/* Design tokens: generated from docs/design-system/tokens.json. Change them there first. */
:root {
  --bg: #f7f6f2; --panel: #ffffff; --text: #1c2430; --muted: #667085; --line: #e3e0d8; --line-strong: #c9c4b8;
  --track: #eceae4; --blue: #005293; --blue-tint: #e8f0f7; --action: #005293; --on-action: #ffffff;
  --on-action-line: rgba(255, 255, 255, 0.22); --yellow: #fecc02; --on-yellow: #1c2430; --green: #11663a;
  --green-tint: #d6efe0; --amber: #a15c07; --amber-tint: #fbefdc; --red: #b42318; --red-tint: #fdecea;
  --level-1: #c4d7e9; --level-2: #8fb3d5; --level-3: #4a86bd; --level-4: #005293; --focus: #005293;
  --orb-hi: #dcecff; --orb-mid: #1f6fb3; --orb-deep: #003e70;
  --shadow-surface: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.07);
  --shadow-bar: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-primary: 0 8px 24px rgba(0, 82, 147, 0.28);
  --shadow-orb: 0 14px 34px rgba(0, 82, 147, 0.35), inset -10px -14px 28px rgba(254, 204, 2, 0.55);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --radius-key: 6px; --radius-control: 12px; --radius-button: 18px; --radius-card-phone: 16px;
  --radius-card: 20px; --radius-pill: 999px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Older names, kept so existing rules keep working. */
  --surface-shadow: var(--shadow-surface); --bar-shadow: var(--shadow-bar);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c; --panel: #1d2128; --text: #eceff4; --muted: #98a2b3; --line: #2c323c;
    --line-strong: #4a525e; --track: #2a3038; --blue: #6aa9e6; --blue-tint: #1f2c3b; --action: #1f6db5;
    --green: #72e0a8; --green-tint: #1b3d2a; --amber: #f5b544; --amber-tint: #38290f; --red: #f97066;
    --red-tint: #3b1d1b; --level-1: #22364b; --level-2: #2d5478; --level-3: #3f78b0; --level-4: #6aa9e6;
    --focus: #6aa9e6; --shadow-surface: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-bar: 0 1px 0 rgba(255, 255, 255, 0.07), 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-primary: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-orb: 0 14px 34px rgba(0, 0, 0, 0.55), inset -10px -14px 28px rgba(254, 204, 2, 0.5);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* even on elements whose class sets a display */
/* The page draws to the screen edges (viewport-fit=cover), so on an iPhone the strip under the last button is
   the page's own background, not a band Safari paints. Side insets keep content clear of the notch in landscape;
   docks at the bottom add env(safe-area-inset-bottom) themselves. */
html { background: var(--bg); }
body { margin: 0; padding: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); background: var(--bg); color: var(--text); font: 16px/1.5 var(--font-sans); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
a { color: var(--blue); }
h1 { margin: 0 0 1rem; font-size: 1.5rem; }
/* Top bar (menu option A): a quiet bar on the panel colour with the card's ring, text links in the
   text colour and the current page underlined in blue. On phones the links fold behind "Menu". */
.topbar { position: relative; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.75rem; min-height: 60px; padding: 0 1rem 0 1.5rem; background: var(--panel); box-shadow: var(--bar-shadow); }
.topbar form { margin: 0; }
.topbar nav { display: flex; gap: 1.5rem; align-items: center; flex-grow: 1; }
.topbar nav a { color: var(--text); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.topbar nav a:hover { color: var(--blue); }
.topbar nav a[aria-current=page] { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.topbar nav a:focus-visible, .topbar button:focus-visible, .topbar .brand:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.topbar .sign-out-form { margin-left: -1.25rem; }
.topbar .sign-out, .topbar .menu-button { color: var(--text); text-decoration: none; padding: .5rem .4rem; border-radius: 10px; }
.topbar .menu-button { display: none; }
.topbar nav .nav-home { display: none; }
.mic-button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--text); cursor: pointer; }
.mic-button:hover { background: var(--bg); }
.mic-button.off { color: var(--muted); }
.mic-button .mic-slash-gap { stroke: var(--panel); stroke-width: 5; }
.mic-button:hover .mic-slash-gap { stroke: var(--bg); }
.mic-button:not(.off) .mic-slash, .mic-button:not(.off) .mic-slash-gap { display: none; }
@media (max-width: 520px) {
  .topbar { min-height: 56px; gap: 0 .25rem; padding: 0 .5rem 0 1rem; }
  .topbar .brand { margin-right: auto; }
  .topbar nav, .topbar .sign-out-form { display: none; }
  .topbar .menu-button { display: inline-block; min-height: 44px; padding: 0 .65rem; }
  .topbar.open .menu-button { font-weight: 600; }
  .mic-button { width: 44px; height: 44px; }
  .topbar.open nav, .topbar.open .sign-out-form { display: flex; flex-basis: 100%; order: 10; margin: 0; }
  .topbar.open nav { flex-direction: column; align-items: stretch; gap: 0; padding: 0 .5rem 0 0; }
  .topbar.open nav a, .topbar.open .sign-out { display: flex; align-items: center; min-height: 48px; padding: 0; border-bottom: 0; border-top: 1px solid var(--line); border-radius: 0; }
  .topbar.open nav a[aria-current=page] { border-bottom: 0; }
  .topbar.open .sign-out-form { order: 11; padding: 0 .5rem .5rem 0; }
  .topbar.open .sign-out { width: 100%; color: var(--muted); font-size: 15px; }
  .topbar.open nav .nav-home { display: flex; border-top: 0; }
  .topbar.open nav a { font-size: 17px; }
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); border-bottom: 3px solid var(--yellow); }
.link-button { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; cursor: pointer; text-decoration: underline; }
/* Card surface: no border, the soft ring and drop from --shadow-surface. */
.panel { background: var(--panel); border: 0; border-radius: var(--radius-card); padding: var(--space-5); box-shadow: var(--shadow-surface); }
@media (max-width: 520px) { .panel { border-radius: var(--radius-card-phone); padding: var(--space-5) var(--space-4); } }
/* Home: separate blocks (today, book chapters, activity), wide enough for a year of activity. */
.home { max-width: 760px; margin: 2rem auto; display: flex; flex-direction: column; gap: 1.25rem; }
.home .panel { border: 0; border-radius: var(--radius-card); padding: 1.5rem 2rem; box-shadow: var(--surface-shadow); }
/* The Today card: the Study session button on the left, This week on the right (stacked on phones). */
.home .panel.today { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; }
.today > turbo-frame { display: block; flex: 1 1 0; min-width: 0; }
.today-row { display: flex; flex-direction: column; gap: .75rem; }
.today-row > p { margin: 0; }
.this-week { display: flex; flex-direction: column; gap: .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.this-week-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 1rem; font-size: .9rem; }
.this-week-total { display: inline-flex; align-items: baseline; gap: .4rem; }
/* One wide tile per day, filling the card's width: the day and its word count inside, shaded blue by amount. */
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.week-days .day { display: flex; width: auto; height: auto; flex-direction: column; justify-content: space-between; min-height: 62px; padding: .55rem .7rem; border-radius: 12px; font-size: .8rem; }
.week-days .weekday { font-weight: 600; }
.week-days .count { font-size: 1.1rem; font-weight: 700; line-height: 1.2; min-height: 1.2em; }
.week-days .day.level-0 { background: var(--track); color: var(--muted); }
.week-days .day.level-0 .count { font-weight: 400; }
.week-days .day.level-3, .week-days .day.level-4 { color: var(--on-action); }
.week-days .future .day { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.week-days .today .day { outline: 2px solid var(--text); outline-offset: 2px; }
.year-view .link-button { color: var(--muted); font-size: .9rem; }
dialog.year-dialog { width: min(48rem, calc(100vw - 2rem)); border: 0; border-radius: 16px; padding: 1.25rem 1.5rem 1rem; background: var(--panel); color: var(--text); box-shadow: var(--surface-shadow); }
dialog.year-dialog::backdrop { background: rgb(0 0 0 / .4); }
dialog.year-dialog[open] { animation: card-in 240ms ease both; }
dialog.year-dialog h2 { margin: 0 0 .5rem; font-size: 1.2rem; }
dialog.year-dialog .activity { margin: 0; border: 0; padding: 0; }
dialog.year-dialog .actions { justify-content: flex-end; margin: .75rem 0 0; }
/* Or pick it yourself: By exercise / By chapter tabs over the exercise rows or the books. */
.pick-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 1rem; margin-bottom: .25rem; border-bottom: 1px solid var(--line); }
.pick-head h2 { margin: 0; font-size: 1.25rem; }
.pick-head p { margin: .25rem 0 0; font-size: .9rem; }
.tabs { display: flex; padding: 4px; border-radius: var(--radius-control); background: var(--track); }
.tabs [role=tab] { border: 0; border-radius: 9px; padding: .5rem 1rem; background: transparent; color: var(--muted); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.tabs [role=tab][aria-selected=true] { background: var(--panel); color: var(--text); box-shadow: var(--shadow-bar); }
.tabs [role=tab]:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.pick-books { display: flex; flex-direction: column; gap: .75rem; padding-top: 1rem; }
.today-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.panel.card { text-align: center; max-width: 560px; margin: 2rem auto; }
input, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1.5px solid var(--line-strong); border-radius: var(--radius-control); padding: .6rem .75rem; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Primary button: the one main action. Filled with --action so white text keeps 4.5:1 in dark mode too. */
.button, input[type=submit] { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; background: var(--action); color: var(--on-action); border: 0; border-radius: var(--radius-control); padding: 0 var(--space-5); font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; width: auto; box-shadow: var(--shadow-primary); }
.button[disabled], input[type=submit][disabled] { opacity: .45; box-shadow: none; cursor: not-allowed; }
/* Pressed: on click (:active) and, for keyboard shortcuts, briefly via the .pressed class (pressed.js). */
.button, input[type=submit], .link-button { transition: transform 120ms ease, opacity 200ms ease; }
.button:active:not([disabled]), input[type=submit]:active:not([disabled]), .button.pressed { transform: scale(.97); }
.link-button:active, .link-button.pressed { transform: translateY(1px); filter: brightness(.8); }
.muted { color: var(--muted); }
/* Exercise badge: the only place yellow fills something. */
.badge { display: inline-flex; align-items: center; height: 24px; background: var(--yellow); color: var(--on-yellow); border-radius: var(--radius-pill); padding: 0 10px; font-size: 12px; font-weight: 600; margin: 0 0 .5rem; }
.prompt { font-size: 2rem; font-weight: 700; margin: .5rem 0 1rem; }
.answer { font-size: 1.75rem; font-weight: 600; color: var(--blue); margin: .5rem 0; }
.example { font-style: italic; color: var(--muted); }
.answer-input { font-size: 1.4rem; text-align: center; }
.feedback { font-weight: 700; margin: .25rem 0; }
.feedback.right { color: var(--green); } .feedback.near { color: var(--amber); } .feedback.wrong { color: var(--red); }
.chapters { border: 1px solid var(--line); border-radius: 14px; padding: 0 1.25rem; }
.chapters > summary { display: flex; align-items: baseline; gap: .25rem .75rem; flex-wrap: wrap; padding: 1rem 1.5rem 1rem 0; position: relative; cursor: pointer; list-style: none; }
.chapters summary::-webkit-details-marker { display: none; }
.chapters summary::after { content: ""; position: absolute; right: .25rem; top: 50%; width: .5rem; height: .5rem; border: solid var(--muted); border-width: 0 2px 2px 0;
  transform: translateY(-75%) rotate(45deg); transition: transform 200ms ease; }
.chapters details[open] > summary::after, .chapters[open] > summary::after { transform: translateY(-25%) rotate(-135deg); }
.chapters summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.chapters h3 { font-size: 1.1rem; margin: 0; }
.chapters > summary strong, .chapter-due { color: var(--blue); font-weight: 600; }
.chapters ul { list-style: none; margin: 0; padding: 0; }
.chapters li { padding: .75rem 0; border-top: 1px solid var(--line); }
/* A started chapter: its name, one bar for how ready it is and the percentage; open, a bar per kind and
   its "just this chapter" buttons. */
.chapter > summary { display: flex; align-items: center; gap: 1rem; padding: .2rem 1.75rem .2rem 0; position: relative; }
.chapter > summary strong { color: inherit; font-weight: 700; flex: none; min-width: 8.5rem; } /* lines the bar up with the kind bars under it */
.chapter > summary .recall-bar { flex: 1; height: 8px; border-radius: 4px; }
.chapter-ready { flex: none; min-width: 7rem; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.chapter-kinds { margin: .9rem 0 .25rem; padding-right: 1.75rem; display: flex; flex-direction: column; gap: .6rem; }
.chapter-kind { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 7rem; align-items: center; gap: 1rem; }
.chapter-kind dt, .chapter-kind dd { margin: 0; }
.chapter-kind dd.muted { font-size: .9rem; text-align: right; }
.chapter-line { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.chapter-line > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.chapter-line .button { min-width: 6rem; box-sizing: border-box; text-align: center; }
.chapters form { margin: 0; }
.recall-bar { display: block; height: 6px; border-radius: var(--radius-pill); background: var(--track); overflow: hidden; }
.recall-bar span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
/* Messages after an action (mockup A2): a small card at the top that fades out; problems use the amber note. */
.flash-stack { display: flex; flex-direction: column; gap: var(--space-2); max-width: 600px; margin: var(--space-3) auto 0; padding: 0 var(--space-4); }
.flash { margin: 0; }
.flash.notice { display: flex; align-items: center; gap: var(--space-2); padding: 10px 6px 10px 14px; border-radius: var(--radius-control); background: var(--panel); box-shadow: var(--shadow-surface); font-size: 15px; font-weight: 500; animation: toast-in 250ms ease both; transition: opacity 250ms ease, transform 250ms ease; }
.flash.notice svg { flex: none; color: var(--green); }
.flash.notice span { flex: 1; }
.flash.notice.leaving { opacity: 0; transform: translateY(-6px); }
.flash-close { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.flash-close:hover { background: var(--bg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .flash.notice { animation: none; transition: none; } }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--line); }
tr.duplicate td { color: var(--muted); } tr.error td { color: var(--red); }
.actions { display: flex; gap: 1rem; align-items: center; } .inline { display: inline; }
kbd { display: inline-flex; align-items: center; vertical-align: middle; height: 22px; padding: 0 7px; border: 0; border-radius: var(--radius-key); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line), 0 1px 0 var(--line); color: var(--text); font: 600 12px/1 var(--font-sans); }
code { background: var(--bg); padding: .05rem .3rem; border-radius: 4px; }
.button.secondary { background: var(--panel); color: var(--blue); border: 0; box-shadow: inset 0 0 0 1.5px var(--blue); }
.banner { background: var(--amber-tint); border-radius: var(--radius-control); padding: .6rem 1rem; }
.status { min-height: 1.5em; font-weight: 600; }
/* Record buttons (mic_meter.js): grey "Opening mic…" until audio really flows, then an outline with
   five bars that move only with the sound the microphone hears, then faded while checking. */
.recorder { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; }
.recorder .mic-bars { display: inline-flex; gap: 3px; align-items: center; height: 22px; }
.recorder .mic-bars i { display: block; width: 4px; height: 4px; border-radius: 2px; background: currentColor; }
.recorder.opening { position: relative; overflow: hidden; background: var(--line); color: var(--muted); border-color: transparent; }
.recorder.opening::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .3), transparent); transform: translateX(-100%); animation: mic-shimmer 1.1s infinite; }
.recorder.listening { background: var(--panel); color: var(--blue); border-color: transparent; box-shadow: inset 0 0 0 2px var(--blue); }
.recorder.checking { opacity: .5; cursor: progress; }
@keyframes mic-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .recorder.opening::after { animation: none; } } /* the bars still move: they carry information */
label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
select { font: inherit; color: var(--text); background: var(--panel); border: 1.5px solid var(--line-strong); border-radius: var(--radius-control); padding: .5rem .6rem; min-height: 40px; }
.link-button.danger { color: var(--red); }
/* Grey outline label (Learn, Review, ...): quieter than the yellow badge. */
.pager { display: flex; gap: 1rem; align-items: center; }
dialog.shortcuts { border: 0; border-radius: var(--radius-card); background: var(--panel); color: var(--text); max-width: 44rem; width: calc(100% - 2rem); padding: var(--space-6); box-shadow: var(--shadow-surface); }
dialog.shortcuts::backdrop { background: rgb(0 0 0 / .4); }
.shortcuts-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.shortcuts-head h2 { margin: 0; font-size: 20px; }
.shortcuts-head form { margin: 0; }
.shortcuts-head .link-button.quiet { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; }
.shortcut-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-6); }
dialog.shortcuts h3 { margin: var(--space-3) 0 var(--space-1); font-size: 13px; font-weight: 600; color: var(--muted); }
dialog.shortcuts dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--space-3); margin: 0; font-size: 14px; align-items: center; }
dialog.shortcuts dt { display: flex; gap: 4px; justify-content: flex-end; }
dialog.shortcuts dd { margin: 0; }
dialog.shortcuts dd kbd { height: 20px; padding: 0 5px; font-size: 11px; }
@media (max-width: 640px) { .shortcut-cols { grid-template-columns: 1fr; } dialog.shortcuts { padding: var(--space-5) var(--space-4); } }
.activity { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.activity-summary { margin: 0 0 .5rem; }
.activity .grid { display: flex; gap: 2px; overflow-x: auto; padding: 2px 2px .25rem; }
.activity .week { display: grid; grid-template-rows: repeat(7, 10px); gap: 2px; }
.activity .grid .day { width: 10px; height: 10px; border-radius: 2px; }
.activity .grid .day:hover { outline: 2px solid var(--text); outline-offset: -1px; }
.activity-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .25rem 1rem; }
.activity-tip { margin: .5rem 0 0; font-size: .85rem; min-height: 1.3em; }
.day { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--track); }
.day.blank { background: transparent; }
.day.level-1 { background: var(--level-1); }
.day.level-2 { background: var(--level-2); }
.day.level-3 { background: var(--level-3); }
.day.level-4 { background: var(--level-4); }
.legend { display: flex; gap: 3px; align-items: center; font-size: .8rem; margin: .5rem 0 0; }
/* Settings (rest-of-app mockups S1, S2, D3): one card, groups headed by a small muted line, each setting a
   row with its name and hint on the left and its control on the right. */
.settings-form { display: flex; flex-direction: column; gap: var(--space-4); }
.settings-group + .settings-group { border-top: 1px solid var(--line); padding-top: var(--space-4); }
.settings-group h2 { margin: 0 0 var(--space-1); font-size: 13px; font-weight: 600; color: var(--muted); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding: var(--space-3) 0; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row.stacks { flex-direction: column; align-items: stretch; }
.setting-label { display: flex; flex-direction: column; gap: 2px; min-width: 6rem; flex: 1 1 14rem; }
.setting-name { font-size: 16px; font-weight: 600; }
.setting-label label.setting-name { display: inline; }
.setting-hint { font-size: 13px; font-weight: 400; color: var(--muted); }
.setting-control { flex: none; }
.setting-more { font-size: 13px; color: var(--muted); }
.setting-more summary { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; width: fit-content; list-style: none; }
.setting-more summary::-webkit-details-marker { display: none; }
.setting-more p { margin: .35rem 0 0; }
.settings select.setting-control { width: auto; max-width: 100%; min-height: 40px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control); box-shadow: inset 0 0 0 1.5px var(--line-strong); background: var(--panel); color: var(--text); font: 500 15px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.settings select.time-zone { max-width: 16rem; }
/* New words a day: a number between − and + buttons. */
.stepper { display: inline-flex; align-items: center; border-radius: var(--radius-control); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.stepper button { width: 40px; height: 40px; border: 0; background: transparent; color: var(--blue); font: 600 20px/1 var(--font-sans); cursor: pointer; }
.stepper input { width: 2.5rem; padding: 0; border: 0; background: transparent; box-shadow: none; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input:focus { box-shadow: none; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* On/off switch (a styled checkbox). */
input.switch { appearance: none; flex: none; width: 48px; height: 28px; padding: 0; margin: 0; border: 0; border-radius: 999px; background: var(--track); box-shadow: inset 0 0 0 1.5px var(--line-strong); position: relative; cursor: pointer; transition: background 150ms ease; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--panel); box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: left 150ms ease; }
input.switch:checked { background: var(--blue); box-shadow: none; }
input.switch:checked::after { left: 23px; }
input.switch:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (max-width: 520px) { .settings select.time-zone { max-width: 11rem; } }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::after { transition: none; } }
/* Remember: the same two choices as the Study goal sentence, a segmented row; the chosen one lifts out of the track. */
fieldset.setting-row { margin: 0; min-width: 0; padding: var(--space-3) 0; border: 0; border-top: 1px solid var(--line); }
fieldset.setting-row legend { float: left; width: 100%; padding: 0; }
.remember-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: var(--space-2); padding: 4px; border: 0; border-radius: var(--radius-control); background: var(--track); }
.remember-choices label { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 56px; padding: 6px 4px; border-radius: 9px; text-align: center; cursor: pointer; }
.remember-choices input[type=radio] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.remember-choices b { font-size: 16px; color: var(--text); }
.remember-choices small { font-size: 13px; color: var(--muted); }
.remember-choices label:has(:checked) { background: var(--panel); box-shadow: var(--shadow-bar); }
.remember-choices label:has(:checked) b { color: var(--blue); }
.remember-choices label:has(:focus-visible) { outline: 3px solid var(--blue); outline-offset: 1px; }
.feedback-detail { text-align: left; margin-top: .5rem; }
.feedback-detail:not(:empty) { margin-bottom: 1.25rem; } /* clear of the Play and Skip rows below */
.feedback-detail .words { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.feedback-detail .word { border-radius: 999px; padding: .15rem .8rem; border: 1px solid var(--line); }
.feedback-detail .word.good { border-color: var(--green); color: var(--green); }
.feedback-detail .word.fair { border-color: var(--amber); color: var(--amber); }
.feedback-detail .word.weak { border-color: var(--red); color: var(--red); }
/* Sound-by-sound detail: the letters of an unclear sound, marked inside the word. */
.feedback-detail .word .sound { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.feedback-detail .word .sound.weak { color: var(--red); }
.feedback-detail .word .sound.fair { color: var(--amber); }
.feedback-detail .comparison { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .5rem; }
.feedback-detail .compare, .review-card .feedback-detail .compare { font-size: .9rem; padding: .35rem .8rem; border-radius: 10px; }
.feedback-detail .compare-key { font-size: .85rem; }
.feedback-detail .tip-disclosure { flex-basis: 100%; }
.feedback-detail .tip-disclosure summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.feedback-detail .tip-disclosure .tip { margin: .5rem 0 0; font-size: .9rem; line-height: 1.5; }

/* The single review card: a soft, lifted card whose stages slide in place (see card_motion.js). */
.review-card { --ring: rgb(0 0 0 / .05); --shadow: rgb(0 0 0 / .07); --lift: rgb(0 0 0 / .12);
  --motion: 300ms; --spring: cubic-bezier(.34, 1.45, .64, 1); --ease: cubic-bezier(.2, .8, .2, 1);
  /* Card-to-card motion is kept short so studying feels quick: a card or stage arriving, and one leaving. */
  --arrive: 200ms; --leave: 140ms;
  max-width: 600px; margin: 2rem auto; background: var(--panel); border-radius: 20px; padding: 2rem 2rem 1.75rem;
  box-shadow: 0 0 0 1px var(--ring), 0 4px 16px var(--shadow); position: relative; text-align: left;
  transition: transform var(--motion) var(--ease), box-shadow var(--motion) var(--ease); }
.review-card:has(.mic.listening) { transform: scale(1.015); box-shadow: 0 0 0 1px var(--ring), 0 12px 24px var(--lift); }
.review-card .counter { position: absolute; top: 1.1rem; right: 1.5rem; margin: 0; font-size: .8rem; color: var(--muted); }
.review-card .study-scope { margin: 0 0 .75rem; padding-right: 8rem; font-size: .85rem; color: var(--muted); }
.review-card .context { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 .35rem; padding-right: 9rem; font-size: .85rem; color: var(--muted); }
.review-card .context .badge { margin: 0; }
/* Exercise labels (ExerciseLabelsHelper): a quiet grey outline, not the yellow fill, so the word on
   the card is read first; up to 4 words, so a size smaller than other badges. The grey hint goes
   under it on the first card of an exercise. */
.context .badge { font-size: .75rem; font-weight: 600; background: none; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.exercise-hint { margin: 0 0 .5rem; font-size: .85rem; color: var(--muted); }
.review-card .context + .exercise-hint { margin-top: -.1rem; }
.review-card .counter + .prompt { margin-top: 1.5rem; } /* no badge line: keep the prompt clear of the counter */
.review-card .said-by { margin: 0; font-size: .85rem; }
.review-card .with-speaker .speaker-line { display: inline-block; vertical-align: middle; margin-left: .25rem; }
.review-card .with-speaker .speaker { margin: 0; }
.review-card .prompt { font-size: 2.25rem; line-height: 1.15; letter-spacing: -.01em; margin: .25rem 0 1rem; padding-right: 4rem; }
.review-card .prompt.done { font-size: 1.25rem; font-weight: 600; opacity: .6; margin-bottom: .75rem; }
.review-card .cue { margin: 0 0 .5rem; font-size: .9rem; font-weight: 600; color: var(--blue); }
.review-card .answer { align-self: flex-start; display: inline-block; font-size: 2.25rem; font-weight: 700; line-height: 1.15; color: var(--text);
  margin: .5rem 0 .25rem -.75rem; padding: .3rem .75rem; border-radius: 14px; }
.review-card .answer.outcome-good { background: var(--green-tint); color: var(--green); }
.review-card .answer.outcome-fair { background: color-mix(in srgb, var(--amber) 10%, transparent); }
.review-card .answer.outcome-bad { background: color-mix(in srgb, var(--red) 8%, transparent); }
.review-card .forms { margin: 0 0 .75rem; color: var(--muted); }
.review-card .answer-input { font-size: 1.4rem; text-align: left; border-radius: 12px; padding: .75rem 1rem; }
.review-card .button { border-radius: 12px; padding: .7rem 1.25rem; }
.review-card .earlier { opacity: .8; }
.review-card .typed { margin: .25rem 0; font-size: 1.1rem; }
.review-card .typed .accept { white-space: nowrap; } .review-card .typed .accept-link { font-size: .95rem; }
.review-card .typed.right { color: var(--green); } .review-card .typed.near { color: var(--amber); } .review-card .typed.wrong { color: var(--red); }
.review-card .speak-row, .review-card .actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: .5rem 0; }
.review-card > .reveal > .actions:last-child, .review-card > .actions:last-child { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
/* Speaking stage: Play and Skip each get their own spaced row, like the Record row above. */
.review-card [data-speech-target=audio] [data-controller=audio], .review-card .skip-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: .75rem 0 0; }
.review-card .skip-row { gap: .4rem; margin-top: 1rem; }
.review-card .pronounce-again { margin: 1rem 0; padding-top: .75rem; border-top: 1px dashed var(--line); }
.review-card.done-state { text-align: center; }
.review-card.round-break .actions { justify-content: center; } /* round break: buttons sit under the centred heading */

/* Motion, only when a card or stage arrives by navigation (card_motion.js adds the classes). */
.review-card.stage-in .reveal { animation: card-reveal var(--arrive) var(--spring) both; }
.review-card.stage-in .prompt.done { animation: prompt-settle var(--arrive) var(--ease) both; }
.review-card.stage-in .answer.outcome-good { animation: burst-good calc(var(--arrive) * 1.6) var(--spring) both; }
.review-card.stage-in .answer.outcome-fair { animation: burst-fair calc(var(--arrive) * 1.6) var(--spring) both; }
.review-card.stage-in .answer.outcome-bad { animation: burst-bad calc(var(--arrive) * 1.6) var(--spring) both; }
.review-card.card-in { animation: card-in var(--arrive) var(--spring) both; }
.review-card.card-out { animation: card-out var(--leave) var(--ease) both; }
@keyframes card-reveal { from { opacity: 0; transform: translateY(16px); } }
@keyframes prompt-settle { from { font-size: 2.25rem; font-weight: 700; opacity: 1; } }
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes card-out { to { opacity: 0; transform: translateX(-110%) rotate(-3deg); } }
@keyframes burst-good { 0% { transform: scale(.92); background: transparent; } 45% { transform: scale(1.05); background: color-mix(in srgb, var(--green) 20%, transparent); } }
@keyframes burst-fair { 0% { transform: scale(.92); background: transparent; } 45% { transform: scale(1.05); background: color-mix(in srgb, var(--amber) 22%, transparent); } }
@keyframes burst-bad { 0% { transform: scale(.92); background: transparent; } 45% { transform: scale(1.05); background: color-mix(in srgb, var(--red) 18%, transparent); } }
@media (prefers-color-scheme: dark) {
  .week-days .day.level-3, .week-days .day.level-4 { color: var(--bg); }
  .review-card { --ring: rgb(255 255 255 / .07); --shadow: rgb(0 0 0 / .45); --lift: rgb(0 0 0 / .6); }
}
@media (prefers-reduced-motion: reduce) {
  .review-card, .review-card * { animation: none !important; transition: none !important; }
  .chapters summary::after { transition: none; }
  dialog.year-dialog[open] { animation: none; }
}
@media (max-width: 520px) {
  .home { margin: 1rem 0; gap: 1rem; }
  .home .panel { border-radius: 16px; padding: 1.25rem 1rem; }
  .week-days { gap: 5px; }
  .week-days .day { align-items: center; min-height: 58px; padding: .45rem .2rem; font-size: .72rem; }
  .week-days .count { font-size: .95rem; }
  .year-view .link-button { min-height: 44px; }
  .tabs { width: 100%; } .tabs [role=tab] { flex: 1; min-height: 44px; }
  .chapters { padding: 0 .9rem; }
  .chapter > summary { gap: .75rem; }
  .chapter > summary strong { min-width: 0; }
  .chapter-ready { min-width: 0; font-size: .95rem; }
  .chapter-kinds { padding-right: 0; }
  .chapter-kind { grid-template-columns: 7rem minmax(0, 1fr) auto; gap: .6rem; }
  .today-actions { width: 100%; } .today-actions .button { flex: 1; text-align: center; }
  .review-card { margin: 1rem 0; padding: 1.5rem 1rem 1.25rem; border-radius: 16px; }
  .review-card .prompt { font-size: 1.75rem; padding-right: 0; }
  .review-card .prompt.done { font-size: 1.1rem; }
  .review-card .answer { font-size: 1.9rem; }
  .review-card .context { padding-right: 6.5rem; }
  .review-card .study-scope { margin-top: 1.4rem; padding-right: 0; } /* below the drill's counter, which is longer than on a phone fits beside it */
  .review-card .study-scope + .context { padding-right: 0; }
  .review-card .button, .review-card .button.mic { width: 100%; text-align: center; padding: .9rem 1rem; font-size: 1.1rem; }
  .review-card .actions .muted, .review-card .speak-row .muted, .review-card [data-controller=audio] .muted, .review-card .pronounce-again > span.muted, .review-card .compare-key { display: none; } /* keyboard hints are noise on a phone */
  .review-card .answer-input { font-size: 1.25rem; }
  .review-card .skip-hint { display: none; }
  .review-card form.inline { display: block; }
  .review-card form.inline .link-button { width: 100%; min-height: 48px; text-align: center; }
  .review-card .skip-row form.inline { flex-basis: 100%; }
  .review-card .feedback-detail .compare { padding: .7rem 1rem; font-size: 1rem; }
}

/* Streak celebration (once a study day): yesterday's count rolls up to today's, then today's dot joins the week. */
dialog.celebration { --spring: cubic-bezier(.34, 1.45, .64, 1); --ease: cubic-bezier(.2, .8, .2, 1);
  border: 0; border-radius: var(--radius-card); background: var(--panel); color: var(--text); box-shadow: var(--surface-shadow);
  width: calc(100% - 2rem); max-width: 420px; padding: 2rem; text-align: center; }
dialog.celebration[open] { animation: card-in 390ms var(--spring) both; }
dialog.celebration::backdrop { background: rgb(0 0 0 / .4); }
dialog.celebration form { margin: 0; }
dialog.celebration .context { margin: 0; font-size: .85rem; color: var(--muted); }
dialog.celebration { text-align: center; }
dialog.celebration .streak-count { position: relative; height: 1.05em; margin: var(--space-2) auto 0; overflow: hidden; font-size: 64px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
dialog.celebration .streak-count span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
dialog.celebration .streak-count .from { animation: count-out 300ms var(--ease) 450ms both; }
dialog.celebration .streak-count .to { animation: count-in 300ms var(--spring) 450ms both, count-pulse 400ms var(--ease) 800ms; }
dialog.celebration .streak-line { margin: var(--space-3) 0; color: var(--muted); }
dialog.celebration .streak-line::before { content: ""; display: block; width: 44px; height: 6px; margin: 0 auto var(--space-4); border-radius: 3px; background: var(--yellow); }
dialog.celebration .week { list-style: none; display: flex; justify-content: center; gap: 6px; margin: 0; padding: 0; }
dialog.celebration .week li { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--track); color: var(--muted); font-size: 11px; font-weight: 600; }
dialog.celebration .week li.on { background: var(--blue); color: var(--on-action); }
dialog.celebration .week li.today.on { animation: dot-in 300ms var(--spring) 900ms both; }
dialog.celebration .actions { display: flex; justify-content: center; margin-top: var(--space-5); }
dialog.celebration .button { min-width: 12rem; }
@keyframes count-out { to { opacity: 0; transform: translateY(-60%); } }
@keyframes count-in { from { opacity: 0; transform: translateY(60%); } }
@keyframes count-pulse { 50% { transform: scale(1.12); } }
@keyframes dot-in { from { background: var(--line); transform: scale(.6); } }
@media (prefers-reduced-motion: reduce) {
  dialog.celebration, dialog.celebration * { animation: none !important; }
  dialog.celebration .streak-count .from { display: none; }
}
@media (max-width: 520px) {
  dialog.celebration { padding: 1.5rem 1rem 1.25rem; border-radius: 16px; }
  dialog.celebration .button { width: 100%; padding: .9rem 1rem; font-size: 1.1rem; }
}

/* Talking hides the menu on a phone; the speaker buttons on word cards. */
@keyframes sheet-in { from { transform: translateY(100%); } }
@media (max-width: 520px) { .talking .topbar { display: none; } }
.review-card .speaker { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; margin: -6px 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--blue); cursor: pointer; }
.review-card .speaker:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.review-card .speaker:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.grammar-progress { display: flex; gap: 6px; margin: .5rem 0 1.25rem; }
.grammar-progress.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.grammar-progress.steps span.done { background: var(--blue); }
.grammar-progress span.now { background: var(--blue); }
.grammar-progress span.right { background: var(--green); }
.grammar-progress span.wrong { background: color-mix(in srgb, var(--muted) 60%, var(--line)); } /* a calm grey, not red: a miss is not a failure */
/* The review card's round of 10: the grammar steps bar spread across the top of the card. */
.review-card .counter.round-progress { position: static; margin: 0 0 1.25rem; }
.review-card .round-progress + .prompt { margin-top: 0; }
.review-card .round-progress ~ .study-scope, .review-card .round-progress ~ .context { margin-top: 0; padding-right: 0; }
.study-session-form { margin: 0; }
/* The study goal as a sentence to complete: "I want to learn [Chapter 4] by [Fri 20 Nov]". Each blank
   opens its picker inside the card: every chapter with how ready it is, or five weeks of days. */
.goal-sentence { display: flex; flex-direction: column; gap: var(--space-3); }
.goal-sentence form { display: flex; flex-direction: column; gap: var(--space-3); margin: 0; }
.goal-line { margin: 0; font-size: 30px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
p.goal-line { font-size: 24px; }
.goal-line .blank { display: inline-flex; align-items: baseline; gap: 4px; margin: 0 -2px; padding: 0 6px; border: 0; border-radius: 8px; background: var(--blue-tint); color: var(--blue); font: inherit; letter-spacing: inherit; white-space: nowrap; cursor: pointer; }
.goal-line .blank::after { content: "▾"; font-size: .4em; align-self: center; }
.goal-line .blank[aria-expanded=true] { background: var(--action); color: var(--on-action); }
.goal-fc { margin: 0; font-size: 15px; color: var(--muted); }
.goal-fc b { color: var(--text); font-weight: 600; }
.goal-sentence turbo-frame { display: flex; flex-direction: column; gap: var(--space-1); }
.goal-picker { display: grid; gap: 10px; padding: 12px 0 4px; border-top: 1px solid var(--line); }
.goal-picker-head { display: flex; justify-content: space-between; align-items: center; }
.goal-picker-head b { font-size: 16px; }
.goal-picker-head .link-button.quiet { min-height: 36px; }
.goal-hint { margin: 0; font-size: 13px; color: var(--muted); }
.goal-chgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.goal-chgrid button { display: grid; justify-items: center; min-height: 50px; padding: 6px 2px; border: 0; border-radius: var(--radius-control); background: var(--bg); color: var(--text); font: inherit; font-size: 18px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.goal-chgrid small { font-size: 12px; font-weight: 400; color: var(--muted); }
.goal-chgrid [data-s=mid] { background: var(--blue-tint); box-shadow: inset 0 0 0 1px var(--level-1); }
.goal-chgrid [data-s=end] { background: var(--action); color: var(--on-action); box-shadow: none; }
.goal-chgrid [data-s=end] small { color: var(--on-action); opacity: .85; }
.goal-cal-head { display: flex; align-items: center; justify-content: space-between; }
.goal-cal-head b { font-size: 15px; }
.goal-cal-nav { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--bg); color: var(--text); font-size: 18px; cursor: pointer; }
.goal-cal-nav[disabled] { opacity: .35; cursor: default; }
.goal-fc .remember-flip { display: inline; padding: 0; border: 0; background: none; color: var(--blue); font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.goal-weekgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.goal-weekgrid i { padding: 2px 0; font-size: 12px; font-style: normal; color: var(--muted); }
.goal-weekgrid button { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: 500 14px/1 var(--font-sans, inherit); font-variant-numeric: tabular-nums; cursor: pointer; }
.goal-weekgrid button small { font-size: 9px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; }
.goal-weekgrid button[disabled] { color: var(--line-strong); cursor: default; }
.goal-weekgrid button[data-today] { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.goal-weekgrid button[aria-pressed=true] { background: var(--action); color: var(--on-action); }
.goal-weekgrid button[aria-pressed=true] small { color: var(--on-action); }
.goal-heavy { font-weight: 600; }
.goal-actions { padding-top: var(--space-1); }
.goal-actions.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.goal-actions.row form { margin: 0; }
.goal-actions.row .button.secondary { min-height: 44px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
.study-session-start .done-today { margin: 0; color: var(--green); font-weight: 600; }
.kind { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.activity-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; }
/* Home: the By exercise tab's Review and Practice rows. */
.exercise-row { display: grid; grid-template-columns: 6rem minmax(0, 1fr); align-items: center; gap: .5rem 1rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.exercise-row:first-child { border-top: 0; }
.exercise-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.exercise-buttons form, .chapter-focus form { margin: 0; }
.exercise-rows > p { margin: .5rem 0 0; }
/* A chapter's quiet "Just this chapter" buttons. */
.chapter-focus { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .75rem; font-size: .85rem; }
.pill { min-height: 36px; border: 0; border-radius: 999px; padding: .4rem .9rem; background: color-mix(in srgb, var(--blue) 10%, transparent); color: var(--blue);
  font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer; }
.pill:hover { background: color-mix(in srgb, var(--blue) 16%, transparent); }
.pill:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; }
.pill[disabled] { opacity: .5; cursor: not-allowed; }
/* Study session's countdown above the exercises of a sitting. */
/* Wider screens: "Study session" on the left, a small ring, the time and Stop in the top-right corner.
   Phones: a big ring with the minutes inside, then "Study session" over "14:32 left of 25 min". */
.study-session-bar { display: flex; align-items: center; gap: .6rem; padding: .5rem 1.75rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.study-session-bar form { margin: 0 0 0 .5rem; }
.study-session-bar .label { display: contents; }
.study-session-bar .label strong { order: -2; margin-right: auto; }
.study-session-bar .ring { order: -1; width: 26px; height: 26px; flex: none; }
.study-session-bar .ring circle { fill: none; stroke-width: 6; }
.study-session-bar .ring .track { stroke: var(--line); }
.study-session-bar .ring .left { stroke: var(--blue); stroke-linecap: round; transition: stroke-dasharray 1s linear; }
.study-session-bar .ring text { display: none; fill: var(--text); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.study-session-bar .time[hidden], .study-session-bar .time-up-note[hidden] { display: none; }
.study-session-bar .clock { font-variant-numeric: tabular-nums; font-weight: 600; }
.study-session-bar .of { display: none; }
.study-session-bar .time-up-note { margin: 0; }
.study-session-bar .stop { padding: .3rem .9rem; font-size: .9rem; }
@media (max-width: 520px) {
  .study-session-bar { gap: .75rem; padding: .5rem 1rem; }
  .study-session-bar .ring { width: 52px; height: 52px; }
  .study-session-bar .ring circle { stroke-width: 5; }
  .study-session-bar .ring text { display: inline; }
  .study-session-bar .label { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; flex: 1; min-width: 0; }
  .study-session-bar .label strong { margin-right: 0; }
  .study-session-bar .time { font-size: .85rem; color: var(--muted); }
  .study-session-bar .clock { font-weight: 400; }
  .study-session-bar .of { display: inline; }
  .study-session-bar form { margin: 0; }
  .study-session-bar .stop { min-height: 44px; }
}
.study-session-bar.time-up .ring .left { display: none; }
/* Today's list in the study session: one bar of how much is done, no timer. */
.study-session-bar.list-bar { gap: .75rem; }
.list-bar .list-progress { flex: 1; min-width: 0; max-width: 40rem; margin: 0 auto; display: flex; flex-direction: column; gap: .3rem; }
.list-bar .list-count { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; font-variant-numeric: tabular-nums; }
.list-bar .recall-bar { height: 8px; border-radius: 4px; }
.list-bar form { margin: 0; }
@media (prefers-reduced-motion: reduce) { .study-session-bar .ring .left { transition: none; } }
.study-session-done .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.study-session-done .actions form { margin: 0; }
.study-session-done .keep-going-note { margin: .5rem 0 0; font-size: .85rem; }
@media (max-width: 520px) {
  .exercise-row { grid-template-columns: 1fr; }
}

/* Up next (Study session): the card between two kinds of exercise. */
.review-card.up-next { text-align: center; padding: 2.5rem 2rem 2rem; }
.up-next .eyebrow { margin: 0 0 .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.up-next .prompt { margin: 0 0 .5rem; padding-right: 0; font-size: 1.9rem; line-height: 1.2; }
.up-next .target { margin: 0 0 .5rem; font-weight: 600; }
.up-next .detail { margin: 0 auto; max-width: 30rem; color: var(--muted); }
.up-next .minutes { margin: .5rem 0 0; font-size: .9rem; }
.up-next .actions { display: flex; justify-content: center; align-items: center; gap: .75rem; margin-top: 1.5rem; }

/* Words page (rest-of-app mockups R1-R6): a page title with Import words, search, filter chips, then
   one card per chapter whose word rows open in place with their actions as chips. */
.words-page { display: flex; flex-direction: column; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.page-head h1 { margin: 0; }
.words-page .page-sub { margin: var(--space-1) 0 var(--space-4); }
.search-field { display: flex; flex-direction: row; align-items: center; gap: var(--space-2); font-weight: 400; background: var(--panel); border: 0; box-shadow: inset 0 0 0 1.5px var(--line-strong); border-radius: var(--radius-control); padding: 0 var(--space-3); min-height: 44px; color: var(--muted); }
.search-field:focus-within { box-shadow: inset 0 0 0 2px var(--blue); }
.search-field input { border: 0; background: transparent; padding: .6rem 0; flex: 1; min-width: 0; font-size: 16px; box-shadow: none; }
.search-field input:focus { outline: none; }
.search-field .clear { flex: none; color: var(--muted); font-size: 13px; text-underline-offset: 3px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-3) 0 var(--space-4); }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-pill); background: var(--track); color: var(--text); text-decoration: none; font: 600 13px/1 var(--font-sans); cursor: pointer; list-style: none; }
.chip::-webkit-details-marker { display: none; }
.chip:hover { filter: brightness(.97); }
.chip.on { background: var(--blue); color: var(--on-action); }
.chip-more > summary::after { content: "▾"; margin-left: 3px; font-size: 11px; }
.chip-more { position: relative; display: inline-block; }
.menu-pop { position: absolute; z-index: 5; top: calc(100% + .35rem); left: 0; min-width: 12rem; display: flex; flex-direction: column; padding: .4rem; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow-surface); }
.menu-pop a, .menu-pop .link-button { display: block; width: 100%; text-align: left; padding: .55rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.menu-pop a:hover, .menu-pop .link-button:hover { background: var(--bg); }
.menu-pop a[aria-current] { color: var(--blue); font-weight: 600; }
.menu-pop .link-button.danger { color: var(--red); }
.menu-pop form { display: block; }
.word-groups { display: flex; flex-direction: column; gap: var(--space-3); }
.word-group.list-card, .word-results.list-card, .empty-words.list-card { padding: var(--space-1) var(--space-5) var(--space-2); background: var(--panel); }
.word-group > summary { display: flex; align-items: baseline; justify-content: space-between; gap: .1rem .75rem; padding: var(--space-4) 0; cursor: pointer; list-style: none; }
.word-group > summary strong { font-size: 16px; }
.word-group > summary .muted { font-size: 13px; text-align: right; }
.word-group:not([open]) > summary .muted::after { content: " ▸"; }
.word-group > summary::-webkit-details-marker { display: none; }
.word-group > summary:focus-visible, .word-row > summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.word-group .loading { margin: 0 0 var(--space-4); }
.word-group .word-list, .word-results .word-list { margin-bottom: var(--space-2); }
.word-results h2, .empty-words h2 { margin: var(--space-4) 0 var(--space-3); font-size: 16px; }
.word-results h2 .muted { font-weight: 400; }
.empty-words { padding-bottom: var(--space-5) !important; }
.empty-words h2 { font-size: 24px; margin-bottom: var(--space-2); }
.empty-words p { margin: 0 0 var(--space-3); }
.word-row { border-top: 1px solid var(--line); }
.word-row > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-3); align-items: center; padding: var(--space-3) 0; cursor: pointer; list-style: none; border-radius: var(--radius-control); }
.word-row > summary::-webkit-details-marker { display: none; }
.word-row > summary .word-sv, .word-row > summary .word-en { grid-column: 1; }
.word-row > summary .strength { grid-column: 2; grid-row: 1 / span 2; }
.word-row[open] { margin: 0 calc(-1 * var(--space-3)); padding: 0 var(--space-3); border-radius: var(--radius-control); border-top-color: transparent; background: var(--bg); }
.word-row[open] + .word-row { border-top-color: transparent; }
.word-row.selected > summary { box-shadow: 0 0 0 2px var(--blue); }
.word-sv { font-size: 16px; font-weight: 600; }
.word-en { font-size: 14px; color: var(--muted); }
.word-row.suspended > summary .word-sv, .word-row.suspended > summary .word-en,
.word-row.deleted > summary .word-sv, .word-row.deleted > summary .word-en { opacity: .55; }
.row-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; margin-left: 6px; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--muted); font-size: 11px; font-weight: 600; vertical-align: 2px; }
.strength { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; }
.strength i { display: block; width: 4px; border-radius: 2px; background: var(--track); }
.strength i:nth-child(1) { height: 6px; } .strength i:nth-child(2) { height: 9px; } .strength i:nth-child(3) { height: 12px; } .strength i:nth-child(4) { height: 16px; }
.strength i.on { background: var(--blue); }
.word-detail { padding: 0 0 var(--space-3); display: flex; flex-direction: column; gap: 6px; font-size: 14px; animation: word-open 200ms ease; }
.word-detail p { margin: 0; }
.row-notice { color: var(--blue); font-weight: 600; }
.word-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--space-1); }
.word-actions form.inline { display: inline-flex; }
.word-actions .chip-button { min-height: 32px; padding: 0 12px; font-size: 13px; text-decoration: none; gap: 6px; }
.word-actions .chip-button kbd { height: 18px; padding: 0 5px; font-size: 11px; }
.confirm-row { display: grid; gap: var(--space-2); margin-top: var(--space-1); }
.confirm-row p { margin: 0; }
.confirm-actions { display: flex; align-items: center; gap: var(--space-3); }
.confirm-actions form.inline { display: inline-flex; }
.confirm-actions .button.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.confirm-actions .link-button.quiet { min-height: 40px; }
.button.small { padding: .4rem .9rem; border-radius: 10px; font-size: .9rem; }
.words-page .pager { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) 0 var(--space-2); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
@keyframes word-open { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
  .word-detail { animation: none; }
}
@media (max-width: 520px) {
  .word-group.list-card, .word-results.list-card, .empty-words.list-card { padding: var(--space-1) var(--space-4) var(--space-2); }
  .word-row > summary { min-height: 44px; }
  .word-actions .chip-button { min-height: 36px; }
  .search-field .key-hint, .word-actions .key-hint { display: none; }
}

/* ===== Redesign: word cards and the study session bar (docs/design-system/mockups/word-card-mockups.html) ===== */
.chip-button { display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-pill); background: var(--blue-tint); color: var(--blue); font: 600 14px/1 var(--font-sans); cursor: pointer; }
.chip-button:active { transform: scale(.97); }
a.chip-button { text-decoration: none; }
.link-button.quiet { color: var(--muted); font-weight: 500; text-underline-offset: 3px; min-height: 44px; }
.word-card { max-width: 600px; padding: var(--space-6); border-radius: var(--radius-card); box-shadow: var(--shadow-surface); }
.word-card .round-progress { margin: 0 0 var(--space-4); gap: 4px; }
.word-card .round-progress span { background: var(--track); }
.word-card .round-progress span.right { background: var(--blue); }
.word-card .round-progress span.wrong { background: var(--line-strong); }
.word-card .round-progress span.now { background: var(--level-2); }
/* Review and Learn: one mark per word of today's queue, always one row (see answers/_counter). The row is its
   own container: segments while each has 18px or more, then dots, then thin pipes (phone: pipes above 30 words, wider above 60). */
.word-card .day-marks { display: flex; align-items: center; gap: 8px; container-type: inline-size; } /* "N left" hugs the right edge; the marks take the rest */
.day-marks .marks { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 4px; height: 8px; }
.day-marks .marks span { flex: 1 1 0; min-width: 0; height: 6px; border-radius: 3px; transition: background-color 220ms ease; }
.day-marks .marks-left { display: none; flex: none; color: var(--muted); font: 600 12px/1 var(--font-sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
@container (max-width: 419px) {
  .day-marks.n-dots .marks, .day-marks.n-pipes .marks { flex: 1 1 auto; }
  .day-marks.n-dots .marks { gap: 0; justify-content: space-between; }
  .day-marks.n-dots .marks span { flex: none; width: clamp(4px, calc((100cqw - 56px) / var(--n) * .62), 8px); height: auto; aspect-ratio: 1; border-radius: 50%; }
  .day-marks.n-pipes .marks { gap: 0; justify-content: space-between; height: 14px; }
  .day-marks.n-pipes .marks span { flex: none; width: clamp(1px, calc((100cqw - 56px) / var(--n) * .45), 4px); height: 14px; border-radius: 1px; }
  .day-marks.n-dots .marks-left, .day-marks.n-pipes .marks-left { display: block; }
}
@container (min-width: 420px) {
  .day-marks.w-dots .marks, .day-marks.w-pipes .marks { flex: 1 1 auto; }
  .day-marks.w-dots .marks { gap: 0; justify-content: space-between; }
  .day-marks.w-dots .marks span { flex: none; width: clamp(4px, calc((100cqw - 56px) / var(--n) * .62), 8px); height: auto; aspect-ratio: 1; border-radius: 50%; }
  .day-marks.w-pipes .marks { gap: 0; justify-content: space-between; height: 14px; }
  .day-marks.w-pipes .marks span { flex: none; width: clamp(1px, calc((100cqw - 56px) / var(--n) * .45), 4px); height: 14px; border-radius: 1px; }
  .day-marks.w-dots .marks-left, .day-marks.w-pipes .marks-left { display: block; }
}
@media (prefers-reduced-motion: reduce) { .day-marks .marks span { transition: none; } }
.word-card .context { gap: var(--space-2); margin: 0 0 var(--space-3); padding-right: 0; font-size: 13px; }
.word-card .context .badge { margin: 0; height: 24px; background: var(--yellow); color: var(--on-yellow); box-shadow: none; font-size: 12px; }
.word-card .exercise-hint { margin: -4px 0 var(--space-3); font-size: 13px; }
/* The word type after the chapter ("verb", "noun"): the design system's quiet grey label (.sv-label). */
.context .word-class { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 12px; font-weight: 600; }
/* The ⋯ menu at the end of the context line (Don't show this word again). */
.card-menu { position: relative; margin-left: auto; }
.card-menu > summary { display: grid; place-items: center; width: 36px; height: 32px; border-radius: 10px; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; list-style: none; }
.card-menu > summary::-webkit-details-marker { display: none; }
.card-menu > summary:hover, .card-menu[open] > summary { background: var(--track); }
.card-menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-control); background: var(--panel); box-shadow: var(--shadow-surface); white-space: nowrap; font-size: 14px; }
.card-menu-pop form { margin: 0; }
.card-menu-pop .link-button { color: var(--text); text-decoration: none; min-height: 36px; }
/* The text stack: one hero per card (the English to recall, or the Swedish once it shows). */
.word-card .prompt { margin: 0 0 var(--space-4); padding-right: 0; font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.word-card .prompt.small, .word-card .prompt.done { margin: 0 0 var(--space-1); font-size: 17px; line-height: 1.4; font-weight: 600; letter-spacing: 0; color: var(--muted); opacity: 1; }
.word-card .answer { display: block; margin: var(--space-1) 0 var(--space-3); padding: 0; border-radius: 0; font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; color: var(--text); background: none; text-wrap: balance; }
.word-card .answer[class*=outcome-] { background: none; }
.word-card.stage-in .prompt.done { animation: none; }
.word-card.stage-in .answer[class*=outcome-] { animation: hero-settle var(--arrive) var(--spring) both; }
@keyframes hero-settle { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.word-card .cue { display: block; margin: 0 0 var(--space-2); font-size: 15px; font-weight: 600; color: var(--blue); }
.word-card .answer-input { min-height: 52px; padding: 0 var(--space-4); border-radius: var(--radius-control); font-size: 20px; font-weight: 500; text-align: left; }
.word-card .earlier { opacity: 1; }
.word-card .typed { margin: 0 0 var(--space-2); font-size: 15px; color: var(--muted); }
.word-card .typed.wrong, .word-card .typed.near { color: var(--muted); }
.word-card .typed b { color: var(--text); font-weight: 600; }
.word-card .typed.wrong .verdict { color: var(--red); font-weight: 600; }
.word-card .typed.near .verdict { color: var(--amber); font-weight: 600; }
.word-card .typed.right { color: var(--green); font-weight: 600; }
.word-card .typed .tick::before, .word-card .feedback.right::before { content: "✓"; font-weight: 700; margin-right: 6px; }
.word-card .typed .accept { margin-left: var(--space-2); }
/* On a phone the link gets its own line, flush with "You wrote" (a wrapped inline margin pushed it right). */
@media (max-width: 520px) { .word-card .typed .accept { display: block; margin: 2px 0 0; } }
/* A wrong answer marks what differs: struck through in what you typed, underlined in the right answer. */
.word-card .typed del.diff { color: var(--red); text-decoration: line-through 2px; }
.word-card .answer ins.diff { color: var(--red); text-decoration: underline 3px; text-underline-offset: 6px; }
/* After a wrong answer (mic on) Hold to speak takes Play's place; the audio still autoplays. */
.word-card .audio-row.silent { display: none; }
/* A wrapper the mic switch swaps in place (mic_controller.js); it adds no box of its own. */
.mic-part { display: contents; }
/* The answer sits on a soft tint of how it went (Wabi card), and a wrong part's fix drops into place. */
.word-card[data-stage=result] .answer[class*=outcome-] { width: fit-content; max-width: 100%; padding: 2px 10px; margin-left: -10px; border-radius: 12px; }
/* A right answer is itself green, on the green tint (like a wrong letter turns red). */
.word-card[data-stage=result] .answer.outcome-good { background: var(--green-tint); color: var(--green); }
.word-card[data-stage=result] .answer.outcome-fair { background: color-mix(in srgb, var(--amber) 11%, transparent); }
.word-card[data-stage=result] .answer.outcome-bad { background: color-mix(in srgb, var(--red) 8%, transparent); }
.word-card .answer ins.diff { display: inline-block; }
.word-card .answer .word-whole { white-space: nowrap; }
.word-card.stage-in .answer ins.diff { animation: fix-drop .5s var(--spring) both; animation-delay: calc(var(--motion) * 1.2); }
@keyframes fix-drop { from { opacity: 0; transform: translateY(-16px); filter: blur(3px); } }
@media (prefers-reduced-motion: reduce) { .word-card.stage-in .answer ins.diff { animation: none; } }
.word-card .pronounce-again .orb-row { flex-wrap: nowrap; margin: var(--space-1) 0 0; }
.word-card .pronounce-again .orb-hint { margin: 0; }
.word-card .typed .accept-link { color: var(--muted); font-size: 14px; }
.word-card .feedback { margin: var(--space-2) 0; font-size: 15px; font-weight: 600; }
.word-card .feedback.near { color: var(--amber); }
/* What the mic heard: one chip per word, coloured by how it sounded. */
.word-card .feedback-detail .words { gap: var(--space-2); }
.word-card .feedback-detail .word { display: inline-block; line-height: 36px; min-height: 36px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-control); font-size: 18px; font-weight: 600; }
.word-card .feedback-detail .word.good { background: var(--green-tint); color: var(--green); }
.word-card .feedback-detail .word.fair { background: var(--amber-tint); color: var(--amber); }
.word-card .feedback-detail .word.weak { background: var(--red-tint); color: var(--red); }
.word-card .feedback-detail .word .sound { text-decoration-thickness: 3px; text-underline-offset: 5px; }
.word-card .audio-row, .word-card [data-speech-target=audio] [data-controller=audio] { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; }
.word-card .forms { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-3) 0; color: var(--text); }
.word-card .forms span:not(.sep) { padding: 3px 10px; border-radius: var(--radius-pill); background: var(--track); font-size: 14px; font-weight: 600; }
.word-card .forms .sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.word-card .example { margin: var(--space-3) 0 0; padding-top: var(--space-3); border-top: 1px solid var(--line); font-size: 15px; font-style: normal; color: var(--text); }
.word-card .actions.dock { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-3); margin: var(--space-5) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.word-card .actions.dock .muted { margin: 0; }
.word-card .actions.dock form { margin: 0; }
.word-card .waiting { margin: var(--space-3) 0 0; }
/* The orb: the one living control, hold to speak. */
.word-card .orb-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin: var(--space-4) 0 var(--space-2); }
.word-card .orb-hint { font-size: 14px; color: var(--muted); max-width: 22rem; }
.word-card .button.orb { position: relative; flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 104px; height: 104px; min-height: 0; padding: 0 12px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--orb-hi) 0%, var(--orb-mid) 40%, var(--orb-deep) 80%); color: var(--on-action); box-shadow: var(--shadow-orb);
  font: 700 15px/1.15 var(--font-sans); text-align: center; transition: transform 200ms var(--spring, ease), opacity 200ms ease; }
.word-card .button.orb::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--blue-tint); transition: inset 200ms ease; pointer-events: none; }
.word-card .button.orb.small { width: 80px; height: 80px; font-size: 13px; }
.word-card .button.orb.small::before { inset: -8px; }
.word-card .button.orb.recorder.listening { background: radial-gradient(circle at 32% 28%, var(--orb-hi) 0%, var(--orb-mid) 40%, var(--orb-deep) 80%); color: var(--on-action); box-shadow: var(--shadow-orb); transform: scale(1.08); }
.word-card .button.orb.recorder.listening::before { inset: -22px; box-shadow: inset 0 0 0 2px var(--level-1); }
.word-card .button.orb.recorder.opening { background: radial-gradient(circle at 32% 28%, var(--orb-hi) 0%, var(--orb-mid) 40%, var(--orb-deep) 80%); color: var(--on-action); opacity: .75; }
.word-card .button.orb .mic-bars { height: 18px; }
.word-card .status { margin: var(--space-2) 0; font-size: 14px; font-weight: 400; color: var(--muted); }
.word-card .pronounce-again { margin: var(--space-4) 0 0; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.word-card .pronounce-again > p.muted { margin: 0; font-size: 14px; }
.word-card .skip-row { margin-top: var(--space-3); }
/* Ends of rounds and days: one calm card with up to three numbers. */
.word-card.done-state { text-align: left; }
.word-card.done-state h1 { margin: 0 0 var(--space-3); font-size: 36px; line-height: 1.1; letter-spacing: -.01em; }
.word-card.done-state > .muted { margin: 0 0 var(--space-2); font-size: 16px; }
.bigstat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-2) 0 var(--space-4); }
.bigstat div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 10px; border-radius: var(--radius-control); background: var(--bg); }
.bigstat dd { margin: 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bigstat dt { font-size: 12px; font-weight: 500; color: var(--muted); }
/* The study session bar on Today's list: "24 of 90 · about 9 min left" over one thin bar, then the mic and Stop.
   The background spans the screen, but its row lines up with the 600px card column below it on wide screens. */
.study-session-bar.list-bar { min-height: 56px; padding: 0 max(var(--space-4), calc((100% - 600px) / 2)); gap: var(--space-3); border-bottom: 0; box-shadow: var(--shadow-bar); }
.list-bar .list-progress { flex: 1 1 auto; max-width: none; margin: 0; gap: 6px; }
.list-bar .list-count { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-bar .list-count strong { color: var(--text); font-weight: 600; }
.list-bar .list-track { display: block; height: 4px; border-radius: var(--radius-pill); background: var(--track); overflow: hidden; }
.list-bar .list-track > span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width 300ms ease; }
.list-bar .button.stop { min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-control); background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); font-size: 14px; }
@media (max-width: 520px) {
  .key-hint { display: none !important; } /* no keyboard on a phone */
  .word-card { margin: var(--space-3) 0; padding: var(--space-5) var(--space-4); border-radius: var(--radius-card-phone); }
  .word-card .prompt, .word-card .answer, .word-card.done-state h1 { font-size: 32px; }
  /* The dock: the card's one main action, full width at the foot of the card (not floating at the
     bottom of the screen, where it moved with the keyboard and the card motion). */
  .review-card.word-card .actions.dock { flex-direction: column; align-items: stretch; gap: var(--space-2); margin: var(--space-5) 0 0; padding: 0; border-top: 0; }
  .word-card .actions.dock .button, .word-card .actions.dock form.inline, .word-card .actions.dock form.inline .button { width: 100%; min-height: 56px; border-radius: var(--radius-button); font-size: 17px; }
  .word-card .actions.dock .link-button.quiet { align-self: center; width: auto; min-height: 44px; }
  .word-card .orb-row.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; flex-direction: column; gap: 6px; margin: 0;
    padding: var(--space-4) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--bg) 75%, transparent); text-align: center; }
  .word-card .orb-row.dock .button.orb { width: 96px; height: 96px; padding: 0 10px; font-size: 15px; }
  .review-card.word-card .orb-row .orb-hint { display: block; max-width: 290px; }
  .word-card .orb-row:not(.dock) .button.orb { width: 80px; padding: 0 10px; font-size: 13px; }
  main:has(.word-card .orb-row.dock:not([hidden])) { padding-bottom: calc(13rem + env(safe-area-inset-bottom, 0px)); }
  .bigstat dd { font-size: 20px; }
}
/* A transform on the card or its reveal would pin the phone dock to the card instead of the screen, so the
   arrival motion keeps no transform once it ends, and the card doesn't lift while listening. */
.word-card.card-in, .word-card.stage-in .reveal, .word-card.stage-in .answer[class*=outcome-] { animation-fill-mode: backwards; }
.word-card:has(.mic.listening) { transform: none; }
@media (max-width: 520px) {
  /* Even while it runs, a sliding card would carry the dock with it, so the main button would ride in inside
     the card and then jump to the bottom. On a phone cards and reveals only fade; the button stays put. */
  .review-card.card-in, .review-card.stage-in .reveal { animation-name: fade-in; }
  .review-card.card-out { animation-name: fade-out; }
  /* On the write card Check sits right under the answer field. */
  .review-card.word-card[data-stage=write] .actions.dock { margin-top: var(--space-4); }
}
@keyframes fade-in { from { opacity: 0; } }
/* keyboard_handoff.js: holds the phone keyboard open while the write card loads. Out of sight, but focusable;
   16px so iOS doesn't zoom in on it. */
.keyboard-stand-in { position: fixed; top: 0; left: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; font-size: 16px; pointer-events: none; }
@keyframes fade-out { to { opacity: 0; } }

/* ===== Redesign: home and the study session cards (docs/design-system/mockups/home-mockups.html, home-prototype.html) ===== */
.home { max-width: 560px; margin: 0 auto; padding-top: var(--space-5); gap: var(--space-4); }
.home .panel.focus { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); border-radius: var(--radius-card); box-shadow: var(--shadow-surface); }
.focus .context { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.focus .hero { margin: 0; font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.focus .detail { margin: 0; font-size: 16px; color: var(--muted); }
.focus .bigstat { margin: var(--space-1) 0 0; }
.focus-actions { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-2); }
.focus-actions form { margin: 0; }
.focus-actions .link-button.quiet { align-self: center; }
.focus-actions .key-hint { display: none; }
.button.session-button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; width: 100%; min-height: 60px; padding: 0 var(--space-5); border-radius: var(--radius-button); font-size: 17px; text-align: left; }
.button.session-button .title { font-weight: 600; }
.button.session-button .sub { font-size: 13px; font-weight: 500; opacity: .85; }
.focus-actions form.button_to, .focus-actions form.study-session-form { width: 100%; }
.focus-actions form.inline.study-session-form, .focus-actions form.inline { width: auto; align-self: center; }
/* Tapping the focus card (or its progress line) opens Today's list inside it. */
.home .panel.focus.card-tap { cursor: pointer; transition: box-shadow 200ms ease; }
.home .panel.focus.card-tap:hover { box-shadow: var(--shadow-surface), 0 0 0 1.5px var(--line-strong); }
.focus .list-in { padding-top: 6px; cursor: default; }
/* The thin progress line: "24 of 90 — Goal on track"; a button that opens Today's list. */
.progress-line { display: flex; align-items: center; gap: var(--space-3); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-line .recall-bar { flex: 1 1 auto; height: 6px; }
.progress-line .behind { color: var(--amber); font-weight: 600; }
.progress-button { width: 100%; margin: var(--space-1) 0 0; padding: var(--space-4) 0 0; border: 0; border-top: 1px solid var(--line); background: transparent; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; text-align: left; }
.progress-button:hover .recall-bar span { filter: brightness(1.1); }
.amber-note { margin: 0; font-size: 13px; color: var(--amber); }
.home-note { margin: 0; font-size: 14px; }
.home > turbo-frame { display: flex; flex-direction: column; gap: var(--space-3); }
.home .banner.home-note { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.home .banner.home-note form { margin: 4px 0 0; }
/* The quiet line under the card: This week, Pick it yourself, Study goal. */
.quiet { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: 0 4px; }
.quiet .qlink, .quiet .week-dots { padding: 6px 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.quiet .week-dots { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; }
.week-dots .dots { display: inline-flex; gap: 3px; }
.week-dots .dots i { width: 9px; height: 9px; border-radius: 2px; background: var(--track); }
.week-dots .dots i.level-1 { background: var(--level-1); } .week-dots .dots i.level-2 { background: var(--level-2); }
.week-dots .dots i.level-3 { background: var(--level-3); } .week-dots .dots i.level-4 { background: var(--level-4); }
.week-dots .dots i.today { box-shadow: 0 0 0 1.5px var(--text); }
.week-dots .total { font-variant-numeric: tabular-nums; }
/* Unfold: a card opens in place and pushes the page down (grid rows 0fr to 1fr); its content fades in
   just after. Closed, it takes no room and is inert. Inside the focus card it has no gap of its own. */
.unfold { display: grid; grid-template-rows: 0fr; margin-top: calc(-1 * var(--space-4)); transition: grid-template-rows 300ms cubic-bezier(.2, .85, .25, 1), margin-top 300ms cubic-bezier(.2, .85, .25, 1); }
.unfold > div { min-height: 0; overflow: hidden; padding: 0 2px 4px; }
.unfold[data-open] { grid-template-rows: 1fr; margin-top: 0; }
.unfold > div > * { opacity: 0; transform: translateY(-8px); transition: opacity 200ms ease-out, transform 200ms ease-out; }
.unfold[data-open] > div > * { opacity: 1; transform: none; transition: opacity 240ms ease 60ms, transform 300ms cubic-bezier(.34, 1.45, .64, 1) 60ms; }
.focus .unfold, .goal-sentence .unfold { margin-top: calc(-1 * var(--space-3)); }
.focus .unfold[data-open], .goal-sentence .unfold[data-open] { margin-top: 0; }
.focus .unfold > div, .goal-sentence .unfold > div { padding: 0; }
@media (prefers-reduced-motion: reduce) { .unfold, .unfold > div > * { transition: none; } }
.quiet [aria-expanded=true] { color: var(--blue); font-weight: 600; text-decoration: none; }
/* Cards on home under the quiet line: This week, Edit study goal, and Pick it yourself, always shown. */
.home .panel.in-place, .home .panel.pick-card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) var(--space-5) var(--space-5); border-radius: var(--radius-card); box-shadow: var(--shadow-surface); }
.in-place-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.in-place-head h2, .pick-card h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.in-place-head .link-button.quiet { min-height: 36px; }
.home .pick .pick-head { margin: 0 0 var(--space-2); padding: 0; border: 0; }
.home .pick .tabs { width: 100%; } .home .pick .tabs [role=tab] { flex: 1; min-height: 40px; }
.home .pick .chapters { border: 0; padding: 0; }
.today-rows { display: grid; margin: 0; padding: 0; list-style: none; }
.today-rows li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; }
.today-rows li:first-child { border-top: 0; }
.today-rows .st { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); font-size: 12px; font-weight: 700; }
.today-rows .st.done { box-shadow: none; background: var(--green-tint); color: var(--green); }
.today-rows .st.now { box-shadow: inset 0 0 0 5px var(--blue); }
.today-rows li.done .what { color: var(--muted); }
.today-rows li.off { opacity: .55; }
.today-rows .n { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.today-rows .n strong { color: var(--text); }
.home .note { margin: var(--space-3) 0 0; font-size: 14px; color: var(--muted); }
.home .week-days .day { min-height: 44px; align-items: center; justify-content: flex-end; padding: 4px; }
.home .week-days li { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: 12px; color: var(--muted); text-align: center; }
.home .week-days li.today { color: var(--text); font-weight: 600; }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.sheet-head h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.sheet-sub { margin: 0 0 var(--space-3); font-size: 14px; color: var(--muted); }
/* Sheets (the conversation Stop sheet): a centred card on wider screens, rising from the bottom on phones. */
dialog.sheet { width: min(36rem, calc(100vw - 2rem)); max-height: min(44rem, calc(100vh - 4rem)); padding: var(--space-4) var(--space-5) var(--space-5); border: 0; border-radius: var(--radius-card); background: var(--panel); color: var(--text); box-shadow: 0 -8px 30px rgb(0 0 0 / .18); text-align: left; overflow: auto; }
dialog.sheet::backdrop { background: rgb(20 23 28 / .38); }
dialog.sheet[open] { animation: card-in 240ms var(--ease, ease) both; }
.year-view { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.year-view h3 { margin: 0 0 var(--space-2); font-size: 13px; font-weight: 600; color: var(--muted); }
.year-view .activity { margin: 0; padding: 0; border: 0; }
/* Up next cards in a study session: badge, one hero, one line, the estimate, Start. */
.review-card.word-card.up-next { text-align: left; }
.up-next .context .target { color: var(--muted); }
.up-next .detail { margin: 0 0 var(--space-2); max-width: none; font-size: 16px; color: var(--muted); }
.up-next .minutes { margin: 0; font-size: 14px; }
.study-session-done .muted strong { color: var(--text); }
@media (max-width: 520px) {
  .home { margin: 0; padding-top: var(--space-4); }
  .home .panel.focus { padding: var(--space-5) var(--space-4); border-radius: var(--radius-card-phone); }
  .focus .hero { font-size: 32px; }
  .home .panel.in-place, .home .panel.pick-card { padding: var(--space-4); border-radius: var(--radius-card-phone); }
  .goal-line { font-size: 28px; }
  .quiet .wk-w { display: none; }
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 88vh; margin: auto 0 0; padding: var(--space-2) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom, 0px)); border-radius: 20px 20px 0 0; }
  dialog.sheet[open] { animation: sheet-in 300ms cubic-bezier(.2, .8, .2, 1) both; }
  dialog.sheet::before { content: ""; display: block; width: 36px; height: 4px; margin: 0 auto var(--space-3); border-radius: 2px; background: var(--line-strong); }
}

/* ===== Redesign: grammar (docs/design-system/mockups/grammar-mockups.html) ===== */
/* The word card's frame: badge and chapter on top, one hero, the main action in the dock. The part of
   an example or answer that changes is marked in blue, or in the outcome colour after answering. */
.word-card.grammar mark { background: none; color: var(--blue); font-weight: 700; padding: 0; }
.word-card.grammar .prompt { overflow-wrap: break-word; }
.word-card.grammar .cue { margin: 0 0 var(--space-2); color: var(--blue); font-size: 16px; font-weight: 600; }
.word-card.grammar .grammar-context { margin: 0 0 var(--space-3); color: var(--muted); font-size: 15px; }
.word-card.grammar .grammar-intro { margin: 0 0 var(--space-3); font-size: 16px; line-height: 1.5; }
.grammar-examples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.grammar-examples li { padding: 10px var(--space-3); border-radius: var(--radius-control); background: var(--bg); font-size: 18px; }
.grammar-rule { margin: var(--space-2) 0 0; }
.grammar-rule p { margin: 0 0 var(--space-3); padding-left: var(--space-4); border-left: 3px solid var(--blue-tint); font-size: 16px; line-height: 1.5; }
.grammar-rule p:last-child { margin-bottom: 0; }
.grammar-rule em { color: var(--muted); }
/* Practice: the rule's right answers in a row. */
.grammar-streak { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); color: var(--muted); font-size: 13px; }
.grammar-streak .pips { display: inline-flex; gap: 4px; }
.grammar-streak .pips span { width: 7px; height: 7px; border-radius: 50%; background: var(--track); }
.grammar-streak .pips span.on { background: var(--blue); }
/* Review started on its own: the round of 10 on top of the card, as for words. */
.word-card.grammar .grammar-progress { margin: 0 0 var(--space-4); }
/* Choices: big tiles that turn green or red in place. */
.grammar-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.grammar-choices.long { grid-template-columns: minmax(0, 1fr); }
.grammar-choices .choice { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 0; min-height: 56px; padding: 10px var(--space-4);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-control); background: var(--panel); color: var(--text); font: 600 19px/1.25 var(--font-sans);
  text-align: left; overflow-wrap: anywhere; cursor: pointer; transition: transform 80ms ease, border-color 80ms ease, background 120ms ease; }
.grammar-choices.long .choice { font-size: 17px; }
.grammar-choices button.choice:hover, .grammar-choices button.choice:focus-visible { border-color: var(--blue); outline: none; }
.grammar-choices button.choice:active, .grammar-choices .choice.pressed { transform: scale(.98); }
.grammar-choices .choice kbd { flex: none; min-width: 20px; padding: 1px 5px; font-size: 11px; color: var(--muted); }
.grammar-choices .choice.right { border-color: var(--green); background: var(--green-tint); color: var(--green); }
.grammar-choices .choice.wrong { border-color: var(--red); background: var(--red-tint); color: var(--red); }
.grammar-choices .choice.faded { color: var(--muted); border-color: var(--line); }
.grammar-choices .choice .mark { flex: none; font-size: 15px; }
/* After answering. */
.word-card.grammar .reveal { margin-top: var(--space-3); }
.word-card.grammar .reveal > .feedback { margin: 0 0 var(--space-3); font-size: 16px; font-weight: 600; }
.word-card.grammar .feedback del { text-decoration-thickness: 2px; }
.word-card.grammar .you-wrote { margin: 0 0 var(--space-1); color: var(--muted); }
.word-card.grammar .you-wrote strong { color: var(--text); }
.word-card.grammar .grammar-answer { margin: 0 0 var(--space-2); font-size: 36px; }
.word-card.grammar .grammar-answer mark { text-decoration: underline 3px; text-underline-offset: 6px; }
.word-card.grammar .grammar-answer.outcome-good mark { color: var(--green); }
.word-card.grammar .grammar-answer.outcome-fair mark { color: var(--amber); }
.word-card.grammar .grammar-answer.outcome-bad mark { color: var(--red); }
.word-card.grammar .grammar-reason { margin: 0 0 var(--space-2); font-size: 15px; line-height: 1.5; }
.word-card.grammar .grammar-reason mark { color: var(--blue); }
.word-card.grammar .grammar-trap { margin: 0 0 var(--space-2); color: var(--muted); font-size: 15px; }
.grammar-rule-reminder { margin: var(--space-3) 0 0; padding-top: var(--space-3); border-top: 1px solid var(--line); }
.grammar-rule-reminder summary { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; list-style: none; }
.grammar-rule-reminder summary::-webkit-details-marker { display: none; }
.grammar-rule-reminder .grammar-rule { margin-top: var(--space-3); }
/* Write: the cue is the field's label. */
.grammar-write { margin-top: var(--space-2); }
.grammar-write .cue { display: block; }
/* Ends. */
.grammar-misses { list-style: none; margin: 0; padding: 0; }
.grammar-misses li { padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
.grammar-misses del { color: var(--red); text-decoration-thickness: 2px; }
.grammar-misses span { margin: 0 var(--space-2); color: var(--muted); }
.button.two-line { flex-direction: column; gap: 0; line-height: 1.2; }
.button.two-line .sub { font-size: 12px; font-weight: 500; opacity: .85; }
/* Grammar and Conversations pages: one list per chapter. */
.list-page { max-width: 600px; margin: 0 auto; padding-top: var(--space-5); }
.list-page h1 { margin: 0 0 var(--space-1); font-size: 28px; }
.list-page .page-sub { margin: 0 0 var(--space-4); color: var(--muted); }
.list-card { padding: var(--space-2) var(--space-5) var(--space-4); border: 0; border-radius: var(--radius-card); box-shadow: var(--shadow-surface); }
.list-group h2 { margin: var(--space-4) 0 var(--space-1); color: var(--muted); font-size: 15px; font-weight: 600; }
.list-group > .muted { margin: 0 0 var(--space-2); font-size: 14px; }
.list-group ul { list-style: none; margin: 0; padding: 0; }
.list-group li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.list-group li:last-child { border-bottom: 0; }
.list-group .rule-name { display: flex; flex-direction: column; min-width: 0; }
.list-group .rule-name strong { font-weight: 600; }
.list-group .rule-name > span { font-size: 13px; }
.list-group .chapter-due { color: var(--blue); font-weight: 600; }
.list-group form { margin: 0; }
.list-group .chip-button:disabled { opacity: .45; cursor: default; }
@media (max-width: 520px) {
  .grammar-choices .choice kbd { display: none; }
  .word-card.grammar .grammar-answer { font-size: 32px; }
  .list-card { padding: var(--space-1) var(--space-4) var(--space-3); }
}

/* ===== Redesign: conversations (docs/design-system/mockups/conversation-mockups.html) ===== */
.conversation-card .topic { margin: 0 0 var(--space-4); color: var(--muted); font-size: 17px; line-height: 1.45; }
.objectives-head { display: flex; justify-content: space-between; margin: 0 0 var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.objective-groups { display: flex; flex-direction: column; gap: var(--space-3); }
.objective-group h3 { margin: 0 0 var(--space-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.conversation-card .objectives { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.conversation-card .objectives li { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; line-height: 1.4; }
.conversation-card .objectives .tick { flex: none; display: grid; place-items: center; width: 16px; height: 16px; margin-top: 3px; border: 1.5px solid var(--line-strong); border-radius: 50%; box-sizing: border-box; }
.conversation-card .objectives li.covered .tick { border-color: var(--green); background: var(--green); }
.conversation-card .objectives li.covered .tick::after { content: ""; width: 4px; height: 7px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.conversation-card .objectives li { transition: color var(--motion) var(--ease); }
.conversation-card .objectives li.covered { color: var(--green); }
.conversation-card .objectives .tick { transition: background-color var(--motion) var(--ease), border-color var(--motion) var(--ease); }
.conversation-card .hint { margin: var(--space-4) 0 0; font-size: 14px; }
.conversation-card .actions.dock .back { margin-right: auto; }
/* Talking: the partner as a quiet disc with their name and what they're doing. */
.talk .context .stop { margin-left: auto; padding: 4px 0; border: 0; background: none; color: var(--muted); font: 500 14px var(--font-sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.partner-row { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-2) 0 var(--space-4); }
.partner-row .disc { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--blue-tint); color: var(--muted); font-weight: 600; }
.partner-row.speaking .disc::after { content: ""; position: absolute; inset: -5px; border: 2px solid color-mix(in srgb, var(--blue) 45%, transparent); border-radius: 50%; animation: disc-pulse 1.4s ease-in-out infinite; }
.partner-row.thinking .disc { animation: disc-think 1.2s ease-in-out infinite; }
@keyframes disc-pulse { 50% { transform: scale(1.06); opacity: .6; } }
@keyframes disc-think { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .partner-row .disc, .partner-row .disc::after { animation: none !important; } }
.partner-row p { margin: 0; }
.partner-row .partner { color: var(--muted); font-size: 20px; font-weight: 600; }
.partner-row .state { color: var(--blue); font-size: 15px; font-weight: 600; }
.talk .banner { margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-control); background: var(--amber-tint); color: var(--text); }
.talk .help-line { margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-control); background: var(--blue-tint); font-size: 17px; }
.talk-links { display: flex; justify-content: space-between; margin: 0 0 var(--space-3); padding: 0 var(--space-2); }
.talk-links .text-button, .talk .text-button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: none; color: var(--muted); font: 500 16px var(--font-sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.talk-tasks .objectives-head { margin-bottom: var(--space-2); }
.talk .log { margin: var(--space-3) 0 0; }
.talk .log summary { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; list-style: none; }
.talk .log summary::-webkit-details-marker { display: none; }
.talk .log:not([open]) .when-open, .talk .log[open] .when-closed { display: none; }
.talk .chat { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.talk .chat li { display: flex; max-width: 82%; }
.talk .chat li.avatar { align-self: flex-start; }
.talk .chat li.learner { align-self: flex-end; }
.talk .chat .bubble { padding: 10px 14px; border: 0; border-radius: 14px; font: 16px/1.35 var(--font-sans); text-align: left; }
.talk .chat li.avatar .bubble { background: var(--bg); color: var(--text); cursor: pointer; }
.talk .chat li.learner .bubble { background: var(--blue-tint); color: var(--text); }
.talk .orb-row { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-4) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.talk .orb-row .orb-hint { margin: 0; font-size: 14px; }
.talk .orb-row .button.orb kbd { display: none; }
/* Stop now? */
dialog.stop-sheet h2 { margin: 0; font-size: 22px; }
dialog.stop-sheet p { margin: 0 0 var(--space-3); }
dialog.stop-sheet .stop-actions { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); margin-top: var(--space-4); }
dialog.stop-sheet .stop-actions .button { min-height: 52px; }
dialog.stop-sheet .stop-actions form { display: flex; justify-content: center; margin: 0; }
/* Feedback. */
.grade-label { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; }
.grade-label.grade-good { background: var(--green-tint); color: var(--green); }
.grade-label.grade-hard { background: var(--amber-tint); color: var(--amber); }
.grade-label.grade-again { background: var(--red-tint); color: var(--red); }
.feedback-card h2 { margin: var(--space-4) 0 0; padding-bottom: var(--space-2); border-bottom: 1px solid var(--line); font-size: 16px; }
.feedback-card .corrections { list-style: none; margin: 0; padding: 0; }
.feedback-card .corrections li { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.feedback-card .corrections li:last-child { border-bottom: 0; }
.feedback-card .corrections p { margin: 0; }
.feedback-card .corrected { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); font-size: 18px; font-weight: 600; }
.feedback-card .corrected mark { background: none; color: var(--green); text-decoration: underline 2px; text-underline-offset: 4px; }
.feedback-card .corrections .muted { margin-top: 4px; font-size: 14px; }
.feedback-card .words-to-pronounce li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.feedback-card .words-to-pronounce li > div { display: flex; flex-direction: column; }
.feedback-card .words-to-pronounce strong { font-size: 18px; }
.feedback-card .chip-button.speaker { background: var(--blue-tint); width: 36px; min-height: 32px; padding: 0; justify-content: center; margin: 0; border-radius: var(--radius-pill); }
.feedback-card .chip-button.speaker svg { width: 16px; height: 16px; }
.feedback-card .kept-note { margin: var(--space-3) 0 0; font-size: 14px; }
.feedback-card .objective-groups { margin-top: var(--space-2); }
/* The Conversations page. */
.conversations-page .setup-note { display: flex; flex-direction: column; gap: 4px; margin: 0 0 var(--space-4); }
.unfinished-talk { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-card); background: var(--blue-tint); }
.unfinished-talk .rule-name { display: flex; flex-direction: column; }
.unfinished-talk .rule-name > span { font-size: 13px; }
.chip-button.on-tint { background: var(--panel); text-decoration: none; }
@media (max-width: 520px) {
  .talk .orb-row.dock { flex-direction: column; border-top: 0; }
  .talk .orb-row.dock .orb-hint { text-align: center; }
  main:has(.talk .orb-row.dock) { padding-bottom: calc(12rem + env(safe-area-inset-bottom, 0px)); }
}

/* ===== Redesign: forms, Import, Settings, Sign in (rest-of-app mockups R7, I1-I3, S1-S2, L1-L2) ===== */
.form-card h1 { margin: 0 0 var(--space-2); font-size: 28px; line-height: 1.2; }
.form-card > .context { margin: 0 0 var(--space-3); font-size: 13px; font-weight: 500; line-height: 1.4; }
.form-card > p.muted { margin: 0 0 var(--space-4); }
.form-fields { display: flex; flex-direction: column; gap: var(--space-3); }
.form-fields > label { gap: var(--space-2); font-size: 14px; font-weight: 600; color: var(--text); }
.form-fields > label input:not([type=file]), .form-fields > label textarea { min-height: 48px; font-size: 17px; font-weight: 400; }
.form-fields > .field-hint { margin: calc(-1 * var(--space-2)) 0 0; font-size: 13px; color: var(--muted); }
.form-fields > .banner { margin: 0; }
.form-card .banner { color: var(--text); }
.form-card .banner b { color: var(--amber); }
.form-card .actions.dock .key-hint kbd { margin-left: 2px; }
.form-card .actions.dock .button .key-hint kbd { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 45%, transparent); }
.import-card textarea { min-height: 160px; font-size: 15px; line-height: 1.5; }
.file-pick { flex-direction: row !important; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 12px 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-control); font-size: 14px; font-weight: 400 !important; color: var(--muted) !important; }
.file-pick input[type=file] { width: auto; max-width: 100%; padding: 0; border: 0; background: transparent; font-size: 14px; }
.file-pick input[type=file]::file-selector-button { margin-right: var(--space-2); padding: 6px 12px; border: 0; border-radius: var(--radius-pill); background: var(--blue-tint); color: var(--blue); font: 600 13px/1.2 var(--font-sans); cursor: pointer; }
.import-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.import-rows { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.import-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-2); padding: 9px 0; border-top: 1px solid var(--line); }
.import-rows .import-sv { font-weight: 600; font-size: 15px; }
.import-rows small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.import-status { font-weight: 600; }
.import-rows .ok .import-status { color: var(--green); }
.import-rows .restore .import-status { color: var(--blue); }
.import-rows .duplicate .import-status { color: var(--muted); }
.import-rows .error .import-status { color: var(--red); }
.import-rows .duplicate .import-sv { color: var(--muted); }
.settings-page h1 { margin-bottom: var(--space-3); }
.settings-page .form-card { margin-top: 0; }
.signin-page { max-width: 600px; margin: 0 auto; }
.signin-brand { display: flex; justify-content: center; margin: 44px 0 var(--space-4); }
.signin-brand .brand { font-size: 24px; }
.signin-card { margin-top: 0; }
@media (max-width: 520px) {
  .form-card .actions.dock .link-button.quiet { order: 2; }
  .form-card .key-hint { display: none; }
  .form-card h1 { font-size: 26px; }
  .signin-brand { margin-top: 28px; }
}


/* Reports (ConversationReport): Report while talking, the transcript after, and the report form.
   Label chips are the design system's new LabelChip: outlined, filled blue with a tick when picked. */
.talk-links .text-button.reported { color: var(--blue); }
.report-toast { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin: 0 0 var(--space-3); padding: 10px 14px; border-radius: var(--radius-control); background: var(--blue-tint); font-size: 14px; }
.report-toast .text-button { color: var(--blue); font-size: 14px; }
dialog.stop-sheet .stop-actions form .button.secondary { width: 100%; }
.feedback-card .report-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: var(--space-2) 0 0; }
.feedback-card .report-links .link-button { color: var(--muted); }

.transcript-card .chat { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.transcript-card .chat li { display: flex; flex-direction: column; gap: 3px; max-width: 82%; }
.transcript-card .chat li.avatar { align-self: flex-start; align-items: flex-start; }
.transcript-card .chat li.learner { align-self: flex-end; align-items: flex-end; }
.transcript-card .chat li.help { align-self: center; font-size: 13px; }
.transcript-card .bubble { padding: 10px 14px; border-radius: 14px; font: 16px/1.35 var(--font-sans); }
.transcript-card li.avatar .bubble { background: var(--bg); border-bottom-left-radius: 4px; }
.transcript-card li.avatar.reported .bubble { background: var(--blue-tint); box-shadow: inset 0 0 0 1.5px var(--blue); }
.transcript-card li.learner .bubble { background: var(--blue-tint); border-bottom-right-radius: 4px; }
.transcript-card .judged { font-size: 13px; color: var(--muted); text-align: right; }
.transcript-card .report-link, .transcript-card .report-note { font-size: 13px; font-weight: 600; color: var(--blue); text-underline-offset: 3px; }
.transcript-card .report-note { text-decoration: none; }
.transcript-card .report-note .muted { font-weight: 400; }

.report-card .quote { margin: var(--space-2) 0 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-control); background: var(--bg); }
.report-card .quote p { margin: 0; }
.report-card .quote p + p { margin-top: 4px; font-size: 13px; }
.report-card h2 { margin: var(--space-4) 0 var(--space-2); font-size: 14px; font-weight: 600; color: var(--muted); }
.report-form { display: flex; flex-direction: column; }
.label-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.label-chip { position: relative; display: inline-flex; }
.label-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.label-chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong); font: 500 14px/1.2 var(--font-sans); cursor: pointer; }
.label-chip input:checked + span { background: var(--blue); color: var(--on-action); box-shadow: none; font-weight: 600; }
.label-chip input:checked + span::before { content: "✓"; font-size: 12px; }
.label-chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.report-field { display: flex; flex-direction: column; gap: 6px; margin: var(--space-3) 0 0; padding: 0; border: 0; min-width: 0; }
.report-field > label, .report-field legend { font-size: 14px; font-weight: 600; color: var(--muted); padding: 0; }
.report-field textarea, .report-field input[type=text] { width: 100%; padding: 10px 12px; border: 0; border-radius: var(--radius-control); background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line-strong); font: 16px/1.4 var(--font-sans); resize: vertical; }
.option-rows { display: grid; gap: 6px; margin-top: 6px; }
.option-row { position: relative; display: flex; }
.option-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option-row span { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px; border-radius: var(--radius-control); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 15px; line-height: 1.3; cursor: pointer; }
.option-row input:checked + span { background: var(--blue); color: var(--on-action); box-shadow: none; font-weight: 600; }
.option-row input:checked + span::before { content: "✓"; font-size: 12px; }
.option-row input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.report-card .actions, .transcript-card .actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); }

/* Reported lines (ReportsController) */
.reports-page h2 { margin: var(--space-5) 0 var(--space-1); font-size: 20px; }
.report-rows { list-style: none; margin: 0; padding: 0; }
.report-rows li + li { border-top: 1px solid var(--line); }
.report-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--space-3); align-items: center; padding: var(--space-3) 0; color: var(--text); text-decoration: none; }
.report-row strong { font-size: 15px; overflow-wrap: anywhere; }
.report-row small { grid-column: 1; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.report-status { grid-row: 1 / span 2; grid-column: 2; font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; }
.report-status.status-new, .report-status.status-open { color: var(--blue); }
.report-status.status-fixed, .report-status.status-live, .report-status.status-changed { color: var(--green); }
.report-detail h1 { margin: var(--space-3) 0 var(--space-2); font-size: 20px; }
.report-detail .quote { font-size: 17px; }
.report-steps { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.report-steps li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 2px var(--space-3); color: var(--muted); }
.report-steps li::before { content: ""; grid-row: 1 / span 2; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.report-steps li.done { color: var(--text); }
.report-steps li.done::before { content: "✓"; display: grid; place-items: center; font-size: 12px; background: var(--green-tint); color: var(--green); box-shadow: none; }
.report-steps li.next { color: var(--text); }
.report-steps li.next::before { box-shadow: inset 0 0 0 5px var(--blue); }
.report-steps span { font-size: 14px; color: var(--muted); }
