/*
 * Colour tokens copied from AETHER (Harmony-aether-mxo/src/index.css) so this page matches
 * the app it opens from. Dark is the default; [data-theme='light'] is AETHER's light set.
 * Component styling follows AETHER App.css: .app-header, .nav-bar/.nav-tab, .filter-select,
 * .events-table, .status-badge, .theme-toggle.
 */
:root {
  --navy: #0b1d3a;
  --blue: #1a3a6b;
  --accent: #00c8d4;
  --accent-hover: #00a8b4;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --surface: rgba(11, 29, 58, 0.92);
  --glass: rgba(26, 58, 107, 0.55);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --border: rgba(0, 200, 212, 0.25);
  --radius: 6px;

  /* Derived (same recipes AETHER uses inline) */
  --nav-bg: rgba(26, 58, 107, 0.4);
  --row-line: rgba(0, 200, 212, 0.08);
  --row-hover: rgba(0, 200, 212, 0.06);
  --accent-soft: rgba(0, 200, 212, 0.15);
  --amber-soft: rgba(245, 158, 11, 0.15);
  --red-soft: rgba(239, 68, 68, 0.15);
  /* Dashboard highlights (from the Quick DBR), tuned to sit on AETHER navy */
  --late: #ec4899;
  --arrival: var(--red);
  color-scheme: dark;
}

[data-theme='light'] {
  --navy: #f0f4f8;
  --blue: #dce6f0;
  --accent: #0891b2;
  --accent-hover: #0e7490;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --surface: rgba(255, 255, 255, 0.95);
  --glass: rgba(226, 232, 240, 0.7);
  --text: #1e293b;
  --text-dim: #64748b;
  --border: rgba(8, 145, 178, 0.25);

  --nav-bg: rgba(220, 230, 240, 0.6);
  --row-line: rgba(8, 145, 178, 0.12);
  --row-hover: rgba(8, 145, 178, 0.06);
  --accent-soft: rgba(8, 145, 178, 0.12);
  --amber-soft: rgba(217, 119, 6, 0.12);
  --red-soft: rgba(220, 38, 38, 0.1);
  --late: #db2777;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--navy);
  color: var(--text);
  font: 13px/1.4 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body { display: flex; flex-direction: column; overflow: hidden; }

/* ---- Top tabs (AETHER .nav-bar / .nav-tab) ---- */
.tab-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
.tab-bar .tab {
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: color 0.15s, border-color 0.15s;
}
.tab-bar .tab:hover:not(:disabled) { color: var(--text); }
.tab-bar .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.tab-panel[hidden] { display: none; }

/* ---- Daily / Weekly / Custom sliding switch ---- */
.mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.mode-switch .mode-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 999px;
  background: var(--accent);
  transition: transform 0.25s ease;
}
.mode-switch[data-mode='weekly'] .mode-thumb { transform: translateX(100%); }
.mode-switch[data-mode='custom'] .mode-thumb { transform: translateX(200%); }
.mode-switch button {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 5px 0;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.2s;
}
.mode-switch button[aria-checked='true'] { color: #fff; }
.mode-switch button:hover:not(:disabled) { border-color: transparent; color: var(--text); }
.mode-switch button[aria-checked='true']:hover { color: #fff; }
.mode-switch:hover { border-color: var(--accent); }
.mode-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.period-hint { font-size: 11px; color: var(--accent); min-height: 15px; }
.period-hint.snapped { color: var(--amber); }
.period-hint.invalid { color: var(--amber); }
.custom-range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.custom-range input { min-width: 0; padding: 6px 4px; } /* two date inputs side by side in the 240px sidebar */
/* .range label and .custom-range set display, which would override the hidden attribute */
.custom-range[hidden], .range label[hidden] { display: none; }
.identity .period { font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }

/* ---- Always-visible metrics bar (AETHER .app-header) ---- */
.metrics-bar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 260px) 1fr minmax(170px, 200px);
  gap: 8px;
  padding: 8px 12px;
  background: var(--navy);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}
/* Each tab's metric cards share the middle column; the OTP card gets a little more room. */
.metric-group { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(90px, 1fr); gap: 8px; }
.metric-group[hidden] { display: none; }
.metric-group .metric.otp { min-width: 150px; }
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.identity h1 { margin: 0 0 4px; font-size: 16px; font-weight: 700; letter-spacing: 0.04em; }
.identity div { font-size: 12px; color: var(--text-dim); }
.metric { text-align: center; display: flex; flex-direction: column; }
.metric .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.metric .value { font-size: 30px; font-weight: 600; margin: auto 0; color: var(--text); }
.metric.otp .goal { font-size: 11px; color: var(--text-dim); }
.metric.otp .value { font-size: 28px; }
.metric.otp .value.below { color: var(--red); }
.metric.otp .value.met { color: var(--green); }
.metric .partial-note { font-size: 10px; line-height: 1.2; color: var(--amber); }
.metric.partial { border-color: var(--amber); background: var(--amber-soft); }
.metric.partial .value { color: var(--text-dim); }

.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.brand .brand-name { font-size: 20px; font-weight: 700; letter-spacing: 0.04em; }
.brand .brand-name span { color: var(--accent); }
.brand .brand-sub { font-size: 11px; color: var(--text-dim); }

/* Theme toggle (AETHER .theme-toggle) */
.theme-toggle { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.theme-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: background 0.3s, border-color 0.3s;
  display: flex;
  align-items: center;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s;
}
.theme-toggle input:checked + .toggle-slider::before { transform: translateX(22px); }
.toggle-icon { position: absolute; font-size: 11px; line-height: 1; pointer-events: none; }
.theme-toggle input:not(:checked) + .toggle-slider .toggle-icon { left: 28px; }
.theme-toggle input:checked + .toggle-slider .toggle-icon { left: 8px; }
.theme-toggle:hover .toggle-slider { border-color: var(--accent); }
.theme-toggle input:focus-visible + .toggle-slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Sidebar (AETHER .nav-bar / .nav-tab, vertical) + main ---- */
.layout { flex: 1 1 auto; display: flex; min-height: 0; }

.sidebar {
  flex: 0 0 240px;
  background: var(--nav-bg);
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.range { display: grid; gap: 8px; }
.range label { display: grid; gap: 3px; color: var(--text-dim); font-size: 11px; }
.sidebar nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sidebar nav a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sidebar nav a:hover { color: var(--text); background: var(--row-hover); }
.sidebar nav a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); }
.sidebar nav a .count { font-weight: 400; color: var(--text-dim); }
.status { color: var(--text-dim); font-size: 11px; margin-top: auto; }
.status.ok { color: var(--green); }
.status.bad { color: var(--red); }

/* overflow-anchor: none, so banners inserted after load push content down instead of
   scrolling themselves out of view (Chrome scroll anchoring). */
main { flex: 1 1 auto; overflow: auto; overflow-anchor: none; padding: 12px 16px 24px; min-width: 0; }

/* Inputs and buttons (AETHER .filter-select / .filter-search / .nav-new-record-btn) */
input, select, button {
  font: inherit;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
input:focus, select:focus { border-color: var(--accent); }
input::placeholder { color: var(--text-dim); }
select option { background: var(--navy); color: var(--text); }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
#load { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
#load:hover:not(:disabled) { background: var(--accent-hover); color: #fff; }

.banner { margin: 0 0 8px; padding: 8px 12px; border: 1px solid; border-left-width: 4px; border-radius: var(--radius); }
.banner.warning { background: var(--amber-soft); border-color: var(--amber); }
.banner.error { background: var(--red-soft); border-color: var(--red); }
.notes { margin: 0 0 10px; color: var(--text-dim); }
.notes summary { cursor: pointer; }
.notes ul { margin: 4px 0 6px; padding-left: 20px; }

/* ---- Sections ---- */
.section {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}

/* Snip-to-clipboard button, top-right of every section (public/snip.mjs) */
.snip-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  padding: 0;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
}
.snip-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--border); background: var(--glass); }
.snip-btn:disabled { opacity: 0.5; cursor: progress; }

/* Post-to-Pippin button, left of the snip button (public/pippin.mjs) */
.post-btn {
  position: absolute;
  top: 6px;
  right: 42px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  width: 112px;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
}
.post-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--border); background: var(--glass); }
.post-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Post-to-Airwalker button, left of the Pippin button (public/airwalker.mjs) */
.aw-post-btn {
  position: absolute;
  top: 6px;
  right: 156px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  width: 128px;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
}
.aw-post-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--border); background: var(--glass); }
.aw-post-btn:disabled { opacity: 0.45; cursor: not-allowed; }
/* Keep heading text clear of the three buttons (more specific than the later .section-head button rule) */
.section > .section-head button { padding-right: 300px; }

/* Pippin destination box in the sidebar */
.pippin-target { display: grid; gap: 3px; color: var(--text-dim); font-size: 11px; }
.pippin-target input { width: 100%; box-sizing: border-box; font-size: 11px; }
.pippin-target-status { display: grid; gap: 2px; min-height: 15px; overflow-wrap: anywhere; }
.pippin-target-status .ok { color: var(--green); }
.pippin-target-status .warn { color: var(--amber); }
.pippin-target-status .bad { color: var(--red); }

/* Only inside a snip image: page font and the caption line under the heading */
.snip-root { font: 13px/1.4 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--text); padding: 0; }
.snip-caption { padding: 0 14px 8px 30px; margin-top: -4px; font-size: 12px; color: var(--accent); font-weight: 600; }
/* Caption as the first line, when the section heading is left out of the snip (BLUF) */
.snip-caption.snip-caption-top { padding: 12px 14px 8px 14px; margin-top: 0; font-size: 14px; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  background: var(--navy);
  color: var(--text);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: opacity 0.25s;
}
.toast.bad { border-left-color: var(--red); }
.toast[hidden] { display: block; opacity: 0; pointer-events: none; }
.section-head { margin: 0; font-size: 14px; font-weight: 600; }
.section-head button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  letter-spacing: 0.02em;
}
.section-head button:hover:not(:disabled) { color: var(--accent); }
.section-head button::before { content: '▸'; color: var(--accent); }
.section-head button[aria-expanded='true']::before { content: '▾'; }
.section-head .count { color: var(--text-dim); font-weight: 400; font-size: 12px; }
.section-body { padding: 0 14px 14px; }
.empty { color: var(--text-dim); padding: 12px 4px; font-style: italic; }

/* Report tables (AETHER .events-table) */
.report-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.report { border-collapse: collapse; width: 100%; font-size: 12px; }
table.report th {
  background: var(--navy);
  padding: 8px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}
table.report td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--row-line);
  text-align: center;
  vertical-align: middle;
}
table.report tbody tr { transition: background 0.12s; }
table.report tbody tr:hover { background: var(--row-hover); }
table.report th.wide { width: 40%; }
table.report td.reason { text-align: left; white-space: normal; line-height: 1.35; }
table.report th.wide-half { width: 28%; }
table.report.audited td.reason { font-size: 11.5px; }
table.report td.late { background: var(--late); color: #fff; font-weight: 700; }
table.report td.arrival { background: var(--arrival); color: #fff; font-weight: 700; }
table.report td.blank { color: var(--text-dim); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* Mx Operations Performance: one row of three cards per region / carrier */
.ops-grid { display: grid; grid-template-columns: repeat(3, minmax(160px, 260px)); gap: 8px; }
.ops-grid .metric { min-height: 104px; padding: 10px 12px; }
.ops-grid .metric .label { font-size: 12px; }
.ops-grid .metric .value { font-size: 26px; }
.ops-grid .metric .value.nodata { color: var(--text); font-size: 22px; }
.ops-grid .metric.otp .value.below { color: var(--red); }
.ops-grid .metric.otp .value.met { color: var(--green); }
.ops-grid .metric.extra { border-style: dashed; }
.ops-note { grid-column: 1 / -1; color: var(--text-dim); font-size: 11px; font-style: italic; }

/* OOS Event Metrics: Quick's KPI row, then the two tables side by side (.agents/tasks/oos-metrics/layout/layout.md) */
.oos-kpi-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.oos-kpi-tile { position: relative; }
.oos-kpi-slot { height: 100%; }
.oos-kpi-tile .oos-kpi { box-sizing: border-box; height: 100%; min-height: 112px; padding: 34px 10px 12px; }
.oos-kpi .label { text-transform: none; letter-spacing: 0; font-size: 12px; line-height: 1.25; }
.oos-kpi .value { font-size: 28px; }
.oos-kpi .value.nodata { font-size: 20px; }
.oos-kpi-tile > .snip-btn { top: 4px; right: 4px; }
.oos-kpi-tile > .post-btn { top: 4px; right: 36px; }
/* KPI cards (.oos-kpi-row: repeat(7, minmax(0, 1fr))): icons only; three 30px icons need 98px */
.oos-kpi-tile > .post-btn, .oos-kpi-tile > .aw-post-btn { width: 30px; padding: 0; justify-content: center; }
.oos-kpi-tile > .post-btn span, .oos-kpi-tile > .aw-post-btn span { display: none; }
.oos-kpi-tile > .aw-post-btn { top: 4px; right: 68px; }
.oos-table-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; margin-bottom: 10px; }
.oos-table-row[hidden] { display: none; }
.oos-table-row > .section { margin-bottom: 0; min-width: 0; }
@media (max-width: 1200px) {
  .oos-kpi-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .oos-table-row { grid-template-columns: 1fr; }
}
/* data-pinned sections never collapse: no caret, plain title */
.section[data-pinned] > .section-head button { cursor: default; color: var(--text); }
.section[data-pinned] > .section-head button::before { content: none; }
.oos-panel .report-wrap { display: inline-block; max-width: 100%; border: 0; }
table.report.oos-table { width: auto; }
table.report.oos-table th { background: var(--glass); color: var(--text); font-weight: 700; text-transform: none; letter-spacing: 0; border: 1px solid var(--border); }
table.report.oos-table td, table.report.oos-table td.num { text-align: center; border: 1px solid var(--border); }
table.report.oos-table tbody tr:nth-child(even) { background: var(--glass); }

/* BLUF */
.bluf-status { color: var(--text-dim); font-size: 12px; font-style: italic; padding: 6px 0; }
.bluf-status:empty { display: none; }
.bluf-notes { margin: 0 0 8px; padding-left: 18px; color: var(--text-dim); font-size: 11px; }
.bluf-notes li.warning { color: var(--amber); }
.bluf-text {
  white-space: pre-wrap;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  line-height: 1.5;
}
.bluf-text:empty { display: none; }
.bluf-text p { margin: 0 0 10px; white-space: pre-line; }
.bluf-text p:last-child { margin-bottom: 0; }
.bluf-text[hidden] { display: none; }
.bluf-editor {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  resize: vertical;
  font: inherit;
  line-height: 1.5;
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.bluf-editor[hidden] { display: none; }
.bluf-actions { margin-bottom: 10px; }
.bluf-actions button + button { margin-left: 6px; }
.bluf-actions button:disabled { cursor: not-allowed; }
.bluf-edited { margin-left: 10px; font-size: 11px; font-style: italic; color: var(--accent); }
.bluf-edited[hidden] { display: none; }
/* Numbers table toggle: collapsed by default, chevron as on the section heads */
.bluf-metrics-bar { margin-bottom: 8px; }
.bluf-metrics-toggle::before { content: '▸'; color: var(--accent); margin-right: 6px; }
.bluf-metrics-toggle[aria-expanded='true']::before { content: '▾'; }
.report-wrap[hidden] { display: none; }
table.report td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* FCP trend charts */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.chart-card { background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px 4px; }
.chart-card h3 { margin: 0 0 2px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text); }
.chart-card .chart-total { text-align: center; font-size: 11px; color: var(--text-dim); }
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart .grid { stroke: var(--row-line); stroke-width: 1; }
.bar-chart .axis { stroke: var(--text-dim); stroke-width: 1; }
.bar-chart .tick, .bar-chart .xlabel { fill: var(--text-dim); font-size: 10px; }
.bar-chart .value { fill: var(--text); font-size: 11px; font-weight: 600; }
.bar-chart .legend { fill: var(--text); font-size: 11px; }
.chart-grid.history { grid-template-columns: 1fr; }

/* FCP controls (not a section, never snipped) and the filter note inside filtered sections */
.fcp-filters {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; padding: 8px 10px;
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius);
}
.fcp-filters[hidden] { display: none; }
.fcp-filters label { color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.fcp-filter-code { position: relative; font-size: 11px; color: var(--text-dim); }
.fcp-filter-code summary { cursor: pointer; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.fcp-filter-code summary span { color: var(--text); }
.fcp-filter-code[open] summary { border-color: var(--accent); }
.fcp-filter-code-list {
  position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; min-width: 220px; max-height: 280px; overflow: auto;
  display: flex; flex-direction: column; gap: 4px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.fcp-filter-code-list label { color: var(--text); white-space: nowrap; }
.fcp-filter-code-list input[type='checkbox'] { padding: 0; margin: 0; accent-color: var(--accent); }
.filter-note { margin: 0 0 8px; color: var(--amber); font-size: 11px; font-style: italic; }
.filter-note[hidden] { display: none; }

/* Full dataset explorer */
.explorer-controls { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding-bottom: 10px; }
.explorer-controls label { color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.column-filters { display: contents; }
#text-filter { min-width: 220px; }
select { max-width: 220px; cursor: pointer; }
.row-count { margin-left: auto; color: var(--text-dim); font-style: italic; }
.explorer-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius); }
table.explorer { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12px; }
table.explorer th, table.explorer td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--row-line);
  white-space: nowrap;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
table.explorer th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--navy);
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
table.explorer tbody tr:hover { background: var(--row-hover); }
table.explorer td.null { color: var(--text-dim); opacity: 0.6; }
table.explorer td.null::after { content: '—'; }
.show-all { margin-top: 10px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--glass); border: 1px solid var(--border); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* Hosted sign-in (boot.mjs): the signed-in user in the header, and the full-page auth messages. */
#auth-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-dim); }
#auth-bar[hidden] { display: none; }
#auth-bar .auth-user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
#auth-bar button, .auth-page button {
  background: var(--accent-soft); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font: inherit; cursor: pointer;
}
#auth-bar button:hover, .auth-page button:hover { border-color: var(--accent); }
.auth-page { max-width: 560px; margin: 15vh auto; padding: 24px; text-align: center; color: var(--text); }
.auth-page h1 { font-size: 20px; margin: 0 0 12px; }
.auth-page p { color: var(--text-dim); margin: 0 0 16px; overflow-wrap: anywhere; }
