/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #16161e;
  --surface3: #1e1e28;
  --border: #2a2a38;
  --border2: #333344;
  --text: #e2e2ee;
  --text-dim: #8888aa;
  --text-muted: #555566;
  --gold: #c9a84c;
  --gold-dim: rgba(201,168,76,0.12);
  --gold-glow: rgba(201,168,76,0.3);
  --green: #00c853;
  --green-dim: rgba(0,200,83,0.12);
  --red: #ef5350;
  --red-dim: rgba(239,83,80,0.12);
  --accent: #4a90d9;
  --radius: 10px;
  --radius-sm: 6px;
  --header-h: 60px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

/* ── Header ── */
#app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(135deg, #0a0a0f 0%, #0f0f1a 100%);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 28px;
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-cn {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.header-nav {
  display: flex;
  gap: 6px;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
}

.nav-btn:hover {
  color: var(--text);
  border-color: var(--border2);
  background: var(--surface2);
}

.nav-btn.active {
  color: var(--gold);
  border-color: var(--gold-dim);
  background: var(--gold-dim);
}

/* ── Main & Tabs ── */
#app-main {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

.tab-panel {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
}

.tab-panel[hidden] { display: none; }
.tab-panel.active { display: block; }

#timeline-nav {
  width: 200px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 0;
}

#timeline-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px;
  background:
    radial-gradient(circle at top left, rgba(201,168,76,0.08), transparent 34%),
    linear-gradient(180deg, rgba(17,17,24,0.98), rgba(10,10,15,1));
}

.timeline-detail-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.timeline-stat-chip {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--text-dim);
  font-size: 12px;
}

.timeline-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.timeline-stocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.timeline-pill {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 180px;
  flex: 1 1 180px;
}

.timeline-pill-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.timeline-pill-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-moments {
  display: grid;
  gap: 10px;
}

.timeline-moment {
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 14px 16px;
}

.timeline-moment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.timeline-moment-type {
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.timeline-moment-title {
  font-size: 14px;
  font-weight: 600;
}

.timeline-moment-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-moment-text {
  color: var(--text-dim);
  line-height: 1.8;
  font-size: 13px;
}

.timeline-moment-link {
  color: var(--gold);
  text-decoration: none;
}

.timeline-month-stream {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.timeline-month-block {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 18px 18px 8px;
}

.timeline-month-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.timeline-month-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gold);
}

.timeline-month-count {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-post-card {
  background: rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.045);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 10px;
}

.timeline-post-card:last-child {
  margin-bottom: 0;
}

.timeline-post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.timeline-post-kicker {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gold);
}

.timeline-post-date {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline-post-text {
  color: var(--text);
  font-size: 15px;
  line-height: 1.85;
}

/* ── HOME: Word Cloud ── */
#wordcloud-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

#wordcloud-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  transform: translateY(-40px);
}

#wordcloud-intro {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.intro-quote {
  font-size: 15px;
  color: rgba(201,168,76,0.7);
  font-style: italic;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.intro-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
}

/* ── PHILOSOPHY TAB ── */
.phi-layout {
  display: flex;
  height: 100%;
  min-height: calc(100vh - var(--header-h));
}

#phi-nav {
  width: 200px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 0;
}

.phi-nav-title {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 16px 12px;
}

.phi-nav-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  color: var(--text-dim);
  text-align: left;
  padding: 10px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  transition: all 0.15s;
}

.phi-nav-item:hover {
  color: var(--text);
  background: var(--surface2);
}

.phi-nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--gold-dim);
}

#phi-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px;
}

.phi-header-card {
  background: linear-gradient(135deg, var(--surface2), var(--surface3));
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 28px;
}

.phi-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}

.phi-tagline {
  font-size: 14px;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 14px;
}

.phi-description {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}

.section-title {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ── Quote Cards ── */
.quotes-section {
  margin-bottom: 32px;
}

.quote-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: border-left-color 0.2s;
}

.quote-card:hover {
  border-left-color: var(--gold);
}

.quote-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 10px;
}

.quote-cite {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quote-date {
  font-size: 12px;
  color: var(--text-muted);
}

.quote-link {
  font-size: 12px;
  color: var(--gold);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.quote-link:hover { opacity: 1; }

.quote-stars {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1px;
}

/* ── Philosophy Stock Cards ── */
#phi-stocks-section {
  margin-top: 8px;
}

#phi-stocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.phi-stock-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.phi-stock-card:hover {
  border-color: var(--border2);
  background: var(--surface3);
  transform: translateY(-2px);
}

.psc-ticker {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: monospace;
}

.psc-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.psc-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── STOCKS TAB ── */
.stocks-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

#stocks-search {
  flex: 1;
  max-width: 320px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
}

#stocks-search:focus { border-color: var(--border2); }

.market-filters {
  display: flex;
  gap: 4px;
}

.mf-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.15s;
}

.mf-btn:hover { border-color: var(--border2); color: var(--text); }

.mf-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(74,144,217,0.1);
}

#stocks-list {
  padding: 16px 24px;
}

.inline-chart-wrap {
  padding-top: 16px;
}

.inline-chart {
  width: 100%;
  height: 360px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface2);
}

.inline-chart-stats {
  display: flex;
  gap: 16px;
  padding: 14px 0 16px;
  flex-wrap: wrap;
}

/* ── Stock Accordion ── */
.stock-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.stock-item.expanded { border-color: var(--border2); }

.stock-item-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  gap: 12px;
  user-select: none;
}

.stock-item-header:hover { background: var(--surface2); }

.si-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.si-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.si-ticker {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

.si-sentiment {
  display: flex;
  gap: 8px;
  font-size: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.si-bull { color: var(--green); }
.si-bear { color: var(--red); }

.si-expand {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.stock-item.expanded .si-expand { transform: rotate(180deg); }

.stock-item-body {
  display: none;
  padding: 0 18px 20px;
  border-top: 1px solid var(--border);
}

.stock-item.expanded .stock-item-body { display: block; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-bull { background: var(--green-dim); color: var(--green); }
.badge-bear { background: var(--red-dim); color: var(--red); }
.badge-market { background: var(--surface3); color: var(--text-dim); }
.badge-gold { background: var(--gold-dim); color: var(--gold); }

/* ── Opinion Timeline ── */
.opinion-timeline {
  margin-top: 16px;
}

.opinion-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.opinion-item:last-child { border-bottom: none; }

.opinion-sentiment-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.opinion-body { flex: 1; min-width: 0; }

.opinion-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.opinion-date-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.opinion-date-link:hover { color: var(--gold); }

.opinion-summary {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface3);
  padding: 1px 6px;
  border-radius: 4px;
}

.opinion-quote {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  word-break: break-all;
}

/* ── Chart Stats Bar ── */
#chart-stats {
  display: flex;
  gap: 16px;
  padding: 14px 20px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.gold { color: var(--gold); }

#chart-container {
  width: 100%;
  height: 460px;
  flex-shrink: 0;
}

/* ── Chart Modal ── */
#chart-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
}

#chart-modal[hidden] { display: none; }

#chart-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}

#chart-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1120px, 96vw);
  max-height: 88vh;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
}

#chart-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#chart-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

#chart-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

#chart-modal-close:hover { color: var(--text); background: var(--surface2); }

#chart-opinions-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 16px;
  min-height: 0;
}

@media (max-width: 1024px) {
  .header-inner {
    padding: 0 18px;
    gap: 14px;
  }

  .header-nav {
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
    max-width: 56vw;
  }

  .header-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    flex: 0 0 auto;
  }

  #timeline-content,
  #phi-content {
    padding: 24px 24px 36px;
  }

  #chart-modal-content {
    width: min(960px, 97vw);
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 92px;
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 10px 14px 10px;
    gap: 8px;
  }

  .header-brand {
    width: 100%;
    gap: 4px;
  }

  .brand-cn {
    font-size: 17px;
    line-height: 1.15;
    letter-spacing: 0.8px;
  }

  .brand-sub {
    font-size: 11px;
    line-height: 1.2;
    opacity: 0.8;
  }

  .header-nav {
    max-width: 100%;
    width: 100%;
    gap: 10px;
    padding: 1px 0 2px;
    overflow-y: hidden;
    align-items: center;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }

  .nav-btn {
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 999px;
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.04);
  }

  .nav-btn.active {
    box-shadow: inset 0 0 0 1px rgba(201,168,76,0.08);
  }

  .nav-btn:hover {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.04);
  }

  #wordcloud-canvas {
    transform: translateY(-44px);
  }

  #wordcloud-intro {
    width: min(88vw, 340px);
    bottom: 26px;
  }

  .intro-quote {
    font-size: 13px;
    letter-spacing: 0.4px;
  }

  .phi-layout {
    flex-direction: column;
    min-height: auto;
  }

  #phi-nav,
  #timeline-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
  }

  .phi-nav-title {
    padding: 0 14px 10px;
  }

  #phi-nav-list,
  #timeline-nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 14px;
    scrollbar-width: none;
  }

  #phi-nav-list::-webkit-scrollbar,
  #timeline-nav-list::-webkit-scrollbar {
    display: none;
  }

  .phi-nav-item {
    width: auto;
    flex: 0 0 auto;
    border-left: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--surface2);
    white-space: nowrap;
  }

  .phi-nav-item.active {
    border-left-color: transparent;
    border-color: var(--gold-dim);
  }

  #timeline-content,
  #phi-content {
    padding: 18px 14px 28px;
  }

  .phi-header-card {
    padding: 18px 18px;
    margin-bottom: 22px;
  }

  .phi-title {
    font-size: 18px;
  }

  .phi-tagline,
  .phi-description,
  .timeline-post-text,
  .quote-text {
    font-size: 13px;
  }

  #phi-stocks-grid,
  .timeline-stocks-grid {
    grid-template-columns: 1fr;
  }

  .stocks-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 14px;
  }

  #stocks-search {
    max-width: none;
    width: 100%;
  }

  .market-filters {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .market-filters::-webkit-scrollbar {
    display: none;
  }

  .mf-btn {
    flex: 0 0 auto;
  }

  #stocks-list {
    padding: 12px 14px 24px;
  }

  .stock-item-header {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 10px;
  }

  .si-info {
    width: calc(100% - 24px);
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  .si-sentiment {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .stock-item-body {
    padding: 0 14px 16px;
  }

  .inline-chart {
    height: 260px;
    border-radius: 12px;
  }

  .inline-chart-stats,
  #chart-stats {
    gap: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
  }

  .stat-item {
    min-width: 0;
  }

  #chart-modal-content {
    inset: 0;
    top: 0;
    left: 0;
    transform: none;
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding-bottom: env(safe-area-inset-bottom);
  }

  #chart-modal-header {
    padding: 12px 14px;
  }

  #chart-modal-title {
    font-size: 14px;
    max-width: calc(100% - 44px);
    line-height: 1.4;
  }

  #chart-container {
    height: 300px;
  }

  #chart-stats {
    padding: 12px 14px;
  }

  #chart-opinions-list {
    padding: 0 14px 14px;
  }

  .opinion-meta {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
  }

  .timeline-pill-row {
    gap: 8px;
  }

  .timeline-pill {
    min-width: 100%;
  }

  .timeline-month-block,
  .timeline-moment {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  :root {
    --header-h: 84px;
  }

  .header-inner {
    padding: 10px 12px 9px;
    gap: 7px;
  }

  .brand-cn {
    font-size: 16px;
    letter-spacing: 0.6px;
  }

  .nav-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .header-nav {
    gap: 8px;
  }

  #wordcloud-intro {
    bottom: 18px;
  }

  .intro-hint {
    font-size: 11px;
  }

  .phi-header-card,
  .quote-card,
  .phi-stock-card,
  .timeline-month-block,
  .timeline-moment,
  .timeline-post-card,
  .stock-item,
  .inline-chart {
    border-radius: 10px;
  }

  .phi-title {
    font-size: 17px;
  }

  .timeline-month-title,
  .psc-name,
  .si-name {
    font-size: 14px;
  }

  .timeline-post-text,
  .quote-text,
  .opinion-quote {
    font-size: 12px;
  }

  #chart-container {
    height: 260px;
  }

  .inline-chart {
    height: 220px;
  }

  .inline-chart-stats,
  #chart-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-label {
    font-size: 10px;
  }

  .stat-value {
    font-size: 14px;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state .icon { font-size: 40px; margin-bottom: 12px; }

/* ── Loading ── */
.loading-dots::after {
  content: "";
  animation: dots 1.2s infinite;
}
@keyframes dots {
  0%, 20% { content: ""; }
  40% { content: "."; }
  60% { content: ".."; }
  80%, 100% { content: "..."; }
}
