/* Task loot-reference-pages-20261030 (lane SITE): Terminal State reference site — small vanilla stylesheet.
   Light and dark themes follow the reader's system setting. No web fonts, no images, no external requests. */

:root {
  color-scheme: light;
  --bg: #fcfcfb;
  --surface: #ffffff;
  --surface-2: #f3f2ef;
  --text: #0b0b0b;
  --text-2: #52514e;
  --border: #d6d4cf;
  --link: #1c5cab;
  --link-visited: #5a3fa8;
  --focus: #1c5cab;
  --accent: #eda100;
  --accent-ink: #0b0b0b;
  --bar: #2a78d6;
  --bar-track: #e6e4df;
  --good: #006300;
  --warn-ink: #7a4b00;
  --crit-ink: #a12727;
  --radius: 6px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --surface-2: #242422;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --border: #3d3d39;
    --link: #86b6ef;
    --link-visited: #b4a9f2;
    --focus: #f2c14e;
    --bar: #3987e5;
    --bar-track: #2e2e2b;
    --good: #5fd35f;
    --warn-ink: #f2c14e;
    --crit-ink: #ff8f8f;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
}

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }

code, kbd, pre { font-family: var(--mono); font-size: 0.92em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 0.25em; overflow-wrap: anywhere; }

h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 0.5em; }
h1 { font-size: 2rem; margin-top: 0.6em; }
h2 { font-size: 1.45rem; border-bottom: 1px solid var(--border); padding-bottom: 0.25em; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p, ul, ol, dl { margin: 0.6em 0; }
.lede { font-size: 1.12rem; color: var(--text-2); max-width: 52rem; }
.muted, .note { color: var(--text-2); }
.note { font-size: 0.93rem; }

/* Skip link: visible on keyboard focus. */
.skip-link {
  position: absolute; left: 0.5rem; top: -3rem; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: 0.5rem 0.8rem; border-radius: var(--radius); font-weight: 600;
}
.skip-link:focus { top: 0.5rem; }

/* Header: subway-signage stripe. */
.site-header { background: var(--surface-2); border-top: 5px solid var(--accent); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.7rem; padding-bottom: 0.7rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; }
.brand:visited { color: var(--text); }
.brand-mark {
  display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; letter-spacing: 0.02em;
}
.brand-text { display: flex; flex-direction: column; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.15; }
.brand-sub { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-2); font-size: 0.85rem; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: inline-block; padding: 0.3rem 0.1rem; color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; }
.site-nav a:visited { color: var(--text); }
.site-nav a:hover { border-bottom-color: var(--border); }
.site-nav a[aria-current] { border-bottom-color: var(--accent); }

.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 1rem 0 0; gap: 0.25rem; font-size: 0.92rem; color: var(--text-2); }
.crumbs li + li::before { content: "/"; margin: 0 0.4rem 0 0.15rem; color: var(--text-2); }

main { padding-bottom: 3rem; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 0.9rem; padding: 1rem 0 1.5rem; }
.site-footer code { background: var(--surface); }

/* Cards (landing / level index). */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; padding: 0; list-style: none; margin: 1rem 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card h2, .card h3 { margin: 0 0 0.4rem; border: 0; padding: 0; font-size: 1.15rem; }
.card p { margin: 0.35rem 0; }
.card .stat { color: var(--text-2); font-size: 0.92rem; }
.card-soon { border-style: dashed; color: var(--text-2); }

/* Callouts. */
.callout { border: 1px solid var(--border); border-left: 5px solid var(--accent); background: var(--surface); border-radius: var(--radius); padding: 0.7rem 1rem; margin: 1rem 0; }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

/* Tables. */
.table-wrap { overflow-x: auto; margin: 0.8rem 0 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
table.data caption { caption-side: top; text-align: left; font-weight: 700; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
table.data th, table.data td { padding: 0.4rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
table.data thead th { font-size: 0.85rem; color: var(--text-2); font-weight: 700; white-space: nowrap; background: var(--surface); }
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data tbody th { font-weight: 600; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.share { min-width: 11rem; }
.item-id { display: block; font-family: var(--mono); font-size: 0.8rem; color: var(--text-2); }

/* Share bars: one hue; the exact value is always printed beside the bar. */
.share-cell { display: flex; align-items: center; gap: 0.6rem; }
.bar { flex: 1 1 6rem; min-width: 4rem; height: 0.7rem; background: var(--bar-track); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.share-value { font-variant-numeric: tabular-nums; min-width: 4.2rem; text-align: right; }
.denom { display: block; color: var(--text-2); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

/* Chips and badges: identity is the text; tone is a secondary cue. */
.chip { display: inline-block; padding: 0 0.5em; margin: 0.1em 0.2em 0.1em 0; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: 0.82rem; line-height: 1.6; white-space: nowrap; }
.chip-slot { border-style: dashed; }
.chips { display: flex; flex-wrap: wrap; gap: 0.15rem; }
.badge { display: inline-block; padding: 0 0.45em; border-radius: 4px; border: 1px solid currentColor; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.6; white-space: nowrap; vertical-align: 0.1em; }
.badge-guaranteed, .badge-exact { color: var(--good); }
.badge-conditional, .badge-special { color: var(--warn-ink); }
.badge-notderivable { color: var(--crit-ink); }
.badge-decoration, .badge-nonloot, .badge-info { color: var(--text-2); }

/* Stage gates. */
.stages { counter-reset: stage; list-style: none; padding: 0; margin: 0.8rem 0; display: grid; gap: 0.4rem; }
.stages > li { counter-increment: stage; position: relative; padding: 0.45rem 0.75rem 0.45rem 2.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stages > li::before { content: counter(stage); position: absolute; left: 0.7rem; top: 0.45rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.8rem; font-weight: 700; }

/* Definition lists (key facts). */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; }
dl.facts dt { font-weight: 600; color: var(--text-2); }
dl.facts dd { margin: 0; }

/* Collapsible groups. */
details.group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 0.6rem 0; }
details.group > summary { cursor: pointer; padding: 0.55rem 0.8rem; font-weight: 600; list-style-position: inside; }
details.group > summary:hover { background: var(--surface-2); }
details.group[open] > summary { border-bottom: 1px solid var(--border); }
details.group > .group-body { padding: 0.2rem 0.9rem 0.6rem; }
details.group .table-wrap { margin: 0.6rem 0; }
.summary-meta { font-weight: 400; color: var(--text-2); font-size: 0.9rem; }

/* In-page navigation. */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 1rem; margin: 1rem 0; }
.toc h2 { margin: 0 0 0.3rem; border: 0; padding: 0; font-size: 1rem; }
.toc ul { display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; list-style: none; margin: 0; padding: 0; }

/* Filter box (enabled by the script). */
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; margin: 1rem 0; padding: 0.6rem 0.8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.filter label { font-weight: 600; }
.filter input { flex: 1 1 16rem; min-width: 0; font: inherit; padding: 0.35rem 0.55rem; color: var(--text); background: var(--surface); border: 1px solid var(--text-2); border-radius: 4px; }
.filter-status { color: var(--text-2); font-size: 0.9rem; }
.tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.tools button { font: inherit; font-size: 0.9rem; padding: 0.25rem 0.7rem; color: var(--text); background: var(--surface); border: 1px solid var(--text-2); border-radius: 4px; cursor: pointer; }
.tools button:hover { background: var(--surface-2); }
[hidden] { display: none !important; }

.repo { overflow-wrap: anywhere; }
.access { color: var(--text-2); font-size: 0.82em; white-space: nowrap; }

@media (max-width: 40rem) {
  body { font-size: 15px; }
  h1 { font-size: 1.6rem; }
  .wrap { padding: 0 0.8rem; }
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dd { margin-bottom: 0.4rem; }
  table.data th, table.data td { padding: 0.35rem 0.5rem; }
}

@media (forced-colors: active) {
  .bar { border: 1px solid CanvasText; }
  .bar-fill { background: CanvasText; forced-color-adjust: none; }
  .badge, .chip { border-color: CanvasText; }
}

@media print {
  .site-header, .site-footer, .filter, .tools, .skip-link { display: none; }
  details.group { break-inside: avoid; }
}
