/* Static insights SPA overrides */
html {
  scroll-behavior: smooth;
}

#app-outlet {
  min-height: calc(100vh - 4rem);
}

@media (min-width: 1024px) {
  #app-outlet {
    min-height: calc(100vh - 72px);
  }
}

.insights-shell-main {
  font-family: Manrope, var(--font-sans), ui-sans-serif, system-ui;
}

/* Lucide-style icon sizing in nav */
.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mobile-nav-icon {
  width: 20px;
  height: 20px;
}

/* HPU header pill */
.hpu-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  border: 1px solid rgb(99 102 241 / 0.45);
  background: rgb(99 102 241 / 0.12);
  color: var(--color-cognition, #6366f1);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.dark .hpu-pill {
  border-color: rgb(129 140 248 / 0.55);
  background: rgb(99 102 241 / 0.18);
  color: #a5b4fc;
}

.hpu-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.hpu-pill-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hpu-pill-compact {
  padding: 0.25rem 0.5rem;
  font-size: 0.625rem;
  gap: 0.25rem;
  max-width: 6.5rem;
}

.hpu-pill-compact .hpu-pill-icon {
  width: 12px;
  height: 12px;
}

.hpu-pill-compact .hpu-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Asset library loading */
.asset-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgb(99 102 241 / 0.2);
  border-top-color: var(--color-cognition, #6366f1);
  border-radius: 50%;
  animation: asset-spin 0.7s linear infinite;
}

@keyframes asset-spin {
  to { transform: rotate(360deg); }
}

/* Asset library cards */
.asset-card:hover {
  border-color: rgb(99 102 241 / 0.35);
}

.asset-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-card-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(148 163 184);
}

.media-type-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  backdrop-filter: blur(4px);
}

.media-type-video {
  background: rgb(99 102 241 / 0.85);
}

.media-type-image {
  background: rgb(245 158 11 / 0.9);
}

.media-type-audio {
  background: rgb(139 92 246 / 0.9);
}

.card-score-ring {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
}

.card-score-ring-svg {
  width: 40px;
  height: 40px;
  color: #818cf8;
}

.card-score-ring-text {
  fill: #fff;
  font-size: 11px;
  font-weight: 800;
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
}

.asset-card-rank {
  font-size: 0.6875rem;
  font-weight: 700;
  color: rgb(99 102 241);
}

.asset-card-calendar-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.7;
}

.asset-filter-chip {
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--color-divider-soft, rgb(226 232 240));
  background: var(--color-bg-elevated, #fff);
  color: var(--color-text-secondary, #64748b);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.asset-filter-chip:hover {
  color: var(--color-text-primary, #0f172a);
}

.asset-filter-chip.is-active {
  background: var(--color-cognition, #6366f1);
  border-color: var(--color-cognition, #6366f1);
  color: #fff;
}

.dark .asset-filter-chip {
  border-color: rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.05);
}

.dark .asset-filter-chip.is-active {
  background: var(--color-cognition, #6366f1);
  border-color: var(--color-cognition, #6366f1);
}

/* Score bar gradients */
.pillar-cognition { color: var(--color-cognition, #6366f1); }
.pillar-emotion { color: var(--color-emotion, #10b981); }
.pillar-decision { color: var(--color-decision, #f59e0b); }

.score-bar-track {
  height: 8px;
  border-radius: 9999px;
  background: rgb(148 163 184 / 0.2);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.insight-card-expanded {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ────────────────────────────────────────────────────────────────────────
   Analysis detail page
   ──────────────────────────────────────────────────────────────────────── */

/* Hero */
.detail-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem;
  border-radius: 1.25rem;
  border: 1px solid var(--color-divider-soft, rgb(226 232 240));
  background: var(--color-bg-elevated, #fff);
}

@media (min-width: 900px) {
  .detail-hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }
}

.detail-hero-media {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: rgb(15 23 42 / 0.04);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dark .detail-hero-media {
  background: rgb(255 255 255 / 0.04);
}

.detail-media-img,
.detail-media-video {
  width: 100%;
  border-radius: 1rem;
  display: block;
  object-fit: contain;
  max-height: 360px;
  background: #000;
}

.detail-media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.8125rem;
  font-weight: 600;
}

.detail-media-icon-svg { width: 28px; height: 28px; opacity: 0.6; }

.detail-media-caption {
  margin-top: 0.625rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(99 102 241 / 0.75);
}

.detail-media-caption-icon { width: 13px; height: 13px; }

.detail-hero-score {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "overview ring" "verdict ring";
  gap: 0.75rem 1.25rem;
  align-items: center;
}

@media (max-width: 560px) {
  .detail-hero-score {
    grid-template-columns: 1fr;
    grid-template-areas: "ring" "overview" "verdict";
    justify-items: center;
    text-align: center;
  }
}

.detail-overview { grid-area: overview; }
.detail-hero-ring { grid-area: ring; }
.detail-verdict { grid-area: verdict; }

.detail-overview-eyebrow {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(99 102 241 / 0.8);
  margin-bottom: 0.375rem;
}

.detail-overview-hint,
.detail-overview-body {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--color-text-secondary, #64748b);
}

.detail-overview-body p { margin-bottom: 0.5rem; }
.detail-overview-body p:last-child { margin-bottom: 0; }
.detail-overview-body strong { color: var(--color-text-primary, #0f172a); }

.detail-date-icon { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.7; }

/* HABS donut */
.habs-donut {
  position: relative;
  width: 140px;
  height: 140px;
}

.habs-donut svg { width: 100%; height: 100%; display: block; }
.habs-donut-track { color: rgb(148 163 184 / 0.18); }

.habs-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.habs-donut-value {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text-primary, #0f172a);
}

.habs-donut-label {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--color-text-muted, #94a3b8);
  margin-top: 0.25rem;
}

.detail-verdict-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
}

.detail-verdict-tag {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.3125rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--color-divider-soft, rgb(226 232 240));
  background: rgb(148 163 184 / 0.08);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary, #64748b);
}

.detail-pills { max-width: 28rem; margin: 0 auto; width: 100%; }

/* Rich insight cards */
.insight-rich-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) { .insight-rich-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .insight-rich-grid { grid-template-columns: repeat(3, 1fr); } }

.insight-rich-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--color-divider-soft, rgb(226 232 240));
  background: var(--color-bg-elevated, #fff);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.insight-rich-card:hover {
  border-color: rgb(99 102 241 / 0.3);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.06);
}

.insight-rich-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.insight-rich-title { display: flex; align-items: center; gap: 0.5rem; }
.insight-rich-title h3 {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--color-text-primary, #0f172a);
}

.insight-rich-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 0.625rem;
}

.insight-rich-icon-svg { width: 17px; height: 17px; }

.insight-pillar-cognition .insight-rich-icon { background: rgb(99 102 241 / 0.12); color: #6366f1; }
.insight-pillar-emotion .insight-rich-icon { background: rgb(236 72 153 / 0.12); color: #ec4899; }
.insight-pillar-decision .insight-rich-icon { background: rgb(139 92 246 / 0.12); color: #8b5cf6; }

.insight-rich-score { font-size: 1.0625rem; font-weight: 800; }
.insight-rich-score-suffix,
.insight-ring-suffix { font-size: 0.6875rem; font-weight: 700; opacity: 0.6; margin-left: 1px; }

/* tone */
.insight-tone-pos { color: #10b981; }
.insight-tone-good { color: #3b82f6; }
.insight-tone-warn { color: #f59e0b; }
.insight-tone-neg { color: #f97316; }

.insight-rich-viz { display: flex; justify-content: center; padding: 0.25rem 0; }

.insight-ring { position: relative; width: 96px; height: 96px; }
.insight-ring svg { width: 100%; height: 100%; }
.insight-ring-track { fill: none; stroke: rgb(148 163 184 / 0.18); stroke-width: 8; }
.insight-ring-fill { fill: none; stroke: currentColor; stroke-width: 8; transition: stroke-dasharray 0.4s ease; }

.insight-ring-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.insight-ring-value { font-size: 1.5rem; font-weight: 800; color: var(--color-text-primary, #0f172a); }

.insight-rich-perf { font-size: 0.875rem; font-weight: 700; }
.insight-rich-narrative {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-secondary, #64748b);
}

.insight-rich-callout {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary, #64748b);
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  background: rgb(148 163 184 / 0.1);
}

.insight-benchmark { margin-top: auto; padding-top: 0.25rem; }
.insight-benchmark-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  margin-bottom: 0.375rem;
}
.insight-benchmark-label { color: var(--color-text-muted, #94a3b8); font-weight: 600; }
.insight-benchmark-value { margin-left: auto; font-weight: 700; color: var(--color-text-primary, #0f172a); }
.insight-delta-pos { color: #3b82f6; font-weight: 700; }
.insight-delta-neg { color: #6366f1; font-weight: 700; }

.insight-benchmark-track {
  position: relative;
  height: 8px;
  border-radius: 9999px;
  background: rgb(148 163 184 / 0.18);
}
.insight-benchmark-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, #818cf8, #6366f1);
}
.insight-benchmark-marker {
  position: absolute; top: -2px; width: 2px; height: 12px;
  background: var(--color-text-primary, #0f172a);
  border-radius: 2px;
  transform: translateX(-1px);
}

/* Scroll cue */
.detail-scroll-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 0;
}
.detail-scroll-icon { width: 16px; height: 16px; animation: scroll-bounce 1.6s ease-in-out infinite; }
@keyframes scroll-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* Insight curves */
.detail-curves { display: flex; flex-direction: column; gap: 1rem; }
.detail-curves-canvas {
  border-radius: 1rem;
  border: 1px solid var(--color-divider-soft, rgb(226 232 240));
  background: var(--color-bg-elevated, #fff);
  padding: 1rem;
}
.insight-curves-loading { color: var(--color-text-muted, #94a3b8); font-size: 0.8125rem; padding: 2rem; text-align: center; }

.insight-curves-section-title {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted, #94a3b8);
  margin-bottom: 0.5rem;
}
.insight-curves-section-title--summary { margin-top: 0.75rem; }
.insight-curves-section-title--frames { margin-top: 0.75rem; }

.insight-curves-chart-wrap { position: relative; height: 320px; }
.insight-curves-chart-main { margin-bottom: 0.25rem; }

/* Summary strip: dashed chart + peak frame thumbnail */
.insight-summary-strip {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 0.25rem;
}
.insight-summary-chart-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 140px;
}
.insight-peak-frame {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.insight-peak-frame:empty { display: none; }
.insight-peak-frame img {
  max-width: 100%;
  max-height: 120px;
  border-radius: 0.375rem;
  border: 2px solid #1a1a2e;
  display: block;
}
.insight-peak-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-text-secondary, #64748b);
  font-family: ui-monospace, monospace;
}

/* Frame timeline strip */
.insight-timeline {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0.5rem 0 0.25rem;
  position: relative;
  scrollbar-width: thin;
}
.insight-timeline:empty { display: none; }
.insight-timeline-empty {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #94a3b8);
  padding: 0.5rem 0;
}
.insight-timeline-thumb {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1875rem;
  position: relative;
}
.insight-timeline-thumb img {
  width: 100%;
  height: auto;
  border-radius: 3px;
  border: 1px solid var(--color-divider-soft, rgb(226 232 240));
  display: block;
  cursor: crosshair;
  transition: border-color 0.12s;
}
.insight-timeline-thumb:hover { z-index: 20; }
.insight-timeline-thumb:hover img { border-color: var(--color-cognition, #6366f1); }
.insight-timeline-label {
  font-size: 0.625rem;
  color: var(--color-text-muted, #94a3b8);
  font-family: ui-monospace, monospace;
  white-space: nowrap;
}

/* Hover magnification loupe */
.insight-frame-loupe {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  width: 280px;
  border-radius: 0.5rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), 0 0 0 2px var(--color-cognition, #6366f1);
  overflow: hidden;
  background: #000;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.insight-frame-loupe.visible { opacity: 1; }
.insight-frame-loupe img { width: 100%; height: auto; display: block; }
.insight-frame-loupe-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-family: ui-monospace, monospace;
  font-size: 0.6875rem;
  text-align: center;
}

.insight-curves-legend {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1rem;
  margin-top: 0.875rem; padding-top: 0.875rem;
  border-top: 1px solid var(--color-divider-soft, rgb(226 232 240));
}
.insight-curves-legend-item {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 0.75rem; color: var(--color-text-secondary, #64748b);
}
.insight-curves-dot { width: 12px; height: 12px; border-radius: 9999px; }
.insight-curves-dot-dashed { border-radius: 2px; height: 4px; width: 16px; }

.detail-video-metrics {
  border-radius: 1rem;
  border: 1px solid var(--color-divider-soft, rgb(226 232 240));
  background: rgb(99 102 241 / 0.04);
  padding: 1.25rem;
}
.detail-video-metrics-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9375rem; font-weight: 800;
  color: var(--color-text-primary, #0f172a);
  margin-bottom: 0.625rem;
}
.detail-vm-icon { width: 16px; height: 16px; color: #6366f1; }
.detail-video-metrics-body { font-size: 0.8125rem; line-height: 1.6; color: var(--color-text-secondary, #64748b); }
.detail-video-metrics-body p { margin-bottom: 0.5rem; }
.detail-video-metrics-body ul { list-style: disc; padding-left: 1.25rem; margin-bottom: 0.5rem; }
.detail-video-metrics-body strong { color: var(--color-text-primary, #0f172a); }

/* Rich recommendation / watchout cards */
.rec-section { display: flex; flex-direction: column; gap: 1rem; }
.rec-section-head { text-align: center; display: flex; flex-direction: column; gap: 0.25rem; }
.rec-eyebrow {
  font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: rgb(99 102 241 / 0.85);
}
.rec-section-title { font-size: 1.375rem; font-weight: 800; color: var(--color-text-primary, #0f172a); }
.rec-section-subtitle { font-size: 0.8125rem; color: var(--color-text-muted, #94a3b8); }

.rec-list { display: flex; flex-direction: column; gap: 0.875rem; }

.rec-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--color-divider-soft, rgb(226 232 240));
  background: var(--color-bg-elevated, #fff);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rec-card:hover { box-shadow: 0 8px 24px rgb(15 23 42 / 0.06); }

.rec-card-icon {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 0.75rem;
  background: rgb(99 102 241 / 0.1); color: #6366f1;
}
.rec-card-watchout .rec-card-icon { background: rgb(244 63 94 / 0.1); color: #f43f5e; }
.rec-card-icon-svg { width: 19px; height: 19px; }

.rec-card-body { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.rec-card-head { display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap; }
.rec-card-title { font-size: 0.9375rem; font-weight: 800; color: var(--color-text-primary, #0f172a); }
.rec-card-detail { font-size: 0.8125rem; line-height: 1.5; color: var(--color-text-secondary, #64748b); }

.rec-prio {
  font-size: 0.625rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.1875rem 0.5rem; border-radius: 9999px;
}
.rec-prio-high { background: rgb(244 63 94 / 0.12); color: #e11d48; }
.rec-prio-medium { background: rgb(245 158 11 / 0.14); color: #d97706; }
.rec-prio-low { background: rgb(148 163 184 / 0.16); color: #64748b; }

.rec-card-foot { margin-top: 0.125rem; }
.rec-impact {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  padding: 0.25rem 0.625rem; border-radius: 9999px;
}
.rec-impact-pos { background: rgb(99 102 241 / 0.1); color: #6366f1; }
.rec-impact-neg { background: rgb(244 63 94 / 0.1); color: #e11d48; }

.dark .insight-rich-card,
.dark .rec-card,
.dark .detail-hero,
.dark .detail-curves-canvas {
  border-color: rgb(255 255 255 / 0.08);
}

/* Login standalone (no shell) */
.login-view {
  min-height: 100vh;
}

/* ── Analyse upload flow ─────────────────────────────────────────────────── */
.cos-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  border: 1.5px dashed rgb(148 163 184 / 0.55);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cos-dropzone:hover,
.cos-dropzone-active {
  border-color: #6366f1;
  background: rgb(99 102 241 / 0.05);
}
.cos-dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  color: #6366f1;
  background: rgb(99 102 241 / 0.1);
}
.dark .cos-dropzone { border-color: rgb(255 255 255 / 0.14); }

.cos-progress-track {
  height: 0.5rem;
  width: 100%;
  border-radius: 9999px;
  background: rgb(148 163 184 / 0.2);
  overflow: hidden;
}
.cos-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: #6366f1;
  transition: width 0.2s ease;
}

.cos-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  border: 2px solid rgb(99 102 241 / 0.3);
  border-top-color: #6366f1;
  animation: cos-spin 0.7s linear infinite;
}
@keyframes cos-spin {
  to { transform: rotate(360deg); }
}

/* ── PDF export (off-screen clone) ───────────────────────────────────────── */
.pdf-export-root {
  --color-bg-base: #f7f7fb;
  --color-bg-elevated: #ffffff;
  --color-text-primary: #0f172a;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-divider-soft: rgb(148 163 184 / 0.35);
  background: #ffffff;
  color: #0f172a;
  font-family: Manrope, var(--font-sans), ui-sans-serif, system-ui;
}

.pdf-export-root .insight-rich-card,
.pdf-export-root .rec-card,
.pdf-export-root .detail-hero,
.pdf-export-root .detail-curves-canvas,
.pdf-export-root .border-divider-soft.bg-bg-elevated {
  background: #ffffff;
  border-color: rgb(148 163 184 / 0.35);
  color: #0f172a;
}

.pdf-export-root .text-text-primary { color: #0f172a; }
.pdf-export-root .text-text-secondary { color: #64748b; }
.pdf-export-root .text-text-muted { color: #94a3b8; }

.pdf-export-root .insight-rich-card,
.pdf-export-root .detail-hero,
.pdf-export-root .rec-card {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pdf-export-root .detail-curves-canvas img {
  max-width: 100%;
  height: auto;
}
