/* ============================================================
   Funnel Opt-in Tracker — warm-dark instrument panel
   ============================================================ */
:root {
  /* Dark-only app: tell the browser so native popups (select dropdowns, confirm()
     dialogs, date inputs, scrollbars, autofill) render dark — not white-on-white. */
  color-scheme: dark;
  /* xAI design system — near-black canvas, restrained palette, accents rare.
     Emphasis from ink-white + tight tracking, not hue. */
  --bg:        #0a0a0a;   /* canvas */
  --surface:   #191919;   /* canvas-card */
  --surface-2: #1c1e22;   /* elevated (card header / chips) — slight lift */
  --line:      #2a2c31;   /* hairline — card border + visible dividers */
  --line-soft: #1f2125;   /* faint internal divider */
  --ink:       #ffffff;   /* headings + headline numbers */
  --text:      #dadbdf;   /* body */
  --muted:     #7d8187;   /* body-mid — secondary text */
  --faint:     #5c6066;   /* eyebrow labels, faintest */

  --accent:    #ffffff;   /* primary highlight / interactive (white) */
  --accent-dim:#c9cace;
  --accent-soft:rgba(255,255,255,0.08);
  --violet:    #c4b5fd;   /* twilight — masterclass tag */
  --good:      #a0c3ec;   /* breeze — positive numbers (cash, ROAS, best-in-column) */
  --warn:      #ff7a17;   /* sunset — errors / low, used sparingly */
  --link:      #a0c3ec;   /* breeze — inline links */

  --r-sm: 6px; --r-md: 8px; --r-lg: 12px;  /* xAI: 8px cards */

  --space-2: 4px; --space-3: 8px; --space-4: 12px; --space-5: 16px;
  --space-6: 24px; --space-7: 32px; --space-8: 48px; --space-9: 64px;

  --display: "Inter", system-ui, -apple-system, sans-serif;     /* Universal Sans substitute */
  --serif:   "Inter", system-ui, sans-serif;                    /* xAI has no serif — fold into Inter */
  --font: var(--display);
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);  /* expo-out */
}

* { box-sizing: border-box; margin: 0; }
/* native select dropdown items — force dark so white text never lands on a white menu */
select option, select optgroup { background: #1c1e22; color: #dadbdf; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.011em;
  min-height: 100vh;
  padding: var(--space-6) clamp(var(--space-5), 4vw, var(--space-9)) var(--space-9);
  position: relative;
}

/* faint film-grain texture so the dark surface isn't flat */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.035;
  background-image: radial-gradient(oklch(1 0 0) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}
body > * { position: relative; z-index: 1; }

::selection { background: var(--accent); color: #0a0a0a; }

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--line-soft);
  position: relative; z-index: 60;  /* lift so the calendar popover escapes content */
}
.brand { display: flex; align-items: center; gap: var(--space-4); }
.brand-logo { height: 30px; width: auto; display: block; flex-shrink: 0; }
.brand-divider { width: 1px; height: 24px; background: var(--line); flex-shrink: 0; }
.brand-sub { color: var(--faint); font-size: 0.78rem; }
@media (max-width: 560px) { .brand-divider, .brand-sub { display: none; } }
.topbar-actions { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.ver-filter { display: flex; align-items: center; gap: var(--space-3); }
.ver-filter > span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); font-weight: 600; }
.ver-filter select { width: auto; min-width: 140px; padding: 9px 32px 9px 12px; font-size: 0.84rem; background-color: var(--surface); }
.hint { font-size: 0.78rem; color: var(--muted); line-height: 1.55; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  font-family: var(--font); font-weight: 600; font-size: 0.86rem;
  border-radius: var(--r-sm); padding: 9px 15px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid transparent; transition: all 0.18s var(--ease);
}
.btn-ico { font-size: 1.05em; line-height: 1; }
.btn.solid { background: var(--accent); color: #06150f; font-weight: 700; border-color: var(--accent); }
.btn.solid:hover { background: #6bf0c2; border-color: #6bf0c2; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn.ghost:hover { color: var(--text); border-color: var(--faint); background: var(--surface); }
.btn:active { transform: translateY(0); }

.icon-btn {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  width: 32px; height: 32px; border-radius: var(--r-sm); cursor: pointer;
  font-size: 0.9rem; transition: all 0.18s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--faint); }

/* ── Totals strip ─────────────────────────────────────── */
.totals {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  overflow: hidden; margin: var(--space-6) 0;
}
.totals[hidden] { display: none; } /* class display: grid otherwise beats the hidden attr */
.total { background: var(--surface); padding: var(--space-5) var(--space-6); }
.total.accent { background: var(--surface-2); }
.total-label {
  display: block; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--faint); font-weight: 600;
}
.total-val {
  display: block; font-family: var(--mono); font-weight: 600;
  font-size: clamp(1.75rem, 1rem + 2.4vw, 2.6rem); margin-top: 8px; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.045em; color: var(--text);
}
.total.accent .total-val { color: var(--good); }

/* ── Board / webinar cards ────────────────────────────── */
.board { display: flex; flex-direction: column; gap: var(--space-5); margin-top: var(--space-4); }

.wb {
  background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  overflow: hidden; animation: rise 0.5s var(--ease) both;
}
.wb-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  flex-wrap: wrap; padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid transparent; background: var(--surface-2);
  cursor: pointer; user-select: none; transition: background 0.15s var(--ease);
}
.wb-head:hover { background: var(--elevated, var(--surface-2)); filter: brightness(1.08); }
.wb-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wb.open .wb-head { border-bottom-color: var(--line-soft); }
.chevron { color: var(--muted); font-size: 0.9rem; display: inline-block; transition: transform 0.25s var(--ease); }
.wb.open .chevron { transform: rotate(90deg); color: var(--accent); }

/* collapse animation via grid-template-rows */
.wb-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s var(--ease); }
.wb.open .wb-body { grid-template-rows: 1fr; }
.wb-body > .vtable { overflow: hidden; min-height: 0; }

.wb-title { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.wb-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.wb-meta { display: flex; align-items: center; gap: var(--space-4); }

.tag {
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700; padding: 3px 8px; border-radius: 0;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line-soft);
}
.tag.event { color: var(--accent); }
.tag.masterclass { color: var(--violet); }
.window { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sales-strip { margin: 0; border: 0; border-radius: 0; }
.sales-body > .sales-strip + .sales-strip { margin-top: var(--space-3); }
/* outcome metrics read green (cash collected, ROAS) — text only, no tile bg */
.sales-strip .total-val[data-s="cash"],
.sales-strip .total-val[data-s="setCash"],
.sales-strip .total-val[data-s="roas"] { color: var(--good); }
/* Sales hover detail — frosted overlay ON TOP of the tile (blurs the value behind),
   same feel as the Funnel-Economics A/B/C/D popover. Neutral colour, not red. */
.total:has(.sales-pop) { position: relative; }
.sales-pop {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  padding: 8px var(--space-4);
  background: rgba(17, 17, 19, 0.55);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--muted);
  line-height: 1.4; letter-spacing: -0.01em;
  opacity: 0; visibility: hidden; transform: scale(1.015);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
  pointer-events: none;
}
.total:hover .sales-pop:not(:empty) { opacity: 1; visibility: visible; transform: scale(1); }
/* "N calls upcoming" sub-line under the primary popover detail */
.sales-pop .sp-sub { font-size: 0.72rem; font-weight: 600; color: var(--accent); letter-spacing: 0; }

/* ── Sales / Marketing mode bar (lives in the topbar, Sales tab only) ── */
/* Toggle pinned far-right (never moves); mkt-controls slide in to its LEFT in
   Marketing mode. The bar sits where the date-picker/Add-webinar do. */
.mode-bar { display: none; align-items: center; gap: var(--space-4); }
body[data-view="sales"] .mode-bar { display: inline-flex; }
.board[hidden] { display: none; }

/* real on/off switch — checked = Sales Mode (default), unchecked = Marketing */
.mode-switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; user-select: none; flex: none; }
.mode-switch-label { font-size: 0.82rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text); min-width: 108px; text-align: right; }
.mode-input { position: absolute; opacity: 0; width: 0; height: 0; }
.mode-track { position: relative; width: 46px; height: 26px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; transition: background 0.2s var(--ease), border-color 0.2s var(--ease); flex: none; }
.mode-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); transition: transform 0.22s var(--ease); }
.mode-input:not(:checked) + .mode-track { background: var(--accent-soft); border-color: var(--accent-dim); }
.mode-input:not(:checked) + .mode-track .mode-knob { transform: translateX(20px); }
.mode-input:focus-visible + .mode-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.src-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--line); flex: none; }
.src-btn { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 0.78rem; padding: 7px 15px; cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.src-btn + .src-btn { border-left: 1px solid var(--line); }
.src-btn.is-active { background: var(--accent); color: #06150f; }
/* Hidden by default; fades + slides in to the left of the pinned toggle when
   Marketing mode is on (JS toggles .is-shown). Controls keep their natural size
   (no width collapse → no layout shift), so the toggle never moves. */
.mkt-controls {
  display: inline-flex; align-items: center; gap: var(--space-3); flex: none; white-space: nowrap;
  opacity: 0; transform: translateX(8px); pointer-events: none; visibility: hidden;
  transition: opacity 0.26s var(--ease), transform 0.3s var(--ease), visibility 0.26s var(--ease);
}
.mkt-controls.is-shown { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.mkt-select { background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 0.85rem; padding: 9px 14px; cursor: pointer; width: auto; max-width: 220px; text-overflow: ellipsis; flex: none; }
.mkt-select:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mkt-panel { margin-top: var(--space-5); }
/* xAI card wrapper around the breakdown table (matches the other tabs). */
.mkt-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.mkt-table { width: 100%; border-collapse: collapse; }
.mkt-table th { text-align: right; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mkt-table td { text-align: right; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); font-size: 0.92rem; font-variant-numeric: tabular-nums; color: var(--text); }
.mkt-table tbody tr:last-child td { border-bottom: 0; }
.mkt-table tbody tr:hover { background: var(--surface-2); }
.mkt-table th:first-child, .mkt-table td:first-child { text-align: left; }
.mkt-src { font-family: var(--font) !important; font-weight: 500; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.mkt-cash { color: var(--good); font-weight: 600; }
/* cells whose hover reveals the underlying count / cash */
.mkt-cp[data-tip], .mkt-cash[data-tip] { cursor: help; }
/* styled metric tooltip — xAI: canvas-soft fill, hairline border, Geist-Mono UPPERCASE
   tracked, ink text, rounded.sm, NO shadow (hairline carries elevation). body-mounted. */
.mkt-tip {
  position: fixed; z-index: 200; pointer-events: none;
  padding: 6px 9px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--ink); font-family: var(--mono); text-transform: uppercase;
  font-size: 0.62rem; letter-spacing: 0.1em; line-height: 1.4;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; transform: translateY(3px);
  transition: opacity 0.12s var(--ease), transform 0.12s var(--ease);
}
.mkt-tip.show { opacity: 1; transform: translateY(0); }
.mkt-total td { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 600; color: var(--ink); }
.mkt-total:hover td { background: transparent; }
.mkt-empty { color: var(--muted); padding: var(--space-8); text-align: center; border: 1px dashed var(--line); border-radius: var(--r-md); }
/* click-to-sort headers (mirror the Ad-by-Ad .at-th) */
.mkt-th { cursor: pointer; user-select: none; transition: color 0.12s var(--ease); }
.mkt-th:hover { color: var(--muted); }
.mkt-th.is-sorted { color: var(--ink); }
.mkt-th:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.mkt-sort { font-style: normal; font-size: 0.82em; opacity: 0.4; margin-left: 5px; }
.mkt-th.is-sorted .mkt-sort { opacity: 1; color: var(--good); }
/* step-conversion chip on the seam between two cards */
.sales-strip .total { position: relative; }
.sales-conv {
  position: absolute; left: 0; top: 50%; transform: translate(-50%, -50%); z-index: 6;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 9px; font-family: var(--mono); font-size: 0.68rem; font-weight: 700;
  color: var(--accent); white-space: nowrap; letter-spacing: -0.02em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.sales-conv:empty { display: none; }
/* values must always fit their cell — never overflow / cut off */
.total { min-width: 0; }
.total-val { min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Sales strip packs 6 tiles in a row → tighter padding + a font that reads well
   for short values (counts, %) yet keeps long money inside the cell. */
.sales-strip .total { padding: var(--space-4) var(--space-4); text-align: center; }
.sales-strip .total-val { font-size: clamp(1.3rem, 0.55rem + 1.5vw, 1.95rem); margin-top: 6px; text-align: center; }
.sales-strip .total-label { font-size: 0.62rem; text-align: center; }
.status { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 5px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.live { color: var(--good); }
.status.live::before { box-shadow: 0 0 8px currentColor; animation: pulse 1.6s infinite; }
.status.upcoming { color: var(--accent-dim); }
.status.ended { color: var(--faint); }

/* version table */
.vtable { padding: var(--space-3) var(--space-4) var(--space-4); }
.vt-row {
  display: grid;
  grid-template-columns: minmax(104px, 1.25fr) repeat(8, minmax(58px, 1fr));
  align-items: stretch; gap: var(--space-3);
  padding: 0 var(--space-4); border-radius: var(--r-sm);
}
/* cells carry the vertical padding (not the row) so each cell fills the full row
   height — that lets the group-separator border run unbroken top-to-bottom. */
.vt-row > span { display: flex; align-items: center; justify-content: flex-end; padding: 11px 0; }
.vt-row > .vt-ver { justify-content: flex-start; }
/* column-group separators: one continuous rule per boundary, drawn centered in
   the whitespace between the previous group's last value and this group's first
   value (numbers are right-aligned, so a plain column-edge border hugs the prev
   number — left:50%-4px lands it midway between the two values). */
.vt-row > .grp-pct, .vt-row > .grp-cost { position: relative; }
.vt-row > .grp-pct::before, .vt-row > .grp-cost::before {
  content: ""; position: absolute; top: 0; bottom: 0;
  width: 1px; background: var(--line);
  /* midpoint between prev value's end (cell left - 8px gap) and this value's
     start (right-aligned): 50% - (ownTextWidth + 8px)/2. Text width differs per
     group: pct values ("14.8%") ≈ 36px, cost values ("$14.24") ≈ 48px. */
}
.vt-row > .grp-pct::before { left: calc(50% - 22px); }
.vt-row > .grp-cost::before { left: calc(50% - 28px); }
.vt-head > span {
  font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--faint); font-weight: 700;
}
.vt-body .vt-row + .vt-row { border-top: 1px solid var(--line-soft); border-radius: 0; }
.vt-body .vt-row:hover { background: var(--surface-2); }
.vt-row.is-all { background: var(--accent-soft); }
.vt-row.is-all .vt-ver { color: var(--accent); }

.vt-ver { font-weight: 600; font-size: 0.86rem; }
.num { font-family: var(--mono); font-weight: 500; font-size: 0.98rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.num.muted { color: var(--muted); }
/* relative per-column coloring: best in column = green, rest = orange */
.num.good { color: var(--good); font-weight: 600; }
.num.mid { color: var(--muted); }
.vt-loading { padding: var(--space-5) var(--space-4); color: var(--faint); font-size: 0.86rem; animation: blink 1.1s var(--ease) infinite; }
.vt-loading.err { color: var(--warn); animation: none; }

/* ── Empty state ──────────────────────────────────────── */
.empty {
  text-align: center; padding: var(--space-9) var(--space-6);
  max-width: 46ch; margin: var(--space-8) auto;
}
.empty-art { font-size: 40px; color: var(--accent-dim); margin-bottom: var(--space-5); }
.empty h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.empty p { color: var(--muted); margin: var(--space-4) 0 var(--space-6); }

/* ── Drawer ───────────────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: 120; visibility: hidden; }
.drawer[aria-hidden="false"] { visibility: visible; }
.drawer-scrim {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.drawer[aria-hidden="false"] .drawer-scrim { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(420px, 92vw); background: var(--surface);
  border-left: 1px solid var(--line);
  padding: var(--space-6) var(--space-6) var(--space-7);
  display: flex; flex-direction: column; gap: var(--space-5);
  overflow-y: auto;
  transform: translateX(100%); transition: transform 0.36s var(--ease);
  box-shadow: -24px 0 60px oklch(0.1 0.01 70 / 0.5);
}
.drawer[aria-hidden="false"] .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.field-label { font-size: 0.74rem; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.field-label em { color: var(--faint); font-style: normal; }
input, select {
  font-family: var(--font); font-size: 0.9rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 12px; width: 100%;
  transition: border-color 0.15s var(--ease);
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder { color: var(--faint); }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2398a3bd' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type="date"] { font-family: var(--mono); }

/* segmented type control */
.seg { display: grid; grid-auto-flow: column; gap: 6px; }
.seg button {
  font-family: var(--font); font-weight: 600; font-size: 0.85rem;
  padding: 9px; border-radius: var(--r-sm); cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
  transition: all 0.15s var(--ease); text-transform: capitalize;
}
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); border-color: var(--faint); }
.seg button:hover { color: var(--text); }

.form-err { color: var(--warn); font-size: 0.82rem; }
.drawer-foot { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: auto; padding-top: var(--space-4); }

/* ── Toast ────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%) translateY(10px);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: var(--r-sm); font-size: 0.86rem; font-weight: 500;
  z-index: 60; opacity: 0; transition: all 0.28s var(--ease); box-shadow: 0 12px 40px oklch(0.1 0.01 70 / 0.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { color: var(--warn); }

/* ── Motion ───────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes blink { 0%,100% { opacity: 0.4; } 50% { opacity: 0.85; } }

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

/* ── Responsive: version table scrolls horizontally on narrow screens ── */
@media (max-width: 760px) {
  /* must match .wb-body > .vtable specificity (collapse clip) to re-enable x-scroll.
     keep overflow-y hidden so the 0fr collapse animation still clips vertically. */
  .wb-body > .vtable { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .vt-row { min-width: 800px; }
  .wb-head { gap: var(--space-3); }
}

/* date range picker */
.daterange { position: relative; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 3px; }
.dr-trigger { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: transparent; border: 1px solid transparent; border-radius: var(--r-md); padding: 5px 12px; cursor: pointer; font-family: var(--font); transition: background .15s var(--ease), border-color .15s; }
.dr-trigger:hover { background: var(--surface-2); }
.dr-trigger.active { background: var(--surface-2); border-color: rgba(255,255,255,0.25); }
.dr-cap { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.13em; color: var(--faint); font-weight: 600; }
.dr-val { font-family: var(--mono); font-size: 0.84rem; color: var(--text); letter-spacing: -0.02em; }
.dr-sep { color: var(--faint); font-size: 0.8rem; padding: 0 2px; }
.dr-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 110; width: 286px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.dr-pop[hidden] { display: none; }
.dr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dr-month { font-family: var(--mono); font-weight: 600; font-size: 0.86rem; letter-spacing: -0.01em; }
.dr-nav { width: 28px; height: 28px; background: transparent; border: 1px solid rgba(255,255,255,0.25); border-radius: 9999px; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; display: grid; place-items: center; transition: color .15s, border-color .15s; }
.dr-nav:hover { color: var(--ink); border-color: rgba(255,255,255,0.4); }
.dr-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dr-dow { text-align: center; font-size: 0.56rem; color: var(--faint); font-weight: 600; text-transform: uppercase; padding: 2px 0 6px; }
.dr-day { aspect-ratio: 1; background: transparent; border: none; border-radius: var(--r-sm); color: var(--muted); font-family: var(--mono); font-size: 0.78rem; cursor: pointer; transition: background .12s, color .12s; }
.dr-day:hover:not(.is-disabled):not(.is-edge) { background: var(--surface-2); color: var(--text); }
.dr-day.in-range { background: var(--accent-soft); color: var(--text); }
.dr-day.is-edge { background: var(--accent); color: #0a0a0a; font-weight: 600; }
.dr-day.is-disabled { color: var(--line); cursor: not-allowed; }

/* ── Menu blur scrim ── */
.fab-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(8,8,9,0.4); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); opacity: 0; pointer-events: none; transition: opacity .32s var(--ease); }
body.menu-open .fab-scrim { opacity: 1; pointer-events: auto; }

/* ── Section views + floating burger menu ─────────────── */
.view[hidden] { display: none; }
/* topbar add/date controls only apply to Marketing */
body[data-view="sales"]   .topbar-actions,
body[data-view="organic"] .topbar-actions,
body[data-view="status"]  .topbar-actions,
body[data-view="ads"]      .topbar-actions { display: none; }

.placeholder {
  text-align: center; max-width: 50ch; margin: clamp(48px, 12vh, 120px) auto 0;
  padding: var(--space-9) var(--space-6);
  background: var(--surface); border: 1px solid var(--line-soft);
}
.ph-mark { font-family: var(--mono); font-size: 34px; color: var(--accent); line-height: 1; margin-bottom: var(--space-5); }
.placeholder h2 { font-size: clamp(1.4rem, 1rem + 1.4vw, 1.9rem); font-weight: 700; letter-spacing: -0.03em; }
.placeholder p { color: var(--muted); margin: var(--space-4) 0 var(--space-5); line-height: 1.65; }
.ph-soon {
  display: inline-block; font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--accent); border: 1px solid var(--line); padding: 6px 12px;
}

/* floating menu */
.fab { position: fixed; right: clamp(16px, 3vw, 28px); bottom: clamp(16px, 3vw, 28px); z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-3); pointer-events: none; }
.fab-toggle { pointer-events: auto; }
.fab-items { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-2); }
.fab-item {
  font-family: var(--font); font-weight: 600; font-size: 0.84rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); padding: 11px 16px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  opacity: 0; transform: translateY(16px) scale(0.96); pointer-events: none;
  transition: opacity .28s var(--ease), transform .4s var(--ease), color .15s, border-color .15s, background .15s;
}
.fab-item:hover { color: var(--text); border-color: var(--faint); }
.fab-item.is-active { color: var(--accent); background: var(--surface-2); border-color: var(--accent-soft); }
/* per-section emoji glyph (replaces the old square dot) */
.fab-item .fab-dot { width: auto; height: auto; background: none; font-size: 1.05rem; line-height: 1; opacity: 0.65; transition: opacity 0.15s var(--ease), transform 0.15s var(--ease); }
.fab-item:hover .fab-dot { opacity: 0.9; }
.fab-item.is-active .fab-dot { opacity: 1; transform: scale(1.08); }
.fab-sep { width: 64%; align-self: flex-end; height: 1px; background: var(--line); margin: 3px 4px; opacity: 0; transition: opacity .28s var(--ease); }
.fab.open .fab-sep { opacity: 0.55; }
.fab-item.fab-meta { color: var(--faint); }
.fab-item.fab-meta.is-active { color: var(--accent); }

/* Status tab */
.st-badge { font-weight: 800; letter-spacing: 0.02em; }
.st-ok { color: var(--accent); }
.st-warn { color: var(--warn); }
.st-err { color: #ff6b6b; }
.st-time { font-size: 1.45rem; }
.st-meta { color: var(--muted); font-size: 0.86rem; line-height: 1.8; margin: var(--space-6) 0; }
.st-meta b { color: var(--text); font-weight: 600; }
.st-detail { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }
.st-detail.err { color: var(--warn); }
.st-table { padding: var(--space-3) var(--space-4) var(--space-4); margin-top: var(--space-4); }
.st-table .at-row { grid-template-columns: 1fr auto; }
/* per-source health row: Source · Last run · Status pill · Rows */
.st-table .at-row.st-src { grid-template-columns: 1fr auto 76px 72px; align-items: center; gap: var(--space-4); }
.st-when { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); text-align: right; white-space: nowrap; }
.st-src .num { text-align: right; }
/* status pill — xAI pill shape (9999px) + hairline border, semantic text color */
.st-pill { justify-self: center; font-family: var(--mono); font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.08em; padding: 2px 9px; border-radius: 9999px; border: 1px solid var(--line);
  white-space: nowrap; text-align: center; }
.st-pill.st-ok { color: var(--accent); }
.st-pill.st-warn { color: var(--warn); border-color: rgba(255,122,23,0.4); }
.st-pill.st-err { color: #ff6b6b; border-color: rgba(255,107,107,0.4); }
.st-pill.st-muted { color: var(--faint); }
.st-rowerr { font-family: var(--mono); font-size: 0.68rem; color: var(--warn); padding: 1px var(--space-3) var(--space-3); }

/* ── Daily Report ─────────────────────────────────────── */
.drep-eyebrow { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.62rem;
  font-weight: 700; color: var(--faint); padding: 0 var(--space-2) var(--space-3); }
.drep-mut { color: var(--faint); font-style: italic; }
/* NB: own prefix `drep-` — NOT `dr-`, which the date-picker calendar owns (.dr-day
   there has aspect-ratio:1, which would force every day card square / equal-height). */
.drep-day { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.drep-sum { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-5); cursor: pointer; list-style: none; user-select: none; transition: background .12s var(--ease); }
.drep-sum::-webkit-details-marker { display: none; }
.drep-sum::marker { content: ""; }
.drep-sum:hover { background: var(--surface-2); }
.drep-date { font-family: var(--font); font-weight: 600; font-size: 0.95rem; color: var(--ink); letter-spacing: -0.01em; }
.drep-date::before { content: "▸"; display: inline-block; margin-right: var(--space-3); color: var(--faint);
  font-size: 0.7rem; transition: transform .15s var(--ease); }
.drep-day[open] .drep-date::before { transform: rotate(90deg); }
.drep-pills { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
.drep-tot { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.05rem;
  color: var(--ink); min-width: 40px; text-align: right; }
.drep-day[open] .drep-sum { border-bottom: 1px solid var(--line-soft); }
/* body shows only when open, so closed days collapse to summary height (native) */
.drep-body { display: none; }
.drep-day[open] .drep-body { display: flex; flex-direction: column; gap: var(--space-5);
  padding: var(--space-4) var(--space-4) var(--space-5); }

/* source-group pill — xAI pill shape, hairline border, mono caps, restrained color */
.g-pill { font-family: var(--mono); font-size: 0.56rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 9999px; border: 1px solid var(--line); white-space: nowrap; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.g-pill.g-ads     { color: var(--violet); border-color: rgba(196,181,253,0.35); }
.g-pill.g-youtube { color: var(--warn); border-color: rgba(255,122,23,0.35); }
.g-pill.g-email   { color: var(--good); border-color: rgba(160,195,236,0.35); }
.g-pill.g-other   { color: var(--muted); }

.drep-grphead { display: flex; align-items: center; gap: var(--space-3); font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 0.66rem; font-weight: 700; color: var(--faint); padding: 0 var(--space-2) var(--space-3); }
.drep-grphead.g-ads     { color: var(--violet); }
.drep-grphead.g-youtube { color: var(--warn); }
.drep-grphead.g-email   { color: var(--good); }
.drep-grpn { font-variant-numeric: tabular-nums; color: var(--muted); }

/* exact-source table: utm_source · utm_campaign · utm_content · count (UTMs left-aligned) */
.drep-tbl { padding: 0; }
.drep-tbl .at-row { grid-template-columns: minmax(90px,1fr) minmax(110px,1.6fr) minmax(110px,1.6fr) 72px; min-width: 0; gap: var(--space-4); }
.drep-tbl .at-row > span { justify-content: flex-start; padding: 8px 0; font-size: 0.82rem; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 1.4; }
.drep-tbl .at-row > span.num { justify-content: flex-end; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.drep-tbl .at-head > span { font-size: 0.58rem; }

/* ── Export modal ─────────────────────────────────────── */
/* fade scrim + scale/slide the card on open; reverse on close (aria-hidden toggle) */
.exp-modal { position: fixed; inset: 0; z-index: 300; opacity: 0; visibility: hidden;
  transition: opacity .2s var(--ease), visibility 0s linear .2s; }
.exp-modal[aria-hidden="false"] { opacity: 1; visibility: visible; transition: opacity .2s var(--ease); }
.exp-scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.6); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.exp-card { position: absolute; left: 50%; top: 50%;
  width: min(440px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4);
  transform: translate(-50%,-50%) scale(0.96) translateY(8px); transition: transform .22s var(--ease); }
.exp-modal[aria-hidden="false"] .exp-card { transform: translate(-50%,-50%); }
.exp-head { display: flex; align-items: center; justify-content: space-between; }
.exp-head h2 { font-family: var(--font); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.02em; color: var(--ink); }
.exp-x { background: transparent; border: none; color: var(--muted); font-size: 0.95rem; cursor: pointer; line-height: 1; padding: 4px; transition: color .12s var(--ease); }
.exp-x:hover { color: var(--ink); }
.exp-sub { color: var(--muted); font-size: 0.82rem; line-height: 1.5; margin-top: calc(-1 * var(--space-2)); }
.exp-label { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.6rem; font-weight: 700; color: var(--faint); }
.exp-select { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 12px; font-family: var(--font); font-size: 0.9rem; width: 100%; margin-top: calc(-1 * var(--space-3)); }
.exp-go { width: 100%; justify-content: center; margin-top: var(--space-2); transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease); }
/* completion signature moment: brief breeze-blue confirm before the modal closes */
.exp-go.is-done, .exp-go.is-done:hover { background: var(--good) !important; border-color: var(--good) !important; color: #06150f !important; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .exp-modal, .exp-modal .exp-card { transition: none; }
  .exp-modal[aria-hidden="false"] .exp-card, .exp-card { transform: translate(-50%,-50%); }
}
.fab.open .fab-item { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.fab.open .fab-item:nth-child(1) { transition-delay: .02s; }
.fab.open .fab-item:nth-child(2) { transition-delay: .07s; }
.fab.open .fab-item:nth-child(3) { transition-delay: .12s; }

.fab-toggle {
  width: 54px; height: 54px; background: var(--accent); border: 1px solid var(--accent); cursor: pointer;
  display: grid; place-items: center; align-self: flex-end;
  box-shadow: 0 12px 34px rgba(78,232,176,0.28), 0 4px 12px rgba(0,0,0,0.5);
  transition: transform .3s var(--ease), background .2s var(--ease), border-color .2s;
}
.fab-toggle:hover { transform: translateY(-2px); }
.fab.open .fab-toggle { background: var(--surface-2); border-color: var(--line); }
.fab-burger { position: relative; width: 20px; height: 14px; }
.fab-burger i { position: absolute; left: 0; width: 100%; height: 2px; background: #06150f; transition: transform .35s var(--ease), opacity .2s, background .2s; }
.fab-burger i:nth-child(1) { top: 0; }
.fab-burger i:nth-child(2) { top: 6px; }
.fab-burger i:nth-child(3) { top: 12px; }
.fab.open .fab-burger i { background: var(--text); }
.fab.open .fab-burger i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.fab.open .fab-burger i:nth-child(2) { opacity: 0; }
.fab.open .fab-burger i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* version row external-link icon */
.vt-ver { display: inline-flex; align-items: center; gap: 7px; }
.vt-link { display: inline-flex; align-items: center; color: var(--faint); transition: color .15s var(--ease), transform .15s var(--ease); }
.vt-link:hover { color: var(--accent); transform: translate(1px, -1px); }

/* ── Ad-by-Ad table ─────────────────────────────────────── */
.wb-body > .atable { overflow: hidden; min-height: 0; }  /* collapse clip (matches .vtable) */
.wb-body > .sales-body { overflow: hidden; min-height: 0; padding: var(--space-3) 0 var(--space-4); }  /* collapse clip for the Sales two-row body */
.atable { padding: var(--space-3) var(--space-4) var(--space-4); }
.at-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.at-row {
  display: grid;
  grid-template-columns: minmax(160px, 2.2fr) repeat(7, minmax(70px, 1fr));
  align-items: center; gap: var(--space-3); padding: 0 var(--space-4); min-width: 860px;
}
.at-row > span { display: flex; align-items: center; justify-content: flex-end; padding: 10px 0; }
.at-row > .at-name { display: block; min-width: 0; align-self: stretch; line-height: 40px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 0.84rem; }
.at-head > span { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 700; }
.at-head > .at-name { line-height: 34px; }
/* click-to-sort column headers */
.at-th { cursor: pointer; gap: 5px; transition: color 0.12s var(--ease); }
.at-th:hover { color: var(--muted); }
.at-th.is-sorted { color: var(--text); }
.at-sort { font-size: 0.82em; opacity: 0.45; font-style: normal; }
.at-th.is-sorted .at-sort { opacity: 1; color: var(--accent); }
.at-th:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* instant, styled column tooltip (replaces slow native title) */
.at-th[data-tip], .ot-th[data-tip] { position: relative; }
.at-th[data-tip]::after, .ot-th[data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 9px); right: 0;
  width: max-content; max-width: 230px;
  padding: 9px 11px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  color: var(--muted); font-size: 0.72rem; font-weight: 500; line-height: 1.45;
  text-transform: none; letter-spacing: 0; text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; transform: translateY(-3px);
  transition: opacity 0.1s var(--ease), transform 0.1s var(--ease), visibility 0.1s;
  pointer-events: none; z-index: 90;
}
.at-th[data-tip]:hover::after, .at-th[data-tip]:focus-visible::after,
.ot-th[data-tip]:hover::after { opacity: 1; visibility: visible; transform: translateY(0); }

/* Organic table — Video + 6 metric columns */
.atable.ot { padding: var(--space-5) var(--space-6) var(--space-6); }
.atable.ot .at-row { grid-template-columns: minmax(180px, 2.4fr) repeat(6, minmax(64px, 1fr)); }
.ot-th { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.ot-count { color: var(--faint); font-size: 0.74rem; font-weight: 500; }
.ot-bar { display: flex; justify-content: flex-end; margin-bottom: var(--space-4); }
.ot-bar .btn { font-size: 0.8rem; padding: 7px 14px; }
.atable.ot .at-row.ot-unmatched { opacity: 0.42; }
.atable.ot .at-name a { color: inherit; text-decoration: none; }
.atable.ot .at-name a:hover { color: var(--accent); text-decoration: underline; }
/* Email table — Email/campaign + 8 metric columns (overrides the .ot 6-col grid) */
.atable.et .at-row { grid-template-columns: minmax(240px, 3.7fr) repeat(8, minmax(50px, 1fr)); }
/* Email name cell: label ellipsizes, funnel tag + "· N emails" badge never truncate. */
.atable.et .at-name { display: flex; align-items: center; gap: 7px; }
.atable.et .et-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.atable.et .at-name .tag, .atable.et .at-name .ot-count { flex-shrink: 0; }
/* Space between the stacked YouTube + Email tables (no heading labels). */
#board-email { margin-top: var(--space-5); }
.at-body .at-row + .at-row { border-top: 1px solid var(--line-soft); }
.at-body .at-row:hover { background: var(--surface-2); }
.at-row.is-best { background: var(--accent-soft); }
.at-row.is-best .at-name { color: var(--accent); }
.at-total { border-top: 1px solid var(--line); margin-top: 2px; }
.at-total > span { font-weight: 700; }
.at-total > .at-name, .at-total > span:first-child { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.at-sub { padding: var(--space-4) var(--space-4) var(--space-2); font-size: 0.62rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--faint); font-weight: 700; border-top: 1px solid var(--line-soft); margin-top: var(--space-3); }
.at-muted .at-name { color: var(--muted); font-weight: 500; }
.at-warn { padding: var(--space-3) var(--space-4); color: var(--warn); font-size: 0.8rem; }

/* grade split for Form filled (A/B/C/D) — hover-only popover, absolute so it
   never changes the tile height; kept inside the tile so .totals overflow:hidden
   doesn't clip it. */
.total:has(.grade-split) { position: relative; }
.grade-split {
  position: absolute; inset: 0;
  padding: var(--space-5) var(--space-6);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px 11px;
  background: rgba(17,17,19,0.55);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  font-family: var(--mono); font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums;
  opacity: 0; visibility: hidden; transform: scale(1.015);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  pointer-events: none;
}
.total:hover .grade-split:not(:empty) { opacity: 1; visibility: visible; transform: scale(1); }
/* burger-style overlay: dim + blur the sibling tiles so the grade popover stands out */
.totals:has(.total:has(.grade-split):hover) .total:not(:has(.grade-split)) {
  filter: blur(2px); opacity: 0.5;
}
.totals .total { transition: filter .3s var(--ease), opacity .3s var(--ease); }
.grade-split i { width: 1px; height: 9px; background: var(--line-soft); display: inline-block; }
.grade-split .gr { font-weight: 700; margin-right: 3px; font-style: normal; }
.grade-split .gr-a { color: var(--accent); }
.grade-split .gr-b { color: var(--good); }
.grade-split .gr-c { color: var(--muted); }
.grade-split .gr-d { color: var(--warn); }

/* ─────────────────────────────────────────────────────────────────────────
   xAI type system — Inter (display + body), Geist Mono for eyebrows/labels/
   counters. Display = tight NEGATIVE tracking, ink white, modest weight (no
   bold). Eyebrows = Geist Mono UPPERCASE with positive tracking. */
.brand-sub { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.6rem; color: var(--muted); }
/* Display headings: title-case, tight negative tracking, ink white. */
.wb-name { text-transform: none; letter-spacing: -0.02em; font-weight: 600; color: var(--ink); }
.empty h2, .drawer-head h2 { text-transform: none; letter-spacing: -0.025em; font-weight: 600; color: var(--ink); }
.placeholder h2 { text-transform: none; letter-spacing: -0.03em; font-weight: 600; color: var(--ink); }
/* Headline metric values → ink white. */
.total-val { color: var(--ink); }
/* Eyebrows / labels / counters → Geist Mono, uppercase, positive tracking. */
.total-label, .vt-head > span, .at-head > span, .ot-count, .dr-cap, .dr-month,
.ver-filter > span, .tag, .ph-soon, .at-sub, .at-total > .at-name,
.at-total > span:first-child, .mkt-table th { font-family: var(--mono); }
/* Running prose stays Inter (no serif in xAI) with a hair of negative tracking. */
.empty p, .placeholder p, .st-meta { font-family: var(--font); letter-spacing: -0.01em; }

/* ─── xAI finish: flat near-black, no shadows, translucent-white pill controls ─── */
.grain { display: none; }                                   /* flat canvas — no film grain */
/* No shadows / glows anywhere — depth is hairline borders + surface tone only. */
.drawer-panel, .toast, .fab-item, .fab-toggle, .sales-conv, .dr-pop,
.at-th[data-tip]::after, .ot-th[data-tip]::after,
.status.live::before, .fab-item.is-active .fab-dot { box-shadow: none; }
/* No glassmorphism — solid surfaces instead of blur. */
.sales-pop, .grade-split { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(25,25,25,0.94); }
.fab-scrim { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(0,0,0,0.7); }

/* Interactive = pill, 1px translucent-white border, transparent fill (xAI signature). */
.btn { background: transparent; border: 1px solid rgba(255,255,255,0.25); color: var(--text);
  border-radius: 9999px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.4); color: var(--ink); }
.btn.ghost { color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
/* The single filled-pill exception → primary CTA (Add webinar / first-run). */
.btn.solid { background: var(--ink); border-color: var(--ink); color: #0a0a0a; font-weight: 500; }
.btn.solid:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #0a0a0a; transform: translateY(-1px); }
/* Pill-ify the remaining controls. (Text inputs / selects stay 8px rounded rects.) */
.fab-item, .icon-btn, .dr-nav, .ph-soon, .tag, .seg button, .src-toggle { border-radius: 9999px; }
.src-toggle { overflow: hidden; }                            /* clip the active segment to the pill */
.src-btn.is-active { background: var(--ink); color: #0a0a0a; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); border-color: rgba(255,255,255,0.4); color: var(--ink); }
.placeholder { border-radius: var(--r-lg); }
/* Circular menu toggle: solid black, translucent-white pill border. */
.fab-toggle { background: #000000; border: 1px solid rgba(255,255,255,0.25); border-radius: 9999px; }
.fab-toggle:hover { background: #000000; border-color: rgba(255,255,255,0.4); }
.fab.open .fab-toggle { background: #000000; border-color: var(--line); }
.fab-burger i { background: var(--text); }
/* Focus: thin translucent-white ring, no accent glow. */
input:focus, select:focus { border-color: rgba(255,255,255,0.5); box-shadow: none; }
.st-err { color: var(--warn); }
