/*
 * ═══════════════════════════════════════════════════════════════
 * XFACTORAI RE COACH v0.1: STAGE 1: FOUNDATION
 * Mobile-first • SIS Color System • Touch Optimized
 * ═══════════════════════════════════════════════════════════════
 */

/* ─────────────────────────────────────────────────────────────
   CSS RESET: Mobile Optimized
   ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    background: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--ink);
    min-height: 100vh;
    min-height: 100dvh;
    /* Dynamic viewport height for mobile */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
}

/* ─────────────────────────────────────────────────────────────
   SIS COLOR SYSTEM: Sales Inevitability Score
   PREMIUM PALETTE: Vibrant, High-Contrast, Professional
   ───────────────────────────────────────────────────────────── */
:root {
    /* SIS Border Colors - PREMIUM High-Contrast Palette */
    --sis-green: #00D9A5;
    /* Emerald Glow - 75-100%: Strong/Likely Close */
    --sis-blue: #00B4FF;
    /* Electric Blue - 55-74%: Good position */
    --sis-yellow: #FFB800;
    /* Golden Amber - 35-54%: Uncertain */
    --sis-red: #FF4757;
    /* Coral Red - 0-34%: At Risk */

    /* SIS Background Tints (for badges) - Richer, more visible */
    --sis-green-bg: rgba(0, 217, 165, 0.2);
    --sis-blue-bg: rgba(0, 180, 255, 0.2);
    --sis-yellow-bg: rgba(255, 184, 0, 0.2);
    --sis-red-bg: rgba(255, 71, 87, 0.2);

    /* SIS Glow Effects */
    --sis-green-glow: 0 0 20px rgba(0, 217, 165, 0.4), 0 0 40px rgba(0, 217, 165, 0.2);
    --sis-blue-glow: 0 0 20px rgba(0, 180, 255, 0.4), 0 0 40px rgba(0, 180, 255, 0.2);
    --sis-yellow-glow: 0 0 20px rgba(255, 184, 0, 0.4), 0 0 40px rgba(255, 184, 0, 0.2);
    --sis-red-glow: 0 0 20px rgba(255, 71, 87, 0.4), 0 0 40px rgba(255, 71, 87, 0.2);

    /* Spacing Scale (touch-friendly) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Touch Target Minimum */
    --touch-min: 44px;

    /* Border Radius - Slightly more refined */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* SIS Border Width */
    --sis-border-width: 3px;

    /* Safe Areas (notch phones) */
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
    --safe-left: env(safe-area-inset-left);
    --safe-right: env(safe-area-inset-right);
}

/* ─────────────────────────────────────────────────────────────
   THEMES: UNIFIED Theme System (matches all XFactorAI apps)
   ───────────────────────────────────────────────────────────── */

/* Midnight Theme (Dark - Default) */
:root,
[data-theme="midnight"] {
  --bg: #0b1221;
  --bg-alt: #101827;
  --bg-gradient: linear-gradient(180deg, #0b1221 0%, #111827 50%, #1a2332 100%);
  --bg-card: #1a2332;
  --bg-card-hover: #243041;
  --bg-input: #1f2937;
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --surface: #1a2436;
  --panel: #1a2332;
  --panel-light: #293548;
  --ink: #f8fafc;
  --ink-secondary: #94a3b8;
  --ink-muted: #64748b;
  --muted: #64748b;
  --line: #334155;
  --line-soft: #1e293b;
  --border: rgba(255, 255, 255, 0.06);
  --accent: #10b981;
  --accent-secondary: #059669;
  --accent-ink: #ffffff;
  --accent-glow: rgba(16, 185, 129, 0.15);
  --cyan: #06b6d4;
  --teal: #10b981;
  --orange: #f97316;
  --gold: #E9C46A;
  --glow: 0 18px 44px rgba(0,0,0,0.4);
  --blue-500: #10b981;
  --blue-600: #059669;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --card-border: 1px solid rgba(255, 255, 255, 0.08);
  --card-border-hover: 1px solid rgba(255, 255, 255, 0.15);
}

/* Cream Theme (Light) */
[data-theme="cream"] {
  --bg: #fdfbf7;
  --bg-alt: #f8f5f0;
  --bg-gradient: linear-gradient(180deg, #fdfbf7 0%, #f8f5f0 50%, #f0ebe3 100%);
  --bg-card: #ffffff;
  --bg-card-hover: #f8f5f0;
  --bg-input: #f0ebe3;
  --bg-glass: rgba(0, 0, 0, 0.02);
  --bg-glass-hover: rgba(0, 0, 0, 0.04);
  --bg-hover: rgba(0, 0, 0, 0.03);
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-light: #f0ebe3;
  --ink: #1a1a1a;
  --ink-secondary: #4a4a4a;
  --ink-muted: #7a7a7a;
  --muted: #7a7a7a;
  --line: #e5e0d8;
  --line-soft: #f0ebe3;
  --border: #d4cfc4;
  --accent: #d97706;
  --accent-secondary: #b45309;
  --accent-ink: #ffffff;
  --accent-glow: rgba(217, 119, 6, 0.1);
  --cyan: #0891b2;
  --teal: #0d9488;
  --glow: 0 18px 44px rgba(0,0,0,0.08);
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --card-border: 1px solid #e5e0d8;
  --card-border-hover: 1px solid #d4cfc4;
}

/* Ocean Breeze Theme (Light) */
[data-theme="ocean"] {
  --bg: #f0f9ff;
  --bg-alt: #e0f2fe;
  --bg-gradient: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 50%, #bae6fd 100%);
  --bg-card: #ffffff;
  --bg-card-hover: #e0f2fe;
  --bg-input: #e0f2fe;
  --bg-glass: rgba(0, 0, 0, 0.02);
  --bg-glass-hover: rgba(0, 0, 0, 0.04);
  --bg-hover: rgba(0, 0, 0, 0.03);
  --surface: #ffffff;
  --panel: #ffffff;
  --panel-light: #e0f2fe;
  --ink: #0c4a6e;
  --ink-secondary: #075985;
  --ink-muted: #0369a1;
  --muted: #0369a1;
  --line: #bae6fd;
  --line-soft: #e0f2fe;
  --border: #bae6fd;
  --accent: #0284c7;
  --accent-secondary: #0369a1;
  --accent-ink: #ffffff;
  --accent-glow: rgba(2, 132, 199, 0.1);
  --cyan: #0284c7;
  --teal: #0d9488;
  --glow: 0 18px 44px rgba(0,0,0,0.08);
  --blue-500: #0ea5e9;
  --blue-600: #0284c7;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --card-border: 1px solid #bae6fd;
  --card-border-hover: 1px solid #7dd3fc;
}

/* Tanzanite Theme (Dark) */
[data-theme="tanzanite"] {
  --bg: #0f0d1a;
  --bg-alt: #1a1625;
  --bg-gradient: linear-gradient(180deg, #0f0d1a 0%, #1a1625 50%, #1e1a2e 100%);
  --bg-card: #1e1a2e;
  --bg-card-hover: #2a2540;
  --bg-input: #252136;
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --surface: #252136;
  --panel: #1e1a2e;
  --panel-light: #352f4a;
  --ink: #e8e4f0;
  --ink-secondary: #c4bdd4;
  --ink-muted: #8b82a8;
  --muted: #8b82a8;
  --line: #3d3654;
  --line-soft: #2a2440;
  --border: #3d3654;
  --accent: #a78bfa;
  --accent-secondary: #8b5cf6;
  --accent-ink: #ffffff;
  --accent-glow: rgba(167, 139, 250, 0.15);
  --cyan: #a78bfa;
  --teal: #8b5cf6;
  --glow: 0 18px 44px rgba(0,0,0,0.4);
  --blue-500: #a78bfa;
  --blue-600: #8b5cf6;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --card-border: 1px solid rgba(167, 139, 250, 0.1);
  --card-border-hover: 1px solid rgba(167, 139, 250, 0.2);
}

/* Obsidian Theme (Dark) */
[data-theme="obsidian"] {
  --bg: #09090b;
  --bg-alt: #18181b;
  --bg-gradient: linear-gradient(180deg, #09090b 0%, #18181b 50%, #1c1c1f 100%);
  --bg-card: #1c1c1f;
  --bg-card-hover: #27272a;
  --bg-input: #27272a;
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --surface: #27272a;
  --panel: #1c1c1f;
  --panel-light: #3f3f46;
  --ink: #fafafa;
  --ink-secondary: #d4d4d8;
  --ink-muted: #71717a;
  --muted: #71717a;
  --line: #3f3f46;
  --line-soft: #27272a;
  --border: #3f3f46;
  --accent: #f59e0b;
  --accent-secondary: #d97706;
  --accent-ink: #000000;
  --accent-glow: rgba(245, 158, 11, 0.15);
  --cyan: #f59e0b;
  --teal: #d97706;
  --glow: 0 18px 44px rgba(0,0,0,0.4);
  --blue-500: #f59e0b;
  --blue-600: #d97706;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --card-border: 1px solid rgba(255, 255, 255, 0.08);
  --card-border-hover: 1px solid rgba(255, 255, 255, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   UNIFIED TOOLBAR STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.app-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-toolbar.active {
  display: flex;
}

/* Toolbar Sections */
.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* Theme Selector */
.theme-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-label {
  display: flex;
  align-items: center;
  color: var(--muted);
}

.theme-label svg {
  width: 18px;
  height: 18px;
}

.theme-selector select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.theme-selector select:hover {
  border-color: var(--cyan);
}

.theme-selector select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

@media (max-width: 768px) {
  .theme-selector select {
    padding: 6px 28px 6px 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .theme-selector {
    display: none;
  }
}

/* Toolbar Buttons */
.toolbar-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.toolbar-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

.toolbar-btn:hover {
  border-color: var(--cyan);
}

.toolbar-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toolbar-btn:hover {
  background: var(--bg-card-hover);
}

.toolbar-btn:active {
  transform: scale(0.95);
}

/* Toolbar Logo */
.toolbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-logo .logo-icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.toolbar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #050811;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.toolbar-logo .logo-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
}

@media (max-width: 600px) {
  .toolbar-logo .logo-text {
    display: none;
  }
}

/* Profile Button & Dropdown */
.toolbar-profile {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-btn:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: #050811;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-chevron {
  color: var(--ink-muted);
  transition: transform 0.2s ease;
}

.toolbar-profile.open .profile-chevron {
  transform: rotate(180deg);
}

@media (max-width: 600px) {
  .profile-name {
    display: none;
  }
  .profile-btn {
    padding: 6px;
    border-radius: 50%;
  }
  .profile-chevron {
    display: none;
  }
}

/* Profile Dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transform-origin: top right;
  transition: all 0.2s ease;
  z-index: 1001;
}

.toolbar-profile.open .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: #050811;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-user-details {
  flex: 1;
  min-width: 0;
}

.dropdown-user-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-email {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-plan {
  font-size: 0.7rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--surface);
}

.dropdown-item:last-child {
  border-radius: 0 0 12px 12px;
}

.dropdown-item svg {
  color: var(--muted);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP LAUNCHER STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.app-launcher-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 998;
}

.app-launcher-overlay.active {
  opacity: 1;
  visibility: visible;
}

.app-launcher {
  position: fixed;
  top: 64px;
  left: 16px;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(-10px);
  transform-origin: top left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  overflow: hidden;
}

.app-launcher.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.app-launcher-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.app-launcher-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px;
}

.app-launcher-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--ink);
}

.app-launcher-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--line);
}

.app-launcher-item.current {
  background: var(--bg-card-hover);
  border-color: var(--cyan);
}

.app-launcher-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--bg-card-hover), var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  transition: all 0.2s ease;
}

.app-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.app-launcher-item:hover .app-launcher-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.app-launcher-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  color: var(--ink);
  line-height: 1.3;
}

@media (max-width: 400px) {
  .app-launcher {
    left: 8px;
    right: 8px;
    width: auto;
  }
}

/* Adjust body padding when toolbar is visible */
body.toolbar-active {
  padding-top: 56px;
}

/* Hide old user-info-badge when toolbar is active */
body.toolbar-active .user-info-badge {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASS SYSTEM: Responsive-ready building blocks
   ═══════════════════════════════════════════════════════════════ */

/* Breakpoints Reference:
   Mobile:  < 640px (default, no prefix)
   Tablet:  >= 640px (sm:)
   Desktop: >= 1024px (lg:)
   Wide:    >= 1400px (xl:)
*/

/* ─────────────────────────────────────────────────────────────
   GRID UTILITIES
   ───────────────────────────────────────────────────────────── */
.grid {
    display: grid;
}

.grid-1 {
    display: grid;
    grid-template-columns: 1fr;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive grid - stack on mobile */
.grid-2-1 {
    display: grid;
    grid-template-columns: 1fr;
}

.grid-4-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.grid-4-2-1 {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .sm\:grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .sm\:grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .sm\:grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-2-1 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4-2 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-4-2-1 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .lg\:grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .lg\:grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .lg\:grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid-4-2-1 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ─────────────────────────────────────────────────────────────
   GAP UTILITIES
   ───────────────────────────────────────────────────────────── */
.gap-xs {
    gap: var(--space-xs);
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.gap-xl {
    gap: var(--space-xl);
}

/* ─────────────────────────────────────────────────────────────
   PADDING UTILITIES
   ───────────────────────────────────────────────────────────── */
.p-0 {
    padding: 0;
}

.p-xs {
    padding: var(--space-xs);
}

.p-sm {
    padding: var(--space-sm);
}

.p-md {
    padding: var(--space-md);
}

.p-lg {
    padding: var(--space-lg);
}

.p-xl {
    padding: var(--space-xl);
}

.px-sm {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
}

.px-md {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

.px-lg {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
}

.py-sm {
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
}

.py-md {
    padding-top: var(--space-md);
    padding-bottom: var(--space-md);
}

.py-lg {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
}

/* ─────────────────────────────────────────────────────────────
   MARGIN UTILITIES
   ───────────────────────────────────────────────────────────── */
.m-0 {
    margin: 0;
}

.mb-xs {
    margin-bottom: var(--space-xs);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

/* ─────────────────────────────────────────────────────────────
   TEXT UTILITIES
   ───────────────────────────────────────────────────────────── */
.text-xs {
    font-size: 10px;
}

.text-sm {
    font-size: 12px;
}

.text-md {
    font-size: 14px;
}

.text-lg {
    font-size: 16px;
}

.text-xl {
    font-size: 20px;
}

.text-2xl {
    font-size: 24px;
}

.text-3xl {
    font-size: 32px;
}

.text-4xl {
    font-size: 42px;
}

.text-5xl {
    font-size: 56px;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-black {
    font-weight: 900;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.leading-tight {
    line-height: 1.2;
}

.leading-normal {
    line-height: 1.5;
}

.leading-relaxed {
    line-height: 1.7;
}

.tracking-wide {
    letter-spacing: 1px;
}

.tracking-wider {
    letter-spacing: 2px;
}

.uppercase {
    text-transform: uppercase;
}

/* ─────────────────────────────────────────────────────────────
   COLOR UTILITIES
   ───────────────────────────────────────────────────────────── */
.text-ink {
    color: var(--ink);
}

.text-secondary {
    color: var(--ink-secondary);
}

.text-muted {
    color: var(--ink-muted);
}

.text-accent {
    color: var(--accent);
}

.text-white {
    color: white;
}

.text-green {
    color: var(--sis-green);
}

.text-blue {
    color: var(--sis-blue);
}

.text-yellow {
    color: var(--sis-yellow);
}

.text-red {
    color: var(--sis-red);
}

.bg-dark {
    background: var(--bg);
}

.bg-card {
    background: var(--bg-card);
}

.bg-input {
    background: var(--bg-input);
}

.bg-accent {
    background: var(--accent);
}

.bg-green {
    background: var(--sis-green);
}

.bg-blue {
    background: var(--sis-blue);
}

.bg-yellow {
    background: var(--sis-yellow);
}

.bg-red {
    background: var(--sis-red);
}

.bg-white {
    background: white;
}

.bg-transparent {
    background: transparent;
}

.bg-glass {
    background: rgba(255, 255, 255, 0.05);
}

.bg-glass-dark {
    background: rgba(0, 0, 0, 0.3);
}

/* ─────────────────────────────────────────────────────────────
   BORDER UTILITIES
   ───────────────────────────────────────────────────────────── */
.rounded-sm {
    border-radius: var(--radius-sm);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: var(--radius-full);
}

.border {
    border: 1px solid var(--line);
}

.border-2 {
    border: 2px solid var(--line);
}

.border-accent {
    border-color: var(--accent);
}

.border-green {
    border-color: var(--sis-green);
}

.border-transparent {
    border-color: transparent;
}

/* ─────────────────────────────────────────────────────────────
   FLEXBOX UTILITIES
   ───────────────────────────────────────────────────────────── */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

/* ─────────────────────────────────────────────────────────────
   SIZING UTILITIES
   ───────────────────────────────────────────────────────────── */
.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.min-h-touch {
    min-height: var(--touch-min);
}

/* ─────────────────────────────────────────────────────────────
   DISPLAY UTILITIES
   ───────────────────────────────────────────────────────────── */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.inline-flex {
    display: inline-flex;
}

@media (min-width: 640px) {
    .sm\:hidden {
        display: none;
    }

    .sm\:block {
        display: block;
    }

    .sm\:flex {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .lg\:hidden {
        display: none;
    }

    .lg\:block {
        display: block;
    }

    .lg\:flex {
        display: flex;
    }
}

/* ─────────────────────────────────────────────────────────────
   OVERFLOW & SCROLLING
   ───────────────────────────────────────────────────────────── */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-y-auto {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─────────────────────────────────────────────────────────────
   CURSOR & INTERACTION
   ───────────────────────────────────────────────────────────── */
.cursor-pointer {
    cursor: pointer;
}

.select-none {
    user-select: none;
    -webkit-user-select: none;
}

.transition {
    transition: all 0.15s ease;
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENT CLASSES: Semantic, reusable blocks
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   RESPONSE CARD: Main container for AI analysis
   ───────────────────────────────────────────────────────────── */
.response-card {
    background: var(--bg-card);
    background-image: var(--card-gradient);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: var(--card-border);
    backdrop-filter: blur(10px);
    margin-top: 2rem;
}

/* ─────────────────────────────────────────────────────────────
   METRIC CARD: Score displays (deal score, risk, etc.)
   PREMIUM: Glass morphism with subtle glow
   ───────────────────────────────────────────────────────────── */
.metric-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.metric-card:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-card-value {
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
}

.metric-card-value-sm {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.metric-card-value-xs {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.metric-card-label {
    font-size: 9px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: var(--space-xs);
    text-transform: uppercase;
}

.metric-card-sublabel {
    font-size: 11px;
    font-weight: 600;
    margin-top: var(--space-xs);
}

.metric-card-why {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    padding: var(--space-sm) var(--space-md);
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-card-hint {
    font-size: 8px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: var(--space-sm);
}

/* Progress bar inside metric */
.metric-progress {
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: var(--space-sm);
    overflow: hidden;
}

.metric-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────
   ACTION CARD: Actionable content (top 1% move, send this)
   ───────────────────────────────────────────────────────────── */
.action-card {
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.action-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.action-card-icon {
    font-size: 24px;
}

.action-card-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.action-card-body {
    font-size: 16px;
    line-height: 1.6;
    font-weight: 600;
}

.action-card-hint {
    font-size: 12px;
    margin-top: var(--space-sm);
    opacity: 0.8;
}

/* Card color variants */
.action-card-green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
    border: 2px solid rgba(34, 197, 94, 0.5);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.action-card-blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-top: 4px solid #3b82f6;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.action-card-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 3px solid #f59e0b;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.action-card-red {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border-left: 6px solid #ef4444;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.action-card-purple {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.action-card-dark {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

/* ─────────────────────────────────────────────────────────────
   SECTION: Generic content section with header
   ───────────────────────────────────────────────────────────── */
.section {
    padding: var(--space-lg);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.section-icon {
    font-size: 18px;
}

.section-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.section-badge {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────
   INFO BOX: Small info cards in grids
   ───────────────────────────────────────────────────────────── */
.info-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.info-box-icon {
    font-size: 24px;
    margin-bottom: var(--space-sm);
}

.info-box-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
}

.info-box-value {
    font-size: 12px;
    color: var(--ink);
    line-height: 1.4;
}

/* ─────────────────────────────────────────────────────────────
   BANNER: Full-width status/goal displays
   ───────────────────────────────────────────────────────────── */
.banner {
    padding: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
}

.banner-yellow {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 3px solid #f59e0b;
    padding: var(--space-md);
}

.banner-green {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    padding: var(--space-lg);
}

.banner-dark {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: var(--space-lg);
}

.banner-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: var(--space-sm);
}

.banner-value {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.banner-sub {
    font-size: 13px;
    margin-top: var(--space-sm);
    opacity: 0.8;
}

/* ─────────────────────────────────────────────────────────────
   BUTTONS: Contextual action buttons
   ───────────────────────────────────────────────────────────── */
.btn-copy {
    background: var(--accent);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-copy:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-edit {
    background: var(--sis-yellow);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.btn-action {
    background: var(--sis-green);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

/* ─────────────────────────────────────────────────────────────
   PILL / BADGE: Small status indicators
   ───────────────────────────────────────────────────────────── */
.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
}

.pill-green {
    background: var(--sis-green);
    color: white;
}

.pill-blue {
    background: var(--sis-blue);
    color: white;
}

.pill-yellow {
    background: var(--sis-yellow);
    color: white;
}

.pill-red {
    background: var(--sis-red);
    color: white;
}

.pill-purple {
    background: #7c3aed;
    color: white;
}

.pill-muted {
    background: var(--bg-input);
    color: var(--ink-muted);
}

/* ─────────────────────────────────────────────────────────────
   QUICK STATS ROW: Bottom stats strip (responsive)
   ───────────────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--line);
    border-top: 1px solid var(--line);
}

@media (min-width: 400px) {
    .stats-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stats-row-item {
    background: var(--bg-card);
    padding: var(--space-sm);
    text-align: center;
}

.stats-row-value {
    font-size: 18px;
    font-weight: 800;
}

.stats-row-label {
    font-size: 9px;
    color: var(--ink-muted);
}

/* SIS Score Circle: Center of 4 main metrics */
.sis-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    padding: 8px;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.sis-circle:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.sis-circle.sis-green {
    background: linear-gradient(145deg, #00FFB8 0%, #00D9A5 50%, #00B88A 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 60px rgba(0, 217, 165, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: pulse-premium-green 3s ease-in-out infinite;
}

.sis-circle.sis-blue {
    background: linear-gradient(145deg, #00D4FF 0%, #00B4FF 50%, #0099DD 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 60px rgba(0, 180, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: pulse-premium-blue 3s ease-in-out infinite;
}

.sis-circle.sis-yellow {
    background: linear-gradient(145deg, #FFD400 0%, #FFB800 50%, #E5A500 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 60px rgba(255, 184, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: pulse-premium-yellow 3s ease-in-out infinite;
}

.sis-circle.sis-red {
    background: linear-gradient(145deg, #FF6B7A 0%, #FF4757 50%, #E5323F 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 60px rgba(255, 71, 87, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: pulse-premium-red 3s ease-in-out infinite;
}

@keyframes pulse-premium-green {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 217, 165, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    50% {
        box-shadow: 0 8px 48px rgba(0, 0, 0, 0.4), 0 0 80px rgba(0, 255, 184, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

@keyframes pulse-premium-blue {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 180, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    50% {
        box-shadow: 0 8px 48px rgba(0, 0, 0, 0.4), 0 0 80px rgba(0, 212, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

@keyframes pulse-premium-yellow {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 184, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    50% {
        box-shadow: 0 8px 48px rgba(0, 0, 0, 0.4), 0 0 80px rgba(255, 212, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

@keyframes pulse-premium-red {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 71, 87, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }

    50% {
        box-shadow: 0 8px 48px rgba(0, 0, 0, 0.4), 0 0 80px rgba(255, 107, 122, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

.sis-value {
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.sis-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 4px;
}

.sis-label-top {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2px;
}

.sis-label-bottom {
    font-size: 7px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.sis-hint {
    font-size: 7px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
}

.metrics-with-sis {
    position: relative;
}

/* 2x2 grid for main metrics */
.metrics-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    position: relative;
}

/* Power Balance Bar Graph */
.power-bar-container {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 35%, #10b981 65%, #10b981 100%);
    border-radius: 6px;
    position: relative;
    margin-top: 8px;
    z-index: 1;
    overflow: visible;
}

.power-bar-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 16px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.power-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 3;
    font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   SIDE-BY-SIDE: Two columns on tablet+
   ───────────────────────────────────────────────────────────── */
.side-by-side {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
}

@media (min-width: 640px) {
    .side-by-side {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─────────────────────────────────────────────────────────────
   EXPANDABLE METRIC WIDGETS
   Tap any number to see why it was scored that way
   ───────────────────────────────────────────────────────────── */
.metric-expand {
    transition: all 0.2s ease;
}

.metric-expand summary {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.metric-expand summary::-webkit-details-marker {
    display: none;
}

.metric-expand summary::marker {
    display: none;
    content: '';
}

.metric-expand[open] summary {
    background: rgba(255, 255, 255, 0.08);
}

.metric-expand[open] {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* ─────────────────────────────────────────────────────────────
   BASE TYPOGRAPHY
   ───────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink);
}

h1 {
    font-size: 1.5rem;
}

/* 24px */
h2 {
    font-size: 1.25rem;
}

/* 20px */
h3 {
    font-size: 1.125rem;
}

/* 18px */
h4 {
    font-size: 1rem;
}

/* 16px */

p {
    color: var(--ink-secondary);
    font-size: 0.9375rem;
    /* 15px */
}

small {
    font-size: 0.8125rem;
    /* 13px */
    color: var(--ink-muted);
}

/* ─────────────────────────────────────────────────────────────
   TOUCH-OPTIMIZED INTERACTIVE ELEMENTS: PREMIUM
   All interactive elements meet 44px minimum touch target
   ───────────────────────────────────────────────────────────── */
button,
.btn,
[role="button"] {
    min-height: var(--touch-min);
    min-width: var(--touch-min);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-user-select: none;
    user-select: none;
}

/* Primary Button: PREMIUM with glow */
.btn-primary {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--orange), var(--gold));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
}

.btn-primary:active {
    transform: scale(0.98) translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Secondary Button: PREMIUM glass */
.btn-secondary {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.15);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--ink-secondary);
}

.btn-ghost:active {
    background: var(--bg-input);
}

/* Icon-only Button */
.btn-icon {
    width: var(--touch-min);
    height: var(--touch-min);
    padding: 0;
    border-radius: var(--radius-full);
}

/* ─────────────────────────────────────────────────────────────
   INPUT ELEMENTS: Touch Optimized
   ───────────────────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: var(--bg-alt);
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease;
}

input:focus,
textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

textarea::placeholder {
    color: var(--ink-muted);
}

::placeholder {
    color: var(--ink-muted);
}

/* ─────────────────────────────────────────────────────────────
   LAYOUT COMPONENTS
   ───────────────────────────────────────────────────────────── */

/* App Shell */
.app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    background: var(--bg) !important;
    width: 100%;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-alt);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-md);
    padding-top: calc(var(--space-md) + var(--safe-top));
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    box-shadow: var(--shadow-md);
}

.app-logo {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    letter-spacing: -0.02em;
}

.app-logo-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(0, 180, 255, 0.5));
}

/* Main Content Area */
.app-main {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Responsive container - centers content on larger screens */
.app-main-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 16px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 32px 20px 16px;
    margin-bottom: 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(20,184,166,0.1));
    border: 1px solid rgba(6,182,212,0.3);
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cyan);
    margin-bottom: 14px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0.3); }
    50% { box-shadow: 0 0 20px 4px rgba(6,182,212,0.15); }
}

.hero-badge-icon {
    font-size: 1.1rem;
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 10px;
    letter-spacing: -1px;
    position: relative;
}

.hero-title .gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--ink-muted);
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

.hero-subtitle strong {
    color: var(--ink);
    font-weight: 700;
}

/* Bottom Action Bar (for primary actions) */
.app-footer {
    position: sticky;
    bottom: 0;
    z-index: 100;
    background: var(--bg);
    padding: var(--space-md);
    padding-bottom: calc(var(--space-md) + var(--safe-bottom));
    border-top: 1px solid var(--line);
}

/* ─────────────────────────────────────────────────────────────
   CARD COMPONENT: Base for SIS Border System
   ───────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

/* SIS Border States: Applied dynamically via JS */
.card.sis-green {
    border-color: var(--sis-green);
}

.card.sis-blue {
    border-color: var(--sis-blue);
}

.card.sis-yellow {
    border-color: var(--sis-yellow);
}

.card.sis-red {
    border-color: var(--sis-red);
}

/* ─────────────────────────────────────────────────────────────
   BADGE COMPONENT: For Sentiment Display
   ───────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 2px 8px;
    font-size: 0.6875rem;
    /* 11px */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
}

/* Sentiment Badges */
.badge-engaged {
    background: var(--sis-green-bg);
    color: var(--sis-green);
}

.badge-interested {
    background: var(--sis-blue-bg);
    color: var(--sis-blue);
}

.badge-hesitant {
    background: var(--sis-yellow-bg);
    color: var(--sis-yellow);
}

.badge-cold {
    background: var(--sis-red-bg);
    color: var(--sis-red);
}

/* ─────────────────────────────────────────────────────────────
   UTILITY CLASSES
   ───────────────────────────────────────────────────────────── */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.w-full {
    width: 100%;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--ink-muted);
}

.text-secondary {
    color: var(--ink-secondary);
}

.font-bold {
    font-weight: 700;
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

/* Hide visually but accessible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─────────────────────────────────────────────────────────────
   CLIENT HEADER COMPONENT: Stage 3
   Displays client info with sentiment badge
   ───────────────────────────────────────────────────────────── */
.client-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid var(--line);
}

.client-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.client-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.client-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

.client-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.client-meta-divider {
    color: var(--line);
}

/* Last Contact indicator */
.last-contact {
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin-top: var(--space-xs);
}

.last-contact.recent {
    color: var(--sis-green);
}

.last-contact.moderate {
    color: var(--sis-yellow);
}

.last-contact.stale {
    color: var(--sis-red);
}

/* ─────────────────────────────────────────────────────────────
   INPUT PANEL: Stage 4
   "Client Said This" input with voice support
   ───────────────────────────────────────────────────────────── */
.input-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid var(--line);
}

.input-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.input-panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.input-mode-toggle {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.input-mode-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-muted);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 32px;
    min-width: auto;
}

.input-mode-btn.active {
    background: var(--accent);
    color: white;
}

.input-textarea {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: var(--bg-alt);
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease;
}

.input-textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.input-textarea::placeholder {
    color: var(--ink-muted);
}

.input-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.voice-btn {
    position: relative;
    overflow: hidden;
}

.voice-btn.recording {
    background: var(--sis-red);
    border-color: var(--sis-red);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.voice-status {
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin-top: var(--space-xs);
    min-height: 18px;
}

.voice-status.recording {
    color: var(--sis-red);
}

/* ═══════════════════════════════════════════════════════════════
   CONTEXT PANEL: Collapsible Deal Context
   ═══════════════════════════════════════════════════════════════ */

.context-panel {
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-lg);
    background: var(--panel);
    border: 1px solid var(--line);
    overflow: hidden;
    transition: all 0.3s ease;
}

.context-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.context-panel-header:hover {
    background: var(--bg-hover);
}

.context-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
}

.context-panel-title-icon {
    font-size: 1rem;
}

.context-panel-badge {
    font-size: 0.625rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 700;
}

.context-panel-toggle {
    font-size: 0.75rem;
    color: var(--ink-muted);
    transition: transform 0.3s ease;
}

.context-panel.open .context-panel-toggle {
    transform: rotate(180deg);
}

.context-panel-body {
    display: none;
    padding: 0 14px 14px 14px;
}

.context-panel.open .context-panel-body {
    display: block;
}

.context-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 400px) {
    .context-grid {
        grid-template-columns: 1fr;
    }
}

.context-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.context-field.full-width {
    grid-column: 1 / -1;
}

.context-field-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.context-field-label .auto-badge {
    font-size: 0.5625rem;
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    font-weight: 700;
}

.context-input,
.context-select,
.context-textarea {
    padding: 8px 10px;
    font-size: 0.8125rem;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    outline: none;
    transition: all 0.2s ease;
}

.context-input:focus,
.context-select:focus,
.context-textarea:focus {
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.context-input::placeholder,
.context-textarea::placeholder {
    color: var(--ink-muted);
}

.context-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.context-select option {
    background: var(--bg-input);
    color: var(--ink);
}

.context-textarea {
    resize: none;
    min-height: 60px;
}

.context-auto-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.625rem;
    color: #22c55e;
}

/* ═══════════════════════════════════════════════════════════════
   ENHANCED VOICE PANEL: Speaker Selection + Transcript Builder
   ═══════════════════════════════════════════════════════════════ */

.voice-panel {
    display: none;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
}

.voice-panel.active {
    display: flex;
}

.voice-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
}

.voice-panel-actions {
    display: flex;
    gap: var(--space-xs);
}

.voice-panel-btn {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--ink-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
    min-height: 32px;
    min-width: 32px;
}

.voice-panel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--ink);
}

/* Speaker Selector */
.speaker-selector {
    display: flex;
    gap: var(--space-sm);
}

.speaker-btn {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
}

.speaker-btn:hover {
    border-color: var(--accent);
    color: var(--ink);
}

.speaker-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, #0099DD 100%);
    border-color: transparent;
    color: white;
}

.speaker-btn.active.client {
    background: linear-gradient(135deg, #9333EA 0%, #7C3AED 100%);
}

/* Audio Level Meter */
.audio-level-container {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.audio-level-label {
    font-size: 0.6875rem;
    color: var(--ink-muted);
    min-width: 60px;
}

.audio-level-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.audio-level-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--sis-green) 0%, var(--sis-yellow) 70%, var(--sis-red) 100%);
    border-radius: 4px;
    transition: width 0.1s ease;
}

/* Client Input Section (for typing client messages) */
.client-input-section {
    display: none;
}

.client-input-section.active {
    display: block;
}

.client-typed-input {
    width: 100%;
    min-height: 60px;
    padding: var(--space-sm);
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--ink);
    resize: none;
    font-family: inherit;
}

.client-typed-input::placeholder {
    color: rgba(147, 51, 234, 0.6);
}

.client-typed-input:focus {
    outline: none;
    border-color: #9333EA;
}

.client-add-btn {
    width: 100%;
    padding: 10px;
    margin-top: var(--space-sm);
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid #9333EA;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: #9333EA;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
}

.client-add-btn:hover {
    background: var(--accent);
    color: var(--accent-ink);
}

/* Transcript Live Area */
.transcript-live-area {
    min-height: 80px;
    max-height: 150px;
    overflow-y: auto;
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.transcript-placeholder {
    color: var(--ink-muted);
    text-align: center;
    padding: var(--space-md);
}

.transcript-line {
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--line);
}

.transcript-line:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.speaker-label {
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.speaker-label.you {
    color: var(--accent);
}

.speaker-label.client {
    color: #9333EA;
}

.transcript-text {
    color: var(--ink);
}

.transcript-interim {
    color: var(--ink-muted);
    font-style: italic;
}

.use-transcript-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--sis-green) 0%, #00B88A 100%);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    box-shadow: 0 4px 12px rgba(0, 217, 165, 0.3);
}

.use-transcript-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 217, 165, 0.4);
}

/* ═══════════════════════════════════════════════════════════════
   VERBOSITY SLIDER: Control response length
   ═══════════════════════════════════════════════════════════════ */

.verbosity-control {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
}

.verbosity-label {
    font-size: 0.6875rem;
    color: var(--ink-muted);
    min-width: 70px;
}

.verbosity-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: linear-gradient(90deg, var(--sis-green) 0%, var(--accent) 50%, #9333EA 100%);
    border-radius: 3px;
    outline: none;
}

.verbosity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.verbosity-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.verbosity-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink);
    min-width: 60px;
    text-align: right;
}

/* Copy Button Enhancement */
.copy-response-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #0099DD 100%);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.copy-response-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 180, 255, 0.3);
}

.copy-response-btn.copied {
    background: linear-gradient(135deg, var(--sis-green) 0%, #00B88A 100%);
}

/* ═══════════════════════════════════════════════════════════════
   INLINE CHAT PANEL - Toggle between Input and Chat modes
   ═══════════════════════════════════════════════════════════════ */

.input-mode-content {
    display: none;
}

.input-mode-content.active {
    display: block;
}

/* Chat Messages Container */
.inline-chat-messages {
    min-height: 150px;
    max-height: 280px;
    overflow-y: auto;
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.inline-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--ink-muted);
    text-align: center;
    gap: var(--space-sm);
}

.inline-chat-empty-icon {
    font-size: 32px;
    opacity: 0.5;
}

.inline-chat-empty-text {
    font-size: 0.875rem;
}

.inline-chat-empty-hint {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Chat Message Bubbles */
.inline-chat-message {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.inline-chat-message.user {
    flex-direction: row-reverse;
}

.inline-chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.inline-chat-message.user .inline-chat-avatar {
    background: linear-gradient(135deg, var(--accent) 0%, #0099DD 100%);
}

.inline-chat-message.assistant .inline-chat-avatar {
    background: linear-gradient(135deg, #00D9A5 0%, #00B88A 100%);
    border: 2px solid #00D9A5;
    box-shadow: 0 0 12px rgba(0, 217, 165, 0.3);
}

/* RE Logo for Coach Avatar */
.re-logo-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #FF8C00;
    letter-spacing: -0.5px;
}

/* Empty state RE logo */
.inline-chat-empty-icon .re-logo-large {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #00D9A5 0%, #00B88A 100%);
    border-radius: 50%;
    border: 3px solid #00D9A5;
    box-shadow: 0 0 20px rgba(0, 217, 165, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #FF8C00;
    letter-spacing: -0.5px;
}

.inline-chat-bubble {
    max-width: 85%;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    line-height: 1.5;
}

.inline-chat-message.user .inline-chat-bubble {
    background: linear-gradient(135deg, var(--accent) 0%, #0099DD 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.inline-chat-message.assistant .inline-chat-bubble {
    background: var(--bg-card);
    color: var(--ink);
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
}

/* Chat bubble content formatting */
.inline-chat-bubble strong {
    color: #FF8C00;
    font-weight: 700;
}

.inline-chat-message.user .inline-chat-bubble strong {
    color: white;
}

.inline-chat-message.assistant .inline-chat-bubble strong {
    color: #FF8C00;
}

.inline-chat-bubble .action-card {
    background: linear-gradient(145deg, rgba(0, 217, 165, 0.2) 0%, rgba(0, 217, 165, 0.1) 100%);
    border: 1px solid rgba(0, 217, 165, 0.4);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    margin-top: var(--space-sm);
}

.inline-chat-bubble .action-card-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: #00A080;
    margin-bottom: 4px;
}

/* Typing indicator */
.inline-chat-typing {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
}

.inline-chat-typing-dots {
    display: flex;
    gap: 4px;
}

.inline-chat-typing-dot {
    width: 8px;
    height: 8px;
    background: #FF8C00;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.inline-chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.inline-chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input Area */
.inline-chat-input-area {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
}

.inline-chat-input {
    flex: 1;
    min-height: 72px;
    max-height: 120px;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--ink);
    border: 2px solid var(--line);
    border-radius: var(--radius-md);
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(255, 140, 0, 0);
    animation: subtleOrangeGlow 3s ease-in-out infinite;
}

@keyframes subtleOrangeGlow {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(255, 140, 0, 0.15), 0 0 16px rgba(255, 140, 0, 0.08);
        border-color: rgba(255, 140, 0, 0.25);
    }

    50% {
        box-shadow: 0 0 12px rgba(255, 140, 0, 0.25), 0 0 24px rgba(255, 140, 0, 0.12);
        border-color: rgba(255, 140, 0, 0.4);
    }
}

.inline-chat-input:focus {
    border-color: #FF8C00;
    box-shadow: 0 0 16px rgba(255, 140, 0, 0.35), 0 0 32px rgba(255, 140, 0, 0.15);
    animation: none;
}

.inline-chat-input::placeholder {
    color: #888;
}

.inline-chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #FF8C00 0%, #FF6B00 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

.inline-chat-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 140, 0, 0.4);
}

.inline-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Suggested Questions */
.inline-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.inline-chat-suggestion {
    padding: 6px 12px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: linear-gradient(145deg, rgba(0, 180, 255, 0.1) 0%, rgba(0, 180, 255, 0.05) 100%);
    color: var(--accent);
    border: 1px solid rgba(0, 180, 255, 0.2);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 28px;
}

.inline-chat-suggestion:hover {
    background: linear-gradient(145deg, rgba(0, 180, 255, 0.2) 0%, rgba(0, 180, 255, 0.1) 100%);
    border-color: rgba(0, 180, 255, 0.4);
}

/* Chat context indicator */
.inline-chat-context {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: linear-gradient(145deg, rgba(0, 217, 165, 0.1) 0%, rgba(0, 217, 165, 0.05) 100%);
    border: 1px solid rgba(0, 217, 165, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    color: var(--sis-green);
    margin-bottom: var(--space-sm);
}

.inline-chat-no-context {
    background: linear-gradient(145deg, rgba(255, 184, 0, 0.1) 0%, rgba(255, 184, 0, 0.05) 100%);
    border-color: rgba(255, 184, 0, 0.2);
    color: var(--sis-yellow);
}

/* Quick Objection Buttons */
.quick-objections {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--line);
}

.quick-objection-btn {
    padding: 6px 10px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: var(--bg-input);
    color: var(--ink-secondary);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 28px;
    min-width: auto;
}

.quick-objection-btn:active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* API Connection Status Indicator */
.api-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.api-indicator.connected {
    background: rgba(16, 185, 129, 0.2);
    color: var(--sis-green);
}

.api-indicator.disconnected {
    background: rgba(239, 68, 68, 0.2);
    color: var(--sis-red);
}

.api-indicator.testing {
    background: rgba(245, 158, 11, 0.2);
    color: var(--sis-yellow);
}

.api-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

.api-indicator.connected .dot {
    background: var(--sis-green);
    box-shadow: 0 0 8px var(--sis-green);
}

.api-indicator.disconnected .dot {
    background: var(--sis-red);
    box-shadow: 0 0 8px var(--sis-red);
    animation: none;
}

.api-indicator.testing .dot {
    background: var(--sis-yellow);
    animation: pulse-dot 0.5s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.85);
    }
}

/* Connection Banner */
.connection-banner {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    padding: 12px 16px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 300;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.connection-banner.show {
    transform: translateY(0);
}

.connection-banner.connected {
    background: var(--sis-green);
    color: white;
}

.connection-banner.disconnected {
    background: var(--sis-red);
    color: white;
}

/* ─────────────────────────────────────────────────────────────
   TRANSCRIPT OVERLAY: Pop-out to view client input
   ───────────────────────────────────────────────────────────── */
.transcript-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.transcript-overlay.open {
    opacity: 1;
    visibility: visible;
}

.transcript-panel {
    width: min(400px, 90vw);
    max-height: 60vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.transcript-overlay.open .transcript-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.transcript-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.transcript-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.transcript-header .btn-icon {
    color: white;
}

.transcript-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.transcript-btn {
    position: relative;
}

.transcript-btn::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* ─────────────────────────────────────────────────────────────
   THEME PICKER: Quick theme selection dropdown
   ───────────────────────────────────────────────────────────── */
.theme-picker {
    position: fixed;
    top: 60px;
    right: 16px;
    width: 200px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.theme-picker.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-picker-header {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink-muted);
    border-bottom: 1px solid var(--line);
}

.theme-options {
    padding: 8px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}

.theme-option:hover {
    background: var(--bg-input);
}

.theme-option.active {
    background: var(--accent);
}

.theme-option.active .theme-name,
.theme-option.active .theme-desc {
    color: white;
}

.theme-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.theme-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    flex: 1;
}

.theme-desc {
    font-size: 11px;
    color: var(--ink-muted);
}

.theme-btn {
    font-size: 18px;
}

/* Layout Options (same style as theme options) */
.layout-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
}

.layout-option:hover {
    background: var(--bg-input);
}

.layout-option.active {
    background: var(--accent);
}

.layout-option.active .theme-name,
.layout-option.active .theme-desc {
    color: white;
}

.layout-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--bg-input);
    border-radius: 8px;
    flex-shrink: 0;
}

.layout-option.active .layout-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* RTL Support for Arabic */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .ml-auto {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .ml-sm {
    margin-left: 0;
    margin-right: var(--space-sm);
}

[dir="rtl"] .gap-sm {
    direction: rtl;
}

[dir="rtl"] .text-right {
    text-align: left;
}

[dir="rtl"] .chat-bubble-user {
    margin-left: 0;
    margin-right: auto;
    border-radius: 16px 16px 4px 16px;
}

[dir="rtl"] .chat-bubble-ai {
    margin-right: 0;
    margin-left: auto;
    border-radius: 16px 16px 16px 4px;
}

[dir="rtl"] .message-input-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .sis-circle {
    direction: ltr;
}

[dir="rtl"] .metrics-grid-2x2 {
    direction: ltr;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #22c55e;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

/* Client Selector */
.client-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
}

.client-selector select {
    flex: 1;
    min-height: var(--touch-min);
    padding: var(--space-sm) var(--space-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    outline: none;
}

.client-selector .btn-icon {
    flex-shrink: 0;
}

/* Thread/Chat History */
.thread-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.thread-message {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading overlay for cards */
.card.loading {
    position: relative;
    pointer-events: none;
}

.card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-glass);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─────────────────────────────────────────────────────────────
   LOADING OVERLAY: Flying Pills Animation
   ───────────────────────────────────────────────────────────── */
.loading-overlay{position:fixed;inset:0;background:transparent;display:none;align-items:center;justify-content:center;z-index:10002;opacity:0;visibility:hidden;transition:all 0.2s}
.loading-overlay.show{display:flex;opacity:1;visibility:visible;background:rgba(0,0,0,0.7);backdrop-filter:blur(8px)}
.loading-content{background:white;border-radius:20px;width:90%;max-width:440px;padding:2rem;text-align:center;transform:translateY(20px);transition:transform 0.2s;box-shadow:0 25px 50px -12px rgba(0,0,0,0.25);position:relative;z-index:10003}
.loading-overlay.show .loading-content{transform:translateY(0)}
.loading-cancel{position:absolute;top:1rem;right:1rem;background:none;border:none;color:#999;cursor:pointer;padding:0.25rem;font-size:1.5rem;z-index:10;transition:all 0.2s}
.loading-cancel:hover{color:#333}
.loading-spinner{width:48px;height:48px;border:3px solid #e5e5e5;border-top-color:#06b6d4;border-radius:50%;animation:spin 1s linear infinite;margin:0 auto}
@keyframes spin{to{transform:rotate(360deg)}}
.loading-text-container{text-align:center;margin-top:1rem}
.loading-text{font-size:1rem;font-weight:600;color:#1a1a1a}
.loading-subtext{font-size:0.8125rem;color:#666;margin-top:0.5rem}
.loading-progress{width:200px;height:4px;background:#e5e5e5;border-radius:2px;overflow:hidden;margin:1rem auto 0}
.loading-progress-bar{height:100%;background:#06b6d4;border-radius:2px;animation:loadingProgress 2s ease-in-out infinite}
@keyframes loadingProgress{0%{width:0%}50%{width:80%}100%{width:100%}}
.loading-cancel-btn{margin-top:1rem;padding:0.625rem 1.5rem;background:#f5f5f5;border:1px solid #e5e5e5;border-radius:8px;color:#1a1a1a;font-size:0.875rem;font-weight:600;cursor:pointer;transition:all 0.2s}
.loading-cancel-btn:hover{background:#e8f7fb;border-color:#06b6d4;color:#06b6d4}
.coach-pills-container{position:fixed;inset:0;pointer-events:none;overflow:hidden;opacity:0;transition:opacity 0.3s;z-index:10004}
.coach-pills-container.active{opacity:1}
.coach-pill{position:absolute;padding:8px 14px;border-radius:20px;font-size:12px;font-weight:600;white-space:nowrap;opacity:0;transition:opacity 0.3s;box-shadow:0 4px 16px rgba(0,0,0,0.15);border:1px solid rgba(255,255,255,0.3);z-index:10004}
.coach-pill.visible{opacity:1}
.coach-pill.marketing{background:linear-gradient(135deg,#c4a052 0%,#a88a3e 100%);color:white}
.coach-pill.audience{background:linear-gradient(135deg,#3b82f6 0%,#2563eb 100%);color:white}
.coach-pill.content{background:linear-gradient(135deg,#10b981 0%,#059669 100%);color:white}
.coach-pill.strategy{background:linear-gradient(135deg,#8b5cf6 0%,#6366f1 100%);color:white}
.coach-pill.insight{background:linear-gradient(135deg,#f59e0b 0%,#d97706 100%);color:white}
.coach-pill.creative{background:linear-gradient(135deg,#ec4899 0%,#db2777 100%);color:white}
.coach-pill.processing{background:linear-gradient(135deg,#64748b 0%,#475569 100%);color:white}

/* ─────────────────────────────────────────────────────────────
   LOADING STATE
   ───────────────────────────────────────────────────────────── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation:spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─────────────────────────────────────────────────────────────
   MEDIA QUERIES: Progressive Enhancement
   ───────────────────────────────────────────────────────────── */

/* Slightly larger phones */
@media (min-width: 390px) {
    :root {
        --space-md: 20px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   v0.8.4 FEATURES: CSS STYLES
   ═══════════════════════════════════════════════════════════════ */

/* SIS Coaching Message */
.sis-coaching {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    margin-top: 6px;
    white-space: nowrap;
}

/* Knowledge Panel */
.knowledge-panel {
    padding: var(--space-md);
    background: var(--panel);
    border-radius: 8px;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.knowledge-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.knowledge-label {
    font-size: 10px;
    color: var(--ink-muted);
    font-weight: 600;
}

.knowledge-value {
    font-size: 13px;
    color: var(--ink);
    font-weight: 500;
}

.knowledge-value.empty {
    color: var(--ink-muted);
    font-style: italic;
}

/* HAG Patterns */
.hag-patterns {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.hag-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.hag-badge.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.hag-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.hag-badge.info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Mission Control */
.mission-control {
    padding: var(--space-md);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.mission-goal {
    font-size: 14px;
    font-weight: 600;
    color: #c4b5fd;
}

.mission-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.mission-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #3b82f6);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.mission-progress-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
}

.mission-subgoals {
    margin-top: var(--space-sm);
}

.mission-subgoal {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 12px;
    padding: 4px 0;
}

.mission-subgoal.done {
    color: #34d399;
}

.mission-subgoal.in-progress {
    color: #60a5fa;
}

.mission-subgoal.blocked {
    color: #f87171;
}

.mission-subgoal.pending {
    color: rgba(255, 255, 255, 0.4);
}

/* Scenarios Grid */
.scenarios-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-sm);
}

@media (max-width: 500px) {
    .scenarios-grid {
        grid-template-columns: 1fr;
    }
}

.scenario-card {
    padding: var(--space-md);
    border-radius: 8px;
    text-align: center;
}

.scenario-card.best {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.scenario-card.likely {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.scenario-card.worst {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.scenario-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.scenario-card.best .scenario-label {
    color: #34d399;
}

.scenario-card.likely .scenario-label {
    color: #60a5fa;
}

.scenario-card.worst .scenario-label {
    color: #f87171;
}

.scenario-probability {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.scenario-outcome {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

.scenario-trigger {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    font-style: italic;
}

/* Response Variants */
.response-variants {
    padding: var(--space-md);
}

.variant-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-md);
}

.variant-tab {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.variant-tab.active {
    color: white;
}

.variant-tab.assertive.active {
    background: rgba(248, 113, 113, 0.3);
}

.variant-tab.diplomatic.active {
    background: rgba(96, 165, 250, 0.3);
}

.variant-tab.collaborative.active {
    background: rgba(52, 211, 153, 0.3);
}

.variant-content {
    display: none;
    padding: var(--space-md);
    background: var(--panel);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink);
}

.variant-content.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSE VARIANTS: Tabbed Layout (Warm/Direct/Formal)
   ═══════════════════════════════════════════════════════════════ */

.response-variants-container {
    margin-bottom: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.response-variants-tabs {
    display: flex;
    border-bottom: 2px solid var(--line);
    background: var(--bg-input);
}

.response-variant-tab {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--ink-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.response-variant-tab:hover {
    color: var(--ink);
    background: var(--bg-hover);
}

.response-variant-tab.active {
    color: var(--ink);
    background: var(--bg);
}

.response-variant-tab.active.warm {
    border-bottom-color: #f97316;
    color: #ea580c;
}

.response-variant-tab.active.direct {
    border-bottom-color: #3b82f6;
    color: #2563eb;
}

.response-variant-tab.active.formal {
    border-bottom-color: #8b5cf6;
    color: #7c3aed;
}

.response-variant-tab-icon {
    font-size: 1rem;
}

.response-variant-panel {
    display: none;
    padding: var(--space-lg);
}

.response-variant-panel.active {
    display: block;
}

.response-variant-panel.warm {
    border-left: 4px solid #f97316;
}

.response-variant-panel.direct {
    border-left: 4px solid #3b82f6;
}

.response-variant-panel.formal {
    border-left: 4px solid #8b5cf6;
}

.response-variant-body {
    font-size: 1rem;
    line-height: 1.7;
    color: #1e293b;
    margin-bottom: var(--space-lg);
}

.response-variant-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid #e2e8f0;
}

.variant-char-count {
    font-size: 0.75rem;
    color: #94a3b8;
}

.variant-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 36px;
}

.variant-copy-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #1e293b;
}

.variant-copy-btn:active {
    transform: scale(0.98);
}

.variant-copy-btn.copied {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #86efac;
    color: #166534;
}

.variant-copy-btn.copied .copy-icon {
    display: none;
}

.variant-copy-btn.copied .check-icon {
    display: inline;
}

.variant-copy-btn .check-icon {
    display: none;
}



/* Dark pill variants for better contrast */
.pill-green-dark {
    background: #065f46;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.pill-blue-dark {
    background: #1e40af;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.pill-yellow-dark {
    background: #92400e;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.pill-red-dark {
    background: #991b1b;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   EXPORT & REPORT STYLES
   ═══════════════════════════════════════════════════════════════ */

.export-bar {
    display: flex;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(145deg, rgba(18, 23, 31, 0.9) 0%, rgba(12, 16, 22, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    margin: 16px 0;
    flex-wrap: wrap;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
}

.export-btn:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.export-btn:active {
    transform: scale(0.98);
}

.export-btn.primary {
    background: linear-gradient(135deg, #00C8FF 0%, #00B4FF 50%, #0099DD 100%);
    border-color: rgba(0, 180, 255, 0.5);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 180, 255, 0.25);
}

.export-btn.primary:hover {
    background: linear-gradient(135deg, #00D4FF 0%, #00C8FF 50%, #00B4FF 100%);
    box-shadow: 0 6px 16px rgba(0, 180, 255, 0.35);
}

.export-btn-icon {
    font-size: 16px;
}

/* Export Modal: PREMIUM */
.export-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.export-modal.active {
    opacity: 1;
    visibility: visible;
}

.export-modal-content {
    background: linear-gradient(145deg, #1A2332 0%, #12171F 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.export-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 16px;
    text-align: center;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.export-option-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 10px;
}

.export-option-text {
    flex: 1;
}

.export-option-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.export-option-desc {
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 2px;
}

.export-modal-close {
    margin-top: 16px;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--ink-muted);
    font-size: 14px;
    cursor: pointer;
}

/* PDF Generation Progress */
.pdf-progress {
    text-align: center;
    padding: 20px;
}

.pdf-progress-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════════════
   SIS EXPLANATION MODAL
   ═══════════════════════════════════════════════════════════════ */

.sis-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sis-modal.active {
    opacity: 1;
    visibility: visible;
}

.sis-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 20px;
    padding: 24px;
    max-width: 380px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.sis-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.sis-modal-score {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}

.sis-modal-score.sis-green {
    color: #10b981;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.sis-modal-score.sis-blue {
    color: #3b82f6;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

.sis-modal-score.sis-yellow {
    color: #f59e0b;
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
}

.sis-modal-score.sis-red {
    color: #ef4444;
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

.sis-modal-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.sis-modal-why {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border-left: 3px solid #3b82f6;
}

.sis-modal-why-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #3b82f6;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.sis-modal-why-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.sis-modal-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.sis-metric-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sis-metric-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sis-metric-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.sis-modal-close {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sis-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ═══════════════════════════════════════════════════════════════
   ASK COACH CHAT MODAL
   ═══════════════════════════════════════════════════════════════ */

.coach-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.coach-chat-modal.active {
    opacity: 1;
    visibility: visible;
}

.coach-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.coach-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coach-chat-title-icon {
    font-size: 24px;
}

.coach-chat-title-text {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.coach-chat-title-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.coach-chat-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.coach-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.coach-chat-context {
    padding: 10px 20px;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.coach-chat-context-badge {
    font-size: 11px;
    font-weight: 600;
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 6px;
}

.coach-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg);
}

.coach-chat-message {
    display: flex;
    gap: 12px;
    max-width: 90%;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.coach-chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.coach-chat-message.assistant {
    align-self: flex-start;
}

.coach-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.coach-chat-message.user .coach-chat-avatar {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.coach-chat-message.assistant .coach-chat-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
}

.coach-chat-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.coach-chat-message.user .coach-chat-bubble {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-bottom-right-radius: 4px;
}

.coach-chat-message.assistant .coach-chat-bubble {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.coach-chat-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.coach-chat-typing-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.coach-chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.coach-chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }
}

.coach-chat-input-area {
    padding: 16px 20px;
    background: #1e293b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.coach-chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.coach-chat-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    font-family: inherit;
}

.coach-chat-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.08);
}

.coach-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.coach-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.coach-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.coach-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.coach-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.coach-chat-suggestion {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.coach-chat-suggestion:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: white;
}

.coach-chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.coach-chat-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.coach-chat-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.coach-chat-empty-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    max-width: 280px;
}

/* Ask Coach Button */
.ask-coach-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(0, 217, 165, 0.3);
    background: linear-gradient(145deg, rgba(0, 217, 165, 0.15) 0%, rgba(0, 217, 165, 0.05) 100%);
    color: #00D9A5;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    box-shadow: 0 0 20px rgba(0, 217, 165, 0.1);
}

.ask-coach-btn:hover {
    background: linear-gradient(145deg, rgba(0, 217, 165, 0.25) 0%, rgba(0, 217, 165, 0.1) 100%);
    border-color: rgba(0, 217, 165, 0.5);
    box-shadow: 0 0 30px rgba(0, 217, 165, 0.2);
    transform: translateY(-1px);
}

.ask-coach-btn:active {
    transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER & DISCLAIMER
   ═══════════════════════════════════════════════════════════════ */

.footer {
  padding: 24px 16px 40px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.ai-disclaimer {
  background: linear-gradient(145deg, rgba(255, 184, 0, 0.08) 0%, rgba(255, 184, 0, 0.03) 100%);
  border: 1px solid rgba(255, 184, 0, 0.15);
  border-radius: 16px;
  padding: 18px;
  margin: 0 auto 24px;
  max-width: 800px;
}

.ai-disclaimer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #FFB800;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ai-disclaimer-text {
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-link:hover {
  color: var(--cyan);
}

.footer-copyright {
  text-align: center;
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}

/* ==========================================
   USER INFO BADGE
   ========================================== */
.user-info-badge {
    position: fixed;
    top: 20px;
    right: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-info-badge.active {
    display: flex;
}

.user-info-badge:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--sis-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #050811;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

.user-plan {
    font-size: 11px;
    color: var(--ink-muted);
    text-transform: capitalize;
}

/* =================================
   CONFIG MODAL (Unified Pattern)
   ================================= */
.config-modal{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(7,11,18,0.95);
  z-index:2000;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.config-modal.active{display:flex}

.config-panel{
  background:var(--surface);
  border-radius:16px;
  padding:32px;
  max-width:600px;
  width:100%;
  max-height:90vh;
  overflow-y:auto;
  border:1px solid var(--line);
  box-shadow:0 8px 32px rgba(0,0,0,0.4);
}

.config-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:24px;
  padding-bottom:16px;
  border-bottom:2px solid var(--line);
}

.config-title{
  font-size:1.5rem;
  font-weight:700;
  color:var(--cyan);
}

.config-close{
  width:32px;
  height:32px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--line);
  border-radius:8px;
  color:var(--ink);
  font-size:1.2rem;
  cursor:pointer;
  transition:all 0.2s;
}

.config-close:hover{
  background:rgba(255,255,255,0.1);
  border-color:var(--cyan);
}

.config-section{
  margin-bottom:24px;
}

.config-section-title{
  font-size:0.85rem;
  font-weight:700;
  color:var(--ink-muted);
  text-transform:uppercase;
  letter-spacing:0.5px;
  margin-bottom:12px;
}

/* Theme Picker */
.theme-picker{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.theme-option{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:10px 12px;
  background:var(--panel-soft);
  border:2px solid var(--line);
  border-radius:10px;
  cursor:pointer;
  transition:all 0.2s;
}

.theme-option:hover{
  border-color:var(--cyan);
  transform:translateY(-2px);
}

.theme-option.active{
  border-color:var(--accent);
  background:rgba(255,145,77,0.1);
}

.theme-preview{
  width:36px;
  height:36px;
  border-radius:8px;
}

.theme-name{
  font-size:0.75rem;
  font-weight:600;
  color:var(--ink-muted);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 16px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--cyan);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-style: italic;
}

.config-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 0;
  border-bottom:1px solid var(--line-soft);
}

.config-toggle .toggle-label{
  font-size:0.95rem;
  color:var(--ink);
}

/* Toggle Switch with Input */
.toggle-switch-input{
  position:relative;
  display:inline-block;
  width:48px;
  height:26px;
}

.toggle-switch-input input{
  opacity:0;
  width:0;
  height:0;
}

.toggle-slider-input{
  position:absolute;
  cursor:pointer;
  top:0;
  left:0;
  right:0;
  bottom:0;
  background:var(--line);
  border-radius:13px;
  transition:background 0.2s;
}

.toggle-slider-input::after{
  content:'';
  position:absolute;
  width:22px;
  height:22px;
  background:white;
  border-radius:50%;
  top:2px;
  left:2px;
  transition:transform 0.2s;
}

.toggle-switch-input input:checked + .toggle-slider-input{
  background:var(--sis-green);
}

.toggle-switch-input input:checked + .toggle-slider-input::after{
  transform:translateX(22px);
}

.config-info-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 0;
  border-bottom:1px solid var(--line-soft);
}

.config-info-label{
  font-size:0.9rem;
  color:var(--ink);
}

.config-info-value{
  font-size:0.9rem;
  font-weight:600;
  color:var(--ink-muted);
}

.config-actions{
  display:flex;
  gap:12px;
  margin-top:24px;
  padding-top:20px;
  border-top:2px solid var(--line);
}

.config-btn-primary{
  flex:1;
  padding:12px 20px;
  background:linear-gradient(135deg, var(--cyan), var(--teal));
  border:none;
  border-radius:10px;
  color:#050811;
  font-size:1rem;
  font-weight:700;
  cursor:pointer;
  transition:all 0.2s;
}

.config-btn-primary:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 24px rgba(6,182,212,0.4);
}

.config-btn-secondary{
  flex:1;
  padding:12px 20px;
  background:rgba(255,255,255,0.05);
  border:1px solid var(--line);
  border-radius:10px;
  color:var(--ink);
  font-size:1rem;
  font-weight:600;
  cursor:pointer;
  transition:all 0.2s;
}

.config-btn-secondary:hover{
  background:rgba(255,255,255,0.1);
  border-color:var(--cyan);
}

/* Bottom CTA */
.bottom-cta{
  text-align:center;
  padding:40px 20px;
  margin-top:32px;
}

.cta-headline{
  font-size:1.5rem;
  font-weight:700;
  color:var(--ink);
  margin-bottom:12px;
}

.cta-subtext{
  font-size:1rem;
  color:var(--muted);
}

.cta-subtext strong{
  color:var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATION SYSTEM
   ═══════════════════════════════════════════════════════════════ */

.copy-toast-container {
  position: fixed;
  top: 70px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copy-toast {
  background: var(--accent);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: toast-in 0.3s ease;
}

.copy-toast.removing {
  animation: toast-out 0.3s ease forwards;
}

/* Toast type variants */
.toast-success {
  background: var(--accent);
}

.toast-info {
  background: var(--accent);
}

.toast-warning {
  background: var(--accent);
}

.toast-error {
  background: #ef4444;
}

/* Welcome Toast */
.welcome-toast {
  background: var(--accent);
}

/* Toast Animations */
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* ─────────────────────────────────────────────────────────────
   LIGHT THEME TEXT FIXES: Dark text on light colored cards
   ───────────────────────────────────────────────────────────── */

/* Fix text colors inside light-background action cards for light themes */
[data-theme="cream"] .action-card-green,
[data-theme="cream"] .action-card-red,
[data-theme="cream"] .action-card-purple,
[data-theme="cream"] .action-card-blue,
[data-theme="cream"] .action-card-yellow,
[data-theme="cream"] .banner-green,
[data-theme="cream"] .banner-yellow,
[data-theme="ocean"] .action-card-green,
[data-theme="ocean"] .action-card-red,
[data-theme="ocean"] .action-card-purple,
[data-theme="ocean"] .action-card-blue,
[data-theme="ocean"] .action-card-yellow,
[data-theme="ocean"] .banner-green,
[data-theme="ocean"] .banner-yellow {
  color: #1a1a1a;
}

/* Override .text-white inside light cards on light themes */
[data-theme="cream"] .action-card-green .text-white,
[data-theme="cream"] .action-card-red .text-white,
[data-theme="cream"] .action-card-purple .text-white,
[data-theme="cream"] .action-card-blue .text-white,
[data-theme="cream"] .action-card-yellow .text-white,
[data-theme="cream"] .banner-green .text-white,
[data-theme="cream"] .banner-yellow .text-white,
[data-theme="ocean"] .action-card-green .text-white,
[data-theme="ocean"] .action-card-red .text-white,
[data-theme="ocean"] .action-card-purple .text-white,
[data-theme="ocean"] .action-card-blue .text-white,
[data-theme="ocean"] .action-card-yellow .text-white,
[data-theme="ocean"] .banner-green .text-white,
[data-theme="ocean"] .banner-yellow .text-white {
  color: #2d2d2d !important;
}

/* Override all text elements inside light cards on light themes */
[data-theme="cream"] .action-card-green *,
[data-theme="cream"] .action-card-red *,
[data-theme="cream"] .action-card-purple *,
[data-theme="cream"] .action-card-blue *,
[data-theme="cream"] .action-card-yellow *,
[data-theme="cream"] .banner-green *,
[data-theme="cream"] .banner-yellow *,
[data-theme="ocean"] .action-card-green *,
[data-theme="ocean"] .action-card-red *,
[data-theme="ocean"] .action-card-purple *,
[data-theme="ocean"] .action-card-blue *,
[data-theme="ocean"] .action-card-yellow *,
[data-theme="ocean"] .banner-green *,
[data-theme="ocean"] .banner-yellow * {
  color: inherit;
}

/* Specific action-card element overrides for light themes */
[data-theme="cream"] .action-card-green .action-card-title,
[data-theme="ocean"] .action-card-green .action-card-title {
  color: #166534 !important;
}

[data-theme="cream"] .action-card-red .action-card-title,
[data-theme="cream"] .action-card-red .section-title,
[data-theme="ocean"] .action-card-red .action-card-title,
[data-theme="ocean"] .action-card-red .section-title {
  color: #991b1b !important;
}

[data-theme="cream"] .action-card-purple .action-card-title,
[data-theme="cream"] .action-card-purple .section-title,
[data-theme="ocean"] .action-card-purple .action-card-title,
[data-theme="ocean"] .action-card-purple .section-title {
  color: #5b21b6 !important;
}

[data-theme="cream"] .action-card-blue .action-card-title,
[data-theme="ocean"] .action-card-blue .action-card-title {
  color: #1e40af !important;
}

[data-theme="cream"] .action-card-yellow .action-card-title,
[data-theme="cream"] .banner-yellow .banner-label,
[data-theme="ocean"] .action-card-yellow .action-card-title,
[data-theme="ocean"] .banner-yellow .banner-label {
  color: #92400e !important;
}

[data-theme="cream"] .banner-green .banner-label,
[data-theme="ocean"] .banner-green .banner-label {
  color: #166534 !important;
}

/* Preserve white text on dark backgrounds within light cards */
[data-theme="cream"] .action-card-green .bg-white,
[data-theme="cream"] .action-card-red .bg-white,
[data-theme="cream"] .action-card-purple .bg-white,
[data-theme="ocean"] .action-card-green .bg-white,
[data-theme="ocean"] .action-card-red .bg-white,
[data-theme="ocean"] .action-card-purple .bg-white {
  color: #1a1a1a;
}

/* Info boxes inside action cards should have dark text */
[data-theme="cream"] .action-card-purple .info-box,
[data-theme="cream"] .action-card-purple .info-box-value,
[data-theme="ocean"] .action-card-purple .info-box,
[data-theme="ocean"] .action-card-purple .info-box-value {
  color: #1a1a1a !important;
}

[data-theme="cream"] .action-card-purple .info-box-label,
[data-theme="ocean"] .action-card-purple .info-box-label {
  color: #7c3aed !important;
}

/* ─────────────────────────────────────────────────────────────
   BANNER-DARK & METRIC-CARD: Light theme overrides
   Convert dark backgrounds to light backgrounds on cream/ocean
   ───────────────────────────────────────────────────────────── */

/* Banner Dark - make light on light themes */
[data-theme="cream"] .banner-dark,
[data-theme="ocean"] .banner-dark {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

[data-theme="cream"] .banner-dark *,
[data-theme="ocean"] .banner-dark * {
  color: inherit;
}

[data-theme="cream"] .banner-dark .section-title,
[data-theme="ocean"] .banner-dark .section-title {
  color: #334155;
}

/* Metric cards - make light on light themes */
[data-theme="cream"] .metric-card,
[data-theme="ocean"] .metric-card {
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.04) 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

[data-theme="cream"] .metric-card:hover,
[data-theme="ocean"] .metric-card:hover {
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.06) 100%);
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="cream"] .metric-card *,
[data-theme="ocean"] .metric-card * {
  color: inherit;
}

[data-theme="cream"] .metric-card-label,
[data-theme="ocean"] .metric-card-label {
  color: #64748b !important;
}

[data-theme="cream"] .metric-card-hint,
[data-theme="ocean"] .metric-card-hint {
  color: #94a3b8 !important;
}

[data-theme="cream"] .metric-card-why,
[data-theme="ocean"] .metric-card-why {
  background: rgba(0, 0, 0, 0.03);
  color: #334155 !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Knowledge panel text overrides */
[data-theme="cream"] .knowledge-label,
[data-theme="ocean"] .knowledge-label {
  color: #64748b !important;
}

[data-theme="cream"] .knowledge-value,
[data-theme="ocean"] .knowledge-value {
  color: #1e293b !important;
}

[data-theme="cream"] .knowledge-value.empty,
[data-theme="ocean"] .knowledge-value.empty {
  color: #94a3b8 !important;
}

/* Pills in dark areas */
[data-theme="cream"] .pill-green-dark,
[data-theme="ocean"] .pill-green-dark {
  background: #dcfce7;
  color: #166534 !important;
}

[data-theme="cream"] .pill-blue-dark,
[data-theme="ocean"] .pill-blue-dark {
  background: #dbeafe;
  color: #1e40af !important;
}

/* ─────────────────────────────────────────────────────────────
   THEME-AWARE TEXT UTILITY CLASSES
   ───────────────────────────────────────────────────────────── */

/* Green accent text - dark on light themes, light on dark themes */
.text-green-accent {
  color: #86efac;
}

[data-theme="cream"] .text-green-accent,
[data-theme="ocean"] .text-green-accent {
  color: #166534;
}

/* Amber accent for labels */
.text-amber-accent {
  color: #f59e0b;
}

[data-theme="cream"] .text-amber-accent,
[data-theme="ocean"] .text-amber-accent {
  color: #b45309;
}

/* Red accent for labels */
.text-red-accent {
  color: #ef4444;
}

[data-theme="cream"] .text-red-accent,
[data-theme="ocean"] .text-red-accent {
  color: #dc2626;
}

/* Metric card content text */
.text-metric-content {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="cream"] .text-metric-content,
[data-theme="ocean"] .text-metric-content {
  color: #1e293b;
}

/* Metric card muted text */
.text-metric-muted {
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="cream"] .text-metric-muted,
[data-theme="ocean"] .text-metric-muted {
  color: #64748b;
}

/* Text on colored backgrounds (SIS circle) */
.text-theme-on-color {
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="cream"] .text-theme-on-color,
[data-theme="ocean"] .text-theme-on-color {
  color: #1e293b;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* ─────────────────────────────────────────────────────────────
   EXTRACTED DATA SECTION
   ───────────────────────────────────────────────────────────── */
.extracted-data-section {
  background: rgba(30, 41, 59, 0.5);
}

[data-theme="cream"] .extracted-data-section,
[data-theme="ocean"] .extracted-data-section {
  background: rgba(241, 245, 249, 0.9);
  border-bottom: 1px solid #e2e8f0;
}

.text-extracted-label {
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="cream"] .text-extracted-label,
[data-theme="ocean"] .text-extracted-label {
  color: #475569;
}

.text-extracted-arrow {
  color: rgba(255, 255, 255, 0.4);
}

[data-theme="cream"] .text-extracted-arrow,
[data-theme="ocean"] .text-extracted-arrow {
  color: #94a3b8;
}

.border-extracted {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="cream"] .border-extracted,
[data-theme="ocean"] .border-extracted {
  border-color: rgba(0, 0, 0, 0.1);
}

/* ─────────────────────────────────────────────────────────────
   TOP 1% MOVE CARD
   ───────────────────────────────────────────────────────────── */
.top-move-card {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  border: 2px solid rgba(34, 197, 94, 0.5);
}

[data-theme="cream"] .top-move-card,
[data-theme="ocean"] .top-move-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #86efac;
}

.text-top-move-title {
  color: #86efac;
}

[data-theme="cream"] .text-top-move-title,
[data-theme="ocean"] .text-top-move-title {
  color: #166534;
}

.text-top-move-content {
  color: white;
}

[data-theme="cream"] .text-top-move-content,
[data-theme="ocean"] .text-top-move-content {
  color: #14532d;
}

.text-top-move-hint {
  color: #a7f3d0;
}

[data-theme="cream"] .text-top-move-hint,
[data-theme="ocean"] .text-top-move-hint {
  color: #059669;
}

/* ─────────────────────────────────────────────────────────────
   PREDICTION CARD
   ───────────────────────────────────────────────────────────── */
.prediction-card {
  background: #1e1b4b;
  border: 1px solid #4338ca;
  color: white;
}

[data-theme="cream"] .prediction-card,
[data-theme="ocean"] .prediction-card {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid #a5b4fc;
  color: #1e1b4b;
}

.text-prediction-title {
  color: #a5b4fc;
}

[data-theme="cream"] .text-prediction-title,
[data-theme="ocean"] .text-prediction-title {
  color: #4338ca;
}

.text-prediction-content {
  color: white;
}

[data-theme="cream"] .text-prediction-content,
[data-theme="ocean"] .text-prediction-content {
  color: #312e81;
}

.text-prediction-hint {
  color: #c4b5fd;
}

[data-theme="cream"] .text-prediction-hint,
[data-theme="ocean"] .text-prediction-hint {
  color: #5b21b6;
}

.text-prediction-warning {
  color: #fde68a;
}

[data-theme="cream"] .text-prediction-warning,
[data-theme="ocean"] .text-prediction-warning {
  color: #92400e;
}

/* ─────────────────────────────────────────────────────────────
   STATUS ANCHOR CARD
   ───────────────────────────────────────────────────────────── */
.status-anchor-card {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="cream"] .status-anchor-card,
[data-theme="ocean"] .status-anchor-card {
  background: rgba(241, 245, 249, 0.95);
  border: 1px solid #e2e8f0;
}

.text-status-content {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="cream"] .text-status-content,
[data-theme="ocean"] .text-status-content {
  color: #1e293b;
}

/* ─────────────────────────────────────────────────────────────
   HAG PATTERNS TEXT
   ───────────────────────────────────────────────────────────── */
.text-hag-evidence {
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="cream"] .text-hag-evidence,
[data-theme="ocean"] .text-hag-evidence {
  color: #475569;
}

.text-hag-counter {
  color: #34d399;
}

[data-theme="cream"] .text-hag-counter,
[data-theme="ocean"] .text-hag-counter {
  color: #059669;
}

/* ─────────────────────────────────────────────────────────────
   MISSION CONTROL TEXT
   ───────────────────────────────────────────────────────────── */
.text-mission-current {
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="cream"] .text-mission-current,
[data-theme="ocean"] .text-mission-current {
  color: #64748b;
}

/* ─────────────────────────────────────────────────────────────
   ELITE INSIGHT CARDS
   ───────────────────────────────────────────────────────────── */
.elite-insight-banner {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="cream"] .elite-insight-banner,
[data-theme="ocean"] .elite-insight-banner {
  border-top: 1px solid #e2e8f0;
}

.elite-risk-card {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="cream"] .elite-risk-card,
[data-theme="ocean"] .elite-risk-card {
  background: rgba(254, 226, 226, 0.8);
  border: 1px solid #fca5a5;
}

.text-elite-risk-title {
  color: #fca5a5;
}

[data-theme="cream"] .text-elite-risk-title,
[data-theme="ocean"] .text-elite-risk-title {
  color: #dc2626;
}

.text-elite-risk-content {
  color: white;
}

[data-theme="cream"] .text-elite-risk-content,
[data-theme="ocean"] .text-elite-risk-content {
  color: #991b1b;
}

.elite-secret-card {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

[data-theme="cream"] .elite-secret-card,
[data-theme="ocean"] .elite-secret-card {
  background: rgba(243, 232, 255, 0.8);
  border: 1px solid #c4b5fd;
}

.text-elite-secret-title {
  color: #d8b4fe;
}

[data-theme="cream"] .text-elite-secret-title,
[data-theme="ocean"] .text-elite-secret-title {
  color: #7c3aed;
}

.text-elite-secret-content {
  color: white;
}

[data-theme="cream"] .text-elite-secret-content,
[data-theme="ocean"] .text-elite-secret-content {
  color: #5b21b6;
}

/* ─────────────────────────────────────────────────────────────
   ORACLE CARD (PRO layout)
   ───────────────────────────────────────────────────────────── */
.oracle-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: white;
}

[data-theme="cream"] .oracle-card,
[data-theme="ocean"] .oracle-card {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #1e1b4b;
  border: 1px solid #c7d2fe;
}

.text-oracle-title {
  color: #a5b4fc;
}

[data-theme="cream"] .text-oracle-title,
[data-theme="ocean"] .text-oracle-title {
  color: #4338ca;
}

.text-oracle-content {
  color: white;
}

[data-theme="cream"] .text-oracle-content,
[data-theme="ocean"] .text-oracle-content {
  color: #312e81;
}

.text-oracle-label {
  color: #a5b4fc;
}

[data-theme="cream"] .text-oracle-label,
[data-theme="ocean"] .text-oracle-label {
  color: #6366f1;
}

.text-oracle-detail {
  color: white;
}

[data-theme="cream"] .text-oracle-detail,
[data-theme="ocean"] .text-oracle-detail {
  color: #3730a3;
}

.oracle-reality-check {
  background: rgba(251, 191, 36, 0.2);
  border-left: 3px solid #fbbf24;
}

[data-theme="cream"] .oracle-reality-check,
[data-theme="ocean"] .oracle-reality-check {
  background: rgba(254, 243, 199, 0.8);
  border-left: 3px solid #f59e0b;
}

.text-oracle-warning-label {
  color: #fde68a;
}

[data-theme="cream"] .text-oracle-warning-label,
[data-theme="ocean"] .text-oracle-warning-label {
  color: #b45309;
}

.text-oracle-warning {
  color: white;
}

[data-theme="cream"] .text-oracle-warning,
[data-theme="ocean"] .text-oracle-warning {
  color: #92400e;
}

/* ─────────────────────────────────────────────────────────────
   SCENARIO FORECAST CARDS: Light theme overrides
   ───────────────────────────────────────────────────────────── */
[data-theme="cream"] .scenario-card.best,
[data-theme="ocean"] .scenario-card.best {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

[data-theme="cream"] .scenario-card.likely,
[data-theme="ocean"] .scenario-card.likely {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

[data-theme="cream"] .scenario-card.worst,
[data-theme="ocean"] .scenario-card.worst {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

[data-theme="cream"] .scenario-probability,
[data-theme="ocean"] .scenario-probability {
  color: #1e293b;
}

[data-theme="cream"] .scenario-outcome,
[data-theme="ocean"] .scenario-outcome {
  color: #475569;
}

[data-theme="cream"] .scenario-trigger,
[data-theme="ocean"] .scenario-trigger {
  color: #64748b;
}

/* Scenario labels keep their colors - they're readable on light */
[data-theme="cream"] .scenario-card.best .scenario-label,
[data-theme="ocean"] .scenario-card.best .scenario-label {
  color: #059669;
}

[data-theme="cream"] .scenario-card.likely .scenario-label,
[data-theme="ocean"] .scenario-card.likely .scenario-label {
  color: #2563eb;
}

[data-theme="cream"] .scenario-card.worst .scenario-label,
[data-theme="ocean"] .scenario-card.worst .scenario-label {
  color: #dc2626;
}

/* ─────────────────────────────────────────────────────────────
   MISSION CONTROL: Light theme overrides
   ───────────────────────────────────────────────────────────── */
[data-theme="cream"] .mission-control,
[data-theme="ocean"] .mission-control {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

[data-theme="cream"] .mission-goal,
[data-theme="ocean"] .mission-goal {
  color: #6d28d9;
}

[data-theme="cream"] .mission-progress,
[data-theme="ocean"] .mission-progress {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="cream"] .mission-progress-text,
[data-theme="ocean"] .mission-progress-text {
  color: #64748b;
}

[data-theme="cream"] .mission-subgoal.done,
[data-theme="ocean"] .mission-subgoal.done {
  color: #059669;
}

[data-theme="cream"] .mission-subgoal.in-progress,
[data-theme="ocean"] .mission-subgoal.in-progress {
  color: #2563eb;
}

[data-theme="cream"] .mission-subgoal.blocked,
[data-theme="ocean"] .mission-subgoal.blocked {
  color: #dc2626;
}

[data-theme="cream"] .mission-subgoal.pending,
[data-theme="ocean"] .mission-subgoal.pending {
  color: #64748b;
}

/* Mission next/abort text */
.text-mission-next {
  color: #60a5fa;
}

[data-theme="cream"] .text-mission-next,
[data-theme="ocean"] .text-mission-next {
  color: #2563eb;
}

.text-mission-abort {
  color: #f87171;
}

[data-theme="cream"] .text-mission-abort,
[data-theme="ocean"] .text-mission-abort {
  color: #dc2626;
}

/* Muted text for light cards - adapts to theme */
.text-card-muted {
  color: rgba(255, 255, 255, 0.6);
}

[data-theme="cream"] .text-card-muted,
[data-theme="ocean"] .text-card-muted {
  color: #4a4a4a;
}

/* Primary text for light cards - adapts to theme */
.text-card-primary {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="cream"] .text-card-primary,
[data-theme="ocean"] .text-card-primary {
  color: #1a1a1a;
}

/* Border color for light cards - adapts to theme */
.border-card-subtle {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="cream"] .border-card-subtle,
[data-theme="ocean"] .border-card-subtle {
  border-color: rgba(0, 0, 0, 0.1);
}

/* Border utility */
.border-t {
  border-top-width: 1px;
  border-top-style: solid;
}

/* ─────────────────────────────────────────────────────────────
   LIGHT THEME: Dark container overrides
   Convert dark backgrounds to light backgrounds on cream/ocean
   ───────────────────────────────────────────────────────────── */

/* Banner Dark - make light on light themes */
[data-theme="cream"] .banner-dark,
[data-theme="ocean"] .banner-dark {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

/* All text inside banner-dark */
[data-theme="cream"] .banner-dark *,
[data-theme="ocean"] .banner-dark * {
  color: inherit;
}

/* Override inline white text inside banner-dark */
[data-theme="cream"] .banner-dark [style*="color: white"],
[data-theme="cream"] .banner-dark [style*="color:white"],
[data-theme="cream"] .banner-dark .text-white,
[data-theme="ocean"] .banner-dark [style*="color: white"],
[data-theme="ocean"] .banner-dark [style*="color:white"],
[data-theme="ocean"] .banner-dark .text-white {
  color: #1e293b !important;
}

[data-theme="cream"] .banner-dark [style*="rgba(255,255,255"],
[data-theme="cream"] .banner-dark [style*="rgba(255, 255, 255"],
[data-theme="ocean"] .banner-dark [style*="rgba(255,255,255"],
[data-theme="ocean"] .banner-dark [style*="rgba(255, 255, 255"] {
  color: #475569 !important;
}

/* Action Card Dark - make light on light themes */
[data-theme="cream"] .action-card-dark,
[data-theme="ocean"] .action-card-dark {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #1e1b4b;
  border: 1px solid #c7d2fe;
}

[data-theme="cream"] .action-card-dark *,
[data-theme="ocean"] .action-card-dark * {
  color: inherit;
}

[data-theme="cream"] .action-card-dark [style*="color: white"],
[data-theme="cream"] .action-card-dark [style*="color:white"],
[data-theme="cream"] .action-card-dark .text-white,
[data-theme="ocean"] .action-card-dark [style*="color: white"],
[data-theme="ocean"] .action-card-dark [style*="color:white"],
[data-theme="ocean"] .action-card-dark .text-white {
  color: #1e1b4b !important;
}

[data-theme="cream"] .action-card-dark [style*="rgba(255,255,255"],
[data-theme="cream"] .action-card-dark [style*="rgba(255, 255, 255"],
[data-theme="ocean"] .action-card-dark [style*="rgba(255,255,255"],
[data-theme="ocean"] .action-card-dark [style*="rgba(255, 255, 255"] {
  color: #4338ca !important;
}

/* Labels in action-card-dark */
[data-theme="cream"] .action-card-dark .section-title,
[data-theme="ocean"] .action-card-dark .section-title {
  color: #4338ca !important;
}

/* Metric cards - make light on light themes */
[data-theme="cream"] .metric-card,
[data-theme="ocean"] .metric-card {
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.06) 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #1e293b;
}

[data-theme="cream"] .metric-card:hover,
[data-theme="ocean"] .metric-card:hover {
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.08) 100%);
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="cream"] .metric-card *,
[data-theme="ocean"] .metric-card * {
  color: inherit;
}

[data-theme="cream"] .metric-card [style*="color: white"],
[data-theme="cream"] .metric-card [style*="color:white"],
[data-theme="cream"] .metric-card .text-white,
[data-theme="ocean"] .metric-card [style*="color: white"],
[data-theme="ocean"] .metric-card [style*="color:white"],
[data-theme="ocean"] .metric-card .text-white {
  color: #1e293b !important;
}

[data-theme="cream"] .metric-card [style*="rgba(255,255,255"],
[data-theme="cream"] .metric-card [style*="rgba(255, 255, 255"],
[data-theme="ocean"] .metric-card [style*="rgba(255,255,255"],
[data-theme="ocean"] .metric-card [style*="rgba(255, 255, 255"] {
  color: #475569 !important;
}

[data-theme="cream"] .metric-card-label,
[data-theme="ocean"] .metric-card-label {
  color: #64748b !important;
}

[data-theme="cream"] .metric-card-hint,
[data-theme="ocean"] .metric-card-hint {
  color: #94a3b8 !important;
}

[data-theme="cream"] .metric-card-why,
[data-theme="ocean"] .metric-card-why {
  background: rgba(0, 0, 0, 0.05);
  color: #334155 !important;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* SIS Circle text */
[data-theme="cream"] .sis-circle .sis-coaching,
[data-theme="ocean"] .sis-circle .sis-coaching {
  color: #1e293b !important;
  text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

/* Extracted Data Section */
[data-theme="cream"] [style*="background: rgba(30, 41, 59"],
[data-theme="ocean"] [style*="background: rgba(30, 41, 59"] {
  background: rgba(241, 245, 249, 0.9) !important;
  border: 1px solid #e2e8f0;
}

[data-theme="cream"] [style*="background: rgba(30, 41, 59"] *,
[data-theme="ocean"] [style*="background: rgba(30, 41, 59"] * {
  color: #334155 !important;
}

/* Knowledge panel text */
[data-theme="cream"] .knowledge-label,
[data-theme="ocean"] .knowledge-label {
  color: #64748b !important;
}

[data-theme="cream"] .knowledge-value,
[data-theme="ocean"] .knowledge-value {
  color: #1e293b !important;
}

[data-theme="cream"] .knowledge-value.empty,
[data-theme="ocean"] .knowledge-value.empty {
  color: #94a3b8 !important;
}

/* Status anchor cards with dark backgrounds */
[data-theme="cream"] [style*="background: rgba(30, 41, 59, 0.8)"],
[data-theme="ocean"] [style*="background: rgba(30, 41, 59, 0.8)"] {
  background: rgba(241, 245, 249, 0.95) !important;
  border: 1px solid #e2e8f0 !important;
}

/* HAG badges */
[data-theme="cream"] .hag-badge,
[data-theme="ocean"] .hag-badge {
  color: #1e293b !important;
}

/* Mission control */
[data-theme="cream"] .mission-control,
[data-theme="ocean"] .mission-control {
  color: #1e293b;
}

[data-theme="cream"] .mission-control [style*="color: rgba(255,255,255"],
[data-theme="cream"] .mission-control [style*="color: rgba(255, 255, 255"],
[data-theme="ocean"] .mission-control [style*="color: rgba(255,255,255"],
[data-theme="ocean"] .mission-control [style*="color: rgba(255, 255, 255"] {
  color: #475569 !important;
}

/* Oracle section bg-glass */
[data-theme="cream"] .bg-glass,
[data-theme="ocean"] .bg-glass {
  background: rgba(0, 0, 0, 0.03) !important;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="cream"] .bg-glass *,
[data-theme="ocean"] .bg-glass * {
  color: #334155 !important;
}

/* Override for any remaining inline rgba white */
[data-theme="cream"] .banner-dark div[style*="color: rgba(255"],
[data-theme="cream"] .action-card-dark div[style*="color: rgba(255"],
[data-theme="cream"] .metric-card div[style*="color: rgba(255"],
[data-theme="ocean"] .banner-dark div[style*="color: rgba(255"],
[data-theme="ocean"] .action-card-dark div[style*="color: rgba(255"],
[data-theme="ocean"] .metric-card div[style*="color: rgba(255"] {
  color: #475569 !important;
}

/* Section headers in dark containers */
[data-theme="cream"] .banner-dark .section-header,
[data-theme="cream"] .banner-dark .section-title,
[data-theme="ocean"] .banner-dark .section-header,
[data-theme="ocean"] .banner-dark .section-title {
  color: #1e293b !important;
}

/* Pills in dark areas */
[data-theme="cream"] .pill-green-dark,
[data-theme="ocean"] .pill-green-dark {
  background: #dcfce7;
  color: #166534 !important;
}

[data-theme="cream"] .pill-blue-dark,
[data-theme="ocean"] .pill-blue-dark {
  background: #dbeafe;
  color: #1e40af !important;
}

/* Border overrides for light themes */
[data-theme="cream"] [style*="border: 1px solid rgba(255,255,255"],
[data-theme="cream"] [style*="border: 1px solid rgba(255, 255, 255"],
[data-theme="cream"] [style*="border-top: 1px solid rgba(255,255,255"],
[data-theme="cream"] [style*="border-top: 1px solid rgba(255, 255, 255"],
[data-theme="ocean"] [style*="border: 1px solid rgba(255,255,255"],
[data-theme="ocean"] [style*="border: 1px solid rgba(255, 255, 255"],
[data-theme="ocean"] [style*="border-top: 1px solid rgba(255,255,255"],
[data-theme="ocean"] [style*="border-top: 1px solid rgba(255, 255, 255"] {
  border-color: rgba(0, 0, 0, 0.1) !important;
}

/* Dark indigo background (Oracle prediction) */
[data-theme="cream"] [style*="background: #1e1b4b"],
[data-theme="ocean"] [style*="background: #1e1b4b"] {
  background: #eef2ff !important;
}

[data-theme="cream"] [style*="background: #1e1b4b"] *,
[data-theme="ocean"] [style*="background: #1e1b4b"] * {
  color: #312e81 !important;
}

/* Key risk and not telling you cards in elite insight section */
[data-theme="cream"] [style*="background: rgba(239, 68, 68, 0.15)"],
[data-theme="ocean"] [style*="background: rgba(239, 68, 68, 0.15)"] {
  background: rgba(239, 68, 68, 0.1) !important;
}

[data-theme="cream"] [style*="background: rgba(239, 68, 68, 0.15)"] .text-white,
[data-theme="cream"] [style*="background: rgba(239, 68, 68, 0.15)"] [style*="text-white"],
[data-theme="ocean"] [style*="background: rgba(239, 68, 68, 0.15)"] .text-white,
[data-theme="ocean"] [style*="background: rgba(239, 68, 68, 0.15)"] [style*="text-white"] {
  color: #991b1b !important;
}

[data-theme="cream"] [style*="background: rgba(168, 85, 247, 0.15)"],
[data-theme="ocean"] [style*="background: rgba(168, 85, 247, 0.15)"] {
  background: rgba(168, 85, 247, 0.1) !important;
}

[data-theme="cream"] [style*="background: rgba(168, 85, 247, 0.15)"] .text-white,
[data-theme="cream"] [style*="background: rgba(168, 85, 247, 0.15)"] [style*="text-white"],
[data-theme="ocean"] [style*="background: rgba(168, 85, 247, 0.15)"] .text-white,
[data-theme="ocean"] [style*="background: rgba(168, 85, 247, 0.15)"] [style*="text-white"] {
  color: #5b21b6 !important;
}

/* Generic text-white override in any context on light themes */
[data-theme="cream"] .text-white,
[data-theme="ocean"] .text-white {
  color: #1e293b !important;
}