/* ============================================================
   VDS Lead Platform — Components
   Built ONLY from tokens.css variables. No raw hex anywhere.
   ============================================================ */

/* ---------------- Reset / base ---------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--grad-page), var(--paper);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv05" 1;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.tnum { font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; color: var(--ink); letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }

/* Visible, branded focus ring on everything interactive */
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }

/* Brand-tinted text selection */
::selection { background: color-mix(in srgb, var(--red) 22%, transparent); }

/* Themed thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* Reduced motion: kill animation/transitions for users who ask */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------- App shell ---------------- */
.app { display: flex; min-height: 100vh; }
.rail {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--rail-w); flex: none;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 0;
  background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--paper) 55%, var(--panel)));
  border-right: 1px solid var(--line);
}
.rail__logo {
  width: 34px; height: 34px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  margin-bottom: 8px; letter-spacing: -.04em;
}
.rail__logo svg { width: 21px; height: 19px; display: block;
  filter: drop-shadow(0 1px 1px color-mix(in srgb, #000 22%, transparent)); }
.rail__spacer { flex: 1; }
.rail-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: var(--radius);
  border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.rail-btn svg { width: 20px; height: 20px; }
.rail-btn:hover { background: var(--paper-2); color: var(--ink); }
.rail-btn[aria-current="page"] { background: var(--red-tint); color: var(--red); }
.rail-btn[aria-current="page"]::after {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: var(--radius-pill); background: var(--red);
}
.rail-btn .tip {
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%) scale(.96);
  background: var(--ink); color: var(--paper); padding: 5px 9px; border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 550; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
  box-shadow: var(--shadow-md); z-index: 50;
}
.rail-btn:hover .tip { opacity: 1; transform: translateY(-50%) scale(1); }
.rail__avatar {
  width: 32px; height: 32px; border-radius: var(--radius-pill);
  background: var(--slate); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 650; border: 0;
}

/* ---------------- Contextual panel ---------------- */
.panel {
  position: fixed; inset: 0 auto 0 var(--rail-w); z-index: 30;
  width: var(--panel-w); flex: none;
  display: flex; flex-direction: column;
  background-color: color-mix(in srgb, var(--paper) 78%, transparent);
  /* Fine horizontal hairlines — a quiet, luxury linen/pinstripe texture. */
  background-image: repeating-linear-gradient(to bottom,
    color-mix(in srgb, var(--ink) 3.5%, transparent) 0 1px, transparent 1px 3px);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--line);
  /* Slight inset shadow hugging the left edge (against the rail) — a touch of depth. */
  box-shadow: inset 8px 0 12px -10px color-mix(in srgb, var(--scrim) 38%, transparent);
  transition: transform var(--duration) var(--ease);
}
[data-theme="dark"] .panel {
  /* Dark mode: faint light hairlines on the dark surface — premium brushed/carbon feel. */
  background-image: repeating-linear-gradient(to bottom,
    color-mix(in srgb, var(--ink) 6%, transparent) 0 1px, transparent 1px 3px);
}
.app.panel-collapsed .panel { transform: translateX(calc(-1 * (var(--panel-w) + 2px))); }
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 8px;
}
.panel__title { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); }
.panel__scroll { overflow-y: auto; padding: 4px 10px 14px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.panel__section { margin-top: 14px; }
.panel__section + .panel__section { border-top: 1px solid var(--line); padding-top: 12px; }
.panel__label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); padding: 4px 8px; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: var(--radius); color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; border: 0; background: transparent; width: 100%; text-align: left;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.nav-item:hover { background: var(--paper-2); }
.nav-item[aria-current="true"], .nav-item.is-active { background: var(--red-tint); color: var(--red); font-weight: 600; }
.nav-item svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.nav-item[aria-current="true"] svg, .nav-item.is-active svg { color: var(--red); }
.nav-item .count { margin-left: auto; font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.nav-item .dot { margin-left: auto; }

/* Client switcher inside panel — fills the panel height; search pinned, list scrolls. */
.switcher { padding: 0 8px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.switcher__list { margin-top: 6px; display: flex; flex-direction: column; gap: 1px; flex: 1; min-height: 0; overflow-y: auto; }
.client-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 8px; border-radius: var(--radius); border: 0; background: transparent; text-align: left;
  font-size: 13px; color: var(--ink-2);
  transition: background var(--duration) var(--ease);
}
.client-row:hover { background: var(--paper-2); }
.client-row.is-active { background: var(--panel); box-shadow: var(--shadow-xs); font-weight: 600; }
.client-row__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- Main + context bar ---------------- */
.main {
  flex: 1; min-width: 0;
  margin-left: calc(var(--rail-w) + var(--panel-w));
  transition: margin-left var(--duration) var(--ease);
  display: flex; flex-direction: column;
}
.app.panel-collapsed .main { margin-left: var(--rail-w); }

.context-bar {
  position: sticky; top: 0; z-index: 20;
  min-height: var(--contextbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px;
  background: var(--glass-fill);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge);
}
.panel-toggle {
  width: 30px; height: 30px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--muted); display: grid; place-items: center; flex: none;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.panel-toggle:hover { color: var(--ink); background: var(--paper-2); }
.panel-toggle svg { width: 15px; height: 15px; }

.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
.breadcrumb b { color: var(--ink); font-weight: 600; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { color: var(--muted-2); }
.context-bar__spacer { flex: 1; }
.context-bar__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* view flag (admin vs client) + demo switcher */
.view-flag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 650; flex: none; white-space: nowrap; }
.view-flag svg { width: 12px; height: 12px; }
.view-flag--admin { background: var(--ink); color: var(--paper); }
.view-flag--admin i { font-style: normal; font-weight: 500; opacity: .72; }
.view-flag--client { background: var(--info-tint); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.demo-switch { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.demo-switch__note { font-size: 10px; color: var(--muted-2); letter-spacing: .02em; white-space: nowrap; }

/* viewing-as chip */
.viewing-as {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 5px 6px 5px 11px; border-radius: var(--radius-pill);
  background: var(--amber-tint); color: var(--amber);
  font-size: 12.5px; font-weight: 600; border: 1px solid color-mix(in srgb, var(--amber) 28%, transparent);
}
.viewing-as a { color: var(--amber); text-decoration: underline; text-underline-offset: 2px; font-weight: 650; }
.viewing-as .x {
  width: 18px; height: 18px; border-radius: var(--radius-pill); border: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber);
}
.viewing-as .x svg { width: 11px; height: 11px; }

/* ---------------- Page container ---------------- */
.page { padding: 22px; max-width: 1400px; width: 100%; }
.page--wide { max-width: none; }
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page__title {
  font-size: 21px; font-weight: 700;
  background: var(--grad-ink-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.page__sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.section-title { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); margin: 0 0 10px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.btn svg { width: 15px; height: 15px; }
.btn--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--red) 88%, #fff), var(--red));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), var(--shadow-xs);
}
.btn--primary:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--red-hover) 88%, #fff), var(--red-hover)); }
.btn--primary:active { background: var(--red-dark); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); }
.btn--default { background: var(--grad-raised); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn--default:hover { background: var(--paper-2); }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--paper-2); }
.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: var(--red-hover); }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn--icon { width: 34px; padding: 0; }
.btn--icon.btn--sm { width: 28px; }
.btn:disabled { opacity: .5; pointer-events: none; }

.linkish { color: var(--red); font-weight: 600; }
.linkish:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- Inputs ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field__hint { font-size: 12px; color: var(--muted); }
.field__error { font-size: 12px; color: var(--red); font-weight: 550; display: none; }
.field.has-error .field__error { display: block; }
.field.has-error .input { border-color: var(--red); }

.input, .select, .textarea {
  height: 34px; padding: 0 11px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  font-family: inherit; font-size: 13.5px; width: 100%;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a93a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px;
}

.search {
  position: relative; display: flex; align-items: center;
}
.search svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted-2); pointer-events: none; }
.search .input { padding-left: 32px; }

.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--red); cursor: pointer; }

.toggle { position: relative; width: 38px; height: 22px; flex: none; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle__track { position: absolute; inset: 0; background: var(--line-strong); border-radius: var(--radius-pill); transition: background var(--duration) var(--ease); }
.toggle__thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: var(--radius-pill); background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--duration) var(--ease); }
.toggle input:checked ~ .toggle__track { background: var(--grad-brand); }
.toggle input:checked ~ .toggle__thumb { transform: translateX(16px); }
.toggle input:focus-visible ~ .toggle__track { box-shadow: var(--focus-ring); }

/* Segmented control */
.segmented { display: inline-flex; padding: 2px; gap: 2px; background: var(--paper-2); border-radius: var(--radius); border: 1px solid var(--line); }
.segmented button {
  height: 26px; padding: 0 11px; border: 0; background: transparent; border-radius: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.segmented button[aria-pressed="true"], .segmented button.is-active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-xs); }

/* ---------------- Cards ---------------- */
.card {
  background: var(--glass-sheen), var(--glass-fill-strong);
  -webkit-backdrop-filter: var(--glass-blur-soft); backdrop-filter: var(--glass-blur-soft);
  border: 1px solid var(--glass-border); border-radius: var(--radius-l);
  box-shadow: var(--glass-edge), var(--shadow-sm);
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: color-mix(in srgb, var(--paper-2) 88%, var(--panel)); border-bottom: 1px solid color-mix(in srgb, var(--line-strong) 55%, var(--line)); border-radius: var(--radius-l) var(--radius-l) 0 0; }
.card__title { font-size: 14px; font-weight: 650; display: inline-flex; align-items: center; gap: 7px; }
.card__title svg, .card__title [data-ico] { width: 14px; height: 14px; color: var(--muted-2); display: inline-flex; }
.card__body { padding: 16px; }
.card__foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }

/* The single metric card — used for KPI strips everywhere */
.metric-card {
  background: var(--glass-sheen), var(--glass-fill-strong);
  -webkit-backdrop-filter: var(--glass-blur-soft); backdrop-filter: var(--glass-blur-soft);
  border: 1px solid var(--glass-border); border-radius: var(--radius-l);
  padding: 15px 16px 14px; box-shadow: var(--glass-edge), var(--shadow-xs);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 11px; min-width: 0;
  position: relative; overflow: hidden;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
a.metric-card, .metric-card.is-link { transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease); }
a.metric-card:hover, .metric-card.is-link:hover { border-color: color-mix(in srgb, var(--accent, var(--line-strong)) 55%, var(--line-strong)); box-shadow: var(--glass-edge), var(--shadow-md); transform: translateY(-2px); }
.metric-card__label { font-size: 11.5px; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.metric-card__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.metric-card__value { font-size: 31px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; margin-top: auto; }
.metric-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-card__src { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); }
.metric-card__spark { height: 30px; width: 84px; flex: none; }

/* ── Perfected KPI cards: accent chip · corner glow · count-up value · rate gauge ── */
.metric-card::before {
  content: ""; position: absolute; inset: -48% -28% auto auto; width: 156px; height: 156px; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, var(--ink)) 17%, transparent), transparent 70%);
  opacity: .6; transition: opacity var(--duration) var(--ease);
}
a.metric-card:hover::before, .metric-card.is-link:hover::before { opacity: 1; }
.metric-card__top { display: flex; align-items: center; justify-content: center; gap: 9px; position: relative; }
.metric-card__ico { width: 27px; height: 27px; border-radius: 8px; flex: none; display: grid; place-items: center;
  color: var(--accent, var(--ink)); background: color-mix(in srgb, var(--accent, var(--line)) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, var(--line)) 22%, transparent); }
.metric-card__ico svg { width: 15px; height: 15px; }
.metric-card__value { position: relative; }
.metric-card__gauge { height: 5px; width: 100%; align-self: stretch; border-radius: 999px; overflow: hidden; position: relative;
  background: color-mix(in srgb, var(--accent, var(--line)) 16%, transparent); }
.metric-card__gauge > span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 62%, transparent), var(--accent));
  box-shadow: 0 0 9px -1px color-mix(in srgb, var(--accent) 65%, transparent);
  transition: width .7s cubic-bezier(.22,1,.36,1); }
.metric-card__cap { font-size: 11px; font-weight: 550; letter-spacing: .015em; color: var(--muted-2);
  display: flex; align-items: center; justify-content: center; gap: 5px; position: relative; }

.kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpi-strip--4 { grid-template-columns: repeat(4, 1fr); }
.kpi-strip--6 { grid-template-columns: repeat(6, 1fr); }

.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.delta svg { width: 12px; height: 12px; }
.delta--up { color: var(--delta-up); }
.delta--down { color: var(--delta-down); }
.delta--flat { color: var(--muted-2); }

/* ---------------- Badges / chips ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: currentColor; opacity: .85; }
.badge--soft { background: var(--paper-2); color: var(--ink-2); }
.badge--outline { background: transparent; color: var(--muted); border-color: var(--line-strong); }

/* status stage badges */
.badge--stage-new { background: var(--stage-new-tint); color: var(--stage-new); }
.badge--stage-reviewing { background: var(--stage-reviewing-tint); color: var(--stage-reviewing); }
.badge--stage-qualified { background: var(--stage-qualified-tint); color: var(--stage-qualified); }
.badge--stage-contacted { background: var(--stage-contacted-tint); color: var(--stage-contacted); }
.badge--stage-closed { background: var(--stage-closed-tint); color: var(--stage-closed); }
.badge--needs-review { background: var(--amber-tint); color: var(--amber); }

/* confidence badges */
.badge--conf-high { background: var(--conf-high-tint); color: var(--conf-high); }
.badge--conf-medium { background: var(--conf-medium-tint); color: var(--conf-medium); }
.badge--conf-low { background: var(--conf-low-tint); color: var(--conf-low); }

/* feedback badges */
.badge--amber { background: var(--amber-tint); color: var(--amber); }
.badge--info { background: var(--info-tint); color: var(--info); }
.badge--ok { background: var(--ok-tint); color: var(--ok); }
.badge--danger { background: var(--red-tint); color: var(--red); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: var(--radius-pill);
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--ink-2);
  font-size: 12.5px; font-weight: 550;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.chip:hover { background: var(--paper-2); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--red-tint); border-color: color-mix(in srgb, var(--red) 30%, transparent); color: var(--red); }
.chip svg { width: 13px; height: 13px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.dnc { display: inline-flex; align-items: center; gap: 3px; color: var(--red); font-weight: 650; font-size: 11px; }
.inferred { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--amber); background: var(--amber-tint); padding: 1px 5px; border-radius: var(--radius-xs); }

/* health dot */
.health { display: inline-flex; align-items: center; }
.health__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.health--ok .health__dot { background: var(--health-ok); }
.health--warn .health__dot { background: var(--health-warn); }
.health--bad .health__dot { background: var(--health-bad); box-shadow: 0 0 0 3px var(--red-tint); animation: health-pulse 2s var(--ease) infinite; }
@keyframes health-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--red-tint); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 10%, transparent); }
}

/* ---------------- The single TABLE ---------------- */
.table-wrap { background: var(--glass-sheen), var(--glass-fill-strong); -webkit-backdrop-filter: var(--glass-blur-soft); backdrop-filter: var(--glass-blur-soft); border: 1px solid var(--glass-border); border-radius: var(--radius-l); box-shadow: var(--glass-edge), var(--shadow-sm); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
/* Fixed-layout variant: columns honor the <colgroup> widths exactly instead of
   resizing to content, so headers always sit over their data and inter-column
   gaps stay constant no matter what each cell holds (a key vs. a long URL, etc.).
   Pair with a <colgroup> whose widths sum to 100%. Cells that could overflow a
   locked column (long emails) clip with an ellipsis rather than forcing a reflow. */
.table--fixed { table-layout: fixed; }
.table--fixed tbody td { overflow: hidden; text-overflow: ellipsis; }
.table--fixed .lead-cell__name, .table--fixed .lead-cell__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--paper); color: var(--muted-2); text-align: left; font-weight: 650; font-size: 11px;
  padding: 16px 14px 9px; border-bottom: 1px solid var(--line); white-space: nowrap;
  text-transform: uppercase; letter-spacing: .05em;
}
.table thead th.num, .table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Centered columns (leads: Source · Medium · Enriched) — header th-inner + body cells. */
.table thead th.col-center { text-align: center; }
.table tbody td[data-colname="source"], .table tbody td[data-colname="medium"], .table tbody td[data-colname="enriched"] { text-align: center; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable .th-inner { display: inline-flex; align-items: center; gap: 5px; }
.table th.sortable .sort-ico { opacity: 0; transition: opacity var(--duration) var(--ease); width: 12px; height: 12px; }
.table thead th svg { width: 13px; height: 13px; }
.table th.sortable:hover .sort-ico { opacity: .5; }
.table th[aria-sort="ascending"] .sort-ico, .table th[aria-sort="descending"] .sort-ico { opacity: 1; color: var(--red); }
.table th[aria-sort="descending"] .sort-ico { transform: rotate(180deg); }
.table tbody td { padding: 11px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); color: var(--ink-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.row-link { cursor: pointer; transition: background var(--duration) var(--ease); }
.table tbody tr.row-link:hover { background: var(--paper-2); }
.table tbody tr.is-selected { background: var(--red-tint); }
.table .ellip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .col-check { width: 38px; }
.table .col-check input { width: 16px; height: 16px; accent-color: var(--red); }
.table caption { text-align: left; padding: 0; }

/* cell helpers */
.lead-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: var(--radius-pill); background: var(--paper-2); color: var(--ink-2); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.avatar--red { background: var(--red-tint); color: var(--red); }
/* deterministic hue variants — assigned by app.js from initials */
.avatar--h0 { background: var(--red-tint); color: var(--red); }
.avatar--h1 { background: var(--info-tint); color: var(--info); }
.avatar--h2 { background: var(--ok-tint); color: var(--ok); }
.avatar--h3 { background: var(--stage-contacted-tint); color: var(--stage-contacted); }
.avatar--h4 { background: var(--amber-tint); color: var(--amber); }
.avatar--h5 { background: var(--stage-new-tint); color: var(--stage-new); }
.lead-cell__main { min-width: 0; }
.lead-cell__name { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.lead-cell__sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.dash { color: var(--muted-2); }

/* score bar */
.score { display: inline-flex; align-items: center; gap: 8px; }
.score__bar { display: block; width: 56px; height: 6px; border-radius: var(--radius-pill); background: var(--paper-2); overflow: hidden; }
.score__fill { display: block; height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, color-mix(in srgb, var(--red) 72%, var(--gold)), var(--red)); width: calc(var(--score, 0) * 1%); }
.score__num { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 20px; text-align: right; }

/* Radial gauge — engine-free semicircle (SVG arc, pathLength-normalized to 100). Each gauge sits
   in its own rounded, subtly-recessed box; accent via --gauge-accent (a token). Lead-detail Score
   + Confidence readouts. */
.gauge-box { display: inline-flex; flex-direction: column; align-items: center; padding: 10px 18px 11px;
  border-radius: 14px; --gauge-accent: var(--series-3);
  background: color-mix(in srgb, var(--ink) 3.5%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
.gauge__dial { position: relative; width: 156px; height: 92px; }
.gauge__dial svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gauge__track { fill: none; stroke: color-mix(in srgb, var(--ink) 12%, transparent); stroke-width: 12; stroke-linecap: round; }
.gauge__fill { fill: none; stroke: var(--gauge-accent); stroke-width: 12; stroke-linecap: round;
  transition: stroke-dasharray .55s var(--ease); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--gauge-accent) 45%, transparent)); }
.gauge__center { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.gauge__value { font-size: 23px; font-weight: 800; letter-spacing: -.02em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gauge__label { margin-top: 4px; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }

/* conv bar (channel) */
.bar-mini { display: block; height: 7px; border-radius: var(--radius-pill); background: var(--paper-2); overflow: hidden; }
.bar-mini__fill { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--series-2) 78%, #fff), var(--series-2)); border-radius: var(--radius-pill); width: calc(var(--pct,0) * 1%); }

/* empty-state row */
.table .empty-row td { padding: 0; border: 0; }
.empty-state { text-align: center; padding: 44px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state__icon { width: 40px; height: 40px; border-radius: var(--radius-l); background: transparent; border: 1.5px dashed var(--line-strong); color: var(--muted-2); display: grid; place-items: center; margin-bottom: 4px; }
.empty-state__icon svg { width: 20px; height: 20px; }
.empty-state h3 { font-size: 15px; }
.empty-state p { color: var(--muted); font-size: 13.5px; max-width: 360px; }

/* ---------------- Table chrome: toolbar / pagination ---------------- */
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.count-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--radius-pill); background: var(--paper-2); color: var(--ink-2); font-size: 12.5px; font-weight: 650; }
.count-badge b { color: var(--ink); }
.toolbar-spacer { flex: 1; }

.filter-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filter-bar .input, .filter-bar .select { height: 32px; width: auto; min-width: 0; }
.filter-bar .search { flex: 1; min-width: 180px; max-width: 280px; }

.pagination { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); }
.pagination__info { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.pager button { width: 30px; height: 30px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-2); display: grid; place-items: center; font-size: 12.5px; font-variant-numeric: tabular-nums; transition: background var(--duration) var(--ease); }
.pager button:hover:not(:disabled) { background: var(--paper-2); }
.pager button[aria-current="page"] { background: var(--grad-brand); color: #fff; border-color: var(--red); }
.pager button:disabled { opacity: .4; pointer-events: none; }
.pager button svg { width: 14px; height: 14px; }
.page-size { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.page-size .select { height: 30px; width: auto; padding: 0 26px 0 9px; }

/* ---------------- Bulk action bar ---------------- */
.bulk-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%);
  z-index: 60; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--ink-2), var(--ink)); color: var(--paper); box-shadow: var(--shadow-lg);
  transition: transform var(--duration) var(--ease);
}
.bulk-bar.is-open { transform: translate(-50%, 0); }
.bulk-bar__count { font-weight: 650; font-size: 13.5px; }
.bulk-bar__count b { color: #fff; }
.bulk-bar .divider { width: 1px; height: 20px; background: rgba(255,255,255,.2); }
.bulk-bar .bbtn { height: 30px; padding: 0 12px; border-radius: var(--radius-pill); border: 0; background: rgba(255,255,255,.1); color: var(--paper); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; transition: background var(--duration) var(--ease); }
.bulk-bar .bbtn:hover { background: rgba(255,255,255,.2); }
.bulk-bar .bbtn svg { width: 14px; height: 14px; }
.bulk-bar .bbtn--close { width: 30px; padding: 0; background: transparent; }

/* ---------------- Toasts ---------------- */
.toast-region { position: fixed; top: 16px; right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 10px; width: 320px; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px;
  border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--ok);
  animation: toast-in var(--duration) var(--ease);
}
.toast.is-leaving { animation: toast-out .16s var(--ease) forwards; }
.toast--ok { border-left-color: var(--ok); }
.toast--info { border-left-color: var(--info); }
.toast--danger { border-left-color: var(--red); }
.toast__ico { flex: none; margin-top: 1px; }
.toast__ico svg { width: 16px; height: 16px; }
.toast--ok .toast__ico { color: var(--ok); }
.toast--info .toast__ico { color: var(--info); }
.toast--danger .toast__ico { color: var(--red); }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-size: 13px; font-weight: 650; color: var(--ink); }
.toast__msg { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.toast__x { border: 0; background: transparent; color: var(--muted-2); width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--radius-xs); flex: none; }
.toast__x:hover { background: var(--paper-2); color: var(--ink); }
.toast__x svg { width: 13px; height: 13px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

/* ---------------- Dialog (modal) ---------------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity var(--duration) var(--ease); }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.dialog {
  width: 100%; max-width: 440px;
  background: var(--glass-sheen), var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-l); box-shadow: var(--glass-edge), var(--shadow-lg); overflow: hidden;
  transform: translateY(8px) scale(.99); transition: transform var(--duration) var(--ease);
}
.scrim.is-open .dialog { transform: translateY(0) scale(1); }
.dialog__head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 0; }
.dialog__ico { width: 36px; height: 36px; border-radius: var(--radius); display: grid; place-items: center; flex: none; background: var(--red-tint); color: var(--red); }
.dialog__ico.is-info { background: var(--info-tint); color: var(--info); }
.dialog__ico svg { width: 18px; height: 18px; }
.dialog__title { font-size: 16px; font-weight: 680; }
.dialog__body { padding: 8px 18px 18px 66px; color: var(--muted); font-size: 13.5px; }
.dialog__body strong { color: var(--ink); font-weight: 650; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--paper); }

/* ---------------- Drawer (slide-over) ---------------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity var(--duration) var(--ease); }
.drawer-scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 72; width: 460px; max-width: 92vw;
  background: var(--glass-sheen), var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--glass-border); box-shadow: var(--glass-edge), var(--shadow-lg);
  transform: translateX(100%); transition: transform var(--duration) var(--ease);
  display: flex; flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer__title { font-size: 16px; font-weight: 680; }
.drawer__body { overflow-y: auto; padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 18px; }

/* ---------------- Popover (column picker / menus) ---------------- */
.pop-host { position: relative; }
.popover {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; min-width: 220px;
  background: var(--glass-sheen), var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--glass-edge), var(--shadow-lg);
  padding: 7px; opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.popover.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.popover__label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); padding: 5px 9px; }
.popover__item { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: var(--radius-xs); font-size: 13px; color: var(--ink-2); width: 100%; border: 0; background: transparent; text-align: left; }
.popover__item:hover { background: var(--paper-2); }
.popover__item svg { width: 14px; height: 14px; color: var(--muted); }
.popover__item.is-danger { color: var(--red); }
.popover__item.is-danger svg { color: var(--red); }
.popover hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

/* dropdown menu button caret */
.menu-btn svg.caret { width: 13px; height: 13px; }

/* ---------------- Panels for detail pages ---------------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
/* lead_detail holds exactly TWO direct children (left stack, right stack); Person is the first
   card in the left stack (Operational removed, §7). Kept for any detail page that still places a
   card directly in the grid — it equalizes to the taller of its row. */
.detail-grid > .card { align-self: stretch; }
.stack { display: flex; flex-direction: column; gap: 16px; }
/* the two stacks equalize to the taller column; a .card--grow inside fills the slack
   so the right column's bottom lines up with the left (Activity ↔ the left column). */
.detail-grid > .stack { align-self: stretch; }
.card--grow { flex: 1 1 auto; }
/* Anchored cards (lead-detail "On this page" panel nav) scroll clear of the sticky context bar. */
.card[id] { scroll-margin-top: 84px; }

/* Key-value detail list — recessed panel + hairline row dividers (design bake-off winner).
   Labels never wrap; values single-line with ellipsis (carry a title= for the full string). */
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 0; font-size: 13.5px;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 12px; padding: 2px 16px; }
.dl dt, .dl dd { padding: 10px 0; min-width: 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.dl dt { color: var(--muted); white-space: nowrap; }
.dl dt:first-of-type, .dl dd:first-of-type { border-top: 0; }
.dl dd { margin: 0; color: var(--ink); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl dd.dash { color: var(--muted-2); font-weight: 400; }

.collapsible__head { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; border: 0; padding: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.collapsible__head svg { width: 14px; height: 14px; transition: transform var(--duration) var(--ease); }
.collapsible[open] .collapsible__head svg, .collapsible.is-open .collapsible__head svg { transform: rotate(90deg); }

/* ── Channel details — expandable ranked breakdown (traffic tab) ─────────── */
.chdet { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.chdet:first-of-type { border-top: 0; }
.chdet__row { display: grid; grid-template-columns: 15px minmax(120px, 1fr) minmax(90px, 1.5fr) 74px 46px;
  align-items: center; gap: 16px; padding: 11px 8px; cursor: pointer; list-style: none;
  border-radius: var(--radius-sm); transition: background var(--duration) var(--ease); }
.chdet__row::-webkit-details-marker { display: none; }
.chdet__row:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.chdet[open] > .chdet__row { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.chdet__chev svg { width: 14px; height: 14px; color: var(--muted-2); transition: transform var(--duration) var(--ease); }
.chdet[open] .chdet__chev svg { transform: rotate(90deg); }
.chdet__name { display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  font-size: 13.5px; font-weight: 600; color: var(--ink); }
.chdet__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chdet__dot { width: 9px; height: 9px; border-radius: 999px; flex: none; background: var(--accent, var(--series-1)); }
.chdet__bar { height: 8px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--accent, var(--series-1)) 14%, transparent); }
.chdet__fill { display: block; height: 100%; min-width: 6px; border-radius: 999px; background: var(--accent, var(--series-1)); }
.chdet__sessions { text-align: right; font-size: 13.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.chdet__share { justify-self: end; }
.chdet__detail { padding: 2px 8px 16px; }
.chdet__detail .funnel-stats { margin-top: 0; gap: 0; }
.chdet__detail .funnel-stats > div { text-align: center; padding: 2px 12px; }
.chdet__detail .funnel-stats > div + div { border-left: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.chdet__detail .funnel-stat__v { font-size: 18px; text-align: center; }

/* before/after enrichment compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.compare__col { padding: 14px 16px; }
.compare__col + .compare__col { border-left: 1px solid var(--line); }
.compare__col--after { background: color-mix(in srgb, var(--ok-tint) 60%, transparent); }
.compare__h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.compare__col--after .compare__h { color: var(--ok); }
.compare__field { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.compare__field:last-child { border-bottom: 0; }
.compare__field.added { padding-left: 9px; border-left: 2px solid var(--ok); margin: 4px 0; }
.compare__k { font-size: 11.5px; color: var(--muted); }
.compare__v { font-size: 13.5px; color: var(--ink); font-weight: 550; }

/* attribution dual cards */
.touch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.touch-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; }
.touch-card__h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }

/* timeline */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding-bottom: 16px; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.tl-ico { width: 28px; height: 28px; border-radius: var(--radius-pill); display: grid; place-items: center; background: var(--paper-2); color: var(--muted); z-index: 1; }
.tl-ico svg { width: 14px; height: 14px; }
.tl-ico--ok { background: var(--ok-tint); color: var(--ok); }
.tl-ico--info { background: var(--info-tint); color: var(--info); }
.tl-ico--red { background: var(--red-tint); color: var(--red); }
.tl-body { padding-top: 3px; }
.tl-title { font-size: 13.5px; color: var(--ink); }
.tl-title b { font-weight: 650; }
.tl-time { font-size: 12px; color: var(--muted-2); margin-top: 1px; }
.tl-note { margin-top: 6px; padding: 9px 11px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; color: var(--ink-2); }
.tl-note__author { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* ---------------- Funnel ---------------- */
.card--col { display: flex; flex-direction: column; }
.funnel-body { display: flex; flex-direction: column; flex: 1; }
.funnel { display: flex; flex-direction: column; gap: 4px; flex: 1; justify-content: center; }
.funnel__stage { cursor: pointer; }
.funnel__bar-track { display: flex; align-items: center; gap: 10px; min-width: 0; }
.funnel__meta { min-width: 0; }
.funnel__bar { height: 44px; border-radius: var(--radius); display: flex; align-items: center; padding: 0 12px; color: #fff; font-weight: 650; font-size: 14px; min-width: 60px; flex: none; transition: filter var(--duration) var(--ease); }
.funnel-connector { display: flex; align-items: center; gap: 8px; padding-left: 18px; font-size: 11.5px; color: var(--muted-2); }
.funnel-connector__line { width: 2px; height: 16px; border-radius: 1px; background: linear-gradient(180deg, var(--line-strong), color-mix(in srgb, var(--line-strong) 30%, transparent)); flex: none; }
.funnel-connector b { color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.funnel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); padding-top: 13px; margin-top: 14px; }
.funnel-stat__v { font-size: 17px; font-weight: 720; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.funnel-stat__l { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); margin-top: 2px; }
.funnel__stage:hover .funnel__bar { filter: brightness(1.06); }
.funnel__bar--1 { background: linear-gradient(135deg, color-mix(in srgb, var(--series-2) 82%, #fff), var(--series-2)); flex: 1 1 auto; width: auto; }
.funnel__bar--2 { background: linear-gradient(135deg, color-mix(in srgb, var(--series-1) 84%, #fff), var(--series-1)); }
.funnel__bar--3 { background: linear-gradient(135deg, color-mix(in srgb, var(--series-3) 82%, #fff), var(--series-3)); }
.funnel__meta { font-size: 12.5px; color: var(--muted); }
.funnel__drop { font-size: 12px; color: var(--delta-down); font-weight: 600; }

/* ── Leads-by-stage distribution bars (a status snapshot, not a conversion funnel) ──
   Fixed label + count columns so every stage is always readable; per-stage --accent. */
.stage-bars { display: flex; flex-direction: column; gap: 9px; }
.stage-bar { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 14px;
  text-decoration: none; color: inherit; }
.stage-bar__label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  display: flex; align-items: center; gap: 8px; }
.stage-bar__label::before { content: ""; width: 8px; height: 8px; border-radius: 999px; flex: none;
  background: var(--accent); box-shadow: 0 0 7px -1px var(--accent); }
.stage-bar__track { height: 26px; border-radius: 8px; overflow: hidden;
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.stage-bar__fill { display: block; height: 100%; border-radius: 8px; min-width: 7px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 66%, transparent), var(--accent));
  box-shadow: var(--glass-edge), 0 0 12px -3px var(--accent);
  transition: width .7s cubic-bezier(.22,1,.36,1); }
.stage-bar:hover .stage-bar__fill { filter: brightness(1.08); }
.stage-bar__count { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
/* Ranked variant (Top sources / Top campaigns): single accent per list, longer
   string labels (e.g. "brand-paid-search") get a wider column + ellipsis, and the
   per-row legend dot is dropped since every bar shares one color. */
.stage-bars--rank .stage-bar { grid-template-columns: 124px 1fr 28px; gap: 12px; }
.stage-bars--rank .stage-bar__label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stage-bars--rank .stage-bar__label::before { display: none; }

/* ---------------- Charts ---------------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--series-grid); stroke-width: 1; stroke-dasharray: 3 5; }
.chart .axis-label { fill: var(--muted-2); font-size: 10px; font-family: var(--font); }
.chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: var(--series-area); }
.chart .dot { fill: var(--panel); stroke: var(--series-1); stroke-width: 2; }

/* signature line chart */
.chart--rich { position: relative; }
.chart--rich .line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: chart-draw .9s var(--ease) .1s forwards; }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }
.chart--rich .end-halo { transform-box: fill-box; transform-origin: center; animation: end-halo 2.4s var(--ease) infinite; }
@keyframes end-halo { 0%, 100% { transform: scale(1); opacity: .35; } 50% { transform: scale(1.9); opacity: 0; } }
.chart--rich .end-chip-bg { fill: var(--ink); }
.chart--rich .end-chip-tx { fill: var(--paper); font-size: 10.5px; font-weight: 650; font-family: var(--font); }
.chart-cross { position: absolute; top: 5%; bottom: 12%; width: 0; border-left: 1px dashed var(--line-strong); opacity: 0; transition: opacity var(--duration) var(--ease); pointer-events: none; }
.chart-tip {
  position: absolute; transform: translate(-50%, -140%); pointer-events: none;
  background: var(--ink); color: var(--paper); font-size: 11.5px; font-weight: 550;
  padding: 4px 9px; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity var(--duration) var(--ease);
}
.chart-tip b { color: inherit; font-weight: 750; font-variant-numeric: tabular-nums; }
.chart--rich.is-hover .chart-cross, .chart--rich.is-hover .chart-tip { opacity: 1; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* channel block */
.channel-row { display: grid; grid-template-columns: minmax(110px, 1.3fr) 1fr 64px 50px 56px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); font-size: 13px; }
.channel-row:last-child { border-bottom: 0; }
.channel-row--head { padding: 4px 0 8px; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); border-bottom: 1px solid var(--line); }
.channel-row__name { font-weight: 600; display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.channel-row__nm { display: flex; flex-direction: column; gap: 3px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-row__flag { height: 17px; font-size: 9.5px; padding: 0 6px; width: fit-content; }
.channel-row .swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; margin-top: 5px; }

/* ---------------- Skeletons ---------------- */
.skel { background: linear-gradient(100deg, var(--paper-2) 30%, var(--line) 50%, var(--paper-2) 70%); background-size: 200% 100%; animation: skel 1.2s linear infinite; border-radius: var(--radius-xs); }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-line { height: 12px; }
.skel-kpi { height: 92px; border-radius: var(--radius-l); }

/* ---------------- Flash banner ---------------- */
.flash { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius); font-size: 13.5px; font-weight: 550; margin-bottom: 16px; border: 1px solid transparent; }
.flash svg { width: 16px; height: 16px; flex: none; }
.flash--ok { background: var(--ok-tint); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 24%, transparent); }
.flash--amber { background: var(--amber-tint); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 24%, transparent); }
.flash--danger { background: var(--red-tint); color: var(--red); border-color: color-mix(in srgb, var(--red) 24%, transparent); }

/* ---------------- Tabs (used by data-tracking via panel subnav, plus inline) ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { height: 38px; padding: 0 14px; border: 0; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--red); border-bottom-color: var(--red); }
/* per-tab count badge (nested Leads sub-tabs) — token-pure pill, both themes via tokens */
.tab__count { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--paper-2); color: var(--muted-2); font-size: 11px; line-height: 17px;
  font-weight: 650; font-variant-numeric: tabular-nums; vertical-align: middle; }
.tab[aria-selected="true"] .tab__count { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }

/* ---------------- Misc utilities ---------------- */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
/* inline "▸ Play" recording link inside a table cell — keeps icon + label on the baseline */
.cell-play { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.cell-play svg { width: 13px; height: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fz-12 { font-size: 12px; } .fz-13 { font-size: 13px; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.text-muted { color: var(--muted); }
.copy-code { display: inline-flex; align-items: center; gap: 7px; padding: 3px 8px; border-radius: var(--radius-xs); background: var(--paper-2); border: 1px solid var(--line); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--ink-2); cursor: pointer; transition: background var(--duration) var(--ease); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.copy-code:hover { background: var(--line); }
.copy-code svg { width: 12px; height: 12px; color: var(--muted); }

/* ---------------- Login ---------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(820px 520px at 50% -12%, color-mix(in srgb, var(--red) 7%, transparent), transparent 62%), var(--grad-page), var(--paper); }
.auth-card { width: 100%; max-width: 380px; background: var(--glass-sheen), var(--glass-fill-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); border-radius: var(--radius-l); box-shadow: var(--glass-edge), var(--shadow-lg); padding: 32px 30px; }
.auth-logo { width: 44px; height: 44px; border-radius: var(--radius); background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 19px; letter-spacing: -.04em; margin-bottom: 18px; }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-foot { margin-top: 18px; font-size: 12.5px; color: var(--muted-2); text-align: center; }
.theme-fab { position: fixed; top: 16px; right: 16px; }

/* ---- Login hero (the platform's first entry point — LOGIN_REDESIGN_PROMPT.md). Token-driven so it
   themes automatically; both light + dark verified. ---- */
.auth-card--hero { max-width: 416px; padding: 38px 38px 30px; position: relative; z-index: 1;
  animation: authIn .5s var(--ease) both; }
@keyframes authIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
/* Centered hero block: logo → eyebrow → heading → slogan. The form below stays left-aligned. */
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.auth-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; color: var(--red);
  border-radius: 15px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--red) 10%, transparent), transparent 78%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 22%, transparent),
              inset 0 1px 0 color-mix(in srgb, #fff 30%, transparent),
              0 10px 26px color-mix(in srgb, var(--red) 32%, transparent);
  margin-bottom: 20px; }
.auth-mark svg { width: 41px; height: 41px; display: block;
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--red) 45%, transparent)); }
.auth-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 9px; }
.auth-card--hero .auth-title { font-size: 33px; line-height: 1.05; font-weight: 800; letter-spacing: -.022em;
  color: var(--ink); margin-bottom: 11px; }
.auth-slogan { font-size: 15.5px; font-weight: 450; color: var(--muted-2); margin-bottom: 0; letter-spacing: 0; }
.auth-field { margin-bottom: 15px; }
.input-wrap { position: relative; display: block; }
.input-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); display: grid; place-items: center; pointer-events: none; transition: color var(--duration) var(--ease); }
.input-ico svg { width: 15px; height: 15px; }
.input--ico { padding-left: 34px; height: 42px; }
.input-wrap:focus-within .input-ico { color: var(--red); }
.auth-card--hero .input { transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease); }
.auth-card--hero .flash { margin-bottom: 20px; }
.auth-submit { height: 48px; font-size: 15px; font-weight: 640; margin-top: 8px; border-radius: var(--radius); letter-spacing: -.01em;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--red) 30%, transparent); transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), filter var(--duration) var(--ease); }
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 26px color-mix(in srgb, var(--red) 38%, transparent); }
.auth-submit:active { transform: translateY(0); }
.auth-submit svg { transition: transform var(--duration) var(--ease); }
.auth-submit:hover svg { transform: translateX(3px); }

/* ---------------- Roster / dashboard layout ---------------- */
.split { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.attn-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.attn-item:last-child { border-bottom: 0; }
.attn-item__body { flex: 1; min-width: 0; }
.attn-item__title { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.attn-item__reason { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.activity-item { display: flex; gap: 10px; padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-item .when { color: var(--muted-2); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* form-review three-zone */
.review-grid { display: grid; grid-template-columns: 220px minmax(0,1fr) 340px; gap: 16px; align-items: start; }
.thumb { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 10px; background: var(--panel); width: 100%; text-align: left; transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease); }
.thumb.is-active { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.thumb__name { font-size: 13px; font-weight: 650; margin-top: 8px; }
.thumb__meta { font-size: 12px; color: var(--muted); }
.thumb__preview { height: 110px; border-radius: var(--radius-xs); background: var(--paper-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.thumb__preview .ln { height: 9px; border-radius: 3px; background: var(--line-strong); }
.preview-stage { border: 1px solid var(--line); border-radius: var(--radius-l); padding: 28px; display: grid; place-items: center; min-height: 360px; transition: background var(--duration) var(--ease); }
.preview-stage.bg-site { background: var(--paper-2); }
.swatch-edit { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.swatch-edit:last-child { border-bottom: 0; }
.swatch-chip { width: 22px; height: 22px; border-radius: var(--radius-xs); border: 1px solid var(--line-strong); flex: none; }
.gate-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.gate-row:last-child { border-bottom: 0; }
.gate-ico { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.gate-ico svg { width: 11px; height: 11px; }
.gate-ico--pass { background: var(--ok-tint); color: var(--ok); }
.gate-ico--warn { background: var(--amber-tint); color: var(--amber); }
.gate-ico--fail { background: var(--red-tint); color: var(--red); }

/* ingest step tracker */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding-bottom: 18px; position: relative; }
.step:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 30px; bottom: 0; width: 2px; background: var(--ok); }
.step.is-fail:not(:last-child)::before { background: var(--line); }
.step__ico { width: 32px; height: 32px; border-radius: var(--radius-pill); display: grid; place-items: center; z-index: 1; }
.step__ico svg { width: 15px; height: 15px; }
.step__ico--ok { background: var(--ok); color: #fff; }
.step__ico--fail { background: var(--red); color: #fff; }
.step__ico--idle { background: var(--paper-2); color: var(--muted-2); }
.step__title { font-size: 14px; font-weight: 600; }
.step__meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* upload dropzone */
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius-l); padding: 34px 24px; text-align: center; background: var(--paper); transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease); }
.dropzone:hover { border-color: var(--red); background: var(--red-tint); }
.dropzone__ico { width: 44px; height: 44px; border-radius: var(--radius-l); background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 12px; color: var(--muted); }

/* account cards (GA4) */
.acct-card { border: 1px solid var(--line); border-radius: var(--radius-l); padding: 16px; background: var(--panel); }
.acct-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

/* index directory */
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.dir-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--panel); box-shadow: var(--shadow-xs); transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease); }
.dir-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.dir-card__name { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.dir-card__file { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--muted-2); }
.dir-card__desc { font-size: 12.5px; color: var(--muted); }

/* ---------------- Organic layer (form review + global) ---------------- */
/* dot-grid design canvas */
.canvas-dots { background-image: radial-gradient(color-mix(in srgb, var(--line-strong) 55%, transparent) 1px, transparent 1px); background-size: 16px 16px; }

/* generation provenance strip */
.gen-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: var(--radius-l);
  background: linear-gradient(120deg, color-mix(in srgb, var(--red-tint) 45%, var(--panel)), var(--panel) 42%);
  font-size: 13px; color: var(--ink-2);
}
.gen-strip__site { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink); }
.gen-strip__favicon { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.gen-strip__step { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.gen-strip__step svg { width: 13px; height: 13px; color: var(--ok); }
.gen-strip__sep { color: var(--line-strong); }
.gen-strip__time { margin-left: auto; color: var(--muted-2); font-size: 12px; }

/* preview entrance — re-triggerable */
.preview-in { animation: preview-in .28s var(--ease); }
@keyframes preview-in { from { opacity: 0; transform: translateY(7px) scale(.99); } to { opacity: 1; transform: none; } }

/* on-site mock backdrop inside preview stage */
.preview-stage { position: relative; overflow: hidden; }
.preview-stage > * { position: relative; z-index: 1; }
.site-mock { position: absolute; inset: 0; z-index: 0; opacity: 0; transition: opacity var(--duration) var(--ease); pointer-events: none; }
.preview-stage.bg-site .site-mock { opacity: 1; }
.site-mock__hero { height: 44%; background: linear-gradient(130deg, var(--ink) 10%, var(--ink-soft)); }
.site-mock__hero .ln { position: absolute; border-radius: var(--radius-pill); background: rgba(255,255,255,.22); }
.site-mock__body { height: 56%; background: var(--paper-2); }
.site-mock__body .ln { position: absolute; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--line-strong) 70%, transparent); }

/* why-this-design note */
.why-line {
  display: flex; gap: 9px; align-items: flex-start; margin-top: 12px;
  padding: 10px 13px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper-2) 55%, transparent);
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
}
.why-line svg { width: 14px; height: 14px; color: var(--gold); flex: none; margin-top: 2px; }
.why-line b { color: var(--ink-2); font-weight: 600; }

/* extracted colour swatches (form-review preview) — renamed from `.palette` to avoid colliding with
   the ⌘K command palette (which also uses `.palette` and was inheriting this flex-row + padding). */
.swatches { display: flex; gap: 7px; padding: 4px 0 10px; }
.swatches__chip { width: 22px; height: 22px; border-radius: 7px; border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); transition: transform var(--duration) var(--ease); }
.swatches__chip:hover { transform: scale(1.18); }

/* extraction confidence bars */
.conf-bars { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 12px; }
.conf-bars span { width: 3.5px; border-radius: 2px; background: var(--line-strong); }
.conf-bars span:nth-child(1) { height: 5px; } .conf-bars span:nth-child(2) { height: 8px; } .conf-bars span:nth-child(3) { height: 12px; }
.conf-bars--high span { background: var(--ok); }
.conf-bars--medium span:nth-child(-n+2) { background: var(--amber); }
.conf-label { font-size: 11.5px; font-weight: 650; }

/* gate icon stagger */
.gate-row .gate-ico { animation: pop-in .3s var(--ease) backwards; }
.gate-row:nth-child(1) .gate-ico { animation-delay: .04s; }
.gate-row:nth-child(2) .gate-ico { animation-delay: .1s; }
.gate-row:nth-child(3) .gate-ico { animation-delay: .16s; }
.gate-row:nth-child(4) .gate-ico { animation-delay: .22s; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* glass action bar (sticky page footer) */
.action-bar {
  position: sticky; bottom: 16px; z-index: 25;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--glass-sheen), var(--glass-fill);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius-l); box-shadow: var(--glass-edge), var(--shadow-md);
}
.check-dots { display: inline-flex; gap: 4px; }
.check-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.check-dots span.is-warn { background: var(--amber); }
.check-dots span.is-fail { background: var(--red); }

/* option thumbnails — organic refinement */
.thumb { position: relative; }
.thumb__preview .ln { border-radius: var(--radius-pill); }
.thumb__check {
  position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--red); color: #fff; display: none; place-items: center; box-shadow: var(--shadow-sm);
}
.thumb__check svg { width: 10px; height: 10px; }
.thumb.is-active .thumb__check { display: grid; animation: pop-in .25s var(--ease); }
.thumb__name { display: flex; align-items: center; gap: 7px; }

/* ---------------- Setup wizard ---------------- */
.wiz__rail { display: flex; align-items: center; margin-bottom: 22px; flex-wrap: wrap; row-gap: 10px; }
.wiz-node { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; padding: 0; }
.wiz-node__dot {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 700; background: var(--paper-2); color: var(--muted);
  border: 1px solid var(--line-strong);
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.wiz-node__dot svg { width: 13px; height: 13px; }
.wiz-node.is-done .wiz-node__dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.wiz-node.is-active .wiz-node__dot { background: var(--grad-brand); border-color: var(--red); color: #fff; box-shadow: 0 0 0 4px var(--red-tint); }
.wiz-node__label { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.wiz-node.is-active .wiz-node__label { color: var(--ink); }
.wiz-node.is-done .wiz-node__label { color: var(--ink-2); }
.wiz-link { flex: 1; height: 2px; background: var(--line); margin: 0 10px; min-width: 14px; border-radius: 1px; }
.wiz-link.is-done { background: var(--ok); }
.wiz-pane { animation: preview-in .25s var(--ease); }
.wiz-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }

/* live status pill */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; flex: none;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 650;
  background: var(--paper-2); color: var(--muted); border: 1px solid var(--line-strong);
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: none; }
.live-pill.is-checking { background: var(--info-tint); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.live-pill.is-checking .dot { background: var(--info); animation: pill-blink .9s var(--ease) infinite; }
.live-pill.is-live { background: var(--ok-tint); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 32%, transparent); }
.live-pill.is-live .dot { background: var(--ok); }
@keyframes pill-blink { 50% { opacity: .3; } }

/* where-to-find-it instruction box */
.instruct {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 11px 13px; border-radius: var(--radius);
  background: var(--info-tint); border: 1px solid color-mix(in srgb, var(--info) 22%, transparent);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.55;
}
.instruct svg { width: 14px; height: 14px; color: var(--info); flex: none; margin-top: 2px; }
.instruct b { font-weight: 650; }
.instruct .mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; background: color-mix(in srgb, var(--panel) 70%, transparent); padding: 1px 5px; border-radius: 4px; }

/* multistep preview step dots */
.step-dots { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted-2); font-weight: 650; }
.step-dots span { width: 22px; height: 5px; border-radius: var(--radius-pill); background: var(--paper-2); }
.step-dots span.is-on { background: var(--red); }

/* ---------------- 2026 pop layer (research-driven) ---------------- */
/* gradient hairline border utility */
.border-grad {
  border: 1px solid transparent;
  background-image: var(--grad-card),
    linear-gradient(135deg, color-mix(in srgb, var(--red) 38%, var(--line)), var(--line) 42%, color-mix(in srgb, var(--info) 30%, var(--line)));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

/* film-grain noise on glass surfaces */
.tex-noise { position: relative; }
.tex-noise::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: .035; mix-blend-mode: overlay;
}
[data-theme="dark"] .tex-noise::after { opacity: .05; }

/* hover-reveal row actions */
.table .row-reveal { opacity: 0; transition: opacity var(--duration) var(--ease); }
.table tr:hover .row-reveal, .table tr:focus-within .row-reveal,
.table .row-reveal:has(.popover.is-open) { opacity: 1; }

/* bento feature KPI tile */
.metric-card--hero { grid-column: span 2; }
.metric-card--hero .metric-card__value { font-size: 34px; }
.metric-card--hero .metric-card__spark { width: 150px; height: 40px; }
.metric-card--hero .metric-card__spark svg { width: 100%; height: 100%; }

/* context-bar depth on scroll */
.context-bar.is-scrolled { box-shadow: var(--glass-edge), var(--shadow-sm); border-bottom-color: var(--line-strong); }

/* toast auto-dismiss progress hairline */
.toast { position: relative; overflow: hidden; }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: color-mix(in srgb, currentColor 25%, transparent); animation: toast-life 4s linear forwards; }
.toast:hover::after { animation-play-state: paused; }
@keyframes toast-life { to { width: 0; } }

/* aurora drift behind the auth card */
.auth-wrap { position: relative; overflow: hidden; }
.auth-wrap::before, .auth-wrap::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; z-index: 0;
}
.auth-wrap::before { width: 480px; height: 480px; left: 10%; top: 3%; background: color-mix(in srgb, var(--red) 16%, transparent);
  animation: aurora-a 16s var(--ease) infinite alternate, authGlow 5.5s ease-in-out infinite alternate; }
.auth-wrap::after { width: 360px; height: 360px; right: 10%; bottom: 8%; background: color-mix(in srgb, var(--info) 11%, transparent); animation: aurora-b 19s var(--ease) infinite alternate; }
.auth-card { position: relative; z-index: 1; }
@keyframes aurora-a { to { transform: translate(60px, 40px) scale(1.12); } }
@keyframes aurora-b { to { transform: translate(-50px, -36px) scale(1.08); } }
/* Breathing red glow behind the card — pulses opacity so the brand colour feels alive. */
@keyframes authGlow { from { opacity: .5; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .auth-wrap::before, .auth-wrap::after { animation: none; } }

/* segmented press feedback */
.segmented button:active { transform: scale(.96); }

/* ---------------- Command palette (⌘K) ---------------- */
.palette-scrim {
  position: fixed; inset: 0; z-index: 95; background: var(--scrim);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: none; align-items: flex-start; justify-content: center; padding: 16vh 16px 16px;
}
.palette-scrim.is-open { display: flex; }
/* `display:block` is explicit so the input/list/hint always STACK (a stray `.palette{display:flex}`
   used to leak in from the colour-swatch palette and lay them out in a row). */
.palette { display: block; width: 560px; max-width: 100%; border-radius: var(--radius-l); background: var(--glass-sheen), var(--glass-fill); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); box-shadow: var(--glass-edge), var(--shadow-lg); overflow: hidden; animation: preview-in .2s var(--ease); }
/* Search header — the hero of the palette: a red-tinted icon badge + large input on a subtly
   recessed zone so it reads as "type here" and pops. */
.palette__input { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 3%, transparent); }
.palette__ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: none;
  color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 22%, transparent);
  transition: box-shadow var(--duration) var(--ease); }
.palette__ico svg { width: 16px; height: 16px; }
.palette__input:focus-within .palette__ico { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 45%, transparent), 0 0 0 3px var(--red-tint); }
.palette__input input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; font-weight: 500; color: var(--ink); width: 100%; letter-spacing: -.01em; }
.palette__input input::placeholder { color: var(--muted-2); font-weight: 400; }
.palette__list { max-height: 344px; overflow-y: auto; padding: 8px; }
.palette__group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); padding: 10px 10px 5px; }
.palette__item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: var(--radius); font-size: 13.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: background var(--duration) var(--ease); }
.palette__item svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.palette__item:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.palette__item.is-sel { background: var(--red-tint); color: var(--red); }
.palette__item.is-sel svg { color: var(--red); }
.palette__empty { padding: 26px; text-align: center; color: var(--muted-2); font-size: 13px; }
.palette__hint { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted-2); background: color-mix(in srgb, var(--paper) 60%, transparent); }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .kpi-strip, .kpi-strip--4, .kpi-strip--6 { grid-template-columns: repeat(2, 1fr); }
  .review-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --panel-w: 0px; }
  .rail {
    inset: auto 0 0 0; width: 100%; height: 56px; flex-direction: row; justify-content: space-around;
    border-right: 0; border-top: 1px solid var(--line); padding: 0 8px;
  }
  .rail__logo, .rail__spacer { display: none; }
  .panel {
    inset: 0 auto 0 0; width: 280px; z-index: 75; transform: translateX(-100%); box-shadow: var(--shadow-lg);
  }
  .app.panel-open .panel { transform: none; }
  .main { margin-left: 0 !important; padding-bottom: 64px; }
  .kpi-strip, .kpi-strip--4, .kpi-strip--6, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 4px; }
  .table tbody td { border: 0; padding: 6px 12px; display: flex; justify-content: space-between; gap: 16px; }
  .table tbody td::before { content: attr(data-label); color: var(--muted-2); font-size: 12px; font-weight: 600; }
  .table .col-check { display: none; }
  .touch-grid, .compare { grid-template-columns: 1fr; }
  .compare__col + .compare__col { border-left: 0; border-top: 1px solid var(--line); }
}

/* ============================================================
   POLISH LAYER — 100-tweak perfection pass (light + dark)
   Appended overrides; cascade-safe.
   ============================================================ */

/* --- typography & base --- */
h1, h2, h3, h4 { text-wrap: balance; }
b, strong { font-weight: 650; }
code { font-family: var(--font-mono); font-size: .92em; }
kbd { font-family: var(--font-mono); }
.page__sub { max-width: 70ch; }
a { transition: color var(--duration) var(--ease); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
*:disabled { cursor: not-allowed; }
::-webkit-scrollbar-corner { background: transparent; }

/* --- utilities (replace repeated inline styles) --- */
.ico-inline { display: inline-flex; }
.ico-12 { width: 12px; height: 12px; }
.card__body--compact { padding-top: 8px; padding-bottom: 8px; }
.mono { font-family: var(--font-mono); font-size: .92em; }
.flex-wrap { flex-wrap: wrap; }

/* --- insurance: explicit display on sized spans (bug class that bit twice) --- */
.swatch-chip, .swatches__chip, .health__dot, .step-dots span, .check-dots span,
.badge .dot, .live-pill .dot { display: inline-block; }
.gate-ico, .step__ico, .tl-ico, .empty-state__icon { display: grid; }

/* --- focus refinement: ring follows pill shapes --- */
.btn:focus-visible { border-radius: var(--radius); }
.chip:focus-visible, .badge:focus-visible, .rail__avatar:focus-visible, .pager button:focus-visible { border-radius: var(--radius-pill); }
.linkish:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
.table th.sortable:focus-visible { box-shadow: inset var(--focus-ring); }

/* --- chrome --- */
.rail-btn:active, .panel-toggle:active, .chip:active { transform: scale(.95); }
.rail__logo { box-shadow: var(--shadow-sm); }
.rail-btn .tip::before { content: ""; position: absolute; right: 100%; top: 50%; transform: translateY(-50%); border: 5px solid transparent; border-right-color: var(--ink); }
.nav-item .count { background: var(--paper-2); padding: 0 7px; border-radius: var(--radius-pill); font-size: 11px; line-height: 18px; }
.nav-item[aria-current="true"] .count, .nav-item.is-active .count { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.switcher__list { scrollbar-gutter: stable; }
.panel__head { border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); padding-bottom: 10px; }
.breadcrumb b { font-weight: 650; letter-spacing: -.01em; }
.viewing-as { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-switch__note { opacity: .85; }
[data-theme="dark"] .view-flag--admin { border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }

/* --- controls --- */
.btn svg { flex: none; }
.btn--default:active { background: var(--paper-2); }
.input:hover:not(:focus), .select:hover:not(:focus), .textarea:hover:not(:focus) { border-color: color-mix(in srgb, var(--line-strong) 55%, var(--muted-2)); }
.input:disabled, .select:disabled { background: var(--paper-2); color: var(--muted-2); }
.textarea { min-height: 70px; }
.checkbox input:focus-visible { box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }
.segmented { flex: none; }
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3acc2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
[data-theme="dark"] .toggle__track { background: color-mix(in srgb, #fff 14%, var(--panel)); }
[data-theme="dark"] .toggle input:checked ~ .toggle__track { background: var(--grad-brand); }

/* --- badges / chips / cells --- */
.badge { line-height: 1; letter-spacing: .01em; }
[data-theme="dark"] .badge--outline { border-color: color-mix(in srgb, var(--line-strong) 80%, var(--muted-2)); }
.delta { white-space: nowrap; }
.metric-card { min-height: 116px; }
.metric-card--hero .metric-card__label { font-size: 12.5px; }
.avatar--xl { width: 52px; height: 52px; font-size: 16px; }
.table .ellip { max-width: min(260px, 30vw); }
.count-badge { font-variant-numeric: tabular-nums; }

/* --- overlays --- */
.pagination { flex-wrap: wrap; row-gap: 8px; }
.filter-bar { row-gap: 8px; }
.bulk-bar { max-width: calc(100vw - 32px); flex-wrap: wrap; justify-content: center; }
.toast__title, .toast__msg { word-break: break-word; }
.popover { max-height: 60vh; overflow-y: auto; }
.flash { align-items: flex-start; }
.flash svg { margin-top: 2px; }
.err-code { font-family: var(--font-mono); word-break: break-word; }

/* --- detail / data viz --- */
.tl-note { background: color-mix(in srgb, var(--paper-2) 70%, var(--panel)); }
[data-theme="dark"] .compare__col--after { background: color-mix(in srgb, var(--ok-tint) 80%, transparent); }
[data-theme="dark"] .chart .axis-label { fill: var(--muted); }
[data-theme="dark"] .score__bar, [data-theme="dark"] .bar-mini { background: color-mix(in srgb, #fff 7%, var(--panel)); }
[data-theme="dark"] .table thead th { background: color-mix(in srgb, var(--panel) 45%, var(--paper)); }
[data-theme="dark"] .canvas-dots { background-image: radial-gradient(color-mix(in srgb, var(--line-strong) 80%, transparent) 1px, transparent 1px); }
[data-theme="dark"] .auth-wrap::before { background: color-mix(in srgb, var(--red) 24%, transparent); }
[data-theme="dark"] .auth-wrap::after { background: color-mix(in srgb, var(--info) 14%, transparent); }
[data-theme="dark"] .site-mock__hero { opacity: .8; }
[data-theme="dark"] .skel { background: linear-gradient(100deg, var(--paper-2) 30%, color-mix(in srgb, #fff 8%, var(--paper-2)) 50%, var(--paper-2) 70%); background-size: 200% 100%; }
.funnel-stats > div[title] { cursor: help; }

/* --- responsive additions --- */
@media (max-width: 1100px) {
  .gen-strip__time { width: 100%; margin-left: 34px; }
  .channel-row { grid-template-columns: minmax(100px, 1.2fr) 1fr 56px 44px 50px; gap: 8px; }
}
@media (max-width: 760px) {
  .context-bar { padding: 10px 14px; }
  .demo-switch__note { display: none; }
  .bulk-bar { bottom: 72px; }
  .toast-region { top: 8px; right: 8px; left: 8px; width: auto; }
  .palette-scrim { padding-top: 9vh; }
  .dialog__body { padding-left: 18px; }
  .drawer { width: 100vw; max-width: 100vw; }
  .channel-row--head { display: none; }
  .channel-row { grid-template-columns: 1fr 64px; row-gap: 6px; }
  .channel-row .bar-mini { grid-column: 1 / -1; }
  .funnel-connector { padding-left: 12px; }
}

/* --- accessibility / environment --- */
@media (prefers-contrast: more) {
  :root, [data-theme="dark"] { --line: var(--line-strong); }
  .muted-2, .muted { color: var(--muted); }
}
@media print {
  .rail, .panel, .context-bar__actions, .panel-toggle, .demo-switch, .bulk-bar, .toast-region, .theme-fab { display: none !important; }
  .main { margin-left: 0 !important; }
  body { background: #fff; }
  .card, .table-wrap, .metric-card { box-shadow: none; break-inside: avoid; }
}

/* --- reskin Phase 2: two flagged token-pure additions (shared component library) --- */
/* .btn--block — full-width button; replaces the inline style="width:100%" on login/full-width CTAs.
   Geometric only (width/justify) — no new color tokens, so both themes inherit the base .btn colors.
   Light (base) + dark blocks below reaffirm token-only reuse. */
.btn--block { width: 100%; justify-content: center; }
[data-theme="dark"] .btn--block { width: 100%; justify-content: center; }

/* .input--otp — letter-spaced / centered / large one-time-code input; replaces the per-instance
   inline letter-spacing/text-align/font-size on the TOTP field. Geometry + font metrics only;
   colors/border come from the base .input token rules, so both themes are covered. */
.input--otp { letter-spacing: .4em; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .input--otp { letter-spacing: .4em; text-align: center; font-size: 18px; }

/* ── Channel/product tiles (agency roster "Channels" column) ──
   Fixed set of small letter tiles per client. Outlined by default (channel not active);
   .chan--on fills the tile with the channel's brand colour + white text. Colours are the
   same in both themes (filled swatches read on light and dark); the inactive tile uses
   theme tokens (paper bg / muted text / line border) so it adapts. */
.chan-row { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.chan {
  display: inline-grid; place-items: center;
  min-width: 21px; height: 21px; padding: 0 5px;
  border-radius: var(--radius-xs);
  font: 700 11px/1 var(--font); letter-spacing: .01em;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--muted-2);
}
.chan--on { color: #fff; border-color: transparent; }
.chan--paid.chan--on { background: #3f7fd6; }
.chan--organic.chan--on, .chan--local.chan--on { background: #56b25a; }
.chan--programmatic.chan--on { background: #8b6fd6; }
.chan--web.chan--on { background: #4a63d6; }
.chan--consulting.chan--on { background: #e8912a; }

/* Rectangular "enriched-source" tag — e.g. the PROSPECT HUB ENRICHED chip on the Person card's
   Secondary Contact tab. Squared corners (not a pill) to read as a data-source label. */
.tag-enriched { display: inline-flex; align-items: center; height: 15px; margin-left: 7px;
  padding: 0 5px; border-radius: 3px; white-space: nowrap;
  font-size: 8.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  background: color-mix(in srgb, var(--series-2) 16%, transparent); color: var(--series-2);
  border: 1px solid color-mix(in srgb, var(--series-2) 34%, transparent); }
