/* ---------------------------------------------------------------------------
   B's Workout Plan - design system
   Dark UI, aquamarine 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: #7fffd4;
	--accent-soft: rgba(127, 255, 212, 0.1);
	--accent-border: rgba(127, 255, 212, 0.35);

	/* phase tones */
	--tone-prep: #8fb8f2;
	--tone-prep-bg: rgba(96, 143, 214, 0.14);
	--tone-hyper: #c3a8f7;
	--tone-hyper-bg: rgba(151, 111, 233, 0.14);
	--tone-strength: #7fffd4;
	--tone-strength-bg: rgba(127, 255, 212, 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(127, 255, 212, 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;
}

/* --------------------------------------------------------------------------
   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(127, 255, 212, 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;
}

.badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.4rem 0.85rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--surface);
	font-size: 0.85rem;
	font-weight: 400;
	color: var(--muted);
	white-space: nowrap;
}

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

.chip.tone-prep {
	color: var(--tone-prep);
	background: var(--tone-prep-bg);
	border-color: transparent;
}

.chip.tone-hyper {
	color: var(--tone-hyper);
	background: var(--tone-hyper-bg);
	border-color: transparent;
}

.chip.tone-strength {
	color: var(--tone-strength);
	background: var(--tone-strength-bg);
	border-color: transparent;
}

.chip.tone-power {
	color: var(--tone-power);
	background: var(--tone-power-bg);
	border-color: transparent;
}

.chip.tone-rest {
	color: var(--tone-rest);
	background: var(--tone-rest-bg);
	border-color: transparent;
}

.progress {
	margin-top: 1.75rem;
	max-width: 420px;
}

.progress-bar {
	height: 6px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
}

.progress-fill {
	display: block;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: var(--accent);
	transition: width 0.35s ease;
}

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

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

.progress.complete .progress-fill {
	box-shadow: 0 0 14px rgba(127, 255, 212, 0.55);
}

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

.ghost-btn {
	margin-top: 1.1rem;
	font: inherit;
	font-size: 0.85rem;
	color: var(--muted);
	background: transparent;
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0.4rem 1rem;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.ghost-btn:hover {
	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);
	}
}

.goal-card img {
	width: 72px;
	height: 72px;
	flex-shrink: 0;
	object-fit: cover;
	border-radius: var(--radius-sm);
}

.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 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(127, 255, 212, 0.075), rgba(127, 255, 212, 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(127, 255, 212, 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-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;
}

.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.85rem;
	padding: 0.4rem 1rem;
	border-radius: 999px;
	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;
	}
}
