/* Cricket Performance Lab - mobile-first, no inline styles, strict-CSP friendly */
:root {
  --blue: #1a5fb4; --blue-d: #123f7a; --saffron: #ff9933; --green: #138808;
  --cream: #F4EDE0; --gold: #C99A4A; --ink: #14213d; --muted: #4a5568;
  --card: #ffffff; --line: #e3d9c6; --red: #b42318;
  --r: 22px; --shadow: 0 6px 20px rgba(26, 95, 180, .14);
  /* Design tokens (UX 2026-11-19): semantic colours (light + dark), type, space, radius, elevation, motion */
  --bg: var(--cream); --surface: #fff; --surface-2: #eaf1fb; --surface-warm: #fff7e8; --text: var(--ink);
  --heading: var(--blue-d); --link: var(--blue); --accent-text: #b45f06; --good-text: #0b5a04; --good-bg: #e7f5e5;
  --bad-text: var(--red); --bad-bg: #fdeceb; --track: #e6dcc8; --glass: rgba(255, 255, 255, .94); --hover: #f1ece0; --chip-bg: #dcebff; --accent-strong: #8a4b00; --pill-bg: #4a5568;
  --fs-xs: .78rem; --fs-sm: .9rem; --fs-md: 1rem; --fs-lg: 1.2rem; --fs-xl: 1.5rem; --fs-2xl: 2.2rem;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --r-sm: 12px; --r-md: 16px; --r-pill: 999px;
  --shadow-2: 0 18px 48px rgba(8, 25, 60, .28);
  --dur-fast: .15s; --dur: .22s; --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light dark;
  font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Malayalam", sans-serif;
}
/* Dark mode for evening use (UX 2026-11-19). Brand fills (blue, saffron, green) stay; surfaces and text change. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1626; --surface: #16233a; --surface-2: #1d3150; --surface-warm: #2a2416; --text: #e8edf5; --muted: #a9b4c4;
    --line: #2b3a55; --card: #16233a; --heading: #9cc3ff; --link: #8ab8ff; --accent-text: #ffb15c; --good-text: #86dc80;
    --good-bg: #15301a; --bad-text: #ff9a8f; --bad-bg: #3a1a1a; --track: #2b3a55; --glass: rgba(16, 26, 44, .94); --hover: #1d2b45;
    --chip-bg: #1f3a63; --accent-strong: #ffb15c; --pill-bg: #44546f; --shadow: 0 6px 20px rgba(0, 0, 0, .35); --shadow-2: 0 18px 48px rgba(0, 0, 0, .55);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
/* App feel (2026-11-16): no grey tap flash, no text selection on controls, no pull-to-refresh bounce. */
body { overscroll-behavior-y: none; }
.btn, .nav, .chip, .top { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, a, .chip { touch-action: manipulation; }
main.enter { animation: page-in .22s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main.enter { animation: none; } .nav a svg { transition: none; } }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.45; min-height: 100vh; min-height: 100dvh; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; }
h2 { font-size: var(--fs-lg); color: var(--heading); }
p { margin: 0 0 .6em; }
a { color: var(--link); }
main:focus { outline: none; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tricolor { height: 4px; background: linear-gradient(90deg, var(--saffron) 33.3%, #fff 33.3% 66.6%, var(--green) 66.6%); }

/* header + nav */
.top { position: sticky; top: 0; z-index: 20; background: var(--blue); color: #fff; padding-top: env(safe-area-inset-top); box-shadow: 0 2px 10px rgba(18, 63, 122, .25); }
.top-in { display: flex; align-items: center; gap: 10px; padding: 8px 16px; max-width: 760px; margin: 0 auto; }
.brand { white-space: nowrap; font-weight: 800; letter-spacing: .06em; font-size: 1.15rem; flex: 1; }
.brand span { color: #ffb35c; } /* lighter saffron: 3:1+ on the blue bar (audit 2026-11-19) */
.who { font-size: .8rem; opacity: .95; text-align: right; }
/* Phones: let the name/role line sit under the title instead of being squashed (device check 2026-11-16). */
@media (max-width: 560px) {
  .top-in { flex-wrap: wrap; row-gap: 2px; }
  .top-in { padding: 6px 12px 6px 16px; }
  .brand { font-size: .95rem; letter-spacing: .02em; line-height: 1.15; white-space: normal; flex: 1 1 0; min-width: 0; }
  .who { display: none; } /* one-row header (UX 2026-11-19); the name is on the Sign out button for screen readers */
  #logout { flex: none; min-height: 44px; padding: 4px 12px; font-size: .85rem; }
}
/* Native-style tab bar (2026-11-16): icon over label, sits above the phone's home bar. */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: center;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; max-width: 140px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; font-weight: 700; font-size: .7rem; letter-spacing: .01em; color: var(--muted); transition: color .15s; }
.nav a svg { width: 52px; height: 30px; padding: 2px 13px; border-radius: var(--r-pill); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-fast) var(--ease), background-color var(--dur) var(--ease); }
.nav a[aria-current="page"] { color: var(--link); }
/* Active tab: a pill behind the icon (UX 2026-11-19) */
.nav a[aria-current="page"] svg { stroke-width: 2.3; background: var(--chip-bg); }
.nav a.nav-extra { display: none; } /* PIN + Admin live on the Me screen on phones */
.nav a:active svg { transform: scale(.88); }
/* Native shell (APK 9): the app shows the header and tabs itself. */
.native-shell header.top, .native-shell #nav { display: none; }
.native-shell main { padding-bottom: 24px; }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px calc(84px + env(safe-area-inset-bottom)); }

/* controls */
.btn { white-space: nowrap; min-height: 48px; min-width: 48px; padding: 10px 20px; border: 0; border-radius: 999px; font: inherit; font-weight: 800; cursor: pointer; background: var(--saffron); color: #1b1b1b; box-shadow: 0 3px 0 #c76f0b; }
.btn { transition: transform .08s, box-shadow .08s, filter .08s; }
.btn:active { transform: translateY(2px) scale(.98); box-shadow: 0 1px 0 #c76f0b; filter: brightness(.95); }
.btn.blue { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-d); }
.btn.green { background: var(--green); color: #fff; box-shadow: 0 3px 0 #0b5a04; }
.btn.red { background: var(--red); color: #fff; box-shadow: 0 3px 0 #7a1810; }
.btn.ghost { background: transparent; color: #fff; box-shadow: none; border: 2px solid rgba(255, 255, 255, .7); min-height: 44px; padding: 6px 14px; }
/* Inside the page (white cards) a ghost button must be blue, not white-on-white (device check 2026-11-16). */
main .btn.ghost { color: var(--blue); border-color: var(--blue); }
.btn.small { min-height: 44px; padding: 6px 14px; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
label { display: block; font-weight: 700; margin: 12px 0 4px; }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line); border-radius: 14px; }
textarea { min-height: 96px; resize: vertical; }
.err { color: var(--bad-text); font-weight: 700; min-height: 1.4em; }
.ok { color: var(--good-text); font-weight: 700; }
.muted { color: var(--muted); font-size: .92rem; }

/* cards */
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin: 14px 0; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card.blue { background: linear-gradient(135deg, var(--blue), var(--blue-d)); color: #fff; border: 0; }
.card.blue h2 { color: #fff; }
.card.gold { border-top: 6px solid var(--gold); }
.card.saffron { border-top: 6px solid var(--saffron); }
.card.green { border-top: 6px solid var(--green); }
.hero { position: relative; padding: 0; overflow: hidden; min-height: 200px; background: var(--blue-d); }
.hero img { display: block; width: 100%; height: auto; max-height: 75vh; object-fit: contain; object-position: top center; color: transparent; } /* whole photo, never cropped (bug 2026-11-19); a broken picture shows the blue, not its alt text */
.hero-cap { position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px; color: #fff; background: linear-gradient(transparent, rgba(8, 25, 60, .9)); }
.hero-cap h1 { font-size: 2.2rem; letter-spacing: .1em; margin: 0; }
.hero-cap p { margin: 0; font-weight: 600; }
.quote-en { font-size: 1.15rem; font-weight: 700; }
.quote-ml { font-size: 1.05rem; margin-top: 6px; }
.quote-by { font-size: .85rem; opacity: .85; }
.count { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.count b { font-size: 2.4rem; color: var(--accent-text); } /* darker saffron: readable on white (bug hunt 2026-11-16) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.tile { background: var(--surface); border-radius: 18px; padding: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.tile b { display: block; font-size: 1.9rem; color: var(--link); }
.tile.s b { color: var(--accent-text); } .tile.g b { color: var(--good-text); }
.tile small { color: var(--muted); font-weight: 600; }
.bar { width: 100%; height: 12px; margin-top: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar::-webkit-progress-bar { background: var(--track); }
.bar::-webkit-progress-value { background: linear-gradient(90deg, var(--saffron), var(--green)); border-radius: 99px; }
.bar::-moz-progress-bar { background: linear-gradient(90deg, var(--saffron), var(--green)); border-radius: 99px; }

/* road to India */
.road { list-style: none; margin: 0; padding: 0; }
.road li { position: relative; padding: 8px 0 8px 44px; min-height: 48px; }
.road li::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 4px; background: var(--line); }
.road li:first-child::before { top: 50%; } .road li:last-child::before { bottom: 50%; }
.road .dot { position: absolute; left: 0; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 4px solid var(--line); z-index: 1; }
.road .done .dot { background: var(--green); border-color: var(--green); }
.road .current .dot { background: var(--saffron); border-color: var(--blue); }
.road .current strong { color: var(--link); }
.road small { display: block; color: var(--muted); }

/* pills + lists */
.pill { display: inline-block; padding: 2px 12px; border-radius: 99px; font-size: .8rem; font-weight: 800; color: #fff; background: var(--pill-bg); }
.pill.open { background: #b45f06; } .pill.improving { background: var(--blue); } .pill.fixed { background: var(--green); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.grow { flex: 1; min-width: 160px; }
.tick { min-width: 48px; min-height: 48px; border-radius: 14px; border: 3px solid var(--green); background: var(--surface); font-size: 1.5rem; font-weight: 800; color: var(--good-text); cursor: pointer; }
.tick[aria-pressed="true"] { background: var(--green); color: #fff; }
.note audio { width: 100%; margin-top: 6px; }
.note-en { font-weight: 600; }
.review { white-space: normal; }
.md h3, .md h4, .md h5 { color: var(--heading); margin-top: .8em; }
.md ul { padding-left: 20px; }
.badge { font-size: .78rem; background: var(--surface-warm); color: var(--accent-strong); border: 1px solid var(--saffron); padding: 2px 10px; border-radius: 99px; font-weight: 800; }

/* mic */
.mic { text-align: center; }
.mic-btn { width: 124px; height: 124px; border-radius: 50%; border: 0; cursor: pointer; background: radial-gradient(circle at 35% 30%, #ffb866, var(--saffron) 60%, #e07b00); color: #1b1b1b; font-size: 3rem; box-shadow: 0 0 0 8px rgba(255, 153, 51, .25), 0 8px 20px rgba(0, 0, 0, .25); }
.mic.compact .mic-btn { width: 56px; height: 56px; font-size: 1.5rem; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); }
.mic-ic { width: 66px; height: 66px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mic.compact .mic-ic { width: 30px; height: 30px; stroke-width: 2; }
.mic.rec .mic-btn { background: var(--red); color: #fff; animation: pulse 1.2s infinite; }
.mic-steps { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; text-align: left; } /* one full-width step per row: readable at any width (owner 2026-11-26) */
.mic-steps li { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: .95rem; line-height: 1.3; overflow-wrap: break-word; min-width: 0; color: var(--text); }
.mic-steps .step-n { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--saffron); color: #1b1b1b; font-weight: 700; display: grid; place-items: center; font-size: .8rem; }
.mic-steps li:last-child { border-color: var(--green); font-weight: 600; }
.mic-steps li { gap: 10px; }
.mic-steps .step-i { flex: none; display: inline-flex; color: var(--heading); }
.mic-timer { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mic-msg { min-height: 1.5em; font-weight: 600; margin: 6px 0; }
.mic textarea { margin-top: 8px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(180, 35, 24, .6); } 100% { box-shadow: 0 0 0 26px rgba(180, 35, 24, 0); } }

/* chat */
.thread-link { display: block; text-decoration: none; color: inherit; }
.chat { display: flex; flex-direction: column; gap: 10px; padding: 6px 0 14px; }
.bub { max-width: 86%; padding: 10px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; overflow-wrap: anywhere; }
.bub.me { align-self: flex-end; background: var(--chip-bg); border-color: var(--line); }
.bub small { display: block; color: var(--muted); font-size: .75rem; }
.bub audio { width: 100%; max-width: 260px; margin-top: 4px; }
.composer { position: sticky; bottom: 62px; display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 8px 0; }
.composer textarea { min-height: 52px; height: 52px; flex: 1; width: auto; min-width: 0; }
.composer .mic, .composer .btn { flex: none; }
.mic.compact .mic-msg { position: absolute; left: 0; right: 0; bottom: 100%; margin: 0; padding: 4px 0; text-align: left; background: var(--bg); font-size: .9rem; }
.mic.compact .bar { position: absolute; left: 0; right: 0; bottom: 100%; }

/* login + welcome */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 20px 16px; max-width: 440px; margin: 0 auto; }
.login-wrap h1 { text-align: center; font-size: 2rem; letter-spacing: .08em; color: var(--heading); }
.login-wrap h1 span { color: var(--saffron); }
.lion { display: block; width: 110px; height: 110px; margin: 0 auto 10px; border-radius: 50%; object-fit: cover; border: 5px solid var(--gold); }
.login-art { display: block; width: auto; height: auto; max-width: 100%; max-height: min(28vh, 280px); margin: 0 auto 8px; border-radius: var(--r); box-shadow: var(--shadow); }
.login-wrap:has(.login-art) .lion { width: 56px; height: 56px; border-width: 3px; margin-bottom: 8px; }
@media (max-width: 360px) { .login-wrap h1 { font-size: 1.55rem; letter-spacing: .04em; } }
@media (max-height: 700px) { .login-wrap { padding: 10px 16px; } .login-wrap .card { margin: 10px 0 6px; } .login-art { max-height: 20vh; } .login-wrap:has(.login-art) .lion { width: 44px; height: 44px; margin-bottom: 6px; } }
.welcome { position: fixed; inset: 0; z-index: 50; width: 100%; border: 0; padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; cursor: pointer; color: #fff; font: inherit;
  background: linear-gradient(rgba(10, 30, 70, .25), rgba(10, 30, 70, .88) 75%), url("/img/hero.webp") top center / cover no-repeat, var(--blue-d); overflow: hidden; }
.welcome h1 { font-size: 2.6rem; letter-spacing: .12em; margin: 0 0 12px; color: var(--saffron); text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.welcome .msg { font-family: Georgia, "Noto Serif", serif; font-size: 1.5rem; line-height: 1.5; max-width: 520px; margin-bottom: 18px; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.welcome .tap { font-weight: 800; padding: 10px 22px; border-radius: 99px; background: rgba(255, 255, 255, .2); border: 2px solid #fff; margin-bottom: 24px; }
.welcome .tricolor { position: absolute; left: 0; right: 0; top: 0; height: 10px; }
.confetti { position: absolute; inset: 0; pointer-events: none; opacity: .85;
  background:
    radial-gradient(circle, var(--saffron) 3px, transparent 4px) 0 0 / 70px 90px,
    radial-gradient(circle, #fff 2.5px, transparent 3.5px) 30px 40px / 90px 70px,
    radial-gradient(circle, var(--green) 3px, transparent 4px) 50px 10px / 110px 100px,
    radial-gradient(circle, var(--gold) 2.5px, transparent 3.5px) 10px 60px / 80px 120px;
  animation: drift 14s linear infinite; }
@keyframes drift { to { background-position: 0 300px, 30px 340px, 50px 360px, 10px 420px; } }
.skeleton { height: 120px; border-radius: var(--r); background: linear-gradient(90deg, var(--track), var(--surface), var(--track)); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin: 14px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
/* Toast (UX 2026-11-19): above the tab bar and the phone's home bar; errors stay with a close button */
.toast { position: fixed; left: 50%; bottom: calc(72px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: var(--sp-2);
  background: #14213d; color: #fff; padding: 10px 18px; border-radius: var(--r-md); z-index: 60; font-weight: 700; width: max-content; max-width: min(92vw, 520px);
  box-shadow: var(--shadow-2); animation: toast-in var(--dur) var(--ease); }
.toast.error { background: #8f1d14; padding-right: 6px; }
.toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-x { flex: none; min-width: 44px; min-height: 44px; border: 0; border-radius: var(--r-sm); background: rgba(255, 255, 255, .16); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* Bottom sheet for confirm / edit (UX 2026-11-19) */
.sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 560px; max-height: 85dvh; padding: 0; border: 0; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); animation: sheet-in var(--dur) var(--ease); }
.sheet::backdrop { background: rgba(8, 18, 36, .5); }
.sheet-in { padding: 10px var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom)); }
.sheet-in::before { content: ""; display: block; width: 44px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: var(--line); }
.sheet-msg { font-size: 1.05rem; font-weight: 700; white-space: pre-line; margin: 0 0 var(--sp-4); }
.sheet-form label { margin-top: 0; }
.sheet-btns { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.sheet-btns .btn { flex: 1; }
.sheet .btn.ghost { color: var(--link); border-color: var(--link); } /* the sheet sits outside main: no white-on-white Cancel */
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@media (min-width: 620px) { .sheet { inset: 0; margin: auto; height: max-content; border-radius: 22px; } .sheet-in { padding-bottom: var(--sp-4); } }
/* Empty / error states (UX 2026-11-19) */
.state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-5) var(--sp-4); margin: var(--sp-3) 0;
  border: 2px dashed var(--line); border-radius: var(--r-md); color: var(--muted); }
.state-ic { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.state-msg { margin: 0; font-weight: 600; max-width: 34ch; }
.state.error { border-color: var(--bad-text); color: var(--bad-text); background: var(--bad-bg); }
.card .state { margin: var(--sp-2) 0 0; padding: var(--sp-4) var(--sp-3); }
.card.blue .state { color: #e8f0fb; border-color: rgba(255, 255, 255, .4); }
/* Headings with a line icon instead of emoji (UX 2026-11-19) */
.ic-h { display: flex; align-items: center; gap: var(--sp-2); }
.ic { flex: none; width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.devbar { background: var(--surface-warm); padding: 6px 16px; text-align: center; font-size: .85rem; }

@media (min-width: 620px) { .tiles { grid-template-columns: repeat(4, 1fr); } .hero img { max-height: 560px; } }
@media (prefers-reduced-motion: reduce) {
  .confetti, .skeleton, .mic.rec .mic-btn, .toast, .sheet { animation: none; }
  .nav a svg { transition: none; }
  .btn:active { transform: none; }
  * { scroll-behavior: auto !important; }
}

/* Admin reset PIN (2026-11-16) */
.reset { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: 100%; }
/* Admin people list: the action buttons get their own full-width row so none run off a phone screen. */
.list li > .reset { flex-basis: 100%; }
.reset input { width: 9.5em; min-height: 44px; }

/* Matches (2026-11-16) */
.page-title { margin: 14px 0 0; color: var(--heading); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.chip { min-height: 44px; padding: 8px 14px; border-radius: 99px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.chip.on { background: var(--blue); border-color: var(--blue-d); color: #fff; }
.chips.ro .chip { min-height: 0; padding: 2px 12px; font-size: .85rem; cursor: default; }
.chip.bad { background: var(--bad-bg); border-color: var(--red); color: var(--bad-text); }
.chip.good { background: var(--good-bg); border-color: var(--green); color: var(--good-text); }
.chip.zone { background: var(--surface-2); border-color: var(--blue); color: var(--heading); }
.chip-title { margin: 10px 0 0; font-weight: 800; color: var(--heading); }
.fld { display: block; margin: 8px 0; }
.fld > span { display: block; font-weight: 700; font-size: .9rem; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.match-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.score b { font-size: 1.6rem; color: var(--link); }
.coach-note { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; }
.review-panel { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 6px; }
.tiles.stats { grid-template-columns: 1fr 1fr; }
.muted-on { color: #e8f0fb; }
.scores { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.score-chip { min-width: 44px; text-align: center; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); color: var(--heading); font-weight: 800; }
@media (min-width: 620px) { .grid4 { grid-template-columns: repeat(4, 1fr); } .tiles.stats { grid-template-columns: repeat(4, 1fr); } }

/* Drill planner (2026-11-16) */
.datebar { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.datebar input { flex: 1; min-width: 0; }
.datebar .btn { font-size: 1.4rem; padding: 4px 16px; }
.day-head { margin: 4px 0 0; font-size: 1.05rem; }
.slot-theme { margin: 0 0 6px; }
.slot-theme .theme { font-weight: 800; color: var(--heading); }
.total { margin: 0 0 8px; padding: 6px 12px; border-radius: 12px; background: var(--good-bg); color: var(--good-text); }
.total.over { background: var(--bad-bg); color: var(--bad-text); font-weight: 700; }
.plan-item { align-items: center; }
.plan-item.is-done .grow strong { text-decoration: line-through; color: var(--muted); }
.tick.big { min-width: 56px; min-height: 56px; font-size: 1.8rem; }
.done-mark { color: var(--good-text); font-weight: 800; white-space: nowrap; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.chip-ro { padding: 1px 10px; border-radius: 99px; background: var(--surface-2); color: var(--heading); font-size: .8rem; font-weight: 700; }
.plan-item .pill { margin-left: 8px; }
.xbtn { min-width: 44px; min-height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--bad-text); font-size: 1.2rem; font-weight: 800; cursor: pointer; }
.add-drill { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 8px; }
.add-drill h3 { font-size: 1.05rem; color: var(--heading); }
.picks { list-style: none; margin: 4px 0; padding: 0; max-height: 280px; overflow-y: auto; border-radius: 14px; }
.picks:empty { display: none; }
.pick { display: block; width: 100%; min-height: 48px; padding: 10px 14px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line); border-top-width: 0; cursor: pointer; }
.picks li:first-child .pick { border-top-width: 2px; border-radius: 14px 14px 0 0; }
.picks li:last-child .pick { border-radius: 0 0 14px 14px; }
.picks li:only-child .pick { border-radius: 14px; }
.pick:hover, .pick:focus-visible { background: var(--surface-2); }
.pick-none { padding: 10px 14px; }
.chosen { margin: 6px 0; font-weight: 700; }
.add-drill .grid2 { margin: 8px 0; }
.add-drill .grid2 > * { min-width: 0; }
.new-skill { border: 2px dashed var(--line); border-radius: 14px; padding: 4px 12px 12px; margin-top: 10px; }
@media (max-width: 420px) { .nav a { font-size: .82rem; } }

/* Review before share (2026-11-16) */
.note-review { width: 100%; margin-top: 10px; padding: 12px; border: 2px dashed var(--gold); border-radius: 16px; background: var(--surface-warm); text-align: left; }
.note-review audio { width: 100%; margin: 8px 0; }
.note-review .note-ml { margin: 4px 0; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.del-note { color: var(--bad-text) !important; border-color: var(--red) !important; }
.bub .del-note { min-height: 36px; padding: 2px 12px; font-size: .85rem; margin-top: 4px; }
.note-edit { width: 100%; margin-top: 8px; }
.note-edit textarea { min-height: 90px; }

/* Bug hunt 2026-11-16: links that act as buttons get a 44px tap area; white on blue cards. */
a.more { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; font-weight: 700; }
.card.blue a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.welcome .msg, .welcome .btn, .welcome h1 { position: relative; z-index: 1; }

/* UX batch 2026-11-16 */
.pin-wrap { display: flex; gap: 8px; align-items: center; }
.pin-wrap input { flex: 1; }
.show-pin { flex: none; }
main .btn.ghost.danger, .btn.ghost.danger { color: var(--bad-text); border-color: var(--red); }
.reset-danger { margin-top: 6px; }
/* UX 2026-11-16: per-field form errors */
.field-err { display: block; color: var(--bad-text); font-weight: 700; font-size: .9rem; margin-top: 4px; }
[aria-invalid="true"] { border-color: var(--red) !important; box-shadow: 0 0 0 2px rgba(200,30,30,.15); }
/* Voice player 2026-11-16: real length + working bar */
.vplayer { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.vplayer audio { display: none; }
.vp-btn { min-width: 44px; min-height: 44px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 1rem; cursor: pointer; }
.vp-btn:disabled { opacity: .6; }
.vp-bar { flex: 1; min-width: 0; accent-color: var(--blue); height: 28px; }
.vp-time { font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; color: var(--muted, #555); }
/* Reminders card 2026-11-16 */
.reminders input[type=time] { min-height: 44px; font-size: 1rem; }
.reminders .muted { color: #e8f0ff; }
.reminders .fld span { color: #fff; font-weight: 700; }
.reminders [aria-live] { color: #fff; font-weight: 700; }

/* DEVAN's own space (PO 2026-11-16): affirmations, diary, goals */
.page-title { font-size: 1.5rem; margin: 6px 0 2px; }
.affirm-list { margin: 8px 0 12px; padding-left: 1.4em; }
.affirm-list li { margin: 10px 0; font-size: 1.12rem; font-weight: 700; line-height: 1.35; }
.affirm-list .row-actions { display: flex; gap: 6px; margin-top: 4px; font-size: .9rem; font-weight: 400; }
.streak { font-weight: 800; color: var(--accent-text); }
.done-today { font-weight: 800; color: var(--good-text); }
.btn.tiny { min-height: 36px; min-width: 36px; padding: 4px 12px; font-size: .85rem; }
.inline-add { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.inline-add input { flex: 1; width: auto; min-width: 0; }
.inline-add .btn { flex: none; }
.lock { font-size: .92rem; background: var(--surface-warm); border-radius: 12px; padding: 8px 12px; }
.lbl { font-weight: 700; font-size: .9rem; color: var(--muted); margin: 10px 0 0; }
.chip.emo { font-size: 1.5rem; min-width: 52px; padding: 4px 10px; }
.diary-entry, .goal-group, .new-goal { border-top: 1px solid var(--line); padding: 10px 0; }
.diary-entry summary, .goal-group summary, .new-goal summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.diary-entry p { margin: 6px 0; white-space: pre-wrap; }
.horizon { margin-top: 16px; color: var(--link); }
.goal { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 10px 0; background: var(--surface); }
.goal.done { border-color: var(--green); background: var(--good-bg); }
.goal.dropped { opacity: .7; }
.goal .why { margin: 4px 0; }
.progress-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.progress-row progress { flex: 1; height: 14px; accent-color: var(--green); }
.goal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.goal-actions input[type=range] { flex: 1 1 160px; min-height: 36px; padding: 0; border: 0; accent-color: var(--blue); }
.goal-comments .gc { margin: 6px 0; font-size: .95rem; }
.goal-comments .gc .btn { margin-left: 6px; }
.diary-form > .btn { margin: 10px 0 16px; }

/* Learn */
.learn-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scrollbar-width: none; }
.learn-tabs::-webkit-scrollbar { display: none; }
.learn-tab { flex: none; scroll-snap-align: start; }
/* Edge fade shows there are more chips to swipe to (UX 2026-11-19); learn.js sets the classes */
.learn-tabs.more-r { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.learn-tabs.more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%); mask-image: linear-gradient(90deg, transparent, #000 15%); }
.learn-tabs.more-l.more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
.learn-tab[aria-selected="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
/* Coaching points tabs (PO 2026-11-19) */
.pt-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0 12px; padding: 4px; border-radius: 16px; background: linear-gradient(135deg, var(--surface-2), var(--surface-warm)); border: 1px solid var(--line); box-shadow: inset 0 1px 2px rgba(18, 63, 122, .08); }
@media (max-width: 339px) { .pt-seg { grid-template-columns: 1fr 1fr; } }
.pt-tab { position: relative; min-height: 52px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 4px 9px; border: 0; border-radius: 12px; background: transparent; color: var(--heading); font: inherit; font-size: .85rem; font-weight: 800; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.pt-tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-tab[aria-selected="true"] { background: linear-gradient(135deg, var(--blue), var(--blue-d)); color: #fff; box-shadow: 0 4px 14px rgba(26, 95, 180, .35); }
.pt-badge { min-width: 22px; padding: 0 6px; border-radius: 99px; font-size: .75rem; line-height: 18px; background: #b45f06; color: #fff; }
.pt-badge.zero { background: var(--track); color: var(--muted); }
.pt-tab[aria-selected="true"] .pt-badge.zero { background: rgba(255, 255, 255, .25); color: #fff; }
.pt-meter { position: absolute; left: 12px; right: 12px; bottom: 4px; height: 3px; border-radius: 3px; background: rgba(18, 63, 122, .12); overflow: hidden; }
.pt-tab[aria-selected="true"] .pt-meter { background: rgba(255, 255, 255, .25); }
.pt-meter-fill { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--saffron), var(--green)); }
/* Point groups (owner 2026-11-30): one card per root problem, with its points and drills. */
.pg-card { margin: 10px 0; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.pg-title { margin: 0 0 4px; font-size: 1.05rem; }
.pg-sub { margin: 12px 0 4px; font-size: .95rem; }
.pg-root { margin: 0 0 6px; }
.pg-progress { margin: 0 0 4px; font-weight: 600; }
.pt-meter.pg-meter { position: static; display: block; margin: 4px 0 8px; }
.pg-drill { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; }
.pg-btn { min-height: 44px; }
.pg-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.pg-move { min-height: 44px; max-width: 100%; }
.pg-suggest { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pg-card .pt-edit input { width: 100%; box-sizing: border-box; margin: 4px 0; min-height: 44px; }
/* Standard problems (owner 2026-12-01): one row per problem, folded; the coaches who raised it sit under the title. */
.sp-row { margin: 6px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sp-row > summary { cursor: pointer; min-height: 44px; padding: 8px 12px; display: grid; gap: 2px; list-style: none; }
.sp-row > summary::-webkit-details-marker { display: none; }
.sp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sp-coaches { font-size: .85rem; overflow-wrap: anywhere; }
.sp-row > .list { padding: 0 12px 8px; }
.sp-by { font-weight: 700; }
.pt-panel:focus-visible { outline-offset: 4px; border-radius: 8px; }
.pt-type { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 6px; font-size: .75rem; font-weight: 800; background: var(--surface-2); color: var(--heading); }
.pt-type.fault { background: var(--bad-bg); color: var(--bad-text); } .pt-type.strength { background: var(--good-bg); color: var(--good-text); }
.pt-skill { display: inline; } .pt-text { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.pt-empty { margin: 4px 0; }
.pt-done { margin-top: 8px; } .pt-done > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--good-text); }
@media (prefers-reduced-motion: reduce) { .pt-tab { transition: none; } }
.learn-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .learn-grid { grid-template-columns: 1fr 1fr; } }
.learn-card { display: block; text-decoration: none; color: var(--text); margin: 0; }
.learn-card strong { display: block; color: var(--heading); font-size: 1.05rem; margin: 2px 0 4px; }
.learn-card p { margin: 4px 0 8px; }
.learn-back { display: inline-block; min-height: 44px; line-height: 44px; font-weight: 700; text-decoration: none; }
.learn-kicker { margin: 0; font-weight: 700; text-transform: uppercase; font-size: .78rem; letter-spacing: .04em; }
.learn-sec h3 { color: var(--heading); margin: 18px 0 6px; font-size: 1.05rem; }
.learn-sec:first-child h3 { margin-top: 0; }
.learn-list { margin: 0; padding-left: 20px; }
.learn-list li { margin: 4px 0; overflow-wrap: anywhere; }
.learn-fault { border-left: 4px solid var(--saffron); padding: 4px 0 4px 10px; margin: 10px 0; }
.learn-fault p { margin: 3px 0; }
.learn-quote { margin: 4px 0; padding-left: 10px; border-left: 3px solid var(--gold); font-style: italic; }
.learn-figs { display: grid; gap: 12px; grid-template-columns: 1fr; }
.learn-fig { margin: 8px 0; }
.learn-fig[hidden] { display: none; }
.learn-fig img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.learn-fig figcaption { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.learn-fig { container-type: inline-size; }
.learn-photo-legend { display: none; }
@container (max-width: 562px) { .learn-photo-legend { display: block; } }
.learn-photo-legend ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.learn-photo-legend li { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; line-height: 1.35; }
.learn-num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #1f5fbf; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 800; }
.learn-photo-legend p { margin: 6px 0 0; font-size: .88rem; }
.learn-photo { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; aspect-ratio: 8 / 5; }
.learn-fig .learn-photo img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; background: transparent; }
.learn-zoom { cursor: zoom-in; border-radius: 12px; }
.learn-zoom:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.learn-zoom-hint { display: none; }
@media (max-width: 760px) { .learn-zoom-hint { display: inline; font-weight: 600; color: var(--heading); } }
html.learn-viewer-open, html.learn-viewer-open body { overflow: hidden; }
.learn-viewer { position: fixed; inset: 0; z-index: 1000; background: #fff; color: #14213d; overflow: auto; -webkit-overflow-scrolling: touch; }
.learn-viewer-bar { position: sticky; top: 0; left: 0; z-index: 1; display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); width: 100vw; box-sizing: border-box; }
.learn-viewer-title { font-weight: 700; color: var(--blue-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.learn-viewer-close { min-height: 44px; min-width: 88px; font-size: 1rem; font-weight: 700; border-radius: 10px; border: 1px solid var(--line); background: var(--blue); color: #fff; flex: none; }
.learn-viewer-pic { width: max(820px, 100vw); max-width: 1400px; margin: 8px 0; padding: 0 8px; box-sizing: border-box; }
.learn-viewer-tip { padding: 0 12px 16px; font-size: .9rem; position: sticky; left: 0; width: 100vw; box-sizing: border-box; }
.learn-skills-h { margin: 22px 0 6px; }
.learn-skill { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; }
.learn-skill > summary { cursor: pointer; min-height: 48px; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.learn-code { font-weight: 800; color: var(--link); }
.learn-level { flex-basis: 100%; }
.learn-skill-body { padding: 0 14px 14px; }
.learn-skill-body h4 { color: var(--heading); margin: 14px 0 4px; }
.learn-cue { background: var(--surface-warm); border-left: 5px solid var(--saffron); border-radius: 10px; padding: 10px 12px; font-weight: 800; font-size: 1.05rem; margin: 6px 0 10px; }
.learn-drill { border-top: 1px dashed var(--line); padding: 8px 0; }
.learn-drill p { margin: 3px 0; }
.learn-audio { margin: 4px 0 8px; }
.lesson-link { font-size: .82rem; font-weight: 700; margin-left: 4px; }

/* Desktop layout (2026-11-16, owner report). Phones and tablets below 1024px are unchanged. */
@media (min-width: 1024px) {
  .top-in { max-width: none; padding: 8px 28px; }
  /* tab bar becomes a left sidebar under the header */
  .nav { top: 0; right: auto; bottom: 0; width: 220px; z-index: 10; flex-direction: column; justify-content: flex-start;
    padding: 76px 12px 16px; background: var(--surface); border-top: 0; border-right: 1px solid var(--line);
    -webkit-backdrop-filter: none; backdrop-filter: none; overflow-y: auto; }
  .nav a { flex: none; max-width: none; min-height: 48px; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 6px 14px; border-radius: 12px; font-size: .98rem; margin-bottom: 2px; }
  .nav a svg { width: 24px; height: 24px; padding: 0; border-radius: 0; flex: none; }
  .nav a[aria-current="page"] svg { background: none; }
  .nav a.nav-extra { display: flex; }
  .nav a:hover { background: var(--hover); }
  .nav a[aria-current="page"] { background: var(--surface-2); color: var(--heading); }
  .nav a[aria-current="page"] svg { transform: none; }
  .nav a:focus-visible { outline: 3px solid var(--saffron); outline-offset: -2px; }
  main { max-width: 1180px; margin: 0 0 0 220px; padding: 20px 32px 48px; }
  .toast { bottom: 24px; left: calc(50% + 110px); }
  main[data-route="home"] > .more-sec { grid-column: 1 / -1; }
  main[data-route="home"] { grid-auto-flow: row dense; } /* full-width cards must not leave holes beside the hero / Today */

  /* cards that sit in a grid lose their stacking margins */
  main[data-route="home"], main[data-route="matches"], main[data-route="me"], main[data-route="admin"] {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  main[data-route="home"] > *, main[data-route="matches"] > *, main[data-route="me"] > *, main[data-route="admin"] > * { margin-top: 0; margin-bottom: 0; }
  main[data-route="home"] > .tiles, main[data-route="home"] > .road-card,
  main[data-route="matches"] > :not(.match-card), main[data-route="me"] > :not(.card), main[data-route="admin"] > :not(.card),
  main[data-route="admin"] > .card.blue-top { grid-column: 1 / -1; }
  main[data-route="home"] > .hero { min-height: 0; }
  /* portrait hero (640x794): full picture in the left column, cards stack beside it */
  main[data-route="home"] > .hero { grid-column: 1; grid-row: span 4; align-self: start; }
  main[data-route="home"] .hero img { height: auto; max-height: 640px; width: 100%; object-fit: contain; }
  main[data-route="home"] > .review, main[data-route="home"] > .mic-card { grid-column: 1 / -1; }

  /* planner: the day's drills on the left, the add-drill form on the right */
  main[data-route="plan"] .card.green, main[data-route="plan"] .card.gold { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  main[data-route="plan"] .card.green > *, main[data-route="plan"] .card.gold > * { grid-column: 1; }
  main[data-route="plan"] .card.green > .add-drill, main[data-route="plan"] .card.gold > .add-drill { grid-column: 2; grid-row: 1 / span 6; margin-top: 0; }

  /* chats */
  main[data-route="threads"] > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  main[data-route="threads"] > div > .card { margin: 0; }
  main[data-route="thread"] { max-width: 820px; }

  /* learn */
  main[data-route="learn"] .learn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .learn-layout { display: block; }
  .learn-main { max-width: 760px; }
}
@media (min-width: 1200px) {
  .learn-layout { display: grid; grid-template-columns: minmax(0, 760px) 240px; gap: 32px; align-items: start; }
  .learn-toc { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
  .learn-toc b { color: var(--heading); margin-bottom: 6px; }
  .learn-toc-link { text-align: left; min-height: 40px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: .92rem; color: var(--link); cursor: pointer; }
  .learn-toc-link:hover { background: var(--surface-2); }
  .learn-toc-link:focus-visible { outline: 3px solid var(--saffron); outline-offset: -2px; }
}
@media (min-width: 1400px) {
  main[data-route="home"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* the contents list only shows beside the lesson on wide screens */
.learn-toc { display: none; }
@media (min-width: 1200px) { .learn-toc { display: flex; } }

/* DCPL short name under the login title (PO 2026-11-16) */
.login-wrap .dcpl { margin: -4px 0 6px; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); text-align: center; }

/* Home "Today" card + folding Progress section (UX 2026-11-19) */
.card.today { border-top: 6px solid var(--blue); }
.today-date { margin: 0; font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.today-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); }
.today-stat { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.today-stat b { font-size: 1.5rem; line-height: 1.1; color: var(--link); font-variant-numeric: tabular-nums; }
.today-stat small { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); line-height: 1.2; }
.today-stat.is-warn b { color: var(--accent-text); }
.today-stat.is-ok b { color: var(--good-text); }
.today-sub { margin: 0; font-weight: 700; color: var(--heading); }
.today-rest { font-weight: 700; }
.more-sec { margin: 14px 0; }
.more-sec > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-height: 52px; padding: 12px 16px; cursor: pointer; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); font-weight: 800; font-size: var(--fs-lg); color: var(--heading); }
.more-sec > summary::-webkit-details-marker { display: none; }
.more-sec > summary::after { content: ""; margin-left: auto; align-self: center; width: 10px; height: 10px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor;
  transform: rotate(45deg) translateY(-3px); transition: transform var(--dur) var(--ease); }
.more-sec[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.more-sec > summary small { font-weight: 600; font-size: var(--fs-sm); }
.hw-done { flex: none; }
.hw-state { flex: none; align-self: center; }
.hw-state.done { background: var(--good-bg); color: var(--good-text); }
.list li > .state { flex: 1 1 100%; }
.acct-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
@media (max-width: 359px) { .today-stat { padding: 6px 8px; } .today-stat b { font-size: 1.25rem; } }
@media (prefers-reduced-motion: reduce) { .more-sec > summary::after { transition: none; } }

/* Dark mode overrides that must come after the base rules (UX 2026-11-19) */
@media (prefers-color-scheme: dark) {
  main .btn.ghost { color: var(--link); border-color: var(--link); }
  .pt-tab[aria-selected="true"] { box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
}

/* Kaaval Maalakha, the guardian angel (2026-11-22). Floats above the tab bar; drag to move, tap to shrink. */
.angel { position: fixed; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; width: 110px; touch-action: none; cursor: grab;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; outline-offset: 4px; transition: width var(--dur) var(--ease); }
.angel.placed { right: auto; bottom: auto; }
.angel.mini { width: 56px; }
.angel-img { display: block; width: 100%; height: auto; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(201, 154, 74, .6)); animation: angel-float 5s ease-in-out infinite; }
.angel.joy .angel-img { animation: angel-joy 1.2s var(--ease) 1, angel-float 5s ease-in-out 1.2s infinite; }
.angel-bubble { position: absolute; bottom: 100%; right: 0; width: max-content; max-width: min(240px, calc(100vw - 24px)); margin-bottom: 8px; padding: 10px 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--gold); border-radius: var(--r-md); box-shadow: var(--shadow); font-size: var(--fs-sm); line-height: 1.35; }
.angel-bubble[hidden] { display: none; }
.angel-bubble::after { content: ""; position: absolute; right: 28px; top: 100%; border: 7px solid transparent; border-top-color: var(--gold); }
.angel-spark { position: absolute; bottom: 30%; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); pointer-events: none; opacity: 0; animation: angel-spark 1.4s ease-out forwards; }
@keyframes angel-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes angel-joy { 0% { transform: scale(1); } 35% { transform: scale(1.22) rotate(-4deg); } 70% { transform: scale(.96) rotate(3deg); } 100% { transform: scale(1); } }
@keyframes angel-spark { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-110px) scale(.3); } }
@media (min-width: 620px) { .angel { width: 130px; } .angel.mini { width: 64px; } }
@media (prefers-reduced-motion: reduce) {
  .angel, .angel-img, .angel.joy .angel-img, .angel-spark { animation: none; transition: none; }
  .angel-spark { display: none; }
}
/* Angel chat sheet (2026-11-23): bottom sheet for DEVAN and his parent. Theme variables only, so dark mode stays readable. */
html.angel-chat-open, html.angel-chat-open body { overflow: hidden; }
.angel-chat-back { position: fixed; inset: 0; z-index: 900; display: flex; align-items: flex-end; justify-content: center; background: rgba(13, 22, 38, .55); }
.angel-chat { display: flex; flex-direction: column; width: 100%; max-width: 560px; height: min(86vh, 720px); box-sizing: border-box; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-md) var(--r-md) 0 0; box-shadow: var(--shadow); }
.angel-chat-bar { display: flex; align-items: center; gap: 8px; justify-content: space-between; color: var(--heading); }
.angel-chat-bar .btn { min-height: 36px; padding: 4px 12px; margin-left: auto; }
.angel-chat-close { min-width: 44px; min-height: 44px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 1.1rem; cursor: pointer; }
.angel-chat-tabs { display: flex; gap: 8px; margin: 8px 0; }
.angel-chat-tab { flex: 1; min-height: 44px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.angel-chat-tab.on { background: var(--surface-2); border-color: var(--gold); color: var(--heading); }
.angel-chat-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.angel-chat-chat[hidden], .angel-chat-quiz[hidden] { display: none; }
.angel-chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; -webkit-overflow-scrolling: touch; }
.angel-msg { max-width: 88%; padding: 10px 12px; border-radius: var(--r-md); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.angel-msg.bot { align-self: flex-start; background: var(--surface-warm); color: var(--text); border: 1px solid var(--gold); }
.angel-msg.me { align-self: flex-end; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.angel-note { align-self: flex-start; font-size: var(--fs-sm); color: var(--good-text); }
.angel-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.angel-chip { min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--link); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.angel-chat-pending { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.angel-pending-card { padding: 10px 12px; border: 2px solid var(--gold); border-radius: var(--r-md); background: var(--surface-warm); color: var(--text); }
.angel-pending-card p { margin: 4px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.angel-chat-row { display: flex; align-items: flex-end; gap: 6px; margin-top: 8px; }
.angel-chat-input { flex: 1; min-width: 0; min-height: 48px; max-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; resize: none; }
.angel-chat-icon { flex: none; min-width: 48px; min-height: 48px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 1.2rem; cursor: pointer; }
.angel-chat-icon.rec { background: var(--red); color: #fff; }
.angel-chat-quiz { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.angel-quiz-q h3 { margin: 12px 0 6px; color: var(--heading); font-size: 1rem; }
.angel-quiz-opts { display: flex; flex-direction: column; gap: 6px; }
.angel-quiz-opt { min-height: 48px; padding: 8px 12px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.angel-quiz-opt.right { background: var(--good-bg); color: var(--good-text); border-color: var(--green); }
.angel-quiz-opt.try { background: var(--surface-warm); color: var(--accent-text); border-color: var(--gold); }
.angel-quiz-explain, .angel-quiz-score { margin: 6px 0; color: var(--text); font-weight: 600; }
@media (min-width: 620px) { .angel-chat-back { align-items: center; } .angel-chat { border-radius: var(--r-md); border-bottom: 1px solid var(--line); } }
/* Unshared notes card (2026-11-22) */
.card.drafts-card { border: 2px solid var(--gold); border-top-width: 6px; }
/* Privacy page + login link (2026-11-23, Play Store requirement) */
.privacy-page { max-width: 680px; margin: 0 auto; padding: 16px 16px 40px; color: var(--text); line-height: 1.55; }
.privacy-page h1, .privacy-page h2 { color: var(--heading); }
.privacy-page h2 { font-size: 1.1rem; margin-top: 22px; }
.privacy-page a, .privacy-link a { color: var(--link); }
.privacy-link { text-align: center; margin-top: 12px; }

/* Home tabs (owner option A, 2026-11-24) */
.home-tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; margin: 0 0 12px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.home-tab { flex: 1; min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.home-tab[aria-selected="true"] { background: var(--blue); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; }
.tab-badge[hidden], .home-panel[hidden] { display: none; }
.note.new { border-left: 4px solid var(--red); padding-left: 8px; }
.new-tag { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 6px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; vertical-align: 1px; }

/* Coaching point date line (owner 2026-11-24); points open 14+ days get a warm marker. */
.pt-when { display: block; margin-top: 3px; font-size: .78rem; color: var(--muted); }
.pt-old .pt-when { color: var(--red); font-weight: 600; }
.pt-old { box-shadow: inset 3px 0 0 var(--red); padding-left: 6px; }

/* Coach status buttons on a coaching point (owner 2026-11-24) */
.pt-set { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pt-set-btn { min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.pt-set-btn[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.pt-set-btn:disabled { opacity: .5; }
/* Point history and comment box (owner 2026-11-24: findings stay, with fixed dates) */
.pt-edit { margin-top: 6px; font-size: .85rem; }
.pt-edit summary { cursor: pointer; color: var(--blue); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.pt-edit[open] summary { margin-bottom: 6px; }
.pt-comment { width: 100%; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; }
.pt-hist { margin-top: 6px; font-size: .82rem; }
.pt-hist summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.pt-hist-list { margin: 6px 0 0; padding-left: 18px; color: var(--text); }
.pt-hist-list li { display: list-item; margin: 3px 0; padding: 0; border: 0; line-height: 1.35; }
.pt-hist-list li > span { display: inline; }
.pt-hist-when { color: var(--muted); }
.pt-hist-note { font-style: italic; }

/* DEVAN File, weekly check-in and scorecard draft (owner 2026-11-25) */
.card.amber { border-top: 6px solid var(--saffron); background: var(--surface-warm); }
.card.good { border-top: 6px solid var(--green); background: var(--good-bg); color: var(--good-text); }
.file-big { font-size: 1.15rem; font-weight: 800; margin: 4px 0; }
.file-agg { font-weight: 800; margin: 4px 0 8px; }
.file-alerts { margin: 6px 0 0; padding-left: 20px; } .file-alerts li { margin: 6px 0; font-weight: 700; color: var(--accent-strong); }
.table-wrap { overflow-x: auto; margin: 8px 0; }
.file-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.file-table th, .file-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.file-table td:last-child { white-space: normal; }
.card.blue .file-table th, .card.blue .file-table td { border-bottom-color: rgba(255, 255, 255, .25); }
.fit-list { margin: 0; padding: 0; list-style: none; }
.fit-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.fit-name { font-weight: 700; } .fit-trend { grid-column: 1 / -1; font-size: var(--fs-sm); font-weight: 800; }
.fit-trend.up { color: var(--good-text); } .fit-trend.down { color: var(--bad-text); } .fit-trend.same { color: var(--muted); }
.file-fit-form { margin-top: 12px; }
.week-list { margin: 0; padding: 0; list-style: none; }
.week-row { display: grid; grid-template-columns: 64px 1fr 28px; align-items: center; gap: 10px; padding: 4px 0; }
.week-bar { position: relative; display: block; height: 10px; border-radius: 6px; background: var(--track); overflow: hidden; }
.week-bar .pt-meter-fill { height: 100%; }
.rate-row { margin: 10px 0; } .rate-label { display: block; font-weight: 800; margin-bottom: 4px; }
.good-note { font-weight: 800; color: var(--good-text); }
.draft-note { margin: 8px 0 0; font-size: var(--fs-sm); }
.draft-note.amber { padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-warm); border: 2px solid var(--saffron); color: var(--accent-strong); font-weight: 800; }
.draft-note.err { color: var(--bad-text); }
.scorecard-pick { margin: 6px 0 10px; }
.vr-point { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.vr-point input { width: 24px; min-width: 24px; min-height: 24px; margin-top: 2px; }
.vr-text { display: block; margin: 4px 0; }
.vr-fb { padding: 0 0 10px 34px; }
.vr-fb-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vr-fb-why { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.vr-fb-btn { min-height: 44px; }
.vr-fb-btn.is-on { background: var(--accent-strong, #f5b800); color: #08142f; border-color: var(--accent-strong, #f5b800); font-weight: 800; }
.vr-fb-missed-box { margin: 12px 0; padding-top: 8px; border-top: 1px solid var(--line); }
.vr-fb-missed-box select { min-height: 44px; max-width: 100%; }
.vr-fb-missed { margin: 4px 0 8px; padding-left: 20px; }
.vr-camera-guide { margin: 8px 0; }
.vr-camera-guide summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 800; }
.vr-camera-guide ul { margin: 4px 0; padding-left: 20px; }
.vr-point-block { border-top: 1px solid var(--line); }
.vr-point-block .vr-point { border-top: 0; }
.vr-thumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 10px 34px; }
.vr-thumb { padding: 0; border: 2px solid var(--line); border-radius: 10px; background: #000; cursor: pointer; overflow: hidden; min-width: 44px; min-height: 44px; }
.vr-thumb img { display: block; height: 72px; width: auto; max-width: 128px; object-fit: cover; }
.vr-viewer { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; background: rgba(8, 18, 36, .92); }
.vr-viewer img { max-width: 100%; max-height: 75dvh; border-radius: 12px; background: #000; }
.vr-viewer-cap { color: #fff; margin: 0; text-align: center; }
.data-row { padding: 12px 0; border-top: 1px solid var(--line); }
.data-row:first-child { border-top: 0; }
.data-row h3 { margin: 0 0 4px; }
.vr-saw { font-weight: 800; color: var(--heading); margin: 0 0 6px; }
.vr-message { font-weight: 700; }
.vr-frames { margin: 10px 0; }
.vr-ask { font-weight: 700; margin: 0 0 4px; }
.vr-save { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.vr-past { margin-top: 14px; }
.vr-past-list { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 8px; }
.video-review video { width: 100%; max-height: 50vh; margin: 8px 0; border-radius: 12px; background: #000; }

/* Third Eye Studio (owner 2026-11-26): the highlight video block, saved video preview, report links in the past list */
.te-studio { margin: 14px 0; padding: 12px; border: 2px solid var(--gold); border-radius: var(--r-md); background: var(--surface-warm); }
.te-studio h3 { margin: 0 0 6px; }
.te-studio progress { width: 100%; height: 14px; margin: 8px 0; }
.te-preview { display: block; width: 100%; max-width: 360px; max-height: 70dvh; margin: 10px 0; border-radius: 12px; background: #000; }
.te-saved { margin: 8px 0; }
.vr-past-row { align-items: center; gap: 8px; flex-wrap: wrap; }

/* Third Eye Compare and share links (owner 2026-11-26) */
.cmp { margin-top: 12px; }
.cmp-body { margin-top: 8px; }
.cmp-controls { flex-wrap: wrap; gap: 8px; margin: 8px 0; align-items: center; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (orientation: portrait), (max-width: 640px) { .cmp-grid { grid-template-columns: 1fr; } }
.cmp-side { min-width: 0; }
.cmp-tip { margin: 0 0 4px; font-weight: 700; }
.cmp-label { width: 100%; max-width: 14rem; margin-bottom: 4px; }
.cmp-video { display: block; width: 100%; max-height: 45dvh; background: #000; border-radius: 12px; }
.cmp-side input[type=range] { width: 100%; }
.cmp-side .row { flex-wrap: wrap; gap: 8px; align-items: center; }
.cmp .chip[aria-pressed="true"] { background: var(--gold); color: #1b1b1b; font-weight: 800; }
.share-panel { margin: 10px 0; }
.share-url { width: 100%; max-width: 26rem; }
.share-new .row, .share-row { flex-wrap: wrap; gap: 8px; align-items: center; }

.vr-sync { margin: 8px 0; }
.vr-sync-videos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vr-sync-videos video { width: 100%; max-height: 220px; background: #000; }
.vr-sync-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }

/* Third Eye polish (owner 2026-11-26): one icon + pill system, a styled file picker, tidy buttons and past-review rows. */
.icon { flex: none; vertical-align: -3px; }
.te-pill { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 10px 2px 8px; border: 1px solid transparent; border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.te-pill .icon { vertical-align: 0; }
.te-ok { background: #e7f5e5; color: #0d5c06; border-color: #b7dfb2; }
.te-unsure { background: #fff6dc; color: #7a5600; border-color: #ecd28a; }
.te-removed { background: #eef0f3; color: #4a5568; border-color: #d3d8e0; }
.te-angle { background: #e6eefb; color: #1b3d7a; border-color: #bfd0ee; }
.te-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.te-stats .te-pill { margin-left: 0; }
.te-stats-title { font-weight: 700; font-size: .85rem; }
.te-info { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 8px 12px; border: 1px solid #bfd0ee; border-radius: 12px; background: #eef4fd; color: #1b3d7a; font-size: .9rem; }
.te-info .icon { margin-top: 2px; }
.te-point h3 .te-pill, .video-review .vr-point .te-pill { margin-left: 8px; }
.vr-point .te-pill { margin-left: 6px; }
.te-file-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0; }
.te-file-pick[hidden] { display: none; }
.te-file-input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; border: 0; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.te-file-btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.te-file-input:focus-visible + .te-file-btn { outline: 3px solid var(--link); outline-offset: 2px; }
.te-file-input:disabled + .te-file-btn { opacity: .6; cursor: not-allowed; }
.te-file-name { font-size: .9rem; overflow-wrap: anywhere; min-width: 0; }
.video-review .btn .icon { margin-right: 8px; vertical-align: -4px; }
.video-review .vr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.video-review .vr-go { margin: 16px 0 8px; }
.video-review .vr-save input[type=checkbox] { width: 18px; min-width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 0; accent-color: var(--blue); flex: none; }
.video-review .vr-save { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.video-review .vr-point input[type=checkbox] { width: 18px; min-width: 18px; height: 18px; min-height: 18px; padding: 0; margin-top: 3px; accent-color: var(--blue); }
.vr-chip { display: inline-flex; align-items: center; gap: 8px; }
.vr-chip .icon { margin: 0; }
.vr-past-list { align-items: stretch; gap: 0; }
.vr-past-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.vr-past-row:first-child { border-top: 0; }
.vr-past-open { flex: 1 1 14rem; min-height: 44px; padding: 4px 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.vr-past-open:hover { color: var(--link); }
.vr-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--link); font-weight: 700; text-decoration: none; }
.vr-link:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .video-review .te-ok { background: #15301a; color: #86dc80; border-color: #2d5a30; }
  :root:not([data-theme="light"]) .video-review .te-unsure { background: #3a3014; color: #ffd36b; border-color: #6b5a22; }
  :root:not([data-theme="light"]) .video-review .te-removed { background: #263246; color: #c4cede; border-color: #3b4a66; }
  :root:not([data-theme="light"]) .video-review .te-angle, :root:not([data-theme="light"]) .video-review .te-info { background: #1f3a63; color: #cfe0ff; border-color: #34578f; }
}

/* Progress monitor (2026-11-27): colours from the theme variables, so light and dark both read well. Shape + word carry the status too. */
.mon-svg { display: block; width: 100%; height: auto; max-width: 560px; }
.mon-t { fill: var(--muted); font-size: 10.5px; }
.mon-b { fill: var(--text); font-weight: 700; font-size: 12px; }
.mon-n { fill: #fff; font-size: 10px; font-weight: 800; }
.mon-track { fill: var(--track); }
.mon-axis { stroke: var(--line); stroke-width: 2; }
.mon-line { stroke: var(--link); }
.mon-dot { fill: var(--link); }
.mon-s-open { color: var(--bad-text); }
.mon-s-improving { color: var(--accent-text); }
.mon-s-fixed { color: var(--good-text); }
.mon-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 10px; font-size: var(--fs-sm); }
.mon-key { display: inline-flex; align-items: center; gap: 4px; }
.mon-swatch { width: 14px; height: 14px; }
.mon-list li, .mon-tl li { display: block; padding: 10px 0; }
.mon-tl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mon-badge { background: transparent; border-color: currentColor; }
.mon-b-open { color: var(--bad-text); }
.mon-b-improving { color: var(--accent-text); }
.mon-b-fixed { color: var(--good-text); }
.mon-metric h3 { margin: 12px 0 4px; font-size: var(--fs-md); }

/* APK 2.6 charts (.bm-*): pitch map, line & length, wagon wheel */
:root {
  --bm-yorker: #b42318; --bm-full: #b45f06; --bm-good: #0b5a04; --bm-short: #1a5fb4; --bm-bouncer: #6b3fa0;
  --bm-pitch: #efe2c4; --bm-ground: #e7f5e5; --bm-grid: #b9ad94; --bm-r0: #6b7280; --bm-r13: #1a5fb4; --bm-r4: #0b7a04; --bm-r6: #b8860b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bm-yorker: #ff8f85; --bm-full: #ffb15c; --bm-good: #86dc80; --bm-short: #8ab8ff; --bm-bouncer: #c9a4f2;
    --bm-pitch: #2a2416; --bm-ground: #15301a; --bm-grid: #5a6b88; --bm-r0: #a9b4c4; --bm-r13: #8ab8ff; --bm-r4: #86dc80; --bm-r6: #ffd166;
  }
}
:root[data-theme="dark"] {
  --bm-yorker: #ff8f85; --bm-full: #ffb15c; --bm-good: #86dc80; --bm-short: #8ab8ff; --bm-bouncer: #c9a4f2;
  --bm-pitch: #2a2416; --bm-ground: #15301a; --bm-grid: #5a6b88; --bm-r0: #a9b4c4; --bm-r13: #8ab8ff; --bm-r4: #86dc80; --bm-r6: #ffd166;
}
.bm-host { display: grid; gap: 14px; margin-top: 10px; }
.bm-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bm-filter select { min-width: 0; max-width: 100%; }
.bm-box { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; min-width: 0; }
.bm-box h3 { margin: 0 0 8px; font-size: var(--fs-md); color: var(--heading); }
.bm-svg { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; }
.bm-pitch { fill: var(--bm-pitch); stroke: var(--bm-grid); stroke-width: 1; }
.bm-band { fill: none; stroke: var(--bm-grid); stroke-width: .5; stroke-dasharray: 3 3; }
.bm-band.b-yorker { fill: var(--bm-yorker); fill-opacity: .12; } .bm-band.b-full { fill: var(--bm-full); fill-opacity: .12; }
.bm-band.b-good { fill: var(--bm-good); fill-opacity: .14; } .bm-band.b-short { fill: var(--bm-short); fill-opacity: .12; }
.bm-band.b-bouncer { fill: var(--bm-bouncer); fill-opacity: .12; }
.bm-stump { fill: var(--text); }
.bm-lbl, .bm-side { fill: var(--muted); font-size: 10px; font-weight: 700; }
.bm-side { font-size: 11px; letter-spacing: .06em; }
.bm-dot { stroke: var(--surface); stroke-width: 1; fill-opacity: .9; }
.bm-ground { fill: var(--bm-ground); stroke: var(--bm-grid); stroke-width: 1.5; }
.bm-axis { stroke: var(--bm-grid); stroke-width: .6; stroke-dasharray: 3 3; }
.bm-bat { fill: var(--text); }
.bm-ray { stroke-width: 1.6; stroke-linecap: round; }
.d-yorker { fill: var(--bm-yorker); } .d-full { fill: var(--bm-full); } .d-good { fill: var(--bm-good); } .d-short { fill: var(--bm-short); } .d-bouncer { fill: var(--bm-bouncer); }
.bm-ray.r0 { stroke: var(--bm-r0); } .bm-ray.r13 { stroke: var(--bm-r13); } .bm-ray.r4 { stroke: var(--bm-r4); } .bm-ray.r6 { stroke: var(--bm-r6); }
.bm-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 8px 0 0; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.bm-key::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; background: currentColor; vertical-align: -1px; }
.bm-key.d-yorker { color: var(--bm-yorker); } .bm-key.d-full { color: var(--bm-full); } .bm-key.d-good { color: var(--bm-good); } .bm-key.d-short { color: var(--bm-short); } .bm-key.d-bouncer { color: var(--bm-bouncer); }
.bm-key.r0 { color: var(--bm-r0); } .bm-key.r13 { color: var(--bm-r13); } .bm-key.r4 { color: var(--bm-r4); } .bm-key.r6 { color: var(--bm-r6); }
.bm-ll h4 { margin: 8px 0 4px; font-size: var(--fs-sm); color: var(--heading); }
.bm-row { display: grid; grid-template-columns: 6.5em 1fr auto; gap: 8px; align-items: center; font-size: var(--fs-sm); padding: 2px 0; }
.bm-bar { height: 8px; background: var(--track); border-radius: var(--r-pill); overflow: hidden; }
.bm-bar i { display: block; height: 100%; background: var(--link); border-radius: var(--r-pill); }
.bm-empty { color: var(--muted); margin: 0; }
.bm-err { margin: 0; }
@media (min-width: 900px) { .bm-host { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } }

/* ---- Matches | Analysis (2026-11-30) ---- */
.seg-switch { display: flex; gap: 4px; margin: 14px 0 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-pill); }
.seg { flex: 1; min-height: 44px; border: 0; border-radius: var(--r-pill); font: inherit; font-weight: 800; background: transparent; color: var(--muted); cursor: pointer; }
.seg.on { background: var(--blue); color: #fff; box-shadow: 0 2px 6px rgba(18, 63, 122, .25); }
.an-card h2 { margin: 0 0 4px; }
.an-mean { margin: 0 0 12px; color: var(--muted); font-size: var(--fs-sm); }
.an-mean b { color: var(--accent-text); }
.an-filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.an-filter-grid .fld { min-width: 0; }
.an-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.an-tiles { grid-template-columns: repeat(2, 1fr); margin: 0; }
.an-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.an-point { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r-sm); border-left: 6px solid var(--saffron); background: var(--surface-warm); }
.an-point.strength { border-left-color: var(--green); background: var(--good-bg); }
.an-tag { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-strong); }
.an-point.strength .an-tag { color: var(--good-text); }
.an-form, .an-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.an-form-row, .an-bar-row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: var(--fs-sm); }
.an-form-lbl, .an-bar-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-form-val, .an-bar-val { min-width: 3.2em; text-align: right; }
.an-track { display: block; height: 12px; background: var(--track); border-radius: var(--r-pill); overflow: hidden; }
.an-fill { display: block; height: 100%; background: var(--link); border-radius: var(--r-pill); }
.an-fill.warn { background: var(--saffron); }
.an-fill.good { background: var(--green); }
.an-line { margin: 10px 0 0; font-weight: 600; }
.an-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.an-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.an-table th, .an-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.an-table thead th { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .03em; }
.an-table th[scope="row"] { font-weight: 700; min-width: 8em; }
.an-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.match-meta { margin: 2px 0; font-weight: 600; }
@media (min-width: 700px) { .an-tiles { grid-template-columns: repeat(4, 1fr); } .an-filter-grid { grid-template-columns: repeat(4, 1fr); } }
@media print {
  .no-print, .top, .nav, .tricolor, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; page-break-inside: avoid; }
  .an-fill { background: #444 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .an-scroll { overflow: visible; }
}
