/* ══════════════════════════════════════════════════════════════════
   Katto Learning Hub, cozy cream pixel style (borrowed from Katto's
   v0.54 cozy cards: cream paper, stepped ink outline, hard pixel shadow,
   Galmuri labels, Lora headings).
   ══════════════════════════════════════════════════════════════════ */
@font-face { font-family: "Galmuri11"; src: url("../fonts/Galmuri11-latin.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/Lora-latin.ttf") format("truetype"); font-display: swap; font-weight: 400 700; }

:root {
  --ink: #3b2c4f; --paper: #fff8e8; --soft: #f3ecdc; --desk: #f6ecd9; --bg: #efe3cc;
  --mute: #6a5a84; --text: #4a3d60; --line: rgba(59, 44, 79, 0.22);
  --lilac: #b69cff; --lilac-d: #7a5cff; --pink: #ffb8c6; --pink-l: #ffe0ea; --butter: #ffe9b0;
  --gold: #ffd34d; --gold-d: #c99a1c; --mint: #8fe3b0; --mint-d: #2f9e6e; --red: #e5566b; --red-l: #ffd9de;
  --os: #6fd3b0; --os-d: #23896a; --os-l: #d9f6ea;
  --la: #c4acff; --la-d: #6d4fe0; --la-l: #ece4ff;
  --shadow: rgba(30, 16, 50, 0.3);
  --on: color-mix(in srgb, var(--lilac) 32%, var(--paper));
  --pix: "Galmuri11", ui-monospace, Menlo, Monaco, monospace;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --nav-h: 68px;
  color-scheme: light;
}
:root[data-theme="night"] {
  --ink: #e9e0ff; --paper: #2a2140; --soft: #221a36; --desk: #1d1731; --bg: #151027;
  --mute: #b6a9da; --text: #ddd3f5; --line: rgba(233, 224, 255, 0.2);
  --butter: #3f3363; --pink-l: #4a2f4f; --red-l: #4d2530; --os-l: #1d3b35; --la-l: #2e2553;
  --os-d: #7fe6c2; --la-d: #cdb9ff; --mint-d: #8fe3b0; --gold-d: #ffd34d;
  --shadow: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--text); background: var(--bg);
  font: 400 16px/1.55 var(--sans), "Apple Color Emoji", "Segoe UI Emoji";
  /* a faint pixel checker, like paper grain */
  background-image:
    linear-gradient(45deg, rgba(59,44,79,0.035) 25%, transparent 25%, transparent 75%, rgba(59,44,79,0.035) 75%),
    linear-gradient(45deg, rgba(59,44,79,0.035) 25%, transparent 25%, transparent 75%, rgba(59,44,79,0.035) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
  overflow-x: hidden;
}
:root[data-theme="night"] body { background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1.5px); background-size: 22px 22px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--lilac-d); }
img, svg { max-width: 100%; }
.pxa { width: 18px; height: 18px; image-rendering: pixelated; vertical-align: -3px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px dashed var(--lilac-d); outline-offset: 3px; }

/* ── the stepped pixel outline ── */
.px, .card {
  background: var(--paper); color: var(--ink);
  box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), 6px 10px 0 0 var(--shadow);
}
.px2 { box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink); }
.card { padding: 16px 16px 16px; margin: 22px 4px; position: relative; }
.card.tight { padding: 12px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

/* ── top bar ── */
#top {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px;
  padding: 10px max(12px, env(safe-area-inset-left)) 10px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--paper); box-shadow: 0 4px 0 0 var(--ink), 0 8px 0 0 var(--shadow);
}
#brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
#brand .logo { width: 30px; height: 30px; image-rendering: pixelated; flex: none; }
#brand b { font: 700 13px/1.1 var(--pix); letter-spacing: 0.02em; white-space: nowrap; }
#brand small { display: block; font: 700 10px/1.1 var(--pix); color: var(--mute); }
.top-chips { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border: none; background: var(--soft); color: var(--ink);
  font: 700 12px/1 var(--pix); white-space: nowrap; font-variant-numeric: tabular-nums;
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
}
button.chip:hover { background: var(--butter); }
button.chip:active { transform: translate(1px, 2px); }
.chip .pxa { width: 15px; height: 15px; }
#chip-count { background: var(--pink-l); }
@media (max-width: 560px) { #brand > span { display: none; } .chip { padding: 0 7px; } }
@media (max-width: 360px) { #chip-fish .lbl { display: none; } .top-chips { gap: 4px; } }

/* ── layout ── */
main { width: min(100%, 760px); margin: 0 auto; padding: 8px 14px calc(var(--nav-h) + 110px + env(safe-area-inset-bottom)); }
.view-enter { animation: viewIn 0.28s steps(5, end); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); line-height: 1.2; }
h1 { font-size: 28px; margin: 18px 0 6px; }
h2 { font-size: 22px; margin: 4px 0 10px; }
h3 { font-size: 18px; margin: 14px 0 8px; }
p { margin: 8px 0; }
.lbl, .kicker { font: 700 11px/1.2 var(--pix); letter-spacing: 0.06em; text-transform: lowercase; color: var(--mute); }
.sec { display: flex; align-items: center; gap: 8px; margin: 26px 4px 10px; font: 700 12px/1 var(--pix); letter-spacing: 0.06em; color: var(--mute); text-transform: lowercase; }
.sec::after { content: ""; flex: 1; height: 2px; background-image: linear-gradient(90deg, var(--line) 50%, transparent 50%); background-size: 6px 2px; }
.muted { color: var(--mute); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
hr.dots { border: none; height: 2px; margin: 14px 0; background-image: linear-gradient(90deg, var(--line) 50%, transparent 50%); background-size: 6px 2px; }

/* ── pixel buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; margin: 3px;
  border: none; border-radius: 0; background: var(--paper); color: var(--ink); text-decoration: none;
  font: 700 13px/1.1 var(--pix); letter-spacing: 0.01em; user-select: none; -webkit-user-select: none;
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 3px 5px 0 0 var(--shadow);
}
.btn:hover { background: var(--butter); }
.btn:active { transform: translate(2px, 3px); box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink); }
.btn.main { background: var(--on); }
.btn.os { background: var(--os-l); }
.btn.la { background: var(--la-l); }
.btn.big { min-height: 54px; padding: 0 20px; font-size: 15px; }
.btn.wide { display: flex; width: calc(100% - 6px); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 11.5px; }
.btn.ghost { background: transparent; box-shadow: none; text-decoration: underline dotted; color: var(--mute); }
.btn.ghost:active { transform: none; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn .pxa { width: 18px; height: 18px; }
.btn.big .pxa { width: 22px; height: 22px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg { display: inline-flex; gap: 0; margin: 3px; box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink); }
.seg button { min-height: 34px; padding: 0 12px; border: none; background: var(--paper); color: var(--ink); font: 700 12px/1 var(--pix); }
.seg button + button { box-shadow: -2px 0 0 0 var(--ink); }
.seg button.on { background: var(--on); }
.seg button.on.os { background: var(--os); color: #10302a; }
.seg button.on.la { background: var(--la); color: #231650; }

/* ── countdown hero ── */
.hero { padding: 0; overflow: hidden; }
.hero .scene-wrap { position: relative; background: #1d1842; }
.hero canvas { display: block; width: 100%; aspect-ratio: 256 / 100; image-rendering: pixelated; cursor: pointer; touch-action: manipulation; }
.hero .cd {
  position: absolute; left: 0; right: 0; top: 0; padding: 10px 12px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
}
.cd-box { background: rgba(255, 248, 232, 0.94); color: #3b2c4f; padding: 7px 10px 8px; box-shadow: 0 -2px 0 0 #3b2c4f, 0 2px 0 0 #3b2c4f, -2px 0 0 0 #3b2c4f, 2px 0 0 0 #3b2c4f, 3px 4px 0 0 rgba(30,16,50,0.35); }
.cd-box .lbl { color: #6a5a84; }
.cd-big { font: 700 26px/1 var(--pix); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; margin-top: 4px; white-space: nowrap; }
.cd-big small { font-size: 13px; color: #6a5a84; margin: 0 3px 0 1px; }
.cd-mini { font: 700 12px/1.2 var(--pix); color: #3b2c4f; margin-top: 4px; }
@media (max-width: 420px) { .cd-big { font-size: 20px; } .cd-big small { font-size: 11px; } .hero .cd { padding: 7px; } .cd-box { padding: 5px 7px 6px; } }
.hero-foot { padding: 12px 14px 14px; border-top: 4px solid var(--ink); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.whims { display: flex; flex-wrap: wrap; gap: 6px; }
.whim { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; background: var(--soft); font: 700 11.5px/1.2 var(--pix); color: var(--ink); }
.whim .pxa { width: 14px; height: 14px; }

/* ── the next-thing card ── */
.next-card { display: flex; gap: 14px; align-items: center; }
.next-card .ic { width: 56px; height: 56px; flex: none; display: grid; place-items: center; background: var(--ink); box-shadow: 3px 3px 0 0 var(--shadow); }
.next-card .ic .pxa { width: 36px; height: 36px; }
.next-card .t { font: 600 19px/1.25 var(--serif); color: var(--ink); }
.next-card .why { font-size: 13.5px; color: var(--mute); margin-top: 3px; }

/* ── cat room ── */
.cat-room { position: relative; padding: 0; overflow: visible; }
.room-scene {
  position: relative; height: 220px; overflow: visible;
  background:
    linear-gradient(180deg, transparent 0 70%, var(--desk) 70% 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--lilac) 18%, var(--desk)), var(--desk));
}
.room-scene::after { /* the floor edge */
  content: ""; position: absolute; left: 0; right: 0; top: 70%; height: 4px; background: var(--ink); opacity: 0.85; z-index: 0;
}
.room-window {
  position: absolute; left: 50%; top: 14px; width: 128px; height: 84px; transform: translateX(-50%);
  background: #9fd3ff; box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink);
  overflow: hidden;
}
.room-window canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.room-window::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent calc(50% - 2px), var(--ink) calc(50% - 2px), var(--ink) calc(50% + 2px), transparent calc(50% + 2px)), linear-gradient(180deg, transparent calc(50% - 2px), var(--ink) calc(50% - 2px), var(--ink) calc(50% + 2px), transparent calc(50% + 2px)); }
.room-shelf { position: absolute; left: 14px; top: 40px; display: flex; gap: 2px; align-items: flex-end; }
.room-shelf i { display: block; width: 10px; box-shadow: 0 0 0 2px var(--ink); }
.room-shelf::after { content: ""; position: absolute; left: -6px; right: -6px; bottom: -6px; height: 4px; background: var(--ink); }
.room-plant { position: absolute; right: 18px; top: 58px; }
.room-plant .pxa { width: 40px; height: 40px; }
.cats-stage { z-index: 1; position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; align-items: flex-end; gap: 0; height: 150px; }
.cat-slot { position: relative; width: 150px; height: 150px; touch-action: manipulation; cursor: grab; -webkit-user-select: none; user-select: none; }
.cat-slot:active { cursor: grabbing; }
.cat-slot .kcat { width: 100%; height: 100%; display: block; overflow: visible; }
.cat-slot .nm { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); font: 700 11px/1 var(--pix); background: var(--paper); color: var(--ink); padding: 3px 6px; box-shadow: 0 0 0 2px var(--ink); white-space: nowrap; pointer-events: none; }
.cat-slot.hop { animation: hop 0.7s steps(7, end) 1; }
@keyframes hop { 0%, 100% { translate: 0 0; } 25% { translate: 0 -16px; } 45% { translate: 0 -22px; } 65% { translate: 0 -8px; } 82% { translate: 0 0; } 90% { translate: 0 -4px; } }
.cat-slot.tilt .kcat { animation: tilt 1.1s steps(6, end) 1; transform-origin: 50% 80%; }
@keyframes tilt { 0%, 100% { rotate: 0deg; } 30%, 70% { rotate: -7deg; } }
.cat-slot.wiggle { animation: wig 0.5s steps(4, end) 2; }
@keyframes wig { 0%, 100% { translate: 0 0; } 25% { translate: -3px 0; } 75% { translate: 3px 0; } }
@media (max-width: 420px) { .cat-slot { width: 128px; height: 128px; } .room-scene { height: 200px; } .cats-stage { height: 130px; } }
.room-actions { padding: 10px 12px 12px; border-top: 4px solid var(--ink); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; }

/* speech bubbles */
.bubble {
  position: absolute; z-index: 30; max-width: 250px; min-width: 120px; padding: 9px 11px; background: #fff; color: #2b2240;
  font: 600 13.5px/1.35 var(--sans); box-shadow: 0 -2px 0 0 #2b2240, 0 2px 0 0 #2b2240, -2px 0 0 0 #2b2240, 2px 0 0 0 #2b2240, 3px 4px 0 0 rgba(30,16,50,0.3);
  animation: pop 0.22s steps(3, end); pointer-events: auto;
}
.bubble b { color: #6d4fe0; }
.bubble .who { display: block; font: 700 10px/1 var(--pix); color: #6a5a84; margin-bottom: 4px; text-transform: lowercase; }
.bubble::after { content: ""; position: absolute; left: calc(50% - 6px); bottom: -10px; width: 12px; height: 8px; background: #2b2240; clip-path: polygon(0 0, 100% 0, 50% 100%); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.fx-heart, .fx-z, .fx-bit { position: fixed; z-index: 80; pointer-events: none; font: 700 14px/1 var(--pix); color: var(--lilac-d); animation: floatUp 1.4s steps(10, end) forwards; }
.fx-heart .pxa, .fx-bit .pxa { width: 18px; height: 18px; }
.fx-z { color: var(--mute); font-size: 16px; animation-duration: 2.4s; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(0, 0) scale(0.7); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0px), -70px) scale(1.1); } }

/* ── buddy cat (small, in lessons & quizzes) ── */
#buddy { position: fixed; right: max(8px, env(safe-area-inset-right)); bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); width: 86px; height: 86px; z-index: 35; display: none; cursor: pointer; touch-action: manipulation; }
#buddy .kcat { width: 100%; height: 100%; overflow: visible; }
body[data-buddy] #buddy { display: block; }
#buddy.hop { animation: hop 0.7s steps(7, end) 1; }
#buddy .bubble { right: 10px; bottom: 92px; width: max-content; max-width: min(260px, 70vw); }
#buddy .bubble::after { left: auto; right: 30px; }
@media (min-width: 1000px) { #buddy { width: 120px; height: 120px; right: calc(50% - 520px); } #buddy .bubble { bottom: 126px; } }

/* ── bottom nav ── */
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; justify-content: center; background: var(--paper); box-shadow: 0 -4px 0 0 var(--ink);
}
#nav .in { display: flex; width: min(100%, 620px); }
#nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-decoration: none; color: var(--mute);
  font: 700 10.5px/1 var(--pix); letter-spacing: 0.02em; text-transform: lowercase; position: relative;
}
#nav a .pxa { width: 24px; height: 24px; filter: grayscale(0.6) opacity(0.75); }
#nav a.on { color: var(--ink); background: var(--soft); }
#nav a.on .pxa { filter: none; }
#nav a.on::before { content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 4px; background: var(--lilac-d); }
#nav a:active .pxa { transform: translateY(2px); }

/* ── plan / checklist (Katto's star check-offs) ── */
.plan-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-bar { height: 12px; background: var(--soft); box-shadow: 0 0 0 2px var(--ink); margin: 10px 2px 14px; position: relative; overflow: hidden; }
.plan-bar i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, var(--lilac) 0 8px, color-mix(in srgb, var(--lilac) 70%, #fff) 8px 10px); transition: width 0.5s steps(8, end); }
.phase { font: 700 11px/1 var(--pix); color: var(--mute); margin: 16px 2px 6px; text-transform: lowercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 6px; }
.task { display: flex; align-items: center; gap: 10px; padding: 8px 6px; min-height: 48px; position: relative; }
.task + .task { box-shadow: 0 -2px 0 0 var(--soft); }
.task .star {
  width: 30px; height: 30px; flex: none; border: none; background: transparent; padding: 0; display: grid; place-items: center;
}
.task .star svg { width: 26px; height: 26px; }
.task .star .s-out { fill: var(--paper); stroke: var(--ink); }
.task.done .star .s-out { fill: var(--gold); }
.task .star:active { transform: scale(0.88); }
.task .txt { flex: 1; min-width: 0; font-size: 15px; color: var(--ink); }
.task .txt small { display: block; color: var(--mute); font-size: 12.5px; }
.task.done .txt { text-decoration: line-through; text-decoration-color: var(--mute); color: var(--mute); }
.tag { flex: none; font: 700 10px/1 var(--pix); padding: 4px 6px; background: var(--soft); color: var(--ink); }
.tag.os { background: var(--os-l); }
.tag.la { background: var(--la-l); }
.task .go { flex: none; }
.task .del { border: none; background: none; color: var(--mute); font: 700 16px/1 var(--pix); width: 30px; height: 30px; opacity: 0.6; }
.task .del:hover { opacity: 1; color: var(--red); }
.task.now { background: color-mix(in srgb, var(--butter) 55%, transparent); }
.task.pop .star { animation: starPop 0.5s steps(5, end); }
@keyframes starPop { 0% { transform: scale(1); } 40% { transform: scale(1.5) rotate(20deg); } 100% { transform: scale(1); } }
.add-task { display: flex; gap: 8px; margin-top: 10px; }
.input, .add-task input {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: none; border-radius: 0; background: var(--soft); color: var(--ink); outline: none;
  box-shadow: inset 0 2px 0 0 var(--line), 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
  font-size: 16px;
}
.input::placeholder, .add-task input::placeholder { color: var(--mute); opacity: 0.85; }

/* ── progress pills ── */
.meter { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.meter .name { width: 84px; font: 700 12px/1.1 var(--pix); color: var(--ink); }
.meter .bar { flex: 1; height: 14px; background: var(--soft); box-shadow: 0 0 0 2px var(--ink); position: relative; overflow: hidden; }
.meter .bar i { position: absolute; inset: 0 auto 0 0; transition: width 0.6s steps(10, end); }
.meter .bar.os i { background: var(--os); }
.meter .bar.la i { background: var(--la); }
.meter .pct { width: 44px; text-align: right; font: 700 12px/1 var(--pix); color: var(--ink); font-variant-numeric: tabular-nums; }

/* ── quest map ── */
.map { position: relative; padding: 8px 0 30px; }
.map-path { position: absolute; left: 50%; top: 30px; bottom: 30px; width: 8px; transform: translateX(-50%); background-image: linear-gradient(180deg, var(--ink) 50%, transparent 50%); background-size: 8px 16px; opacity: 0.25; }
.node { position: relative; display: flex; align-items: center; gap: 12px; width: min(100%, 340px); margin: 18px auto; padding: 12px 14px; text-decoration: none; }
.node:nth-child(even) { transform: translateX(-18%); }
.node:nth-child(odd) { transform: translateX(18%); }
@media (max-width: 520px) { .node:nth-child(even), .node:nth-child(odd) { transform: none; } }
.node .n-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font: 700 17px/1 var(--pix); color: #fff; box-shadow: 3px 3px 0 0 var(--shadow); }
.node.os .n-ic { background: var(--os-d); }
.node.la .n-ic { background: var(--la-d); }
:root[data-theme="night"] .node.os .n-ic { background: #1f6f58; }
:root[data-theme="night"] .node.la .n-ic { background: #5b41c0; }
.node .n-t { font: 600 16px/1.25 var(--serif); color: var(--ink); }
.node .n-s { font: 700 10.5px/1.3 var(--pix); color: var(--mute); margin-top: 3px; }
.node .stars { display: flex; gap: 2px; margin-top: 5px; }
.node .stars svg { width: 16px; height: 16px; }
.st-on { fill: var(--gold); stroke: var(--ink); }
.st-off { fill: var(--soft); stroke: var(--line); }
.node.hot::after { content: "🔥 high yield"; position: absolute; top: -12px; right: 8px; font: 700 10px/1 var(--pix); padding: 4px 6px; background: var(--butter); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.node.done-all { background: color-mix(in srgb, var(--gold) 18%, var(--paper)); }
.node:hover { background: var(--butter); }

/* ── topic page ── */
.topic-hero { display: flex; gap: 14px; align-items: center; }
.topic-hero .n-ic { width: 60px; height: 60px; flex: none; display: grid; place-items: center; font: 700 22px/1 var(--pix); color: #fff; box-shadow: 3px 3px 0 0 var(--shadow); }
.topic-hero.os .n-ic { background: var(--os-d); } .topic-hero.la .n-ic { background: var(--la-d); }
:root[data-theme="night"] .topic-hero.os .n-ic { background: #1f6f58; }
:root[data-theme="night"] .topic-hero.la .n-ic { background: #5b41c0; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 4px; }
.mode { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px 12px; text-decoration: none; text-align: center; border: none; }
.mode .pxa { width: 30px; height: 30px; }
.mode b { font: 700 13px/1.1 var(--pix); color: var(--ink); }
.mode small { font-size: 11.5px; color: var(--mute); line-height: 1.25; }
.mode.got { background: color-mix(in srgb, var(--gold) 22%, var(--paper)); }
.mode:hover { background: var(--butter); }
.cheat { margin: 0; padding: 0; list-style: none; }
.cheat li { position: relative; padding: 8px 4px 8px 26px; color: var(--ink); font-size: 15px; }
.cheat li + li { box-shadow: 0 -2px 0 0 var(--soft); }
.cheat li::before { content: "◆"; position: absolute; left: 6px; top: 8px; color: var(--lilac-d); font-size: 12px; }

/* ── lesson player ── */
.player { min-height: 60vh; display: flex; flex-direction: column; }
.dots { display: flex; gap: 4px; margin: 14px 4px 4px; }
.dots i { flex: 1; height: 8px; background: var(--soft); box-shadow: 0 0 0 2px var(--ink); }
.dots i.on { background: var(--lilac); }
.dots i.cur { background: var(--gold); }
.bite { padding: 20px 18px; }
.bite h2 { font-size: 23px; }
.bite .body { font-size: 16.5px; color: var(--text); }
.bite .body p { margin: 10px 0; }
.bite .body ul, .bite .body ol { padding-left: 20px; margin: 8px 0; }
.bite .body li { margin: 5px 0; }
.bite .body b, .bite .body strong { color: var(--ink); }
.hook { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 4px; padding: 10px 12px; background: color-mix(in srgb, var(--gold) 20%, var(--paper)); box-shadow: 0 0 0 2px var(--ink); color: var(--ink); font-size: 15px; }
.hook .pxa { width: 22px; height: 22px; margin-top: 1px; }
.trap { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; padding: 10px 12px; background: var(--red-l); box-shadow: 0 0 0 2px var(--ink); color: var(--ink); font-size: 15px; }
.trap::before { content: "⚠"; font: 700 16px/1.2 var(--pix); color: var(--red); }
.vis { margin: 14px 0; padding: 12px; background: var(--soft); box-shadow: 0 0 0 2px var(--line); overflow-x: auto; }
.player-nav { display: flex; gap: 8px; align-items: center; margin: 18px 4px; }
.player-nav .btn.main { flex: 1; }
.check { margin-top: 16px; padding-top: 12px; box-shadow: 0 -2px 0 0 var(--soft); }
.check .q { font-weight: 600; color: var(--ink); margin-bottom: 8px; }

/* ── quiz ── */
.qhead { display: flex; align-items: center; gap: 10px; margin: 14px 4px 6px; }
.qhead .prog { flex: 1; height: 12px; background: var(--soft); box-shadow: 0 0 0 2px var(--ink); position: relative; overflow: hidden; }
.qhead .prog i { position: absolute; inset: 0 auto 0 0; background: var(--lilac); transition: width 0.4s steps(6, end); }
.combo { font: 700 12px/1 var(--pix); padding: 5px 8px; background: var(--soft); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); white-space: nowrap; }
.combo.hot { background: var(--butter); animation: wig 0.4s steps(4, end) 1; }
.qcard { padding: 20px 16px; }
.qcard .qtxt { font: 600 18px/1.4 var(--sans); color: var(--ink); margin-bottom: 14px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 50px; padding: 12px 12px; text-align: left; border: none; background: var(--paper); color: var(--ink);
  font: 500 15.5px/1.4 var(--sans);
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 3px 4px 0 0 var(--shadow);
}
.opt .k { flex: none; width: 24px; height: 24px; display: grid; place-items: center; font: 700 12px/1 var(--pix); background: var(--soft); box-shadow: 0 0 0 2px var(--ink); }
.opt:hover { background: var(--butter); }
.opt:active { transform: translate(1px, 2px); }
.opt.right { background: color-mix(in srgb, var(--mint) 55%, var(--paper)); }
.opt.wrong { background: var(--red-l); }
.opt.dim { opacity: 0.55; }
.opts.locked .opt { pointer-events: none; }
.feedback { margin-top: 14px; padding: 12px; box-shadow: 0 0 0 2px var(--ink); font-size: 15px; color: var(--ink); animation: pop 0.2s steps(3, end); }
.feedback.ok { background: color-mix(in srgb, var(--mint) 35%, var(--paper)); }
.feedback.no { background: color-mix(in srgb, var(--pink) 30%, var(--paper)); }
.feedback .fb-t { font: 700 13px/1.2 var(--pix); margin-bottom: 4px; }
.num-in { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.num-in .input { max-width: 220px; font: 700 18px/1 var(--pix); }
.hint-help { font-size: 12.5px; color: var(--mute); margin-top: 6px; }

/* ── flashcards ── */
.flip { perspective: 1200px; margin: 18px 4px; }
.flip-in { position: relative; min-height: 280px; transition: transform 0.45s steps(8, end); transform-style: preserve-3d; cursor: pointer; }
.flip.flipped .flip-in { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 22px 18px; }
.face.back { transform: rotateY(180deg); }
.face .fc-t { font: 600 21px/1.35 var(--serif); color: var(--ink); }
.face .fc-b { font: 600 20px/1.45 var(--sans); color: var(--ink); }
.face .fc-q { font-size: 13.5px; color: var(--mute); margin-bottom: 12px; line-height: 1.35; }
.face .fc-tag { position: absolute; top: 12px; left: 14px; }
.face .fc-hint { position: absolute; bottom: 12px; left: 0; right: 0; font: 700 11px/1 var(--pix); color: var(--mute); }
.rate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 4px; }
.rate .btn { margin: 0; flex-direction: column; gap: 3px; min-height: 58px; }
.rate .btn small { font: 700 10px/1 var(--pix); color: var(--mute); }
.rate .again { background: var(--red-l); }
.rate .good { background: color-mix(in srgb, var(--mint) 45%, var(--paper)); }
.boxes { display: flex; gap: 6px; flex-wrap: wrap; }
.box-pill { font: 700 11px/1 var(--pix); padding: 5px 7px; background: var(--soft); box-shadow: 0 0 0 2px var(--ink); color: var(--ink); }

/* ── labs ── */
.lab-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 10px 4px; }
@media (max-width: 520px) { .lab-list { grid-template-columns: minmax(0, 1fr); } }
.lab-tile { display: flex; gap: 12px; align-items: center; padding: 14px; text-decoration: none; }
.lab-tile .ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: var(--ink); box-shadow: 3px 3px 0 0 var(--shadow); }
.lab-tile .ic .pxa { width: 28px; height: 28px; }
.lab-tile b { display: block; font: 600 16px/1.25 var(--serif); color: var(--ink); }
.lab-tile small { display: block; font-size: 12.5px; color: var(--mute); line-height: 1.35; margin-top: 2px; }
.lab-tile:hover { background: var(--butter); }
.lab-tile .solved { font: 700 10px/1 var(--pix); color: var(--mint-d); margin-top: 4px; display: block; }
table.t { border-collapse: collapse; font: 600 14px/1.2 var(--pix); color: var(--ink); margin: 8px 0; font-variant-numeric: tabular-nums; }
table.t th, table.t td { padding: 7px 8px; text-align: center; box-shadow: inset 0 0 0 1px var(--line); }
table.t th { background: var(--soft); font-size: 11.5px; }
table.t td.hl { background: var(--butter); }
table.t td.ok { background: color-mix(in srgb, var(--mint) 45%, var(--paper)); }
table.t td.bad { background: var(--red-l); }
table.t input { width: 46px; height: 32px; border: none; text-align: center; background: var(--paper); color: var(--ink); font: 700 14px/1 var(--pix); box-shadow: 0 0 0 2px var(--ink); border-radius: 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 2px 2px 6px; }
.gantt { display: flex; min-width: min-content; margin: 10px 10px 26px 8px; position: relative; }
.gantt .g { position: relative; height: 44px; display: grid; place-items: center; font: 700 13px/1 var(--pix); color: #231a33; box-shadow: inset 0 0 0 2px var(--ink); min-width: 28px; }
.gantt .g .tick { position: absolute; left: -4px; bottom: -20px; font: 700 11px/1 var(--pix); color: var(--ink); }
.gantt .g .tick.end { left: auto; right: -4px; }
.gantt .g.idle { background: repeating-linear-gradient(45deg, var(--soft) 0 4px, var(--paper) 4px 8px); color: var(--mute); }
.gantt .g.new { animation: pop 0.25s steps(3, end); }
.frames { display: flex; gap: 6px; align-items: flex-end; flex-wrap: nowrap; }
.pr-col { display: flex; flex-direction: column; gap: 3px; align-items: center; min-width: 34px; }
.pr-col .ref { font: 700 14px/1 var(--pix); color: var(--ink); padding: 5px 0; width: 100%; text-align: center; background: var(--soft); }
.pr-col .fr { width: 32px; height: 30px; display: grid; place-items: center; font: 700 14px/1 var(--pix); color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 2px var(--line); }
.pr-col .fr.in { background: color-mix(in srgb, var(--lilac) 45%, var(--paper)); box-shadow: inset 0 0 0 2px var(--ink); }
.pr-col .fr.hit { background: color-mix(in srgb, var(--mint) 45%, var(--paper)); }
.pr-col .f { font: 700 11px/1 var(--pix); height: 14px; }
.pr-col .f.fault { color: var(--red); }
.pr-col .f.hitm { color: var(--mint-d); }
.pr-col.cur .ref { background: var(--gold); }
.evict-pick { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.evict-pick .btn { min-width: 58px; font-size: 18px; }
.lab-out { margin-top: 12px; }
.steps { margin: 8px 0; padding-left: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 6px 0 6px 34px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 5px; width: 24px; height: 24px; display: grid; place-items: center; font: 700 12px/1 var(--pix); background: var(--ink); color: var(--paper); }
.pill { display: inline-block; font: 700 11px/1 var(--pix); padding: 4px 7px; background: var(--soft); color: var(--ink); box-shadow: 0 0 0 2px var(--ink); margin: 2px; }
.pill.ok { background: color-mix(in srgb, var(--mint) 50%, var(--paper)); }
.pill.bad { background: var(--red-l); }
.pill.hl { background: var(--butter); }
.proc-pick { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.disk-svg { width: 100%; height: auto; display: block; background: var(--paper); }
.race-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.race-steps .col { padding: 10px; background: var(--soft); box-shadow: 0 0 0 2px var(--line); }
.race-steps .ins { font: 600 13px/1.3 ui-monospace, Menlo, monospace; padding: 5px 6px; color: var(--ink); }
.race-steps .ins.done { opacity: 0.45; text-decoration: line-through; }
.race-steps .ins.next { background: var(--butter); box-shadow: 0 0 0 2px var(--ink); }
.reg { font: 700 13px/1.3 var(--pix); color: var(--ink); }

/* ── math bits ── */
.m { font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", Georgia, serif; font-style: normal; white-space: nowrap; }
.mat { display: inline-grid; vertical-align: middle; margin: 2px 4px; padding: 2px 7px; position: relative; font: 600 15px/1.25 var(--pix); color: var(--ink); gap: 2px 12px; text-align: center; font-variant-numeric: tabular-nums; }
.mat::before, .mat::after { content: ""; position: absolute; top: 0; bottom: 0; width: 5px; border: 2px solid var(--ink); }
.mat::before { left: 0; border-right: none; }
.mat::after { right: 0; border-left: none; }
.mat.det::before, .mat.det::after { width: 0; border-top: none; border-bottom: none; }
.mat span { min-width: 18px; }
code, .code { font: 600 13.5px/1.45 ui-monospace, Menlo, Consolas, monospace; background: var(--soft); color: var(--ink); padding: 1px 4px; }
pre.code { display: block; padding: 10px 12px; overflow-x: auto; white-space: pre; box-shadow: 0 0 0 2px var(--line); margin: 10px 0; }
.formula { display: block; margin: 10px 0; padding: 10px 12px; background: var(--paper); box-shadow: 0 0 0 2px var(--ink); font: 600 16px/1.5 "Cambria Math", "STIX Two Math", Georgia, serif; color: var(--ink); text-align: center; overflow-x: auto; }

/* ── exam day sheet ── */
.sheet h3 { display: flex; align-items: center; gap: 8px; }
.sheet .kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.sheet .kv div { padding: 9px 4px; font-size: 15px; color: var(--ink); }
.sheet .kv div + div { box-shadow: 0 -2px 0 0 var(--soft); }
.sheet .kv b { font-family: var(--pix); font-size: 12.5px; color: var(--lilac-d); display: block; margin-bottom: 2px; }
:root[data-theme="night"] .sheet .kv b { color: var(--la-d); }
.breath { display: grid; place-items: center; height: 190px; }
.breath .orb { width: 70px; height: 70px; background: var(--lilac); box-shadow: 0 0 0 4px var(--ink); animation: breathe 16s steps(32, end) infinite; image-rendering: pixelated; }
@keyframes breathe { 0% { transform: scale(0.8); } 25% { transform: scale(1.9); } 50% { transform: scale(1.9); } 75% { transform: scale(0.8); } 100% { transform: scale(0.8); } }
.breath-txt { font: 700 14px/1 var(--pix); color: var(--ink); text-align: center; min-height: 18px; }

/* ── modals / sheets ── */
#modal-root { position: fixed; inset: 0; z-index: 90; display: none; align-items: flex-end; justify-content: center; background: rgba(30, 16, 50, 0.45); padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
#modal-root.open { display: flex; }
@media (min-width: 640px) { #modal-root { align-items: center; } }
.modal { width: min(100%, 480px); max-height: min(88vh, 760px); overflow: auto; padding: 18px 16px 16px; position: relative; animation: pop 0.2s steps(3, end); }
.modal .x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: none; background: var(--paper); color: var(--ink); font: 700 16px/1 var(--pix); box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 2px 4px 0 0 var(--shadow); }
.modal .x:hover { background: var(--pink-l); }
.modal h2 { padding-right: 40px; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; margin: 10px auto; width: fit-content; box-shadow: 0 0 0 2px var(--ink); }
.qr canvas, .qr img { display: block; image-rendering: pixelated; width: min(72vw, 280px); height: auto; }
textarea.input { height: 90px; padding: 10px; font: 600 12px/1.4 ui-monospace, Menlo, monospace; resize: vertical; width: 100%; }

/* ── toast ── */
#toasts { position: fixed; left: 50%; top: calc(66px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { padding: 10px 14px; background: var(--paper); color: var(--ink); font: 700 13px/1.3 var(--pix); display: flex; gap: 8px; align-items: center; animation: toastIn 0.25s steps(4, end), toastOut 0.3s steps(3, end) 2.6s forwards; box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 3px 5px 0 0 var(--shadow); }
.toast.xp { background: color-mix(in srgb, var(--gold) 30%, var(--paper)); }
@keyframes toastIn { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-10px); opacity: 0; } }

/* ── confetti ── */
.confetti { position: fixed; top: -12px; z-index: 99; width: 8px; height: 8px; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }

/* ── focus sprint ── */
#focus { position: fixed; inset: 0; z-index: 85; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; background: var(--bg); }
body[data-focus] #focus { display: flex; }
.focus-card { width: min(100%, 440px); text-align: center; padding: 22px 18px 18px; }
.focus-time { font: 700 64px/1 var(--pix); color: var(--ink); font-variant-numeric: tabular-nums; margin: 8px 0; letter-spacing: 0.02em; }
@media (max-width: 400px) { .focus-time { font-size: 50px; } }
.focus-bar { display: flex; gap: 3px; justify-content: center; margin: 10px auto 4px; flex-wrap: wrap; }
.focus-bar i { width: 12px; height: 10px; background: var(--soft); box-shadow: 0 0 0 2px var(--ink); }
.focus-bar i.on { background: var(--lilac); }
.focus-cats { display: flex; justify-content: center; gap: 0; height: 120px; }
.focus-cats .cat-slot { width: 120px; height: 120px; }

/* ── me / shop ── */
.lvl-card { display: flex; gap: 14px; align-items: center; }
.lvl-badge { width: 70px; height: 70px; flex: none; display: grid; place-items: center; background: var(--ink); color: var(--paper); font: 700 26px/1 var(--pix); box-shadow: 4px 4px 0 0 var(--shadow); }
.xpbar { height: 14px; background: var(--soft); box-shadow: 0 0 0 2px var(--ink); position: relative; overflow: hidden; margin-top: 8px; }
.xpbar i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #ffe38a 8px 10px); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.badge { text-align: center; padding: 10px 6px; background: var(--soft); box-shadow: 0 0 0 2px var(--line); }
.badge .pxa { width: 30px; height: 30px; }
.badge b { display: block; font: 700 10.5px/1.25 var(--pix); color: var(--ink); margin-top: 6px; }
.badge small { display: block; font-size: 11px; color: var(--mute); line-height: 1.25; margin-top: 3px; }
.badge.locked { opacity: 0.45; filter: grayscale(1); }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: none; background: var(--paper); color: var(--ink); box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), 3px 4px 0 0 var(--shadow); }
.item:hover { background: var(--butter); }
.item.on { background: var(--on); }
.item .sw { width: 34px; height: 20px; box-shadow: 0 0 0 2px var(--ink); }
.item b { font: 700 11.5px/1.2 var(--pix); }
.item small { font: 700 10.5px/1 var(--pix); color: var(--mute); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.swatches button { width: 28px; height: 28px; border: none; box-shadow: 0 0 0 2px var(--ink); }
.swatches button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.dress-stage { display: flex; justify-content: center; gap: 10px; background: var(--desk); padding: 10px 0 0; box-shadow: 0 0 0 2px var(--ink); margin: 10px 0; }
.dress-stage .cat-slot { width: 130px; height: 130px; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 10px 2px; }
.toggle + .toggle { box-shadow: 0 -2px 0 0 var(--soft); }
.toggle .grow b { display: block; color: var(--ink); font-weight: 600; }
.toggle .grow small { color: var(--mute); font-size: 13px; }
.sw-px { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; flex: none; margin: 0; background: #e4dccb; position: relative; cursor: pointer; box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink); }
:root[data-theme="night"] .sw-px { background: #3a3056; }
.sw-px::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; background: var(--ink); transition: transform 0.15s steps(3, end); }
.sw-px:checked { background: var(--lilac); }
.sw-px:checked::after { transform: translateX(20px); background: var(--paper); box-shadow: 0 0 0 2px var(--ink); }

/* ── sync badge ── */
.sync-note { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: color-mix(in srgb, var(--lilac) 18%, var(--paper)); box-shadow: 0 0 0 2px var(--ink); color: var(--ink); font-size: 14px; margin: 14px 4px 0; }
.sync-note .pxa { width: 22px; height: 22px; }

/* ── calm mode: stop the wiggles ── */
body[data-calm] *, body[data-calm] *::before, body[data-calm] *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
body[data-calm] .kcat * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .view-enter, .cat-slot.hop, #buddy.hop, .confetti { animation: none !important; }
}
@media print { #top, #nav, #buddy, .no-print { display: none !important; } main { padding: 0; } .card { box-shadow: 0 0 0 2px #000; } }
label > .lbl { display: block; margin-bottom: 7px; }
table.t td.bad input { background: var(--red-l); }
@media (max-width: 560px) {
  .hero .scene-wrap { display: flex; flex-direction: column-reverse; background: var(--paper); }
  .hero .cd { position: static; padding: 10px 10px 10px; gap: 8px; border-bottom: 4px solid var(--ink); }
  .hero .cd-box { flex: 1; }
}
@media (max-width: 560px) { #buddy { width: 66px; height: 66px; right: 4px; } #buddy .bubble { bottom: 70px; } }
.num-in .input { flex: 1 1 160px; min-width: 0; }

.chip.warn { background: var(--red-l); }
details > summary { list-style: none; padding: 6px 0; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; }
details[open] > summary::before { content: "▾ "; }
