/* Adaptive Emotional Design System
   Colors and styles shift subtly based on meeting context and conversation tone.
   All transitions are slow (3-5s) so changes feel organic, not jarring.
*/

:root {
  /* Base palette - these get interpolated based on mood */
  --hue-base: 230;           /* Blue default, shifts warmer/cooler */
  --saturation-base: 60%;    /* Shifts based on energy */
  --lightness-base: 50%;
  
  /* Mood dimensions (0-100, set by JS) */
  --mood-warmth: 50;         /* 0=cool/formal, 100=warm/friendly */
  --mood-intensity: 50;      /* 0=calm/low-stakes, 100=high-stakes/urgent */
  --mood-formality: 50;      /* 0=casual, 100=professional */
  
  /* Derived values - computed from mood */
  --hue: calc(var(--hue-base) + (var(--mood-warmth) - 50) * 0.8);
  --sat: calc(var(--saturation-base) + (var(--mood-intensity) - 50) * 0.3%);
  
  /* Primary colors */
  --primary-h: var(--hue);
  --primary-s: var(--sat);
  --primary-l: 45%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-dark: hsl(var(--primary-h), var(--primary-s), 35%);
  --primary-light: hsl(var(--primary-h), calc(var(--primary-s) * 0.5), 95%);
  
  /* Background - subtle warmth shift */
  --bg-h: calc(var(--hue) + 10);
  --bg-s: calc(5% + (var(--mood-warmth) - 50) * 0.1%);
  --bg-l: calc(98% - (var(--mood-intensity) - 50) * 0.02%);
  --bg: hsl(var(--bg-h), var(--bg-s), var(--bg-l));
  
  /* Card backgrounds */
  --card-bg: hsl(0, 0%, 100%);
  --card-shadow: 0 1px 3px hsla(var(--hue), 20%, 20%, 0.08);
  --card-shadow-hover: 0 4px 12px hsla(var(--hue), 20%, 20%, 0.12);
  
  /* Text */
  --text: hsl(var(--hue), 15%, 15%);
  --text-muted: hsl(var(--hue), 10%, 45%);
  --text-light: hsl(var(--hue), 8%, 60%);
  
  /* Borders - softer when warm, crisper when formal */
  --border-l: calc(88% - (var(--mood-formality) - 50) * 0.1%);
  --border: hsl(var(--hue), 8%, var(--border-l));
  
  /* Border radius - rounder when warm/casual, sharper when formal */
  --radius-base: calc(12px - (var(--mood-formality) - 50) * 0.08px);
  --radius-sm: calc(var(--radius-base) * 0.5);
  --radius-lg: calc(var(--radius-base) * 1.5);
  --radius-full: 9999px;
  
  /* Spacing - more breathing room when calm */
  --space-modifier: calc(1 + (50 - var(--mood-intensity)) * 0.002);
  --space-xs: calc(4px * var(--space-modifier));
  --space-sm: calc(8px * var(--space-modifier));
  --space-md: calc(16px * var(--space-modifier));
  --space-lg: calc(24px * var(--space-modifier));
  --space-xl: calc(40px * var(--space-modifier));
  
  /* Chat bubbles */
  --user-bubble: var(--primary);
  --user-bubble-text: white;
  --ai-bubble: var(--primary-light);
  --ai-bubble-text: var(--text);
  
  /* Status colors - intensity affects vibrancy */
  --success-s: calc(50% + (var(--mood-intensity) - 50) * 0.3%);
  --success: hsl(160, var(--success-s), 42%);
  --error: hsl(0, var(--success-s), 50%);
  --warning: hsl(40, var(--success-s), 50%);
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-weight-normal: calc(400 + (var(--mood-formality) - 50) * 0.2);
  --font-weight-medium: calc(500 + (var(--mood-formality) - 50) * 0.2);
  --font-weight-bold: calc(600 + (var(--mood-formality) - 50) * 0.3);
  
  /* Line height - tighter when intense */
  --line-height: calc(1.6 - (var(--mood-intensity) - 50) * 0.002);
  
  /* Transitions - everything moves slowly */
  --transition-mood: 4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
}

/* Apply transitions to all mood-affected properties */
*, *::before, *::after {
  transition: 
    background-color var(--transition-mood),
    border-color var(--transition-mood),
    color var(--transition-mood),
    box-shadow var(--transition-mood),
    border-radius var(--transition-mood);
}

/* Override for interactive elements - they need fast feedback */
button, a, input, textarea, .interactive {
  transition: 
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

/* ===== BASE STYLES ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: var(--line-height);
  min-height: 100vh;
}

:root {
  --brief-bg: var(--bg);
}

body.brief-view {
  background: var(--brief-bg);
}

body.brief-view[data-meeting-type="negotiation"] {
  --hue-base: 215;
  --mood-warmth: 32;
  --mood-intensity: 78;
  --mood-formality: 70;
  --brief-bg: radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.18), transparent 55%),
              radial-gradient(circle at 85% 0%, rgba(239, 68, 68, 0.14), transparent 45%),
              var(--bg);
}

body.brief-view[data-meeting-type="decision"] {
  --hue-base: 225;
  --mood-warmth: 38;
  --mood-intensity: 68;
  --mood-formality: 72;
  --brief-bg: radial-gradient(circle at 10% 15%, rgba(37, 99, 235, 0.18), transparent 55%),
              radial-gradient(circle at 80% 10%, rgba(234, 179, 8, 0.18), transparent 45%),
              var(--bg);
}

body.brief-view[data-meeting-type="alignment"] {
  --hue-base: 195;
  --mood-warmth: 55;
  --mood-intensity: 40;
  --mood-formality: 45;
  --brief-bg: radial-gradient(circle at 10% 10%, rgba(45, 212, 191, 0.16), transparent 55%),
              radial-gradient(circle at 90% 20%, rgba(14, 116, 144, 0.12), transparent 50%),
              var(--bg);
}

body.brief-view[data-meeting-type="exploration"] {
  --hue-base: 25;
  --mood-warmth: 75;
  --mood-intensity: 48;
  --mood-formality: 35;
  --brief-bg: radial-gradient(circle at 12% 8%, rgba(251, 146, 60, 0.22), transparent 55%),
              radial-gradient(circle at 88% 18%, rgba(244, 63, 94, 0.14), transparent 50%),
              var(--bg);
}

body.brief-view[data-meeting-type="relationship"] {
  --hue-base: 120;
  --mood-warmth: 85;
  --mood-intensity: 32;
  --mood-formality: 25;
  --brief-bg: radial-gradient(circle at 15% 12%, rgba(34, 197, 94, 0.2), transparent 55%),
              radial-gradient(circle at 85% 15%, rgba(250, 204, 21, 0.16), transparent 50%),
              var(--bg);
}

body.brief-view[data-meeting-type="conflict"] {
  --hue-base: 350;
  --mood-warmth: 30;
  --mood-intensity: 82;
  --mood-formality: 65;
  --brief-bg: radial-gradient(circle at 12% 12%, rgba(190, 24, 93, 0.18), transparent 55%),
              radial-gradient(circle at 88% 8%, rgba(15, 23, 42, 0.12), transparent 50%),
              var(--bg);
}

/* ===== TYPOGRAPHY ===== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.375rem; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; }

p {
  margin-bottom: var(--space-md);
}

/* ===== LAYOUT ===== */

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-lg);
}

/* ===== HEADER ===== */

.header {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-xs);
}

.tagline {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: var(--font-weight-normal);
}

/* ===== CARDS ===== */

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

.card h2 {
  font-size: 1.125rem;
  margin-bottom: var(--space-md);
}

/* ===== FORMS ===== */

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-weight: var(--font-weight-medium);
  font-size: 0.875rem;
  margin-bottom: var(--space-xs);
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
  font-size: 1rem;
  font-family: inherit;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-section {
  margin: var(--space-lg) 0;
}

.form-section h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.choice-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.choice-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  background: var(--card-bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.choice-card input {
  accent-color: var(--primary);
}

.choice-card.is-selected {
  border-color: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.6);
  box-shadow: 0 0 0 3px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);
}

.choice-title {
  font-weight: var(--font-weight-medium);
}

.choice-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: 0.9375rem;
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  border: none;
  border-radius: var(--radius-base);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
  padding: var(--space-md) var(--space-lg);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--ai-bubble);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

/* ===== CHAT UI ===== */

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg);
}

.chat-header {
  padding: var(--space-md) var(--space-lg);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.chat-header h1 {
  font-size: 1rem;
  color: var(--primary);
  font-weight: var(--font-weight-bold);
}

.chat-header .meeting-title {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  font-weight: var(--font-weight-normal);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.message {
  max-width: 90%;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  line-height: 1.5;
  font-size: 1rem;
}

.message.user {
  background: var(--user-bubble);
  color: var(--user-bubble-text);
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
}

.message.assistant {
  background: var(--ai-bubble);
  color: var(--ai-bubble-text);
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm);
}

.message.typing {
  background: var(--ai-bubble);
  color: var(--text-muted);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: var(--space-xs) 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-3px); opacity: 1; }
}

/* Chat input */
.chat-input-container {
  padding: var(--space-md) var(--space-lg);
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

.chat-input-form {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  min-height: 44px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card-bg);
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.send-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.send-btn:active {
  transform: scale(0.98);
}

.send-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.send-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== COMPLETION STATE ===== */

.chat-complete {
  text-align: center;
  padding: var(--space-xl);
}

.chat-complete .icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}

.chat-complete h2 {
  color: var(--success);
  margin-bottom: var(--space-sm);
}

.chat-complete p {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* ===== BRIEF PAGE ===== */

.brief-container {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.brief-header {
  text-align: center;
  padding: var(--space-lg) 0 var(--space-xl);
}

.brief-header h1 {
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.brief-header .subtitle {
  color: var(--text-muted);
}

.brief-content {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.brief-content h1,
.brief-content h2,
.brief-content h3 {
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.brief-section-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--card-shadow);
}

.brief-section-card h3 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--text);
}

.brief-section-card p {
  color: var(--text-muted);
}

.one-move-callout {
  background: linear-gradient(
    120deg,
    hsla(var(--primary-h), var(--primary-s), 94%, 0.9),
    hsla(var(--primary-h), var(--primary-s), 98%, 0.7)
  );
  border: 1px solid hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--card-shadow);
}

.one-move-callout h3 {
  margin-top: 0;
  color: var(--primary);
}

.one-move-callout p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.say-avoid-callout {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--card-bg);
}

.say-avoid-callout h3 {
  margin-top: 0;
}

.say-avoid-callout p strong {
  color: var(--primary);
}

.say-avoid-callout ul {
  margin: var(--space-xs) 0 var(--space-sm);
}

/* ===== SHARE CARDS ===== */

.share-cards-section {
  margin: var(--space-lg) 0;
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

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

.share-cards-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
}

.share-cards-header p {
  margin: var(--space-xs) 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.share-cards-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.legend-on {
  background: var(--success);
}

.legend-off {
  background: var(--border);
}

.share-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
}

.share-cards-empty .share-card-grid {
  grid-template-columns: 1fr;
}

.share-cards-empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--card-bg);
}

.share-cards-empty-state h4 {
  margin: 0 0 var(--space-xs);
  font-size: 0.95rem;
}

.share-cards-empty-state p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.share-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--card-bg);
}

.share-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.share-card-label {
  font-weight: var(--font-weight-medium);
  font-size: 0.95rem;
}

.share-card-content {
  margin: 0 0 var(--space-sm);
  color: var(--text-muted);
  line-height: 1.4;
  font-size: 0.9rem;
}

.share-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 0.8rem;
  font-weight: var(--font-weight-medium);
}

.share-card-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.share-card-status.is-private {
  color: var(--text-muted);
}

.share-toggle {
  position: relative;
  width: 42px;
  height: 22px;
}

.share-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.share-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
}

.share-toggle-track::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--card-bg);
  top: 2px;
  left: 2px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: var(--transition-fast);
}

.share-toggle input:checked + .share-toggle-track {
  background: var(--success);
}

.share-toggle input:checked + .share-toggle-track::after {
  transform: translateX(20px);
}

/* ===== BRIEF LOADING ===== */

.loading-panel {
  background: var(--card-bg);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.loading-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

.loading-title {
  font-size: 1.1rem;
  font-weight: var(--font-weight-medium);
  margin-bottom: 4px;
}

.loading-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.loading-step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.loading-step.active {
  color: var(--text);
  font-weight: var(--font-weight-medium);
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--transition-fast);
}

.loading-step.active .step-dot {
  background: var(--primary);
}

.loading-specific {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--bg);
}

.loading-specific-title {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
}

.loading-specific-headline {
  margin: var(--space-xs) 0 var(--space-sm);
  font-size: 0.95rem;
  color: var(--text);
  font-weight: var(--font-weight-medium);
}

.loading-specific ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading-specific li + li {
  margin-top: 6px;
}

.loading-tip {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border: 1px dashed var(--border);
}

.loading-tip-title {
  font-size: 0.9rem;
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-xs);
}

.loading-tip ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading-tip li + li {
  margin-top: 6px;
}

.brief-ready-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  margin-bottom: var(--space-lg);
}

.brief-ready-banner h3 {
  margin: 0;
  border: none;
  padding: 0;
}

.brief-ready-banner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.brief-ready-banner button {
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  cursor: pointer;
  font-weight: var(--font-weight-medium);
}

.brief-ready-banner button:hover {
  transform: translateY(-1px);
}

.brief-sync-cta {
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
}

.brief-sync-cta h3 {
  margin: 0 0 var(--space-xs);
}

.brief-sync-cta p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.brief-sync-cta .cta-status {
  flex-basis: 100%;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.brief-sync-cta .btn-primary {
  width: auto;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  box-shadow: var(--card-shadow);
}

.brief-content h1:first-child,
.brief-content h2:first-child {
  margin-top: 0;
}

.brief-content h2 {
  color: var(--primary);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.brief-content ul,
.brief-content ol {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.brief-content li {
  margin-bottom: var(--space-sm);
}

.brief-content li::marker {
  color: var(--primary);
}

.insight-card {
  background: linear-gradient(135deg, var(--primary-light), var(--card-bg));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: var(--card-shadow);
}

.insight-card h2 {
  margin-bottom: var(--space-xs);
  color: var(--primary);
  font-size: 1rem;
}

.insight-card p {
  margin: 0 0 var(--space-sm);
  color: var(--text-muted);
}

.insight-card ul,
.insight-card ol {
  margin-left: var(--space-md);
  margin-bottom: 0;
}

.brief-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

.brief-toolbar .btn-secondary {
  font-size: 0.875rem;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-weight: var(--font-weight-medium);
}

.brief-toolbar .btn-secondary:hover {
  background: var(--bg);
  transform: translateY(-1px);
}

.copy-feedback {
  font-size: 0.875rem;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.copy-feedback.visible {
  opacity: 1;
}

.single-party-note {
  background: var(--ai-bubble);
  border-left: 4px solid var(--primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-base);
  margin-bottom: var(--space-md);
  font-size: 0.9375rem;
}

.single-party-note .polling-status {
  margin-top: var(--space-xs);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.update-notification {
  background: hsl(150, 50%, 95%);
  border: 1px solid hsl(150, 50%, 85%);
  color: var(--success);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-base);
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
  text-align: center;
}

.not-ready {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--card-shadow);
  text-align: center;
}

.not-ready h2 {
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.not-ready p {
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

/* ===== MODAL ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: hsla(var(--hue), 20%, 10%, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  z-index: 1000;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px hsla(var(--hue), 20%, 10%, 0.3);
}

.modal h2 {
  color: var(--success);
  margin-bottom: var(--space-md);
}

.link-group {
  margin-bottom: var(--space-md);
}

.link-group label {
  display: block;
  font-weight: var(--font-weight-medium);
  font-size: 0.8125rem;
  margin-bottom: var(--space-xs);
  color: var(--text-muted);
}

.link-input-group {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.link-input {
  flex: 1;
  padding: var(--space-sm) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: monospace;
  background: var(--bg);
  color: var(--text);
}

textarea.link-input {
  resize: vertical;
  min-height: 90px;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
}

.invite-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--bg);
  margin-bottom: var(--space-md);
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.invite-preview-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--text-light);
  margin-bottom: var(--space-xs);
}

.auto-start {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.copy-btn {
  padding: var(--space-sm) var(--space-md);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: var(--font-weight-medium);
}

.copy-btn:hover {
  background: var(--primary-dark);
}

.modal-footer {
  margin-top: var(--space-lg);
  text-align: center;
}

/* ===== UTILITIES ===== */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error {
  background: hsl(0, 50%, 97%);
  color: var(--error);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-base);
  border: 1px solid hsl(0, 50%, 90%);
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
}

.hidden {
  display: none !important;
}

/* ===== MOOD PRESETS (for testing) ===== */

.mood-warm {
  --mood-warmth: 75;
  --mood-intensity: 40;
  --mood-formality: 30;
}

.mood-professional {
  --mood-warmth: 35;
  --mood-intensity: 55;
  --mood-formality: 75;
}

.mood-intense {
  --mood-warmth: 45;
  --mood-intensity: 80;
  --mood-formality: 60;
}

.mood-calm {
  --mood-warmth: 55;
  --mood-intensity: 25;
  --mood-formality: 40;
}

/* ===== INPUT BAR ===== */

.input-bar {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.input-bar .chat-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: var(--space-sm);
  font-size: 0.9375rem;
}

.input-bar .chat-input:focus {
  outline: none;
  box-shadow: none;
}

.input-icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.input-icon-btn:hover {
  background: var(--ai-bubble);
  color: var(--primary);
}

.input-icon-btn:active {
  transform: scale(0.95);
}

.input-icon-btn.send-btn {
  background: var(--primary);
  color: white;
}

.input-icon-btn.send-btn:hover {
  background: var(--primary-dark);
  color: white;
}

.input-icon-btn.send-btn:disabled {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Upload status */
.upload-status {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  text-align: center;
  background: var(--ai-bubble);
  border-radius: var(--radius-base);
  margin-bottom: var(--space-sm);
}

.upload-status.error {
  color: var(--error);
  background: hsl(0, 50%, 97%);
  border: 1px solid hsl(0, 50%, 90%);
}

.upload-status.success {
  color: var(--success);
  background: hsl(160, 50%, 97%);
  border: 1px solid hsl(160, 50%, 90%);
}

.upload-status.uploading {
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--border);
}

.upload-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ===== VOICE OVERLAY ===== */

.voice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.voice-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  color: white;
}

.voice-visualizer {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 60px;
}

.visualizer-bar {
  width: 6px;
  height: 20px;
  background: var(--primary);
  border-radius: 3px;
  animation: visualize 0.8s ease-in-out infinite;
}

.visualizer-bar:nth-child(1) { animation-delay: 0s; }
.visualizer-bar:nth-child(2) { animation-delay: 0.1s; }
.visualizer-bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer-bar:nth-child(4) { animation-delay: 0.3s; }
.visualizer-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes visualize {
  0%, 100% { height: 20px; }
  50% { height: 50px; }
}

.voice-status {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.voice-status.error {
  color: var(--error);
}

.stop-voice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--error);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  font-size: 0.9375rem;
  cursor: pointer;
}

.stop-voice-btn:hover {
  background: hsl(0, 70%, 45%);
  transform: scale(1.02);
}

/* Transcribing indicator */
.transcribing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.transcribing-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===== PROGRESS ===== */

.progress-wrap {
  margin: 0 var(--space-lg) var(--space-md);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: hsl(var(--hue), 15%, 92%);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 0.6s ease;
}

/* ===== BRIEF SHARE CONTROLS ===== */

.brief-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: var(--space-xs) 0 var(--space-sm);
  margin-bottom: var(--space-sm);
}

.brief-share-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  width: 100%;
}

.share-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.85rem;
  color: var(--text);
}

.share-chip input[type="checkbox"] {
  width: 14px;
  height: 14px;
}

.insight-card .brief-share-row {
  margin-top: var(--space-sm);
}
