/* ==========================================================================
   TermOwl design system. Rules live in docs/design-system.md.
   The look follows macOS: a translucent sidebar, a toolbar, push buttons, segmented
   controls and grouped lists, in our own colours. Use only these tokens in components:
   no new hex colours below this block. Themes change only these values.
   ========================================================================== */

:root {
  /* Neutrals: the window, its panels, and the lines between them */
  --bg: #f5f4ff;
  --surface: #ffffff;
  --surface-2: #f4f3fd;
  --border: #e4e2f3;
  --border-strong: #c9c5e3;
  --text: #17152b;
  --text-muted: #575473;
  --sidebar: rgb(240 238 255 / .72);
  --toolbar: rgb(247 246 255 / .78);
  --separator: rgb(60 60 67 / .14);
  --control: #ffffff;
  --control-track: rgb(118 118 128 / .12);

  /* Brand: one primary colour (the accent, as on a Mac) */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eceaff;
  --on-primary: #ffffff;
  /* Filled controls (selected sidebar row, primary buttons): white text on the accent. */
  --accent-fill: #4f46e5;
  --on-accent: #ffffff;
  /* The brand's second colour: filled buttons and the selected row run from the accent
     to this, and the page glows softly in both. */
  --accent-2: #a21caf;
  --accent-3: #22d3ee;
  --glow: rgb(99 102 241 / .35);
  --aurora-1: rgb(99 102 241 / .16);
  --aurora-2: rgb(217 70 239 / .12);
  --aurora-3: rgb(34 211 238 / .12);

  /* Urgency: always paired with an icon and words */
  --ok: #047857;      --ok-soft: #e3f9ef;   --ok-line: #9fe8c8;
  --soon: #b04a00;    --soon-soft: #fff2dc; --soon-line: #fdcf8a;
  --risk: #c81e3a;    --risk-soft: #ffebef; --risk-line: #fbb6c3;

  /* Type scale (San Francisco on a Mac, Segoe on Windows) */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.8125rem;  /* 13px, the Mac's body size */
  --text-md: 0.9375rem;  /* 15px */
  --text-lg: 1.1875rem;  /* 19px */
  --text-xl: 1.625rem;   /* 26px */

  /* Spacing (4px grid) and shape */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --radius-sm: 7px;
  --radius: 11px;
  --radius-lg: 14px;
  --control-h: 32px;
  --shadow: 0 0 0 .5px rgb(0 0 0 / .06), 0 1px 2px rgb(0 0 0 / .06), 0 4px 14px rgb(0 0 0 / .05);
  --shadow-pop: 0 0 0 .5px rgb(0 0 0 / .1), 0 10px 30px rgb(0 0 0 / .14), 0 2px 6px rgb(0 0 0 / .08);
  --shadow-control: 0 0 0 .5px rgb(0 0 0 / .12), 0 1px 1.5px rgb(0 0 0 / .1);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0a1c;
    --surface: #17142d;
    --surface-2: #1f1b3a;
    --border: #2d2852;
    --border-strong: #463f78;
    --text: #f4f2ff;
    --text-muted: #b5b0d6;
    --sidebar: rgb(22 19 45 / .72);
    --toolbar: rgb(16 14 34 / .78);
    --separator: rgb(255 255 255 / .1);
    --control: #2b2650;
    --control-track: rgb(118 118 128 / .24);

    --primary: #a5a8ff;
    --primary-hover: #c4c6ff;
    --primary-soft: #28245a;
    --on-primary: #0c0a1c;
    --accent-fill: #6352f0;
    --on-accent: #ffffff;
    --accent-2: #b62bd0;
    --glow: rgb(124 112 255 / .45);
    --aurora-1: rgb(99 102 241 / .22);
    --aurora-2: rgb(217 70 239 / .16);
    --aurora-3: rgb(34 211 238 / .10);

    --ok: #4ee3a6;   --ok-soft: #0f2b22;   --ok-line: #1d5a44;
    --soon: #ffc35a; --soon-soft: #2e2210; --soon-line: #6a4b12;
    --risk: #ff8aa0; --risk-soft: #33121d; --risk-line: #6e2236;

    --shadow: 0 0 0 .5px rgb(255 255 255 / .06), 0 4px 14px rgb(0 0 0 / .3);
    --shadow-pop: 0 0 0 .5px rgb(255 255 255 / .1), 0 12px 32px rgb(0 0 0 / .5);
    --shadow-control: 0 0 0 .5px rgb(255 255 255 / .1), 0 1px 1.5px rgb(0 0 0 / .4);
    --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
    color-scheme: dark;
  }
}
/* Chosen in Themes: dark even when the computer is set to light. */
:root[data-theme="dark"] {
  --bg: #0c0a1c;
  --surface: #17142d;
  --surface-2: #1f1b3a;
  --border: #2d2852;
  --border-strong: #463f78;
  --text: #f4f2ff;
  --text-muted: #b5b0d6;
  --sidebar: rgb(22 19 45 / .72);
  --toolbar: rgb(16 14 34 / .78);
  --separator: rgb(255 255 255 / .1);
  --control: #2b2650;
  --control-track: rgb(118 118 128 / .24);

  --primary: #a5a8ff;
  --primary-hover: #c4c6ff;
  --primary-soft: #28245a;
  --on-primary: #0c0a1c;
  --accent-fill: #6352f0;
  --on-accent: #ffffff;
    --accent-2: #b62bd0;
    --glow: rgb(124 112 255 / .45);
    --aurora-1: rgb(99 102 241 / .22);
    --aurora-2: rgb(217 70 239 / .16);
    --aurora-3: rgb(34 211 238 / .10);

  --ok: #4ee3a6;   --ok-soft: #0f2b22;   --ok-line: #1d5a44;
  --soon: #ffc35a; --soon-soft: #2e2210; --soon-line: #6a4b12;
  --risk: #ff8aa0; --risk-soft: #33121d; --risk-line: #6e2236;

  --shadow: 0 0 0 .5px rgb(255 255 255 / .06), 0 4px 14px rgb(0 0 0 / .3);
  --shadow-pop: 0 0 0 .5px rgb(255 255 255 / .1), 0 12px 32px rgb(0 0 0 / .5);
  --shadow-control: 0 0 0 .5px rgb(255 255 255 / .1), 0 1px 1.5px rgb(0 0 0 / .4);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
  color-scheme: dark;
}


/* ---------- Accent colours (Themes) ----------
   Blue is the default above. Every other theme, built-in or the student's own three colours,
   comes from /theme.css (app/services/palette.py), which recolours these same tokens. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60vw 50vh at 8% -10%, var(--aurora-1), transparent 70%),
    radial-gradient(50vw 45vh at 100% 0%, var(--aurora-2), transparent 70%),
    radial-gradient(60vw 50vh at 70% 110%, var(--aurora-3), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: var(--text-md)/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-underline-offset: 2px; text-decoration-thickness: from-font; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.015em; font-family: var(--font-display); }
p { margin: 0; }
code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.icon { flex: none; }
::selection { background: var(--primary-soft); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--s4); top: var(--s4); z-index: 30; background: var(--surface); padding: var(--s2) var(--s3); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- The window: sidebar, toolbar, content ---------- */
.window { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s1);
  padding: var(--s4) var(--s3);
  background: var(--sidebar);
  -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
  border-right: 1px solid var(--separator);
}
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: var(--text-md); color: var(--text); text-decoration: none; padding: var(--s1) var(--s2) var(--s3); }
.brand:hover { color: var(--text); }
.source-list { display: grid; gap: 2px; }
.nav-heading { margin: var(--s3) var(--s2) 2px; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--text-muted); }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  min-height: 30px; padding: 0 var(--s2); border-radius: var(--radius-sm);
  color: var(--text); font-size: var(--text-sm); font-weight: 500; text-decoration: none;
}
.nav-item .icon { color: var(--primary); }
.nav-item:hover { background: var(--control-track); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.nav-item[aria-current="page"] .icon { color: var(--on-primary); }
.sidebar-foot { margin-top: auto; display: grid; gap: var(--s2); padding-top: var(--s3); }
.sidebar-note { padding: 0 var(--s2); font-size: 11px; color: var(--text-muted); line-height: 1.4; }

.content { min-width: 0; display: flex; flex-direction: column; }
.toolbar {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; gap: var(--s2);
  min-height: 52px; padding: 0 var(--s4);
  background: var(--toolbar);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--separator);
}
.toolbar-spacer { flex: 1; }
.brand-compact { display: none; padding: 0; }
.tool-btn {
  display: inline-grid; place-items: center; width: 34px; height: 30px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none;
}
.tool-btn:hover { background: var(--control-track); color: var(--text); }
.btn-toolbar { min-height: 30px; padding: 0 var(--s3); }
form.inline { display: inline-flex; margin: 0; }
.page { width: 100%; max-width: 780px; margin: 0 auto; flex: 1; padding: var(--s5) var(--s5) var(--s7); }
.tabbar { display: none; }
/* The sidebar is the way around, so per-page "back" links are only needed on phones. */
.back { display: none; }

/* ---------- Buttons (Mac push buttons) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--control-h); padding: 0 var(--s4);
  border: 0; border-radius: var(--radius-sm);
  font: 500 var(--text-sm)/1 var(--font);
  text-decoration: none; cursor: default; white-space: nowrap; user-select: none;
  transition: background-color .12s ease, box-shadow .12s ease, transform .08s ease, filter .12s ease;
}
.btn:active { transform: scale(.98); filter: brightness(.96); }
.btn-primary {
  background: linear-gradient(to bottom, color-mix(in srgb, var(--primary) 88%, white), var(--primary));
  color: var(--on-primary);
  box-shadow: 0 0 0 .5px color-mix(in srgb, var(--primary) 70%, black), 0 1px 2px rgb(0 0 0 / .18), inset 0 .5px 0 rgb(255 255 255 / .25);
}
.btn-primary:hover { color: var(--on-primary); filter: brightness(1.05); }
.btn-secondary { background: var(--control); color: var(--text); box-shadow: var(--shadow-control); }
.btn-secondary:hover { color: var(--text); background: color-mix(in srgb, var(--control) 92%, var(--text)); }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 0 var(--s3); }
.btn-ghost:hover { background: var(--control-track); color: var(--text); }
.btn-lg { min-height: 40px; padding: 0 var(--s5); font-size: var(--text-md); border-radius: 9px; }
.btn-block { width: 100%; }
/* Fingers need bigger targets than a mouse pointer. */
@media (pointer: coarse) { :root { --control-h: 44px; } .nav-item { min-height: 40px; } }

/* ---------- Tags (urgency and flags: icon + words, never colour alone) ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: var(--text-xs); font-weight: 600; color: var(--text-muted); white-space: nowrap;
}
.tag-risk { color: var(--risk); background: var(--risk-soft); border-color: var(--risk-line); }
.tag-soon { color: var(--soon); background: var(--soon-soft); border-color: var(--soon-line); }
.tag-warn { color: var(--soon); background: var(--soon-soft); border-color: var(--soon-line); }
.tag-ok   { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }

/* ---------- Home: next due ---------- */
.eyebrow { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: var(--s5);
  border-left: 4px solid var(--primary);
}
.hero.is-soon { border-left-color: var(--soon); }
.hero.is-risk { border-left-color: var(--risk); }
.hero-title { font-size: var(--text-xl); font-weight: 700; margin-top: var(--s1); }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s2); color: var(--text-muted); }
.hero-footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s4); }
.hero-action { margin-left: auto; }
.course { font-weight: 600; color: var(--text); }
.dot { color: var(--border-strong); }
.summary { margin: var(--s5) 0 0; font-size: var(--text-sm); color: var(--text-muted); }

/* ---------- Home: grouped list ---------- */
.group { margin-top: var(--s5); }
.group-title {
  display: flex; align-items: center; gap: var(--s2);
  font-size: var(--text-sm); font-weight: 700; color: var(--text-muted);
  margin-bottom: var(--s2);
}
.count {
  font-size: var(--text-xs); font-weight: 600; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px;
}
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.row { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); }
.row + .row { border-top: 1px solid var(--border); }
.row-body { min-width: 0; flex: 1; }
.row-title { display: block; font-weight: 600; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.row-title:hover { color: var(--primary); text-decoration: underline; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s2); margin-top: 2px; font-size: var(--text-sm); color: var(--text-muted); }

.datechip {
  flex: none; width: 44px; padding: 4px 0; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.datechip-dow { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.datechip-day { display: block; font-size: var(--text-lg); font-weight: 700; line-height: 1.1; }
.is-risk .datechip { border-color: var(--risk-line); background: var(--risk-soft); }
.is-risk .datechip-dow, .is-risk .datechip-day { color: var(--risk); }

details.past > summary { list-style: none; cursor: pointer; min-height: 44px; margin-bottom: 0; border-radius: var(--radius-sm); }
details.past > summary::-webkit-details-marker { display: none; }
details.past > summary .icon { transition: transform .15s ease; }
details.past[open] > summary .icon { transform: rotate(90deg); }
details.past[open] > summary { margin-bottom: var(--s2); }

/* ---------- Empty states ---------- */
.empty {
  text-align: center; padding: var(--s7) var(--s5);
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
}
.empty h2 { font-size: var(--text-lg); }
.empty p { color: var(--text-muted); max-width: 44ch; margin: var(--s2) auto var(--s5); }

/* ---------- Generic page pieces ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-title { font-size: var(--text-xl); font-weight: 700; }
.back { display: inline-flex; align-items: center; gap: var(--s1); font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); text-decoration: none; margin-bottom: var(--s3); min-height: 32px; }
.back:hover { color: var(--text); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--s5); }
.card + .card { margin-top: var(--s4); }
.card-title { font-size: var(--text-md); font-weight: 700; }
.muted { color: var(--text-muted); }
.small { font-size: var(--text-sm); }

.alert {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4); border-radius: var(--radius); border: 1px solid;
  font-size: var(--text-sm); margin-bottom: var(--s4);
}
.alert-risk { color: var(--risk); background: var(--risk-soft); border-color: var(--risk-line); }
.alert-ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.alert-soon { color: var(--soon); background: var(--soon-soft); border-color: var(--soon-line); }
.alert strong { display: block; }
.alert p { color: var(--text); margin-top: 2px; }

/* ---------- Setup steps ---------- */
.step { display: flex; gap: var(--s4); }
.step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--text-sm); font-weight: 700;
  background: var(--primary-soft); color: var(--primary);
}
.step-body { flex: 1; min-width: 0; }
.step-body > p { margin-top: var(--s1); color: var(--text-muted); font-size: var(--text-sm); }
.status-line { display: inline-flex; align-items: center; gap: var(--s2); margin-top: var(--s3); font-weight: 600; font-size: var(--text-sm); }
.status-ok { color: var(--ok); }
.status-warn { color: var(--soon); }

/* ---------- Sync preview ---------- */
.change-group { margin-top: var(--s5); }
.change-group-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.change-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.change { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); cursor: pointer; }
.change-list > li + li { border-top: 1px solid var(--border); }
.change input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--primary); cursor: pointer; }
.change-body { min-width: 0; flex: 1; }
.change-title { font-weight: 600; overflow-wrap: anywhere; }
.change-detail { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); }
.old { text-decoration: line-through; }
.new { color: var(--text); font-weight: 600; }
.actionbar {
  position: sticky; bottom: 0; z-index: 4;
  display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end;
  margin-top: var(--s5); padding: var(--s3) 0;
  background: linear-gradient(to bottom, transparent, var(--bg) 30%);
}
.actionbar .spacer { flex: 1; }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--s4); }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--text-sm); font-weight: 600; }
.field .hint { font-size: var(--text-xs); color: var(--text-muted); font-weight: 400; }
.input {
  width: 100%; min-height: 44px; padding: 10px var(--s3);
  font: var(--text-md)/1.4 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.input:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
textarea.input { min-height: 96px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.form-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s2); }

/* ---------- Guide ---------- */
.prose { font-size: var(--text-md); }
.prose ol { padding-left: 1.3em; margin: 0 0 var(--s4); display: grid; gap: var(--s2); }
.prose p + p { margin-top: var(--s3); }

/* ---------- Tabs (filters) ---------- */
.tabs {
  display: inline-flex; gap: var(--s1); padding: var(--s1); margin-bottom: var(--s4);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.tab {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 36px; padding: 0 var(--s3); border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); text-decoration: none;
}
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--border); }

/* ---------- Estimates ---------- */
.est { display: inline-flex; align-items: center; gap: 4px; }
.est-rough { color: var(--soon); font-weight: 600; }
.reason { margin-top: var(--s2); font-size: var(--text-sm); color: var(--text-muted); }
.hero-title a { color: inherit; text-decoration: none; }
.hero-title a:hover { text-decoration: underline; }
.estimate-big { font-size: var(--text-xl); font-weight: 700; margin-top: var(--s3); line-height: 1.1; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.quick-label { width: 100%; font-size: var(--text-sm); font-weight: 600; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 44px; min-width: 52px; padding: 0 var(--s3);
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  font: 600 var(--text-sm)/1 var(--font); color: var(--text); cursor: pointer; text-decoration: none;
}
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.is-selected, .chip-confirm { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.chip-link { color: var(--text-muted); }
.other-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s3); }
.other-form label { font-size: var(--text-sm); font-weight: 600; }
.input-sm { width: 160px; }
.row-review { align-items: flex-start; }

/* ---------- Detail ---------- */
.detail-head { align-items: flex-start; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.facts { display: grid; gap: var(--s2); margin: var(--s3) 0 0; }
.facts-first { margin-top: 0; }
.facts > div { display: grid; grid-template-columns: 110px 1fr; gap: var(--s3); align-items: baseline; }
.facts dt { font-size: var(--text-sm); color: var(--text-muted); }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.history { list-style: none; margin: var(--s3) 0 0; padding: var(--s3) 0 0; border-top: 1px solid var(--border); display: grid; gap: var(--s2); font-size: var(--text-sm); }
.history-label { font-weight: 600; margin-right: var(--s2); }
.description { margin-top: var(--s3); white-space: pre-line; color: var(--text); overflow-wrap: anywhere; }

/* ---------- Plan ---------- */
.tag-start { color: var(--primary); background: var(--primary-soft); border-color: var(--primary); }
.why { margin-top: var(--s2); font-size: var(--text-sm); }
.why > summary {
  display: inline-flex; min-height: 32px; align-items: center; cursor: pointer;
  font-weight: 600; color: var(--primary); list-style: none;
}
.why > summary::-webkit-details-marker { display: none; }
.why > summary::after { content: "›"; margin-left: 4px; transition: transform .15s ease; }
.why[open] > summary::after { transform: rotate(90deg); }
.why > p { color: var(--text); margin-top: var(--s1); max-width: 62ch; }
.overload { margin-bottom: var(--s4); }
.overload a { font-weight: 600; color: inherit; }
.plan-card { border-left: 4px solid var(--primary); }
.plan-card.is-risk { border-left-color: var(--risk); }
.explanation { margin-top: var(--s3); max-width: 62ch; }
.planned { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: 4px; font-size: var(--text-sm); }
.planned li { display: grid; grid-template-columns: 110px 1fr auto; gap: var(--s3); padding: 6px 0; border-top: 1px solid var(--border); }
.planned-day { font-weight: 600; }
.importance fieldset { border: 0; padding: 0; margin: var(--s4) 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.importance legend { font-size: var(--text-sm); font-weight: 600; padding: 0; margin-bottom: var(--s2); float: left; width: 100%; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4);
  border: 1px solid var(--border-strong); border-radius: 999px; font-size: var(--text-sm); font-weight: 600; cursor: pointer;
}
.seg input:checked + span { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.change-due { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--border); }
.change-due > summary { cursor: pointer; font-size: var(--text-sm); font-weight: 600; color: var(--primary); min-height: 32px; display: inline-flex; align-items: center; }
.change-due > p { margin-top: var(--s1); }
.input-md { width: 240px; }
.options { margin: var(--s3) 0 0; padding: 0; list-style: none; display: grid; gap: var(--s2); counter-reset: opt; }
.option { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--border); }
.option:first-child { border-top: 0; }

/* ---------- Study times ---------- */
.week { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.week-day { display: grid; grid-template-columns: 110px 1fr; gap: var(--s3); align-items: center; padding: var(--s2) 0; border-top: 1px solid var(--border); }
.week-day:first-child { border-top: 0; }
.week-name { font-weight: 600; font-size: var(--text-sm); }
.week-blocks { display: flex; flex-wrap: wrap; gap: var(--s2); }
.slot {
  display: inline-flex; align-items: center; gap: 2px; margin: 0;
  padding-left: var(--s3); border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: var(--text-sm); background: var(--surface-2);
}
.slot-remove {
  display: inline-grid; place-items: center; width: 36px; height: 36px; margin: 2px;
  border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer;
}
.slot-remove:hover { background: var(--risk-soft); color: var(--risk); }
.add-slot { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: var(--s3); align-items: end; margin-top: var(--s4); }
select.input { appearance: auto; }

/* ---------- Motion: small, quick, and never required to understand anything ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.6); opacity: .35; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes collapse { to { opacity: 0; transform: translateX(24px); max-height: 0; padding-top: 0; padding-bottom: 0; } }

.page { animation: rise .25s ease-out both; }
.reveal { animation: rise .28s ease-out both; animation-delay: calc(var(--i, 0) * 28ms); }
.btn, .chip, .round, .check-btn, .day-chip span, .seg span, .tab {
  transition: transform .12s ease, background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:active, .chip:active, .round:active, .check-btn:active, .day-chip span:active, .seg span:active { transform: scale(.96); }
.chip.is-selected, .seg input:checked + span, .day-chip input:checked + span { animation: pop .22s ease-out; }
.tag-risk .icon { animation: pop .3s ease-out; }
.is-busy .icon, form.is-busy .icon { animation: spin .8s linear infinite; }
.btn.is-busy { opacity: .8; cursor: progress; }

/* ---------- Header timer pill ---------- */
.timer-pill {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; padding: 0 var(--s3);
  border-radius: 999px; background: var(--primary-soft); color: var(--primary);
  font-weight: 700; font-variant-numeric: tabular-nums; text-decoration: none; margin-right: var(--s1);
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 1.6s ease-in-out infinite; }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; left: 0; right: 0; bottom: var(--s5); z-index: 20; display: flex; justify-content: center; padding: 0 var(--s4); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s3);
  max-width: 520px; padding: var(--s2) var(--s2) var(--s2) var(--s4);
  border-radius: 999px; background: var(--text); color: var(--bg);
  box-shadow: 0 8px 24px rgb(0 0 0 / .18); animation: toast-in .3s cubic-bezier(.2, .9, .3, 1.2) both;
  font-size: var(--text-sm); font-weight: 600;
}
.toast.is-leaving { opacity: 0; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.toast-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: var(--surface); animation: pop .35s ease-out .1s both; }
.toast-action, .toast-close { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; min-height: 36px; border-radius: 999px; }
.toast-action { padding: 0 var(--s3); text-decoration: underline; text-underline-offset: 3px; }
.toast-close { width: 36px; display: grid; place-items: center; opacity: .7; }
.toast-action:hover, .toast-close:hover { background: rgb(127 127 127 / .2); }

/* ---------- Done check on rows ---------- */
.done-form { margin: 0; flex: none; }
.check-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 2px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--border-strong); cursor: pointer;
}
.check-btn:hover, .check-btn:focus-visible { border-color: var(--ok); color: var(--ok); }
.row.is-completing .check-btn, .check-btn.is-checked { background: var(--ok); border-color: var(--ok); color: var(--surface); animation: pop .3s ease-out; }
.row.is-completing .row-title { color: var(--text-muted); background: linear-gradient(currentColor, currentColor) no-repeat 0 55% / 0 2px; animation: strike .3s ease-out forwards; text-decoration: none; }
.row.is-completing { animation: collapse .35s ease-in .45s forwards; overflow: hidden; max-height: 120px; }
.spark {
  position: fixed; left: var(--x); top: var(--y); z-index: 30; width: 7px; height: 7px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: var(--c); pointer-events: none; animation: spark .7s cubic-bezier(.1, .7, .3, 1) forwards;
}
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--primary); cursor: pointer;
}
.icon-btn:hover { background: var(--primary-soft); }
.hero-actions { margin-left: auto; display: inline-flex; gap: var(--s2); flex-wrap: wrap; }

/* ---------- Focus screen (Mac-style timer) ---------- */
.focus { text-align: center; padding: var(--s5) var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.focus-title { font-size: var(--text-xl); font-weight: 700; margin-top: var(--s1); }
.focus-title a { color: inherit; text-decoration: none; }
.focus-meta { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-top: var(--s2); color: var(--text-muted); }
.dial { position: relative; width: min(280px, 72vw); aspect-ratio: 1; margin: var(--s5) auto var(--s4); }
.dial-svg { width: 100%; height: 100%; }
.dial-track { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.dial-progress { fill: none; stroke: var(--primary); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s ease; }
.focus.is-over .dial-progress { stroke: var(--soon); }
.dial-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.dial-time { font-size: clamp(2.6rem, 11vw, 3.6rem); font-weight: 250; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.dial-sub { font-size: var(--text-sm); color: var(--text-muted); font-weight: 600; }
.focus.is-running .dial-time { color: var(--text); }
.dial-buttons { display: flex; justify-content: space-between; max-width: 340px; margin: 0 auto; }
.dial-buttons form { margin: 0; }
.round {
  display: grid; place-items: center; align-content: center; gap: 2px; width: 88px; height: 88px;
  border-radius: 50%; border: 0; cursor: pointer; font: 600 var(--text-xs)/1 var(--font);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px currentColor;
}
.round-start { background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }
.round-stop { background: var(--soon-soft); color: var(--soon); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--soon-line); }
.round-done { background: var(--ok-soft); color: var(--ok); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ok-line); }
.round-done.is-checked { background: var(--ok); color: var(--surface); }
.focus-logged { margin-top: var(--s4); color: var(--text-muted); font-size: var(--text-sm); }
.why-center { display: inline-block; text-align: left; }

/* ---------- Detail: work bar ---------- */
.work-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--border); }
.work-logged { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--text-sm); }
.work-actions { display: inline-flex; flex-wrap: wrap; gap: var(--s2); }
.alert-action { margin-left: auto; }
.alert .btn { color: var(--text); }
.form-actions-reverse { flex-direction: row-reverse; justify-content: flex-start; flex-wrap: wrap; }

/* ---------- Study-time picker: day chips + scroll wheels ---------- */
.js-only { display: none !important; }
.js .js-only { display: flex !important; }
.js .wheel-fallback { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.picker { margin-top: var(--s4); display: grid; gap: var(--s4); padding: var(--s4); background: var(--surface-2); border-radius: var(--radius); }
.days { border: 0; margin: 0; padding: 0; }
.days legend, .wheel-label { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--s2); padding: 0; }
.days.is-shake, .picker-total.is-shake { animation: shake .4s ease; }
.day-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-chip span {
  display: grid; place-items: center; min-width: 52px; height: 44px; padding: 0 var(--s3);
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  font-weight: 600; font-size: var(--text-sm); cursor: pointer; user-select: none;
}
.day-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.day-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.presets { gap: var(--s3); margin-top: var(--s2); flex-wrap: wrap; }
.link-btn { border: 0; background: none; padding: 4px 0; font: 600 var(--text-sm)/1.2 var(--font); color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.time-pair { display: flex; align-items: flex-end; justify-content: center; gap: var(--s3); flex-wrap: wrap; }
.time-arrow { font-size: var(--text-lg); color: var(--text-muted); padding-bottom: 82px; }
.wheel-time { display: grid; justify-items: center; }
.wheels {
  position: relative; align-items: center; gap: 2px; padding: 0 var(--s2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
/* The highlighted band across the middle, like the Mac Clock timer. */
.wheels::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 80px; height: 40px;
  border-radius: 10px; background: var(--surface-2); z-index: 0;
}
.wheel {
  position: relative; z-index: 1; height: 200px; width: 58px; overflow-y: auto; scroll-snap-type: y mandatory;
  scrollbar-width: none; overscroll-behavior: contain; outline: none; border-radius: 10px;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
          mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.wheel::-webkit-scrollbar { display: none; }
.wheel:focus-visible { box-shadow: inset 0 0 0 2px var(--primary); }
.wheel ul { list-style: none; margin: 0; padding: 80px 0; }
.wheel li {
  height: 40px; display: grid; place-items: center; scroll-snap-align: center;
  font-size: 1.35rem; font-variant-numeric: tabular-nums; color: var(--text-muted); cursor: pointer;
  transition: color .15s ease, transform .15s ease, font-weight .15s ease;
}
.wheel li.is-selected, .wheel li.is-near { color: var(--text); font-weight: 650; transform: scale(1.08); }
.wheel-ampm { width: 64px; }
.wheel-ampm li { font-size: 1.05rem; }
.wheel-colon { position: relative; z-index: 1; font-size: 1.35rem; font-weight: 650; }
.picker-total { text-align: center; font-weight: 700; color: var(--primary); }
.picker-total.is-warning { color: var(--risk); }
.picker-total.is-bump { animation: bump .25s ease-out; }
.slot.is-removing { animation: collapse .22s ease-in forwards; }
.slot { transition: opacity .2s ease; }

/* ---------- Error pages ---------- */
.error-page .error-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--soon-soft); color: var(--soon); margin-bottom: var(--s3); animation: pop .4s ease-out; }

/* ---------- Phase 4 tester fixes ---------- */
.lead { color: var(--text-muted); margin: calc(var(--s3) * -1) 0 var(--s4); max-width: 60ch; }
.feed-form .input { flex: 1; min-width: 220px; }
.importance legend .hint { display: block; font-weight: 400; color: var(--text-muted); font-size: var(--text-xs); margin-top: 2px; }
.select-links { gap: var(--s4); align-items: center; flex-wrap: wrap; margin-top: var(--s2); }
.bulk { margin: 0 0 var(--s2); }
.row.is-done .row-title { color: var(--text-muted); }
.done-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); flex: none; }
.summary-title { cursor: pointer; display: flex; align-items: center; min-height: 32px; }
.edit-form { margin-top: var(--s4); }
.danger-zone { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--border); }
.btn-danger { background: var(--surface); color: var(--risk); border-color: var(--risk-line); }
.btn-danger:hover { background: var(--risk-soft); color: var(--risk); }
.description a { word-break: break-all; }

.pair-code {
  margin-top: var(--s3); font-size: 2.2rem; font-weight: 700; letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums; color: var(--primary); animation: pop .3s ease-out;
}
.pair-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-top: var(--s3); }
.pair-row .pair-code { margin-top: 0; }
.card-title .hint { font-weight: 400; color: var(--text-muted); font-size: var(--text-xs); }
/* Setup's three Connect Canvas steps, numbered down the side. */
.connect-steps { margin: var(--s3) 0 var(--s4); padding-left: var(--s5); display: grid; gap: var(--s4); }
.connect-step::marker { font-weight: 700; color: var(--text-muted); }
.connect-step > p, .connect-step > form, .connect-step > details { margin-top: var(--s2); }
.connect-step-text .status-ok { display: inline-flex; align-items: center; gap: var(--s1); margin-left: var(--s2); font-weight: 600; }
.connect-step-text .status-ok[hidden] { display: none; }
.connect-step .status-warn:empty { display: none; }

/* ---------- Sessions and study methods ---------- */
.sub-title { font-size: var(--text-sm); font-weight: 700; margin: var(--s4) 0 0; }
.sub-title .hint { font-weight: 400; color: var(--text-muted); font-size: var(--text-xs); }
.planned-step { font-weight: 600; text-align: right; }
.method { margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--surface-2); text-align: left; }
.method-label { font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.method-name { font-weight: 700; margin-top: 2px; }
.method-how { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }
.method-why { font-size: var(--text-sm); margin-top: var(--s2); }
.method-source { display: block; font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.method-list { list-style: none; padding: 0; margin: var(--s2) 0 0; }
.method-list > li { padding: var(--s3) 0; border-top: 1px solid var(--border); }
.method-list > li:first-child { border-top: 0; }
.refs { padding-left: var(--s4); }
.refs li { margin-top: var(--s2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.method-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: var(--s3); }
.rate { display: inline-flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.rate-label { font-size: var(--text-sm); font-weight: 600; }
.focus-method { max-width: 520px; margin: var(--s4) auto 0; }
.session-step { margin-top: var(--s3); font-size: var(--text-sm); }

/* ---------- Small screens ---------- */
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .hero { padding: var(--s4); }
  .hero-action { margin-left: 0; width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .add-slot { grid-template-columns: 1fr 1fr; }
  .add-slot .field:first-of-type { grid-column: 1 / -1; }
  .add-slot .btn { grid-column: 1 / -1; }
  .week-day { grid-template-columns: 1fr; gap: var(--s1); }
  .planned li { grid-template-columns: 1fr auto; }
  .planned li > span:nth-child(2) { grid-column: 1; }
  .option { flex-direction: column; align-items: flex-start; }
  .input-md { width: 100%; }
  .actionbar .btn { flex: 1; }
  .actionbar .spacer { display: none; }
}

@media (max-width: 400px) {
  .brand-name { display: none; }
  .round { width: 76px; height: 76px; }
  .wheel { width: 50px; }
  .time-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.methods-intro { margin-bottom: var(--s4); }

/* ---------- Semester recap (Wrapped) ---------- */
.wrap-card {
  margin-top: var(--s4); padding: var(--s6) var(--s5); border-radius: var(--radius-lg);
  background: var(--primary-soft); border: 1px solid var(--border); text-align: left;
  animation: rise .35s ease-out;
}
.wrap-eyebrow { font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.wrap-big { font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1.1; font-weight: 800; margin: var(--s2) 0 0; }
.wrap-sub { font-size: var(--text-lg); color: var(--text-muted); margin-top: var(--s2); }
.wrap-names { margin: var(--s3) 0 0; padding-left: var(--s4); font-size: var(--text-sm); overflow-wrap: anywhere; }
.wrap-names .more { list-style: none; color: var(--text-muted); }
.heat { list-style: none; padding: 0; margin: var(--s5) 0 0; display: flex; align-items: flex-end; gap: 3px; height: 96px; }
.heat-bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.heat-fill { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--border-strong); transform-origin: bottom; animation: grow .5s ease-out both; }
.heat-bar.is-hardest .heat-fill { background: var(--primary); }
.heat-bar.h-0 .heat-fill { height: 2px; background: transparent; border-bottom: 2px dashed var(--border-strong); border-radius: 0; }
.heat-bar.h-1 .heat-fill { height: 10%; }
.heat-bar.h-2 .heat-fill { height: 20%; }
.heat-bar.h-3 .heat-fill { height: 30%; }
.heat-bar.h-4 .heat-fill { height: 40%; }
.heat-bar.h-5 .heat-fill { height: 50%; }
.heat-bar.h-6 .heat-fill { height: 60%; }
.heat-bar.h-7 .heat-fill { height: 70%; }
.heat-bar.h-8 .heat-fill { height: 80%; }
.heat-bar.h-9 .heat-fill { height: 90%; }
.heat-bar.h-10 .heat-fill { height: 100%; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.wrap-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s4); margin: var(--s5) 0 0; }
.wrap-stats dt { font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; }
.wrap-stats dd { margin: 2px 0 0; font-size: var(--text-xl); font-weight: 800; }
.wrap-mark { margin-top: var(--s5); font-size: var(--text-xs); color: var(--text-muted); }
.wrap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s4); }
.wrap-actions [data-copy-status] { flex-basis: 100%; }
.hardest-line { margin-top: var(--s2); }
@media (prefers-reduced-motion: reduce) { .heat-fill, .wrap-card { animation: none; } }
.show-more { margin: var(--s2) 0 0; font-size: var(--text-sm); font-weight: 600; }
.quick-dues { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.quick-dues[hidden] { display: none; }

/* ---------- Block time ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); }
.chip-lg { min-height: 44px; padding-inline: var(--s4); font-size: var(--text-sm); }
.busy-label { display: grid; gap: var(--s1); font-weight: 600; font-size: var(--text-sm); }
.busy-list { list-style: none; padding: 0; margin: var(--s2) 0 0; }
.busy-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--border); }
.busy-list li:first-child { border-top: 0; }
.busy-text { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: var(--text-sm); }
.how-to { margin: var(--s3) 0; font-size: var(--text-sm); }
.how-to summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.how-to ul { margin: var(--s2) 0; padding-left: var(--s4); }
.how-to li { margin-top: var(--s1); }
.rec-list { list-style: none; padding: 0; margin: var(--s3) 0; display: grid; gap: var(--s2); }
.rec-list li { display: flex; border-radius: var(--radius); background: var(--primary-soft); font-weight: 600; }
.rec-pick { flex: 1; display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: var(--s2) var(--s3); cursor: pointer; border-radius: inherit; }
.rec-pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); flex: none; }
.rec-list li:has(input:not(:checked)) { background: var(--surface-2); color: var(--text-muted); }

/* ---------- Crossing off, and the Done list ---------- */
@keyframes strike { to { background-size: 100% 2px; } }
.row.is-done .row-title { background: linear-gradient(currentColor, currentColor) no-repeat 0 55% / 100% 1px; }
.done-hero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5); margin: var(--s4) 0 var(--s5); padding: var(--s5); border-radius: var(--radius-lg); background: var(--ok-soft); border: 1px solid var(--ok-line); }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--ok-line); stroke-width: 12; }
.ring-fill { fill: none; stroke: var(--ok); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); }
.ring-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--text-lg); color: var(--ok); }
.ring-text strong { font-size: 2rem; font-weight: 800; }
.done-hero-body { flex: 1 1 240px; min-width: 0; }
.done-title { font-size: var(--text-lg); font-weight: 800; margin: 0; }
.done-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s3); margin: var(--s3) 0 0; }
.done-stats dt { font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; }
.done-stats dd { margin: 2px 0 0; font-size: var(--text-lg); font-weight: 800; }
.done-day { margin-top: var(--s4); }
/* Drawn by default; the animation only plays the drawing, so a tick never goes missing. */
.done-mark .draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw-in .45s ease-out backwards; animation-delay: calc(var(--i, 0) * 60ms + .15s); }
@keyframes draw-in { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.row.is-just-done { box-shadow: 0 0 0 2px var(--ok); animation: glow 2.4s ease-out 1; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 var(--ok); } 30% { box-shadow: 0 0 0 6px var(--ok-line); } 100% { box-shadow: 0 0 0 2px var(--ok); } }
@media (prefers-reduced-motion: reduce) {
  .row.is-completing .row-title { animation: none; background-size: 100% 2px; }
  .ring-fill { transition: none; }
  .done-mark .draw { animation: none; stroke-dashoffset: 0; }
  .row.is-just-done { animation: none; }
}

/* ==========================================================================
   Mac look for every component. These rules sit last on purpose: the sections above
   describe layout and behaviour, this layer gives them the macOS finish.
   ========================================================================== */

/* Panels: soft shadows instead of hard borders, like Mac popovers and grouped lists. */
.card, .hero, .rows, .change-list, .focus, .list-box {
  background: var(--surface); border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.card { padding: var(--s5); }
.card + .card { margin-top: var(--s4); }
.card-title { font-size: var(--text-md); font-weight: 650; }
.hero { padding: var(--s5); border-left: 0; position: relative; overflow: hidden; }
.hero::before, .plan-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary);
}
.hero.is-soon::before { background: var(--soon); }
.hero.is-risk::before, .plan-card.is-risk::before { background: var(--risk); }
.plan-card { border-left: 0; position: relative; overflow: hidden; }
.hero-title, .focus-title, .page-title { font-family: var(--font-display); letter-spacing: -0.02em; }
.page-title { font-size: 1.75rem; font-weight: 700; }
.page-head { margin-bottom: var(--s4); }
.eyebrow, .method-label { font-size: 11px; letter-spacing: .04em; }

/* Lists: rows with hairline separators that start after the leading badge. */
.row { padding: 10px var(--s4); min-height: 56px; }
.row + .row { border-top: 0; box-shadow: inset 0 1px 0 var(--separator); }
.row-title { font-weight: 590; }
.row-meta { font-size: var(--text-sm); }
.group-title { font-size: var(--text-sm); font-weight: 650; color: var(--text-muted); margin: 0 var(--s1) var(--s2); }
.count { background: var(--control-track); border: 0; padding: 1px 7px; font-weight: 600; }
.change-list > li + li { border-top: 0; box-shadow: inset 0 1px 0 var(--separator); }

/* The date badge looks like the Calendar app icon. */
.datechip { width: 42px; padding: 0 0 3px; border: 0; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-control); overflow: hidden; }
.datechip-dow { padding: 2px 0 1px; background: var(--primary); color: var(--on-primary); font-size: 9.5px; letter-spacing: .06em; }
.datechip-day { font-size: 1.125rem; font-weight: 600; padding-top: 2px; }
.is-risk .datechip { background: var(--surface); border: 0; }
.is-risk .datechip-dow { background: var(--risk); color: var(--surface); }
.is-risk .datechip-day { color: var(--risk); }

/* Tags: quiet capsules. */
.tag { border: 0; padding: 2px 8px; font-size: 11.5px; font-weight: 600; background: var(--control-track); }
.tag-risk { background: var(--risk-soft); }
.tag-soon, .tag-warn { background: var(--soon-soft); }
.tag-ok { background: var(--ok-soft); }
.tag-start { background: var(--primary-soft); border: 0; }

/* Segmented controls: the view tabs, and importance. */
.tabs { gap: 2px; padding: 2px; border: 0; border-radius: 9px; background: var(--control-track); }
.tab { min-height: 28px; padding: 0 var(--s3); border-radius: 7px; font-size: var(--text-sm); font-weight: 500; color: var(--text); }
.tab[aria-current="page"] { background: var(--control); border: 0; box-shadow: var(--shadow-control); font-weight: 600; }
.importance fieldset { gap: 0; display: inline-flex; padding: 2px; border-radius: 9px; background: var(--control-track); margin-top: var(--s2); }
.importance legend { float: none; margin-bottom: var(--s2); }
.seg span { min-height: 28px; border: 0; border-radius: 7px; padding: 0 var(--s4); font-weight: 500; }
.seg input:checked + span { background: var(--control); color: var(--text); box-shadow: var(--shadow-control); font-weight: 600; }
.seg input:focus-visible + span { outline: none; box-shadow: var(--focus); }

/* Chips are rounded-rect buttons; the chosen one takes the accent. */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-h); padding: 0 var(--s3);
  border: 0; border-radius: var(--radius-sm); background: var(--control); color: var(--text);
  box-shadow: var(--shadow-control); font: 500 var(--text-sm)/1 var(--font); cursor: default;
}
.chip:hover { background: color-mix(in srgb, var(--control) 92%, var(--text)); color: var(--text); }
.chip.is-selected, .chip-confirm { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.chip-lg { min-height: 36px; padding: 0 var(--s4); }
.day-chip span { min-width: 46px; height: var(--control-h); border: 0; border-radius: var(--radius-sm); background: var(--control); box-shadow: var(--shadow-control); font-weight: 500; }
.day-chip input:checked + span { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.day-chip input:focus-visible + span { outline: none; box-shadow: var(--focus); }

/* Text fields: the Mac's sunken look, with the accent focus ring. */
.input {
  min-height: calc(var(--control-h) + 2px); padding: 6px 10px; font-size: var(--text-md);
  background: var(--control); border: 0; border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 .5px rgb(0 0 0 / .18), inset 0 1px 1px rgb(0 0 0 / .05);
}
.input:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--primary), var(--focus); }
.field label { font-size: var(--text-sm); font-weight: 600; }
select.input { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: right 13px center, right 8px center; background-size: 5px 5px; background-repeat: no-repeat; }

/* Alerts: tinted banners without hard edges. */
.alert { border: 0; border-radius: var(--radius); padding: var(--s3) var(--s4); box-shadow: inset 0 0 0 .5px currentColor; }
.empty { border: 0; background: var(--surface); box-shadow: var(--shadow); }

/* Toasts become Mac notification banners in the top-right corner. */
.toast-region { top: calc(var(--s4) + 52px); bottom: auto; left: auto; right: var(--s4); justify-content: flex-end; padding: 0; }
.toast {
  max-width: 380px; padding: var(--s3) var(--s2) var(--s3) var(--s3); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--text);
  -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-pop); font-weight: 500; animation: banner-in .38s cubic-bezier(.2, .9, .25, 1.05) both;
}
.toast.is-leaving { transform: translateX(24px); }
.toast-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: var(--on-primary); }
.toast-done .toast-icon { background: var(--ok); color: var(--surface); }
.toast-action { text-decoration: none; color: var(--primary); font-weight: 600; border-radius: var(--radius-sm); }
@keyframes banner-in { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }

/* Mac-style checkbox circles on rows. */
.check-btn { width: 44px; height: 44px; border: 0; background: transparent; color: transparent; position: relative; }
.check-btn::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--border-strong); background: var(--control); transition: background-color .15s ease, box-shadow .15s ease; }
.check-btn .icon { position: relative; z-index: 1; }
.check-btn:hover::before, .check-btn:focus-visible::before { box-shadow: inset 0 0 0 1.5px var(--ok); }
.check-btn:hover { color: var(--ok); }
.row.is-completing .check-btn, .check-btn.is-checked { background: transparent; color: var(--surface); }
.row.is-completing .check-btn::before, .check-btn.is-checked::before { background: var(--ok); box-shadow: none; }

/* Timer pill in the toolbar. */
.timer-pill { min-height: 28px; padding: 0 var(--s3); font-size: var(--text-sm); }

/* Study method box, recap card and Done hero sit on the same grouped surface. */
.method { background: var(--surface-2); border-radius: var(--radius); }
.wrap-card { border: 0; box-shadow: var(--shadow); }
.done-hero { border: 0; box-shadow: var(--shadow); }
.icon-btn { border: 0; box-shadow: var(--shadow-control); background: var(--control); }
.btn-danger { background: var(--control); color: var(--risk); box-shadow: var(--shadow-control); }
.round { box-shadow: 0 0 0 3px var(--surface), 0 0 0 4.5px currentColor; }

/* ---------- Phones and narrow windows: no sidebar, an iOS tab bar at the bottom ---------- */
@media (max-width: 760px) {
  .window { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .brand-compact { display: inline-flex; }
  .brand-compact .brand-name { font-size: var(--text-sm); }
  .page { padding: var(--s4) var(--s4) calc(84px + env(safe-area-inset-bottom)); }
  .back { display: inline-flex; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--toolbar);
    -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
    border-top: 1px solid var(--separator);
  }
  .tabbar .nav-item { flex-direction: column; justify-content: center; gap: 2px; min-height: 48px; padding: 0; font-size: 10.5px; font-weight: 600; color: var(--text-muted); background: none; border-radius: var(--radius-sm); }
  .tabbar .nav-item .icon { color: var(--text-muted); width: 24px; height: 24px; }
  .tabbar .nav-item[aria-current="page"], .tabbar .nav-item[aria-current="page"] .icon { color: var(--primary); background: none; }
  .toast-region { top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); left: var(--s3); right: var(--s3); justify-content: center; }
  .toast { max-width: 100%; }
  .tabs { display: flex; overflow-x: auto; scrollbar-width: none; }
  .tab { flex: none; }
}

/* ---------- Mac layer: second pass after looking at every screen ---------- */
@media (min-width: 761px) { .back { display: none; } }
.slot { border: 0; border-radius: var(--radius-sm); background: var(--control); box-shadow: var(--shadow-control); padding-left: var(--s3); }
.slot-remove { width: 30px; height: 30px; border-radius: 6px; }
.week-day { border-top: 0; box-shadow: inset 0 1px 0 var(--separator); }
.week-day:first-child { box-shadow: none; }
.picker { background: var(--surface-2); border-radius: var(--radius); }
.wheels { box-shadow: var(--shadow-control); border: 0; }
.summary + .card, .summary + .alert, .page-head + .summary { margin-top: var(--s3); }
.summary + .card { margin-top: var(--s4); }
.card-title + .busy-quick, .card-title + form, .card-title + p, .card-title + .form { margin-top: var(--s3); }
.busy-label { margin-top: var(--s2); }
.option, .planned li, .method-list > li, .busy-list li { border-top: 0; box-shadow: inset 0 1px 0 var(--separator); }
.option:first-child, .method-list > li:first-child, .busy-list li:first-child { box-shadow: none; }
.history { border-top: 0; box-shadow: inset 0 1px 0 var(--separator); }
.work-bar, .danger-zone, .change-due { border-top: 0; box-shadow: inset 0 1px 0 var(--separator); }
.actionbar { background: linear-gradient(to bottom, transparent, var(--bg) 35%); }
.step-num { background: var(--primary-soft); }
.pair-code { font-family: var(--font-display); }

/* Long lists: rows far below the screen are skipped by the browser until you scroll near. */
.rows > .row:nth-child(n+15) { content-visibility: auto; contain-intrinsic-size: auto 60px; }

/* ---------- Mac layer: third pass (tester findings) ---------- */
.page-title, .hero-title, .focus-title, .wrap-big { overflow-wrap: anywhere; }
.importance fieldset { display: block; padding: 0; background: none; border-radius: 0; margin-top: var(--s4); }
.importance legend { margin-bottom: var(--s2); }
.segmented { display: inline-flex; gap: 0; padding: 2px; border-radius: 9px; background: var(--control-track); }
.ring-text { display: flex; align-items: baseline; justify-content: center; gap: 1px; }
.ring-text strong { line-height: 1; }
.row.is-done .row-title { display: inline; }
.field { align-content: start; }
@media (min-width: 761px) { .phone-only { display: none !important; } }
.nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--control-track); font-size: 11px; font-weight: 600; text-align: center; color: var(--text-muted); }
.nav-item[aria-current="page"] .nav-count { background: rgb(255 255 255 / .25); color: inherit; }
.tabbar .nav-count { display: none; }
.toolbar-title { font-weight: 650; font-size: var(--text-sm); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tool-btn[aria-current="page"] { background: var(--control-track); color: var(--text); }
.datechip-dow { font-size: 10.5px; }

/* More (phones): a grouped list of the other sections. */
.more-list .more-link { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: var(--s2) var(--s4); color: var(--text); text-decoration: none; }
.more-list li + li .more-link { box-shadow: inset 0 1px 0 var(--separator); }
.more-list .icon { color: var(--primary); }
.more-text { display: grid; flex: 1; min-width: 0; }
.more-note { font-size: var(--text-sm); color: var(--text-muted); }
.more-chevron { color: var(--text-muted); font-size: 1.4rem; }
.more-list { list-style: none; padding: 0; margin: 0; }
.more-gap { margin-top: var(--s5); }

/* Focus: both round buttons the same size, each with a ring in its own colour. */
.round { width: 88px; height: 88px; }
.round-start { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary-soft); }
.round-stop { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--soon-line); }
.round-done { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ok-line); }
.dial-face { gap: 10px; }
.dial-time { line-height: 1.05; }

/* Notification banners sit bottom-right, clear of the page's own alerts. */
@media (min-width: 761px) { .toast-region { top: auto; bottom: var(--s5); right: var(--s5); } }
/* Filled accents use white text in both themes, like macOS. */
.nav-item[aria-current="page"] { background: linear-gradient(120deg, var(--accent-fill), var(--accent-2)); color: var(--on-accent); box-shadow: 0 6px 18px -8px var(--glow); }
.nav-item[aria-current="page"] .icon { color: var(--on-accent); }
.btn-primary { background: linear-gradient(120deg, var(--accent-fill), var(--accent-2)); color: var(--on-accent); border-color: transparent; box-shadow: 0 8px 22px -10px var(--glow), 0 1px 2px rgb(0 0 0 / .18), inset 0 .5px 0 rgb(255 255 255 / .3); }
.btn-primary:hover { filter: brightness(1.06) saturate(1.08); box-shadow: 0 10px 26px -8px var(--glow), 0 1px 2px rgb(0 0 0 / .18), inset 0 .5px 0 rgb(255 255 255 / .3); }
.btn-primary:hover { color: var(--on-accent); }
.chip.is-selected, .chip-confirm, .day-chip input:checked + span { background: linear-gradient(120deg, var(--accent-fill), var(--accent-2)); color: var(--on-accent); box-shadow: 0 4px 14px -8px var(--glow); }
.toast-icon { background: var(--accent-fill); color: var(--on-accent); }
.round-start { background: var(--accent-fill); color: var(--on-accent); }
.ring-text { align-items: center; }
.feed-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s3); }

/* ---------- "See how" guides: big type, one step at a time, with pictures ---------- */
.how-to ul { list-style: none; padding-left: 0; }
.how-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); padding: var(--s2) 0; }
.how-row + .how-row { box-shadow: inset 0 1px 0 var(--separator); }
.how-row .btn { flex: none; }
.back-always { display: inline-flex !important; }
.guide-lead { font-size: 1.125rem; color: var(--text-muted); margin-bottom: var(--s4); max-width: 60ch; }
.guide-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
.guide-step { display: flex; gap: var(--s4); align-items: flex-start; }
.guide-num { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); font-size: 1.25rem; font-weight: 800; }
.guide-body { flex: 1; min-width: 0; }
.guide-title { font-size: 1.3rem; font-weight: 700; }
.guide-detail { font-size: 1.125rem; line-height: 1.55; margin-top: var(--s2); max-width: 62ch; }
.guide-pic { display: block; width: 100%; max-width: 560px; height: auto; margin-top: var(--s4); }
.guide-phone { max-width: 260px; }
.guide-tip { margin-top: var(--s4); font-size: var(--text-md); }
.guide-paste { margin-top: var(--s4); }
.guide-safe { margin-top: var(--s2); }
.gp-device { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 2; }
.gp-screen, .gp-row { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.gp-bar, .gp-side { fill: var(--control-track); }
.gp-notch { fill: var(--text); }
.gp-address { fill: var(--surface); }
.gp-address-text { fill: var(--text-muted); font: 500 12px var(--font); }
.gp-dot.r { fill: var(--risk); } .gp-dot.y { fill: var(--soon); } .gp-dot.g { fill: var(--ok); }
.gp-title { fill: var(--text); font: 700 22px var(--font-display); }
.gp-row-text { fill: var(--text); font: 500 16px var(--font); }
.gp-row-text.small { font-size: 13px; }
.gp-side-row { fill: transparent; }
.gp-row.is-target, .gp-side-row.is-target { fill: var(--primary-soft); stroke: var(--accent-fill); stroke-width: 3; }
.gp-tap { fill: none; stroke: var(--accent-fill); stroke-width: 3; opacity: .6; }
.gp-tap-dot { fill: var(--accent-fill); }
.gp-cursor { fill: var(--text); stroke: var(--surface); stroke-width: 1.5; }
.gp-callout rect { fill: var(--accent-fill); }
.gp-callout text { fill: var(--on-accent); font: 700 15px var(--font); }
@media (max-width: 560px) { .how-row { flex-direction: column; } .guide-step { flex-direction: column; gap: var(--s2); } }
.gp-pointer { fill: none; stroke: var(--accent-fill); stroke-width: 2.5; stroke-dasharray: 5 5; }

/* ---------- Themes page ---------- */
.mode-picks { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s3); }
.mode-pick, .accent-pick { position: relative; display: grid; justify-items: center; gap: var(--s2); cursor: default; }
.mode-pick input, .accent-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-preview { display: flex; width: 132px; height: 86px; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-control); }
.mode-preview .mp-side { width: 34%; }
.mode-preview .mp-main { flex: 1; display: grid; align-content: start; gap: 6px; padding: 12px 10px; }
.mp-line { height: 7px; border-radius: 4px; }
.mp-line.short { width: 60%; }
.mp-btn { width: 44%; height: 12px; border-radius: 4px; background: var(--accent-fill); margin-top: 4px; }
.mode-light .mp-side { background: #e7e7ec; } .mode-light .mp-main { background: #ffffff; } .mode-light .mp-line { background: #d9d9df; }
.mode-dark .mp-side { background: #2a2a2f; } .mode-dark .mp-main { background: #1d1d20; } .mode-dark .mp-line { background: #3c3c42; }
.mode-system .mp-side { background: linear-gradient(135deg, #e7e7ec 50%, #2a2a2f 50%); }
.mode-system .mp-main { background: linear-gradient(135deg, #ffffff 50%, #1d1d20 50%); }
.mode-system .mp-line { background: #8a8a92; }
.mode-pick input:checked + .mode-preview { box-shadow: 0 0 0 3px var(--primary); }
.mode-pick input:focus-visible + .mode-preview { box-shadow: 0 0 0 3px var(--primary), 0 0 0 5px var(--surface), 0 0 0 7px var(--primary); }
.mode-label, .accent-label { font-size: var(--text-sm); font-weight: 500; }
.accent-picks { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s3); }
.swatch { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.accent-pick input:checked + .swatch { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px currentColor; }
.accent-pick input:focus-visible + .swatch { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px currentColor, var(--focus); }
.coming { opacity: .85; }

/* Pop-ups grow sideways instead of stacking their words: one line on a computer,
   buttons never break, and the message only wraps when it is longer than the screen allows. */
.toast { width: max-content; max-width: min(760px, calc(100vw - 2 * var(--s4))); }
.toast-text { flex: 1 1 auto; min-width: 0; }
.toast-action, .toast-close, .toast .inline { flex: none; white-space: nowrap; }
@media (max-width: 760px) { .toast { width: auto; max-width: 100%; } }

/* ---------- Recap you can explore: weeks or months, earlier terms, tap a bar ---------- */
.recap-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); margin-bottom: var(--s4); }
.recap-by { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--control-track); }
.recap-by-opt { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--s4); border-radius: 7px; color: var(--text); text-decoration: none; font-size: var(--text-sm); font-weight: 600; }
.recap-by-opt[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow-control); }
.recap-by-opt:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.recap-terms { display: flex; gap: var(--s2); margin-left: auto; }
.wrap-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.wrap-top-text { min-width: 0; }
.wrap-step { display: flex; gap: var(--s1, 4px); flex: none; }
.wrap-step-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--control-track); color: var(--text); }
.wrap-step-btn:hover { background: color-mix(in srgb, var(--primary) 18%, var(--control-track)); }
.wrap-step-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.wrap-step-btn.is-off { opacity: .35; }
.heat-hit { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; width: 100%; height: 100%; padding-top: 4px; border-radius: 4px; color: inherit; text-decoration: none; cursor: pointer; }
.heat-hit:hover .heat-fill { filter: brightness(1.15); }
.heat-hit:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.heat-bar.h-0 .heat-hit .heat-fill { height: 2px; }
.heat-bar .heat-fill { flex: none; }
.heat-bar.h-1 .heat-hit .heat-fill { height: 10%; } .heat-bar.h-2 .heat-hit .heat-fill { height: 20%; }
.heat-bar.h-3 .heat-hit .heat-fill { height: 30%; } .heat-bar.h-4 .heat-hit .heat-fill { height: 40%; }
.heat-bar.h-5 .heat-hit .heat-fill { height: 50%; } .heat-bar.h-6 .heat-hit .heat-fill { height: 60%; }
.heat-bar.h-7 .heat-hit .heat-fill { height: 70%; } .heat-bar.h-8 .heat-hit .heat-fill { height: 80%; }
.heat-bar.h-9 .heat-hit .heat-fill { height: 90%; } .heat-bar.h-10 .heat-hit .heat-fill { height: 100%; }
/* The bar you're looking at is filled with the accent; the busiest one keeps an accent outline. */
.heat-bar.is-hardest .heat-fill { background: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); }
.heat-bar.is-selected .heat-fill { background: var(--primary); }
.heat-bar.is-selected .heat-hit { box-shadow: inset 0 -3px 0 var(--primary); }
.heat.by-month { height: 128px; gap: var(--s2); margin-bottom: 22px; }
.heat-hit { position: relative; }
.heat-label { position: absolute; top: calc(100% + 4px); left: 0; right: 0; font-size: var(--text-xs); color: var(--text-muted); text-align: center; line-height: 1.2; }
.heat-bar.is-selected .heat-label { color: var(--text); font-weight: 700; }
.heat-hint { margin-top: var(--s2); font-size: var(--text-xs); color: var(--text-muted); }

/* Graphite is grey like the text, so its links are underlined to stay findable. */
:root[data-accent="graphite"] main summary, :root[data-accent="graphite"] main a:not(.btn):not(.heat-hit):not(.recap-by-opt):not(.wrap-step-btn):not(.row-link):not(.card-link) { text-decoration: underline; text-underline-offset: 3px; }
/* Themes: the cards after the form keep the same gap as the ones inside it. */
.themes-form + .card, .themes-form > .card + .card { margin-top: var(--s4); }
/* Recap: the picked option stands out in dark mode too; month bars don't stretch absurdly wide. */
.recap-by-opt[aria-current="page"] { background: var(--control); }
.heat.by-month { justify-content: flex-start; }
.heat.by-month .heat-bar { max-width: 88px; }
/* Guide drawings: an iPhone-style on switch, and the tab bar along the bottom of a phone. */
.gp-switch { fill: var(--ok); }
.gp-switch-knob { fill: var(--on-accent); }
.gp-tabline { stroke: var(--border-strong); stroke-width: 1; }
.gp-tab-text { fill: var(--text-muted); font-size: 14px; font-weight: 600; font-family: var(--font); }
.gp-tab-text.is-target { fill: var(--primary); }
.gp-tab-ring { fill: none; stroke: var(--accent-fill); stroke-width: 3; }
.how-to-title { margin: var(--s3) 0 0; }

/* ---------- Phase 6: big enough to tap, readable counts, rows you can tap anywhere ---------- */
/* Counts sit on a grey pill, so they use the full text colour to stay readable (AA). */
.count, .nav-count { color: var(--text); }
.nav-item[aria-current="page"] .nav-count { color: var(--on-accent); background: rgb(0 0 0 / .22); }
/* The whole row opens the assignment; the tick button stays its own target on top. */
.row { position: relative; }
a.row-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.row :is(form, button, summary, details, input, select, a:not(.row-title)) { position: relative; z-index: 1; }
.row:has(.row-title:focus-visible) { box-shadow: inset 0 0 0 2px var(--primary); }
.row-title:focus-visible { box-shadow: none; outline: none; }
/* On a phone or touch screen, everything you can press is at least 44 x 44 px. */
@media (max-width: 760px), (pointer: coarse) {
  .btn, .chip, .input, select, .tab, .tool-btn, .btn-toolbar, .back, .link-btn, .recap-by-opt,
  .slot-remove, .brand-compact, .chip-link, .wrap-step-btn { min-height: 44px; }
  .tool-btn, .slot-remove, .wrap-step-btn, .brand-compact { min-width: 44px; }
  .back, .link-btn, .brand-compact { display: inline-flex; align-items: center; }
  .tab { display: inline-flex; align-items: center; }
  summary:not(.group-title) { min-height: 44px; min-width: 44px; }
  .link-btn { min-width: 44px; justify-content: center; }
  .hero-title a, .focus-title a { display: inline-flex; align-items: center; min-height: 44px; }
  .input, select, textarea { font-size: 16px; } /* also stops phones zooming in on tap */
}

/* Keyboard focus is always visible: a solid ring around buttons and links. (Buttons have their
   own resting shadow, which used to hide the focus shadow.) */
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Empty screens look intentional: the owl on top, a plain sentence, and what to do next. */
.empty::before { content: ""; display: block; width: 56px; height: 56px; margin: 0 auto var(--s4); background: url("/static/logo.svg") center / contain no-repeat; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2) var(--s3); }
.empty-actions .inline { margin: 0; }

/* ---------- Accounts and TermOwl Plus ---------- */
:root { --plus: #7a4a00; --plus-soft: #fdf0d5; --plus-line: #f0c46a; --plus-on-light: #7a4a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --plus: #f5c66b; --plus-soft: #33250a; --plus-line: #6b4d12; } }
:root[data-theme="dark"] { --plus: #f5c66b; --plus-soft: #33250a; --plus-line: #6b4d12; }
/* The gold "Plus" tag: the owl's colour, on every paid feature. */
.plus-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 5px; border-radius: 999px; background: var(--plus-soft); color: var(--plus); box-shadow: inset 0 0 0 1px var(--plus-line); font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.nav-item .plus-tag { margin-left: auto; }
.nav-item[aria-current="page"] .plus-tag { background: rgb(255 255 255 / .9); box-shadow: none; color: var(--plus-on-light); }
.tabbar .plus-tag { display: none; }
.plus-list { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: var(--s2); }
.plus-gate .plus-list { display: inline-grid; text-align: left; margin-bottom: var(--s5); }
.plan-line { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.plan-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0 var(--s4); }
.plan-actions-end { margin-bottom: 0; }
.dev-card { box-shadow: inset 0 0 0 1px var(--plus-line), var(--shadow); }
/* Sign in and sign up: a small centred card on the window background. */
.auth-body { min-height: 100vh; }
.auth-page { max-width: 420px; margin: 0 auto; padding: var(--s7) var(--s4); text-align: center; }
.auth-logo { display: block; margin: 0 auto var(--s4); border-radius: 18px; }
.auth-lead { color: var(--text-muted); margin: var(--s2) 0 var(--s5); }
.auth-form { display: grid; gap: var(--s4); text-align: left; }
.auth-form .field { display: grid; gap: var(--s1); }
.auth-switch { margin-top: var(--s5); }
.auth-fine { margin-top: var(--s3); }

.auth-form .label { font-size: var(--text-sm); font-weight: 600; }
.accent-pick input:disabled + .swatch, .accent-pick input:disabled ~ .accent-label { opacity: .45; }
.accent-pick:has(input:disabled) { cursor: not-allowed; }

/* The slogan: one quiet line in the brand colour, on sign-in and the first Setup screen. */
.slogan { margin: 0 0 var(--s2); font-size: var(--text-sm); font-weight: 700; letter-spacing: .02em; color: var(--primary); }
.auth-page .slogan { margin: var(--s3) 0 0; text-align: center; }
.page-head .slogan { flex-basis: 100%; margin: 0 0 calc(var(--s4) * -1 + var(--s1)); }

/* ---------- Study a reading ---------- */
.study-form .field { display: grid; gap: var(--s2); }
.study-file { padding: var(--s2); height: auto; cursor: pointer; }
.study-file::file-selector-button { margin-right: var(--s3); padding: var(--s2) var(--s4); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.study-file::file-selector-button:hover { background: var(--primary-soft); }
.study-text { min-height: 140px; resize: vertical; padding: var(--s3); line-height: 1.5; }
.study-or { margin: var(--s2) 0; color: var(--text-muted); font-weight: 600; text-align: center; }
.study-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.study-link { display: grid; gap: 2px; padding: var(--s3); border-radius: var(--radius); background: var(--surface-2); color: var(--text); text-decoration: none; }
.study-link:hover { background: var(--primary-soft); }
.study-link-title { font-weight: 650; }
.worth-list { margin: var(--s3) 0 0; padding-left: var(--s5); display: grid; gap: var(--s3); }
.worth-point { font-weight: 650; }
.worth-why { color: var(--text-muted); margin-top: 2px; }
.study-tip { margin-top: var(--s4); padding: var(--s3); border-radius: var(--radius); background: var(--primary-soft); }
.flash-list { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: var(--s3); }
.flash-face { width: 100%; display: grid; gap: var(--s2); text-align: left; padding: var(--s4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.flash-front { font-weight: 650; }
.flash-back { color: var(--text-muted); }
/* With JavaScript: one big card at a time that flips between question and answer. */
.is-deck .flash-face { min-height: 180px; place-content: center; text-align: center; font-size: var(--text-lg, 1.125rem); padding: var(--s5); transition: transform .25s ease, background-color .2s ease; }
.is-deck .flash-back { display: none; color: var(--text); }
.is-deck .flash-front::before, .is-deck .flash-back::before { display: block; margin-bottom: var(--s2); font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.is-deck .flash-front::before { content: "Question"; }
.is-deck .flash-back::before { content: "Answer"; }
.is-deck .is-flipped .flash-front { display: none; }
.is-deck .is-flipped .flash-back { display: block; }
.is-deck .is-flipped .flash-face { background: var(--primary-soft); border-color: var(--primary); }
.is-deck .flash-face:active { transform: scale(.98); }
.flash-nav { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); }
.quiz-list { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s5); }
.quiz-num { color: var(--text-muted); }
.quiz-q fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.quiz-question { font-weight: 650; margin-bottom: var(--s2); padding: 0; }
.quiz-choice { display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.quiz-choice input { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; flex: none; }
.quiz-choice:hover { background: var(--surface-2); }
.quiz-choice.is-answer { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); font-weight: 650; }
.quiz-choice.is-picked-wrong { border-color: var(--risk-line); background: var(--risk-soft); color: var(--risk); }
.quiz-result { margin-top: var(--s2); font-weight: 650; }
.quiz-result:empty { display: none; }
.is-right .quiz-result { color: var(--ok); }
.is-wrong .quiz-result { color: var(--risk); }
.quiz-explain { margin-top: var(--s2); }
.quiz-explain summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.quiz-explain p { margin-top: var(--s2); }
.class-grid { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); }
.class-tile { display: grid; gap: 2px; padding: var(--s4); border-radius: var(--radius); background: var(--surface-2); color: var(--text); text-decoration: none; transition: background-color .15s ease, transform .1s ease; }
.class-tile:hover { background: var(--primary-soft); }
.class-tile:active { transform: scale(.98); }
.class-tile-name { font-weight: 700; }
.slide-list { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; }
.slide-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--border); }
.slide-row:first-child { border-top: 0; }
.slide-name { font-weight: 600; overflow-wrap: anywhere; }
.slide-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }

/* The brand name glows in the brand's two colours. */
.brand-name { background: linear-gradient(120deg, var(--primary), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (forced-colors: active) { .brand-name { color: CanvasText; background: none; } }

/* ---------- Themes: your own colours ---------- */
.swatch-blue { background: linear-gradient(135deg, #4f46e5, #a21caf 70%, #22d3ee); }
.swatch-purple { background: linear-gradient(135deg, #7c3aed, #c026d3 70%, #f472b6); }
.swatch-pink { background: linear-gradient(135deg, #db2777, #9333ea 70%, #fb923c); }
.swatch-orange { background: linear-gradient(135deg, #c2410c, #db2777 70%, #facc15); }
.swatch-green { background: linear-gradient(135deg, #047857, #0369a1 70%, #a3e635); }
.swatch-graphite { background: linear-gradient(135deg, #475569, #334155 70%, #94a3b8); }
.swatch-custom { background: linear-gradient(135deg, var(--accent-fill), var(--accent-2) 70%, var(--accent-3, var(--accent-2))); }
.colour-slots { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0; }
.colour-slot { position: relative; display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: var(--s2) var(--s3); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.colour-slot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.colour-slot:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.colour-slot:has(input:focus-visible) { box-shadow: var(--focus); }
.colour-chip { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); background: var(--surface-2); }
.colour-slot-text { display: grid; line-height: 1.2; }
.colour-slot-name { font-weight: 650; }
.colour-picker { flex-wrap: wrap; gap: var(--s5); align-items: center; margin: var(--s4) 0; }
.js .colour-picker.js-only { display: flex !important; }
.colour-wheel { width: 220px; height: 220px; border-radius: 50%; cursor: crosshair; touch-action: none; box-shadow: 0 10px 30px -12px var(--glow); }
.colour-controls { flex: 1; min-width: 200px; display: grid; gap: var(--s3); }
.colour-controls .field { display: grid; gap: var(--s1); font-weight: 600; }
.colour-light { width: 100%; accent-color: var(--primary); }
.colour-hex { max-width: 160px; font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.colour-preview { display: flex; align-items: center; gap: var(--s4); padding: var(--s3); border-radius: var(--radius); background: var(--surface-2); }
.colour-light { min-height: 44px; }
.colour-preview a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s2); }
.colour-wheel:focus-visible { box-shadow: var(--focus), 0 10px 30px -12px var(--glow); }

/* Real screenshots in the guides, circled like the drawings. */
.guide-shots { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s3); }
.guide-shot { margin: 0; flex: 1 1 360px; max-width: 100%; }
.guide-shot.is-phone { flex: 0 1 230px; }
.guide-shot-pic { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-pop); background: var(--surface-2); }
.gs-ring { fill: none; stroke: var(--accent-fill); stroke-width: 6; vector-effect: non-scaling-stroke; }
.gs-ring-pulse { transform-box: fill-box; transform-origin: center; animation: gs-pulse 1.6s ease-out infinite; }
@keyframes gs-pulse { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.5); } }
.gs-callout rect { fill: var(--accent-fill); }
/* No font-size here: each label's size is set to suit its picture. */
.gs-callout text { fill: var(--on-accent); font-family: var(--font); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .gs-ring-pulse { animation: none; opacity: 0; } }

.quiz-figure { margin: 0 0 var(--s3); display: grid; gap: var(--s1); }
.quiz-figure img { display: block; max-width: 100%; max-height: 360px; width: auto; height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }

/* The break suggestion: shown on every page once you've studied for about two hours. */
.break-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s4); margin: var(--s4) clamp(16px, 3vw, 32px) 0; padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--accent-fill) 35%, var(--border)); }
.break-title { font-weight: 700; }
.break-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.break-label { color: var(--text-muted); font-weight: 600; }

/* Privacy and terms pages. */
.legal-page { max-width: 680px; margin: 0 auto; padding: var(--s6) var(--s4) var(--s7); }
.legal-brand { display: inline-flex; min-height: 44px; min-width: 44px; align-items: center; gap: var(--s2); margin-bottom: var(--s4); text-decoration: none; color: inherit; font-weight: 700; }
.legal-page h2 { margin: var(--s5) 0 var(--s2); font-size: 1.15rem; }
.legal-page li { margin: var(--s1) 0; }
.legal-foot { margin-top: var(--s6); }

/* Account page: Free and Plus side by side, the current one outlined. */
.plan-now { margin: 0 0 var(--s4); }
.plan-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s4); align-items: stretch; }
.plan-option { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s4); border-radius: var(--radius-lg); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.plan-option.is-current { box-shadow: inset 0 0 0 2px var(--primary); }
.plan-option-plus { background: var(--plus-soft); }
.plan-option-plus.is-current { box-shadow: inset 0 0 0 2px var(--plus-line); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.plan-name { display: inline-flex; align-items: center; gap: var(--s2); margin: 0; font-size: 1.1rem; }
.plan-badge { padding: 2px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; }
.plan-option-plus .plan-badge { background: var(--plus-soft); color: var(--plus); box-shadow: inset 0 0 0 1px var(--plus-line); }
.plan-price { margin: 0; color: var(--text-muted); }
.plan-price strong { font-size: 1.5rem; color: var(--text); }
.plan-or { margin: 0 4px; }
.nowrap { white-space: nowrap; }
.plan-includes { margin: 0; font-weight: 600; }
.plan-features { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.plan-features li { display: flex; align-items: flex-start; gap: var(--s2); }
.plan-features svg { flex: none; margin-top: 3px; color: var(--ok); }
.plan-foot { margin-top: auto; display: grid; gap: var(--s2); padding-top: var(--s2); }
.plan-foot .inline { display: block; }
.plan-foot p { margin: 0; }
