:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --ink: #0f1c2e;
  --ink-soft: #5b6b7f;
  --line: #e1e8f0;
  --brand: #0b63b8;
  --brand-700: #084a8c;
  --accent: #00a3a3;
  --amber: #b7791f;
  --green: #1f8a4c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 28, 46, .05), 0 6px 20px rgba(16, 28, 46, .06);
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
body { font-family: var(--sans); margin: 0; color: var(--ink); background: var(--bg); }

.accent-bar { height: 4px; background: linear-gradient(90deg, var(--brand), var(--accent)); }

/* ---- header ---- */
header { position: relative; background: var(--panel); border-bottom: 1px solid var(--line); padding: 14px 88px 0 24px;
  position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 0 rgba(16, 28, 46, .03); }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-logo { position: absolute; top: 10px; right: 24px; width: 46px; height: 46px;
  object-fit: contain; }
.wordmark { font-size: 24px; font-weight: 700; letter-spacing: 2px; color: var(--ink); }
.subtitle { font-size: 11px; color: var(--ink-soft); letter-spacing: .3px; margin-top: 2px; }
.site-footer { display: flex; justify-content: center; gap: 16px; align-items: center;
  padding: 18px 24px 28px; font-family: var(--sans); font-size: 11.5px; color: var(--ink-soft); }
.site-footer a { color: var(--ink-soft); text-decoration: underline; }
.site-footer a:hover { color: var(--brand); }

/* Google sign-in state (per-user BigQuery) */
.auth-state { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; }
.auth-email { font-family: var(--mono); font-size: 11px; color: var(--ink-soft);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-btn { font-family: var(--sans); font-size: 11.5px; cursor: pointer; border-radius: 6px;
  padding: 3px 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.auth-btn:hover { border-color: var(--brand); color: var(--brand); }
.auth-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.auth-btn.primary:hover { background: var(--brand-700); color: #fff; }
.auth-privacy { font-family: var(--sans); font-size: 11px; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 2px; }
.auth-privacy:hover { color: var(--brand); }
.auth-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(12px);
  z-index: 200; max-width: 460px; background: #23303f; color: #fff; font-family: var(--sans);
  font-size: 12.5px; line-height: 1.4; padding: 10px 14px; border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.28); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; }
.auth-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.budget { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); margin-top: 4px;
  background: #eef2f7; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; display: inline-block; }
.budget b { color: var(--brand); font-weight: 600; }
.budget { cursor: pointer; }
.budget:hover { border-color: var(--brand); color: var(--ink); }
.budget-wrap { position: relative; display: inline-block; }
.budget-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: 360px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 14px; }
.budget-pop-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink); margin-bottom: 10px; }
.budget-pop-head .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.budget-pop-stats { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
.budget-pop-stats .metric-v { font-size: 14px; }
.budget-pop-users { margin-top: 10px; }
.budget-pop-users:empty { display: none; }
.bu-head { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--ink-soft); margin-bottom: 6px; }
.bu-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: baseline;
  padding: 3px 0; border-top: 1px solid var(--line); font-size: 12px; }
.bu-row:first-of-type { border-top: none; }
.bu-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.bu-num { font-family: var(--mono); color: var(--ink-soft); text-align: right; }
.bu-num:last-child { color: var(--ink); }

.toolbar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field label { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-soft); font-weight: 600; }
.field input, .field select { font-family: var(--sans); font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); max-width: 190px; }
.field select { cursor: pointer; }
.field-slider { min-width: 150px; }
.field-slider label b { color: var(--brand); font-variant-numeric: tabular-nums; }
.field-slider input[type="range"] { width: 150px; height: 18px; padding: 0; margin: 2px 0;
  accent-color: var(--brand); cursor: pointer; background: transparent; }
#apply { font-family: var(--sans); font-weight: 600; font-size: 13px; padding: 7px 16px; border: none;
  border-radius: 8px; background: var(--brand); color: #fff; cursor: pointer; }
#apply:hover { background: var(--brand-700); }

nav#tabs { display: flex; gap: 4px; margin-top: 12px; }
nav#tabs button { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-soft);
  background: none; border: none; padding: 9px 14px; cursor: pointer; border-bottom: 2px solid transparent; }
nav#tabs button:hover { color: var(--ink); }
nav#tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---- layout ---- */
main { padding: 22px 24px 40px; }
.blurb, .caption { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 18px; max-width: 1000px; }
.blurb { max-width: none; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; color: var(--ink); }
.muted { color: var(--ink-soft); font-size: 12px; font-family: var(--mono); }

.bottom-row { display: flex; gap: 20px; }
.bottom-row .card { flex: 1; min-width: 0; margin-bottom: 0; }
.bottom-row #map, .bottom-row #entities { height: 430px; }

/* ---- table ---- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; }
#events.grid thead th { background: #f4f7fb; position: sticky; top: 0; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px; color: var(--ink-soft); white-space: nowrap;
  padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
#events.grid tbody td { font-family: var(--mono); font-size: 11.5px; padding: 7px 10px; white-space: nowrap;
  border-bottom: 1px solid #f0f3f7; color: var(--ink); }
#events.grid tbody tr:nth-child(even) { background: #fafbfd; }
#events.grid tbody tr:hover { background: #eaf2fb; cursor: pointer; }
.rownum { color: #aab4c0; }

.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 10.5px;
  font-weight: 600; font-family: var(--sans); letter-spacing: .2px; }
.b-inter { background: #fdf0d9; color: var(--amber); }
.b-intra { background: #e3effb; color: var(--brand); }
.b-source { background: #e2f3ea; color: var(--green); }
.b-fwd { background: #e3effb; color: var(--brand); }
.b-rev { background: #efe7fb; color: #6b46c1; }
.b-neutral { background: #eef1f5; color: var(--ink-soft); }

#pager { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
#pager button { font-family: var(--sans); font-size: 12px; font-weight: 500; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
#pager button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
#pager button:disabled { opacity: .4; cursor: default; }

/* ---- Temporal + Audit views (not yet carded) keep their own panel chrome ---- */
#trends, #audit-drop, #audit-rtt, #audit-ips, #audit-interdomain {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; margin-bottom: 18px; height: 360px; }

/* ---- Event Detail plots (sit inside .card) ---- */
#ev-sankey { height: 360px; }
#ts-rtt, #ts-tp, #ts-dist, #ts-loss { height: 250px; }
#dist-tp, #dist-rtt2 { height: 280px; }
#topo-during { height: 380px; margin-bottom: 12px; }
.tpath-pair { display: flex; gap: 18px; margin-bottom: 12px; }
.tpath-pair > div { flex: 1; min-width: 0; }
#tpath-usual, #tpath-day-net { height: 340px; }
.layout-toggle button { font-family: var(--sans); font-size: 11px; padding: 3px 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-soft); cursor: pointer; }
.layout-toggle button:first-child { border-radius: 6px 0 0 6px; }
.layout-toggle button:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.layout-toggle button.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.toggles { display: flex; gap: 10px; align-items: center; }

/* ---- Correlation tomography: responsible-segment panel ---- */
.tomo-wrap { display: flex; gap: 16px; align-items: stretch; }
.tomo-candidates { display: flex; flex-direction: column; gap: 6px; width: 230px; flex: none;
  max-height: 420px; overflow-y: auto; }
.tomo-cand { text-align: left; font-family: var(--sans); background: #fafbfd; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.tomo-cand:hover { border-color: var(--brand); }
.tomo-cand.active { border-color: var(--brand); background: #eaf2fb; box-shadow: inset 3px 0 0 var(--brand); }
.tomo-cand .tc-edge { font-size: 12px; font-weight: 600; color: var(--ink); }
.tomo-cand .tc-meta { font-family: var(--mono); font-size: 10.5px; color: var(--ink-soft); }
.tomo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
#tomo-focus { height: 280px; }
#tomo-evidence { border-top: 1px solid var(--line); padding-top: 10px; }
.ev-head { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.ev-head .ev-arrow { color: #d62728; margin: 0 4px; }
/* lattice zoom: click an entity to navigate its finer/coarser flagged components */
.tomo-zoom { display: flex; flex-direction: column; gap: 6px; }
.tomo-zoom:empty { display: none; }
.zoom-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.zoom-lab { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft);
  font-weight: 600; margin-right: 2px; }
.zoom-chip { font-family: var(--sans); font-size: 11.5px; color: var(--ink); background: #fafbfd;
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; cursor: pointer; }
.zoom-chip:hover { border-color: var(--brand); background: #eaf2fb; }
.zoom-chip.is-cul { border-color: #f0c98a; background: #fffaf0; }
.zoom-chip .zoom-meta { font-family: var(--mono); font-size: 10px; color: var(--ink-soft); margin-left: 6px; }
/* temporal tomography insight headline */
.tpath-insight { border-radius: 8px; padding: 10px 14px; margin: 0 0 4px; border: 1px solid var(--line); }
.tpath-insight:empty { display: none; }
.ins-reroute { background: #fdecea; border-color: #f4c7c1; }
.ins-congest { background: #fff8e1; border-color: #f0deb0; }
.ins-indet, .ins-stable { background: #f4f6f9; border-color: var(--line); }
.ins-head { font-size: 14px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ins-ico { font-size: 15px; }
.ins-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.45; }
.ins-changes { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.ins-change { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; }
.ins-verb { font-weight: 600; }
.ins-seg { font-family: var(--mono); font-size: 11.5px; color: var(--ink); }
.ins-delta { font-family: var(--mono); font-size: 11.5px; font-weight: 600; margin-left: auto; }
.ins-agree { font-size: 11px; font-weight: 600; color: var(--green); background: #e2f3ea; border-radius: 999px; padding: 1px 8px; }
.tpath-detail { margin-top: 12px; }
.tpath-detail > summary { cursor: pointer; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ink-soft); font-weight: 600; padding: 6px 0; list-style: revert; }
.tpath-detail[open] > summary { margin-bottom: 8px; }
.bd-head { display: flex; align-items: baseline; gap: 10px; }
.bd-focus { font-size: 12px; color: var(--ink); background: #f7f9fc; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; }
.bd-path { margin-top: 4px; }
.bd-path-lab { font-size: 11px; color: var(--ink-soft); margin-bottom: 5px; }
.path-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.path-pill { font-family: var(--mono); font-size: 10.5px; padding: 2px 7px; border-radius: 6px;
  background: #eef1f5; color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
.path-pill.pp-hit { background: #fdeceb; color: #c0392b; border-color: #f4c7c1; font-weight: 700; }
.path-pill.pp-grp { background: #fff3e0; color: #b35309; border-color: #f0c98a; }
.path-pill.pp-star { background: #fff; color: #aab4c0; }
.path-arrow { color: #aab4c0; font-size: 11px; }
.zoom-back { font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--brand);
  background: none; border: none; padding: 2px 0; cursor: pointer; align-self: flex-start; }
.zoom-back:hover { text-decoration: underline; }
.zoom-note { font-size: 11.5px; line-height: 1.45; color: var(--ink-soft); background: #fffdf7;
  border: 1px solid #f0d9b5; border-radius: 8px; padding: 7px 10px; }
.zoom-note code, .zoom-chip code { font-family: var(--mono); font-size: 10.5px; background: #f1f4f8;
  padding: 1px 4px; border-radius: 4px; }
/* granularity badge for the responsible entity: edge | node | AS | metro | IXP */
.gran { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; vertical-align: 1px; }
.gran-edge { background: #efe7fb; color: #6b46c1; }
.gran-node { background: #e3effb; color: var(--brand); }
.gran-AS { background: #fdf0d9; color: var(--amber); }
.gran-metro { background: #d9f2f2; color: #0f7a7a; }
.gran-IXP { background: #e2f3ea; color: var(--green); }
.gran-path_local { background: #eef1f5; color: var(--ink-soft); }
.ev-sub code, .gran + code { font-family: var(--mono); font-size: 11px; background: #f1f4f8;
  padding: 1px 5px; border-radius: 4px; color: var(--ink); }
.ev-row { margin-bottom: 10px; }
.ev-k { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft);
  font-weight: 600; margin-bottom: 3px; }
.ev-big { font-family: var(--mono); font-size: 20px; font-weight: 600; color: var(--ink); }
.ev-big .ev-unit { font-family: var(--sans); font-size: 12.5px; font-weight: 400; color: var(--ink-soft); }
.ev-bars { display: flex; flex-direction: column; gap: 4px; }
.ev-bar { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.ev-bar .ev-lab { width: 110px; flex: none; color: var(--ink-soft); }
.ev-bar .ev-track { flex: 1; height: 12px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.ev-bar .ev-fill { display: block; height: 100%; border-radius: 6px; }
.ev-bar .ev-fill.bad { background: #d62728; }
.ev-bar .ev-fill.good { background: var(--green); }
.ev-bar .ev-val { width: 120px; flex: none; font-family: var(--mono); font-size: 11px; color: var(--ink); }
.ev-sub { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.chip.warn { background: #fdf0d9; color: var(--amber); }

/* ---- geoloc flag button + modal ---- */
.flag-btn { border: none; background: none; cursor: pointer; color: #c0b3a0; font-size: 12px;
  padding: 0 3px; line-height: 1; opacity: .55; }
.flag-btn:hover { color: var(--amber); opacity: 1; }
.rownum .flag-btn { font-size: 11px; }
.modal { position: fixed; inset: 0; background: rgba(16, 28, 46, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; width: 440px; max-width: 92vw; }
.modal-head { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.flag-ctx { font-size: 12.5px; color: var(--ink-soft); font-family: var(--mono); background: #f4f7fb;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 14px; line-height: 1.5; }
.flag-ctx .flag-shown { color: var(--amber); }
.flag-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ink-soft); font-weight: 600; margin: 10px 0 4px; }
.modal-card input { width: 100%; font-family: var(--sans); font-size: 13px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.btn-primary { font-family: var(--sans); font-weight: 600; font-size: 13px; padding: 8px 16px; border: none;
  border-radius: 8px; background: var(--brand); color: #fff; cursor: pointer; }
.btn-primary:hover { background: var(--brand-700); }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-ghost { font-family: var(--sans); font-size: 13px; padding: 8px 16px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink-soft); cursor: pointer; }
.flag-msg { font-size: 12.5px; color: var(--green); margin-top: 10px; min-height: 16px; text-align: right; }

/* ---- per-event tags (overview table) ---- */
#events.grid td.tags { white-space: nowrap; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600;
  font-family: var(--sans); letter-spacing: .2px; margin-right: 3px; }
.tag-lat { background: #fdeceb; color: #c0392b; }
.tag-tp { background: #e3effb; color: var(--brand); }
.tag-dist { background: #efe7fb; color: #6b46c1; }
.tag-reroute { background: #fdecea; color: #c0392b; }
.tag-congest { background: #fff3da; color: #b7760a; }

.stat-grid { display: flex; gap: 20px; }
.stat-grid > div { flex: 1; min-width: 0; }
.subhead { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.stat-block { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.stat-block td { padding: 5px 8px; border-bottom: 1px solid #f0f3f7; }
.stat-block td.sv { font-family: var(--mono); text-align: right; }
.stat-block tr.verdict td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: none; padding-top: 8px; }
.stat-block tr.subrow td { padding-top: 12px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .4px; color: var(--ink-soft); font-weight: 600; border-bottom: none; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .3px; }
.chip.ok { background: #e2f3ea; color: var(--green); }
.chip.no { background: #eef1f5; color: var(--ink-soft); }
.chip.anom { background: #fdeceb; color: #c0392b; }
#logical-fwd, #logical-rev { overflow-x: auto; }
.bottom-row #geo-fwd, .bottom-row #geo-rev { height: 460px; }

.path-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.path-table th { text-align: left; padding: 7px 10px; background: #f4f7fb; color: var(--ink-soft);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.path-table td { padding: 6px 10px; border-bottom: 1px solid #f0f3f7; font-family: var(--mono);
  font-size: 11.5px; white-space: nowrap; }
.path-table tbody tr:hover { background: #f7f9fc; }
.path-table .src-entry { background: #fff6f5; }
.path-table .src-entry td { box-shadow: inset 2px 0 0 var(--brand); }
.asdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px;
  vertical-align: middle; }
.ixp { color: #b7791f; font-weight: 600; }
.path-table tr.reached td { background: #e2f3ea; }
.path-table tr.reached td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.path-table tr.reached td:last-child { box-shadow: inset -3px 0 0 var(--green); }
.reached-tag { font-family: var(--sans); font-size: 9.5px; font-weight: 600; color: var(--green);
  text-transform: uppercase; letter-spacing: .3px; margin-left: 4px; }
.path-table tr.reached-src td { background: #fff1ef; }
.path-table tr.reached-src td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.path-table tr.reached-src td:last-child { box-shadow: inset -3px 0 0 var(--brand); }
.src-reach-tag { font-family: var(--sans); font-size: 9.5px; font-weight: 600; color: var(--brand);
  text-transform: uppercase; letter-spacing: .3px; margin-left: 4px; }
.path-table tr.not-reached td { background: #fdf3f2; color: #b03a2e; border-top: 2px dashed #e0b4ad;
  font-weight: 500; }
.entry-tag { font-family: var(--sans); font-size: 9.5px; font-weight: 600; color: var(--brand);
  text-transform: uppercase; letter-spacing: .3px; margin-left: 4px; }
.path-caution { font-family: var(--sans); font-size: 11.5px; line-height: 1.45; color: #8a5a00;
  background: #fff8e6; border: 1px solid #f2d98a; border-left: 3px solid #e0a400;
  border-radius: 6px; padding: 7px 10px; margin: 0 0 8px; }
.path-caution b { color: #7a4f00; }

.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.metric { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fafbfd; }
.metric-k { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-soft); }
.metric-v { font-family: var(--mono); font-size: 16px; font-weight: 500; margin-top: 2px; color: var(--ink);
  overflow-wrap: anywhere; word-break: break-all; }
#meas-select { font-family: var(--mono); font-size: 12px; padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 8px; max-width: 380px; }

#edges, #tomo, #tpath-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
#edges th, #tomo th, #tpath-tbl th { text-align: left; padding: 8px 10px; background: #f4f7fb; color: var(--ink-soft);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
#edges td, #tomo td, #tpath-tbl td { padding: 7px 10px; border-bottom: 1px solid #f0f3f7; font-family: var(--mono); font-size: 11.5px; }
#event-title { font-size: 16px; font-weight: 600; }

/* ---- guide / tutorial ---- */
nav#tabs button.tab-guide { margin-left: auto; }
nav#tabs button.tab-guide::before { content: "?"; display: inline-flex; align-items: center;
  justify-content: center; width: 15px; height: 15px; margin-right: 6px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; vertical-align: -2px; }
.blurb-link { color: var(--brand); font-weight: 600; text-decoration: none; white-space: nowrap; }
.blurb-link:hover { text-decoration: underline; }

.guide { max-width: none; }
.guide-hero { position: relative; }
.guide-hide { position: absolute; top: 14px; right: 14px; font-family: var(--sans); font-size: 12px;
  font-weight: 600; color: var(--brand); background: #eef4fb; border: 1px solid #cfe0f3;
  border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.guide-hide:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.guide .card { padding: 20px 22px; }
.guide-hero h2 { margin: 0 0 10px; font-size: 20px; color: var(--ink); }
.guide-hero p, .guide-p, .guide-block p, .guide li { font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.guide-p { margin: 0 0 10px; }
.guide-defs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.guide-defs > div { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft);
  border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; }
.guide-term { display: block; font-weight: 700; color: var(--ink); font-size: 12px;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }

.guide-steps { margin: 4px 0 0; padding-left: 22px; }
.guide-steps li { margin-bottom: 12px; }
.guide-list { margin: 6px 0 4px; padding-left: 20px; }
.guide-list li { margin-bottom: 7px; }

.guide-block { padding: 14px 0; border-top: 1px solid var(--line); }
.guide-block:first-of-type { border-top: none; padding-top: 4px; }
.guide-h { font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.guide-block p { margin: 0; }

.guide-tags { display: grid; gap: 8px; margin: 4px 0 12px; }
.guide-tags > div { font-size: 12.5px; color: var(--ink); }

.guide-glossary { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; }
.guide-glossary dt { font-weight: 700; font-size: 12.5px; color: var(--ink); }
.guide-glossary dd { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }

.guide-caveats { border-color: #f0d9b5; background: #fffdf7; }
@media (max-width: 560px) { .guide-glossary { grid-template-columns: 1fr; gap: 2px 0; }
  .guide-glossary dd { margin-bottom: 8px; } }
