/* ============================================================================
   Tools — deck viewer + analytics · design system
   Platform chrome = blue accent, cool near-white, Inter. Data-forward, quiet.
   Creator brand (Atlas Academy) is scoped under .brand-atlas — the viewer wears
   THEIR brand; the platform chrome underneath stays neutral.
   Palettes validated via the dataviz skill (blue sequential + 3-cat + ordinal).
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* --- surfaces & ink (platform, light) --- */
  --plane:        #F6F7F9;
  --surface:      #FFFFFF;
  --surface-2:    #FBFCFD;
  --overlay:      #FFFFFF;

  --ink:          #10131A;
  --ink-2:        #565D6E;
  --ink-3:        #878D9C;
  --ink-inv:      #FFFFFF;

  --line:         #E7E9EE;      /* hairline border */
  --line-2:       #EEF0F4;      /* gridline */
  --line-strong:  #D8DBE3;

  /* --- platform accent (validated blue family) --- */
  --accent:       #2A78D6;
  --accent-press: #1F62B4;
  --accent-ink:   #1C5CAB;      /* accent as text — >=3:1 */
  --accent-wash:  #EDF4FD;
  --accent-wash-2:#DCE9FA;
  --focus:        rgba(42,120,214,.32);

  /* --- status --- */
  --good:         #0CA30C;
  --good-ink:     #06760A;
  --warn:         #E8920B;
  --crit:         #D03B3B;
  --hot:          #E8580C;      /* "hot lead" attention (warm) */
  --hot-wash:     #FDEFE7;

  /* --- sequential blue (single hue, magnitude) --- */
  --seq:          #2A78D6;
  --seq-track:    #E6EEFA;
  /* heatmap buckets: 0 .. 5 (validated ordinal) */
  --h0:           #EEF3F9;
  --h1:           #C8DCF6;
  --h2:           #86B6EF;
  --h3:           #5598E7;
  --h4:           #2A78D6;
  --h5:           #1C5CAB;

  /* --- device categorical (validated, direct-labeled) --- */
  --cat-1:        #2A78D6;      /* desktop  */
  --cat-2:        #EB6834;      /* mobile   */
  --cat-3:        #1BAF7A;      /* tablet   */

  /* --- shape & depth --- */
  --r-xs: 6px; --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --sh-1: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.04);
  --sh-2: 0 2px 4px rgba(16,24,40,.05), 0 6px 16px rgba(16,24,40,.07);
  --sh-3: 0 8px 24px rgba(16,24,40,.10), 0 2px 6px rgba(16,24,40,.06);
  --ring-inset: inset 0 0 0 1px var(--line);

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif:'Fraunces', Georgia, 'Times New Roman', serif;

  --pad: 24px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--plane);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-wash-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sec { color: var(--ink-2); }

/* ============================================================================
   Top app bar (platform)
   ============================================================================ */
.appbar {
  position: sticky; top: 0; z-index: 40;
  height: 56px; display: flex; align-items: center; gap: 14px;
  padding: 0 20px;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brandmark { display: flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.brandmark .glyph {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(145deg, #3a86e0, #1f62b4);
  display: grid; place-items: center; color: #fff; box-shadow: 0 1px 2px rgba(31,98,180,.4), inset 0 1px 0 rgba(255,255,255,.25);
}
.brandmark .glyph svg { width: 15px; height: 15px; }
.appbar .divider { width: 1px; height: 22px; background: var(--line-strong); }
.appbar .crumb { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 450; min-width: 0; }
.appbar .crumb .doc { color: var(--ink); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .spacer { flex: 1; }
.appbar .live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  padding: 5px 10px 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(12,163,12,.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(12,163,12,.45)} 70%{box-shadow:0 0 0 6px rgba(12,163,12,0)} 100%{box-shadow:0 0 0 0 rgba(12,163,12,0)} }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: #fff; background: #64708a; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

/* ============================================================================
   Layout shell
   ============================================================================ */
.page { max-width: var(--maxw); margin: 0 auto; padding: 28px var(--pad) 80px; }
.row { display: grid; gap: 18px; }
.grid-kpi { grid-template-columns: repeat(5, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.mt { margin-top: 18px; }
.mt-l { margin-top: 26px; }

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.section-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.section-head .hint { font-size: 12.5px; color: var(--ink-3); }
.section-head .spacer { flex: 1; }

/* ============================================================================
   Cards
   ============================================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
}
.card-pad { padding: 18px 20px; }

/* --- document header --- */
.dochead { display: grid; grid-template-columns: 200px 1fr; gap: 22px; padding: 20px; }
.dochead .cover {
  aspect-ratio: 16/10; border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--sh-2); border: 1px solid var(--line); position: relative; background: #23180f;
}
.dochead .cover .thumb-scale { position: absolute; inset: 0; }
.dochead .meta h1 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0 4px; }
.dochead .meta .subline { color: var(--ink-2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.dochead .meta .subline .sep { color: var(--line-strong); }
.dochead .actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* share/link row */
.linkbar { display: flex; align-items: center; gap: 0; margin-top: 16px; max-width: 560px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; }
.linkbar .url { flex: 1; padding: 9px 12px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkbar .lock { display: grid; place-items: center; width: 34px; align-self: stretch; color: var(--accent-ink); background: var(--accent-wash); border-right: 1px solid var(--line); }
.linkbar .lock svg { width: 14px; height: 14px; }

/* access chips */
.access { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12.5px; color: var(--ink-2);
}
.chip .ci { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 700; color: #fff; }
.chip.accent { border-color: var(--accent-wash-2); background: var(--accent-wash); color: var(--accent-ink); }

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(31,98,180,.35), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.primary:hover { background: var(--accent-press); border-color: var(--accent-press); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; justify-content: center; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.seg button { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2); padding: 5px 11px; border-radius: 6px; cursor: pointer; transition: .12s; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ============================================================================
   Stat tiles (KPI)
   ============================================================================ */
.tile { padding: 15px 16px 14px; }
.tile .label { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: .01em; }
.tile .valrow { display: flex; align-items: flex-end; gap: 9px; margin-top: 7px; }
.tile .value { font-size: 27px; font-weight: 600; letter-spacing: -.025em; line-height: 1; }
.tile .value .u { font-size: 15px; font-weight: 500; color: var(--ink-2); margin-left: 1px; }
.tile .delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding-bottom: 2px; }
.tile .delta.up { color: var(--good-ink); }
.tile .delta.down { color: var(--crit); }
.tile .delta svg { width: 12px; height: 12px; }
.tile .spark { margin-top: 11px; height: 30px; }

/* ============================================================================
   Charts — generic
   ============================================================================ */
.chart-wrap { position: relative; }
.axis-y-lab, .axis-x-lab { font-size: 10.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.grid-line { stroke: var(--line-2); stroke-width: 1; }
.axis-line { stroke: var(--line-strong); stroke-width: 1; }
.area-line { fill: none; stroke: var(--seq); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.area-fill { fill: url(#areaGrad); }
.dot-end { fill: var(--seq); stroke: var(--surface); stroke-width: 2; }
.legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }

/* tooltip */
.vtip {
  position: fixed; z-index: 80; pointer-events: none; opacity: 0; transform: translateY(2px);
  background: #11151d; color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px;
  box-shadow: var(--sh-3); transition: opacity .1s; max-width: 240px; line-height: 1.4;
}
.vtip .t-h { font-weight: 600; margin-bottom: 3px; }
.vtip .t-r { display: flex; justify-content: space-between; gap: 16px; color: #c9cede; }
.vtip .t-r b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================================
   Per-slide engagement (the signature view)
   ============================================================================ */
.slides-tbl { display: flex; flex-direction: column; }
.slides-head, .slide-row {
  display: grid; grid-template-columns: 32px 104px minmax(150px,1.3fr) minmax(120px,1fr) 88px 62px; gap: 14px; align-items: center;
}
.slides-head { padding: 0 20px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.slides-head .r { text-align: right; }
.slide-row { padding: 10px 20px; border-top: 1px solid var(--line-2); transition: background .12s; }
.slide-row:hover { background: var(--surface-2); }
.slide-row .idx { font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.slide-row .thumb { aspect-ratio: 16/10; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); position: relative; box-shadow: var(--sh-1); background:#23180f; }
.slide-row .thumb .thumb-scale { position: absolute; inset: 0; }
.slide-row .title { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.slide-row .title .tag { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 450; margin-top: 1px; }
.timebar { position: relative; height: 26px; display: flex; align-items: center; gap: 10px; }
.timebar .track { flex: 1; height: 10px; border-radius: 999px; background: var(--seq-track); overflow: hidden; }
.timebar .fill { display: block; height: 100%; min-width: 6px; border-radius: 999px; background: var(--seq); transition: width .5s cubic-bezier(.2,.7,.3,1); }
.timebar .t { font-size: 12.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 44px; }
.slide-row .views { text-align: right; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.slide-row .drop { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.slide-row .drop.bad { color: var(--crit); font-weight: 600; }
.slide-row .drop.ok { color: var(--ink-3); }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.flag.peak { background: var(--accent-wash); color: var(--accent-ink); }
.flag.drop { background: var(--hot-wash); color: var(--hot); }

/* ============================================================================
   Viewers table
   ============================================================================ */
.vtable { width: 100%; }
.vt-head { display: grid; grid-template-columns: 1.6fr 1fr 104px 104px 104px 84px 30px; gap: 12px; padding: 0 20px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.vt-head .r { text-align: right; }
.vt-head button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.vt-head button:hover { color: var(--ink); }
.vt-head button.r { justify-content: flex-end; }
.vt-head .caret { opacity: .5; }
.vrow-wrap { border-top: 1px solid var(--line-2); }
.vrow-wrap.pinned { background: linear-gradient(90deg, var(--hot-wash) 0%, transparent 40%); }
.vrow { display: grid; grid-template-columns: 1.6fr 1fr 104px 104px 104px 84px 30px; gap: 12px; align-items: center; padding: 11px 20px; cursor: pointer; transition: background .12s; }
.vrow:hover { background: var(--surface-2); }
.vrow .who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.vrow .who .av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.vrow .who .nm { min-width: 0; }
.vrow .who .nm b { font-size: 13.5px; font-weight: 550; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow .who .nm span { font-size: 12px; color: var(--ink-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow .fund { font-size: 13px; color: var(--ink-2); }
.vrow .when { font-size: 12.5px; color: var(--ink-2); text-align: left; }
.vrow .num { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.vrow .meter { text-align: right; }
.mini-meter { display: inline-flex; align-items: center; gap: 8px; }
.mini-meter .mt-track { width: 60px; height: 6px; border-radius: 999px; background: var(--seq-track); overflow: hidden; }
.mini-meter .mt-fill { display: block; height: 100%; min-width: 4px; background: var(--seq); border-radius: 999px; }
.mini-meter .mt-n { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 30px; text-align: right; }
.expander { display: grid; place-items: center; color: var(--ink-3); transition: transform .16s; }
.vrow[aria-expanded="true"] .expander { transform: rotate(90deg); color: var(--ink); }

.badge-eng { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 7px 2px 6px; border-radius: 999px; }
.badge-eng.hot { background: var(--hot-wash); color: var(--hot); }
.badge-eng.warm { background: #FEF6E7; color: #A9740A; }
.badge-eng.cold { background: #EEF0F4; color: var(--ink-3); }

/* per-viewer drilldown */
.drill { overflow: hidden; max-height: 0; transition: max-height .3s ease; background: var(--surface-2); border-top: 1px solid transparent; }
.vrow-wrap.open .drill { max-height: 400px; border-top-color: var(--line-2); }
.drill-inner { padding: 16px 20px 18px; }
.drill-inner .dtitle { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.heatstrip { display: flex; gap: 3px; }
.heatstrip .cell { flex: 1; height: 40px; border-radius: 4px; position: relative; cursor: default; transition: transform .1s; }
.heatstrip .cell:hover { transform: scaleY(1.08); }
.heatstrip .cell .n { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.heatscale { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 11px; color: var(--ink-3); }
.heatscale .steps { display: flex; gap: 2px; }
.heatscale .steps i { width: 16px; height: 8px; border-radius: 2px; display: block; }

/* live presence (named, real-time) */
.live-strip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(90deg, #F0FAF3 0%, var(--surface) 55%); box-shadow: var(--sh-1); }
.live-strip .lp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(12,163,12,.5); animation: pulse 2.4s infinite; flex: none; }
.live-strip .stack { display: flex; }
.live-strip .stack .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; box-shadow: 0 0 0 2px var(--surface); margin-left: -8px; }
.live-strip .stack .av:first-child { margin-left: 0; }
.live-strip .txt { font-size: 13.5px; color: var(--ink-2); }
.live-strip .txt b { color: var(--ink); font-weight: 600; }
.live-strip .txt .on { color: var(--accent-ink); font-weight: 600; }
.live-strip .spacer { flex: 1; }
.live-strip .now { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--good-ink); }

/* drop-off callout (data → a fix-this instruction) */
.drop-callout { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: var(--r-md); background: var(--hot-wash); border: 1px solid #F6D4C0; color: #8A3D14; font-size: 13.5px; }
.drop-callout svg { width: 17px; height: 17px; flex: none; color: var(--hot); }
.drop-callout b { font-weight: 700; }

/* engagement score chip */
.score { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; }
.score .n { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.score .track2 { width: 34px; height: 5px; border-radius: 999px; background: var(--seq-track); overflow: hidden; }
.score .track2 i { display: block; height: 100%; border-radius: 999px; }
.score.hot .n { color: var(--hot); } .score.hot .track2 i { background: var(--hot); }
.score.warm .n { color: #A9740A; } .score.warm .track2 i { background: var(--warn); }
.score.cold .n { color: var(--ink-3); } .score.cold .track2 i { background: var(--ink-3); }

/* per-viewer dwell comparison (this viewer vs the deck average — the ghost) */
.dwell { display: flex; align-items: flex-end; gap: 6px; height: 96px; padding-top: 20px; }
.dwell .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.dwell .bars { position: relative; width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.dwell .ghost { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0; width: 82%; background: repeating-linear-gradient(-45deg, #E2E6EC, #E2E6EC 3px, #EDEFF3 3px, #EDEFF3 6px); border-radius: 3px 3px 0 0; }
.dwell .me { position: relative; width: 46%; background: var(--seq); border-radius: 3px 3px 0 0; z-index: 2; transition: height .5s cubic-bezier(.2,.7,.3,1); }
.dwell .me.miss { background: transparent; }
.dwell .col .cn { font-size: 10px; color: var(--ink-3); margin-top: 6px; font-variant-numeric: tabular-nums; }
.dwell .col .peak { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10px; font-weight: 700; color: var(--accent-ink); }
.dwell-legend { display: flex; align-items: center; gap: 16px; margin: 10px 0 2px; font-size: 11.5px; color: var(--ink-2); }
.dwell-legend .k { display: inline-flex; align-items: center; gap: 6px; }
.dwell-legend .sw { width: 12px; height: 10px; border-radius: 2px; }
.dwell-legend .sw.me { background: var(--seq); }
.dwell-legend .sw.gh { background: repeating-linear-gradient(-45deg, #E2E6EC, #E2E6EC 3px, #EDEFF3 3px, #EDEFF3 6px); }

/* the visit path (with re-reads) */
.path { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 14px; }
.path .plab { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-right: 4px; }
.path .step { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.path .step.revisit { background: var(--accent-wash); border-color: var(--accent-wash-2); color: var(--accent-ink); }
.path .arr { color: var(--ink-3); font-size: 11px; }
.path .revtag { margin-left: 6px; font-size: 11px; color: var(--accent-ink); font-weight: 600; }

/* device split */
.donut-wrap { display: flex; align-items: center; gap: 18px; }
.donut { flex: none; }
.dev-list { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.dev-list .dv { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.dev-list .dv .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dev-list .dv .nm { color: var(--ink-2); flex: 1; }
.dev-list .dv .n { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================================
   State A — first-run (deployed, waiting for the first viewer)
   ============================================================================ */
.fr-hero { padding: 30px 32px; margin-bottom: 18px; position: relative; overflow: hidden; }
.fr-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(42,120,214,.08), transparent 70%); }
.fr-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--good-ink); background: #EAF7EE; border: 1px solid #CBEBD5; padding: 5px 11px; border-radius: 999px; }
.fr-badge .d { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.fr-hero h1 { font-size: 28px; font-weight: 600; letter-spacing: -.025em; margin: 16px 0 6px; }
.fr-hero > p { color: var(--ink-2); font-size: 15px; margin: 0 0 18px; max-width: 560px; }
.linkbar.big { max-width: 620px; }
.linkbar.big .url { padding: 13px 14px; font-size: 13.5px; }
.fr-links { margin-top: 22px; }
.frl-label { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.frl { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); margin-bottom: 8px; max-width: 620px; }
.frl .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600; flex: none; }
.frl .who { flex: 1; min-width: 0; }
.frl .who b { font-size: 13.5px; font-weight: 550; }
.frl .who span { font-size: 12px; color: var(--ink-3); margin-left: 6px; }
.fr-note { margin-top: 20px; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); background: var(--accent-wash); border: 1px solid var(--accent-wash-2); padding: 9px 13px; border-radius: var(--r-sm); }
.tile.ghosted .value { color: var(--line-strong); }
.tile.ghosted .spark { opacity: .25; }
.empty-visitors { padding: 0; overflow: hidden; }
.empty-visitors .ghost-row { display: grid; grid-template-columns: 1.6fr 1fr 104px 104px; gap: 12px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--line-2); opacity: calc(.5 - var(--i, 0) * .12); }
.empty-visitors .ghost-row:first-child { border-top: 0; }
.empty-visitors .ghost-row .gav { width: 32px; height: 32px; border-radius: 50%; background: var(--line-2); }
.empty-visitors .ghost-row .gb { height: 9px; border-radius: 5px; background: var(--line-2); }
.empty-visitors .gwho { display: flex; align-items: center; gap: 11px; }
.empty-visitors .gwho .gcol { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.empty-visitors .empty-msg { text-align: center; padding: 30px 20px 34px; }
.empty-visitors .empty-msg .em-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-wash); display: grid; place-items: center; margin: 0 auto 12px; color: var(--accent-ink); }
.empty-visitors .empty-msg h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.empty-visitors .empty-msg p { color: var(--ink-3); font-size: 13.5px; margin: 0; }

/* skeleton loading (State B) */
@keyframes shimmer { 0% { background-position: -420px 0; } 100% { background-position: 420px 0; } }
.sk { background: linear-gradient(90deg, #EEF0F4 8%, #F6F7F9 22%, #EEF0F4 36%); background-size: 800px 100%; animation: shimmer 1.3s infinite linear; border-radius: 6px; }
.sk-tile { height: 108px; }
.sk-row { display: grid; grid-template-columns: 1.6fr 1fr 104px 104px 30px; gap: 12px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--line-2); }
.sk-row:first-child { border-top: 0; }
.sk-who { display: flex; align-items: center; gap: 11px; }
.sk-av { width: 32px; height: 32px; border-radius: 50%; flex: none; }

/* preview-states switcher (demo aid) */
.state-switch { position: fixed; bottom: 20px; right: 20px; z-index: 60; display: inline-flex; gap: 3px; padding: 4px; background: rgba(17,21,29,.92); backdrop-filter: blur(10px); border-radius: 999px; box-shadow: var(--sh-3); }
.state-switch a { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: #aeb6c4; padding: 6px 13px; border-radius: 999px; text-decoration: none; transition: .14s; }
.state-switch a:hover { color: #fff; }
.state-switch a.on { background: #fff; color: #11151d; font-weight: 600; }
.state-switch .lbl { color: #6b7484; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 6px 6px 6px 12px; }

/* quick top-viewers */
.qv { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.qv:first-of-type { border-top: 0; }
.qv .av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600; flex: none; }
.qv .nm { flex: 1; min-width: 0; }
.qv .nm b { font-size: 13px; font-weight: 550; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qv .nm span { font-size: 11.5px; color: var(--ink-3); }
.qv .t { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* footer */
.foot { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.foot .spacer { flex: 1; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 12px); z-index: 90; background: #11151d; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--sh-3); opacity: 0; pointer-events: none; transition: .18s; display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 15px; height: 15px; color: #6ee7a8; }

@media (max-width: 1000px) {
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1 { grid-template-columns: 1fr; }
  .dochead { grid-template-columns: 1fr; }
  .dochead .cover { max-width: 260px; }
}
@media (max-width: 680px) {
  .grid-kpi { grid-template-columns: 1fr 1fr; }
  .slides-head { display: none; }
  .slide-row { grid-template-columns: 24px 58px 1fr 46px 38px; gap: 9px; }
  .slide-row .timebar { display: none; }
  .flag { display: none; }
  .vt-head, .vrow { grid-template-columns: 1.5fr 84px 70px 26px; }
  .vrow .fund, .vt-head .fund, .vrow .when, .vt-head .when,
  .vrow .meter, .vt-head [data-sort="slides"] { display: none; }
  .dwell { height: 78px; }
}
