/* Battery Passport Audit — shared styles. Plain CSS, no build step. */

/* ---------- font (self-hosted, SIL OFL; see assets/fonts/OFL-Inter.txt) ---------- */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --fg: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #1e40af;
  --accent-fg: #ffffff;
  --accent-soft: #eef2ff;
  /* signal colours (always paired with a shape and text) */
  --harm: #b42318;
  --flag: #a14306;
  --structural: #5b21b6;
  --none: #526075;
  --gap-line: #7d8aa0;
  /* confidence */
  --c-high: #067647;
  --c-medium: #8a5a00;
  --c-low: #b93815;
  --c-unknown: #526075;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.16);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #111a2b; --surface-2: #18233a; --fg: #e6ebf2; --muted: #9eabbe; --line: #24324a; --line-strong: #33445f;
    --accent: #93b4ff; --accent-fg: #0b1220; --accent-soft: #1a2747;
    --harm: #ff8a7a; --flag: #fdb35a; --structural: #c0aefc; --none: #9eabbe; --gap-line: #6f7f99;
    --c-high: #5bd69a; --c-medium: #f5c451; --c-low: #ff9b6a; --c-unknown: #9eabbe;
    --shadow: none; --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #111a2b; --surface-2: #18233a; --fg: #e6ebf2; --muted: #9eabbe; --line: #24324a; --line-strong: #33445f;
  --accent: #93b4ff; --accent-fg: #0b1220; --accent-soft: #1a2747;
  --harm: #ff8a7a; --flag: #fdb35a; --structural: #c0aefc; --none: #9eabbe; --gap-line: #6f7f99;
  --c-high: #5bd69a; --c-medium: #f5c451; --c-low: #ff9b6a; --c-unknown: #9eabbe;
  --shadow: none; --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5); color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; letter-spacing: -0.015em; }
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 1.3rem; font-weight: 650; margin-top: 1.75rem; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a.sr-only:focus { position: fixed; top: 0.5rem; left: 0.5rem; width: auto; height: auto; margin: 0; padding: 0.5rem 0.75rem; clip: auto; overflow: visible;
  z-index: 20; background: var(--surface); color: var(--fg); border: 2px solid var(--accent); border-radius: var(--radius-sm); }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
main.wrap { padding-top: 2rem; padding-bottom: 4rem; }
.lede { font-size: 1.075rem; color: var(--muted); max-width: 46rem; margin-bottom: 1.25rem; }
.eyebrow { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
main > section + section { margin-top: 2.5rem; }

/* notice strip */
.banner { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }
.banner .wrap { padding-top: 0.4rem; padding-bottom: 0.4rem; display: flex; gap: 0.6rem; align-items: baseline; }
.banner strong { flex: none; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border-radius: 4px; padding: 0.05rem 0.4rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 2rem; min-height: 3.75rem; padding-top: 0.4rem; padding-bottom: 0.4rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 700; letter-spacing: -0.01em; color: var(--fg); text-decoration: none; }
.brand svg { width: 1.6rem; height: 1.6rem; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0.15rem; }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.92rem; font-weight: 500; padding: 0.35rem 0.7rem; border-radius: var(--radius-sm); }
.nav a:hover { color: var(--fg); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.theme-toggle { margin-left: auto; display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; background: none;
  border: 1px solid var(--line); color: var(--fg); border-radius: var(--radius-sm); cursor: pointer; padding: 0; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; }
@media (max-width: 760px) {
  .site-header { position: static; }
  .site-header .wrap { gap: 0.4rem 0.75rem; }
  .nav { order: 3; width: 100%; margin: 0 -0.7rem; }
}

/* footer */
.footer { border-top: 1px solid var(--line); margin-top: 2rem; padding: 1.5rem 0 2rem; font-size: 0.85rem; color: var(--muted); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.footer nav { display: flex; gap: 1rem; }
.footer a { color: var(--muted); }

/* ---------- badges and signals: text first, colour second ---------- */
.badge { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em; line-height: 1.6;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent); background: color-mix(in srgb, currentColor 9%, transparent);
  border-radius: 5px; padding: 0 0.45rem; white-space: nowrap; }
.badge.tier, .badge.tag { color: var(--muted); font-family: var(--mono); font-weight: 500; }
.badge.conf-High { color: var(--c-high); }
.badge.conf-Medium { color: var(--c-medium); }
.badge.conf-Low { color: var(--c-low); }
.badge.conf-Unknown { color: var(--c-unknown); border: 1px dashed currentColor; background: none; }
.badge.shadow-tag { color: var(--structural); border-style: dashed; }
.sig { font-weight: 600; white-space: nowrap; }
.sig-documented-harm { color: var(--harm); }
.sig-screening-flag { color: var(--flag); }
.sig-structural { color: var(--structural); }
.sig-no-known-evidence { color: var(--none); }
.cov { font-size: 0.8rem; white-space: nowrap; color: var(--muted); }
.cov-not-covered { font-weight: 700; color: var(--fg); }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-size: 0.82rem; margin: 0.75rem 0 1rem; color: var(--muted); }
.cell-gap { border: 1.5px dashed var(--gap-line); border-radius: var(--radius-sm); }

/* ---------- controls ---------- */
.picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 1.25rem; }
.picker button { font: inherit; font-weight: 600; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.55rem 0.95rem; cursor: pointer; text-align: left; min-width: 6.5rem; box-shadow: var(--shadow); transition: border-color 0.12s, background 0.12s; }
.picker button:hover { border-color: var(--line-strong); }
.picker button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.picker .pt { display: block; font-size: 0.72rem; font-weight: 500; color: var(--muted); text-transform: capitalize; }
.picker-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); margin: 0; }
.use-toggle { display: inline-flex; flex-wrap: wrap; gap: 0.2rem; padding: 0.2rem; margin: 0.25rem 0 0.75rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.use-toggle button { font: inherit; font-size: 0.85rem; font-weight: 500; background: none; color: var(--muted); border: 0; border-radius: 5px; padding: 0.3rem 0.75rem; cursor: pointer; }
.use-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }
.chain-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; margin: 0.5rem 0; font-size: 0.9rem; }
.chain-controls label { color: var(--muted); font-weight: 500; }
.chain-controls select { font: inherit; font-size: 0.88rem; color: var(--fg); margin-left: 0.4rem; padding: 0.35rem 0.5rem; max-width: 22rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.chain-controls .check { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--fg); }
.chain-controls input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--accent); }
.open-detail { font: inherit; font-size: 0.8rem; font-weight: 500; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; justify-self: start; }
.open-detail:hover { text-decoration: underline; }

/* ---------- tables ---------- */
.table-scroll { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface-2); font-size: 0.78rem; font-weight: 600; color: var(--muted); }
tbody th { font-weight: 600; background: var(--surface); }
tbody tr:last-child > * { border-bottom: 0; }
.table-scroll tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.75rem; margin: 1rem 0 1.5rem; }
.kpi { padding: 1rem 1.15rem; }
.kpi .num { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-bottom: 0.3rem; }
.kpi .lab { font-size: 0.85rem; color: var(--muted); line-height: 1.4; }
@media (max-width: 640px) { .kpis { grid-template-columns: 1fr 1fr; gap: 0.5rem; } .kpi .num { font-size: 1.4rem; } .kpi { padding: 0.75rem; } }

/* ---------- home hero (passports page) ---------- */
.hero { padding: 0.5rem 0 1.5rem; }
.hero h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); max-width: 40rem; }
.hero .lede { font-size: 1.125rem; }
.hero .kpi.alert .num { color: var(--harm); }

/* ---------- scorecard ---------- */
.scorecard th[scope="row"] { min-width: 7rem; }
.scorecard td, .scorecard th { padding: 0.45rem 0.4rem; }
.cell-btn { all: unset; display: block; width: 100%; min-width: 6.4rem; cursor: pointer; border-radius: var(--radius-sm); padding: 0.45rem; box-sizing: border-box; }
.cell-btn:hover { background: var(--surface-2); }
.cell-btn:focus-visible { outline: 2px solid var(--accent); }
.cell-btn .sig { display: block; font-size: 0.85rem; }
.cell-btn .cats { display: block; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); margin: 0.2rem 0; }
.cell-btn .meta { display: block; font-size: 0.74rem; color: var(--muted); }
.cell-btn .meta.nc { color: var(--fg); font-weight: 700; }
.cell-empty { color: var(--muted); font-size: 0.78rem; }
td.selected { background: var(--accent-soft); }

/* ---------- risk lists and panels ---------- */
.panel { margin-top: 1.25rem; }
.risk-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; }
.risk-list li { border-left: 3px solid var(--line-strong); padding: 0.15rem 0 0.15rem 0.85rem; }
.risk-list li.documented-harm { border-left-color: var(--harm); }
.risk-list li.screening-flag { border-left-color: var(--flag); }
.risk-list li.structural { border-left-color: var(--structural); }
.risk-list .chips { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin: 0.25rem 0; }
.sources { font-size: 0.83rem; margin: 0.3rem 0 0; padding-left: 1.1rem; }
.sources li { margin-bottom: 0.15rem; }
.flag-label { font-size: 0.8rem; font-style: italic; color: var(--muted); }

/* ---------- passport ---------- */
.passport-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 900px) { .passport-layout { grid-template-columns: minmax(0, 1fr); } }
.passport { padding: 1.5rem; }
.passport-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1rem; }
.passport-head h2 { font-size: 1.4rem; }
.stamp { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 0.1rem 0.45rem; align-self: flex-end; }
.passport-foot { border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1rem; }
.qr { margin: 0; display: flex; align-items: center; gap: 1rem; }
.qr a { flex: none; }
.qr svg { width: 5.5rem; height: 5.5rem; display: block; background: #fff; border-radius: 4px; padding: 2px; border: 1px solid var(--line); }
.qr figcaption { font-size: 0.8rem; color: var(--muted); line-height: 1.45; max-width: 26rem; }
.qr figcaption strong { display: block; color: var(--fg); font-size: 0.85rem; }
.field-group h3 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1.5rem 0 0.25rem; }
.field { display: grid; grid-template-columns: 2.6rem minmax(0, 13rem) minmax(0, 1fr); gap: 0.25rem 0.9rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.field .no { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); padding-top: 0.15rem; }
.field .label { font-weight: 600; font-size: 0.92rem; }
.field .label > div { margin-top: 0.2rem; }
.field .vals { display: grid; gap: 0.35rem; }
.field .val .chips { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin-top: 0.2rem; }
.field .conflict-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.5rem; }
.field .conflict-row .val { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.4rem 0.55rem; }
.val.superseded { opacity: 0.7; text-decoration: line-through; }
.field.deferred .vals, .field.empty .vals { border: 1.5px dashed var(--gap-line); border-radius: var(--radius-sm); padding: 0.45rem 0.65rem; background: var(--surface-2); }
.field .note { font-size: 0.8rem; color: var(--muted); }
@media (max-width: 640px) { .field { grid-template-columns: 2.2rem minmax(0, 1fr); } .field .vals { grid-column: 1 / -1; } .passport { padding: 1rem; } }
.shadow-panel { position: sticky; top: 4.75rem; border-top: 3px solid var(--harm); }
@media (max-width: 900px) { .shadow-panel { position: static; } }
.shadow-panel h2 { margin-top: 0; font-size: 1.1rem; }
.shadow-panel h3 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 1.25rem 0 0.5rem; }
.shadow-panel ul { padding-left: 1.1rem; margin: 0.25rem 0 0.75rem; font-size: 0.9rem; }
.shadow-panel li { margin-bottom: 0.45rem; }
.scope { border-left: 3px solid var(--c-high); background: var(--surface-2); padding: 0.65rem 0.85rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 0.75rem; display: grid; gap: 0.3rem; }
.scope .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.scope-likely, .scope-unclear { border-left-color: var(--c-medium); }
.scope-out-of-scope { border-left-color: var(--c-low); }
details summary { cursor: pointer; color: var(--muted); }

/* ---------- detail dialog ---------- */
dialog.detail { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--fg); padding: 0;
  width: min(44rem, 100vw - 2rem); max-height: calc(100vh - 2rem); margin: 1rem 1rem 1rem auto; box-shadow: var(--shadow-lg); }
dialog.detail::backdrop { background: rgba(15, 23, 42, 0.45); }
.detail-inner { padding: 1.25rem 1.5rem 1.75rem; }
.detail-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.detail-head h2 { margin-top: 0; }
.detail-close { font: inherit; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--fg); cursor: pointer; width: 2rem; height: 2rem; }
.detail-close:hover { background: var(--surface-2); }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin: 0.75rem 0 1rem; }
.tabs [role="tab"] { font: inherit; font-size: 0.92rem; font-weight: 500; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 0.5rem 0.75rem; cursor: pointer; margin-bottom: -1px; }
.tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.detail h4 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; }
.detail .val { margin-bottom: 0.6rem; }
.detail .val .chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.2rem; }
.detail .conflict-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.5rem; }
.detail .conflict-row .val { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.45rem 0.6rem; }
@media (max-width: 640px) { dialog.detail { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; margin: 0; border-radius: 0; } }

/* ---------- supply-chain explorer ---------- */
.chain { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.chain-edges { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.chain-edges .edge { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.chain-edges .edge.conf-Low, .chain-edges .edge.conf-Unknown { stroke-dasharray: 4 4; stroke: var(--gap-line); }
.chain-edges .edge.dim { opacity: 0.2; }
.chain-edges .edge.ov-ownership, .chain-edges .edge.ov-capital { stroke: var(--accent); stroke-width: 2; }
.chain-edges .edge.ov-capital { stroke-dasharray: 6 3; }
.chain-cols { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.75rem; }
.chain-cols.with-own { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1.4rem; }
.col { display: flex; flex-direction: column; gap: 0.6rem; }
.own-col { border-left: 1px dashed var(--line-strong); padding-left: 0.6rem; }
.col-head { font-size: 0.8rem; font-weight: 700; margin: 0 0 0.35rem; font-family: var(--mono); color: var(--accent); }
.col-head span, .list-head span { display: block; font-family: var(--font); font-weight: 500; font-size: 0.74rem; color: var(--muted); }
.node { font: inherit; text-align: left; background: var(--surface); color: var(--fg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem; cursor: pointer; display: grid; gap: 0.2rem; width: 100%; box-shadow: var(--shadow); transition: opacity 0.15s, border-color 0.12s; }
.node:hover { border-color: var(--accent); }
.node.gap { border-style: dashed; border-color: var(--gap-line); background: var(--surface-2); box-shadow: none; }
.node.dim { opacity: 0.3; }
.node.pol-hit { border-color: var(--flag); box-shadow: 0 0 0 2px color-mix(in srgb, var(--flag) 45%, transparent); }
.node-name { font-size: 0.8rem; font-weight: 600; line-height: 1.3; }
.node-meta { font-size: 0.7rem; color: var(--muted); }
.node-badge { font-size: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.15rem 0.4rem; align-items: baseline; }
.node-cats { font-family: var(--mono); font-size: 0.64rem; color: var(--muted); }
.node-own { font-size: 0.7rem; color: var(--accent); border-top: 1px solid var(--line); padding-top: 0.25rem; margin-top: 0.1rem; }
.node-pol { font-size: 0.7rem; color: var(--fg); border-top: 1px solid var(--line); padding-top: 0.25rem; margin-top: 0.1rem; }
.node-pol strong { color: var(--flag); }
.node-pol .asof { color: var(--muted); white-space: nowrap; }
.legend-own { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--accent); }
.legend-own line { stroke: var(--accent); stroke-width: 2; }
.legend-own .lg-cap { stroke-dasharray: 6 3; }
.chain-list { display: none; }
.list-head { font-size: 1rem; margin: 1.5rem 0 0.5rem; }
.list-item { margin-bottom: 0.6rem; }
.edge-text { font-size: 0.8rem; color: var(--muted); padding: 0.2rem 0 0 0.75rem; }
@media (max-width: 899px) { .chain { display: none; } .chain-list { display: block; } .node-name { font-size: 0.9rem; } }
@media (prefers-reduced-motion: reduce) { .node, .picker button { transition: none; } }

/* ---------- compare ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 1.5rem; }
.toc a { font-size: 0.82rem; font-weight: 500; text-decoration: none; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem; }
.toc a:hover { color: var(--accent); border-color: var(--accent); }
.bar { display: block; position: relative; background: var(--surface-2); border-radius: 4px; height: 1.35rem; min-width: 6rem; overflow: hidden; }
.bar::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.bar span { position: relative; padding-left: 0.4rem; font-weight: 700; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.depth { font-size: 0.76rem; font-weight: 600; padding: 0 0.45rem; border-radius: 5px; white-space: nowrap;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent); background: color-mix(in srgb, currentColor 9%, transparent); }
.depth-Entity { color: var(--c-high); }
.depth-Country { color: var(--c-medium); }
.depth-Low { color: var(--c-low); }
.depth-Gap { color: var(--c-unknown); border: 1px dashed currentColor; background: none; }
.scope-cell { font-weight: 600; }
.scope-cell.scope-out-of-scope { color: var(--c-low); }
#t-minerals td { text-align: center; }
.mcell { white-space: nowrap; }
.mcell .sig { font-size: 1.05rem; text-decoration: none; }
.mcell.nc, .nc-key { background: color-mix(in srgb, var(--harm) 10%, transparent); }
.nc-key { padding: 0 0.3rem; border-radius: 4px; }

/* ---------- prose pages (methods, about) ---------- */
.prose > * { max-width: 48rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }
.prose h3 { margin-top: 1.5rem; }
.prose .table-scroll { margin: 0.5rem 0 1rem; }
.steps li { margin-bottom: 0.7rem; }
dl.pages { margin: 0.5rem 0; }
dl.pages dt { font-weight: 650; margin-top: 0.9rem; }
dl.pages dd { margin: 0.15rem 0 0; color: var(--muted); }
.read-list { list-style: none; padding-left: 0 !important; }
.read-list li { margin-bottom: 0.7rem; }
.read-list .badge, .read-list .sig { margin-right: 0.15rem; }

/* ---------- small screens and print ---------- */
@media (max-width: 640px) { h1 { font-size: 1.6rem; } main.wrap { padding-top: 1.25rem; } }
@media print { .site-header, .theme-toggle, .banner { display: none; } body { background: #fff; } }
.legend-note { font-size: 0.82rem; color: var(--muted); margin: -0.5rem 0 1rem; }
/* ---------- passport card: government / regulatory record style ---------- */
.gp { padding: 1.75rem 2rem 1.5rem; border-radius: 0; border-top: 5px solid var(--accent); }
.gp-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding-bottom: 0.9rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
.gp-tag { display: inline-block; background: var(--accent); color: var(--accent-fg); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.15rem 0.5rem; }
.gp-caption { display: block; color: var(--muted); font-size: 1rem; margin-bottom: 0.25rem; }
.gp-title { font-size: 2rem; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 0.75rem; }
.gp-lead { font-size: 1.1rem; max-width: 42rem; margin-bottom: 1.25rem; }
.gp-h { font-size: 1.3rem; font-weight: 700; margin: 2rem 0 0.5rem; }
.gp-summary { margin: 0; }
.gp-row { display: grid; grid-template-columns: minmax(0, 32%) minmax(0, 1fr) auto; gap: 0.25rem 1.25rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line-strong); }
.gp-compact .gp-row { grid-template-columns: minmax(0, 32%) minmax(0, 1fr); padding: 0.55rem 0; }
.gp-summary .gp-row:first-child { border-top: 1px solid var(--line-strong); }
.gp-key { font-weight: 700; }
.gp-no { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); margin-top: 0.1rem; }
.gp-value { margin: 0; min-width: 0; }
.gp-val + .gp-val { margin-top: 0.5rem; }
.gp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-top: 0.25rem; font-size: 0.82rem; color: var(--muted); }
.gp-secondary, .gp-note { color: var(--muted); }
.gp-note { font-size: 0.88rem; margin: 0.35rem 0 0; }
.gp-blank { color: var(--muted); margin: 0; }
.gp-inset { border-left: 5px solid var(--line-strong); padding: 0.35rem 0 0.35rem 1rem; margin: 0.5rem 0 0; font-size: 0.92rem; }
.gp-inset-item { margin-top: 0.35rem; }
.gp-scope { margin: 1rem 0 0; display: grid; gap: 0.3rem; }
.gp-scope.scope-in-scope { border-left-color: var(--c-high); }
.gp-scope .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.gp-actions { margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; }
.gp-link { font: inherit; font-size: 0.95rem; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.gp-link:hover { text-decoration-thickness: 2px; }
.gp-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gp-choices button { font: inherit; font-size: 0.95rem; background: var(--surface-2); color: var(--fg); border: 0; border-radius: 0; box-shadow: 0 2px 0 var(--line-strong); padding: 0.45rem 0.9rem; cursor: pointer; }
.gp-choices button:hover { background: var(--line); }
.gp-choices button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); box-shadow: 0 2px 0 var(--fg); }
.gp .conflict-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.5rem; }
.gp .conflict-row .gp-val { border: 1px solid var(--line); padding: 0.4rem 0.55rem; margin: 0; }
.gp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line-strong); }
.gp-bin { margin: 0; display: flex; align-items: center; gap: 0.6rem; color: var(--fg); }
.gp-bin svg { width: 1.8rem; height: 2.2rem; flex: none; }
.gp-bin figcaption { font-size: 0.8rem; color: var(--muted); max-width: 11rem; line-height: 1.35; }
@media (max-width: 640px) {
  .gp { padding: 1.25rem 1rem; }
  .gp-title { font-size: 1.6rem; }
  .gp-row, .gp-compact .gp-row { grid-template-columns: minmax(0, 1fr); }
  .gp-actions { flex-direction: row; align-items: center; justify-content: flex-start; gap: 0.75rem; }
}
