/**
 * MKP WebHub · Insights Page · V1.0.16 · 2026-05-05
 * Trinity-Hat approved migration of Legacy Report Modal · Phase 1.
 *
 * Design language inherits from create-v2.css (boss directive: same theme as
 * Create Content). Same tokens · same surface treatment · same accent rules.
 * Differences from create-v2:
 *   - Full-width grid (NOT 1fr+460px sidebar) · Hia Gem demand · Dashboard
 *     stats need horizontal breathing room
 *   - 6-card stat grid pattern + funnel chart bars (insights-only)
 *   - Empty/disconnected states (Jame UX demand)
 *
 * Scope: .insights-root · day-1 cleanup not needed since this page is greenfield.
 */
.insights-root {
  /* Spacing · 8pt grid (mirrors create-v2) */
  --v2-s-1: 4px; --v2-s-2: 8px; --v2-s-3: 12px; --v2-s-4: 16px;
  --v2-s-5: 24px; --v2-s-6: 32px; --v2-s-7: 48px; --v2-s-8: 64px;
  --v2-t-display: 28px; --v2-t-heading: 18px; --v2-t-body: 14px; --v2-t-caption: 12px;
  --v2-accent: #EA8623;
  --v2-accent-hover: #FF9933;
  --v2-accent-soft: rgba(234,134,35,0.08);
  --v2-accent-glow: rgba(234,134,35,0.18);
  --v2-g-200: #E5E5E5; --v2-g-400: #A3A3A3; --v2-g-500: #737373;
  --v2-g-600: #525252; --v2-g-700: #404040; --v2-g-800: #262626;
  --v2-g-900: #171717; --v2-g-950: #0A0A0A;
  --v2-bg: #0A0A0A;
  --v2-bg-card: #171717;
  --v2-bg-input: #262626;
  --v2-border: rgba(255,255,255,0.08);
  --v2-border-strong: rgba(255,255,255,0.14);
  --v2-border-hover: rgba(234,134,35,0.4);
  --v2-shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --v2-shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.6);
  --v2-r-sm: 6px; --v2-r-md: 10px; --v2-r-lg: 16px;
  --v2-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --v2-t-fast: 120ms; --v2-t-base: 200ms;
  --v2-success: #10B981; --v2-danger: #EF4444; --v2-warning: #F59E0B;
  --v2-info: #3B82F6;

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--v2-t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color: var(--v2-g-200);
}

.insights-root *, .insights-root *::before, .insights-root *::after { box-sizing: border-box; }

/* ─────────────────────── Page header ─────────────────────── */
.insights-root .ins-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--v2-s-5);
}
.insights-root .ins-title {
  font-size: var(--v2-t-display); font-weight: 800;
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 12px;
}
.insights-root .ins-title .material-symbols-rounded {
  color: var(--v2-accent); font-size: 32px; font-variation-settings: 'FILL' 1;
}
.insights-root .ins-subtitle { color: var(--v2-g-500); font-size: var(--v2-t-body); margin-top: 2px; }

.insights-root .ins-tools {
  display: flex; gap: var(--v2-s-3); align-items: center; flex-wrap: wrap;
}
.insights-root .ins-tool-btn,
.insights-root .ins-compare-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--v2-r-md);
  background: var(--v2-bg-card); border: 1px solid var(--v2-border);
  color: var(--v2-g-400); font-size: var(--v2-t-caption); font-weight: 600;
  cursor: pointer; transition: all var(--v2-t-fast) var(--v2-ease);
  font-family: inherit;
}
.insights-root .ins-tool-btn:hover,
.insights-root .ins-compare-btn:hover { border-color: var(--v2-border-hover); color: #fff; }
.insights-root .ins-tool-btn.active,
.insights-root .ins-tool-btn.primary,
.insights-root .ins-compare-btn.active {
  background: var(--v2-accent); color: #000; border-color: var(--v2-accent);
}
.insights-root .ins-tool-btn .material-symbols-rounded,
.insights-root .ins-compare-btn .material-symbols-rounded { font-size: 16px; }

/* Custom date row · shown when range='custom' */
.insights-root .ins-custom-range {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: var(--v2-s-4);
  background: var(--v2-bg-card); border: 1px solid var(--v2-border-strong);
  border-radius: var(--v2-r-md);
}
.insights-root .ins-custom-range.hidden { display: none; }
.insights-root .ins-custom-range .material-symbols-rounded { color: var(--v2-accent); }
.insights-root .ins-date-input {
  background: var(--v2-bg-input); border: 1px solid var(--v2-border);
  color: #fff; padding: 6px 10px; border-radius: var(--v2-r-sm);
  font-family: inherit; font-size: var(--v2-t-body);
  color-scheme: dark;
}
.insights-root .ins-date-input:focus { outline: none; border-color: var(--v2-accent); box-shadow: var(--v2-glow); }
.insights-root .ins-date-sep { color: var(--v2-g-500); font-size: var(--v2-t-caption); }
.insights-root .ins-date-meta { margin-left: auto; color: var(--v2-g-500); font-size: var(--v2-t-caption); }

.insights-root .ins-range-bar {
  display: flex; gap: 6px; padding: 4px;
  background: var(--v2-bg-card); border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-md);
}
.insights-root .ins-range-btn {
  font-family: inherit; font-size: var(--v2-t-caption); font-weight: 600;
  padding: 6px 14px; border-radius: var(--v2-r-sm);
  background: transparent; color: var(--v2-g-400); border: none;
  cursor: pointer; transition: all var(--v2-t-fast) var(--v2-ease);
}
.insights-root .ins-range-btn:hover { color: #fff; background: var(--v2-bg-input); }
.insights-root .ins-range-btn.active { background: var(--v2-accent); color: #000; }

/* ─────────────────────── Layout grid · full-width ─────────────────────── */
.insights-root .ins-layout {
  display: grid; gap: var(--v2-s-5);
  grid-template-columns: 1fr;
}
.insights-root .ins-row-2 {
  display: grid; gap: var(--v2-s-5);
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 980px) {
  .insights-root .ins-row-2 { grid-template-columns: 1fr; }
}

/* Card surface · same recipe as create-v2 .v2-card */
.insights-root .ins-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%), var(--v2-bg-card);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-lg);
  box-shadow: var(--v2-shadow-md);
  padding: var(--v2-s-5);
  position: relative;
}
.insights-root .ins-card-title {
  display: flex; align-items: center;
  font-size: var(--v2-t-heading); font-weight: 700;
  letter-spacing: -0.01em; margin-bottom: var(--v2-s-4);
}
.insights-root .ins-card-title::before {
  content: ''; width: 3px; height: 18px;
  background: var(--v2-accent); border-radius: 2px;
  margin-right: 10px; display: inline-block;
}
.insights-root .ins-card-title-sub {
  font-size: var(--v2-t-caption); color: var(--v2-g-500);
  font-weight: 400; margin-left: auto;
}

/* ─────────────────────── Section 1 · Stats grid (8 tiles) ─────────────── */
.insights-root .stats-grid {
  display: grid; gap: var(--v2-s-3);
  grid-template-columns: repeat(8, 1fr);
}
@media (max-width: 1400px) { .insights-root .stats-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 700px)  { .insights-root .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* All-time totals · 6-tile grid · less prominent than today's stats */
.insights-root .alltime-grid {
  display: grid; gap: var(--v2-s-3);
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 700px) { .insights-root .alltime-grid { grid-template-columns: repeat(2, 1fr); } }

.insights-root .stat-tile {
  background: var(--v2-bg-input);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-md);
  padding: var(--v2-s-4);
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
  transition: border-color var(--v2-t-base) var(--v2-ease);
}
.insights-root .stat-tile:hover { border-color: var(--v2-border-hover); }
.insights-root .stat-tile-label {
  font-size: var(--v2-t-caption); color: var(--v2-g-500);
  font-weight: 500; display: flex; align-items: center; gap: 6px;
}
.insights-root .stat-tile-value {
  font-size: 26px; font-weight: 800; color: #fff;
  letter-spacing: -0.02em; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.insights-root .stat-tile-trend {
  font-size: 11px; color: var(--v2-g-500); margin-top: auto;
}
.insights-root .stat-tile.success .stat-tile-value { color: var(--v2-success); }
.insights-root .stat-tile.danger  .stat-tile-value { color: var(--v2-danger); }
.insights-root .stat-tile.warning .stat-tile-value { color: var(--v2-warning); }
.insights-root .stat-tile.accent  .stat-tile-value { color: var(--v2-accent); }
.insights-root .stat-tile.info    .stat-tile-value { color: var(--v2-info); }

/* ─────────────────────── Section 2 · Funnel chart ─────────────────────── */
.insights-root .funnel { display: flex; flex-direction: column; gap: 10px; }
.insights-root .funnel-row {
  display: grid; grid-template-columns: 130px 1fr 90px;
  gap: var(--v2-s-3); align-items: center;
}
.insights-root .funnel-label {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--v2-t-body); font-weight: 600; color: var(--v2-g-200);
}
.insights-root .funnel-label .material-symbols-rounded {
  font-size: 20px; color: var(--v2-accent);
}
.insights-root .funnel-bar-track {
  height: 28px; background: var(--v2-bg-input);
  border-radius: var(--v2-r-sm); overflow: hidden;
  border: 1px solid var(--v2-border);
}
.insights-root .funnel-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--v2-accent), var(--v2-accent-hover));
  transition: width 600ms var(--v2-ease);
  display: flex; align-items: center; justify-content: flex-end; padding-right: 10px;
  color: #000; font-weight: 700; font-size: var(--v2-t-caption);
}
.insights-root .funnel-bar-fill.s-image { background: linear-gradient(90deg, #6366f1, #818cf8); color: #fff; }
.insights-root .funnel-bar-fill.s-video { background: linear-gradient(90deg, #8b5cf6, #a78bfa); color: #fff; }
.insights-root .funnel-bar-fill.s-posted { background: linear-gradient(90deg, var(--v2-success), #34D399); color: #000; }
.insights-root .funnel-bar-fill.s-jobs { background: linear-gradient(90deg, var(--v2-accent), var(--v2-accent-hover)); color: #000; }
.insights-root .funnel-count {
  text-align: right; font-variant-numeric: tabular-nums;
  font-size: var(--v2-t-body); font-weight: 700; color: #fff;
}
.insights-root .funnel-count .pct {
  display: block; font-size: 10px; color: var(--v2-g-500); font-weight: 500;
}
.insights-root .funnel-summary {
  margin-top: var(--v2-s-4); padding: var(--v2-s-3) var(--v2-s-4);
  background: var(--v2-bg-input); border-radius: var(--v2-r-md);
  border: 1px solid var(--v2-border);
  display: flex; gap: var(--v2-s-5); justify-content: space-around;
  font-size: var(--v2-t-caption);
}
.insights-root .funnel-summary div { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.insights-root .funnel-summary strong { font-size: 18px; color: #fff; font-variant-numeric: tabular-nums; }
.insights-root .funnel-summary .lbl { color: var(--v2-g-500); }

/* Compare-mode trend badges · used in funnel rows + summary + failures */
.insights-root .funnel-prev,
.insights-root .failure-trend,
.insights-root .trend {
  display: inline-block; margin-left: 8px;
  font-size: 10px; font-weight: 600; line-height: 1;
  padding: 2px 6px; border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.insights-root .trend.good    { background: rgba(16,185,129,0.16);  color: #34D399; }
.insights-root .trend.bad     { background: rgba(239,68,68,0.16);   color: #fca5a5; }
.insights-root .trend.neutral { background: rgba(115,115,115,0.16); color: var(--v2-g-400); }

/* ─────────────────────── Next queue ─────────────────────── */
.insights-root .queue-list { display: flex; flex-direction: column; gap: 8px; }
.insights-root .queue-row {
  display: grid; grid-template-columns: 40px 1fr;
  gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: var(--v2-r-md);
  background: var(--v2-bg-input); border: 1px solid var(--v2-border);
  transition: border-color var(--v2-t-fast) var(--v2-ease);
}
.insights-root .queue-row:hover { border-color: var(--v2-border-hover); }
.insights-root .queue-row.paused { opacity: 0.7; }
.insights-root .queue-pos {
  text-align: center; font-weight: 800; color: var(--v2-accent);
  font-size: var(--v2-t-body); font-variant-numeric: tabular-nums;
}
.insights-root .queue-info { min-width: 0; }
.insights-root .queue-title {
  font-size: var(--v2-t-body); font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.insights-root .queue-meta {
  font-size: 11px; color: var(--v2-g-500); margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.insights-root .queue-more {
  text-align: center; padding: 6px; font-size: var(--v2-t-caption);
  color: var(--v2-g-500); font-style: italic;
}

/* ─────────────────────── ROI / Profit card ─────────────────────── */
.insights-root .ins-roi-card { padding: var(--v2-s-5) var(--v2-s-5) var(--v2-s-4); }
.insights-root .roi-headline {
  text-align: center; padding: var(--v2-s-4) 0;
  border-bottom: 1px solid var(--v2-border); margin-bottom: var(--v2-s-4);
}
.insights-root .roi-profit {
  font-size: 36px; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.insights-root .roi-profit.success { color: var(--v2-success); }
.insights-root .roi-profit.danger  { color: var(--v2-danger); }
.insights-root .roi-label { color: var(--v2-g-500); font-size: var(--v2-t-body); margin-top: 4px; }
.insights-root .roi-grid {
  display: grid; gap: var(--v2-s-3);
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 900px) { .insights-root .roi-grid { grid-template-columns: repeat(2, 1fr); } }
.insights-root .roi-cell {
  background: var(--v2-bg-input); border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-md); padding: var(--v2-s-3) var(--v2-s-4);
}
.insights-root .roi-cell-lbl { font-size: 11px; color: var(--v2-g-500); margin-bottom: 4px; }
.insights-root .roi-cell-val {
  font-size: 22px; font-weight: 800; line-height: 1.1; color: #fff;
  font-variant-numeric: tabular-nums; margin-bottom: 2px;
}
.insights-root .roi-cell-val.success { color: var(--v2-success); }
.insights-root .roi-cell-val.danger  { color: var(--v2-danger); }
.insights-root .roi-cell-val.accent  { color: var(--v2-accent); }
.insights-root .roi-cell-val.info    { color: var(--v2-info); }
.insights-root .roi-cell-meta { font-size: 10px; color: var(--v2-g-500); }

/* ─────────────────────── Top styles ─────────────────────── */
.insights-root .topstyle-list { display: flex; flex-direction: column; gap: 8px; }
.insights-root .topstyle-row {
  display: grid; grid-template-columns: 24px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: var(--v2-r-md);
  background: var(--v2-bg-input); border: 1px solid var(--v2-border);
}
.insights-root .topstyle-rank {
  text-align: center; font-weight: 800; color: var(--v2-accent);
  font-size: var(--v2-t-body);
}
.insights-root .topstyle-info { min-width: 0; }
.insights-root .topstyle-name {
  font-size: var(--v2-t-body); font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.insights-root .topstyle-meta { font-size: 10px; color: var(--v2-g-500); margin-top: 2px; }
.insights-root .topstyle-stats { display: flex; gap: 12px; align-items: baseline; }
.insights-root .topstyle-qty {
  font-size: 16px; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums;
}
.insights-root .topstyle-qty small { font-size: 9px; color: var(--v2-g-500); margin-left: 2px; }
.insights-root .topstyle-rate {
  font-size: 14px; font-weight: 700; min-width: 42px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.insights-root .topstyle-rate.good { color: var(--v2-success); }
.insights-root .topstyle-rate.mid  { color: var(--v2-warning); }
.insights-root .topstyle-rate.bad  { color: var(--v2-danger); }

/* ─────────────────────── Goal progress ─────────────────────── */
.insights-root .goal-row {
  display: flex; gap: 12px; align-items: center;
}
.insights-root .goal-track {
  flex: 1; height: 14px; background: var(--v2-bg-input);
  border: 1px solid var(--v2-border); border-radius: 8px; overflow: hidden;
}
.insights-root .goal-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--v2-accent), var(--v2-accent-hover));
  transition: width 600ms var(--v2-ease);
}
.insights-root .goal-num {
  font-size: var(--v2-t-body); font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums; min-width: 110px; text-align: right;
}
.insights-root .goal-num strong { color: var(--v2-accent); font-size: 18px; }
.insights-root .goal-pct { color: var(--v2-g-500); margin-left: 6px; font-weight: 500; }
.insights-root .goal-meta { color: var(--v2-g-500); font-size: var(--v2-t-caption); margin-top: 8px; }

/* ─────────────────────── Cost config modal ─────────────────────── */
.ins-cfg-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  font-family: 'Inter', -apple-system, sans-serif;
}
.ins-cfg-modal {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent), #171717;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px; padding: 0; width: 380px; max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  color: #E5E5E5;
}
.ins-cfg-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ins-cfg-header .material-symbols-rounded { color: #EA8623; }
.ins-cfg-header strong { flex: 1; font-size: 14px; }
.ins-cfg-close {
  background: transparent; border: none; color: #A3A3A3;
  font-size: 22px; cursor: pointer; padding: 0 8px;
  font-family: inherit;
}
.ins-cfg-close:hover { color: #fff; }
.ins-cfg-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.ins-cfg-row { display: flex; align-items: center; gap: 12px; }
.ins-cfg-row span { flex: 1; font-size: 13px; color: #D4D4D4; }
.ins-cfg-row input {
  width: 110px; background: #262626; border: 1px solid rgba(255,255,255,0.08);
  color: #fff; padding: 8px 10px; border-radius: 8px;
  font-family: inherit; font-size: 14px; text-align: right;
  font-variant-numeric: tabular-nums; color-scheme: dark;
}
.ins-cfg-row input:focus { outline: none; border-color: #EA8623; box-shadow: 0 0 0 3px rgba(234,134,35,0.18); }
.ins-cfg-footer {
  padding: 12px 20px 16px; display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.ins-cfg-btn-cancel,
.ins-cfg-btn-save {
  padding: 8px 18px; border-radius: 8px; font-weight: 700; font-size: 13px;
  cursor: pointer; font-family: inherit; border: 1px solid rgba(255,255,255,0.08);
}
.ins-cfg-btn-cancel { background: transparent; color: #A3A3A3; }
.ins-cfg-btn-cancel:hover { color: #fff; }
.ins-cfg-btn-save { background: #EA8623; color: #000; border-color: #EA8623; }
.ins-cfg-btn-save:hover { background: #FF9933; }

/* ─────────────────────── Section 3 · Production health ─────────────────────── */
.insights-root .stuck-banner {
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.3);
  color: #fecaca; border-radius: var(--v2-r-md);
  padding: var(--v2-s-3) var(--v2-s-4); margin-bottom: var(--v2-s-4);
  display: flex; align-items: center; gap: 8px; font-size: var(--v2-t-body);
}
.insights-root .stuck-banner .material-symbols-rounded { color: var(--v2-danger); font-size: 20px; }

.insights-root .failure-list { display: flex; flex-direction: column; gap: 8px; }
.insights-root .failure-row {
  display: grid; grid-template-columns: 140px 1fr 60px;
  gap: var(--v2-s-3); align-items: center;
  padding: 8px 12px; border-radius: var(--v2-r-sm);
  background: var(--v2-bg-input); border: 1px solid var(--v2-border);
}
.insights-root .failure-step { font-size: var(--v2-t-body); font-weight: 600; color: var(--v2-g-200); }
.insights-root .failure-step.tiktok_upload, .insights-root .failure-step.upload { color: #f472b6; }
.insights-root .failure-step.video_gen, .insights-root .failure-step.video { color: #c084fc; }
.insights-root .failure-step.image_gen, .insights-root .failure-step.image { color: #818cf8; }
.insights-root .failure-step.download { color: #fbbf24; }
.insights-root .failure-step.unknown { color: var(--v2-g-500); }
.insights-root .failure-bar-track {
  height: 8px; background: var(--v2-bg); border-radius: 4px; overflow: hidden;
}
.insights-root .failure-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--v2-danger), #f87171);
  transition: width 500ms var(--v2-ease);
}
.insights-root .failure-count {
  text-align: right; font-weight: 700; color: var(--v2-danger);
  font-variant-numeric: tabular-nums; font-size: var(--v2-t-body);
}

/* ─────────────────────── Section 4 · Activity feed ─────────────────────── */
.insights-root .activity-feed {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 380px; overflow-y: auto;
  padding-right: 4px;
}
.insights-root .activity-feed::-webkit-scrollbar { width: 6px; }
.insights-root .activity-feed::-webkit-scrollbar-track { background: var(--v2-bg); border-radius: 3px; }
.insights-root .activity-feed::-webkit-scrollbar-thumb { background: var(--v2-g-700); border-radius: 3px; }
.insights-root .activity-feed::-webkit-scrollbar-thumb:hover { background: var(--v2-g-600); }

.insights-root .activity-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: var(--v2-r-sm);
  font-size: var(--v2-t-caption);
  transition: background var(--v2-t-fast) var(--v2-ease);
}
.insights-root .activity-row:hover { background: var(--v2-bg-input); }
.insights-root .activity-row.new {
  animation: insFadeIn 320ms var(--v2-ease);
  background: var(--v2-accent-soft);
}
@keyframes insFadeIn {
  from { opacity: 0; transform: translateY(-4px); background: var(--v2-accent-glow); }
  to   { opacity: 1; transform: none; background: var(--v2-accent-soft); }
}
.insights-root .activity-time {
  color: var(--v2-g-500); font-size: 11px;
  font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 56px;
}
.insights-root .activity-msg { color: var(--v2-g-200); line-height: 1.5; word-break: break-word; }

/* ─────────────────────── Empty / disconnected states ─────────────────────── */
.insights-root .ins-empty {
  text-align: center; padding: var(--v2-s-7) var(--v2-s-5);
  color: var(--v2-g-500); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.insights-root .ins-empty .material-symbols-rounded {
  font-size: 48px; color: var(--v2-g-700);
}
.insights-root .ins-empty-title { font-size: var(--v2-t-heading); font-weight: 600; color: var(--v2-g-400); }
.insights-root .ins-empty-msg { font-size: var(--v2-t-body); max-width: 300px; }
.insights-root .ins-empty-cta {
  margin-top: var(--v2-s-3); padding: 10px 18px;
  background: var(--v2-accent); color: #000;
  font-weight: 700; font-size: var(--v2-t-body);
  border-radius: var(--v2-r-md); border: none;
  cursor: pointer; transition: background var(--v2-t-fast) var(--v2-ease);
  text-decoration: none; display: inline-block;
}
.insights-root .ins-empty-cta:hover { background: var(--v2-accent-hover); }

.insights-root .ws-offline {
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3);
  color: #fde68a; border-radius: var(--v2-r-md);
  padding: 8px 14px; margin-bottom: var(--v2-s-4);
  display: flex; align-items: center; gap: 8px; font-size: var(--v2-t-caption);
}
.insights-root .ws-offline .material-symbols-rounded { color: var(--v2-warning); font-size: 18px; }

/* Skeleton state · keep page from jumping while data loads */
.insights-root .ins-skel {
  background: linear-gradient(90deg, var(--v2-bg-input), var(--v2-g-800), var(--v2-bg-input));
  background-size: 200% 100%;
  animation: insSkelShine 1.5s infinite ease-in-out;
  border-radius: var(--v2-r-sm);
}
@keyframes insSkelShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
