/* ══════════════════════════════════════════════════════════════════ */
/*  Honestly design system — hi-fi, aligned with dashboard/style-ref   */
/* ══════════════════════════════════════════════════════════════════ */

:root {
  --accent:        #4454E1;
  --accent-hover:  #3a48c9;
  --accent-subtle: rgba(68,84,225,0.08);
  --accent-border: rgba(68,84,225,0.20);

  --neutral-75:   #e8eaf4;
  --neutral-100:  #dfe1eb;
  --neutral-200:  #bbbdc9;
  --neutral-300:  #979aa7;
  --neutral-400:  #747684;
  --neutral-500:  #505262;
  --neutral-600:  #2c2f3f;
  --neutral-650:  #1a1d2e;

  --page-bg:       var(--neutral-75);
  --surface-bg:    var(--neutral-100);
  --surface-raised:var(--neutral-200);

  --text-primary:   var(--neutral-650);
  --text-secondary: var(--neutral-400);
  --text-tertiary:  var(--neutral-300);
  --text-muted:     var(--neutral-200);

  --border-default: var(--neutral-200);
  --border-subtle:  var(--neutral-100);
  --border-accent:  rgba(68,84,225,0.20);

  --positive: #1DA86D;
  --warning:  #FFBD44;
  --negative: #FF605C;

  --yt:        #FF0000;
  --tiktok:    #AAE0F0;
  --tiktok-text:#1a6b7a;
  --reddit:    #FF8C00;
  --instagram: #C13584;

  --shadow-focus: 0 0 0 3px rgba(68,84,225,0.25);

  --radius:      4px;
  --radius-md:   8px;
  --radius-lg:  12px;
  --radius-full:9999px;

  --s1:  8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 40px;
  --s6: 48px;
  --s8: 64px;

  --text-xs:11px; --text-sm:12px; --text-base:14px; --text-md:16px;
  --text-lg:18px; --text-xl:20px; --text-2xl:24px; --text-3xl:32px;

  --wire:        rgba(68,84,225,0.40);
  --wire-soft:   rgba(68,84,225,0.14);
  --wire-ghost:  rgba(116,118,132,0.18);

  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 350ms ease;
}

html.dark {
  --accent:#5b6bf0; --accent-hover:#4d5de8;
  --accent-subtle:rgba(91,107,240,0.15); --accent-border:rgba(91,107,240,0.25);
  --page-bg:var(--neutral-650); --surface-bg:var(--neutral-600); --surface-raised:var(--neutral-500);
  --text-primary:var(--neutral-75); --text-secondary:var(--neutral-200);
  --text-tertiary:var(--neutral-300); --text-muted:var(--neutral-400);
  --border-default:rgba(255,255,255,0.10); --border-subtle:rgba(255,255,255,0.05);
  --shadow-focus: 0 0 0 3px rgba(91,107,240,0.30);
  --wire: rgba(91,107,240,0.55);
  --wire-soft: rgba(91,107,240,0.20);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.43;
  color: var(--text-primary);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Host Grotesk', 'DM Sans', sans-serif;
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  line-height: 1.25;
}

button, input, textarea { font-family: inherit; font-size: inherit; }

/* ══════════════════════════════════════ */
/*              SHELL LAYOUT              */
/* ══════════════════════════════════════ */

.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 48px 1fr;
  height: 100vh;
}

/* ── Top bar ── */

.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex; align-items: center;
  background: var(--surface-bg);
  border-bottom: 1px solid var(--border-default);
  z-index: 20;
}
.topbar-brand {
  width: 220px;
  padding: 0;
  display: flex; align-items: center; justify-content: space-between;
  border-right: 1px solid var(--border-default);
  height: 100%;
  overflow: hidden;
}
.topbar-brand-inner {
  display: flex; align-items: center; gap: 10px;
  height: 100%;
}
.topbar-brand-logo {
  display: block;
  height: 100%;
  flex-shrink: 0;
  border-right: 1px solid var(--border-default);
}
.topbar-brand-mark {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}
.topbar-brand-name {
  font-size: 13px; font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.topbar-brand-collapse {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--text-tertiary);
  cursor: pointer;
  border: none; background: transparent;
  transition: color var(--transition-fast), background var(--transition-fast);
  margin-right: 8px;
  flex-shrink: 0;
}
.topbar-brand-collapse:hover { color: var(--text-primary); background: var(--page-bg); }
.topbar-brand-collapse svg { width: 16px; height: 16px; stroke-width: 1.4; }

.topbar-right {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--s3) 0 var(--s3);
  height: 100%;
}
.topbar-page {
  display: flex; align-items: center; gap: var(--s2);
  color: var(--text-primary);
  font-size: 13px; font-weight: 500;
}
.topbar-page .crumb {
  color: var(--text-tertiary);
}
.topbar-page .crumb-sep {
  color: var(--text-muted);
  font-weight: 400;
}
.topbar-page .crumb-active {
  color: var(--text-primary);
}
.topbar-page-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-primary);
}
.topbar-page-title svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.3;
  color: var(--accent, #4454E1);
}
.topbar-page-title .topbar-breadcrumb-sep {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  margin: 0 8px;
  opacity: 0.4;
}
.topbar-page-title .topbar-breadcrumb-product {
  color: var(--text-primary);
  font-weight: 400;
}
.topbar-page-title .topbar-breadcrumb-leaf {
  color: var(--text-primary);
  font-weight: 500;
}
.topbar-tools {
  display: flex; align-items: center; gap: var(--s2);
  margin-left: auto;
  height: 100%;
}
.topbar-tools:empty { margin: 0; }
.topbar-tool {
  height: 32px;
  padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  background: var(--page-bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.topbar-tool:hover { color: var(--text-primary); border-color: var(--text-muted); }
.topbar-tool svg { width: 14px; height: 14px; stroke-width: 1.4; }
.topbar-tool-kicker { color: var(--text-tertiary); font-weight: 400; }

/* Borderless topbar action — plain icon + text, mirrors the Olive Young
   demo's Export affordance. Sits inside .topbar-tools and ends with the
   .topbar-honestly border-left acting as the divider. */
.topbar-action {
  height: 100%;
  padding: 0 18px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--transition-fast);
}
.topbar-action:hover { color: var(--accent); }
.topbar-action svg { width: 15px; height: 15px; stroke-width: 1.5; }

/* Topbar Save — primary action, only shown when there are pending changes.
   Sits to the left of any topbar-action(s) which sit to the left of the
   Honestly logo. Animated in/out via opacity-only transitions so the layout
   doesn't shift when the button appears. */
.topbar-save {
  height: 30px;
  padding: 0 14px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  align-self: center;
  margin-right: 12px;
  transition: background var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
  animation: topbar-save-fade-in 180ms ease-out;
}
.topbar-save:hover { background: var(--accent-hover, #3849d2); border-color: var(--accent-hover, #3849d2); }
.topbar-save svg { width: 14px; height: 14px; stroke-width: 1.6; }
.topbar-save.is-blocked { opacity: 0.55; cursor: not-allowed; }
.topbar-save[disabled]:not(.is-blocked) { opacity: 0.85; cursor: progress; }

@keyframes topbar-save-fade-in {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Scan-line loader — single dashboard-wide loading icon.
   lib/scan-loader.js auto-injects the inline SVG into any element
   with .scan-loader (or one of the legacy spinner aliases below).
   The animation rules live here once — not duplicated per SVG.
   Color follows currentColor: white on dark surfaces, dark on light.
   ============================================================ */
.scan-loader,
.cp-spinner,
.ci-spinner,
.btn-spinner,
.tree-item-spinner,
.topbar-save-spinner {
  --scan-size: 18px;
  display: inline-block;
  width: var(--scan-size);
  height: var(--scan-size);
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 0;
  color: currentColor;
}
.scan-loader-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.scan-loader-svg .bg { fill: currentColor; opacity: 0.07; }
.scan-loader-svg .fg {
  fill: currentColor;
  opacity: 0;
  animation: scan-line-pulse 2000ms linear infinite both;
}
.scan-loader-svg .r0 { animation-delay: 0ms; }
.scan-loader-svg .r1 { animation-delay: 333ms; }
.scan-loader-svg .r2 { animation-delay: 667ms; }
.scan-loader-svg .r3 { animation-delay: 1000ms; }
.scan-loader-svg .r4 { animation-delay: 1333ms; }
@keyframes scan-line-pulse {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  36%  { opacity: 0.05; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .scan-loader-svg .fg { animation: none; opacity: 0.45; }
}

/* Size variants */
.scan-loader--sm { --scan-size: 14px; }
.scan-loader--md { --scan-size: 24px; }
.scan-loader--lg { --scan-size: 56px; }

/* Legacy spinner aliases — preserve their original sizes / positioning. */
.tree-item-spinner   { --scan-size: 14px; }
.ci-spinner          { --scan-size: 14px; margin-right: 6px; vertical-align: -2px; }
.cp-spinner          { --scan-size: 18px; }
.btn-spinner         { --scan-size: 14px; }
.topbar-save-spinner { --scan-size: 14px; }

/* Range segmented control (7d 30d 90d 6m 1y) */
.range-chips {
  display: inline-flex;
  padding: 3px;
  background: var(--neutral-75);
  border: none;
  border-radius: var(--radius-full);
  gap: 2px;
}
.range-chips button {
  height: 24px;
  padding: 0 12px;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  font-family: inherit;
}
.range-chips button:hover { color: var(--text-primary); }
.range-chips button.active {
  background: rgba(187, 189, 201, 0.6);
  color: var(--text-primary);
}
html.dark .range-chips { background: var(--neutral-500); }
html.dark .range-chips button.active { background: var(--neutral-650); }

/* Entity pill — inline with breadcrumb, Analyze-only */
.entity-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 12px;
  font-family: inherit;
  transition: background var(--transition-fast);
}
.entity-pill:hover { background: rgba(68,84,225,0.12); }
.entity-pill-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.entity-pill-sep {
  color: var(--border-default);
  font-weight: 400;
}
.entity-pill-value { color: var(--accent); }
.entity-pill svg { width: 12px; height: 12px; stroke-width: 1.5; color: var(--accent); }
.topbar-honestly {
  width: 48px; height: 100%;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-left: 1px solid var(--border-default);
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}
.topbar-honestly img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
}

/* ── Sidebar (expanded 220px) ── */

.sidebar {
  grid-column: 1;
  grid-row: 2;
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  background: var(--surface-bg);
  border-right: 1px solid var(--border-default);
  display: flex; flex-direction: column;
  padding: var(--s2) var(--s1) var(--s1);
  overflow: hidden;
}

.sidebar-search {
  position: relative;
  margin-bottom: var(--s2);
}
.sidebar-search input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 32px;
  background: var(--page-bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}
.sidebar-search input:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.sidebar-search input::placeholder { color: var(--text-tertiary); }
.sidebar-search svg {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--text-tertiary);
  stroke-width: 1.4;
  pointer-events: none;
}

.sidebar-section { display: flex; flex-direction: column; gap: 1px; }

.nav-item {
  height: 32px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px;
  border: none; background: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  text-align: left; width: 100%;
  font-family: inherit;
  text-decoration: none;
}
a.nav-item { color: var(--text-secondary); }
a.nav-item.parent-active { color: var(--text-primary); }
a.nav-item.active { color: var(--accent); }
.nav-item svg { width: 16px; height: 16px; stroke-width: 1.4; flex-shrink: 0; }
.nav-item .nav-chevron {
  margin-left: auto;
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}
.nav-item.expanded .nav-chevron { transform: rotate(90deg); }
.nav-item:hover { color: var(--text-primary); background: var(--page-bg); }
.nav-item.active {
  color: var(--accent); background: var(--accent-subtle);
}
.nav-item.active svg { color: var(--accent); }
.nav-item.parent-active {
  color: var(--text-primary);
  font-weight: 500;
}
.nav-item.parent-active svg { color: var(--accent); }
.nav-item.locked {
  color: var(--text-tertiary);
  cursor: not-allowed;
}
.nav-item.locked:hover { background: none; color: var(--text-tertiary); }
.nav-item-lock {
  margin-left: auto;
  width: 14px; height: 14px;
  color: var(--text-muted);
}
html.dark .nav-item:hover { background: var(--surface-raised); }

/* Nested sub-nav under an expanded parent */
.nav-sub {
  display: flex; flex-direction: column; gap: 1px;
  padding: 2px 0;
}
.nav-sub-item {
  height: 28px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px 0 36px;
  border: none; background: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 12px; font-weight: 400;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  text-align: left; width: 100%;
  font-family: inherit;
  text-decoration: none;
}
a.nav-sub-item { color: var(--text-secondary); }
a.nav-sub-item.active { color: var(--accent); }
.nav-sub-item:hover { color: var(--text-primary); background: var(--page-bg); }
.nav-sub-item.active {
  color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 500;
}
.nav-item:not(.expanded) + .nav-sub { display: none; }

.sidebar-spacer { flex: 1; }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: var(--s1);
  margin-top: var(--s1);
  border-top: 1px solid var(--border-default);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
}

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout {
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--s1) 6px;
}

/* ── Main area ── */

.main {
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
}
.canvas {
  flex: 1;
  overflow: auto;
  position: relative;
}

/* ══════════════════════════════════════ */
/*            COMPONENT KIT               */
/* ══════════════════════════════════════ */

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--page-bg);
  border: 1px solid var(--border-default);
  font-size: 11px; font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  line-height: 1;
  white-space: nowrap;
}
.chip:hover { background: var(--surface-raised); border-color: var(--text-muted); }
.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.chip-tinted {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent);
}
.chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.chip-stat {
  font-size: 10px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.chip.active .chip-stat { color: rgba(255,255,255,0.8); }

/* Cards */
.card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--page-bg);
  padding: var(--s2);
  transition: border-color var(--transition-fast);
}
.card-filled { background: var(--surface-bg); }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s2);
}
.card-title {
  font-size: 13px; font-weight: 500;
  color: var(--text-primary);
}
.card-meta {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Metric / KPI */
.metric {
  background: var(--surface-bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  padding: 14px var(--s2);
}
.metric-label {
  font-size: 10px; font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 8px;
}
.metric-value {
  font-family: 'Host Grotesk', sans-serif;
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  line-height: 1.1;
}
.metric-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
  display: flex; align-items: center; gap: 6px;
}
.metric-delta-pos { color: var(--positive); }
.metric-delta-neg { color: var(--negative); }

/* Platform dots */
.dot-yt       { background: var(--yt); }
.dot-tiktok   { background: var(--tiktok); box-shadow: inset 0 0 0 0.5px rgba(26,107,122,0.7); }
.dot-reddit   { background: var(--reddit); }
.dot-instagram{ background: var(--instagram); }

/* Avatar */
.avatar {
  border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 500;
  flex-shrink: 0;
  font-family: 'Host Grotesk', sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}
.avatar-xs { width: 18px; height: 18px; font-size: 9px; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-md { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }

/* Sentiment bar */
.sent-bar {
  display: flex; height: 6px; border-radius: 3px;
  overflow: hidden; gap: 1px; min-width: 80px;
}
.sent-pos { background: var(--positive); }
.sent-neu { background: var(--warning); }
.sent-neg { background: var(--negative); }

/* Pill/Badge */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10.5px; font-weight: 500;
  color: var(--text-primary);
  background: var(--surface-bg);
  letter-spacing: 0.01em;
}
.badge-accent   { background: var(--accent-subtle);         color: var(--accent); }
.badge-positive { background: rgba(29,168,109,0.10);        color: var(--positive); }
.badge-warning  { background: rgba(255,189,68,0.14);        color: #aa7a10; }
.badge-negative { background: rgba(255,96,92,0.10);         color: var(--negative); }
html.dark .badge-warning  { color: #ffbd44; }

/* Buttons */
.btn {
  height: 32px; padding: 0 12px;
  font-size: 12px; font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  background: var(--page-bg);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.btn:hover { background: var(--surface-raised); }
.btn svg { width: 14px; height: 14px; stroke-width: 1.4; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--page-bg); }

/* Chart canvas */
.chart-box {
  background: var(--surface-bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.chart-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 48px 32px;
  opacity: 0.55;
  pointer-events: none;
}
html.dark .chart-grid { opacity: 0.3; }

.spark { display: inline-block; vertical-align: middle; }

/* Utility */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; } .gap-4 { gap: 32px; }
.p-1 { padding: 8px; } .p-2 { padding: 16px; } .p-3 { padding: 24px; } .p-4 { padding: 32px; }
.px-3 { padding-left: 24px; padding-right: 24px; }
.py-2 { padding-top: 16px; padding-bottom: 16px; }
.py-3 { padding-top: 24px; padding-bottom: 24px; }
.tabular { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }

/* Scrollbar polish */
.canvas::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
*::-webkit-scrollbar { width: 8px; height: 8px; }
.canvas::-webkit-scrollbar-track,
*::-webkit-scrollbar-track { background: transparent; }
.canvas::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}
.canvas::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════ */
/*         WAITING-FOR-DATA PANEL          */
/* ══════════════════════════════════════ */

.block-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100%;
  padding: 18px 20px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius);
  color: var(--text-tertiary);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  line-height: 1.4;
  background: var(--surface-bg);
}

.block-waiting--error {
  border-color: rgba(255, 96, 92, 0.35);
  color: var(--negative);
  background: rgba(255, 96, 92, 0.06);
}

.block-waiting .waiting-kicker {
  display: block;
  font-family: 'Host Grotesk', sans-serif;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.block-waiting .waiting-body {
  display: block;
  color: var(--text-secondary);
  font-size: 11.5px;
}

