/* ═══════════════════════════════════════════════════════════
   Unison — Editorial UI with Unison Brand
   Playfair Display + Plus Jakarta Sans
   Unison Indigo + editorial earth tones
   ═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  /* Unison brand */
  --unison: #6366F1;
  --unison-light: #EEF1FC;
  --unison-dim: rgba(99, 102, 241, 0.10);

  --charcoal: #2C2C2C;
  --sage: #7D8F82;
  --sage-light: #F4F6F4;
  --bronze: #A68D6A;
  --cream: #FAF9F6;
  --border: #E5E2DD;
  --white: #FFFFFF;

  /* Semantic */
  --positive: #5A9A6E;
  --positive-dim: rgba(90, 154, 110, 0.12);
  --negative: #C0574A;
  --negative-dim: rgba(192, 87, 74, 0.10);
  --warning: #C4944A;
  --warning-dim: rgba(196, 148, 74, 0.12);
  --info-dim: rgba(99, 102, 241, 0.08);

  --text-primary: #2C2C2C;
  --text-secondary: #5E6B62;
  --text-muted: #9CA89F;

  --radius: 8px;
  --radius-lg: 12px;

  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--sage); }

/* ═══════════════════════════════════════════════════════════
   STARTUP SCREEN
   ═══════════════════════════════════════════════════════════ */

/* Customer Cards */
.customer-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.customer-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.customer-card:hover {
  border-color: var(--bronze);
  box-shadow: 0 2px 12px rgba(166, 141, 106, 0.1);
}

.customer-card.selected {
  border-color: var(--unison);
  background: rgba(99, 102, 241, 0.04);
  box-shadow: 0 2px 16px rgba(99, 102, 241, 0.12);
}

.customer-card .card-name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--charcoal);
}

.customer-card .card-tagline {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.customer-card .card-interactions {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-top: 0.25rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-delete-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  border-radius: 4px;
}

.customer-card:hover .card-delete-btn { opacity: 1; }
.card-delete-btn:hover { color: var(--negative); background: var(--negative-dim); }

/* Divider — handled by Tailwind in HTML, but keep fallback */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Primary button base */
.primary-btn {
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
}
.primary-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD CARDS — shared card style for intelligence panel
   ═══════════════════════════════════════════════════════════ */

.dashboard-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-family: var(--font-sans);
}

/* ═══════════════════════════════════════════════════════════
   MESSAGE BLOCKS — editorial style
   ═══════════════════════════════════════════════════════════ */

#message-area {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Wrapper for label + message */
.message-block {
  display: flex;
  flex-direction: column;
  margin-bottom: 2.5rem;
}

.message-block.user {
  align-items: flex-end;
}

.message-block.user .message-label,
.message-block.user .message {
  text-align: right;
}

.message-block.system {
  align-items: center;
  margin-bottom: 0.75rem;
}

/* Editorial label above each message */
.message-label {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.message-block.agent .message-label {
  color: var(--bronze);
}

.message {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.6;
  word-wrap: break-word;
  color: var(--text-primary);
  max-width: 85%;
}

.message.user {
  font-style: italic;
  color: var(--charcoal);
}

.message.agent {
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
  color: var(--text-primary);
}

.message.system {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   ACTION CARDS
   ═══════════════════════════════════════════════════════════ */

.action-card {
  background: var(--sage-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0.25rem 0 1.5rem 1.25rem;
  font-size: 0.85rem;
}

.action-card .action-header {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--sage);
  margin-bottom: 0.25rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.action-card .action-body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 0.8rem;
}

.action-card .action-status {
  font-family: var(--font-sans);
  color: var(--positive);
  font-weight: 600;
  margin-top: 0.375rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.action-card.special-offer {
  border-color: var(--bronze);
  background: rgba(166, 141, 106, 0.06);
}

.action-card.special-offer .action-header {
  color: var(--bronze);
}

/* Action card rich details */
.action-detail {
  margin-top: 0.5rem;
  padding: 0.5rem 0.625rem;
  background: var(--sage-light);
  border-radius: 6px;
  font-size: 0.7rem;
}

.action-detail-warning {
  background: rgba(196, 148, 74, 0.08);
}

.action-detail-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.action-detail-item {
  color: var(--text-secondary);
  line-height: 1.4;
  padding: 0.1rem 0;
}

.action-flag {
  margin-top: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: rgba(196, 148, 74, 0.1);
  border-left: 2px solid var(--warning);
  border-radius: 0 4px 4px 0;
  font-size: 0.7rem;
  color: var(--warning);
  font-weight: 500;
}

.action-progress-track {
  margin-top: 0.5rem;
  height: 4px;
  background: var(--sage-light);
  border-radius: 2px;
  overflow: hidden;
}

.action-progress-fill {
  height: 100%;
  background: var(--unison);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.action-confirmation {
  margin-top: 0.375rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════════════════════
   TYPING INDICATOR
   ═══════════════════════════════════════════════════════════ */

.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 0.875rem 1.125rem;
  align-self: flex-start;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--sage);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   CALL BAR
   ═══════════════════════════════════════════════════════════ */

#call-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.5rem;
  background: rgba(90, 154, 110, 0.08);
  border-top: 1px solid rgba(90, 154, 110, 0.25);
}

.call-bar-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--positive);
  font-weight: 600;
}

.call-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--positive);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(90, 154, 110, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(90, 154, 110, 0); }
}

#call-timer {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.call-bar-controls {
  display: flex;
  gap: 0.5rem;
}

.call-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-btn:hover { background: var(--sage-light); }

.call-btn-end {
  background: var(--negative);
  border-color: var(--negative);
  color: white;
}

.call-btn-end:hover { opacity: 0.9; background: var(--negative); }

/* Call start button in input bar */
.call-start-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.625rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  color: var(--positive);
  display: flex;
  align-items: center;
  justify-content: center;
}

.call-start-btn:hover {
  background: var(--positive-dim);
  border-color: var(--positive);
}

.call-start-btn.in-call {
  display: none;
}

/* Audio Visualizer */
#audio-visualizer {
  height: 28px;
  width: 120px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   IPC BARS (Relationship Dynamics)
   ═══════════════════════════════════════════════════════════ */

.ipc-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ipc-bar-label {
  width: 100px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: right;
  font-weight: 500;
}

.ipc-bar-track {
  flex: 1;
  height: 6px;
  background: var(--sage-light);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.ipc-bar-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.ipc-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 3px;
  transition: left 0.5s ease, width 0.5s ease, background 0.5s ease;
}

.ipc-bar-value {
  width: 40px;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ═══════════════════════════════════════════════════════════
   ANALYSIS CARDS
   ═══════════════════════════════════════════════════════════ */

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.analysis-item {
  background: var(--sage-light);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}

.analysis-item .label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.analysis-item .value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-top: 0.125rem;
}

.analysis-item .justification {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
  line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════
   APPRAISAL FEED
   ═══════════════════════════════════════════════════════════ */

.appraisal-entry {
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--border);
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  background: var(--sage-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.appraisal-entry.positive { border-left-color: var(--positive); }
.appraisal-entry.negative { border-left-color: var(--negative); }
.appraisal-entry .timestamp { color: var(--text-muted); font-size: 0.6rem; font-weight: 600; text-transform: uppercase; }
.appraisal-entry .thought { color: var(--text-secondary); font-style: italic; margin-top: 0.25rem; line-height: 1.4; }

/* ═══════════════════════════════════════════════════════════
   CUSTOMER FACTS
   ═══════════════════════════════════════════════════════════ */

.fact-pills {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.fact-pill {
  background: var(--sage-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 0.625rem;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-secondary);
  font-weight: 500;
}

.fact-pill.new {
  border-color: var(--unison);
  animation: factGlow 2s ease-out;
}

@keyframes factGlow {
  0% { box-shadow: 0 0 8px rgba(99, 102, 241, 0.4); }
  100% { box-shadow: none; }
}

.fact-confidence {
  font-size: 0.55rem;
  font-weight: 700;
  margin-right: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   PROFILE COMPLETENESS
   ═══════════════════════════════════════════════════════════ */

.completeness-bar {
  height: 5px;
  background: var(--sage-light);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.completeness-fill {
  height: 100%;
  background: var(--unison);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ═══════════════════════════════════════════════════════════
   PREQUAL TRACKER
   ═══════════════════════════════════════════════════════════ */

.prequal-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--sage-light);
}

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

.prequal-check {
  font-size: 0.85rem;
  color: var(--sage);
}

.prequal-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.prequal-value {
  color: var(--text-primary);
  font-weight: 600;
  margin-left: auto;
  font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════
   PERSONALITY BARS
   ═══════════════════════════════════════════════════════════ */

.personality-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.personality-bar-label {
  width: 120px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.personality-bar-track {
  flex: 1;
  height: 5px;
  background: var(--sage-light);
  border-radius: 3px;
  overflow: hidden;
}

.personality-bar-fill {
  height: 100%;
  background: var(--sage);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ═══════════════════════════════════════════════════════════
   OCTANT BADGE
   ═══════════════════════════════════════════════════════════ */

.octant-badge {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--unison);
  padding: 0.375rem;
  text-transform: capitalize;
  font-family: var(--font-sans);
}

/* ═══════════════════════════════════════════════════════════
   INNER THOUGHT
   ═══════════════════════════════════════════════════════════ */

.inner-thought-section {
  border-left: 3px solid var(--unison);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.inner-thought-section.pulse {
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.15);
}

.inner-thought-text {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.6;
  transition: opacity 0.3s ease;
  min-height: 2.5rem;
  opacity: 1;
  font-family: var(--font-serif);
}

.inner-thought-text.placeholder {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-style: normal;
}

.inner-thought-text.fade-out {
  opacity: 0;
}

.inner-thought-text.fade-in {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   CONFIDENCE INDICATOR
   ═══════════════════════════════════════════════════════════ */

.confidence-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.confidence-track {
  flex: 1;
  height: 6px;
  background: var(--sage-light);
  border-radius: 3px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--negative) 0%, var(--warning) 50%, var(--positive) 100%);
  transition: width 0.5s ease;
}

.confidence-label {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  min-width: 36px;
  text-align: right;
  color: var(--charcoal);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSE STRATEGY
   ═══════════════════════════════════════════════════════════ */

.strategy-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.strategy-tone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.strategy-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.strategy-tone-value {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--unison);
}

.strategy-section {
  margin-bottom: 0.5rem;
}

.strategy-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem 0;
}

.strategy-list li {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.2rem 0 0.2rem 0.75rem;
  border-left: 2px solid var(--sage);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.strategy-section.info-gather .strategy-list li {
  border-left-color: var(--warning);
}

.strategy-section.next-steps .strategy-list li {
  border-left-color: var(--positive);
}

/* ═══════════════════════════════════════════════════════════
   ALERTS PANEL
   ═══════════════════════════════════════════════════════════ */

.alerts-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius);
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  line-height: 1.4;
  animation: alertFadeIn 0.3s ease;
}

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

.alert-item.alert-critical {
  background: var(--negative-dim);
  border: 1px solid rgba(192, 87, 74, 0.25);
  color: var(--negative);
}

.alert-item.alert-warning {
  background: var(--warning-dim);
  border: 1px solid rgba(196, 148, 74, 0.25);
  color: #8B6914;
}

.alert-item.alert-info {
  background: var(--info-dim);
  border: 1px solid rgba(125, 143, 130, 0.2);
  color: var(--text-secondary);
}

.alert-icon { flex-shrink: 0; }
.alert-text { flex: 1; }

/* ═══════════════════════════════════════════════════════════
   CANVAS CONTAINERS
   ═══════════════════════════════════════════════════════════ */

#mood-space-canvas,
#behavioral-radar-canvas {
  border-radius: var(--radius);
  display: block;
}

/* ═══════════════════════════════════════════════════════════
   EMOTION TIMELINE (sparklines)
   ═══════════════════════════════════════════════════════════ */

.timeline-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.timeline-label {
  width: 70px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: right;
}

.timeline-sparkline {
  flex-shrink: 0;
  border-radius: 3px;
}

.timeline-value {
  width: 42px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', monospace;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════
   RELATIONSHIP INSIGHTS (maturity, novelty, deltas)
   ═══════════════════════════════════════════════════════════ */

.insights-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.insights-gauge {
  margin-bottom: 0.75rem;
}

.insights-gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.insights-gauge-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.insights-gauge-desc {
  font-size: 0.7rem;
  font-weight: 600;
  font-style: italic;
  font-family: var(--font-serif);
}

.insights-gauge-track {
  height: 4px;
  background: var(--sage-light);
  border-radius: 2px;
  overflow: hidden;
}

.insights-gauge-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.insights-deltas {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.insights-deltas-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.insights-delta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.insights-delta-chip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--sage-light);
  border: 1px solid var(--border);
}

.insights-delta-chip.positive {
  background: var(--positive-dim);
  border-color: rgba(90, 154, 110, 0.2);
}

.insights-delta-chip.negative {
  background: var(--negative-dim);
  border-color: rgba(192, 87, 74, 0.2);
}

.delta-name {
  color: var(--text-secondary);
}

.delta-value {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.6rem;
}

.insights-delta-chip.positive .delta-value {
  color: var(--positive);
}

.insights-delta-chip.negative .delta-value {
  color: var(--negative);
}

.insights-count {
  margin-top: 0.75rem;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════
   ICON BUTTON (legacy compatibility)
   ═══════════════════════════════════════════════════════════ */

.icon-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.625rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.icon-btn:hover { background: var(--sage-light); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE / OVERRIDES
   ═══════════════════════════════════════════════════════════ */

/* Ensure input bar on main screen doesn't get primary-btn full-width treatment */
#input-bar .primary-btn {
  width: auto;
}

/* Canvas styling */
canvas {
  max-width: 100%;
}
