/* ===== DESIGN TOKENS — GoTo Foods Brand ===== */
:root {
  --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);

  --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;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

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

  /* GoTo Foods brand typography — bold, clean, modern */
  --font-display: 'Cabinet Grotesk', 'Helvetica Neue', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;

  --sidebar-width: 224px;
  --topbar-height: 60px;

  /* GoTo Foods brand primaries — always available */
  --goto-red:    #C8102E;
  --goto-red-dk: #A00D24;
  --goto-black:  #1A1A1A;
  --goto-cream:  #F5F0EB;
}

/* ===== LIGHT MODE — GoTo Foods ===== */
:root, [data-theme="light"] {
  --color-bg:             #F5F0EB;
  --color-surface:        #FFFFFF;
  --color-surface-2:      #FBF8F5;
  --color-surface-offset: #EDE9E3;
  --color-divider:        #DDD8D1;
  --color-border:         #CCC7BF;

  --color-text:           #1A1A1A;
  --color-text-muted:     #6B6560;
  --color-text-faint:     #B0AAA4;
  --color-text-inverse:   #FFFFFF;

  /* GoTo crimson red as primary */
  --color-primary:        #C8102E;
  --color-primary-hover:  #A00D24;
  --color-primary-active: #7C0A1C;
  --color-primary-highlight: #FADFDF;

  --color-success:        #1D7A3A;
  --color-success-bg:     #E4F5E9;
  --color-warning:        #B45309;
  --color-warning-bg:     #FEF3C7;
  --color-notification:   #C8102E;
  --color-notification-bg: #FADFDF;
  --color-blue:           #1A5FAD;
  --color-blue-bg:        #DBEAFE;
  --color-orange:         #D97706;
  --color-purple:         #6D28D9;

  --shadow-sm: 0 1px 3px rgba(26,26,26,0.08);
  --shadow-md: 0 4px 12px rgba(26,26,26,0.1);
  --shadow-lg: 0 12px 32px rgba(26,26,26,0.14);
}

/* ===== DARK MODE — GoTo Foods ===== */
[data-theme="dark"] {
  /* Deep warm near-black — GoTo brand dark */
  --color-bg:             #100C0D;
  --color-surface:        #1C1416;
  --color-surface-2:      #241A1C;
  --color-surface-offset: #2A1E20;
  --color-divider:        #332427;
  --color-border:         #44302F;

  --color-text:           #F0EAE5;
  --color-text-muted:     #9A8D89;
  --color-text-faint:     #5A4A48;
  --color-text-inverse:   #100C0D;

  /* GoTo crimson red — slightly brightened for dark bg legibility */
  --color-primary:        #E8193A;
  --color-primary-hover:  #C8102E;
  --color-primary-active: #A00D24;
  --color-primary-highlight: #3D0E15;

  --color-success:        #4ADE80;
  --color-success-bg:     #052E16;
  --color-warning:        #FBBF24;
  --color-warning-bg:     #1C1408;
  --color-notification:   #F87171;
  --color-notification-bg: #2A0A0A;
  --color-blue:           #60A5FA;
  --color-blue-bg:        #0C1F3A;
  --color-orange:         #FB923C;
  --color-purple:         #A78BFA;

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

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #100C0D;
    --color-surface:        #1C1416;
    --color-surface-2:      #241A1C;
    --color-surface-offset: #2A1E20;
    --color-divider:        #332427;
    --color-border:         #44302F;
    --color-text:           #F0EAE5;
    --color-text-muted:     #9A8D89;
    --color-text-faint:     #5A4A48;
    --color-text-inverse:   #100C0D;
    --color-primary:        #E8193A;
    --color-primary-hover:  #C8102E;
    --color-primary-active: #A00D24;
    --color-primary-highlight: #3D0E15;
    --color-success:        #4ADE80;
    --color-success-bg:     #052E16;
    --color-warning:        #FBBF24;
    --color-warning-bg:     #1C1408;
    --color-notification:   #F87171;
    --color-notification-bg: #2A0A0A;
    --color-blue:           #60A5FA;
    --color-blue-bg:        #0C1F3A;
    --color-orange:         #FB923C;
    --color-purple:         #A78BFA;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.65);
  }
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a { text-decoration: none; color: inherit; }
table { border-collapse: collapse; width: 100%; }
input, select { font: inherit; color: inherit; background: transparent; border: none; outline: none; }

/* ===== DASHBOARD SHELL ===== */
.dashboard-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100dvh;
  overflow: hidden;
}

.dashboard-shell.sidebar-collapsed {
  grid-template-columns: 56px 1fr;
}

/* ===== SIDEBAR — GoTo Foods dark brand rail ===== */
.sidebar {
  background: var(--color-surface-offset);
  border-right: 1px solid var(--color-divider);
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: var(--space-4);
  transition: width var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid rgba(200,16,46,0.2);
  min-height: var(--topbar-height);
  background: var(--color-surface-offset);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--color-text);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.sidebar-toggle {
  color: var(--color-text-faint);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--color-text); background: var(--color-surface-2); }

.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: rgba(200,16,46,0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-item:hover { color: var(--color-text); background: var(--color-surface-2); }
.nav-item.active { color: #FFFFFF; background: #C8102E; }
.nav-item i { flex-shrink: 0; }

/* Brand filters */
.brand-filters {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-2);
}

.brand-chip {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.brand-chip:hover { color: var(--color-text); background: var(--color-surface-2); }
.brand-chip.active { color: #FFFFFF; background: #C8102E; }

.sidebar-bottom {
  padding: 0 var(--space-2);
  margin-top: auto;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  width: 100%;
  transition: color var(--transition), background var(--transition);
}
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-2); }

/* Collapsed sidebar */
.dashboard-shell.sidebar-collapsed .sidebar-brand,
.dashboard-shell.sidebar-collapsed .sidebar-section-label,
.dashboard-shell.sidebar-collapsed .nav-item span,
.dashboard-shell.sidebar-collapsed .brand-chip,
.dashboard-shell.sidebar-collapsed .theme-toggle span {
  display: none;
}
.dashboard-shell.sidebar-collapsed .nav-item,
.dashboard-shell.sidebar-collapsed .theme-toggle {
  justify-content: center;
  padding: var(--space-2);
}
.dashboard-shell.sidebar-collapsed .sidebar-header {
  justify-content: center;
}
.dashboard-shell.sidebar-collapsed .sidebar-toggle { display: none; }

/* ===== MAIN AREA ===== */
.main-area {
  display: grid;
  grid-template-rows: var(--topbar-height) 1fr;
  height: 100dvh;
  overflow: hidden;
}

/* ===== TOPBAR ===== */
.topbar {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.page-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.filter-select {
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--transition);
}
.filter-select:hover { border-color: var(--color-primary); }

.btn-primary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--color-primary-hover); }

/* ===== MAIN SCROLL ===== */
.main-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* ===== PAGES ===== */
.page { display: none; flex-direction: column; gap: var(--space-5); }
.page.active { display: flex; }

/* ===== KPI ROW ===== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); border-top-color: var(--color-primary-hover); }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

.kpi-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.kpi-badge.positive { background: var(--color-success-bg); color: var(--color-success); }
.kpi-badge.neutral  { background: var(--color-warning-bg); color: var(--color-warning); }
.kpi-badge.negative { background: var(--color-notification-bg); color: var(--color-notification); }

.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  margin-bottom: var(--space-1);
}

.kpi-sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}

.kpi-spark {
  height: 40px !important;
  width: 100% !important;
}

/* ===== CHART GRID ===== */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}

.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.chart-card:hover { box-shadow: var(--shadow-md); }

.chart-card.wide {
  grid-column: span 2;
}

@media (max-width: 1100px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card.wide { grid-column: span 1; }
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-4);
}

.chart-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.chart-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: var(--space-1);
}

.chart-wrap {
  height: 240px;
  position: relative;
}

/* ===== DATA TABLE ===== */
.data-table {
  width: 100%;
  font-size: var(--text-xs);
}

.data-table thead th {
  text-align: left;
  color: var(--color-text-faint);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-divider);
}

.data-table tbody tr {
  border-bottom: 1px solid var(--color-divider);
  transition: background var(--transition);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--color-surface-offset); }

.data-table tbody td {
  padding: var(--space-3);
  color: var(--color-text);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

/* ===== SENTIMENT BAR ===== */
.sentiment-bar {
  display: flex;
  height: 6px;
  border-radius: var(--radius-full);
  overflow: hidden;
  gap: 1px;
  width: 80px;
}
.sentiment-bar-pos { background: var(--color-success); }
.sentiment-bar-neu { background: var(--color-warning); }
.sentiment-bar-neg { background: var(--color-notification); }

/* ===== SCORE BADGE ===== */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 20px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-high   { background: var(--color-success-bg); color: var(--color-success); }
.score-medium { background: var(--color-warning-bg); color: var(--color-warning); }
.score-low    { background: var(--color-notification-bg); color: var(--color-notification); }

/* ===== TOPIC HEATMAP ===== */
.topic-heatmap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-2);
}

.topic-tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: default;
  transition: transform var(--transition), box-shadow var(--transition);
}
.topic-tag:hover { transform: scale(1.06); box-shadow: var(--shadow-md); }
.topic-tag.t-pos { background: var(--color-success-bg); color: var(--color-success); }
.topic-tag.t-neu { background: var(--color-warning-bg); color: var(--color-warning); }
.topic-tag.t-neg { background: var(--color-notification-bg); color: var(--color-notification); }

/* ===== AGGREGATOR CARDS ===== */
.aggregator-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

.aggregator-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-offset);
}

.aggregator-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: white;
}

.aggregator-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
}

.aggregator-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 1px;
}

.aggregator-stars {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-warning);
  font-variant-numeric: tabular-nums;
}

.aggregator-issues {
  font-size: 11px;
  color: var(--color-notification);
  background: var(--color-notification-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ===== TOPIC BUBBLES ===== */
.topic-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  padding-top: var(--space-2);
  min-height: 140px;
}

.topic-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-weight: 700;
  color: white;
  cursor: default;
  transition: transform var(--transition);
}
.topic-bubble:hover { transform: scale(1.08); }

/* ===== RATING BARS ===== */
.rating-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

.rating-row {
  display: grid;
  grid-template-columns: 24px 1fr 48px;
  align-items: center;
  gap: var(--space-3);
}

.rating-star {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  text-align: right;
}

.rating-bar-wrap {
  height: 8px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-warning);
  transition: width 0.8s ease;
}

.rating-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ===== REVIEW FEED ===== */
.review-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.review-card {
  background: var(--color-surface-offset);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border-left: 3px solid transparent;
  transition: box-shadow var(--transition);
}
.review-card:hover { box-shadow: var(--shadow-md); }
.review-card.pos { border-left-color: var(--color-success); }
.review-card.neu { border-left-color: var(--color-warning); }
.review-card.neg { border-left-color: var(--color-notification); }

.review-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.review-platform {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-muted);
}

.review-brand {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
}

.review-stars {
  font-size: 11px;
  color: var(--color-warning);
  margin-left: auto;
}

.review-date {
  font-size: 11px;
  color: var(--color-text-faint);
}

.review-text {
  font-size: var(--text-xs);
  color: var(--color-text);
  line-height: 1.6;
  max-width: 72ch;
}

.review-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.review-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-weight: 600;
}

/* ===== IMPACT METRICS ===== */
.opportunity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.opportunity-item {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-offset);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}
.opportunity-item:hover { box-shadow: var(--shadow-md); }

.opp-rank {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-primary);
  text-align: center;
  line-height: 1;
}

.opp-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.opp-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.opp-impact {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}
.opp-impact.high { background: var(--color-success-bg); color: var(--color-success); }
.opp-impact.med  { background: var(--color-warning-bg); color: var(--color-warning); }
.opp-impact.low  { background: var(--color-blue-bg); color: var(--color-blue); }

.opp-roi {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text);
  text-align: right;
  white-space: nowrap;
}
.opp-roi small {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* ===== PRIORITY BADGE ===== */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.priority-badge.critical { background: var(--color-notification-bg); color: var(--color-notification); }
.priority-badge.high     { background: var(--color-warning-bg); color: var(--color-warning); }
.priority-badge.medium   { background: var(--color-blue-bg); color: var(--color-blue); }
.priority-badge.low      { background: var(--color-success-bg); color: var(--color-success); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-faint); }

/* ===== ATTRIBUTION ===== */
.pplx-attribution {
  padding: var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-divider);
  margin-top: var(--space-8);
}
.pplx-attribution a { color: var(--color-primary); }

/* ===== DATA DICTIONARY ===== */
.dict-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-primary);
}

.dict-h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  line-height: 1.2;
}

.dict-lead {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: 72ch;
}

.dict-refresh-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}

.dict-section-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
  margin-bottom: var(--space-1);
}

/* Source grid */
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}

.source-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.source-card:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary); }

.source-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.source-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.source-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.source-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-top: 1px;
}

.source-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: var(--space-3);
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.source-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
}

/* Metric table */
.dict-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dict-table td:first-child { font-weight: 700; color: var(--color-primary); }
.dict-table td { font-size: var(--text-xs); vertical-align: top; padding: var(--space-3) var(--space-4); }
.dict-table td:nth-child(3) { font-family: monospace; font-size: 11px; color: var(--color-text-muted); }

/* Methodology */
.dict-method-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.method-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.method-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.method-text strong {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.method-text span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Score tiers */
.score-tier-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.score-tier-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-offset);
}

.tier-badge {
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
}

.tier-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.tier-desc strong { color: var(--color-text); }

/* Channel definitions */
.channel-def-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

.channel-def-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.channel-def-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.channel-def-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-def-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}

.channel-def-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: var(--space-3);
}

.channel-def-sources {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.channel-source-chip {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-weight: 600;
}

/* Competitive sets */
.comp-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.comp-set-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.comp-set-brand {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}

.comp-set-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.comp-set-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.comp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-faint);
  flex-shrink: 0;
}

/* Glossary */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.glossary-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.glossary-term {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.glossary-def {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Disclaimer */
.dict-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* =====================================================
   GEOGRAPHY PAGE
   ===================================================== */

/* Map tooltip */
.map-tooltip {
  position: absolute;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text);
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  min-width: 160px;
}
.map-tooltip strong { display: block; font-size: var(--text-sm); margin-bottom: 4px; color: var(--color-primary); }
.map-tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; color: var(--color-text-muted); }
.map-tooltip .tt-val { color: var(--color-text); font-weight: 600; }

/* US Map SVG */
#usMapContainer svg { width: 100%; height: 100%; }
#usMapContainer .state-path {
  stroke: var(--color-surface);
  stroke-width: 0.8;
  cursor: pointer;
  transition: opacity 0.15s;
}
#usMapContainer .state-path:hover { opacity: 0.75; stroke-width: 1.8; stroke: var(--color-primary); }

/* Geo legend */
.geo-legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.geo-legend-bar {
  width: 120px;
  height: 10px;
  border-radius: 5px;
}
.geo-legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Geo issue list */
.geo-issue-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-1) 0;
}
.geo-issue-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-notification);
}
.geo-issue-item.warn { border-left-color: var(--color-warning); }
.geo-issue-state {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  min-width: 100px;
}
.geo-issue-score {
  font-size: var(--text-xs);
  color: var(--color-notification);
  font-weight: 600;
  min-width: 60px;
}
.geo-issue-item.warn .geo-issue-score { color: var(--color-warning); }
.geo-issue-tag {
  font-size: 10px;
  background: rgba(239,68,68,0.12);
  color: var(--color-notification);
  padding: 2px 8px;
  border-radius: 20px;
}
.geo-issue-item.warn .geo-issue-tag { background: rgba(245,158,11,0.12); color: var(--color-warning); }

/* =====================================================
   CONSUMER JOURNEY PAGE
   ===================================================== */

/* Funnel KPI row */
.journey-funnel-row {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  padding-bottom: 2px;
}
.funnel-step {
  flex: 1;
  min-width: 140px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  position: relative;
  overflow: hidden;
}
.funnel-step::after {
  content: '›';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--color-text-muted);
  z-index: 2;
}
.funnel-step:last-child::after { display: none; }
.funnel-step-stage {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.funnel-step-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 4px;
}
.funnel-step-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.funnel-step-bar {
  height: 3px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}
.funnel-step-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.funnel-step-conv {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Sankey SVG */
#sankeyContainer svg { width: 100%; height: 100%; }
.sankey-node rect {
  rx: 4;
  ry: 4;
  cursor: pointer;
}
.sankey-node text {
  font-family: 'Satoshi', sans-serif;
  font-size: 11px;
  fill: var(--color-text);
}
.sankey-link {
  fill: none;
  opacity: 0.35;
  transition: opacity 0.2s;
}
.sankey-link:hover { opacity: 0.65; }

/* Journey legend */
.journey-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--text-xs);
}
.journey-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
}
.journey-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Drop-off list */
.journey-dropoff-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-1) 0;
}
.dropoff-item {
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}
.dropoff-stages {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.dropoff-stages strong { color: var(--color-text); }
.dropoff-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.dropoff-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}
.dropoff-bar-fill {
  height: 100%;
  border-radius: 3px;
}
.dropoff-pct {
  font-size: var(--text-xs);
  font-weight: 700;
  min-width: 38px;
  text-align: right;
}

/* Friction table */
.journey-friction-table {
  overflow-x: auto;
}
.friction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
}
.friction-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
}
.friction-table td {
  padding: var(--space-2) var(--space-3);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.friction-table tr:last-child td { border-bottom: none; }
.friction-table tr:hover td { background: var(--color-surface-2); }
.friction-table td:first-child { color: var(--color-text); font-weight: 600; }
.friction-severity {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}
.sev-high   { background: rgba(239,68,68,0.15); color: var(--color-notification); }
.sev-medium { background: rgba(245,158,11,0.15); color: #f59e0b; }
.sev-low    { background: rgba(34,197,94,0.15); color: var(--color-success); }

/* Impact pill */
.impact-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.impact-pill.neg { background: rgba(239,68,68,0.12); color: var(--color-notification); }
.impact-pill.pos { background: rgba(34,197,94,0.12); color: var(--color-success); }


/* =====================================================
   COMPETITOR TOPICS DRAWER
   ===================================================== */

.comp-topics-drawer {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  animation: drawerIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes drawerIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.comp-topics-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.comp-topics-identity {
  flex-shrink: 0;
  min-width: 160px;
}

.comp-topics-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}

.comp-topics-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 3px;
}

.comp-topics-insight {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  border-left: 2px solid var(--color-border);
  padding-left: var(--space-4);
  line-height: 1.5;
}

.comp-topics-close {
  flex-shrink: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  transition: background var(--transition), color var(--transition);
}
.comp-topics-close:hover {
  background: var(--color-notification-bg);
  color: var(--color-notification);
  border-color: var(--color-notification);
}

.comp-topics-body {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}

.comp-topics-col {
  flex: 1;
}

.comp-topics-col-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}
.comp-topics-col-label.pos { color: var(--color-success); }
.comp-topics-col-label.neg { color: var(--color-notification); }

.comp-topics-divider {
  width: 1px;
  background: var(--color-border);
  align-self: stretch;
  flex-shrink: 0;
}

.comp-topics-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.comp-topic-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: default;
  transition: transform 0.12s;
}
.comp-topic-tag:hover { transform: scale(1.05); }

.comp-topic-tag.pos {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.comp-topic-tag.neg {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-notification);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.comp-topic-tag .tag-size {
  font-size: 9px;
  opacity: 0.65;
  font-weight: 400;
}

/* Clickable bar cursor hint */
#competitorBar { cursor: pointer; }


/* ============================================================
   CUSTOMER LEAKAGE & MIGRATION PAGE
   ============================================================ */

/* Recommendation cards grid */
.leakage-rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 4px 0 8px;
}

.leakage-rec-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.leakage-rec-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary)22;
}

.leakage-rec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.leakage-rec-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  font-family: var(--font-display);
}

.leakage-rec-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.leakage-rec-badge.high {
  background: rgba(239,68,68,0.15);
  color: var(--color-notification);
  border: 1px solid rgba(239,68,68,0.3);
}

.leakage-rec-badge.medium {
  background: rgba(245,158,11,0.15);
  color: var(--color-warning);
  border: 1px solid rgba(245,158,11,0.3);
}

.leakage-rec-badge.emerging {
  background: rgba(139,92,246,0.15);
  color: var(--color-purple);
  border: 1px solid rgba(139,92,246,0.3);
}

.leakage-rec-momentum {
  font-size: 12px;
  color: var(--color-text-muted);
}

.leakage-rec-momentum strong {
  color: var(--color-text);
  font-weight: 600;
}

.leakage-rec-why {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
}

.leakage-rec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.leakage-rec-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* Steal score pill in table */
.steal-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.steal-pill.high   { background: rgba(239,68,68,0.15);   color: var(--color-notification); }
.steal-pill.medium { background: rgba(245,158,11,0.15);  color: var(--color-warning); }
.steal-pill.low    { background: rgba(74,222,128,0.15);  color: var(--color-success); }

.in-set-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.in-set-chip.yes { background: rgba(56,176,154,0.15); color: var(--color-success); }
.in-set-chip.no  { background: rgba(139,92,246,0.15); color: var(--color-purple); }

/* ============================================================
   MARKETING SIGNAL PAGE
   ============================================================ */

/* Intro banner */
.signal-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.signal-intro-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}
.signal-intro-subtitle {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 640px;
}
.signal-legend {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
}
.signal-legend-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.signal-legend-pill.high     { background: rgba(56,176,154,0.18); color: var(--color-success); border: 1px solid rgba(56,176,154,0.4); }
.signal-legend-pill.moderate { background: rgba(234,179,8,0.15);  color: var(--color-warning); border: 1px solid rgba(234,179,8,0.35); }
.signal-legend-pill.low      { background: rgba(239,68,68,0.12);  color: var(--color-notification); border: 1px solid rgba(239,68,68,0.3); }

/* Category filter tabs */
.signal-cat-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.signal-cat-tab {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.signal-cat-tab:hover { border-color: var(--color-primary); color: var(--color-primary); }
.signal-cat-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Concept card grid */
.signal-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.signal-card {
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.signal-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.signal-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary);
}
.signal-card-icon {
  font-size: 26px;
  line-height: 1;
}
.signal-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}
.signal-card-cat {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.signal-card-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
  align-self: flex-start;
  letter-spacing: 0.3px;
}
.signal-card-pill.high     { background: rgba(56,176,154,0.18); color: var(--color-success); }
.signal-card-pill.moderate { background: rgba(234,179,8,0.15);  color: var(--color-warning); }
.signal-card-pill.low      { background: rgba(239,68,68,0.12);  color: var(--color-notification); }
/* Subtle accent stripe on the top of each card */
.signal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  opacity: 0;
  transition: opacity 0.18s;
}
.signal-card.high::before    { background: var(--color-success); opacity: 1; }
.signal-card.moderate::before{ background: var(--color-warning); opacity: 1; }
.signal-card.low::before     { background: var(--color-notification); opacity: 1; }

/* Signal output panel */
.signal-output {
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-primary);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  animation: signalFadeIn 0.2s ease;
}
@keyframes signalFadeIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: translateY(0); } }
.signal-output-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.signal-output-left { flex: 1; }
.signal-output-concept {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}
.signal-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.signal-score-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  flex-shrink: 0;
}
.signal-score-badge.high     { background: rgba(56,176,154,0.18); color: var(--color-success); border: 1px solid rgba(56,176,154,0.4); }
.signal-score-badge.moderate { background: rgba(234,179,8,0.15);  color: var(--color-warning); border: 1px solid rgba(234,179,8,0.35); }
.signal-score-badge.low      { background: rgba(239,68,68,0.12);  color: var(--color-notification); border: 1px solid rgba(239,68,68,0.3); }
.signal-score-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  max-width: 240px;
  overflow: hidden;
}
.signal-score-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.signal-score-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  flex-shrink: 0;
  min-width: 40px;
  text-align: right;
}
.signal-close-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 6px;
  margin-left: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.signal-close-btn:hover { border-color: var(--color-notification); color: var(--color-notification); }
/* signal-output-body kept for preset card detail panel (not tester) */
.signal-output-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .signal-output-body { grid-template-columns: 1fr; }
}
.signal-output-section { display: flex; flex-direction: column; gap: 8px; }

/* ── Two-panel tester output layout ────────────────────────── */
.sto-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: 0;
}
.sto-topbar-left { flex: 1; min-width: 0; }
.sto-topbar-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.sto-body {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 0;
  margin-top: 0;
  min-height: 0;
}

/* Left panel */
.sto-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 16px 0;
  border-right: 1px solid var(--color-divider);
  overflow-y: auto;
  max-height: 620px;
}
.sto-left::-webkit-scrollbar { width: 3px; }
.sto-left::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

.sto-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Right panel */
.sto-right {
  padding: 16px 0 16px 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sto-channels-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  max-height: 580px;
}
.sto-channels-scroll::-webkit-scrollbar { width: 3px; }
.sto-channels-scroll::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

/* Right panel: channels in single column stack */
.sto-right .signal-channels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  grid-template-columns: unset;
}

/* Compact booster cards for left panel */
.sto-left .tester-booster-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}
.sto-left .booster-card {
  padding: 10px 12px;
  gap: 7px;
}
.sto-left .booster-name { font-size: 12px; }
.sto-left .booster-desc { font-size: 11px; }
.sto-left .booster-delta-badge { font-size: 11px; padding: 2px 7px; }
.sto-left .tester-booster-footer { font-size: 11px; padding: 7px 10px; }

@media (max-width: 1000px) {
  .sto-body { grid-template-columns: 1fr; }
  .sto-left { border-right: none; border-bottom: 1px solid var(--color-divider); padding: 16px 0; max-height: none; }
  .sto-right { padding: 16px 0; }
  .sto-right .signal-channels { flex-direction: row; flex-wrap: wrap; }
}
.signal-output-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.signal-rationale {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.6;
}
.signal-topics {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.signal-topic-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 10px;
}
.signal-topic-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.signal-topic-vol {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.signal-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.signal-channel-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(99,179,155,0.1);
  border: 1px solid rgba(99,179,155,0.3);
  border-radius: 8px;
  padding: 5px 10px;
}

/* ── Signal Idea Tester ──────────────────────────────────────── */
.signal-tester {
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
  transition: border-color 0.2s;
}
.signal-tester:focus-within {
  border-color: var(--color-primary);
}
.signal-tester-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.signal-tester-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}
.signal-tester-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: 4px;
}
.signal-tester-body { display: flex; flex-direction: column; gap: 4px; }
.signal-tester-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.signal-tester-input {
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 14px;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}
.signal-tester-input:focus { border-color: var(--color-primary); }
.signal-tester-input::placeholder { color: var(--color-text-muted); }
.signal-tester-select {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 12px;
  padding: 9px 10px;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}
.signal-tester-select:focus { border-color: var(--color-primary); }
.signal-analyze-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.12s;
}
.signal-analyze-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.signal-analyze-btn:active { transform: translateY(0); }
.signal-analyze-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.signal-char-count {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: right;
  padding-right: 2px;
}

/* Result area */
.signal-tester-output {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  animation: signalFadeIn 0.25s ease;
}
.signal-tester-result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.signal-tester-result-left { flex: 1; min-width: 0; }
.signal-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid var(--color-primary);
  border-radius: 8px;
  color: var(--color-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.signal-add-btn:hover { background: var(--color-primary); color: #fff; }
.signal-add-btn.added {
  background: rgba(56,176,154,0.12);
  border-color: var(--color-success);
  color: var(--color-success);
  cursor: default;
}

/* Shimmer loading state */
.signal-shimmer-wrap { padding-top: 16px; border-top: 1px solid var(--color-border); }
.signal-shimmer {
  height: 14px;
  width: 100%;
  background: linear-gradient(90deg,
    var(--color-border) 25%,
    var(--color-surface) 50%,
    var(--color-border) 75%
  );
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmerSlide 1.4s infinite linear;
}
@keyframes shimmerSlide {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ============================================================
   CAMPAIGN PIPELINE
   ============================================================ */

.pipeline-section {
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  padding: 20px 24px;
}
.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}
.pipeline-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pipeline-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}
.pipeline-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.pipeline-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pipeline-legend-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-right: 8px;
}
.pipeline-status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.pipeline-status-dot.planned     { background: var(--color-blue); }
.pipeline-status-dot.active-live { background: var(--color-success); box-shadow: 0 0 6px var(--color-success); animation: pulseDot 1.8s infinite; }
.pipeline-status-dot.completed   { background: var(--color-text-muted); }
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 4px var(--color-success); }
  50%       { box-shadow: 0 0 10px var(--color-success), 0 0 18px rgba(56,176,154,0.4); }
}

/* Empty state */
.pipeline-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 0 24px;
  color: var(--color-text-muted);
}
.pipeline-empty-text { font-size: 14px; font-weight: 600; color: var(--color-text-muted); }
.pipeline-empty-sub  { font-size: 12px; color: var(--color-text-muted); }

/* Pipeline card */
.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pipeline-card {
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 18px;
  background: var(--color-surface);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.pipeline-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
}
.pipeline-card.planned::before     { background: var(--color-blue); }
.pipeline-card.active-live::before { background: var(--color-success); }
.pipeline-card.completed::before   { background: var(--color-text-muted); }

/* Active campaign glows */
.pipeline-card.active-live {
  border-color: var(--color-success);
  box-shadow: 0 0 0 1px rgba(56,176,154,0.3), 0 4px 20px rgba(56,176,154,0.12);
  background: rgba(56,176,154,0.04);
}

.pipeline-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.pipeline-card-left { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.pipeline-card-icon { font-size: 20px; flex-shrink: 0; line-height: 1.3; }
.pipeline-card-info { flex: 1; min-width: 0; }
.pipeline-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipeline-card-brand {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
}
.pipeline-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.pipeline-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.pipeline-status-badge.planned     { background: rgba(99,179,237,0.15); color: var(--color-blue); border: 1px solid rgba(99,179,237,0.3); }
.pipeline-status-badge.active-live { background: rgba(56,176,154,0.15); color: var(--color-success); border: 1px solid rgba(56,176,154,0.35); animation: badgePulse 2s infinite; }
.pipeline-status-badge.completed   { background: rgba(148,163,184,0.12); color: var(--color-text-muted); border: 1px solid rgba(148,163,184,0.25); }
@keyframes badgePulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.7; }
}

/* Date / timing row */
.pipeline-card-dates {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.pipeline-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pipeline-countdown {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(99,179,237,0.1);
  color: var(--color-blue);
}
.pipeline-countdown.live   { background: rgba(56,176,154,0.12); color: var(--color-success); }
.pipeline-countdown.ending { background: rgba(234,179,8,0.12);   color: var(--color-warning); }
.pipeline-countdown.done   { background: rgba(148,163,184,0.1);  color: var(--color-text-muted); }

/* Score vs expected */
.pipeline-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--color-surface-2);
  border-radius: 8px;
  flex-wrap: wrap;
}
.pipeline-score-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pipeline-score-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}
.pipeline-score-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
}
.pipeline-score-divider {
  width: 1px;
  height: 28px;
  background: var(--color-border);
  align-self: center;
}
.pipeline-score-delta {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pipeline-score-delta.ahead  { color: var(--color-success); }
.pipeline-score-delta.behind { color: var(--color-notification); }
.pipeline-score-delta.on-track { color: var(--color-warning); }
.pipeline-score-why {
  flex: 1;
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.5;
  min-width: 160px;
}

/* Card actions */
.pipeline-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}
.pipeline-action-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
}
.pipeline-action-btn:hover         { border-color: var(--color-primary); color: var(--color-primary); }
.pipeline-action-btn.danger:hover  { border-color: var(--color-notification); color: var(--color-notification); }

/* Modal */
.pipeline-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: signalFadeIn 0.18s ease;
}
.pipeline-modal {
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: 16px;
  width: 480px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.pipeline-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--color-border);
}
.pipeline-modal-title { font-size: 15px; font-weight: 700; color: var(--color-text); }
.pipeline-modal-body  { padding: 18px 20px; }
.pipeline-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
}
.pipeline-modal-concept {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--color-surface);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.pipeline-date-row {
  display: flex;
  gap: 14px;
}
.pipeline-date-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.pipeline-date-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pipeline-date-input {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
  color-scheme: dark;
}
.pipeline-date-input:focus { border-color: var(--color-primary); }


/* ===== BRAND SOCIAL Q&A CHAT ===== */
.sqc-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sqc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-2);
}

.sqc-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sqc-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.sqc-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  font-family: var(--font-display);
}

.sqc-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.sqc-clear-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.sqc-clear-btn:hover {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

/* Suggested prompts */
.sqc-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px 10px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-divider);
}

.sqc-suggestion-chip {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
  white-space: nowrap;
}
.sqc-suggestion-chip:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Chat thread */
.sqc-thread {
  flex: 1;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.sqc-thread::-webkit-scrollbar { width: 4px; }
.sqc-thread::-webkit-scrollbar-track { background: transparent; }
.sqc-thread::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

/* Welcome state */
.sqc-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
  text-align: center;
  flex: 1;
  margin: auto;
}
.sqc-welcome-icon {
  font-size: 36px;
  line-height: 1;
}
.sqc-welcome-text {
  font-size: 13px;
  color: var(--color-text-muted);
  max-width: 340px;
  line-height: 1.6;
}

/* Message bubbles */
.sqc-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}
.sqc-message.user {
  align-items: flex-end;
}
.sqc-message.assistant {
  align-items: flex-start;
}

.sqc-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 88%;
}
.sqc-message.user .sqc-bubble {
  background: var(--color-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.sqc-message.assistant .sqc-bubble {
  background: var(--color-surface-offset);
  color: var(--color-text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--color-divider);
}

.sqc-bubble-label {
  font-size: 11px;
  color: var(--color-text-faint);
  padding: 0 2px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Sentiment badges inside assistant bubbles */
.sqc-sentiment-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.sqc-sent-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}
.sqc-sent-badge.pos {
  background: var(--color-success-surface, rgba(56,176,154,0.12));
  color: var(--color-success);
  border: 1px solid var(--color-success);
}
.sqc-sent-badge.neg {
  background: rgba(239,68,68,0.08);
  color: var(--color-notification);
  border: 1px solid var(--color-notification);
}
.sqc-sent-badge.neu {
  background: rgba(245,158,11,0.08);
  color: var(--color-warning);
  border: 1px solid var(--color-warning);
}

.sqc-quotes {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sqc-quote {
  background: var(--color-surface);
  border-left: 3px solid var(--color-primary);
  padding: 6px 10px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
  line-height: 1.5;
}

.sqc-volume-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  padding: 6px 10px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-divider);
}

/* Typing indicator / shimmer */
.sqc-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-divider);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.sqc-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-muted);
  animation: sqcDotBounce 1.2s infinite ease-in-out;
}
.sqc-typing-dot:nth-child(1) { animation-delay: 0s; }
.sqc-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.sqc-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes sqcDotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input row */
.sqc-input-row {
  display: flex;
  gap: 10px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--color-divider);
  background: var(--color-surface-2);
  align-items: flex-end;
}

.sqc-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  resize: none;
  outline: none;
  transition: border-color var(--transition);
  line-height: 1.5;
  min-height: 42px;
  max-height: 100px;
  overflow-y: auto;
}
.sqc-input:focus {
  border-color: var(--color-primary);
}
.sqc-input::placeholder {
  color: var(--color-text-faint);
}

.sqc-send-btn {
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  background: var(--color-primary);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  height: 42px;
  flex-shrink: 0;
}
.sqc-send-btn:hover { background: var(--color-primary-hover); }
.sqc-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dark mode overrides (already handled by CSS vars, but ensure color-scheme) */
[data-theme="dark"] .sqc-input { color-scheme: dark; }


/* ===== SCORE BOOSTER SECTION ===== */
.tester-booster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.booster-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.booster-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--booster-accent, var(--color-success));
  border-radius: 3px 0 0 3px;
}
.booster-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.booster-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.booster-card-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.booster-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.booster-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  font-family: var(--font-display);
  line-height: 1.3;
}

.booster-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.5;
}

/* Score delta badge */
.booster-delta-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.booster-delta-badge {
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
  background: rgba(56,176,154,0.12);
  color: var(--color-success);
  border: 1px solid var(--color-success);
  white-space: nowrap;
}

.booster-new-score {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: right;
  white-space: nowrap;
}

.booster-new-score strong {
  color: var(--color-text);
  font-weight: 700;
}

/* Score progress bar within card */
.booster-score-track {
  display: flex;
  align-items: center;
  gap: 8px;
}

.booster-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--color-surface-offset);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.booster-bar-base {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--color-text-faint);
  border-radius: 99px;
  transition: width 0.6s ease;
}

.booster-bar-new {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--color-success);
  border-radius: 99px;
  transition: width 0.8s ease 0.15s;
  opacity: 0.85;
}

.booster-bar-label {
  font-size: 10px;
  color: var(--color-text-faint);
  white-space: nowrap;
  min-width: 28px;
  text-align: right;
}

/* Effort tag */
.booster-effort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  border: 1px solid var(--color-divider);
}
.booster-effort.quick   { color: var(--color-success); border-color: var(--color-success); background: rgba(56,176,154,0.08); }
.booster-effort.medium  { color: var(--color-warning); border-color: var(--color-warning); background: rgba(245,158,11,0.08); }
.booster-effort.heavy   { color: var(--color-notification); border-color: var(--color-notification); background: rgba(239,68,68,0.08); }

.booster-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Footer note */
.tester-booster-footer {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}


/* ===== CHANNEL VISUAL CARDS ===== */

/* Override signal-channels to use grid layout for visual cards */
.signal-channels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

/* Outer card wrapper */
.cv-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}
.cv-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border-color: var(--ch-color, var(--color-primary));
}

/* Card header bar */
.cv-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--ch-color, var(--color-primary)) 14%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--ch-color, var(--color-primary)) 20%, transparent);
}
.cv-card-icon { font-size: 18px; }
.cv-card-labels { flex: 1; min-width: 0; }
.cv-card-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-text);
  font-family: var(--font-display);
  letter-spacing: 0.2px;
}
.cv-card-format {
  font-size: 10px;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 1px;
}
.cv-card-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ch-color, var(--color-primary)) 18%, transparent);
  color: var(--ch-color, var(--color-primary));
  border: 1px solid color-mix(in srgb, var(--ch-color, var(--color-primary)) 35%, transparent);
}

/* Mockup container */
.cv-card-mockup {
  flex: 1;
  padding: 12px;
  background: var(--color-surface-2);
}

/* --- Shared image placeholder --- */
.cv-image-placeholder {
  width: 100%;
  height: 80px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 15%, transparent), color-mix(in srgb, var(--color-blue) 15%, transparent));
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.cv-image-emoji { font-size: 26px; line-height: 1; }
.cv-image-brand { font-size: 10px; font-weight: 800; color: var(--color-text-muted); letter-spacing: 0.5px; text-transform: uppercase; }

/* --- TikTok --- */
.cv-tiktok-frame {
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  height: 160px;
  background: #1a1a1a;
}
.cv-tiktok-bg {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
  opacity: 0.9;
}
.cv-tiktok-overlay {
  position: absolute; inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px;
  z-index: 1;
}
.cv-tiktok-text-area { flex: 1; min-width: 0; padding-right: 8px; }
.cv-tiktok-handle { font-size: 11px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.cv-tiktok-caption { font-size: 11px; color: rgba(255,255,255,0.9); line-height: 1.4; margin-bottom: 4px; }
.cv-tiktok-tags { font-size: 10px; color: rgba(255,255,255,0.6); }
.cv-tiktok-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.cv-tiktok-action { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.cv-tiktok-count { font-size: 9px; color: rgba(255,255,255,0.7); font-weight: 600; }

/* --- Instagram --- */
.cv-ig-frame {
  background: var(--color-surface);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-divider);
}
.cv-ig-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
}
.cv-ig-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #f77737, #e1306c, #c13584, #833ab4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 12px;
}
.cv-ig-info { flex: 1; }
.cv-ig-handle { font-size: 11px; font-weight: 700; color: var(--color-text); }
.cv-ig-location { font-size: 9px; color: var(--color-text-muted); }
.cv-ig-more { font-size: 14px; color: var(--color-text-muted); }
.cv-ig-image { overflow: hidden; border-radius: 4px; margin: 0 10px; }
.cv-ig-image-content .cv-image-placeholder { height: 70px; border-radius: 6px; }
.cv-ig-actions { padding: 6px 10px 2px; font-size: 10px; color: var(--color-text-muted); display: flex; gap: 10px; }
.cv-ig-caption { padding: 2px 10px 8px; font-size: 10px; color: var(--color-text-muted); line-height: 1.5; }
.cv-ig-tags { color: #0095f6; }

/* --- Reels --- */
.cv-reels-frame { position: relative; border-radius: 10px; overflow: hidden; height: 150px; }
.cv-reels-bg { position: absolute; inset: 0; background: linear-gradient(160deg, #833ab4, #e1306c, #f77737); }
.cv-reels-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; z-index: 1; }
.cv-reels-play { color: rgba(255,255,255,0.5); font-size: 28px; text-align: center; margin-top: 30px; }
.cv-reels-caption { }
.cv-reels-text { font-size: 11px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.cv-reels-sub { font-size: 9px; color: rgba(255,255,255,0.6); }
.cv-reels-stats { display: flex; gap: 10px; font-size: 10px; color: rgba(255,255,255,0.8); }

/* --- SMS --- */
.cv-sms-frame { background: var(--color-surface-offset); border-radius: 10px; overflow: hidden; }
.cv-sms-header { background: var(--color-surface-2); padding: 8px 12px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--color-divider); }
.cv-sms-sender-dot { width: 8px; height: 8px; border-radius: 50%; background: #34c759; }
.cv-sms-sender-name { font-size: 11px; font-weight: 700; color: var(--color-text); }
.cv-sms-thread { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.cv-sms-bubble {
  background: #34c759; color: #fff;
  padding: 8px 12px; border-radius: 14px; border-bottom-left-radius: 4px;
  font-size: 11px; line-height: 1.5; max-width: 90%;
}
.cv-sms-time { font-size: 9px; color: var(--color-text-faint); text-align: center; margin-top: 4px; }
.cv-sms-input-row { display: flex; gap: 6px; padding: 6px 10px 8px; align-items: center; }
.cv-sms-input { flex: 1; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; padding: 5px 10px; font-size: 10px; color: var(--color-text-faint); }
.cv-sms-send-btn { width: 22px; height: 22px; border-radius: 50%; background: #34c759; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }

/* --- Push Notification --- */
.cv-push-frame { position: relative; border-radius: 10px; overflow: hidden; height: 150px; }
.cv-push-wallpaper { position: absolute; inset: 0; background: linear-gradient(160deg, #1c1c2e, #2d1b69, #11063a); }
.cv-push-phone-bar { position: relative; z-index: 1; display: flex; justify-content: space-between; padding: 6px 14px; font-size: 10px; color: rgba(255,255,255,0.7); font-weight: 700; }
.cv-push-notif {
  position: relative; z-index: 1;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(12px);
  margin: 4px 10px; border-radius: 12px; padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.2);
}
.cv-push-notif-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.cv-push-app-icon { width: 16px; height: 16px; border-radius: 4px; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; }
.cv-push-app-name { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.9); flex: 1; }
.cv-push-time { font-size: 9px; color: rgba(255,255,255,0.5); }
.cv-push-title { font-size: 11px; font-weight: 800; color: rgba(255,255,255,0.95); margin-bottom: 2px; }
.cv-push-body { font-size: 10px; color: rgba(255,255,255,0.7); line-height: 1.4; }

/* --- Email --- */
.cv-email-frame { border-radius: 10px; overflow: hidden; border: 1px solid var(--color-divider); background: var(--color-surface); }
.cv-email-header-bar { background: var(--color-surface-offset); padding: 6px 10px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--color-divider); }
.cv-email-dots { display: flex; gap: 4px; }
.cv-email-dots span { width: 8px; height: 8px; border-radius: 50%; }
.cv-email-dots span:nth-child(1) { background: #ff5f56; }
.cv-email-dots span:nth-child(2) { background: #ffbd2e; }
.cv-email-dots span:nth-child(3) { background: #27c93f; }
.cv-email-bar-label { font-size: 10px; color: var(--color-text-muted); font-weight: 600; }
.cv-email-meta { padding: 8px 12px 6px; border-bottom: 1px solid var(--color-divider); }
.cv-email-from, .cv-email-subject { font-size: 10px; color: var(--color-text-muted); line-height: 1.6; }
.cv-email-hero {
  background: linear-gradient(135deg, var(--color-primary), var(--color-blue));
  color: #fff; text-align: center; padding: 12px;
  font-size: 13px; font-weight: 800; font-family: var(--font-display); letter-spacing: 0.5px;
}
.cv-email-body-preview { padding: 8px 12px; font-size: 10px; color: var(--color-text-muted); line-height: 1.6; }
.cv-email-cta {
  margin: 0 12px 10px; background: var(--color-primary); color: #fff;
  border-radius: 6px; padding: 6px 12px; text-align: center;
  font-size: 11px; font-weight: 700;
}

/* --- Facebook --- */
.cv-fb-frame { background: var(--color-surface); border-radius: 10px; border: 1px solid var(--color-divider); overflow: hidden; }
.cv-fb-header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.cv-fb-avatar { width: 28px; height: 28px; border-radius: 50%; background: #1877f2; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.cv-fb-info { flex: 1; }
.cv-fb-name { font-size: 11px; font-weight: 700; color: var(--color-text); }
.cv-fb-meta { font-size: 9px; color: var(--color-text-muted); }
.cv-fb-body { padding: 0 10px 6px; font-size: 11px; color: var(--color-text-muted); line-height: 1.5; }
.cv-fb-image-area { margin: 0 10px; border-radius: 4px; overflow: hidden; }
.cv-fb-image-area .cv-image-placeholder { height: 60px; border-radius: 4px; }
.cv-fb-reactions { padding: 6px 10px; font-size: 10px; color: var(--color-text-muted); }
.cv-fb-cta-btn { margin: 4px 10px 8px; background: var(--color-surface-offset); border: 1px solid var(--color-border); border-radius: 4px; padding: 5px; text-align: center; font-size: 11px; font-weight: 700; color: var(--color-text); }

/* --- LinkedIn --- */
.cv-linkedin-frame { background: var(--color-surface); border-radius: 10px; border: 1px solid var(--color-divider); overflow: hidden; }
.cv-linkedin-header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.cv-linkedin-avatar { width: 28px; height: 28px; border-radius: 4px; background: #0a66c2; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.cv-linkedin-info { flex: 1; }
.cv-linkedin-name { font-size: 11px; font-weight: 700; color: var(--color-text); }
.cv-linkedin-meta { font-size: 9px; color: var(--color-text-muted); }
.cv-linkedin-body { padding: 0 10px 6px; font-size: 11px; color: var(--color-text-muted); line-height: 1.5; }
.cv-linkedin-image-area { margin: 0 10px; border-radius: 4px; overflow: hidden; }
.cv-linkedin-image-area .cv-image-placeholder { height: 60px; border-radius: 4px; }
.cv-linkedin-cta-btn { margin: 6px 10px 8px; background: #0a66c2; border-radius: 14px; padding: 6px 14px; text-align: center; font-size: 11px; font-weight: 700; color: #fff; display: inline-block; }

/* --- Tweet / X --- */
.cv-tweet-frame { background: var(--color-surface); border-radius: 10px; border: 1px solid var(--color-divider); padding: 12px; }
.cv-tweet-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cv-tweet-avatar { width: 28px; height: 28px; border-radius: 50%; background: #1da1f2; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.cv-tweet-info { flex: 1; }
.cv-tweet-name { font-size: 11px; font-weight: 800; color: var(--color-text); }
.cv-tweet-handle { font-size: 9px; color: var(--color-text-muted); }
.cv-tweet-x { font-size: 14px; font-weight: 800; color: var(--color-text); }
.cv-tweet-body { font-size: 11px; color: var(--color-text); line-height: 1.6; margin-bottom: 8px; }
.cv-tweet-actions { display: flex; gap: 14px; font-size: 10px; color: var(--color-text-muted); }

/* --- YouTube --- */
.cv-yt-frame { background: var(--color-surface); border-radius: 10px; overflow: hidden; }
.cv-yt-thumb { position: relative; background: #0a0a0a; height: 80px; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cv-yt-thumb::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, #1a0a0a, #3d0000); }
.cv-yt-play-btn { position: relative; z-index: 1; width: 30px; height: 22px; background: #ff0000; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; }
.cv-yt-title-overlay { position: absolute; bottom: 6px; left: 8px; right: 8px; font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.9); line-height: 1.3; z-index: 1; }
.cv-yt-duration { position: absolute; bottom: 4px; right: 6px; background: rgba(0,0,0,0.8); color: #fff; font-size: 9px; padding: 1px 4px; border-radius: 3px; z-index: 1; }
.cv-yt-meta { display: flex; gap: 8px; padding: 8px 4px 4px; align-items: flex-start; }
.cv-yt-channel-avatar { width: 22px; height: 22px; border-radius: 50%; background: #ff0000; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 10px; flex-shrink: 0; }
.cv-yt-video-title { font-size: 10px; font-weight: 700; color: var(--color-text); line-height: 1.4; }
.cv-yt-channel-name { font-size: 9px; color: var(--color-text-muted); margin-top: 2px; }

/* --- Google Search --- */
.cv-google-frame { background: var(--color-surface); border-radius: 10px; padding: 12px; border: 1px solid var(--color-divider); }
.cv-google-label { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.cv-google-sponsored { font-size: 9px; font-weight: 700; color: #fff; background: #4285f4; padding: 1px 5px; border-radius: 3px; }
.cv-google-url { font-size: 10px; color: #3c4043; }
.cv-google-headline { font-size: 13px; color: #1a0dab; font-weight: 500; line-height: 1.4; margin-bottom: 1px; }
[data-theme="dark"] .cv-google-headline { color: #8ab4f8; }
.cv-google-description { font-size: 11px; color: var(--color-text-muted); line-height: 1.5; margin: 4px 0; }
.cv-google-sitelinks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cv-google-sitelink { font-size: 10px; color: #1a0dab; border: 1px solid #dadce0; border-radius: 4px; padding: 3px 8px; }
[data-theme="dark"] .cv-google-sitelink { color: #8ab4f8; border-color: #3c4043; }

/* --- In-Store POS --- */
.cv-pos-frame {
  background: var(--color-primary); border-radius: 10px; padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.cv-pos-header { font-size: 10px; font-weight: 800; color: rgba(255,255,255,0.6); letter-spacing: 2px; text-transform: uppercase; }
.cv-pos-hero-text { font-size: 17px; font-weight: 900; color: #fff; font-family: var(--font-display); letter-spacing: 0.5px; line-height: 1.2; }
.cv-pos-sub { font-size: 11px; color: rgba(255,255,255,0.75); }
.cv-pos-badge { background: rgba(255,255,255,0.2); color: #fff; border-radius: 99px; padding: 3px 12px; font-size: 10px; font-weight: 700; border: 1px solid rgba(255,255,255,0.3); }
.cv-pos-footer { font-size: 9px; color: rgba(255,255,255,0.5); }

/* --- OOH Billboard --- */
.cv-ooh-frame { border-radius: 10px; overflow: hidden; }
.cv-ooh-billboard {
  background: #111; padding: 16px; text-align: center;
  border-bottom: 3px solid #333;
}
.cv-ooh-brand { font-size: 9px; font-weight: 900; color: rgba(255,255,255,0.4); letter-spacing: 3px; margin-bottom: 4px; }
.cv-ooh-headline { font-size: 17px; font-weight: 900; color: #fff; font-family: var(--font-display); line-height: 1.2; letter-spacing: 0.5px; }
.cv-ooh-sub { font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 4px; }
.cv-ooh-footer { padding: 6px 10px; font-size: 9px; color: var(--color-text-muted); text-align: center; background: var(--color-surface-offset); }

/* --- PR Article --- */
.cv-pr-frame { background: var(--color-surface); border-radius: 10px; padding: 12px; border: 1px solid var(--color-divider); }
.cv-pr-outlet { font-size: 10px; font-weight: 800; color: var(--color-text-muted); margin-bottom: 6px; }
.cv-pr-headline { font-size: 13px; font-weight: 800; color: var(--color-text); line-height: 1.4; font-family: var(--font-display); margin-bottom: 4px; }
.cv-pr-byline { font-size: 9px; color: var(--color-text-muted); margin-bottom: 6px; }
.cv-pr-excerpt { font-size: 10px; color: var(--color-text-muted); line-height: 1.6; margin-bottom: 8px; }
.cv-pr-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.cv-pr-tag { font-size: 9px; background: var(--color-surface-offset); border: 1px solid var(--color-border); border-radius: 99px; padding: 2px 7px; color: var(--color-text-muted); }

/* --- CTV --- */
.cv-ctv-frame { border-radius: 10px; overflow: hidden; background: #0a0a0a; }
.cv-ctv-screen { position: relative; min-height: 120px; }
.cv-ctv-content { }
.cv-ctv-content .cv-image-placeholder { height: 80px; border-radius: 0; background: linear-gradient(135deg, #1a0a2e, #0f3460); }
.cv-ctv-lower-third {
  background: rgba(0,0,0,0.8); padding: 8px 12px;
  border-top: 3px solid var(--color-primary);
}
.cv-ctv-brand-name { font-size: 10px; font-weight: 900; color: var(--color-primary); letter-spacing: 1px; text-transform: uppercase; }
.cv-ctv-tagline { font-size: 12px; font-weight: 800; color: #fff; margin: 2px 0; }
.cv-ctv-call-to-action { font-size: 9px; color: rgba(255,255,255,0.6); }
.cv-ctv-skip { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); color: rgba(255,255,255,0.7); font-size: 9px; padding: 2px 6px; border-radius: 3px; }

/* --- In-App Modal --- */
.cv-inapp-frame { background: var(--color-surface-offset); border-radius: 10px; overflow: hidden; }
.cv-inapp-phone-chrome { background: var(--color-surface-2); border-bottom: 1px solid var(--color-divider); }
.cv-inapp-status-bar { display: flex; justify-content: space-between; padding: 4px 12px; font-size: 9px; color: var(--color-text-muted); font-weight: 700; }
.cv-inapp-nav { text-align: center; padding: 4px; font-size: 11px; font-weight: 800; color: var(--color-text); border-bottom: 1px solid var(--color-divider); }
.cv-inapp-modal {
  margin: 10px; background: var(--color-surface); border-radius: 12px;
  padding: 14px; text-align: center; position: relative;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.cv-inapp-close { position: absolute; top: 8px; right: 10px; font-size: 12px; color: var(--color-text-faint); cursor: pointer; }
.cv-inapp-emoji { font-size: 28px; line-height: 1; margin-bottom: 6px; }
.cv-inapp-headline { font-size: 13px; font-weight: 800; color: var(--color-text); margin-bottom: 4px; font-family: var(--font-display); }
.cv-inapp-body { font-size: 11px; color: var(--color-text-muted); line-height: 1.5; margin-bottom: 10px; }
.cv-inapp-btn { background: var(--color-primary); color: #fff; border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.cv-inapp-dismiss { font-size: 10px; color: var(--color-text-faint); }

/* Fallback chip for unrecognized channels */
.cv-channel-fallback {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 20px 10px;
  border: 1px dashed var(--color-border); border-radius: 10px;
  background: var(--color-surface-2);
}
.cv-fallback-icon { font-size: 22px; }
.cv-fallback-name { font-size: 11px; font-weight: 700; color: var(--color-text-muted); }

/* Channel cards in right panel: horizontal mockup + header side by side */
.sto-right .cv-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto;
  border-radius: 12px;
}
.sto-right .cv-card-header {
  grid-column: 1 / -1;
  padding: 8px 12px;
}
.sto-right .cv-card-mockup {
  grid-column: 1 / -1;
  padding: 0 12px 12px;
}

/* Make mockup content more compact in right panel */
.sto-right .cv-tiktok-frame { height: 130px; }
.sto-right .cv-push-frame { height: 130px; }
.sto-right .cv-reels-frame { height: 120px; }
.sto-right .cv-ig-image-content .cv-image-placeholder { height: 56px; }
.sto-right .cv-fb-image-area .cv-image-placeholder { height: 50px; }
.sto-right .cv-linkedin-image-area .cv-image-placeholder { height: 50px; }
.sto-right .cv-yt-thumb { height: 68px; }
.sto-right .cv-ctv-content .cv-image-placeholder { height: 66px; }
.sto-right .cv-ooh-billboard { padding: 12px; }
.sto-right .cv-pos-frame { padding: 12px; }

/* ===== BOOSTER CAMPAIGN BUTTON ===== */
.booster-campaign-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  margin-top: 2px;
}
.booster-campaign-btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}
.booster-campaign-btn:active { transform: translateY(0); }

/* ===== PIPELINE BOOSTER TACTIC SECTION ===== */
.pipeline-booster-tactic {
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, transparent);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pipeline-booster-header {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.pipeline-booster-icon { font-size: 15px; line-height: 1; }
.pipeline-booster-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
  border-radius: var(--radius-full);
  padding: 1px 7px;
}
.pipeline-booster-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
}
.pipeline-booster-lift {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-success);
  background: rgba(56,176,154,0.1);
  border: 1px solid var(--color-success);
  border-radius: var(--radius-full);
  padding: 1px 8px;
}
.pipeline-booster-desc {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.5;
  padding-left: 22px;
}

/* ===== PIPELINE CHANNEL CHIPS ===== */
.pipeline-channels-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 2px 0;
}
.pipeline-channel-chip {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px 9px;
}
.pipeline-channel-chip.muted {
  color: var(--color-text-faint);
  background: transparent;
}

/* ===== TESTER CONTROLS ROW (brand dropdown + category + analyze button) ===== */
.signal-tester-row-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.signal-tester-brand-select {
  flex: 0 0 auto;
  min-width: 160px;
  max-width: 200px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 7px 10px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238892a4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.signal-tester-brand-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
}
.signal-tester-brand-select:hover {
  border-color: var(--color-primary);
}

/* ===== BOOSTER SECTION HEADER (label + count badge + select-all btn) ===== */
.booster-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.booster-section-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.booster-select-all-btn {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 28%, transparent);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.booster-select-all-btn:hover {
  background: color-mix(in srgb, var(--color-primary) 18%, transparent);
  transform: translateY(-1px);
}
.booster-select-all-btn:active { transform: translateY(0); }

.booster-selected-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

/* ===== BOOSTER CARD SELECTION ROW (checkbox + label) ===== */
.booster-select-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-top: 1px solid var(--color-divider);
  cursor: pointer;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: background var(--transition);
}
.booster-select-row:hover {
  background: color-mix(in srgb, var(--color-primary) 6%, transparent);
}

.booster-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--color-primary);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 3px;
}

.booster-select-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  user-select: none;
  transition: color var(--transition);
}
.booster-select-row:hover .booster-select-label,
.booster-checkbox:checked + .booster-select-label {
  color: var(--color-primary);
}

/* ===== BOOSTER CARD SELECTED STATE ===== */
.booster-card.booster-selected {
  border-color: var(--booster-accent, var(--color-primary));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--booster-accent, var(--color-primary)) 22%, transparent),
              0 4px 14px rgba(0,0,0,0.1);
  background: color-mix(in srgb, var(--booster-accent, var(--color-primary)) 5%, var(--color-surface));
}
.booster-card.booster-selected .booster-select-label {
  color: var(--booster-accent, var(--color-primary));
}

/* ===== BOOSTER APPLY BAR ===== */
.booster-apply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface-2));
  border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  animation: fadeIn 0.2s ease;
}

.booster-apply-summary {
  font-size: 12px;
  color: var(--color-text-muted);
  flex: 1;
  min-width: 0;
  line-height: 1.5;
}
.booster-apply-summary strong {
  color: var(--color-text);
  font-weight: 700;
}
.booster-apply-summary .apply-score-lift {
  color: var(--color-success);
  font-weight: 800;
}

.booster-apply-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ===== BOOSTER APPLY BUTTONS (primary + secondary) ===== */
.booster-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.booster-apply-btn:hover { transform: translateY(-1px); }
.booster-apply-btn:active { transform: translateY(0); }

.booster-apply-btn.primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 35%, transparent);
}
.booster-apply-btn.primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--color-primary) 45%, transparent);
}

.booster-apply-btn.secondary {
  background: var(--color-surface-offset);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.booster-apply-btn.secondary:hover {
  background: var(--color-surface-2);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ===== BIG CRAZY IDEA — Category Tab ===== */
.signal-cat-tab-crazy {
  background: linear-gradient(135deg,
    color-mix(in srgb, #f59e0b 18%, transparent),
    color-mix(in srgb, #a855f7 12%, transparent)
  ) !important;
  border-color: color-mix(in srgb, #f59e0b 40%, transparent) !important;
  color: #f59e0b !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}
.signal-cat-tab-crazy::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(168,85,247,0.06));
  pointer-events: none;
}
.signal-cat-tab-crazy:hover,
.signal-cat-tab-crazy.active {
  background: linear-gradient(135deg,
    color-mix(in srgb, #f59e0b 28%, transparent),
    color-mix(in srgb, #a855f7 20%, transparent)
  ) !important;
  border-color: #f59e0b !important;
  color: #f59e0b !important;
}

/* ===== BIG CRAZY IDEA — Card ===== */
.signal-card.signal-card-crazy {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, #f59e0b 7%, var(--color-surface)),
    color-mix(in srgb, #a855f7 5%, var(--color-surface))
  );
  border: 1.5px solid color-mix(in srgb, #f59e0b 35%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, #f59e0b 10%, transparent),
    0 4px 18px color-mix(in srgb, #f59e0b 12%, transparent);
  position: relative;
  overflow: hidden;
}
.signal-card.signal-card-crazy::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.signal-card.signal-card-crazy:hover {
  border-color: #f59e0b;
  box-shadow:
    0 0 0 2px color-mix(in srgb, #f59e0b 20%, transparent),
    0 8px 28px color-mix(in srgb, #f59e0b 18%, transparent);
  transform: translateY(-2px);
}
.signal-card.signal-card-crazy .signal-card-icon {
  font-size: 22px;
}
.signal-card.signal-card-crazy .signal-card-name {
  color: var(--color-text);
  font-weight: 800;
}

/* ===== BIG CRAZY IDEA — Badge + Pill ===== */
.signal-crazy-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 35%, transparent);
  border-radius: var(--radius-full);
  padding: 2px 8px;
}

.signal-card-pill.signal-crazy-pill {
  background: color-mix(in srgb, #a855f7 14%, transparent);
  color: #a855f7;
  border: 1px solid color-mix(in srgb, #a855f7 30%, transparent);
  font-weight: 800;
  font-size: 9px;
}

/* ===== BIG CRAZY IDEA — Pipeline Button ===== */
.pipeline-action-btn-crazy {
  background: linear-gradient(135deg,
    color-mix(in srgb, #f59e0b 15%, transparent),
    color-mix(in srgb, #a855f7 10%, transparent)
  ) !important;
  border-color: color-mix(in srgb, #f59e0b 40%, transparent) !important;
  color: #f59e0b !important;
  font-weight: 800 !important;
}
.pipeline-action-btn-crazy:hover {
  background: linear-gradient(135deg,
    color-mix(in srgb, #f59e0b 25%, transparent),
    color-mix(in srgb, #a855f7 18%, transparent)
  ) !important;
  border-color: #f59e0b !important;
}

/* ===== BRAND PERCEPTION MAP ===== */

/* Legend dots (header) */
.perception-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.perception-legend-dot.premium   { background: var(--color-purple); box-shadow: 0 0 6px color-mix(in srgb, var(--color-purple) 60%, transparent); }
.perception-legend-dot.mainstream { background: var(--color-blue); }
.perception-legend-dot.value      { background: var(--color-success); }

/* Top row — tier badge + signals */
.perception-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 14px 0;
  flex-wrap: wrap;
}

.perception-tier-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.perception-tier-badge.premium   { background: color-mix(in srgb, var(--color-purple) 20%, transparent); color: var(--color-purple); border: 1px solid color-mix(in srgb, var(--color-purple) 40%, transparent); }
.perception-tier-badge.mainstream { background: color-mix(in srgb, var(--color-blue) 18%, transparent);   color: var(--color-blue);   border: 1px solid color-mix(in srgb, var(--color-blue) 35%, transparent); }
.perception-tier-badge.value      { background: color-mix(in srgb, var(--color-success) 18%, transparent); color: var(--color-success); border: 1px solid color-mix(in srgb, var(--color-success) 35%, transparent); }

.perception-tier-label { font-size: 11px; }
.perception-tier-score {
  font-size: 18px;
  font-weight: 800;
  opacity: 0.9;
}

/* Signal chips */
.perception-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.perception-signal-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
  color: var(--color-text-muted);
  border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
}

/* Spectrum bar wrapper */
.perception-spectrum-wrap {
  position: relative;
  margin: 4px 0 48px 0;
}

.perception-spectrum-bar {
  position: relative;
  display: flex;
  height: 100px;
  border-radius: 10px;
  overflow: visible;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
}

.perception-zone {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding-bottom: 8px;
  padding-left: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  position: relative;
}
.perception-zone.value      { background: color-mix(in srgb, var(--color-success) 8%, transparent); color: var(--color-success); border-radius: 10px 0 0 10px; }
.perception-zone.mainstream { background: color-mix(in srgb, var(--color-blue) 7%, transparent);    color: var(--color-blue); }
.perception-zone.premium    { background: color-mix(in srgb, var(--color-purple) 10%, transparent); color: var(--color-purple); border-radius: 0 10px 10px 0; }

/* Dividers between zones */
.perception-zone.value::after,
.perception-zone.mainstream::after {
  content: '';
  position: absolute;
  right: 0; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--color-divider);
}

/* Dots row — absolutely positioned over the bar */
.perception-dots-row {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  pointer-events: none;
}

.perception-brand-dot {
  position: absolute;
  transform: translateX(-50%) translateY(-50%);
  top: 38%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-bg);
  cursor: default;
  pointer-events: all;
  transition: transform 0.2s ease;
  z-index: 2;
}
.perception-brand-dot:hover { transform: translateX(-50%) translateY(-50%) scale(1.25); z-index: 10; }
.perception-brand-dot.premium    { background: var(--color-purple); box-shadow: 0 0 8px color-mix(in srgb, var(--color-purple) 70%, transparent); }
.perception-brand-dot.mainstream { background: var(--color-blue); box-shadow: 0 0 6px color-mix(in srgb, var(--color-blue) 50%, transparent); }
.perception-brand-dot.value      { background: var(--color-success); box-shadow: 0 0 6px color-mix(in srgb, var(--color-success) 50%, transparent); }

/* Focal (our brand) is larger */
.perception-brand-dot.focal {
  width: 22px;
  height: 22px;
  border-width: 3px;
  z-index: 5;
}

/* Competitor dots slightly muted */
.perception-brand-dot.competitor {
  opacity: 0.72;
}

/* Dot labels — appear below each dot inside the expanded bar */
.perception-dot-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.01em;
}
.perception-brand-dot.focal .perception-dot-label {
  color: var(--color-text);
  font-size: 11px;
  font-weight: 700;
}

/* Insight text */
.perception-insight {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--color-text-muted);
  border-left: 3px solid var(--color-primary);
  padding-left: 12px;
  margin: 4px 0 18px 0;
}

/* Competitor table */
.perception-comp-table {
  margin-top: 4px;
}
.perception-comp-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.perception-comp-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.perception-comp-row {
  display: grid;
  grid-template-columns: minmax(170px, 220px) 100px 1fr 140px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--color-text) 3%, transparent);
  font-size: 12.5px;
}
.perception-comp-name {
  font-weight: 600;
  color: var(--color-text);
  white-space: normal;
  word-break: break-word;
}
.perception-comp-tier {
  font-size: 11px;
  color: var(--color-text-muted);
}
.perception-comp-bar-wrap {
  height: 5px;
  background: color-mix(in srgb, var(--color-text) 10%, transparent);
  border-radius: 3px;
  overflow: hidden;
}
.perception-comp-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.perception-comp-bar.premium    { background: var(--color-purple); }
.perception-comp-bar.mainstream { background: var(--color-blue); }
.perception-comp-bar.value      { background: var(--color-success); }

.perception-comp-diff {
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}
.perception-diff-above   { color: var(--color-notification); }
.perception-diff-below   { color: var(--color-success); }
.perception-diff-neutral { color: var(--color-text-muted); }

/* Portfolio insight strip */
.perception-portfolio-strip {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
}
.perception-portfolio-insight {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--color-text-muted);
}
.perception-portfolio-insight strong { color: var(--color-text); }

/* ===== END BRAND PERCEPTION MAP ===== */

/* ===== GEO MAP TOGGLE ===== */
.geo-map-toggle {
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
  border: 1px solid var(--color-divider);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}
.geo-map-toggle-btn {
  padding: 4px 14px;
  border-radius: 16px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.geo-map-toggle-btn.active {
  background: var(--color-primary);
  color: #fff;
}
.geo-map-toggle-btn:not(.active):hover {
  background: color-mix(in srgb, var(--color-text) 10%, transparent);
  color: var(--color-text);
}

/* ===== EXPANSION DEMAND LEGEND ===== */
.expansion-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.expansion-legend-dot.existing { background: #f97316; }
.expansion-legend-dot.new      { background: #a855f7; }

/* ===== EXPANSION DEMAND PANEL ===== */
.expansion-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 4px 0 8px 0;
}
@media (max-width: 900px) {
  .expansion-two-col { grid-template-columns: 1fr; }
}

.expansion-col-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 6px 0 10px 2px;
  margin-bottom: 2px;
  border-bottom: 2px solid;
}
.expansion-col-header.existing { color: #f97316; border-color: #f9731640; }
.expansion-col-header.new      { color: #a855f7; border-color: #a855f740; }

.expansion-market-card {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--color-divider);
  background: color-mix(in srgb, var(--color-text) 2%, transparent);
  transition: border-color 0.15s ease;
}
.expansion-market-card.existing { border-left: 3px solid #f97316; }
.expansion-market-card.new      { border-left: 3px solid #a855f7; }
.expansion-market-card.expansion-rank-1.existing { background: color-mix(in srgb, #f97316 6%, transparent); }
.expansion-market-card.expansion-rank-1.new      { background: color-mix(in srgb, #a855f7 6%, transparent); }

.expansion-card-top {
  display: grid;
  grid-template-columns: 28px 1fr auto 120px 60px;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.expansion-rank {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-text-muted);
  opacity: 0.5;
}
.expansion-market-card.expansion-rank-1 .expansion-rank {
  opacity: 1;
  color: var(--color-text);
}

.expansion-city {
  font-size: 13px;
  color: var(--color-text);
}
.expansion-city strong {
  font-weight: 700;
}

.expansion-type-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.expansion-type-badge.existing {
  background: color-mix(in srgb, #f97316 18%, transparent);
  color: #f97316;
  border: 1px solid color-mix(in srgb, #f97316 30%, transparent);
}
.expansion-type-badge.new {
  background: color-mix(in srgb, #a855f7 18%, transparent);
  color: #a855f7;
  border: 1px solid color-mix(in srgb, #a855f7 30%, transparent);
}

.expansion-signal-bar-wrap {
  height: 5px;
  background: color-mix(in srgb, var(--color-text) 10%, transparent);
  border-radius: 3px;
  overflow: hidden;
}
.expansion-signal-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.expansion-signal-bar.existing { background: #f97316; }
.expansion-signal-bar.new      { background: #a855f7; }

.expansion-signal-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
  text-align: right;
  white-space: nowrap;
}
.expansion-signal-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.expansion-quote {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--color-text-muted);
  font-style: italic;
  padding-left: 28px;
}

/* ===== END EXPANSION DEMAND ===== */
