/* POIBench — shared styles (dark, monospace) */
:root {
  --bg: #050607;
  --panel: #0b0d0f;
  --panel-2: #101316;
  --line: #1c2125;
  --line-2: #2a3136;
  --text: #e6e9ea;
  --muted: #8b9397;
  --dim: #5b6368;
  --cyan: #4fe3cf;
  --lime: #bdf35a;
  --warn: #f2b84b;
  --err: #ff6b6b;
  /* data-source colors: validated categorical palette for the dark surface (CVD-checked) */
  --ove: #3280de;
  --sf: #e3622e;
  --fsq: #12a878;
  --osm: #bb59bd;
  --font: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--cyan); color: #000; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; border-bottom: 1px solid transparent;
  background: linear-gradient(var(--bg), rgba(5, 6, 7, 0));
}
.nav.solid { background: var(--bg); border-bottom-color: var(--line); }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.brand .cursor { color: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 28px; align-items: center; color: var(--muted); font-size: 13px; }
.nav-links a:hover { color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 10px 18px; border: 1px solid var(--line-2); background: transparent;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--text); }
.btn.primary { border-color: var(--cyan); color: var(--cyan); }
.btn.primary:hover { background: var(--cyan); color: #000; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.active { border-color: var(--cyan); color: var(--cyan); }

/* ---------- landing ---------- */
.hero { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
#globe { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
#globe:active { cursor: grabbing; }
.hero-corner { position: absolute; z-index: 2; pointer-events: none; }
.hero-corner.tl { top: 104px; left: 48px; }
.hero-corner.tr { top: 96px; right: 48px; text-align: right; }
.hero-corner.bl { bottom: 56px; left: 48px; pointer-events: auto; }
.hero-corner.br { bottom: 56px; right: 48px; text-align: right; color: var(--muted); font-size: 12px; }
.kicker { font-size: 22px; line-height: 1.25; }
.kicker b { font-weight: 700; }
.big-num { font-size: 96px; line-height: .9; font-weight: 400; }
.big-num + div { font-size: 28px; }
.title { font-size: clamp(56px, 9vw, 128px); line-height: .95; margin: 0 0 18px; font-weight: 400; letter-spacing: -.01em; }
.title b { font-weight: 700; }
.tagline { max-width: 560px; color: var(--muted); font-size: 15px; margin: 0 0 28px; }
.cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hover-label {
  position: absolute; z-index: 3; pointer-events: none; padding: 4px 8px; font-size: 12px;
  background: rgba(5, 6, 7, .85); border: 1px solid var(--line-2); display: none; white-space: nowrap;
}

.section { padding: 96px 48px; border-top: 1px solid var(--line); }
.section h2 { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 40px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); }
.stat { padding: 28px 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat .v { font-size: 40px; line-height: 1; }
.stat .k { color: var(--muted); font-size: 12px; margin-top: 10px; }
.grad { background: linear-gradient(90deg, var(--cyan), var(--lime)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.module { background: var(--bg); padding: 28px; min-height: 210px; display: flex; flex-direction: column; gap: 12px; }
.module .id { color: var(--dim); font-size: 12px; }
.module h3 { margin: 0; font-size: 20px; font-weight: 700; }
.module p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.tag { align-self: flex-start; font-size: 11px; padding: 2px 8px; border: 1px solid var(--line-2); color: var(--muted); }
.tag.live { border-color: var(--cyan); color: var(--cyan); }

.flow { display: flex; align-items: center; gap: 0; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.flow span { padding: 10px 16px; border: 1px solid var(--line-2); }
.flow i { font-style: normal; padding: 0 10px; color: var(--dim); }

.footer { padding: 40px 48px 56px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* ---------- configure (M1) ---------- */
.app { position: fixed; inset: 64px 0 0 0; display: grid; grid-template-columns: 440px 1fr; }
.side { border-right: 1px solid var(--line); overflow-y: auto; background: var(--bg); display: flex; flex-direction: column; }
.side-head { padding: 24px 28px 8px; }
.side-head .crumb { color: var(--dim); font-size: 12px; }
.side-head h1 { font-size: 22px; margin: 6px 0 0; font-weight: 700; }
.step { padding: 22px 28px; border-top: 1px solid var(--line); }
.step-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.step-h .n { color: var(--cyan); font-size: 12px; }
.step-h .t { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.step-h .s { margin-left: auto; font-size: 11px; color: var(--dim); }
.hint { color: var(--dim); font-size: 12px; margin: 8px 0 0; }

.seg { display: flex; border: 1px solid var(--line-2); margin-bottom: 14px; }
.seg button { flex: 1; padding: 8px 6px; background: none; border: none; border-right: 1px solid var(--line-2); cursor: pointer; color: var(--muted); font-size: 12px; }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--text); color: #000; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
select, input[type="text"], input[type="number"] {
  width: 100%; color: var(--text); padding: 9px 10px; background: var(--panel); border: 1px solid var(--line-2); outline: none; border-radius: 0;
}
select:focus, input:focus { border-color: var(--cyan); }

.row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.row .sw { width: 10px; height: 10px; flex: none; }
.row .name { flex: 1; }
.row .num { color: var(--muted); font-size: 12px; }
.check { appearance: none; width: 14px; height: 14px; border: 1px solid var(--line-2); margin: 0; cursor: pointer; flex: none; display: grid; place-content: center; }
.check:checked { border-color: var(--cyan); background: var(--cyan); }
.check:checked::after { content: ""; width: 6px; height: 6px; background: #000; }
.check:disabled { opacity: .5; cursor: default; }

.cats { display: grid; grid-template-columns: 1fr; gap: 0; }
.cat { display: grid; grid-template-columns: 14px 1fr 56px; gap: 10px; align-items: center; padding: 5px 0; font-size: 12px; cursor: pointer; }
.cat .bar { grid-column: 2 / 4; height: 2px; background: var(--line); margin-top: -2px; }
.cat .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--lime)); }
.cat .num { text-align: right; color: var(--muted); }
.cat.off .label, .cat.off .num { color: var(--dim); }
.cat.off .bar i { background: var(--line-2); }
.links { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.links a { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.links a:hover { color: var(--text); }

.drop { display: block; border: 1px dashed var(--line-2); padding: 14px; font-size: 12px; color: var(--muted); cursor: pointer; text-align: center; margin-bottom: 10px; }
.drop:hover { border-color: var(--cyan); color: var(--text); }
.drop input { display: none; }
.filecheck { font-size: 12px; margin: -4px 0 12px; }
.filecheck .ok { color: var(--cyan); }
.filecheck .bad { color: var(--err); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; font-size: 12px; }
.kv .k { color: var(--dim); }

.side-foot { margin-top: auto; padding: 20px 28px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; position: sticky; bottom: 0; background: var(--bg); }
.side-foot .status { font-size: 12px; color: var(--muted); flex: 1; }

.mapwrap { position: relative; }
#map { position: absolute; inset: 0; background: #0a0c0e; }
.map-tools { position: absolute; top: 16px; left: 16px; z-index: 5; display: flex; gap: 8px; }
.map-tools .btn { background: rgba(5, 6, 7, .9); }
.legend { position: absolute; top: 16px; right: 16px; z-index: 5; background: rgba(5, 6, 7, .9); border: 1px solid var(--line-2); padding: 12px 14px; font-size: 12px; min-width: 210px; }
.legend .row { padding: 3px 0; }
.legend .line { width: 18px; height: 0; border-top: 2px solid var(--cyan); flex: none; }
.legend .line.dash { border-top-style: dashed; border-color: var(--lime); }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(189, 243, 90, .25); flex: none; }
.terminal {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 5; max-height: 30%;
  background: rgba(5, 6, 7, .94); border: 1px solid var(--line-2); display: flex; flex-direction: column;
}
.terminal .bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); cursor: pointer; }
.terminal pre { margin: 0; padding: 12px 14px; overflow: auto; font-size: 12px; color: var(--text); }
.terminal pre .k { color: var(--cyan); }
.terminal pre .s { color: var(--lime); }
.terminal pre .n { color: var(--warn); }
.terminal.min pre { display: none; }
.maplibregl-ctrl-attrib { background: rgba(5, 6, 7, .7) !important; color: var(--dim) !important; font-family: var(--font); font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .modules { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 60vh; position: static; padding-top: 64px; }
  .hero-corner.tr { display: none; }
  .section, .footer { padding-left: 20px; padding-right: 20px; }
  .hero-corner.tl, .hero-corner.bl { left: 20px; }
}

/* ---------- landing: POI card + schema ---------- */
.poi-card {
  position: absolute; z-index: 3; pointer-events: none; display: none; width: 240px;
  background: rgba(5, 6, 7, .9); border: 1px solid var(--line-2); padding: 10px 12px; font-size: 11px;
}
.poi-card .c-id { color: var(--dim); }
.poi-card .c-name { font-size: 13px; font-weight: 700; margin: 2px 0 6px; color: var(--text); }
.poi-card .c-row { display: grid; grid-template-columns: 72px 1fr; color: var(--text); }
.poi-card .c-row span { color: var(--dim); }
.schema { border: 1px solid var(--line); }
.schema-row { display: grid; grid-template-columns: 160px 140px 140px 1fr; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 13px; }
.schema-row:first-child { border-top: none; }
.schema-row.head { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.schema-row span:first-child { color: var(--cyan); }
.schema-row .req { color: var(--text); }
.schema-row .opt { color: var(--muted); }
.schema-row i { color: var(--dim); font-style: normal; }
.note { color: var(--muted); font-size: 12px; margin: 18px 0 0; }
.note a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.schema { overflow-x: auto; }
@media (max-width: 960px) { .schema-row { grid-template-columns: 110px 100px 100px minmax(200px, 1fr); gap: 8px; min-width: 560px; } }

/* ---------- configure: demo notice ---------- */
.notice { border: 1px solid var(--line-2); padding: 10px 12px; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.notice b { color: var(--text); font-weight: 400; }
[hidden] { display: none !important; }
.hint a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.hint a:hover { color: var(--text); }

.bbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bbox-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--dim); }
.bbox-grid input { width: 100%; box-sizing: border-box; color: var(--text); font-size: 12px; -moz-appearance: textfield; }
.bbox-grid input::-webkit-inner-spin-button, .bbox-grid input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bb-handle { width: 12px; height: 12px; background: var(--bg); border: 2px solid var(--cyan); cursor: nwse-resize; box-sizing: border-box; }
.bb-handle.ne, .bb-handle.sw { cursor: nesw-resize; }

/* ---------- match (M2) ---------- */
a.ul, .ul { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
a.ul:hover { color: var(--text); }
.adv { margin-top: 12px; font-size: 12px; }
.adv summary { cursor: pointer; color: var(--muted); list-style: none; }
.adv summary::before { content: "+ "; color: var(--cyan); }
.adv[open] summary::before { content: "– "; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.trio label, .mini { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--dim); }
.trio input, .mini input { font-size: 12px; }
.hint.warn { color: var(--warn); }
.seg.small button { padding: 6px; font-size: 11px; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline .mini { flex: 1; }
.mainwrap { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.tabs button { background: none; border: none; border-right: 1px solid var(--line); padding: 12px 22px; cursor: pointer; color: var(--muted); font-size: 12px; position: relative; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--cyan); }
.tabs button .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); margin-left: 8px; vertical-align: middle; }
.view { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; padding: 24px 28px; overflow: hidden; }
.view.scroll { overflow-y: auto; display: block; }
.idle { color: var(--muted); }
.diagram { font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 18px 20px; margin: 0 0 14px; overflow-x: auto; background: var(--panel); }
.pipe-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 16px; }
#steps { display: flex; flex-direction: column; border: 1px solid var(--line); }
#steps:empty { display: none; }
.st { display: grid; grid-template-columns: 22px 230px 1fr 280px; gap: 14px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 12px; }
.st:first-child { border-top: none; }
.st .ic { color: var(--dim); text-align: center; }
.st.running .ic { color: var(--cyan); animation: blink 1s steps(1) infinite; }
.st.done .ic { color: var(--cyan); }
.st.failed .ic { color: var(--err); }
.st .lb { font-weight: 700; display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.st .lb .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.st .sub { color: var(--dim); font-weight: 400; font-size: 11px; flex-basis: 100%; padding-left: 18px; }
.st .meter { height: 4px; background: var(--line); position: relative; }
.st .meter i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--cyan), var(--lime)); }
.st .nums { color: var(--muted); text-align: right; font-size: 11px; }
.st .nums b { color: var(--text); font-weight: 400; }
.logbox { margin-top: 16px; border: 1px solid var(--line); flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.logbox .bar { padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 11px; color: var(--dim); }
.logbox pre { margin: 0; padding: 10px 12px; font-size: 11px; color: var(--muted); overflow: auto; flex: 1; white-space: pre-wrap; }
.logbox pre .e { color: var(--err); }
#v-label { padding: 0; }
.labeler { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.lmap { position: relative; flex: 1; min-height: 200px; }
.pair { flex: none; border-top: 1px solid var(--line); padding: 16px 24px 18px; background: var(--bg); }
.pair-top { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.pair-top #pair-n { color: var(--text); }
.pbar { flex: 1; height: 3px; background: var(--line); }
.pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--lime)); }
.pair-cols { display: grid; grid-template-columns: 1fr 1fr 220px; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.pc { background: var(--bg); padding: 12px 14px; font-size: 12px; min-width: 0; }
.pc-h { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.pc-name { font-size: 16px; font-weight: 700; margin: 4px 0 8px; overflow-wrap: anywhere; }
.pc-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 1px 0; }
.pc-row span { color: var(--dim); }
.pc-row b { font-weight: 400; overflow-wrap: anywhere; }
.feats .pc-row { grid-template-columns: 1fr auto; }
.pair-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.btn.lab { padding: 10px 18px; }
.btn.lab.yes { border-color: var(--cyan); color: var(--cyan); }
.btn.lab.no { border-color: var(--err); color: var(--err); }
.btn.lab.yes.sel { background: var(--cyan); color: #000; }
.btn.lab.no.sel { background: var(--err); color: #000; }
.btn.lab.skip.sel { background: var(--muted); color: #000; }
kbd { font-family: inherit; font-size: 10px; border: 1px solid currentColor; padding: 0 4px; opacity: .8; }
.pmark { display: flex; align-items: center; gap: 6px; pointer-events: none; }
.pmark i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #000; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); flex: none; }
.pmark span { font-size: 11px; background: rgba(5, 6, 7, .85); border: 1px solid var(--line-2); padding: 1px 6px; white-space: nowrap; }
/* model + results */
.card { border: 1px solid var(--line); margin-bottom: 18px; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.card-h b { color: var(--text); font-size: 14px; }
.card-b { padding: 14px 16px; }
table.t { width: 100%; border-collapse: collapse; font-size: 12px; }
table.t th { text-align: right; color: var(--dim); font-weight: 400; padding: 6px 10px; border-bottom: 1px solid var(--line); }
table.t td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--line); }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t tr:last-child td { border-bottom: none; }
table.t td.best { color: var(--cyan); }
.verdict { padding: 12px 14px; border: 1px solid var(--line-2); font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.verdict b { color: var(--text); font-weight: 400; }
.hbars .hb { display: grid; grid-template-columns: 140px 1fr 60px; gap: 10px; align-items: center; font-size: 12px; padding: 3px 0; }
.hbars .hb i { display: block; height: 6px; background: linear-gradient(90deg, var(--cyan), var(--lime)); }
.hbars .hb span:last-child { text-align: right; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 18px; }
.kpi { background: var(--bg); padding: 16px; }
.kpi .v { font-size: 26px; line-height: 1.1; }
.kpi .k { font-size: 11px; color: var(--dim); margin-top: 6px; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; }
.stack { display: flex; height: 14px; margin: 6px 0 8px; }
.stack i { display: block; height: 100%; }
.stack-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.stack-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: var(--c); }
.hist { display: flex; align-items: flex-end; gap: 2px; height: 70px; position: relative; margin-top: 8px; border-bottom: 1px solid var(--line-2); }
.hist i { flex: 1; background: var(--line-2); min-height: 1px; }
.hist i.acc { background: var(--cyan); }
.hist-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--dim); margin-top: 4px; }
.downloads { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 1200px) { .st { grid-template-columns: 22px 1fr 160px; } .st .nums { grid-column: 2 / 4; text-align: left; } .pair-cols { grid-template-columns: 1fr 1fr; } .feats { grid-column: 1 / 3; } }
.inline.btns { align-items: center; }
a.btn, button.btn { line-height: 1.4; }
a.btn[aria-disabled="true"] { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ---------- assess (M3) ---------- */
.report { overflow-y: auto; min-width: 0; padding: 28px 36px 80px; }
#content { max-width: 1240px; }
.rep-head { margin-bottom: 26px; }
.rep-head h2 { font-size: 22px; margin: 6px 0 6px; font-weight: 700; letter-spacing: .01em; }
.sec { padding: 22px 0 8px; border-top: 1px solid var(--line); scroll-margin-top: 8px; }
.sec + .sec { margin-top: 10px; }
.sec-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sec-h .n { color: var(--cyan); font-size: 12px; }
.sec-h h3 { margin: 0; font-size: 16px; text-transform: uppercase; letter-spacing: .06em; }
.sec-h.sub h3 { font-size: 13px; color: var(--muted); }
.sec-h .formula { margin-left: auto; font-size: 12px; color: var(--muted); border: 1px solid var(--line); padding: 3px 10px; }
.sec-h .inline-seg { margin: 0 0 0 auto; }
.sec-h .inline-seg button { padding: 5px 12px; }
.sec-p { color: var(--muted); font-size: 12px; max-width: 860px; margin: 0 0 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid2:empty { display: none; }
.viz .card-h { align-items: center; gap: 16px; flex-wrap: wrap; }
.viz .card-h > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.card-sub { font-size: 11px; color: var(--dim); }
.card-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.legend-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.lg-i { display: inline-flex; align-items: center; gap: 6px; }
.lg-box { display: inline-block; width: 12px; height: 8px; border-radius: 2px; }
.sw-svg { flex: none; vertical-align: middle; }
.linkbtn { background: none; border: 1px solid var(--line-2); color: var(--muted); font-size: 11px; padding: 3px 9px; cursor: pointer; }
.linkbtn:hover { color: var(--text); border-color: var(--text); }
.card-b { overflow: hidden; }
.card-note { margin: 0; padding: 0 16px 14px; }
svg.chart { display: block; overflow: visible; font-family: var(--font); }
svg.chart .tk { font-size: 10.5px; fill: var(--muted); }
svg.chart .tk.dim { fill: var(--dim); }
svg.chart .lb { font-size: 12px; fill: var(--text); }
svg.chart .val { font-size: 12.5px; fill: var(--text); font-weight: 700; }
svg.chart .val.sm { font-size: 11.5px; font-weight: 400; }
.tbl-wrap { overflow-x: auto; }
table.t.score td, table.t.score th { white-space: nowrap; }
table.t td.dim { color: var(--dim); }
.barcell b { display: inline-block; min-width: 54px; }
table.t.score td:nth-child(2), table.t.score th:nth-child(2) { text-align: left; }
table.t.score td:nth-child(2) .sw-svg { margin-right: 4px; }
.mini { display: inline-block; vertical-align: middle; margin-right: 10px; width: 90px; height: 6px; background: var(--line); border-radius: 0 3px 3px 0; overflow: hidden; }
.mini i { display: block; height: 100%; border-radius: 0 3px 3px 0; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: rgba(11, 13, 15, .97); border: 1px solid var(--line-2); padding: 9px 11px; font-size: 11.5px; min-width: 190px; max-width: 360px; }
.tip-t { color: var(--muted); margin-bottom: 6px; }
.tip-r { display: grid; grid-template-columns: 12px auto 1fr; gap: 8px; align-items: center; padding: 1px 0; }
.tip-r b { color: var(--text); font-weight: 700; white-space: nowrap; }
.tip-l { color: var(--muted); }
.tip-k { width: 12px; height: 2px; }
.tip-f { color: var(--dim); margin-top: 6px; border-top: 1px solid var(--line); padding-top: 5px; }
.toc { display: flex; flex-direction: column; font-size: 12px; }
.toc a { color: var(--muted); padding: 4px 0 4px 10px; border-left: 2px solid transparent; cursor: pointer; }
.toc a b { color: var(--cyan); font-weight: 400; margin-right: 6px; }
.toc a.sub { padding-left: 34px; font-size: 11px; color: var(--dim); }
.toc a:hover, .toc a.on { color: var(--text); }
.toc a.on { border-left-color: var(--cyan); }
.src-row { cursor: pointer; }
.src-row .num { min-width: 52px; text-align: right; }
.side .downloads .btn { font-size: 11px; padding: 4px 8px; }
@media (max-width: 1300px) { .grid2 { grid-template-columns: 1fr; } }
.sec-h .inline-seg button { white-space: nowrap; }

/* ---------- explore (M4) ---------- */
.map-tools.right { left: auto; right: 16px; }
.map-tools .seg { margin: 0; background: rgba(5, 6, 7, .9); }
.legend.bl { top: auto; right: auto; bottom: 28px; left: 16px; min-width: 230px; }
.lg-title { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.lg-note { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px !important; }
.dot-sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; box-sizing: border-box; }
.ramp { height: 8px; border-radius: 4px; margin: 2px 0 4px; }
.ramp-ax { display: flex; justify-content: space-between; font-size: 10px; color: var(--dim); margin-bottom: 6px; }
.map-note { position: absolute; z-index: 5; bottom: 28px; left: 50%; transform: translateX(-50%); background: rgba(5, 6, 7, .85); border: 1px solid var(--line-2); padding: 5px 12px; font-size: 11px; color: var(--muted); pointer-events: none; }
.src-row.on .name { color: var(--text); font-weight: 700; }
.check.round { border-radius: 50%; }
.check.round:checked::after { border-radius: 50%; }
.range2 { position: relative; height: 22px; }
.range2 input { position: absolute; left: 0; right: 0; width: 100%; top: 4px; pointer-events: none; appearance: none; background: none; margin: 0; }
.range2 input::-webkit-slider-thumb { pointer-events: auto; appearance: none; width: 12px; height: 12px; background: var(--cyan); border: 0; cursor: pointer; }
.range2 input::-moz-range-thumb { pointer-events: auto; width: 12px; height: 12px; background: var(--cyan); border: 0; border-radius: 0; cursor: pointer; }
.range2::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--line-2); }
.review { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); }
.review.hint { border: none; }
.rv { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; text-align: left; background: none; border: none; border-bottom: 1px solid var(--line); padding: 7px 10px; cursor: pointer; color: var(--text); font-size: 11px; }
.rv:hover { background: var(--panel-2); }
.rv-p { font-weight: 700; font-size: 12px; }
.rv-t { display: flex; flex-direction: column; min-width: 0; }
.rv-t b { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-t span { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-pop .maplibregl-popup-content { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 0; padding: 12px 14px; font-family: var(--font); font-size: 12px; }
.pb-pop .maplibregl-popup-tip { border-top-color: var(--line-2); border-bottom-color: var(--line-2); }
.pb-pop .maplibregl-popup-close-button { color: var(--muted); font-size: 16px; padding: 2px 6px; }
.pp-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; padding-right: 14px; }
.pp-badge { border: 1px solid; padding: 0 6px; font-size: 11px; }
.pp-h { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; margin-top: 8px; }
.pp-n { font-weight: 700; margin: 2px 0 4px; font-size: 13px; }
.pp-r { display: grid; grid-template-columns: 70px 1fr; gap: 6px; }
.pp-r span { color: var(--dim); }
.pp-f { display: flex; gap: 10px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.pp-a { display: inline-block; margin-top: 8px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.mt-logo { position: absolute; z-index: 5; right: 12px; bottom: 34px; display: block; line-height: 0; }

/* ---------- M5 interpretation ---------- */
.m5-box { border: 1px solid var(--line-2); }
.m5-box textarea { width: 100%; box-sizing: border-box; background: var(--panel); color: var(--text); border: none; padding: 12px 14px; font-family: var(--font); font-size: 13px; resize: vertical; outline: none; }
.m5-bar { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; border-top: 1px solid var(--line); }
.m5-bar .hint { flex: 1; margin: 0; }
.m5-ans { border: 1px solid var(--line); margin-top: 16px; }
.m5-ans .card-h { gap: 12px; }
.m5-ans .q { color: var(--muted); font-size: 12px; }
.m5-ans .md { padding: 14px 16px; font-size: 13px; line-height: 1.65; max-width: 900px; }
.m5-ans .md p { margin: 0 0 10px; }
.m5-ans .md ul { margin: 0 0 10px; padding-left: 20px; }
.m5-ans .md li { margin: 3px 0; }
.m5-ans .md b { color: var(--text); }
.m5-ans .foot { padding: 0 16px 12px; font-size: 11px; color: var(--dim); }
.m5-ans .card-h > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.examples { display: flex; flex-direction: column; gap: 6px; }
.ex { text-align: left; background: none; border: 1px solid var(--line); color: var(--muted); font-size: 11px; padding: 7px 10px; cursor: pointer; line-height: 1.45; }
.ex:hover { border-color: var(--line-2); color: var(--text); }
.reads { margin: 0; padding-left: 18px; font-size: 12px; color: var(--text); }
.reads li { margin: 3px 0; }
#m5-out .m5-ans:first-child { margin-top: 0; }

/* M6 deliver */
.preview { position: relative; min-width: 0; background: var(--bg); }
.preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #525659; }
.preview .ph { padding: 28px 36px; max-width: 640px; }
.preview .ph h2 { margin: 6px 0 16px; }
.rtoc { margin: 0; padding-left: 20px; line-height: 2; }
.rtoc span { color: var(--dim); font-size: 12px; margin-left: 8px; }
.dl-list { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; }
.dl-list a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.dl-list a:hover { color: var(--text); }
.btns { display: flex; gap: 10px; margin-top: 10px; }
.row.opt { cursor: pointer; padding: 4px 0; }
a.btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }

/* ---------- landing: one screen, no scrolling ---------- */
body.landing { overflow: hidden; height: 100vh; height: 100dvh; }
.btn.ghost { border-color: transparent; color: var(--muted); padding-left: 6px; padding-right: 6px; }
.btn.ghost:hover { color: var(--text); border-color: transparent; }
.hero-corner.tl { top: calc(64px + clamp(16px, 4vh, 40px)); }
.hero-corner.tr { top: calc(64px + clamp(12px, 3vh, 32px)); }
.hero-corner.bl { bottom: clamp(20px, 6vh, 56px); max-width: min(620px, 92vw); }
.hero-corner.br { bottom: clamp(20px, 6vh, 56px); }
.title { font-size: clamp(44px, min(9vw, 13vh), 128px); }
.big-num { font-size: clamp(56px, 11vh, 96px); }

/* ---------- documentation ---------- */
body.docs-page { background: var(--bg); }
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; padding: 64px 32px 0; gap: 56px; }
.docs-toc { position: sticky; top: 64px; align-self: start; display: flex; flex-direction: column; padding: 40px 0; font-size: 13px; max-height: calc(100vh - 64px); overflow-y: auto; }
.docs-toc .crumb { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.docs-toc a { color: var(--muted); padding: 5px 0 5px 12px; border-left: 2px solid var(--line); }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.on { color: var(--text); border-left-color: var(--cyan); }
.docs-body { padding: 40px 0 120px; min-width: 0; }
.docs-body section { padding: 0 0 56px; scroll-margin-top: 88px; }
.docs-body section + section { border-top: 1px solid var(--line); padding-top: 40px; }
.docs-body .crumb { color: var(--dim); font-size: 12px; letter-spacing: .08em; }
.docs-body h1 { font-size: clamp(26px, 4vw, 36px); margin: 8px 0 18px; }
.docs-body h2 { font-size: 22px; margin: 8px 0 20px; }
.docs-body h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin: 26px 0 8px; color: var(--text); }
.docs-body p, .docs-body li { color: var(--muted); max-width: 820px; }
.docs-body p b, .docs-body li b { color: var(--text); font-weight: 400; }
.docs-body code { color: var(--text); font-size: 12px; }
.docs-body .flow { margin-bottom: 24px; }
.docs-body .module { min-height: 0; }
.formula-line { color: var(--text) !important; border: 1px solid var(--line); padding: 10px 14px; display: inline-block; font-size: 13px; overflow-x: auto; max-width: 100%; }
.schema.compact .schema-row { grid-template-columns: 200px 1fr; }
ul.plain { padding-left: 18px; margin: 10px 0 0; }
ul.plain li { margin-bottom: 8px; }
.cite { color: var(--text) !important; border-left: 2px solid var(--cyan); padding-left: 14px; }

/* ---------- responsive: navigation and app shells ---------- */
@media (max-width: 1100px) {
  .nav { padding: 0 16px; gap: 16px; }
  .nav-links { gap: 18px; font-size: 12px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; min-width: 0; }
  .nav-links::-webkit-scrollbar { display: none; }
  .app { grid-template-columns: 360px 1fr; }
  .side-head, .step, .side-foot { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 960px) {
  .brand { flex: none; }
  .docs { grid-template-columns: 1fr; padding: 64px 20px 0; gap: 0; }
  .docs-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; padding: 24px 0 0; max-height: none; }
  .docs-toc .crumb { flex-basis: 100%; margin-bottom: 4px; }
  .docs-toc a { border-left: none; padding: 2px 0; }
  .schema.compact .schema-row { grid-template-columns: 160px 1fr; min-width: 0; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto; position: static; padding-top: 64px; }
  .app > .mapwrap, .app > .preview { height: 70vh; height: 70dvh; min-height: 360px; border-top: 1px solid var(--line); }
  .app > .mainwrap { min-height: 80vh; border-top: 1px solid var(--line); }
  .app > .report { overflow: visible; padding: 24px 20px 60px; border-top: 1px solid var(--line); }
  .side { border-right: none; overflow: visible; }
  .side-foot { position: sticky; bottom: 0; z-index: 4; }
  .src-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .pair-cols { grid-template-columns: 1fr; }
  .feats { grid-column: auto; }
  .st { grid-template-columns: 22px 1fr; }
  .st .meter, .st .nums { grid-column: 2; }
  .legend { min-width: 0; max-width: calc(100% - 32px); }
}
@media (max-width: 600px) {
  .nav-links .btn.small { padding: 5px 8px; }
  .brand { font-size: 16px; }
  .hero-corner.tl, .hero-corner.tr { display: none; }
  .hero-corner.bl { left: 16px; right: 16px; }
  .tagline { font-size: 13px; margin-bottom: 18px; }
  .cta .btn { padding: 8px 12px; font-size: 13px; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: 1px solid var(--line); }
  .schema.compact .schema-row { grid-template-columns: 1fr; min-width: 0; padding: 10px 14px; }
  .schema.compact .schema-row.head { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .trio { grid-template-columns: 1fr; }
  .report, .view { padding-left: 16px; padding-right: 16px; }
}
/* short screens (landscape phones, small laptops) */
@media (max-height: 620px) {
  .hero-corner.tl, .hero-corner.tr { display: none; }
  .tagline { display: none; }
}
@media (max-height: 760px) and (min-width: 601px) {
  .tagline { font-size: 13px; margin-bottom: 16px; }
}
/* landing credits: bottom right on wide screens, a full-width strip under the buttons otherwise */
.credits { pointer-events: auto; font-size: 11.5px; line-height: 1.7; color: var(--dim); padding: 8px 0 0 16px;
  background: radial-gradient(closest-side, rgba(5, 6, 7, .85), rgba(5, 6, 7, 0)); }
.credits a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.credits a:hover { color: var(--text); text-decoration-color: currentColor; }
@media (max-width: 1100px), (max-height: 620px) {
  .hero-corner.bl { bottom: calc(clamp(12px, 3vh, 24px) + 92px); }
  .hero-corner.credits { left: 48px; right: 48px; bottom: clamp(12px, 3vh, 24px); text-align: left; font-size: 10.5px; line-height: 1.6; }
}
@media (max-width: 960px) { .hero-corner.credits { left: 20px; right: 20px; } }
@media (max-width: 600px) {
  .hero-corner.credits { left: 16px; right: 16px; }
  .hero-corner.bl { bottom: calc(clamp(12px, 3vh, 24px) + 88px); }
}
@media (max-width: 1100px) {
  .nav-links { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
}
@media (max-width: 600px) {
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs button { padding: 12px 14px; white-space: nowrap; flex: none; }
}
/* stat tiles: five in a row, the number scales with the row width so it always fits */
.stats-wrap { container-type: inline-size; }
.stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.stat { min-width: 0; padding: 24px 20px; background: var(--bg); border: none !important; }
.stat .v { font-size: clamp(24px, 3.4cqi, 38px); white-space: nowrap; letter-spacing: -.02em; }
@container (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:last-child { grid-column: 1 / -1; }
  .stat .v { font-size: clamp(26px, 7cqi, 38px); }
}

/* landing top right: rotating feature, mixed type sizes */
.hero-corner.tr { width: min(300px, 24vw); text-shadow: 0 0 12px var(--bg), 0 0 4px var(--bg); }
.feat { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.feat .f-pre { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.feat .f-big { font-size: clamp(20px, min(2.2vw, 3.8vh), 34px); line-height: 1.1; white-space: nowrap; font-weight: 700; letter-spacing: -.02em;
  background: linear-gradient(90deg, var(--cyan), var(--lime)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.feat .f-post { font-size: 11px; color: var(--muted); max-width: 260px; text-align: right; }
.feat.in > * { animation: featIn .6s cubic-bezier(.2, .7, .2, 1) both; }
.feat.in .f-big { animation-delay: .06s; }
.feat.in .f-post { animation-delay: .14s; }
@keyframes featIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.feat-dots { display: flex; gap: 5px; justify-content: flex-end; margin-top: 8px; }
.feat-dots i { width: 10px; height: 2px; background: var(--line-2); transition: background .3s, width .3s; }
.feat-dots i.on { background: var(--cyan); width: 20px; }
@media (prefers-reduced-motion: reduce) { .feat.in > * { animation: none; } }
