/* Mindicraft — one stylesheet, light and dark, no framework.
   The feel: a working grimoire. Warm paper, clear ink, folio marks, and no
   ornament that hides the causal chain. */

:root {
  --bg: #f7f3ec;
  --panel: #fffdf8;
  --ink: #2b2620;
  --muted: #6f675c;
  --line: #e5dccc;
  --ember: #b0522b;
  --leaf: #4a7c59;
  --amber: #815b12;
  --plum: #7d5ba6;
  --system-accent: #2a6f9d;
  --system-control-ink: #174b70;
  --system-control-hover: #0e3c5e;
  --shadow: 0 1px 3px rgba(60, 45, 20, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191613;
    --panel: #211d19;
    --ink: #ece5da;
    --muted: #a99f92;
    --line: #37302a;
    --ember: #e07a4a;
    --leaf: #7fb08a;
    --amber: #d3a94e;
    --plum: #b295d6;
    --system-accent: #72c9ff;
    --system-control-ink: #bfe7ff;
    --system-control-hover: #e9f7ff;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
.sr-only {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
h1, h2, h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", serif;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
a { color: var(--ember); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible,
summary:focus-visible, label:has(input:focus-visible),
[data-learning-focus-fallback]:focus-visible {
  outline: 3px solid var(--ember); outline-offset: 3px; border-radius: 0.2rem;
}

main { max-width: 46rem; margin: 0 auto; padding: 0 1.1rem 3rem; }

/* header + language switcher */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  max-width: 46rem; margin: 0 auto; padding: 0.9rem 1.1rem;
}
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.55rem; }
.brand {
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-weight: 700; font-size: 1.15rem; color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--ember); }
.langs { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.lang {
  padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.85rem;
  border: 1px solid var(--line); color: var(--muted);
}
.lang.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lang:hover { text-decoration: none; border-color: var(--ember); color: var(--ember); }
.system-door {
  flex: none; padding: 0.2rem 0.7rem; border: 1px solid #2c75ad;
  border-radius: 999px; color: #e9f7ff; background: #102238;
  font: 700 0.75rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em; box-shadow: 0 0 0.8rem rgba(55, 160, 230, 0.12);
}
.system-door:hover { color: #fff; border-color: #72c9ff; text-decoration: none; }

/* root cover — an obvious door dressed like a working book */
.root-page,
body[data-learning-page="home"],
body[data-learning-page="domain"],
body[data-learning-page="guide"] {
  background:
    radial-gradient(circle at 15% 8%, color-mix(in srgb, var(--amber) 8%, transparent), transparent 28rem),
    repeating-linear-gradient(90deg, transparent 0 4rem, color-mix(in srgb, var(--line) 20%, transparent) 4rem calc(4rem + 1px)),
    var(--bg);
}
body[data-learning-page="home"] main,
body[data-learning-page="home"] .top { max-width: 60rem; }
body[data-learning-page="domain"] main,
body[data-learning-page="domain"] .top,
body[data-learning-page="guide"] main,
body[data-learning-page="guide"] .top { max-width: 50rem; }
body[data-learning-page="domain"] main,
body[data-learning-page="guide"] main {
  min-height: calc(100vh - 8rem); padding-top: 0.7rem;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  border-inline: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.root-page { min-height: 100vh; }
.root-top { max-width: 60rem; padding-top: 1.15rem; }
.root-agent-door {
  color: var(--muted); font-size: 0.84rem; text-decoration: underline;
  text-decoration-color: var(--line); text-underline-offset: 0.2rem;
}
.root-main { max-width: 60rem; padding-bottom: 4rem; }
.root-cover {
  position: relative; isolation: isolate; overflow: hidden;
  margin: 1.25rem 0; padding: clamp(1.5rem, 5vw, 3.5rem);
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--amber) 5%, transparent), transparent 36%),
    var(--panel);
  border: 3px double var(--line); border-radius: 0.2rem;
  box-shadow: 0 1.4rem 3rem rgba(54, 38, 18, 0.12);
}
.root-cover::after {
  content: "✦"; position: absolute; z-index: -1; right: -0.04em; top: -0.34em;
  color: color-mix(in srgb, var(--amber) 9%, transparent);
  font: 20rem/1 "Iowan Old Style", Palatino, Georgia, serif;
}
.root-kicker, .book-kicker {
  color: var(--ember); font: 750 0.74rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.root-cover h1 {
  margin: 0.15rem 0 0.25rem; font-size: clamp(2.9rem, 9vw, 5.8rem);
  letter-spacing: -0.045em;
}
.root-lede { margin: 0 0 1rem; font-size: clamp(1.1rem, 2.4vw, 1.35rem); color: var(--muted); }
.root-cover > p:not(.root-kicker, .root-lede, .root-equation, .root-actions) { max-width: 42rem; }
.root-equation {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1.2fr;
  align-items: stretch; gap: 0.35rem; margin: 1.7rem 0; padding: 0;
}
.root-equation span {
  display: grid; place-items: center; min-height: 4rem; padding: 0.55rem;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--amber) 5%, var(--panel));
  font-family: "Iowan Old Style", Palatino, Georgia, serif; font-weight: 700; text-align: center;
}
.root-equation b { align-self: center; color: var(--ember); }
.root-open { margin-top: 2rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.root-open h2, .root-shelves h2 { margin: 0 0 0.8rem; font-size: 1.2rem; }
.root-languages {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem;
}
.root-languages a, .root-shelves a {
  display: block; padding: 0.8rem 0.9rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 0.2rem; background: var(--bg);
}
.root-languages a:hover, .root-shelves a:hover {
  border-color: var(--ember); text-decoration: none; background: var(--panel);
}
.root-languages strong, .root-shelves strong { display: block; font-family: "Iowan Old Style", Palatino, Georgia, serif; }
.root-languages span, .root-shelves span { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.8rem; }
.root-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: 1rem 0 0; }
.book-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem;
  padding: 0.5rem 1rem; color: var(--panel); background: var(--ink);
  border: 1px solid var(--ink); border-radius: 0.18rem; font-weight: 750;
}
.book-button:hover { color: var(--panel); background: var(--ember); border-color: var(--ember); text-decoration: none; }
.root-shelves { margin: 2rem 0; }
.root-shelves > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.wildfire-entry {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 0.8rem 0 0; padding: 0.85rem 1rem; color: var(--ink);
  border: 1px solid var(--line); border-left: 4px solid var(--amber);
  border-radius: 0.2rem; background: color-mix(in srgb, var(--amber) 7%, var(--panel));
}
.wildfire-entry > span > strong, .wildfire-entry > span > span { display: block; }
.wildfire-entry > span > span { margin-top: 0.08rem; color: var(--muted); font-size: 0.78rem; }
.wildfire-entry::after { content: "Open now →"; flex: none; font-weight: 750; color: var(--amber); }
.wildfire-entry:hover { border-color: var(--amber); text-decoration: none; }
.not-found { max-width: 42rem; margin-top: 12vh; padding: 2rem; border: 3px double var(--line); background: var(--panel); }
.not-found nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; margin-top: 1.3rem; }

/* home hero */
.wildfire-home-door {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 1rem 0 0; padding: 0.9rem 1rem;
  background: color-mix(in srgb, var(--amber) 7%, var(--panel));
  border: 1px solid var(--line); border-left: 4px solid var(--amber);
  border-radius: 0.75rem; box-shadow: var(--shadow);
}
.wildfire-home-door div { display: grid; gap: 0.08rem; }
.wildfire-home-door strong { font-family: "Iowan Old Style", Palatino, Georgia, serif; }
.wildfire-home-door span { color: var(--muted); font-size: 0.84rem; }
.wildfire-home-door > a {
  flex: none; min-height: 2.75rem; display: inline-flex; align-items: center;
  padding: 0.55rem 0.8rem; border: 1px solid var(--amber); border-radius: 0.55rem;
  color: var(--ink); font-weight: 750;
}
.wildfire-home-door > a:hover { background: var(--panel); text-decoration: none; }
.hero {
  position: relative; margin: 1.2rem 0 2rem; padding: clamp(1.25rem, 4vw, 2.4rem);
  text-align: left; background: var(--panel); border: 3px double var(--line);
  border-radius: 0.2rem; box-shadow: 0 1rem 2.5rem rgba(54, 38, 18, 0.09);
}
.hero h1 { max-width: 42rem; font-size: clamp(1.9rem, 4vw, 2.55rem); margin: 0.2rem 0 0.55rem; }
.hero .hero-intro { color: var(--muted); max-width: 42rem; margin: 0 0 0.9rem; }
.book-kicker { margin: 0; }
.hero .book-truth {
  max-width: 42rem; margin: 0 0 1rem; padding: 0.65rem 0 0.65rem 1rem;
  color: var(--ink); border-left: 3px solid var(--ember);
}
.hero-actions { margin: 0 0 1.2rem; }
.craft-law { margin: 1.35rem 0; padding: 1rem 0; border-block: 1px solid var(--line); }
.craft-law h2 { margin: 0 0 0.65rem; font-size: 1rem; }
.craft-law ol {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: craft-step;
}
.craft-law li {
  counter-increment: craft-step; position: relative; min-width: 0;
  padding: 0.45rem 0.75rem 0.45rem 2.1rem; border-left: 1px solid var(--line);
}
.craft-law li:first-child { border-left: 0; }
.craft-law li::before {
  content: counter(craft-step); position: absolute; left: 0.55rem; top: 0.52rem;
  color: var(--ember); font: 750 0.72rem/1 ui-monospace, monospace;
}
.craft-law strong, .craft-law span { display: block; }
.craft-law strong { font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 0.93rem; }
.craft-law span { margin-top: 0.16rem; color: var(--muted); font-size: 0.74rem; line-height: 1.4; }
.search-label { display: block; margin: 0 0 0.4rem; font-weight: 750; }
#q {
  width: 100%; max-width: 34rem; padding: 0.72rem 0.85rem; font: inherit;
  border: 1.5px solid var(--line); border-radius: 0.18rem;
  background: var(--panel); color: var(--ink); outline: none;
}
#q:focus { border-color: var(--ember); }

/* the tree: numbered domains */
.book-contents { padding-bottom: 1rem; }
.domain { margin-top: 2.8rem; padding-top: 1.15rem; border-top: 1px solid var(--line); }
.domain h2 { font-size: 1.42rem; margin: 0 0 0.25rem; }
.domain h2 a { color: var(--ink); }
.domain h2 a:hover { color: var(--ember); text-decoration: none; }
.dnum {
  display: inline-block; min-width: 1.7em; text-align: center;
  font-size: 0.8rem; font-family: inherit; font-weight: 600;
  border: 1.5px solid var(--line); border-radius: 0.12rem;
  color: var(--muted); vertical-align: 0.25em; margin-right: 0.2rem;
}
.count { font-family: inherit; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.intro { color: var(--muted); margin: 0.1rem 0 0.9rem; }

/* guide cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.7rem; }
.card {
  display: flex; flex-direction: column; gap: 0.3rem;
  background: color-mix(in srgb, var(--panel) 82%, var(--bg));
  border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 0.18rem;
  padding: 0.85rem 1rem; color: var(--ink);
}
.card:hover { border-color: var(--ember); background: var(--panel); text-decoration: none; }
.card .sum { font-size: 0.88rem; color: var(--muted); flex: 1; }
.card .meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* chips */
.chip {
  font-size: 0.75rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.55rem;
}
.diff-easy { color: var(--leaf); border-color: var(--leaf); }
.diff-steady { color: var(--amber); border-color: var(--amber); }
.diff-hard { color: var(--ember); border-color: var(--ember); }
.diff-mastery { color: var(--plum); border-color: var(--plum); }

/* guide page */
.crumb { color: var(--muted); font-size: 0.9rem; margin: 1rem 0 0; }
.guide h1 { font-size: 1.9rem; margin: 0.6rem 0 0.3rem; }
.lede { font-size: 1.1rem; color: var(--muted); font-style: italic; margin: 0 0 0.6rem; }
.guide .meta { display: flex; gap: 0.4rem; margin: 0 0 1.2rem; }
.guide h2 { font-size: 1.25rem; margin: 1.8rem 0 0.5rem; border-bottom: 1px solid var(--line); padding-bottom: 0.25rem; }
.guide ol, .guide ul { padding-left: 1.4rem; }
.guide li { margin: 0.35rem 0; }
.guide img { max-width: 100%; }
.guide pre { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.8rem 1rem; }
.guide blockquote { margin: 1rem 0; padding: 0.1rem 1rem; border-left: 3px solid var(--amber); color: var(--muted); background: var(--panel); border-radius: 0 0.5rem 0.5rem 0; }
.guide table { border-collapse: collapse; display: block; overflow-x: auto; }
.guide th, .guide td { border: 1px solid var(--line); padding: 0.35rem 0.7rem; text-align: left; }

/* needs / unlocks boxes */
.box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 0.7rem;
  padding: 0.7rem 1rem; margin: 1.2rem 0; font-size: 0.95rem;
}
.box.needs { border-left: 3px solid var(--amber); }
.box.opens { border-left: 3px solid var(--leaf); }

.notice {
  background: var(--panel); border: 1px dashed var(--amber); border-radius: 0.7rem;
  padding: 0.6rem 1rem; color: var(--muted); font-size: 0.9rem; margin-top: 1rem;
}

/* prev / next */
.prevnext { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; font-size: 0.92rem; }
.prevnext .next { margin-left: auto; text-align: right; }

.foot {
  text-align: center; color: var(--muted); font-size: 0.85rem;
  padding: 2rem 1rem 2.5rem; border-top: 1px solid var(--line); margin-top: 2rem;
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.55rem; }
  .guide h1 { font-size: 1.5rem; }
  .grid { grid-template-columns: 1fr; }
  .top { align-items: flex-start; flex-wrap: wrap; }
  .top-actions { width: 100%; align-items: flex-start; flex-direction: column; gap: 0.4rem; }
  .wildfire-home-door { align-items: stretch; flex-direction: column; }
  .wildfire-home-door > a { justify-content: center; }
  .root-cover { padding: 1.25rem; }
  .root-equation { grid-template-columns: 1fr; }
  .root-equation span { min-height: 3rem; }
  .root-equation b { justify-self: center; line-height: 0.7; }
  .root-languages, .root-shelves > div { grid-template-columns: 1fr; }
  .wildfire-entry { align-items: flex-start; flex-direction: column; }
  .wildfire-entry::after { content: "Open now →"; }
  .craft-law ol { grid-template-columns: 1fr; }
  .craft-law li { border-top: 1px solid var(--line); border-left: 0; }
  .craft-law li:first-child { border-top: 0; }
  body[data-learning-page="domain"] main,
  body[data-learning-page="guide"] main { border-inline: 0; }
}

@media print {
  .root-page,
  body[data-learning-page="home"],
  body[data-learning-page="domain"],
  body[data-learning-page="guide"] { background: #fff; }
  .root-cover, .hero { box-shadow: none; }
  .root-agent-door, .system-door, .langs { display: none; }
}

/* The Mindicraft System — private progress as a lens over real study.
   No leaderboard, streak, timer, loss, content gate, or automatic tracking. */
.learning-strip, .system-window {
  --system-blue: #72c9ff;
  --system-green: #7ee2a8;
  --system-amber: #ffd479;
  --system-bg: #0d1827;
  --system-panel: #12243a;
  --system-ink: #edf8ff;
  --system-muted: #a9c3d7;
  --system-line: #40789e;
  color: var(--system-ink); background:
    linear-gradient(135deg, rgba(46, 118, 166, 0.12), transparent 42%),
    var(--system-bg);
  border: 1px solid var(--system-line); border-radius: 0.85rem;
  box-shadow: 0 0.8rem 2.2rem rgba(8, 20, 35, 0.16), inset 0 0 1.5rem rgba(93, 190, 245, 0.04);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.learning-strip {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 0.8rem; margin: 0.5rem 0 1.4rem; padding: 0.75rem 0.85rem;
}
.learning-strip-rank {
  display: grid; place-items: center; width: 2.35rem; height: 2.35rem;
  border: 1px solid var(--system-blue); border-radius: 0.45rem;
  color: var(--system-blue); font-size: 1.45rem; font-weight: 850;
  text-shadow: 0 0 0.75rem rgba(114, 201, 255, 0.45);
}
.learning-strip strong { display: block; font-size: 0.9rem; }
.learning-strip small { color: var(--system-muted); }
.learning-strip a { color: var(--system-blue); font-size: 0.78rem; }
.system-page { max-width: 46rem; }
.system-kicker {
  margin: 1rem 0 0.3rem; color: var(--system-accent); font: 750 0.76rem/1.5 ui-monospace, monospace;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.system-window { position: relative; overflow: hidden; margin: 1.4rem 0; padding: 1.05rem; }
.system-window::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.16;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(114, 201, 255, 0.1) 4px);
}
.system-window > * { position: relative; }
.system-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding-bottom: 0.65rem; border-bottom: 1px solid var(--system-line);
}
.system-heading h2 { margin: 0; color: var(--system-blue); font: 800 1.05rem/1.4 ui-monospace, monospace; letter-spacing: 0.08em; }
.system-heading span { color: var(--system-muted); font-size: 0.72rem; }
.system-rank-row { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; margin: 1rem 0; }
.system-rank {
  display: grid; place-items: center; width: 4rem; height: 4rem;
  border: 2px solid var(--system-blue); border-radius: 0.55rem;
  color: var(--system-blue); font-size: 2.5rem; font-weight: 900;
  text-shadow: 0 0 1rem rgba(114, 201, 255, 0.5);
}
.system-rank-copy strong { display: block; font-size: 1rem; }
.system-rank-copy small { color: var(--system-muted); }
.system-xp-label { display: flex; justify-content: space-between; gap: 1rem; color: var(--system-muted); font-size: 0.72rem; }
.system-progress {
  display: block; width: 100%; height: 0.7rem; margin: 0.35rem 0 0.9rem;
  border: 1px solid var(--system-line); border-radius: 999px; overflow: hidden;
  background: #08111d; appearance: none;
}
.system-progress::-webkit-progress-bar { background: #08111d; }
.system-progress::-webkit-progress-value { background: linear-gradient(90deg, #3a8fc4, var(--system-blue)); }
.system-progress::-moz-progress-bar { background: linear-gradient(90deg, #3a8fc4, var(--system-blue)); }
.system-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; }
.system-stat { padding: 0.55rem; background: var(--system-panel); border: 1px solid var(--system-line); border-radius: 0.5rem; }
.system-stat strong { display: block; color: var(--system-green); font-size: 1.05rem; }
.system-stat span { color: var(--system-muted); font-size: 0.68rem; }
.system-section {
  margin: 1.25rem 0; padding: 0.9rem 1rem; background: var(--panel);
  border: 1px solid var(--line); border-left: 3px solid var(--system-accent); border-radius: 0.75rem;
}
.system-section h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.system-section > p:first-of-type { color: var(--muted); }
.system-quest-path, .system-ready-list, .system-binder-list { margin: 0.65rem 0 0; padding: 0; list-style: none; }
.system-quest-path { counter-reset: system-step; }
.system-quest-path li {
  counter-increment: system-step; display: grid; grid-template-columns: auto 1fr auto;
  gap: 0.65rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid var(--line);
}
.system-quest-path li::before {
  content: counter(system-step); display: grid; place-items: center; width: 1.5rem; height: 1.5rem;
  border: 1px solid var(--system-accent); border-radius: 50%; color: var(--system-accent); font: 700 0.7rem/1 ui-monospace, monospace;
}
.system-quest-path li.is-done { color: var(--muted); }
.system-quest-path li.is-done::before { content: "✓"; color: var(--leaf); border-color: var(--leaf); }
.system-ready-list, .system-binder-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.55rem; }
.system-ready-list a, .system-binder-list li {
  display: block; padding: 0.65rem 0.75rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 0.55rem;
}
.system-ready-list a:hover { border-color: var(--system-accent); text-decoration: none; }
.system-ready-list small, .system-binder-list small { display: block; color: var(--muted); }
.learning-checkpoint {
  margin: 1.7rem 0; padding: 1rem; background: color-mix(in srgb, var(--system-accent) 6%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--system-accent) 48%, var(--line));
  border-left: 4px solid var(--system-accent); border-radius: 0.8rem;
}
.learning-checkpoint h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.learning-checkpoint > p { color: var(--muted); }
.learning-checks { display: grid; gap: 0.45rem; margin: 0.8rem 0; }
.learning-checks label {
  display: flex; gap: 0.55rem; align-items: flex-start; padding: 0.5rem 0.6rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 0.5rem;
}
.learning-checks input { margin-top: 0.28rem; accent-color: var(--system-accent); }
.system-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.75rem; }
.system-button, .system-file-label {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.3rem;
  padding: 0.35rem 0.85rem; border: 1px solid var(--system-accent); border-radius: 999px;
  color: var(--system-control-ink); background: color-mix(in srgb, #72c9ff 14%, var(--panel));
  font: inherit; font-size: 0.82rem; font-weight: 700; line-height: 1.35; cursor: pointer;
}
.system-button:hover, .system-file-label:hover { border-color: var(--system-control-hover); text-decoration: none; }
.system-button:disabled { cursor: not-allowed; opacity: 0.48; }
.system-button-danger { color: var(--ember); border-color: var(--ember); background: transparent; }
.system-button-danger:hover { border-color: var(--ember); }
.system-file-label input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.system-message { min-height: 1.5em; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.system-receipt {
  margin-top: 0.75rem; padding: 0.75rem; color: var(--system-ink); background: var(--system-bg);
  border: 1px solid var(--system-line); border-radius: 0.55rem;
  font: 0.78rem/1.55 ui-monospace, monospace;
  animation: system-rise 420ms ease-out;
}
.system-receipt strong { color: var(--system-green); }
@keyframes system-rise { from { transform: translateY(0.35rem); opacity: 0; } to { transform: none; opacity: 1; } }
.card.is-learned { border-color: color-mix(in srgb, var(--leaf) 65%, var(--line)); }
.card.is-quest { outline: 2px solid var(--system-accent); outline-offset: 1px; }
.learning-card-mark {
  align-self: flex-start; padding: 0.05rem 0.42rem; border: 1px solid currentColor;
  border-radius: 999px; color: var(--leaf); font-size: 0.68rem;
}
.learning-card-mark.is-quest { color: var(--system-accent); }
.system-sigil-help {
  margin: 0.75rem 0 0; color: var(--system-muted); font-size: 0.7rem;
}
.system-xenia-boundary {
  color: var(--muted); font-size: 0.88rem;
}
.system-boundary {
  padding: 0.75rem 0.85rem; color: var(--muted); background: var(--panel);
  border: 1px dashed var(--line); border-radius: 0.65rem; font-size: 0.88rem;
}
html[data-learning-mode="quiet"] .learning-strip,
html[data-learning-mode="quiet"] .learning-checkpoint,
html[data-learning-mode="quiet"] .learning-card-mark { display: none !important; }
@media (max-width: 560px) {
  .learning-strip { grid-template-columns: auto 1fr; }
  .learning-strip > a { grid-column: 2; }
  .system-stats { grid-template-columns: 1fr; }
  .system-quest-path li { grid-template-columns: auto 1fr; }
  .system-quest-path li > small { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .system-receipt { animation: none; }
}

/* the margin — where the book receives */
.marginbox {
  background: var(--panel); border: 1px dashed var(--line); border-radius: 0.7rem;
  padding: 0.7rem 1rem; margin: 1.6rem 0; font-size: 0.95rem;
}
.marginbox summary { cursor: pointer; color: var(--muted); }
.marginbox summary:hover { color: var(--ember); }
.marginbox .hint { color: var(--muted); font-size: 0.85rem; margin: 0.6rem 0 0.4rem; }
.marginbox textarea, .marginbox input[type="text"], .marginbox input:not([type]) {
  width: 100%; font: inherit; font-size: 0.9rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.5rem 0.7rem;
}
.marginbox textarea { resize: vertical; margin-bottom: 0.5rem; }
.marginbox .mrow { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.6rem; }
.marginbox .mrow input:not([type="checkbox"]) { flex: 1; min-width: 12rem; }
.marginbox label { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.marginbox .marginchoices {
  display: grid; gap: 0.35rem; margin: 0.35rem 0 0.8rem;
}
.marginbox .marginchoices label { white-space: normal; }
.marginbox #mmsg { overflow-wrap: anywhere; }
.marginbox .marginreceipt { margin-top: 0.45rem; }
.marginbox button {
  font: inherit; font-size: 0.9rem; cursor: pointer; color: var(--bg);
  background: var(--ember); border: 0; border-radius: 999px; padding: 0.35rem 1.1rem;
}
.marginbox button:disabled { opacity: 0.5 }

/* honesty labels */
.evid-tradition-asserted { color: var(--muted); border-style: dashed; }
.evid-hand-tested { color: var(--leaf); border-color: var(--leaf); }

/* Frontier Walk — the map ends honestly, and the edge stays readable. */
.frontier-page { --frontier: var(--plum); }
.frontier-kicker {
  margin: 1.2rem 0 0.25rem; color: var(--frontier); font-size: 0.78rem;
  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.frontier-boundary {
  margin: 1.4rem 0; padding: 0.85rem 1rem; color: var(--muted);
  background: var(--panel); border: 1px dashed var(--frontier);
  border-radius: 0.75rem;
}
.frontier-walk {
  margin: 2rem 0; padding: 1rem 1.1rem 1.1rem;
  background: linear-gradient(135deg, var(--panel), color-mix(in srgb, var(--frontier) 7%, var(--panel)));
  border: 1px solid var(--line); border-left: 3px solid var(--frontier);
  border-radius: 0.8rem; box-shadow: var(--shadow);
}
.frontier-walk h2 { margin-top: 0.2rem; }
.frontier-bridge {
  padding-left: 0.75rem; border-left: 2px solid var(--frontier);
  color: var(--muted);
}
.frontier-stop { margin-bottom: 0; color: var(--muted); font-style: italic; }
.frontier-grid { display: grid; gap: 0.85rem; }
.frontier-sequence { margin: 1rem 0; padding: 0; list-style: none; }
.frontier-sequence > li { min-width: 0; }
.frontier-trails {
  display: grid; gap: 0.65rem; margin: 0 0 2rem; padding: 0; list-style: none;
}
.frontier-trails li {
  padding: 0.75rem 0.85rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: 0.7rem;
}
.frontier-trails a { font-family: "Iowan Old Style", Georgia, serif; font-weight: 700; }
.frontier-trails a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.2em; }
.frontier-trails p { margin: 0.2rem 0; color: var(--muted); }
.frontier-trails small { color: var(--muted); }
.frontier-edition {
  margin-left: 0.45rem; padding: 0.08rem 0.45rem;
  color: var(--frontier); border: 1px solid var(--frontier);
  border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.frontier-shelf { margin: 2rem 0; }
.frontier-shelf > summary {
  color: var(--frontier); cursor: pointer; font-size: 1.2rem; font-weight: 700;
}
.frontier-shelf[open] > summary { margin-bottom: 0.8rem; }
.frontier-card {
  scroll-margin-top: 1rem; padding: 0.9rem 1rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 0.8rem;
  box-shadow: var(--shadow);
}
.frontier-position {
  float: right; margin: 0 0 0.25rem 0.75rem; color: var(--frontier);
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.frontier-card:target { border-color: var(--frontier); }
.frontier-card h3 { margin: 0.1rem 0 0.15rem; font-size: 1.18rem; }
.frontier-title { margin: 0 0 0.65rem; color: var(--muted); font-style: italic; }
.frontier-kind {
  margin: 0; color: var(--frontier); font-size: 0.73rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.frontier-card details { border-top: 1px solid var(--line); padding-top: 0.6rem; }
.frontier-card summary { color: var(--frontier); cursor: pointer; font-weight: 650; }
.frontier-card summary:hover { text-decoration: underline; }
.frontier-card h4 { margin: 1rem 0 0.2rem; }
.frontier-card ul { margin-top: 0.2rem; }
.frontier-links { color: var(--muted); font-size: 0.88rem; }
.frontier-links ul { margin: 0.25rem 0; }
.frontier-links li span { display: block; font-size: 0.8rem; }
.frontier-carry {
  margin: 1.5rem 0; padding: 0.85rem 1rem; background: var(--panel);
  border: 1px solid var(--line); border-left: 3px solid var(--frontier);
  border-radius: 0.75rem;
}
.frontier-api {
  margin-top: 1.6rem; padding-top: 1rem; color: var(--muted);
  border-top: 1px solid var(--line);
}
.frontier-page a:focus-visible,
.frontier-page summary:focus-visible {
  outline: 3px solid var(--frontier); outline-offset: 3px; border-radius: 0.2rem;
}

/* Roots to remedies — warm botany, hard evidence, no false equivalence. */
.remedy-page, .remedy-detail { --remedy: var(--leaf); }
.remedy-kicker {
  display: block; margin: 1.1rem 0 0.25rem; color: var(--remedy);
  font-size: 0.75rem; font-weight: 750; letter-spacing: 0.11em;
  text-transform: uppercase;
}
.remedy-boundary {
  margin: 1.3rem 0; padding: 0.9rem 1rem; color: var(--muted);
  background: var(--panel); border: 1px dashed var(--ember);
  border-left: 4px solid var(--ember); border-radius: 0.75rem;
}
.remedy-principles > div {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.7rem;
}
.remedy-principles article {
  padding: 0.75rem 0.85rem; background: var(--panel);
  border: 1px solid var(--line); border-top: 3px solid var(--remedy);
  border-radius: 0.7rem;
}
.remedy-principles h3 { margin: 0; font-size: 1rem; }
.remedy-principles p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.88rem; }
.remedy-index {
  display: grid; gap: 0.75rem; margin: 0; padding: 0 !important; list-style: none;
}
.remedy-index-card {
  display: grid; gap: 0.25rem; padding: 0.85rem 1rem; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--remedy); border-radius: 0.75rem;
  box-shadow: var(--shadow);
}
.remedy-index-card:hover { border-color: var(--remedy); text-decoration: none; }
.remedy-index-card strong {
  font-family: "Iowan Old Style", Palatino, Georgia, serif; font-size: 1.15rem;
}
.remedy-index-card > span:not(.remedy-kicker) { color: var(--muted); font-size: 0.9rem; }
.remedy-index-card small { margin-top: 0.25rem; color: var(--remedy); line-height: 1.45; }
.remedy-method { margin: 2rem 0; }
.remedy-method > summary { color: var(--remedy); cursor: pointer; font-weight: 750; }
.remedy-method dl, .remedy-facts { margin: 0.5rem 0; }
.remedy-method dl > div, .remedy-facts > div {
  display: grid; grid-template-columns: minmax(9rem, 0.38fr) 1fr;
  gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line);
}
.remedy-method dt, .remedy-facts dt { font-weight: 700; }
.remedy-method dd, .remedy-facts dd { margin: 0; color: var(--muted); }
.remedy-medicine, .remedy-natural, .remedy-compare {
  margin: 1.5rem 0; padding: 0.95rem 1.05rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: 0.8rem; box-shadow: var(--shadow);
}
.remedy-medicine { border-top: 4px solid var(--ember); }
.remedy-natural { border-top: 4px solid var(--remedy); }
.remedy-compare { border-left: 4px solid var(--amber); }
.remedy-medicine h2, .remedy-natural h3 { margin: 0.15rem 0 0.25rem; }
.remedy-medicine h3, .remedy-natural h4 {
  margin: 1.15rem 0 0.2rem; color: var(--muted); font-family: inherit;
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.remedy-medicine h3 + p, .remedy-natural h4 + p { margin-top: 0.15rem; }
.remedy-latin, .remedy-aliases { margin: 0.1rem 0; color: var(--muted); }
.remedy-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.remedy-tags span, .remedy-evidence, .remedy-match {
  display: inline-block; padding: 0.08rem 0.48rem; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); font-size: 0.7rem;
  letter-spacing: 0.03em; text-transform: lowercase;
}
.remedy-evidence { color: var(--remedy); border-color: var(--remedy); font-weight: 750; }
.evidence-evidence-of-harm { color: var(--ember); border-color: var(--ember); }
.evidence-not-established-or-conflicting,
.evidence-preclinical-only,
.evidence-traditional-use-recorded { color: var(--amber); border-color: var(--amber); }
.remedy-refs { font-size: 0.68rem; vertical-align: super; }
.remedy-refs a {
  display: inline-block; white-space: nowrap; margin-left: 0.16rem;
  padding: 0.02rem 0.2rem; border: 1px solid var(--line);
  border-radius: 0.25rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.remedy-safety, .remedy-replacement, .remedy-bottom-line {
  padding: 0.65rem 0.75rem; border-radius: 0.55rem;
}
.remedy-safety { background: color-mix(in srgb, var(--ember) 7%, var(--panel)); }
.remedy-replacement {
  background: color-mix(in srgb, var(--amber) 8%, var(--panel));
  border-left: 3px solid var(--amber);
}
.remedy-bottom-line {
  background: color-mix(in srgb, var(--remedy) 8%, var(--panel));
  border-left: 3px solid var(--remedy); font-weight: 650;
}
.remedy-sources ol { padding-left: 1.4rem; }
.remedy-sources li { margin: 0.6rem 0; overflow-wrap: anywhere; }
.remedy-sources li span { display: block; color: var(--muted); font-size: 0.78rem; }
.remedy-api { margin-top: 1.5rem; color: var(--muted); font-size: 0.88rem; }
.healing-door {
  margin: 1.4rem 0; padding: 0.9rem 1rem; background: var(--panel);
  border: 1px solid var(--line); border-left: 4px solid var(--plum);
  border-radius: 0.75rem; box-shadow: var(--shadow);
}
.healing-door h2 { margin-top: 0.15rem; }
.healing-door p:last-child { margin-bottom: 0; font-weight: 700; }
.healing-page { --remedy: var(--plum); }
.healing-history-boundary { border-color: var(--plum); border-left-color: var(--plum); }
.healing-history-boundary p, .healing-history-boundary ul { margin: 0.55rem 0; }
.healing-jump ol {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.55rem; margin: 1.5rem 0 2rem; padding: 0; list-style: none;
}
.healing-jump li {
  margin: 0; padding: 0.65rem 0.75rem; background: var(--panel);
  border: 1px solid var(--line); border-radius: 0.65rem;
}
.healing-jump a { display: block; font-weight: 700; }
.healing-jump small { display: block; margin-top: 0.2rem; color: var(--muted); }
.healing-tradition {
  scroll-margin-top: 1rem; margin: 2rem 0; padding: 1rem 1.1rem;
  background: var(--panel); border: 1px solid var(--line);
  border-top: 4px solid var(--plum); border-radius: 0.8rem; box-shadow: var(--shadow);
}
.healing-tradition:target { border-color: var(--plum); }
.healing-tradition h2 { margin: 0.2rem 0 0.35rem; }
.healing-scope { color: var(--muted); font-style: italic; }
.healing-claims {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.7rem; margin-top: 1rem;
}
.healing-claims section { padding: 0.65rem 0.75rem; border: 1px solid var(--line); border-radius: 0.65rem; }
.healing-claims h3, .healing-boundary h3 { margin: 0; font-size: 0.95rem; }
.healing-claims ul { margin: 0.4rem 0 0; padding-left: 1.15rem; }
.healing-claims li { margin: 0.55rem 0; }
.healing-claims li small, .healing-boundary > small {
  display: block; margin-top: 0.2rem; color: var(--muted);
  font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase;
}
.healing-harms { background: color-mix(in srgb, var(--ember) 6%, var(--panel)); }
.healing-boundary {
  margin-top: 0.8rem; padding: 0.7rem 0.8rem;
  background: color-mix(in srgb, var(--plum) 6%, var(--panel));
  border-left: 3px solid var(--plum); border-radius: 0.55rem;
}
.healing-boundary p { margin: 0.35rem 0; }
.healing-sources { margin-top: 2.5rem; }
.remedy-page a:focus-visible, .remedy-detail a:focus-visible,
.remedy-page summary:focus-visible, .healing-page a:focus-visible {
  outline: 3px solid var(--remedy); outline-offset: 3px; border-radius: 0.2rem;
}
@media (max-width: 540px) {
  .remedy-method dl > div, .remedy-facts > div { grid-template-columns: 1fr; gap: 0.1rem; }
  .remedy-medicine, .remedy-natural, .remedy-compare { padding: 0.8rem; }
  .healing-tradition { padding: 0.8rem; }
}

/* Wildfire help — calm emergency information, outside the learning System. */
.wildfire-page {
  --wildfire-urgent: #9d3f29;
  --wildfire-urgent-soft: color-mix(in srgb, var(--wildfire-urgent) 8%, var(--panel));
  --wildfire-calm: #2d6f68;
  --wildfire-calm-soft: color-mix(in srgb, var(--wildfire-calm) 8%, var(--panel));
  --wildfire-gold: #9a681c;
  padding-bottom: 1rem;
}
@media (prefers-color-scheme: dark) {
  .wildfire-page {
    --wildfire-urgent: #ff9b7d;
    --wildfire-calm: #81c7bd;
    --wildfire-gold: #e1b968;
  }
}
.wildfire-hero { padding: 1.8rem 0 0.8rem; }
.wildfire-kicker {
  margin: 0 0 0.3rem; color: var(--wildfire-calm); font-size: 0.77rem;
  font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase;
}
.wildfire-hero h2 {
  max-width: 42rem; margin: 0; font-size: clamp(2rem, 7vw, 3.35rem);
  line-height: 1.08;
}
.wildfire-care { max-width: 40rem; margin: 1.15rem 0 0.55rem; font-size: 1.08rem; }
.wildfire-care strong { color: var(--wildfire-calm); }
.wildfire-hero > p:last-child { color: var(--muted); }
.wildfire-now {
  margin: 1rem 0 1.2rem; padding: 1.05rem 1.1rem 1.15rem;
  border: 2px solid var(--wildfire-urgent); border-radius: 0.85rem;
  background: var(--wildfire-urgent-soft); box-shadow: var(--shadow);
}
.wildfire-now > p:first-child {
  margin: 0; color: var(--wildfire-urgent); font-size: 0.75rem;
  font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase;
}
.wildfire-now h1 { margin: 0.15rem 0 0.35rem; font-size: 1.55rem; }
.wildfire-now > p { margin: 0.35rem 0; }
.wildfire-now-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.9rem; }
.wildfire-now-actions a {
  min-height: 2.8rem; display: inline-flex; align-items: center;
  padding: 0.55rem 0.8rem; border: 1px solid var(--line);
  border-radius: 0.55rem; background: var(--panel); color: var(--ink); font-weight: 750;
}
.wildfire-now-actions a:hover { border-color: var(--wildfire-urgent); text-decoration: none; }
.wildfire-now-actions .wildfire-primary-action {
  border-color: var(--wildfire-urgent); background: var(--wildfire-urgent); color: #fff;
}
@media (prefers-color-scheme: dark) {
  .wildfire-now-actions .wildfire-primary-action { color: #1b100c; }
}
.wildfire-boundary {
  margin: 1.2rem 0 1.6rem; padding: 0.9rem 1rem;
  border: 1px solid var(--line); border-left: 4px solid var(--wildfire-gold);
  border-radius: 0.75rem; background: var(--panel);
}
.wildfire-boundary h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.wildfire-boundary p { margin: 0.45rem 0; }
.wildfire-choices { margin: 2rem 0; }
.wildfire-choices h2 { margin-bottom: 0.65rem; }
.wildfire-choices > div {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.65rem;
}
.wildfire-choices a {
  min-height: 5rem; display: flex; flex-direction: column; justify-content: center; gap: 0.18rem;
  padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: 0.7rem;
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow);
}
.wildfire-choices a:hover { border-color: var(--wildfire-calm); text-decoration: none; }
.wildfire-choices a.urgent { border: 2px solid var(--wildfire-urgent); }
.wildfire-choices a strong { font-family: "Iowan Old Style", Palatino, Georgia, serif; }
.wildfire-choices a span { color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
.wildfire-path {
  scroll-margin-top: 1rem; margin: 2.2rem 0; overflow: hidden;
  border: 1px solid var(--line); border-top: 4px solid var(--wildfire-calm);
  border-radius: 0.85rem; background: var(--panel); box-shadow: var(--shadow);
}
.wildfire-path:target { border-color: var(--wildfire-calm); }
.wildfire-path-urgent { border-top-color: var(--wildfire-urgent); }
.wildfire-path-urgent:target { border-color: var(--wildfire-urgent); }
.wildfire-path-heading { padding: 0.9rem 1rem 0.75rem; background: var(--wildfire-calm-soft); }
.wildfire-path-urgent .wildfire-path-heading { background: var(--wildfire-urgent-soft); }
.wildfire-path-heading p {
  margin: 0; color: var(--wildfire-calm); font-size: 0.72rem;
  font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase;
}
.wildfire-path-urgent .wildfire-path-heading p { color: var(--wildfire-urgent); }
.wildfire-path-heading h2 { margin: 0.12rem 0 0.2rem; }
.wildfire-path-heading > span { display: block; color: var(--muted); }
.wildfire-path > ol {
  margin: 0; padding: 0; list-style: none; counter-reset: wildfire-step;
}
.wildfire-path > ol > li {
  counter-increment: wildfire-step; display: grid;
  grid-template-columns: 2.15rem 1fr; gap: 0.15rem 0.7rem;
  margin: 0; padding: 0.85rem 1rem; border-top: 1px solid var(--line);
}
.wildfire-path > ol > li::before {
  content: counter(wildfire-step); grid-row: 1 / span 2;
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border: 1px solid var(--wildfire-calm); border-radius: 999px;
  color: var(--wildfire-calm); font-weight: 800;
}
.wildfire-path-urgent > ol > li::before {
  border-color: var(--wildfire-urgent); color: var(--wildfire-urgent);
}
.wildfire-citations {
  display: block; color: var(--muted); font-size: 0.72rem; line-height: 1.5;
}
.wildfire-citations a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; min-height: 2rem; margin: 0.05rem;
  border: 1px solid var(--line); border-radius: 0.35rem; text-align: center;
}
.wildfire-say {
  margin: 0.35rem 1rem 1rem; padding: 0.7rem 0.8rem;
  border-left: 3px solid var(--wildfire-gold); border-radius: 0.45rem;
  background: color-mix(in srgb, var(--wildfire-gold) 7%, var(--panel));
}
.wildfire-say strong { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.wildfire-say p { margin: 0.25rem 0 0; }
.wildfire-needs { margin: 2.5rem 0; }
.wildfire-needs > p, .wildfire-official > p { color: var(--muted); }
.wildfire-needs > div {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0.65rem;
}
.wildfire-needs section {
  padding: 0.75rem 0.85rem; border: 1px solid var(--line);
  border-radius: 0.7rem; background: var(--panel);
}
.wildfire-needs h3 { margin: 0; font-size: 1rem; }
.wildfire-needs section p { margin: 0.35rem 0; font-size: 0.9rem; }
.wildfire-official { scroll-margin-top: 1rem; margin: 2.5rem 0; }
.wildfire-region {
  margin: 0.6rem 0; border: 1px solid var(--line);
  border-radius: 0.7rem; background: var(--panel); box-shadow: var(--shadow);
}
.wildfire-region > summary {
  min-height: 3.1rem; display: flex; align-items: center;
  padding: 0.7rem 0.85rem; cursor: pointer; font-weight: 800;
}
.wildfire-region[open] > summary { color: var(--wildfire-calm); border-bottom: 1px solid var(--line); }
.wildfire-region > div { padding: 0.25rem 0.85rem 0.8rem; }
.wildfire-region ul { margin: 0.5rem 0 0; padding: 0; list-style: none; }
.wildfire-region li { padding: 0.65rem 0; border-top: 1px solid var(--line); }
.wildfire-region li:first-child { border-top: 0; }
.wildfire-region li a, .wildfire-region li span, .wildfire-region li small { display: block; }
.wildfire-region li span { color: var(--muted); font-size: 0.88rem; }
.wildfire-region li small { margin-top: 0.12rem; color: var(--muted); font-size: 0.72rem; }
.wildfire-call {
  padding: 0.65rem 0.75rem; border-left: 3px solid var(--wildfire-urgent);
  border-radius: 0.45rem; background: var(--wildfire-urgent-soft);
}
.wildfire-call > a { font-weight: 850; }
.wildfire-sources { margin: 2.5rem 0; }
.wildfire-sources > p { color: var(--muted); }
.wildfire-sources ol { padding-left: 1.8rem; }
.wildfire-sources li { margin: 0.7rem 0; padding-left: 0.2rem; overflow-wrap: anywhere; }
.wildfire-sources li span { display: block; color: var(--muted); font-size: 0.75rem; }
.wildfire-carry {
  margin: 2rem 0; padding: 0.85rem 1rem; border: 1px solid var(--line);
  border-left: 4px solid var(--wildfire-calm); border-radius: 0.75rem; background: var(--panel);
}
.wildfire-carry h2 { margin: 0; font-size: 1.15rem; }
.wildfire-carry p { margin: 0.45rem 0; }
.wildfire-carry code { overflow-wrap: anywhere; color: var(--muted); font-size: 0.7rem; }
.wildfire-page a:focus-visible, .wildfire-page summary:focus-visible {
  outline-color: var(--wildfire-calm);
}
@media (max-width: 520px) {
  .wildfire-now-actions { display: grid; }
  .wildfire-now-actions a { justify-content: center; text-align: center; }
  .wildfire-path > ol > li { padding: 0.8rem; }
}
@media print {
  .top, .foot, .wildfire-choices, .wildfire-now-actions { display: none !important; }
  body { background: #fff; color: #111; font-size: 11pt; }
  main { max-width: none; padding: 0; }
  .wildfire-page { --panel: #fff; --line: #bbb; }
  .wildfire-hero, .wildfire-now, .wildfire-boundary, .wildfire-path,
  .wildfire-needs section, .wildfire-region, .wildfire-carry {
    box-shadow: none; break-inside: avoid;
  }
  .wildfire-region:not([open]) > :not(summary) { display: block !important; }
  .wildfire-page a[href^="http"]::after {
    content: " (" attr(href) ")"; color: #333; font-size: 8pt; overflow-wrap: anywhere;
  }
}
