:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --border: #e2dfd6;
  --ink: #1c1b18;
  --ink-2: #57544c;
  --ink-3: #8a867b;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fbe7dc;
  --easy: #0f766e;   --easy-soft: #d7f0ec;
  --med: #a16207;    --med-soft: #f8ecd0;
  --hard: #b91c1c;   --hard-soft: #f9dcdc;
  --ok: #15803d;     --ok-soft: #dcf2e2;
  --heat-0: #e9e6de; --heat-1: #f6c9ae; --heat-2: #ee9a6a; --heat-3: #d9622c; --heat-4: #a83a0b;
  --shadow: 0 1px 2px rgba(28,27,24,.05), 0 2px 8px rgba(28,27,24,.04);
  --radius: 10px;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211; --surface: #1b1a18; --surface-2: #242320; --border: #2f2d29;
    --ink: #edeae3; --ink-2: #b2ada2; --ink-3: #7e796e;
    --accent: #f2804a; --accent-ink: #1b1a18; --accent-soft: #3a2418;
    --easy: #4fd1c5; --easy-soft: #15302d; --med: #f0b54a; --med-soft: #33290f; --hard: #f27b7b; --hard-soft: #3a1c1c;
    --ok: #5fd28a; --ok-soft: #173322;
    --heat-0: #262522; --heat-1: #4a2c1c; --heat-2: #7d4220; --heat-3: #c25a25; --heat-4: #f2804a;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121211; --surface: #1b1a18; --surface-2: #242320; --border: #2f2d29;
  --ink: #edeae3; --ink-2: #b2ada2; --ink-3: #7e796e;
  --accent: #f2804a; --accent-ink: #1b1a18; --accent-soft: #3a2418;
  --easy: #4fd1c5; --easy-soft: #15302d; --med: #f0b54a; --med-soft: #33290f; --hard: #f27b7b; --hard-soft: #3a1c1c;
  --ok: #5fd28a; --ok-soft: #173322;
  --heat-0: #262522; --heat-1: #4a2c1c; --heat-2: #7d4220; --heat-3: #c25a25; --heat-4: #f2804a;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0 0 .8em; }
code, pre { font-family: var(--mono); font-size: .86em; font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }

/* ── shell ── */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--ink); padding: 0 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); display: flex; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: var(--ink-2); padding: 8px 10px; border-radius: 8px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 7px 9px; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; font-size: .8rem; color: var(--ink-3); padding: 0 8px; }
.main { padding: 32px clamp(16px, 4vw, 48px) 0; max-width: 1180px; width: 100%; margin: 0 auto; outline: none; }
@media (min-width: 1800px) { .main { max-width: 1320px; } }
.main { display: flex; flex-direction: column; min-height: 100vh; }
.main > .page { flex: 1 0 auto; }
@media (max-width: 820px) { .main { min-height: calc(100vh - 56px); } }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); z-index: 10; gap: 12px; overflow-x: auto; }
  .brand span:last-child { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav a { white-space: nowrap; padding: 6px 9px; font-size: .88rem; }
  .sidebar-foot { display: none; }
  .main { padding-top: 20px; }
}

/* ── generic ── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { color: var(--ink-2); margin: 0; max-width: 64ch; }
.eyebrow { font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.muted { color: var(--ink-3); }
.sub { color: var(--ink-2); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .hero > .card + .card, .stack > .card + .card { margin-top: 0; }
.stack > * + * { margin-top: 16px !important; }
.hero-main { display: flex; flex-direction: column; }
.phase-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: auto; padding-top: 16px; }
.phase-strip div { border-top: 3px solid var(--surface-2); padding-top: 8px; font-size: .8rem; color: var(--ink-3); }
.phase-strip div b { display: block; color: var(--ink-2); font-weight: 600; }
.phase-strip div.now { border-color: var(--accent); }
.phase-strip div.now b { color: var(--ink); }
.phase-strip div.past { border-color: var(--heat-2); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid > *, .hero > *, .step > * { min-width: 0; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)) !important; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.section-title { margin: 28px 0 12px; display: flex; align-items: baseline; gap: 10px; }
.section-title h2 { margin: 0; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: .9rem; color: var(--ink); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 3px 9px; font-size: .8rem; }
.btn.danger { color: var(--hard); }
.btn:disabled { opacity: .5; cursor: default; }

.pill { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.E, .pill.Easy { background: var(--easy-soft); color: var(--easy); }
.pill.M, .pill.Medium { background: var(--med-soft); color: var(--med); }
.pill.H, .pill.Hard { background: var(--hard-soft); color: var(--hard); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.bar.ok > span { background: var(--ok); }

input[type=text], input[type=date], input[type=search], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
}
textarea { width: 100%; min-height: 110px; resize: vertical; font-family: var(--font); line-height: 1.5; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ── dashboard ── */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.hero-main h1 { font-size: 2rem; margin-bottom: 4px; }
.pace { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: .85rem; padding: 4px 10px; border-radius: 99px; }
.pace.ahead { background: var(--ok-soft); color: var(--ok); }
.pace.behind { background: var(--hard-soft); color: var(--hard); }
.pace.on { background: var(--accent-soft); color: var(--accent); }
.timeline { display: grid; grid-template-columns: repeat(26, 1fr); gap: 3px; margin: 14px 0 6px; }
.timeline span { height: 8px; border-radius: 2px; background: var(--surface-2); }
.timeline span.past { background: var(--heat-2); }
.timeline span.now { background: var(--accent); outline: 2px solid var(--accent-soft); }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .num small { font-size: .9rem; font-weight: 500; color: var(--ink-3); }
.stat .lbl { font-size: .8rem; color: var(--ink-3); font-weight: 500; }
.split { display: flex; gap: 10px; font-size: .78rem; color: var(--ink-2); flex-wrap: wrap; }
.split b { font-weight: 600; }

.heatmap-wrap { overflow-x: auto; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; width: max-content; }
.heatmap i { width: 13px; height: 13px; border-radius: 3px; background: var(--heat-0); }
.heatmap i.l1 { background: var(--heat-1); } .heatmap i.l2 { background: var(--heat-2); } .heatmap i.l3 { background: var(--heat-3); } .heatmap i.l4 { background: var(--heat-4); }
.heatmap i.future { opacity: .35; }
.heatmap i.today { outline: 1.5px solid var(--ink); outline-offset: 1px; }
.legend { display: flex; gap: 3px; align-items: center; font-size: .75rem; color: var(--ink-3); margin-top: 8px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.todo { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.todo:first-child { border-top: 0; }
.todo .kind { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); width: 46px; flex-shrink: 0; }
.todo .t { flex: 1; min-width: 0; }

/* ── problems ── */
.plist { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.prow { border-top: 1px solid var(--border); }
.prow:first-child { border-top: 0; }
.prow-main { display: grid; grid-template-columns: 28px 1fr 70px auto; align-items: center; gap: 12px; padding: 9px 14px; }
.prow-main .pill { justify-self: start; }
.prow-title { min-width: 0; }
.prow-title a { color: var(--ink); font-weight: 500; }
.prow-title a:hover { color: var(--accent); }
.prow-title .meta { font-size: .76rem; color: var(--ink-3); }
.prow-actions { display: flex; gap: 2px; }
.prow-actions .btn { padding: 3px 8px; font-size: .78rem; }
.prow-actions .btn.on { color: var(--accent); }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0; color: transparent; font-size: 12px; font-weight: 800; }
.check:hover { border-color: var(--accent); }
.check.done { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.check.due { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.prow-extra { padding: 0 14px 12px 54px; display: flex; flex-direction: column; gap: 10px; }
.hint { background: var(--surface-2); border-radius: 8px; padding: 9px 12px; font-size: .9rem; }
.grade { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; background: var(--accent-soft); padding: 10px 12px; border-radius: 8px; }
.grade .q { font-weight: 600; font-size: .85rem; margin-right: 6px; }
.grade .btn small { color: var(--ink-3); font-weight: 400; }
@media (max-width: 640px) {
  .prow-main { grid-template-columns: 26px 1fr auto; }
  .prow-main .pill { display: none; }
  .prow-extra { padding-left: 14px; }
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input[type=search] { flex: 1; min-width: 180px; }

/* ── roadmap ── */
.tiers { display: flex; flex-direction: column; gap: 14px; }
.tier { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; position: relative; }
.topic-card { width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.topic-card:hover { border-color: var(--accent); text-decoration: none; }
.topic-card .name { font-weight: 600; }
.topic-card .count { font-size: .78rem; color: var(--ink-3); }
.topic-card.done { border-color: var(--ok); }
.tier-connector { height: 10px; width: 2px; background: var(--border); margin: -8px auto; }

.cheats { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cheats td { padding: 7px 10px; border-top: 1px solid var(--border); vertical-align: top; }
.cheats td:last-child { color: var(--accent); font-weight: 500; }
.cheats tr:first-child td { border-top: 0; }

/* ── prose ── */
.prose { max-width: 76ch; }
.prose h2 { margin-top: 1.5em; font-size: 1.1rem; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 .9em; }
.prose li { margin: .25em 0; }
.prose strong { font-weight: 650; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 0 0 1em; padding: 4px 14px; color: var(--ink-2); }
.prose table { border-collapse: collapse; margin: 0 0 1em; font-size: .92em; width: 100%; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; }
.table-wrap { overflow-x: auto; }
pre.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; line-height: 1.5; margin: 0 0 1em; }
.cues { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }

/* ── system design ── */
.sd-card { display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.sd-card:hover { border-color: var(--accent); text-decoration: none; }
.sd-card .t { font-weight: 600; }
.sd-card p { color: var(--ink-2); font-size: .88rem; margin: 0; }
.sd-card .foot { display: flex; gap: 6px; align-items: center; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.req-grid ul { margin: 0; padding-left: 1.2em; }
.req-grid li { margin: .3em 0; }
details.deep { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin-bottom: 8px; }
details.deep summary { cursor: pointer; padding: 11px 14px; font-weight: 600; list-style: none; display: flex; gap: 8px; }
details.deep summary::before { content: '+'; color: var(--accent); font-weight: 700; width: 12px; }
details.deep[open] summary::before { content: '−'; }
details.deep .prose { padding: 0 16px 6px 34px; }
.diagram { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px; overflow-x: auto; margin-bottom: 1em; }
.diagram pre.mermaid { margin: 0; font-family: var(--mono); font-size: .8rem; white-space: pre; background: none; color: var(--ink-2); }
.diagram svg { max-width: 100%; height: auto; }
.shield { border: 1px dashed var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: 18px 20px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ── practice ── */
.timer-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0; margin-bottom: 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
@media (max-width: 820px) { .timer-bar { top: 52px; } }
.clock { font-family: var(--mono); font-size: 1.5rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.clock.over { color: var(--hard); }
.phase-track { display: flex; gap: 3px; flex: 1; min-width: 200px; }
.phase-track span { flex: var(--w); height: 8px; border-radius: 3px; background: var(--surface-2); position: relative; }
.phase-track span.active { background: var(--accent); }
.phase-track span.past { background: var(--heat-2); }
.step { display: grid; grid-template-columns: 1fr; gap: 10px; }
.step.compare { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .step.compare { grid-template-columns: 1fr; } }
.step-head { display: flex; align-items: baseline; gap: 10px; }
.step-head .n { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.step-guide { color: var(--ink-2); font-size: .88rem; margin: 0; }
.ref { background: var(--surface-2); border-radius: 8px; padding: 12px 14px; font-size: .9rem; }
.ref ul { padding-left: 1.2em; margin: 0; }
.rubric label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.rubric input { margin-top: 4px; accent-color: var(--accent); }

/* ── plan ── */
.phase-block { margin-bottom: 28px; }
.phase-block > .row { margin-bottom: 10px; }
.week { display: grid; grid-template-columns: 74px 1fr auto; gap: 14px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--border); }
.week:first-child { border-top: 0; }
.week.now { background: var(--accent-soft); }
.week .wk { font-weight: 700; font-variant-numeric: tabular-nums; }
.week .wk small { display: block; font-weight: 500; color: var(--ink-3); font-size: .74rem; }
.week .focus { font-weight: 600; margin-bottom: 4px; }
.week .items { display: flex; gap: 6px; flex-wrap: wrap; }
.week .items a.pill { color: var(--ink-2); }
.week .items a.pill:hover { text-decoration: none; color: var(--accent); }
.week .items .pill.ok { color: var(--ok); }
.week .pct { font-weight: 600; font-size: .85rem; color: var(--ink-2); min-width: 44px; text-align: right; }
@media (max-width: 640px) { .week { grid-template-columns: 56px 1fr; } .week .pct { display: none; } }

/* ── check-ins & projects ── */
.n-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 700; margin-right: 10px; vertical-align: 2px; }
.quiz-q { padding: 12px 0; border-top: 1px solid var(--border); }
.quiz-q:first-child { border-top: 0; padding-top: 0; }
.quiz-q > p { margin: 0 0 8px; font-weight: 500; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: .92rem; }
label.opt:hover { background: var(--surface-2); }
.opt input { margin-top: 4px; accent-color: var(--accent); }
.opt.correct { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.opt.wrong { background: var(--hard-soft); color: var(--hard); }
.why { color: var(--ink-2); font-size: .87rem; margin: 8px 0 0; padding-left: 10px; border-left: 2px solid var(--border); }
.conf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 4px 24px; margin-bottom: 14px; }
.conf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; }
.conf-row a { color: var(--ink); font-weight: 500; }
.conf { display: flex; gap: 4px; }
.conf button { width: 30px; height: 28px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.conf button:hover { border-color: var(--accent); }
.conf button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rlabel { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .9rem; margin-top: 10px; }
.rlabel textarea { min-height: 70px; font-weight: 400; }
.ck-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ck-table th, .ck-table td { padding: 10px 14px; text-align: left; border-top: 1px solid var(--border); white-space: nowrap; }
.ck-table th { border-top: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.ck-table tr.now td { background: var(--accent-soft); }
.conf-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 700; font-size: .8rem; }
.conf-dot.c1 { background: var(--hard-soft); color: var(--hard); } .conf-dot.c2 { background: var(--med-soft); color: var(--med); }
.conf-dot.c3 { background: var(--surface-2); color: var(--ink-2); } .conf-dot.c4 { background: var(--easy-soft); color: var(--easy); }
.conf-dot.c5 { background: var(--ok-soft); color: var(--ok); }
.tasks { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; cursor: pointer; font-size: .92rem; }
.task input { margin-top: 4px; accent-color: var(--ok); }
.task input:checked + span { color: var(--ink-3); text-decoration: line-through; }
.pill.proj { background: var(--easy-soft); color: var(--easy); }
.month-card { display: flex; flex-direction: column; gap: 6px; }

.mock-problem { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.mock-problem:first-child { border-top: 0; }
.empty { text-align: center; padding: 36px 20px; color: var(--ink-3); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; font-weight: 500; font-size: .9rem; z-index: 50; box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.kbd { font-family: var(--mono); font-size: .78rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }

/* ── Java highlighting ── */
.tk-k { color: #a626a4; font-weight: 500; }
.tk-t { color: #0e7490; }
.tk-s { color: #4d7c0f; }
.tk-n { color: #b45309; }
.tk-c { color: var(--ink-3); font-style: italic; }
.tk-a { color: #9333ea; }
:root[data-theme="dark"] .tk-k { color: #d19af0; } :root[data-theme="dark"] .tk-t { color: #67d3e8; }
:root[data-theme="dark"] .tk-s { color: #a5d76e; } :root[data-theme="dark"] .tk-n { color: #f5b86a; } :root[data-theme="dark"] .tk-a { color: #c4a3f7; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tk-k { color: #d19af0; } :root:not([data-theme="light"]) .tk-t { color: #67d3e8; }
  :root:not([data-theme="light"]) .tk-s { color: #a5d76e; } :root:not([data-theme="light"]) .tk-n { color: #f5b86a; } :root:not([data-theme="light"]) .tk-a { color: #c4a3f7; }
}

/* ── topic page ── */
.topic-grid { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1180px) { .topic-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); } }

/* ── interactive walkthroughs ── */
.viz { --vz-hl: #f59e0b; --vz-hl-soft: #fdecc8; --vz-q: #3b82f6; --vz-q-soft: #dbe8fd; }
:root[data-theme="dark"] .viz { --vz-hl: #fbbf24; --vz-hl-soft: #4a3510; --vz-q: #60a5fa; --vz-q-soft: #172a47; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .viz { --vz-hl: #fbbf24; --vz-hl-soft: #4a3510; --vz-q: #60a5fa; --vz-q-soft: #172a47; } }
.vz-head h3 { margin: 2px 0 4px; }
.vz-head p { margin: 0 0 12px; font-size: .9rem; }
.vz-inputs, .vz-ctrl { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; margin-bottom: 10px; }
.vz-inputs label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--ink-2); }
.vz-inputs input[type=text] { font-family: var(--mono); font-size: .85rem; padding: 5px 8px; max-width: 100%; }
.vz-inputs input[type=range] { width: 160px; accent-color: var(--accent); }
.vz-inputs .vz-radio { flex-direction: row; align-items: center; gap: 6px; font-size: .85rem; color: var(--ink); padding-bottom: 4px; }
.vz-ctrl { align-items: center; padding: 8px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.vz-ctrl .vz-scrub { flex: 1; min-width: 120px; accent-color: var(--accent); }
.vz-ctrl .vz-count { font-size: .8rem; white-space: nowrap; min-width: 84px; }
.vz-ctrl .vz-play { min-width: 86px; justify-content: center; }
.vz-ctrl select { padding: 3px 6px; font-size: .8rem; }
.vz-err { background: var(--hard-soft); color: var(--hard); border-radius: 8px; padding: 8px 12px; font-size: .88rem; margin-bottom: 10px; }
.vz-body { display: grid; gap: 16px; margin-top: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .vz-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); } .vz-body.one { grid-template-columns: minmax(0, 1fr); } }
.vz-code { margin: 0; font-size: .8rem; padding: 10px 0; align-self: start; }
.vz-code .vz-ln { display: block; padding: 0 12px 0 0; border-left: 3px solid transparent; white-space: pre; }
.vz-code .vz-ln i { display: inline-block; width: 2.6em; padding-right: .9em; text-align: right; color: var(--ink-3); font-style: normal; user-select: none; }
.vz-code .vz-ln.on { background: var(--vz-hl-soft); border-left-color: var(--vz-hl); }
.vz-code.static { padding: 12px 14px; margin-top: 8px; }
.vz-msg { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; min-height: 3.2em; font-size: .92rem; margin-bottom: 12px; }
.vz-msg code, .vz-note code { font-size: .85em; }
.vz-stage { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.vz-block { min-width: 0; }
.vz-t { font-size: .74rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px; }
.vz-arr { display: flex; flex-wrap: wrap; gap: 4px; }
.vz-arr.nowrap { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
.vz-col { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.vz-cell { min-width: 36px; height: 36px; padding: 0 6px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--border); border-radius: 7px; background: var(--surface); font-family: var(--mono); font-size: .88rem; font-weight: 500; transition: background .15s, border-color .15s; }
.vz-arr.sm .vz-cell { min-width: 24px; height: 28px; padding: 0 3px; font-size: .8rem; }
.vz-cell.hl { background: var(--vz-hl-soft); border-color: var(--vz-hl); }
.vz-cell.ok { background: var(--ok-soft); border-color: var(--ok); }
.vz-cell.bad { background: var(--hard-soft); border-color: var(--hard); }
.vz-cell.src, .vz-cell.stk { background: var(--vz-q-soft); border-color: var(--vz-q); }
.vz-cell.win { background: var(--accent-soft); }
.vz-cell.best { box-shadow: 0 0 0 2px var(--ok); }
.vz-cell.dim { opacity: .35; }
.vz-cell.null { color: var(--ink-3); font-size: .74rem; border-style: dashed; }
.vz-idx { font-size: .68rem; color: var(--ink-3); font-family: var(--mono); margin-top: 2px; }
.vz-ptr { font-size: .7rem; font-weight: 700; color: var(--accent); min-height: 1em; line-height: 1.2; text-align: center; font-family: var(--mono); }
.vz-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.vz-chip { font-family: var(--mono); font-size: .8rem; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.vz-chip.hl, .vz-chip.top { background: var(--vz-hl-soft); border-color: var(--vz-hl); }
.vz-chip.new { background: var(--ok-soft); border-color: var(--ok); }
.vz-chip.bad { background: var(--hard-soft); border-color: var(--hard); }
.vz-empty { color: var(--ink-3); font-size: .82rem; font-style: italic; }
.vz-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.vz-var { font-family: var(--mono); font-size: .8rem; background: var(--surface-2); border-radius: 6px; padding: 3px 8px; }
.vz-var b { color: var(--accent); font-weight: 600; }
.vz-note { font-size: .8rem; color: var(--ink-3); margin: 0; }
.vz-scroll { overflow-x: auto; max-width: 100%; }
.vz-svg { display: block; max-width: 100%; height: auto; }
.vz-svg text { font-family: var(--mono); font-size: 12px; text-anchor: middle; fill: var(--ink); font-variant-ligatures: none; }
.vz-bar { fill: var(--surface-2); stroke: var(--border); }
.vz-bar.hl { fill: var(--vz-hl); stroke: var(--vz-hl); }
.vz-bar.ok { fill: var(--ok); stroke: var(--ok); }
.vz-bar.dim { opacity: .35; }
.vz-water { fill: var(--vz-q-soft); stroke: var(--vz-q); stroke-dasharray: 3 3; }
.vz-svg .vz-bt { font-size: 11px; fill: var(--ink-2); }
.vz-svg .vz-bp { font-size: 11px; font-weight: 700; fill: var(--accent); }
.vz-edge, .vz-gedge line { stroke: var(--border); stroke-width: 2; }
.vz-edge.tree, .vz-gedge.tree line { stroke: var(--ok); stroke-width: 3; }
.vz-gedge.hl line { stroke: var(--vz-hl); stroke-width: 3.5; }
.vz-gedge rect { fill: var(--surface); stroke: var(--border); }
.vz-gedge text { font-size: 10.5px; fill: var(--ink-2); }
.vz-node circle { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.5; }
.vz-node circle.ring { fill: none; stroke-width: 1.2; }
.vz-node .sub { font-size: 13px; font-weight: 700; fill: var(--accent); }
.vz-node.cur circle { fill: var(--vz-hl-soft); stroke: var(--vz-hl); stroke-width: 2.5; }
.vz-node.queued circle, .vz-node.path circle { fill: var(--vz-q-soft); stroke: var(--vz-q); stroke-width: 2; }
.vz-node.done circle, .vz-node.new circle { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 2; }
.vz-node.hl circle { fill: var(--vz-hl-soft); stroke: var(--vz-hl); stroke-width: 2.5; }
.vz-node.src circle { fill: var(--vz-q-soft); stroke: var(--vz-q); stroke-width: 2; }
.vz-node.ok circle { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 2.5; }
.vz-node.bad circle { fill: var(--hard-soft); stroke: var(--hard); stroke-width: 2.5; }
.vz-grid { border-collapse: separate; border-spacing: 3px; font-family: var(--mono); font-size: .85rem; }
.vz-grid th { color: var(--ink-3); font-weight: 600; padding: 0 6px; font-size: .8rem; }
.vz-grid td { min-width: 34px; height: 34px; text-align: center; border: 1.5px solid var(--border); border-radius: 6px; background: var(--surface); padding: 0 4px; }
.vz-grid td.dim { color: var(--ink-3); background: transparent; border-style: dashed; }
.vz-grid td.hl { background: var(--vz-hl-soft); border-color: var(--vz-hl); }
.vz-grid td.src { background: var(--vz-q-soft); border-color: var(--vz-q); }
.vz-grid td.ok { background: var(--ok-soft); border-color: var(--ok); }
.vz-grid td.water { background: var(--surface-2); color: var(--ink-3); }
.vz-grid td.land { background: #d6c7a1; border-color: #b3a27a; color: #3b3220; }
.vz-grid td.isl1 { background: #fcd9b8; border-color: #ea8a3c; } .vz-grid td.isl2 { background: #c9e3fb; border-color: #4b93d6; }
.vz-grid td.isl3 { background: #cfeed6; border-color: #3fa45b; } .vz-grid td.isl4 { background: #ead2f7; border-color: #a35ccc; }
.vz-grid td.isl5 { background: #fbe39a; border-color: #c69a1a; } .vz-grid td.isl6 { background: #c7efeb; border-color: #2a9d90; }
.vz-grid td[class^="isl"], .vz-grid td.land { color: #1c1b18; font-weight: 600; }
.vz-ll { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 2px 0; }
.vz-arrow { width: 26px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-weight: 700; }
.vz-arrow.none { color: var(--border); }
.vz-tick { stroke: var(--border); stroke-dasharray: 2 3; }
.vz-svg .vz-lab { text-anchor: start; font-size: 11px; fill: var(--ink-2); }
.vz-svg .vz-lab.strong { font-weight: 700; fill: var(--ink); }
.vz-iv { fill: var(--surface-2); stroke: var(--ink-3); }
.vz-iv.hl { fill: var(--vz-hl-soft); stroke: var(--vz-hl); stroke-width: 2; }
.vz-iv.ok { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 2; }
.vz-iv.out { fill: var(--accent-soft); stroke: var(--accent); }
.vz-iv.out.src { fill: var(--vz-q-soft); stroke: var(--vz-q); stroke-width: 2; }
.vz-iv.out.ok { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 2; }
.vz-src { margin-top: 14px; }
.vz-src summary { cursor: pointer; font-weight: 600; font-size: .9rem; }

/* simulators */
.hc0 { fill: #e8590c; background: #e8590c; } .hc1 { fill: #1c7ed6; background: #1c7ed6; } .hc2 { fill: #2f9e44; background: #2f9e44; } .hc3 { fill: #ae3ec9; background: #ae3ec9; }
.hc4 { fill: #e0a100; background: #e0a100; } .hc5 { fill: #0c8599; background: #0c8599; } .hc6 { fill: #e03131; background: #e03131; } .hc7 { fill: #5c940d; background: #5c940d; }
.sim-ring .ring-base { fill: none; stroke: var(--border); stroke-width: 2; }
.sim-ring .vnode { stroke: var(--surface); stroke-width: 1.5; }
.sim-ring .ring-lab { font-family: var(--font); font-size: 15px; font-weight: 700; }
.sim-ring .ring-lab.sub { font-size: 12px; font-weight: 400; fill: var(--ink-3); }
.sim-ring .vz-svg { margin: 0 auto; }
.dist-row { display: grid; grid-template-columns: 12px 30px minmax(0, 1fr) 34px; gap: 8px; align-items: center; font-size: .85rem; margin-bottom: 6px; }
.dist-row .sw { width: 12px; height: 12px; border-radius: 3px; }
.dist-row .bar { height: 10px; }
.dist-row .bar span { display: block; height: 100%; border-radius: 999px; }
.tok-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tok { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); background: transparent; }
.tok.on { background: var(--ok); border-color: var(--ok); }
.tok.part { background: conic-gradient(var(--ok) var(--p), transparent 0); border-color: var(--ok); }
.tb-log { display: flex; gap: 2px; align-items: flex-end; min-height: 22px; flex-wrap: wrap; }
.tb-log span { width: 7px; height: 20px; border-radius: 2px; }
.tb-log span.ok { background: var(--ok); }
.tb-log span.bad { background: var(--hard); }
.viz, .viz input { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }

/* ── whiteboard ── */
.bd-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9rem; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.08); }
.bd-fab:hover { border-color: var(--accent); color: var(--accent); }
.bd-fab.has::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.board { position: fixed; top: 0; right: 0; bottom: 0; width: var(--bd-w, 46vw); z-index: 60; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -6px 0 24px rgba(0,0,0,.06); outline: none; }
.board.max { width: auto; left: 0; border-left: 0; }
.bd-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; touch-action: none; }
.bd-grip:hover { background: linear-gradient(90deg, transparent 3px, var(--accent) 3px, var(--accent) 5px, transparent 5px); }
.board.max .bd-grip { display: none; }
.bd-head, .bd-tools, .bd-foot { display: flex; align-items: center; gap: 4px; padding: 6px 10px; flex-wrap: wrap; }
.bd-head { border-bottom: 1px solid var(--border); gap: 8px; }
.bd-logo { color: var(--accent); display: flex; }
.bd-pick { max-width: min(380px, 60%); font-size: .88rem; padding: 4px 8px; font-weight: 600; }
.bd-tools { border-bottom: 1px solid var(--border); background: var(--bg); }
.bd-b { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 1rem; line-height: 1; }
.bd-b:hover { background: var(--surface-2); color: var(--ink); }
.bd-b.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.bd-b:disabled { opacity: .35; cursor: default; background: transparent; }
.bd-b.sm { min-width: 26px; height: 26px; }
.bd-b:focus-visible, .bd-sw:focus-visible, .bd-zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bd-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.bd-sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; background: transparent; padding: 3px; cursor: pointer; display: inline-flex; }
.bd-sw i { flex: 1; border-radius: 50%; border: 1px solid rgba(127,127,127,.35); }
.bd-sw.on { border-color: var(--ink-2); }
.bd-w i { display: block; width: 18px; background: currentColor; border-radius: 99px; }
.bd-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--surface); }
.bd-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.bd-foot { border-top: 1px solid var(--border); font-size: .78rem; color: var(--ink-3); padding: 4px 10px; flex-wrap: nowrap; }
.bd-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bd-msg.bad { color: var(--hard); font-weight: 600; }
.bd-zoom { border: 0; background: transparent; color: var(--ink-2); font: 500 .78rem var(--mono); min-width: 48px; cursor: pointer; border-radius: 6px; padding: 4px; }
.bd-zoom:hover { background: var(--surface-2); }
.bd-pop { position: absolute; top: 8px; left: 8px; z-index: 3; width: min(360px, calc(100% - 16px)); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 12px; box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.bd-pop-h { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 6px; }
.bd-stamps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.bd-arr { display: flex; gap: 6px; }
.bd-arr input { flex: 1; min-width: 0; font-family: var(--mono); font-size: .82rem; padding: 5px 8px; }
.bd-edit { position: absolute; z-index: 2; margin: 0; min-height: 0; padding: 2px 3px; border: 1px dashed var(--accent); border-radius: 4px; background: transparent; resize: none; overflow: hidden; white-space: pre; font-family: var(--font); outline: none; }
.bd-edit.lbl { text-align: center; font-weight: 500; white-space: pre-wrap; background: var(--surface); }
@media (min-width: 1000px) {
  .bd-open .shell { margin-right: var(--bd-w, 46vw); }
  .bd-open .topic-grid, .bd-open .vz-body, .bd-open .hero, .bd-open .step.compare { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 999px) {
  .board { left: 0; width: auto; border-left: 0; }
  .bd-grip, .bd-maxbtn { display: none !important; }
  .bd-open body { overflow: hidden; }
}
@media (max-width: 640px) { .bd-fab span { display: none; } .bd-fab { padding: 12px; } .bd-foot .bd-msg { display: none; } }
@media print { .board, .bd-fab { display: none !important; } }

/* ── account / sync ── */
.account { padding: 0 2px; }
.acct-cta, .acct-me { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--ink); cursor: pointer; font: inherit; }
.acct-cta:hover { filter: brightness(.98); }
.acct-me { border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.acct-me:hover { text-decoration: none; border-color: var(--ink-3); }
.acct-ico { font-size: 1.15rem; color: var(--accent); line-height: 1; }
.acct-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.acct-txt b { font-size: .84rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-txt small { font-size: .74rem; color: var(--ink-3); }
.acct-me .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.acct-me .dot.synced { background: var(--ok); }
.acct-me .dot.syncing, .acct-me .dot.pending { background: var(--med); }
.acct-me .dot.error, .acct-me .dot.offline { background: var(--hard); }
@media (max-width: 820px) {
  .account { flex: none; order: 3; }
  .acct-cta, .acct-me { padding: 6px 9px; }
  .acct-txt { display: none; }
}
.sync-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(15, 14, 12, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sync-modal { position: relative; width: min(420px, 100%); background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 14px; padding: 26px 24px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.sync-modal h2 { font-size: 1.3rem; margin-bottom: 6px; }
.sync-modal .sub { font-size: .9rem; margin-bottom: 16px; }
.sync-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.sync-x:hover { background: var(--surface-2); color: var(--ink); }
.sync-form { display: flex; flex-direction: column; gap: 12px; }
.sync-form label { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; font-weight: 500; color: var(--ink-2); }
.sync-form input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.sync-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sync-form small { color: var(--ink-3); font-weight: 400; }
.sync-form .btn { justify-content: center; padding: 10px; }
.sync-cap { min-height: 65px; display: flex; justify-content: center; }
.sync-err { background: var(--hard-soft); color: var(--hard); border-radius: 8px; padding: 8px 11px; font-size: .86rem; }
.sync-ok { background: var(--ok-soft); color: var(--ok); border-radius: 8px; padding: 10px 12px; font-size: .88rem; }
.sync-form textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; resize: vertical; min-height: 110px; }
.sync-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.fb-kinds { display: flex; gap: 8px; }
.fb-kinds label { flex: 1; flex-direction: row; }
.fb-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.fb-kinds span { flex: 1; text-align: center; padding: 8px 6px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: .86rem; }
.fb-kinds input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.fb-kinds input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.fb-side { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--ink-2); font: inherit; font-size: .86rem; cursor: pointer; text-align: left; }
.fb-side:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 820px) { .fb-side { display: none; } }
.sync-alt { margin-top: 14px; font-size: .85rem; color: var(--ink-3); text-align: center; }
.sync-remind { position: fixed; right: 20px; bottom: 76px; z-index: 70; width: min(380px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 14px 16px; box-shadow: 0 10px 34px rgba(0,0,0,.18); animation: sync-in .25s ease-out; }
.sync-remind p { font-size: .87rem; color: var(--ink-2); margin: 6px 0; }
.sync-remind .row { margin-top: 10px; gap: 6px; }
.sync-remind-h { display: flex; align-items: center; gap: 8px; padding-right: 30px; }
.sync-remind .sync-x { top: 8px; right: 8px; }
@keyframes sync-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .sync-remind { right: 16px; bottom: 72px; } }
@media (prefers-reduced-motion: reduce) { .sync-remind { animation: none; } }

/* ── footer + legal ── */
.site-foot { margin-top: 56px; padding: 18px 0 22px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; font-size: .8rem; color: var(--ink-3); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--ink-3); }
.site-foot a:hover { color: var(--ink); }
.site-foot a.support { color: var(--accent); font-weight: 500; }
.legal { max-width: 760px; }
.legal .prose h2 { font-size: 1.05rem; margin-top: 1.6em; }

/* ═══════════════════════════════════════════════════════════════════════════
   Workshop notebook: design layer
   Serif display (Fraunces) + Geist + Geist Mono, dotted paper, numbered nav,
   ink hero card, hatched progress tracks, "stamped" hover on link cards.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #f3efe6; --surface: #fffdf8; --surface-2: #ebe6da; --border: #ddd6c6; --line: #1c1b18;
  --ink: #17150f; --ink-2: #4f4b41; --ink-3: #857f71;
  --accent: #c8410b; --accent-soft: #fbe4d5;
  --dot: rgba(23, 21, 15, .11);
  --hatch: repeating-linear-gradient(-45deg, var(--surface-2) 0 3px, transparent 3px 6px);
  --radius: 6px;
  --shadow: none;
  --stamp: 3px 3px 0 var(--line);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11100d; --surface: #1a1915; --surface-2: #26241f; --border: #34312a; --line: #f2804a;
    --ink: #f0ebe0; --ink-2: #b9b2a3; --ink-3: #847d6f; --dot: rgba(240, 235, 224, .07);
    --hatch: repeating-linear-gradient(-45deg, var(--surface-2) 0 3px, transparent 3px 6px);
  }
}
:root[data-theme="dark"] {
  --bg: #11100d; --surface: #1a1915; --surface-2: #26241f; --border: #34312a; --line: #f2804a;
  --ink: #f0ebe0; --ink-2: #b9b2a3; --ink-3: #847d6f; --dot: rgba(240, 235, 224, .07);
  --hatch: repeating-linear-gradient(-45deg, var(--surface-2) 0 3px, transparent 3px 6px);
}

body {
  font-size: 14.5px; letter-spacing: -0.003em;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px; background-attachment: fixed;
}
::selection { background: var(--accent); color: #fff; }

/* type */
h1, h2, .brand, .stat .num, .sync-modal h2 {
  font-family: var(--display); font-optical-sizing: auto; font-variation-settings: "SOFT" 50;
}
h1 { font-size: clamp(2rem, 3.2vw, 2.7rem); font-weight: 560; letter-spacing: -0.025em; line-height: 1.05; margin-bottom: .35em; }
h2 { font-size: 1.45rem; font-weight: 560; letter-spacing: -0.015em; }
h3 { font-weight: 600; letter-spacing: -0.01em; }
.page-head { padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid var(--border); position: relative; }
.page-head::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 56px; height: 2px; background: var(--accent); }
.page-head p { font-size: 1rem; line-height: 1.6; }
.eyebrow, .todo .kind, .stat .lbl, .ck-table th, .bd-pop-h, .vz-t {
  font-family: var(--mono); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-size: .7rem;
}
.eyebrow { color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.eyebrow::before { content: ''; width: 7px; height: 7px; background: var(--accent); flex: none; }
.section-title { margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
.section-title h2 { font-size: 1.35rem; }

/* sidebar: numbered index like a notebook's table of contents */
.sidebar { background: transparent; border-right: 1px solid var(--border); padding: 22px 14px; gap: 20px; }
.brand { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; gap: 9px; }
.brand-mark svg { width: 24px; height: 24px; }
.nav { counter-reset: nav; gap: 1px; }
.nav a { counter-increment: nav; justify-content: flex-start; gap: 12px; padding: 7px 10px; border-radius: 4px; font-weight: 500; border: 1px solid transparent; }
.nav a::before { content: counter(nav, decimal-leading-zero); font: 500 .68rem var(--mono); color: var(--ink-3); width: 16px; flex: none; }
.nav a .badge { margin-left: auto; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: none; padding: 7px 10px; }
.nav a.active::before { color: var(--accent); }
:root[data-theme="dark"] .nav a.active::before { color: #c8410b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav a.active::before { color: #c8410b; } }
.sidebar-foot { font-family: var(--mono); font-size: .7rem; line-height: 1.7; letter-spacing: .02em; border-top: 1px dashed var(--border); padding-top: 12px; }
.fb-side { border-radius: 4px; border-style: dashed; font-size: .84rem; }

/* surfaces */
.card { border-radius: var(--radius); background: var(--surface); }
.btn { border-radius: 5px; font-weight: 550; }
.btn.primary { box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.btn.primary:hover { filter: none; background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: none; }
.pill { border-radius: 4px; font-family: var(--mono); font-weight: 500; font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; }
.pace { border-radius: 4px; font-family: var(--mono); font-weight: 500; font-size: .74rem; letter-spacing: .02em; }
input[type=text], input[type=date], input[type=search], select, textarea { border-radius: 5px; }

/* link cards get a "stamped" hover: lift + hard ink shadow */
.topic-card, .sd-card, a.card { transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.topic-card:hover, .sd-card:hover, a.card:hover { transform: translate(-2px, -2px); box-shadow: var(--stamp); border-color: var(--line); }
@media (prefers-reduced-motion: reduce) { .topic-card, .sd-card, a.card { transition: none; } }

/* progress: hatched track, solid fill */
.bar { height: 5px; border-radius: 0; background: var(--hatch); box-shadow: inset 0 0 0 1px var(--border); }
.bar > span { border-radius: 0; }
.timeline { gap: 4px; }
.timeline span { height: 10px; border-radius: 1px; background: var(--hatch); box-shadow: inset 0 0 0 1px var(--border); }
.timeline span.past { background: var(--heat-3); box-shadow: none; }
.timeline span.now { background: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent); }

/* dashboard hero: an ink card that anchors the page */
.hero-main {
  --surface: #191712; --surface-2: #2a2721; --border: #36322a; --ink: #f4efe4; --ink-2: #c4bdad; --ink-3: #8f8778;
  --hatch: repeating-linear-gradient(-45deg, #2f2b24 0 3px, transparent 3px 6px);
  background: #191712; color: var(--ink); border-color: #191712; position: relative; overflow: hidden;
}
.hero-main::after { /* faint ember glow */
  content: ''; position: absolute; right: -120px; top: -140px; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(242, 128, 74, .28), transparent); pointer-events: none;
}
.hero-main > * { position: relative; z-index: 1; }
.hero-main h1 { font-size: clamp(3rem, 5.4vw, 4.6rem); font-weight: 500; letter-spacing: -0.04em; margin: 4px 0 10px; line-height: .95; }
.hero-main h1 .muted { font-style: italic; font-weight: 400 !important; color: var(--ink-3); }
.hero-main .sub { font-size: 1.05rem; color: var(--ink-2); }
.hero-main .btn { background: transparent; border-color: #4a443a; color: var(--ink); }
.hero-main .btn:hover { background: #2a2721; }
.hero-main .pace.on { background: rgba(242, 128, 74, .16); color: #f6a378; }
.hero-main .pace.behind { background: rgba(242, 123, 123, .14); color: #f6a3a3; }
.hero-main .pace.ahead { background: rgba(95, 210, 138, .14); color: #8be0aa; }
.hero-main .timeline span.past { background: #a8461a; }
.hero-main .timeline span.now { background: #f2804a; box-shadow: 0 0 0 2px #191712, 0 0 0 3px #f2804a; }
.phase-strip div { border-top-width: 2px; font-family: var(--mono); font-size: .7rem; letter-spacing: .02em; }
.phase-strip div b { font-family: var(--font); font-size: .84rem; letter-spacing: 0; margin-bottom: 2px; }
.hero-main .phase-strip div.now { border-color: #f2804a; }
.hero-main .phase-strip div.past { border-color: #a8461a; }
:root[data-theme="dark"] .hero-main { background: #1f1c16; border-color: #3a342a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-main { background: #1f1c16; border-color: #3a342a; } }

/* this-week list */
.todo { padding: 11px 0; border-top-style: dashed; }
.todo .kind { width: 54px; font-size: .64rem; color: var(--ink-3); }
.todo .t a { color: var(--ink); font-weight: 550; }
.todo .t a:hover { color: var(--accent); text-decoration: none; }

/* stats: serif numerals */
.stat { gap: 6px; }
.stat .lbl { color: var(--ink-3); font-size: .64rem; line-height: 1.5; }
.stat .num { font-size: 2.5rem; font-weight: 500; letter-spacing: -0.035em; line-height: 1; margin: 2px 0 4px; }
.stat .num small { font-family: var(--mono); font-size: .78rem; letter-spacing: 0; font-weight: 400; }
.split { font-family: var(--mono); font-size: .7rem; letter-spacing: .01em; }

/* heatmap: squarer cells */
.heatmap { grid-template-rows: repeat(7, 14px); gap: 3px; }
.heatmap i { width: 14px; height: 14px; border-radius: 2px; }
.heatmap i.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.legend { font-family: var(--mono); font-size: .68rem; }
.legend i { border-radius: 2px; }

/* problem lists */
.plist { border-radius: var(--radius); }
.prow-main { padding: 10px 16px; }
.prow:hover { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.prow-title a { font-weight: 550; }
.check { border-radius: 4px; border-width: 1.5px; }
.check.done { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* roadmap */
.topic-card { border-radius: var(--radius); padding: 13px 15px; }
.topic-card .name { font-family: var(--display); font-size: 1.08rem; font-weight: 560; letter-spacing: -0.01em; }
.topic-card .count { font-family: var(--mono); font-size: .7rem; }
.topic-card.done { border-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 50%, var(--surface)); }
.tier-connector { width: 0; border-left: 1.5px dashed var(--ink-3); background: none; height: 12px; }

/* system design cards */
.sd-card .t { font-family: var(--display); font-size: 1.12rem; font-weight: 560; letter-spacing: -0.01em; }

/* plan */
.week { padding: 14px 18px; }
.week .wk { font-family: var(--display); font-size: 1.25rem; font-weight: 560; }
.week .wk small { font-family: var(--mono); font-size: .66rem; letter-spacing: .03em; }
.week.now { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.week .pct { font-family: var(--mono); font-size: .76rem; }

/* misc */
.n-badge { border-radius: 4px; font-family: var(--mono); font-weight: 600; }
.shield { border-radius: var(--radius); }
.toast { border-radius: 5px; font-family: var(--mono); font-size: .8rem; letter-spacing: .01em; }
.bd-fab { border-radius: 6px; border-color: var(--line); box-shadow: var(--stamp); font-weight: 600; }
.bd-fab:hover { color: var(--ink); border-color: var(--line); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--line); }
.acct-cta, .acct-me { border-radius: 5px; }
.sync-modal { border-radius: 8px; border-color: var(--line); box-shadow: 6px 6px 0 var(--line); }
.sync-remind { border-radius: 8px; border-color: var(--line); box-shadow: 5px 5px 0 var(--line); }
.site-foot { font-family: var(--mono); font-size: .7rem; letter-spacing: .02em; border-top-style: dashed; }
.prose h2 { font-size: 1.3rem; }
.prose blockquote { border-left-width: 2px; font-family: var(--display); font-style: italic; font-size: 1.05em; }
@media (max-width: 820px) {
  .sidebar { background: var(--bg); }
  .nav a::before { display: none; }
  .nav a { padding: 6px 9px; }
  .nav a.active { padding: 6px 9px; }
}
/* refinements */
.pill { text-transform: none; letter-spacing: 0; font-size: .7rem; white-space: normal; text-align: left; line-height: 1.35; }
.pill.E, .pill.M, .pill.H, .pill.Easy, .pill.Medium, .pill.Hard { text-transform: uppercase; letter-spacing: .04em; font-size: .64rem; white-space: nowrap; }
.hero-main .timeline { margin-top: auto; }
.hero-main .phase-strip { margin-top: 0; padding-top: 22px; }
.hero-main h1 { margin-bottom: 14px; }
.sidebar-foot { font-size: .66rem; letter-spacing: 0; }
.hero-main .sub { margin-bottom: 20px !important; }
/* mock page: keep the start buttons on one baseline */
.mock-card { display: flex; flex-direction: column; align-items: flex-start; }
.mock-card > .btn { margin-top: auto; }
.mock-card > .row { margin: 12px 0 16px !important; }

/* ── pet (js/pet.js) ── */
.pet-svg { display: block; overflow: visible; }
.pet-body { transform-origin: 60px 104px; animation: pet-bob 3.2s ease-in-out infinite; }
.mood-happy .pet-body { animation: pet-hop 1.6s ease-in-out infinite; }
.mood-missed .pet-body { animation: pet-wiggle 2.4s ease-in-out infinite; }
.pet-shadow { transform-origin: 60px 108px; animation: pet-shadow 3.2s ease-in-out infinite; }
.mood-happy .pet-shadow { animation-duration: 1.6s; }
.pet-eye { transform-box: fill-box; transform-origin: center; animation: pet-blink 4.6s infinite; }
.pet-sparks circle { animation: pet-spark 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pet-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-3px) scale(.98, 1.03); } }
@keyframes pet-hop { 0%, 100% { transform: translateY(0) scale(1.03, .97); } 40% { transform: translateY(-9px) scale(.97, 1.04); } 60% { transform: translateY(-9px) scale(.97, 1.04); } }
@keyframes pet-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-6deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(0); } }
@keyframes pet-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.85); opacity: .7; } }
@keyframes pet-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes pet-spark { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }

/* in the dashboard hero */
.hero-main > .pet-hero {
  position: absolute; z-index: 2; right: 18px; top: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font: inherit;
}
.pet-hero:focus-visible { outline: 2px solid #f2804a; outline-offset: 4px; border-radius: 8px; }
.pet-hero .pet-tag { font-family: var(--mono); font-size: .66rem; letter-spacing: .03em; color: var(--ink-3); }
.pet-hero .pet-tag b { color: var(--ink); font-family: var(--font); font-size: .78rem; letter-spacing: 0; }
.pet-xp { width: 92px; height: 4px; background: #2f2b24; display: block; margin-top: 3px; }
.pet-xp > span { display: block; height: 100%; background: #f2804a; }
.pet-bubble {
  position: absolute; right: calc(100% - 22px); top: 4px; width: max-content; max-width: 190px; text-align: left;
  background: #f4efe4; color: #17150f; font-size: .76rem; font-weight: 500; line-height: 1.35; padding: 7px 10px; border-radius: 8px 8px 2px 8px;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.pet-hero:hover .pet-bubble, .pet-hero:focus-visible .pet-bubble, .pet-hero.evolved .pet-bubble { opacity: 1; transform: none; }
.pet-hero.evolved .pet-svg { animation: pet-evolve 1.4s ease-out; }
@keyframes pet-evolve { 0% { transform: scale(.6); filter: brightness(2.2) drop-shadow(0 0 0 #ffd36b); } 50% { transform: scale(1.15); filter: brightness(1.5) drop-shadow(0 0 18px #ffd36b); } 100% { transform: scale(1); filter: none; } }
.hero-main h1, .hero-main .sub { padding-right: 150px; }
@media (max-width: 640px) {
  .hero-main > .pet-hero { right: 8px; top: 8px; }
  .hero-main > .pet-hero .pet-svg { width: 88px; height: 88px; }
  .hero-main > .pet-hero .pet-tag, .hero-main > .pet-hero .pet-xp, .pet-bubble { display: none; }
  .hero-main h1 { padding-right: 84px; }
  .hero-main .sub { padding-right: 0; }
}

/* sidebar */
.pet-mini { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 10px -6px; padding: 4px 6px; background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; color: var(--ink); text-align: left; font: inherit; }
.pet-mini:hover { background: var(--surface-2); border-color: var(--border); }
.pet-mini span { display: flex; flex-direction: column; line-height: 1.25; }
.pet-mini b { font-family: var(--font); font-size: .82rem; font-weight: 600; letter-spacing: 0; }
.pet-mini small { font-family: var(--mono); font-size: .64rem; color: var(--ink-3); }

/* detail panel */
.pet-modal { width: min(520px, 100%); }
.pet-modal-top { display: flex; gap: 14px; align-items: center; }
.pet-modal-top > div { flex: 1; min-width: 0; }
.pet-modal-top .pet-svg { flex: none; background: radial-gradient(closest-side, rgba(242,128,74,.22), transparent); border-radius: 50%; }
.pet-name { font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1.5px dashed var(--border); padding: 0 0 2px; width: 100%; border-radius: 0; }
.pet-name:hover, .pet-name:focus { border-bottom-color: var(--accent); outline: none; }
.pet-meter small { display: block; margin-top: 6px; font-family: var(--mono); font-size: .7rem; color: var(--ink-3); }
.pet-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 12px; }
.pet-facts div { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
.pet-facts b { display: block; font-family: var(--display); font-size: 1.35rem; font-weight: 560; line-height: 1.1; }
.pet-facts small { font-family: var(--mono); font-size: .64rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.pet-stages { list-style: none; margin: 0; padding: 10px 0 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; border-top: 1px dashed var(--border); }
.pet-stages li { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.pet-stages li small { font-family: var(--mono); font-size: .58rem; color: var(--ink-3); }
.pet-stages li.now small { color: var(--accent); font-weight: 600; }
.pet-stages li.past .pet-svg { opacity: .55; }
.pet-stages .pet-svg .pet-body, .pet-stages .pet-svg .pet-shadow { animation: none; }
.pet-lock { width: 44px; height: 44px; display: grid; place-items: center; border: 1.5px dashed var(--border); border-radius: 50%; color: var(--ink-3); font-family: var(--mono); font-size: .8rem; }
.pet-how { font-size: .8rem; margin: 12px 0 0; }
@media (max-width: 520px) { .pet-stages { grid-template-columns: repeat(4, 1fr); row-gap: 10px; } .pet-modal-top { flex-direction: column; text-align: center; } }
@media (prefers-reduced-motion: reduce) { .pet-body, .pet-shadow, .pet-eye, .pet-sparks circle, .pet-hero.evolved .pet-svg { animation: none !important; } }
/* pet evolution preview */
.pet-preview { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 12px 12px; border-radius: 8px; background: #191712; color: #f4efe4; position: relative; overflow: hidden; min-width: 170px; }
.pet-preview::before { content: ''; position: absolute; inset: 0; background: radial-gradient(closest-side at 50% 45%, rgba(242,128,74,.25), transparent 70%); transition: opacity .4s; opacity: .6; }
.pet-preview.final::before { opacity: 1; background: radial-gradient(closest-side at 50% 45%, rgba(240,70,110,.35), rgba(255,211,107,.12) 60%, transparent 80%); }
.pet-preview > * { position: relative; }
.pet-preview-stage { width: 120px; height: 120px; }
.pet-preview-stage.pop .pet-svg { animation: pet-evolve .7s ease-out; }
.pet-preview.final .pet-preview-stage.pop .pet-svg { animation-duration: 1.2s; }
.pet-preview-cap { display: flex; flex-direction: column; align-items: center; line-height: 1.3; }
.pet-preview-name { font-family: var(--display); font-size: 1.15rem; font-weight: 560; }
.pet-preview.final .pet-preview-name { color: #ffd36b; }
.pet-preview-cap small { font-family: var(--mono); font-size: .62rem; letter-spacing: .04em; text-transform: uppercase; color: #8f8778; }
.pet-preview-dots { display: flex; gap: 4px; margin-top: 4px; }
.pet-preview-dots i { width: 14px; height: 3px; background: #36322a; }
.pet-preview-dots i.on { background: #f2804a; }
.pet-preview.final .pet-preview-dots i.on { background: #f0466e; }
.pet-goal { margin-top: 12px; }
.pet-goal .pet-preview { flex-direction: row; justify-content: center; gap: 16px; padding: 10px 14px; }
.pet-goal .pet-preview-cap { align-items: flex-start; }
.pet-goal .pet-preview-dots { position: absolute; bottom: 10px; right: 14px; }
.pet-howto { display: flex; gap: 18px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.pet-howto .prose { flex: 1; font-size: .92rem; }
.pet-howto .prose p { margin: 0; }
@media (max-width: 560px) { .pet-howto { flex-direction: column; align-items: stretch; } }
/* code language tabs (topic templates) */
.lang-tabs { display: flex; flex-wrap: wrap; gap: 0; margin: -2px 0 10px; border-bottom: 1px solid var(--border); }
.lang-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 6px 11px; font: 500 .74rem var(--mono); letter-spacing: .02em; color: var(--ink-3); cursor: pointer; }
.lang-tabs button:hover { color: var(--ink); }
.lang-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.lang-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tpl-card .card-head { margin-bottom: 8px; }
.vz-left { min-width: 0; align-self: start; }
.vz-left .vz-code { margin-top: 0; }
.vz-langs { margin: 0 0 6px; }
.vz-src .lang-tabs { margin-top: 8px; }
