/* ==========================================================================
   SCIENCE BLITZ v2 — design system
   Lab-notebook paper, exam-paper diagrams, topics as test tubes.
   Display: Recursive (semi-casual). Reading: Lexend. Instruments: Recursive Mono.
   ========================================================================== */
:root {
  --paper: #f2f5f4;
  --sheet: #ffffff;
  --ink: #1b2433;
  --ink-2: #4b5767;
  --ink-3: #7d8898;
  --line: #d4dce2;
  --line-2: #e5ebee;
  --grid: rgba(47, 95, 224, .065);
  --t-div: #2a9d5c;
  --t-cyc: #d99a00;
  --t-sys: #2f5fe0;
  --t-int: #9b3fc4;
  --t-ene: #ea5b1f;
  --t-skl: #0f8a8a;
  --tc: var(--t-sys);
  --ok: #178a55; --ok-bg: #e3f4ea; --ok-line: #9fd7b8;
  --bad: #c8323f; --bad-bg: #fbe8ea; --bad-line: #f1b1b7;
  --hl: #ffe27a;
  --f-display: "Recursive", system-ui, sans-serif;
  --f-body: "Lexend", system-ui, sans-serif;
  --f-mono: "Recursive", ui-monospace, monospace;
  --r-sheet: 18px; --r-ctl: 12px;
  --shadow: 0 1px 0 rgba(27, 36, 51, .05), 0 10px 30px -18px rgba(27, 36, 51, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--t-sys); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
b, strong { font-weight: 600; }
.kw { background: linear-gradient(transparent 58%, var(--hl) 58%); padding: 0 .1em; font-weight: 500; }

/* ---------- typography ---------- */
.h1, .h2, .h3, .display { font-family: var(--f-display); font-variation-settings: "CASL" .55; letter-spacing: -.01em; line-height: 1.12; }
.h1 { font-size: clamp(28px, 6.4vw, 40px); font-weight: 800; }
.h2 { font-size: 22px; font-weight: 750; }
.h3 { font-size: 17px; font-weight: 700; }
.sub { color: var(--ink-2); font-size: 14.5px; }
.h1 + .sub { margin-top: 10px; max-width: 64ch; }
.tiny { font-size: 12.5px; color: var(--ink-3); }
.mono { font-family: var(--f-mono); font-variation-settings: "MONO" 1; }

/* ---------- shell ---------- */
#app { max-width: 820px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--f-display); font-weight: 800; font-size: 18px; font-variation-settings: "CASL" .8; letter-spacing: -.01em; }
.brand svg { width: 22px; height: 28px; }
.topbar .spacer { flex: 1; }
.pchip { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--sheet); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.pchip .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-size: 15px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sheet); border: 1px solid var(--line); }
.iconbtn svg { width: 20px; height: 20px; }
main#view { flex: 1; padding: 6px 16px 40px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--r-ctl); font-weight: 600; font-size: 16px; transition: transform .15s var(--ease), background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-ink { background: var(--ink); color: #fff; box-shadow: 0 3px 0 #0b111b; }
.btn-ink:hover { background: #253046; }
.btn-tc { background: var(--tc); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--tc) 70%, #000); }
.btn-line { background: var(--sheet); border: 1.5px solid var(--line); }
.btn-line:hover { border-color: var(--ink-3); }
.btn-ghost { color: var(--ink-2); padding: 0 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { color: var(--t-sys); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; display: inline; padding: 0; }

/* ---------- sheets ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-sheet); box-shadow: var(--shadow); }
.pad { padding: 18px; }

/* ---------- home ---------- */
.hello { color: var(--ink-2); font-size: 15px; margin: 8px 0 2px; }
.mission { margin-top: 16px; padding: 18px; display: grid; gap: 14px; position: relative; overflow: hidden; }
.mission .row { display: flex; gap: 18px; flex-wrap: wrap; }
.mission .stat { display: flex; flex-direction: column; }
.mission .stat b { font-family: var(--f-display); font-size: 26px; font-weight: 800; line-height: 1; font-variation-settings: "CASL" .5; }
.mission .stat span { font-size: 13px; color: var(--ink-2); }
.mission .streak { position: absolute; right: 16px; top: 14px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.mission .streak b { color: var(--t-ene); font-family: var(--f-display); font-size: 17px; }
.mission.done { border-color: var(--ok-line); }
.mission .mtext { display: grid; gap: 14px; align-content: center; position: relative; }
.mission .streak { position: static; justify-self: start; }
.mission .preview { display: grid; justify-items: center; gap: 6px; padding: 10px; border-radius: 14px; background: #f7f9fb; border: 1px dashed var(--line); }
.mission .preview .tiny i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--tc); margin-right: 6px; }
.mission .preview .fig { width: 100%; }
@media (min-width: 680px) { .mission.has-fig { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 22px; } }
@media (min-width: 720px) { .racks { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .racks .tube { width: 68px; } .racks .tube .tname { font-size: 11.5px; } .racks .tubes { gap: 1px; } }
.section { margin-top: 30px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }

/* test-tube racks */
.racks { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.rack { --tc: var(--t-sys); min-width: 0; padding: 14px 14px 0; border-radius: var(--r-sheet); background: var(--sheet); border: 1px solid var(--line); position: relative; }
.rack-name { font-family: var(--f-display); font-weight: 750; font-size: 16px; font-variation-settings: "CASL" .6; display: flex; align-items: center; gap: 8px; }
.rack-name i { width: 10px; height: 10px; border-radius: 3px; background: var(--tc); display: inline-block; }
.rack-name small { font-family: var(--f-body); font-weight: 400; color: var(--ink-3); font-size: 12.5px; margin-left: auto; }
.tubes { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 2px 0; }
.tubes::-webkit-scrollbar { display: none; }
.rack-shelf { height: 12px; margin: 0 -14px; border-top: 2px solid var(--ink); background: repeating-linear-gradient(90deg, #eef2f5 0 10px, #e6ebef 10px 20px); border-radius: 0 0 var(--r-sheet) var(--r-sheet); }
.tube { flex: 0 0 auto; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 2px 8px; border-radius: 12px; transition: background .15s; }
.tube:hover { background: #f4f7f9; }
.tube svg { width: 34px; height: 92px; overflow: visible; }
.tube .tname { font-size: 12px; line-height: 1.2; text-align: center; font-weight: 500; min-height: 29px; hyphens: manual; overflow-wrap: normal; max-width: 100%; }
.tube .tpct { font-size: 11px; color: var(--ink-3); font-family: var(--f-mono); font-variation-settings: "MONO" 1; }
.tube.later { opacity: .55; }
.tube-liquid { transition: y 1.1s var(--ease), height 1.1s var(--ease); }

/* tools */
.tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tool { text-align: left; padding: 14px; display: grid; gap: 4px; align-content: start; min-height: 96px; }
.tool .ti { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #f1f4f7; margin-bottom: 4px; }
.tool .ti svg { width: 20px; height: 20px; }
.tool b { font-weight: 600; }
.tool span { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.tool .badge { justify-self: start; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600; background: var(--bad-bg); color: var(--bad); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.muted { background: #eef2f5; color: var(--ink-2); }
@media (min-width: 640px) { .tools { grid-template-columns: repeat(3, 1fr); } }

/* ---------- topic page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14.5px; padding: 6px 0; }
.topic-head { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin: 6px 0 16px; }
.topic-head .tube { width: auto; pointer-events: none; padding: 0; }
.topic-head .tube svg { width: 46px; height: 124px; }
.topic-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--sheet); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); }
.actions { display: grid; gap: 10px; }
.actions .btn { justify-content: space-between; }
.actions .btn small { font-weight: 400; opacity: .8; font-size: 13px; }
@media (min-width: 640px) { .actions { grid-template-columns: repeat(3, 1fr); } .actions .btn { flex-direction: column; align-items: flex-start; justify-content: center; padding: 14px 16px; min-height: 76px; } }
.lo-list { display: grid; gap: 2px; }
.lo { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line-2); font-size: 14px; color: var(--ink-2); border-radius: 8px; }
.lo:hover:not([disabled]) { background: #f4f7f9; color: var(--ink); }
.lo:last-child { border-bottom: 0; }
.dots { display: flex; gap: 3px; }
.dots i { width: 9px; height: 9px; border-radius: 3px; background: var(--line-2); }
.dots i.on { background: var(--tc); }
.cards { display: grid; gap: 10px; }
.ccard { padding: 16px; }
.ccard h3 { font-family: var(--f-display); font-variation-settings: "CASL" .5; font-size: 17px; font-weight: 750; margin-bottom: 6px; }
.ccard .body { font-size: 15.5px; }
.ccard .fig { margin: 12px 0 4px; }
.tip { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--tc); background: #f6f8fa; border-radius: 0 10px 10px 0; font-size: 14px; color: var(--ink-2); }
.tip b { color: var(--ink); }

/* ---------- player ---------- */
.player { position: fixed; inset: 0; z-index: 20; background-color: var(--paper); background-image: inherit; background-size: 24px 24px; display: flex; flex-direction: column; }
.player-in { width: 100%; max-width: 820px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px 8px; }
.pbar .close { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.pbar .close svg { width: 22px; height: 22px; }
.segs { flex: 1; display: flex; gap: 3px; }
.segs i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); transition: background .3s; }
.segs i.ok { background: var(--ok); } .segs i.no { background: var(--bad); } .segs i.cur { background: var(--ink); } .segs i.part { background: var(--t-cyc); } .segs i.ans { background: var(--ink-3); }
.pcount { font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: 13px; color: var(--ink-2); min-width: 44px; text-align: right; }
.ptimer { font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--sheet); border: 1px solid var(--line); }
.ptimer.low { color: var(--bad); border-color: var(--bad-line); }
.qscroll { flex: 1; overflow-y: auto; padding: 4px 16px 20px; -webkit-overflow-scrolling: touch; }
.pfoot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; }
.pfoot .btn { flex: 1; }
.qcard { padding: 18px 18px 20px; }
.qhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.qnum { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 15px; }
.qtopic { font-size: 12.5px; color: var(--ink-3); flex: 1; }
.qtopic i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--tc); margin-right: 6px; }
.qmarks { font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: 13px; color: var(--ink-2); }
.stem { font-size: 17px; line-height: 1.6; }
.stem p + p { margin-top: 8px; }
.stem ul, .body ul, .fb ul, .model ul { margin: 8px 0 8px 1.3em; }
.stem li, .body li, .fb li, .model li { margin: 3px 0; padding-left: 2px; }
.qcard .fig { margin: 16px 0 6px; }
.stmts { margin: 12px 0 2px; display: grid; gap: 6px; }
.stmt { display: grid; grid-template-columns: 28px 1fr; font-size: 16px; line-height: 1.5; }
.stmt b { font-family: var(--f-display); font-weight: 800; }
.opts { list-style: none; display: grid; gap: 9px; margin-top: 18px; }
.opt { width: 100%; display: grid; grid-template-columns: 38px 1fr 24px; align-items: center; gap: 10px; text-align: left; padding: 11px 12px; min-height: 54px; border-radius: var(--r-ctl); background: var(--sheet); border: 1.5px solid var(--line); font-size: 16px; line-height: 1.4; transition: border-color .12s, background .12s, transform .12s; }
.opt:hover { border-color: var(--ink-3); }
.opt .on { font-family: var(--f-display); font-weight: 750; color: var(--ink-2); font-size: 15px; }
.opt .mk { width: 24px; height: 24px; }
.opt.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt.sel .on { color: var(--ink); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); box-shadow: inset 0 0 0 1px var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); box-shadow: inset 0 0 0 1px var(--bad); }
.opt.dim { opacity: .55; }
.opt .fig { margin: 0; align-items: flex-start; }
.opt .ot { display: grid; gap: 4px; min-width: 0; }
.opts.pics { grid-template-columns: repeat(2, 1fr); }
.opts.pics .opt { grid-template-columns: 34px 1fr 20px; }
.optable { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: 10px; }
.optable th { font-size: 13px; color: var(--ink-2); font-weight: 600; text-align: left; padding: 0 10px; }
.optable td { background: var(--sheet); border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); padding: 12px 10px; font-size: 15px; cursor: pointer; }
.optable td:first-child { border-left: 1.5px solid var(--line); border-radius: var(--r-ctl) 0 0 var(--r-ctl); width: 46px; font-family: var(--f-display); font-weight: 750; color: var(--ink-2); }
.optable td:last-child { border-right: 1.5px solid var(--line); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.optable tr.sel td { border-color: var(--ink); }
.optable tr.right td { border-color: var(--ok); background: var(--ok-bg); }
.optable tr.wrong td { border-color: var(--bad); background: var(--bad-bg); }
.optable tr.dim td { opacity: .55; }

/* feedback */
.fb { margin-top: 14px; padding: 16px 18px; border-radius: var(--r-sheet); background: var(--sheet); border: 1.5px solid var(--line); display: grid; gap: 10px; animation: rise .35s var(--ease); }
.fb.ok { border-color: var(--ok-line); }
.fb.no { border-color: var(--bad-line); }
.fb-title { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 800; font-size: 19px; font-variation-settings: "CASL" .7; }
.fb.ok .fb-title { color: var(--ok); } .fb.no .fb-title { color: var(--bad); }
.fb-title svg { width: 26px; height: 26px; }
.fb p { font-size: 15.5px; }
.fb .why { color: var(--ink); }
.fb .yours { color: var(--ink-2); font-size: 14.5px; }
.miscon { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: #fff7df; font-size: 14px; }
.miscon b { color: #8a5a00; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.shake { animation: shake .28s ease; }

/* structured questions */
.part { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.part-q { display: grid; grid-template-columns: 30px 1fr auto; gap: 6px; font-size: 16.5px; line-height: 1.55; }
.part-q .pl { font-family: var(--f-display); font-weight: 750; }
.part-q .pm { font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: 13px; color: var(--ink-2); }
.part-body { margin-top: 10px; margin-left: 30px; display: grid; gap: 10px; }
.part.locked { opacity: .45; pointer-events: none; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--sheet); font-size: 15px; }
.choice.sel { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice.right { border-color: var(--ok); background: var(--ok-bg); }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.answer-lines { width: 100%; min-height: 96px; resize: vertical; border: 1.5px solid var(--line); border-radius: var(--r-ctl); padding: 10px 12px; font-size: 16px; line-height: 30px;
  background: var(--sheet) repeating-linear-gradient(transparent 0 29px, var(--line-2) 29px 30px); background-origin: content-box; }
.answer-lines:focus { outline: none; border-color: var(--ink); }
input.short { width: 100%; border: 0; border-bottom: 2px solid var(--line); padding: 8px 2px; font-size: 16px; background: transparent; }
input.short:focus { outline: none; border-color: var(--ink); }
.mode-switch { display: inline-flex; background: #eef2f5; border-radius: 999px; padding: 3px; gap: 2px; justify-self: start; }
.mode-switch button { padding: 6px 12px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); }
.mode-switch button.on { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); font-weight: 500; }
.tray { min-height: 60px; border: 1.5px dashed var(--line); border-radius: var(--r-ctl); padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; background: #fbfcfd; }
.tray:empty::before { content: "Tap phrases below to build your answer."; color: var(--ink-3); font-size: 14px; padding: 6px; }
.bank { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--sheet); font-size: 14.5px; line-height: 1.35; text-align: left; transition: transform .12s; }
.chip:hover { border-color: var(--ink-3); }
.chip.used { opacity: .3; pointer-events: none; }
.tray .chip { background: #eef3ff; border-color: #c9d6fb; }
.chip.good { background: var(--ok-bg); border-color: var(--ok-line); }
.chip.bad { background: var(--bad-bg); border-color: var(--bad-line); }
.rubric { display: grid; gap: 6px; }
.rubric div { display: grid; grid-template-columns: 22px 1fr; gap: 6px; font-size: 14.5px; align-items: start; }
.rubric svg { width: 18px; height: 18px; margin-top: 2px; }
.model { padding: 12px 14px; border-radius: 12px; background: #f3f7fb; font-size: 15px; }
.model b { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-bottom: 2px; }
.selfmark { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.selfmark button { width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--sheet); font-family: var(--f-display); font-weight: 750; }
.selfmark button.sel { border-color: var(--ink); background: var(--ink); color: #fff; }
.samples { display: grid; gap: 8px; }
.sample { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 14.5px; display: grid; gap: 4px; }
.sample .sm { font-family: var(--f-mono); font-variation-settings: "MONO" 1; font-size: 12.5px; }
.details summary { cursor: pointer; font-size: 14px; color: var(--t-sys); font-weight: 500; }
.details[open] summary { margin-bottom: 8px; }

/* ---------- results ---------- */
.result-hero { text-align: center; padding: 26px 18px 20px; }
.result-hero .big { font-family: var(--f-display); font-weight: 800; font-size: 64px; line-height: 1; font-variation-settings: "CASL" .5; }
.result-hero .big small { font-size: 26px; color: var(--ink-3); }
.result-hero .verdict { font-family: var(--f-display); font-size: 20px; font-weight: 750; margin-top: 8px; font-variation-settings: "CASL" .8; }
.gains { display: grid; gap: 8px; }
.gain { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.gain:last-child { border-bottom: 0; }
.review-item { padding: 14px 16px; display: grid; gap: 8px; }
.review-item .stem { font-size: 15px; }
.review-item .ans { font-size: 14px; }
.al { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--ink); font-family: var(--f-display); font-weight: 800; font-size: 28px; }

/* ---------- lists ---------- */
.list { display: grid; gap: 10px; }
.row-btn { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 14px 16px; }
.row-btn .t { font-weight: 500; }
.row-btn .d { font-size: 13px; color: var(--ink-2); }
.bar { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--tc); border-radius: 4px; }
.empty { text-align: center; padding: 34px 18px; color: var(--ink-2); }
.empty .h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- profiles ---------- */
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 18px; }
.prof { padding: 18px 12px; display: grid; justify-items: center; gap: 8px; }
.prof .av { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #eef2f5; font-size: 30px; }
.prof b { font-weight: 600; }
.form { display: grid; gap: 16px; margin-top: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field input[type=text] { border: 1.5px solid var(--line); border-radius: var(--r-ctl); padding: 12px 14px; font-size: 16px; background: var(--sheet); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { padding: 10px 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--sheet); font-weight: 500; }
.seg button.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.avatars { display: flex; flex-wrap: wrap; gap: 8px; }
.avatars button { width: 52px; height: 52px; border-radius: 50%; border: 2px solid transparent; background: #eef2f5; font-size: 24px; }
.avatars button.on { border-color: var(--ink); }

/* ---------- misc ---------- */
.toast { pointer-events: none; position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14.5px; z-index: 50; animation: rise .3s var(--ease); max-width: calc(100% - 32px); }
.xp-pop { position: fixed; z-index: 60; pointer-events: none; font-family: var(--f-display); font-weight: 800; color: var(--ok); font-size: 18px; animation: xpup .9s var(--ease) forwards; }
@keyframes xpup { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-40px); } }
.grid2 { display: grid; gap: 10px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.hr { height: 1px; background: var(--line-2); margin: 14px 0; }
.kbd { font-family: var(--f-mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- labs ---------- */
.lab-grid { display: grid; gap: 12px; margin-top: 16px; }
@media (min-width: 760px) { .lab-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; } }
.lab-stage { padding: 14px; display: grid; gap: 12px; justify-items: center; }
.lab-stage .fig { width: 100%; }
.lab-panel { padding: 16px; display: grid; gap: 16px; }
.readout { display: grid; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line-2); }
.readout > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14.5px; }
.lvl { font-size: 13px; padding: 2px 10px; border-radius: 999px; background: #eef2f5; color: var(--ink-2); }
.lvl-dim { background: #fff4cc; color: #7a5a00; } .lvl-normal { background: #ffe68a; color: #5a4300; } .lvl-bright { background: #ffd23f; color: #3a2b00; font-weight: 600; }
.meter { display: grid !important; grid-template-columns: auto 1fr; }
.meter .bar i { background: var(--ink); }
.big-read { display: grid !important; justify-content: start !important; gap: 0 !important; }
.big-read .mono { font-size: 30px; font-weight: 700; line-height: 1.1; }
.challenge { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 12px 14px; font-size: 15px; align-items: start; }
.challenge .ck svg { width: 24px; height: 24px; }
.challenge .num { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 12px; font-family: var(--f-display); font-weight: 700; color: var(--ink-3); }
.challenge.done { border-color: var(--ok-line); }
.challenge .learn { margin-top: 6px; font-size: 14px; color: var(--ink-2); padding-left: 10px; border-left: 3px solid var(--ok-line); }
.screen-view { display: grid; justify-items: center; gap: 4px; }
.heat-row { display: grid; gap: 6px; width: 100%; justify-items: center; }
.heat-row #beaker { width: 170px; }
.heat-row #graph { width: 100%; }
.chip.sel-chip { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
input[type=range] { width: 100%; accent-color: var(--tc); height: 28px; }
.field label b { font-family: var(--f-mono); font-variation-settings: "MONO" 1; }
.fbulb-i { cursor: pointer; }
.fbulb-i:hover circle.fp { stroke: var(--t-sys); }
.grid3 { display: grid; gap: 10px; }
@media (min-width: 700px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }
.grid3 .seg button { padding: 8px 10px; font-size: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise-b 2.4s linear infinite; }
  @keyframes rise-b { from { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(-38px); opacity: 0; } }
}

.foot { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.foot .link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.foot .tiny { margin-left: auto; }
.bar-test { justify-content: space-between; font-weight: 400; font-size: 14.5px; min-height: 44px; padding: 0 14px; }
.bar-test b { font-weight: 600; }

.modal { position: fixed; inset: 0; z-index: 80; background: rgba(27, 36, 51, .45); display: grid; place-items: center; padding: 20px; animation: rise .2s var(--ease); }
.modal-card { width: 100%; max-width: 380px; padding: 20px; display: grid; gap: 16px; font-size: 16px; }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
