/* ---------------------------------------------------------------------------
   F's Workout Plan - design system
   Dark UI, violet accent, Rubik for text, Major Mono Display for the brand.
--------------------------------------------------------------------------- */

:root {
	--bg: #131316;
	--surface: #1c1c20;
	--surface-2: #232329;
	--border: rgba(255, 255, 255, 0.08);
	--border-strong: rgba(255, 255, 255, 0.16);
	--text: #f5f5f7;
	--muted: #a3a3ad;
	--faint: #6e6e78;
	--accent: #a882ff;
	--accent-soft: rgba(168, 130, 255, 0.1);
	--accent-border: rgba(168, 130, 255, 0.35);

	/* phase tones */
	--tone-prep: #8fb8f2;
	--tone-prep-bg: rgba(96, 143, 214, 0.14);
	--tone-hyper: #5fd9c0;
	--tone-hyper-bg: rgba(95, 217, 192, 0.14);
	--tone-strength: #a882ff;
	--tone-strength-bg: rgba(168, 130, 255, 0.1);
	--tone-power: #ffbd85;
	--tone-power-bg: rgba(255, 158, 88, 0.13);
	--tone-rest: #b9b9c2;
	--tone-rest-bg: rgba(255, 255, 255, 0.07);

	--nav-h: 4rem;
	--radius: 14px;
	--radius-sm: 8px;
	--font-body: "Rubik", system-ui, -apple-system, sans-serif;
	--font-mono: "Major Mono Display", monospace;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	color-scheme: dark;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--nav-h) + 1rem);
	-webkit-text-size-adjust: 100%;
}

body {
	font-family: var(--font-body);
	font-weight: 300;
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: rgba(168, 130, 255, 0.25);
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 4px;
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

img {
	display: block;
	max-width: 100%;
}

ul {
	list-style: none;
}

.mono {
	font-family: var(--font-mono);
}

.skip-link {
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 200;
	padding: 0.6rem 1rem;
	border-radius: var(--radius-sm);
	background: var(--accent);
	color: #0d0d0f;
	font-weight: 500;
	transform: translateY(-160%);
	transition: transform 0.2s ease;
}

.skip-link:focus {
	transform: translateY(0);
	outline: none;
	text-decoration: none;
}

.container {
	max-width: 1060px;
	margin-inline: auto;
	padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.container-narrow {
	max-width: 800px;
}

.program-container {
	max-width: 1360px;
}

/* --------------------------------------------------------------------------
   Entry gate
-------------------------------------------------------------------------- */

.gate {
	position: fixed;
	inset: 0;
	z-index: 400;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background: rgba(19, 19, 22, 0.8);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: opacity 0.3s ease;
}

.gate.away {
	opacity: 0;
	pointer-events: none;
}

body:has(.gate:not(.away)) {
	overflow: hidden;
}

.gate-card {
	width: min(92vw, 340px);
	padding: 1.5rem;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
	text-align: center;
}

.gate.shake .gate-card {
	animation: gate-shake 0.3s ease;
}

@keyframes gate-shake {
	25% {
		transform: translateX(-7px);
	}
	75% {
		transform: translateX(7px);
	}
}

.gate-brand {
	color: var(--accent);
	font-size: 0.85rem;
	margin-bottom: 1rem;
}

.gate-hint {
	color: var(--muted);
	font-size: 0.95rem;
	margin-bottom: 1.1rem;
}

#gateForm {
	display: flex;
	gap: 0.5rem;
}

.max-input.gate-input {
	flex: 1;
	min-width: 0;
	text-align: left;
}

.gate-btn {
	flex-shrink: 0;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	padding: 0.45rem 1.1rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--accent-border);
	background: var(--accent-soft);
	color: var(--accent);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.gate-btn:hover {
	background: rgba(168, 130, 255, 0.18);
}

.gate-error {
	margin-top: 0.8rem;
	font-size: 0.85rem;
	color: #f87171;
}

/* --------------------------------------------------------------------------
   Navigation
-------------------------------------------------------------------------- */

.site-nav {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 100;
	transition: background-color 0.3s ease, border-color 0.3s ease;
	border-bottom: 1px solid transparent;
}

.site-nav.scrolled {
	background: rgba(19, 19, 22, 0.8);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-bottom-color: var(--border);
}

.nav-inner {
	height: var(--nav-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.wordmark {
	font-family: var(--font-mono);
	font-size: 1.05rem;
	color: var(--text);
	white-space: nowrap;
}

.wordmark:hover {
	text-decoration: none;
	color: var(--accent);
}

.wordmark-short {
	display: none;
}

.nav-links {
	display: flex;
	align-items: center;
	gap: clamp(0.9rem, 3vw, 1.75rem);
}

.nav-links a {
	color: var(--muted);
	font-size: 0.95rem;
	font-weight: 400;
	padding: 0.35rem 0.1rem;
	border-bottom: 1px solid transparent;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover {
	color: var(--text);
	text-decoration: none;
}

.nav-links a.active {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Hero - today's status
-------------------------------------------------------------------------- */

.hero {
	padding-top: calc(var(--nav-h) + clamp(3.5rem, 12vh, 7rem));
	padding-bottom: clamp(2.5rem, 7vh, 4.5rem);
	background:
		radial-gradient(ellipse 60% 50% at 15% 0%, rgba(168, 130, 255, 0.07), transparent 70%),
		radial-gradient(ellipse 50% 40% at 90% 20%, rgba(151, 111, 233, 0.06), transparent 70%);
}

.hero-date {
	color: var(--accent);
	font-size: clamp(0.8rem, 2.4vw, 0.95rem);
	letter-spacing: 0.08em;
	margin-bottom: 1rem;
}

.hero-title {
	font-size: clamp(2.1rem, 7vw, 3.6rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.1;
	margin-bottom: 0.9rem;
}

.hero-note {
	color: var(--muted);
	font-size: clamp(1rem, 2.6vw, 1.15rem);
	max-width: 46ch;
	margin-bottom: 1.75rem;
}

/* Hero stat strip: label-over-value columns split by hairlines - reads like
   instrumentation, matching the macro map's mono micro-label language. */
.badges {
	display: flex;
	flex-wrap: wrap;
	row-gap: 0.9rem;
}

.hero-stat {
	display: flex;
	flex-direction: column;
	gap: 0.32rem;
	padding: 0.1rem 1.15rem;
	border-left: 1px solid var(--border);
}

.hero-stat:first-child {
	padding-left: 0;
	border-left: 0;
}

.stat-label {
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

.stat-value {
	font-size: 0.98rem;
	font-weight: 600;
	color: var(--text);
	white-space: nowrap;
}

@media (max-width: 480px) {
	.hero-stat {
		padding: 0.1rem 0.8rem;
	}
}

/* Session progress: one skewed tick per core exercise, lighting up as lifts
   are checked off - a rep counter, not a loading bar. */
.progress {
	margin-top: 1.75rem;
	max-width: 420px;
}

.progress-bar {
	display: flex;
	gap: 6px;
	height: 12px;
	padding: 1px 4px;
}

.progress-seg {
	flex: 1;
	min-width: 0;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 2px;
	transform: skewX(-16deg);
	transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.progress-seg.on {
	background: var(--accent);
	border-color: transparent;
	box-shadow: 0 0 9px rgba(168, 130, 255, 0.35);
}

.progress-label {
	margin-top: 0.55rem;
	font-size: 0.85rem;
	color: var(--muted);
}

.progress-label strong {
	color: var(--text);
	font-weight: 500;
}

.progress.complete .progress-seg.on {
	box-shadow: 0 0 14px rgba(168, 130, 255, 0.55);
}

.progress.complete .progress-label,
.progress.complete .progress-label strong {
	color: var(--accent);
}

/* Action buttons: compact uppercase micro-type on sharp rectangles - the
   same instrument language as the cell labels, not generic pills. */
.ghost-btn {
	margin-top: 1.1rem;
	font: inherit;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	background: transparent;
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 0.5rem 0.85rem;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.ghost-btn:hover {
	background: var(--surface-2);
	color: var(--text);
	border-color: var(--border-strong);
}

/* --------------------------------------------------------------------------
   Sections
-------------------------------------------------------------------------- */

.section {
	padding-block: clamp(3rem, 9vh, 5.5rem);
}

.section-head {
	margin-bottom: clamp(1.75rem, 5vh, 2.75rem);
}

.eyebrow {
	color: var(--accent);
	font-size: 0.8rem;
	letter-spacing: 0.12em;
	margin-bottom: 0.75rem;
}

.section-head h2 {
	font-size: clamp(1.55rem, 4.2vw, 2.15rem);
	font-weight: 600;
	letter-spacing: -0.015em;
	margin-bottom: 0.5rem;
}

.section-sub {
	color: var(--muted);
	font-size: 1rem;
	max-width: 60ch;
}

/* --------------------------------------------------------------------------
   Goals
-------------------------------------------------------------------------- */

.goal-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 0.9rem;
}

.goal-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.goal-open {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	padding: 0.9rem;
	background: none;
	border: 0;
	border-radius: inherit;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
	.goal-card:hover {
		border-color: var(--accent-border);
		transform: translateY(-2px);
		box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
	}
}

/* Text-only targets: keep the card height the artwork used to give, and mark
   an unfilled slot as an invitation rather than something broken. */
.goal-open {
	min-height: 90px;
}

.goal-card.empty {
	border-style: dashed;
}

/* No artwork to sit beside, so the text carries the card: centre it both ways
   and every slot reads the same whether filled or still empty. */
.goal-open {
	justify-content: center;
	text-align: center;
}

.goal-empty-title {
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--accent);
}

.goal-card.empty .goal-target {
	color: var(--faint);
}

.goal-form {
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
}

.goal-field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.goal-field span {
	font-size: 0.66rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--faint);
}

.goal-field input {
	width: 100%;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	color: var(--text);
	font: inherit;
	font-size: 0.95rem;
}

.goal-field input:focus {
	outline: none;
	border-color: var(--accent-border);
}

.goal-field input[aria-invalid="true"] {
	border-color: rgba(248, 113, 113, 0.6);
}

.goal-check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	color: var(--muted);
	cursor: pointer;
}

.goal-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem;
	margin-top: 0.2rem;
}

.goal-actions .ghost-btn {
	margin-top: 0;
}

.goal-body {
	min-width: 0;
}

.goal-body h3 {
	font-size: 1.02rem;
	font-weight: 500;
	line-height: 1.3;
	margin-bottom: 0.35rem;
}

.goal-target {
	display: inline-block;
	font-size: 0.8rem;
	color: var(--accent);
	background: var(--accent-soft);
	padding: 0.15rem 0.6rem;
	border-radius: 999px;
}

.goal-card.deferred {
	opacity: 0.5;
}

.goal-card.deferred .goal-target {
	color: var(--muted);
	background: var(--tone-rest-bg);
}

.goal-defer {
	display: inline-block;
	margin-left: 0.4rem;
	font-size: 0.72rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--faint);
}

/* --------------------------------------------------------------------------
   Goal animation modal
-------------------------------------------------------------------------- */

.goal-modal {
	margin: auto;
	width: min(92vw, 400px);
	padding: 1.1rem;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.goal-modal::backdrop {
	background: rgba(10, 10, 12, 0.65);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

.goal-modal[open] {
	animation: modal-in 0.22s ease;
}

@keyframes modal-in {
	from {
		opacity: 0;
		transform: scale(0.94) translateY(8px);
	}
}

.goal-modal-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.9rem;
}

.goal-modal-head h3 {
	font-size: 1.1rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	margin-bottom: 0.4rem;
}

.modal-close {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: none;
	color: var(--muted);
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.modal-close:hover {
	color: var(--text);
	border-color: var(--border-strong);
}

.anim-stage {
	border-radius: 10px;
	overflow: hidden;
}

.anim-stage svg,
.anim-video {
	display: block;
	width: 100%;
	height: auto;
}

/* clips have their background crushed to pure black; screen-blending them
   makes the black transparent so the silhouette floats on the dialog */
.anim-video {
	mix-blend-mode: screen;
}

/* --------------------------------------------------------------------------
   Workout blocks + checklists
-------------------------------------------------------------------------- */

.blocks {
	display: grid;
	gap: 1rem;
}

.block {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

.block-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	padding: 1.05rem 1.25rem;
	border-bottom: 1px solid var(--border);
}

.block-head h3 {
	font-size: 1.05rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.block-meta {
	font-size: 0.82rem;
	color: var(--muted);
}

.block-note {
	padding: 0.9rem 1.25rem 0;
	color: var(--muted);
	font-size: 0.95rem;
}

.block-note:last-child {
	padding-bottom: 1.05rem;
}

.checklist li + li {
	border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.paired-row {
	position: relative;
	background:
		linear-gradient(90deg, rgba(168, 130, 255, 0.075), rgba(168, 130, 255, 0.025) 48%, transparent 100%),
		var(--surface);
}

.paired-row::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 3px;
	background: var(--accent);
	opacity: 0.65;
}

.paired-row.pair-start::before {
	border-top-right-radius: 3px;
}

.paired-row.pair-end::before {
	border-bottom-right-radius: 3px;
}

.paired-row.pair-end {
	border-top-color: rgba(168, 130, 255, 0.15);
}

.check {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.7rem 1.25rem;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.check.has-pair {
	gap: 0.65rem;
}

@media (hover: hover) {
	.check:hover {
		background: rgba(255, 255, 255, 0.03);
	}
}

.check input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.check .box {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	border-radius: 6px;
	border: 1.5px solid var(--border-strong);
	position: relative;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.check .box::after {
	content: "";
	position: absolute;
	left: 4px;
	top: 5px;
	width: 9px;
	height: 5px;
	border-left: 2px solid #102a22;
	border-bottom: 2px solid #102a22;
	transform: rotate(-45deg);
	opacity: 0;
	transition: opacity 0.15s ease;
}

.check input:checked + .box {
	background: var(--accent);
	border-color: var(--accent);
}

.check input:checked + .box::after {
	opacity: 1;
}

.check input:focus-visible + .box {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.pair-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	min-width: 2.1rem;
	height: 1.35rem;
	padding-inline: 0.45rem;
	border: 1px solid var(--accent-border);
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1;
}

.check-text {
	min-width: 0;
	font-size: 1rem;
	font-weight: 400;
	transition: color 0.15s ease;
}

.check input:checked ~ .check-text {
	color: var(--faint);
	text-decoration: line-through;
	text-decoration-color: rgba(255, 255, 255, 0.3);
}

.note-item {
	padding: 0.7rem 1.25rem;
	color: var(--faint);
	font-size: 0.95rem;
}

.block-foot {
	padding: 0.8rem 1.25rem;
	border-top: 1px dashed var(--border);
	font-size: 0.8rem;
	color: var(--faint);
}

/* collapsible blocks */

details.block > summary {
	list-style: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

details.block > summary::-webkit-details-marker {
	display: none;
}

details.block > summary .block-head {
	border-bottom: none;
}

details.block[open] > summary .block-head {
	border-bottom: 1px solid var(--border);
}

details.block > summary .block-meta::after {
	content: " +";
	color: var(--accent);
}

details.block[open] > summary .block-meta::after {
	content: " \2212";
}

/* --------------------------------------------------------------------------
   Program overview
-------------------------------------------------------------------------- */

.phase-guide {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
	gap: 1rem;
}

.phase-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.05rem;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.65rem;
	min-height: 100%;
}

.phase-name {
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.phase-blurb {
	font-size: 0.88rem;
	color: var(--muted);
	flex: 1;
}

.phase-meta {
	font-size: 0.78rem;
	color: var(--faint);
}

.program-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	margin-top: 1.1rem;
	overflow: hidden;
}

.program-card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	padding: 1.05rem 1.25rem;
	border-bottom: 1px solid var(--border);
}

.program-card-head h3 {
	font-size: 1.05rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.macro-rows {
	padding: 1.1rem 1.25rem 1.25rem;
	display: grid;
	gap: 1rem;
}

.macro-row {
	display: grid;
	grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr);
	gap: 1rem;
	align-items: center;
}

.macro-label {
	font-size: 0.85rem;
	color: var(--muted);
}

.macro-cells {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 0.65rem;
}

.macro-cell,
.rhythm-day {
	border: 1px solid var(--border);
	background: var(--surface-2);
	border-radius: var(--radius-sm);
	padding: 0.55rem 0.65rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.15rem;
	min-width: 0;
	min-height: 4rem;
	cursor: pointer;
	transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.macro-cell:hover,
.rhythm-day:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.macro-cell:hover:not(.current),
.rhythm-day:hover:not(.today) {
	border-color: var(--border-strong);
}

.macro-cell:focus-visible,
.rhythm-day:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.rhythm-day.deferred {
	opacity: 0.5;
}

.rhythm-day.deferred .cell-value {
	text-decoration: line-through;
}

.rhythm-day.trip .cell-value {
	color: var(--accent);
}

.cell-label {
	font-size: 0.66rem;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--faint);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cell-value {
	font-size: 0.84rem;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.macro-cell.current,
.rhythm-day.today {
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.macro-cell.current .cell-label,
.rhythm-day.today .cell-label {
	color: var(--accent);
}

.tone-text-prep {
	color: var(--tone-prep);
}

.tone-text-hyper {
	color: var(--tone-hyper);
}

.tone-text-strength {
	color: var(--tone-strength);
}

.tone-text-power {
	color: var(--tone-power);
}

.tone-text-rest {
	color: var(--tone-rest);
}

.rhythm {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
	gap: 0.5rem;
	padding: 1.1rem 1.25rem 1.25rem;
}

.maxes-card {
	margin-top: 0;
}

.maxes-list {
	list-style: none;
	padding-top: 0.35rem;
}

.max-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.65rem;
	padding: 0.55rem 1.25rem 0.55rem 0.85rem;
	font-size: 0.95rem;
	transition: transform 0.18s ease;
}

.max-row + .max-row {
	border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.max-row.dragging {
	position: relative;
	z-index: 5;
	background: var(--surface-2);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
	transition: none;
}

.max-drag {
	border: 0;
	background: none;
	color: var(--faint);
	font-size: 0.9rem;
	letter-spacing: -0.05em;
	padding: 0.4rem 0.3rem;
	cursor: grab;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
}

.max-drag:active {
	cursor: grabbing;
}

.max-row.dragging .max-drag {
	color: var(--accent);
}

.max-info {
	min-width: 0;
}

.max-remove,
.max-chart {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: none;
	color: var(--faint);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.max-chart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.max-chart:hover {
	color: var(--accent);
	border-color: var(--accent-border);
}

.max-remove:hover {
	color: #f87171;
	border-color: rgba(248, 113, 113, 0.45);
}

.max-add {
	display: flex;
	gap: 0.5rem;
	padding: 0.8rem 1.25rem 1rem;
	border-top: 1px dashed var(--border);
}

.max-input.max-add-name {
	flex: 1;
	min-width: 0;
	text-align: left;
}

.max-add-name[aria-invalid="true"] {
	border-color: rgba(248, 113, 113, 0.6);
}

.max-add-value {
	width: 6.5rem;
	flex-shrink: 0;
}

.max-add-btn {
	margin-top: 0;
	flex-shrink: 0;
}

.confirm-modal {
	width: min(92vw, 360px);
}

.graph-modal {
	width: min(92vw, 440px);
}

.graph-stage {
	position: relative;
}

.graph-stage svg {
	display: block;
	width: 100%;
	height: auto;
}

.graph-tip {
	position: absolute;
	transform: translateX(-50%);
	padding: 0.25rem 0.6rem;
	border-radius: 8px;
	background: var(--surface-2);
	border: 1px solid var(--border-strong);
	font-size: 0.78rem;
	color: var(--text);
	white-space: nowrap;
	pointer-events: none;
	z-index: 2;
}

.graph-data {
	margin-top: 0.75rem;
}

.graph-data summary {
	cursor: pointer;
	font-size: 0.8rem;
	color: var(--muted);
	-webkit-tap-highlight-color: transparent;
}

.graph-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0.5rem;
}

.graph-table td {
	padding: 0.35rem 0.25rem;
	font-size: 0.85rem;
	color: var(--muted);
}

.graph-table td:last-child {
	text-align: right;
	color: var(--text);
}

.graph-table tr + tr td {
	border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.confirm-text {
	font-size: 1.02rem;
	font-weight: 500;
}

.confirm-sub {
	margin-top: 0.35rem;
	font-size: 0.85rem;
	color: var(--muted);
}

.confirm-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 1.1rem;
}

.confirm-actions .ghost-btn {
	margin-top: 0;
}

.danger-btn {
	font: inherit;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.5rem 0.85rem;
	border-radius: 6px;
	border: 1px solid rgba(248, 113, 113, 0.45);
	background: rgba(248, 113, 113, 0.12);
	color: #f87171;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.danger-btn:hover {
	background: rgba(248, 113, 113, 0.2);
}

.max-name {
	display: block;
}

.max-date {
	display: block;
	margin-top: 0.15rem;
	font-size: 0.72rem;
	letter-spacing: 0.02em;
	color: var(--faint);
}

.max-row.is-custom .max-date {
	color: var(--muted);
}

.max-delta {
	flex-shrink: 0;
	font-size: 0.75rem;
	font-weight: 500;
	padding: 0.15rem 0.55rem;
	border-radius: 999px;
	background: var(--tone-rest-bg);
	color: var(--tone-rest);
	cursor: help;
}

.max-delta.up {
	background: rgba(74, 222, 128, 0.14);
	color: #4ade80;
}

.max-delta.down {
	background: rgba(248, 113, 113, 0.14);
	color: #f87171;
}

.max-controls {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
}

.max-input {
	width: min(9.5rem, 100%);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	color: var(--text);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 400;
	padding: 0.45rem 0.6rem;
	text-align: right;
}

.max-input:focus {
	border-color: var(--accent-border);
	outline: none;
}

.max-reset {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 400;
	padding: 0.45rem 0.65rem;
}

.max-reset:hover:not(:disabled) {
	border-color: var(--border-strong);
	color: var(--text);
}

.max-reset:disabled {
	cursor: default;
	opacity: 0.35;
}

/* --------------------------------------------------------------------------
   Footer
-------------------------------------------------------------------------- */

.site-footer {
	border-top: 1px solid var(--border);
	padding: 2rem 0 2.5rem;
}

.footer-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 2rem;
	justify-content: space-between;
	align-items: baseline;
	color: var(--muted);
	font-size: 0.9rem;
}

.footer-inner .mono {
	font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Responsive
-------------------------------------------------------------------------- */

@media (max-width: 900px) {
	.program-card-head {
		align-items: flex-start;
		flex-direction: column;
	}

	.macro-row {
		grid-template-columns: 1fr;
		gap: 0.55rem;
	}

	.macro-cells {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0.5rem;
	}

	.macro-cell,
	.rhythm-day {
		min-height: 3.75rem;
		padding: 0.5rem 0.55rem;
	}

	.rhythm-day {
		padding-inline: 0.45rem;
	}

	.rhythm-day .cell-label {
		letter-spacing: 0;
	}
}

@media (max-width: 360px) {
	.macro-cells {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 420px) {
	.wordmark {
		font-size: 0.9rem;
	}

	.nav-links {
		gap: 0.55rem;
	}

	.nav-links a {
		font-size: 0.78rem;
	}
}

@media (max-width: 370px) {
	.wordmark {
		display: none;
	}

	.nav-inner {
		justify-content: center;
	}
}

@media (max-width: 380px) {
	.macro-cell,
	.rhythm-day {
		padding: 0.45rem 0.4rem;
	}

	.cell-value {
		font-size: 0.74rem;
	}

	.cell-label {
		font-size: 0.6rem;
	}
}

@media (max-width: 600px) {
	.wordmark-full {
		display: none;
	}

	.wordmark-short {
		display: inline;
	}

	.nav-links a {
		font-size: 0.9rem;
	}

	.check.has-pair {
		display: grid;
		grid-template-columns: 20px auto minmax(0, 1fr);
		column-gap: 0.65rem;
	}

	.pair-badge {
		min-width: 2rem;
		padding-inline: 0.4rem;
	}

	.goal-grid {
		grid-template-columns: 1fr;
	}

	.phase-guide {
		grid-template-columns: 1fr;
	}

	.block-head,
	.check,
	.note-item,
	.block-note,
	.block-foot,
	.program-card-head,
	.macro-rows,
	.rhythm {
		padding-inline: 1rem;
	}

	.max-row {
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-areas:
			"drag info"
			"drag controls";
		row-gap: 0.45rem;
		padding: 0.7rem 1rem 0.7rem 0.6rem;
	}

	.max-drag {
		grid-area: drag;
	}

	.max-info {
		grid-area: info;
	}

	.max-controls {
		grid-area: controls;
		justify-content: stretch;
	}

	.max-input {
		flex: 1;
		min-width: 0;
		text-align: left;
		width: auto;
	}

	.max-reset,
	.max-remove {
		flex-shrink: 0;
	}

	.max-add {
		flex-wrap: wrap;
		padding-inline: 1rem;
	}

	.max-input.max-add-name {
		flex-basis: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

/* --------------------------------------------------------------------------
   Exercise results
   Goal-block rows log how an item actually went; a modal captures the detail.
-------------------------------------------------------------------------- */

.checklist li.has-result {
	display: flex;
	align-items: center;
}

.has-result .check {
	flex: 1 1 auto;
	min-width: 0;
}

.result-btn {
	flex: 0 0 auto;
	margin-right: 1.25rem;
	font: inherit;
	font-size: 0.72rem;
	line-height: 1;
	color: var(--faint);
	background: transparent;
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.3rem 0.65rem;
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.result-btn:hover {
	color: var(--text);
	border-color: var(--border-strong);
}

.result-btn.set {
	color: var(--tone-power);
	border-color: rgba(255, 158, 88, 0.35);
	background: var(--tone-power-bg);
}

.result-btn.set.full {
	color: var(--accent);
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.result-btn.set.skip {
	color: var(--tone-rest);
	border-color: var(--border-strong);
	background: var(--tone-rest-bg);
}

.result-btn.set.over {
	color: var(--accent);
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.status-skip .check input:checked + .box {
	background: transparent;
	border-color: var(--border-strong);
}

.status-skip .check input:checked + .box::after {
	content: "\00d7";
	border: 0;
	width: auto;
	height: auto;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -54%);
	color: var(--faint);
	font-size: 0.95rem;
	line-height: 1;
}

.status-partial .check input:checked + .box {
	background: var(--tone-power);
	border-color: var(--tone-power);
}

.check-note {
	/* inline-block keeps the row's line-through from striking the note */
	display: inline-block;
	width: 100%;
	font-size: 0.78rem;
	color: var(--faint);
	margin-top: 0.15rem;
	white-space: pre-wrap;
}

.result-modal {
	width: min(92vw, 380px);
}

.result-options {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	margin-bottom: 0.9rem;
}

.result-options label {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.5rem 0.65rem;
	border-radius: var(--radius-sm);
	cursor: pointer;
	color: var(--muted);
	transition: background-color 0.15s ease, color 0.15s ease;
}

.result-options label:hover,
.result-options label:has(input:checked) {
	background: var(--surface-2);
	color: var(--text);
}

.result-options input {
	accent-color: var(--accent);
	width: 1rem;
	height: 1rem;
}

.result-note {
	width: 100%;
	font: inherit;
	font-size: 0.9rem;
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	padding: 0.55rem 0.7rem;
	resize: vertical;
	min-height: 2.6rem;
}

.result-note:focus {
	outline: none;
	border-color: var(--accent-border);
}

.result-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.6rem;
	margin-top: 0.9rem;
}

.result-actions .ghost-btn {
	margin-top: 0;
	margin-right: auto;
}

/* --------------------------------------------------------------------------
   Coach overlay
   Adjusted prescriptions carry a quiet dotted accent underline; one faint
   line under the session header carries the review summary. Minimal by intent.
-------------------------------------------------------------------------- */

.session-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.check-text.adjusted {
	text-decoration: underline dotted;
	text-decoration-color: var(--accent-border);
	text-underline-offset: 4px;
	text-decoration-thickness: 1.5px;
}

/* Once ticked, completion styling (line-through) takes over; keep the accent
   hint via color only so the row doesn't look doubly decorated. */
.check input:checked ~ .check-text.adjusted {
	text-decoration-line: line-through;
	text-decoration-color: rgba(255, 255, 255, 0.3);
}

.coach-line {
	margin: 0 0 0.5rem;
	padding: 0.7rem 1.1rem;
	background: var(--accent-soft);
	border: 1px solid var(--accent-border);
	border-radius: var(--radius-sm);
	color: var(--text);
	font-size: 0.9rem;
	line-height: 1.5;
}

.coach-line .coach-tag {
	color: var(--accent);
	font-size: 0.7rem;
	letter-spacing: 0.06em;
	text-transform: lowercase;
}

.coach-line.error {
	background: var(--tone-rest-bg);
	border-color: var(--border-strong);
	color: var(--muted);
}

.coach-line.error .coach-tag {
	color: var(--faint);
}

/* --------------------------------------------------------------------------
   Exercise how-to video
   A compact play affordance per exercise row; the clip opens in an on-page
   dialog with a responsive 16:9 embed.
-------------------------------------------------------------------------- */

.checklist li.has-video {
	display: flex;
	align-items: center;
}

.has-video .check {
	flex: 1 1 auto;
	min-width: 0;
}

.video-btn {
	flex: 0 0 auto;
	margin-right: 1.25rem;
	width: 1.9rem;
	height: 1.9rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding-left: 0.12rem; /* optical-center the triangle */
	font-size: 0.6rem;
	color: var(--muted);
	background: transparent;
	border: 1px solid var(--border);
	border-radius: 999px;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.video-btn:hover {
	color: var(--accent);
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.video-modal {
	width: min(94vw, 640px);
}

.video-frame {
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.video-frame iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Macrocycle week peek: what the phase is, then the week day by day. */
.week-modal {
	width: min(94vw, 460px);
}

.week-phase {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	padding: 0.75rem 0.85rem;
	margin-bottom: 0.9rem;
}

.week-phase-name {
	font-size: 0.68rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	margin-bottom: 0.4rem;
}

.week-phase-blurb {
	font-size: 0.9rem;
	line-height: 1.5;
}

.week-phase-meta {
	margin-top: 0.45rem;
	font-size: 0.75rem;
	color: var(--faint);
}

.week-days {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.week-day {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.45rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: var(--surface-2);
}

.week-day.today {
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.week-day.deferred {
	opacity: 0.55;
}

.week-day.deferred .week-day-what {
	text-decoration: line-through;
}

.week-day-when {
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	white-space: nowrap;
}

.week-day.today .week-day-when {
	color: var(--accent);
}

.week-day-what {
	font-size: 0.88rem;
	font-weight: 500;
	text-align: right;
}

.week-foot {
	margin-top: 0.9rem;
	font-size: 0.72rem;
	line-height: 1.4;
	color: var(--faint);
}

/* Weekly-rhythm day-peek popup: just the core work for the tapped day. */
.rhythm-modal {
	width: min(94vw, 460px);
}

.rhythm-plan-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.rhythm-plan-item {
	border: 1px solid var(--border);
	background: var(--surface-2);
	border-radius: var(--radius-sm);
	padding: 0.6rem 0.7rem;
}

.rhythm-plan-row {
	display: flex;
	align-items: baseline;
	gap: 0.55rem;
}

.rhythm-plan-badge {
	flex-shrink: 0;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--accent);
	background: var(--accent-soft);
	border: 1px solid var(--accent-border);
	border-radius: 6px;
	padding: 0.05rem 0.4rem;
}

.rhythm-plan-name {
	font-size: 0.92rem;
	line-height: 1.35;
}

.rhythm-plan-coach {
	margin-top: 0.4rem;
	font-size: 0.8rem;
	line-height: 1.4;
	color: var(--muted);
}

.rhythm-plan-coach .coach-tag {
	color: var(--accent);
	letter-spacing: 0.06em;
	text-transform: lowercase;
}

.rhythm-plan-foot {
	margin-top: 0.85rem;
	font-size: 0.72rem;
	line-height: 1.4;
	color: var(--faint);
}

.rhythm-empty {
	font-size: 0.92rem;
	line-height: 1.45;
	color: var(--muted);
}

.rhythm-defer {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 0.9rem;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--border);
}

.rhythm-defer-when {
	font-size: 0.8rem;
	color: var(--muted);
}

.rhythm-defer-rel {
	color: var(--text);
	font-weight: 600;
}

.rhythm-defer-note {
	font-size: 0.85rem;
	line-height: 1.4;
	color: var(--muted);
}

.rhythm-defer-row {
	display: flex;
	align-items: stretch;
	gap: 0.5rem;
}

.rhythm-defer-row .rhythm-defer-reason {
	flex: 1;
	min-width: 0;
}

.rhythm-defer-row .rhythm-defer-btn {
	flex-shrink: 0;
}

.rhythm-defer-reason {
	width: 100%;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	color: var(--text);
	font: inherit;
	font-size: 0.9rem;
}

.rhythm-defer-reason::placeholder {
	color: var(--faint);
}

.rhythm-defer-reason:focus {
	outline: none;
	border-color: var(--accent-border);
}

.rhythm-defer-btn {
	margin-top: 0;
	align-self: flex-start;
}

.rhythm-defer-help {
	font-size: 0.75rem;
	line-height: 1.4;
	color: var(--faint);
}

/* 05 · coach - the standing note from the latest review. */
.coach-card {
	padding: 1.4rem 1.5rem 1.3rem;
}

.coach-message {
	font-size: 1.02rem;
	line-height: 1.6;
	max-width: 58ch;
}

.coach-note-line {
	display: block;
}

.coach-note-line + .coach-note-line {
	margin-top: 0.55em;
}

.coach-meta {
	margin-top: 0.9rem;
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: lowercase;
	color: var(--faint);
}

/* Card micro-label, and the "tell the coach" channel. */
.coach-card-label {
	font-size: 0.66rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 0.7rem;
}

.coach-tell {
	padding: 1.4rem 1.5rem 1.5rem;
}

.coach-tell-hint {
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--muted);
	max-width: 58ch;
	margin-bottom: 1rem;
}

.coach-note-text {
	width: 100%;
	padding: 0.7rem 0.8rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	color: var(--text);
	font: inherit;
	font-size: 0.92rem;
	line-height: 1.5;
	resize: vertical;
}

.coach-note-text:focus {
	outline: none;
	border-color: var(--accent-border);
}

.coach-note-text[aria-invalid="true"] {
	border-color: rgba(248, 113, 113, 0.6);
}

.coach-note-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	margin-top: 0.7rem;
}

.coach-note-date {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--faint);
}

.coach-note-date input {
	font: inherit;
	font-size: 0.85rem;
	color: var(--text);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 0.35rem 0.5rem;
	color-scheme: dark;
}

.coach-note-row .gate-btn {
	margin-left: auto;
}

.coach-note-list {
	list-style: none;
	margin-top: 1.1rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.coach-note-empty {
	font-size: 0.85rem;
	color: var(--faint);
}

.coach-note {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface-2);
	padding: 0.65rem 0.8rem;
}

.coach-note-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.35rem;
}

.coach-note-range {
	font-size: 0.66rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--accent);
}

.coach-note-remove {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	line-height: 1;
	border: 1px solid var(--border);
	border-radius: 6px;
	background: none;
	color: var(--muted);
	font-size: 1rem;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.coach-note-remove:hover {
	color: var(--text);
	border-color: var(--border-strong);
}

.coach-note-body {
	font-size: 0.9rem;
	line-height: 1.5;
	white-space: pre-wrap;
}

.rhythm-plan-coachnote {
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--muted);
	margin-bottom: 0.7rem;
}

.rhythm-plan-coachnote .coach-tag {
	color: var(--accent);
	letter-spacing: 0.06em;
	text-transform: lowercase;
}

/* The "train today after all" undo button - a primary action on a deferred
   day, so it stands out from the neutral ghost buttons. */
.ghost-btn.accent-btn {
	color: var(--accent);
	border-color: var(--accent-border);
	background: var(--accent-soft);
}

.ghost-btn.accent-btn:hover {
	color: var(--accent);
	border-color: var(--accent);
	background: rgba(168, 130, 255, 0.18);
}
