/* ---------------------------------------------------------------------------
   PatternPrep v2 — Material 3 Expressive.
   Light tonal surfaces, top app bar with pill tabs, five group hues,
   wavy progress ring signature. Content is the hero, not the chrome.
--------------------------------------------------------------------------- */
:root {
  --bg: #f8fafd;
  --surface: #ffffff;
  --surface-2: #f0f4f9;
  --surface-3: #e9eef6;
  --outline: #e0e5ec;
  --ink: #1f1f1f;
  --ink-2: #444746;
  --ink-3: #5f6368;

  --blue: #1a73e8;   --blue-c: #d3e3fd;   --on-blue-c: #0842a0;   --blue-soft: #e8f0fe;
  --green: #1e8e3e;  --green-c: #ceead6;  --on-green-c: #0d652d;  --green-soft: #e6f4ea;
  --amber: #f29900;  --amber-c: #feefc3;  --on-amber-c: #7a4f01;  --amber-soft: #fef7e0;
  --red: #d93025;    --red-c: #fad2cf;    --on-red-c: #8c1d18;    --red-soft: #fce8e6;
  --purple: #8430ce; --purple-c: #e9d2fd; --on-purple-c: #4a0d8a; --purple-soft: #f3e8fd;
  --teal: #0097a7;   --teal-c: #c2ecf4;   --on-teal-c: #00505c;   --teal-soft: #e2f6fa;

  /* extended hues — Pattern Atlas branches */
  --indigo: #4355b9;   --indigo-c: #dde2fb;   --on-indigo-c: #1b2a80;
  --magenta: #b80672;  --magenta-c: #fdd9ec;  --on-magenta-c: #770b4e;
  --orange: #e8710a;   --orange-c: #fee2c8;   --on-orange-c: #8a4a00;
  --brown: #8a6534;    --brown-c: #f0e3cd;    --on-brown-c: #57401d;
  --slate: #5f6368;    --slate-c: #e4e7ed;    --on-slate-c: #3c4043;
  --graphite: #3c4043; --graphite-c: #e8eaed; --on-graphite-c: #202124;

  --solved: var(--green);
  --attempted: var(--amber);
  --untouched: #dbe1e9;
  --ring-track: #e4e9f1;
  --topbar-bg: rgba(248, 250, 253, .92);

  --display: "Outfit", "Google Sans", system-ui, sans-serif;
  --body: "Roboto", system-ui, sans-serif;
  --mono: "Google Sans Code", "JetBrains Mono", Menlo, monospace;

  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;

  --shadow-1: 0 1px 2px rgba(60, 64, 67, .12), 0 1px 6px rgba(60, 64, 67, .08);
  --shadow-2: 0 4px 12px rgba(60, 64, 67, .14), 0 1px 3px rgba(60, 64, 67, .10);
}

html[data-theme="light"] { color-scheme: light; }

/* Dark theme — Google dark palette: bright hue mains, deep tonal containers. */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #131418;
  --surface: #1e2025;
  --surface-2: #282b31;
  --surface-3: #32363d;
  --outline: #363a42;
  --ink: #e7e9ee;
  --ink-2: #b8bcc6;
  --ink-3: #9096a1;

  --blue: #8ab4f8;   --blue-c: #274777;   --on-blue-c: #d3e3fd;   --blue-soft: #1d2636;
  --green: #81c995;  --green-c: #1f4a30;  --on-green-c: #c8ecd4;  --green-soft: #1b2b21;
  --amber: #fdd663;  --amber-c: #54431a;  --on-amber-c: #ffe9a6;  --amber-soft: #2d2718;
  --red: #f28b82;    --red-c: #5c2b26;    --on-red-c: #ffd8d3;    --red-soft: #301f1d;
  --purple: #d0bcff; --purple-c: #463366; --on-purple-c: #eadcff; --purple-soft: #282133;
  --teal: #80deea;   --teal-c: #0f444e;   --on-teal-c: #b8ecf4;   --teal-soft: #17292e;

  --indigo: #9fa8ff;   --indigo-c: #333a75;   --on-indigo-c: #dfe1ff;
  --magenta: #ff8bcb;  --magenta-c: #5c1d44;  --on-magenta-c: #ffd7eb;
  --orange: #fcad70;   --orange-c: #5e3a1b;   --on-orange-c: #ffddbd;
  --brown: #d3b184;    --brown-c: #4c3a24;    --on-brown-c: #ecd9bd;
  --slate: #9aa0a6;    --slate-c: #3a3f46;    --on-slate-c: #dde1e6;
  --graphite: #e8eaed; --graphite-c: #43464c; --on-graphite-c: #f4f5f7;

  --untouched: #3a3e46;
  --ring-track: #3a3e46;
  --topbar-bg: rgba(19, 20, 24, .9);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5), 0 1px 6px rgba(0, 0, 0, .35);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--blue-c); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================ top app bar ============================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 clamp(12px, 2.5vw, 28px);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--outline);
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--surface);
  background: var(--blue);
  padding: 4px 9px;
  border-radius: 11px;
}
.brand-name { font-family: var(--display); font-weight: 500; font-size: 20px; color: var(--ink); letter-spacing: -0.01em; }
.brand-name b { font-weight: 700; color: var(--blue); }

.tabs { display: flex; gap: 4px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-2);
  padding: 8px 13px;
  border-radius: 99px;
  white-space: nowrap;
  transition: background .15s;
}
.tab:hover { background: var(--surface-3); text-decoration: none; }
.tab.active { background: var(--blue-c); color: var(--on-blue-c); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.tabs + .topbar-right { margin-left: 0; }

.progress-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--outline);
  padding: 5px 14px 5px 8px;
  border-radius: 99px;
}
.progress-pill:hover { text-decoration: none; box-shadow: var(--shadow-1); }
.progress-pill svg { display: block; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); }

#themeToggle .icon-sun { display: none; }
html[data-theme="dark"] #themeToggle .icon-sun { display: block; }
html[data-theme="dark"] #themeToggle .icon-moon { display: none; }

.ring-track { stroke: var(--ring-track); }

.menu { position: relative; }
.menu-list {
  position: absolute;
  right: 0;
  top: 46px;
  background: var(--surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--outline);
  padding: 6px;
  min-width: 220px;
  z-index: 60;
}
.menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--body);
  font-size: 14px;
  padding: 10px 14px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
}
.menu-list button:hover { background: var(--surface-2); }
.menu-list button.danger { color: var(--red); }
.menu-list hr { border: none; border-top: 1px solid var(--outline); margin: 6px 4px; }

.hamburger { display: none; }

/* ============================ layout ============================ */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px clamp(16px, 4vw, 40px) 96px;
}
.main:focus { outline: none; }

.foot {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 48px;
  color: var(--ink-3);
  font-size: 13.5px;
  border-top: 1px solid var(--outline);
}

/* ============================ type ============================ */
h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(21px, 2.6vw, 26px);
  letter-spacing: -0.01em;
  margin: 48px 0 18px;
}
h3 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 26px 0 10px; }

.lede { color: var(--ink-2); font-size: 17px; max-width: 62ch; margin: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
}
.eyebrow a { color: inherit; }
.eyebrow a:hover { color: var(--blue); }

/* ============================ hero ============================ */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.5fr auto;
  gap: 32px;
  align-items: center;
  background: linear-gradient(120deg, var(--blue-soft) 0%, var(--bg) 58%, var(--surface) 100%);
  border: 1px solid var(--outline);
  border-radius: var(--r-lg);
  padding: clamp(28px, 4vw, 52px);
  margin-bottom: 20px;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 45% 55% 60% 40% / 50% 45% 55% 50%;
  opacity: .55;
  pointer-events: none;
}
.hero::before { width: 220px; height: 220px; background: var(--amber-c); right: -70px; top: -110px; }
.hero::after { width: 150px; height: 150px; background: var(--green-c); right: 220px; bottom: -90px; }

.hero h1 { margin-bottom: 14px; }
.hero .lede { font-size: 18px; }

.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

.hero-ring { position: relative; z-index: 1; text-align: center; }
.hero-ring .ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-ring .pct { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; color: var(--ink); }
.hero-ring .frac { font-family: var(--mono); font-size: 13px; color: var(--ink-3); margin-top: 6px; }

.ring-progress { transition: stroke-dashoffset .9s cubic-bezier(.3, 0, .2, 1); }

.stat-chips { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.stat-chip {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 99px;
}
.stat-chip b { font-weight: 700; }
.stat-chip.sol { background: var(--green-c); color: var(--on-green-c); }
.stat-chip.att { background: var(--amber-c); color: var(--on-amber-c); }
.stat-chip.rem { background: var(--surface-3); color: var(--ink-2); }

/* ============================ buttons ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 26px;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  transition: box-shadow .15s, background .15s;
}
.btn-filled { background: var(--blue); color: var(--surface); }
.btn-filled:hover { box-shadow: var(--shadow-2); filter: brightness(.94); text-decoration: none; }
.btn-tonal { background: var(--blue-c); color: var(--on-blue-c); }
.btn-tonal:hover { box-shadow: var(--shadow-1); text-decoration: none; }
.btn-outline { background: var(--surface); color: var(--blue); border: 1px solid var(--outline); }
.btn-outline:hover { background: var(--blue-soft); text-decoration: none; }
.btn-sm { font-size: 13.5px; padding: 8px 18px; }

/* ============================ continue card ============================ */
.continue-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  padding: 18px 24px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.continue-card .up-next {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.continue-card .t { font-family: var(--display); font-weight: 600; font-size: 18px; }
.continue-card .spacer { flex: 1; }

/* ============================ section headers ============================ */
.section-head { display: flex; align-items: baseline; gap: 14px; margin: 52px 0 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .sub { color: var(--ink-3); font-size: 14.5px; }

/* ============================ path (pattern grid) ============================ */
.phase-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 16px;
  border-radius: 99px;
  margin: 34px 0 14px;
}
.phase-label .n { font-family: var(--mono); font-weight: 700; font-size: 12px; opacity: .75; }
.phase-blue { background: var(--blue-c); color: var(--on-blue-c); }
.phase-green { background: var(--green-c); color: var(--on-green-c); }
.phase-amber { background: var(--amber-c); color: var(--on-amber-c); }
.phase-red { background: var(--red-c); color: var(--on-red-c); }
.phase-purple { background: var(--purple-c); color: var(--on-purple-c); }
.phase-teal { background: var(--teal-c); color: var(--on-teal-c); }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

.pattern-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  padding: 20px 22px;
  color: inherit;
  transition: box-shadow .18s, transform .18s;
}
.pattern-card:hover { text-decoration: none; box-shadow: var(--shadow-2); transform: translateY(-2px); }

.pattern-top { display: flex; align-items: center; gap: 14px; }
.avatar {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
}
.avatar-blue { background: var(--blue-c); color: var(--on-blue-c); }
.avatar-green { background: var(--green-c); color: var(--on-green-c); }
.avatar-amber { background: var(--amber-c); color: var(--on-amber-c); }
.avatar-red { background: var(--red-c); color: var(--on-red-c); }
.avatar-purple { background: var(--purple-c); color: var(--on-purple-c); }
.avatar-teal { background: var(--teal-c); color: var(--on-teal-c); }

.pattern-top .name { font-family: var(--display); font-weight: 600; font-size: 17.5px; line-height: 1.25; }
.pattern-top .tag { color: var(--ink-3); font-size: 13.5px; }
.pattern-top .mini-ring { margin-left: auto; flex: none; position: relative; }
.mini-ring .mr-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--ink-2);
}

/* solve strip — one square per problem */
.strip { display: flex; flex-wrap: wrap; gap: 5px; }
.strip .sq { width: 13px; height: 13px; border-radius: 4.5px; background: var(--untouched); flex: none; }
.strip .sq.solved { background: var(--solved); }
.strip .sq.attempted { background: var(--attempted); }
.strip-lg .sq { width: 16px; height: 16px; border-radius: 5.5px; }

/* ============================ pattern atlas (mind map) ============================ */
.atlas-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 26px 0 14px;
}

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 99px;
  padding: 4px;
  gap: 2px;
}
.seg-opt {
  font-family: var(--display);
  font-weight: 500;
  font-size: 13.5px;
  padding: 8px 18px;
  border-radius: 99px;
  color: var(--ink-2);
  white-space: nowrap;
}
.seg-opt:hover { background: var(--surface-2); text-decoration: none; }
.seg-opt.active { background: var(--blue-c); color: var(--on-blue-c); font-weight: 600; }

.atlas-float .tool {
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.atlas-float .tool:hover { background: var(--surface-2); }
.atlas-zoom {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--outline);
  background: var(--surface);
  border-radius: 99px;
  padding: 2px;
}
.atlas-zoom button {
  width: 30px; height: 30px;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.atlas-zoom button:hover { background: var(--surface-3); }
.atlas-zoom .pct {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  min-width: 42px;
  text-align: center;
}

/* Map mode is an immersive workspace: the canvas owns the whole viewport
   below the top bar, controls float over it, and the page itself never
   scrolls — one scroll context only. */
body.atlas-full { overflow: hidden; }
body.atlas-full .main { max-width: none; padding: 0; }
body.atlas-full .foot { display: none; }

.atlas-stage {
  position: relative;
  height: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  min-height: 420px;
  background: var(--surface);
}
.atlas-viewport {
  position: absolute;
  inset: 0;
  overflow: auto;
  cursor: grab;
  background-image: radial-gradient(color-mix(in srgb, var(--outline) 72%, transparent) 1px, transparent 1.4px);
  background-size: 24px 24px;
}
.atlas-viewport.dragging { cursor: grabbing; }
.atlas-viewport.dragging * { pointer-events: none; }
.atlas-sizer { position: relative; }

.atlas-float {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
}
.atlas-float-tl { top: 16px; left: 18px; }
.atlas-float-tr { top: 16px; right: 18px; flex-wrap: wrap; justify-content: flex-end; }
.atlas-float-bl { bottom: 14px; left: 18px; }
.atlas-float .seg, .atlas-float .tool, .atlas-float .atlas-zoom { box-shadow: var(--shadow-1); }
.atlas-float-bl .atlas-hint {
  margin: 0;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--outline);
  border-radius: 99px;
  padding: 7px 15px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.atlas-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.atlas-canvas > svg { position: absolute; left: 0; top: 0; display: block; }

.atlas-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.atlas-node .an-t {
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 2px 7px;
  margin: 0 -7px 0 0;
  border-radius: 9px;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.atlas-node button.an-t { cursor: pointer; }
.atlas-node button.an-t:hover { background: var(--surface-3); }

.an-root .an-t {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 18px;
  padding: 11px 18px;
  margin: 0;
  box-shadow: var(--shadow-1);
  display: block;
  white-space: nowrap;
}
.an-root .rt { font-family: var(--display); font-weight: 700; font-size: 17px; display: block; line-height: 1.25; }
.an-root .rs { font-family: var(--mono); font-size: 11px; color: var(--ink-3); display: block; margin-top: 3px; }

.an-d1 .an-t { font-family: var(--display); font-weight: 700; font-size: 14.5px; letter-spacing: .01em; padding: 4px 9px; margin-right: -9px; border-radius: 11px; }
.an-d2 .an-t { font-family: var(--body); font-weight: 600; font-size: 13.5px; }
.an-leaf .an-t { font-family: var(--body); font-weight: 400; font-size: 13.5px; color: var(--ink-2); }

.an-count {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 10.5px;
  padding: 1.5px 8px;
  border-radius: 99px;
  background: var(--chip-bg);
  color: var(--chip-fg);
}
.an-go {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 10.5px;
  padding: 2.5px 9px;
  border-radius: 99px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  flex: none;
}
.an-go:hover { background: var(--chip-main); color: var(--surface); text-decoration: none; }
.an-go.an-learn {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--chip-main) 40%, transparent);
  color: var(--chip-fg);
  font-weight: 500;
}
.an-go.an-learn:hover { background: var(--chip-bg); color: var(--chip-fg); }

.atlas-hint {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin: 12px 2px 0;
}

@media (max-width: 760px) {
  .atlas-float-tr {
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .atlas-float-tr::-webkit-scrollbar { display: none; }
  .atlas-float-bl { display: none; }
}

/* ============================ structures guides (visual blocks) ============================
   Hue arrives via --dg-main / --dg-c / --dg-on set on the page wrapper;
   everything falls back to blue so blocks stay usable anywhere. */

.st-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  padding: 20px 22px;
  color: inherit;
  transition: box-shadow .18s, transform .18s;
}
.st-card:hover { text-decoration: none; box-shadow: var(--shadow-2); transform: translateY(-2px); }
.st-card .st-num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  flex: none;
  width: 34px; height: 34px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--dg-c, var(--blue-c));
  color: var(--dg-on, var(--on-blue-c));
}
.st-card .st-num.done { background: var(--green-c); color: var(--on-green-c); font-size: 15px; }
.st-card .st-body { flex: 1; min-width: 0; }
.st-card .t { font-family: var(--display); font-weight: 600; font-size: 16.5px; }
.st-card .s { color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.st-card .st-min { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); flex: none; padding-top: 8px; }

/* callouts */
.callout {
  border-radius: var(--r-md);
  border: 1px solid;
  padding: 16px 20px;
  margin: 0 0 16px;
  max-width: 72ch;
}
.callout .co-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; flex-wrap: wrap; }
.callout .co-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.callout .co-title { font-family: var(--display); font-weight: 600; font-size: 15.5px; color: var(--ink); }
.callout .co-text { margin: 0; font-size: 15px; color: var(--ink-2); }
.co-analogy { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 24%, var(--surface)); }
.co-analogy .co-label { color: var(--on-blue-c); }
.co-rule { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 24%, var(--surface)); }
.co-rule .co-label { color: var(--on-green-c); }
.co-pitfall { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, var(--surface)); }
.co-pitfall .co-label { color: var(--on-amber-c); }
.co-pro { background: var(--purple-soft); border-color: color-mix(in srgb, var(--purple) 24%, var(--surface)); }
.co-pro .co-label { color: var(--on-purple-c); }

/* big-O strip */
.bigo {
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 0 0 16px;
  max-width: 720px;
}
.bigo-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) auto minmax(140px, 1.6fr);
  gap: 14px;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface);
}
.bigo-row + .bigo-row { border-top: 1px solid var(--outline); }
.bo-op { font-size: 14.5px; font-weight: 500; }
.bo-chip {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 99px;
  justify-self: start;
  white-space: nowrap;
}
.cost-green { background: var(--green-c); color: var(--on-green-c); }
.cost-teal { background: var(--teal-c); color: var(--on-teal-c); }
.cost-amber { background: var(--amber-c); color: var(--on-amber-c); }
.cost-orange { background: var(--orange-c); color: var(--on-orange-c); }
.cost-red { background: var(--red-c); color: var(--on-red-c); }
.bo-note { font-size: 13px; color: var(--ink-3); }
@media (max-width: 640px) {
  .bigo-row { grid-template-columns: 1fr auto; }
  .bo-note { grid-column: 1 / -1; margin-top: -4px; }
}

/* diagram figures */
.dg { margin: 0 0 18px; }
.dg-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.dg-scroll { overflow-x: auto; padding: 4px 2px; }
.dg-cap { font-size: 13.5px; color: var(--ink-3); margin-top: 10px; max-width: 68ch; }

.dg-grid { display: inline-grid; gap: 6px 6px; align-items: center; }
.dg-cell {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--outline);
  border-radius: 12px;
  white-space: nowrap;
}
.dg-cell.hl1 { background: var(--dg-c, var(--blue-c)); border-color: var(--dg-main, var(--blue)); color: var(--dg-on, var(--on-blue-c)); }
.dg-cell.hl2 { border-color: var(--dg-main, var(--blue)); border-style: dashed; }
.dg-cell.dim { opacity: .38; border-style: dashed; }
.dg-idx { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); text-align: center; }
.dg-ptr { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--dg-main, var(--blue)); text-align: center; white-space: nowrap; }
.dg-arrow { color: var(--ink-3); font-size: 15px; text-align: center; }

.dgv { display: flex; flex-direction: column; gap: 6px; }
.dgv-row { display: flex; align-items: center; gap: 10px; }
.dgv .dg-cell { min-width: 84px; height: 40px; }
.dgv-lab { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--dg-main, var(--blue)); white-space: nowrap; }

/* tree + graph SVG */
.dg-tree, .dg-graph { width: 100%; height: auto; display: block; }
.dg-tedge { stroke: var(--outline); stroke-width: 1.6; }
.dg-node { fill: var(--surface-2); stroke: var(--outline); stroke-width: 1.5; }
.dg-node.hl1 { fill: var(--dg-c, var(--blue-c)); stroke: var(--dg-main, var(--blue)); }
.dg-node.hl2 { stroke: var(--dg-main, var(--blue)); stroke-dasharray: 3 2.4; }
.dg-ntext { fill: var(--ink); font: 700 12.5px var(--mono); text-anchor: middle; dominant-baseline: central; }
.dg-ntext.hl1 { fill: var(--dg-on, var(--on-blue-c)); }
.dg-gedge { stroke: var(--ink-3); stroke-width: .9; opacity: .55; }
.dg-gedge.hl { stroke: var(--dg-main, var(--blue)); stroke-width: 1.5; opacity: 1; }
.dg-arrowhead { fill: var(--ink-3); }
.dg-gtext { fill: var(--ink); font: 700 5.5px var(--mono); text-anchor: middle; dominant-baseline: central; }
.dg-gtext.hl1 { fill: var(--dg-on, var(--on-blue-c)); }
.dg-wlab { fill: var(--ink-3); font: 600 4.5px var(--mono); text-anchor: middle; }

/* stepper */
.stepper {
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  background: var(--surface);
  margin: 0 0 18px;
  overflow: hidden;
}
.stepper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 0;
}
.st-title { font-family: var(--display); font-weight: 600; font-size: 15.5px; }
.st-count { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.stepper-stage { padding: 18px 20px 6px; min-height: 96px; }
.stepper-cap { margin: 0; padding: 0 20px 14px; font-size: 14.5px; color: var(--ink-2); min-height: 40px; max-width: none; }
.stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--outline);
  background: var(--surface-2);
}
.st-btn {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 18px;
  border-radius: 99px;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.st-btn:hover:not(:disabled) { background: var(--surface-3); }
.st-btn:disabled { opacity: .45; cursor: default; }
.st-btn.st-primary { background: var(--dg-main, var(--blue)); border-color: transparent; color: var(--surface); }
.st-btn.st-primary:hover:not(:disabled) { background: var(--dg-main, var(--blue)); filter: brightness(.92); }
.st-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.st-dot {
  width: 9px; height: 9px;
  padding: 0;
  border-radius: 99px;
  border: none;
  background: var(--untouched);
  cursor: pointer;
}
.st-dot.done { background: color-mix(in srgb, var(--dg-main, var(--blue)) 45%, var(--untouched)); }
.st-dot.on { background: var(--dg-main, var(--blue)); transform: scale(1.25); }

/* self-check reveals */
.checks { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; max-width: 720px; }
.check-item { border: 1px solid var(--outline); border-radius: 14px; background: var(--surface); overflow: hidden; }
.check-q {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 13px 18px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--body);
}
.check-q:hover { background: var(--surface-2); }
.check-q .cq-t { font-size: 14.5px; font-weight: 500; color: var(--ink); flex: 1; }
.check-q .cq-hint { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); flex: none; white-space: nowrap; }
.check-a { padding: 0 18px 14px; font-size: 14.5px; color: var(--ink-2); max-width: 64ch; }

/* mastery ladder */
.ladder { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 4px; max-width: 720px; }
.ladder-step { display: grid; grid-template-columns: 32px 1fr; gap: 16px; position: relative; padding-bottom: 14px; }
.ladder-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: -2px;
  width: 2px;
  background: var(--outline);
}
.ld-n {
  width: 32px; height: 32px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  background: var(--dg-c, var(--blue-c));
  color: var(--dg-on, var(--on-blue-c));
  position: relative;
  z-index: 1;
}
.ld-t { font-family: var(--display); font-weight: 700; font-size: 15.5px; }
.ld-d { margin: 3px 0 8px; font-size: 14.5px; color: var(--ink-2); max-width: 62ch; }
.ld-link {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--outline);
  background: var(--surface);
  color: var(--dg-on, var(--on-blue-c));
}
.ld-link:hover { text-decoration: none; background: var(--dg-c, var(--blue-c)); border-color: transparent; }

/* ============================ learn cards ============================ */
.learn-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: var(--r-md);
  padding: 26px 26px 24px;
  color: inherit;
  border: 1px solid transparent;
  transition: box-shadow .18s, transform .18s;
  overflow: hidden;
}
.learn-card:hover { text-decoration: none; box-shadow: var(--shadow-2); transform: translateY(-2px); }
.learn-blue { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 22%, var(--surface)); }
.learn-green { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 22%, var(--surface)); }
.learn-amber { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 22%, var(--surface)); }
.learn-purple { background: var(--purple-soft); border-color: color-mix(in srgb, var(--purple) 22%, var(--surface)); }
.learn-red { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 22%, var(--surface)); }
.learn-teal { background: var(--teal-soft); border-color: color-mix(in srgb, var(--teal) 22%, var(--surface)); }
.learn-teal .glyph { color: var(--teal); }

.learn-card .glyph { font-family: var(--mono); font-weight: 700; font-size: 22px; }
.learn-blue .glyph { color: var(--blue); }
.learn-green .glyph { color: var(--green); }
.learn-amber .glyph { color: var(--on-amber-c); }
.learn-purple .glyph { color: var(--purple); }
.learn-red .glyph { color: var(--red); }

.learn-card .t { font-family: var(--display); font-weight: 600; font-size: 19px; }
.learn-card .s { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.learn-card .count { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* topic cards (within a section) */
.topic-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  padding: 20px 22px;
  color: inherit;
  transition: box-shadow .18s, transform .18s;
}
.topic-card:hover { text-decoration: none; box-shadow: var(--shadow-2); transform: translateY(-2px); }
.topic-card .num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  flex: none;
  width: 34px; height: 34px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.topic-card .t { font-family: var(--display); font-weight: 600; font-size: 16.5px; margin-bottom: 3px; }
.topic-card .s { color: var(--ink-2); font-size: 14px; line-height: 1.55; }

/* ============================ problem list ============================ */
.cat-hero {
  border-radius: var(--r-lg);
  padding: clamp(24px, 3.5vw, 40px);
  margin-bottom: 26px;
  border: 1px solid var(--outline);
}
.cat-hero .lede { font-size: 16.5px; }
.cat-hero-blue { background: linear-gradient(115deg, var(--blue-soft), var(--surface) 75%); }
.cat-hero-green { background: linear-gradient(115deg, var(--green-soft), var(--surface) 75%); }
.cat-hero-amber { background: linear-gradient(115deg, var(--amber-soft), var(--surface) 75%); }
.cat-hero-red { background: linear-gradient(115deg, var(--red-soft), var(--surface) 75%); }
.cat-hero-purple { background: linear-gradient(115deg, var(--purple-soft), var(--surface) 75%); }
.cat-hero-teal { background: linear-gradient(115deg, var(--teal-soft), var(--surface) 75%); }
.cat-hero-meta { display: flex; align-items: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.cat-hero-meta .txt { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }

.pattern-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 22px; scrollbar-width: none; }
.pattern-chips::-webkit-scrollbar { display: none; }
.pchip {
  font-family: var(--display);
  font-weight: 500;
  font-size: 13.5px;
  padding: 7px 15px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--outline);
  color: var(--ink-2);
  white-space: nowrap;
  flex: none;
}
.pchip:hover { text-decoration: none; background: var(--surface-2); }
.pchip.active-blue { background: var(--blue-c); color: var(--on-blue-c); border-color: transparent; font-weight: 600; }
.pchip.active-green { background: var(--green-c); color: var(--on-green-c); border-color: transparent; font-weight: 600; }
.pchip.active-amber { background: var(--amber-c); color: var(--on-amber-c); border-color: transparent; font-weight: 600; }
.pchip.active-red { background: var(--red-c); color: var(--on-red-c); border-color: transparent; font-weight: 600; }
.pchip.active-purple { background: var(--purple-c); color: var(--on-purple-c); border-color: transparent; font-weight: 600; }
.pchip.active-teal { background: var(--teal-c); color: var(--on-teal-c); border-color: transparent; font-weight: 600; }

.prob-rows { display: flex; flex-direction: column; gap: 10px; }
.prob-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.prob-row:hover { text-decoration: none; box-shadow: var(--shadow-1); transform: translateX(2px); }
.prob-row .idx { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); width: 24px; flex: none; }
.prob-row .t { font-weight: 500; font-size: 16px; flex: 1; min-width: 0; }
.prob-row .meta { display: flex; align-items: center; gap: 12px; flex: none; }
.hint-count { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.status-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--untouched); flex: none; }
.status-dot.solved { background: var(--solved); }
.status-dot.attempted { background: var(--attempted); }

/* difficulty chips */
.chip {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 99px;
  white-space: nowrap;
}
.chip-easy { color: var(--on-green-c); background: var(--green-c); }
.chip-medium { color: var(--on-amber-c); background: var(--amber-c); }
.chip-hard { color: var(--on-red-c); background: var(--red-c); }
.chip-super { color: var(--on-purple-c); background: var(--purple-c); }
.chip-neutral { color: var(--ink-2); background: var(--surface-3); }

/* ============================ problem detail ============================ */
.article { max-width: 860px; }
.article-wide { max-width: 980px; }

.prob-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.prob-head .chips { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }

.statuses { display: inline-flex; background: var(--surface); border: 1px solid var(--outline); border-radius: 99px; padding: 4px; gap: 2px; }
.statuses button {
  font-family: var(--display);
  font-weight: 500;
  font-size: 13.5px;
  padding: 8px 18px;
  border: none;
  border-radius: 99px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.statuses button:hover { background: var(--surface-2); }
.statuses button.on-none { background: var(--ink); color: var(--bg); font-weight: 600; }
.statuses button.on-attempted { background: var(--amber); color: var(--surface); font-weight: 600; }
.statuses button.on-solved { background: var(--green); color: var(--surface); font-weight: 600; }

.statement-card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  padding: 26px 30px;
  margin-top: 18px;
}
.statement p { margin: 0 0 14px; max-width: 72ch; font-size: 16.5px; }
.statement p:last-child { margin-bottom: 0; }
.example {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  margin: 0 0 14px;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* hints — M3 stepper cards */
.hints { display: flex; flex-direction: column; gap: 12px; }
.hint-step {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  overflow: hidden;
}
.hint-step.locked { background: transparent; border-style: dashed; }
.hint-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--body);
}
.hint-trigger:disabled { cursor: not-allowed; }
.hint-trigger .hn {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 13px;
  background: var(--blue-c); color: var(--on-blue-c);
}
.hint-step.locked .hn { background: var(--surface-3); color: var(--ink-3); }
.hint-trigger .ht { font-family: var(--display); font-weight: 600; font-size: 15.5px; color: var(--ink); }
.hint-step.locked .ht { color: var(--ink-3); font-weight: 500; }
.hint-trigger .hs { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-family: var(--mono); }
.hint-body { padding: 0 20px 20px 68px; white-space: pre-wrap; max-width: 75ch; font-size: 15.5px; color: var(--ink-2); }
.hint-body.mono { font-family: var(--mono); font-size: 13.5px; line-height: 1.75; color: var(--ink); }

.spoiler-actions { display: flex; gap: 14px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.spoiler-note { font-size: 13.5px; color: var(--ink-3); }

/* solution */
.complexity { display: flex; gap: 10px; margin: 18px 0 6px; flex-wrap: wrap; }
.complexity .cx {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 99px;
  padding: 7px 16px;
}
.complexity .cx b { color: var(--blue); font-weight: 700; }

pre.code {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  background: #202124;
  color: #e8eaed;
  border-radius: var(--r-md);
  padding: 22px 26px;
  overflow-x: auto;
  margin: 14px 0;
  tab-size: 4;
}
.tok-keyword { color: #8ab4f8; }
.tok-type { color: #4ecde6; }
.tok-string { color: #81c995; }
.tok-comment { color: #9aa0a6; font-style: italic; }
.tok-number { color: #f28b82; }
.tok-annotation { color: #fdd663; }

.explain-card {
  background: var(--blue-soft);
  border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--surface));
  border-radius: var(--r-md);
  padding: 20px 26px;
  max-width: 75ch;
}
.explain-card p { margin: 0; font-size: 15.5px; }

.prob-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; }
.prob-pager a {
  font-family: var(--display);
  font-weight: 500;
  font-size: 14.5px;
  padding: 10px 20px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--outline);
  color: var(--ink-2);
}
.prob-pager a:hover { text-decoration: none; background: var(--blue-soft); color: var(--on-blue-c); }

/* ============================ article content blocks ============================ */
.blocks { font-size: 16.5px; }
.blocks p { max-width: 72ch; margin: 0 0 16px; }
.blocks ul { max-width: 72ch; margin: 0 0 16px; padding-left: 24px; }
.blocks li { margin-bottom: 9px; }
.blocks li::marker { color: var(--dg-main, var(--blue)); }
.blocks h3 { display: flex; align-items: center; gap: 10px; }
.blocks h3::before { content: ""; width: 5px; height: 22px; border-radius: 3px; background: var(--dg-main, var(--blue)); }

.blocks code, .statement code, .hint-body code, td code, .lede code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--blue-soft);
  color: var(--on-blue-c);
  padding: 2px 6px;
  border-radius: 6px;
}

.blocks table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 20px;
  font-size: 14.5px;
  width: 100%;
  max-width: 780px;
  border: 1px solid var(--outline);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.blocks th {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  color: var(--ink-2);
  background: var(--surface-2);
  padding: 10px 16px;
}
.blocks td { border-top: 1px solid var(--outline); padding: 10px 16px; vertical-align: top; background: var(--surface); }
.blocks td:first-child { font-family: var(--mono); font-size: 13px; white-space: nowrap; }

.article-body {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-lg);
  padding: clamp(24px, 4vw, 44px);
}

/* guided design steps */
.step {
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}
.step summary {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16.5px;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.step summary::-webkit-details-marker { display: none; }
.step summary::before {
  content: "+";
  font-family: var(--mono);
  color: var(--blue);
  font-weight: 700;
  font-size: 17px;
  width: 30px; height: 30px;
  flex: none;
  border-radius: 99px;
  background: var(--blue-soft);
  display: flex; align-items: center; justify-content: center;
}
.step[open] summary::before { content: "–"; }
.step summary:hover { background: var(--surface-2); }
.step .step-body { padding: 4px 24px 20px; }

/* ============================ misc ============================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #202124;
  color: #e8eaed;
  font-family: var(--display);
  font-weight: 500;
  font-size: 14px;
  padding: 14px 26px;
  border-radius: 99px;
  z-index: 90;
  box-shadow: var(--shadow-2);
  animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.data-card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  padding: 24px 28px;
}
.data-card p { margin: 0 0 16px; max-width: 72ch; color: var(--ink-2); }
.data-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-danger-outline { background: var(--surface); color: var(--red); border: 1px solid var(--outline); }
.btn-danger-outline:hover { background: var(--red-soft); }

/* ============================ read tracking ============================ */
.read-toggle {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--outline);
  flex: none;
  align-self: flex-start;
}
.read-toggle:hover { border-color: var(--green); color: var(--on-green-c); }
.read-toggle.is-read { background: var(--green-c); color: var(--on-green-c); border-color: transparent; }

.topic-card .num.num-done { background: var(--green-c); color: var(--on-green-c); font-size: 15px; }

/* ============================ roadmap ============================ */
.rm-toggle { display: flex; gap: 14px; margin: 4px 0 26px; flex-wrap: wrap; }
.rm-opt {
  flex: 1;
  min-width: 250px;
  padding: 18px 24px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--outline);
  background: var(--surface);
  color: inherit;
  transition: border-color .15s, background .15s;
}
.rm-opt:hover { text-decoration: none; border-color: var(--blue); }
.rm-opt.active { border-color: var(--blue); background: var(--blue-soft); }
.rm-opt .t { display: block; font-family: var(--display); font-weight: 700; font-size: 18px; }
.rm-opt.active .t { color: var(--on-blue-c); }
.rm-opt .s { display: block; font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }

.rm-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 34px; }
.rm-overall {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  background: var(--blue-c);
  color: var(--on-blue-c);
  padding: 8px 18px;
  border-radius: 99px;
  flex: none;
}

.roadmap { position: relative; max-width: 900px; }
.roadmap::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 24px;
  bottom: 44px;
  width: 3px;
  border-radius: 2px;
  background: var(--outline);
}

.rm-stage {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 22px;
  margin-bottom: 26px;
}
.rm-node {
  position: relative;
  width: 46px;
  height: 46px;
  background: var(--bg);
  border-radius: 99px;
  z-index: 1;
}
.rm-node svg { display: block; }
.rm-node-n {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-2);
}

.rm-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-md);
  padding: 22px 26px;
}
.rm-card::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 21px;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--outline);
}

.rm-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rm-title { font-family: var(--display); font-weight: 700; font-size: 19px; }
.rm-pct { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }
.rm-goal { margin: 10px 0 0; color: var(--ink-2); font-size: 15px; max-width: 68ch; }

.rm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.rm-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid transparent;
  max-width: 100%;
}
a.rm-chip:hover { text-decoration: none; border-color: var(--blue); color: var(--ink); }
.rm-chip .dot { width: 8px; height: 8px; border-radius: 99px; flex: none; }
.rm-chip .ct { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.rm-chip.done { background: var(--green-c); color: var(--on-green-c); }
.rm-chip.done .ct { color: var(--on-green-c); }
.rm-chip.rm-note { background: transparent; border: 1.5px dashed var(--outline); color: var(--ink-3); }

.rm-gate {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--ink-2);
}
.rm-gate b { color: var(--ink); font-weight: 600; }

@media (max-width: 640px) {
  .roadmap::before { left: 15px; }
  .rm-stage { grid-template-columns: 32px 1fr; gap: 16px; }
  .rm-node, .rm-node svg { width: 32px; height: 32px; }
  .rm-node-n { font-size: 11px; }
  .rm-card::before { left: -16px; width: 16px; }
}

/* ============================ drawer (mobile) ============================ */
.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: 300px;
  background: var(--surface);
  z-index: 70;
  transform: translateX(-105%);
  transition: transform .22s cubic-bezier(.3, 0, .2, 1);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  box-shadow: var(--shadow-2);
  padding: 20px 14px;
  overflow-y: auto;
}
body.nav-open .drawer { transform: none; }
.drawer a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 99px;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
}
.drawer a:hover { background: var(--surface-2); text-decoration: none; }
.drawer a.active { background: var(--blue-c); color: var(--on-blue-c); font-weight: 600; }
.drawer .drawer-group {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 18px 16px 6px;
}
.drawer .mini { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-left: auto; }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(31, 31, 31, .4);
  z-index: 65;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
body.nav-open .scrim { opacity: 1; pointer-events: auto; }

/* ============================ responsive ============================ */
@media (max-width: 1080px) {
  .tabs { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-ring { order: -1; margin: 0 auto; }
  .prob-head { flex-direction: column; }
  .hint-body { padding-left: 20px; }
  .brand-name { display: none; }
  .main { padding-top: 24px; }
}
