:root {
  color-scheme: light;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --page: #f6f6f3;
  --surface-1: #fcfcfb;
  --surface-2: #f0efec;
  --border: rgba(11, 11, 11, 0.10);
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --accent: #2a78d6;
  --accent-wash: rgba(42, 120, 214, 0.10);

  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;

  --delta-up: #e34948;    /* spend increase (diverging red pole) */
  --delta-down: #2a78d6;  /* spend decrease (diverging blue pole) */
  --total: #898781;
  --good-text: #006300;
  --bad-text: #c42f2f;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --good: #0ca30c;

  /* Roles the themes restyle without touching components */
  --font-display: var(--font-sans);
  --link: var(--accent);
  --single: var(--series-1);        /* one-series marks: bar lists, daily bars */
  --logo-ink: #0b0b0b;              /* Cloudec wordmark */
  --side-bg: var(--surface-1);
  --side-text: var(--text-secondary);
  --side-strong: var(--text-primary);
  --side-muted: var(--text-muted);
  --side-hover: var(--surface-2);
  --side-active: var(--accent-wash);
  --side-border: var(--border);
  --btn-radius: 6px;
  --brand-strip: none;
  --ai-ink: #6250d6;                /* marks AI-written content */
  --ai-wash: rgba(98, 80, 214, 0.08);
  --ai-line: rgba(98, 80, 214, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface-1: #1a1a19; --surface-2: #232321; --border: rgba(255, 255, 255, 0.10);
    --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --accent: #3987e5; --accent-wash: rgba(57, 135, 229, 0.16);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --delta-up: #e66767; --delta-down: #3987e5; --good-text: #0ca30c; --bad-text: #e66767;
    --logo-ink: #f0efec; --ai-ink: #9085e9; --ai-wash: rgba(144, 133, 233, 0.10); --ai-line: rgba(144, 133, 233, 0.40);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface-1: #1a1a19; --surface-2: #232321; --border: rgba(255, 255, 255, 0.10);
  --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --accent: #3987e5; --accent-wash: rgba(57, 135, 229, 0.16);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --delta-up: #e66767; --delta-down: #3987e5; --good-text: #0ca30c; --bad-text: #e66767;
  --logo-ink: #f0efec; --ai-ink: #9085e9; --ai-wash: rgba(144, 133, 233, 0.10); --ai-line: rgba(144, 133, 233, 0.40);
}

/* Cloudec brand theme, from cloudec.com.au: black sections over white content,
   orange (#ff8d10) pill calls to action, the yellow -> orange -> magenta gradient,
   Montserrat headings and Poppins body. Chart series keep the validated palette. */
:root[data-theme="cloudec"] {
  color-scheme: light;
  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Montserrat", "Poppins", system-ui, sans-serif;
  --page: #f4f4f2;
  --surface-1: #ffffff;
  --surface-2: #f3f3f3;
  --border: rgba(0, 0, 0, 0.09);
  --text-primary: #111111;
  --text-secondary: #4a4a4a;
  --text-muted: #85837d;
  --accent: #ff8d10;
  --accent-wash: rgba(255, 141, 16, 0.12);
  --link: #c84f0c;
  --single: #f15f22;
  --logo-ink: #ffffff;
  --side-bg: #000000;
  --side-text: rgba(255, 255, 255, 0.72);
  --side-strong: #ffffff;
  --side-muted: rgba(255, 255, 255, 0.45);
  --side-hover: rgba(255, 255, 255, 0.08);
  --side-active: rgba(255, 141, 16, 0.18);
  --side-border: rgba(255, 255, 255, 0.10);
  --btn-radius: 30px;
  --brand-strip: linear-gradient(90deg, #ffc80a 0%, #f15f22 50%, #ed1067 100%);
  --ai-ink: #ed1067;
  --ai-wash: rgba(237, 16, 103, 0.06);
  --ai-line: rgba(237, 16, 103, 0.30);
}
:root[data-theme="cloudec"] .btn.primary { text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; font-size: 12px; padding: 7px 16px; }
:root[data-theme="cloudec"] .tile.hero .tile-value {
  background: linear-gradient(90deg, #f15f22, #ed1067); -webkit-background-clip: text; background-clip: text; color: transparent;
}
:root[data-theme="cloudec"] .sidebar nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
:root[data-theme="cloudec"] .sidebar select { background: #111; color: #fff; border-color: var(--side-border); }
:root[data-theme="cloudec"] .seg button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--accent); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--text-primary);
  font: 14px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; font-family: var(--font-display); }
h1 { font-weight: 700; }
h1 { font-size: 26px; }
h2 { font-size: 15px; }
.h3 { font-size: 13px; margin: 16px 0 8px; color: var(--text-secondary); }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

/* Shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px 14px; background: var(--side-bg); color: var(--side-text); border-right: 1px solid var(--side-border);
}
.brand { display: grid; gap: 2px; padding: 0 6px 4px; color: var(--side-strong); }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 148px; color: var(--logo-ink); }
.brand-logo svg { display: block; width: 100%; height: auto; }
.brand-logo svg path:not([class]) { fill: currentColor; }
.brand-sub { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--side-muted); padding-left: 2px; }
.sidebar .muted { color: var(--side-muted); }
.client-pick { display: grid; gap: 4px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a {
  color: var(--side-text); padding: 6px 10px; border-radius: 6px;
  display: flex; align-items: center; gap: 6px;
}
.sidebar nav a:hover { background: var(--side-hover); text-decoration: none; }
.sidebar nav a[aria-current="page"] { background: var(--side-active); color: var(--side-strong); font-weight: 550; }
.nav-label { margin: 14px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--side-muted); }
.ai-dot { margin-left: auto; font-size: 10px; font-weight: 600; padding: 0 5px; border-radius: 4px; border: 1px solid var(--side-border); color: var(--side-text); }
.sidebar .badge { background: transparent; border-color: var(--side-border); color: var(--side-text); }
.theme-pick { display: grid; gap: 4px; }

/* Brand strip and client bar */
main { position: relative; }
main::before { content: ""; display: block; height: 4px; background: var(--brand-strip); }
.client-bar {
  display: flex; align-items: center; gap: 14px; padding: 14px 32px;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
}
.client-logo {
  height: 44px; max-width: 160px; padding: 4px 8px; border-radius: 8px; background: #ffffff;
  border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden;
}
.client-logo img { height: 36px; width: auto; max-width: 144px; object-fit: contain; display: block; }
.client-mono {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-wash); color: var(--text-primary); font: 700 18px var(--font-display); text-transform: uppercase;
}
.client-name { font: 650 17px/1.2 var(--font-display); text-transform: capitalize; }
.client-meta { font-size: 12px; color: var(--text-muted); }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; }

main { min-width: 0; }
.page { padding: 28px 32px 48px; max-width: 1440px; margin: 0 auto; display: grid; gap: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; font-size: 12px; color: var(--text-muted); }
.sub { margin: 2px 0 0; color: var(--text-muted); font-size: 12.5px; }

/* Controls */
select, input[type="search"] {
  font: inherit; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px;
  padding: 6px 12px; border-radius: var(--btn-radius); border: 1px solid var(--border);
  background: var(--surface-1); color: var(--text-primary); cursor: pointer;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.disabled { opacity: 0.4; cursor: default; }
.btn.ghost { background: transparent; }
.btn.small { font-size: 12px; padding: 4px 8px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 8px 0 0; }
.pager, .pickers { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pickers label { display: flex; gap: 6px; align-items: center; color: var(--text-secondary); font-size: 13px; }
.pickers select:disabled { opacity: 0.5; cursor: default; }
.view-pickers { justify-content: flex-end; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; padding: 2px; gap: 2px; background: var(--surface-2); }
.seg button { font: inherit; font-size: 12px; border: 0; background: transparent; color: var(--text-secondary); padding: 4px 10px; border-radius: 5px; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg button:disabled { opacity: 0.4; cursor: default; }
.quick { margin: -8px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--text-muted); font-size: 12.5px; }

/* Badges & chips */
.status-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -8px; }
.badge {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500;
  padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-secondary); background: var(--surface-1);
}
.badge.final span { color: var(--good); }
.badge.partial span { color: var(--warning); }
.badge.muted { color: var(--text-muted); }
.badge.tiny { font-size: 10px; padding: 0 6px; }
.chip { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); }
.chip.ok { background: var(--accent-wash); color: var(--text-primary); }
a.chip:hover { text-decoration: none; background: var(--accent-wash); }

/* Panels & grids */
.panel { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2.tight { gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.col { display: grid; gap: 16px; min-width: 0; }
.side .sticky { position: sticky; top: 16px; }
.report-scroll { max-height: 70vh; overflow-y: auto; padding-right: 6px; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; display: grid; gap: 4px; align-content: start; }
.tile-label { font-size: 12.5px; color: var(--text-secondary); }
.info-link { color: var(--text-muted); text-decoration: none; font-size: 0.95em; }
.info-link:hover { color: var(--text-secondary); }
.measure-note { margin: 8px 0 0; }
.tile-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.tile.hero .tile-value { font-size: 34px; }
.tile-foot { font-size: 12px; color: var(--text-muted); }
.delta { font-size: 12.5px; font-weight: 550; font-variant-numeric: tabular-nums; }
.delta.good { color: var(--good-text); }
.delta.bad { color: var(--bad-text); }
.delta.neutral { color: var(--text-secondary); }
.delta-label { color: var(--text-muted); font-weight: 400; }

/* Charts */
.chart { width: 100%; }
.chart-foot { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); }

/* Bar list */
.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.barlist li { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(32px, 1fr) auto 44px; gap: 10px; align-items: center; font-size: 13px; }
.bl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-sub { color: var(--text-muted); font-size: 11.5px; margin-left: 6px; }
.bl-bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bl-bar span { display: block; height: 100%; background: var(--single); border-radius: 0 4px 4px 0; }
.bl-value { font-variant-numeric: tabular-nums; text-align: right; }
.bl-pct { font-variant-numeric: tabular-nums; text-align: right; color: var(--text-muted); font-size: 12px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--text-muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.table td { padding: 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.table.compact td { padding: 5px 8px; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table .c { text-align: center; }
.table tr.total td { font-weight: 600; border-top: 1px solid var(--axis); }
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover { background: var(--surface-2); }
.table tr[aria-selected="true"] { background: var(--accent-wash); }
.ellip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot-flag { color: var(--serious); }

/* Key/value */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--text-secondary); display: flex; align-items: center; gap: 6px; text-transform: none; }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mix { display: flex; height: 10px; gap: 2px; border-radius: 5px; overflow: hidden; margin-bottom: 12px; }
.mix-seg, .key-dot { background: var(--text-muted); }
.key-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
[data-k="on_demand"] { background: var(--series-1); }
[data-k="savings_plans"] { background: var(--series-2); }
[data-k="reserved_instances"] { background: var(--series-3); }
[data-k="spot"] { background: var(--series-4); }
ul.plain { margin: 0; padding-left: 18px; font-size: 13px; }

/* Signals */
.signals { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.signal { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.signal-icon {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--serious); color: #fff; font-weight: 700; font-size: 12px;
}
.signal-title { font-weight: 550; font-size: 13.5px; }
.signal-detail { font-size: 12.5px; color: var(--text-secondary); }
details.quiet { margin-top: 14px; font-size: 12.5px; color: var(--text-muted); }
details.quiet summary { cursor: pointer; }
ul.passed { list-style: none; padding: 6px 0 0; margin: 0; display: grid; gap: 2px; }

/* Callouts */
.callout { border: 1px solid var(--border); border-left: 3px solid var(--text-muted); background: var(--surface-1); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.callout summary { cursor: pointer; }
.callout summary span { color: var(--text-secondary); font-weight: 400; }
.callout ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-secondary); }
.callout.warn { border-left-color: var(--warning); }
.callout.error { border-left-color: var(--critical); }
.loading, .empty { padding: 40px; text-align: center; color: var(--text-muted); }

/* Markdown report */
.prose { font-size: 13.5px; line-height: 1.6; color: var(--text-primary); }
.prose h1 { font-size: 18px; margin: 0 0 8px; }
.prose h2 { font-size: 15px; margin: 18px 0 6px; }
.prose h3 { font-size: 13.5px; margin: 14px 0 4px; }
.prose p, .prose li { color: var(--text-secondary); }
.prose hr { border: 0; border-top: 1px solid var(--grid); margin: 14px 0; }
.prose table { border-collapse: collapse; font-size: 12px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--grid); padding: 4px 6px; text-align: left; }

/* Provenance */
.provenance { font-size: 12.5px; color: var(--text-secondary); }
.provenance summary { cursor: pointer; color: var(--text-muted); }
.provenance dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 10px 0 0; }
.provenance dt { color: var(--text-muted); }
.provenance dd { margin: 0; }
.linklist { margin: 0; padding-left: 18px; }

/* Explorer */
.explore { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.section-nav { position: sticky; top: 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 10px; max-height: calc(100vh - 32px); overflow-y: auto; }
.section-nav input { width: 100%; margin-bottom: 8px; }
.section-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.section-nav a { display: block; padding: 5px 8px; border-radius: 6px; color: var(--text-secondary); font-size: 13px; }
.section-nav a[aria-current="page"] { background: var(--accent-wash); color: var(--text-primary); font-weight: 550; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; font-size: 12.5px; }
.meta dt { color: var(--text-muted); }
.meta dd { margin: 0 0 0 -14px; color: var(--text-secondary); }
.warn { color: var(--text-secondary); }
pre.raw { max-height: 420px; overflow: auto; background: var(--surface-2); border-radius: 8px; padding: 12px; font: 12px/1.5 var(--font-mono); margin: 12px 0 0; }

/* Responsive */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  .side .sticky { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
  .nav-label { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; display: flex; align-items: center; }
  .page { padding: 20px 16px 40px; }
  .client-bar { padding: 12px 16px; }
  .brand-logo { width: 116px; }
  .grid-2, .explore { grid-template-columns: 1fr; }
  .section-nav { position: static; max-height: 240px; }
  .ellip { max-width: 180px; }
}

/* AI-generated content is always marked */
.ai-badge {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; margin-left: 6px;
  font: 600 11px/1 var(--font-sans); letter-spacing: 0.02em; padding: 4px 8px; border-radius: 999px;
  color: var(--text-primary); background: var(--ai-wash); border: 1px solid var(--ai-line);
}
.ai-badge span { color: var(--ai-ink); }
.ai-summary { border-color: var(--ai-line); box-shadow: inset 4px 0 0 var(--ai-ink); }
.ai-summary-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; }
.ai-summary-grid .h3 { margin-top: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.check span { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: #fff; }
.check.ok span { background: var(--good); }
.check.review span { background: var(--warning); color: #0b0b0b; }
.check-detail ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-secondary); }
.rule-badge { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; margin-left: 6px; font: 600 11px/1 var(--font-sans); padding: 4px 8px; border-radius: 999px; color: var(--text-secondary); border: 1px solid var(--border); }
@media (max-width: 860px) { .ai-summary-grid { grid-template-columns: 1fr; } }

/* Sidebar guide link */
.guide-link { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--side-text); padding: 4px 6px; border-radius: 6px; }
.guide-link span { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--side-border); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.guide-link:hover, .guide-link[aria-current="page"] { color: var(--side-strong); background: var(--side-hover); text-decoration: none; }

/* AI insights explorer */
.nav-group { margin: 6px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.nav-group ~ .nav-group { margin-top: 14px; }
.nav-empty { margin: 0 8px; }
.section-nav ul.runs { margin: 2px 0 6px 12px; border-left: 1px solid var(--grid); padding-left: 6px; }
.section-nav ul.runs a { font-size: 12px; padding: 3px 8px; }
.run-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.run-title { font-size: 18px; margin-bottom: 10px; }
.run-head .status-row { margin-top: 0; }
.kv.wide { grid-template-columns: 120px 1fr; }
.kv.wide dd { text-align: left; }
.flag-note { margin: -4px 0 12px; }

/* User guide */
.guide .panel p, .guide li, .guide dd { color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; }
.guide .panel > p:first-of-type { margin-top: 0; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-toc a { font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); }
.guide-toc a:hover { color: var(--text-primary); text-decoration: none; background: var(--surface-2); }
.guide-table td:first-child { white-space: nowrap; font-weight: 550; }
.guide-kv { grid-template-columns: minmax(150px, max-content) 1fr; gap: 12px 20px; }
.guide-kv dt { color: var(--text-primary); font-weight: 550; align-items: flex-start; }
.guide-kv dd { text-align: left; }
.guide-list { padding-left: 18px; margin: 0; display: grid; gap: 8px; }
.pipeline { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: stage; }
.pipeline .stage { position: relative; display: grid; gap: 6px; align-content: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 12.5px; }
.pipeline .stage b { color: var(--text-primary); font-size: 13px; }
.pipeline .stage span { color: var(--text-secondary); }
.pipeline .stage + .stage::before { content: "→"; position: absolute; left: -22px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; }
.pipeline .stage.raw { opacity: 0.6; border-style: dashed; }
.pipeline .stage.app { border-color: var(--accent); background: var(--accent-wash); }
@media (max-width: 1000px) {
  .pipeline { grid-template-columns: 1fr; gap: 22px; }
  .pipeline .stage + .stage::before { content: "↓"; left: 50%; top: -20px; transform: translateX(-50%); }
  .guide-kv { grid-template-columns: 1fr; }
}
.sidebar-foot .guide-link { justify-self: start; }

/* Collapsible AI summary */
details.ai-summary > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
details.ai-summary > summary::-webkit-details-marker { display: none; }
details.ai-summary[open] > summary { margin-bottom: 12px; }
details.ai-summary .chev { display: inline-block; width: 16px; color: var(--text-muted); transition: transform 0.15s; }
details.ai-summary[open] .chev { transform: rotate(90deg); }
.run-actions { display: flex; gap: 8px; flex-wrap: wrap; }
details.quiet-panel > summary { cursor: pointer; list-style: none; }
details.quiet-panel > summary::-webkit-details-marker { display: none; }
details.quiet-panel > summary h2::before { content: "▸ "; color: var(--text-muted); }
details.quiet-panel[open] > summary h2::before { content: "▾ "; }
details.quiet-panel[open] > summary { margin-bottom: 8px; }
.run-head a:hover .check { background: var(--surface-2); }
.guide-list.tight { gap: 4px; margin-top: 6px; }
.guide-table td { vertical-align: top; }
.guide-table td:nth-child(2), .guide-table td:nth-child(3) { min-width: 220px; }
.check-table td:first-child { white-space: normal; min-width: 150px; }

/* Compare: links out to AI insights */
.insight-link { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--ai-line); border-radius: 10px; background: var(--ai-wash); }
.insight-link-main { display: grid; gap: 4px; color: var(--text-primary); }
.insight-link-main span { font-size: 12.5px; color: var(--text-secondary); }
.insight-link-main:hover { text-decoration: none; }
.insight-link-main:hover b { text-decoration: underline; }
.insight-link-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
details.quiet-panel > summary.panel-head { margin-bottom: 0; }
details.quiet-panel[open] > summary.panel-head { margin-bottom: 12px; }

/* Customer links and details */
.link-icon {
  width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; flex: none;
  background: #ffffff; border: 1px solid rgba(0, 0, 0, 0.08);
}
.link-icon img { width: 14px; height: 14px; object-fit: contain; display: block; }
.link-icon.plain { font: 700 11px/1 var(--font-sans); color: var(--text-secondary); background: var(--surface-2); }
.link-cards .link-icon { width: 28px; height: 28px; border-radius: 7px; }
.link-cards .link-icon img { width: 18px; height: 18px; }
.sidebar nav a.ext .ext-mark { margin-left: auto; font-size: 11px; color: var(--side-muted); }
.sidebar nav a.is-placeholder { opacity: 0.7; }
.chip.placeholder { background: transparent; border: 1px dashed var(--text-muted); color: var(--text-muted); font-size: 10.5px; padding: 0 6px; vertical-align: middle; }
.lead { margin: 0 0 12px; color: var(--text-secondary); font-size: 14px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.people li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-wash); color: var(--text-primary); font: 600 13px var(--font-display); }
.contact-lines { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.link-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.link-cards a { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-primary); height: 100%; }
.link-cards a:hover { background: var(--surface-2); text-decoration: none; }
.block { display: block; }
.url { overflow-wrap: anywhere; }
pre.raw.left { text-align: left; max-width: 560px; margin: 12px auto 0; }

.btn.ai-btn { border-color: var(--ai-line); background: var(--ai-wash); }
.btn.ai-btn span { color: var(--ai-ink); }
details.ai-summary > summary.panel-head { align-items: center; }
.person-notes { color: var(--text-secondary); margin-top: 2px; }
.kv.company { grid-template-columns: 170px 1fr; }

/* Sidebar sub-item */
.sidebar nav a.sub { padding-left: 26px; font-size: 13px; }
.sidebar nav a.sub::before { content: "↳"; margin-left: -14px; color: var(--side-muted); font-size: 11px; }

/* MFF deck prep */
.mff-checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 20px; }
.mff-checklist li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 4px 0; border-bottom: 1px solid var(--grid); font-size: 13px; }
.mff-checklist li > a { color: var(--text-primary); display: inline-flex; gap: 8px; align-items: center; flex: 1; min-width: 160px; }
.mff-checklist .muted { width: 100%; padding-left: 30px; }
.slide-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); color: var(--text-secondary); font: 600 11.5px var(--font-sans); }
.mff-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.mff-status span { width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; font-size: 9.5px; color: #fff; }
.mff-status.ready span { background: var(--good); }
.mff-status.review span { background: var(--warning); color: #0b0b0b; }
.mff-status.input span { background: var(--ai-ink); }
.mff-status.nodata span { background: var(--text-muted); }
.mff-slide { display: grid; gap: 8px; scroll-margin-top: 16px; }
.mff-slide-head { display: flex; align-items: center; gap: 10px; }
.mff-slide-head h2 { font-size: 15px; margin-right: auto; }
.mff-sources { margin: 0; font-size: 11.5px; color: var(--text-muted); }

/* The slide preview is always light, like the deck, whatever the app theme. */
.slide {
  --surface-1: #ffffff; --surface-2: #f3f3f3; --text-primary: #2b2b2b; --text-secondary: #4a4a4a; --text-muted: #85837d;
  --grid: #e6e5e0; --axis: #c3c2b7; --border: rgba(0,0,0,0.09); --link: #c84f0c;
  --font-sans: "Poppins", system-ui, sans-serif; --font-display: "Montserrat", "Poppins", system-ui, sans-serif;
  color-scheme: light; background: #ffffff; color: #2b2b2b; border: 1px solid var(--border); border-radius: 10px;
  padding: 22px 28px 18px; display: grid; gap: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 10px solid #f15f22;
}
.slide-title { font: 700 24px/1.2 var(--font-display); color: #2b2b2b; padding-bottom: 8px; border-bottom: 2px solid #f15f22; }
.slide-headline { display: flex; gap: 12px; align-items: flex-start; }
.slide-headline p { margin: 0; flex: 1; font-size: 13.5px; color: #2b2b2b; }
.slide-headline p::before { content: "Generated text · "; color: #85837d; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.slide .btn { background: #fff; color: #2b2b2b; border-color: rgba(0,0,0,0.12); }
.slide .btn:hover { background: #f3f3f3; }
.slide-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.slide-kpi { border: 1px solid rgba(0,0,0,0.08); border-top: 5px solid #3a3a3a; border-radius: 4px; padding: 10px 12px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.08); background: #fff; }
.slide-kpi.down { border-top-color: #2e9e4f; background: #e9f8ee; }
.slide-kpi.up { border-top-color: #d93a3a; background: #fdecec; }
.slide-kpi .k-label { font-size: 12.5px; color: #4a4a4a; }
.slide-kpi .k-value { font: 700 21px/1.3 var(--font-display); color: #2b2b2b; }
.slide-kpi.down .k-value { color: #1f7a3b; }
.slide-kpi.up .k-value { color: #b42525; }
.slide-block { display: grid; gap: 6px; }
.slide-subtitle { font: 600 14px var(--font-display); color: #2b2b2b; display: flex; align-items: center; gap: 4px; }
.slide-tools { display: flex; justify-content: flex-end; gap: 6px; }
.slide-table { width: 100%; border-collapse: collapse; font-size: 12.5px; color: #2b2b2b; }
.slide-table th { background: #f15f22; color: #fff; font-weight: 600; padding: 7px 10px; text-align: center; border: 1px solid #f15f22; white-space: nowrap; }
.slide-table th.l { text-align: left; }
.slide-table td { padding: 6px 10px; border: 1px solid #ebebeb; text-align: center; font-variant-numeric: tabular-nums; }
.slide-table td.l { text-align: left; }
.slide-table td.strong { font-weight: 700; }
.slide-table td.em { font-style: italic; color: #4a4a4a; }
.slide-table td.down { color: #1f8a43; }
.slide-table td.up { color: #c62828; }
.slide-table tbody tr:nth-child(even) td { background: #f6f8fa; }
.slide-table tr.key td.strong:not(.l) { background: #3a3a3a; color: #fff; }
.slide-table tr.total td { background: #fdeee6 !important; font-weight: 700; }
.slide-table.compact td { padding: 4px 8px; }
.tier { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 3px; }
.tier.watch { background: #fff3d6; color: #8a5a00; }
.tier.saving { background: #e1f5e7; color: #1f7a3b; }
.tier.stable { background: #f0f0f0; color: #2b2b2b; }
.slide-note { margin: 0; font-size: 11px; font-style: italic; color: #85837d; }
.slide-empty { margin: 0; color: #4a4a4a; font-size: 13.5px; }
.slide .raw { background: #f3f3f3; color: #2b2b2b; }
.cover { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; min-height: 180px; }
.cover-cloudec { height: 38px; }
.cover-client { height: 48px; max-width: 160px; object-fit: contain; justify-self: end; }
.cover-text { grid-column: 1 / -1; display: grid; gap: 4px; }
.cover-title { font: 700 26px var(--font-display); color: #2b2b2b; }
.cover-client-name { font: 700 26px var(--font-display); color: #f15f22; }
.cover-month { font: 700 15px var(--font-display); color: #2b2b2b; margin-top: 12px; }
.cover.thanks { grid-template-columns: 1fr; }
.ai-block { border: 1px solid var(--ai-line); background: rgba(237, 16, 103, 0.04); border-radius: 8px; padding: 10px 14px; }
.ai-block .prose p, .ai-block .prose li { color: #2b2b2b; }
.obs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.mover { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; border: 1px solid #ebebeb; border-radius: 8px; padding: 10px; font-size: 12.5px; }
.mover-text { display: grid; gap: 6px; align-content: start; }
.mover-name { font: 700 15px var(--font-display); }
@media (max-width: 860px) { .mover { grid-template-columns: 1fr; } .obs-grid { grid-template-columns: 1fr; } .slide { padding: 16px; } }
.slide-kpi.long .k-value { font-size: 15px; line-height: 1.35; }
.deck-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.deck-explain { margin: 12px 0 0; }
.slide-guidance { background: #fceee4; border: 1px solid #f4956a; border-radius: 8px; padding: 10px 14px; font-size: 12.5px; color: #36454f; }
.slide-guidance .g-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-weight: 600; }
.slide-guidance ol { margin: 8px 0 4px; padding-left: 20px; display: grid; gap: 3px; }
.slide-guidance .muted { color: #6b7780; margin: 4px 0 0; }
.slide-table.blank td { height: 26px; }
.image-slot { border: 1.5px dashed #f4956a; border-radius: 8px; min-height: 160px; display: grid; place-content: center; text-align: center; gap: 4px; font-weight: 600; color: #36454f; }
.image-slot span { font-weight: 400; font-size: 12px; color: #6b7780; }

/* Available data */
.sidebar-foot .guide-link + .guide-link { margin-top: -6px; }
.data-group { display: grid; gap: 14px; }
.data-group-head { display: grid; gap: 4px; padding-top: 8px; border-top: 2px solid var(--accent); }
.data-group-head h2 { font-size: 20px; }
.data-group-head code { justify-self: start; }
.data-group-head .sub { margin: 0; }
.nowrap { white-space: nowrap; }
.row-missing td { background: var(--surface-2); }
.inv-flag { font-size: 12px; font-weight: 550; }
.inv-flag.failed, .inv-flag.stale { color: var(--bad-text); }
.inv-flag.current { color: var(--good-text); }
.inv-flag.absent, .inv-flag.unknown { color: var(--text-muted); }
.inv-count { font-variant-numeric: tabular-nums; font-size: 12px; }
.inv-count.ok { color: var(--good-text); }
.inv-count.nodata { color: var(--text-secondary); }
.inv-count.failed { color: var(--bad-text); font-weight: 600; }
.inv-count.absent { color: var(--text-muted); }
.inv-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.cellmark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.cellmark.ok { background: rgba(12, 163, 12, 0.14); color: var(--good-text); }
.cellmark.nodata { background: var(--surface-2); color: var(--text-secondary); border: 1px dashed var(--text-muted); }
.cellmark.failed { background: rgba(208, 59, 59, 0.16); color: var(--bad-text); }
.cellmark.absent { color: var(--text-muted); }
.table.matrix td, .table.matrix th { padding: 3px 6px; }
.table.matrix td:first-child { white-space: nowrap; }

/* Section explorer guide */
.section-guide { background: var(--surface-1); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 18px; }
.section-guide .sg-group { margin: 0 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.section-guide .sg-what { margin: 0 0 10px; font-size: 14.5px; font-weight: 550; color: var(--text-primary); }
.section-guide dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.section-guide dt { color: var(--text-muted); font-weight: 550; }
.section-guide dd { margin: 0; color: var(--text-secondary); line-height: 1.5; }
@media (max-width: 860px) { .section-guide dl { grid-template-columns: 1fr; } }
/* The guidance inside "About this section" sits in the panel, not in its own card. */
.section-guide.about-guide { border: 0; border-radius: 0; padding: 0 0 14px; margin-bottom: 14px; border-bottom: 1px solid var(--grid); background: none; }

/* Explorer nested rows */
.tree-toggle { width: 18px; height: 18px; margin-right: 4px; padding: 0; border: 0; background: none; color: var(--text-secondary); cursor: pointer; font-size: 11px; vertical-align: middle; }
.tree-toggle:hover { color: var(--text-primary); }
.tree-spacer { display: inline-block; width: 22px; }
.table tr.child-row td { background: var(--surface-2); font-size: 12.5px; }
.table tr.child-row td:first-child { color: var(--text-secondary); }

/* Explorer: month status pills and measures */
.ms-notes { font-size: 12.5px; color: var(--text-secondary); }
.ms-notes summary { cursor: pointer; color: var(--text-muted); }
.ms-notes ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.table.measures tr.group-row td { padding-top: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 1px solid var(--grid); background: none; cursor: default; }
.table.measures td.indent { padding-left: 18px; }
.chart-title { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.table td.attr { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text-secondary); }
.about-kv { grid-template-columns: 220px 1fr; }
.about-kv dd { overflow-wrap: anywhere; }
.placeholder-text { color: #c84f0c; font-style: italic; }

/* Section explorer analyst views: headline figures and a purpose-built chart, then the figures */
.table tr.cat-row td { font-weight: 600; background: var(--surface-2); }
.table tr.type-row td:first-child { padding-left: 22px; }
.table tr.type-row code { font-size: 11px; }
.meter-cell { min-width: 120px; }
.meter { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.meter span { display: block; height: 100%; background: var(--single); border-radius: 3px; }
.badge.warn-badge { border-color: var(--warning); }
.detail-group { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); padding: 12px 18px; }
.detail-group > summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.detail-group > summary .dg-title { font-weight: 600; font-size: 15px; }
.detail-group[open] > summary { margin-bottom: 14px; }
.explain { margin: 4px 0 16px; display: grid; gap: 2px; }
.explain-head { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.explain details { border-bottom: 1px solid var(--grid); padding: 7px 0; }
.explain summary { cursor: pointer; font-weight: 500; font-size: 13.5px; }
.explain details p { margin: 6px 0 2px 16px; color: var(--text-secondary); font-size: 13px; line-height: 1.6; max-width: 80ch; }
.summary-tiles .tile.hero .tile-value { font-size: 24px; }
.summary-tiles .tile-value { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table td.num { white-space: nowrap; }
.table tr.cat-row .muted { font-weight: 400; }
.summary-tiles .tile-value .tile-text { display: block; white-space: normal; overflow-wrap: anywhere; font-size: 18px; line-height: 1.3; }
.basis-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.basis-pick select { font: inherit; font-size: 13px; }
.table th.grp { text-align: center; border-bottom: 1px solid var(--grid); }
.tiles.summary-tiles { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.table th.wrap { white-space: normal; max-width: 110px; }
.ellip.name { max-width: 210px; }
.acct { font-weight: 500; color: var(--text-secondary); }
.table td.qr { white-space: normal; min-width: 120px; }
.share-table { table-layout: fixed; }
.share-table .name-col { width: 38%; }
.share-table .bar-col { width: 24%; }
.share-table.no-share .name-col { width: 38%; }
.share-table.no-share .bar-col { width: 16%; }
.share-table td:first-child .ellip.name { max-width: 100%; }
.tag-chart-title { margin-top: 18px; }
.share-table .bl-bar { margin-top: 5px; }
.tag-key { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.share-table.no-share td:first-child .ellip.name { white-space: normal; overflow: visible; }

/* Savings Plan inventory: plan rows that expand to their full detail */
.sp-table tbody tr.sp-row { cursor: pointer; }
.sp-table tbody tr.sp-row:hover { background: var(--surface-2); }
.sp-table tr.sp-row.open td { border-bottom-color: transparent; background: var(--accent-wash); }
.sp-table .sp-sub { padding-left: 22px; }
.sp-table tr.sp-detail-row > td { background: var(--surface-2); padding: 14px 18px 16px; }
.sp-detail h4 { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.sp-detail > h4 { margin-top: 16px; }
.sp-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 28px; }
.sp-detail .kv { font-size: 12.5px; }
.sp-detail .kv dd.bad-text { color: var(--bad-text); }
.sp-detail .table { background: var(--surface-1); border-radius: 8px; }
.sp-detail .sp-ids { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--grid); }
.sp-detail .sp-ids dd { overflow-wrap: anywhere; }
.sp-detail .sp-ids code { font-size: 11.5px; }
.sp-table td:first-child { min-width: 210px; }
.sp-table td.meter-cell { min-width: 96px; }
.sp-table .sp-sub { white-space: nowrap; }
.bad-text { color: var(--bad-text); }

/* Pricing model mix: spend split by pricing model */
.pm-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); min-width: 120px; }
.pm-bar.tall { height: 14px; border-radius: 7px; margin: 4px 0 14px; }
.pm-bar span { display: block; min-width: 2px; }
.pm-cell { width: 28%; min-width: 140px; vertical-align: middle; }
.pm-legend { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.pm-key { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; }
.pm-key .key-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; align-self: center; }
.pm-key-label { color: var(--text-secondary); font-size: 13px; }
.pm-key b { grid-column: 2; font-size: 18px; font-weight: 600; }
.pm-key .small { grid-column: 2; }
.pm-chart-title { margin-top: 20px; }
.ri-table .sp-sub { white-space: normal; }
.ri-table td:first-child { min-width: 190px; }
/* An expanded row's detail fits the table rather than widening it; its own tables scroll. */
.sp-table tr.sp-detail-row > td > .sp-detail { width: 0; min-width: 100%; }

/* Section explorer header: description under the title, a slim status line, no card */
.page-head .section-what { margin-top: 6px; max-width: 64ch; font-size: 14px; color: var(--text-secondary); line-height: 1.45; }
.section-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; padding: 0 2px 2px; font-size: 12.5px; color: var(--text-secondary); }
.ss-months { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.ss-month { display: inline-flex; align-items: center; gap: 5px; color: var(--text-primary); font-weight: 500; }
.ss-month .ss-dot { font-size: 12px; line-height: 1; }
.ss-month.final .ss-dot { color: var(--good); }
.ss-month.partial .ss-dot { color: var(--warning); }
.ss-month.missing { color: var(--text-muted); }
.ss-month.missing .ss-dot { color: var(--bad-text); }
.ss-word { color: var(--text-muted); font-weight: 400; }
.ss-links { display: inline-flex; gap: 16px; align-items: baseline; }
.ss-links .btn.link { padding: 0; font-size: inherit; }

/* Credits: use meter with a tick for how far through its validity a credit is */
.cr-meter { position: relative; }
.cr-meter .cr-tick { position: absolute; top: 3px; width: 2px; height: 12px; margin-left: -1px; background: var(--text-primary); border-radius: 1px; }
.cr-types { margin-top: 18px; }
.cr-products { margin: 0; color: var(--text-secondary); line-height: 1.6; }
.cr-table td:first-child { min-width: 240px; }
.cr-table .sp-sub { white-space: normal; }
