/* ------------------------------------------------------------------ *
 * UA Platform — one stylesheet.
 *
 * Calm, analytical, professional. Light by default, with a dark theme behind a toggle.
 * Clarity over raw density: generous whitespace, a real type scale, one clear hierarchy
 * (a few lead numbers loud, everything else quiet). Colour is semantic and measured —
 * status hues only ever appear beside a glyph and a label, never carrying meaning alone.
 * ------------------------------------------------------------------ */

:root {
  color-scheme: light;

  /* Surfaces */
  --page:            #f5f6f8;
  --panel:           #ffffff;
  --raised:          #eef1f4;
  --hairline:        #e6e9ee;
  --hairline-strong: #d3d8e0;
  --shadow:          0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-pop:      0 8px 28px rgba(16, 24, 40, 0.14);

  /* Ink — measured against --panel (#fff) */
  --ink:   #101828;   /* 16.9:1 */
  --ink-2: #475467;   /* 7.5:1  secondary */
  --ink-3: #667085;   /* 5.1:1  metadata */
  --ink-4: #98a2b3;   /* 2.9:1  faint, non-text only */

  --accent:    #2f6feb;
  --accent-bg: #e8f0fe;
  --accent-ink:#1d4ed8;

  --good: #067647;
  --bad:  #d13438;
  --warn: #b25e09;

  /* Categorical series — CVD-checked on both surfaces */
  --s1: #2f6feb;   /* blue   */
  --s2: #e8590c;   /* orange */
  --s3: #0f9d76;   /* teal   */

  --maturing-hatch: rgba(16, 24, 40, 0.05);

  --r: 10px;
  --r-sm: 7px;
  --gap: 16px;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --page:            #0e0f13;
  --panel:           #17191f;
  --raised:          #20232b;
  --hairline:        #282b33;
  --hairline-strong: #3a3e49;
  --shadow:          0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-pop:      0 12px 32px rgba(0, 0, 0, 0.6);

  --ink:   #f3f5f8;
  --ink-2: #b6bdc9;   /* 8.4:1 on panel */
  --ink-3: #8b93a1;   /* 5.0:1 */
  --ink-4: #616875;   /* 3.0:1 */

  --accent:    #5b9bff;
  --accent-bg: #16283f;
  --accent-ink:#a9c9ff;

  --good: #38b26a;
  --bad:  #e5615f;
  --warn: #e0a63a;

  --s1: #4c8dff;
  --s2: #f07a3c;
  --s3: #33b98c;

  --maturing-hatch: rgba(255, 255, 255, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ------------------------------------------------------------------ *
 * Top bar
 * ------------------------------------------------------------------ */

.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px; height: 58px;
  background: var(--panel);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 0; z-index: 40;
}
.brand { font-weight: 700; letter-spacing: -0.015em; font-size: 15px; }
.brand span { color: var(--ink-3); font-weight: 400; }

.viewnav { display: flex; gap: 4px; }
.viewnav button {
  background: none; border: 0; color: var(--ink-3);
  padding: 8px 14px; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 500; transition: background 120ms, color 120ms;
}
.viewnav button[aria-current="page"] {
  background: var(--accent-bg);
  color: var(--accent-ink);
  font-weight: 600;
}
.viewnav button[disabled] { color: var(--ink-4); cursor: not-allowed; }

.topbar .spacer { flex: 1; }
.freshness { color: var(--ink-3); font-size: 12px; text-align: right; line-height: 1.4; }
.freshness b { color: var(--ink-2); font-weight: 600; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--r-sm);
  background: none; border: 1px solid var(--hairline); color: var(--ink-2);
  cursor: pointer; padding: 0; flex: none; transition: background 120ms, border-color 120ms;
}
.theme-toggle svg { width: 18px; height: 18px; }
@media (hover: hover) { .theme-toggle:hover { background: var(--raised); border-color: var(--hairline-strong); color: var(--ink); } }

/* ------------------------------------------------------------------ *
 * Filter bar
 * ------------------------------------------------------------------ */

.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  padding: 12px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--hairline);
  position: sticky; top: 58px; z-index: 35;
}
.fgroup { display: flex; align-items: center; gap: 9px; }
.flabel {
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 10.5px; color: var(--ink-3); font-weight: 600;
}
.seg { display: flex; background: var(--page); border: 1px solid var(--hairline); border-radius: var(--r-sm); overflow: hidden; }
.seg button {
  background: none; border: 0; border-right: 1px solid var(--hairline);
  color: var(--ink-2); padding: 7px 12px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500;
  transition: background 120ms, color 120ms;
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent-ink); font-weight: 600; }
.seg button[disabled] { color: var(--ink-4); cursor: not-allowed; }
@media (hover: hover) {
  .seg button:not([aria-pressed="true"]):not([disabled]):hover { background: var(--raised); color: var(--ink); }
  .viewnav button:not([aria-current="page"]):not([disabled]):hover { background: var(--raised); color: var(--ink); }
}
.dateinput {
  background: var(--page); border: 1px solid var(--hairline); color: var(--ink-2);
  border-radius: var(--r-sm); padding: 6px 9px; font: inherit; font-size: 13px;
}
.chip-note {
  font-size: 12px; color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  padding: 4px 11px; border-radius: 20px;
}

/* ------------------------------------------------------------------ *
 * Layout
 * ------------------------------------------------------------------ */

main { padding: 26px 22px 64px; max-width: 1680px; margin: 0 auto; }
.section { margin-bottom: 30px; }
.section-head {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px;
}
.section-head h2 {
  margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); font-weight: 700;
}
.section-head .sub { color: var(--ink-4); font-size: 12.5px; }

/* Plain-language page orientation line. */
.page-lead {
  font-size: 14px; color: var(--ink-2); line-height: 1.6;
  margin: 0 0 24px; max-width: 940px;
}
.page-lead strong { color: var(--ink); font-weight: 650; }

/* ------------------------------------------------------------------ *
 * KPI tiles
 * ------------------------------------------------------------------ */

.tiles { display: grid; gap: var(--gap); }
.tiles.lead { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles.support { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tile {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  min-width: 0;
  position: relative;
  display: flex; flex-direction: column; gap: 9px;
}
.tile .label {
  font-size: 12px; letter-spacing: 0.01em;
  color: var(--ink-3); font-weight: 600;
  overflow-wrap: anywhere; white-space: normal;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.tile .value {
  font-size: 26px; font-weight: 680; letter-spacing: -0.02em; color: var(--ink);
  overflow-wrap: anywhere; line-height: 1.1;
}
.tiles.lead .tile .value { font-size: 38px; font-weight: 700; }
.tiles.lead .tile { padding: 22px 22px 20px; }

.tile .value.st-unavailable,
.tile .value.st-source_unavailable { color: var(--ink-4); font-weight: 500; }
.tile .value.st-maturing { color: var(--ink-2); }

.badge {
  font-size: 9.5px; letter-spacing: 0.06em; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; border: 1px solid var(--hairline-strong);
  color: var(--ink-3); background: var(--raised); text-transform: uppercase;
}
.badge.cohort { color: #7c5cd6; border-color: color-mix(in srgb, #7c5cd6 40%, transparent); background: color-mix(in srgb, #7c5cd6 12%, transparent); }
.badge.activity { color: var(--ink-3); }
.badge.predicted { color: var(--ink-3); }

.tile .foot { display: flex; align-items: center; gap: 10px; min-height: 18px; flex-wrap: wrap; }
.delta { font-size: 13px; font-weight: 650; display: inline-flex; align-items: center; gap: 4px; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }
.delta.flat, .delta.none { color: var(--ink-3); }
.prev { font-size: 12.5px; color: var(--ink-3); }
.reason { font-size: 12px; color: var(--ink-4); overflow-wrap: anywhere; }

.spark { display: block; width: 100%; height: 30px; margin-top: 3px; color: var(--accent); }

/* Tooltip */
.tip {
  position: absolute; z-index: 60; left: 10px; right: 10px; top: calc(100% - 6px);
  background: var(--panel); border: 1px solid var(--hairline-strong);
  border-radius: var(--r-sm); padding: 11px 13px; font-size: 12.5px; color: var(--ink-2);
  box-shadow: var(--shadow-pop); display: none; line-height: 1.5;
}
.tip.open { display: block; }
.tip dt { color: var(--ink-4); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 7px; font-weight: 600; }
.tip dt:first-child { margin-top: 0; }
.tip dd { margin: 2px 0 0; color: var(--ink-2); }
.tile .info {
  position: absolute; top: 12px; right: 12px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--hairline-strong); background: none;
  color: var(--ink-4); font-size: 10px; line-height: 1; cursor: pointer; padding: 0;
}
@media (hover: hover) { .tile .info:hover { color: var(--ink); border-color: var(--ink-3); } }

/* ------------------------------------------------------------------ *
 * Secondary families
 * ------------------------------------------------------------------ */

.families { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.family { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px 18px; min-width: 0; }
.family > h3 {
  margin: 0 0 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-3); font-weight: 700;
  padding-bottom: 10px; border-bottom: 1px solid var(--hairline);
}
.minigrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px 18px; }
.mini { min-width: 0; }
.mini .label {
  font-size: 11px; color: var(--ink-3); font-weight: 500;
  overflow-wrap: anywhere; display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.mini .value { font-size: 19px; font-weight: 650; color: var(--ink); letter-spacing: -0.01em; margin-top: 2px; }
.mini .value.st-unavailable, .mini .value.st-source_unavailable { color: var(--ink-4); font-weight: 500; }
.mini .delta { font-size: 12px; }

/* ------------------------------------------------------------------ *
 * Charts
 * ------------------------------------------------------------------ */

.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.card {
  background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 18px 18px 14px; min-width: 0;
}
.card > header { margin-bottom: 12px; }
.card h3 { margin: 0; font-size: 15px; font-weight: 650; color: var(--ink); letter-spacing: -0.01em; }
.card .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.plot { width: 100%; height: 220px; }
.plot.tall { height: 260px; }
.card .note { font-size: 12px; color: var(--ink-4); margin: 8px 0 2px; line-height: 1.5; }

/* ------------------------------------------------------------------ *
 * Tables / rankings
 * ------------------------------------------------------------------ */

.tablewrap { overflow-x: auto; margin: 0 -2px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: right; padding: 10px 14px; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--panel); font-weight: 500; color: var(--ink); }
thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--hairline-strong);
  padding-top: 6px; padding-bottom: 10px;
}
tbody tr { border-bottom: 1px solid var(--hairline); }
tbody tr:last-child { border-bottom: 0; }
@media (hover: hover) { tbody tr:hover td { background: var(--raised); } tbody tr:hover td:first-child { background: var(--raised); } }
tfoot td { border-top: 2px solid var(--hairline-strong); font-weight: 700; color: var(--ink); padding-top: 11px; }
td.st-unavailable, td.st-source_unavailable { color: var(--ink-4); }
td.st-good { color: var(--good); }
td.st-bad { color: var(--bad); }

/* ------------------------------------------------------------------ *
 * Alerts
 * ------------------------------------------------------------------ */

.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--hairline);
  border-left: 3px solid var(--hairline-strong);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 13px 15px;
}
.alert.critical { border-left-color: var(--bad); }
.alert.warn { border-left-color: var(--warn); }
.alert.info { border-left-color: var(--accent); }
.alert .sev {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;
  padding: 3px 7px; border-radius: 4px; background: var(--raised); border: 1px solid var(--hairline-strong);
  flex: none; margin-top: 1px;
}
.alert.critical .sev { color: var(--bad); }
.alert.warn .sev { color: var(--warn); }
.alert.info .sev { color: var(--accent); }
.alert .body h4 { margin: 0 0 3px; font-size: 14px; font-weight: 650; }
.alert .body p { margin: 0; font-size: 13px; color: var(--ink-2); }
.empty { color: var(--ink-3); font-size: 13px; padding: 16px 18px; background: var(--panel); border: 1px dashed var(--hairline-strong); border-radius: var(--r); }

details.suppressed { margin-top: 12px; }
details.suppressed summary { cursor: pointer; color: var(--ink-3); font-size: 12.5px; }
details.suppressed ul { margin: 8px 0 0; padding-left: 20px; color: var(--ink-4); font-size: 12px; }

/* ------------------------------------------------------------------ *
 * Login
 * ------------------------------------------------------------------ */

.login { display: grid; place-items: center; min-height: 100vh; }
.login form { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 28px; width: 320px; }
.login h1 { font-size: 18px; margin: 0 0 6px; }
.login p { color: var(--ink-3); font-size: 13px; margin: 0 0 18px; }
.login input { width: 100%; padding: 11px 13px; background: var(--page); border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); color: var(--ink); font: inherit; }
.login button { width: 100%; margin-top: 12px; padding: 11px; background: var(--accent); color: #fff; border: 0; border-radius: var(--r-sm); font: inherit; font-weight: 600; cursor: pointer; }
.login .err { color: var(--bad); font-size: 12.5px; margin-top: 10px; min-height: 16px; }

.loading { color: var(--ink-3); padding: 60px 0; text-align: center; font-size: 14px; }
.fatal { color: var(--bad); padding: 22px; background: var(--panel); border: 1px solid var(--bad); border-radius: var(--r); }

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */

@media (max-width: 1400px) {
  .tiles.support { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .tiles.lead { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles.support { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .families, .charts { grid-template-columns: 1fr; }
}

.filter-toggle {
  display: none; background: var(--panel); border: 1px solid var(--hairline);
  color: var(--ink-2); border-radius: var(--r-sm); padding: 9px 14px; font: inherit; cursor: pointer;
}

@media (max-width: 720px) {
  main { padding: 16px 14px 48px; }
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 8px 14px; }
  .topbar .brand { flex: 1 1 auto; }
  .theme-toggle { order: 2; }
  .topbar .freshness { flex: 1 1 100%; text-align: left; }
  .viewnav { flex: 1 1 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .viewnav button { flex: none; }
  .filterbar { top: 0; position: static; padding: 10px 14px; }
  .fgroup { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .seg { flex: none; }

  .tiles.lead, .tiles.support {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: 12px; padding-bottom: 6px; -webkit-overflow-scrolling: touch;
  }
  .tiles.lead .tile, .tiles.support .tile {
    flex: 0 0 80%; scroll-snap-align: start; min-width: 240px;
  }
  .tiles.lead .tile .value { font-size: 32px; }

  .seg button, .viewnav button { min-height: 42px; padding: 11px 15px; font-size: 14px; }
  .tile .info { width: 28px; height: 28px; font-size: 13px; top: 10px; right: 10px; }
  .dateinput { min-height: 42px; }

  .filterbar.collapsed .fgroup:not(.always) { display: none; }
  .filter-toggle { display: inline-flex; }
  .plot { height: 220px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ------------------------------------------------------------------ *
 * Acquisition: verdict panel
 * ------------------------------------------------------------------ */

.verdict { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap); }
.vcard {
  background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.vcard.flagged.critical { border-color: var(--bad); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--bad) 40%, transparent); }
.vcard.flagged.warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.vcard h3 { margin: 0 0 4px; font-size: 15.5px; font-weight: 700; }
.v-metric { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.v-metric .v-label {
  font-size: 11.5px; color: var(--ink-3); font-weight: 500;
}
.v-metric .v-value { font-size: 15px; font-weight: 650; }
.v-metric.hero .v-value { font-size: 30px; letter-spacing: -0.02em; }
.v-metric.hero .v-label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.v-value.st-unavailable, .v-value.st-source_unavailable { color: var(--ink-4); font-weight: 500; }
.v-rest { border-top: 1px solid var(--hairline); padding-top: 10px; margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.v-flag {
  display: flex; gap: 9px; align-items: flex-start; margin-top: 6px;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.45;
  border-radius: var(--r-sm); padding: 9px 11px; background: var(--raised);
}
.v-flag .sev {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; flex: none; margin-top: 2px;
  padding: 3px 7px; border-radius: 4px; border: 1px solid var(--hairline-strong); background: var(--panel);
}
.v-flag.critical .sev { color: var(--bad); }
.v-flag.warn .sev { color: var(--warn); }

/* ------------------------------------------------------------------ *
 * Acquisition: table
 * ------------------------------------------------------------------ */

.tabletools { display: flex; gap: 10px; align-items: center; }
.section-head .spacer { flex: 1; }

/* Table-scoped controls (group by / then / filter), sitting with the table. */
.table-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin: 0 0 14px; }

.tablewrap.acq { max-height: 74vh; overflow: auto; border: 1px solid var(--hairline); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); }
.tablewrap.acq table { font-size: 13.5px; }
.tablewrap.acq thead th {
  position: sticky; top: 0; background: var(--panel); z-index: 3;
  box-shadow: 0 1px 0 var(--hairline-strong);
}
.tablewrap.acq thead th:first-child { z-index: 4; }
.tablewrap.acq th:first-child, .tablewrap.acq td:first-child {
  position: sticky; left: 0; background: var(--panel); z-index: 2;
  max-width: 320px; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 1px 0 0 var(--hairline);
}
.tablewrap.acq tfoot td { position: sticky; bottom: 0; background: var(--panel); box-shadow: 0 -1px 0 var(--hairline-strong); }
.tablewrap.acq tfoot td:first-child { z-index: 2; }
.rowkey { font-weight: 500; color: var(--ink); white-space: nowrap; }
tr.child .rowkey { color: var(--ink-2); font-weight: 400; }
.expander {
  background: none; border: 0; color: var(--ink-3); cursor: pointer;
  font: inherit; padding: 0 4px; width: 20px;
}
@media (hover: hover) { .expander:hover { color: var(--ink); } }

.cmp { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.cmp .now { font-weight: 650; }
.cmp .chg { font-size: 11px; font-weight: 650; }
.cmp .chg.good { color: var(--good); }
.cmp .chg.bad { color: var(--bad); }
.cmp .chg.flat, .cmp .chg.none { color: var(--ink-4); }
.cmp .was { font-size: 11px; color: var(--ink-4); }

/* columns picker */
.colpick { position: relative; }
.colpick-btn {
  background: var(--panel); border: 1px solid var(--hairline); color: var(--ink-2);
  border-radius: var(--r-sm); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
@media (hover: hover) { .colpick-btn:hover { background: var(--raised); color: var(--ink); } }
.colpick-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  background: var(--panel); border: 1px solid var(--hairline-strong); border-radius: var(--r);
  padding: 12px 14px; width: 260px; max-height: 60vh; overflow-y: auto;
  box-shadow: var(--shadow-pop);
}
.colpick-panel.open { display: block; }
.colpick-cat {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-4);
  font-weight: 700; margin: 10px 0 5px;
}
.colpick-cat:first-child { margin-top: 0; }
.colpick-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 13px; color: var(--ink-2); cursor: pointer; }
@media (hover: hover) { .colpick-item:hover { color: var(--ink); } }

/* Value filter (media source / campaign multi-select) */
.colpick-btn.on { background: var(--accent-bg); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, transparent); font-weight: 600; }
.colpick-panel.wide { width: 320px; }
.colpick-head { display: flex; gap: 8px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); }
.colpick-head .colpick-btn { flex: 1; text-align: center; }
.filter-search { width: 100%; margin: 2px 0 8px; }
.filter-list { max-height: 190px; overflow-y: auto; margin-bottom: 6px; }
.filter-list .colpick-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-actions { display: flex; gap: 8px; margin-top: 8px; border-top: 1px solid var(--hairline); padding-top: 12px; }
.filter-actions .colpick-btn { flex: 1; text-align: center; }
.colpick-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
@media (hover: hover) { .colpick-btn.primary:hover { background: var(--accent-ink); color: #fff; } }

@media (max-width: 720px) {
  .verdict { grid-template-columns: 1fr; }
  .tablewrap.acq { max-height: none; }
  .colpick-panel { position: fixed; left: 14px; right: 14px; width: auto; top: 20vh; }
}

/* ------------------------------------------------------------------ *
 * Cohort: matrix, day chips, single-column chart row
 * ------------------------------------------------------------------ */

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--panel); border: 1px solid var(--hairline); color: var(--ink-2);
  border-radius: 20px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, transparent); font-weight: 600; }
@media (hover: hover) { .chip:not([aria-pressed="true"]):hover { background: var(--raised); color: var(--ink); } }

.charts.one { grid-template-columns: 1fr; }
.tablewrap.cohort td.empty-row { text-align: left; color: var(--ink-3); padding: 18px 12px; }
.tablewrap.cohort th .badge { margin-left: 5px; }
.section-head .badge { align-self: center; }
td.st-maturing { color: var(--ink-2); background-image: repeating-linear-gradient(135deg, transparent 0 6px, var(--maturing-hatch) 6px 7px); }

@media (max-width: 720px) {
  .chip { min-height: 38px; padding: 8px 14px; font-size: 13px; }
}
