:root {
  --bg: #f6f2e8;
  --fg: #22201c;
  --muted: #6b655a;
  --line: #d8d0bf;
  --accent: #8a2c22;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17160f;
    --fg: #e9e4d6;
    --muted: #a39c8b;
    --line: #3a372c;
    --accent: #e08a76;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.8 system-ui, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", sans-serif;
}
a { color: var(--accent); }
.site-header, main, .site-footer {
  max-width: 46rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  font: 700 1.25rem/1.2 Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: .02em;
}
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }
main { padding-top: 2rem; padding-bottom: 3rem; }
h1, h2 {
  font-family: Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif;
  line-height: 1.3;
}
h1 { font-size: 1.9rem; margin: 0 0 1rem; }
h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 .75rem;
  padding-bottom: .25rem;
  border-bottom: 1px solid var(--line);
}
h2 a { color: inherit; text-decoration: none; }
.prose img { max-width: 100%; height: auto; }
.crumb { margin: 0 0 .5rem; font-size: .9rem; }
.muted, time { color: var(--muted); }
.entries { list-style: none; padding: 0; margin: 0; }
.entries li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.entries time { display: inline-block; min-width: 7em; font-variant-numeric: tabular-nums; }
.button {
  display: inline-block;
  padding: .4rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-decoration: none;
}
.button:hover { background: var(--accent); color: var(--bg); }
.prose table, table.doctrines { border-collapse: collapse; margin: 1rem 0; font-size: .95rem; }
.prose th, .prose td, table.doctrines th, table.doctrines td {
  text-align: left;
  vertical-align: top;
  padding: .4rem .7rem;
  border-bottom: 1px solid var(--line);
}
table.doctrines td { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.doctrines thead th { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
h3.tier { font-size: 1.05rem; margin: 1.8rem 0 .4rem; }
h3.tier .count { color: var(--muted); font-weight: 400; margin-left: .3rem; }
dl.routines { margin: 0; }
dl.routines dt { font-weight: 700; padding-top: .7rem; }
dl.routines dd { margin: 0; padding-bottom: .7rem; border-bottom: 1px solid var(--line); color: var(--muted); }
dl.routines .result { display: block; margin-top: .25rem; font-size: .88rem; }
dl.routines .result b { margin-right: .5rem; color: var(--fg); }
.verdict {
  display: inline-block;
  margin-left: .4rem;
  padding: 0 .45rem;
  border-radius: 3px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.6;
  vertical-align: middle;
  white-space: nowrap;
}
.verdict-legend .verdict { margin: 0 .4rem 0 0; }
.v-plus { background: #2e6b4f; color: #fff; }
.v-neutral { background: var(--muted); color: var(--bg); }
.v-minus { background: var(--accent); color: var(--bg); }
.v-unmeasured { border: 1px solid var(--line); color: var(--muted); font-weight: 400; }

/* layer diagram (data/pipeline.json) */
:root {
  --paper: #fff;
  --artery: #b3261e;
  --vein: #2b5c9e;
  --b1: #e6ecf5; --b2: #eaf1e7; --b3: #f5efe3; --b4: #f4e8e8;
  --boxfill: #fff;
  --ledger: #fbf7ec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1b14;
    --artery: #e8665c;
    --vein: #77a3e6;
    --b1: #172030; --b2: #17231a; --b3: #241f16; --b4: #261a1b;
    --boxfill: #1d2624;
    --ledger: #27241a;
  }
}
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .88rem; color: var(--muted); margin: 1rem 0 .6rem; }
.legend span { display: inline-flex; align-items: center; gap: .5rem; }
.legend .sw { width: 34px; height: 0; border-top: 3px solid var(--artery); display: inline-block; }
.legend .sw.v { border-top: 2.5px dashed var(--vein); }
.diagram {
  width: min(1180px, calc(100vw - 2rem));
  margin-left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}
.diagram svg { display: block; min-width: 1000px; width: 100%; height: auto; }
.diagram .band1 { fill: var(--b1); } .diagram .band2 { fill: var(--b2); }
.diagram .band3 { fill: var(--b3); } .diagram .band4 { fill: var(--b4); }
.diagram .bandl { fill: var(--fg); font: 800 22px Georgia, "Yu Mincho", "Hiragino Mincho ProN", serif; }
.diagram .bandsub { fill: var(--muted); font-size: 11.5px; }
.diagram .box { fill: var(--boxfill); stroke: var(--line); stroke-width: 1.2; }
.diagram .box.ledger { fill: var(--ledger); stroke: var(--accent); stroke-width: 1.8; }
.diagram .bt { fill: var(--fg); font-weight: 700; font-size: 14.5px; }
.diagram .bs { fill: var(--muted); font-size: 11.5px; }
.diagram .art { stroke: var(--artery); fill: none; }
.diagram .vein { stroke: var(--vein); fill: none; stroke-dasharray: 7 5; }
.diagram .al { fill: var(--artery); font-size: 11.5px; font-weight: 700; }
.diagram .vl { fill: var(--vein); font-size: 11.5px; font-weight: 700; }
.diagram .mk-a { fill: var(--artery); } .diagram .mk-v { fill: var(--vein); }

.site-footer {
  padding-top: 1rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}

/* scenarios */
table.scenarios { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.scenarios th, table.scenarios td { text-align: left; padding: .35rem .6rem; border-bottom: 1px solid var(--line); }
table.scenarios td:first-child, table.scenarios td:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag { display: inline-block; font-size: .8rem; line-height: 1.5; padding: 0 .5em; border: 1px solid var(--line); border-radius: .6em; color: var(--muted); }
.tag.demo { color: var(--accent); border-color: var(--accent); }
.facts { margin: 0 0 1rem; }
.briefing { white-space: pre-wrap; }
figure.map { margin: 1rem 0 1.5rem; }
.map-frame { position: relative; line-height: 0; border: 1px solid var(--line); }
.map-frame img { width: 100%; height: auto; }
.map-frame .lb {
  position: absolute; transform: translate(-50%, -50%); line-height: 1.2; white-space: nowrap;
  font-size: clamp(.55rem, 1.6vw, .8rem); color: #2a2418; text-shadow: 0 0 3px #ecdfc4, 0 0 3px #ecdfc4, 0 0 2px #ecdfc4;
}
.map-frame .lb-battle { font-weight: 700; }
figure.map figcaption { color: var(--muted); font-size: .9rem; margin-top: .3rem; }

/* candidates */
.toc { margin: 0 0 1rem; padding-left: 1.2rem; color: var(--muted); font-size: .95rem; }
section.battle { padding: .25rem 0 .75rem; border-bottom: 1px solid var(--line); }
section.battle h3 { font-size: 1.05rem; margin: 1rem 0 .1rem; }
section.battle p { margin: 0; }
section.battle dl { margin: .3rem 0 0; font-size: .95rem; }
section.battle dt { font-weight: 700; margin-top: .4rem; font-size: .85rem; color: var(--muted); }
section.battle dd { margin: 0; }
a.tag { text-decoration: none; }
