/* Off Script design system. Navy ink, one indigo accent, brand gradient for key moments. Light + dark.
   Shape rule: cards 20px, controls 12px, chips/badges and primary calls to action pill. */

@font-face { font-family: "Geist"; src: url("../vendor/fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; src: url("../vendor/fonts/geist-cyrillic-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Geist Mono"; src: url("../vendor/fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

@font-face { font-family: "Geist"; src: url("../vendor/fonts/geist-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

/* Off Script design tokens. Brand: navy ink + blue-to-violet gradient from the logo.
   The gradient is reserved for brand moments (logo, the main call to action, progress rings).
   Everything else uses one solid indigo accent so the interface stays calm. */
:root {
  --bg: #F6F6FB;
  --surface: #FFFFFF;
  --surface-2: #F0F0F8;
  --line: #E4E4EF;
  --line-strong: #CFCFE0;
  --ink: #0D1230;
  --ink-2: #3D4263;
  --muted: #646A8A;
  --accent: #4B44E8;
  --accent-hover: #3F38D6;
  --accent-ink: #FFFFFF;
  --accent-soft: #EDECFF;
  --accent-text: #3C35D4;
  --grad: linear-gradient(120deg, #2C7BFF 0%, #4B44E8 48%, #8B4DF6 100%);
  --grad-soft: linear-gradient(120deg, rgba(44, 123, 255, .10), rgba(139, 77, 246, .12));
  --good: #157A4E;
  --good-soft: #E3F5EC;
  --warn: #8A5A00;
  --warn-soft: #FDF2DA;
  --bad: #B4232F;
  --bad-soft: #FDE8EA;
  --shadow: 0 1px 2px rgba(13, 18, 48, .04), 0 12px 32px -12px rgba(13, 18, 48, .10);
  --shadow-lift: 0 2px 4px rgba(13, 18, 48, .05), 0 22px 44px -18px rgba(60, 53, 212, .28);
  --r-card: 20px;
  --r-ctl: 12px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --rail: 248px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --glow-a: rgba(124, 92, 255, .16);
  --glow-b: rgba(44, 123, 255, .10);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0D1E; --surface: #12162B; --surface-2: #191E37;
    --line: #252A47; --line-strong: #353B5E;
    --ink: #EEF0FF; --ink-2: #C3C7E6; --muted: #959BC0;
    --accent: #7D78FF; --accent-hover: #918CFF; --accent-ink: #0A0D1E; --accent-soft: #211F4D; --accent-text: #ADA9FF;
    --good: #5FD39A; --good-soft: #10291E; --warn: #F0C064; --warn-soft: #2C2410;
    --bad: #FF8A93; --bad-soft: #321419;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px -12px rgba(0, 0, 0, .5);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 22px 44px -18px rgba(125, 120, 255, .35);
    --glow-a: rgba(124, 92, 255, .20); --glow-b: rgba(44, 123, 255, .12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0D1E; --surface: #12162B; --surface-2: #191E37;
  --line: #252A47; --line-strong: #353B5E;
  --ink: #EEF0FF; --ink-2: #C3C7E6; --muted: #959BC0;
  --accent: #7D78FF; --accent-hover: #918CFF; --accent-ink: #0A0D1E; --accent-soft: #211F4D; --accent-text: #ADA9FF;
  --good: #5FD39A; --good-soft: #10291E; --warn: #F0C064; --warn-soft: #2C2410;
  --bad: #FF8A93; --bad-soft: #321419;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px -12px rgba(0, 0, 0, .5);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 22px 44px -18px rgba(125, 120, 255, .35);
  --glow-a: rgba(124, 92, 255, .20); --glow-b: rgba(44, 123, 255, .12);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.accent-text { color: var(--accent-text); }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100dvh; padding: 22px 16px 18px;
  display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand-name { font-weight: 650; font-size: 18px; letter-spacing: -0.03em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-ctl);
  text-decoration: none; color: var(--ink-2); font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a i { font-size: 19px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav a[aria-current="page"] i { color: var(--accent); }
.rail-foot { margin-top: auto; display: grid; gap: 10px; }
.streak-pill {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--r-ctl);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500;
}
.streak-pill i { color: var(--accent); font-size: 20px; }
.streak-pill small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; line-height: 1.2; }
.conn { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 12.5px; color: var(--muted); }
.conn b { font-weight: 500; color: var(--ink-2); }

main:focus { outline: none; }
main { min-width: 0; padding: 40px clamp(20px, 4vw, 56px) 72px; outline: none; }
.page { max-width: 1120px; margin: 0 auto; animation: rise 0.45s var(--ease) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 38px); }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 56ch; }

.tabbar { display: none; }

@media (max-width: 959px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  main { padding: 24px 16px 108px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; text-decoration: none;
    font-size: 11.5px; font-weight: 500; color: var(--muted); border-radius: var(--r-ctl);
  }
  .tabbar a i { font-size: 22px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] i { color: var(--accent); }
  .mobile-brand { display: flex !important; }
}
.mobile-brand { display: none; align-items: center; gap: 8px; margin-bottom: 18px; }
.mobile-brand svg { width: 24px; height: 24px; }
.mobile-brand span { font-weight: 650; letter-spacing: -0.03em; font-size: 17px; }

/* ---------- Primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; }
.card.flat { background: transparent; }
.card h3 { font-size: 16px; }
.eyebrow { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  min-height: 42px; padding: 0 18px; border-radius: var(--r-ctl); border: 1px solid transparent;
  font-weight: 550; text-decoration: none; transition: background 0.15s, transform 0.12s, border-color 0.15s, color 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn i { font-size: 18px; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 82%, var(--bg)); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-quiet { background: transparent; color: var(--ink-2); padding: 0 12px; }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.icon-btn { width: 40px; padding: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent; white-space: nowrap;
}
.chip.accent { background: var(--accent-soft); color: var(--accent-text); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip i { font-size: 14px; }

.seg { display: inline-flex; padding: 3px; border-radius: var(--r-ctl); background: var(--surface-2); gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 500; font-size: 14px; color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.field { display: grid; gap: 8px; }
.field > label, .label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-ctl); color: var(--ink);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { font-size: 13px; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background 0.2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform 0.2s var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); }

/* ---------- Practice ---------- */
.practice { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 28px; align-items: start; }
@media (max-width: 1100px) { .practice { grid-template-columns: 1fr; } }

.mode-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.mode {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; width: 100%; text-align: left;
  padding: 15px 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; transition: background 0.15s;
}
.mode:last-child { border-bottom: 0; }
.mode:hover { background: var(--surface-2); }
.mode .ico { width: 40px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-size: 20px; }
.mode b { display: block; font-weight: 600; letter-spacing: -0.01em; }
.mode span.d { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.mode .dur { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.mode[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.mode[aria-pressed="true"] .ico { background: var(--accent); color: var(--accent-ink); }

.setup { position: sticky; top: 24px; display: grid; gap: 20px; }
.topic-box { padding: 20px; border-radius: var(--r-ctl); background: var(--surface-2); display: grid; gap: 12px; }
.topic-text { font-size: clamp(20px, 2.2vw, 25px); line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.topic-box .chip { background: var(--surface); }
.topic-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stance { font-weight: 600; }

.hero-strip { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 14px; margin-bottom: 28px; }
@media (max-width: 760px) { .hero-strip { grid-template-columns: 1fr 1fr; } .hero-strip .daily { grid-column: 1 / -1; } }
.daily { display: grid; gap: 10px; align-content: space-between; background: var(--ink); color: var(--bg); border-color: var(--ink); }
.daily .eyebrow { color: color-mix(in srgb, var(--bg) 62%, var(--ink)); }
.daily .t { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.daily .btn { background: var(--accent); color: var(--accent-ink); justify-self: start; }
.stat { display: grid; gap: 4px; align-content: space-between; }
.stat .v { font-family: var(--font); font-feature-settings: "tnum"; font-size: 36px; letter-spacing: -0.04em; font-weight: 600; line-height: 1; }
.stat .v small { font-size: 14px; color: var(--muted); letter-spacing: 0; margin-left: 4px; }

.focus-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-ctl); background: var(--accent-soft); color: var(--ink); }
.focus-note i { color: var(--accent-text); font-size: 20px; margin-top: 1px; }
.focus-note b { font-weight: 600; }

/* ---------- Session ---------- */
.session { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .session { grid-template-columns: 1fr; } }
.stage {
  position: relative; border-radius: var(--r-card); overflow: hidden; background: #0d0d0d; aspect-ratio: 16 / 10;
  display: grid; place-items: center; border: 1px solid var(--line); color: #F3F3F0;
}
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.stage .blank { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 24px; color: #BDBDB8; }
.stage .blank i { font-size: 40px; color: #8F8F89; }
.wave { position: absolute; left: 0; right: 0; bottom: 0; height: 96px; width: 100%; pointer-events: none; }
.stage-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 8px; z-index: 2; }
.stage .chip { background: rgba(20, 20, 20, 0.66); color: #F3F3F0; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
.overlay-count {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; background: rgba(10, 10, 10, 0.55);
  font-family: var(--mono); font-size: clamp(84px, 16vw, 150px); font-weight: 500; color: #fff; letter-spacing: -0.05em;
}
.overlay-count.pop span { animation: pop 0.9s var(--ease) both; display: block; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); opacity: 0.9; } }

.timer-ring { position: relative; width: 168px; height: 168px; margin: 0 auto; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 7; }
.timer-ring .bg { stroke: var(--line); }
.timer-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.timer-ring .time { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.timer-ring .time b { font-family: var(--mono); font-size: 38px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.timer-ring .time small { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.side { display: grid; gap: 14px; }
.live-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.live-metrics > div { padding: 12px 14px; border-radius: var(--r-ctl); background: var(--surface-2); }
.live-metrics .k { font-size: 12.5px; color: var(--muted); }
.live-metrics .v { font-family: var(--mono); font-size: 24px; letter-spacing: -0.03em; }
.transcript-live { min-height: 92px; max-height: 160px; overflow: auto; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--surface-2); color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.transcript-live em { color: var(--muted); font-style: normal; }
.prompts { display: flex; gap: 6px; flex-wrap: wrap; }
.prompts .chip { transition: background 0.2s, color 0.2s; }
.prompts .chip.on { background: var(--accent); color: var(--accent-ink); }
.session-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.meter-mic { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter-mic i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.08s linear; }

/* ---------- Results ---------- */
.results-top { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .results-top { grid-template-columns: 1fr; } }
.player { border-radius: var(--r-card); overflow: hidden; background: #0d0d0d; border: 1px solid var(--line); }
.player video, .player audio { display: block; width: 100%; max-height: 420px; background: #0d0d0d; }
.player .audio-only { padding: 22px 18px; }
.player audio { max-height: none; background: transparent; }
.score-hero { display: grid; gap: 14px; }
.score-big { display: flex; align-items: baseline; gap: 10px; }
.score-big b { font-family: var(--font); font-feature-settings: "tnum"; font-size: 76px; font-weight: 600; letter-spacing: -0.05em; line-height: 0.9; }
.score-big span { color: var(--muted); font-size: 15px; }
.dim { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.dim:last-child { border-bottom: 0; }
.dim .n { font-weight: 550; }
.dim .n small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.dim .s { font-family: var(--mono); font-size: 20px; letter-spacing: -0.03em; text-align: right; }
.dim .bar { grid-column: 1 / -1; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.dim .bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.dim.locked .s { color: var(--muted); font-size: 13px; font-family: var(--font); letter-spacing: 0; }
.dim .delta { font-family: var(--mono); font-size: 12.5px; margin-left: 8px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }

.grid-2 { align-items: start; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 16px; }
.timeline { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.transcript { line-height: 1.8; color: var(--ink-2); font-size: 15px; }
.transcript mark { background: var(--warn-soft); color: var(--warn); padding: 1px 4px; border-radius: 4px; font-weight: 550; }
.coach-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.coach-list li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.coach-list li i { font-size: 18px; margin-top: 2px; }
.coach-list.good li i { color: var(--good); } .coach-list.fix li i { color: var(--accent-text); }
.one-thing { padding: 18px 20px; border-radius: var(--r-ctl); background: var(--accent-soft); }
.one-thing .eyebrow { color: var(--accent-text); }
.one-thing p { font-size: 17px; font-weight: 550; letter-spacing: -0.01em; margin-top: 4px; text-wrap: balance; }
.locked-card { display: grid; gap: 12px; padding: 22px; border: 1px dashed var(--line-strong); border-radius: var(--r-card); }
.locked-card p { color: var(--muted); max-width: 54ch; }
.follow-ups { display: grid; gap: 8px; }
.follow-ups button { text-align: left; padding: 12px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.follow-ups button:hover { background: var(--surface-2); }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-ctl); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Progress / Library ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
@media (max-width: 800px) { .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chart { width: 100%; height: 220px; display: block; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-2); display: block; }
.heat i[data-l="1"] { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.heat i[data-l="2"] { background: color-mix(in srgb, var(--accent) 60%, var(--surface-2)); }
.heat i[data-l="3"] { background: var(--accent); }
.mini-trend { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini-trend:last-child { border-bottom: 0; }
.mini-trend svg { grid-column: 1 / -1; width: 100%; height: 34px; }

.list { display: grid; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
.list-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background 0.15s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .ico { width: 44px; height: 44px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--surface-2); font-size: 20px; color: var(--ink-2); }
.list-row .t { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .m { color: var(--muted); font-size: 13px; }
.list-row .sc { font-family: var(--mono); font-size: 20px; letter-spacing: -0.03em; min-width: 40px; text-align: right; }
@media (max-width: 600px) { .list-row { grid-template-columns: 40px minmax(0, 1fr) auto; } .list-row .chip { display: none; } }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { max-width: 280px; }

.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 56px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-card); }
.empty i { font-size: 34px; color: var(--accent); }
.empty p { color: var(--muted); max-width: 44ch; }

/* ---------- Drills ---------- */
.drill-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.drill-grid .span { grid-column: 1 / -1; }
@media (max-width: 800px) { .drill-grid { grid-template-columns: 1fr; } }
.drill { display: grid; gap: 14px; align-content: space-between; }
.drill .ico { width: 44px; height: 44px; border-radius: var(--r-ctl); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 22px; }
.drill p { color: var(--muted); }
.drill .goal { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.script-box { padding: 16px 18px; border-radius: var(--r-ctl); background: var(--surface-2); line-height: 1.7; font-size: 16px; }

/* ---------- Settings ---------- */
.settings { display: grid; gap: 16px; max-width: 760px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-row .l b { display: block; font-weight: 550; }
.set-row .l span { color: var(--muted); font-size: 13.5px; }
code.inline { font-family: var(--mono); font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }

/* ---------- Toasts / modal ---------- */
#toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
@media (max-width: 959px) { #toasts { bottom: 92px; } }
.toast { pointer-events: auto; padding: 12px 16px; border-radius: var(--r-ctl); background: var(--ink); color: var(--bg); box-shadow: var(--shadow); animation: rise 0.3s var(--ease) both; display: flex; gap: 10px; align-items: center; }
.toast.err { background: var(--bad); color: #fff; }
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(10, 10, 10, 0.5); display: grid; place-items: center; padding: 16px; animation: fade 0.2s both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(480px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; display: grid; gap: 16px; box-shadow: var(--shadow); animation: rise 0.3s var(--ease) both; }
.modal h2 { font-size: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Mobile refinements */
body[data-route="session"] .tabbar { display: none; }
@media (max-width: 959px) {
  body[data-route="session"] main { padding-bottom: 110px; }
  body[data-route="session"] .session-actions {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
}

body[data-route="interview"] .tabbar { display: none; }
@media (max-width: 959px) {
  body[data-route="interview"] main { padding-bottom: 110px; }
  body[data-route="interview"] .session-actions {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
}

.steps-list { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 8px; }
.steps-list li { counter-increment: st; display: grid; grid-template-columns: 24px 1fr; gap: 2px 10px; font-size: 14px; }
.steps-list li::before { content: counter(st); grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 600; display: grid; place-items: center; font-family: var(--mono); }
.steps-list li b { font-weight: 600; }
.steps-list li span { color: var(--muted); line-height: 1.4; }
details.tips { font-size: 14px; }
details.tips summary { cursor: pointer; color: var(--ink-2); font-weight: 550; padding: 4px 0; }
details.tips ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 4px; }
.step-cue { font-size: 14px; color: var(--ink-2); min-height: 21px; }
.stage-btn { position: absolute; right: 14px; bottom: 14px; z-index: 2; border: 0; padding: 8px 12px; border-radius: 999px; background: rgba(20,20,20,.66); color: #F3F3F0; display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; }
.coverage { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.coverage li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.coverage li i { font-size: 18px; margin-top: 2px; }
.coverage li.yes i { color: var(--good); } .coverage li.no i { color: var(--bad); }
.coverage small { display: block; color: var(--muted); }
details.how summary { cursor: pointer; font-weight: 550; color: var(--ink-2); }
details.how dl { margin: 12px 0 0; display: grid; gap: 10px; font-size: 14px; }
details.how dt { font-weight: 600; } details.how dd { margin: 0; color: var(--muted); }
.breath { position: relative; width: 200px; height: 200px; margin: 0 auto; border: 2px solid var(--line-strong); border-radius: 20px; }
.breath-dot { position: absolute; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: var(--accent); left: 0; top: 0; animation: box 16s linear infinite; }
.breath-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; font-size: 18px; color: var(--ink-2); }
@keyframes box { 0% { left: 0; top: 100%; } 25% { left: 0; top: 0; } 50% { left: 100%; top: 0; } 75% { left: 100%; top: 100%; } 100% { left: 0; top: 100%; } }

/* ---------- Presentation ---------- */
body[data-route="rehearse"] .tabbar { display: none; }
.dropzone { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 36px 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-card); background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone:hover, .dropzone.over { background: var(--accent-soft); border-color: var(--accent); }
.dropzone > i { font-size: 34px; color: var(--accent); }
.dropzone .hint { max-width: 60ch; }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.deck-card { display: grid; gap: 12px; padding: 14px; text-decoration: none; transition: background .15s; }
.deck-card:hover { background: var(--surface-2); }
.thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: block; }
.text-thumb { display: grid; place-items: center; padding: 10px; background: var(--surface-2); text-align: center; font-size: 12.5px; line-height: 1.3; overflow: hidden; }
.title-input { width: 100%; font: inherit; font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -0.02em; border: 0; background: transparent; padding: 4px 0; margin-top: 6px; border-bottom: 1px dashed transparent; }
.title-input:hover, .title-input:focus { border-bottom-color: var(--line-strong); outline: none; }
.slide-list { display: grid; gap: 10px; }
.slide-row { display: grid; grid-template-columns: 28px 150px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.slide-num { color: var(--muted); font-size: 14px; padding-top: 4px; }
@media (max-width: 640px) { .slide-row { grid-template-columns: 24px 1fr; } .slide-row .thumb { grid-column: 2; } .slide-row > .stack { grid-column: 1 / -1; } }
.run-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.run-row:hover { background: var(--surface-2); }
.rehearse { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .rehearse { grid-template-columns: 1fr; } }
.slide-stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-card); overflow: hidden; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.slide-stage img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.text-slide { width: 100%; height: 100%; padding: 6% 7%; background: var(--surface); color: var(--ink); overflow: hidden; }
.text-slide h2 { font-size: clamp(20px, 3vw, 36px); margin-bottom: 18px; }
.text-slide ul { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: clamp(14px, 1.6vw, 20px); color: var(--ink-2); }
.rehearse-bar { display: flex; gap: 10px; align-items: center; }
.timer-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timer-pair .k { font-size: 12.5px; color: var(--muted); }
.timer-pair .v { font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; }
.notes-text { font-size: 15px; line-height: 1.6; max-height: 220px; overflow: auto; }
.cam-mini { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-card); overflow: hidden; background: #0d0d0d; display: grid; place-items: center; color: #BDBDB8; }
.cam-mini video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-mini .blank { display: grid; gap: 6px; justify-items: center; font-size: 13px; }
.next-thumb { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; opacity: .85; }
.next-thumb img { width: 100%; height: 100%; object-fit: contain; }
.next-thumb .text-slide { padding: 5%; } .next-thumb .text-slide h2 { font-size: 13px; margin-bottom: 6px; } .next-thumb .text-slide ul { font-size: 10px; gap: 2px; }
.fix-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.fix-list li { padding-left: 4px; }
.fix-list li::marker { color: var(--accent-text); font-weight: 700; }
.slide-res { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.slide-res > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 26px 120px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; }
.slide-res > summary::-webkit-details-marker { display: none; }
.slide-res > summary .sc { font-size: 20px; min-width: 34px; text-align: right; }
.slide-res[open] > summary { border-bottom: 1px solid var(--line); }
.slide-detail { padding: 16px 18px 18px; }
@media (max-width: 640px) { .slide-res > summary { grid-template-columns: 22px 80px minmax(0, 1fr); } .slide-res > summary .sc { display: none; } }
.time-bar { position: relative; height: 6px; border-radius: 99px; background: var(--line); display: block; }
.time-bar i { display: block; height: 100%; border-radius: inherit; }
.time-bar em { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--ink); opacity: .55; }
@media (max-width: 1000px) { .cam-mini { max-width: 240px; } }
@media (max-width: 959px) {
  body[data-route="rehearse"] main { padding-bottom: 110px; }
  body[data-route="rehearse"] .session-actions:not(:empty) {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  }
}
.research-clock { text-align: right; }
.research-clock .mono { font-size: 44px; letter-spacing: -0.04em; line-height: 1; }
body[data-route="research"] .tabbar { display: none; }
@media (max-width: 959px) {
  body[data-route="research"] main { padding-bottom: 110px; }
  body[data-route="research"] .session-actions { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .research-clock { text-align: left; }
}

.point-card { padding: 18px 20px; border-radius: var(--r-ctl); background: var(--surface-2); }
.main-point { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 6px 0 12px; text-wrap: balance; }
.point-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
@media (max-width: 700px) { .point-grid { grid-template-columns: 1fr; } }
.point-grid dt { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.point-grid dd { margin: 2px 0 0; font-size: 14.5px; }
.corrections { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.corrections li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--surface-2); }
.corrections .said { text-decoration: line-through; color: var(--muted); }
.corrections .better { font-weight: 600; }
.corrections i { color: var(--accent-text); }
.corrections small { flex-basis: 100%; color: var(--muted); }
.btn.moment { justify-content: flex-start; white-space: normal; text-align: left; height: auto; padding: 10px 14px; }
.btn.moment small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.btn.moment[disabled] { opacity: .7; }

/* ---------- Guides ---------- */
.guide { display: grid; gap: 14px; }
.guide-trains { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--accent-soft); }
.guide-trains i { color: var(--accent-text); font-size: 18px; margin-top: 2px; }
.guide-why { color: var(--ink-2); font-size: 16px; line-height: 1.6; max-width: 68ch; }
.guide-h { font-size: 16px; margin: 6px 0 2px; }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: gs; display: grid; gap: 14px; }
.guide-steps li { counter-increment: gs; position: relative; padding-left: 40px; }
.guide-steps li::before { content: counter(gs); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 600 13px var(--mono); display: grid; place-items: center; }
.guide-steps b { font-size: 16px; }
.guide-steps p { color: var(--ink-2); margin-top: 2px; }
.guide-steps blockquote { margin: 6px 0 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 14.5px; color: var(--ink); }
.guide-example { padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-ctl); }
.guide-example ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--ink-2); }
.guide-modal { width: min(760px, 100%); max-height: 88dvh; overflow: auto; }

/* ---------- Focus view ---------- */
.focus-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 14px; }
@media (max-width: 1000px) { .focus-grid { grid-template-columns: 1fr; } }
.focus-card { display: grid; gap: 14px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.focus-one { font-size: clamp(20px, 2.2vw, 26px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; text-wrap: balance; }
.focus-fixes { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.focus-fixes li::marker { color: var(--accent-text); font-weight: 700; }
.breakdown-toggle { margin: 4px 0 16px -12px; font-weight: 550; }
.retake { padding: 14px 16px; border-radius: var(--r-ctl); background: var(--surface-2); display: grid; gap: 6px; }
.retake-fix { font-weight: 550; }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.cmp th { text-align: left; font-weight: 550; color: var(--muted); font-size: 12.5px; padding: 4px 6px; }
.cmp td { padding: 6px; border-top: 1px solid var(--line); }
.cmp td:not(:first-child), .cmp th:not(:first-child) { text-align: right; }
.fix-banner { padding: 14px 16px; border-radius: var(--r-ctl); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.fix-banner .label { display: flex; gap: 6px; align-items: center; color: var(--accent-text); }
.fix-banner p { font-size: 17px; font-weight: 600; margin-top: 4px; letter-spacing: -0.01em; }

/* =====================================================================
   Redesign layer (Off Script brand). Overrides earlier rules on purpose.
   ===================================================================== */

/* Ambient glow behind everything: fixed, non-interactive, cheap to paint. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 85% -10%, var(--glow-a), transparent 70%),
    radial-gradient(50vw 45vh at -5% 10%, var(--glow-b), transparent 70%);
}
body { background: var(--bg); }

/* Brand */
.brand img { width: 32px; height: 32px; flex: none; border-radius: 9px; }
.brand-name { font-weight: 750; font-style: italic; font-size: 19px; letter-spacing: -0.035em; color: var(--ink); }
.topbar { display: none; }
@media (max-width: 959px) {
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 25; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .topbar .brand { padding: 0; }
  .topbar .brand img { width: 28px; height: 28px; border-radius: 8px; }
  .topbar .brand-name { font-size: 17px; }
  main { padding-top: 8px; }
  body[data-route="session"] .topbar, body[data-route="interview"] .topbar,
  body[data-route="rehearse"] .topbar, body[data-route="research"] .topbar { display: none; }
}

/* Rail + nav */
.rail { border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.nav a { transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; font-weight: 600; }
.nav a[aria-current="page"] i { color: var(--accent-text); }
.streak-pill { box-shadow: none; border: 1px solid var(--line); }
.tabbar a[aria-current="page"] { color: var(--accent-text); }
.tabbar a[aria-current="page"] i { color: var(--accent-text); }

/* Surfaces: soft diffused shadows instead of hard borders */
.card { border-color: color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.list { box-shadow: var(--shadow); }
a.card, button.card { text-decoration: none; color: inherit; transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

/* Buttons */
.btn { transition: background 0.2s var(--ease), transform 0.15s var(--ease), border-color 0.2s, color 0.2s, box-shadow 0.25s var(--ease); }
.btn-accent { background: var(--grad); color: #fff; box-shadow: 0 8px 20px -10px rgba(75, 68, 232, .7); }
.btn-accent:hover { background: var(--grad); filter: brightness(1.06); box-shadow: 0 12px 26px -10px rgba(75, 68, 232, .8); }
.btn-cta {
  background: var(--grad); color: #fff; border-radius: 999px; min-height: 52px; padding: 0 8px 0 24px; gap: 14px;
  font-weight: 600; font-size: 16px; box-shadow: 0 10px 28px -12px rgba(75, 68, 232, .75);
}
.btn-cta:hover { filter: brightness(1.06); box-shadow: 0 14px 32px -12px rgba(75, 68, 232, .85); }
.btn-cta .cta-ico {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18);
  transition: transform 0.3s var(--ease);
}
.btn-cta .cta-ico i { font-size: 17px; }
.btn-cta:hover .cta-ico { transform: translateX(2px); }
.btn-cta.btn-lg { padding: 0 26px; width: 100%; }
.btn-cta.btn-lg i { font-size: 19px; }
.btn-ghost { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { color: var(--accent-text); }
.chip.accent { background: var(--accent-soft); color: var(--accent-text); }
:focus-visible { outline-color: var(--accent); }

/* ---------- Practice home ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.9fr); gap: 28px; align-items: stretch; margin-bottom: 44px; }
.hero-copy { display: grid; align-content: center; gap: 18px; padding: 8px 0; }
.hero-copy h1 { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; }
.swash { position: relative; white-space: nowrap; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .04em; }
.swash::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.08em; height: 0.16em; border-radius: 999px;
  background: var(--grad); opacity: .35;
}
.hero-sub { color: var(--muted); font-size: 17px; max-width: 46ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.progress-card { display: grid; gap: 18px; align-content: start; padding: 22px 24px; }
.pc-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.pc-head .section-title { color: var(--ink); }
.pc-body { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 22px; align-items: center; }
.pc-ring { position: relative; width: 132px; height: 132px; }
.gauge { width: 132px; height: 132px; display: block; }
.pc-val { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 2px; padding-top: 6px; }
.pc-val b { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-feature-settings: "tnum"; }
.pc-val small { color: var(--muted); font-size: 12px; }
.pc-val .chip { padding: 1px 7px; font-size: 11.5px; margin-top: 2px; }
.pc-skills { display: grid; gap: 12px; }
.pc-skills > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; font-size: 13.5px; }
.pc-skills span { color: var(--ink-2); }
.pc-skills b { font-weight: 600; }
.pc-skills i { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pc-skills em { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.pc-empty { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; color: var(--muted); font-size: 14px; }
.pc-empty .gauge { width: 96px; height: 96px; }
.pc-foot { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.pc-foot span { display: inline-flex; align-items: center; gap: 6px; }
.pc-foot b { color: var(--ink); font-weight: 600; }
.pc-foot i { color: #F07A3A; font-size: 16px; }

.h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 16px; }
/* All exercise cards share one size: equal columns, equal row heights. */
.ex-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 14px; }
.ex-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-height: 152px;
  text-align: left; padding: 18px; border-radius: var(--r-card); background: var(--surface); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow); text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.2s;
}
.ex-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ex-card:active { transform: translateY(-1px) scale(0.99); }
.ex-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ex-ico {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent-text); transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.ex-ico i { font-size: 22px; }
.ex-card:hover .ex-ico { background: var(--grad); color: #fff; }
.ex-name { font-weight: 620; font-size: 16px; letter-spacing: -0.01em; line-height: 1.25; }
.ex-desc { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.ex-dur { font-size: 12px; color: var(--muted); padding: 3px 9px; border-radius: 999px; background: var(--surface-2); }
.ex-dur i { font-size: 14px; display: block; }
.ex-present { grid-column: span 2; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad-soft) border-box; }
@media (max-width: 1180px) { .ex-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  /* Phones: a compact one-column list scans faster than tiny tiles. */
  .ex-grid { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 10px; }
  .ex-present { grid-column: auto; }
  .ex-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center; min-height: 0; padding: 14px 16px; }
  .ex-top { display: contents; }
  .ex-card .ex-ico { grid-column: 1; grid-row: 1 / 3; width: 42px; height: 42px; border-radius: 12px; }
  .ex-card .ex-dur { grid-column: 3; grid-row: 1 / 3; }
  .ex-name { grid-column: 2; grid-row: 1; align-self: end; }
  .ex-desc { grid-column: 2; grid-row: 2; align-self: start; }
}

/* Today's prompt: a labelled card so the topic reads as a prompt, not a slogan. */
.daily-card { display: grid; gap: 8px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow); max-width: 560px; }
.dc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dc-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.dc-topic { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; text-wrap: balance; }
.daily-card .chip { background: var(--surface-2); }
.daily-card .chip.good { background: var(--good-soft); }

/* Theme switch */
.theme-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-ctl);
  background: transparent; border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; text-align: left;
  transition: background 0.2s var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); }
.theme-toggle i { font-size: 19px; color: var(--accent-text); }
.topbar-actions { display: flex; gap: 4px; }

.home-lower { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; margin-top: 36px; }
.home-lower > :only-child { grid-column: 1 / -1; }
.last-card, .goal-card { display: grid; gap: 14px; align-content: start; }
.last-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.last-body .ex-ico { grid-row: auto; }
.last-body b { display: block; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.last-body .hint { display: block; margin-top: 2px; }
.last-score { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.last-fix { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--surface-2); font-size: 14px; color: var(--ink-2); }
.last-fix i { color: var(--accent-text); margin-top: 3px; }
.goal-card p { color: var(--ink-2); }
.goal-card .btn { justify-self: start; }

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; gap: 22px; margin-bottom: 32px; }
  .home-lower { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hero-copy h1 { font-size: 34px; }
  .hero-sub { font-size: 15.5px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .pc-body { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; }
  .pc-ring, .gauge { width: 112px; height: 112px; }
  .pc-val b { font-size: 28px; }
}

/* ---------- Setup sheet: right drawer on desktop, bottom sheet on phones ---------- */
.sheet-back {
  position: fixed; inset: 0; z-index: 40; background: rgba(10, 13, 30, .38);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.sheet-back.in { opacity: 1; }
.sheet {
  position: fixed; z-index: 41; top: 12px; right: 12px; bottom: 12px; width: min(520px, calc(100vw - 24px));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(13, 18, 48, .35);
  transform: translateX(calc(100% + 24px)); transition: transform 0.45s var(--ease); overflow: hidden;
}
.sheet.in { transform: none; }
.sheet-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 20px 20px 16px 22px; border-bottom: 1px solid var(--line); }
.sheet-head .ex-ico { grid-row: auto; }
.sheet-head h2 { font-size: 20px; }
.sheet-head .hint { margin-top: 2px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 20px 22px 24px; gap: 20px; }
.sheet-foot { padding: 14px 22px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.sheet .topic-box { background: var(--surface-2); border: 0; border-radius: 16px; padding: 18px; }
body.sheet-open { overflow: hidden; }
.steps-box { border: 1px solid var(--line); border-radius: 16px; padding: 0 16px; }
.steps-box > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 14px 0; }
.steps-box > summary::-webkit-details-marker { display: none; }
.steps-box > summary > span:first-child { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.steps-box > summary > span:first-child::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 400; font-size: 18px; transition: transform 0.25s var(--ease); }
.steps-box[open] > summary > span:first-child::after { transform: rotate(45deg); }
.steps-box > summary i { color: var(--accent-text); }
.steps-box[open] { padding-bottom: 16px; display: grid; }
.steps-box[open] > * + * { margin-top: 12px; }
.tips-list { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; display: grid; gap: 6px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) {
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; border-bottom: 0; transform: translateY(100%); }
  .sheet::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 999px; background: var(--line-strong); }
  .sheet-head { padding-top: 22px; }
  .row-2 { grid-template-columns: 1fr; }
}

/* ---------- Live session: topic banner on top, controls under the video ---------- */
.topic-banner {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 18px 22px; margin-bottom: 20px; border-radius: var(--r-card); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.topic-banner::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--grad); }
.tb-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.tb-ico i { font-size: 22px; }
.topic-banner .topic-text { font-size: clamp(17px, 2vw, 21px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; margin-top: 2px; text-wrap: balance; }
.stage { border-radius: 22px; border: 0; background: radial-gradient(120% 90% at 50% 0%, #1B2147 0%, #0B0E22 70%); box-shadow: var(--shadow); }
.stage .chip { background: rgba(10, 13, 30, .6); }
.under-stage { display: grid; gap: 14px; margin-top: 14px; }
.mic-row { display: flex; align-items: center; gap: 12px; }
.mic-row .meter-mic { flex: 1; }
.under-stage .session-actions { justify-content: center; }
.under-stage .session-actions .btn-lg { max-width: 420px; }
.under-stage .session-actions:empty { display: none; }
@media (max-width: 640px) {
  .topic-banner { grid-template-columns: minmax(0, 1fr); padding: 14px 16px 14px 20px; gap: 8px; margin-bottom: 14px; }
  .topic-banner .tb-ico { display: none; }
  .topic-banner .chip { justify-self: start; }
}

@media (max-width: 959px) {
  .input, .select, .textarea { font-size: 16px; } /* stops iOS zooming into fields */
  .topbar .brand { min-height: 44px; }
}
/* Coach strip under the camera */
.coach-strip { display: grid; gap: 10px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow); }
.cs-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cs-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cs-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.cs-steps li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 500; color: var(--ink-2); transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.cs-steps li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; background: var(--surface); color: var(--muted); }
.cs-steps li.done { color: var(--muted); }
.cs-steps li.on { background: var(--accent-soft); color: var(--accent-text); }
.cs-steps li.on span { background: var(--accent); color: #fff; }
.cs-cue { font-size: 16px; line-height: 1.45; color: var(--ink); }
.cs-cue b { font-weight: 650; }
.cs-tip { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--line); }
.cs-tip i { color: #E9A23B; margin-top: 2px; font-size: 16px; }
.cs-tip b { color: var(--ink-2); font-weight: 600; }
@media (max-width: 640px) { .coach-strip { padding: 14px; } .cs-cue { font-size: 15px; } }

/* Briefing round */
.brief-box { display: grid; gap: 12px; padding: 18px; border-radius: 16px; background: var(--surface-2); }
.brief-box h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.brief-box h3 i { color: var(--accent-text); font-size: 19px; }
.brief-box .input, .brief-box .textarea { background: var(--surface); }
.brief .field > label { display: flex; align-items: center; gap: 8px; font-weight: 550; color: var(--ink); }
.brief-n { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); }
.field-err { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bad); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); }
.brief-card { max-width: 640px; display: grid; gap: 22px; }
.brief-actions .btn-cta { width: 100%; padding: 0 26px; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-back, .ex-card, a.card, .btn-cta .cta-ico { transition: none !important; }
}
