/* Terrane — technical report atlas
   Layout: full-bleed instrument panel. A fixed top bar, one view at a time, dense tabular data with a 3D stage.
   Dark-first (a field screen at night); light theme mirrors the same tokens. */
:root {
  color-scheme: dark;
  --bg: #0b0f14;            /* basalt */
  --bg-2: #11171f;          /* panel */
  --bg-3: #171f29;          /* raised panel */
  --line: #253040;          /* hairline */
  --line-2: #314052;
  --fg: #e8ecf1;            /* chalk */
  --fg-2: #a9b4c2;          /* secondary ink */
  --fg-3: #6f7c8c;          /* muted ink */
  --accent: #d9893b;        /* native copper */
  --accent-2: #f0b35a;      /* oxidised rim */
  --accent-ink: #10110f;
  --good: #3fb27f;
  --warn: #e0a429;
  --bad: #e2645e;
  --info: #5aa6e0;
  --flag: #e0a429;
  /* categorical commodity slots — fixed order (validated dark steps) */
  --c-ni: #3987e5; --c-cu: #d95926; --c-li: #199e70; --c-au: #c98500; --c-ree: #d55181; --c-u: #008300; --c-graphite: #9085e9; --c-other: #e66767;
  --font-display: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 6px;
  --shadow: 0 8px 30px rgba(0,0,0,.45);
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f5f3ee; --bg-2: #ffffff; --bg-3: #edeae2; --line: #d9d4c8; --line-2: #c6c0b2;
    --fg: #17202a; --fg-2: #4b5665; --fg-3: #7d8896; --accent: #b86a22; --accent-2: #d28a3b; --accent-ink: #ffffff;
    --good: #1f8a5a; --warn: #a97300; --bad: #c43f3a; --info: #2a78d6; --flag: #a97300;
    --c-ni: #2a78d6; --c-cu: #eb6834; --c-li: #1baf7a; --c-au: #eda100; --c-ree: #e87ba4; --c-u: #008300; --c-graphite: #6250d6; --c-other: #e34948;
    --shadow: 0 8px 30px rgba(40,30,10,.12);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f3ee; --bg-2: #ffffff; --bg-3: #edeae2; --line: #d9d4c8; --line-2: #c6c0b2;
  --fg: #17202a; --fg-2: #4b5665; --fg-3: #7d8896; --accent: #b86a22; --accent-2: #d28a3b; --accent-ink: #ffffff;
  --good: #1f8a5a; --warn: #a97300; --bad: #c43f3a; --info: #2a78d6; --flag: #a97300;
  --c-ni: #2a78d6; --c-cu: #eb6834; --c-li: #1baf7a; --c-au: #eda100; --c-ree: #e87ba4; --c-u: #008300; --c-graphite: #6250d6; --c-other: #e34948;
  --shadow: 0 8px 30px rgba(40,30,10,.12);
}

html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg-2); }
* { box-sizing: border-box; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
h1 { font-size: 1.7rem; line-height: 1.15; }
h2 { font-size: 1.15rem; line-height: 1.25; }
h3 { font-size: 0.95rem; }
.mono, .num, td.num, .kpi .v, .cell-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-2); }
.faint { color: var(--fg-3); }
.small { font-size: 12px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); font-weight: 600; }
.hint { font-size: 12px; color: var(--fg-3); }

/* top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; display: flex; align-items: center; gap: 14px; height: 52px; padding-left: var(--gutter-l); padding-right: var(--gutter-r); background: var(--bg-2); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .01em; color: var(--fg); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(from 200deg, var(--accent) 0 40%, var(--bg-3) 40% 100%); box-shadow: inset 0 0 0 2px var(--bg-2), 0 0 0 1px var(--line-2); }
.brand .tag { font: 500 11px/1 var(--font-mono); color: var(--fg-3); letter-spacing: .06em; margin-left: 2px; }
nav.views { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
nav.views::-webkit-scrollbar { display: none; }
nav.views a { padding: 8px 10px; border-radius: 4px; color: var(--fg-2); font-weight: 500; white-space: nowrap; }
nav.views a.active { color: var(--fg); background: var(--bg-3); }
nav.views a:hover { text-decoration: none; color: var(--fg); }
.search { margin-left: auto; position: relative; min-width: 0; flex: 0 1 300px; }
.search input { width: 100%; height: 32px; padding: 0 10px 0 30px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--bg); color: var(--fg); }
.search input::placeholder { color: var(--fg-3); }
.search svg { position: absolute; left: 10px; top: 9px; width: 14px; height: 14px; fill: none; stroke: var(--fg-3); stroke-width: 2; }
.search .results { position: absolute; top: 36px; right: 0; width: min(420px, 90vw); max-height: 60vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 70; }
.search .results a { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; color: var(--fg); border-bottom: 1px solid var(--line); }
.search .results a:hover { background: var(--bg-3); text-decoration: none; }
.search .results .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); min-width: 54px; }

main { padding-left: var(--gutter-l); padding-right: var(--gutter-r); padding-block: 18px 40px; min-width: 0; }
main.full { padding: 0; }
.page { max-width: 1320px; margin: 0 auto; min-width: 0; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 16px; }
.head p { margin: 4px 0 0; color: var(--fg-2); max-width: 70ch; }

/* chips, pills, badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: 12px; color: var(--fg-2); line-height: 1.3; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); flex: none; }
.chip.on { border-color: var(--accent); color: var(--fg); background: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); }
.chip.btn { cursor: pointer; }
.chip.btn:hover { border-color: var(--fg-3); color: var(--fg); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 4px; font: 600 11px/1.5 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; background: var(--bg-3); color: var(--fg-2); }
.pill.stage-pea, .pill.stage-pfs, .pill.stage-fs { background: color-mix(in srgb, var(--accent) 22%, var(--bg-3)); color: var(--fg); }
.pill.stage-production, .pill.stage-construction { background: color-mix(in srgb, var(--good) 22%, var(--bg-3)); color: var(--fg); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px dashed var(--line-2); color: var(--fg-3); vertical-align: middle; }
.badge.flag { border-color: var(--flag); color: var(--flag); border-style: dashed; }
.badge.inferred { border-color: var(--info); color: var(--info); }
.badge.stated { border-color: var(--good); color: var(--good); border-style: solid; }
.badge.pending { border-color: var(--line-2); color: var(--fg-3); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }

/* layout helpers */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid > * { min-width: 0; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.panel h2, .panel h3 { margin-bottom: 10px; }
.panel .sub { margin: -6px 0 10px; color: var(--fg-3); font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.kpi { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.kpi .l { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-3); display: flex; justify-content: space-between; gap: 6px; }
.kpi .v { font-size: 22px; line-height: 1.1; margin-top: 4px; color: var(--fg); overflow-wrap: anywhere; }
.kpi .v small { font-size: 12px; color: var(--fg-2); font-family: var(--font-body); margin-left: 4px; }
.kpi .s { font-size: 12px; color: var(--fg-2); margin-top: 3px; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
table.data th { position: sticky; top: 0; background: var(--bg-3); color: var(--fg-2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; user-select: none; z-index: 1; }
table.data th.sorted { color: var(--fg); }
table.data th .arrow { color: var(--accent-2); margin-left: 3px; }
table.data td.num, table.data th.num { text-align: right; }
table.data tr:hover td { background: color-mix(in srgb, var(--bg-3) 60%, transparent); }
table.data td.wrap { white-space: normal; min-width: 180px; }
table.data td a.name { color: var(--fg); font-weight: 600; }
table.data .bar { display: inline-block; height: 8px; background: var(--accent); border-radius: 2px; vertical-align: middle; margin-right: 6px; opacity: .85; }
table.data tbody tr.sel td { background: color-mix(in srgb, var(--accent) 10%, var(--bg-2)); }
.empty { padding: 24px; text-align: center; color: var(--fg-3); }
.dash { color: var(--fg-3); }

/* filter rail */
.rail { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; margin-bottom: 14px; }
.rail .group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rail .group .eyebrow { margin-right: 4px; }
select.ctl, input.ctl { height: 30px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-2); color: var(--fg); padding: 0 8px; }
.btn { height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg-2); color: var(--fg); font-weight: 500; }
.btn:hover { border-color: var(--fg-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.on { background: var(--bg-3); border-color: var(--accent); }

/* globe view */
.globe-wrap { position: relative; height: calc(100vh - 52px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); min-height: 520px; overflow: hidden; background: radial-gradient(ellipse at 50% 60%, #121a24 0%, var(--bg) 70%); }
:root[data-theme="light"] .globe-wrap { background: radial-gradient(ellipse at 50% 60%, #e9e4d8 0%, var(--bg) 70%); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .globe-wrap { background: radial-gradient(ellipse at 50% 60%, #e9e4d8 0%, var(--bg) 70%); } }
.globe-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.overlay { position: absolute; z-index: 5; }
.overlay.tl { top: 14px; left: var(--gutter-l); right: var(--gutter-r); display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.overlay.tl > * { pointer-events: auto; }
.filterbox { background: color-mix(in srgb, var(--bg-2) 86%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; max-width: 100%; }
.filterbox .eyebrow { margin-bottom: 6px; }
.filterbox .row { gap: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--fg-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.overlay.br { right: var(--gutter-r); bottom: 14px; display: flex; gap: 8px; }
.overlay.bl { left: var(--gutter-l); bottom: 14px; max-width: min(360px, 60vw); font-size: 12px; color: var(--fg-3); }
.globe-list { position: absolute; z-index: 5; top: 14px; right: var(--gutter-r); width: 320px; max-height: calc(100% - 28px); display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.globe-list header { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.globe-list .items { overflow: auto; }
.globe-list .item { display: block; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--fg); }
.globe-list .item:hover, .globe-list .item.hot { background: var(--bg-3); text-decoration: none; }
.globe-list .item .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.globe-list .item .m { font-size: 12px; color: var(--fg-2); display: flex; gap: 8px; flex-wrap: wrap; }
.tip { position: absolute; z-index: 9; pointer-events: none; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 9px; font-size: 12px; box-shadow: var(--shadow); max-width: 260px; }
.tip b { display: block; font-size: 13px; }
.overlay.br { flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - var(--gutter-l) - var(--gutter-r)); }
.overlay.br .toggles .btn.on, .btn.on { border-color: var(--accent); color: var(--fg); background: color-mix(in srgb, var(--accent) 22%, var(--bg-2)); }
@media (max-width: 860px) {
  .globe-wrap { min-height: 0; height: calc(100dvh - 52px - env(safe-area-inset-top, 0px)); }
  .overlay.tl { max-height: calc(100% - 70px); overflow: auto; }
  .globe-list { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-height: 48%; border-radius: 10px 10px 0 0; }
  .globe-wrap.list-open .overlay.br { display: none; }
  .overlay.bl { display: none; }
}
/* full screen: native (desktop, Android) or the immersive fallback (iPhone) */
.globe-wrap:fullscreen, .stage:fullscreen { height: 100vh; max-height: none; border-radius: 0; background: var(--bg); }
body.immersive .topbar { display: none; }
body.immersive #view.full .globe-wrap { position: fixed; inset: 0; height: 100vh; height: 100dvh; min-height: 0; z-index: 60; }
.stage.immersive-stage { position: fixed; inset: 0; z-index: 60; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }

/* property page */
.prop-head { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 16px; }
.prop-head .title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.prop-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--fg-2); align-items: center; }
.subnav { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { padding: 8px 10px; white-space: nowrap; color: var(--fg-2); border-bottom: 2px solid transparent; font-weight: 500; }
.subnav a:hover { text-decoration: none; color: var(--fg); }
.subnav a.active { color: var(--fg); border-color: var(--accent); }
section.block { margin-bottom: 22px; scroll-margin-top: 70px; }
section.block > h2 { margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
section.block > h2 .hint { font-weight: 400; }

/* 3D stage */
.stage { position: relative; height: 520px; max-height: 70vh; min-height: 360px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, #0e141b 0%, #0a0e13 100%); }
:root[data-theme="light"] .stage { background: linear-gradient(180deg, #e6e1d6 0%, #d8d2c4 100%); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .stage { background: linear-gradient(180deg, #e6e1d6 0%, #d8d2c4 100%); } }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage .hud { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.stage .hud > * { pointer-events: auto; }
.stage .hud select, .stage .hud .btn { height: 26px; font-size: 12px; background: color-mix(in srgb, var(--bg-2) 86%, transparent); }
.stage .scalebar { position: absolute; left: 12px; bottom: 12px; font: 11px var(--font-mono); color: var(--fg-2); }
.stage .scalebar i { display: block; height: 2px; background: var(--fg-2); margin-bottom: 3px; }
.stage .compass { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; }
.stage .legend-ramp { position: absolute; right: 12px; top: 46px; width: 150px; background: color-mix(in srgb, var(--bg-2) 86%, transparent); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; font-size: 11px; color: var(--fg-2); }
.stage .legend-ramp .ramp { height: 8px; border-radius: 2px; margin: 4px 0; }
.stage .legend-ramp .ends { display: flex; justify-content: space-between; font-family: var(--font-mono); }
.stage .stage-tip { position: absolute; pointer-events: none; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 9px; font-size: 12px; box-shadow: var(--shadow); z-index: 4; max-width: 260px; }
.stage .empty-stage { position: absolute; inset: 0; display: grid; place-items: center; color: var(--fg-2); text-align: center; padding: 20px; }
.holelist { max-height: 520px; overflow: auto; }
.stage .stage-label { position: absolute; z-index: 3; pointer-events: none; font-size: 11px; line-height: 1.35; color: var(--info); background: color-mix(in srgb, var(--bg-2) 80%, transparent); border: 1px dashed var(--info); border-radius: 4px; padding: 4px 7px; max-width: 230px; }
.stage .stage-label span { color: var(--fg-2); }
.stage .model-panel { position: absolute; left: 10px; right: 10px; bottom: 34px; z-index: 4; background: color-mix(in srgb, var(--bg-2) 90%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 12px; max-height: 42%; overflow: auto; }
.stage .model-panel .ctl { height: 24px; font-size: 12px; padding: 0 6px; }
.stage .model-panel .btn.sm { height: 22px; font-size: 11px; }
@media (max-width: 700px) { .stage .model-panel { bottom: 30px; max-height: 55%; } .stage .legend-ramp { top: auto; bottom: 64px; width: 120px; } }

/* property page as Form 43-101F1 Items */
.itemnav-wrap { margin-bottom: 18px; }
.strip.itemnav a { display: block; height: 26px; border-radius: 3px; background: var(--bg-3); color: var(--fg); font: 600 10px var(--font-mono); text-align: center; line-height: 26px; }
.strip.itemnav a.p { background: var(--accent); color: var(--bg); }
.strip.itemnav a.a { background: var(--bad); opacity: .75; color: #fff; }
.strip.itemnav a.na { background: var(--bg-3); background-image: repeating-linear-gradient(45deg, transparent 0 3px, var(--line-2) 3px 4px); color: var(--fg-3); }
.strip.itemnav a:hover { text-decoration: none; filter: brightness(1.15); }
@media (max-width: 700px) { .strip.itemnav { grid-template-columns: repeat(9, 1fr); } .strip.itemnav a { height: 30px; line-height: 30px; font-size: 11px; } }
section.block.item > h2 .itemno { font: 600 11px var(--font-mono); color: var(--fg-3); letter-spacing: .04em; margin-right: 2px; align-self: center; }
section.block.item.na { opacity: .62; }
section.block.item.na > h2 { font-size: 15px; margin-bottom: 4px; }
.excerpt { white-space: pre-wrap; font-size: 13px; line-height: 1.55; color: var(--fg-2); max-width: 90ch; }
.excerpt.clamp { max-height: 7.8em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
.excerpt-panel { margin-top: 10px; }
.panel.rpeee { border-left: 3px solid var(--good); }
.disc { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.disc i { font: 500 10px var(--font-mono); font-style: normal; padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--fg-3); white-space: nowrap; }
.disc i.ok { border-color: var(--good); color: var(--good); }
.disc i.no { border-color: var(--bad); color: var(--bad); border-style: dashed; }
.disc i.na { opacity: .45; }
.chip.on { border-color: var(--good); color: var(--fg); }
.btn[disabled] { opacity: .55; cursor: wait; }

/* coverage strip (27 items) */
.strip { display: grid; grid-template-columns: repeat(27, 1fr); gap: 2px; }
.strip i { display: block; height: 14px; border-radius: 2px; background: var(--bg-3); position: relative; }
.strip i.p { background: var(--accent); }
.strip i.a { background: var(--bad); opacity: .7; }
.strip i.na { background: var(--bg-3); background-image: repeating-linear-gradient(45deg, transparent 0 3px, var(--line-2) 3px 4px); }
.strip i.thin { opacity: .45; }
.strip.lg i { height: 22px; }
.strip-labels { display: grid; grid-template-columns: repeat(27, 1fr); gap: 2px; font: 9px var(--font-mono); color: var(--fg-3); text-align: center; margin-top: 2px; }

/* quality gauge */
.gauge { display: flex; align-items: center; gap: 12px; }
.gauge svg { width: 64px; height: 64px; flex: none; }
.gauge .n { font: 600 22px var(--font-mono); }
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; font-size: 12px; }
.bars .track { height: 6px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.bars .track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bars .track i.pending { background: repeating-linear-gradient(45deg, var(--line-2) 0 3px, transparent 3px 6px); width: 100% !important; }

/* charts */
.chart { width: 100%; height: auto; display: block; font-family: var(--font-body); }
.chart text { fill: var(--fg-2); font-size: 11px; }
.chart .axis line, .chart .axis path { stroke: var(--line-2); }
.chart .grid line { stroke: var(--line); }
.chart .lab { fill: var(--fg); font-size: 11px; }
.chart .mark:hover { opacity: .8; }
.chart-tip { position: fixed; pointer-events: none; z-index: 80; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 5px 8px; font-size: 12px; box-shadow: var(--shadow); }

/* timeline */
.timeline { position: relative; padding-left: 18px; border-left: 2px solid var(--line-2); display: grid; gap: 10px; }
.timeline .ev { position: relative; }
.timeline .ev::before { content: ""; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--fg-3); border: 2px solid var(--bg); }
.timeline .ev.drill_results::before { background: var(--accent); }
.timeline .ev.resource_update::before, .timeline .ev.first_economics::before, .timeline .ev.feasibility_study::before { background: var(--info); }
.timeline .ev.permit_milestone::before { background: var(--good); }
.timeline .ev.ownership_change::before { background: var(--c-ree); }
.timeline .ev.document::before { background: var(--fg-2); }
.timeline .d { font: 12px var(--font-mono); color: var(--fg-3); }
.timeline .t { color: var(--fg); }

/* facts list */
.facts { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: 6px 14px; font-size: 13px; }
.facts dt { color: var(--fg-3); }
.facts dd { margin: 0; color: var(--fg); min-width: 0; overflow-wrap: anywhere; }
.facts dd .src { font-size: 11px; margin-left: 6px; }

/* QP cards */
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.card .nm { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card .nm a { color: var(--fg); }
.card .ln { font-size: 12px; color: var(--fg-2); margin-top: 2px; overflow-wrap: anywhere; }
.card .mini { margin-top: 8px; }
.quote { font-size: 12px; color: var(--fg-2); border-left: 2px solid var(--line-2); padding-left: 8px; margin: 6px 0 0; overflow-wrap: anywhere; }
details.more > summary { cursor: pointer; color: var(--accent-2); font-size: 12px; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }

/* notices */
.notice { border: 1px solid var(--line-2); border-left: 3px solid var(--info); border-radius: 4px; padding: 8px 12px; font-size: 13px; color: var(--fg-2); background: var(--bg-2); }
.notice.flag { border-left-color: var(--flag); }
.notice.bad { border-left-color: var(--bad); }
.notice.good { border-left-color: var(--good); }
.sev { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.sev.high { background: var(--bad); } .sev.medium { background: var(--warn); } .sev.info { background: var(--info); } .sev.low { background: var(--fg-3); }

/* mini map */
.minimap { width: 100%; height: auto; display: block; border-radius: 4px; background: var(--bg-3); }

/* loading */
.loading { display: grid; place-items: center; height: 60vh; color: var(--fg-2); gap: 10px; }
.loading .spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading .spin { animation: none; } }

.footer { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.inline-list { display: inline; }
kbd { font: 11px var(--font-mono); border: 1px solid var(--line-2); border-radius: 3px; padding: 0 4px; color: var(--fg-2); }
.sparkbar { display: inline-block; height: 6px; background: var(--accent); border-radius: 2px; vertical-align: middle; }
.two { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .two { grid-template-columns: 2fr 1fr; } .two.even { grid-template-columns: 1fr 1fr; } }
.scroll-x { overflow-x: auto; }

/* v0.3 — quote-verified values */
.badge.stated.q { cursor: pointer; }
.badge.stated.q:hover, .badge.stated.q:focus-visible { background: color-mix(in srgb, var(--good) 16%, transparent); }
.quote-pop { position: fixed; z-index: 90; width: min(340px, calc(100vw - 16px)); max-height: 50vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--good); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; line-height: 1.5; color: var(--fg); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.chip { max-width: 100%; }
.chip.wrapok, .ownership .chip, .prop-head .chip, section.block .chip, .kpi .chip { white-space: normal; }
.search input { min-width: 0; }
h4 { font-family: var(--font-display); font-weight: 600; font-size: 0.85rem; color: var(--fg-2); }
table.data tr.tot td { font-weight: 600; color: var(--fg); }
table.data tr.base td { background: color-mix(in srgb, var(--accent) 9%, var(--bg-2)); }
table.data td.zero { color: var(--fg); font-weight: 600; }
.pipeline-wrap { margin-bottom: 14px; }
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; }
.pipeline .stage-cell { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); color: var(--fg); text-align: left; min-width: 0; }
.pipeline .stage-cell:hover { border-color: var(--fg-3); }
.pipeline .stage-cell.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-2)); }
.pipeline .stage-cell .n { font: 600 20px/1 var(--font-mono); }
.pipeline .stage-cell .l { font-size: 11px; color: var(--fg-2); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pipeline .stage-cell .fill { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.review-note ul { list-style: disc; }
.cert-card .facts, .bm-card .facts { grid-template-columns: minmax(96px, 130px) 1fr; font-size: 12px; }
.rpeee-quote { font-size: 13px; }
@media (max-width: 560px) {
  .facts, .cert-card .facts, .bm-card .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dt { margin-top: 6px; }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .head .row .ctl { flex: 1 1 140px; min-width: 0; }
}
@media (max-width: 560px) {
  .topbar { gap: 10px; }
  .brand .tag { display: none; }
  .search { flex: 0 0 104px; }
  nav.views { flex: 1 1 auto; min-width: 0; }
  .search input { padding-right: 6px; }
}
.chart.spider { max-width: 760px; }
/* KPI label + badge: the badge wraps under a long label instead of overlapping it */
.kpi .l { flex-wrap: wrap; align-items: center; row-gap: 3px; column-gap: 6px; }
.kpi .l .lt { min-width: 0; overflow-wrap: anywhere; }
.kpi .l .badge { flex: none; margin-left: auto; font-size: 10px; padding: 0 5px; letter-spacing: 0; text-transform: none; }
.none-stated { white-space: normal; }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 14px; }
.rank-grid .panel.rank h3 { margin: 0 0 2px; }
.refresh-note a { white-space: nowrap; }
