/* Guruji — minimal. White, near-black ink, one hairline system, lots of air.
   No configuration screens; the app just hands you the one thing and a timer. */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f8;
  --bg-card: #ffffff;
  --line: #ececee;
  --line-soft: #f4f4f5;
  --text: #101114;
  --text-dim: #6b7076;
  --text-faint: #a9acb2;

  /* mode accents — restrained, only used as small marks */
  --desk: #3b5bd9;
  --transit: #0f9d6b;
  --wind: #d98324;

  --accent: #101114;   /* primary action = ink */
  --danger: #c2483d;
  --ok: #0f9d6b;

  --radius: 16px;
  --radius-sm: 11px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 52px; /* height of the fixed bottom nav; content reserves this below */
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overscroll-behavior-y: none; }

.app { display: flex; flex-direction: column; min-height: 100%; }

/* Boot splash — a calm branded loading state while the app initialises. */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  background: var(--bg);
  transition: opacity .45s ease;
  pointer-events: none; /* purely decorative — never intercept taps */
}
.splash.hide { opacity: 0; }
.splash-mark {
  font-size: 27px; font-weight: 700; letter-spacing: -.01em; color: var(--text);
  animation: splashBreath 1.5s ease-in-out infinite;
}
.splash-bar { width: 128px; height: 3px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; }
.splash-bar span {
  display: block; height: 100%; width: 42%; border-radius: 3px; background: var(--accent);
  animation: splashSlide 1.15s cubic-bezier(.65,0,.35,1) infinite;
}
@keyframes splashBreath { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes splashSlide { 0% { transform: translateX(-115%); } 100% { transform: translateX(320%); } }
@media (prefers-reduced-motion: reduce) {
  .splash-mark, .splash-bar span, .iv-bar span { animation: none; }
}

/* Import veil — visible progress while a file loads / a schema upgrade runs. */
.import-veil {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 0 34px; text-align: center;
  background: var(--bg); opacity: 0; transition: opacity .25s ease;
}
.import-veil.show { opacity: 1; }
.import-veil:not(.show) { pointer-events: none; } /* don't intercept taps while fading out */
.iv-bar { width: 132px; height: 3px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; }
.iv-bar span { display: block; height: 100%; width: 42%; border-radius: 3px; background: var(--accent); animation: splashSlide 1.15s cubic-bezier(.65,0,.35,1) infinite; }
.iv-main { font-size: 16px; font-weight: 650; color: var(--text); }
.iv-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; max-width: 320px; }
.iv-steps li { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.iv-steps li::before { content: '✓ '; color: var(--accent); font-weight: 700; }

/* ---------- Top bar (brand + quiet Data action) ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: calc(var(--safe-top) + 16px) 24px 4px;
}
.brand { font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.topbar-action {
  font-size: 13px; color: var(--text-faint); text-decoration: none; padding: 6px 2px;
  transition: color .15s;
}
.topbar-action.active, .topbar-action:hover { color: var(--text); }

/* [hidden] must beat the explicit display:flex on chrome for chromeless views */
.topbar[hidden], .nav[hidden] { display: none; }

.view {
  flex: 1; width: 100%; max-width: 560px;
  margin: 0 auto;
  /* reserve room for the fixed bottom nav so the last content clears it */
  padding: 8px 24px calc(24px + var(--nav-h) + var(--safe-bottom));
}

/* ---------- Bottom nav ---------- */
/* Fixed, not sticky: iOS Safari mis-paints a `position: sticky; bottom: 0`
   bar with a backdrop-filter during momentum scroll — it detaches and drifts.
   A fixed bar is rock-solid; the `.view` above reserves matching space. */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; justify-content: center; gap: 28px;
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 12px 12px calc(12px + var(--safe-bottom));
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.nav-item {
  font-size: 12px; letter-spacing: .04em;
  color: var(--text-faint); text-decoration: none;
  padding: 6px 4px; transition: color .15s;
}
.nav-item.active { color: var(--text); }
/* Extra module tabs only earn their place on the wide desktop nav; on the phone
   they'd overflow the bar, so they stay in the Now dashboard's quick row. */
.nav-desktop { display: none; }
/* Plan is the phone's tab into the readable study guides; the desktop omits it. */
.nav-mobile { display: inline-block; }

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 12px;
}
h1 { font-size: 27px; font-weight: 650; margin: 0 0 6px; letter-spacing: -.025em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; letter-spacing: -.01em; }
p  { color: var(--text-dim); line-height: 1.55; }
.muted { color: var(--text-faint); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--line);
  background: #fff; color: var(--text);
  font: inherit; font-weight: 550;
  padding: 12px 18px; border-radius: var(--radius-sm);
  cursor: pointer; touch-action: manipulation;
  transition: transform .08s, background .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 620; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 24px; font-size: 16px; }

/* ---------- Cards ---------- */
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

/* ---------- Now / dashboard ---------- */
.now-wrap { min-height: 66vh; display: flex; flex-direction: column; justify-content: center; }

/* the coach's verdict — the decisive call, stated first */
.verdict {
  font-size: 31px; font-weight: 680; line-height: 1.12;
  letter-spacing: -.03em; color: var(--text);
  margin: 0 0 10px; max-width: 16ch;
}

/* the reasoning behind the call */
.coach {
  font-size: 16px; line-height: 1.5; font-weight: 500;
  letter-spacing: -.01em; color: var(--text-dim);
  margin: 0 0 24px; max-width: 30ch;
}

.ctx { display: flex; gap: 8px; margin-bottom: 26px; }
.areas { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 28px; }
.areas[hidden] { display: none; }
.ctx-chip {
  appearance: none; cursor: pointer;
  background: transparent; border: 1px solid var(--line);
  color: var(--text-dim); font: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: border-color .15s, color .15s, background .15s;
}
.ctx-chip .d { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }
.ctx-chip .d.DESK { background: var(--desk); }
.ctx-chip .d.TRANSIT { background: var(--transit); }
.ctx-chip .d.WIND_DOWN { background: var(--wind); }
.ctx-chip.on { border-color: var(--text); color: var(--text); background: var(--bg-soft); }

.hero { margin-bottom: 30px; }
.hero .title {
  font-size: 27px; line-height: 1.25; font-weight: 650;
  letter-spacing: -.025em; margin: 0 0 10px; color: var(--text);
}
.hero .meta { color: var(--text-faint); font-size: 14px; margin: 0; }

.dur-label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.dur { display: flex; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.dur-chip {
  appearance: none; cursor: pointer;
  background: transparent; border: 1px solid var(--line);
  color: var(--text-dim); font: inherit; font-size: 15px; font-weight: 550;
  padding: 12px 0; border-radius: var(--radius-sm);
  flex: 1; min-width: 64px; text-align: center;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, color .15s, background .15s;
}
.dur-chip.on { border-color: var(--text); color: var(--text); background: var(--bg-soft); }

.now-foot { text-align: center; margin-top: 26px; }

/* Two quiet secondary actions under the primary CTA. */
/* "Something else" — the contextual area switcher, right under the CTA. */
.now-switch-row { margin-top: 15px; }
.secondary-link { appearance: none; background: none; border: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--text-faint); padding: 0; transition: color .15s; }
.secondary-link:hover { color: var(--text-dim); }
.now-sep { color: var(--line); font-size: 13px; }

/* Quick-access bar — the app's other surfaces, evenly spread so it never wraps,
   set off from the hero by its own hairline. */
.now-quick {
  display: flex; gap: 4px; margin-top: 26px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.now-quick-item {
  flex: 1 1 0; min-width: 0; appearance: none; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 12.5px; letter-spacing: .01em; color: var(--text-dim);
  padding: 8px 2px; text-align: center; border-radius: 9px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.now-quick-item:hover { background: var(--bg-soft); color: var(--text); }
.now-quick-item:active { background: var(--bg-soft); }

/* Cognitive-load gauge — quiet, reinforces quality over quantity. */
.cog { margin-top: 30px; }
.cog-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.cog-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.cog-pct { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cog-track { height: 5px; background: var(--line); border-radius: 5px; overflow: hidden; }
.cog-fill { height: 100%; border-radius: 5px; background: var(--cog, var(--text-dim)); transition: width .5s ease, background .3s; }
.cog.tone-low  { --cog: #0f9d6b; }
.cog.tone-mid  { --cog: #6b8afd; }
.cog.tone-high { --cog: #d98324; }
.cog.tone-max  { --cog: #c2483d; }

/* life-context: collapsed to one line, expands to chips on tap */
.ctx-summary { appearance: none; background: none; border: none; cursor: pointer; font: inherit; font-size: 12px; color: var(--text-faint); padding: 0; margin-top: 11px; display: inline-flex; align-items: center; gap: 5px; transition: color .15s; }
.ctx-summary:hover { color: var(--text-dim); }
.ctx-caret { font-size: 13px; }
.ctxchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ctxchips[hidden] { display: none; }
.ctxchip { appearance: none; background: transparent; border: 1px solid var(--line); color: var(--text-faint); font: inherit; font-size: 12px; padding: 5px 11px; border-radius: 999px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.ctxchip.on { border-color: var(--text); color: var(--text); background: var(--bg-soft); }

/* capacity gate */
.gate-note { font-size: 13px; color: #c98a2e; margin-bottom: 10px; line-height: 1.45; }
.btn-link { display: block; width: 100%; text-align: center; background: none; border: none; color: var(--text-dim); font: inherit; font-size: 13px; padding: 12px 0 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--text); }

/* ---------- Day / adaptive schedule ---------- */
.day-wrap { padding-top: 4px; }
.day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.day-nav { appearance: none; background: transparent; border: 1px solid var(--line); color: var(--text-dim); width: 38px; height: 38px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; transition: border-color .15s, color .15s; }
.day-nav:hover { border-color: var(--text-faint); color: var(--text); }
.day-title { text-align: center; }
.day-rel { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.day-date { font-size: 12px; color: var(--text-faint); letter-spacing: .04em; }

.timeline { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.day-empty { padding: 22px 2px; }

/* a study session — soft and warm, accented with the area's palette colour,
   no boxy borders; the area is the hero, the time a quiet subline. */
.blk { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 15px 16px 13px 20px; border-radius: 16px; background: var(--bg-soft); transition: opacity .2s, box-shadow .15s; animation: swapIn .28s ease both; }
.blk::before { content: ''; position: absolute; left: 7px; top: 15px; bottom: 15px; width: 3px; border-radius: 3px; background: var(--accent, var(--text-faint)); }
.blk.m-DESK { --accent: var(--desk); }
.blk.m-TRANSIT { --accent: var(--transit); }
.blk.m-WIND_DOWN { --accent: var(--wind); }
.blk.done { opacity: .48; }
.blk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.blk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.blk-arearow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.blk-area { font-size: 17px; font-weight: 620; letter-spacing: -.02em; color: var(--text); }
.blk-commute { font-size: 11px; font-weight: 600; color: var(--transit); background: rgba(15,157,107,.12); padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; }
/* Session-intensity badge: Light for drained / low-capacity times, Deep for
   fresh, longer sittings. Tells you what a block expects at a glance. */
.blk-badge { font-size: 11px; font-weight: 650; padding: 2px 9px; border-radius: 999px; letter-spacing: .02em; }
.blk-badge.b-light { color: var(--wind, #d98324); background: rgba(217,131,36,.13); }
.blk-badge.b-deep { color: var(--desk, #3b5bd9); background: rgba(59,91,217,.12); }
.blk-dur { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.blk-dur.has-studied { color: var(--text-dim); }
.blk-studied { font-weight: 700; color: var(--accent, var(--text)); }
.blk-when { display: flex; align-items: center; gap: 6px; margin: 2px 0 11px; }
.blk-time { appearance: none; background: none; border: none; padding: 0; color: var(--text-dim); font: inherit; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.blk-time:disabled { color: var(--text-faint); opacity: 1; }
.blk-time::-webkit-calendar-picker-indicator { display: none; }
.blk-time::-webkit-date-and-time-value { text-align: left; margin: 0; padding: 0; }
.blk-time-end { color: var(--text-faint); }
.blk-dash { font-size: 14px; color: var(--text-faint); }
/* Action toolbar — set apart from the block's content by a hairline so the card
   reads as [what & when] over [do], not one wall of buttons. Generous tap
   targets; the one bright pill (Start) leads, destructive Remove is pushed to
   the far edge on its own so a stray tap can't wipe a block. */
.blk-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.blk-start { appearance: none; cursor: pointer; background: var(--accent, var(--text)); color: #fff; border: none; font: inherit; font-size: 13px; font-weight: 600; padding: 8px 18px; border-radius: 999px; margin-right: 4px; transition: filter .15s; }
.blk-start:hover { filter: brightness(1.07); }
.blk-act { appearance: none; cursor: pointer; background: none; border: none; color: var(--text-dim); font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 9px; transition: color .15s, background .15s; }
.blk-act:hover { color: var(--text); background: var(--bg); }
.blk-x { margin-left: auto; color: var(--text-faint); }
.blk-x:hover { color: #c2483d; background: rgba(194,72,61,.08); }
.blk-delay-k { font-size: 12.5px; color: var(--text-faint); align-self: center; padding-right: 2px; }
.blk-delay { font-weight: 600; color: var(--text-dim); }
.blk-swap { font-weight: 600; color: var(--accent, var(--text-dim)); }
.blk-log-min { width: 52px; font: inherit; font-size: 13.5px; text-align: center; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; font-variant-numeric: tabular-nums; }
.blk-log-min:focus { outline: none; border-color: var(--text-dim); }
.blk-log-unit { font-size: 12.5px; color: var(--text-faint); align-self: center; }

.day-actions { display: flex; flex-direction: column; gap: 12px; }
.day-sub { display: flex; gap: 18px; justify-content: center; }
.day-inline { display: inline; width: auto; padding: 0; text-decoration: none; color: var(--text-faint); font-size: 13px; }
.day-inline:hover { color: var(--text); }
.add-form { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 12px; animation: swapIn .28s ease both; }
.add-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
.add-at { display: flex; align-items: center; gap: 8px; }

/* commitments (gym, walk…) — a quiet outline so study cards stand out */
/* Wrap when a commitment is packed (time + label + draining + actions) so the
   actions drop to a second line rather than squeezing the label onto two. */
.busy { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border: 1px dashed var(--line); border-radius: 16px; background: transparent; }
.busy-times { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.busy-time-in { appearance: none; background: none; border: none; padding: 0; color: var(--text-faint); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; width: auto; }
.busy-time-in::-webkit-calendar-picker-indicator { display: none; }
.busy-time-in::-webkit-date-and-time-value { text-align: left; margin: 0; padding: 0; }
.busy-dash { font-size: 13px; color: var(--text-faint); }
.busy-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 550; color: var(--text-dim); }
.busy-acts { margin-left: auto; display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.busy-done.on { color: var(--ok, #0f9d6b); font-weight: 650; }
.busy.done { opacity: .5; }
.busy.done .busy-label { text-decoration: line-through; }

/* a breather between study sessions */
.break-row { text-align: center; font-size: 11px; color: var(--text-faint); letter-spacing: .1em; padding: 4px 0; opacity: .8; }
.wake-row { text-align: center; font-size: 11px; color: var(--text-faint); letter-spacing: .14em; text-transform: uppercase; padding: 2px 0 6px; opacity: .75; }
.sync-status { font-size: 12.5px; color: var(--text-faint); margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.gist-steps { margin: 8px 0 12px; padding-left: 20px; color: var(--text-dim); font-size: 13px; line-height: 1.55; }
.gist-steps li { margin-bottom: 6px; }
.gist-steps a { color: var(--accent, #3b5bd9); }
.gist-token { width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; padding: 11px 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); }
.reset-row { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: 13px; color: var(--text-dim); line-height: 1.45; cursor: pointer; }
.reset-row input { margin-top: 2px; flex: none; }
.plan-why { margin: 2px 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface, rgba(0,0,0,.03)); }
.plan-why-mix { font-size: 13px; font-weight: 600; color: var(--text-dim); letter-spacing: .01em; }
.plan-why-note { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--text-faint); }
.timeline { gap: 12px; }

.busy-drain { flex-shrink: 0; font-size: 11px; color: var(--wind); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }

/* the planning wizard — a few grouped steps, Next / Back */
.wizard { display: flex; flex-direction: column; gap: 22px; padding-top: 6px; animation: viewIn .3s ease both; }
.wz-top { text-align: center; }
.wz-step { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.wz-h { font-size: 24px; font-weight: 660; letter-spacing: -.02em; margin: 0; }
.wz-body { display: flex; flex-direction: column; gap: 24px; }
.wz-group { display: flex; flex-direction: column; gap: 11px; }
.wz-glabel { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.wz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-chip { appearance: none; cursor: pointer; background: transparent; border: 1px solid var(--line); color: var(--text-dim); font: inherit; font-size: 14px; font-weight: 500; padding: 9px 15px; border-radius: 999px; transition: border-color .15s, color .15s, background .15s; }
.wz-chip.on { border-color: var(--text); color: var(--text); background: var(--bg-soft); }
.wz-seg-wrap { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; align-self: flex-start; }
.wz-seg { appearance: none; cursor: pointer; background: transparent; border: none; color: var(--text-dim); font: inherit; font-size: 14px; font-weight: 550; padding: 9px 22px; transition: background .15s, color .15s; }
.wz-seg.on { background: var(--text); color: var(--bg); }
.wz-detail { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.wz-detail.hidden { display: none; }
.wz-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wz-rl { font-size: 14px; color: var(--text-dim); flex: none; }
.wz-select { appearance: auto; font: inherit; font-size: 14px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); flex: 1; min-width: 0; max-width: 62%; }
.wz-input { font: inherit; font-size: 15px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); width: 100%; }
.wz-time { appearance: none; font: inherit; font-size: 16px; font-weight: 600; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); }
.wz-time::-webkit-calendar-picker-indicator { display: none; }
.wz-note { font-size: 12.5px; color: var(--text-faint); line-height: 1.5; margin: 4px 0 0; }
.wz-inline { display: flex; }
.wz-dots { display: flex; justify-content: center; gap: 7px; }
.wz-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .2s; }
.wz-dot.on { background: var(--text); }
.wz-dot.done { background: var(--text-faint); }
.wz-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.wz-next { width: auto; min-width: 150px; }

/* the planning conversation — one open question, centered, no outer frame */
.journey { display: flex; flex-direction: column; justify-content: center; gap: 16px; min-height: 76vh; animation: swapIn .3s ease both; }
.q-title { font-size: 23px; font-weight: 650; letter-spacing: -.02em; margin: 0; text-align: center; }
.q-sub { font-size: 14px; color: var(--text-dim); line-height: 1.5; margin: -6px 0 6px; text-align: center; max-width: 34ch; align-self: center; }
.q-opts { display: flex; flex-direction: column; gap: 9px; }
.q-opt { appearance: none; cursor: pointer; text-align: center; background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 16px; font: inherit; font-size: 15px; font-weight: 550; color: var(--text); display: flex; justify-content: center; align-items: center; gap: 10px; transition: border-color .15s, background .15s; }
.q-opt:hover { border-color: var(--text-faint); background: var(--bg-soft); }
.q-opt.on { border-color: var(--text); background: var(--bg-soft); }
.q-opt-sub { color: var(--text-faint); font-size: 13px; font-weight: 400; }
.q-input { font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--text); text-align: center; }
.q-bedrow { display: flex; align-items: center; justify-content: center; gap: 10px; }
.q-recap { margin: 0 auto; padding: 0; list-style: none; text-align: center; color: var(--text-dim); font-size: 14px; line-height: 1.8; }
.q-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.q-back, .q-cancel { appearance: none; background: none; border: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--text-faint); padding: 4px 0; transition: color .15s; }
.q-back:hover, .q-cancel:hover { color: var(--text-dim); }

/* dashboard goal countdown — nonchalant, in the corner, never bold */
.goal-countdown { text-align: right; font-size: 11px; letter-spacing: .05em; color: var(--text-faint); margin-bottom: 12px; }

/* dashboard bedtime nudge — quiet, brightens as it nears */
.sleep-nudge { text-align: center; font-size: 12px; color: var(--text-faint); margin-top: 18px; letter-spacing: .02em; }
.sleep-nudge.soon { color: var(--wind); }
.sleep-main { font-size: 13px; font-weight: 550; }
.sleep-sub { font-size: 12px; color: var(--text-faint); margin-top: 4px; line-height: 1.45; }
.sleep-nudge.soon .sleep-sub { color: var(--text-dim); }

/* ---------- Reading practice ---------- */
.reading-wrap { display: flex; flex-direction: column; }
.r-title { font-size: 25px; font-weight: 660; letter-spacing: -.025em; margin: 0 0 2px; }
.r-author { color: var(--text-faint); font-size: 14px; margin: 0 0 20px; }
.r-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.r-input, .r-area { font: inherit; font-size: 15px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--text); width: 100%; }
.r-area { line-height: 1.5; resize: vertical; }
.r-input:focus, .r-area:focus { outline: none; border-color: var(--text-faint); }
.r-block { border-left: 2px solid var(--line); padding: 2px 0 2px 14px; margin: 18px 0 22px; }
.r-block-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.r-intent { font-size: 16px; line-height: 1.5; color: var(--text); margin: 0; }
.r-edit { display: inline; width: auto; padding: 6px 0 0; text-decoration: none; color: var(--text-faint); font-size: 13px; }
.r-edit:hover { color: var(--text-dim); }

.r-refs-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 12px; }
.r-refs-head h2 { margin: 0; }
.r-empty { line-height: 1.55; margin: 12px 0; }
.ref-form { margin-bottom: 8px; }
.ref-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-top: 10px; animation: swapIn .28s ease both; }
.ref-quote { font-size: 15px; font-style: italic; color: var(--text); line-height: 1.5; margin: 0 0 8px; }
.ref-thought-text { font-size: 15px; color: var(--text-dim); line-height: 1.55; margin: 0 0 8px; }
.ref-meta { display: flex; align-items: center; justify-content: space-between; }
.ref-meta .muted { font-size: 12px; }
.r-finish { display: block; width: 100%; text-align: center; background: none; border: none; color: var(--text-faint); font: inherit; font-size: 13px; padding: 22px 0 4px; cursor: pointer; }
.r-finish:hover { color: var(--text-dim); }

/* rating chips on the finish form */
.rate-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rate-chip { appearance: none; cursor: pointer; background: transparent; border: 1px solid var(--line); color: var(--text-dim); font: inherit; font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 999px; transition: border-color .15s, color .15s, background .15s; }
.rate-chip.on { border-color: var(--text); color: var(--text); background: var(--bg-soft); }

/* the shelf — finished books, a visible point of view */
.shelf { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 26px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; }
.shelf-head h2 { margin: 0; }
.shelf-sub { margin: 6px 0 16px; line-height: 1.5; }
.shelf-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-top: 12px; animation: swapIn .28s ease both; }
.shelf-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.shelf-title { font-size: 17px; font-weight: 620; letter-spacing: -.01em; line-height: 1.3; }
.shelf-author { font-size: 13px; color: var(--text-faint); margin-top: 2px; }
.shelf-rating { flex: none; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.shelf-rating.rate-loved { background: rgba(15,157,107,.12); color: #0f9d6b; }
.shelf-rating.rate-worth { background: rgba(59,91,217,.12); color: var(--desk); }
.shelf-rating.rate-skip { background: var(--bg-soft); color: var(--text-faint); }
.shelf-verdict { font-size: 15px; color: var(--text); line-height: 1.55; margin: 12px 0 0; }
.shelf-rec { font-size: 14px; color: var(--text-dim); line-height: 1.5; margin: 8px 0 0; }
.shelf-rec-k { color: var(--text-faint); text-transform: uppercase; font-size: 11px; letter-spacing: .1em; }
.shelf-toggle { appearance: none; background: none; border: none; cursor: pointer; color: var(--text-faint); font: inherit; font-size: 13px; padding: 12px 0 0; text-decoration: underline; text-underline-offset: 3px; }
.shelf-toggle:hover { color: var(--text-dim); }
.shelf-notes { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.shelf-note { border-left: 2px solid var(--line); padding-left: 12px; }
.shelf-note .ref-quote, .shelf-note .ref-thought-text { margin: 0 0 4px; font-size: 14px; }
.shelf-cardmeta { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.shelf-cardmeta .muted { font-size: 12px; }

/* prep: when it's bedtime, we don't offer a session */
.bedtime-block { margin-top: 6px; }
.bedtime-note { font-size: 15px; color: var(--text-dim); line-height: 1.5; margin-bottom: 16px; }

/* ---------- Empty / centered states ---------- */
.center-state {
  min-height: 62vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 10px;
}
.center-state p { max-width: 40ch; }

/* ---------- Focus session ---------- */
.focus {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: calc(var(--safe-top) + 24px) 26px calc(var(--safe-bottom) + 24px);
}
.focus .phase-label { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-faint); }
.focus .focus-title {
  font-size: 19px; font-weight: 550; color: var(--text-dim);
  max-width: 28ch; margin: 8px 0 30px; line-height: 1.4; letter-spacing: -.01em;
}
.focus .clock {
  font-size: clamp(66px, 23vw, 132px); font-weight: 300;
  font-variant-numeric: tabular-nums; letter-spacing: .01em; line-height: 1; color: var(--text);
}
.focus .clock.done { color: var(--ok); }
.focus .ritual {
  color: var(--text-dim); font-size: 16px; max-width: 30ch;
  margin: 26px 0 8px; line-height: 1.5; min-height: 3em;
  transition: opacity .35s ease;
}
/* Reading keeps its principles whisper-quiet; sprints state them plainly. */
.focus.env-read .ritual { color: #a9906c; font-size: 15px; }
.focus .focus-controls { display: flex; gap: 12px; margin-top: 22px; }

/* Coaching under the timer: the hero (timer) fills the first screen; the coach
   panel sits just below, scroll to read it while the clock runs. The resolve
   screen uses plain .focus (still centred). */
.focus.has-coach { justify-content: flex-start; overflow-y: auto; }
.focus-hero { width: 100%; min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.focus-coach { width: 100%; max-width: 460px; margin: 4px auto 0; padding-bottom: 28px; text-align: left; }
.focus-coach .fc-head { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.focus-coach .fc-steps { margin: 0 0 20px; padding-left: 22px; }
.focus-coach .fc-steps li { color: var(--text-dim); font-size: 14px; line-height: 1.55; margin-bottom: 9px; }
.focus-coach .fc-steps li::marker { color: var(--env, var(--text-faint)); font-weight: 700; }
.focus-coach .fc-sub { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 9px; }
.focus-coach .fc-res { margin: 0; padding: 0; list-style: none; }
.focus-coach .fc-res li { position: relative; color: var(--text-dim); font-size: 13.5px; line-height: 1.5; margin-bottom: 8px; padding-left: 16px; }
.focus-coach .fc-res li::before { content: '›'; position: absolute; left: 0; color: var(--env, var(--text-faint)); font-weight: 700; }

/* Session expectations — a checklist you tick as you meet each one. The first
   unmet one is highlighted as "now"; met ones dim and strike through. */
.focus-coach .fc-obj-box { margin-bottom: 24px; }
.focus-coach .fc-obj-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.focus-coach .fc-obj-top .fc-head { margin-bottom: 0; }
.focus-coach .fc-obj-count { font-size: 12.5px; font-weight: 700; color: var(--env, var(--text-dim)); font-variant-numeric: tabular-nums; }
.focus-coach .fc-obj-count.all { color: var(--ok, #0f9d6b); }
.focus-coach .fc-obj { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-radius: 10px; padding: 11px 10px; margin: 0 0 2px; cursor: pointer; font: inherit; color: var(--text-dim); transition: background .15s, color .15s; }
.focus-coach .fc-obj:hover { background: rgba(127,127,127,.08); }
.focus-coach .fc-obj-mark { flex: 0 0 auto; width: 18px; text-align: center; font-weight: 800; color: var(--text-faint); }
.focus-coach .fc-obj-text { flex: 1; font-size: 14px; line-height: 1.5; }
.focus-coach .fc-obj.current { background: rgba(127,127,127,.10); }
.focus-coach .fc-obj.current .fc-obj-mark { color: var(--env, var(--text)); }
.focus-coach .fc-obj.current .fc-obj-text { color: var(--text); font-weight: 600; }
.focus-coach .fc-obj.met .fc-obj-mark { color: var(--ok, #0f9d6b); }
.focus-coach .fc-obj.met .fc-obj-text { color: var(--text-faint); text-decoration: line-through; }
.focus-coach .fc-obj-note { font-size: 12.5px; color: var(--text-faint); line-height: 1.5; margin: 8px 2px 0; }
.focus-coach .fc-obj-note.done { color: var(--ok, #0f9d6b); font-weight: 600; }
.focus-coach .fc-head-sub { margin-top: 4px; }
/* End-of-session confirm: the checklist, centred on the wrap-up screen. */
.resolve-confirm { max-width: 340px; margin: 0 auto 20px; }
.resolve-confirm .fc-obj-box { margin-bottom: 0; }

/* Day block: the "Goals N/M" progress badge on the expectations action. */
.blk-goals-n { color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* Prep screen: expectations disclosed before you begin. */
.prep-obj { margin: 6px 0 18px; padding: 14px 16px; border-radius: 14px; background: var(--bg-soft); }
.prep-obj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.prep-obj-count { letter-spacing: 0; text-transform: none; font-weight: 650; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.prep-obj-list { list-style: none; margin: 0; padding: 0; }
.prep-obj-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--text-dim); margin-bottom: 7px; }
.prep-obj-list li.met { color: var(--text-faint); }
.prep-obj-mark { flex: 0 0 auto; color: var(--text-faint); font-weight: 700; }
.prep-obj-list li.met .prep-obj-mark { color: var(--ok, #0f9d6b); }

/* Objectives editor (Day view) — a bottom-sheet reusing the wizard shell. */
.oe-card .oe-sub { font-size: 13px; color: var(--text-dim); margin: -4px 0 14px; }
.oe-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.oe-row { display: flex; align-items: center; gap: 9px; }
.oe-check { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ok, #0f9d6b); font-size: 14px; font-weight: 800; line-height: 1; cursor: pointer; transition: border-color .15s, background .15s; }
.oe-check.on { border-color: var(--ok, #0f9d6b); background: rgba(15,157,107,.10); }
.oe-input { flex: 1; min-width: 0; font: inherit; font-size: 14.5px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.oe-input:focus { outline: none; border-color: var(--text-dim); }
.oe-del { flex: 0 0 auto; width: 30px; height: 30px; border: none; background: none; color: var(--text-faint); font-size: 14px; cursor: pointer; border-radius: 8px; }
.oe-del:hover { color: #c2483d; background: rgba(194,72,61,.08); }
.oe-add { width: 100%; text-align: left; background: none; border: 1px dashed var(--line); border-radius: 10px; color: var(--text-dim); font: inherit; font-size: 13.5px; padding: 10px 12px; cursor: pointer; margin-bottom: 16px; transition: border-color .15s, color .15s; }
.oe-add:hover { border-color: var(--text-faint); color: var(--text); }
/* Check-off mode: the live checklist reused inside the Day sheet. */
.oe-check-wrap { max-width: none; margin: 0; padding-bottom: 0; }
.oe-check-wrap .fc-obj-box { margin-bottom: 4px; }
.oe-check-wrap .fc-obj-top .fc-head { color: var(--text-faint); }
.oe-body { min-height: 44px; }
.oe-controls { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.oe-mode { background: none; border: none; color: var(--text-dim); font: inherit; font-size: 13px; padding: 11px; cursor: pointer; text-align: center; }
.oe-mode:hover { color: var(--text); }

/* ---------- Focus environments (one room per area) ---------- */
/* DSA — a sharp sprint: cool, crisp, a depleting bar. */
.focus.env-dsa { background: #f6f8fc; --env: #3b5bd9; }
.focus.env-dsa .phase-label { color: #8b93b4; }
.focus.env-dsa .clock { color: #141a2e; }

/* System Design — spacious thinking space: a slow breathing ring. */
.focus.env-sys { background: #f2faf6; --env: #0f9d6b; }
.focus.env-sys .phase-label { color: #6fae94; }

/* Reading — warm and quiet: soft tone, gentle breath, no ticking bar. */
.focus.env-read { background: #faf5ec; --env: #c98a2e; }
.focus.env-read .phase-label { color: #b39468; }
.focus.env-read .focus-title { color: #6b5c48; }
.focus.env-read .clock { color: #3a3026; font-weight: 250; }
.focus.env-read .ritual { color: #a9906c; }

/* Behavioral + Applications — subtle tints, sprint bar. */
.focus.env-beh { background: #faf6f8; --env: #b5527e; }
.focus.env-app { background: #f5faf9; --env: #2f8f8a; }
.focus.env-default { --env: var(--text); }

/* depleting sprint bar */
.env-barwrap { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.env-bar { width: min(72vw, 320px); height: 3px; background: rgba(0,0,0,.08); border-radius: 3px; overflow: hidden; }
.env-bar-fill { height: 100%; width: 100%; background: var(--env, #111); border-radius: 3px; transition: width 1s linear; }

/* breathing ring (System Design) */
.env-ring {
  display: flex; align-items: center; justify-content: center;
  width: min(72vw, 300px); height: min(72vw, 300px);
  border-radius: 50%; border: 2px solid rgba(15,157,107,.30);
  animation: breathe 6s ease-in-out infinite;
}

/* warm breath (Reading) */
.env-calm { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.env-breath { width: 12px; height: 12px; border-radius: 50%; background: #c98a2e; animation: breathe 5s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { transform: scale(.94); opacity: .55; }
  50%      { transform: scale(1.05); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .env-ring, .env-breath { animation: none; }
}

/* ---------- Prep (drill-in before the timer) ---------- */
.prep { padding-top: calc(var(--safe-top) + 8px); max-width: 460px; margin: 0 auto; }
.prep-back { background: none; border: none; color: var(--text-faint); font: inherit; font-size: 14px; cursor: pointer; padding: 6px 0; margin-bottom: 22px; }
.prep-back:hover { color: var(--text); }
.prep-lead { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 8px; }
.prep-title { font-size: 26px; line-height: 1.25; font-weight: 650; letter-spacing: -.02em; margin: 0 0 14px; }
.prep-how-meta { font-size: 13px; color: var(--text-dim); margin: 0 0 4px; }
.prep-how { font-size: 15px; color: var(--text-dim); line-height: 1.5; margin: 0 0 26px; }
.prep-ritual { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; margin-bottom: 26px; }
.prep-ritual-head { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 12px; }
.prep-ritual ul { margin: 0; padding: 0; list-style: none; }
.prep-ritual li { position: relative; padding-left: 22px; color: var(--text); font-size: 15px; line-height: 1.5; margin-bottom: 9px; }
.prep-ritual li:last-child { margin-bottom: 0; }
.prep-ritual li::before { content: ''; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--text); }

/* ---------- Plan list ---------- */
.plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.progress-track { height: 3px; background: var(--line); border-radius: 3px; margin: 16px 0 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--text); border-radius: 3px; }

/* Plan header + List/Map toggle */
.plan-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.plan-top h1 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-btn { background: transparent; border: none; font: inherit; font-size: 13px; color: var(--text-faint); padding: 7px 15px; cursor: pointer; }
.seg-btn.on { background: var(--text); color: #fff; }

/* DAG map */
.dag-detail:not(.active) { color: var(--text-faint); font-size: 13px; padding: 2px 0; }
.dag-detail.active {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 4px; background: var(--bg-card);
}
.dag-detail-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.dag-detail-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.dag-scroll {
  overflow: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-soft); margin-top: 8px; max-height: 68vh;
}
.dag-svg { display: block; }
.dag-edge { fill: none; stroke: #d6d9de; stroke-width: 1.5; }
.dag-edge.hot { stroke: var(--text); stroke-width: 2; }
.dag-rect { fill: #fff; stroke: var(--line); stroke-width: 1.5; }
.dag-rect.done { fill: #eef0f2; stroke: #e2e4e8; }
.dag-rect.skipped { fill: #f4f4f5; stroke: #e7e7e9; }
.dag-rect.locked { stroke-dasharray: 3 3; }
.dag-rect.sel { stroke: var(--text); stroke-width: 2.5; }
.dag-text { font-size: 11px; fill: var(--text); }
.dag-node.done .dag-text, .dag-node.skipped .dag-text, .dag-node.locked .dag-text { fill: var(--text-faint); }

/* area overview nodes + zoom header */
.area-rect { fill: #fff; stroke-width: 2; }
.area-name { font-size: 13px; font-weight: 650; fill: var(--text); }
.area-sub { font-size: 11px; fill: var(--text-faint); }
.dag-head { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; }
.dag-head-title { flex: 1; font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.crumbs { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: wrap; }
.crumb { background: none; border: none; font: inherit; font-size: 14px; color: var(--text-faint); cursor: pointer; padding: 2px 0; }
.crumb.cur { color: var(--text); font-weight: 650; }
.crumb:disabled { cursor: default; }
.crumb-sep { color: var(--text-faint); font-size: 13px; }
.seg-btn.back { border: 1px solid var(--line); border-radius: 9px; color: var(--text); padding: 7px 12px; }
.zoom-ctl { display: flex; gap: 6px; }
.zoom-btn { width: 36px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 17px; line-height: 1; cursor: pointer; color: var(--text); }
.zoom-btn:active { background: var(--bg-soft); }

.plan-section { margin-bottom: 36px; }
.plan-name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.plan-name { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.plan-count { font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.phase-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin: 22px 0 2px; }
.phase-block { margin-bottom: 30px; }
.phase-block > h2 { margin-bottom: 6px; }
.plan-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 11px; padding: 15px 2px; border-bottom: 1px solid var(--line-soft); }

/* Area → Group hierarchy in the List view: an area band, then collapsible group
   headers so the plan reads as a map instead of one long list. */
.plan-area { display: flex; align-items: center; gap: 8px; margin: 18px 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
.plan-area-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.plan-group { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 12px 2px; margin: 0; font: inherit; color: var(--text); border-bottom: 1px solid var(--line-soft); border-radius: 10px; transition: background .15s; }
.plan-group:active { background: var(--bg-soft); }
.plan-group:hover { color: var(--text); }
.plan-group-chev { font-size: 10px; color: var(--text-faint); transition: transform .15s ease; }
.plan-group.open .plan-group-chev { transform: rotate(90deg); }
.plan-group-name { flex: 1; font-size: 14.5px; font-weight: 600; }
.plan-group-count { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.plan-group-items { padding-left: 16px; }

/* Content layer — desktop only. On the phone these never render, keeping it a
   lightweight tracker; the study material lives on the wide screen. */
.desktop-only { display: none; }
@media (min-width: 900px) { .desktop-only { display: revert; } }
.notes-btn.has-notes { color: var(--accent); font-weight: 650; }
.notes-btn.on { color: var(--text); }
.topic-notes { flex-basis: 100%; width: 100%; margin-top: 8px; }
.topic-notes-ta {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 140px;
  font: inherit; font-size: 14px; line-height: 1.6; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.topic-notes-ta:focus { outline: none; border-color: var(--text-dim); background: var(--bg); }
.plan-item.locked { opacity: .45; }
.pdot { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; flex: 0 0 auto; background: var(--text-faint); }
.pdot.DESK { background: var(--desk); }
.pdot.TRANSIT { background: var(--transit); }
.pdot.WIND_DOWN { background: var(--wind); }
.plan-item .body { flex: 1; min-width: 0; }
.plan-item .t { color: var(--text); font-size: 15px; line-height: 1.4; }
.plan-item.done .t { color: var(--text-faint); text-decoration: line-through; }
.plan-item.skipped .t { color: var(--text-faint); }
.plan-item .sub { font-size: 12px; color: var(--text-faint); margin-top: 3px; }
.plan-item .row-actions { display: flex; gap: 4px; flex-shrink: 0; }
/* ---------- Path · "This week" focus mode ---------- */
.road-seg { margin: 2px 0 18px; }
.tw-head { margin-bottom: 22px; }
.tw-week { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tw-week-n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.tw-week-win { font-size: 13px; color: var(--text-faint); }
.tw-focus { font-size: 15px; font-weight: 600; color: var(--text); margin-top: 6px; }
.tw-verdict { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; padding: 6px 12px; border-radius: 999px; }
.tw-verdict.ok { background: rgba(15,157,107,.12); color: #0f9d6b; }
.tw-verdict.behind { background: rgba(194,72,61,.12); color: #c2483d; }
.tw-verdict-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tw-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tw-count { font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
/* Week-at-a-glance progress bar (solved + attempted this week) */
.tw-prog { margin: 2px 0 22px; }
.tw-prog-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.tw-prog-l { font-size: 13.5px; font-weight: 600; color: var(--text); }
.tw-prog-v { font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.tw-prog-v b { color: var(--text); font-size: 14px; }
.tw-prog-track { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: var(--bg-soft); }
.tw-prog-fill { height: 100%; }
.tw-prog-fill.done { background: var(--ok, #0f9d6b); }
.tw-prog-fill.att { background: #c98a2e; opacity: .5; }
/* Concept groups — collapsible; tap the header to reveal the problems */
.tw-concept { margin-bottom: 4px; }
.tw-concept-top {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--line-soft);
  padding: 12px 2px; font: inherit; color: var(--text); cursor: pointer;
}
.tw-concept-top:active { background: var(--bg-soft); }
.tw-chev { flex: 0 0 auto; font-size: 11px; color: var(--text-faint); transition: transform .15s ease; }
.tw-concept.open .tw-chev { transform: rotate(90deg); }
.tw-concept-name { font-size: 15px; font-weight: 700; color: var(--text); }
.tw-concept-tag { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.tw-concept-tag.studied { color: #0f9d6b; border-color: rgba(15,157,107,.4); }
.tw-concept-mini { margin-left: auto; font-size: 12.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.tw-concept-body { display: none; padding: 2px 0 10px; }
.tw-concept.open .tw-concept-body { display: block; }
/* Non-editable status rows — a mirror of what you logged. */
.tw-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  border-bottom: 1px solid var(--line-soft); padding: 11px 2px; font-size: 14.5px;
}
.tw-mark { flex: 0 0 auto; width: 18px; text-align: center; font-size: 15px; line-height: 1; color: var(--text-faint); }
.tw-item-t { flex: 1; min-width: 0; color: var(--text); }
.tw-item .lc-diff, .tw-item .tw-mini-link { flex: 0 0 auto; }
.tw-item.st-completed .tw-mark { color: var(--ok, #0f9d6b); }
.tw-item.st-completed .tw-item-t { color: var(--text-faint); }
.tw-item.st-attempted .tw-mark { color: #c98a2e; }
.tw-item.st-none .tw-item-t { color: var(--text-faint); }
.tw-mini-link { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 12px; color: var(--text-faint); cursor: pointer; }
.tw-mini-link:active { background: var(--bg-soft); }
.tw-extra { font-size: 12.5px; color: var(--text-faint); margin: 4px 2px 0; }
.tw-note { font-size: 13px; color: var(--text-faint); margin-top: 6px; }
/* Repetition tiles */
.tw-reps { display: flex; gap: 12px; }
.tw-rep { flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; background: var(--bg-soft); border: none; border-radius: 14px; padding: 14px 16px; cursor: pointer; font: inherit; }
.tw-rep:active { opacity: .85; }
.tw-rep-n { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.tw-rep-l { font-size: 12.5px; color: var(--text-faint); }

/* ---------- Mobile topic reader (read-only study guide) ---------- */
.topic-reader { animation: viewIn .3s ease both; padding-bottom: 24px; }
.topic-back { appearance: none; background: none; border: none; color: var(--text-faint); font-size: 14px; cursor: pointer; padding: 6px 0; margin-bottom: 4px; }
.topic-back:hover { color: var(--text); }
.topic-eyebrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 12px; color: var(--text-faint); }
.topic-area { color: var(--text-dim); font-weight: 650; }
.topic-reader-title { font-size: 23px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; margin: 6px 0 16px; }
.topic-empty { color: var(--text-faint); padding: 20px 0; }
.topic-empty p { margin: 0 0 6px; }
.read-dot { color: var(--accent, #3b5bd9); font-weight: 700; }
.plan-item .body-read { display: block; width: 100%; text-align: left; background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
/* Content styling for the reader — scoped so the desktop study pane is untouched. */
.topic-reader .study-content { font-size: 15.5px; line-height: 1.7; color: var(--text-dim); }
.topic-reader .study-content h2 { font-size: 19px; color: var(--text); margin: 24px 0 8px; letter-spacing: -.01em; line-height: 1.3; }
.topic-reader .study-content h3 { font-size: 16px; color: var(--text); margin: 20px 0 6px; }
.topic-reader .study-content h4 { font-size: 14px; color: var(--text); margin: 15px 0 4px; }
.topic-reader .study-content p { margin: 0 0 12px; }
.topic-reader .study-content ul, .topic-reader .study-content ol { margin: 0 0 14px; padding-left: 20px; }
.topic-reader .study-content li { margin: 5px 0; }
.topic-reader .study-content strong { color: var(--text); }
.topic-reader .study-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; color: var(--text); overflow-wrap: anywhere; }
.topic-reader .study-content pre { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 14px; }
.topic-reader .study-content pre code { background: none; padding: 0; font-size: 12.5px; line-height: 1.55; white-space: pre; overflow-wrap: normal; }
.topic-reader .study-content table { border-collapse: collapse; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 15px; font-size: 13.5px; }
.topic-reader .study-content th, .topic-reader .study-content td { border: 1px solid var(--line); padding: 6px 12px; text-align: left; }
.topic-reader .study-content th { background: var(--bg-soft); color: var(--text); font-weight: 650; white-space: nowrap; }
.topic-reader .study-content td { color: var(--text-dim); }

/* ---------- Plan topic search ---------- */
.plan-search-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 14px; }
.plan-search {
  flex: 1; box-sizing: border-box; font: inherit; font-size: 14.5px;
  padding: 11px 14px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.plan-search:focus { outline: none; border-color: var(--text-dim); background: var(--bg); }
.plan-search::placeholder { color: var(--text-faint); }
.plan-search-x { appearance: none; background: none; border: none; color: var(--text-faint); font-size: 15px; cursor: pointer; padding: 6px 8px; }
.plan-search-x:hover { color: var(--text); }
.plan-search-head { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); margin: 2px 0 10px; }
.plan-search-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 6px; border: none; background: none; border-bottom: 1px solid var(--line-soft);
  font: inherit; color: var(--text);
}
.plan-search-item.clickable { cursor: pointer; border-radius: 10px; transition: background .12s; }
.plan-search-item.clickable:hover { background: var(--bg-soft); }
.psi-body { flex: 1; min-width: 0; }
.psi-title { font-size: 14.5px; line-height: 1.35; }
.psi-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.psi-guide { color: var(--accent, #3b5bd9); font-weight: 700; flex: 0 0 auto; }
.psi-status { font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--text-faint); flex: 0 0 auto; }
.psi-status.s-done { color: var(--ok, #0f9d6b); }
.psi-status.s-skipped { color: var(--text-faint); text-decoration: line-through; }

.mini-btn { font-size: 12.5px; padding: 8px 12px; border-radius: 9px; border: none; background: transparent; color: var(--text-faint); cursor: pointer; transition: color .15s, background .15s; }
.mini-btn:hover { color: var(--text); background: var(--bg-soft); }
.mini-btn.active-done { color: var(--text); font-weight: 650; }
.mini-btn.active-skip { color: var(--text); }
.mini-btn.mini-undo { color: var(--accent, #3b5bd9); border: 1px solid currentColor; padding: 5px 9px; }
.plan-reset-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 14px; font-size: 12.5px; }
.plan-reset-row .btn-link { color: var(--accent); font-weight: 600; }

/* ---------- Data (import/export) ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
textarea {
  width: 100%; min-height: 140px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: vertical;
}
input[type="file"] { color: var(--text-dim); font-size: 14px; }
.llm-out { margin-top: 12px; min-height: 180px; font-size: 12px; line-height: 1.5; white-space: pre; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom));
  transform: translateX(-50%) translateY(10px);
  background: var(--text); color: #fff;
  padding: 11px 18px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 200; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.diag-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--line-soft); }
.diag-k { color: var(--text-faint); }
.diag-v { color: var(--text-dim); font-variant-numeric: tabular-nums; text-align: right; }
.diag-v.diag-warn { color: var(--wind, #d98324); font-weight: 700; }

/* ---------- Motion ---------- */
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.swap { animation: swapIn .28s ease both; }
.view.v-enter { animation: viewIn .26s ease both; }
.cta-wrap { display: block; }

.progress-fill { transition: width .5s ease; }
.plan-item, .dag-detail, .card { transition: background .15s ease; }

/* Desktop niceties (pointer devices only) */
@media (hover: hover) {
  .ctx-chip:hover { border-color: var(--text-faint); color: var(--text); }
  .dur-chip:hover { border-color: var(--text-faint); }
  .btn-ghost:hover { background: var(--bg-soft); }
  .btn-primary:hover { filter: brightness(1.08); }
  .nav-item:hover { color: var(--text-dim); }
  .seg-btn:hover:not(.on) { color: var(--text); }
  .plan-item:hover { background: var(--bg-soft); }
}

@media (prefers-reduced-motion: reduce) {
  .swap, .view.v-enter { animation: none !important; }
}

/* ---------- Desktop two-pane study view (Plan → List on wide screens) ------ */
@media (min-width: 900px) {
  .study {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    /* full-bleed: escape the 560px centered column, use the whole landscape */
    width: 100vw; position: relative; left: 50%; right: 50%;
    margin-left: -50vw; margin-right: -50vw;
    border-top: 1px solid var(--line-soft);
    min-height: 74vh; text-align: left;
  }
  .study-nav { border-right: 1px solid var(--line-soft); padding: 8px 14px 48px; max-height: 80vh; overflow-y: auto; }
  .study-plan { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); margin: 16px 6px 6px; }
  .study-phase { font-size: 11px; color: var(--text-faint); margin: 14px 6px 4px; }
  .study-area { display: flex; align-items: center; gap: 7px; margin: 12px 6px 3px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }
  .study-area-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
  .study-group { display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 6px 8px; border-radius: 8px; color: var(--text); font: inherit; font-size: 13px; }
  .study-group:hover { background: var(--bg-soft); }
  .study-group-chev { font-size: 9px; color: var(--text-faint); transition: transform .15s ease; }
  .study-group.open .study-group-chev { transform: rotate(90deg); }
  .study-group-name { flex: 1; font-weight: 600; }
  .study-group-count { font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
  .study-navrow { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 7px 8px 7px 20px; border-radius: 8px; color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.3; }
  .study-navrow:hover { background: var(--bg-soft); }
  .study-navrow.on { background: var(--bg-soft); font-weight: 600; }
  .study-navrow.locked { opacity: .5; }
  .study-navrow.s-done .study-navt { text-decoration: line-through; color: var(--text-faint); }
  .study-navt { flex: 1; min-width: 0; }
  .study-dot { color: var(--accent); font-weight: 700; }
  .study-main { padding: 28px 44px 72px; max-width: 860px; }
  .study-eyebrow { display: flex; gap: 10px; align-items: baseline; font-size: 12px; color: var(--text-faint); text-transform: capitalize; }
  .study-area { color: var(--text-dim); font-weight: 650; }
  .study-title { font-size: 27px; line-height: 1.2; margin: 8px 0 14px; letter-spacing: -.01em; color: var(--text); }
  .study-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
  .study-edit { margin-left: auto; color: var(--accent); font-weight: 600; }
  .study-editor { width: 100%; box-sizing: border-box; min-height: 62vh; resize: vertical; font: inherit; font-size: 14.5px; line-height: 1.7; color: var(--text); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
  .study-empty { color: var(--text-faint); padding: 26px 0; }
  .study-empty p { margin: 0 0 6px; }
  .study-content { font-size: 15.5px; line-height: 1.72; color: var(--text-dim); }
  .study-content h2 { font-size: 20px; color: var(--text); margin: 28px 0 8px; letter-spacing: -.01em; }
  .study-content h3 { font-size: 16px; color: var(--text); margin: 22px 0 6px; }
  .study-content h4 { font-size: 14px; color: var(--text); margin: 16px 0 4px; }
  .study-content p { margin: 0 0 13px; }
  .study-content ul, .study-content ol { margin: 0 0 15px; padding-left: 22px; }
  .study-content li { margin: 5px 0; }
  .study-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; color: var(--text); }
  .study-content pre { background: var(--bg-soft); border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0 0 15px; }
  .study-content pre code { background: none; padding: 0; font-size: 13px; line-height: 1.6; }
  .study-content strong { color: var(--text); }
}

/* Floating "snapshot to iCloud" button — reachable from any view, incl. focus */
.sync-fab {
  position: fixed; z-index: 150;
  right: 16px; bottom: calc(74px + var(--safe-bottom));
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-card); color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  transition: transform .1s ease, opacity .15s;
}
.sync-fab:active { transform: scale(.92); }
.sync-fab.busy { opacity: .45; }
@media (min-width: 900px) { .sync-fab { right: 22px; bottom: 22px; } }

/* "Studying now" live-timer banner in the desktop study pane */
.study-banner {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; margin-bottom: 18px;
  cursor: pointer; font: inherit; color: var(--text);
}
.study-banner .sb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: sbPulse 1.4s ease-in-out infinite; }
.study-banner.paused .sb-dot { background: var(--wind); animation: none; }
.study-banner .sb-label { font-size: 13px; font-weight: 600; }
.study-banner .sb-clock { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text-dim); }
@keyframes sbPulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .study-banner .sb-dot { animation: none; } }

/* ---------- Desktop chrome: align header + nav with the wide study view ---- */
@media (min-width: 900px) {
  /* Top bar spans the screen so the brand sits far-left, Data far-right,
     aligned with the study panes instead of floating in a 560px column. */
  .topbar { max-width: none; padding-left: 28px; padding-right: 28px; }

  /* Bottom nav becomes a clean solid full-width bar, not a translucent pill
     band cutting across the content. */
  .nav {
    max-width: none; gap: 30px;
    background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  /* Surface the modules as real tabs now that the bar spans the screen. */
  .nav-desktop { display: inline-block; }
  /* Plan stays off the desktop nav (opened from its own surfaces there). */
  .nav-mobile { display: none; }

  /* The Plan/study route runs edge-to-edge; align its own header rows with the
     panes (the study grid already full-bleeds itself). */
  .app[data-route="plan"] .view { max-width: none; padding-left: 0; padding-right: 0; }
  .app[data-route="plan"] .plan-top,
  .app[data-route="plan"] .plan-reset-row { padding-left: 28px; padding-right: 28px; }
  .app[data-route="plan"] .plan-top { margin-top: 4px; }
  .study-nav { padding-left: 20px; }
  /* leave room so the last rows clear the sticky bottom bar */
  .study-nav { padding-bottom: 96px; }
  .study-main { padding-bottom: 120px; }
}

/* study-guide tables */
@media (min-width: 900px) {
  .study-content table { border-collapse: collapse; margin: 0 0 16px; font-size: 14px; width: auto; }
  .study-content th, .study-content td { border: 1px solid var(--line); padding: 7px 14px; text-align: left; }
  .study-content th { background: var(--bg-soft); color: var(--text); font-weight: 650; }
  .study-content td { color: var(--text-dim); }
}

/* ---------- Effort feedback loop ---------- */
/* quiet dashboard strip */
.effort-strip { appearance: none; background: none; border: none; cursor: pointer; font: inherit; color: var(--text-faint); font-size: 13px; display: inline-flex; align-items: center; gap: 5px; margin-top: 18px; padding: 4px 0; align-self: flex-start; }
.effort-strip .effort-b { color: var(--text-dim); font-weight: 650; }
.effort-strip .effort-sep { margin: 0 3px; }
.effort-strip .effort-arrow { margin-left: 5px; }
.effort-strip:hover { color: var(--text-dim); }

/* Progress view */
.progress-wrap { padding-top: 6px; animation: viewIn .3s ease both; }
.prog-top { margin-bottom: 22px; }
.prog-total { display: flex; align-items: baseline; gap: 10px; }
.prog-total-num { font-size: 40px; font-weight: 700; letter-spacing: -.03em; color: var(--text); }
.prog-total-lbl { font-size: 14px; color: var(--text-faint); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 30px; }
.stat-tile { background: var(--bg-soft); border-radius: 14px; padding: 14px 10px; text-align: center; }
.stat-num { font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.stat-lbl { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.prog-section { margin-bottom: 30px; }
/* LeetCode dashboard blocks on Progress. */
/* The goal bar — progress toward the aggressive target, sitting right under the
   distinct-solved headline. */
.lc-goal { margin: 16px 0 4px; }
.lc-goal-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.lc-goal-lbl { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.lc-goal-num { font-size: 13px; font-weight: 650; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.lc-goal .adhere-fill { background: var(--desk, #3b5bd9); }
.lc-goal-note { font-size: 12.5px; color: var(--text-faint); line-height: 1.5; margin-top: 2px; }
.lc-goal-sub { font-size: 12px; color: var(--text-faint); margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.prog-sub { margin-top: 20px; }
.prog-subh { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 10px; }
.lc-diff-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.lc-diff { font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 4px 12px; font-variant-numeric: tabular-nums; }
.lc-diff.d-easy { color: #0f9d6b; background: rgba(15,157,107,.12); }
.lc-diff.d-medium { color: #c98a2e; background: rgba(201,138,46,.14); }
.lc-diff.d-hard { color: #c2483d; background: rgba(194,72,61,.12); }
.bar-val { font-size: 10px; color: var(--text-faint); font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.lc-plist { display: flex; flex-direction: column; }
.lc-prow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.lc-pmain { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lc-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--text-faint); }
.lc-dot.o-solved { background: #0f9d6b; }
.lc-dot.o-hint { background: #c98a2e; }
.lc-dot.o-stuck { background: #c2483d; }
.lc-pname { color: var(--text); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-pmeta { color: var(--text-faint); font-size: 12px; flex-shrink: 0; }

/* LeetCode wizard overlay. */
.lc-overlay { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(16,17,20,.42); opacity: 0; transition: opacity .2s ease; padding: 0; }
.lc-overlay.show { opacity: 1; }
.lc-card { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--bg);
  border-radius: 20px 20px 0 0; padding: 18px 20px calc(20px + var(--safe-bottom));
  transform: translateY(12px); transition: transform .2s ease; }
.lc-overlay.show .lc-card { transform: translateY(0); }
@media (min-width: 600px) { .lc-overlay { align-items: center; } .lc-card { border-radius: 18px; } }
.lc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.lc-title { font-size: 17px; font-weight: 650; }
.lc-close { appearance: none; background: none; border: none; font-size: 18px; color: var(--text-faint); cursor: pointer; padding: 4px 8px; }
.lc-list { display: flex; flex-direction: column; margin-bottom: 12px; }
.lc-empty { color: var(--text-faint); font-size: 13px; padding: 4px 0 10px; }
.lc-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.lc-row-main { flex: 1; min-width: 0; }
.lc-row-title { display: block; color: var(--text); font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-row-meta { display: block; color: var(--text-faint); font-size: 12px; margin-top: 2px; }
.lc-row-x { appearance: none; background: none; border: none; color: var(--text-faint); font-size: 18px; cursor: pointer; padding: 2px 6px; }
.lc-form { border-top: 1px solid var(--line); padding-top: 14px; }
.lc-field { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.lc-url { flex: 1; min-width: 180px; box-sizing: border-box; font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.lc-url:focus { outline: none; border-color: var(--text-dim); background: var(--bg); }
.lc-preview { font-size: 13px; color: var(--accent, var(--text-dim)); font-weight: 550; }
.lc-flabel { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin: 12px 0 6px; }
.lc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lc-chip { appearance: none; cursor: pointer; background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  font: inherit; font-size: 13px; padding: 6px 13px; border-radius: 999px; transition: border-color .12s, color .12s, background .12s; }
.lc-chip.on { border-color: var(--text); color: var(--text); background: var(--bg-soft); font-weight: 600; }
.lc-select { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.lc-note { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; color: var(--text); margin-top: 12px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.lc-note:focus, .lc-select:focus { outline: none; border-color: var(--text-dim); background: var(--bg); }
.lc-add { margin-top: 14px; }

/* Concept-confidence wizard (CS Fundamentals). Reuses the overlay/card/chips. */
.cw-hint { font-size: 13px; color: var(--text-faint); margin: 0 0 14px; line-height: 1.5; }
.cw-list { display: flex; flex-direction: column; }
.cw-row { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.cw-concept { font-size: 14px; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.cw-chips { gap: 6px; }
.cw-chip.on.cw-solid { border-color: #0f9d6b; color: #0f9d6b; background: rgba(15,157,107,.1); }
.cw-chip.on.cw-shaky { border-color: #c98a2e; color: #c98a2e; background: rgba(201,138,46,.12); }
.cw-chip.on.cw-noyet { border-color: #c2483d; color: #c2483d; background: rgba(194,72,61,.1); }
/* Confidence tags + review dots on Progress. */
.cw-diff-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.cw-tag { font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 4px 12px; font-variant-numeric: tabular-nums; }
.cw-tag.c-solid { color: #0f9d6b; background: rgba(15,157,107,.12); }
.cw-tag.c-shaky { color: #c98a2e; background: rgba(201,138,46,.14); }
.cw-tag.c-noyet { color: #c2483d; background: rgba(194,72,61,.12); }
.lc-dot.c-solid { background: #0f9d6b; }
.lc-dot.c-shaky { background: #c98a2e; }
.lc-dot.c-noyet { background: #c2483d; }
.prog-h { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }
.prog-chart { display: flex; align-items: flex-end; gap: 6px; height: 100px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 20px; border-radius: 4px 4px 2px 2px; background: var(--accent); }
.bar.empty { background: var(--line); }
.bar-lbl { font-size: 9px; color: var(--text-faint); }
.adhere-track { height: 9px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin-bottom: 9px; }
.adhere-fill { height: 100%; background: var(--ok); border-radius: 999px; }
.adhere-txt { font-size: 13px; color: var(--text-dim); }
.area-bars { display: flex; flex-direction: column; gap: 13px; }
.area-bar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.area-name { color: var(--text-dim); font-weight: 550; }
.area-min { color: var(--text-faint); font-variant-numeric: tabular-nums; }
.area-track { height: 7px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.area-fill { height: 100%; background: var(--text-dim); border-radius: 999px; }

/* Recent sessions list on the Progress view */
.sess-list { display: flex; flex-direction: column; }
.sess-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.sess-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sess-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex: none; }
.sess-dot.done { background: var(--ok); }
.sess-dot.skip { background: var(--wind); }
.sess-area { font-size: 13.5px; font-weight: 600; color: var(--text-dim); flex: none; }
.sess-title { font-size: 13px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-right { display: flex; align-items: baseline; gap: 10px; flex: none; }
.sess-min { font-size: 13.5px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.sess-date { font-size: 12px; color: var(--text-faint); min-width: 58px; text-align: right; }

/* ---------- Roadmap ("Path") — the strategic view to the goal ---------- */
.road-wrap { padding-top: 6px; animation: viewIn .3s ease both; }
.road-head { margin-bottom: 26px; }
.road-count { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 4px; }
.road-days { font-size: 46px; font-weight: 680; letter-spacing: -.03em; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.road-days-lbl { font-size: 15px; color: var(--text-dim); font-weight: 550; }
.road-target { font-size: 13.5px; color: var(--text-faint); margin: 0 0 16px; line-height: 1.5; }
.road-timebar { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.road-timefill { height: 100%; background: var(--text); border-radius: 999px; transition: width .5s ease; }
.road-timemeta { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.road-verdict { display: inline-flex; align-items: center; gap: 9px; margin-top: 16px; padding: 9px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 600; }
.road-verdict.ok { color: var(--ok, #0f9d6b); background: rgba(15,157,107,.10); }
.road-verdict.behind { color: var(--wind, #d98324); background: rgba(217,131,36,.12); }
.road-verdict-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
/* Computed two-part status: deadline feasibility + this-week execution */
.road-status { margin: 16px 0 20px; display: flex; flex-direction: column; gap: 8px; }
.rs-row { display: flex; align-items: center; gap: 10px; }
.rs-k { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); min-width: 74px; }
.rs-v { font-size: 14px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.rs-ok, .rs-on { color: var(--ok, #0f9d6b); background: rgba(15,157,107,.12); }
.rs-tight, .rs-risk { color: #c98a2e; background: rgba(201,138,46,.14); }
.rs-off { color: #c2483d; background: rgba(194,72,61,.12); }
.rs-unknown { color: var(--text-faint); background: var(--bg-soft); }
.rs-rebuilding { color: #3b5bd9; background: rgba(59,91,217,.12); }
.rs-plain { color: var(--text); background: var(--bg-soft); }
.rs-reason { font-size: 13px; color: var(--text-dim); line-height: 1.4; }
/* Goal header */
.road-goal { margin: 4px 0 16px; }
.road-goal-k { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.road-goal-v { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.road-goal-sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
/* Resume-after-break control */
.road-resume { margin: 6px 0 18px; }
.road-resume-btn { max-width: 260px; }
.road-resume-on { font-size: 13px; color: var(--text-dim); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.road-resume-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.road-resume-wk { width: 64px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--text); font: inherit; }
/* Commitments */
.road-section { margin: 0 0 22px; }
.cm-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.cm-l { font-size: 14px; color: var(--text); }
.cm-v { font-size: 13px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.cm-v b { color: var(--text); }
.cm-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.cm-fill { height: 100%; background: #c98a2e; }
.cm-row.met .cm-fill { background: var(--ok, #0f9d6b); }
.cm-demand { font-size: 12px; color: var(--text-faint); margin-top: 10px; line-height: 1.4; }
/* Readiness / recruiting tiles */
.rd-tiles { display: flex; gap: 10px; flex-wrap: wrap; }
.rd-tile { flex: 1; min-width: 96px; background: var(--bg-soft); border-radius: 14px; padding: 12px 14px; }
.rd-tile.warn { background: rgba(201,138,46,.14); }
.rd-tile.ok { background: rgba(15,157,107,.12); }
.rd-n { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.rd-l { font-size: 12px; color: var(--text-faint); margin-top: 2px; line-height: 1.3; }
.pm-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.pm-chip { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 10px; }
.pm-learning { color: #c98a2e; background: rgba(201,138,46,.14); }
.pm-practiced { color: #3b5bd9; background: rgba(59,91,217,.12); }
.pm-ready { color: var(--ok, #0f9d6b); background: rgba(15,157,107,.12); }
.road-vol-h { margin-top: 6px; opacity: .8; }
/* Pipeline view */
.pipe-wrap { padding-bottom: 40px; }
.pipe-rollup { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 18px; }
.pipe-tile { flex: 1; min-width: 80px; background: var(--bg-soft); border-radius: 14px; padding: 12px 14px; }
.pipe-tile-n { font-size: 24px; font-weight: 800; color: var(--text); }
.pipe-tile-l { font-size: 12px; color: var(--text-faint); }
.pipe-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pipe-in { flex: 1; min-width: 120px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--text); font: inherit; font-size: 14px; }
.pipe-list { display: flex; flex-direction: column; gap: 12px; }
.pipe-row { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.pipe-row.inactive { opacity: .55; }
.pipe-row-top { display: flex; align-items: baseline; gap: 10px; }
.pipe-co { font-size: 15px; font-weight: 700; color: var(--text); }
.pipe-role { font-size: 13px; color: var(--text-dim); }
.pipe-x { margin-left: auto; background: none; border: none; color: var(--text-faint); font-size: 20px; cursor: pointer; line-height: 1; }
.pipe-row-ctl { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.pipe-stage { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; }
.pipe-datel { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-faint); }
.pipe-date { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--text); font: inherit; font-size: 13px; }
.pipe-notes { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--text); font: inherit; font-size: 13px; }
/* Weekly commitments editor */
.cm-edit { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.cm-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--text); }
.cm-edit-in { width: 80px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--text); font: inherit; text-align: right; }
/* Now-view cold-review nudge */
.now-review-nudge { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin-bottom: 14px; padding: 11px 14px; border: 1px solid rgba(201,138,46,.4); background: rgba(201,138,46,.10); border-radius: 14px; font: inherit; cursor: pointer; }
.nrn-n { flex: 0 0 auto; font-size: 18px; font-weight: 800; color: #c98a2e; }
.nrn-t { font-size: 13px; color: var(--text-dim); line-height: 1.35; }

.road-section { margin-bottom: 30px; }
.road-h { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 14px; }

.road-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.road-tile { padding: 15px 16px; border-radius: 14px; background: var(--bg-soft); position: relative; }
.road-tile::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--line); }
.road-tile.t-ok::before { background: var(--ok, #0f9d6b); }
.road-tile.t-warn::before { background: var(--wind, #d98324); }
.road-tile-lbl { font-size: 12px; color: var(--text-faint); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.road-tile-big { font-size: 24px; font-weight: 680; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.road-tile-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }

.road-hzs { display: flex; flex-direction: column; gap: 10px; }
.road-hz { padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; }
.road-hz-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.road-hz-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
.road-hz-window { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.road-hz-goal { font-size: 13px; color: var(--text-dim); margin: 6px 0 10px; }
.road-hz-targets { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.road-hz-t { font-size: 13px; color: var(--text-dim); }
.road-hz-t b { color: var(--text); font-weight: 680; font-variant-numeric: tabular-nums; }

.road-arc { display: flex; flex-direction: column; }
.road-phase { display: flex; gap: 14px; }
.road-phase-rail { position: relative; flex: 0 0 auto; width: 12px; display: flex; justify-content: center; }
.road-phase-rail::before { content: ''; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line-soft); }
.road-phase:first-child .road-phase-rail::before { top: 9px; }
.road-phase:last-child .road-phase-rail::before { bottom: calc(100% - 9px); }
.road-phase-node { position: relative; z-index: 1; width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; background: var(--bg); border: 2px solid var(--line); }
.road-phase.s-done .road-phase-node { background: var(--ok, #0f9d6b); border-color: var(--ok, #0f9d6b); }
.road-phase.s-current .road-phase-node { background: var(--text); border-color: var(--text); box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.road-phase.s-behind .road-phase-node { background: var(--wind, #d98324); border-color: var(--wind, #d98324); }
.road-phase-body { flex: 1; min-width: 0; padding-bottom: 20px; }
.road-phase-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.road-phase-name { font-size: 15.5px; font-weight: 620; letter-spacing: -.01em; color: var(--text); }
.road-phase.s-upcoming .road-phase-name { color: var(--text-dim); }
.road-phase-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; color: var(--text-faint); }
.road-phase-tag.st-done { color: var(--ok, #0f9d6b); background: rgba(15,157,107,.12); }
.road-phase-tag.st-current { color: #fff; background: var(--text); }
.road-phase-tag.st-behind { color: var(--wind, #d98324); background: rgba(217,131,36,.14); }
.road-phase-tag.st-upcoming { display: none; }
.road-phase-meta { font-size: 12px; color: var(--text-faint); margin: 4px 0 9px; font-variant-numeric: tabular-nums; }
.road-phase-track { height: 5px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; max-width: 260px; }
.road-phase-fill { height: 100%; border-radius: 999px; background: var(--text-faint); transition: width .5s ease; }
.road-phase.s-done .road-phase-fill { background: var(--ok, #0f9d6b); }
.road-phase.s-current .road-phase-fill { background: var(--text); }
.road-phase.s-behind .road-phase-fill { background: var(--wind, #d98324); }

.road-next { display: flex; flex-direction: column; }
.road-next-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--line-soft); padding: 13px 2px; cursor: pointer; font: inherit; transition: background .15s; }
.road-next-row:hover { background: var(--bg-soft); }
.road-next-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.road-next-t { flex: 1; min-width: 0; font-size: 14.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.road-next-meta { flex: 0 0 auto; font-size: 12px; color: var(--text-faint); }

.road-links { display: flex; gap: 22px; justify-content: center; margin-top: 6px; }
.road-links .btn-link { display: inline; width: auto; }

/* ---------- Revise — the commute card deck ---------- */
.revise-wrap { padding-top: 6px; animation: viewIn .3s ease both; display: flex; flex-direction: column; min-height: 80vh; }
.revise-head { margin-bottom: 14px; }
.revise-top { display: flex; align-items: center; justify-content: space-between; }
.revise-close { appearance: none; background: none; border: none; color: var(--text-faint); font-size: 18px; line-height: 1; cursor: pointer; padding: 4px; }
.revise-close:hover { color: var(--text); }
.revise-progress { height: 4px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin: 10px 0 6px; }
.revise-progress-fill { height: 100%; background: var(--text); border-radius: 999px; transition: width .3s ease; }
.revise-count { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; text-align: right; }

/* the card stack — the top card sits over a faint peek of the next */
.revise-stack { position: relative; margin: 8px 0 18px; }
.revise-card {
  position: relative; width: 100%; max-width: 440px; min-height: 300px; margin: 0 auto;
  background: var(--bg-card, #fff); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
  padding: 28px 26px; box-sizing: border-box; cursor: grab; touch-action: pan-y;
  display: flex; user-select: none; transition: transform .2s ease, box-shadow .2s ease;
}
.revise-card:active { cursor: grabbing; }
/* the next card peeks from behind — absolute so it never affects layout or taps */
.revise-card.revise-peek { position: absolute; inset: 0; transform: scale(.94) translateY(14px); opacity: .5; box-shadow: none; pointer-events: none; }
.revise-card-inner { display: flex; flex-direction: column; width: 100%; }
.revise-kind { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 16px; }
.revise-card.k-concept .revise-kind { color: #7d5bd6; }
.revise-card.k-pattern .revise-kind { color: var(--desk, #3b5bd9); }
.revise-card.k-problem .revise-kind { color: var(--transit, #0f9d6b); }
.revise-front { font-size: 25px; font-weight: 660; letter-spacing: -.02em; line-height: 1.2; color: var(--text); }
.revise-sub { font-size: 13px; color: var(--text-faint); margin-top: 6px; }
.revise-prompt { font-size: 14.5px; color: var(--text-dim); line-height: 1.5; margin-top: 16px; }
/* the back is hidden until the card is flipped (tap) */
.revise-back { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line-soft); display: none; }
.revise-card.flipped .revise-back { display: block; }
.revise-card.flipped .revise-prompt { opacity: .4; }
.revise-back-lbl { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.revise-back-text { font-size: 15px; color: var(--text); line-height: 1.55; white-space: pre-line; }
/* swipe intent hints */
.revise-card.hint-yes { border-color: var(--ok, #0f9d6b); box-shadow: 0 12px 40px rgba(15,157,107,.18); }
.revise-card.hint-no { border-color: var(--wind, #d98324); box-shadow: 0 12px 40px rgba(217,131,36,.18); }

.revise-acts { display: flex; gap: 12px; justify-content: center; position: relative; z-index: 5; }
.revise-btn { flex: 1; max-width: 200px; appearance: none; cursor: pointer; border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 14px; font: inherit; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; transition: border-color .15s, background .15s, color .15s; }
.revise-btn span:first-child { font-size: 17px; }
.revise-btn.yes { color: var(--ok, #0f9d6b); }
.revise-btn.yes:hover { border-color: var(--ok, #0f9d6b); background: rgba(15,157,107,.06); }
.revise-btn.no { color: var(--wind, #d98324); }
.revise-btn.no:hover { border-color: var(--wind, #d98324); background: rgba(217,131,36,.06); }
.revise-hint { text-align: center; font-size: 12.5px; color: var(--text-faint); line-height: 1.5; margin-top: 14px; }

.revise-done { text-align: center; display: flex; flex-direction: column; align-items: center; animation: swapIn .3s ease both; }
.revise-done-mark { width: 54px; height: 54px; border-radius: 50%; background: rgba(15,157,107,.12); color: var(--ok, #0f9d6b); font-size: 26px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.revise-done h2 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 6px; }

/* ---------- Nuggets — bite-sized knowledge cards ---------- */
/* Reuse the revise card frame; the info shows directly (no flip). */
.nug-card .revise-card-inner { justify-content: flex-start; }
.nug-front { font-size: 22px; font-weight: 660; letter-spacing: -.02em; line-height: 1.22; color: var(--text); margin-top: 4px; }
.nug-body { font-size: 15.5px; color: var(--text-dim); line-height: 1.6; margin-top: 14px; }
.nug-card .revise-kind { color: var(--desk, #3b5bd9); }
.nug-card.a-DSA .revise-kind { color: var(--transit, #0f9d6b); }
.nug-card.a-System-Design .revise-kind { color: var(--desk, #3b5bd9); }
.nug-card.a-CS-Fundamentals .revise-kind { color: #7d5bd6; }
.nug-card.a-Behavioral .revise-kind { color: var(--wind, #d98324); }

/* ---------- Drills — fill-in-the-blank MCQ cards ---------- */
/* Reuses the revise card frame; the card is static (no swipe), so grab/pan and
   the peek are dropped and it grows with its content. */
.drills-wrap .revise-card, .drill-card {
  cursor: default; min-height: 0; max-width: 460px; touch-action: auto;
  transition: none; display: block;
}
.drill-stack { margin: 8px 0 18px; }
.drill-lead { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin: 10px 0 2px; }
.drill-kindrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.drill-kindrow .revise-kind { margin-bottom: 0; }
.drill-card .revise-kind { color: var(--desk, #3b5bd9); }
.drill-card.p-Two-pointers .revise-kind { color: var(--transit, #0f9d6b); }
.drill-card.p-Hashing .revise-kind { color: #7d5bd6; }
.drill-card.p-Sliding-window .revise-kind { color: var(--desk, #3b5bd9); }
.drill-card.p-Prefix-sum .revise-kind { color: var(--wind, #d98324); }
.drill-card.p-Binary-search .revise-kind { color: #0e8a9c; }
.drill-card.p-Stack-Monotonic-stack .revise-kind { color: #b5561f; }
.drill-card.p-Dynamic-programming .revise-kind { color: #c2483d; }
.drill-practiced {
  font-size: 10px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700;
  color: var(--ok, #0f9d6b); background: rgba(15,157,107,.12);
  padding: 3px 8px; border-radius: 999px;
}
.drill-title { font-size: 21px; font-weight: 660; letter-spacing: -.02em; line-height: 1.2; color: var(--text); }
.drill-prompt { font-size: 14.5px; color: var(--text-dim); line-height: 1.5; margin-top: 8px; }
.drill-code {
  margin: 16px 0 4px; padding: 14px 16px; border-radius: 12px;
  background: var(--bg-soft, #f6f6f7); border: 1px solid var(--line-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.65; color: var(--text);
  white-space: pre; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.drill-slot {
  display: inline-block; min-width: 60px; text-align: center;
  padding: 0 8px; border-radius: 6px; font-weight: 700;
  background: rgba(59,91,217,.12); color: var(--desk, #3b5bd9);
  border: 1px dashed rgba(59,91,217,.5);
}
.drill-slot.ok { background: rgba(15,157,107,.14); color: var(--ok, #0f9d6b); border-style: solid; border-color: rgba(15,157,107,.5); }
.drill-slot.bad { background: rgba(194,72,61,.12); color: #c2483d; border-style: solid; border-color: rgba(194,72,61,.5); }
.drill-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.drill-choice {
  appearance: none; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); border-radius: 12px;
  padding: 12px 14px; font: inherit; transition: border-color .15s, background .15s;
}
.drill-choice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; color: var(--text); background: none;
}
.drill-choice:hover:not(:disabled) { border-color: var(--text-faint); background: var(--bg-soft); }
.drill-choice:disabled { cursor: default; opacity: .72; }
.drill-choice.correct { border-color: var(--ok, #0f9d6b); background: rgba(15,157,107,.08); opacity: 1; }
.drill-choice.correct code { color: var(--ok, #0f9d6b); font-weight: 600; }
.drill-choice.wrong { border-color: #c2483d; background: rgba(194,72,61,.06); opacity: 1; }
.drill-choice.wrong code { color: #c2483d; }
.drill-feedback { display: none; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); animation: swapIn .25s ease both; }
.drill-feedback.show { display: block; }
.drill-verdict { font-size: 15px; font-weight: 650; margin-bottom: 12px; }
.drill-verdict.ok { color: var(--ok, #0f9d6b); }
.drill-verdict.bad { color: #c2483d; }
.drill-verdict.bad code, .drill-verdict.bad { font-family: inherit; }
.drill-why-lbl { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 6px; }
.drill-why { font-size: 14.5px; color: var(--text); line-height: 1.6; }
.drill-head-actions { display: flex; align-items: center; gap: 14px; }
.drill-concepts-link { appearance: none; background: none; border: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--text-faint); padding: 0; transition: color .15s; }
.drill-concepts-link:hover { color: var(--text-dim); }
.drill-retry { color: var(--text-dim); }

/* ---------- Concepts — the Drills catalog ---------- */
.concepts-wrap { padding-top: 6px; animation: viewIn .3s ease both; padding-bottom: 24px; }
.con-h { font-size: 26px; font-weight: 680; letter-spacing: -.02em; margin: 14px 0 6px; }
.con-sub { font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.con-list { display: flex; flex-direction: column; gap: 8px; }
.con-group-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin: 16px 0 4px; }
.con-group-label:first-child { margin-top: 0; }
.con-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  appearance: none; cursor: pointer; background: var(--bg); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; font: inherit; transition: border-color .15s, background .15s;
}
.con-row:hover { border-color: var(--text-faint); }
.con-row.studied { border-color: var(--ok, #0f9d6b); background: rgba(15,157,107,.05); }
.con-check {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ok, #0f9d6b); font-size: 15px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.con-check.on { border-color: var(--ok, #0f9d6b); background: rgba(15,157,107,.12); }
.con-body { min-width: 0; }
.con-name { font-size: 15.5px; font-weight: 600; color: var(--text); }
.con-meta { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.con-footer { margin-top: 24px; max-width: 360px; }
.con-summary { font-size: 12.5px; color: var(--text-faint); text-align: center; margin: 0 0 12px; }

/* ---------- Day score — "how did I do today?" ---------- */
.day-score { border-radius: 16px; background: var(--bg-soft); padding: 16px 18px; margin-bottom: 22px; }
.day-score.t-low { background: rgba(217,131,36,.07); }
.day-score-top { display: flex; align-items: center; gap: 16px; }
.day-score-num { font-size: 42px; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.day-score.t-ok .day-score-num { color: var(--ok, #0f9d6b); }
.day-score.t-mid .day-score-num { color: var(--wind, #d98324); }
.day-score.t-low .day-score-num { color: #c2483d; }
.day-score-head { min-width: 0; }
.day-score-verdict { font-size: 17px; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
.day-score-sub { font-size: 12px; color: var(--text-faint); letter-spacing: .02em; }
.day-score-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.ds-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; }
.ds-chip-l { color: var(--text-faint); letter-spacing: .01em; }
.ds-chip-v { color: var(--text-dim); font-weight: 650; font-variant-numeric: tabular-nums; }
.ds-chip.full { border-color: rgba(15,157,107,.3); background: rgba(15,157,107,.08); }
.ds-chip.full .ds-chip-v { color: var(--ok, #0f9d6b); }
.ds-chip.empty { border-color: rgba(194,72,61,.28); }
.ds-chip.empty .ds-chip-v { color: #c2483d; }
.day-score-low { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 13px; border-radius: 12px; background: rgba(194,72,61,.08); font-size: 13px; line-height: 1.45; color: var(--text-dim); }
.ds-warn { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: #c2483d; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px; }

/* ---- Login wall (auth) ---- */
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-signout { font: inherit; font-size: 13px; background: none; border: none; cursor: pointer; color: var(--text-faint); padding: 6px 2px; }
.topbar-signout:hover { color: var(--text); }

.auth-mount {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px);
}
.auth-card {
  width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px;
  text-align: center;
}
.auth-mark { font-size: 30px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.auth-sub { margin: -6px 0 6px; color: var(--text-dim); font-size: 14px; }
.auth-note { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.auth-warn {
  text-align: left; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text-dim);
}
.auth-error {
  text-align: left; background: #fdeceb; border: 1px solid #f3c7c2; color: var(--danger);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px;
}
@media (prefers-color-scheme: dark) {
  .auth-error { background: #2a1512; border-color: #5a2620; }
}
.auth-config { text-align: left; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.auth-config > summary {
  cursor: pointer; color: var(--text-dim); font-size: 13px; list-style: none; padding: 6px 0;
  user-select: none;
}
.auth-config > summary::-webkit-details-marker { display: none; }
.auth-config[open] > summary { color: var(--text); }
.auth-field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 12px; color: var(--text-dim); }
.auth-input {
  font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text); width: 100%;
}
.auth-input:focus { outline: none; border-color: var(--text-faint); }
