/* Asbente World status. One accent, warm neutrals, tabular numbers; light and dark by prefers-color-scheme. */

:root {
  --bg: #F7F7F5;
  --surface: #FFFFFF;
  --sunk: #EFEEEA;
  --ink: #242522;
  --ink-2: #4A4B46;
  --muted: #73746D;
  --line: #E3E2DC;
  --line-2: #D3D2CA;
  --accent: #8A5B10;
  --accent-soft: #F2E8D8;
  --bar: #C9B28A;
  --bar-2: #8A5B10;
  --ok: #4E7A57;
  --ok-soft: #E4EEE5;
  --warn: #8A5B10;
  --warn-soft: #F4EAD8;
  --bad: #A2412F;
  --bad-soft: #F6E2DC;
  --quiet: #8C8D86;
  --quiet-soft: #ECEBE6;
  --tip-bg: #FFFFFF;
  --tip-shadow: 0 1px 2px rgba(36, 37, 34, 0.08), 0 8px 24px rgba(36, 37, 34, 0.14);
  --radius: 10px;
  /* Globe and graph: severity (ordinal), density and coverage ramps, entity-kind hues. */
  --sev-extreme: #7A1C12;
  --sev-severe: #C2412B;
  --sev-moderate: #E07E35;
  --sev-minor: #E8B84A;
  --sev-unknown: #8C8D86;
  --pt-stroke: rgba(36, 37, 34, 0.55);
  --dens-lo: #E9D3A2;
  --dens-mid: #C38A2C;
  --dens-hi: #5E3604;
  --cov-1: #DCEADD;
  --cov-2: #B7D5BC;
  --cov-3: #8DBD97;
  --cov-4: #5F9D6D;
  --cov-5: #3B7A4D;
  --cov-6: #1F5531;
  --k-company: #8A5B10;
  --k-facility: #2C7A80;
  --k-agency: #6A4E9E;
  --k-place: #4E7A57;
  --k-list: #A2412F;
  --k-person: #9A5577;
  --k-transport: #3D6C9B;
  --k-goods: #8C8D86;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161714;
    --surface: #1E1F1C;
    --sunk: #252622;
    --ink: #ECEBE6;
    --ink-2: #C9C8C1;
    --muted: #9C9C94;
    --line: #2E2F2B;
    --line-2: #3A3B36;
    --accent: #D8A657;
    --accent-soft: #3A2E1B;
    --bar: #6E5A39;
    --bar-2: #D8A657;
    --ok: #86B48F;
    --ok-soft: #223225;
    --warn: #D8A657;
    --warn-soft: #3A2E1B;
    --bad: #E58C79;
    --bad-soft: #3C231E;
    --quiet: #8F8F88;
    --quiet-soft: #2A2B27;
    --tip-bg: #2A2B27;
    --tip-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.5);
    --sev-extreme: #FF5C4D;
    --sev-severe: #F28A5B;
    --sev-moderate: #F3B66A;
    --sev-minor: #EADB8C;
    --sev-unknown: #A3A39B;
    --pt-stroke: rgba(0, 0, 0, 0.6);
    --dens-lo: #7C6440;
    --dens-mid: #D8A657;
    --dens-hi: #FCE6B6;
    --cov-1: #233A29;
    --cov-2: #2E5138;
    --cov-3: #3F714B;
    --cov-4: #579463;
    --cov-5: #7FB886;
    --cov-6: #B0DFB4;
    --k-company: #D8A657;
    --k-facility: #6CC3C9;
    --k-agency: #B49DDB;
    --k-place: #86B48F;
    --k-list: #E58C79;
    --k-person: #D9A0BC;
    --k-transport: #8DB6E2;
    --k-goods: #9C9C94;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

.num, .tnum, td.num, th.num, .stat-value, .tile-value, .bar-n, .taken, .count-line { font-variant-numeric: tabular-nums; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 40px 24px 64px; }

/* Header */
.top { display: flex; gap: 24px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; margin-bottom: 28px; }
.brand { max-width: 680px; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 650; margin: 0 0 10px; }
.lede { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.taken { color: var(--muted); font-size: 13px; text-align: right; }
.taken strong { color: var(--ink); font-weight: 600; }
.taken .stale { color: var(--bad); font-weight: 600; }

/* Health strip: compact, above the tabs, the same on every tab. */
.health {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) 4fr;
  gap: 16px;
  align-items: stretch;
}
.verdict { display: flex; gap: 12px; align-items: flex-start; padding: 2px 2px 2px 0; min-width: 0; }
.verdict .dot { width: 11px; height: 11px; margin-top: 7px; }
.verdict-title { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 650; letter-spacing: -0.01em; }
.verdict-sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { border-left: 1px solid var(--line); padding: 1px 0 1px 14px; min-width: 0; }
.tile-label { font-size: 12px; color: var(--muted); margin: 0 0 2px; display: flex; gap: 6px; align-items: center; }
.tile-value { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.tile-sub { font-size: 12px; color: var(--muted); margin: 1px 0 0; line-height: 1.35; }
.health .meter { margin-top: 6px; height: 4px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--quiet); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }

.meter { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; margin-top: 8px; position: relative; }
.meter > span { display: block; height: 100%; background: var(--bar-2); border-radius: 3px; }
.meter.ok > span { background: var(--ok); }
.meter.bad > span { background: var(--bad); }

/* Blocks */
.block { margin-top: 44px; scroll-margin-top: 64px; }
.block-head { display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: baseline; margin-bottom: 16px; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 12px; color: var(--ink-2); letter-spacing: 0.01em; }
.hint { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 720px; flex: 1 1 380px; }
.panel-hint { margin: -6px 0 12px; color: var(--muted); font-size: 12.5px; }

/* Tabs: a sticky bar under the health strip; on a phone it scrolls sideways inside itself. */
.tabs {
  position: sticky; top: 0; z-index: 3; margin-top: 18px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tablist {
  display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--line);
}
.tablist::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 14px; font-weight: 550;
  color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 12px 14px 10px; cursor: pointer; white-space: nowrap; letter-spacing: -0.005em;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 8px; }
.tab-n {
  font-size: 11.5px; font-weight: 600; line-height: 18px; padding: 0 7px; border-radius: 999px;
  background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.tab-n.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.tab-n.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.tab-n[hidden] { display: none; }
.tab-panel[hidden] { display: none; }
.tab-panel > .block:first-child { margin-top: 26px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; margin-top: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.two > .panel { margin-top: 14px; }

/* Problems */
.problem-list { display: grid; gap: 14px; }
.problem-set { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.problem-set-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0; padding: 14px 18px;
  font-size: 15px; font-weight: 650; color: var(--ink);
}
.problem-set-head .count {
  font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--sunk); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums;
}
.problem-set-sub { color: var(--muted); font-weight: 400; font-size: 13px; }
.problem-set > .problem-group, .problem-set > .empty { border-top: 1px solid var(--line); }
details.problem-set > summary { cursor: pointer; list-style: none; }
details.problem-set > summary::-webkit-details-marker { display: none; }
details.problem-set > summary::after {
  content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg); transition: transform 0.15s ease;
}
details.problem-set[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
details.problem-set > summary:hover { background: var(--sunk); }
details.problem-set > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.problem-reason .tag {
  display: inline-block; margin-right: 8px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--accent-soft); color: var(--ink-2); vertical-align: 1px; white-space: nowrap;
}
.problem-note { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.problem-note::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-right: 6px; vertical-align: 1px; }
.problem-group-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: var(--sunk);
}
.problem-group-head .n { color: var(--muted); font-weight: 500; }
.problem { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 150px; gap: 4px 18px; padding: 11px 18px; border-top: 1px solid var(--line); align-items: baseline; }
.problem:first-of-type { border-top: 0; }
.problem-name { font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.problem-name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.problem-reason { color: var(--ink-2); font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.problem-since { color: var(--muted); font-size: 12.5px; white-space: nowrap; text-align: right; }
.problem-more { padding: 10px 18px; border-top: 1px solid var(--line); }
.empty { padding: 18px; color: var(--muted); font-size: 14px; display: flex; gap: 10px; align-items: center; }

/* Backlogs and rate limits */
.backlog-list { display: grid; gap: 14px; }
.backlog { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.backlog-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; }
.backlog-name { margin: 0; font-size: 15.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; min-width: 0; overflow-wrap: anywhere; }
.backlog-name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 1px; }
.backlog-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.backlog-figure { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin-top: 14px; }
.backlog-figure .big { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.backlog-figure .big.wait { font-size: 18px; letter-spacing: -0.01em; }
.backlog-figure .of { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.backlog-figure .pct { margin-left: auto; font-size: 15px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.backlog-meter { height: 14px; background: var(--sunk); border-radius: 7px; margin: 10px 0 0; overflow: hidden; }
.backlog-meter > span { display: block; height: 100%; background: var(--bar-2); border-radius: 7px; min-width: 3px; }
.backlog-meter.done > span { background: var(--ok); }
.backlog-meter.waiting { background: repeating-linear-gradient(-45deg, var(--sunk) 0 6px, var(--line) 6px 12px); }
.backlog-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.backlog-facts p { margin: 0; font-size: 12px; color: var(--muted); min-width: 0; }
.backlog-facts .label { display: block; margin-bottom: 2px; }
.backlog-facts strong { display: block; color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.backlog-note { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.backlog-note .label { color: var(--muted); font-size: 12px; margin-right: 6px; }
.callout {
  margin-top: 14px; padding: 12px 14px 12px 16px; border-radius: 8px; background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-left: 3px solid var(--warn);
}
.callout-title { margin: 0 0 3px; font-size: 13px; font-weight: 650; color: var(--warn); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.callout-title code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.callout p { margin: 0; font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.pill.limited { background: var(--bad-soft); color: var(--ink); }
.grid .rl-name { font-weight: 550; min-width: 150px; overflow-wrap: anywhere; }
.grid .rl-name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.shared-list { display: grid; gap: 12px; }
.shared + .shared { border-top: 1px solid var(--line); padding-top: 12px; }
.shared-name { margin: 0; font-weight: 550; font-size: 13.5px; overflow-wrap: anywhere; }
.shared-name small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.shared-text { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.shared-text code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--ink); background: var(--sunk); border-radius: 4px; padding: 1px 5px; }
.panel .empty { padding: 4px 0; }

/* Access and terms (Sources tab): one card per note. */
.access-list { display: grid; gap: 14px; }
.access { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.access-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; }
.access-name { margin: 0; font-size: 15.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.005em; min-width: 0; overflow-wrap: anywhere; }
.access-name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 1px; letter-spacing: 0; }
.access-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.access-date { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.access-date time { color: var(--ink-2); }
.pill.a-not_used_terms { background: var(--bad-soft); color: var(--ink); }
.pill.a-needs_key { background: var(--warn-soft); color: var(--ink); }
.pill.a-paid_only { background: var(--quiet-soft); color: var(--ink-2); }
.pill.a-awaiting_decision { background: var(--accent-soft); color: var(--ink); }
.access-why { margin: 12px 0 0; font-size: 14px; color: var(--ink); max-width: 860px; overflow-wrap: anywhere; }
.access-quote {
  margin: 12px 0 0; padding: 10px 14px; background: var(--sunk); border-left: 3px solid var(--line-2);
  border-radius: 0 8px 8px 0; font-size: 13.5px; color: var(--ink-2); max-width: 860px; overflow-wrap: anywhere;
}
.access-k { display: inline-block; margin-bottom: 3px; font-size: 12px; color: var(--muted); }
.access-quote q { display: block; font-style: italic; }
.access-facts { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 18px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.access-facts dt { font-size: 12.5px; color: var(--muted); }
.access-facts dd { margin: 0; font-size: 13.5px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.access-sep { color: var(--muted); }
.access-items-head { margin: 14px 0 4px; font-size: 12.5px; color: var(--muted); }
.access-items { list-style: none; margin: 0; padding: 0; }
.access-items li { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2px 18px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.access-items strong { font-weight: 550; color: var(--ink); }
.access-items span { color: var(--ink-2); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.stat-label { margin: 0; font-size: 12px; color: var(--muted); }
.stat-value { margin: 2px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.stat-sub { margin: 0; font-size: 12px; color: var(--muted); }

.breakdowns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.breakdowns .panel { margin-top: 0; }
.stack { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--sunk); margin-bottom: 12px; gap: 2px; }
.stack span { display: block; height: 100%; min-width: 2px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.legend .k { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.legend .v { color: var(--muted); font-variant-numeric: tabular-nums; }
.sw { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--bar); }

.c-ok { background: var(--ok); }
.c-partial { background: var(--warn); }
.c-failed { background: var(--bad); }
.c-refused { background: var(--quiet); }
.c-never { background: var(--line-2); }
.c-interrupted { background: repeating-linear-gradient(135deg, var(--quiet) 0 3px, var(--quiet-soft) 3px 6px); }
.c-0 { background: var(--bar-2); }
.c-1 { background: var(--bar); }
.c-2 { background: var(--line-2); }
.c-3 { background: var(--quiet); }

/* Tools */
.table-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 8px; }
.search { flex: 1 1 260px; min-width: 0; }
.search input, .select select {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 12px; min-height: 38px;
}
.search.small { flex: 0 1 220px; }
.search.small input { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.select { flex: 0 0 auto; }
.select select { width: auto; padding-right: 28px; }
.search input:focus, .select select:focus, .chip:focus-visible, .more:focus-visible, th[data-sort]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 13px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 5px 11px; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; min-height: 32px;
}
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: 0.7; }
.count-line { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; }

/* Tables */
.table-box { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: 640px; -webkit-overflow-scrolling: touch; }
.panel .table-box { border-radius: 8px; max-height: 420px; }
.panel .table-box.tall { max-height: 520px; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
.grid th, .grid td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.grid th {
  position: sticky; top: 0; z-index: 1; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted);
  white-space: nowrap; box-shadow: inset 0 -1px 0 var(--line);
}
.grid th[data-sort] { cursor: pointer; user-select: none; }
.grid th[data-sort]:hover { color: var(--ink); }
.grid th[aria-sort="ascending"]::after { content: " ↑"; color: var(--accent); }
.grid th[aria-sort="descending"]::after { content: " ↓"; color: var(--accent); }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: color-mix(in srgb, var(--sunk) 60%, transparent); }
.grid .num { text-align: right; white-space: nowrap; }
.grid td.nowrap { white-space: nowrap; }
.grid .src-name { font-weight: 550; min-width: 220px; max-width: 360px; }
.grid .src-name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.m-status { display: none; }
.grid .note { color: var(--ink-2); min-width: 200px; max-width: 340px; overflow-wrap: anywhere; font-size: 12.5px; }
.grid .doc { color: var(--ink-2); min-width: 240px; }
.grid code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--ink-2); }
.grid.compact th, .grid.compact td { padding: 7px 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 9px 2px 8px;
  border-radius: 999px; background: var(--quiet-soft); color: var(--ink-2); white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; }
.pill.ok { background: var(--ok-soft); }
.pill.partial { background: var(--warn-soft); }
.pill.failed { background: var(--bad-soft); }
.pill.refused, .pill.never, .pill.none { background: var(--quiet-soft); color: var(--muted); }
.pill.interrupted { background: var(--quiet-soft); color: var(--ink-2); }

.more {
  margin-top: 10px; font: inherit; font-size: 13px; font-weight: 500; color: var(--accent); background: none;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 14px; cursor: pointer;
}
.more:hover { border-color: var(--accent); }

/* Bars */
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.bar-k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-k small { color: var(--muted); margin-left: 6px; }
.bar-track { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--bar); border-radius: 4px; min-width: 2px; }
.bar-row.lead .bar-track span { background: var(--bar-2); }
.bar-n { color: var(--muted); font-size: 12.5px; text-align: right; min-width: 64px; }
.bars-more { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* Disk */
.disk-figure { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.disk-figure .big { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.disk-figure .of { color: var(--muted); font-size: 13.5px; }
.disk-meter { position: relative; height: 14px; background: var(--sunk); border-radius: 7px; margin: 14px 0 8px; overflow: visible; }
.disk-meter .used { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar-2); border-radius: 7px; }
.disk-meter .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.disk-meter .mark.alert { background: var(--bad); opacity: 0.6; }
.disk-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.disk-notes { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }

/* History chart */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .b1 { fill: var(--bar); }
.chart .b2 { fill: var(--bar-2); }
.chart .b1, .chart .b2 { pointer-events: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.chart-legend span { display: inline-flex; gap: 6px; align-items: center; }
.chart-legend .sw.b1 { background: var(--bar); }
.chart-legend .sw.b2 { background: var(--bar-2); }
.chart-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.chart-facts p { margin: 0; font-size: 12px; color: var(--muted); }
.chart-facts strong { display: block; color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

.foot { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.foot p { margin: 4px 0; }

.error-banner { background: var(--bad-soft); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }

/* On the globe */
.globe-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.globe-frame {
  position: relative; height: 580px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--surface); isolation: isolate;
}
/* Mapbox's stylesheet makes the map position: relative; the frame keeps it filling the box. */
.globe-frame .globe-map { position: absolute; inset: 0; }
.globe-map .mapboxgl-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.globe-anchor { position: absolute; left: 0; top: 0; width: 12px; height: 12px; pointer-events: none; }
.globe-msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; max-width: min(440px, calc(100% - 32px));
  margin: 0; padding: 12px 16px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-size: 13.5px; text-align: center; box-shadow: var(--tip-shadow);
}
.globe-msg.bad { color: var(--ink); background: var(--bad-soft); }
.globe-msg[hidden] { display: none; }
.globe-legend { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: flex-start; margin-top: 12px; font-size: 12.5px; color: var(--muted); min-height: 24px; }
.lg-group { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; min-width: 0; }
.lg-title { color: var(--ink-2); font-weight: 600; font-size: 12px; margin-right: 2px; }
.lg-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg-item .v { font-variant-numeric: tabular-nums; }
.lg-dot { display: inline-block; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px var(--pt-stroke); }
.lg-sq { display: inline-block; width: 14px; height: 10px; border-radius: 2px; flex: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent); }
.lg-sq.none { background: repeating-linear-gradient(-45deg, var(--sunk) 0 3px, var(--line) 3px 5px); }
.lg-note { flex-basis: 100%; margin: 0; font-size: 12px; }
.globe-legend .chip { font-size: 12.5px; min-height: 28px; padding: 3px 10px; }
.chip .lg-dot { width: 8px; height: 8px; }
.sev-extreme { background: var(--sev-extreme); }
.sev-severe { background: var(--sev-severe); }
.sev-moderate { background: var(--sev-moderate); }
.sev-minor { background: var(--sev-minor); }
.sev-unknown { background: var(--sev-unknown); }
.dens-lo { background: var(--dens-lo); }
.dens-mid { background: var(--dens-mid); }
.dens-hi { background: var(--dens-hi); }
.cov-1 { background: var(--cov-1); } .cov-2 { background: var(--cov-2); } .cov-3 { background: var(--cov-3); }
.cov-4 { background: var(--cov-4); } .cov-5 { background: var(--cov-5); } .cov-6 { background: var(--cov-6); }

/* How the data connects: inline SVG diagrams; they scroll sideways in their own box on narrow screens. */
.diagram-box { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; margin: 0 -4px; padding: 0 4px; }
.diagram { display: block; width: 100%; min-width: 760px; height: auto; font-family: var(--font); }
.diagram text { font-family: var(--font); fill: var(--ink); }
.diagram .dg-name { font-size: 13.5px; font-weight: 600; }
.diagram .dg-count { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.diagram .dg-name, .diagram .dg-count { paint-order: stroke; stroke: var(--surface); stroke-width: 8px; stroke-linejoin: round; pointer-events: none; }
.diagram .dg-head { font-size: 12px; font-weight: 600; fill: var(--muted); letter-spacing: 0.02em; }
.diagram .dg-elabel { font-size: 11.5px; fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: 7px; stroke-linejoin: round; font-variant-numeric: tabular-nums; pointer-events: none; }
.diagram .dg-elabel .n { fill: var(--muted); }
.diagram .dg-edge { fill: none; stroke: color-mix(in srgb, var(--ink-2) 55%, transparent); stroke-linecap: round; pointer-events: none; transition: stroke 120ms, opacity 120ms; }
.diagram .dg-arrow { fill: color-mix(in srgb, var(--ink-2) 75%, transparent); }
.diagram .dg-hit { fill: none; stroke: transparent; stroke-width: 16px; outline: none; }
.diagram .dg-hit:hover + .dg-edge, .diagram .dg-hit:focus-visible + .dg-edge, .diagram .dg-hit[aria-describedby] + .dg-edge { stroke: var(--accent); }
.diagram .dg-node { stroke-width: 1.5px; outline: none; }
.diagram .dg-node:hover, .diagram .dg-node:focus-visible, .diagram .dg-node[aria-describedby] { stroke-width: 3px; }
.diagram .dg-unlinked .dg-node { stroke-dasharray: 3 3; }
.diagram .dg-unlinked text { fill: var(--muted); }
.diagram .dg-pill { stroke-width: 1.2px; outline: none; }
.diagram .dg-pill:hover, .diagram .dg-pill:focus-visible, .diagram .dg-pill[aria-describedby] { stroke-width: 2.4px; }
.diagram .dg-ptext { font-size: 12px; pointer-events: none; }
.diagram .dg-ptext.n { fill: var(--muted); font-variant-numeric: tabular-nums; }
.diagram.focus .dg-edge { opacity: 0.18; }
.diagram.focus .dg-edge.on { opacity: 1; stroke: var(--accent); }
.diagram.focus .dg-pill:not(.on) { opacity: 0.45; }
.diagram.focus .dg-ptext:not(.on) { opacity: 0.45; }
.dg-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid; flex: none; }
.dg-swatch.line { width: 18px; height: 0; border-radius: 0; border-width: 2px 0 0; border-color: var(--ink-2); }
.dg-swatch.dash { border-style: dashed; border-color: var(--muted); }
.diagram .k-company { fill: color-mix(in srgb, var(--k-company) 20%, var(--surface)); stroke: var(--k-company); }
.dg-swatch.k-company { background: color-mix(in srgb, var(--k-company) 20%, var(--surface)); border-color: var(--k-company); }
.diagram .k-facility { fill: color-mix(in srgb, var(--k-facility) 20%, var(--surface)); stroke: var(--k-facility); }
.dg-swatch.k-facility { background: color-mix(in srgb, var(--k-facility) 20%, var(--surface)); border-color: var(--k-facility); }
.diagram .k-agency { fill: color-mix(in srgb, var(--k-agency) 20%, var(--surface)); stroke: var(--k-agency); }
.dg-swatch.k-agency { background: color-mix(in srgb, var(--k-agency) 20%, var(--surface)); border-color: var(--k-agency); }
.diagram .k-place { fill: color-mix(in srgb, var(--k-place) 20%, var(--surface)); stroke: var(--k-place); }
.dg-swatch.k-place { background: color-mix(in srgb, var(--k-place) 20%, var(--surface)); border-color: var(--k-place); }
.diagram .k-list { fill: color-mix(in srgb, var(--k-list) 20%, var(--surface)); stroke: var(--k-list); }
.dg-swatch.k-list { background: color-mix(in srgb, var(--k-list) 20%, var(--surface)); border-color: var(--k-list); }
.diagram .k-person { fill: color-mix(in srgb, var(--k-person) 20%, var(--surface)); stroke: var(--k-person); }
.dg-swatch.k-person { background: color-mix(in srgb, var(--k-person) 20%, var(--surface)); border-color: var(--k-person); }
.diagram .k-transport { fill: color-mix(in srgb, var(--k-transport) 20%, var(--surface)); stroke: var(--k-transport); }
.dg-swatch.k-transport { background: color-mix(in srgb, var(--k-transport) 20%, var(--surface)); border-color: var(--k-transport); }
.diagram .k-goods { fill: color-mix(in srgb, var(--k-goods) 20%, var(--surface)); stroke: var(--k-goods); }
.dg-swatch.k-goods { background: color-mix(in srgb, var(--k-goods) 20%, var(--surface)); border-color: var(--k-goods); }
/* Review agreement (graph.review_agreement): one stacked bar per judge, agreed / disagreed / no call. */
.agree { display: grid; gap: 7px; }
.agree-total { margin: 0 0 4px; font-size: 13px; color: var(--ink-2); }
.agree-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.agree-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--sunk); gap: 2px; }
.agree-bar span { display: block; height: 100%; min-width: 2px; }
.agree-bar .a, .agree-key i.a { background: var(--ok); }
.agree-bar .d, .agree-key i.d { background: var(--bad); }
.agree-bar .x, .agree-key i.x { background: var(--line-2); }
.agree-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.agree-key span { display: inline-flex; gap: 6px; align-items: center; }
.agree-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.narrow-only { display: none; }
.example-meta { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
#example-note .callout { margin: 0 0 12px; }

/* Narrow screens */
@media (max-width: 980px) {
  .health { grid-template-columns: 1fr; gap: 12px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .breakdowns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .wrap { padding: 24px 16px 48px; }
  .health { padding: 12px 14px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .tabs { margin-left: -16px; margin-right: -16px; margin-top: 14px; }
  .tablist { padding: 0 8px; scroll-padding: 0 16px; }
  .tab { padding: 11px 11px 9px; font-size: 13.5px; }
  .tab-panel > .block:first-child { margin-top: 20px; }
  h1 { font-size: 25px; }
  .top { align-items: flex-start; }
  .taken { text-align: left; }
  .two { grid-template-columns: 1fr; gap: 0; }
  .problem { grid-template-columns: 1fr; }
  .problem-since { text-align: left; }
  .breakdowns { grid-template-columns: 1fr; }
  .backlog { padding: 16px; }
  .backlog-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access { padding: 16px; }
  .access-facts { grid-template-columns: 1fr; gap: 2px; }
  .access-facts dd + dt { margin-top: 8px; }
  .access-items li { grid-template-columns: 1fr; }
  .panel .table-box.rl-box { max-height: none; }
  .rl-table thead { display: none; }
  .rl-table, .rl-table tbody { display: block; }
  .rl-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .rl-table tbody tr:last-child { border-bottom: 0; }
  .grid.rl-table td { display: block; padding: 0; border: 0; text-align: left; min-width: 0; }
  .grid.rl-table td.rl-name, .grid.rl-table td.rl-host { grid-column: 1 / -1; }
  .grid.rl-table td.num::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); }
  .bar-row { grid-template-columns: minmax(0, 1fr) 72px auto; gap: 10px; }
  .chart-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table-box { max-height: 560px; }
  .m-status { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); font-weight: 400; }
  .grid .src-name { min-width: 230px; max-width: 260px; }
  .globe-frame { height: 440px; }
  .narrow-only { display: block; margin: 8px 0 0; }
  .globe-legend { gap: 10px 18px; }
}
@media (max-width: 420px) {
  .tile { padding-left: 10px; }
  .tile-value { font-size: 15px; }
}

/* Explanations: a dotted underline (or an info button on headings) marks a term; one fixed tooltip shows it. */
.has-tip {
  text-decoration-line: underline; text-decoration-style: dotted; text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--muted) 75%, transparent); text-underline-offset: 3px; cursor: help;
}
th.has-tip { text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent); }
.grid th[data-sort].has-tip { cursor: pointer; }
.tip-plain { cursor: help; }
a.tip-plain, .chip.tip-plain, input.tip-plain, select.tip-plain { cursor: pointer; }
input.tip-plain { cursor: text; }
.has-tip:focus-visible, .tip-plain:focus-visible, .tip-icon:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
.has-tip:focus:not(:focus-visible), .tip-plain:focus:not(:focus-visible) { outline: none; }
.tip-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px;
  margin: 0 0 0 7px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: transparent;
  color: var(--muted); font: 600 10px/1 var(--font); font-style: normal; vertical-align: 1px; cursor: help; flex: none;
}
.tip-icon::before { content: ""; position: absolute; inset: -8px; }
.tip-icon:hover, .tip-icon[aria-describedby] { color: var(--accent); border-color: var(--accent); }
h2 .tip-icon { width: 16px; height: 16px; font-size: 10.5px; vertical-align: 2px; }
.tip {
  position: fixed; left: 0; top: 0; z-index: 50; max-width: 340px; margin: 0; padding: 10px 12px;
  background: var(--tip-bg); color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 8px;
  box-shadow: var(--tip-shadow); font-size: 12.5px; line-height: 1.45; pointer-events: none;
  overflow-wrap: anywhere; text-align: left; font-weight: 400; letter-spacing: 0;
}
.tip[hidden] { display: none; }
.tip p { margin: 0; }
.tip p + p { margin-top: 5px; }
.tip .tip-title { color: var(--ink); font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.tip .tip-title + p { margin-top: 0; }
.chart .hit { fill: transparent; outline: none; }
.chart .hit:hover, .chart .hit:focus-visible, .chart .hit[aria-describedby] { fill: color-mix(in srgb, var(--sunk) 70%, transparent); }
.chart .hit:focus-visible { stroke: var(--accent); stroke-width: 1.5; }
.src-title { display: inline; }
.legend .k.has-tip { text-overflow: ellipsis; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Sign-in: the shell shows only this card until a session exists; the password goes in a JSON body. */
.top-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.signout {
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 12px; cursor: pointer; min-height: 30px;
}
.signout:hover { border-color: var(--accent); color: var(--ink); }
.signout:focus-visible, .signin-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app[hidden], .signin[hidden], .signout[hidden] { display: none; }
.signin { display: flex; justify-content: center; padding: 24px 0 72px; }
.signin-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 1px 2px rgba(36, 37, 34, 0.04), 0 12px 32px rgba(36, 37, 34, 0.06);
}
.signin-card h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.signin-sub { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.signin-label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.signin-input {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 12px; min-height: 42px;
}
.signin-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.signin-error { margin: 0; color: var(--bad); font-size: 13.5px; font-weight: 550; }
.signin-error[hidden] { display: none; }
.signin-button {
  margin-top: 4px; font: inherit; font-size: 15px; font-weight: 600; color: var(--bg); background: var(--ink);
  border: 1px solid var(--ink); border-radius: 8px; padding: 9px 14px; min-height: 42px; cursor: pointer;
}
.signin-button:hover { background: var(--ink-2); border-color: var(--ink-2); }
.signin-button:disabled { opacity: 0.6; cursor: progress; }
.signin-note { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
@media (prefers-color-scheme: dark) {
  .signin-card { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35); }
}

/* Infrastructure (Data tab): the world database and the Fly machines. */
.infra { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; }
.infra > .panel { margin-top: 0; }
.infra-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.infra-head h3 { margin: 0; }
.infra-tag {
  font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px;
  padding: 2px 9px; white-space: nowrap;
}
.infra-facts { display: grid; grid-template-columns: minmax(96px, auto) minmax(0, 1fr); gap: 0; margin: 0; }
.infra-facts dt, .infra-facts dd { padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.infra-facts dt:first-of-type, .infra-facts dt:first-of-type + dd { border-top: 0; }
.infra-facts dt { color: var(--muted); font-size: 12.5px; padding: 10px 16px 8px 0; }
.infra-facts dd { margin: 0; }
.infra-v { display: block; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.infra-sub { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.infra-machine + .infra-machine { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.infra-machine-name { margin: 0 0 4px; font-weight: 600; font-size: 14.5px; }
.infra-machine-name small { margin-left: 8px; color: var(--muted); font-weight: 400; font-size: 12px; }
@media (max-width: 860px) { .infra { grid-template-columns: 1fr; } }

/* Phase 1 (internal; its content arrives only after sign-in): docs/price-cuts-owed.html's styles under .p1, in this
   page's tokens. Keep in step with that file's <style> when its markup changes. */
.p1 {
  --p1-card: var(--surface); --p1-built: var(--ok); --p1-built-soft: var(--ok-soft); --p1-now: var(--accent);
  --p1-now-soft: var(--accent-soft); --p1-next: #4A5A8A; --p1-next-soft: #E8ECF7;
  font-size: 15.5px; line-height: 1.5; color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  .p1 { --p1-next: #9EAEE0; --p1-next-soft: #232A3D; }
}
.p1 * { margin: 0; padding: 0; }
.p1 .wrap { max-width: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 30px; }
.p1 .hero { display: flex; flex-direction: column; gap: 12px; }
.p1 .col { display: flex; flex-direction: column; gap: 10px; }
.p1 .kicker { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.p1 h1 { font-size: clamp(26px, 3.8vw, 40px); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; max-width: 900px; font-weight: 700; }
.p1 h2 { font-size: 21px; letter-spacing: -0.01em; font-weight: 650; }
.p1 h3 { font-size: 15px; }
.p1 .lede { font-size: 17px; color: var(--muted); max-width: 800px; }
.p1 .card { background: var(--p1-card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.p1 .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.p1 .tldr { border-left: 4px solid var(--accent); display: flex; flex-direction: column; gap: 10px; }
.p1 .tldr ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.p1 .section { display: flex; flex-direction: column; gap: 12px; }
.p1 .sub { color: var(--muted); font-size: 14px; max-width: 820px; }
.p1 .trace { display: flex; flex-direction: column; gap: 0; }
.p1 .layer { display: grid; grid-template-columns: 210px 1fr 1fr 96px; gap: 16px; align-items: start; padding: 14px 18px; background: var(--p1-card); border: 1px solid var(--line); border-top: 0; }
.p1 .layer:first-child { border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; }
.p1 .layer:last-child { border-radius: 0 0 14px 14px; }
.p1 .layer .name b { display: block; font-size: 14.5px; }
.p1 .layer .name span { color: var(--muted); font-size: 12.5px; }
.p1 .layer .does, .p1 .layer .breaks { font-size: 13.5px; }
.p1 .layer .breaks { color: var(--muted); }
.p1 .layer .breaks::before { content: "If it's wrong: "; color: var(--bad); font-weight: 600; }
.p1 .head { display: grid; grid-template-columns: 210px 1fr 1fr 96px; gap: 16px; padding: 0 18px 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.p1 .tag { justify-self: end; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.p1 .tag.built { background: var(--p1-built-soft); color: var(--p1-built); }
.p1 .tag.now { background: var(--p1-now-soft); color: var(--p1-now); }
.p1 .tag.next { background: var(--p1-next-soft); color: var(--p1-next); }
.p1 .step { color: var(--accent); font-weight: 700; margin-right: 6px; }
.p1 .objectives { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.p1 .obj { background: var(--p1-card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.p1 .obj .q { font-weight: 600; font-size: 15px; }
.p1 .obj .p { font-size: 13.5px; color: var(--muted); }
.p1 .obj .m { font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.p1 .obj .m b { color: var(--accent); }
.p1 .measure { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.p1 .mcard { background: var(--p1-card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.p1 .mcard .big { font-size: 22px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; }
.p1 .mcard p { font-size: 13px; color: var(--muted); }
.p1 table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.p1 th, .p1 td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.p1 th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-top: 0; font-weight: 600; }
.p1 td:first-child { font-weight: 600; white-space: nowrap; }
.p1 .yes { color: var(--p1-built); font-weight: 600; }
.p1 .part { color: var(--p1-now); font-weight: 600; }
.p1 .no { color: var(--bad); font-weight: 600; }
.p1 .tablebox { overflow-x: auto; }
.p1 .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.p1 ul.plain { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.p1 footer { color: var(--muted); font-size: 12.5px; text-align: center; }
@media (max-width: 860px) {
  .p1 .head { display: none; }
  .p1 .layer { grid-template-columns: 1fr; gap: 6px; }
  .p1 .tag { justify-self: start; }
  .p1 .measure, .p1 .two { grid-template-columns: 1fr; }
  .p1 td:first-child { white-space: normal; }
}
