:root {
	color-scheme: light;
	--canvas: oklch(96.7% 0.011 151);
	--surface: oklch(99.5% 0.003 151);
	--surface-soft: oklch(93.8% 0.018 151);
	--surface-strong: oklch(89.7% 0.029 151);
	--ink: oklch(26% 0.031 153);
	--ink-soft: oklch(40% 0.025 151);
	--muted-ink: oklch(45% 0.018 151);
	--line: oklch(83% 0.018 151);
	--control-line: oklch(62% 0.028 151);
	--brand: oklch(43% 0.082 151);
	--brand-hover: oklch(36% 0.075 151);
	--brand-soft: oklch(91% 0.038 151);
	--brand-ink: oklch(33% 0.066 151);
	--error: oklch(44% 0.14 25);
	--error-soft: oklch(96% 0.02 25);
	--warning: oklch(42% 0.095 70);
	--warning-soft: oklch(94% 0.035 70);
	color: var(--ink);
	background: var(--canvas);
}
body {
	color: var(--ink);
	background:
		radial-gradient(
			circle at 88% 0,
			oklch(91% 0.04 151 / 0.65),
			transparent 34%
		),
		var(--canvas);
}
h1,
h2,
h3 {
	color: var(--ink);
}
p,
.muted,
.small {
	color: var(--muted-ink);
}
.top {
	border-color: var(--line);
}
.header-logo,
.auth-logo,
.admin-auth-logo {
	border: 1px solid oklch(36% 0.035 151);
	box-shadow: 0 10px 26px oklch(26% 0.031 153 / 0.13);
}
.top-right,
.footer {
	color: var(--muted-ink);
}
.brand,
.eyebrow,
.calendar-grid > strong,
.coach-notice,
.update-item.unread,
.admin-login-link,
.image-credits a,
.image-credits summary {
	color: var(--brand-ink);
}
.nav button {
	color: var(--ink-soft);
}
.nav button.active {
	background: var(--brand-soft);
	border-color: var(--line);
	color: var(--brand-ink);
}
.ghost,
.routine-picker button,
.timer-select select {
	background: var(--surface);
	border-color: var(--control-line);
	color: var(--ink);
}
.ghost:hover:not(:disabled),
.nav button:hover:not(.active):not(:disabled),
.routine-picker button:hover:not(.active):not(:disabled) {
	background: var(--brand-soft);
	border-color: var(--brand);
	color: var(--brand-ink);
}
.primary,
.routine-picker button.active {
	background: var(--brand);
	border-color: var(--brand);
	color: white;
}
.primary:hover:not(:disabled) {
	background: var(--brand-hover);
}
.danger {
	background: var(--error-soft);
	color: var(--error);
	border: 1px solid oklch(82% 0.06 25);
}
:where(button, a, input, select, textarea):focus-visible {
	outline-color: var(--brand);
}
.card,
.auth-card {
	background: var(--surface);
	border-color: var(--line);
	box-shadow: 0 8px 30px oklch(26% 0.031 153 / 0.045);
}
.hero {
	background: linear-gradient(
		115deg,
		oklch(37% 0.075 151),
		oklch(48% 0.075 151)
	);
	border-color: oklch(40% 0.07 151);
	box-shadow: 0 14px 34px oklch(28% 0.06 151 / 0.18);
}
.hero h1,
.hero p,
.hero .eyebrow,
.hero .elapsed-label {
	color: white;
}
.hero .primary {
	background: oklch(90% 0.075 151);
	color: var(--brand-ink);
}
.hero .primary:hover:not(:disabled) {
	background: white;
}
.hero .ghost {
	background: transparent;
	border-color: oklch(90% 0.025 151);
	color: white;
}
.hero .ghost:hover:not(:disabled) {
	background: oklch(100% 0 0 / 0.15);
}
.weekly-goal {
	background: linear-gradient(150deg, var(--surface), var(--brand-soft));
}
.weekly-goal .stat,
.weekly-goal .stat span {
	color: var(--brand-ink);
}
.weekly-goal .stat span {
	opacity: 0.67;
}
.exercise-toggle,
.trainee-choice {
	color: var(--ink);
}
.exercise-toggle:hover,
.trainee-choice:hover:not(:disabled) {
	background: var(--surface-soft);
}
.exercise-copy small,
.exercise-toggle small,
.set-group-fields label,
.editor-head,
.drag-handle,
.coach-stats span,
.weekly-bar,
.empty {
	color: var(--muted-ink);
}
.exercise-thumb {
	border-color: var(--line);
}
.exercise-placeholder {
	background: var(--brand-soft);
	color: var(--brand-ink);
}
.exercise-details,
.exercise,
.set-row,
.coach-exercise,
.history-item,
.image-credits {
	border-color: var(--line);
}
.swap-panel {
	background: var(--surface-soft);
	border-color: var(--line);
}
.pill,
.admin-tag {
	background: var(--brand-soft);
	border-color: var(--line);
	color: var(--brand-ink);
}
.last-performance,
.set-index,
.recap-records,
.suggested-weight,
.inline-saved {
	color: var(--brand-ink);
}
.set-more summary,
.exercise-menu summary {
	color: var(--ink-soft);
}
.field-error,
.account-danger-zone h2 {
	color: var(--error);
}
.account-danger-zone {
	border-color: oklch(82% 0.06 25);
}
.field {
	color: var(--ink-soft);
}
.quick-field-heading {
	color: var(--ink-soft);
}
.quick-field-heading span {
	color: var(--muted-ink);
}
.set-row input,
.set-row select,
.editor-row input,
.field input,
.field select,
.field textarea,
.history-set-form input,
.history-set-form select {
	background: white;
	border-color: var(--control-line);
	color: var(--ink);
}
input::placeholder,
textarea::placeholder {
	color: var(--muted-ink);
}
input:hover,
select:hover,
textarea:hover {
	border-color: var(--brand);
}
.message {
	background: var(--error-soft);
	border-color: oklch(82% 0.06 25);
	color: var(--error);
}
.message.success,
.admin-success {
	background: var(--brand-soft);
	border-color: var(--line);
	color: var(--brand-ink);
}
.undo-toast {
	background: var(--brand);
	border-color: var(--brand-hover);
	color: white;
	box-shadow: 0 12px 28px oklch(25% 0.03 151 / 0.2);
}
.undo-toast .ghost {
	background: white;
}
.calendar-day,
.week-day,
.trainee-choice,
.coach-stats div {
	background: var(--surface-soft);
	border-color: var(--line);
	color: var(--ink);
}
.calendar-day.trained,
.week-day.current,
.trainee-choice.selected {
	border-color: var(--brand);
}
.calendar-day.active {
	background: var(--brand);
	color: white;
}
.trend-track,
.adherence-meter {
	background: var(--surface-strong);
}
.trend-track span,
.adherence-meter span,
.weekly-bar > div {
	background: var(--brand);
}
.weekly-goal .adherence-meter span {
	width: var(--fill, 0%);
	min-width: 0;
}
.timer-display {
	color: var(--brand-ink);
}
.timer-card {
	background: var(--brand-soft);
	border-color: var(--line);
}
.chart-grid {
	stroke: var(--line);
}
.chart-label {
	fill: var(--muted-ink);
}
.chart-line {
	stroke: var(--brand);
}
.chart-dot {
	fill: white;
	stroke: var(--brand);
}
.admin-auth,
.admin-portal {
	background: var(--canvas);
	color: var(--ink);
}
.admin-auth-intro {
	background: linear-gradient(
		145deg,
		var(--brand-soft),
		var(--surface-strong)
	);
	border-color: var(--line);
}
.admin-auth-intro h1,
.admin-auth-intro p,
.admin-member-link {
	color: var(--ink);
}
.admin-auth-card,
.admin-metric,
.admin-panel {
	background: var(--surface);
	border-color: var(--line);
	color: var(--ink);
	box-shadow: 0 8px 30px oklch(26% 0.031 153 / 0.045);
}
.admin-auth-kicker,
.admin-kicker,
.admin-brand,
.admin-panel-heading a,
.admin-panel-heading button {
	color: var(--brand-ink);
}
.admin-sidebar {
	background: var(--surface-soft);
	border-color: var(--line);
}
.admin-sidebar nav button,
.admin-sidebar-footer button,
.admin-sidebar-footer a {
	color: var(--ink-soft);
}
.admin-sidebar nav button:hover,
.admin-sidebar-footer button:hover {
	background: var(--brand-soft);
	color: var(--brand-ink);
}
.admin-sidebar nav button.active {
	background: var(--brand);
	border-color: var(--brand);
	color: white;
}
.admin-sidebar-footer,
.admin-topbar,
.admin-mobile-nav {
	border-color: var(--line);
}
.admin-topbar {
	background: var(--surface);
}
.admin-topbar > div:first-child span,
.admin-identity {
	color: var(--muted-ink);
}
.admin-topbar > div:first-child span {
	border-color: var(--line);
}
.admin-metric > span,
.admin-metric small,
.admin-panel-heading p,
.admin-chart-empty span,
.admin-chart-label,
.admin-quick-links button span,
.admin-audit-row time,
.admin-table td small,
.admin-table .admin-table-empty,
.admin-muted,
.admin-pagination,
.admin-assignment > div span {
	color: var(--muted-ink);
}
.admin-chart,
.admin-chart-empty,
.admin-audit-row,
.admin-table th,
.admin-table td,
.admin-assignment {
	border-color: var(--line);
}
.admin-chart-empty,
.admin-empty,
.admin-inline-stats strong {
	color: var(--ink);
}
.admin-chart-bar {
	background: linear-gradient(var(--brand), var(--brand-hover));
}
.admin-attention-list button,
.admin-quick-links button,
.admin-inline-stats span {
	background: var(--surface-soft);
	border-color: var(--line);
	color: var(--ink);
}
.admin-attention-list button:hover,
.admin-quick-links button:hover {
	background: var(--brand-soft);
	border-color: var(--brand);
}
.admin-attention-list button strong,
.admin-table th,
.admin-audit-dot {
	color: var(--brand-ink);
}
.admin-audit-dot {
	background: var(--brand);
}
.admin-table th {
	background: var(--surface-soft);
}
.admin-status {
	background: var(--surface-soft);
	color: var(--ink-soft);
}
.admin-status.active {
	background: var(--brand-soft);
	color: var(--brand-ink);
}
.admin-status.pending {
	background: var(--warning-soft);
	color: var(--warning);
}
.admin-status.suspended {
	background: var(--error-soft);
	color: var(--error);
}
.admin-mobile-nav button {
	color: var(--ink-soft);
}
.admin-mobile-nav button.active {
	background: var(--brand);
	border-color: var(--brand);
	color: white;
}
@media (max-width: 720px) {
	.nav,
	.nav.coach-nav {
		background: var(--surface);
		border-color: var(--line);
		box-shadow: 0 -8px 24px oklch(26% 0.031 153 / 0.09);
	}
	.timer-card {
		box-shadow: 0 10px 24px oklch(26% 0.031 153 / 0.12);
	}
}

/* M Hamoud: bright training studio, charcoal structure, copper actions. */
:root {
	--canvas: #f6f5f2;
	--surface: #ffffff;
	--surface-soft: #f0efeb;
	--surface-strong: #e5e3dc;
	--ink: #202321;
	--ink-soft: #414540;
	--muted-ink: #666b65;
	--line: #dedfd9;
	--control-line: #9a9e96;
	--brand: #a64b2b;
	--brand-hover: #85391e;
	--brand-soft: #f7ebe3;
	--brand-ink: #873a21;
	font-family: "Barlow", sans-serif;
	font-size: 16px;
}
body {
	background: var(--canvas);
}
h1,
h2,
h3,
.brand,
.mh-brand {
	font-family: "Barlow Condensed", sans-serif;
	letter-spacing: -0.015em;
}
h1 {
	font-size: clamp(2.5rem, 5vw, 3.6rem);
	line-height: 1;
}
h2 {
	font-size: 1.75rem;
}
.eyebrow,
.admin-auth-kicker,
.admin-page-kicker {
	display: none;
}
.shell {
	max-width: 1320px;
	padding-top: 0;
}
.top {
	padding: 18px 0;
	margin-bottom: 0;
	border-bottom: 0;
}
.mh-brand {
	display: flex;
	gap: 13px;
	align-items: center;
	font-size: 1.8rem;
	font-weight: 700;
	color: var(--ink);
}
.mh-brand small {
	display: block;
	font-family: "Barlow", sans-serif;
	font-size: 0.62rem;
	letter-spacing: 0.15em;
	margin-top: 3px;
	color: var(--muted-ink);
}
.logo-crop,
.header-logo,
.auth-logo,
.admin-auth-logo {
	background: #000;
	box-shadow: none;
	border: 0;
}
.logo-crop img,
.header-logo img,
.auth-logo img,
.admin-auth-logo img {
	position: static;
	width: 100%;
	height: 100%;
	object-fit: contain;
	max-width: 100%;
	filter: none;
}
.header-logo {
	width: 64px;
	height: 64px;
	border-radius: 12px;
}
.auth-logo {
	width: 80px;
	height: 80px;
	margin: 0 0 24px;
	border-radius: 12px;
}
.nav,
.nav.coach-nav {
	background: #242825;
	border: 0;
	border-radius: 12px;
	padding: 6px;
	gap: 5px;
	margin: 0 0 30px;
}
.nav button {
	color: #e2e5df;
	font-weight: 600;
	padding: 13px 20px;
	border-radius: 8px;
}
.nav button.active {
	background: #fff;
	color: #202321;
	border-color: transparent;
}
.nav button:hover:not(.active):not(:disabled) {
	background: #414640;
	color: white;
}
.card,
.auth-card {
	box-shadow: none;
	border: 1px solid var(--line);
	border-radius: 14px;
}
.card {
	padding: 24px;
}
.hero {
	background: #252a26;
	box-shadow: none;
	border: 0;
	padding: 32px;
}
.hero h1 {
	font-size: clamp(3rem, 5vw, 4.4rem);
}
.hero .primary {
	background: #fff;
	color: #262a26;
}
.hero .primary:hover:not(:disabled) {
	background: #f7ebe3;
}
.weekly-goal {
	background: #ebe9e1;
	border: 0;
}
.weekly-goal .stat,
.weekly-goal .stat span {
	color: #252a26;
}
.primary {
	min-height: 46px;
	border-radius: 8px;
	font-weight: 600;
}
.ghost {
	min-height: 42px;
	border-radius: 8px;
}
.field input,
.field select,
.field textarea {
	border-radius: 8px;
	padding: 11px 12px;
	min-height: 44px;
}
.field {
	font-weight: 500;
	gap: 7px;
}
.pill,
.admin-tag {
	background: #efefea;
	color: #454b43;
	border: 0;
}
.exercise-thumb {
	border-radius: 10px;
}
.exercise-placeholder {
	background: #eeeee8;
	color: #6b7168;
}
.section-title {
	margin-top: 32px;
	margin-bottom: 16px;
}
.trainee-choice {
	border-radius: 10px;
	padding: 16px;
}
.trainee-choice.selected {
	background: var(--brand-soft);
	border-color: var(--brand);
}
.coach-layout {
	grid-template-columns: 300px minmax(0, 1fr);
	gap: 24px;
}
.coach-connect-divider {
	border-top: 1px solid var(--line);
	padding-top: 22px;
	font-weight: 600;
}
.coaching-banner {
	background: #f7ebe3;
	border-color: #d7b6a5;
	color: #683720;
	border-radius: 12px;
}
.coaching-banner select {
	border-color: #bba797;
}
.auth {
	display: grid;
	grid-template-columns: minmax(320px, 1fr) minmax(380px, 1fr);
	min-height: 100vh;
	padding: 0;
	max-width: none;
	align-items: stretch;
}
.auth-intro {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	background: #242825;
	color: white;
	padding: clamp(36px, 7vw, 120px);
}
.intro-logo {
	width: 200px;
	height: 200px;
	border-radius: 0;
	margin-bottom: 28px;
}
.auth-intro h2 {
	color: white;
	font-size: clamp(3.5rem, 7vw, 6rem);
	margin-bottom: 12px;
}
.auth-intro p {
	color: #e1e4dc;
	font-size: 1.35rem;
}
.auth-principles {
	display: grid;
	gap: 16px;
	margin-top: 45px;
	border-top: 1px solid #596055;
	padding-top: 24px;
	color: #d9ded3;
}
.auth-card {
	align-self: center;
	width: min(100%, 500px);
	margin: 50px auto;
	border: 0;
	background: transparent;
	padding: 40px;
}
.auth-card h1 {
	margin-bottom: 16px;
}
.auth-card #auth-form {
	margin: 25px 0;
}
.auth-card .admin-login-link {
	margin-top: 30px;
}
.admin-sidebar {
	background: #242825;
	border: 0;
}
.admin-brand {
	padding-top: 24px;
}
.admin-brand .mh-brand {
	color: white;
}
.admin-brand .mh-brand small {
	color: #d5dbd0;
}
.admin-sidebar nav button,
.admin-sidebar-footer a,
.admin-sidebar-footer button {
	color: #e0e4da;
}
.admin-sidebar nav button.active {
	background: #fff;
	color: #252a26;
}
.admin-sidebar nav button:hover:not(.active) {
	background: #414640;
	color: #fff;
}
.admin-auth-intro {
	background: #242825;
}
.admin-auth-intro h1 {
	color: white;
}
.admin-auth-intro p,
.admin-member-link {
	color: #d9ded3;
}
.admin-auth-logo {
	width: 160px;
	height: 160px;
}
.admin-metric,
.admin-panel,
.admin-login-card,
.admin-auth-card {
	box-shadow: none;
	border-radius: 14px;
}
.admin-topbar {
	background: white;
}
.stat,
.timer-display,
.admin-metric strong {
	font-variant-numeric: tabular-nums;
}
::selection {
	color: white;
	background: #a64b2b;
}
input,
textarea {
	caret-color: var(--brand);
}
:where(button, a, input, select, textarea):focus-visible {
	outline: 3px solid #a64b2b;
	outline-offset: 3px;
}
@media (max-width: 720px) {
	.shell {
		padding: 0 16px 110px;
	}
	.top {
		padding: 16px 0 22px;
	}
	.header-logo {
		width: 52px;
		height: 52px;
	}
	.mh-brand {
		font-size: 1.55rem;
	}
	.nav,
	.nav.coach-nav {
		margin: 0;
		border-radius: 0;
		padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
		background: #242825;
		box-shadow: none;
	}
	.nav button {
		padding: 12px 6px;
		font-size: 0.78rem;
	}
	.card {
		padding: 20px;
	}
	.coach-layout {
		grid-template-columns: 1fr;
	}
	.auth {
		grid-template-columns: 1fr;
	}
	.auth-intro {
		padding: 24px;
		display: grid;
		grid-template-columns: 64px 1fr;
		align-items: center;
		gap: 8px 16px;
	}
	.intro-logo {
		width: 64px;
		height: 64px;
		margin: 0;
		grid-row: span 2;
	}
	.auth-intro h2 {
		font-size: 2.2rem;
		margin: 0;
	}
	.auth-intro p {
		font-size: 1rem;
		margin: 0;
	}
	.auth-principles {
		display: none;
	}
	.auth-card {
		padding: 28px 24px;
		margin: 0 auto;
	}
	.auth-card .auth-logo {
		display: none;
	}
	.coaching-banner {
		padding: 16px;
	}
}
@media (prefers-reduced-motion: no-preference) {
	.auth-intro {
		animation: mh-enter 350ms ease-out;
	}
	@keyframes mh-enter {
		from {
			clip-path: inset(0 0 5% 0);
		}
		to {
			clip-path: inset(0);
		}
	}
}
.weekly-goal .eyebrow,
.grid > .card .eyebrow,
.timer-header .eyebrow {
	display: block;
	font-family: "Barlow", sans-serif;
	text-transform: none;
	letter-spacing: 0;
	font-size: 0.95rem;
	font-weight: 500;
	margin-bottom: 12px;
}
.hero .eyebrow {
	display: none !important;
}
.admin-kicker {
	display: none;
}
.auth {
	justify-items: stretch;
}
.auth-intro {
	width: 100%;
}
@media (max-width: 720px) {
	.auth {
		grid-template-rows: auto 1fr;
	}
	.auth-intro {
		padding: 20px 24px;
	}
	.auth-card {
		align-self: start;
		padding-top: 32px;
	}
}
.admin-brand .header-logo {
	width: 56px;
	height: 56px;
	flex: 0 0 56px;
}
.admin-brand .mh-brand {
	font-size: 1.5rem;
	gap: 10px;
}
.admin-brand .mh-brand small {
	font-size: 0.48rem;
	letter-spacing: 0.1em;
}
.admin-brand > span {
	color: #d7dcd2;
}

/* Responsive hardening: no clipped cards, labeled editor fields, stable bottom bar. */
.card,
.card > *,
.row > *,
.top > *,
.top-right > *,
.hero-actions > *,
.coach-actions > *,
.editor-actions > *,
.schedule-grid > *,
.week-grid > *,
.goal-form > *,
.measurement-form > *,
.program-form > *,
.settings-form > *,
.catalog-search > *,
.set-form > *,
.history-set-form > *,
.coach-stats > *,
.coach-roster > *,
.trainee-card > *,
.coach-toolbar > *,
.coaching-banner > * {
	min-width: 0;
}
.card input,
.card select,
.card textarea,
.editor-row input,
.editor-row select {
	max-width: 100%;
}
.row,
.hero-actions,
.coach-actions {
	flex-wrap: wrap;
}
.card h2,
.card h3,
.card strong,
.exercise-copy,
.trainee-card {
	overflow-wrap: anywhere;
}

/* Coach roster */
.coach-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	gap: 12px;
	margin: 0 0 18px;
}
.coach-toolbar > .field,
.coach-toolbar > input,
.coach-toolbar > select {
	flex: 1 1 200px;
}
.coach-roster {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: 14px;
}
.trainee-card {
	display: grid;
	gap: 10px;
	padding: 16px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
	color: var(--ink);
}
.trainee-card.selected {
	background: var(--brand-soft);
	border-color: var(--brand);
}

/* Routine editor: labeled fields */
.editor-head,
.editor-row {
	grid-template-columns: 24px minmax(150px, 2fr) repeat(4, minmax(65px, 1fr)) auto;
}
.editor-field {
	display: grid;
	gap: 4px;
	min-width: 0;
	color: var(--ink-soft);
}
.editor-field > span,
.editor-field > small {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--ink-soft);
}

.editor-row .editor-field input,
.editor-row .editor-field input:first-of-type {
	grid-column: auto;
	width: 100%;
	min-width: 0;
	min-height: 44px;
	border: 1px solid var(--control-line);
	border-radius: 8px;
	padding: 10px;
}
.editor-actions {
	align-items: center;
	gap: 6px;
}
.editor-actions button {
	min-width: 44px;
	min-height: 44px;
}

@media (max-width: 720px) {
	:root {
		--nav-h: calc(64px + env(safe-area-inset-bottom));
		--timer-h: 104px;
	}
	.shell {
		padding-bottom: calc(var(--nav-h) + 32px);
	}
	.shell:has(.timer-card.rest-active) {
		padding-bottom: calc(var(--nav-h) + var(--timer-h) + 32px);
	}
	html {
		scroll-padding-bottom: calc(var(--nav-h) + var(--timer-h) + 24px);
	}
	.log-exercise,
	.exercise-toggle,
	.quick-entry {
		scroll-margin-bottom: calc(var(--nav-h) + var(--timer-h) + 24px);
	}
	.nav,
	.nav.coach-nav {
		grid-template-columns: repeat(var(--nav-count, 5), minmax(0, 1fr));
		grid-template-rows: auto;
		grid-auto-flow: column;
		grid-auto-columns: minmax(0, 1fr);
		align-items: stretch;
		gap: 2px;
		min-height: var(--nav-h);
		padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
		overflow: visible;
	}
	.nav button {
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 0;
		min-height: 48px;
		padding: 6px 2px;
		text-align: center;
		line-height: 1.15;
		overflow-wrap: anywhere;
	}
	.timer-card.rest-active {
		bottom: calc(76px + env(safe-area-inset-bottom));
	}
	.undo-toast {
		left: 12px;
		right: 12px;
		bottom: calc(76px + env(safe-area-inset-bottom));
		max-width: calc(100vw - 24px);
		z-index: 45;
	}
	.shell:has(.timer-card.rest-active) .undo-toast {
		bottom: calc(76px + var(--timer-h) + 8px + env(safe-area-inset-bottom));
	}

	/* Header */
	.top {
		flex-wrap: wrap;
		gap: 8px 12px;
	}
	.top > :first-child,
	.mh-brand,
	.mh-brand > span {
		min-width: 0;
	}
	.top > :first-child {
		flex: 1 1 0;
	}
	.mh-brand > span {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.top-right {
		flex: 0 1 auto;
		flex-wrap: wrap;
		justify-content: flex-end;
	}
	.top-right .ghost {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}

	/* Routine editor */
	.editor-head {
		display: none;
	}
	.editor-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
		padding: 12px 0;
		border-top: 1px solid var(--line);
	}
	.editor-row .drag-handle {
		display: none;
	}
	.editor-field > span,
	.editor-field > small {
		position: static;
		width: auto;
		height: auto;
		margin: 0;
		overflow: visible;
		clip-path: none;
		white-space: normal;
		font-size: 0.82rem;
		font-weight: 600;
		color: var(--ink-soft);
	}
	.editor-row .editor-name {
		grid-column: 1 / -1;
	}
	.editor-row .editor-actions {
		grid-column: 1 / -1;
		justify-content: flex-end;
		flex-wrap: wrap;
	}

	/* Cards, forms, grids */
	.card > .row,
	.exercise.row {
		flex-wrap: wrap;
	}
	.coach-actions > button,
	.hero-actions > button,
	.row > button,
	.ghost,
	.danger {
		min-height: 44px;
	}
	.coach-actions,
	.hero-actions {
		gap: 8px;
	}
	.coach-actions > *,
	.hero-actions > * {
		flex: 1 1 140px;
	}
	.coach-roster {
		grid-template-columns: 1fr;
	}
	.coach-toolbar > * {
		flex: 1 1 100%;
	}
	.coaching-banner {
		flex-wrap: wrap;
		gap: 8px;
	}
	.coaching-banner select {
		width: 100%;
		min-height: 44px;
	}
	.calendar-grid,
	.week-grid {
		grid-template-columns: repeat(7, minmax(0, 1fr));
		gap: 4px;
	}
	.calendar-grid > strong {
		font-size: 0.7rem;
	}
	.calendar-day {
		min-width: 0;
		min-height: 44px;
		padding: 2px;
		font-size: 0.8rem;
	}
	.week-grid {
		padding: 12px;
	}
	.week-day {
		min-width: 0;
		padding: 6px 2px;
		overflow-wrap: anywhere;
		text-align: center;
	}
	.schedule-grid,
	.goal-form,
	.measurement-form,
	.program-form,
	.settings-form,
	.catalog-search {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.goal-form button,
	.measurement-form button,
	.program-form button,
	.catalog-search button {
		grid-column: 1 / -1;
	}
	.field input,
	.field select,
	.field textarea,
	.goal-form input,
	.goal-form select {
		width: 100%;
		min-height: 44px;
	}
	.admin-table-wrap {
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.admin-table {
		min-width: 560px;
	}
	.admin-main,
	.admin-panel,
	.admin-page-heading,
	.admin-portal > * {
		min-width: 0;
	}
	.admin-page-heading,
	.admin-topbar,
	.admin-panel-heading,
	.admin-heading-actions,
	.admin-pagination {
		flex-wrap: wrap;
		gap: 8px 12px;
	}
	.admin-assignment-form,
	.admin-catalog-form {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.admin-mobile-nav button {
		min-height: 44px;
	}
}

@media (max-width: 520px) {
	.schedule-grid,
	.goal-form,
	.measurement-form,
	.program-form,
	.settings-form,
	.catalog-search,
	.admin-assignment-form,
	.admin-catalog-form {
		grid-template-columns: 1fr;
	}
	.week-grid {
		grid-template-columns: repeat(7, minmax(0, 1fr));
	}
	.nav.coach-nav,
	.nav {
		grid-template-columns: repeat(var(--nav-count, 5), minmax(0, 1fr));
	}
}

@media (max-width: 360px) {
	.shell {
		padding-left: 12px;
		padding-right: 12px;
	}
	.card {
		padding: 16px;
	}
	.mh-brand {
		gap: 8px;
		font-size: 1.2rem;
	}
	.mh-brand small {
		display: none;
	}
	.header-logo {
		width: 40px;
		height: 40px;
	}
	.top-right {
		gap: 4px;
	}
	.top-right .ghost {
		padding: 0 8px;
		font-size: 0.75rem;
	}
	.nav button {
		font-size: 0.68rem;
	}
	.calendar-day {
		font-size: 0.72rem;
	}
	.editor-row {
		gap: 8px;
	}
}

.nav[data-count="2"] {
	--nav-count: 2;
}
.nav[data-count="5"] {
	--nav-count: 5;
}
.trainee-manage summary,
.coach-existing-member summary {
	cursor: pointer;
	padding: 12px 0;
	min-height: 44px;
	color: var(--muted-ink);
}
.trainee-manage button {
	margin-top: 8px;
}
.coach-toolbar p {
	margin-bottom: 0;
}
.coach-add-trainee {
	margin: 0 0 24px;
}
@media (max-width: 720px) {
	.app-notice {
		bottom: calc(80px + env(safe-area-inset-bottom));
		left: 12px;
		right: 12px;
		width: auto;
		max-width: none;
		z-index: 45;
	}
	.shell:has(.timer-card.rest-active) .app-notice {
		bottom: calc(196px + env(safe-area-inset-bottom));
	}
	.timer-card:not(.rest-active) {
		position: static;
	}
	.coaching-banner select,
	input,
	select,
	textarea {
		font-size: 16px;
	}
	.coaching-banner {
		position: sticky;
		top: 0;
		z-index: 20;
	}
	.coaching-banner .coach-actions,
	.coaching-banner label {
		width: 100%;
	}
	.week-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.editor-row {
		align-items: end;
	}
}
.routine-schedule {
	margin-bottom: 20px;
}
.routine-schedule > summary {
	cursor: pointer;
	font-weight: 600;
	min-height: 44px;
	display: list-item;
	padding: 10px 0;
}
.routine-schedule[open] > summary {
	margin-bottom: 16px;
}
@media (max-width: 720px) {
	[data-plan-card] > .row {
		display: block;
	}
	[data-plan-card] > .row > h2 {
		margin-bottom: 12px;
	}
	[data-plan-card] > .row > .coach-actions {
		display: flex;
		width: 100%;
		margin-bottom: 16px;
		gap: 8px;
	}
	[data-plan-card] > .row > .coach-actions > button {
		flex: 1 1 48px;
		min-width: 44px;
		min-height: 44px;
		padding: 8px 4px;
	}
	.coaching-banner strong {
		font-size: 1rem;
	}
}
@media (max-width: 720px) {
	html:has(.coaching-banner) {
		scroll-padding-top: 110px;
	}
	.coaching-banner {
		display: grid;
		gap: 6px;
		padding: 10px 14px;
	}
	.coaching-banner > div:first-child {
		min-width: 0;
	}
	.coaching-banner strong {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.coaching-banner .switch-label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}
	.coaching-banner label {
		gap: 0;
	}
}
