/* ============================================================
   VERILUX MUSIC — P&L Dashboard Styles
   Art direction: Dark studio / neon-violet accent, space grotesque
   ============================================================ */

/* ── Design Tokens ── */
:root,
[data-theme='light'] {
  /* Type scale */
  --text-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Transitions */
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Light palette — slightly warm neutral */
  --color-bg:             #f5f4f0;
  --color-surface:        #fafaf7;
  --color-surface-2:      #ffffff;
  --color-surface-offset: #ededea;
  --color-border:         #d8d6d0;
  --color-divider:        #e2e0da;
  --color-text:           #1a1818;
  --color-text-muted:     #6b6a66;
  --color-text-faint:     #b0afa9;
  --color-text-inverse:   #f5f4f0;

  /* Accent — electric violet (music/creative energy) */
  --color-accent:         #7c3aed;
  --color-accent-hover:   #6d28d9;
  --color-accent-active:  #5b21b6;
  --color-accent-glow:    rgba(124, 58, 237, 0.18);
  --color-accent-subtle:  #ede9fe;

  /* Semantic */
  --color-success:        #16a34a;
  --color-success-bg:     #dcfce7;
  --color-danger:         #dc2626;
  --color-danger-bg:      #fee2e2;
  --color-warning:        #d97706;
  --color-warning-bg:     #fef3c7;

  /* Chart colors */
  --chart-revenue:   #7c3aed;
  --chart-spend:     #e11d48;
  --chart-cumrev:    #0891b2;
  --chart-cumspend:  #f59e0b;
  --chart-net:       #16a34a;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);

  /* Fonts */
  --font-body:    'Space Grotesk', 'Helvetica Neue', sans-serif;
  --font-mono:    'Space Mono', 'Courier New', monospace;
  --font-display: 'Space Grotesk', 'Helvetica Neue', sans-serif;

  /* Content widths */
  --content-wide: 1440px;
}

[data-theme='dark'] {
  --color-bg:             #0d0c0f;
  --color-surface:        #131117;
  --color-surface-2:      #17151c;
  --color-surface-offset: #1c1921;
  --color-border:         #2e2a36;
  --color-divider:        #252230;
  --color-text:           #e8e6ef;
  --color-text-muted:     #7a7688;
  --color-text-faint:     #4a4658;
  --color-text-inverse:   #0d0c0f;

  --color-accent:         #a78bfa;
  --color-accent-hover:   #c4b5fd;
  --color-accent-active:  #7c3aed;
  --color-accent-glow:    rgba(167, 139, 250, 0.15);
  --color-accent-subtle:  #1e1a2e;

  --color-success:        #4ade80;
  --color-success-bg:     #052e16;
  --color-danger:         #f87171;
  --color-danger-bg:      #3b0a0a;
  --color-warning:        #fbbf24;
  --color-warning-bg:     #2d1b00;

  --chart-revenue:   #a78bfa;
  --chart-spend:     #fb7185;
  --chart-cumrev:    #38bdf8;
  --chart-cumspend:  #fbbf24;
  --chart-net:       #4ade80;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #0d0c0f;
    --color-surface:        #131117;
    --color-surface-2:      #17151c;
    --color-surface-offset: #1c1921;
    --color-border:         #2e2a36;
    --color-divider:        #252230;
    --color-text:           #e8e6ef;
    --color-text-muted:     #7a7688;
    --color-text-faint:     #4a4658;
    --color-text-inverse:   #0d0c0f;
    --color-accent:         #a78bfa;
    --color-accent-hover:   #c4b5fd;
    --color-accent-active:  #7c3aed;
    --color-accent-glow:    rgba(167, 139, 250, 0.15);
    --color-accent-subtle:  #1e1a2e;
    --color-success:        #4ade80;
    --color-success-bg:     #052e16;
    --color-danger:         #f87171;
    --color-danger-bg:      #3b0a0a;
    --color-warning:        #fbbf24;
    --color-warning-bg:     #2d1b00;
    --chart-revenue:   #a78bfa;
    --chart-spend:     #fb7185;
    --chart-cumrev:    #38bdf8;
    --chart-cumspend:  #fbbf24;
    --chart-net:       #4ade80;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  }
}

/* ── Base Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--space-16) + 44px); /* account for both sticky bars */
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
input, select { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.2; }
a, button, input, select { transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), opacity var(--transition); }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: var(--radius-sm); }
::selection { background: var(--color-accent-glow); color: var(--color-text); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Layout ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 101;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Sticky Control Bar ── */
.sticky-control-bar {
  position: sticky;
  /* top will be set by JS once we know header height; fallback here */
  top: 53px;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-divider);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.sticky-control-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-2) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
/* Scenario tabs inside control bar — flat variant (no bottom-border rounding trick) */
.sticky-control-bar .scenario-tab {
  border-radius: var(--radius-md);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-3) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-lockup { display: flex; align-items: center; gap: var(--space-3); }
.logo-mark {
  width: 36px;
  height: 36px;
  color: var(--color-text);
  flex-shrink: 0;
}
.logo-text { display: flex; flex-direction: column; gap: 0; line-height: 1.1; }
.logo-brand {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.logo-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.header-actions { display: flex; align-items: center; gap: var(--space-3); }
.badge-private {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border-radius: var(--radius-full, 9999px);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.theme-btn:hover { color: var(--color-text); background: var(--color-surface-offset); }

.main-content {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-8) var(--space-8) var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

/* ── Section Headers ── */
.section-header { margin-bottom: var(--space-6); }
.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.section-title svg { color: var(--color-accent); flex-shrink: 0; }
.section-desc {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ── Assumptions Collapse ── */
.assumptions-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  cursor: pointer;
}
.collapse-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
  border-color: var(--color-accent);
}
.collapse-btn .chevron-icon {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}
.collapse-btn[aria-expanded="false"] .chevron-icon {
  transform: rotate(180deg);
}

#assumptions-body {
  overflow: hidden;
  transition: max-height 0.38s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  max-height: 2000px; /* large enough to show full content */
  opacity: 1;
}
#assumptions-body.collapsed {
  max-height: 0;
  opacity: 0;
}

/* ── Assumptions Section ── */
.assumptions-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}
.assumptions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
@media (max-width: 1100px) { .assumptions-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .assumptions-grid { grid-template-columns: 1fr; } }

.assumption-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.card-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}
.input-group:last-child { margin-bottom: 0; }
.input-group label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  line-height: 1.3;
}
.input-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.input-row input[type="number"] {
  flex: 1;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  min-width: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.input-row input[type="number"]::-webkit-inner-spin-button,
.input-row input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.input-row input:focus { outline: 2px solid var(--color-accent); border-color: var(--color-accent); }
.unit {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  white-space: nowrap;
  min-width: 48px;
}
.recalc-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
/* ── Scenario tabs (inside assumptions section header) ── */
.scenario-tabs {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  flex-shrink: 0;
}
.scenario-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-5);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all var(--transition);
  min-width: 110px;
}
.scenario-tab:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}
.scenario-tab.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}
.scenario-tab-label {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.scenario-tab-sub {
  font-size: var(--text-xs);
  font-weight: 400;
  opacity: 0.8;
}
.scenario-tab.active .scenario-tab-sub {
  opacity: 0.9;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 0 20px var(--color-accent-glow);
}
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-secondary:hover {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent-hover);
}
.btn-secondary.saved {
  color: var(--color-success);
  border-color: var(--color-success);
  background: transparent;
}
[data-theme='dark'] .btn-secondary.saved {
  color: #4ade80;
  border-color: #4ade80;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-ghost:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
  background: var(--color-surface-offset);
}

.auto-calc-note {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-style: italic;
}

/* ── KPI Section ── */
.kpi-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}
.kpi-section .section-header { margin-bottom: 0; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.kpi-card.kpi-highlight {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  box-shadow: 0 0 24px var(--color-accent-glow);
}
.kpi-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
}
.kpi-value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: var(--space-1) 0;
}
.kpi-card.kpi-highlight .kpi-value { color: var(--color-accent); }
.kpi-value.positive { color: var(--color-success); }
.kpi-value.negative { color: var(--color-danger); }
.kpi-sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.4;
}

/* ── Period Toggles ── */
.period-toggle-group {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.period-toggle-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: var(--space-1);
}
.period-btn {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full, 9999px);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.period-btn:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
  border-color: var(--color-accent);
}
.period-btn.active {
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
}

/* ── KPI Section Header ── */
.kpi-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.kpi-period-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  border-radius: var(--radius-full, 9999px);
  padding: 1px 6px;
  margin-left: var(--space-1);
  vertical-align: middle;
}

/* ── Assumption Label Hints ── */
.label-hint {
  display: block;
  font-size: 0.68rem;
  color: var(--color-text-faint);
  font-style: italic;
  margin-top: 2px;
  line-height: 1.3;
  max-width: 100%;
}

/* ── Chart Controls (period + series toggles) ── */
.chart-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
}
@media (max-width: 720px) {
  .chart-controls { align-items: flex-start; }
}

/* ── Chart Section ── */
.chart-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}
.chart-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.chart-legend-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.legend-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full, 9999px);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  transition: all var(--transition);
}
.legend-btn.active { color: var(--color-text); background: var(--color-surface-offset); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.chart-container {
  position: relative;
  height: 360px;
  margin-top: var(--space-6);
}

/* ── Table Section ── */
.table-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  margin-top: var(--space-6);
}
.pl-table {
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  min-width: 1200px;
}
.pl-table th {
  background: var(--color-surface-offset);
  padding: var(--space-3) var(--space-3);
  text-align: right;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  line-height: 1.3;
}
.pl-table th:first-child { text-align: center; }
.pl-table td {
  padding: var(--space-2) var(--space-3);
  text-align: right;
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.pl-table td:first-child {
  text-align: center;
  font-weight: 700;
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  border-right: 1px solid var(--color-border);
  position: sticky;
  left: 0;
}
.pl-table tbody tr:hover td { background: var(--color-surface-offset); }
.pl-table tbody tr:hover td:first-child { background: var(--color-surface-offset); }
.pl-table tfoot td {
  font-weight: 700;
  background: var(--color-surface-2);
  border-top: 2px solid var(--color-accent);
  color: var(--color-text);
}
.pl-table tfoot td:first-child {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}
td.positive { color: var(--color-success) !important; font-weight: 600; }
td.negative { color: var(--color-danger) !important; font-weight: 600; }
td.breakeven-row td { background: color-mix(in srgb, var(--color-success-bg) 30%, transparent) !important; }
tr.breakeven-row td { background: color-mix(in srgb, var(--color-success-bg) 15%, var(--color-surface)) !important; }
tr.breakeven-row td:first-child { background: var(--color-success-bg) !important; color: var(--color-success) !important; }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: var(--space-8);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-divider);
}

/* ── Utility ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full, 9999px);
}

/* ── Spotify Integration Styles ─────────────────────────────────────────── */
:root {
  --color-spotify: #1DB954;
  --color-spotify-dark: #158a3e;
}

/* Real Data tab — Spotify green accent */
.scenario-tab-spotify {
  border-color: transparent !important;
}
.scenario-tab-spotify:hover {
  border-color: var(--color-spotify) !important;
  color: var(--color-spotify) !important;
}
.scenario-tab-spotify.active {
  background: color-mix(in srgb, var(--color-spotify) 15%, transparent) !important;
  border-color: var(--color-spotify) !important;
  color: var(--color-spotify) !important;
}

/* Spotify panel — full-width section below main */
.spotify-panel {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) var(--space-8);
}
.spotify-panel-inner {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

/* States */
.spotify-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
}
.spotify-state-icon { margin-bottom: var(--space-2); }
.spotify-state-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}
.spotify-state-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  max-width: 520px;
  margin: 0;
  line-height: 1.6;
}
.spotify-data-note {
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 25%, transparent);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  max-width: 520px;
  text-align: left;
  line-height: 1.6;
}

/* Connect button */
.btn-spotify-connect {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-spotify);
  color: #000;
  font-weight: 700;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  border: none;
  border-radius: 999px;
  padding: var(--space-3) var(--space-6);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.02em;
}
.btn-spotify-connect:hover {
  background: #1ed760;
  transform: scale(1.02);
}

/* Apply button */
.btn-spotify-apply {
  background: var(--color-spotify);
  color: #000;
  font-weight: 700;
  font-size: var(--text-sm);
  font-family: var(--font-body);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-6);
  cursor: pointer;
  transition: background 0.15s;
  margin-top: var(--space-2);
}
.btn-spotify-apply:hover { background: #1ed760; }

/* Text / link button */
.btn-text {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--font-body);
  padding: 0;
}
.btn-text:hover { color: var(--color-text-primary); }

/* Artist list */
.spotify-artist-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  max-width: 480px;
}
.spotify-artist-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
}
.spotify-artist-card:hover {
  border-color: var(--color-spotify);
  background: color-mix(in srgb, var(--color-spotify) 8%, var(--color-surface-alt));
}
.spotify-artist-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-border);
}
.spotify-artist-card-info { flex: 1; }
.spotify-artist-card-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}
.spotify-artist-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* Connected header */
.spotify-connected-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  text-align: left;
}
.spotify-artist-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-spotify);
}
.spotify-disconnect {
  margin-left: auto;
  color: var(--color-danger) !important;
}

/* Assumptions preview */
.spotify-assumptions-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-3);
  width: 100%;
  margin-top: var(--space-2);
}
.spotify-assumption-chip {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.spotify-assumption-chip-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}
.spotify-assumption-chip-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-spotify);
  font-family: var(--font-mono);
}
.spotify-assumption-chip-source {
  font-size: 10px;
  color: var(--color-text-muted, var(--color-text-secondary));
  opacity: 0.7;
  margin-top: 2px;
}

/* Spinner */
.spotify-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-spotify);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Spotify manual overrides ─────────────────────────────────────────────── */
.spotify-manual-overrides {
  width: 100%;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-2);
}
.spotify-override-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}
.spotify-override-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.spotify-override-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 140px;
}
.spotify-override-field label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}
.spotify-override-field input {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  width: 100%;
}
.spotify-override-field input:focus {
  outline: none;
  border-color: var(--color-spotify);
}
.spotify-override-hint {
  font-size: 11px;
  color: var(--color-text-secondary);
  opacity: 0.7;
  margin-top: var(--space-3);
  margin-bottom: 0;
  line-height: 1.5;
}
.spotify-override-hint a {
  color: var(--color-spotify);
  text-decoration: none;
}
.spotify-override-hint a:hover { text-decoration: underline; }
