/* Tokens: the dataviz reference palette (validated light + dark), system sans. */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f2f1ed;
  --surface-3: #e8e7e1;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #898781;
  --accent: #2a78d6;
  --accent-wash: rgba(42, 120, 214, 0.10);
  --on-accent: #ffffff;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --up-text: #006300;
  --down-text: #c23434;
  --warn-text: #8a5a00;
  --heat-good: 42 120 214;
  --heat-bad: 227 73 72;
  --heat-max: 0.26;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.05);
  --pop-shadow: 0 10px 34px rgba(0, 0, 0, 0.16);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --surface-3: #2e2e2b;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --grid: #2c2c2a;
    --axis: #383835;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #898781;
    --accent: #3987e5;
    --accent-wash: rgba(57, 135, 229, 0.16);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --up-text: #0ca30c;
    --down-text: #e66767;
    --warn-text: #fab219;
    --heat-good: 57 135 229;
    --heat-bad: 230 103 103;
    --heat-max: 0.34;
    --shadow: none;
    --pop-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --surface-3: #2e2e2b;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --grid: #2c2c2a;
  --axis: #383835;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --muted: #898781;
  --accent: #3987e5;
  --accent-wash: rgba(57, 135, 229, 0.16);
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --up-text: #0ca30c;
  --down-text: #e66767;
  --warn-text: #fab219;
  --heat-good: 57 135 229;
  --heat-bad: 230 103 103;
  --heat-max: 0.34;
  --shadow: none;
  --pop-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; font-weight: 650; font-size: 15px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
}
.nav a svg { flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-wash); color: var(--accent); font-weight: 600; }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; font-size: 12px; color: var(--muted); padding: 0 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: 12px 24px 12px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--page) 90%, transparent);
  backdrop-filter: blur(10px);
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.topbar h1 { font-size: 20px; line-height: 1.2; margin: 0; font-weight: 650; }
.topbar-right { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.content { padding: 18px 24px 56px; display: grid; gap: 16px; transition: opacity 0.15s; }
.content.loading { opacity: 0.55; }
.content > * { min-width: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.grid-halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; align-content: start; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

@media (max-width: 1200px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .grid-halves { grid-template-columns: minmax(0, 1fr); }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 6px 8px; }
  .nav a span { display: none; }
  .sidebar-foot { display: none; }
  .topbar { position: static; padding: 10px 16px; }
  .content { padding: 14px 16px 48px; }
}

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { font-size: 15px; line-height: 1.3; margin: 0; font-weight: 620; }
.card-head .sub { margin-top: 2px; }
.sub { color: var(--muted); font-size: 12.5px; }
.note { color: var(--text-2); font-size: 12.5px; }
.empty { color: var(--muted); padding: 28px; text-align: center; }
.error-box { border: 1px solid rgb(208 59 59 / 0.4); background: rgb(208 59 59 / 0.08); border-radius: 8px; padding: 12px 14px; }
.banner { margin: 12px 24px 0; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.banner.warning { border-color: rgb(250 178 25 / 0.6); background: rgb(250 178 25 / 0.10); }
.banner .btn { margin-left: auto; flex: none; }
.banner + .banner { margin-top: 8px; }
.banner.critical { border-color: rgb(208 59 59 / 0.5); background: rgb(208 59 59 / 0.08); }

/* -------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 13px; cursor: pointer; white-space: nowrap; max-width: 100%;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .seg button:focus-visible, .option:focus-visible, .nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { height: 26px; padding: 0 8px; font-size: 12px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn .label-muted { color: var(--muted); }
.btn .value { font-weight: 600; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); margin-left: 2px; }
.btn.active-filter { border-color: var(--accent); background: var(--accent-wash); }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 10px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent); font-weight: 600; }

.check-toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-size: 13px; cursor: pointer; user-select: none; }
.check-toggle input { accent-color: var(--accent); margin: 0; }

input.text, input[type="date"], input[type="number"] {
  height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; min-width: 0;
}
input.search { width: 220px; }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

.popover {
  position: fixed; z-index: 70; min-width: 230px; max-width: min(420px, calc(100vw - 24px)); max-height: min(70vh, 560px);
  overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: var(--pop-shadow);
}
.popover .section { padding: 8px 8px 4px; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.popover .divider { height: 1px; background: var(--border); margin: 6px 0; }
.popover .foot { display: flex; gap: 8px; align-items: center; padding: 8px; border-top: 1px solid var(--border); margin-top: 6px; flex-wrap: wrap; }
.popover input.text { width: 100%; }
.option {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px;
  background: transparent; cursor: pointer; text-align: left; font-size: 13px;
}
.option:hover { background: var(--surface-2); }
.option .check { width: 16px; flex: none; font-weight: 800; color: var(--accent); text-align: center; }
.option .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.option .meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.option input[type="checkbox"] { accent-color: var(--accent); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12px; cursor: pointer; }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }
.chip .x { color: var(--muted); font-weight: 700; }

/* ----------------------------------------------------------------- tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px 10px; display: flex; flex-direction: column; min-width: 0;
}
.tile .label { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .value { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin-top: 2px; white-space: nowrap; }
.tile .ref { color: var(--muted); font-size: 12px; min-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin-top: 6px; min-height: 24px; }
.delta { font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up-text); }
.delta.down { color: var(--down-text); }
.delta.flat { color: var(--muted); font-weight: 500; }
.info { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 9.5px; font-weight: 700; cursor: help; flex: none; }

/* ----------------------------------------------------------------- table */
.table-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.table-wrap { overflow: auto; max-height: 72vh; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.data th, table.data td { padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: right; vertical-align: top; }
table.data thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 600; cursor: pointer; user-select: none; vertical-align: bottom;
}
table.data thead tr.groups th { height: 26px; text-align: center; color: var(--muted); font-weight: 600; cursor: default; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); font-size: 11.5px; letter-spacing: 0.02em; }
table.data thead tr.groups th:first-child { border-left: 0; }
table.data thead tr.groups + tr th { top: 26px; }
table.data thead th.group-start, table.data td.group-start { border-left: 1px solid var(--border); }
table.data thead th:hover { color: var(--text); }
table.data thead th .sort { color: var(--accent); margin-left: 3px; font-size: 10px; }
table.data th.left, table.data td.left { text-align: left; }
table.data td { font-variant-numeric: tabular-nums; }
table.data .sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; max-width: 280px; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--border); }
table.data thead th.sticky { z-index: 3; background: var(--surface-2); }
table.data tbody tr:hover td { background-color: var(--surface-2); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr:hover td.heat { background-image: linear-gradient(var(--surface-2), var(--surface-2)); background-blend-mode: multiply; }
table.data tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 650; border-top: 1px solid var(--border-strong); border-bottom: 0; z-index: 1; }
table.data tfoot td.sticky { z-index: 2; }
td.heat.better { background-color: rgb(var(--heat-good) / calc(var(--heat-max) * var(--h))); }
td.heat.worse { background-color: rgb(var(--heat-bad) / calc(var(--heat-max) * var(--h))); }
.cell-sub { display: block; font-size: 11px; line-height: 1.3; color: var(--muted); font-weight: 400; }
.cell-sub .delta { font-size: 11px; }
.name-cell { display: flex; flex-direction: column; min-width: 0; }
.name-cell .primary { font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.name-cell .secondary { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.code { display: inline-block; min-width: 26px; padding: 0 4px; margin-right: 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 600; text-align: center; font-family: ui-monospace, Consolas, monospace; }
.more-row td { text-align: center !important; }
.heat-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.heat-legend .sw { width: 22px; height: 10px; border-radius: 3px; }
.heat-legend .sw.better { background: rgb(var(--heat-good) / var(--heat-max)); }
.heat-legend .sw.worse { background: rgb(var(--heat-bad) / var(--heat-max)); }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge .ic { font-size: 10px; }
.badge.scale, .badge.good, .badge.enabled { color: var(--up-text); background: rgb(12 163 12 / 0.10); border-color: rgb(12 163 12 / 0.35); }
.badge.enabled.limited { color: var(--warn-text); background: rgb(250 178 25 / 0.14); border-color: rgb(250 178 25 / 0.55); }
.badge.reduce, .badge.critical { color: var(--down-text); background: rgb(208 59 59 / 0.10); border-color: rgb(208 59 59 / 0.40); }
.badge.test, .badge.warning { color: var(--warn-text); background: rgb(250 178 25 / 0.14); border-color: rgb(250 178 25 / 0.55); }
.badge.removed { color: var(--muted); }

/* -------------------------------------------------------------- insights */
.grid-2 { align-items: start; }
.insights { display: grid; max-height: 440px; overflow: auto; margin-right: -8px; padding-right: 8px; }
.insight { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px 10px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.insight:last-child { border-bottom: 0; }
.insight .icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: #fff; margin-top: 1px; }
.insight.lvl-critical .icon { background: var(--critical); }
.insight.lvl-warning .icon { background: var(--warning); color: #0b0b0b; }
.insight.lvl-good .icon { background: var(--good); }
.insight.lvl-info .icon { background: var(--surface-3); color: var(--text-2); }
.insight .title { font-weight: 600; line-height: 1.35; }
.insight .detail { color: var(--text-2); font-size: 12.5px; margin-top: 2px; }
.insight button.link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-size: 12.5px; margin-top: 3px; }
.insight button.link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- charts */
.chart { position: relative; width: 100%; min-height: 60px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .axis-title { fill: var(--muted); font-size: 11px; }
.chart .end-label { fill: var(--text-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .point-label { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.chart .quadrant { fill: var(--muted); font-size: 11px; }
.chart .ref-line { stroke: var(--critical); stroke-width: 1; shape-rendering: crispEdges; }
.chart .ref-label { fill: var(--down-text); font-size: 11px; font-weight: 600; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin: 0 0 8px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend .line-key { width: 14px; height: 2px; border-radius: 2px; display: inline-block; }
.legend svg { overflow: visible; }
.chart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tooltip {
  position: fixed; z-index: 100; pointer-events: none; min-width: 150px; max-width: 320px;
  padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--pop-shadow); font-size: 12.5px;
}
.tooltip .t-head { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.tooltip .t-sub { color: var(--muted); font-size: 11.5px; margin: -2px 0 4px; }
.tooltip .t-row { display: grid; grid-template-columns: 14px auto minmax(0, 1fr); align-items: center; gap: 2px 8px; }
.tooltip .t-row.no-key { grid-template-columns: auto minmax(0, 1fr); }
.tooltip .t-key { width: 14px; height: 2px; border-radius: 2px; }
.tooltip .t-val { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tooltip .t-name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----------------------------------------------------------------- meter */
.meter { display: grid; gap: 4px; }
.meter .track { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: visible; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.meter .fill.good { background: var(--good); }
.meter .fill.warning { background: var(--warning); }
.meter .fill.critical { background: var(--critical); }
.meter .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 1px; }
.meter .row { justify-content: space-between; font-size: 12.5px; }

/* ---------------------------------------------------------------- drawer */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.32); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(960px, 100vw); overflow: auto;
  background: var(--page); box-shadow: -10px 0 40px rgba(0, 0, 0, 0.22); border-left: 1px solid var(--border);
}
.drawer-head { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-body { padding: 16px 20px 48px; display: grid; gap: 16px; }
.drawer-body > * { min-width: 0; }

.quick-sync { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------- users & features */
.bar { display: inline-block; vertical-align: middle; width: 110px; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar.wide { width: 100%; }
.bar > span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--s1); }
.bar-label { margin-left: 8px; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
table.share-table td, table.share-table th { padding: 5px 10px; }
.reach-list { display: grid; gap: 2px; }
.reach-row { display: grid; grid-template-columns: minmax(0, 220px) minmax(60px, 1fr) 44px; align-items: center; gap: 10px; padding: 5px 6px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left; font-size: 13px; }
.reach-row:hover { background: var(--surface-2); }
.reach-name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reach-name .badge { font-size: 10.5px; padding: 0 6px; }
.reach-value { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.idea { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: var(--surface); min-width: 0; }
.idea h3 { margin: 0 0 6px; font-size: 14px; }
.idea ul { margin: 0 0 8px; padding-left: 18px; color: var(--text-2); font-size: 13px; display: grid; gap: 3px; }
.idea .note { margin: 0 0 8px; }
.idea summary { cursor: pointer; color: var(--accent); font-size: 13px; margin: 4px 0; }
pre.spec { white-space: pre; max-height: 340px; }

/* -------------------------------------------------------- lifetime value */
.callout { display: grid; gap: 6px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; }
.callout .row { gap: 10px; }
.callout .action { color: var(--text-2); }
.callout.scale { border-color: rgb(12 163 12 / 0.35); background: rgb(12 163 12 / 0.06); }
.callout.reduce { border-color: rgb(208 59 59 / 0.4); background: rgb(208 59 59 / 0.06); }
.callout.test { border-color: rgb(250 178 25 / 0.55); background: rgb(250 178 25 / 0.08); }
details.more > summary { cursor: pointer; color: var(--accent); font-size: 13px; margin: 8px 0 4px; }

/* ------------------------------------------------------------------ misc */
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; margin: 12px 0; }
.kv .k { color: var(--muted); font-size: 12px; }
.kv .v { font-weight: 620; font-variant-numeric: tabular-nums; }
.kv .r { color: var(--muted); font-size: 11.5px; }
pre.log { margin: 0; max-height: 300px; overflow: auto; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
dl.glossary { display: grid; grid-template-columns: minmax(130px, max-content) minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 13px; }
dl.glossary dt { font-weight: 600; }
dl.glossary dd { margin: 0; color: var(--text-2); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.status-dot.good { background: var(--good); }
.status-dot.warning { background: var(--warning); }
.status-dot.critical { background: var(--critical); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 120; background: var(--text); color: var(--page); padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: var(--pop-shadow); }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } .content { transition: none; } }
@media (forced-colors: active) { td.heat { forced-color-adjust: none; } }
