/* 316love dashboard
   Chrome: warm neutral planes, rose "love" accent for actions and the live pulse.
   Data: the validated categorical palette (slots 1-5), a 5-step ordinal blue ramp, fixed status colors. */

:root {
  color-scheme: light;
  --page: #f4f3ef;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --surface-3: #e9e8e2;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #6b6964;      /* muted text (>= 4.5:1 on surface) */
  --axis: #898781;       /* axis labels only */
  --grid: #e1e0d9;
  --line: #e1e0d9;
  --line-2: #c3c2b7;
  --ring: rgba(11, 11, 11, .10);
  --love: #c2185b;
  --love-2: #a31350;
  --love-wash: #fbe9f0;
  --on-love: #ffffff;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --ord-1: #86b6ef; --ord-2: #5598e7; --ord-3: #2a78d6; --ord-4: #1c5cab; --ord-5: #0d366b;
  --on-s4: #0b0b0b;
  --good: #0ca30c; --good-ink: #006300; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b; --bad-ink: #b42323;
  --shadow: 0 1px 2px rgba(11, 11, 11, .05), 0 8px 24px -16px rgba(11, 11, 11, .18);
  --radius: 14px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2c2c2a;
  --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #a3a29a; --axis: #898781; --grid: #2c2c2a; --line: #2c2c2a; --line-2: #383835;
  --ring: rgba(255, 255, 255, .10);
  --love: #f06c9b; --love-2: #f48fb1; --love-wash: #3a1726; --on-love: #1a0710;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --ord-1: #184f95; --ord-2: #256abf; --ord-3: #3987e5; --ord-4: #6da7ec; --ord-5: #9ec5f4;
  --good-ink: #0ca30c; --bad-ink: #ef8080; --on-s4: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -16px rgba(0, 0, 0, .6);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2c2c2a;
    --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #a3a29a; --axis: #898781; --grid: #2c2c2a; --line: #2c2c2a; --line-2: #383835;
    --ring: rgba(255, 255, 255, .10);
    --love: #f06c9b; --love-2: #f48fb1; --love-wash: #3a1726; --on-love: #1a0710;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --ord-1: #184f95; --ord-2: #256abf; --ord-3: #3987e5; --ord-4: #6da7ec; --ord-5: #9ec5f4;
    --good-ink: #0ca30c; --bad-ink: #ef8080; --on-s4: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -16px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--love); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: .9em; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 14px; border-right: 1px solid var(--line); background: var(--page); }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
.logo__mark { width: 30px; height: 30px; border-radius: 9px; background: var(--love); color: var(--on-love); display: grid; place-items: center; }
.logo__mark svg { width: 20px; height: 20px; }
.logo__word { font-weight: 650; font-size: 18px; letter-spacing: -.02em; }
.logo__word b { font-family: var(--mono); font-weight: 600; letter-spacing: -.04em; margin-right: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--love), var(--shadow); }
.nav__count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--love); color: var(--on-love); font-size: 12px; font-weight: 600; text-align: center; }
.nav__sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side__foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); display: grid; gap: 8px; }
.side__user { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side__user strong { color: var(--ink); font-weight: 600; display: block; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top__title { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin: 0 8px 0 0; }
.top__spacer { flex: 1; }
.content { padding: 24px 28px 64px; max-width: 1440px; width: 100%; transition: opacity .15s; }
.content.is-loading { opacity: .55; pointer-events: none; }
.demo-banner { margin: 0 0 18px; padding: 10px 14px; border-radius: 10px; background: var(--love-wash); color: var(--ink); font-size: 13px; }

/* Pulse — the live heartbeat */
.pulse { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 10px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--ink); }
.pulse__count { font-weight: 650; }
.pulse__label { color: var(--ink-3); font-size: 13px; }
.pulse__svg { color: var(--love); }
.pulse__dot { fill: var(--love); transform-box: fill-box; transform-origin: center; animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); opacity: 1; } 15% { transform: scale(1.6); opacity: .7; } 30% { transform: scale(1); } }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--love); color: var(--on-love); box-shadow: none; }
.btn--primary:hover { background: var(--love-2); }
.btn--ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn--danger { color: var(--bad-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.select { position: relative; }
.select select, .input, .textarea { width: 100%; min-height: 36px; padding: 7px 12px; border: 0; border-radius: 9px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.select select { appearance: none; padding-right: 30px; cursor: pointer; font-weight: 550; }
.select::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; border: solid var(--ink-3); border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.input:focus, .textarea:focus, .select select:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--love); }
.textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--love); }

.seg-ctl { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); gap: 2px; }
.seg-ctl button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--ink-2); cursor: pointer; }
.seg-ctl button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Date range popover */
.range { position: relative; }
.range__menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 250px; padding: 6px; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 18px 40px -12px rgba(0, 0, 0, .3); }
.range__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.range__item:hover { background: var(--surface-2); }
.range__check { width: 16px; font-weight: 800; color: var(--love); }
.range__custom { display: grid; gap: 8px; margin-top: 6px; padding: 10px 8px 4px; border-top: 1px solid var(--line); }
.range__custom .form-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }

/* ---------- Cards & grid ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid > .hero, .grid > .tiles { align-self: stretch; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1180px) { .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; } }
.card { min-width: 0; background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--ring), var(--shadow); padding: 18px 20px; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.card__sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.card__actions { display: flex; gap: 6px; align-items: center; }
.card--flush { padding: 0; }
.card--flush .card__head { padding: 18px 20px 0; }

/* Hero figure + stat tiles */
.hero { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.hero__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hero__value { font-size: 64px; font-weight: 650; line-height: 1; letter-spacing: -.045em; margin-top: 8px; }
.hero__sub { color: var(--ink-2); font-size: 14px; display: grid; gap: 4px; }
.hero__sub strong { color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 16px; }
.tile { display: grid; gap: 4px; align-content: start; }
.tile__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tile__value { font-size: 28px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; }
.tile__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; flex-wrap: wrap; }
.tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .tiles--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.delta--good { color: var(--good-ink); }
.delta--bad { color: var(--bad-ink); }
.delta--flat { color: var(--ink-3); }
.delta small { font-weight: 500; color: var(--ink-3); margin-left: 2px; }

/* ---------- Charts ---------- */
.viz { position: relative; }
.viz-box { position: relative; }
.viz svg { display: block; overflow: visible; }
.viz-grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.viz-tick { fill: var(--axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-cross { stroke: var(--line-2); stroke-width: 1; }
.viz-ring { stroke: var(--surface); stroke-width: 2; }
.viz-hit { outline: none; }
.viz-hit:focus-visible { outline: none; fill: var(--ring); }
.viz-empty { padding: 28px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.viz-tip { position: absolute; z-index: 10; min-width: 150px; padding: 8px 10px; border-radius: 10px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 12px 28px -10px rgba(0, 0, 0, .35); pointer-events: none; font-size: 12.5px; }
.viz-tip__title { font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.viz-tip__row { display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 8px; }
.viz-tip__key.line { width: 12px; height: 2px; border-radius: 2px; background: var(--c); }
.viz-tip__key.rect { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.viz-tip__value { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.viz-tip__label { color: var(--ink-2); }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: 12.5px; color: var(--ink-2); }
.viz-legend__item { display: inline-flex; align-items: center; gap: 7px; }
.viz-legend__key.line { width: 14px; height: 2px; border-radius: 2px; background: var(--c); }
.viz-legend__key.rect { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

.barlist { display: grid; gap: 10px; }
.barlist__row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 4px 12px; font-size: 13px; outline: none; border-radius: 6px; }
.barlist__row:focus-visible { box-shadow: 0 0 0 2px var(--love); }
.barlist__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.barlist__track { height: 8px; border-radius: 4px; background: transparent; }
.barlist__bar { height: 8px; border-radius: 0 4px 4px 0; }
.barlist__value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; min-width: 36px; }
.barlist__note { grid-column: 2 / -1; margin-top: -4px; font-size: 12px; color: var(--ink-3); }

.funnel { display: grid; gap: 12px; }
.funnel__row { display: grid; gap: 5px; outline: none; border-radius: 6px; }
.funnel__row:focus-visible { box-shadow: 0 0 0 2px var(--love); }
.funnel__head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.funnel__label { color: var(--ink-2); font-weight: 550; }
.funnel__value { font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel__track { height: 12px; }
.funnel__bar { height: 12px; border-radius: 0 4px 4px 0; }
.funnel__rate { font-size: 12px; color: var(--ink-3); }

.seg { display: flex; gap: 2px; height: 28px; }
.seg__part { min-width: 3px; border-radius: 4px; display: flex; align-items: center; padding: 0 8px; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: visible; outline: none; }
.seg__part:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--love); }
.seg + .viz-legend, .viz-box + .viz-legend { margin: 12px 0 0; }

.spark { display: block; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -18px; }
.card--flush .table-wrap { margin: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th, .t td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { position: sticky; top: 0; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.t th:first-child, .t td:first-child { padding-left: 20px; }
.t th:last-child, .t td:last-child { padding-right: 20px; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr.clickable { cursor: pointer; }
.t tbody tr.clickable:hover td { background: var(--surface-2); }
.t th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.t th button:hover { color: var(--ink); }
.t .cell-bar { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.t .cell-bar__bar { height: 6px; border-radius: 0 3px 3px 0; background: var(--s1); }
.t .strong { font-weight: 600; }
.t .sub { display: block; font-size: 12px; color: var(--ink-3); }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* Chips & status */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip--love { background: var(--love-wash); color: var(--love-2); }
.chip--good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--axis)); }
.status--new { --c: var(--s1); }
.status--contacted { --c: var(--s4); }
.status--booked { --c: var(--good); }
.status--showed { --c: var(--s6); }
.status--lost { --c: var(--axis); }
.status--spam { --c: var(--critical); }
.status--answered { --c: var(--good); }
.status--missed { --c: var(--critical); }
.status--ringing { --c: var(--s4); }
.kind { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 12.5px; }
.kind svg { width: 14px; height: 14px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button, .tabs a { border: 0; background: none; padding: 10px 12px; margin-bottom: -1px; font-weight: 550; color: var(--ink-2); border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--ink); border-bottom-color: var(--love); }
.tabs .count { margin-left: 6px; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Drawer & modal */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(10, 8, 12, .38); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; inset: 0 0 0 auto; z-index: 61; width: min(620px, 100%); display: flex; flex-direction: column; background: var(--page); box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .4); animation: slidein .2s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer__head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.drawer__body { flex: 1; overflow-y: auto; padding: 20px 24px 40px; display: grid; gap: 16px; align-content: start; }
.modal { position: fixed; z-index: 61; left: 50%; top: 8vh; translate: -50% 0; width: min(560px, calc(100% - 32px)); max-height: 84vh; overflow-y: auto; border-radius: 16px; background: var(--surface); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: fade .15s; }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.modal__head h2 { margin: 0; font-size: 18px; }
.modal__body { padding: 16px 22px 22px; display: grid; gap: 14px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }

.pipeline { display: flex; flex-wrap: wrap; gap: 6px; }
.pipeline button { border: 0; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pipeline button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pipeline button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.dl { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 8px 14px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 7px 0 7px 0; font-size: 13px; }
.timeline time { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.timeline .ev { display: flex; gap: 8px; align-items: baseline; }
.timeline .ev b { font-weight: 600; }
.timeline .sess { grid-column: 1 / -1; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-3); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed__icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.feed__icon svg { width: 15px; height: 15px; }
.feed__icon.is-goal { background: var(--love-wash); color: var(--love-2); }
.feed time { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.big-live { font-size: 72px; font-weight: 650; letter-spacing: -.05em; line-height: 1; }

.code { position: relative; margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; }
.code + .btn { margin-top: 8px; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.prose p { margin: 0 0 10px; }
.prose h3 { margin: 18px 0 8px; font-size: 15px; }
.callout { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.callout strong { color: var(--ink); }

.toast { position: fixed; z-index: 90; left: 50%; bottom: 24px; translate: -50% 0; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--surface); font-weight: 550; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); animation: fade .15s; }
.toast--error { background: var(--critical); color: #fff; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth__card { width: min(400px, 100%); padding: 32px 30px; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--ring), var(--shadow); display: grid; gap: 16px; }
.auth__card h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.auth__card p { margin: 0; color: var(--ink-2); }
.auth__error { padding: 10px 12px; border-radius: 9px; background: color-mix(in srgb, var(--critical) 12%, transparent); color: var(--bad-ink); font-size: 13px; font-weight: 550; }

/* ---------- Agency: client switcher, health, all clients, setup ---------- */
:root { --warn-ink: #8a5a00; --warn-wash: #fdf0d2; }
:root[data-theme="dark"] { --warn-ink: #fab219; --warn-wash: #3a2c0c; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) { --warn-ink: #fab219; --warn-wash: #3a2c0c; } }

.hdot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent); }
.hdot--stale { background: var(--critical); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 18%, transparent); }
.hdot--none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--axis); }

.switcher { display: flex; align-items: center; gap: 10px; width: 100%; margin: 4px 0 8px; padding: 9px 10px 9px 12px; border: 0; border-radius: 11px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow); text-align: left; cursor: pointer; }
.switcher:hover { box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
.switcher > svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); margin-left: auto; }
.switcher__text { display: grid; min-width: 0; line-height: 1.3; }
.switcher__text strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher__text span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher__menu { position: fixed; z-index: 70; display: grid; gap: 2px; padding: 6px; border-radius: 13px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 22px 50px -14px rgba(0, 0, 0, .35); animation: fade .12s; }
.switcher__menu .input--search { margin: 2px 2px 6px; width: auto; }
.switcher__list { display: grid; gap: 2px; max-height: min(52vh, 420px); overflow-y: auto; }
.switcher__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; }
.switcher__item:hover, .switcher__item:focus-visible { background: var(--surface-2); }
.switcher__item[aria-current="true"] { background: var(--love-wash); }
.switcher__item > svg { width: 16px; height: 16px; flex: none; }
.switcher__item > svg:last-child:not(:first-child) { margin-left: auto; color: var(--love); }
.switcher__all { border-bottom: 1px solid var(--line); border-radius: 9px 9px 0 0; margin-bottom: 4px; padding-bottom: 10px; }
.switcher__add { border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; margin-top: 4px; padding-top: 10px; color: var(--ink-2); font-weight: 550; }
.switcher__empty { padding: 12px 10px; color: var(--ink-3); font-size: 13px; }
.nav__client { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; padding: 8px 10px; font-weight: 600; }
.nav__progress { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--love-wash); color: var(--love-2); font-size: 12px; font-weight: 650; }

.input--search { padding-left: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 16px; background-position: 11px 50%; }
.card__actions .input--search { width: 220px; min-height: 30px; padding-top: 4px; padding-bottom: 4px; }

.tiles--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) { .tiles--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tiles--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.alerts { list-style: none; margin: 0; padding: 0; }
.alert { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.alert:first-child { border-top: 0; padding-top: 0; }
.alert__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); }
.alert__icon svg { width: 17px; height: 17px; }
.alert--critical .alert__icon { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--bad-ink); }
.alert--warning .alert__icon { background: var(--warn-wash); color: var(--warn-ink); }
.alert__text { min-width: 0; font-size: 13.5px; color: var(--ink-2); }
.alert__text strong { color: var(--ink); font-weight: 600; margin-right: 6px; }
.alerts__more { padding-top: 8px; border-top: 1px solid var(--line); }
.allclear { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--good) 10%, var(--surface)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--good) 25%, transparent); font-size: 13.5px; color: var(--ink-2); }
.allclear svg { width: 18px; height: 18px; flex: none; color: var(--good-ink); }
.allclear strong { color: var(--ink); }

.client-cell { display: flex; align-items: flex-start; gap: 10px; min-width: 220px; }
.client-cell .hdot { margin-top: 6px; }
.client-cell .chip { margin-top: 5px; text-decoration: none; }
.num-stack { display: inline-grid; justify-items: end; gap: 1px; }
.num-stack .delta { font-size: 11.5px; }
.num-stack .delta small { display: none; }
.live-n { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.live-n__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--love); animation: beat 1.6s ease-in-out infinite; }
.chip--warn { background: var(--warn-wash); color: var(--warn-ink); text-decoration: none; }
.check-list { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; padding: 2px; }

.empty--big { display: grid; justify-items: center; gap: 6px; padding: 56px 24px; }
.empty--big p { margin: 0 0 10px; max-width: 46ch; }
.empty__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--love-wash); color: var(--love-2); margin-bottom: 6px; }
.empty__icon svg { width: 24px; height: 24px; }

.setup-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setup-banner svg { width: 18px; height: 18px; color: var(--love-2); flex: none; }
.setup-banner .btn { margin-left: auto; }

.setup { display: grid; gap: 14px; max-width: 880px; }
.setup-head__in { display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; align-items: center; }
.setup-head__title { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.setup-head__in p { margin: 0; }
.setup-head__in > .btn { grid-column: 1 / -1; justify-self: start; }
.progress { display: grid; gap: 6px; min-width: 200px; font-size: 13px; color: var(--ink-3); }
.progress__label strong { color: var(--ink); }
.progress__track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 999px; background: var(--love); transition: width .4s ease; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.step__mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line-2); font-weight: 650; font-size: 13px; color: var(--ink-2); }
.step.is-done .step__mark { background: var(--good-ink); box-shadow: none; color: #fff; }
.step__mark svg { width: 16px; height: 16px; }
.step__body { min-width: 0; display: grid; gap: 8px; }
.step__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step__head h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.step__text { margin: 0; color: var(--ink-2); }
.step.is-done .step__text { display: none; }
.step__status { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--ink-3); }
.step__status svg { width: 16px; height: 16px; flex: none; }
.step__status.is-ok { color: var(--good-ink); }
.step__status.is-waiting { color: var(--ink-2); }
.wait-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--axis); }
.step__status.is-waiting .wait-dot { background: var(--love); animation: beat 1.6s ease-in-out infinite; }
.step__details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); width: fit-content; }
.step__details summary:hover { color: var(--ink); }
.step__content { display: grid; gap: 10px; margin-top: 10px; justify-items: start; }
.step__content > * { max-width: 100%; }
.step__how { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.step__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.codebox { display: grid; gap: 8px; justify-items: start; width: 100%; }
.codebox .code { width: 100%; }
.codebox .code + .btn { margin-top: 0; }
.seg-ctl--wrap { flex-wrap: wrap; }

/* Responsive shell */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo { padding: 0 8px 0 0; }
  .logo__word { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 7px 9px; white-space: nowrap; }
  .nav a span { display: none; }
  .nav a[aria-current="page"] span { display: inline; }
  .nav__sep, .side__foot { display: none; }
  .nav { align-items: center; }
  .switcher { flex: none; width: auto; max-width: 190px; margin: 0 6px; padding: 6px 10px; }
  .switcher__text span { display: none; }
  .nav__client { margin: 0 6px; white-space: nowrap; }
  .nav__progress { display: none; }
  .card__actions .input--search { width: 150px; }
  .setup-head__in { grid-template-columns: 1fr; }
  .alert { grid-template-columns: 30px 1fr; }
  .alert > .btn { grid-column: 2; justify-self: start; }
  .top { padding: 10px 16px; flex-wrap: wrap; }
  .content { padding: 18px 16px 48px; }
  .hero__value { font-size: 52px; }
  .pulse__label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .barlist__bar, .funnel__bar, .seg__part { forced-color-adjust: none; border: 1px solid CanvasText; }
}
