/* Warden's Eye Academy
   Palette shared with Warden's Eye: asphalt, concrete, amber. The Academy reads like a reference
   book: cool paper, dark masthead, blue links, and one signature element, the section rail on
   guide pages, drawn as a route line with a stop for each section. */

@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/public-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/public-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --ink: #1f242b;
  --ink-soft: #4a525c;
  --paper: #f4f5f3;
  --sheet: #ffffff;
  --asphalt: #23272e;
  --asphalt-2: #2e333b;
  --kerb: #d3d7da;
  --kerb-soft: #e6e8ea;
  --amber: #e8a317;
  --amber-pale: #fbf1d9;
  --blue: #2f5d8a;
  --blue-pale: #e4ecf4;
  --red: #c8372d;
  --red-pale: #f8e3e1;
  --green: #3d8b4f;
  --energy: #5aa83c;
  --nerve: #c8372d;
  --happy: #e8a317;
  --life: #2f6fb0;

  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;

  /* major third scale on a 17px base */
  --s-1: 0.8125rem; --s0: 1.0625rem; --s1: 1.3125rem; --s2: 1.625rem; --s3: 2.0625rem; --s4: 2.5625rem; --s5: 3.1875rem;
  --gap: 1.5rem;
  --measure: 68ch;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--s0)/1.6 var(--body); }
img, svg { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a.external::after { content: ""; display: inline-block; width: 0.55em; height: 0.55em; margin-left: 0.2em; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; vertical-align: 0.35em; opacity: 0.6; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; letter-spacing: 0.005em; margin: 0 0 0.5rem; }
h1 { font-size: var(--s5); font-weight: 700; }
h2 { font-size: var(--s3); }
h3 { font-size: var(--s1); font-family: var(--body); font-weight: 700; line-height: 1.3; }
p { margin: 0 0 1rem; }
.muted { color: var(--ink-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--amber); color: var(--ink); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
main:focus { outline: none; }
.plain-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.plain-list li { padding: 0.2rem 0; }
.columns { columns: 3 16rem; }
.count { font-family: var(--body); font-size: var(--s-1); font-weight: 600; color: var(--ink-soft); background: var(--kerb-soft); border-radius: 999px; padding: 0.05rem 0.5rem; vertical-align: middle; }
.tag { font-size: var(--s-1); background: var(--red-pale); color: var(--red); padding: 0.05rem 0.4rem; border-radius: var(--radius); }

/* ------------------------------------------------------------------ masthead */
.masthead { background: var(--asphalt); color: #eef0f2; border-bottom: 3px solid var(--amber); }
.masthead-inner { max-width: 76rem; margin: 0 auto; padding: 0.75rem 1.25rem; display: grid; grid-template-columns: auto minmax(11rem, 17rem) 1fr auto; gap: 0.75rem 1.1rem; align-items: center; }
.wordmark { color: #fff; text-decoration: none; font-family: var(--display); font-size: var(--s2); font-weight: 700; line-height: 1; white-space: nowrap; }
.wordmark-torn { color: #c9ced4; font-weight: 600; }
.wordmark-academy { color: #fff; }
.masthead-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 0.85rem; justify-content: flex-end; }
.masthead-nav a { color: #dfe3e7; text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.masthead-nav a:hover, .masthead-nav a[aria-current] { color: #fff; border-bottom-color: var(--amber); }
.masthead-search { position: relative; display: flex; }
.masthead-search input { flex: 1; min-width: 0; border: 1px solid #4a515b; background: var(--asphalt-2); color: #fff; padding: 0.45rem 0.7rem; border-radius: var(--radius) 0 0 var(--radius); font: inherit; font-size: 0.95rem; }
.masthead-search input::placeholder { color: #9aa2ab; }
.masthead-search button { border: 0; background: var(--amber); color: #1f242b; font: 600 0.95rem var(--body); padding: 0 0.9rem; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; list-style: none; margin: 0.25rem 0 0; padding: 0.25rem 0; background: var(--sheet); border: 1px solid var(--kerb); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(20 24 30 / 18%); }
.suggestions a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0.75rem; color: var(--ink); text-decoration: none; }
.suggestions li[aria-selected="true"] a, .suggestions a:hover { background: var(--amber-pale); }
.suggestion-kind { color: var(--ink-soft); font-size: var(--s-1); white-space: nowrap; }

/* ------------------------------------------------------------------ layout */
.page { max-width: 64rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.page-wide { max-width: 76rem; }
.page-head { margin-bottom: 1.75rem; max-width: var(--measure); }
.lede { font-size: var(--s1); line-height: 1.5; color: var(--ink-soft); }
.crumbs { font-size: var(--s-1); margin-bottom: 0.75rem; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.jump { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; padding: 0.75rem 0; margin-bottom: 1.5rem; border-top: 1px solid var(--kerb); border-bottom: 1px solid var(--kerb); }
.jump-letters a { font-family: var(--display); font-weight: 600; font-size: var(--s1); text-decoration: none; min-width: 1.5rem; text-align: center; }

/* ------------------------------------------------------------------ home */
.hero { background: var(--asphalt); color: #eef0f2; }
.hero-inner { max-width: 76rem; margin: 0 auto; padding: 3rem 1.25rem 2rem; }
.hero-title { font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 0.98; max-width: 16ch; color: #fff; margin-bottom: 1rem; }
.hero-lede { font-size: var(--s1); max-width: 46ch; color: #c9ced4; }
.hero-search { max-width: 40rem; margin-top: 1.5rem; }
.hero-search label { display: block; font-weight: 600; margin-bottom: 0.4rem; color: #fff; }
.hero-search-row { position: relative; display: flex; }
.hero-search input { flex: 1; min-width: 0; font: inherit; font-size: var(--s1); padding: 0.7rem 0.9rem; border: 2px solid var(--amber); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: #fff; color: var(--ink); }
.hero-search button { font: 600 var(--s0) var(--body); border: 0; background: var(--amber); color: #1f242b; padding: 0 1.4rem; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.bars { max-width: 76rem; margin: 0 auto; padding: 0 1.25rem 2.5rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.bar { display: grid; gap: 0.35rem; text-decoration: none; color: #dfe3e7; padding: 0.9rem 0 0.25rem; }
.bar-fill { display: block; height: 0.65rem; border-radius: 2px; background: var(--bar); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%); position: relative; overflow: hidden; }
.bar-fill::after { content: ""; position: absolute; inset: 0 0 0 auto; width: var(--empty, 22%); background: rgb(0 0 0 / 45%); }
.bar-name { font-family: var(--display); font-size: var(--s2); font-weight: 600; color: #fff; line-height: 1; }
.bar-fact { font-size: 0.95rem; line-height: 1.45; color: #c2c8ce; }
.bar:hover .bar-name { text-decoration: underline; text-decoration-color: var(--bar); text-decoration-thickness: 3px; text-underline-offset: 0.2em; }
.bar-energy { --bar: var(--energy); --empty: 10%; }
.bar-nerve { --bar: var(--nerve); --empty: 45%; }
.bar-happy { --bar: var(--happy); --empty: 0%; }
.bar-life { --bar: var(--life); --empty: 30%; }
.band { padding: 2.5rem 0; border-bottom: 1px solid var(--kerb); }
.band-inner { max-width: 76rem; margin: 0 auto; padding: 0 1.25rem; }
.band-title { font-size: var(--s3); margin-bottom: 1.25rem; }
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.route::before { content: ""; position: absolute; left: 0.55rem; right: 0.55rem; top: 0.55rem; height: 4px; background: var(--asphalt); border-radius: 2px; }
.route-stop { position: relative; padding-top: 2rem; padding-right: 1rem; }
.route-stop::before { content: ""; position: absolute; top: 0; left: 0; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--sheet); border: 4px solid var(--asphalt); }
.route-stop a { text-decoration: none; display: grid; gap: 0.2rem; }
.route-name { font-family: var(--display); font-size: var(--s2); font-weight: 600; color: var(--ink); line-height: 1.05; }
.route-stop a:hover .route-name { color: var(--blue); text-decoration: underline; }
.route-meta { color: var(--ink-soft); font-size: 0.95rem; }
.contents { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.75rem 2rem; }
.contents-entry h3 { font-family: var(--display); font-size: var(--s2); font-weight: 600; margin-bottom: 0.25rem; }
.contents-entry h3 a { color: var(--ink); text-decoration: none; }
.contents-entry h3 a:hover { color: var(--blue); text-decoration: underline; }
.contents-entry p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0.4rem; }
.contents-entry ul { list-style: none; padding: 0; margin: 0; font-size: 0.95rem; }
.contents-entry li { padding: 0.1rem 0; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.tools .band-title { font-size: var(--s2); margin-bottom: 0.5rem; }
.updates-mini { list-style: none; padding: 0; margin: 0 0 1rem; }
.updates-mini li { display: grid; padding: 0.35rem 0; border-bottom: 1px solid var(--kerb-soft); }
.updates-mini .muted { font-size: var(--s-1); }

/* ------------------------------------------------------------------ guide lists */
.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-row { padding: 0.9rem 0; border-bottom: 1px solid var(--kerb); }
.guide-row-title { font-family: var(--display); font-size: var(--s2); font-weight: 600; line-height: 1.1; text-decoration: none; }
.guide-row-title:hover { text-decoration: underline; }
.guide-row-summary { margin: 0.2rem 0 0.3rem; max-width: var(--measure); }
.guide-row-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: var(--s-1); color: var(--ink-soft); margin: 0; }
.directory-section { margin-bottom: 2.5rem; }
.directory-section h2 a { color: var(--ink); text-decoration: none; }
.category-layout { display: grid; grid-template-columns: 1fr 17rem; gap: 2.5rem; align-items: start; }
.category-aside { background: var(--sheet); border: 1px solid var(--kerb); border-radius: var(--radius); padding: 1rem 1.1rem; font-size: 0.95rem; }
.category-aside h2 { font-size: var(--s1); }
.difficulty { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; }
.difficulty-mark { width: 0.65rem; height: 0.65rem; border-radius: 1px; background: var(--d); }
.difficulty-beginner { --d: var(--blue); }
.difficulty-intermediate { --d: var(--amber); }
.difficulty-advanced { --d: var(--red); }
.flag-uncertain { color: #7a5300; background: var(--amber-pale); padding: 0 0.4rem; border-radius: var(--radius); font-weight: 600; }

/* ------------------------------------------------------------------ guide page */
.guide { max-width: 76rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.guide-head { max-width: 52rem; margin-left: 15.5rem; margin-bottom: 2rem; }
.guide-head h1 { font-size: clamp(2.4rem, 5vw, var(--s5)); }
.guide-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1.25rem; font-size: 0.9rem; color: var(--ink-soft); }
.guide-layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.rail { position: sticky; top: 1rem; font-size: 0.9rem; }
.rail-details > summary { font-weight: 700; cursor: pointer; list-style: none; margin-bottom: 0.5rem; color: var(--ink-soft); }
.rail-details > summary::-webkit-details-marker { display: none; }
.rail-line { list-style: none; margin: 0; padding: 0; position: relative; }
.rail-line::before { content: ""; position: absolute; left: 0.4rem; top: 0.6rem; bottom: 0.6rem; width: 3px; background: var(--kerb); border-radius: 2px; }
.rail-stop { position: relative; padding: 0.3rem 0 0.3rem 1.6rem; }
.rail-stop::before { content: ""; position: absolute; left: 0.1rem; top: 0.62rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--paper); border: 3px solid var(--kerb); }
.rail-stop a { color: var(--ink-soft); text-decoration: none; display: block; line-height: 1.3; }
.rail-stop a:hover { color: var(--ink); text-decoration: underline; }
.rail-stop:has(a[aria-current])::before { border-color: var(--amber); background: var(--amber); }
.rail-stop a[aria-current] { color: var(--ink); font-weight: 700; }
.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--s3); margin-top: 2.25rem; padding-top: 0.25rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.prose li { margin: 0.25rem 0; }
.prose code { font-size: 0.9em; background: var(--kerb-soft); padding: 0.05rem 0.3rem; border-radius: 3px; }
.prose a.term { color: inherit; text-decoration-style: dotted; text-decoration-color: var(--blue); }
.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; }
.prose table, table.data, table.facts { border-collapse: collapse; width: 100%; font-size: 0.92rem; background: var(--sheet); }
.prose th, .prose td, table.data th, table.data td, table.facts th, table.facts td { text-align: left; vertical-align: top; padding: 0.45rem 0.65rem; border-bottom: 1px solid var(--kerb); }
.prose thead th, table.data thead th { background: var(--kerb-soft); font-weight: 700; border-bottom: 2px solid var(--kerb); }
table.data tbody th { font-weight: 600; }
table.facts { max-width: 44rem; }
table.facts th { width: 14rem; color: var(--ink-soft); font-weight: 600; }
.callout { margin: 1.25rem 0; padding: 0.75rem 1rem; border-left: 4px solid var(--c); background: var(--cbg); border-radius: 0 var(--radius) var(--radius) 0; }
.callout p:last-child { margin-bottom: 0; }
.callout-label { font-weight: 700; margin-bottom: 0.2rem; color: var(--clabel, var(--ink)); }
.callout-note { --c: #8a9098; --cbg: var(--kerb-soft); }
.callout-uncertain { --c: var(--amber); --cbg: var(--amber-pale); --clabel: #7a5300; }
.callout-estimate { --c: var(--blue); --cbg: var(--blue-pale); --clabel: var(--blue); }
.callout-warning { --c: var(--red); --cbg: var(--red-pale); --clabel: var(--red); }
.record { margin: 3rem 0 0 15.5rem; padding-top: 1.5rem; border-top: 3px solid var(--asphalt); }
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem 2.5rem; }
.record h2 { font-size: var(--s1); margin-top: 0; }
.record section > h2 ~ h2 { margin-top: 1.25rem; }
.sources { padding-left: 1.1rem; font-size: 0.92rem; }
.history { padding-left: 1.1rem; font-size: 0.92rem; }
.history-version { font-weight: 700; }
.record-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.term-list { columns: 2; }

/* ------------------------------------------------------------------ buttons and forms */
.button { display: inline-block; font: 600 var(--s0) var(--body); background: var(--asphalt); color: #fff; border: 0; border-radius: var(--radius); padding: 0.55rem 1.1rem; text-decoration: none; cursor: pointer; }
.button:hover { background: #000; text-decoration: none; }
.button-quiet { background: var(--sheet); color: var(--ink); border: 1px solid var(--kerb); }
.button-quiet:hover { background: var(--kerb-soft); }
.button-danger { background: var(--red); }
.button[disabled] { opacity: 0.6; cursor: progress; }
.link-button { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; font: inherit; cursor: pointer; }
.stack { display: grid; gap: 1rem; max-width: 36rem; }
.narrow { max-width: 22rem; }
.field { display: grid; gap: 0.3rem; }
.field label, .field legend, .filter-label { font-weight: 600; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field label { font-weight: 400; display: flex; gap: 0.5rem; align-items: center; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid #aab1b8; border-radius: var(--radius); padding: 0.5rem 0.65rem; }
textarea { resize: vertical; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--asphalt); }
input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.hint { font-size: var(--s-1); color: var(--ink-soft); margin: 0; }
.honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2.5rem; align-items: start; }
.form-aside { background: var(--sheet); border: 1px solid var(--kerb); border-radius: var(--radius); padding: 1rem 1.2rem; font-size: 0.95rem; }
.form-aside h2 { font-size: var(--s1); margin-top: 0.5rem; }
.form-status { min-height: 1.5rem; font-weight: 600; }
.form-status.is-error, .error { color: var(--red); }
.filter-input { width: 100%; max-width: 24rem; display: block; margin-top: 0.3rem; }

/* ------------------------------------------------------------------ calculators */
.calc-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 1rem 2rem; }
.calc-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--kerb); }
.calc-list a { font-family: var(--display); font-size: var(--s2); font-weight: 600; text-decoration: none; margin-right: 0.5rem; }
.calc-list p { margin: 0.3rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }
.calc-layout { display: grid; grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.calc { display: grid; gap: 0.9rem; background: var(--sheet); border: 1px solid var(--kerb); border-radius: var(--radius); padding: 1.25rem; }
.field-checkbox label { font-weight: 400; display: flex; gap: 0.5rem; align-items: flex-start; }
.calc-results { position: sticky; top: 1rem; }
.calc-results h2 { font-size: var(--s2); }
.outputs { margin: 0 0 1rem; display: grid; gap: 0; }
.output { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--kerb); align-items: baseline; }
.output dt { color: var(--ink-soft); }
.output dd { margin: 0; text-align: right; display: grid; justify-items: end; }
.output-value { font-family: var(--display); font-size: var(--s2); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kind { font-size: 0.75rem; font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 999px; white-space: nowrap; }
.kind-exact { background: #e3f1e6; color: #24602f; }
.kind-calculated { background: var(--blue-pale); color: var(--blue); }
.kind-estimate { background: var(--amber-pale); color: #7a5300; }
.calc-warnings { padding-left: 1.1rem; color: #6b4a00; font-size: 0.92rem; }
.calc-warnings:empty { display: none; }
.legend { font-size: var(--s-1); color: var(--ink-soft); line-height: 1.9; }
.calc-explain { margin-top: 2.5rem; }
.calc-explain h2 { font-size: var(--s2); }

/* ------------------------------------------------------------------ glossary, paths, items, search, updates */
.glossary { margin: 0; }
.glossary-letter { font-family: var(--display); font-size: var(--s4); font-weight: 700; color: var(--kerb); margin: 1.5rem 0 0; line-height: 1; }
.term-entry { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 0.25rem 1.5rem; padding: 0.75rem 0; border-bottom: 1px solid var(--kerb); scroll-margin-top: 1rem; }
.term-entry:target { background: var(--amber-pale); }
.term-entry dt { font-weight: 700; }
.term-entry dd { margin: 0; max-width: var(--measure); }
.term-entry dd p { margin-bottom: 0.3rem; }
.term-links { font-size: 0.92rem; }
.path-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 1.5rem; }
.path-card { background: var(--sheet); border: 1px solid var(--kerb); border-top: 4px solid var(--asphalt); border-radius: var(--radius); padding: 1rem 1.2rem; }
.path-card h2 { font-size: var(--s2); }
.path-progress { font-weight: 600; }
.route-vertical { display: block; padding-left: 0.2rem; }
.route-vertical::before { left: 0.55rem; right: auto; top: 0.6rem; bottom: 0.6rem; width: 4px; height: auto; }
.route-vertical .route-stop { padding: 0 0 1.75rem 2.25rem; }
.route-vertical .route-stop::before { top: 0.4rem; }
.route-vertical .route-stop.is-done::before { background: var(--green); border-color: var(--green); }
.route-body h2 { font-size: var(--s2); margin-bottom: 0.2rem; }
.route-body p { margin-bottom: 0.3rem; max-width: var(--measure); }
.done { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.92rem; margin-top: 0.3rem; cursor: pointer; }
.item-groups { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.5rem 2rem; }
.item-groups h2 { font-size: var(--s2); margin-bottom: 0.2rem; }
.item-groups li { padding: 0.75rem 0; border-bottom: 1px solid var(--kerb); }
.sort-button { all: unset; cursor: pointer; font-weight: 700; }
.sort-button:focus-visible { outline: 3px solid var(--amber); }
th[aria-sort="ascending"] .sort-button::after { content: " ▲"; font-size: 0.7em; }
th[aria-sort="descending"] .sort-button::after { content: " ▼"; font-size: 0.7em; }
.price-time { display: block; font-size: 0.75rem; }
.compare-pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
table.compare th[scope="row"] { width: 12rem; color: var(--ink-soft); }
.search-form { max-width: 44rem; display: grid; gap: 0.5rem; }
.search-form > label { font-weight: 600; }
.search-row { display: flex; }
.search-row input { flex: 1; min-width: 0; font-size: var(--s1); border-radius: var(--radius) 0 0 var(--radius); }
.search-row button { font: 600 var(--s0) var(--body); border: 0; background: var(--asphalt); color: #fff; padding: 0 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.search-filters { border: 0; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; }
.search-filters legend { font-weight: 600; float: left; margin-right: 0.5rem; }
.search-filters label { font-size: var(--s-1); color: var(--ink-soft); }
.search-status { margin-top: 1.25rem; font-weight: 600; }
.results { list-style: none; padding: 0; max-width: var(--measure); }
.result { padding: 0.9rem 0; border-bottom: 1px solid var(--kerb); display: grid; gap: 0.15rem; }
.result-kind { font-size: var(--s-1); color: var(--ink-soft); font-weight: 600; }
.result-title { font-family: var(--display); font-size: var(--s2); font-weight: 600; line-height: 1.1; text-decoration: none; }
.result-title:hover { text-decoration: underline; }
.result p { margin: 0; color: var(--ink-soft); }
.updates { list-style: none; padding: 0; max-width: 52rem; }
.update { display: grid; grid-template-columns: 7rem 8rem minmax(0, 1fr); gap: 0 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--kerb); align-items: baseline; }
.update p { grid-column: 3; margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.update-date { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 0.92rem; }
.update-kind { font-weight: 700; font-size: 0.92rem; }
.update-mechanics .update-kind { color: var(--red); }
.downloads h2 { font-size: var(--s2); margin-top: 1.75rem; }

/* ------------------------------------------------------------------ moderation */
.queue-bar { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.queue-layout { display: grid; grid-template-columns: 22rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.queue-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--kerb); }
.queue-item { all: unset; display: grid; gap: 0.1rem; width: 100%; padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--kerb); cursor: pointer; box-sizing: border-box; }
.queue-item:hover, .queue-item:focus-visible { background: var(--amber-pale); }
.queue-kind { font-size: var(--s-1); font-weight: 700; color: var(--ink-soft); }
.queue-title { font-weight: 600; }
.queue-detail { background: var(--sheet); border: 1px solid var(--kerb); border-radius: var(--radius); padding: 1rem 1.25rem; display: grid; gap: 0.5rem; }
.submission-body { white-space: pre-wrap; font: inherit; background: var(--paper); padding: 0.75rem; border-radius: var(--radius); margin: 0; }
.decision-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------ footer */
.footer { background: var(--asphalt); color: #c9ced4; margin-top: 3rem; }
.footer-inner { max-width: 76rem; margin: 0 auto; padding: 2rem 1.25rem; display: grid; gap: 0.75rem; font-size: 0.92rem; }
.footer-independence { max-width: 70ch; margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.footer-nav a { color: #fff; }
.footer-edition { margin: 0; color: #9aa2ab; }
body.home .footer { margin-top: 0; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .masthead-inner { grid-template-columns: 1fr; }
  .masthead-nav { justify-content: flex-start; }
  .theme-toggle { justify-self: start; }
  .bars { grid-template-columns: repeat(2, 1fr); }
  .route { grid-template-columns: 1fr; padding-left: 0.2rem; }
  .route::before { left: 0.55rem; right: auto; top: 0.6rem; bottom: 0.6rem; width: 4px; height: auto; }
  .route-stop { padding: 0 0 1.25rem 2.25rem; }
  .route-stop::before { top: 0.35rem; }
  .tools, .category-layout, .form-layout, .calc-layout, .queue-layout { grid-template-columns: 1fr; }
  .guide-head, .record { margin-left: 0; }
  .guide-layout { grid-template-columns: 1fr; gap: 1rem; }
  .rail { position: static; background: var(--sheet); border: 1px solid var(--kerb); border-radius: var(--radius); padding: 0.75rem 1rem; }
  .rail-details > summary { margin-bottom: 0; }
  .rail-details[open] > summary { margin-bottom: 0.5rem; }
  .calc-results { position: static; }
  .term-entry { grid-template-columns: 1fr; }
  .update { grid-template-columns: 6.5rem 1fr; }
  .update p, .update a { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  :root { --s5: 2.5rem; --s3: 1.75rem; }
  .bars { grid-template-columns: 1fr; }
  .page, .guide { padding-top: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  .masthead, .footer, .rail, .record-actions, .skip { display: none; }
  .guide-head, .record { margin-left: 0; }
  .guide-layout { display: block; }
  body { background: #fff; }
  a { color: inherit; }
}

/* ---------------------------------------------------------------- events */
.small { font-size: var(--s-1); }
.next-up { background: var(--sheet); border-left: 4px solid var(--amber); padding: 1rem 1.25rem; margin: 0 0 var(--gap); }
.next-up h2 { margin-top: 0; }
.event-next { list-style: none; padding: 0; margin: 0 0 0.5rem; display: grid; gap: 0.4rem; }
.event-next a { font-weight: 600; }
.event-when { display: inline-block; font-size: var(--s-1); font-weight: 600; color: var(--ink-soft); background: var(--kerb-soft); border-radius: var(--radius); padding: 0.05rem 0.45rem; margin: 0 0.35rem; vertical-align: 0.1em; }
.event-when.on-now { background: var(--green); color: #fff; }
.event-list { list-style: none; padding: 0; margin: 0; }
.event { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--kerb); scroll-margin-top: 5rem; }
.event:target { background: var(--amber-pale); }
.event-date { font: 600 var(--s1)/1.2 var(--display); }
.event-date .muted { display: block; font: 400 var(--s-1) var(--body); }
.event-body h3 { margin: 0 0 0.25rem; }
.event-body p { margin: 0 0 0.35rem; max-width: var(--measure); }
@media (max-width: 40rem) { .event { grid-template-columns: 1fr; gap: 0.25rem; } }

/* ---------------------------------------------------------------- every item */
.catalogue-filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: end; margin: 0 0 0.5rem; }
.catalogue-filters div { display: grid; gap: 0.2rem; }
.catalogue-filters label { font-weight: 600; font-size: var(--s-1); }
.catalogue-filters input, .catalogue-filters select { font: inherit; padding: 0.4rem 0.5rem; border: 1px solid var(--kerb); border-radius: var(--radius); background: var(--sheet); min-width: 12rem; }
.catalogue td:nth-child(3) { max-width: 26rem; }
.obtain { margin: var(--gap) 0; }
.obtain h3 { margin-top: 1rem; }
.feature-link { margin: 0 0 var(--gap); }

/* ---------------------------------------------------------------- reference */
.ref-index { list-style: none; padding: 0; display: grid; gap: 0 2rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.ref-index li { border-top: 1px solid var(--kerb); padding: 0.75rem 0; }
.ref-index h2 { font-size: var(--s1); margin: 0 0 0.25rem; }
.ref-index p { margin: 0 0 0.25rem; }
.ref-card { margin: var(--gap) 0; padding-top: 0.5rem; border-top: 1px solid var(--kerb); scroll-margin-top: 5rem; }
.ref-jump ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.ref-dl div { border-top: 1px solid var(--kerb); padding: 0.6rem 0; }
.ref-dl dt { font-weight: 700; }
.ref-dl dd { margin: 0.15rem 0 0; max-width: var(--measure); }
.catalogue-filters .check { align-self: center; }
.catalogue-filters .check label { font-weight: 400; font-size: var(--s0); }
tr.loss td { color: var(--red); }

/* ---------------------------------------------------------------- quizzes */
.quiz { margin: calc(var(--gap) * 1.5) 0; border-top: 2px solid var(--ink); padding-top: 0.5rem; max-width: var(--measure); }
.quiz-q { border: 1px solid var(--kerb); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0 0 1rem; background: var(--sheet); }
.quiz-q legend { font-weight: 700; padding: 0 0.25rem; }
.quiz-q label { display: block; padding: 0.2rem 0; }
.quiz-q.right { border-color: var(--green); box-shadow: inset 4px 0 0 var(--green); }
.quiz-q.wrong { border-color: var(--red); box-shadow: inset 4px 0 0 var(--red); }
.quiz-q label.is-answer { font-weight: 700; }
.quiz-explain { margin-top: 0.4rem; }
.quiz-explain summary { cursor: pointer; color: var(--blue); }

/* ---------------------------------------------------------------- dark mode
   Follows the device setting; the toggle in the header overrides it (stored in the browser only). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6e8eb; --ink-soft: #b3bac2; --paper: #14171b; --sheet: #1d2126; --asphalt: #0d0f12; --asphalt-2: #22272d;
  --kerb: #353b43; --kerb-soft: #2a2f36; --amber-pale: #3a2f14; --blue: #8fb8e3; --blue-pale: #1e2a38; --red-pale: #3b1f1d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #e6e8eb; --ink-soft: #b3bac2; --paper: #14171b; --sheet: #1d2126; --asphalt: #0d0f12; --asphalt-2: #22272d;
    --kerb: #353b43; --kerb-soft: #2a2f36; --amber-pale: #3a2f14; --blue: #8fb8e3; --blue-pale: #1e2a38; --red-pale: #3b1f1d;
  }
}
:root[data-theme="dark"] .button, :root[data-theme="dark"] .search-row button { background: #3a414a; }
:root[data-theme="dark"] .button:hover { background: #4a525c; }
:root[data-theme="dark"] .flag-uncertain, :root[data-theme="dark"] .kind-estimate, :root[data-theme="dark"] .calc-warnings,
:root[data-theme="dark"] .callout-uncertain { --clabel: #f0c766; color: #f0c766; }
:root[data-theme="dark"] .kind-exact { background: #1f3626; color: #9fd8ab; }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { border-color: #4a525c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .button, :root:not([data-theme="light"]) .search-row button { background: #3a414a; }
  :root:not([data-theme="light"]) .button:hover { background: #4a525c; }
  :root:not([data-theme="light"]) .flag-uncertain, :root:not([data-theme="light"]) .kind-estimate,
  :root:not([data-theme="light"]) .calc-warnings, :root:not([data-theme="light"]) .callout-uncertain { --clabel: #f0c766; color: #f0c766; }
  :root:not([data-theme="light"]) .kind-exact { background: #1f3626; color: #9fd8ab; }
  :root:not([data-theme="light"]) input, :root:not([data-theme="light"]) select, :root:not([data-theme="light"]) textarea { border-color: #4a525c; }
}
.theme-toggle { background: none; border: 1px solid #4a515b; color: #dfe3e7; border-radius: var(--radius); font: 600 0.8rem var(--body); padding: 0.25rem 0.55rem; cursor: pointer; white-space: nowrap; }
.theme-toggle:hover { color: #fff; border-color: var(--amber); }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-block; font: 700 0.72rem/1.4 var(--body); border-radius: var(--radius); padding: 0.05rem 0.4rem; margin-left: 0.4rem; vertical-align: 0.2em; }
.badge-new { background: var(--green); color: #fff; }
.badge-updated { background: var(--blue-pale); color: var(--blue); border: 1px solid var(--blue); }
.catalogue-filters input[type="checkbox"] { min-width: 0; width: auto; margin-right: 0.4rem; }
.catalogue-filters .check label { display: flex; align-items: center; }

/* ---------------------------------------------------------------- faction upgrade planner */
.planner { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.5rem; align-items: start; }
.planner-summary { position: sticky; top: 1rem; background: var(--sheet); border: 1px solid var(--kerb); border-top: 4px solid var(--amber); padding: 1rem 1.1rem; }
.planner-summary h2 { margin-top: 0; }
.planner-summary .output-value { font-size: var(--s1); }
.planner-box { border: 1px solid var(--kerb); background: var(--sheet); border-radius: var(--radius); padding: 0.75rem 1rem 1rem; margin: 0 0 1.25rem; }
.planner-box legend { font: 700 var(--s1) var(--display); padding: 0 0.3rem; }
.planner-row { display: grid; gap: 0.2rem; margin: 0.4rem 0 0.6rem; max-width: 22rem; }
.planner-row label, .planner-pair label { font-weight: 600; font-size: var(--s-1); }
.planner-group h3, .planner-box h3 { font-size: var(--s0); margin: 1rem 0 0.35rem; }
.planner-pair { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.planner-pair label { display: grid; gap: 0.2rem; min-width: 15rem; flex: 1; }
.planner-table input[type="number"] { width: 5rem; }
.planner-tree { border-top: 1px solid var(--kerb); padding: 0.4rem 0; }
.planner-tree summary { cursor: pointer; display: flex; align-items: center; gap: 1rem; font-weight: 700; }
.planner-tree-name { flex: 1; }
.planner-slot { font-weight: 400; font-size: var(--s-1); }
.planner-buy { padding-left: 1.2rem; max-height: 22rem; overflow: auto; font-size: 0.95rem; }
@media (max-width: 900px) { .planner { grid-template-columns: 1fr; } .planner-summary { position: static; } }
.planner-pair select { max-width: 100%; min-width: 0; }
.loadout-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.loadout h2 { margin-top: 0; }
.loadout-field { display: grid; gap: 0.2rem; font-weight: 600; font-size: var(--s-1); margin: 0 0 0.6rem; }
tr.differs th { box-shadow: inset 3px 0 0 var(--amber); }
.price-chart { margin: 1rem 0; max-width: 40rem; color: var(--blue); }
.price-chart svg { width: 100%; height: auto; background: var(--sheet); border: 1px solid var(--kerb); }
.price-chart figcaption { color: var(--ink); font-size: var(--s-1); margin-bottom: 0.3rem; }

/* Warden's Eye bot pages */
.bot-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.button-amber { background: var(--amber); color: #1f242b; }
.button-amber:hover { background: #f2b53a; color: #1f242b; }
.button-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.45); }
.button-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.bot-features, .bot-setup, .bot-safety, .bot-links { margin-bottom: 2.5rem; }
.feature-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.feature-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.7rem; max-width: var(--measure); }
.feature-shot { margin: 0; }
.feature-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--kerb); border-radius: var(--radius); background: var(--sheet); }
.feature-shot figcaption { font-size: var(--s-1); color: var(--ink-soft); margin-top: 0.4rem; }
.shot-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.75rem; }
.steps { padding-left: 1.4rem; display: grid; gap: 0.6rem; max-width: var(--measure); }
.bot-safety ul { max-width: var(--measure); display: grid; gap: 0.5rem; }
@media (max-width: 760px) { .feature-grid, .shot-row { grid-template-columns: 1fr; } }
.cmd-section { margin-top: 2rem; }
.cmd-list { margin: 0; border-top: 1px solid var(--kerb); }
.cmd { padding: 0.75rem 0; border-bottom: 1px solid var(--kerb-soft); }
.cmd dt { font-weight: 600; }
.cmd dt code { font-size: var(--s0); }
.cmd dd { margin: 0.25rem 0 0; color: var(--ink-soft); max-width: var(--measure); }
.cmd-options { margin: 0.35rem 0 0; padding-left: 1.1rem; font-size: var(--s-1); }
.cmd-tag { font-size: var(--s-1); font-weight: 500; color: var(--ink-soft); border: 1px solid var(--kerb); border-radius: var(--radius); padding: 0 0.35rem; margin-left: 0.3rem; }
#cmd-filter { font: inherit; width: 100%; max-width: 30rem; padding: 0.55rem 0.75rem; border: 1px solid var(--kerb); border-radius: var(--radius); background: var(--sheet); color: var(--ink); }

/* Market movers and Today in Torn */
.movers-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.25rem; }
td.up { color: var(--green); font-weight: 600; }
td.down { color: var(--red); font-weight: 600; }
.today { max-width: 76rem; margin: 0 auto; padding: 2rem 1.25rem 0; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; }
.today-card { background: var(--sheet); border: 1px solid var(--kerb); border-top: 3px solid var(--asphalt); border-radius: 0 0 var(--radius) var(--radius); padding: 0.9rem 1rem; }
.today-card h3 { font-size: var(--s0); margin: 0 0 0.5rem; }
.today-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.today-card li { display: flex; justify-content: space-between; gap: 0.75rem; }
.today-card .up { color: var(--green); font-weight: 600; white-space: nowrap; }
.today-card .down { color: var(--red); font-weight: 600; white-space: nowrap; }
.today-card .when { color: var(--ink-soft); white-space: nowrap; font-size: var(--s-1); }
.bookmark-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--kerb-soft); max-width: 40rem; }
button.small, .button.small { padding: 0.2rem 0.6rem; font-size: var(--s-1); }

/* My Torn: next steps and progress charts */
.next-steps { padding-left: 1.1rem; display: grid; gap: 0.5rem; max-width: var(--measure); }
.me-chart { margin: 1rem 0; max-width: 40rem; color: var(--blue); }
.me-chart svg { width: 100%; height: auto; background: var(--sheet); border: 1px solid var(--kerb); padding: 6px; }
.copy-row { margin: 0.75rem 0 0.25rem; }
.copy-fallback { width: 100%; font: 0.85rem/1.4 ui-monospace, monospace; padding: 0.5rem; border: 1px solid var(--kerb); background: var(--sheet); color: var(--ink); }
.helpful { margin: 2.5rem 0 1rem; padding: 1rem 1.25rem; border: 1px solid var(--kerb); border-left: 4px solid var(--amber); background: var(--sheet); max-width: var(--measure); }
.helpful-q { font-weight: 600; margin: 0 0 0.5rem; }
.helpful-actions { margin: 0 0 0.25rem; }
.insights { margin-top: 2.5rem; display: grid; gap: 2rem; }
.first30-group { margin-top: 1.75rem; }
.first30-list { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.first30-list li { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.6rem; align-items: baseline; padding: 0.55rem 0; border-bottom: 1px solid var(--kerb-soft); }
.first30-list li > a { grid-column: 2; }
.first30-list input { width: 1.1rem; height: 1.1rem; accent-color: var(--amber); }
.first30-list input:checked + label { color: var(--ink-soft); text-decoration: line-through; }
.first30-list li:has(input[hidden]) > label { grid-column: 1 / -1; }
.first30-progress { font-weight: 600; }
.hero-new { margin: 1rem 0 0; color: #d6dae0; }
.hero-new a { color: var(--amber); font-weight: 600; }
