/* ============================================================
   ODDES ADS REPORT. The Leadflix Paper appearance.
   Ported from the Sumberkima report (draft F "Paper" + the live
   product's near-black band). Warm paper ground with faint grain,
   white cells with hairlines and blue-tinted shadows. Brand blue
   is the only hue and it is spent on VALUES: bar fills, the key
   figure, the lit leader. Everything else rests in warm grey.
   Chips here are .ochip, never .chip (the Sumberkima collision).
   ============================================================ */

:root {
  /* ground and surfaces */
  --paper: #f7f5f2;
  --cell: #ffffff;
  --hairline: #e2ded6;
  --hairline-soft: #edeae4;
  --track: #efece7;
  --paper-sunk: #f1eee9;

  /* text */
  --ink: #16181b;
  --ink-2: #4e545c;
  --ink-3: #5f666d;

  /* the near-black band */
  --band: #121212;
  --band-edge: #000000;
  --band-ink: #e2dfde;
  --band-ink-2: #ababab;
  --band-rule: #2d2d2d;
  --band-lift: #1e1e1e;
  --band-focus: #85b2db;

  /* the one hue */
  --blue-deep: #24567f;
  --blue: #2f6fa8;
  --blue-mid: #3f7db4;
  --blue-light: #85b2db;
  --blue-pale: #b6d8f4;
  --blue-deeper: #1e4a6f;
  --blue-wash: #eaf1f8;

  /* the rest, muted warm grey */
  --grey-1: #d9d4cb;
  --grey-2: #c3bdb2;

  /* status, used sparingly: the freshness chip and warnings only */
  --amber: #96660f;
  --amber-wash: #f7ebd5;

  /* fills */
  --ramp: linear-gradient(90deg, var(--blue-deep) 0%, var(--blue) 45%, var(--blue-light) 100%);
  --ramp-v: linear-gradient(180deg, var(--blue-light) 0%, var(--blue) 55%, var(--blue-deep) 100%);
  --mute: linear-gradient(90deg, var(--grey-1) 0%, var(--grey-2) 100%);
  --mute-v: linear-gradient(180deg, var(--grey-1) 0%, var(--grey-2) 100%);

  /* light: the winner glows even on white */
  --glow: 0 6px 16px -2px rgba(47, 111, 168, 0.42), 0 2px 4px rgba(47, 111, 168, 0.18);
  --glow-column: 0 14px 30px -10px rgba(47, 111, 168, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  --glow-step: 0 20px 44px -14px rgba(47, 111, 168, 0.6), 0 2px 4px rgba(36, 86, 127, 0.12);

  /* shadows, layered and blue-tinted */
  --shadow-cell: 0 1px 2px rgba(36, 86, 127, 0.05), 0 8px 20px -10px rgba(36, 86, 127, 0.12), 0 28px 56px -28px rgba(36, 86, 127, 0.18);
  --shadow-key: 0 1px 2px rgba(36, 86, 127, 0.06), 0 10px 24px -10px rgba(47, 111, 168, 0.22), 0 30px 60px -26px rgba(47, 111, 168, 0.36);
  --shadow-step: 0 2px 4px rgba(36, 86, 127, 0.08), 0 14px 30px -14px rgba(36, 86, 127, 0.35);
  --shadow-pill: 0 1px 2px rgba(36, 86, 127, 0.08), 0 6px 14px -8px rgba(36, 86, 127, 0.2);

  /* type */
  --font-display: "Baskervville", Georgia, "Times New Roman", serif;
  --font-sans: "Geist", "Helvetica Neue", sans-serif;
  --fs-micro: 0.6875rem;
  --fs-small: 0.8125rem;
  --fs-body: 0.9375rem;
  --fs-h1: 2.125rem;
  --fs-h2: 1.75rem;
  --fs-brand: 1.25rem;
  --fs-kpi: 2.75rem;
  --fs-kpi-sm: 2rem;
  --fs-figure: 1.0625rem;
  --fs-day: 1rem;
  --fs-day-peak: 1.375rem;
  --fs-drop: 0.75rem;
  --track-caps: 0.12em;
  --track-display: -0.015em;
  --track-num: -0.03em;
  --lh-body: 1.6;

  /* rhythm */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.75rem;
  --s-7: 2.5rem;
  --s-8: 3.5rem;
  --s-9: 5rem;

  /* shape */
  --r-cell: 1.25rem;
  --r-pill: 999px;
  --r-column: 0.5rem;

  /* layout */
  --wrap: 74rem;
  --pad-x: clamp(1rem, 3vw, 2.5rem);
  --cell-pad: 1.75rem;
  --bar-h: 0.5rem;
  --chart-h: 200px;
  --funnel-w: 58rem;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(72rem 34rem at 50% -12rem, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 70%),
    radial-gradient(46rem 26rem at 100% 6rem, rgba(133, 178, 219, 0.16) 0%, rgba(133, 178, 219, 0) 70%),
    radial-gradient(40rem 22rem at 0% 30rem, rgba(133, 178, 219, 0.08) 0%, rgba(133, 178, 219, 0) 70%);
  background-repeat: no-repeat;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* the paper grain, fixed and faint */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 240px 240px;
  opacity: 0.035;
  mix-blend-mode: multiply;
}

::selection { background: var(--blue-pale); color: var(--ink); }
img { max-width: 100%; display: block; }
b, strong { font-weight: 600; }
[hidden] { display: none !important; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }
.num { font-variant-numeric: tabular-nums; }

/* ============================================================
   HEADER BAND (near-black, the live product's band)
   ============================================================ */

.band {
  background: var(--band);
  border-bottom: 1px solid var(--band-edge);
  color: var(--band-ink);
}
.band-inner { display: flex; align-items: center; gap: var(--s-5); padding-top: var(--s-3); padding-bottom: var(--s-3); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: var(--s-4); min-width: 0; }
.crest { height: 1.75rem; width: auto; flex: none; }
.brand-lines { min-width: 0; }
.brand-app {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-brand);
  letter-spacing: var(--track-display);
  line-height: 1.15;
  color: var(--band-ink);
  white-space: nowrap;
}
.brand-client {
  display: block;
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--band-ink-2);
  margin-top: 0.15rem;
}

.band-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }

/* freshness chip: reads from the Run Log, never from fetch time */
.fresh {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--band-ink-2);
  border: 1px solid var(--band-rule);
  border-radius: var(--r-pill);
  padding: 0.3rem 0.75rem;
  white-space: nowrap;
}
.fresh::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--blue-light); flex: none; }
.fresh.stale { color: var(--amber); border-color: rgba(150, 102, 15, 0.55); }
.fresh.stale::before { background: var(--amber); }

/* language toggle: a two-state pill on the band */
.lang {
  display: inline-flex;
  gap: 0.15rem;
  padding: 0.2rem;
  border: 1px solid var(--band-rule);
  border-radius: var(--r-pill);
}
.lang button {
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  color: var(--band-ink-2);
  background: none;
  border: none;
  border-radius: var(--r-pill);
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}
.lang button:hover { color: var(--band-ink); background: var(--band-lift); }
.lang button[aria-pressed="true"] { color: var(--band); background: var(--band-ink); }
.lang button:focus-visible { outline: 2px solid var(--band-focus); outline-offset: 2px; }

.signout {
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--band-ink-2);
  background: none;
  border: 1px solid var(--band-rule);
  border-radius: var(--r-pill);
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.signout:hover { color: var(--band-ink); border-color: var(--band-ink-2); background: var(--band-lift); }
.signout:focus-visible { outline: 2px solid var(--band-focus); outline-offset: 2px; }

/* ============================================================
   TOOLBAR: WINDOW SWITCHER + DATE ROW
   ============================================================ */

main { padding-bottom: var(--s-9); }
.toolbar { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding-top: var(--s-7); }
.switcher {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.25rem;
  background: var(--cell);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-pill);
  flex-wrap: wrap;
}
.switcher button {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
  background: none;
  border: none;
  border-radius: var(--r-pill);
  padding: 0.4rem 1.05rem;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.switcher button:hover { color: var(--ink); background: var(--hairline-soft); }
.switcher button:active { background: var(--hairline); }
.switcher button[aria-pressed="true"] {
  color: #ffffff;
  font-weight: 600;
  background: linear-gradient(90deg, var(--blue-deep) 0%, var(--blue) 100%);
  box-shadow: 0 6px 14px -4px rgba(47, 111, 168, 0.5);
}
.switcher button:focus-visible, .refresh:focus-visible, .daterow button:focus-visible,
.daterow input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* the account's configured daily budget, right of the switcher */
.budget-now {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
  background: var(--cell);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 0.4rem 0.9rem;
  white-space: nowrap;
}
.budget-now::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--blue-light); flex: none; }
.budget-now b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.budget-now:not([hidden]) ~ .refresh { margin-left: 0; }

.refresh {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-3);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.refresh svg { width: 0.875rem; height: 0.875rem; }
.refresh:hover { color: var(--ink); border-color: var(--hairline); background: var(--cell); }

/* the second row that appears for Day and Custom */
.daterow { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-3); }
.daterow label { font-size: var(--fs-small); color: var(--ink-3); }
.daterow input[type="date"] {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
  background: var(--cell);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 0.35rem 0.8rem;
}
.daterow button {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink-2);
  background: var(--cell);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}
.daterow button:hover { color: var(--ink); background: var(--hairline-soft); }

/* ============================================================
   MASTHEAD
   ============================================================ */

.masthead { padding-top: var(--s-7); padding-bottom: var(--s-7); }
.window-sub { font-size: var(--fs-micro); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--blue); }
.masthead h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h1);
  letter-spacing: var(--track-display);
  line-height: 1.1;
  color: var(--ink);
  margin-top: var(--s-2);
}
.strip { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin-top: var(--s-4); font-size: var(--fs-body); color: var(--ink-2); }
.strip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.strip .dot { width: 4px; height: 4px; border-radius: var(--r-pill); background: var(--grey-2); }

/* ============================================================
   SECTIONS, CELLS, GRID
   ============================================================ */

.report { margin-top: var(--s-8); }
.report:first-of-type { margin-top: 0; }
.sec-head { margin-bottom: var(--s-5); }
.sec-index { display: inline-block; font-size: var(--fs-micro); font-weight: 600; letter-spacing: var(--track-caps); color: var(--blue); font-variant-numeric: tabular-nums; }
.sec-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  letter-spacing: var(--track-display);
  line-height: 1.15;
  color: var(--ink);
  margin-top: var(--s-1);
}
.lede { font-size: var(--fs-body); color: var(--ink-2); max-width: 46rem; margin-top: var(--s-2); }
.lede b { color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--s-5); }
.grid + .grid { margin-top: var(--s-5); }
.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }

.cell {
  position: relative;
  background: var(--cell);
  border: 1px solid var(--hairline);
  border-radius: var(--r-cell);
  padding: var(--cell-pad);
  box-shadow: var(--shadow-cell);
  min-width: 0;
}
.cell.column { display: flex; flex-direction: column; }
.cell-title { font-size: var(--fs-micro); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-5); }
.cell-title small { display: block; margin-top: 0.2rem; font-size: var(--fs-small); font-weight: 400; letter-spacing: 0; text-transform: none; }
.note { font-size: var(--fs-small); color: var(--ink-3); line-height: 1.55; max-width: 42rem; }
.note + .note { margin-top: var(--s-2); }
.cell .note.after { margin-top: var(--s-5); }

/* ============================================================
   KPI CELLS
   ============================================================ */

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); margin-top: var(--s-5); }
.kpi-row + .kpi-row { margin-top: var(--s-5); }
.kpi-row.five { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: var(--s-6) var(--cell-pad) var(--s-5); overflow: hidden; }
.kpi-value {
  display: block;
  font-weight: 600;
  font-size: var(--fs-kpi);
  letter-spacing: var(--track-num);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi-value small { font-size: 0.36em; font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-left: 0.3em; }
.kpi-label { display: block; margin-top: var(--s-3); font-size: var(--fs-micro); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-3); }
.kpi-hint { display: block; margin-top: 0.3rem; font-size: var(--fs-small); color: var(--ink-3); line-height: 1.45; }
.kpi.key { box-shadow: var(--shadow-key); }
.kpi.key::before {
  content: "";
  position: absolute;
  top: -1px; /* covers the hairline so the strip reads attached, never floating */
  left: var(--cell-pad);
  right: var(--cell-pad);
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--ramp);
  box-shadow: 0 2px 8px rgba(47, 111, 168, 0.35);
}
.kpi.key .kpi-value { color: var(--blue-deep); }
.kpi.quiet .kpi-value { color: var(--ink-3); font-weight: 500; font-size: var(--fs-kpi-sm); }
.kpi-row.quiet-row { grid-template-columns: repeat(5, 1fr); }
.kpi-row.quiet-row .kpi { padding: var(--s-5) var(--s-5) var(--s-4); }

/* ============================================================
   RANKED BARS. The number is always printed; the leader is lit.
   ============================================================ */

.bars { display: grid; gap: 0.875rem; }
.bar { display: grid; grid-template-columns: 1fr auto; column-gap: var(--s-3); row-gap: 0.4rem; align-items: baseline; }
.bl { font-size: var(--fs-small); font-weight: 500; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl .sub { display: block; font-weight: 400; color: var(--ink-3); font-size: var(--fs-micro); letter-spacing: 0; text-transform: none; }
.bv { font-size: var(--fs-small); color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bv b { font-weight: 600; font-size: var(--fs-figure); letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.bv em { font-style: normal; margin-left: 0.3rem; }
.bt { grid-column: 1 / -1; height: var(--bar-h); border-radius: var(--r-pill); background: var(--track); }
.bt i { display: block; height: 100%; width: var(--w); min-width: 4px; border-radius: var(--r-pill); background: var(--mute); }
.bar.lit .bt i { background: var(--ramp); box-shadow: var(--glow); }
.bar.lit .bv b { color: var(--blue-deep); }
.bar.quiet .bv b { color: var(--ink-3); font-weight: 500; }

/* ============================================================
   PARTY CHIPS (.ochip, page-scoped, never .chip)
   ============================================================ */

.ochip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  padding: 0.12rem 0.55rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  background: var(--paper);
  white-space: nowrap;
  vertical-align: middle;
}
.ochip.p-leadflix { border-color: var(--blue-light); color: var(--blue-deep); background: var(--blue-wash); }
.ochip.p-eway { border-color: var(--grey-2); color: var(--ink-2); background: var(--paper-sunk); }
.ochip.p-profida { border-color: var(--hairline); color: var(--ink-3); background: var(--cell); }
.ochip.verdict { text-transform: uppercase; }

/* ============================================================
   TABLE ROWS (sections 04 and 05): a Paper table inside a cell.
   The bar carries ONE number (share of qualified); every other
   figure is printed in tabular Geist columns.
   ============================================================ */

.trows { display: flex; flex-direction: column; }
.trow-head, .trow {
  display: grid;
  grid-template-columns: minmax(14rem, 2.2fr) repeat(var(--tcols, 6), minmax(4.2rem, 1fr));
  gap: var(--s-3);
  align-items: baseline;
  padding: 0.55rem 0;
}
.trow-head {
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--hairline);
}
.trow { border-bottom: 1px solid var(--hairline-soft); }
.trow:last-child { border-bottom: none; }
.trow > span { font-size: var(--fs-small); color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.trow-head > span { text-align: right; }
.trow-head > span:first-child, .trow > .tname { text-align: left; }
.tname { min-width: 0; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tname .sub { display: block; font-weight: 400; font-size: var(--fs-micro); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tname .ochip { margin-left: 0.4rem; }
.trow .tkey { font-weight: 600; font-size: var(--fs-figure); color: var(--ink); letter-spacing: -0.01em; }
.trow.lit .tkey { color: var(--blue-deep); }
.trow.lit .tname { color: var(--blue-deep); }
.trow.quiet .tkey { color: var(--ink-3); font-weight: 500; }
.trow .rank { color: var(--ink-3); font-weight: 500; margin-right: 0.5rem; }
.tscroll { overflow-x: auto; }
.tscroll .trow-head, .tscroll .trow { min-width: 46rem; }

/* campaign rows that open into ad sets */
details.crow { border-bottom: 1px solid var(--hairline-soft); }
details.crow:last-of-type { border-bottom: none; }
details.crow > summary { list-style: none; cursor: pointer; }
details.crow > summary::-webkit-details-marker { display: none; }
details.crow > summary .trow { border-bottom: none; }
details.crow > summary .tname::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(-45deg);
  margin-right: 0.6rem;
  vertical-align: 0.12em;
  transition: transform 160ms ease;
}
details.crow[open] > summary .tname::before { transform: rotate(45deg); }
details.crow > summary:hover .trow { background: var(--paper); }
details.crow > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 0.5rem; }
.crow-sets { padding: 0 0 var(--s-3) var(--s-5); }
.crow-sets .trow { border-bottom: 1px dashed var(--hairline-soft); }
.crow-sets .trow:last-child { border-bottom: none; }
.crow-sets .tname { font-weight: 400; color: var(--ink-2); }

/* ============================================================
   PARTY TRIO (section 02)
   ============================================================ */

.party .pkpi { display: grid; gap: var(--s-4); margin-top: var(--s-2); }
.party .pv { display: block; font-weight: 600; font-size: var(--fs-kpi-sm); letter-spacing: var(--track-num); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.party .pv small { font-size: 0.45em; font-weight: 500; color: var(--ink-3); margin-left: 0.25em; letter-spacing: 0; }
.party .pl { display: block; margin-top: 0.25rem; font-size: var(--fs-micro); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-3); }
.party .pminor { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.6rem, 1fr)); gap: var(--s-3); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--hairline-soft); }
.party .pminor span { font-size: var(--fs-small); color: var(--ink-3); }
.party .pminor b { display: block; font-size: var(--fs-figure); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.party .pshare { margin-top: var(--s-4); display: grid; gap: 0.55rem; }
.party .pshare .srow { display: grid; grid-template-columns: 1fr auto; row-gap: 0.3rem; column-gap: var(--s-3); align-items: baseline; font-size: var(--fs-micro); color: var(--ink-3); }
.party .pshare .srow b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.party .pshare .bt { grid-column: 1 / -1; height: 0.375rem; }
.party { overflow: hidden; }
.party.lead { box-shadow: var(--shadow-key); }
.party.lead::before {
  content: "";
  position: absolute;
  top: -1px; left: var(--cell-pad); right: var(--cell-pad);
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--ramp);
  box-shadow: 0 2px 8px rgba(47, 111, 168, 0.35);
}
.party.lead .pv.pv-key { color: var(--blue-deep); }
.party .na { color: var(--ink-3); font-weight: 500; }

/* ============================================================
   THE FUNNEL (section 06). Narrowing pills, light to deep.
   ============================================================ */

.funnel { display: grid; gap: var(--s-1); max-width: var(--funnel-w); margin: 0 auto; }
.fstep {
  width: var(--w);
  min-width: min(100%, 22rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  border-radius: var(--r-pill);
  padding: 0.875rem 1.5rem;
  box-shadow: var(--shadow-step);
}
.fmain { min-width: 0; }
.flabel { display: block; font-size: var(--fs-small); font-weight: 500; line-height: 1.3; }
.fchips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.fchip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  font-size: var(--fs-micro);
  line-height: 1.3;
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}
.fchip b { font-size: var(--fs-small); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.fnum { flex: none; font-weight: 600; font-size: var(--fs-kpi-sm); letter-spacing: var(--track-num); line-height: 1; font-variant-numeric: tabular-nums; }

.f1 { background: linear-gradient(90deg, var(--blue-light) 0%, var(--blue-pale) 100%); color: var(--ink); }
.f1 .fchip { background: rgba(36, 86, 127, 0.1); border-color: rgba(36, 86, 127, 0.14); color: var(--blue-deep); }
.f1 .fnum { color: var(--blue-deep); }
.f2 { background: linear-gradient(90deg, var(--blue-mid) 0%, var(--blue) 100%); color: #ffffff; }
.f3 { background: linear-gradient(90deg, var(--blue) 0%, var(--blue-deep) 100%); color: #ffffff; box-shadow: var(--glow-step); }
.f2 .fchip-a, .f3 .fchip-a { background: rgba(255, 255, 255, 0.94); color: var(--blue-deep); }
.f2 .fchip-b, .f3 .fchip-b { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.45); color: #ffffff; }

.fdrop { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.2rem 0; font-size: var(--fs-drop); color: var(--ink-3); }
.fdrop::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--grey-2);
  border-bottom: 1px solid var(--grey-2);
  transform: translateY(-2px) rotate(45deg);
}
.fdrop b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.funnel-note { text-align: center; max-width: 42rem; margin: var(--s-4) auto 0; }

/* ============================================================
   DAY COLUMNS (section 01). The .months component at day grain.
   Column count set by --cols; the peak lit; zeros quiet.
   ============================================================ */

.days {
  display: grid;
  grid-template-columns: repeat(var(--cols, 7), 1fr);
  gap: var(--s-1);
  align-items: end;
  height: var(--chart-h);
  padding: 0 var(--s-2);
  border-bottom: 1px solid var(--hairline);
}
.day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 0.4rem; min-width: 0; }
.dv { font-weight: 600; font-size: var(--fs-day); letter-spacing: var(--track-num); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.days.dense .dv { font-size: var(--fs-micro); font-weight: 500; }
.day.peak .dv { font-size: var(--fs-day-peak); color: var(--blue-deep); }
.days.dense .day.peak .dv { font-size: var(--fs-day); font-weight: 600; }
.day.zero .dv { font-size: var(--fs-micro); font-weight: 500; color: var(--ink-3); }
.dc {
  width: min(2.5rem, 78%);
  height: calc(var(--p) * (var(--chart-h) - 3.5rem));
  border-radius: var(--r-column) var(--r-column) 0.2rem 0.2rem;
  background: var(--mute-v);
}
.day.peak .dc { background: var(--ramp-v); box-shadow: var(--glow-column); }
.day.zero .dc { height: 4px; border-radius: 2px; background: var(--hairline); }
.day-names { display: grid; grid-template-columns: repeat(var(--cols, 7), 1fr); gap: var(--s-1); padding: var(--s-3) var(--s-2) 0; }
.day-names span { text-align: center; font-size: var(--fs-micro); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* hour strip for the single-day view */
.hours { --cols: 24; }

/* ============================================================
   LINKS, FOOTER
   ============================================================ */

.plink {
  color: var(--blue-deep);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--blue-light);
  text-underline-offset: 3px;
  border-radius: 0.25rem;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
.plink:hover { color: var(--blue); text-decoration-color: var(--blue); }

.foot {
  margin-top: var(--s-9);
  padding-top: var(--s-6);
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.foot-note { font-size: var(--fs-small); color: var(--ink-3); max-width: 38rem; line-height: 1.55; }
.foot-credit { display: flex; align-items: baseline; gap: var(--s-3); flex: none; }
.foot-credit span { font-size: var(--fs-micro); font-weight: 500; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.foot-credit img { height: 0.875rem; width: auto; opacity: 0.85; }

/* ============================================================
   LOADING, EMPTY, FAULT
   ============================================================ */

.state { padding: var(--s-8) 0; text-align: center; color: var(--ink-3); }
.skel { display: grid; gap: var(--s-4); padding-top: var(--s-6); }
.skel-bar {
  position: relative;
  overflow: hidden;
  height: 1rem;
  border-radius: var(--r-pill);
  background: var(--paper-sunk);
}
.skel-bar.tall { height: 7rem; border-radius: var(--r-cell); }
.skel-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--hairline-soft) 50%, transparent 100%);
  animation: sweep 1.4s linear infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============================================================
   GATE (v1 access): the near-black cover page
   ============================================================ */

#gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--band);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-5);
  padding: var(--s-5);
}
#gate img { height: 2rem; width: auto; }
#gate p { color: var(--band-ink-2); font-size: var(--fs-small); }
#gate form { display: flex; gap: var(--s-2); }
#gate input {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  color: var(--band-ink);
  background: var(--band-lift);
  border: 1px solid var(--band-rule);
  border-radius: var(--r-pill);
  padding: 0.55rem 1.1rem;
  min-width: 16rem;
}
#gate input:focus-visible { outline: 2px solid var(--band-focus); outline-offset: 2px; }
#gate button {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(90deg, var(--blue-deep) 0%, var(--blue) 100%);
  border: none;
  border-radius: var(--r-pill);
  padding: 0.55rem 1.3rem;
  cursor: pointer;
}
#gate .gate-err { color: var(--amber); min-height: 1.2em; }

/* ============================================================
   FOLD-DOWN
   ============================================================ */

@media (max-width: 1100px) {
  .span-7, .span-5 { grid-column: span 12; }
  .span-4 { grid-column: span 6; }
  .span-6 { grid-column: span 12; }
  .kpi-row, .kpi-row.quiet-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .band-inner { row-gap: var(--s-3); }
  .band-right { width: 100%; margin-left: 0; }
  .report { margin-top: var(--s-7); }
}

@media (max-width: 640px) {
  :root { --fs-kpi: 2.25rem; --fs-h1: 1.875rem; --fs-h2: 1.5rem; --cell-pad: 1.25rem; --chart-h: 150px; }
  .span-4 { grid-column: span 12; }
  .kpi-row, .kpi-row.quiet-row { grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
  .fstep { padding: 0.75rem 1rem; gap: var(--s-3); }
  .fnum { font-size: 1.5rem; }
  .refresh { margin-left: 0; }
  .days .dv { font-size: var(--fs-micro); }
  .day-names span { font-size: 0.5625rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* spend printed under each day label (sparse windows only) */
.day-names .dn-spend { display: block; font-style: normal; font-weight: 500; letter-spacing: 0; color: var(--grey-2); margin-top: 0.1rem; }

/* dense day charts scroll sideways inside their cell on narrow screens */
.chart-scroll { overflow-x: auto; }
.chart-scroll .days.dense, .chart-scroll .day-names.dense { min-width: 52rem; }
