/* Accent Coach theme.
   Color, space, radius, shadow and type live here. Screens use these tokens
   so a new component picks up the same surfaces, accent and motion. */

@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Italic accent face for labels and a few headline words (OFL, see fonts/OFL-InstrumentSerif.txt). */
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/InstrumentSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Look: a pale blue-grey page under a grainy blue sky, deep navy text, white cards
   with big corners, navy glass panels, dark glass pill buttons, and an italic
   serif for labels. Tight display grotesk (Inter at its display size) for titles. */
:root {
  color-scheme: light;
  --bg: #e9eef7;
  --surface: #ffffff;
  --sunken: #eef1f8;
  --ink: #041a30;
  --muted: #55606f;
  --line: #dbe2ee;
  --line-strong: #7a879c;
  --accent: #2551a3;
  --accent-hover: #1c3f86;
  --accent-text: #2551a3;
  --accent-soft: #dfe8f8;
  --on-accent: #ffffff;
  --serif-ink: #2d4a6b;
  --tag-bg: #dfe8f8;
  --tag-ink: #1c3f86;
  --good: #0e6b3a;
  --good-soft: #e1f3e8;
  --warn: #7a5200;
  --warn-soft: #f8f0dc;
  --bad: #a3272d;
  --bad-fill: #c2413b;
  --bad-soft: #f9e6e6;
  --bad-hover: #a8332e;
  --on-bad: #ffffff;
  --shadow-1: 0 1px 2px rgba(4, 26, 48, 0.04), 0 12px 32px rgba(4, 26, 48, 0.07);
  --card-ring: 0 0 0 1px rgba(4, 26, 48, 0.04);
  --sky: linear-gradient(180deg, #5b84c4 0px, #8eaedf 200px, #c9d8f0 420px, #e9eef7 640px);
  --glass: radial-gradient(78% 130% at 27% 51%, #4f5156 0%, #1e1e1e 100%);
  --glass-rec: radial-gradient(78% 130% at 27% 51%, #e0605b 0%, #8f1f22 100%);
  --glass-ring: inset 0 0 0 2px rgba(255, 255, 255, 0.2), inset 0 0 24px rgba(255, 255, 255, 0.35);
  --navy-panel: radial-gradient(120% 140% at 20% 0%, #2a56b0 0%, #0f2a63 55%, #071a40 100%);
  --navy-ring: inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 1px 18px rgba(255, 255, 255, 0.18);
  --badge: linear-gradient(90deg, #ffcfae 0%, #e7c9f4 50%, #aac4ff 100%);
  --focus: #2551a3;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 100px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 24px;
  --text-2xl: 34px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --leading: 1.5;
  --leading-tight: 1.1;
  --tracking-tight: -0.025em;
  --ease: cubic-bezier(0.3, 0.7, 0.4, 1);
  --motion: 160ms var(--ease);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07121f;
  --surface: #0f1e33;
  --sunken: #0b1829;
  --ink: #eaf0fa;
  --muted: #9fb0c8;
  --line: #1f3350;
  --line-strong: #5b7192;
  --accent: #3466cc;
  --accent-hover: #2d5bb8;
  --accent-text: #a9c4ff;
  --accent-soft: #16294a;
  --on-accent: #ffffff;
  --serif-ink: #a9c4ff;
  --tag-bg: #16294a;
  --tag-ink: #c9d9f7;
  --good: #8ed4a8;
  --good-soft: #12301f;
  --warn: #f0c36a;
  --warn-soft: #2c2416;
  --bad: #f2a3a3;
  --bad-fill: #c2413b;
  --bad-soft: #3a1e24;
  --bad-hover: #a8332e;
  --on-bad: #ffffff;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.28);
  --card-ring: 0 0 0 1px #1a2c47;
  --sky: linear-gradient(180deg, #102a52 0px, #0c2142 260px, #091a33 520px, #07121f 760px);
  --focus: #a9c4ff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #07121f;
    --surface: #0f1e33;
    --sunken: #0b1829;
    --ink: #eaf0fa;
    --muted: #9fb0c8;
    --line: #1f3350;
    --line-strong: #5b7192;
    --accent: #3466cc;
    --accent-hover: #2d5bb8;
    --accent-text: #a9c4ff;
    --accent-soft: #16294a;
    --on-accent: #ffffff;
    --serif-ink: #a9c4ff;
    --tag-bg: #16294a;
    --tag-ink: #c9d9f7;
    --good: #8ed4a8;
    --good-soft: #12301f;
    --warn: #f0c36a;
    --warn-soft: #2c2416;
    --bad: #f2a3a3;
    --bad-fill: #c2413b;
    --bad-soft: #3a1e24;
    --bad-hover: #a8332e;
    --on-bad: #ffffff;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.28);
    --card-ring: 0 0 0 1px #1a2c47;
    --sky: linear-gradient(180deg, #102a52 0px, #0c2142 260px, #091a33 520px, #07121f 760px);
    --focus: #a9c4ff;
  }
}

* { box-sizing: border-box; }

html, body { background: var(--bg); }

body {
  margin: 0;
  color: var(--ink);
  font: var(--weight-regular) var(--text-md) / var(--leading) var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); color: var(--ink); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

[data-icon="mic"] { --glyph: url("icons/mic.svg"); }
[data-icon="stop"] { --glyph: url("icons/square.svg"); }
[data-icon="play"] { --glyph: url("icons/play.svg"); }
[data-icon="volume"] { --glyph: url("icons/volume-2.svg"); }
[data-icon="reset"] { --glyph: url("icons/rotate-ccw.svg"); }

header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 56px;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

header h1 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  margin: 0;
  letter-spacing: -0.01em;
}

.spacer { margin-left: auto; }

.modes, #path-home .toolbar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.chip {
  font-size: var(--text-xs);
  line-height: 1.4;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--surface);
}

.chip.on {
  color: var(--good);
  border-color: var(--good);
  background: var(--good-soft);
}

.chip.off {
  color: var(--bad);
  border-color: var(--bad);
  background: var(--surface);
}

.wrap {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}

nav {
  border-right: 1px solid var(--line);
  padding: var(--space-4) var(--space-3) var(--space-6);
  overflow: auto;
  background: var(--bg);
}

nav .tip { margin: 0 var(--space-2) var(--space-3); font-size: var(--text-xs); }

main {
  padding: var(--space-6) var(--space-6) var(--space-8);
  max-width: 840px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--space-5);
}

.kicker {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  margin: 0;
}

h2 {
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  margin: var(--space-1) 0 var(--space-3);
  text-wrap: balance;
}

.card-title { font-size: var(--text-lg); margin: 0; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.card-head + .tip { margin-top: 0; }

.target {
  font-size: var(--text-xl);
  line-height: 1.6;
  margin: var(--space-2) 0 var(--space-3);
}

.target .w { padding: 0 2px; border-radius: var(--radius-sm); }

.target .ok { color: var(--good); }

.target .sub {
  background: var(--bad-soft);
  color: var(--bad);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.target .del { color: var(--muted); text-decoration: line-through; }

.target .watch { background: var(--warn-soft); color: var(--warn); }

.sounds { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-2); }

.sound {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--accent-soft);
  color: var(--accent-text);
  cursor: help;
}

.tip { color: var(--muted); font-size: var(--text-sm); margin: var(--space-3) 0 0; }

#path-map > .tip { margin-top: 0; }

.script { font-size: var(--text-lg); line-height: var(--leading); margin: var(--space-4) 0; }

.toolbar { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }

.hear {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.fold .toolbar { margin-top: var(--space-2); }

button.btn, .icon-btn {
  font: inherit;
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--motion), border-color var(--motion), color var(--motion), box-shadow var(--motion);
}

button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

button.btn:hover { background: var(--sunken); }

button.btn:disabled, .icon-btn:disabled { cursor: not-allowed; opacity: 0.55; }

button.btn:disabled:hover { background: var(--surface); }

button.primary:disabled:hover { background: var(--accent); border-color: var(--accent); }

button.rec:disabled:hover { background: var(--bad-fill); border-color: var(--bad-fill); }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: var(--weight-semibold);
}

button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

button.rec {
  background: var(--bad-fill);
  border-color: var(--bad-fill);
  color: var(--on-bad);
  font-weight: var(--weight-semibold);
}

button.rec:hover { background: var(--bad-hover); border-color: var(--bad-hover); }

button.btn[data-icon]::before,
.icon-btn::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--glyph) center / 16px 16px no-repeat;
  mask: var(--glyph) center / 16px 16px no-repeat;
}

.icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  --glyph: url("icons/moon.svg");
}

:root[data-theme="dark"] .icon-btn { --glyph: url("icons/sun.svg"); }

.modes .btn, #path-home .toolbar .btn {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  min-height: 32px;
  font-weight: var(--weight-medium);
}

.modes .btn:hover, #path-home .toolbar .btn:hover {
  color: var(--ink);
  background: transparent;
}

.modes .btn.primary, #path-home .toolbar .btn.primary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-1);
  font-weight: var(--weight-semibold);
}

#path-home .toolbar { margin-left: auto; }

.modes .btn.primary:hover, #path-home .toolbar .btn.primary:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

.prompt-line, .target, .script { overflow-wrap: anywhere; }

.timer, .elapsed, .score, .score small, .best, .home-stat, .ring span,
.pill, #day-xp, #prompt-count, #prompt-grade, .meter-row b, #dash-streak, #path-dash .tip,
.kpi b, .kpi .delta, .chart-readout, .mrow b, .pair b, .day-strip b, .widget-stat b, .heat-months, .tick {
  font-variant-numeric: tabular-nums;
}

.timer { color: var(--muted); min-width: 40px; }

.elapsed {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-1);
  line-height: 1;
}

select, textarea {
  font: inherit;
  font-size: var(--text-md);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--motion), box-shadow var(--motion);
}

select { padding: var(--space-2) var(--space-3); min-height: 40px; }

textarea {
  width: 100%;
  min-height: 72px;
  padding: var(--space-2) var(--space-3);
  background: var(--sunken);
  resize: vertical;
  margin-top: var(--space-2);
}

textarea::placeholder { color: var(--muted); opacity: 1; }

.score {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: var(--tracking-tight);
}

.score small {
  font-size: var(--text-md);
  color: var(--muted);
  font-weight: var(--weight-regular);
  letter-spacing: 0;
}

.finding {
  border: 1px solid var(--line);
  border-left-width: 2px;
  border-left-color: var(--line-strong);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  margin: var(--space-2) 0 0;
}

.finding b { display: block; font-weight: var(--weight-semibold); }

.finding p { margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--text-sm); }

.f-fix { border-left-color: var(--bad); }
.f-music { border-left-color: var(--accent-text); }
.f-check, .f-warn, .f-suggestion { border-left-color: var(--warn); }
.f-good { border-left-color: var(--good); }

.heard { font-size: var(--text-sm); color: var(--muted); margin: var(--space-2) 0 0; }

.err { color: var(--bad); font-size: var(--text-md); margin: var(--space-2) 0 0; min-height: 0; }

.stage-copy { margin: var(--space-1) 0 0; }

.fold { margin-top: var(--space-4); }

summary { cursor: pointer; font-weight: var(--weight-semibold); }

summary::-webkit-details-marker { display: none; }

summary { list-style: none; }

summary::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: var(--space-2);
  vertical-align: -3px;
  background-color: var(--muted);
  -webkit-mask: url("icons/chevron-down.svg") center / 16px 16px no-repeat;
  mask: url("icons/chevron-down.svg") center / 16px 16px no-repeat;
  transition: transform var(--motion);
}

details:not([open]) > summary::before { transform: rotate(-90deg); }

.lesson-notes summary { color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }

.legend {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--muted);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: var(--space-1);
  vertical-align: -1px;
}

.lg-ok::before { background: var(--good); }
.lg-sub::before { background: var(--bad); }
.lg-del::before { background: var(--muted); }

.coachtext { white-space: pre-wrap; font-size: var(--text-md); margin-top: var(--space-2); }

.stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-2);
}

.stage { min-width: 0; }

.stage .bar {
  display: block;
  height: 4px;
  border-radius: var(--radius-sm);
  background: var(--line);
}

.stage .label {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--muted);
}

.stage.is-done .bar, .stage.is-current .bar, .stage.is-now .bar { background: var(--accent-text); }

.stage.is-done .label, .stage.is-current .label, .stage.is-now .label {
  color: var(--ink);
  font-weight: var(--weight-semibold);
}

.stage.is-bad .bar { background: var(--bad-fill); }
.stage.is-bad .label { color: var(--bad); font-weight: var(--weight-semibold); }

.node, .drill {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  color: var(--ink);
  border-radius: var(--radius-md);
  font: inherit;
  cursor: pointer;
  transition: background-color var(--motion), color var(--motion);
}

.node { font-weight: var(--weight-semibold); padding: var(--space-2); }

.node.week { font-size: var(--text-sm); font-weight: var(--weight-semibold); }

.drill { padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5); }

.node:hover, .drill:hover { background: var(--surface); }

.node:disabled {
  color: var(--muted);
  cursor: not-allowed;
  background: none;
}

.drill.sel {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: var(--weight-semibold);
  box-shadow: inset 2px 0 0 var(--accent-text);
}

.chev {
  width: 16px;
  height: 16px;
  flex: none;
  position: relative;
  color: transparent;
  font-size: 0;
  overflow: hidden;
}

.chev::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--muted);
  -webkit-mask: url("icons/chevron-down.svg") center / 16px 16px no-repeat;
  mask: url("icons/chevron-down.svg") center / 16px 16px no-repeat;
  transition: transform var(--motion);
}

.node[aria-expanded="false"] > .chev::before { transform: rotate(-90deg); }

.node .label, .drill .label { flex: 1; }

.best {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--muted);
  padding-top: 2px;
}

.branch {
  margin: 0 0 var(--space-1) var(--space-2);
  padding-left: var(--space-2);
  border-left: 1px solid var(--line);
}

.home-row { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; }

.home-stat {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
}

.ring {
  --p: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex: none;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--accent-soft) 0);
  display: grid;
  place-items: center;
}

.ring span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.level-block { margin-top: var(--space-4); }

.level-block h3 { margin: 0 0 var(--space-2); font-size: var(--text-md); font-weight: var(--weight-semibold); }

.pills { display: flex; flex-wrap: wrap; gap: var(--space-2); }

button.pill {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-align: left;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  min-height: 40px;
  cursor: pointer;
  transition: background-color var(--motion), border-color var(--motion);
}

button.pill:hover:not(:disabled) { background: var(--sunken); }

button.pill.done {
  border-color: var(--good);
  background: var(--good-soft);
  color: var(--ink);
}

button.pill:disabled {
  color: var(--muted);
  background: var(--sunken);
  border-color: var(--line);
  cursor: not-allowed;
}

.cue {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-2);
  background: var(--sunken);
}

.cue p { margin: var(--space-2) 0 0; }

.mouth { font-size: var(--text-md); }

.meter { margin-top: var(--space-3); }

.meter-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

.meter-row > span { width: 48px; color: var(--muted); flex: none; }

.track {
  flex: 1;
  height: 4px;
  background: var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-width: 80px;
}

.track > div { height: 100%; width: 0; background: var(--accent-text); }

#path-review .pill, #path-dash .meter-row { margin-top: var(--space-2); }

#path-dash .meter-row > span { width: auto; max-width: 220px; }

.prompt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: var(--space-4);
  align-items: stretch;
  margin-top: var(--space-4);
}

.prompt-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: var(--surface);
}

.prompt-meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }

.prompt-line {
  font-size: var(--text-2xl);
  line-height: 1.35;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  margin: var(--space-3) 0 var(--space-2);
  text-wrap: balance;
}

.prompt-line .mark {
  background: transparent;
  color: inherit;
  border-radius: 0;
  padding: 0 1px;
  box-shadow: inset 0 -2px 0 var(--accent-text);
}

.prompt-cue { margin: 0 0 var(--space-3); }

.prompt-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: var(--surface);
}

.prompt-actions .btn { width: 100%; }

.prompt-actions .timer { align-self: center; }

.prompt-meta span { display: inline-flex; align-items: center; gap: var(--space-2); }

button.info {
  width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1;
  cursor: pointer;
}

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-2);
  max-height: 160px;
  overflow: auto;
}

.prompt-list button {
  text-align: left;
  font: inherit;
  font-size: var(--text-md);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--motion), border-color var(--motion);
}

.prompt-list button:hover { background: var(--sunken); }

.prompt-list button.on {
  background: var(--sunken);
  border-color: var(--line);
  font-weight: var(--weight-semibold);
  box-shadow: inset 2px 0 0 var(--accent-text);
}

.live-note { color: var(--muted); font-size: var(--text-sm); margin: var(--space-2) 0 0; }

.live-words { margin-top: var(--space-2); }

.wlive {
  display: inline-block;
  margin: 0 var(--space-1) var(--space-1) 0;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-lg);
  background: var(--sunken);
}

.wlive.said { color: var(--good); background: var(--good-soft); }
.wlive.mispronounced {
  color: var(--bad);
  background: var(--bad-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wlive.missed { color: var(--muted); text-decoration: line-through; background: transparent; }
.wlive.pending { color: var(--ink); }

#hover-tip {
  position: fixed;
  z-index: 30;
  max-width: 260px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--text-sm);
  line-height: 1.4;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  pointer-events: none;
}

#legend-pop, #info-pop {
  position: fixed;
  z-index: 31;
  right: var(--space-4);
  top: 72px;
  width: min(380px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-1);
}

#info-pop p, #legend-pop p { margin: var(--space-2) 0 0; }

.meter-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }

.lesson-notes { margin-top: var(--space-2); }

#path-dash:not([hidden]) {
  display: grid;
  gap: var(--space-4);
}

.chart-card h3 { margin: 0 0 var(--space-2); }

.chart-note {
  color: var(--muted);
  font-size: var(--text-sm);
  margin: var(--space-3) 0 0;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: var(--space-4);
}

.kpi { padding: 0 var(--space-4); border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; padding-left: 0; }

.kpi b {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
}

.kpi .delta { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--text-sm); }
.kpi .delta.up, .delta.up { color: var(--good); }
.kpi .delta.down, .delta.down { color: var(--bad); }

.chart { margin-top: var(--space-3); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .baseline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .series { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-soft { opacity: 0.4; }
.chart .range { stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.chart .dot { fill: var(--accent); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--font-sans); }
.chart .mark-check { stroke: var(--warn); fill: var(--surface); stroke-width: 1.5; }
.chart .mark-bench { stroke: var(--accent-text); fill: var(--surface); stroke-width: 1.5; }

.chart-readout { margin: var(--space-2) 0 0; color: var(--ink); font-size: var(--text-sm); min-height: 1.4em; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: var(--text-xs);
}

.chart-legend span { display: inline-flex; align-items: center; gap: var(--space-2); }

.swatch { width: 16px; height: 0; border-top: 1.5px solid var(--accent); display: inline-block; }
.swatch.line { opacity: 0.4; }
.swatch.avg { opacity: 1; }
.swatch.base { border-top-style: dashed; border-top-color: var(--muted); }
.swatch.check {
  width: 8px; height: 8px; border: 1.5px solid var(--warn); border-top-width: 1.5px;
  background: var(--surface); transform: rotate(45deg);
}
.swatch.bench {
  width: 8px; height: 8px; border: 1.5px solid var(--accent-text); background: var(--surface);
}

.mastery { margin-top: var(--space-2); }

.mrow {
  display: grid;
  grid-template-columns: minmax(72px, 160px) 1fr auto auto;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-3);
}

.mname { color: var(--ink); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mtrack { height: 6px; background: var(--sunken); border-radius: 99px; overflow: hidden; }
.mfill { height: 100%; border-radius: 99px; background: var(--accent); }
.mfill.weak { background: var(--bad-fill); }
.mfill.mid { background: var(--warn); }
.mfill.strong { background: var(--good); }

.trend { width: 16px; height: 16px; }
.trend.up { color: var(--good); }
.trend.down { color: var(--bad); }
.trend.flat, .trend.new { color: var(--muted); }

.pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}

.pair-line { margin: 0; }
.scores { display: flex; align-items: center; gap: var(--space-4); }
.score-block { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); min-width: 88px; }
.score-block b { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.score-block .btn { min-height: 32px; }

.heat-scroll { overflow-x: auto; margin-top: var(--space-4); padding-bottom: var(--space-2); }
.heat-months, .heat {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 12px;
  gap: 3px;
}
.heat-months { grid-template-rows: 16px; margin-left: 32px; color: var(--muted); font-size: 10px; }
.heat-months span { line-height: 16px; white-space: nowrap; }
.heat-body { display: flex; gap: 6px; }
.heat-days {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
  width: 26px;
  flex: none;
  color: var(--muted);
  font-size: 10px;
}
.heat-days span { line-height: 12px; }
.heat { grid-template-rows: repeat(7, 12px); }
.heat .cell, .heat-scale .cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  background: var(--sunken);
  display: block;
}
.heat .cell.l1, .heat-scale .cell.l1 { background: color-mix(in srgb, var(--accent) 28%, var(--sunken)); }
.heat .cell.l2, .heat-scale .cell.l2 { background: color-mix(in srgb, var(--accent) 48%, var(--sunken)); }
.heat .cell.l3, .heat-scale .cell.l3 { background: color-mix(in srgb, var(--accent) 70%, var(--surface)); }
.heat .cell.l4, .heat-scale .cell.l4 { background: var(--accent); border-color: var(--accent); }
.heat .cell.future { visibility: hidden; }
.heat .cell:focus { outline: 2px solid var(--focus); outline-offset: 1px; }

.heat-scale {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: var(--text-xs);
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.day-strip span { display: block; color: var(--muted); font-size: var(--text-xs); }
.day-strip b { display: block; font-size: var(--text-sm); font-weight: var(--weight-semibold); }

.prosody-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-top: var(--space-2);
}
.stress-note { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }

.buckets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-3);
}
.review-pill { margin: var(--space-2) var(--space-2) 0 0; }

.widget { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.widget[hidden] { display: none; }
.widget-row { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.widget-stat b { display: block; font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.widget-stat span { color: var(--muted); font-size: var(--text-xs); }
.spark { width: 140px; height: 36px; flex: none; }
.widget .pair { border-top: 0; padding-top: 0; }
#lesson-widget { margin-top: var(--space-4); }

@media (max-width: 760px) {
  header { padding: var(--space-3) var(--space-4); }
  .wrap { grid-template-columns: 1fr; }
  nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 240px;
  }
  main { padding: var(--space-4); }
  h2 { font-size: var(--text-lg); }
  .card { padding: var(--space-4); }
  .stages { gap: var(--space-2); }
  .prompt-row { grid-template-columns: 1fr; }
  .prompt-line { font-size: var(--text-xl); }
  .home-row { align-items: flex-start; }
  #path-home .toolbar { margin-left: 0; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { border-left: 0; border-top: 1px solid var(--line); padding: var(--space-3) 0; }
  .kpi:nth-child(-n + 2) { border-top: 0; }
  .prosody-grid, .buckets { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr; }
  .mrow { grid-template-columns: minmax(56px, 96px) 1fr auto auto; gap: var(--space-2); }
  .day-strip { gap: var(--space-1); }
  .widget-row .spark { width: 100%; }
}

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

/* App navigation (static/appnav.js): one level of destinations. */
.appnav { display: inline-flex; gap: 2px; padding: 2px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.appnav button {
  font: inherit; font-size: var(--text-sm); color: var(--muted); background: transparent; border: 0;
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-md); cursor: pointer; min-height: 32px;
}
.appnav button:hover { color: var(--ink); }
.appnav button.is-on { background: var(--surface); color: var(--ink); font-weight: var(--weight-semibold); box-shadow: 0 0 0 1px var(--line); }
.appnav .appnav-account { display: none; }
.header-account.is-on { border-color: var(--accent); color: var(--accent-text); }
.help-btn { font-weight: var(--weight-semibold); }
.legacy-tabs[hidden] { display: none !important; }

/* The lesson sidebar only belongs to Lessons and Month 1. */
body:not([data-dest="lessons"]):not([data-dest="month1"]) .wrap { grid-template-columns: minmax(0, 1fr); }
body:not([data-dest="lessons"]):not([data-dest="month1"]) .wrap > nav { display: none; }
body:not([data-dest="lessons"]):not([data-dest="month1"]) .wrap > main { max-width: 960px; margin: 0 auto; width: 100%; }

.today-card { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-5); align-items: stretch; }
.today-card[hidden] { display: none; }
.today-title { font-size: var(--text-xl); margin: var(--space-1) 0 var(--space-2); letter-spacing: var(--tracking-tight); }
.today-start { margin-top: var(--space-3); min-width: 140px; }
.today-side { display: grid; gap: var(--space-3); }
.today-tile {
  display: grid; gap: 2px; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4);
}
.today-tile:hover { border-color: var(--line-strong); }
.today-tile b { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.today-tile span { color: var(--muted); font-size: var(--text-sm); }
#account-view .card + .card, #account-view .card + div, #account-voice-slot .card { margin-top: var(--space-4); }
.account-links, .account-chips { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.account-plan { font-weight: var(--weight-semibold); margin: var(--space-2) 0 0; }

@media (max-width: 760px) {
  header .modes, header .header-account { display: none; }
  .appnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr);
    border-radius: 0; border: 0; border-top: 1px solid var(--line); background: var(--surface);
    padding: var(--space-1) var(--space-1) calc(var(--space-1) + env(safe-area-inset-bottom));
  }
  .appnav button { font-size: var(--text-xs); padding: var(--space-2) 0; min-height: 44px; }
  .appnav button.is-on { box-shadow: none; background: var(--sunken); }
  .appnav .appnav-account { display: block; }
  body { padding-bottom: 64px; }
  .wrap > nav { display: none; }
  body[data-dest="month1"] .wrap > nav { display: block; max-height: 240px; }
  .today-card { grid-template-columns: 1fr; }
}
.modes[hidden] { display: none !important; }
#today-card { margin-top: var(--space-4); }
.help-btn { min-width: 36px; padding-inline: var(--space-2); }
#path-widget .widget-row > button[aria-label="Open the progress charts"] { display: none; }

/* ---------------------------------------------------------------------------
   Skin: sky, glass and serif (v0.4). Later rules on purpose, so the base
   layout above stays readable and this layer can be tuned on its own.
   --------------------------------------------------------------------------- */

body { background: transparent; }
html {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.15 0 0 0 0 0.3 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--sky) top / 100% 760px no-repeat,
    var(--bg);
}
body { min-height: 100vh; }

/* Floating glass header */
header {
  position: sticky;
  top: var(--space-3);
  margin: var(--space-3) auto 0;
  width: calc(100% - 2 * var(--space-4));
  max-width: 1180px;
  min-height: 60px;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgba(52, 55, 61, 0.94), rgba(22, 24, 28, 0.94));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 30px rgba(4, 26, 48, 0.25);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  z-index: 6;
}
header h1 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-right: var(--space-2);
}
header h1 em { font-family: var(--font-serif); font-weight: 400; font-size: 1.12em; letter-spacing: 0; color: #c9d9f7; }

.appnav { background: transparent; border: 0; padding: 0; gap: var(--space-1); }
.appnav button {
  color: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
  min-height: 38px;
  font-weight: var(--weight-medium);
  transition: color var(--motion), background-color var(--motion), box-shadow var(--motion);
}
.appnav button:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.appnav button.is-on {
  color: #fff;
  background: radial-gradient(78% 130% at 27% 51%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2), inset 0 0 18px rgba(255, 255, 255, 0.18);
  font-weight: var(--weight-semibold);
}

header .icon-btn, header button.btn.help-btn, header button.btn.header-account {
  color: #fff;
  border: 0;
  border-radius: var(--radius-pill);
  background: radial-gradient(78% 130% at 27% 51%, #5a5d63 0%, #2a2b2e 100%);
  box-shadow: var(--glass-ring);
  min-height: 42px;
}
header .icon-btn { width: 42px; height: 42px; }
header button.btn.header-account { padding-inline: var(--space-5); font-weight: var(--weight-semibold); }
header .icon-btn:hover, header button.btn.help-btn:hover, header button.btn.header-account:hover { background: radial-gradient(78% 130% at 27% 51%, #686b72 0%, #333438 100%); }
header button.btn.header-account.is-on { color: #fff; box-shadow: inset 0 0 0 2px rgba(201, 217, 247, 0.6), inset 0 0 24px rgba(255, 255, 255, 0.35); }

/* Layout breathes under the floating header */
.wrap { min-height: calc(100vh - 84px); margin-top: var(--space-4); }
.wrap > nav { background: transparent; border-right: 0; padding-top: var(--space-2); }
main { padding-top: var(--space-4); }

/* Type */
h2, .today-title, .card-title, .act-promise {
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
}
h2 { font-size: var(--text-xl); line-height: var(--leading-tight); }
.kicker {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.2;
  color: var(--serif-ink);
}
.today-title { font-size: var(--text-2xl); line-height: 1.05; margin: var(--space-1) 0 var(--space-3); }

/* Cards: white, big corners, soft lift */
.card {
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-ring), var(--shadow-1);
  padding: var(--space-6);
}
.card .card, .prompt-card {
  border-radius: 18px;
  box-shadow: none;
  border: 1px solid var(--line);
}

/* Buttons: pills. Primary is dark glass, Record is red glass. */
button.btn {
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
  min-height: 42px;
  border-color: var(--line);
  color: var(--ink);
  transition: background-color var(--motion), border-color var(--motion), box-shadow var(--motion), transform 90ms var(--ease);
}
button.btn:hover { background: var(--sunken); border-color: var(--line-strong); }
button.btn:active:not(:disabled), .today-tile:active, .appnav button:active { transform: scale(0.97); }

button.primary, button.primary:disabled:hover {
  background: var(--glass);
  border: 0;
  color: #fff;
  box-shadow: var(--glass-ring), 0 6px 18px rgba(4, 26, 48, 0.18);
}
button.primary:hover { background: radial-gradient(78% 130% at 27% 51%, #5d6066 0%, #26272a 100%); border: 0; }

button.rec, button.rec:disabled:hover {
  background: var(--glass-rec);
  border: 0;
  color: #fff;
  box-shadow: var(--glass-ring), 0 6px 18px rgba(143, 31, 34, 0.25);
}
button.rec:hover { background: radial-gradient(78% 130% at 27% 51%, #ea6e68 0%, #9c2428 100%); border: 0; }

.icon-btn { border-radius: var(--radius-pill); }

/* Today: navy glass tiles, like a countdown */
.today-tile {
  background: var(--navy-panel);
  border: 0;
  border-radius: 20px;
  box-shadow: var(--navy-ring), 0 10px 28px rgba(15, 42, 99, 0.25);
  color: #fff;
  padding: var(--space-4) var(--space-5);
  transition: transform 90ms var(--ease), box-shadow var(--motion);
}
.today-tile:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), inset 0 1px 18px rgba(255, 255, 255, 0.24), 0 12px 30px rgba(15, 42, 99, 0.32); }
.today-tile b { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: #fff; }
.today-tile span { color: rgba(255, 255, 255, 0.78); }
.today-start { min-width: 168px; min-height: 48px; font-size: var(--text-lg); }

/* Tags and chips: pale blue pills */
.sound, button.pill, .chip {
  border-radius: var(--radius-pill);
  background: var(--tag-bg);
  color: var(--tag-ink);
  border-color: transparent;
  padding: var(--space-1) var(--space-3);
}
button.pill:hover:not(:disabled) { background: color-mix(in srgb, var(--tag-bg) 80%, var(--accent) 20%); }
button.pill.done { background: var(--good-soft); color: var(--good); }
.chip.on { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.off { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.account-plan {
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--badge);
  color: #041a30;
}

/* Lesson sidebar */
.node, .drill { border-radius: var(--radius-md); }
.node:hover, .drill:hover { background: rgba(255, 255, 255, 0.6); }
.drill.sel { background: var(--surface); box-shadow: var(--shadow-1); border-left-color: transparent; }

/* Inputs, findings, progress bars */
select, textarea { border-radius: var(--radius-md); }
.finding { border-radius: var(--radius-md); }
.mtrack, .track { border-radius: var(--radius-pill); }
.stage .bar { border-radius: var(--radius-pill); }

/* Phones: the tab bar floats as a glass pill */
@media (max-width: 760px) {
  header {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    top: var(--space-2);
    margin-top: var(--space-2);
    width: calc(100% - 2 * var(--space-3));
    padding-left: var(--space-4);
  }
  .appnav {
    left: var(--space-3);
    right: var(--space-3);
    bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
    padding: var(--space-1);
    border: 0;
    border-radius: var(--radius-pill);
    background: linear-gradient(180deg, rgba(52, 55, 61, 0.96), rgba(22, 24, 28, 0.96));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 10px 30px rgba(4, 26, 48, 0.3);
  }
  .appnav button { min-height: 44px; padding: var(--space-2) 0; }
  .appnav button.is-on { background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18); }
  body { padding-bottom: 92px; }
  .card { padding: var(--space-5); }
  .today-title { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  button.btn:active:not(:disabled), .today-tile:active, .appnav button:active { transform: none; }
}

/* Headline accent: a few words in the italic serif, as on the reference. */
h2 em, .act-promise em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.12em;
  letter-spacing: 0;
  color: var(--serif-ink);
}
.act-promise { font-size: var(--text-2xl); line-height: 1.08; }
#practice-view > .card + .card, #practice-view .card + .card { margin-top: var(--space-4); }

/* One column of alignment: the content sits in the same 1180px frame as the
   header, and the lesson tree is a frosted panel that lines up with the cards. */
:root { --frame: 1180px; --panel: rgba(255, 255, 255, 0.66); }
:root[data-theme="dark"] { --panel: rgba(15, 30, 51, 0.72); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --panel: rgba(15, 30, 51, 0.72); } }

.wrap {
  max-width: var(--frame);
  width: calc(100% - 2 * var(--space-4));
  margin: var(--space-6) auto 0;
  column-gap: var(--space-5);
  grid-template-columns: 272px minmax(0, 1fr);
  align-items: start;
}
.wrap > main { padding: 0 0 var(--space-8); max-width: none; }
body:not([data-dest="lessons"]):not([data-dest="month1"]) .wrap > main { max-width: none; margin: 0; }
.best:empty { display: none; }

.wrap > nav {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: var(--space-4) var(--space-3);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--card-ring), var(--shadow-1);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.wrap > nav > .tip { margin: 0 var(--space-3) var(--space-3); }

.node { padding: var(--space-2) var(--space-3); align-items: center; }
.drill { padding: var(--space-2) var(--space-3) var(--space-2) var(--space-5); align-items: center; }
.branch { margin: 0 0 var(--space-2); padding-left: 0; border-left: 0; }
.drill.sel { background: var(--surface); box-shadow: var(--shadow-1); font-weight: var(--weight-semibold); }
.node:hover, .drill:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.best {
  flex: none;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 11px;
  font-weight: var(--weight-semibold);
}

/* Sparkline on Today: style it outside .chart too (it showed as a lone black dot). */
.spark .series { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .dot { fill: var(--accent); }

@media (max-width: 760px) {
  .wrap { width: calc(100% - 2 * var(--space-3)); margin-top: var(--space-4); grid-template-columns: 1fr; }
  .wrap > nav { position: static; max-height: 260px; margin-bottom: var(--space-4); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Owner funnel card (Account) */
.funnel { display: grid; gap: var(--space-2); margin: var(--space-3) 0; }
.funnel-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 48px; gap: var(--space-3); align-items: center; font-size: var(--text-sm); }
.funnel-row b { text-align: right; font-variant-numeric: tabular-nums; }
.funnel-track { height: 10px; border-radius: var(--radius-pill); background: var(--accent-soft); overflow: hidden; }
.funnel-fill { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--accent); }
.funnel-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); margin: var(--space-3) 0; }
.funnel-top { margin: var(--space-1) 0 var(--space-3); padding-left: 1.1em; font-size: var(--text-sm); color: var(--muted); }
#account-funnel a.btn { display: inline-flex; align-items: center; min-height: 40px; padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: var(--weight-medium); }
@media (max-width: 760px) { .funnel-row { grid-template-columns: 1fr 64px 36px; } }

/* Account: one even rhythm between cards */
#account-view:not([hidden]) { display: grid; gap: var(--space-4); }
#account-view .card, #account-voice-slot .card { margin-top: 0 !important; }
