/* =====================================================================
   OathReady — styles
   Direction: a well-loved passport. Warm paper, navy ink, rubber-stamp
   red, hard printed edges, chunky buttons you want to press.
   ===================================================================== */

:root {
  --paper: #F3EAD7;
  --paper-2: #EADFC6;
  --card: #FCF8EE;
  --ink: #18203A;
  --ink-2: #505A78;
  --line: #18203A;
  --rule: #D8CBAE;
  --red: #C7362F;
  --blue: #27459B;
  --gold: #E5A31C;
  --teal: #1C8A72;
  --red-soft: #F8DFD8;
  --blue-soft: #DDE4F7;
  --gold-soft: #FBECC4;
  --teal-soft: #D6EEE5;
  --on-accent: #FFFDF6;
  --shadow: #18203A;
  --display: 'Bricolage Grotesque', 'Arial Black', 'Segoe UI', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --stampfont: 'Courier Prime', 'Courier New', monospace;
  --r: 14px;
  --r-sm: 10px;
  --rail: 244px;
  --bar: 56px;
}
[data-theme="dark"] {
  --paper: #10152A;
  --paper-2: #171D36;
  --card: #1B2240;
  --ink: #F3EBD8;
  --ink-2: #A8B0CC;
  --line: #070A16;
  --rule: #2E3760;
  --red: #E4574F;
  --blue: #6F8BE6;
  --gold: #F0B637;
  --teal: #3DBF9F;
  --red-soft: #47202A;
  --blue-soft: #24305E;
  --gold-soft: #47391A;
  --teal-soft: #153F3C;
  --on-accent: #10152A;
  --shadow: #05070F;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background-color: var(--paper);
  font: 400 17px/1.5 var(--body);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(24, 32, 58, .07) 1px, transparent 1.6px),
    repeating-radial-gradient(circle at 110% -10%, transparent 0 22px, rgba(39, 69, 155, .045) 22px 23px),
    repeating-radial-gradient(circle at -10% 110%, transparent 0 26px, rgba(199, 54, 47, .04) 26px 27px);
  background-size: 22px 22px, auto, auto;
  background-attachment: fixed;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.12rem; letter-spacing: -.01em; }
h4 { font-size: 1rem; margin: 1.2rem 0 .4rem; letter-spacing: 0; }
p { margin: .5rem 0; }
a { color: var(--blue); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
#view:focus { outline: none; }
.ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: .5rem 1rem; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }

.kicker { font: 700 .76rem/1 var(--stampfont); letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: .55rem; }
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 56ch; margin: .6rem 0 0; }
.muted { color: var(--ink-2); }
.small, small { font-size: .86rem; }
.fine { font-size: .82rem; color: var(--ink-2); border-top: 1px dashed var(--rule); padding-top: .8rem; margin-top: 1rem; }
.center { text-align: center; }
.left { text-align: left; }
.spacer { flex: 1; }
.plus { color: var(--teal); font-weight: 700; white-space: nowrap; }
.qn { font: 700 .72rem/1 var(--stampfont); letter-spacing: .06em; background: var(--ink); color: var(--paper); padding: .28em .5em .2em; border-radius: 5px; white-space: nowrap; display: inline-flex; align-items: center; }
.qn .ic { width: 1em; height: 1em; }
.starchip { font-size: .74rem; font-weight: 700; color: #7A5200; background: var(--gold-soft); border: 1.5px solid var(--gold); border-radius: 999px; padding: .05em .5em; white-space: nowrap; }
[data-theme="dark"] .starchip { color: var(--gold); }
.empty { text-align: center; color: var(--ink-2); padding: 3rem 1rem; }
.big-ic { font-size: 3.4rem; line-height: 1; margin-bottom: .6rem; }

/* ------------------------------ layout ------------------------------ */
#app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; padding: 1.4rem 1rem 1rem; border-right: 2px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 1.2rem; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); padding: 0 .4rem; }
.brand-seal { width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: var(--on-accent); display: grid; place-items: center; font-size: 1.1rem; box-shadow: inset 0 0 0 3px var(--red), inset 0 0 0 4.500px var(--on-accent); transform: rotate(-8deg); }
.brand-name { font: 800 1.45rem/1 var(--display); letter-spacing: -.03em; }
.brand-name b { color: var(--red); font-weight: 800; }
.rail-nav { display: flex; flex-direction: column; gap: .25rem; }
.navlink { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 600; border: 2px solid transparent; }
.navlink .ic { width: 1.35em; height: 1.35em; }
.navlink:hover { color: var(--ink); background: var(--paper); }
.navlink.on { color: var(--ink); background: var(--gold-soft); border-color: var(--line); box-shadow: 0 3px 0 var(--shadow); }
.rail-stats { margin-top: auto; border: 2px solid var(--line); border-radius: var(--r); padding: .8rem; background: var(--paper); }
.mini { display: flex; align-items: baseline; gap: .4rem; font-size: .9rem; color: var(--ink-2); margin-bottom: .35rem; }
.mini b { font: 800 1.25rem/1 var(--display); color: var(--ink); }
.mini-ic { align-self: center; color: var(--gold); display: inline-flex; }
.flame { color: var(--rule); display: inline-flex; }
.flame.lit { color: var(--red); }
.flame.lit .ic, .mini-ic .ic, .chip.xp .ic { fill: currentColor; fill-opacity: .25; }
.goalbar, .bar { height: 8px; background: var(--paper-2); border-radius: 99px; overflow: hidden; border: 1.5px solid var(--line); }
.goalbar i, .bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .5s cubic-bezier(.2, .9, .3, 1); min-width: 0; }
.bar.thick { height: 14px; }
.goalcap { font-size: .78rem; color: var(--ink-2); margin-top: .35rem; }
.rail-foot { font-size: .72rem; color: var(--ink-2); line-height: 1.4; padding: 0 .3rem; }
.tabbar { display: none; }
.view { padding: 2.2rem clamp(1rem, 4vw, 3rem) 5rem; max-width: 1040px; width: 100%; margin: 0 auto; }
body.focus .rail, body.focus .tabbar { display: none; }
body.focus #app { grid-template-columns: minmax(0, 1fr); }
body.focus .view { padding: 0; max-width: none; }

/* ------------------------------ buttons ------------------------------ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .62rem 1.1rem; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-weight: 700; text-decoration: none; box-shadow: 0 4px 0 var(--shadow); transition: transform .08s, box-shadow .08s, background .15s; line-height: 1.2; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--shadow); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--shadow); }
.btn.primary { background: var(--red); color: var(--on-accent); }
.btn.ghost { background: var(--card); }
.btn.danger { background: var(--card); color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.big { padding: .85rem 1.5rem; font-size: 1.08rem; border-radius: 14px; }
.btn.sm { padding: .36rem .7rem; font-size: .88rem; box-shadow: 0 3px 0 var(--shadow); border-radius: 10px; }
.btn.sm:active { transform: translateY(3px); }
.btn.link { border: 0; box-shadow: none; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding: .5rem .4rem; }
.btn.link:hover { color: var(--ink); transform: none; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: 0 4px 0 var(--shadow); transform: none; }
.iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 2px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 3px 0 var(--shadow); flex: none; color: var(--ink); text-decoration: none; }
.iconbtn:active { transform: translateY(3px); box-shadow: none; }
.iconbtn.sm { width: 38px; height: 38px; border-radius: 10px; }
.iconbtn.mic.live, .btn.live { background: var(--red); color: var(--on-accent); animation: pulse 1.1s infinite; }
.markbtn.on { background: var(--gold); }
.markbtn.on .ic { fill: currentColor; }
.row { display: flex; gap: .7rem; align-items: center; margin-top: 1.1rem; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font: 800 1rem/1 var(--display); padding: .42rem .7rem; border: 2px solid var(--line); border-radius: 999px; background: var(--card); }
.chip.xp { color: var(--ink); }
.chip.xp .ic { color: var(--gold); }
.chip.combo { opacity: 0; transform: scale(.7); transition: .2s; color: var(--red); background: var(--red-soft); }
.chip.combo.show { opacity: 1; transform: none; }
.chips { display: flex; gap: .45rem; flex-wrap: wrap; }
.chipbtn { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: .3rem .8rem; font-weight: 600; font-size: .9rem; }
.chipbtn.on { background: var(--ink); color: var(--paper); }
.pill { font: 700 .72rem/1 var(--stampfont); letter-spacing: .08em; text-transform: uppercase; padding: .35em .6em .25em; border-radius: 6px; border: 1.5px solid currentColor; }
.pill.ok { color: var(--teal); }
.pill.no { color: var(--red); }

/* ------------------------------ panels ------------------------------ */
.panel { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 1.2rem 1.3rem; box-shadow: 5px 5px 0 var(--shadow); margin-top: 1.4rem; }
.panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .8rem; }
.panel-h .muted { font-size: .85rem; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; align-items: start; }
.notice { border: 2px solid var(--line); background: var(--blue-soft); border-radius: var(--r-sm); padding: .8rem 1rem; margin-top: 1.2rem; }
.notice.warn { background: var(--gold-soft); }
.page-h { margin-bottom: 1.6rem; }

/* ------------------------------ toasts, modal, confetti ------------------------------ */
.toasts { position: fixed; z-index: 70; top: calc(var(--bar) + .6rem); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 460px); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); border-radius: 12px; padding: .7rem 1rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); animation: drop .35s cubic-bezier(.2, 1.3, .4, 1); font-size: .95rem; pointer-events: auto; }
.toast.gold { background: var(--gold); color: #1E1500; }
.toast.blue { background: var(--blue); color: #fff; }
.toast.red { background: var(--red); color: #fff; }
.toast .plus { color: inherit; }
.toast.out { opacity: 0; transform: translateY(-12px); transition: .4s; }
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(16, 21, 42, .55); display: none; place-items: center; padding: 1rem; overflow-y: auto; }
.overlay.open { display: grid; }
.modal { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 1.8rem 1.6rem 1.6rem; width: min(100%, 560px); box-shadow: 8px 8px 0 var(--shadow); animation: pop .3s cubic-bezier(.2, 1.3, .4, 1); max-height: 92vh; overflow-y: auto; }
.modal.narrow { width: min(100%, 400px); }
.modal-x { position: absolute; top: .8rem; right: .8rem; width: 38px; height: 38px; box-shadow: none; }
.celebrate { text-align: center; }
.celebrate p { color: var(--ink-2); }
.celebrate .row { justify-content: center; flex-wrap: wrap; }
.celebrate .stamp { margin: .6rem auto 1rem; }
.bignum { font: 800 6rem/1 var(--display); color: var(--red); letter-spacing: -.05em; }
.confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; display: none; }
.confetti.on { display: block; }

/* ------------------------------ stamps ------------------------------ */
.stamp { --c: var(--red); width: 118px; text-align: center; transform: rotate(var(--tilt, -4deg)); color: var(--c); }
.stamp.unit { --c: var(--blue); }
.stamp-ring { width: 86px; height: 86px; margin: 0 auto .35rem; border-radius: 50%; border: 3px solid currentColor; outline: 2px dashed currentColor; outline-offset: -9px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 8%, transparent); }
.stamp-ic { font-size: 2rem; filter: saturate(.9); }
.stamp-name { font: 700 .7rem/1.15 var(--stampfont); letter-spacing: .08em; text-transform: uppercase; }
.stamp.locked { color: var(--rule); transform: none; }
.stamp.locked .stamp-ic { filter: grayscale(1) opacity(.3); }
.stamp.slam { animation: slam .5s cubic-bezier(.3, 1.6, .5, 1) both; width: 150px; }
.stamp.slam .stamp-ring { width: 120px; height: 120px; }
.stamp.slam .stamp-ic { font-size: 3rem; }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 1.4rem .6rem; justify-items: center; }
.stampwrap { text-align: center; }
.stamp-desc { font-size: .74rem; color: var(--ink-2); max-width: 124px; margin: .25rem auto 0; line-height: 1.25; }

/* ------------------------------ home ------------------------------ */
.hero-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.hero h1 { max-width: 20ch; }
.topstats { display: none; gap: .4rem; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin-top: 1.5rem; padding: 1.4rem 1.5rem; border: 2px solid var(--line); border-radius: 20px; background: var(--blue); color: #FFFDF6; text-decoration: none; box-shadow: 6px 6px 0 var(--shadow); position: relative; overflow: hidden; }
[data-theme="dark"] .cta { background: #27459B; }
.cta::before { content: ''; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 100% 0, transparent 0 16px, rgba(255, 255, 255, .07) 16px 17px); pointer-events: none; }
.cta .kicker { color: #FFD26A; }
.cta h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.cta p { margin: .35rem 0 0; opacity: .88; }
.cta-body { position: relative; }
.cta .btn { position: relative; flex: none; background: #FFD26A; color: #18203A; border-color: #0D1226; box-shadow: 0 4px 0 #0D1226; }
.cta:hover .btn { transform: translateY(-2px); box-shadow: 0 6px 0 #0D1226; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.tile { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 1rem; box-shadow: 4px 4px 0 var(--shadow); display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; min-width: 0; }
.tile-h { font: 700 .72rem/1 var(--stampfont); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); align-self: flex-start; }
.tile-f { font-size: .82rem; color: var(--ink-2); margin-top: auto; }
.streak-num { display: flex; align-items: baseline; gap: .35rem; }
.streak-num b { font: 800 3rem/1 var(--display); letter-spacing: -.04em; }
.streak-num .flame { align-self: center; }
.streak-num .flame .ic { width: 2.1rem; height: 2.1rem; }
.week { display: flex; gap: 4px; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .64rem; color: var(--ink-2); font-weight: 700; }
.wk i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--rule); display: grid; place-items: center; }
.wk i .ic { width: 12px; height: 12px; stroke-width: 3.5; }
.wk.on i { background: var(--red); border-color: var(--line); color: var(--on-accent); }
.wk.today i { border-color: var(--line); border-style: dashed; }
.wk.today.on i { border-style: solid; }
.ring { position: relative; width: 104px; height: 104px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--paper-2); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .9, .3, 1); }
.ring.teal .ring-fg { stroke: var(--teal); }
.ring.done .ring-fg { stroke: var(--teal); }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-in b { font: 800 1.5rem/1 var(--display); letter-spacing: -.03em; }
.ring-in span { font-size: .66rem; color: var(--ink-2); margin-top: 2px; }
.lvl-title { font: 800 1.35rem/1.1 var(--display); margin: auto 0; }
.tile.level .bar { width: 100%; }
.quests { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.quest { display: flex; align-items: center; gap: .8rem; }
.quest-ic { font-size: 1.5rem; width: 42px; height: 42px; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--line); border-radius: 12px; flex: none; }
.quest-body { flex: 1; min-width: 0; }
.quest-t { font-weight: 600; margin-bottom: .3rem; }
.quest-xp { font: 800 .95rem/1 var(--display); color: var(--ink-2); min-width: 2.6rem; text-align: right; }
.quest.done .quest-t { text-decoration: line-through; color: var(--ink-2); }
.quest.done .bar i { background: var(--teal); }
.quest.done .quest-xp { color: var(--teal); }
.countdown { display: flex; align-items: baseline; gap: .5rem; }
.countdown b { font: 800 3.4rem/1 var(--display); color: var(--red); letter-spacing: -.04em; }
.tipcard { margin-top: 1rem; padding: .9rem 1rem; background: var(--gold-soft); border: 2px dashed var(--line); border-radius: var(--r-sm); }
.tipcard p { margin: 0; font-weight: 600; }
.tipcard .kicker { color: var(--ink-2); display: block; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.qk { display: flex; flex-direction: column; gap: .15rem; padding: 1rem; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); box-shadow: 0 4px 0 var(--shadow); text-decoration: none; color: var(--ink); transition: transform .1s, box-shadow .1s; }
.qk:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--shadow); }
.qk:active { transform: translateY(4px); box-shadow: none; }
.qk span { font-size: 1.7rem; line-height: 1.1; }
.qk b { font-family: var(--display); font-weight: 800; }
.qk i { font-style: normal; font-size: .82rem; color: var(--ink-2); }

/* ------------------------------ learn path ------------------------------ */
.group-h { display: flex; align-items: center; gap: 1rem; margin: 2.4rem 0 1rem; font: 700 .8rem/1 var(--stampfont); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.group-h::before, .group-h::after { content: ''; flex: 1; border-top: 2px dashed var(--rule); }
.unit { --u: var(--blue); --u-soft: var(--blue-soft); margin-bottom: 1.6rem; }
.unit.c-red { --u: var(--red); --u-soft: var(--red-soft); }
.unit.c-teal { --u: var(--teal); --u-soft: var(--teal-soft); }
.unit.c-gold { --u: var(--gold); --u-soft: var(--gold-soft); }
.unit-h { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; background: var(--u-soft); border: 2px solid var(--line); border-radius: var(--r); box-shadow: 4px 4px 0 var(--shadow); }
.unit-ic { font-size: 1.9rem; width: 56px; height: 56px; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line); border-radius: 50%; flex: none; }
.unit-t { flex: 1; min-width: 0; }
.unit-meta { font-size: .84rem; color: var(--ink-2); margin: .2rem 0 .45rem; }
.unit-t .bar i { background: var(--u); }
.unit-stamp { width: 44px; height: 44px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; border: 2px solid var(--line); transform: rotate(-10deg); flex: none; }
.unit-stamp .ic { stroke-width: 3; }
.trailwrap { position: relative; margin: 1.4rem 0 .4rem; }
.trailwrap > svg { position: absolute; top: 0; left: 50%; margin-left: -160px; width: 320px; pointer-events: none; overflow: visible; }
.trailwrap > svg path { fill: none; stroke: var(--rule); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 13; }
.trail { list-style: none; margin: 0; padding: 0; position: relative; }
.node { height: 136px; display: flex; flex-direction: column; align-items: center; transform: translateX(var(--dx)); }
.node-btn { position: relative; width: 78px; height: 78px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); box-shadow: 0 6px 0 var(--shadow); display: grid; place-items: center; transition: transform .1s, box-shadow .1s; flex: none; padding: 0; }
.node-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--shadow); }
.node-btn:active { transform: translateY(6px); box-shadow: 0 0 0 var(--shadow); }
.node-ic { font-size: 2rem; line-height: 1; }
.node:not(.done):not(.next) .node-ic { filter: grayscale(.85) opacity(.65); }
.node.done .node-btn { background: var(--u); }
.node.next .node-btn { background: var(--gold); animation: bob 1.800s ease-in-out infinite; }
.node-flag { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); font: 700 .72rem/1 var(--stampfont); letter-spacing: .1em; text-transform: uppercase; padding: .45em .7em .35em; border-radius: 8px; white-space: nowrap; }
.node-flag::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--ink); transform: translateX(-50%) rotate(45deg); }
.node-cap { margin-top: .55rem; text-align: center; max-width: 190px; line-height: 1.15; }
.node-cap b { display: block; font-size: .88rem; }
.node-stars { display: inline-flex; gap: 1px; color: var(--rule); margin-top: 2px; }
.node-stars .ic { width: 13px; height: 13px; }
.node-stars i.on { color: var(--gold); }
.node-stars i.on .ic { fill: currentColor; }
.lesson-sheet { text-align: center; }
.sheet-ic { font-size: 3rem; line-height: 1; margin-bottom: .5rem; }
.lesson-sheet .row { justify-content: center; }
.qlist { list-style: none; padding: 0; margin: 1.1rem 0 0; text-align: left; display: grid; gap: .5rem; font-size: .93rem; }
.qlist li { display: grid; grid-template-columns: auto auto 1fr; gap: .5rem; align-items: baseline; }
.qlist li .starchip { justify-self: start; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); display: inline-block; align-self: center; }
.dot.s-learning { background: var(--gold); }
.dot.s-mastered { background: var(--teal); }

/* ------------------------------ practice hub ------------------------------ */
.sec-h { margin: 1.8rem 0 .8rem; font: 700 .8rem/1 var(--stampfont); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.mode { position: relative; display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); box-shadow: 0 4px 0 var(--shadow); text-decoration: none; color: var(--ink); transition: transform .1s, box-shadow .1s; }
.mode:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--shadow); }
.mode:active { transform: translateY(4px); box-shadow: none; }
.mode-ic { font-size: 1.8rem; width: 52px; height: 52px; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--line); border-radius: 14px; flex: none; }
.mode b { font-family: var(--display); font-weight: 800; font-size: 1.05rem; }
.mode p { margin: .1rem 0 0; font-size: .86rem; color: var(--ink-2); line-height: 1.3; }
.mode-badge { position: absolute; top: -10px; right: 12px; background: var(--ink); color: var(--paper); font: 700 .7rem/1 var(--stampfont); letter-spacing: .06em; padding: .4em .6em .3em; border-radius: 6px; }
.mode.feature { background: var(--gold-soft); }
.mode.feature.red { background: var(--red-soft); }
.mode.off { opacity: .55; pointer-events: none; box-shadow: none; border-style: dashed; }

/* ------------------------------ study deck ------------------------------ */
.deckbar { position: sticky; top: var(--bar); z-index: 5; background: var(--paper); padding: .7rem 0; display: grid; gap: .6rem; border-bottom: 2px dashed var(--rule); margin-bottom: .6rem; }
input[type="search"], input[type="text"], input[type="date"], input:not([type]), select { width: 100%; padding: .7rem .9rem; border: 2px solid var(--line); border-radius: 12px; background: var(--card); min-height: 48px; }
input:disabled { opacity: .7; background: var(--paper-2); }
.deck-sec { margin: 1.6rem 0 .7rem; }
.qcard { background: var(--card); border: 2px solid var(--line); border-radius: var(--r-sm); margin-bottom: .55rem; }
.qcard[open] { box-shadow: 4px 4px 0 var(--shadow); }
.qcard summary { display: flex; gap: .7rem; align-items: center; padding: .75rem .9rem; cursor: pointer; list-style: none; }
.qcard summary::-webkit-details-marker { display: none; }
.qtext { flex: 1; font-weight: 600; }
.pips { display: inline-flex; gap: 3px; flex: none; }
.pips i { width: 7px; height: 16px; border-radius: 3px; background: var(--paper-2); border: 1.5px solid var(--line); }
.pips i.on { background: var(--teal); }
.qbody { padding: 0 .9rem .9rem; border-top: 2px dashed var(--rule); }
.needtag { display: inline-block; margin: .8rem 0 0; font: 700 .72rem/1 var(--stampfont); letter-spacing: .1em; text-transform: uppercase; background: var(--blue); color: #fff; padding: .45em .7em .35em; border-radius: 6px; }
.answers { list-style: none; margin: .6rem 0; padding: 0; display: grid; gap: .3rem; }
.answers li { position: relative; padding-left: 1.5rem; font-weight: 600; }
.answers li::before { content: ''; position: absolute; left: .25rem; top: .58em; width: 8px; height: 8px; background: var(--teal); border-radius: 2px; transform: rotate(45deg); }
.more summary { cursor: pointer; color: var(--blue); font-size: .9rem; font-weight: 600; }
.why { color: var(--ink-2); margin: .6rem 0; }
.hook { background: var(--gold-soft); border-left: 5px solid var(--gold); padding: .55rem .8rem; border-radius: 0 10px 10px 0; margin: .6rem 0; }
.hook b { display: block; font: 700 .68rem/1 var(--stampfont); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: .25rem; }
.qtools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .8rem; }
.qtools .stat { margin-left: auto; font-size: .8rem; }

/* ------------------------------ guide ------------------------------ */
.guide { display: grid; gap: .9rem; }
.gsec { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); }
.gsec[open] { box-shadow: 5px 5px 0 var(--shadow); }
.gsec > summary { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.2rem; cursor: pointer; list-style: none; }
.gsec > summary::-webkit-details-marker { display: none; }
.gsec > summary::after { content: '+'; margin-left: auto; font: 800 1.6rem/1 var(--display); color: var(--ink-2); }
.gsec[open] > summary::after { content: '–'; }
.gsec summary p { margin: .15rem 0 0; color: var(--ink-2); font-size: .92rem; }
.gsec-ic { font-size: 1.7rem; width: 52px; height: 52px; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--line); border-radius: 14px; flex: none; }
.gbody { padding: 0 1.2rem 1.2rem; border-top: 2px dashed var(--rule); }
.factgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin: 1rem 0; }
.fact { border: 2px solid var(--line); border-radius: var(--r-sm); padding: .8rem; text-align: center; background: var(--paper); }
.fact b { display: block; font: 800 2.3rem/1 var(--display); color: var(--red); letter-spacing: -.04em; }
.fact span { font-size: .8rem; color: var(--ink-2); line-height: 1.25; display: block; margin-top: .25rem; }
ul.plain, ul.links, ul.check, ol.steps { padding-left: 1.2rem; display: grid; gap: .45rem; margin: .8rem 0; }
ul.check { list-style: none; padding: 0; }
ul.check li { padding-left: 1.800rem; position: relative; }
ul.check li::before { content: ''; position: absolute; left: 0; top: .2em; width: 16px; height: 16px; border: 2px solid var(--line); border-radius: 4px; background: var(--card); }
table.cmp { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1rem 0; border: 2px solid var(--line); border-radius: var(--r-sm); overflow: hidden; font-size: .95rem; }
table.cmp th, table.cmp td { padding: .6rem .8rem; text-align: left; border-bottom: 1.5px solid var(--rule); }
table.cmp tr:last-child th, table.cmp tr:last-child td { border-bottom: 0; }
table.cmp thead th { background: var(--ink); color: var(--paper); font-family: var(--display); }
table.cmp tbody th { background: var(--paper); font-weight: 600; width: 38%; }
table.officials td { font-weight: 700; font-size: 1.05rem; }
.tipbox { background: var(--teal-soft); border: 2px solid var(--line); border-radius: var(--r-sm); padding: .7rem .9rem; }
.rule { display: flex; gap: .9rem; align-items: flex-start; padding: .8rem 0; border-bottom: 1.5px dashed var(--rule); }
.rule-tag { font: 700 .95rem/1 var(--stampfont); border: 2.500px solid var(--red); color: var(--red); padding: .5em .5em .35em; border-radius: 8px; transform: rotate(-4deg); flex: none; min-width: 4.2rem; text-align: center; }

/* ------------------------------ passport ------------------------------ */
.idcard { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; background: var(--blue); color: #FFFDF6; border: 2px solid var(--line); border-radius: 20px; padding: 1.4rem; box-shadow: 6px 6px 0 var(--shadow); position: relative; overflow: hidden; }
.idcard::before { content: ''; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 0 100%, transparent 0 14px, rgba(255, 255, 255, .07) 14px 15px); }
.id-photo { position: relative; width: 104px; height: 124px; background: #FFFDF6; color: #18203A; border: 2px solid #0D1226; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 800 3.4rem/1 var(--display); }
.id-photo span { font: 700 .66rem/1 var(--stampfont); letter-spacing: .2em; margin-top: .3rem; }
.id-main { position: relative; display: grid; gap: .4rem; min-width: 0; }
.id-main .muted { color: rgba(255, 255, 255, .75); font-size: .85rem; }
.id-row { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid rgba(255, 255, 255, .25); padding-bottom: .3rem; }
.id-row span { font: 700 .7rem/1.8 var(--stampfont); letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.id-row b { font-family: var(--display); font-size: 1.15rem; }
.idcard .bar { border-color: #0D1226; background: rgba(0, 0, 0, .25); }
.id-mrz { position: relative; grid-column: 1 / -1; font: 700 .82rem/1 var(--stampfont); letter-spacing: .18em; opacity: .6; white-space: nowrap; overflow: hidden; }
.statgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .7rem; margin-top: 1.4rem; }
.statgrid div { background: var(--card); border: 2px solid var(--line); border-radius: var(--r-sm); padding: .8rem .4rem; text-align: center; }
.statgrid b { display: block; font: 800 1.7rem/1 var(--display); letter-spacing: -.03em; }
.statgrid span { font-size: .74rem; color: var(--ink-2); }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; max-width: 420px; }
.heat i { aspect-ratio: 1; border-radius: 4px; background: var(--paper-2); border: 1.5px solid var(--rule); }
.heat .h1 { background: var(--gold-soft); border-color: var(--gold); }
.heat .h2 { background: var(--gold); border-color: var(--line); }
.heat .h3 { background: var(--red); border-color: var(--line); }
.heat .hf { opacity: .3; border-style: dashed; }
.mocklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.mocklist li { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form label, .field, .you-field { display: grid; gap: .35rem; font-weight: 600; font-size: .92rem; }
.form small, .you-field small, .toggle small { font-weight: 400; color: var(--ink-2); display: block; }
.toggles { display: grid; gap: .8rem; margin-top: 1.2rem; }
.toggle { display: flex; gap: .8rem; align-items: flex-start; cursor: pointer; text-align: left; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw { width: 50px; height: 30px; border: 2px solid var(--line); border-radius: 99px; background: var(--paper-2); position: relative; flex: none; transition: background .15s; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); transition: transform .18s cubic-bezier(.3, 1.5, .5, 1); }
.toggle input:checked + .sw { background: var(--teal); }
.toggle input:checked + .sw::after { transform: translateX(20px); }
.toggle input:focus-visible + .sw { outline: 3px solid var(--gold); outline-offset: 3px; }
.filebtn { cursor: pointer; }

/* ------------------------------ welcome ------------------------------ */
.wizard { min-height: calc(100vh - var(--bar)); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.2rem 3rem; max-width: 620px; margin: 0 auto; }
.wz-dots { display: flex; gap: 6px; margin-bottom: 1.6rem; justify-content: center; }
.wz-dots i { width: 34px; height: 8px; border-radius: 99px; background: var(--paper-2); border: 1.5px solid var(--line); }
.wz-dots i.on { background: var(--red); }
.wz-dots i.past { background: var(--ink); }
.wz-body { width: 100%; display: grid; gap: 1.1rem; animation: rise .4s cubic-bezier(.2, .9, .3, 1); }
.wz-body.step-0 { text-align: center; justify-items: center; }
.wz-body.step-0 .field { width: 100%; text-align: left; }
.wz-body .btn.big { width: 100%; }
.wz-art { display: grid; place-items: center; margin-bottom: .4rem; }
.seal { width: 150px; height: 150px; border-radius: 50%; background: var(--red); color: #FFFDF6; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 700 .95rem/1 var(--stampfont); letter-spacing: .28em; gap: .2rem; box-shadow: inset 0 0 0 5px var(--red), inset 0 0 0 7px #FFFDF6, 6px 6px 0 var(--shadow); border: 2px solid var(--line); transform: rotate(-9deg); animation: slam .7s cubic-bezier(.3, 1.6, .5, 1) both; }
.seal b { font-size: 2.8rem; line-height: 1; letter-spacing: 0; }
.choices { display: grid; gap: .8rem; }
.choices.three { grid-template-columns: repeat(3, 1fr); }
.choice { text-align: left; display: grid; gap: .15rem; padding: 1rem 1.1rem; border: 2px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: 0 4px 0 var(--shadow); transition: transform .08s, box-shadow .08s; }
.choice:active { transform: translateY(4px); box-shadow: none; }
.choice b { font-family: var(--display); font-size: 1.1rem; }
.choice span { color: var(--ink-2); font-size: .9rem; }
.choice em { font: 700 .72rem/1 var(--stampfont); letter-spacing: .1em; text-transform: uppercase; font-style: normal; color: var(--red); margin-top: .35rem; }
.choice.on { background: var(--gold-soft); box-shadow: 0 4px 0 var(--shadow), inset 0 0 0 2px var(--line); }
.btn.back { margin-top: 1rem; }

/* ------------------------------ play ------------------------------ */
.play { min-height: calc(100vh - var(--bar)); min-height: calc(100dvh - var(--bar)); display: flex; flex-direction: column; }
.play-top { display: flex; align-items: center; gap: .8rem; padding: 1rem clamp(1rem, 4vw, 2rem); max-width: 860px; width: 100%; margin: 0 auto; }
.progress { flex: 1; height: 18px; background: var(--paper-2); border: 2px solid var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--teal) 0 10px, color-mix(in srgb, var(--teal) 82%, #fff) 10px 20px); border-radius: 99px; transition: width .45s cubic-bezier(.2, .9, .3, 1); }
.progress i.hot { background: var(--red); }
.play-body { flex: 1; padding: .6rem clamp(1rem, 4vw, 2rem) 2rem; max-width: 760px; width: 100%; margin: 0 auto; }
.play-foot { position: sticky; bottom: 0; border-top: 2px solid var(--line); background: var(--card); z-index: 4; }
.play-foot:empty { display: none; }
.foot-in { max-width: 760px; margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2rem) calc(1rem + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.foot-in:empty { display: none; }
.foot-in.col { flex-direction: column; align-items: stretch; gap: .5rem; }
.hint { font-size: .9rem; }
.play-foot.fb { animation: slideup .28s cubic-bezier(.2, 1.1, .4, 1); }
.fb-body { max-height: 36vh; overflow-y: auto; overscroll-behavior: contain; }
.play-foot.fb.ok { background: var(--teal-soft); }
.play-foot.fb.no { background: var(--red-soft); }
.fb-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.fb-title { font: 800 1.35rem/1.1 var(--display); display: flex; align-items: center; gap: .45rem; }
.fb.ok .fb-title { color: var(--teal); }
.fb.no .fb-title { color: var(--red); }
.fb-title .ic { stroke-width: 3.2; }
.fb-note { margin: 0; font-size: .95rem; }
.fb-body .why { margin: .3rem 0; color: var(--ink); opacity: .85; font-size: .95rem; }
.fb-body .answers { margin: .3rem 0 .5rem; }
.fb-body .hook { background: rgba(255, 255, 255, .45); }
[data-theme="dark"] .fb-body .hook { background: rgba(0, 0, 0, .25); }
.fb-ans > b { font: 700 .7rem/1 var(--stampfont); letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
.fb-actions { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-top: .3rem; flex-wrap: wrap; }
.fb-actions .btn.big { margin-left: auto; }

.qcardbig { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 22px; padding: 1.3rem 1.4rem 1.6rem; box-shadow: 6px 6px 0 var(--shadow); }
.qcardbig.enter, .summary.enter { animation: rise .38s cubic-bezier(.2, .9, .3, 1); }
.qcardbig.center { text-align: center; }
.qcardbig.center .lede { margin-inline: auto; }
.ribbon { position: absolute; top: -13px; left: 22px; background: var(--gold); border: 2px solid var(--line); font: 700 .72rem/1 var(--stampfont); letter-spacing: .14em; text-transform: uppercase; padding: .45em .8em .35em; border-radius: 7px; transform: rotate(-3deg); color: #18203A; }
.ribbon.alt { background: var(--red); color: #fff; }
.ribbon.rev { background: var(--blue); color: #fff; }
.opt.picked { outline: 3px solid var(--ink); outline-offset: 2px; }
.qmeta { display: flex; align-items: center; gap: .55rem; font-size: .84rem; color: var(--ink-2); margin-bottom: 1rem; }
.qmeta > * { flex: none; }
.qmeta > span:nth-child(2) { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qmeta > .spacer { flex: 1 1 0; }
.qtitle { font-size: clamp(1.45rem, 3.6vw, 2.05rem); line-height: 1.16; text-wrap: balance; }
.qtitle.veiled { filter: blur(11px); user-select: none; }
.ansbox { margin: 1.2rem 0 .8rem; border: 2px solid var(--line); border-radius: var(--r); background: var(--teal-soft); padding: .9rem 1.1rem; }
.ansbox-h { font: 700 .72rem/1 var(--stampfont); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.ansbox .answers li { font-size: 1.12rem; }
.you-field { margin-top: .7rem; }
.you-fixed { font-weight: 700; font-size: 1.1rem; margin-top: .5rem; }
.opts { display: grid; gap: .7rem; margin-top: 1.4rem; }
.opts.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt { display: flex; align-items: center; gap: .8rem; text-align: left; padding: .85rem 1rem; border: 2px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: 0 4px 0 var(--shadow); font-weight: 600; font-size: 1.05rem; transition: transform .08s, box-shadow .08s, background .12s; min-height: 58px; }
.opt:hover:not(:disabled) { background: var(--paper); transform: translateY(-1px); box-shadow: 0 5px 0 var(--shadow); }
.opt:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.key { width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 8px; display: grid; place-items: center; font: 800 .85rem/1 var(--display); flex: none; background: var(--paper); }
.opt.sel { background: var(--blue-soft); box-shadow: 0 4px 0 var(--shadow), inset 0 0 0 2px var(--blue); }
.opt.sel .key { background: var(--blue); color: #fff; }
.opt:disabled { cursor: default; color: inherit; }
.opt:disabled:not(.good):not(.bad) { opacity: .5; box-shadow: none; }
.opt.good { background: var(--teal-soft); border-color: var(--teal); box-shadow: 0 4px 0 var(--teal); animation: nod .35s; }
.opt.good .key { background: var(--teal); color: #fff; border-color: var(--teal); }
.opt.bad { background: var(--red-soft); border-color: var(--red); box-shadow: 0 4px 0 var(--red); animation: shake .35s; }
.opt.bad .key { background: var(--red); color: #fff; border-color: var(--red); }
.typebox { display: flex; gap: .6rem; margin-top: 1.4rem; align-items: center; }
.typebox input { font-size: 1.15rem; min-height: 58px; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .06); }
.typebox .iconbtn { width: 58px; height: 58px; border-radius: 50%; }
.shake { animation: shake .35s; }
.flash { margin-top: 1.4rem; text-align: center; }
.flash .ansbox { text-align: left; }
.speed-score { position: absolute; top: -16px; right: 18px; background: var(--ink); color: var(--paper); border-radius: 12px; padding: .4rem .8rem; display: flex; align-items: baseline; gap: .35rem; transform: rotate(3deg); }
.speed-score b { font: 800 1.6rem/1 var(--display); }
.speed-score span { font-size: .75rem; }
.play-empty { margin: auto; text-align: center; padding: 3rem 1.2rem; max-width: 520px; }
.play-empty .btn { margin-top: 1.2rem; }

.summary { text-align: center; padding: 1.2rem 0 2rem; }
.summary .lede { margin-inline: auto; }
.sum-burst { font-size: 4rem; line-height: 1; animation: slam .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.sum-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin: 1.6rem 0; }
.sum-stats div { border: 2px solid var(--line); border-radius: var(--r); padding: .9rem .4rem; background: var(--card); box-shadow: 0 4px 0 var(--shadow); animation: rise .5s both; }
.sum-stats div:nth-child(2) { animation-delay: .08s; } .sum-stats div:nth-child(3) { animation-delay: .16s; } .sum-stats div:nth-child(4) { animation-delay: .24s; }
.sum-stats b { display: block; font: 800 1.9rem/1 var(--display); letter-spacing: -.03em; }
.sum-stats span { font-size: .76rem; color: var(--ink-2); }
.s-xp { background: var(--gold-soft) !important; } .s-acc { background: var(--teal-soft) !important; } .s-combo { background: var(--red-soft) !important; } .s-streak { background: var(--blue-soft) !important; }
.sum-missed { text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.sum-missed ul { list-style: none; padding: 0; margin: .7rem 0 0; display: grid; gap: .8rem; }
.sum-missed li { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; }
.sum-missed li div { display: grid; gap: .15rem; }
.sum-missed li div > span { color: var(--ink-2); font-size: .93rem; }
.sum-missed li .acc { color: var(--teal); font-weight: 600; }
.sum-missed li .btn { justify-self: start; margin-top: .3rem; }
.sum-missed.review li.ok .qn { background: var(--teal); color: #fff; }
.sum-missed.review li.no .qn { background: var(--red); color: #fff; }

/* mock */
.tally { flex: 1; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.tally i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); }
.tally i.r { background: var(--teal); }
.tally i.x { border-radius: 3px; }
.tally i.w { background: var(--red); }
.tally .sep { width: 10px; }
.officer { font-size: 4rem; line-height: 1; width: 104px; height: 104px; display: grid; place-items: center; margin: 0 auto .8rem; background: var(--blue-soft); border: 2px solid var(--line); border-radius: 50%; }
.officer.sm { font-size: 1.8rem; width: 52px; height: 52px; margin: 0; flex: none; }
.officer-line { display: flex; gap: .9rem; align-items: flex-start; }
.mockroom .plain { max-width: 46ch; margin-inline: auto; }
.mockroom .toggles { max-width: 46ch; margin-inline: auto; }
.verdict { display: inline-block; margin-bottom: 1rem; }
.verdict span { display: inline-block; font: 700 1.9rem/1 var(--stampfont); letter-spacing: .14em; padding: .5em .7em .38em; border: 5px double currentColor; border-radius: 12px; transform: rotate(-7deg); animation: slam .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.verdict.pass { color: var(--teal); }
.verdict.fail { color: var(--red); }

/* english */
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.tabs a { padding: .5rem 1rem; border: 2px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; color: var(--ink); font-weight: 700; }
.tabs a.on { background: var(--ink); color: var(--paper); }
.engcard { text-align: center; padding: 1.6rem 1.3rem 1.8rem; }
.sentence { font: 800 clamp(1.5rem, 4.2vw, 2.3rem)/1.2 var(--display); letter-spacing: -.02em; margin: 1.2rem 0; text-wrap: balance; }
.sentence.ghosted { color: var(--blue); }
.typebox.wide { max-width: 600px; margin-inline: auto; }
.e-result { min-height: 1.6rem; margin-top: 1rem; }
.verdictline { font: 800 1.25rem/1 var(--display); display: inline-flex; align-items: center; gap: .45rem; }
.verdictline.ok { color: var(--teal); }
.verdictline.no { color: var(--red); }
.marks { font-size: 1.15rem; font-weight: 700; }
.marks .ok { color: var(--teal); }
.marks .no { color: var(--red); text-decoration: underline wavy; }
.heard { font-style: italic; color: var(--ink-2); }
.vgroup h4 { margin-top: .9rem; font: 700 .72rem/1 var(--stampfont); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.vwords { display: flex; flex-wrap: wrap; gap: .4rem; }
.vword { border: 2px solid var(--line); border-radius: 9px; background: var(--paper); padding: .25rem .6rem; font-weight: 600; }
.vword:hover { background: var(--gold-soft); }

/* ------------------------------ motion ------------------------------ */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
@keyframes slam { 0% { opacity: 0; transform: scale(2.4) rotate(12deg); } 60% { opacity: 1; } 100% { opacity: 1; } }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes nod { 40% { transform: scale(1.03); } }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--red) 25%, transparent); } }
.view > * { animation: rise .42s cubic-bezier(.2, .9, .3, 1) both; }
.view > *:nth-child(2) { animation-delay: .05s; } .view > *:nth-child(3) { animation-delay: .1s; } .view > *:nth-child(4) { animation-delay: .15s; } .view > *:nth-child(5) { animation-delay: .2s; } .view > *:nth-child(n+6) { animation-delay: .24s; }
body.focus .view > * { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
}

/* ------------------------------ responsive ------------------------------ */
@media (max-width: 980px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statgrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .view { padding: 1.3rem 1rem 6.500rem; }
  .topstats { display: flex; flex: none; }
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--card); border-top: 2px solid var(--line); padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom)); }
  .tabbar .navlink { flex-direction: column; gap: .15rem; padding: .4rem .1rem; font-size: .64rem; text-align: center; border: 0; border-radius: 10px; line-height: 1.1; }
  .tabbar .navlink.on { box-shadow: none; background: var(--gold-soft); }
  .cols { grid-template-columns: 1fr; gap: 0; }
  .cta { flex-direction: column; align-items: stretch; }
  .cta .btn { width: 100%; }
  .form { grid-template-columns: 1fr; }
  .factgrid { grid-template-columns: repeat(2, 1fr); }
  .opts.many { grid-template-columns: 1fr; }
  .choices.three { grid-template-columns: 1fr; }
  .deckbar { top: var(--bar); }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .sum-stats { grid-template-columns: repeat(2, 1fr); }
  .idcard { grid-template-columns: 1fr; justify-items: start; }
  .foot-in { padding-inline: 1rem; }
  .fb-actions .btn { flex: 1; }
  .qcardbig { padding: 1.1rem 1rem 1.3rem; border-radius: 18px; }
  .node { --scale: .8; }
  .unit-h { padding: .8rem; gap: .7rem; }
  .unit-h .btn { display: none; }
  .tile { padding: .8rem .5rem; }
  .week { gap: 3px; }
  .wk i { width: 17px; height: 17px; }
  .wk i .ic { width: 10px; height: 10px; }
  .qmeta .starchip { font-size: 0; padding: .1em .4em; }
  .qmeta .starchip::first-letter { font-size: .8rem; }
}

/* ------------------------------ top bar */
/* top bar */
.maincol { position: relative; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 36; height: var(--bar); background: var(--card); border-bottom: 2px solid var(--line); }
.bar-in { height: 100%; display: flex; align-items: center; gap: .4rem; padding: 0 clamp(.6rem, 2.5vw, 1.6rem); }
.barbtn { position: relative; height: 38px; padding: 0 .7rem; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-weight: 700; font-size: .88rem; box-shadow: 0 3px 0 var(--shadow); flex: none; transition: transform .08s, box-shadow .08s; }
.barbtn:hover:not(:disabled) { background: var(--paper); }
.barbtn:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.barbtn:disabled { opacity: .32; box-shadow: none; cursor: default; }
.barbtn.rest { color: var(--ink-2); background: var(--paper); }
.barbtn.rest .ic { opacity: .7; }
.barbtn.ico { width: 38px; padding: 0; }
.barbtn.add { background: var(--gold); color: #18203A; }
.barbtn.add:hover:not(:disabled) { background: #F2B93C; }
.barbtn.off { background: var(--paper-2); color: var(--ink-2); }
.barbtn em { position: absolute; top: -8px; right: -8px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font: 800 .68rem/18px var(--display); font-style: normal; text-align: center; border: 1.5px solid var(--line); }
.bar-title { flex: 1; min-width: 0; margin-left: .5rem; font: 800 .98rem/1 var(--display); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-sep { width: 2px; height: 22px; background: var(--rule); margin: 0 .15rem; flex: none; }
.savestate { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; color: var(--teal); margin-right: .3rem; flex: none; white-space: nowrap; }
.savestate .ic { width: 14px; height: 14px; stroke-width: 3; }
.savestate i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: blink .8s infinite; }
.savestate.saving { color: var(--ink-2); }
.savestate.error { color: var(--red); }
.savestate.error i { animation: none; }
.toast-btn { margin-left: .5rem; background: transparent; color: inherit; border: 1.5px solid currentColor; border-radius: 8px; padding: .1rem .65rem; font-weight: 700; }
.toast .where { opacity: .75; }
@keyframes blink { 50% { opacity: .25; } }

/* ------------------------------ sticky notes */
.notes-layer { position: absolute; top: var(--bar); left: 0; right: 0; height: 0; z-index: 34; }
.n-yellow { --nc: #FFE66B; --nd: #D9B91F; }
.n-pink { --nc: #FFB5CB; --nd: #E57E9F; }
.n-blue { --nc: #A9D8FF; --nd: #5FA9E6; }
.n-green { --nc: #BDEFA9; --nd: #79C763; }
.n-orange { --nc: #FFCB8E; --nd: #EE9C3F; }
.n-purple { --nc: #DCC6FF; --nd: #A988EA; }
.note { position: absolute; width: 220px; padding-bottom: 6px; background-color: var(--nc); background-image: linear-gradient(180deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 34%, rgba(0, 0, 0, .05)); color: #1B2030; border-radius: 3px 3px 14px 3px; border-bottom: 3px solid var(--nd); box-shadow: 2px 7px 14px rgba(15, 20, 40, .3); transform: rotate(var(--tilt, 0deg)); transition: transform .15s, box-shadow .15s; animation: notein .28s cubic-bezier(.2, 1.4, .4, 1); }
.note:hover, .note:focus-within { transform: rotate(0deg); box-shadow: 3px 10px 22px rgba(15, 20, 40, .38); }
.note:focus-within { outline: 2px solid #1B2030; outline-offset: 0; }
.note.dragging { transform: rotate(0deg) scale(1.04); box-shadow: 6px 18px 30px rgba(15, 20, 40, .42); transition: none; cursor: grabbing; }
.note.pinned { position: fixed; box-shadow: 0 0 0 2px #1B2030, 3px 9px 18px rgba(15, 20, 40, .4); }
.note-pin { position: absolute; top: -12px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FF9C95 0 16%, #D7362E 46%, #8D1C17 100%); box-shadow: 0 3px 4px rgba(0, 0, 0, .38); cursor: grab; touch-action: none; }
.note-pin::after { content: ''; position: absolute; left: 9px; top: 19px; width: 3px; height: 6px; background: rgba(0, 0, 0, .28); border-radius: 0 0 3px 3px; }
.note.pinned .note-pin { background: radial-gradient(circle at 35% 30%, #FFF2B8 0 16%, #E5A31C 48%, #8A5D00 100%); }
.note-head { display: flex; align-items: center; gap: 2px; height: 32px; padding: 0 4px 0 10px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.grip { flex: 1; height: 11px; max-width: 46px; margin-right: auto; background-image: radial-gradient(rgba(27, 32, 48, .42) 1.2px, transparent 1.5px); background-size: 6px 5.5px; }
.note-btn { width: 28px; height: 28px; border: 0; padding: 0; background: transparent; border-radius: 7px; display: grid; place-items: center; color: rgba(27, 32, 48, .72); }
.note-btn:hover { background: rgba(0, 0, 0, .12); color: #1B2030; }
.note-btn .ic { width: 16px; height: 16px; }
.pinbtn[aria-pressed="true"] { background: #1B2030; color: #FFE66B; }
.note textarea { display: block; width: 100%; min-height: 66px; border: 0; margin: 0; padding: 2px 12px 6px; background: transparent; resize: none; outline: none; color: inherit; font: 600 .97rem/1.35 var(--body); overflow-y: auto; }
.note textarea::placeholder { color: rgba(27, 32, 48, .45); }
.note-foot { display: flex; gap: 6px; padding: 2px 11px 3px; opacity: 0; transition: opacity .15s; }
.note:hover .note-foot, .note:focus-within .note-foot { opacity: 1; }
.sw-dot { width: 17px; height: 17px; padding: 0; border-radius: 50%; border: 1.5px solid rgba(27, 32, 48, .6); background: var(--nc); }
.sw-dot.on { box-shadow: 0 0 0 2px var(--nc), 0 0 0 3.5px #1B2030; }
@media (hover: none) { .note-foot { opacity: 1; } .sw-dot { width: 21px; height: 21px; } .note-btn { width: 32px; height: 32px; } }
@keyframes notein { from { opacity: 0; transform: scale(.7) rotate(-8deg); } }
.allnotes-page { border-top: 2px dashed var(--rule); padding-top: .8rem; margin-top: .9rem; }
.allnotes-page header { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.allnotes-page ul { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .45rem; }
.allnotes-page li { background: var(--nc); border-bottom: 3px solid var(--nd); color: #1B2030; padding: .5rem .75rem; border-radius: 3px 3px 10px 3px; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; }
@media (max-width: 720px) {
  .barbtn .lbl { display: none; }
  .barbtn { width: 38px; padding: 0; }
  .bar-in { gap: .3rem; }
}
@media (max-width: 520px) {
  .note { width: 178px; }
  .savestate span { display: none; }
  .bar-sep { display: none; }
  .bar-title { font-size: .85rem; margin-left: .2rem; }
}
