/* Athlete and guardian portal. Every colour is a variable: a theme is the variable set on <html data-theme>. */

:root,
html[data-theme="light"] {
	color-scheme: light;
	--ground: #eaf1f4;
	--blob-a: rgba(0, 194, 224, 0.28);
	--blob-b: rgba(124, 150, 255, 0.22);
	--text: #0a1628;
	--text-2: #3f4f63;
	--text-3: #4a5a6e;
	--label: #5a6a7d;
	--card-bg: linear-gradient(150deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.5) 55%, rgba(255, 255, 255, 0.62) 100%);
	--card-filter: blur(26px) saturate(1.8);
	--card-border: 1px solid rgba(255, 255, 255, 0.95);
	--card-shadow: 0 10px 32px rgba(10, 22, 40, 0.08), 0 1px 2px rgba(10, 22, 40, 0.04), inset 0 1.5px 0 rgba(255, 255, 255, 1),
		inset 0 -1px 0 rgba(255, 255, 255, 0.45), inset 0 0 18px rgba(255, 255, 255, 0.35);
	--nav-bg: linear-gradient(150deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.58));
	--nav-filter: blur(28px) saturate(1.9);
	--nav-border: 1px solid rgba(255, 255, 255, 0.95);
	--nav-shadow: 0 12px 34px rgba(10, 22, 40, 0.14), inset 0 1.5px 0 rgba(255, 255, 255, 1), inset 0 -1px 0 rgba(255, 255, 255, 0.45),
		inset 0 0 18px rgba(255, 255, 255, 0.35);
	--nav-active-bg: rgba(0, 194, 224, 0.16);
	--nav-active-text: #0a5a6e;
	--btn-bg: #f6fafb;
	--btn-border: rgba(10, 22, 40, 0.12);
	--btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 1px 2px rgba(10, 22, 40, 0.05);
	--btn-text: #0a1628;
	--sel-bg: #0b7f99;
	--sel-border: #09708a;
	--sel-text: #ffffff;
	--sel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 8px rgba(11, 127, 153, 0.22);
	--chip-sel-bg: #cff0f6;
	--chip-sel-border: rgba(11, 127, 153, 0.6);
	--chip-sel-text: #0a5a6e;
	--tint: rgba(214, 243, 249, 0.72);
	--amber-bg: rgba(255, 176, 32, 0.26);
	--amber-text: #6b3f00;
	--seg: rgba(10, 22, 40, 0.1);
	--focus: #0b7f99;
	--danger: #b42318;
	--skeleton: rgba(10, 22, 40, 0.08);
	--skeleton-shine: rgba(255, 255, 255, 0.6);
	--tab-track: rgba(10, 22, 40, 0.06);
	--tab-sel: #ffffff;
	--tab-sel-shadow: 0 1px 3px rgba(10, 22, 40, 0.12);
	--locked-bg: #5b6676;
	--locked-text: #eef2f6;
	--lock-box: rgba(10, 22, 40, 0.06);
	--error: #b42318;
}

html[data-theme="dark"] {
	color-scheme: dark;
	--ground: #0b1220;
	--blob-a: rgba(0, 194, 224, 0.2);
	--blob-b: rgba(124, 150, 255, 0.18);
	--text: #eaf1f6;
	--text-2: #a9b8c8;
	--text-3: #a9b8c8;
	--label: #8ea0b3;
	--card-bg: linear-gradient(150deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05) 55%, rgba(255, 255, 255, 0.08));
	--card-filter: blur(26px) saturate(1.6);
	--card-border: 1px solid rgba(255, 255, 255, 0.14);
	--card-shadow: 0 12px 34px rgba(0, 0, 0, 0.45), inset 0 1.5px 0 rgba(255, 255, 255, 0.18), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
	--nav-bg: linear-gradient(150deg, rgba(40, 52, 74, 0.78), rgba(22, 31, 48, 0.7));
	--nav-filter: blur(28px) saturate(1.6);
	--nav-border: 1px solid rgba(255, 255, 255, 0.16);
	--nav-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), inset 0 1.5px 0 rgba(255, 255, 255, 0.18), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
	--nav-active-bg: rgba(0, 194, 224, 0.16);
	--nav-active-text: #7fe3f3;
	--btn-bg: #1b2638;
	--btn-border: rgba(255, 255, 255, 0.16);
	--btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
	--btn-text: #eaf1f6;
	--sel-bg: #0b7f99;
	--sel-border: #09708a;
	--sel-text: #ffffff;
	--sel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 3px 10px rgba(0, 194, 224, 0.2);
	--chip-sel-bg: #0f3f4d;
	--chip-sel-border: rgba(11, 127, 153, 0.6);
	--chip-sel-text: #7fe3f3;
	--tint: rgba(0, 194, 224, 0.13);
	--amber-bg: rgba(255, 176, 32, 0.2);
	--amber-text: #ffd27a;
	--seg: rgba(255, 255, 255, 0.12);
	--focus: #7fe3f3;
	--danger: #ff9b8f;
	--skeleton: rgba(255, 255, 255, 0.08);
	--skeleton-shine: rgba(255, 255, 255, 0.14);
	--tab-track: rgba(255, 255, 255, 0.06);
	--tab-sel: #2a3850;
	--tab-sel-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
	--locked-bg: #3a4456;
	--locked-text: #a9b8c8;
	--lock-box: rgba(255, 255, 255, 0.06);
	--error: #ff9b8f;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background: var(--ground);
	color: var(--text);
	font-family: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 1.45;
	-webkit-text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
}

body {
	overflow-x: hidden;
}

/* the two fixed blurred blobs behind the glass */
.blob {
	position: fixed;
	z-index: 0;
	border-radius: 50%;
	pointer-events: none;
}

.blob-a {
	top: -80px;
	right: -80px;
	width: 300px;
	height: 300px;
	background: var(--blob-a);
	filter: blur(60px);
}

.blob-b {
	top: 40%;
	left: -110px;
	width: 320px;
	height: 320px;
	background: var(--blob-b);
	filter: blur(70px);
}

#app {
	position: relative;
	z-index: 1;
}

a {
	color: inherit;
}

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

/* ---- type ---------------------------------------------------------------------------------------------------- */

.title {
	margin: 0;
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.card-title {
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 650;
}

.label {
	margin: 0;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--label);
}

.secondary {
	margin: 0;
	color: var(--text-2);
}

.muted,
.empty {
	color: var(--text-3);
}

.empty {
	margin: 4px 0 0;
}

/* ---- glass ---------------------------------------------------------------------------------------------------- */

.glass {
	background: var(--card-bg);
	-webkit-backdrop-filter: var(--card-filter);
	backdrop-filter: var(--card-filter);
	border: var(--card-border);
	box-shadow: var(--card-shadow);
}

.glass-nav {
	background: var(--nav-bg);
	-webkit-backdrop-filter: var(--nav-filter);
	backdrop-filter: var(--nav-filter);
	border: var(--nav-border);
	box-shadow: var(--nav-shadow);
}

.card {
	border-radius: 22px;
	padding: 18px 18px 20px;
	margin: 0 0 14px;
}

.card.tint {
	background: var(--tint);
}

.card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.date {
	color: var(--text-2);
	font-weight: 500;
	font-size: 14px;
	white-space: nowrap;
}

/* ---- buttons and chips ---------------------------------------------------------------------------------------- */

.btn,
.tile,
.chip-btn,
.side-athlete {
	min-height: 44px;
	padding: 10px 18px;
	border-radius: 16px;
	border: 1px solid var(--btn-border);
	background: var(--btn-bg);
	color: var(--btn-text);
	box-shadow: var(--btn-shadow);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.btn.selected,
.btn[aria-pressed="true"] {
	background: var(--sel-bg);
	border-color: var(--sel-border);
	color: var(--sel-text);
	box-shadow: var(--sel-shadow);
}

.btn.danger {
	color: var(--danger);
}

.chip-btn.selected,
.side-athlete.selected,
.tile.selected {
	background: var(--chip-sel-bg);
	border-color: var(--chip-sel-border);
	color: var(--chip-sel-text);
}

.row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.row.end {
	justify-content: flex-end;
	margin: 6px 0 14px;
}

.chips,
.pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.chip,
.tag,
.pill {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	background: var(--chip-sel-bg);
	border: 1px solid var(--chip-sel-border);
	color: var(--chip-sel-text);
}

.tag {
	margin-top: 10px;
}

.chip.amber {
	background: var(--amber-bg);
	border-color: transparent;
	color: var(--amber-text);
}

/* ---- layout --------------------------------------------------------------------------------------------------- */

.layout {
	min-height: 100vh;
}

.main {
	padding: calc(12px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 0
		calc(16px + env(safe-area-inset-left));
}

.content {
	/* QA4, the ONE bottom-space rule: nothing hides behind the bottom nav or a floating bar. --nav-space and
	   --bar-space are the measured heights (app.js syncBottomSpace, after every render and on resize). */
	padding-bottom: calc(var(--nav-space, 100px) + var(--bar-space, 0px) + 16px + env(safe-area-inset-bottom));
	outline: none;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 52px;
	margin-bottom: 8px;
}

.athlete-name {
	font-weight: 600;
	color: var(--text-2);
	text-align: right;
}

.brand {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	min-height: 44px;
}

.logo {
	height: 40px;
	width: auto;
	display: block;
}

.logo-text {
	font-weight: 700;
	font-size: 18px;
	letter-spacing: -0.01em;
}

html[data-theme="light"] .for-dark,
html[data-theme="dark"] .for-light {
	display: none;
}

.switcher-chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 2px 2px 12px;
	scrollbar-width: none;
}

.chip-btn {
	border-radius: 999px;
	padding: 8px 16px;
	white-space: nowrap;
}

.bottom-nav {
	position: fixed;
	z-index: 5;
	left: calc(12px + env(safe-area-inset-left));
	right: calc(12px + env(safe-area-inset-right));
	bottom: calc(12px + env(safe-area-inset-bottom));
	display: flex;
	justify-content: space-around;
	gap: 6px;
	padding: 8px;
	border-radius: 26px;
}

.bottom-item,
.side-item {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 48px;
	min-width: 44px;
	padding: 6px 14px;
	border-radius: 18px;
	text-decoration: none;
	color: var(--text-2);
	font-weight: 600;
}

.bottom-item {
	flex: 1;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	font-size: 12px;
}

.bottom-item.active,
.side-item.active {
	background: var(--nav-active-bg);
	color: var(--nav-active-text);
}

.icon {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sidebar {
	display: none;
}

@media (min-width: 768px) {
	.layout {
		display: grid;
		grid-template-columns: 232px 1fr;
		gap: 24px;
		padding: calc(16px + env(safe-area-inset-top)) 24px 24px calc(16px + env(safe-area-inset-left));
	}

	.sidebar {
		position: sticky;
		top: 16px;
		align-self: start;
		display: flex;
		flex-direction: column;
		gap: 16px;
		width: 232px;
		min-height: calc(100vh - 32px);
		padding: 18px 12px;
		border-radius: 26px;
	}

	.side-brand {
		padding: 0 8px;
	}

	.switcher-list {
		display: flex;
		flex-direction: column;
		gap: 6px;
	}

	.side-athlete {
		text-align: left;
		border-radius: 14px;
	}

	.side-nav {
		display: flex;
		flex-direction: column;
		gap: 4px;
	}

	.main {
		width: 100%;
		max-width: 960px;
		margin: 0 auto;
		padding: 0;
	}

	.content {
		padding-bottom: 24px;
	}

	.top-brand,
	.switcher-chips,
	.bottom-nav {
		display: none;
	}

	.topbar {
		justify-content: flex-end;
	}
}

/* ---- home ----------------------------------------------------------------------------------------------------- */

.greeting {
	margin: 4px 0 18px;
}

.pills {
	margin-top: 10px;
}

.big-row {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.big {
	font-size: 48px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1;
}

.of {
	color: var(--text-2);
	font-weight: 500;
}

.segments {
	display: flex;
	gap: 3px;
	margin-top: 14px;
	height: 10px;
}

.seg {
	flex: 1;
	border-radius: 4px;
	background: var(--seg);
}

.seg.used {
	background: var(--sel-bg);
}

.todo-list,
.plain-list,
.steps {
	margin: 0;
	padding: 0;
	list-style: none;
}

.todo-list li + li {
	margin-top: 12px;
}

.todo-item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-decoration: none;
}

.todo-title {
	font-weight: 650;
}

/* SG2: the Sign link of a document is a button (44px target) */
a.btn {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.todo-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.excerpt {
	margin: 0 0 10px;
}

.more {
	font-weight: 600;
}

.banner {
	margin: 0 0 12px;
	padding: 10px 14px;
	border-radius: 14px;
	background: var(--tint);
	font-weight: 500;
}

.banner p {
	margin: 0;
}

.banner .btn {
	margin-top: 10px;
}

.load-problem p {
	margin: 0;
	font-weight: 600;
}

.load-problem .row {
	margin-top: 14px;
}

.banner.error {
	background: var(--amber-bg);
	color: var(--amber-text);
}

.install .row {
	margin-top: 12px;
}

/* ---- account -------------------------------------------------------------------------------------------------- */

.tiles {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 12px 8px;
	border-radius: 18px;
}

.swatch {
	width: 44px;
	height: 30px;
	border-radius: 10px;
	border: 1px solid var(--btn-border);
}

.swatch-light {
	background: #eaf1f4;
}

.swatch-dark {
	background: #0b1220;
}

.swatch-device {
	background: linear-gradient(135deg, #eaf1f4 50%, #0b1220 50%);
}

.hint {
	margin-top: 12px;
	font-size: 14px;
}

.plain-list li {
	padding: 8px 0;
	border-bottom: 1px solid var(--seg);
}

.plain-list li:last-child {
	border-bottom: 0;
}

/* ---- sheet (iOS install steps) -------------------------------------------------------------------------------- */

.sheet-backdrop {
	position: fixed;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	background: rgba(10, 22, 40, 0.35);
	padding: 16px;
	padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.sheet {
	width: 100%;
	max-width: 440px;
	border-radius: 22px;
	padding: 20px;
}

.steps {
	counter-reset: step;
	margin: 12px 0 16px;
}

.steps li {
	counter-increment: step;
	padding: 6px 0;
}

.steps li::before {
	content: counter(step) ". ";
	font-weight: 700;
}

/* ---- skeletons ------------------------------------------------------------------------------------------------ */

.sk {
	border-radius: 8px;
	background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-shine) 50%, var(--skeleton) 75%);
	background-size: 200% 100%;
	animation: shine 1.4s ease-in-out infinite;
}

.sk-label {
	width: 30%;
	height: 12px;
	margin-bottom: 14px;
}

.sk-title {
	width: 60%;
	height: 20px;
	margin-bottom: 10px;
}

.sk-line {
	width: 85%;
	height: 14px;
	margin-bottom: 8px;
}

@keyframes shine {
	from {
		background-position: 200% 0;
	}
	to {
		background-position: -200% 0;
	}
}

/* ---- S10s: the portal's own sign-in and wrong-account screens (app.js renderGate) ---------------------------- */

.auth {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.auth-card {
	width: 100%;
	max-width: 420px;
	padding: 28px 22px 22px;
}

.auth-brand {
	display: flex;
	justify-content: center;
	margin-bottom: 18px;
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.auth-form .title {
	font-size: 26px;
}

.auth-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.auth-field input {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border-radius: 14px;
	border: 1px solid var(--btn-border);
	background: var(--btn-bg);
	color: var(--text);
	font: inherit;
	font-size: 17px; /* 16px or more: no zoom on focus in iOS */
}

.auth-password {
	display: flex;
	gap: 8px;
}

.auth-password input {
	flex: 1;
	min-width: 0;
}

.auth-show {
	flex: none;
	min-width: 84px;
}

.auth-submit {
	width: 100%;
	min-height: 50px;
	margin-top: 4px;
}

.auth-error {
	margin: 0;
	color: var(--error);
	font-weight: 600;
}

.auth-lang {
	justify-content: center;
	margin-top: 18px;
}

/* EM4: "Forgot password?" and its form under the sign-in form */
.auth-link {
	align-self: center;
	background: none;
	border-color: transparent;
	box-shadow: none;
	color: var(--text);
	text-decoration: underline;
}

.auth-forgot {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px solid var(--btn-border);
}

.auth-forgot .title {
	font-size: 20px;
}

.auth-sent {
	margin: 0;
	font-weight: 600;
}

.sign-out .auth-error {
	margin-bottom: 8px;
}

.noscript {
	position: relative;
	z-index: 1;
	padding: 24px;
}

/* ---- plan page ------------------------------------------------------------------------------------------------ */

.plan-lead {
	margin: 6px 0 16px;
}

.plan-tabs {
	display: flex;
	gap: 4px;
	padding: 4px;
	margin-bottom: 14px;
	border-radius: 16px;
	background: var(--tab-track);
}

.plan-tab {
	flex: 1;
	min-height: 44px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--text-2);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.plan-tab.selected {
	background: var(--tab-sel);
	color: var(--text);
	box-shadow: var(--tab-sel-shadow);
}

.banner.info {
	background: var(--tint);
}

.plan-page .pills {
	margin: 0 0 14px;
}

.status-row {
	margin-top: 12px;
}

.status-row .btn {
	flex: 1 1 auto;
}

.day-chips-wrap {
	margin-top: 14px;
}

.day-chips {
	margin-top: 8px;
}

.plan-page .btn:disabled,
.plan-page .chip-btn:disabled,
.plan-sheet .btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.plan-deadline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
}

.inline-error {
	margin: 10px 0 0;
	color: var(--error);
	font-weight: 600;
}

.lock-box {
	margin-top: 14px;
	padding: 12px 14px;
	border-radius: 16px;
	background: var(--lock-box);
}

.lock-box p {
	margin: 0 0 10px;
}

.lock-box .pending {
	font-weight: 600;
	margin: 0;
}

.plan-intro {
	margin-bottom: 12px;
}

.plan-intro p {
	margin: 0;
}

.week-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
	margin-top: 12px;
}

.day-cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	min-width: 0;
	padding: 4px 0;
	border-radius: 14px;
	border: 1px solid var(--btn-border);
	background: var(--btn-bg);
	color: var(--btn-text);
	box-shadow: var(--btn-shadow);
	font: inherit;
	cursor: pointer;
}

.day-letter {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	opacity: 0.8;
}

.day-num {
	font-size: 16px;
	font-weight: 650;
}

.day-cell.all {
	background: var(--sel-bg);
	border-color: var(--sel-border);
	color: var(--sel-text);
	box-shadow: var(--sel-shadow);
}

.day-cell.some {
	border: 2px solid var(--sel-bg);
	color: var(--chip-sel-text);
}

.day-cell.empty {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
	color: var(--text-3);
	opacity: 0.6;
	cursor: default;
}

.day-cell.locked {
	background: var(--locked-bg);
	border-color: var(--locked-bg);
	color: var(--locked-text);
	box-shadow: none;
	cursor: not-allowed;
}

.session-rows {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 12px;
}

.session-row {
	text-align: left;
}

.row.center {
	justify-content: center;
	margin: 4px 0 14px;
}

.plan-side {
	display: none;
}

.save-wrap .hint {
	margin-top: 6px;
	text-align: center;
}

.save-btn {
	width: 100%;
	min-height: 52px;
}

.plan-fab {
	position: fixed;
	z-index: 6;
	left: calc(16px + env(safe-area-inset-left));
	right: calc(16px + env(safe-area-inset-right));
	bottom: calc(var(--nav-space, 100px) + env(safe-area-inset-bottom)); /* above the bottom nav */
}

.deadline-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-start;
}

.deadline-name {
	font-weight: 650;
}

.note-label {
	display: block;
	margin-top: 14px;
}

.note-field {
	width: 100%;
	margin-top: 6px;
	padding: 10px 12px;
	border-radius: 14px;
	border: 1px solid var(--btn-border);
	background: var(--btn-bg);
	color: var(--text);
	font: inherit;
	resize: vertical;
}

.plan-sheet {
	max-height: calc(100vh - 32px);
	overflow-y: auto;
}

.toast {
	position: fixed;
	z-index: 20;
	left: 50%;
	bottom: calc(var(--nav-space, 100px) + var(--bar-space, 0px) + 12px + env(safe-area-inset-bottom));
	transform: translateX(-50%);
	padding: 10px 18px;
	border-radius: 14px;
	background: var(--sel-bg);
	color: var(--sel-text);
	font-weight: 600;
	box-shadow: var(--sel-shadow);
}

@media (min-width: 768px) {
	.plan-fab {
		left: auto;
		right: 24px;
		bottom: 24px;
		width: 280px;
	}

	.plan-sheet-backdrop {
		align-items: center;
	}

	.toast {
		bottom: 96px;
	}
}

@media (min-width: 1024px) {
	.plan-layout {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 20px;
		align-items: start;
	}

	.plan-side {
		display: block;
		position: sticky;
		top: 16px;
	}

	.plan-fab {
		display: none;
	}

	.toast {
		bottom: 32px;
	}
}

.event-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.event-head .card-title {
	margin: 0;
}

.session-times {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
}

/* ---- stats and debriefs pages -------------------------------------------------------------------------------- */

.range-chips {
	margin: 14px 0;
}

.range-dates {
	margin: -4px 0 14px;
}

.stat-tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 14px;
}

.stat-tile {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
}

.stat-value {
	font-size: 34px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.type-row,
.history-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.type-name,
.history-title {
	font-weight: 600;
}

.history-main {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.month-group + .month-group {
	margin-top: 14px;
}

.month-label {
	margin: 12px 0 4px;
	font-size: 15px;
	font-weight: 650;
}

.chip.status-present {
	background: var(--chip-sel-bg);
	border-color: var(--chip-sel-border);
	color: var(--chip-sel-text);
}

.chip.status-late {
	background: var(--amber-bg);
	border-color: transparent;
	color: var(--amber-text);
}

.chip.status-absent {
	background: var(--lock-box);
	border-color: var(--btn-border);
	color: var(--text-2);
}

.date-filter {
	margin: 0 0 14px;
	align-items: flex-end;
}

.date-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.date-field input {
	min-height: 44px;
	padding: 8px 12px;
	border-radius: 14px;
	border: 1px solid var(--btn-border);
	background: var(--btn-bg);
	color: var(--text);
	font: inherit;
}

.debrief-text {
	margin: 10px 0 0;
	white-space: pre-line;
}

@media (min-width: 768px) {
	.stat-tiles {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* F3: a trip on a regatta card and in the Trips section */
.trip-block {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid var(--btn-border);
}
.trip-block p {
	margin: 4px 0;
}
.trip-legs li {
	margin: 2px 0;
}
.trips-title {
	margin: 20px 0 8px;
}

/* F3b: the bell and the notifications page */
.bell {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-left: auto;
	border-radius: 12px;
	border: 1px solid var(--btn-border);
	background: var(--btn-bg);
	color: var(--btn-text);
}
.bell.active {
	background: var(--nav-active-bg);
	color: var(--nav-active-text);
}
.bell .badge {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--sel-bg);
	color: var(--sel-text);
	font-size: 11px;
	line-height: 18px;
	text-align: center;
}
.notice-items {
	list-style: none;
	margin: 0;
	padding: 0;
}
.notice {
	padding: 10px 0;
	border-bottom: 1px solid var(--btn-border);
}
.notice:last-child {
	border-bottom: none;
}
.notice-open {
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	text-align: left;
	font: inherit;
	cursor: pointer;
}
.notice.unread .notice-title {
	font-weight: 700;
}
.notice.unread .notice-title::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: var(--sel-bg);
}
.notice-date {
	font-size: 12px;
}

/* F4: accommodation on a regatta card */
.stay-block {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid var(--btn-border);
}
.stay-block p {
	margin: 4px 0;
}
.stay-address {
	white-space: pre-line;
}
.stay-nights {
	margin: 12px 0;
	flex-wrap: wrap;
}

/* S11: the Stats screen: three season totals in a row of glass cards (light, dark and "same as device" themes alike,
   through the theme variables) */
.stats-subtitle {
	margin: -4px 0 12px;
	font-size: 14px;
}

.stat-totals {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin: 6px 0 14px;
}

.stat-total {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	margin: 0;
	padding: 14px 12px;
}

.stat-total-value {
	font-size: 32px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
	overflow-wrap: anywhere;
}

.stat-total-label {
	font-size: 13px;
	line-height: 1.3;
	color: var(--text-2);
}

.stat-total-note {
	font-size: 12px;
	line-height: 1.3;
}

.stats-page .chip-btn {
	min-height: 44px;
}

/* ---- PN2: the notifications toggle (Account) and the first-sign-in sheet ------------------------------------------ */

.switch-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 44px;
}

.switch-label {
	font-weight: 650;
}

.switch {
	position: relative;
	flex: none;
	width: 64px;
	min-width: 64px;
	min-height: 44px;
	padding: 0;
	border-radius: 999px;
	border: 1px solid var(--btn-border);
	background: var(--btn-bg);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.switch.on {
	background: var(--chip-sel-bg);
	border-color: var(--chip-sel-border);
}

.switch-knob {
	position: absolute;
	top: 8px;
	left: 8px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--btn-text);
	transition: transform 0.15s ease;
}

.switch.on .switch-knob {
	transform: translateX(20px);
	background: var(--chip-sel-text);
}

.switch:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.push-line {
	margin-top: 8px;
}

.push-sheet .row {
	margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
	.switch-knob {
		transition: none;
	}
}
