/* Layout: a field-notebook reading column beside a finding tree; the tree folds into the top on phones. */
:root {
  --bg: #f5f7f6; --surface: #ffffff; --ink: #17262b; --muted: #5b6b70; --rule: #d9e1e0;
  --accent: #1d6a86; --grey: #9aa7a8; --good: #3f7d4e; --warn: #b7791f; --bad: #b4473a;
  --c1: #1d6a86; --c2: #c08a2b; --c3: #6b8f3c; --c4: #8a5a8f;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1719; --surface: #152023; --ink: #e3ebea; --muted: #9db0b2; --rule: #2a3a3d;
  --accent: #5fb3d3; --grey: #6f8083; --good: #6fb67f; --warn: #e0a84a; --bad: #e07a6c;
  --c1: #5fb3d3; --c2: #e0a84a; --c3: #9cc46a; --c4: #c296c7; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0f1719; --surface: #152023; --ink: #e3ebea; --muted: #9db0b2; --rule: #2a3a3d;
  --accent: #5fb3d3; --grey: #6f8083; --good: #6fb67f; --warn: #e0a84a; --bad: #e07a6c;
  --c1: #5fb3d3; --c2: #e0a84a; --c3: #9cc46a; --c4: #c296c7; color-scheme: dark; }

/* Diagram palette: named for what it shows (after Omniscala's TONE); light values, dark twins below. */
:root {
  --heat: #d9480f; --nodata: #b8c2c3;
  --r1: #f3d9a4; --r2: #eab46a; --r3: #df8a3e; --r4: #c95b2b; --r5: #9c2f22;
  --s1: #b9dbe7; --s2: #7fb8d0; --s3: #3f8fb0; --s4: #1d6a86;
  --dg-line: #3b3a33; --dg-flow: #2a7fa6; --dg-nts: #b45309; --dg-sky: #e6f1f5;
  --dg-water: #9fd0e4; --dg-water-deep: #4a90b0; --dg-stone: #a7a294; --dg-stone-dark: #77736a; --dg-sand: #d9c9a3;
  --dg-soil: #9a7b55; --dg-leaf: #6fa35a; --dg-leaf-dark: #3f7a3a; --dg-bark: #7a5a3c; --dg-grass: #8dbb63;
  --dg-roof: #b0574a; --dg-wall: #e2dccf; --dg-road: #5c5f63; --dg-snow: #f4f7f8; --dg-salt: #ffffff;
  --dg-olive: #8a8a4a; --dg-amber: #c89a4a; --dg-brown: #7c5a3a; --dg-dark: #2f2a24; --dg-copper: #b0703a;
  --dg-green: #6f9a4a; --dg-tan: #c9b48a; --dg-rust: #a5523a; --dg-pink: #d98b8b; --dg-blood: #b8323a;
  --dg-grey: #8e9590; --dg-beige: #d8ccb0; --dg-accent: #1d6a86;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --heat: #ff8a3d; --nodata: #4d5a5c;
  --r1: #6b5a3a; --r2: #8f6a35; --r3: #b97a32; --r4: #e08a3c; --r5: #ff9b6a;
  --s1: #2b4f5c; --s2: #33708a; --s3: #4a96b8; --s4: #7cc7e6;
  --dg-line: #d8d2c2; --dg-flow: #7cc7e6; --dg-nts: #ffb547; --dg-sky: #18272c;
  --dg-water: #2f6f8c; --dg-water-deep: #1a4257; --dg-stone: #7d796f; --dg-stone-dark: #5a574f; --dg-sand: #8f8266;
  --dg-soil: #6e5638; --dg-leaf: #5e8f4a; --dg-leaf-dark: #3e6a35; --dg-bark: #6a4e34; --dg-grass: #5f8a44;
  --dg-roof: #9a4e44; --dg-wall: #8d877a; --dg-road: #3e4246; --dg-snow: #c9d3d6; --dg-salt: #e9eef0;
  --dg-olive: #8f8f55; --dg-amber: #c49a52; --dg-brown: #8a6646; --dg-dark: #1a1714; --dg-copper: #b77a46;
  --dg-green: #6f9a4a; --dg-tan: #b8a47c; --dg-rust: #a85a44; --dg-pink: #c98585; --dg-blood: #c0464d;
  --dg-grey: #8a918c; --dg-beige: #b9ae94; --dg-accent: #5fb3d3; } }
:root[data-theme="dark"] {
  --heat: #ff8a3d; --nodata: #4d5a5c;
  --r1: #6b5a3a; --r2: #8f6a35; --r3: #b97a32; --r4: #e08a3c; --r5: #ff9b6a;
  --s1: #2b4f5c; --s2: #33708a; --s3: #4a96b8; --s4: #7cc7e6;
  --dg-line: #d8d2c2; --dg-flow: #7cc7e6; --dg-nts: #ffb547; --dg-sky: #18272c;
  --dg-water: #2f6f8c; --dg-water-deep: #1a4257; --dg-stone: #7d796f; --dg-stone-dark: #5a574f; --dg-sand: #8f8266;
  --dg-soil: #6e5638; --dg-leaf: #5e8f4a; --dg-leaf-dark: #3e6a35; --dg-bark: #6a4e34; --dg-grass: #5f8a44;
  --dg-roof: #9a4e44; --dg-wall: #8d877a; --dg-road: #3e4246; --dg-snow: #c9d3d6; --dg-salt: #e9eef0;
  --dg-olive: #8f8f55; --dg-amber: #c49a52; --dg-brown: #8a6646; --dg-dark: #1a1714; --dg-copper: #b77a46;
  --dg-green: #6f9a4a; --dg-tan: #b8a47c; --dg-rust: #a85a44; --dg-pink: #c98585; --dg-blood: #c0464d;
  --dg-grey: #8a918c; --dg-beige: #b9ae94; --dg-accent: #5fb3d3; }
.dg { width: 100%; height: auto; display: block; }
.dg-name { font: 600 12.5px var(--display); fill: var(--ink); }
.dg-sub { font: 11.5px var(--display); fill: var(--muted); }
.dg-big { font: 600 15px var(--display); fill: var(--ink); }
.dg-num { font: 600 13px var(--mono); fill: var(--ink); }
.dg-nts { font: 600 11px var(--display); fill: var(--dg-nts); }
.dg-up { fill: var(--good); } .dg-down { fill: var(--bad); }
.dg-anim .flow { stroke-dasharray: 10 14; animation: dg-flow 1.6s linear infinite; }
.dg-anim .drip { stroke-dasharray: 4 18; animation: dg-flow 1.1s linear infinite; }
@keyframes dg-flow { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) { .dg-anim .flow, .dg-anim .drip { animation: none; } }
figure.diagram { padding: 12px; }

*, *::before, *::after { box-sizing: border-box; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--body); }
a { color: var(--accent); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font: 700 clamp(30px, 5vw, 46px)/1.08 var(--display); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font: 600 24px/1.2 var(--display); margin: 0; text-wrap: balance; }
h3 { font: 600 17px/1.3 var(--display); margin: 0; text-wrap: balance; }
p { margin: 0; max-width: 68ch; }
.meta { font: 13px/1.5 var(--mono); color: var(--muted); }
.eyebrow { font: 600 12px/1.4 var(--display); letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.lede { font-size: 19px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- shell: top bar, menus, phone sheet ---------- */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
kbd { font: 500 11px/1 var(--mono); padding: 2px 5px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: var(--bg); }
.topbar { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 50; background: var(--surface); }
.topbar-in { max-width: 1440px; margin: 0 auto; height: 58px; display: flex; align-items: center; gap: 28px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand img { border-radius: 6px; display: block; }
.brand-name { font: 700 16px/1.1 var(--display); letter-spacing: -.005em; white-space: nowrap; }
.mainnav { flex: 1; min-width: 0; }
.mainnav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; align-items: center; }
.mainnav li { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; font: 600 14px/1 var(--display); color: var(--muted); text-decoration: none;
  padding: 9px 12px; border-radius: 7px; border: 0; background: none; cursor: pointer; }
.nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav-link[aria-current="page"], .nav-link[data-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 7px 7px 0 0; }
.nav-link[aria-expanded="true"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.nav-link svg { opacity: .7; transition: transform .15s; }
.nav-link[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav-link:focus-visible, .menu a:focus-visible, .menu-btn:focus-visible, .sheet a:focus-visible, .sheet summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; box-shadow: 0 12px 32px rgb(0 0 0 / .14), 0 2px 6px rgb(0 0 0 / .06); padding: 8px; min-width: 300px; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 7px; color: var(--ink); text-decoration: none; font: 14px/1.35 var(--display); }
.menu a:hover, .menu a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.menu a b { font-weight: 600; }
.menu a .meta { font-size: 12px; line-height: 1.35; }
.mega { width: min(920px, calc(100vw - 32px)); left: -40px; padding: 12px; }
.mega .menu-all { flex-direction: row; align-items: baseline; gap: 10px; font-weight: 600; border-bottom: 1px solid var(--rule); border-radius: 7px 7px 0 0; margin-bottom: 8px; padding-bottom: 12px; }
.mega-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 12px; }
.mega-head { font-weight: 700 !important; font-size: 12px !important; letter-spacing: .07em; text-transform: uppercase; color: var(--accent) !important; padding-bottom: 4px !important; }
.mega-col li a { flex-direction: row; align-items: baseline; gap: 8px; padding: 5px 10px; font-size: 13.5px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--rule); border-radius: 8px; color: var(--ink); padding: 7px 9px; cursor: pointer; }
.sheet { position: fixed; inset: 0; z-index: 70; background: var(--surface); overflow-y: auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; height: 46px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.sheet-close { font: 400 28px/1 var(--display); background: none; border: 0; color: var(--ink); cursor: pointer; padding: 4px 8px; }
.sheet a, .sheet summary { display: flex; align-items: baseline; gap: 8px; padding: 12px 4px; font: 600 17px/1.3 var(--display); color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); cursor: pointer; }
.sheet details ul { list-style: none; margin: 0; padding: 0 0 6px 12px; }
.sheet details ul a { font-weight: 500; font-size: 15px; border-bottom: 0; padding: 9px 4px; }
.sheet-open body { overflow: hidden; }
@media (max-width: 860px) {
  .mainnav { display: none; }
  .menu-btn { display: inline-flex; }
}

/* ---------- pages ---------- */
.page { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; padding-block: 32px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.page > *:not(.block):not(.cards):not(.rows) { max-width: 820px; }
.page.with-side { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; align-items: start; }
.page.with-side > * { max-width: none; }
.finding { min-width: 0; max-width: 820px; display: flex; flex-direction: column; gap: 22px; }
.local { position: sticky; top: 82px; font: 14px/1.4 var(--display); max-height: calc(100vh - 100px); overflow-y: auto; }
.local-head { display: block; font: 700 12px/1.4 var(--display); letter-spacing: .07em; text-transform: uppercase; color: var(--accent); text-decoration: none; padding: 4px 10px 8px; }
.local ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.local a { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; color: var(--muted); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; }
.local a:hover { color: var(--ink); }
.local a[aria-current="page"] { color: var(--ink); font-weight: 600; border-left-color: var(--accent); }
@media (max-width: 960px) { .page.with-side { grid-template-columns: minmax(0, 1fr); gap: 0; } .local { display: none; } }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--grey); display: inline-block; transform: translateY(-1px); }
.dot.concern { background: var(--bad); } .dot.watch { background: var(--warn); } .dot.good { background: var(--good); }
.main { min-width: 0; }

/* blocks */
.hero { display: flex; flex-direction: column; gap: 10px; }
.block { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.crumbs { font: 13px/1.4 var(--display); color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 4px; }
.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--rule);
  border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.numbers div { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.numbers b { font: 600 24px/1.15 var(--mono); font-variant-numeric: tabular-nums; }
.numbers span { font: 13px/1.4 var(--display); color: var(--muted); }
figure { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart a circle { cursor: pointer; }
.map-border { stroke: var(--muted); stroke-width: 1.1; stroke-linejoin: round; }
.map-state { stroke: var(--rule); stroke-width: .8; stroke-linejoin: round; }
.map-word { font: 600 11px var(--display); letter-spacing: .18em; fill: var(--muted); opacity: .7; }
.chart a:hover circle { stroke: var(--ink); stroke-width: 1.5; fill-opacity: 1; }
.chart a text { fill: var(--accent); text-decoration: underline; }
figcaption { font: 12px/1.5 var(--mono); color: var(--muted); }
svg text { font-family: var(--display); }
.t-title { font-size: 15px; font-weight: 600; fill: var(--ink); }
.t-sub, .t-axis { font-size: 12px; fill: var(--muted); }
.t-label { font-size: 12px; fill: var(--ink); }
.t-note { font-size: 11.5px; fill: var(--muted); }
.grid { stroke: var(--rule); }
.axis { stroke: var(--grey); }
.ref { stroke: var(--muted); stroke-dasharray: 5 4; stroke-width: 1.5; fill: none; }
.tbl { overflow-x: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font: 14px/1.4 var(--display); }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th { font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
td.n, th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font: 600 12px/1.6 var(--display); vertical-align: 2px; white-space: nowrap; }
.pill.good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.pill.neutral { color: var(--muted); background: color-mix(in srgb, var(--grey) 18%, transparent); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cards.list { grid-template-columns: minmax(0, 1fr); }
.card { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 6px; color: var(--ink); text-decoration: none; transition: border-color .15s; }
.card:hover { border-color: var(--accent); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card p { font-size: 15px; color: var(--muted); }
.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sec { padding: 16px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.sec p { font-size: 15px; color: var(--muted); }
.sec ul { list-style: none; margin: 0; padding: 0; font: 14px/1.5 var(--display); display: flex; flex-direction: column; gap: 4px; }
.sec li { display: flex; align-items: baseline; gap: 8px; }
.related { border-top: 1px solid var(--rule); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.related ul { margin: 0; padding-left: 20px; font: 15px/1.5 var(--display); }
.method { border: 1px solid var(--rule); border-radius: 6px; padding: 10px 14px; background: var(--surface); font-size: 15px; }
.method summary { font: 600 14px/1.4 var(--display); cursor: pointer; }
.method p { margin-top: 8px; }
.pager { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--rule); padding-top: 16px; }
.pager a { display: flex; flex-direction: column; font: 600 15px/1.4 var(--display); text-decoration: none; max-width: 48%; }
.pager a.nx { text-align: right; margin-left: auto; }
ol.next { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; max-width: 68ch; }
.foot { border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 24px; display: flex; flex-direction: column; gap: 6px; }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
/* Phones: diagrams keep a readable size and pan sideways inside their frame instead of shrinking. */
@media (max-width: 640px) {
  figure.diagram { overflow-x: auto; }
  figure.diagram svg.dg { min-width: 640px; }
}

/* ---------- Explore: app layout ---------- */
.is-app .foot { margin-top: 0; }
.app { max-width: 1440px; margin: 0 auto; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.app-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-bottom: 12px; }
.ex-search { position: relative; flex: 1 1 280px; max-width: 420px; display: flex; align-items: center; gap: 8px; height: 40px;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); padding: 0 10px; color: var(--muted); }
.ex-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ex-search input { flex: 1; min-width: 0; border: 0; background: none; font: 15px/1 var(--display); color: var(--ink); outline: none; }
.ex-search input::-webkit-search-cancel-button { display: none; }
.ex-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 12px 32px rgb(0 0 0 / .16); max-height: 360px; overflow-y: auto; }
.ex-results li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font: 14px/1.3 var(--display); color: var(--ink); }
.ex-results li span { font-size: 12px; color: var(--muted); }
.ex-results li:hover, .ex-results li.on { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ex-results li.none { cursor: default; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { font: 600 13px/1 var(--display); padding: 0 12px; height: 38px; border: 0; border-right: 1px solid var(--rule); background: none; color: var(--muted); cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--heat) 15%, transparent); color: var(--ink); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ex-select { display: inline-flex; align-items: center; gap: 8px; font: 13px/1 var(--display); color: var(--muted); }
.ex-select select { font: 600 13px/1 var(--display); height: 38px; padding: 0 30px 0 10px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer;
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.ex-select select:disabled { opacity: .5; cursor: default; }
.ex-select select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ex-toggle { font: 600 13px/1 var(--display); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ex-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.app-main { display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-areas: "map panel"; gap: 14px; height: calc(100vh - 58px - 14px - 52px - 16px); min-height: 560px; }
.app-map { grid-area: map; } .ex-panel { grid-area: panel; }
.app-map { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 10px 12px; }
.ex-map { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.ex-map svg { width: 100%; height: 100%; display: block; }
.ex-empty { color: var(--muted); font: 14px/1.5 var(--display); padding: 40px; text-align: center; }
.ex-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 12px/1.5 var(--display); color: var(--muted); padding-top: 8px; border-top: 1px solid var(--rule); }
.ex-legend .lg-title { color: var(--ink); font-weight: 600; }
.ex-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.ex-legend i.heat { background: var(--heat); opacity: .75; border-radius: 2px; }
.ex-legend i.ring { background: transparent; border: 2px solid; width: 9px; height: 9px; }
.ex-label { font: 600 11.5px var(--display); fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.ex-ring circle, .ex-site circle { cursor: pointer; transition: stroke-width .12s, fill-opacity .12s; }
.ex-ring:hover circle, .ex-ring.hl circle { stroke-width: 3.5; fill-opacity: .32; }
.ex-ring:focus-visible circle, .ex-site:focus-visible circle { stroke: var(--accent); stroke-width: 4; }
.ex-site:hover circle { stroke: var(--ink); stroke-width: 2; }
.ex-chapter { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 3 3; pointer-events: none; }
.ex-panel { min-width: 0; min-height: 0; overflow-y: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px 20px;
  display: flex; flex-direction: column; gap: 12px; scrollbar-gutter: stable; }
.ex-crumbs { font: 12.5px/1.6 var(--display); color: var(--muted); }
.ex-crumbs a { color: var(--muted); text-decoration: none; }
.ex-crumbs a:hover { color: var(--accent); text-decoration: underline; }
.ex-crumbs .sep { margin: 0 5px; opacity: .6; }
.ex-crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.ex-title { font: 700 24px/1.15 var(--display); margin: 0; }
.ex-sub { margin: 2px 0 0; font: 13px/1.4 var(--mono); color: var(--muted); }
.ex-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ex-actions button, .ex-actions .btn, .ex-back { font: 600 13px/1 var(--display); padding: 8px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink); text-decoration: none; }
.ex-actions button:hover, .ex-actions .btn:hover, .ex-back:hover { border-color: var(--accent); color: var(--accent); }
.ex-actions .primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.ex-actions .primary:hover { color: var(--bg); filter: brightness(1.08); }
.ex-back { align-self: flex-start; margin-bottom: 8px; border: 0; padding: 4px 0; color: var(--accent); background: none; }
.ex-intro { font-size: 15px; color: var(--muted); }
.ex-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ex-card { border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; background: var(--bg); min-width: 0; }
.ex-card-t { font: 600 11.5px/1.3 var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ex-card b { font: 600 22px/1.15 var(--mono); font-variant-numeric: tabular-nums; }
.ex-card b small { font-size: 12px; color: var(--muted); }
.ex-card-s { font: 12.5px/1.35 var(--display); color: var(--ink); }
.ex-card-p { font: 11.5px/1.35 var(--display); color: var(--muted); }
.ex-trend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ex-h { font: 600 15px/1.3 var(--display); margin: 8px 0 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ex-h .meta { font-size: 11.5px; }
.ex-list { font-size: 13px; }
.ex-list th, .ex-list td { padding: 6px 8px; }
.ex-list th { padding: 0; }
.ex-list .sort { font: 600 11px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: none; border: 0; padding: 8px; cursor: pointer; width: 100%; text-align: inherit; }
.ex-list th.n .sort { text-align: right; }
.ex-list .sort:hover { color: var(--accent); }
.ex-list tr.go { cursor: pointer; }
.ex-list tr.go:hover td, .ex-list tr.hl td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ex-list td:first-child { white-space: normal; min-width: 140px; }
.ex-list td a { color: var(--ink); text-decoration: none; font-weight: 600; }
.ex-list tr.go:hover td a { color: var(--accent); }
.ex-list .maplink { font-weight: 500; color: var(--accent); white-space: nowrap; }
.sw { display: inline-block; width: 9px; height: 9px; border: 2px solid; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }
.pill.accent { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ex-more { border: 1px solid var(--rule); border-radius: 10px; padding: 8px 12px; }
.ex-more summary { font: 600 13.5px/1.4 var(--display); cursor: pointer; }
.ex-more .tbl { margin-top: 8px; }
.ex-spark { width: 100%; height: auto; display: block; }
@media (max-width: 1100px) { .app-main { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 900px) {
  .app-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "map" "panel"; height: auto; min-height: 0; }
  .app-map { aspect-ratio: 760 / 600; }
  .ex-panel { overflow: visible; }
  .ex-search { max-width: none; flex-basis: 100%; }
}
@media (max-width: 520px) { .ex-select span { display: none; } .seg button { padding: 0 9px; font-size: 12px; } .ex-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ---------- lists and blocks on content pages ---------- */
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.block-head a.more { font: 600 14px/1 var(--display); text-decoration: none; }
.block-head h2 a { color: var(--ink); text-decoration: none; }
.block-head h2 a:hover { color: var(--accent); }
.sec-intro { color: var(--muted); font-size: 16px; }
.rows { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--surface); }
.row { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.row:last-child { border-bottom: 0; }
.row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-main b { font: 600 16px/1.3 var(--display); }
.row-main span { font-size: 15px; color: var(--muted); }
.home-below { padding-top: 28px; }
@media (max-width: 520px) { .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; } .seg button { flex: none; } }
@media (pointer: coarse) { kbd, .kbd-hint { display: none; } }
.sheet summary { list-style: none; }
.sheet summary::-webkit-details-marker { display: none; }
.sheet summary::after { content: "+"; margin-left: auto; font-weight: 400; color: var(--muted); }
.sheet details[open] summary::after { content: "–"; }


/* watershed areas on the map */
.ex-area path { fill-opacity: .42; stroke: var(--surface); stroke-width: 1.2; stroke-linejoin: round; cursor: pointer; transition: fill-opacity .12s; }
.ex-area:hover path, .ex-area.hl path { fill-opacity: .7; stroke: var(--ink); stroke-width: 1.6; }
.ex-area:focus-visible path { stroke: var(--accent); stroke-width: 3; }
.ex-area.chapter path { stroke: var(--accent); stroke-width: 2.4; }
.ex-parent { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; pointer-events: none; opacity: .75; }
.ex-parent.fill { fill: var(--accent); fill-opacity: .08; }
.ex-heat { pointer-events: none; }
.ex-label.ch { fill: var(--accent); }
.ex-legend i.area { border-radius: 2px; opacity: .7; }

.ex-area.dim path { fill: transparent; stroke: var(--rule); }
.ex-area.dim:hover path { stroke: var(--muted); fill: color-mix(in srgb, var(--muted) 10%, transparent); fill-opacity: 1; }
.ex-view button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 16%, transparent); }
