/* The skins. Everything else reads these variables. */
:root, [data-theme="ink"] {
  --bg: #0e0e0c; --surface: #171714; --raise: #1f1f1b; --line: #2b2b26;
  --text: #edebe3; --muted: #8f8c82; --faint: #5c5a53;
  --fill: #edebe3; --on-fill: #0e0e0c;
  --ok: #a8d5a2; --warn: #e2b96f; --bad: #e39683;
  color-scheme: dark;
}
[data-theme="paper"] {
  --bg: #f3f0e8; --surface: #faf8f2; --raise: #ffffff; --line: #ddd8cc;
  --text: #1a1915; --muted: #737066; --faint: #a9a59a;
  --fill: #1a1915; --on-fill: #f6f3ec;
  --ok: #2f7a4d; --warn: #a36a12; --bad: #b04a32;
  color-scheme: light;
}
[data-theme="ember"] {
  --bg: #1b1511; --surface: #261d16; --raise: #31261d; --line: #403328;
  --text: #f7ecdc; --muted: #b3a18e; --faint: #7a6a5b;
  --fill: #ffb057; --on-fill: #24170a;
  --ok: #b9dc9a; --warn: #f2c36e; --bad: #f29d85;
  color-scheme: dark;
}
[data-theme="dawn"] {
  --bg: #fbf0e4; --surface: #fff9f1; --raise: #ffffff; --line: #eeddc9;
  --text: #2b1f16; --muted: #866f5c; --faint: #bca995;
  --fill: #cf4a22; --on-fill: #fffaf3;
  --ok: #2f7a4d; --warn: #9a6410; --bad: #a02c4e;
  color-scheme: light;
}
[data-theme="field"] {
  --bg: #0e1712; --surface: #14211a; --raise: #1a2b22; --line: #25392d;
  --text: #e4ece3; --muted: #8aa091; --faint: #587062;
  --fill: #cdf27d; --on-fill: #0e1712;
  --ok: #cdf27d; --warn: #e6c26d; --bad: #e89a86;
  color-scheme: dark;
}

:root {
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --pad: 22px;
  --col: 580px;
  --tabs: 58px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.45 var(--sans); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none; min-height: 100dvh;
}
body.in-flow { overflow: hidden; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; touch-action: manipulation; }
button:disabled { cursor: default; }
input, textarea { background: none; border: 0; outline: 0; border-radius: 0; -webkit-appearance: none; appearance: none; min-width: 0; }
textarea { resize: none; display: block; width: 100%; }
::placeholder { color: var(--faint); opacity: 1; }
:focus-visible { outline: 1.5px solid var(--text); outline-offset: 3px; border-radius: 6px; }
input:focus-visible, textarea:focus-visible { outline: 0; }
svg { display: block; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- motion ---------- */
@keyframes enter { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.enter { animation: enter .28s var(--ease) both; }
.stagger > * { animation: rise .34s var(--ease) both; }
.stagger > :nth-child(2) { animation-delay: .04s; }
.stagger > :nth-child(3) { animation-delay: .08s; }
.stagger > :nth-child(4) { animation-delay: .12s; }
.stagger > :nth-child(5) { animation-delay: .16s; }
.stagger > :nth-child(n+6) { animation-delay: .2s; }
.breathe { animation: breathe 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ---------- type ---------- */
.eyebrow { font-size: 13px; line-height: 1.3; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; line-height: 1.4; }
.serif { font-family: var(--serif); letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 56px; padding: 14px 22px; border-radius: 16px;
  background: var(--fill); color: var(--on-fill); font-weight: 600; font-size: 17px; text-align: center;
  transition: transform .32s var(--spring), opacity .2s, background-color .2s, color .2s;
  user-select: none; -webkit-user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); transition-duration: .08s; }
.btn:disabled { opacity: .32; }
.btn.quiet { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
.btn.busy { pointer-events: none; }
.btn.busy > * { animation: breathe 1.2s ease-in-out infinite; }
.link { color: var(--muted); font-size: 15px; padding: 12px 4px; margin: -12px -4px; border-radius: 8px; transition: color .2s, transform .32s var(--spring); }
.link:active { transform: scale(.96); color: var(--text); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); transition: transform .32s var(--spring), color .2s; }
.icon-btn:active { transform: scale(.88); color: var(--text); }

/* ---------- app shell ---------- */
#app { min-height: 100dvh; }
.view {
  max-width: var(--col); margin: 0 auto;
  padding: calc(var(--sat) + 28px) var(--pad) calc(var(--tabs) + var(--sab) + 40px);
  display: flex; flex-direction: column; gap: 30px;
}
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: center;
  padding-bottom: var(--sab);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabs-in { display: flex; width: 100%; max-width: var(--col); }
.tab {
  flex: 1; height: var(--tabs); display: grid; place-items: center;
  font-size: 15px; font-weight: 500; color: var(--muted);
  transition: color .2s, transform .32s var(--spring);
}
.tab:active { transform: scale(.94); }
.tab[aria-current="page"] { color: var(--text); }
@media (max-width: 380px) { .tab { font-size: 13px; } }
@media (min-width: 760px) {
  .tabs { top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); padding-bottom: 0; }
  .tabs-in { max-width: 420px; }
  .view { padding-top: calc(var(--tabs) + 52px); padding-bottom: 80px; }
}

/* ---------- today ---------- */
.day { display: flex; flex-direction: column; gap: 6px; }
.day h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.now {
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px;
  padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 22px;
}
.now-top { display: flex; flex-direction: column; gap: 8px; }
.now h2 { font-size: 40px; line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; }
.now .sub { color: var(--muted); font-size: 16px; }
.now-foot { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; width: 100%;
  padding: 15px 2px; border-top: 1px solid var(--line); text-align: left;
}
.rows > .row:first-child { border-top: 0; }
.rows.ruled > .row:first-child { border-top: 1px solid var(--line); }
.rows.ruled > .row:last-child { border-bottom: 1px solid var(--line); }
button.row { transition: opacity .2s, transform .32s var(--spring); }
button.row:active { transform: scale(.985); opacity: .7; }
.row .main { flex: 1; min-width: 0; }
.row .side { flex: 0 1 auto; max-width: 62%; overflow-wrap: anywhere; color: var(--muted); font-size: 15px; text-align: right; }
.row .side.strong { color: var(--text); font-weight: 600; }
.section { display: flex; flex-direction: column; gap: 10px; }
.week { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dots { display: flex; gap: 9px; }
.dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); }
.dot.on { background: var(--text); box-shadow: none; }
.dot.today:not(.on) { box-shadow: inset 0 0 0 1.5px var(--muted); }
.dot.on.fresh { animation: pop .5s var(--spring) both; }
.marks { display: flex; flex-direction: column; gap: 9px; }
.marks-top { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.marks-top b { color: var(--text); font-weight: 600; }
.meter { display: flex; height: 4px; border-radius: 2px; overflow: hidden; background: var(--line); }
.meter i { display: block; height: 100%; background: var(--text); transition: width .9s var(--ease); }
.meter .sta { opacity: .4; }
.foot-links { display: flex; justify-content: center; padding-top: 4px; }

/* ---------- flow (full-screen task) ---------- */
#flow {
  position: fixed; inset: 0 0 auto 0; height: var(--vvh, 100dvh); z-index: 20;
  background: var(--bg); display: flex; flex-direction: column;
  animation: fade .22s ease both;
}
#flow.leaving { opacity: 0; transition: opacity .18s ease; }
.frame { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 640px; margin: 0 auto; }
.f-head { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(var(--sat) + 8px) 12px 8px; min-height: 60px; }
.f-right { min-width: 44px; display: flex; justify-content: flex-end; align-items: center; color: var(--muted); font-size: 15px; padding-right: 10px; }
.segs { flex: 1; display: flex; gap: 5px; }
.seg { flex: 1; height: 3px; border-radius: 2px; background: var(--line); transition: background-color .35s; }
.seg.done { background: var(--fill); }
.seg.cur { background: var(--muted); }
.segs.many { gap: 0; border-radius: 2px; overflow: hidden; }
.segs.many .seg { border-radius: 0; }
.f-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 18px var(--pad) 28px; }
.f-body > .stage { display: flex; flex-direction: column; gap: 24px; min-height: 100%; }
.f-foot { flex: none; padding: 12px var(--pad) calc(var(--sab) + 18px); display: flex; flex-direction: column; gap: 12px; }
.f-foot:empty { display: none; }
.foot-label { text-align: center; color: var(--muted); font-size: 14px; }

.prompt { font-family: var(--serif); font-size: 25px; line-height: 1.32; letter-spacing: -0.012em; }
.prompt.done { font-size: 19px; color: var(--muted); }
.stem { white-space: pre-wrap; font-size: 16px; line-height: 1.5; color: var(--text); padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.answer {
  font-size: 17px; line-height: 1.5; padding: 16px 18px; min-height: 108px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color .2s;
}
.answer:focus { border-color: var(--faint); }
.answer.tall { min-height: 220px; }
.yours { white-space: pre-wrap; color: var(--muted); font-size: 16px; padding-left: 14px; border-left: 2px solid var(--line); }
.field {
  width: 100%; font-size: 17px; padding: 15px 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; transition: border-color .2s;
}
.field:focus { border-color: var(--faint); }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chip {
  min-height: 56px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 500; text-align: center; padding: 8px 6px;
  transition: transform .32s var(--spring), background-color .2s, color .2s;
}
.chip:active { transform: scale(.94); transition-duration: .08s; }
.chip.on { background: var(--fill); color: var(--on-fill); box-shadow: none; }

.points { display: flex; flex-direction: column; gap: 10px; }
.point {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  transition: transform .32s var(--spring), border-color .25s, background-color .25s;
}
.point:active { transform: scale(.98); transition-duration: .08s; }
.point.on { border-color: var(--faint); background: var(--raise); }
.point span { flex: 1; }
.tick { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--faint); display: grid; place-items: center; transition: background-color .2s, box-shadow .2s, transform .4s var(--spring); }
.tick svg { width: 14px; height: 14px; }
.tick path { fill: none; stroke: var(--on-fill); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .28s var(--ease) .05s; }
.on > .tick, .tick.on { background: var(--fill); box-shadow: none; transform: scale(1.06); }
.on > .tick path, .tick.on path { stroke-dashoffset: 0; }

.teach { font-size: 19px; line-height: 1.5; }
.source { font-size: 13px; color: var(--faint); }
.note { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); white-space: pre-wrap; }
.banner { padding: 14px 18px; border-radius: 14px; border: 1px solid var(--warn); color: var(--warn); font-size: 16px; }
.ask { display: flex; gap: 8px; align-items: stretch; }
.ask .field { flex: 1; }
.ask .send { flex: none; width: 52px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; transition: transform .32s var(--spring); }
.ask .send:active { transform: scale(.9); }

/* learn */
.now.lesson h2 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; }
.lesson-h { font-family: var(--serif); font-size: 28px; line-height: 1.2; letter-spacing: -0.015em; }
.teach p + p { margin-top: 14px; }
.pt.go { width: 100%; text-align: left; transition: opacity .2s; }
.pt.go:active { opacity: .6; }
.f-foot .foot-links { gap: 28px; }
.sum > .tick { width: 56px; height: 56px; }
.sum > .tick svg { width: 30px; height: 30px; }

/* summary */
.sum { align-items: center; text-align: center; justify-content: center; gap: 28px !important; padding-top: 12px; }
.ring { position: relative; width: 168px; height: 168px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: var(--line); }
.ring .arc { stroke: var(--text); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease) .15s; }
.ring .mid { position: absolute; inset: 0; display: grid; place-content: center; }
.ring .big { font-size: 52px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; }
.ring .of { color: var(--muted); font-size: 15px; margin-top: 4px; }
.sum h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.gain { display: flex; flex-direction: column; gap: 3px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.gain .small { font-weight: 400; letter-spacing: 0; }
.ups { width: 100%; text-align: left; }
.up { display: flex; flex-direction: column; gap: 3px; padding: 13px 2px; border-top: 1px solid var(--line); }
.up:last-child { border-bottom: 1px solid var(--line); }

/* written */
.shots { display: flex; flex-wrap: wrap; gap: 10px; }
.shot { position: relative; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); animation: pop .4s var(--spring) both; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: var(--text); display: grid; place-items: center; }
.add-shot { width: 84px; height: 84px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; color: var(--muted); transition: transform .32s var(--spring); }
.add-shot:active { transform: scale(.94); }
.scheme { display: flex; flex-direction: column; gap: 0; }
.lvl { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px 2px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.lvl:last-child { border-bottom: 1px solid var(--line); }
.lvl b { font-weight: 600; }
.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 16px; }
.bullets li { padding-left: 18px; position: relative; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.bullets.got li::before { background: var(--ok); }
.bullets.miss li::before { background: none; box-shadow: inset 0 0 0 1.5px var(--muted); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; }
.stepper .val { min-width: 96px; text-align: center; font-size: 44px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.stepper .val small { font-size: 17px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.step { width: 56px; height: 56px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; transition: transform .32s var(--spring); }
.step:active { transform: scale(.88); transition-duration: .08s; }
.score { display: flex; align-items: baseline; gap: 8px; }
.score .big { font-size: 72px; line-height: 1; font-weight: 600; letter-spacing: -0.045em; }
.score .of { font-size: 24px; color: var(--muted); }
.waitbox { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--text); }

/* ---------- deadlines ---------- */
.title { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dl { display: flex; align-items: flex-start; gap: 14px; padding: 15px 2px; border-top: 1px solid var(--line); transition: opacity .3s; }
.dl:last-child { border-bottom: 1px solid var(--line); }
.dl.done .dl-title { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.dl-check { flex: none; width: 44px; height: 44px; margin: -10px -10px -10px -10px; display: grid; place-items: center; border-radius: 50%; }
.dl-check:active .tick { transform: scale(.86); }
.dl-mark { flex: none; width: 24px; height: 24px; display: grid; place-items: center; margin-top: 1px; }
.dl-mark i { width: 9px; height: 9px; background: var(--text); transform: rotate(45deg); display: block; }
.dl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dl-sub { font-size: 14px; color: var(--muted); }
.dl-side { flex: none; display: flex; align-items: center; gap: 4px; }
.adder { display: flex; flex-direction: column; gap: 10px; animation: rise .3s var(--ease) both; }
.adder-row { display: flex; gap: 10px; }
.adder-row > * { flex: 1; }
.seg2 { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg2 button { flex: 1; min-height: 44px; border-radius: 10px; text-align: center; font-size: 15px; color: var(--muted); transition: background-color .2s, color .2s; }
.seg2 button.on { background: var(--raise); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
input[type="date"].field { min-height: 54px; }

/* ---------- progress ---------- */
.subject { display: flex; flex-direction: column; gap: 14px; }
.subject h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.grades { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: 15px; }
.grades b { color: var(--text); font-weight: 600; }
.curve { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 6px; }
.curve svg { display: block; width: 100%; height: auto; overflow: visible; }
.curve path { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.curve .c0 { opacity: .25; } .curve .c1 { opacity: .6; } .curve .c2 { stroke-width: 3; }
.curve .key { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; opacity: .7; }
.curve .marks-top { flex-wrap: wrap; row-gap: 4px; }
.curve .marks-top span { white-space: nowrap; }
.topic { border-top: 1px solid var(--line); }
.topic:last-child { border-bottom: 1px solid var(--line); }
.topic-btn { display: flex; flex-direction: column; gap: 9px; width: 100%; padding: 15px 2px; transition: opacity .2s; }
.topic-btn:active { opacity: .65; }
.topic-top { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.topic-top > :last-child { flex: none; }
.bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; gap: 2px; }
.bar i { display: block; height: 100%; background: var(--text); border-radius: 2px; min-width: 0; }
.bar .l0 { opacity: .12; } .bar .l1 { opacity: .28; } .bar .l2 { opacity: .5; } .bar .l3 { opacity: .75; } .bar .l4 { opacity: 1; }
.pts { display: flex; flex-direction: column; padding: 0 2px 14px; animation: rise .3s var(--ease) both; }
.pt { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 10px 0; font-size: 15px; line-height: 1.4; align-items: baseline; }
.pt .lv { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pt .lv.l3, .pt .lv.l4 { color: var(--text); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 12px; }
.swatch { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 8px 12px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; color: var(--muted); transition: transform .32s var(--spring), box-shadow .2s, color .2s; }
.swatch:active { transform: scale(.95); }
.swatch.on { box-shadow: inset 0 0 0 1.5px var(--text); color: var(--text); }
.swatch i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); }
.swatch i::after { content: ""; width: 14px; height: 14px; border-radius: 50%; }
.swatch.sw-ink i { background: #0e0e0c; } .swatch.sw-ink i::after { background: #edebe3; }
.swatch.sw-paper i { background: #f3f0e8; } .swatch.sw-paper i::after { background: #1a1915; }
.swatch.sw-ember i { background: #1b1511; } .swatch.sw-ember i::after { background: #ffb057; }
.swatch.sw-dawn i { background: #fbf0e4; } .swatch.sw-dawn i::after { background: #cf4a22; }
.swatch.sw-field i { background: #0e1712; } .swatch.sw-field i::after { background: #cdf27d; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; flex: none; transition: background-color .25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); transition: transform .32s var(--spring), background-color .25s; }
.switch[aria-checked="true"] { background: var(--fill); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--on-fill); }
.row.mid { align-items: center; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: calc(var(--sat) + 24px) var(--pad) calc(var(--sab) + 24px); }
.auth form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.auth .mark { width: 56px; height: 56px; margin: 0 auto 6px; }
.auth h1 { text-align: center; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 14px; }
.auth .err { min-height: 22px; text-align: center; font-size: 15px; color: var(--bad); }
.check { display: flex; align-items: center; gap: 12px; padding: 8px 2px; color: var(--muted); font-size: 16px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.msg { text-align: center; color: var(--muted); font-size: 15px; min-height: 22px; }

/* ---------- lesson: exam question, beats, checks, visuals ---------- */
.mk { text-align: right; font-size: 15px; color: var(--muted); }
.cmd { box-shadow: inset 0 0 0 1px var(--text); padding: 0 .22em; margin: 0 -.05em; }
.sch-h { font-size: 14px; font-weight: 600; color: var(--muted); padding-top: 6px; }
.point.choice { align-items: center; }
.point.choice.right { border-color: var(--ok); }
.point.choice.wrong { border-color: var(--bad); color: var(--bad); }
.point.choice:disabled { opacity: 1; }
.field.right { border-color: var(--ok); }
.field.wrong { border-color: var(--bad); }
.vis { color: var(--text); display: flex; flex-direction: column; gap: 10px; }
.v-row { display: flex; flex-wrap: wrap; gap: 8px; }
.v-tile { min-width: 48px; height: 48px; padding: 0 8px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; font-size: 18px; }
.v-tile.on { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }
.v-dotrow { display: flex; flex-direction: column; gap: 2px; }
.v-dotrow svg, .v-chart svg { width: 100%; height: auto; display: block; }
.v-scale { display: flex; justify-content: space-between; }
.v-bar { display: flex; flex-direction: column; gap: 5px; }
.v-bar-top { display: flex; justify-content: space-between; gap: 12px; }
.v-track { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.v-track i { display: block; height: 100%; background: var(--text); }
.v-steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.v-steps li { display: flex; gap: 14px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); font-size: 16px; }
.v-steps li:first-child { border-top: 0; }
.v-n { flex: none; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--faint); display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.v-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.v-table th, .v-table td { padding: 9px 8px; text-align: left; border-top: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
.v-table th { font-weight: 600; color: var(--muted); border-top: 0; border-bottom: 1px solid var(--line); }
.v-table th:first-child, .v-table td:first-child { padding-left: 2px; }
.v-table .r { text-align: right; }
.v-calc { padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); gap: 6px; font-size: 17px; }
.v-calc .last { font-weight: 600; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.v-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.v-pair > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v-pair .bullets { font-size: 15px; }
.v-lab { font-size: 11px; font-family: var(--sans); }
.point.choice span { overflow-wrap: anywhere; min-width: 0; }

/* ---------- today: count and path ---------- */
.count { display: flex; align-items: baseline; gap: 10px; padding-top: 6px; }
.count .big { font-family: var(--serif); font-size: 48px; line-height: 1; letter-spacing: -0.03em; }
.count .when { margin-left: auto; text-align: right; }
.day .where { margin-top: -2px; }
.path { display: flex; flex-direction: column; gap: 12px; }
.path-total { text-align: right; }
.rail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pstep { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 16px; align-items: start; padding-bottom: 16px; }
.pstep:last-child { padding-bottom: 0; }
.pstep::before { content: ""; position: absolute; left: 12px; top: 32px; bottom: 6px; width: 1px; background: var(--line); }
.pstep:last-child::before { display: none; }
.pstep-n { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--faint); display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.pstep.first .pstep-n { background: var(--fill); color: var(--on-fill); box-shadow: none; }
.pstep .now { padding: 22px 20px 20px; gap: 18px; }
.pstep .now h2 { font-size: 30px; }
.pstep > .row { border-top: 0; padding: 2px 2px; align-items: center; }
.row .kind { display: block; }
.row.two { align-items: center; }
.row .sub-line { display: block; }
.row .side.stack { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.row .side.stack .strong { color: var(--text); font-weight: 600; font-size: 17px; }

/* ---------- exam ---------- */
.paperbar { display: flex; gap: 8px; align-items: flex-start; }
.pb-seg { min-width: min-content; display: flex; flex-direction: column; gap: 6px; }
.pb-track { position: relative; height: 10px; border-radius: 2px; background: var(--line); overflow: hidden; }
.pb-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .6s var(--ease); }
.pb-track .sta { background: var(--faint); }
.pb-track .sec { background: var(--fill); }
.pb-name { font-size: 13px; line-height: 1.25; }
.pb-marks { line-height: 1; }
.lay { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.lay li { display: flex; gap: 14px; align-items: flex-start; font-size: 16px; line-height: 1.4; }
.lay-n { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--faint); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.tech-slot { align-self: flex-start; }
.tech-slot:empty { display: none; }
.sheet-over {
  position: fixed; inset: 0 0 auto 0; height: var(--vvh, 100dvh); z-index: 30;
  background: var(--bg); display: flex; flex-direction: column; animation: fade .22s ease both;
}

/* ---------- lesson: asked as ---------- */
.rail.solo .pstep { grid-template-columns: minmax(0, 1fr); }
.rail.solo .pstep-n { display: none; }
.rail.solo .now { padding: 28px 24px 24px; }
.rail.solo .now h2 { font-size: 40px; }

/* morning audio */
.aud { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.aud:last-child { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.aud-row { display: flex; align-items: center; gap: 12px; }
.aud-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); transition: transform .32s var(--spring), opacity .2s; }
.aud-btn:active { transform: scale(.92); opacity: .8; }
.aud-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aud-title { font-size: 17px; line-height: 1.25; font-weight: 500; }
.aud-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aud-txt { flex: none; min-width: 44px; min-height: 44px; padding: 0 4px; text-align: center; }
.aud-txt[hidden] { display: none; }
.aud-txt:active { color: var(--text); }
.aud-track { position: relative; height: 32px; margin-top: -2px; touch-action: pan-y; cursor: pointer; }
.aud-bar { position: absolute; left: 0; right: 0; top: 14px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.aud-fill { display: block; height: 100%; width: 0; background: var(--text); }

/* The lesson opener: one question, one tap for the scenario, three answers. */
.ask-card { display: flex; flex-direction: column; gap: 16px; padding: 22px 22px 28px; background: var(--surface); border-radius: 24px; }
.ask-card .prompt { font-size: 24px; }
.ask-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pill { flex: none; padding: 5px 11px; border-radius: 999px; background: var(--fill); color: var(--on-fill); font-size: 13px; font-weight: 600; }
.reveal { align-self: flex-start; min-height: 44px; padding: 10px 18px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 500; transition: transform .32s var(--spring); }
.reveal:active { transform: scale(.96); }
.foot-q { text-align: center; font-size: 15px; color: var(--muted); }
.chips.big .chip { min-height: 60px; border-radius: 18px; font-size: 17px; font-weight: 600; }

/* Reading */
.readtext { display: flex; flex-direction: column; gap: 16px; font-family: var(--serif); font-size: 18px; line-height: 1.6; max-width: 34em; }
.readtext p { margin: 0; }
