/* ═══════════════════════════════════════════════════════════════
   CSS VARIABLES - THEME SYSTEM
   ═══════════════════════════════════════════════════════════════ */

/* Midnight Theme (Dark - Default) */
:root,
[data-theme="midnight"] {
  --bg: #0b1221;
  --bg-alt: #101827;
  --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-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;
  --blue-400: #60a5fa;
  --loading-overlay-bg: rgba(11, 18, 33, 0.95);
}

/* Cream Theme (Light) */
[data-theme="cream"] {
  --bg: #fdfbf7;
  --bg-alt: #f8f5f0;
  --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-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;
  --loading-overlay-bg: rgba(253, 251, 247, 0.95);
}

/* Ocean Breeze Theme (Light) */
[data-theme="ocean"] {
  --bg: #f0f9ff;
  --bg-alt: #e0f2fe;
  --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-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;
  --loading-overlay-bg: rgba(240, 249, 255, 0.95);
}

/* Tanzanite Theme (Dark) */
[data-theme="tanzanite"] {
  --bg: #0f0d1a;
  --bg-alt: #1a1625;
  --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-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;
  --loading-overlay-bg: rgba(15, 13, 26, 0.95);
}

/* Obsidian Theme (Dark) */
[data-theme="obsidian"] {
  --bg: #09090b;
  --bg-alt: #18181b;
  --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-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;
  --loading-overlay-bg: rgba(9, 9, 11, 0.95);
}

/* ═══════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   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;
}

/* Adjust body padding when toolbar is visible */
body.toolbar-active {
    padding-top: 56px;
}

/* Toolbar Sections */
.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.toolbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-label {
    display: flex;
    align-items: center;
    color: var(--ink-secondary);
}

.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;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.toolbar-btn:active {
    transform: scale(0.96);
}

/* App Launcher Button */
.app-launcher-btn {
    width: 40px;
    height: 40px;
}

.app-launcher-btn svg {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.app-launcher-btn:hover svg {
    opacity: 1;
}

.app-launcher-btn.active {
    background: var(--line);
    color: var(--ink);
}

/* Toolbar Brand */
.toolbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-logo .logo-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.toolbar-logo .logo-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--ink);
}

.toolbar-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.toolbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-brand-text {
    display: flex;
    flex-direction: column;
}

.toolbar-brand-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--ink);
    line-height: 1.2;
}

/* User Profile Dropdown */
.user-profile-dropdown {
    position: relative;
}

.user-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;
    width: auto;
    height: auto;
}

.user-profile-btn:hover {
    background: var(--surface);
    border-color: var(--muted);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.user-name-display {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ink);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    opacity: 0.6;
    transition: transform 0.2s;
}

.user-profile-btn[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Profile Dropdown Menu */
.profile-dropdown-menu {
    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;
}

.profile-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.user-avatar-large {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-email {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-plan {
    font-size: 11px;
    color: var(--cyan);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.profile-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

.profile-menu-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;
}

.profile-menu-item:hover {
    background: var(--surface);
}

.profile-menu-item:last-child {
    border-radius: 0 0 12px 12px;
}

.profile-menu-item svg {
    color: var(--muted);
    flex-shrink: 0;
}

/* Settings Icon Button */
.settings-icon-btn {
    width: 40px;
    height: 40px;
}

/* ═══════════════════════════════════════════════════════════════
   APP LAUNCHER PANEL
   ═══════════════════════════════════════════════════════════════ */

.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(--surface);
  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(--line-soft);
  border-color: var(--line);
}

.app-launcher-item.current {
  background: var(--line-soft);
  border-color: var(--cyan);
}

.app-launcher-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--line-soft), var(--surface));
  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;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TOOLBAR RESPONSIVE STYLES
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .app-toolbar {
        padding: 0 12px;
        height: 52px;
    }
    
    .toolbar-logo .logo-text,
    .toolbar-brand-text {
        display: none;
    }
    
    .user-name-display {
        display: none;
    }
    
    .user-profile-btn {
        padding: 6px;
    }
    
    .app-launcher {
        left: 8px;
        right: 8px;
        width: auto;
    }
    
    .profile-dropdown-menu {
        right: -8px;
        width: 260px;
    }
}

@media (max-width: 480px) {
    .app-launcher-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 10px;
    }
    
    .app-launcher-item {
        padding: 12px 8px;
    }
    
    .app-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    
    .app-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   ACCESSIBILITY STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Screen reader only - visually hidden 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;
}

/* Skip link - visible after analysis and on focus */
.skip-link {
    position: fixed;
    top: 56px;
    left: 16px;
    background: var(--teal);
    color: white;
    padding: 8px 16px;
    z-index: 999;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
}

.skip-link.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.skip-link:hover {
    background: var(--cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.skip-link:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .loading-spinner {
        animation: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   FILE DROP ZONE STYLES
   ═══════════════════════════════════════════════════════════════ */

.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    background: var(--surface);
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 16px;
}

.file-drop-zone:hover {
    border-color: var(--cyan);
    background: var(--bg-alt);
}

.file-drop-zone.drag-over {
    border-color: var(--cyan);
    background: var(--bg-alt);
    transform: scale(1.01);
}

.file-drop-zone.processing {
    opacity: 0.7;
    pointer-events: none;
}

.file-drop-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.file-drop-text {
    font-size: 14px;
    color: var(--ink-secondary);
    margin-bottom: 8px;
}

.file-drop-text strong {
    color: var(--blue-600);
}

.file-drop-formats {
    font-size: 12px;
    color: var(--ink-muted);
}

.file-drop-input {
    display: none;
}

/* File list when files are added */
.file-list {
    margin-top: 12px;
    text-align: left;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-item-icon {
    font-size: 18px;
}

.file-item-name {
    font-weight: 500;
    color: var(--ink);
}

.file-item-size {
    color: var(--ink-muted);
    font-size: 11px;
}

.file-item-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.file-item-status.success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.file-item-status.error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.file-item-status.processing {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-600);
}

.file-item-remove {
    background: none;
    border: none;
    color: var(--ink-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color 0.2s;
}

.file-item-remove:hover {
    color: var(--danger);
}

/* Add file button for assessment mode */
.add-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.add-file-btn:hover {
    background: var(--line-soft);
    border-color: var(--blue-500);
    color: var(--blue-600);
}

/* Mini drop zone for adding files during assessment */
.mini-drop-zone {
    display: none;
    border: 2px dashed var(--line);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    background: var(--bg-alt);
    margin-top: 12px;
    transition: all 0.2s;
}

.mini-drop-zone.active {
    display: block;
}

.mini-drop-zone.drag-over {
    border-color: var(--blue-500);
    background: var(--blue-100);
}

/* ═══════════════════════════════════════════════════════════════
   V3.50 - PRODUCTION FEATURES CSS
   ═══════════════════════════════════════════════════════════════ */

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-banner.visible {
    transform: translateY(0);
}

/* Export Toast */
.export-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--ink);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.export-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Template Buttons */
.template-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.template-btn {
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: 13px;
    color: var(--ink-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.template-btn:hover {
    border-color: var(--blue-500);
    color: var(--blue-600);
    background: var(--blue-50);
}

.template-btn.active {
    background: var(--blue-600);
    border-color: var(--blue-600);
    color: white;
}

/* History Button */
.history-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-btn:hover {
    border-color: var(--blue-500);
    color: var(--blue-600);
}

.history-badge {
    background: var(--blue-600);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--ink-muted);
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: var(--ink);
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: 60vh;
}

/* History Items */
.history-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.history-item:hover {
    border-color: var(--blue-500);
    background: var(--blue-50);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.history-item-title {
    font-weight: 600;
    color: var(--ink);
}

.history-item-date {
    font-size: 12px;
    color: var(--ink-muted);
}

.history-item-preview {
    font-size: 13px;
    color: var(--ink-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.empty-state {
    text-align: center;
    color: var(--ink-muted);
    padding: 24px;
}

/* Export Buttons */
.export-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-alt);
    border-radius: 8px;
    margin: 0 auto 16px auto;
    max-width: fit-content;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-btn:hover {
    border-color: var(--blue-500);
    color: var(--blue-600);
    background: var(--blue-50);
}

.export-btn.primary {
    background: var(--blue-600);
    border-color: var(--blue-600);
    color: white;
}

.export-btn.primary:hover {
    background: var(--blue-700);
}

/* Progress Bar Improvements */
.progress-container {
    margin-top: 16px;
}

.progress-bar-wrapper {
    background: var(--line);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-500), var(--blue-600));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-status {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ink-muted);
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .template-buttons {
        justify-content: center;
    }

    .template-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .export-bar {
        justify-content: center;
    }

    .results-action-bar {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 12px 16px;
        min-height: 48px;
    }

    .modal-content {
        width: 95%;
        margin: 16px;
    }

    .history-item-delete {
        opacity: 1;
    }

    /* Bottom-aligned analyze button on mobile */
    .analyze-btn {
        position: sticky;
        bottom: 16px;
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════
   HEADER & BRANDING
   ═══════════════════════════════════════════════════════════════ */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--orange), var(--gold));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: white;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--ink);
}

.brand-tagline {
    font-size: 11px;
    color: var(--ink-muted);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   INPUT SCREEN
   ═══════════════════════════════════════════════════════════════ */

.input-screen {
    padding: 0 20px;
    max-width: 800px;
    margin: 0 auto;
}

.input-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--ink);
}

.input-subtitle {
    font-size: 14px;
    text-align: center;
    color: var(--ink-muted);
    margin-bottom: 32px;
}

/* 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 !important;
}

@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(--cyan), var(--teal), var(--blue-400));
    -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;
}

.input-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.input-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-secondary);
    margin-bottom: 8px;
    display: block;
}

.transcript-input {
    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);
}

.transcript-input:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.transcript-input::placeholder {
    color: var(--ink-muted);
}

.context-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: var(--bg-alt);
    color: var(--ink);
    margin-top: 16px;
}

.analyze-btn {
    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;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
}

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.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.active{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.active .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}
.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}
.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}
.analyst-pills-container{position:fixed;inset:0;pointer-events:none;overflow:hidden;opacity:0;transition:opacity 0.3s;z-index:10004}
.analyst-pills-container.active{opacity:1}
.analyst-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}
.analyst-pill.visible{opacity:1}
.analyst-pill.marketing{background:linear-gradient(135deg,#c4a052 0%,#a88a3e 100%);color:white}
.analyst-pill.audience{background:linear-gradient(135deg,#3b82f6 0%,#2563eb 100%);color:white}
.analyst-pill.content{background:linear-gradient(135deg,#10b981 0%,#059669 100%);color:white}
.analyst-pill.strategy{background:linear-gradient(135deg,#8b5cf6 0%,#6366f1 100%);color:white}
.analyst-pill.insight{background:linear-gradient(135deg,#f59e0b 0%,#d97706 100%);color:white}
.analyst-pill.creative{background:linear-gradient(135deg,#ec4899 0%,#db2777 100%);color:white}
.analyst-pill.processing{background:linear-gradient(135deg,#64748b 0%,#475569 100%);color:white}
@keyframes loadingProgress{0%{width:0%}50%{width:80%}100%{width:100%}}
@keyframes spin{to{transform:rotate(360deg)}}

.loading-stage {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 14px;
}

.loading-stage-icon {
    font-size: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   RESULTS SCREEN
   ═══════════════════════════════════════════════════════════════ */

.results-screen {
    display: none;
}

.results-screen.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   TAB NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

.tab-nav {
    display: flex;
    gap: 4px;
    padding: 8px;
    background: var(--surface);
    border-radius: 12px;
    margin: 20px auto;
    max-width: 500px;
    border: 1px solid var(--line);
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tab-btn:hover {
    background: var(--line-soft);
    color: var(--ink-secondary);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--blue-500), var(--cyan));
    color: white;
}

.tab-btn.active.oracle {
    background: linear-gradient(135deg, var(--orange), var(--gold));
}

.tab-btn.active.team {
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
}

.tab-btn.active.record {
    background: linear-gradient(135deg, var(--success), var(--teal));
}

/* ═══════════════════════════════════════════════════════════════
   TAB CONTENT CONTAINERS
   ═══════════════════════════════════════════════════════════════ */

.tab-content {
    display: none;
    padding: 32px;
    max-width: 1000px;
    margin: 24px auto;
    background: var(--bg);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--glow, 0 4px 20px rgba(0, 0, 0, 0.1));
}

.tab-content.active {
    display: block;
}

/* Tab Headers */
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tab-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
}

.tab-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.tab-badge.oracle {
    background: linear-gradient(135deg, var(--orange), var(--gold));
}

.tab-badge.oracle.work-safe {
    background: linear-gradient(135deg, #10b981, #059669);
}

.tab-badge.team {
    background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
}

.tab-badge.record {
    background: linear-gradient(135deg, var(--success), var(--teal));
}

/* ═══════════════════════════════════════════════════════════════
   SECTION STYLES
   ═══════════════════════════════════════════════════════════════ */

.section {
    margin-bottom: 28px;
    background: var(--panel);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--glow, 0 4px 20px rgba(0, 0, 0, 0.1));
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.section-icon {
    font-size: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}

.section-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--blue-500), var(--cyan));
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   SIGNALBOARD (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

.signalboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.signal-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.signal-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
    margin-bottom: 8px;
}

.signal-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

.signal-sublabel {
    font-size: 11px;
    color: var(--ink-muted);
    text-transform: uppercase;
}

.signal-status {
    font-size: 16px;
    margin-top: 4px;
}

/* Signal card risk highlight */
.signal-card.risk {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), transparent);
}

/* Pulse Animation for Signal Cards */
@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);
    }
}

.signal-card.pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

.signal-card.pulse.positive {
    animation-name: pulse-glow-green;
}

@keyframes pulse-glow-green {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0);
    }

    50% {
        box-shadow: 0 0 15px 3px rgba(5, 150, 105, 0.2);
    }
}

.signal-card.pulse.warning {
    animation-name: pulse-glow-orange;
}

@keyframes pulse-glow-orange {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(217, 119, 6, 0);
    }

    50% {
        box-shadow: 0 0 15px 3px rgba(217, 119, 6, 0.2);
    }
}

.signal-card.pulse.danger {
    animation-name: pulse-glow-red;
}

@keyframes pulse-glow-red {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }

    50% {
        box-shadow: 0 0 15px 3px rgba(220, 38, 38, 0.25);
    }
}

/* ═══════════════════════════════════════════════════════════════
   SIGNALBOARD - GROUPED VIEW (3 Primary Metrics)
   ═══════════════════════════════════════════════════════════════ */

.signalboard-primary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.signal-group {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.signal-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--ink-muted);
    margin-bottom: 8px;
}

.signal-group-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 4px;
}

.signal-group-status {
    font-size: 18px;
    margin-bottom: 8px;
}

.signal-group-sub {
    font-size: 11px;
    color: var(--ink-muted);
}

/* Group color accents */
.signal-group.deal-health {
    border-top: 3px solid var(--blue-500);
}

.signal-group.relationship {
    border-top: 3px solid var(--success);
}

.signal-group.risk {
    border-top: 3px solid var(--orange);
}

/* Expand details */
.signalboard-details {
    margin-top: 8px;
}

.signalboard-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-alt);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink-muted);
    list-style: none;
    user-select: none;
}

.signalboard-expand::-webkit-details-marker {
    display: none;
}

.signalboard-expand:hover {
    background: var(--line-soft);
}

.expand-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.signalboard-details[open] .expand-arrow {
    transform: rotate(180deg);
}

.signalboard-details[open] .signalboard-expand {
    border-radius: 8px 8px 0 0;
}

.signalboard-details .signalboard {
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--line-soft);
    border-top: none;
    padding: 16px;
    background: var(--bg-alt);
}

/* Mobile responsive */
@media (max-width: 600px) {
    .signalboard-primary {
        grid-template-columns: 1fr;
    }

    .signal-group-value {
        font-size: 28px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   VERDICT BOX - Deal Assessment
   ═══════════════════════════════════════════════════════════════ */

.verdict-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

[data-theme="tanzanite"] .verdict-box,
[data-theme="midnight"] .verdict-box,
[data-theme="obsidian"] .verdict-box {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(251, 191, 36, 0.08) 100%);
    border-color: rgba(251, 191, 36, 0.5);
}

.verdict-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.verdict-icon {
    font-size: 20px;
}

.verdict-title {
    font-weight: 700;
    color: #92400e;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="tanzanite"] .verdict-title,
[data-theme="midnight"] .verdict-title,
[data-theme="obsidian"] .verdict-title {
    color: #fbbf24;
}

.verdict-text {
    color: #78350f;
    font-size: 14px;
    line-height: 1.7;
}

[data-theme="tanzanite"] .verdict-text,
[data-theme="midnight"] .verdict-text,
[data-theme="obsidian"] .verdict-text {
    color: var(--ink-secondary);
}

/* Verdict status variants */
.verdict-box.proceed {
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    border-color: #22c55e;
}

.verdict-box.proceed .verdict-title {
    color: #166534;
}

.verdict-box.proceed .verdict-text {
    color: #14532d;
}

.verdict-box.caution {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border-color: #fbbf24;
}

.verdict-box.stop {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #ef4444;
}

.verdict-box.stop .verdict-title {
    color: #991b1b;
}

.verdict-box.stop .verdict-text {
    color: #7f1d1d;
}

/* ═══════════════════════════════════════════════════════════════
   HIDDEN DYNAMICS - Power Signals & Psychology
   ═══════════════════════════════════════════════════════════════ */

.dynamics-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

[data-theme="tanzanite"] .dynamics-card,
[data-theme="midnight"] .dynamics-card,
[data-theme="obsidian"] .dynamics-card {
    background: var(--surface);
    border-color: var(--line);
}

.dynamics-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.dynamics-card-icon {
    font-size: 18px;
}

.dynamics-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.dynamics-card-content {
    font-size: 14px;
    line-height: 1.8;
    color: var(--ink-secondary);
}

.dynamics-card-content strong {
    color: var(--ink);
    display: block;
    margin-bottom: 4px;
}

.dynamics-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-soft);
}

.dynamics-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Unspoken Concerns - Red variant */
.dynamics-card.concerns {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

[data-theme="tanzanite"] .dynamics-card.concerns,
[data-theme="midnight"] .dynamics-card.concerns,
[data-theme="obsidian"] .dynamics-card.concerns {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.dynamics-card.concerns .dynamics-card-title {
    color: #991b1b;
}

[data-theme="tanzanite"] .dynamics-card.concerns .dynamics-card-title,
[data-theme="midnight"] .dynamics-card.concerns .dynamics-card-title,
[data-theme="obsidian"] .dynamics-card.concerns .dynamics-card-title {
    color: #f87171;
}

.dynamics-card.concerns .dynamics-card-content {
    color: #7f1d1d;
}

[data-theme="tanzanite"] .dynamics-card.concerns .dynamics-card-content,
[data-theme="midnight"] .dynamics-card.concerns .dynamics-card-content,
[data-theme="obsidian"] .dynamics-card.concerns .dynamics-card-content {
    color: var(--ink-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   PSYCHOLOGICAL MARKERS TABLE
   ═══════════════════════════════════════════════════════════════ */

.psych-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.psych-table th,
.psych-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.psych-table th {
    background: var(--line-soft);
    font-weight: 600;
    color: var(--ink-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.psych-table tbody tr:hover {
    background: var(--blue-50);
}

[data-theme="tanzanite"] .psych-table tbody tr:hover,
[data-theme="midnight"] .psych-table tbody tr:hover,
[data-theme="obsidian"] .psych-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.psych-table td strong {
    color: var(--ink);
}

.psych-table td:nth-child(2) {
    color: var(--ink-muted);
    font-style: italic;
}

.psych-table td:nth-child(3) {
    color: var(--blue-600);
}

/* ═══════════════════════════════════════════════════════════════
   SMART SUMMARY (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

/* Old smart-summary kept for backwards compatibility */
.smart-summary {
    background: linear-gradient(135deg, var(--blue-50), rgba(6, 182, 212, 0.05));
    border: 1px solid var(--blue-100);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

[data-theme="tanzanite"] .smart-summary,
[data-theme="midnight"] .smart-summary,
[data-theme="obsidian"] .smart-summary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.05));
    border-color: rgba(59, 130, 246, 0.2);
}

/* ═══════════════════════════════════════════════════════════════
   SMART SUMMARY V2 - Animated Sentiment-Based Border
   ═══════════════════════════════════════════════════════════════ */

/* Animated border glow keyframes */
@keyframes borderGlow {

    0%,
    100% {
        box-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color), 0 0 15px var(--glow-color);
    }

    50% {
        box-shadow: 0 0 10px var(--glow-color), 0 0 20px var(--glow-color), 0 0 30px var(--glow-color);
    }
}

@keyframes borderPulse {

    0%,
    100% {
        border-color: var(--border-color);
        box-shadow: 0 0 8px var(--glow-color);
    }

    50% {
        border-color: var(--border-color-bright);
        box-shadow: 0 0 20px var(--glow-color), 0 0 30px var(--glow-color);
    }
}

.smart-summary-v2 {
    background: linear-gradient(135deg, var(--blue-50) 0%, white 100%);
    border: 6px solid var(--blue-400);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    position: relative;
    --border-color: var(--blue-400);
    --border-color-bright: var(--blue-500);
    --glow-color: rgba(59, 130, 246, 0.4);
}

/* Sentiment-based border colors */
.smart-summary-v2.sentiment-info {
    border-color: var(--blue-400);
    --border-color: var(--blue-400);
    --border-color-bright: var(--blue-500);
    --glow-color: rgba(59, 130, 246, 0.5);
}

.smart-summary-v2.sentiment-good {
    border-color: var(--green-500);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, white 100%);
    --border-color: var(--green-500);
    --border-color-bright: var(--green-400);
    --glow-color: rgba(16, 185, 129, 0.5);
}

.smart-summary-v2.sentiment-warning {
    border-color: var(--amber-500);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, white 100%);
    --border-color: var(--amber-500);
    --border-color-bright: var(--amber-400);
    --glow-color: rgba(245, 158, 11, 0.5);
}

.smart-summary-v2.sentiment-issue {
    border-color: var(--red-500);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, white 100%);
    --border-color: var(--red-500);
    --border-color-bright: var(--red-400);
    --glow-color: rgba(239, 68, 68, 0.5);
}

/* Animation class - applied for first 5 seconds */
.smart-summary-v2.animate-border {
    animation: borderPulse 1s ease-in-out infinite;
}

/* Dark theme adjustments */
[data-theme="tanzanite"] .smart-summary-v2,
[data-theme="midnight"] .smart-summary-v2,
[data-theme="obsidian"] .smart-summary-v2 {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, var(--surface) 100%);
}

[data-theme="tanzanite"] .smart-summary-v2.sentiment-good,
[data-theme="midnight"] .smart-summary-v2.sentiment-good,
[data-theme="obsidian"] .smart-summary-v2.sentiment-good {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, var(--surface) 100%);
}

[data-theme="tanzanite"] .smart-summary-v2.sentiment-warning,
[data-theme="midnight"] .smart-summary-v2.sentiment-warning,
[data-theme="obsidian"] .smart-summary-v2.sentiment-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, var(--surface) 100%);
}

[data-theme="tanzanite"] .smart-summary-v2.sentiment-issue,
[data-theme="midnight"] .smart-summary-v2.sentiment-issue,
[data-theme="obsidian"] .smart-summary-v2.sentiment-issue {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, var(--surface) 100%);
}

.smart-summary-v2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.smart-summary-v2-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.smart-summary-v2-icon {
    font-size: 20px;
}

.smart-summary-v2-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.3px;
}

.must-read-badge {
    background: var(--blue-100);
    border: 1px solid var(--blue-300);
    color: var(--blue-700);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: 4px;
}

.smart-summary-v2.sentiment-good .must-read-badge {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--green-400);
    color: var(--green-700);
}

.smart-summary-v2.sentiment-warning .must-read-badge {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--amber-400);
    color: var(--amber-700);
}

.smart-summary-v2.sentiment-issue .must-read-badge {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--red-400);
    color: var(--red-700);
}

[data-theme="tanzanite"] .must-read-badge,
[data-theme="midnight"] .must-read-badge,
[data-theme="obsidian"] .must-read-badge {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--blue-500);
    color: var(--blue-300);
}

.smart-summary-v2-body {
    padding: 20px;
}

/* Insight Flow Line - Understanding → Insight → Action */
.smart-summary-insight-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.08));
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* V1 SO WHAT - Bold headline */
.ss-v1-so-what {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.4;
    margin-bottom: 16px;
}

/* V1 Context - Plain paragraphs */
.ss-v1-context {
    margin-bottom: 20px;
}

.ss-v1-paragraph {
    font-size: 14px;
    line-height: 1.8;
    color: var(--ink-secondary);
    margin-bottom: 12px;
}

.ss-v1-paragraph:last-child {
    margin-bottom: 0;
}

/* V1 Forecast - With structured bolding */
.ss-v1-forecast {
    font-size: 14px;
    line-height: 1.8;
    color: var(--ink-secondary);
}

.ss-v1-forecast strong {
    color: var(--ink);
    font-weight: 600;
}

.smart-summary-v2.sentiment-good .smart-summary-insight-flow {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.smart-summary-v2.sentiment-warning .smart-summary-insight-flow {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
}

.smart-summary-v2.sentiment-issue .smart-summary-insight-flow {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
}

[data-theme="tanzanite"] .smart-summary-insight-flow,
[data-theme="midnight"] .smart-summary-insight-flow,
[data-theme="obsidian"] .smart-summary-insight-flow {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), rgba(16, 185, 129, 0.1));
}

.insight-segment {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.insight-segment.understanding {
    color: var(--blue-600);
}

.insight-segment.key-insight {
    color: var(--success);
}

.insight-segment.key-action {
    color: var(--orange);
}

[data-theme="tanzanite"] .insight-segment,
[data-theme="midnight"] .insight-segment,
[data-theme="obsidian"] .insight-segment {
    color: var(--ink);
}

[data-theme="tanzanite"] .insight-segment.understanding,
[data-theme="midnight"] .insight-segment.understanding,
[data-theme="obsidian"] .insight-segment.understanding {
    color: var(--blue-400);
}

[data-theme="tanzanite"] .insight-segment.key-insight,
[data-theme="midnight"] .insight-segment.key-insight,
[data-theme="obsidian"] .insight-segment.key-insight {
    color: #34d399;
}

[data-theme="tanzanite"] .insight-segment.key-action,
[data-theme="midnight"] .insight-segment.key-action,
[data-theme="obsidian"] .insight-segment.key-action {
    color: var(--orange);
}

.insight-arrow {
    font-size: 16px;
    color: var(--ink-muted);
    font-weight: 600;
}

/* Smart Summary Paragraphs - max 2 sentences each */
.smart-summary-paragraph {
    font-size: 14px;
    line-height: 1.8;
    color: var(--ink-secondary);
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
}

.smart-summary-paragraph:last-of-type {
    border-bottom: none;
}

.smart-summary-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--line-soft);
}

.smart-summary-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.smart-summary-section:first-child {
    padding-top: 0;
}

.smart-summary-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.section-icon-inline {
    font-size: 16px;
}

.section-label-inline {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--amber-600);
}

.smart-summary-section.forecast .section-label-inline {
    color: var(--blue-600);
}

.smart-summary-section-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--ink-secondary);
}

/* Smart Summary Version Toggle */
.smart-summary-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ss-version-btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--line);
    background: var(--bg-alt);
    color: var(--ink-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.ss-version-btn:hover {
    border-color: var(--ink-muted);
}

.ss-version-btn.active {
    background: var(--blue-500);
    border-color: var(--blue-500);
    color: white;
}

/* ═══════════════════════════════════════════════════════════════
   SMART SUMMARY V2: EXECUTIVE GLANCE
   Anchor + Next Steps Only
   ═══════════════════════════════════════════════════════════════ */

/* V2 Anchor - Bold headline */
.ss-v2-anchor {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.4;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-soft);
}

/* V2 Next Steps */
.ss-v2-next-steps {
    background: var(--bg-alt);
    border-radius: 10px;
    padding: 16px 20px;
}

.ss-v2-next-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--ink-muted);
    margin-bottom: 12px;
}

.ss-v2-steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ss-v2-steps-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
}

.ss-v2-steps-list li:last-child {
    margin-bottom: 0;
}

.ss-v2-steps-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--blue-500);
    font-weight: 700;
}

/* Dark theme adjustments */
[data-theme="tanzanite"] .ss-v2-next-steps,
[data-theme="midnight"] .ss-v2-next-steps,
[data-theme="obsidian"] .ss-v2-next-steps {
    background: rgba(255, 255, 255, 0.04);
}

/* Checkmark for watch-out acknowledgment */
.watch-out-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--amber-100);
    border: 1px solid var(--amber-400);
    border-radius: 4px;
    color: var(--amber-600);
    font-size: 12px;
    margin-right: 8px;
    flex-shrink: 0;
}

.smart-summary-v2.sentiment-issue .watch-out-check {
    background: var(--red-100);
    border-color: var(--red-400);
    color: var(--red-600);
}

.smart-summary-v2.sentiment-good .watch-out-check {
    background: var(--green-100);
    border-color: var(--green-400);
    color: var(--green-600);
}

.smart-summary-section.opportunity {
    padding-left: 0;
}

.smart-summary-section.opportunity .smart-summary-section-text {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.8;
}

/* Pills kept for backwards compatibility */
.smart-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.smart-summary-icon {
    font-size: 20px;
}

.smart-summary-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--blue-600);
}

.smart-summary-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink-secondary);
}

.smart-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.pill.positive {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.pill.neutral {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-600);
}

.pill.warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--gold);
}

.pill.urgent {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════
   RISK ALERTS CARD (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

.risk-alerts-card {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(249, 115, 22, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-left: 4px solid var(--danger);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.risk-alerts-card.hidden {
    display: none;
}

.risk-alerts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.risk-alerts-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--danger);
}

.risk-count-badge {
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.risk-alert-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(239, 68, 68, 0.1);
}

.risk-alert-item:last-child {
    border-bottom: none;
}

.risk-alert-icon {
    font-size: 16px;
}

.risk-alert-content {
    flex: 1;
}

.risk-alert-title {
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
}

.risk-alert-action {
    font-size: 13px;
    color: var(--ink-muted);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   SMART QUESTIONS CARD (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

.smart-questions-card {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(20, 184, 166, 0.05));
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-left: 4px solid var(--cyan);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.smart-questions-card.hidden {
    display: none;
}

.smart-questions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.smart-questions-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--cyan);
}

.questions-count-badge {
    background: var(--cyan);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.smart-question-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(6, 182, 212, 0.1);
}

.smart-question-item:last-child {
    border-bottom: none;
}

.smart-question-number {
    width: 24px;
    height: 24px;
    background: var(--cyan);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.smart-question-text {
    font-size: 14px;
    color: var(--ink-secondary);
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════
   INSIGHTS GRID (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

.insights-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.insight-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid var(--blue-500);
}

.insight-card.action {
    border-left-color: var(--blue-500);
}

.insight-card.warning {
    border-left-color: var(--gold);
}

.insight-card.success {
    border-left-color: var(--success);
}

.insight-card.info {
    border-left-color: var(--cyan);
}

.insight-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.insight-card.action .insight-type {
    color: var(--blue-600);
}

.insight-card.warning .insight-type {
    color: var(--gold);
}

.insight-card.success .insight-type {
    color: var(--success);
}

.insight-card.info .insight-type {
    color: var(--cyan);
}

.insight-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   RISK & LEVER GRID (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

.risk-lever-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.risk-lever-card {
    padding: 20px;
    border-radius: 12px;
}

.risk-lever-card.risk {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(249, 115, 22, 0.04));
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.risk-lever-card.lever {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(20, 184, 166, 0.04));
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.risk-lever-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.risk-lever-card.risk .risk-lever-label {
    color: var(--danger);
}

.risk-lever-card.lever .risk-lever-label {
    color: var(--success);
}

.risk-lever-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   ACTION ITEMS (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

.action-item-block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.action-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--line-soft);
    border-bottom: 1px solid var(--line);
}

.action-item-num {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--blue-500), var(--cyan));
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.action-item-title {
    flex: 1;
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
}

.confidence-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.action-item-flow {
    padding: 16px;
}

.flow-step {
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
}

.flow-step:last-child {
    border-bottom: none;
}

.flow-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
    margin-bottom: 6px;
}

.flow-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-secondary);
}

.source-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.source-tag.stated {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.source-tag.implicit {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-600);
}

.source-tag.gap {
    background: rgba(217, 119, 6, 0.1);
    color: var(--gold);
}

.source-tag.ai {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* Source Legend */
.source-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--line-soft);
    border-radius: 10px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.stated {
    background: var(--success);
}

.legend-dot.implicit {
    background: var(--blue-500);
}

.legend-dot.gap {
    background: var(--gold);
}

.legend-dot.ai {
    background: #8b5cf6;
}

/* ═══════════════════════════════════════════════════════════════
   EMAIL BOX (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

.email-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--line-soft);
    border-bottom: 1px solid var(--line);
}

.email-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-secondary);
}

.copy-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--blue-500), var(--cyan));
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    transform: scale(1.05);
}

.email-text {
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-secondary);
    white-space: pre-wrap;
}

/* ═══════════════════════════════════════════════════════════════
   TRAJECTORY CARD (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

.trajectory-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.trajectory-logic {
    font-size: 13px;
    color: var(--blue-600);
    padding: 12px 16px;
    background: var(--blue-50);
    border-radius: 8px;
    margin-bottom: 16px;
    line-height: 1.7;
    font-weight: 500;
}

[data-theme="tanzanite"] .trajectory-logic,
[data-theme="midnight"] .trajectory-logic,
[data-theme="obsidian"] .trajectory-logic {
    background: rgba(59, 130, 246, 0.1);
}

.trajectory-text {
    font-size: 14px;
    color: var(--ink-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.probability-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.probability-label {
    font-size: 13px;
    color: var(--ink-muted);
}

.probability-number {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--blue-600), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══════════════════════════════════════════════════════════════
   COACHING CARD (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

.coaching-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    margin-bottom: 24px;
}

[data-theme="tanzanite"] .coaching-card,
[data-theme="midnight"] .coaching-card,
[data-theme="obsidian"] .coaching-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(167, 139, 250, 0.05));
    border-color: rgba(139, 92, 246, 0.2);
}

.coaching-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.coaching-text {
    font-size: 14px;
    color: var(--ink-secondary);
    line-height: 1.8;
}

/* ═══════════════════════════════════════════════════════════════
   DYNAMICS GRID (Oracle Tab)
   ═══════════════════════════════════════════════════════════════ */

.dynamics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.dynamic-meter {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
}

.meter-label {
    font-size: 12px;
    color: var(--ink-muted);
    margin-bottom: 8px;
}

.meter-bar-wrap {
    height: 8px;
    background: var(--line-soft);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.meter-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-500), var(--success));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.meter-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   TEAM BRIEF STYLES
   ═══════════════════════════════════════════════════════════════ */

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.overview-item {
    background: var(--line-soft);
    padding: 14px 16px;
    border-radius: 10px;
}

.overview-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
    margin-bottom: 4px;
}

.overview-value {
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.data-table th {
    background: var(--line-soft);
    font-weight: 600;
    color: var(--ink-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover td {
    background: rgba(59, 130, 246, 0.04);
}

/* Checklist */
.checklist {
    list-style: none;
    margin-bottom: 24px;
}

.checklist li {
    padding: 10px 0;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink-secondary);
}

.checklist li:last-child {
    border-bottom: none;
}

.checklist .check {
    color: var(--success);
    font-weight: bold;
}

.checklist .warn {
    color: var(--gold);
    font-weight: bold;
}

/* Leverage Grid */
.leverage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.leverage-card {
    padding: 16px;
    border-radius: 12px;
}

.leverage-card.yours {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(16, 185, 129, 0.04));
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.leverage-card.theirs {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.08), rgba(251, 191, 36, 0.04));
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.leverage-card h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.leverage-card.yours h4 {
    color: var(--success);
}

.leverage-card.theirs h4 {
    color: var(--gold);
}

.leverage-card ul {
    list-style: none;
    font-size: 14px;
}

.leverage-card li {
    padding: 6px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--ink-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   MEETING RECORD STYLES
   ═══════════════════════════════════════════════════════════════ */

.record-section {
    margin-bottom: 24px;
    background: var(--panel);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--glow, 0 4px 20px rgba(0, 0, 0, 0.1));
}

.record-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--blue-600);
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
}

/* Discussion Topics - Numbered with bold titles and bullet points */
.discussion-topics .topic-item {
    margin-bottom: 20px;
}

.discussion-topics .topic-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.discussion-topics .topic-points {
    margin: 0;
    padding-left: 24px;
    list-style-type: disc;
}

.discussion-topics .topic-points li {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-secondary);
    margin-bottom: 4px;
}

/* Action Items Table - Matching the reference design */
.action-items-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.action-items-table thead {
    background: var(--line-soft);
}

.action-items-table thead th {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.action-items-table thead th.col-num {
    width: 50px;
    text-align: center;
}

.action-items-table thead th.col-action {
    width: auto;
}

.action-items-table thead th.col-responsible {
    width: 140px;
}

.action-items-table thead th.col-status {
    width: 140px;
}

.action-items-table tbody tr {
    border-bottom: 1px solid var(--line);
}

.action-items-table tbody tr:last-child {
    border-bottom: none;
}

.action-items-table tbody tr:hover {
    background: var(--line-soft);
}

.action-items-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--ink);
    vertical-align: middle;
}

.action-items-table tbody td:first-child {
    text-align: center;
    font-weight: 500;
    color: var(--ink-muted);
}

.action-items-table tbody td.action-text {
    color: var(--ink);
}

.action-items-table tbody td.responsible-text {
    color: var(--ink-secondary);
}

.action-items-table tbody td.status-cell {
    white-space: nowrap;
}

/* Status badges with icons */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
}

.status-badge.todo {
    color: var(--blue-600);
}

.status-badge.in-progress {
    color: var(--amber-600);
}

.status-badge.done {
    color: var(--green-600);
}

.status-badge.after {
    color: var(--amber-600);
}

.status-badge.future {
    color: var(--blue-500);
}

/* Executive Summary - Warm Scannable Style */
.executive-summary-box {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ink);
    padding: 20px;
    background: var(--line-soft);
    border-radius: 12px;
    margin-bottom: 12px;
}

.executive-summary-box p {
    margin: 0 0 12px 0;
}

.executive-summary-box p:last-child {
    margin-bottom: 0;
}

/* Key Highlights Grid */
.key-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.highlight-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: 13px;
    color: var(--ink-secondary);
}

.highlight-pill.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--green-500);
    color: var(--green-700);
}

.highlight-pill.pending {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--blue-500);
    color: var(--blue-700);
}

.highlight-pill.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--amber-500);
    color: var(--amber-700);
}

.highlight-pill.info {
    background: rgba(107, 114, 128, 0.1);
    border-color: var(--ink-muted);
    color: var(--ink-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   MEETING OVERVIEW - Signal Card Style (3x2 Grid)
   ═══════════════════════════════════════════════════════════════ */

.overview-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.overview-card {
    background: var(--line-soft);
    border-radius: 10px;
    padding: 16px 20px;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: 4px solid var(--blue-400);
    transition: border-color 0.2s ease;
}

/* Sentiment border colors */
.overview-card.neutral {
    border-left-color: var(--blue-400);
}

.overview-card.good {
    border-left-color: var(--green-500);
}

.overview-card.warning {
    border-left-color: var(--amber-500);
}

.overview-card.issue {
    border-left-color: var(--red-500);
}

.overview-card-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overview-card-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .overview-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .overview-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   ACTION ITEMS - Compact Table Format
   ═══════════════════════════════════════════════════════════════ */

.source-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: var(--line-soft);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--ink-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.stated {
    background: var(--green-500);
}

.legend-dot.implicit {
    background: var(--blue-500);
}

.legend-dot.not-discussed {
    background: var(--amber-500);
}

.legend-dot.ai-suggested {
    background: var(--purple-500);
}

.action-items-compact {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

/* Oracle Action Items - Single Line Grid */
.oracle-actions-grid {
    display: grid;
    gap: 8px;
}

.oracle-action-row {
    display: grid;
    grid-template-columns: 32px 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    transition: background 0.15s ease;
}

.oracle-action-row:hover {
    background: var(--line-soft);
}

.oracle-action-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--blue-500), var(--cyan));
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
}

.oracle-action-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oracle-action-owner {
    font-size: 12px;
    color: var(--ink-muted);
    white-space: nowrap;
}

.oracle-action-source {
    display: inline-block;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 4px;
}

.oracle-action-source.stated {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-600);
}

.oracle-action-source.implicit {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-600);
}

.oracle-action-source.not-discussed,
.oracle-action-source.gap {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber-600);
}

.oracle-action-source.ai-suggested,
.oracle-action-source.ai {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.action-items-compact thead {
    background: var(--line-soft);
}

.action-items-compact thead th {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.action-items-compact tbody tr {
    transition: background 0.15s ease;
}

.action-items-compact tbody tr:hover {
    background: var(--line-soft);
}

.action-items-compact tbody td {
    padding: 14px;
    font-size: 13px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.action-items-compact tbody tr:last-child td {
    border-bottom: none;
}

.action-items-compact .col-num {
    width: 40px;
    text-align: center;
}

.action-items-compact .col-action {
    width: 35%;
    font-weight: 500;
}

.action-items-compact .col-owner {
    width: 15%;
}

.action-items-compact .col-why {
    width: 35%;
    color: var(--ink-secondary);
}

.action-items-compact .col-source {
    width: 15%;
    text-align: center;
}

.action-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--blue-500);
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
}

.source-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 4px;
}

.source-tag.stated {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green-600);
}

.source-tag.implicit {
    background: rgba(59, 130, 246, 0.15);
    color: var(--blue-600);
}

.source-tag.not-discussed {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber-600);
}

.source-tag.ai-suggested {
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple-600);
}

/* Summary Text */
.summary-text {
    font-size: 14px;
    line-height: 1.8;
    color: var(--ink-secondary);
    padding: 16px;
    background: var(--line-soft);
    border-radius: 10px;
}

/* Quote Block */
.quote-block {
    padding: 16px;
    background: var(--line-soft);
    border-left: 4px solid var(--blue-500);
    border-radius: 0 10px 10px 0;
    margin-bottom: 12px;
    font-style: italic;
    color: var(--ink-secondary);
}

.quote-block .author {
    font-style: normal;
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 8px;
}

/* Metadata Grid */
.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 24px;
    padding: 16px;
    background: var(--line-soft);
    border-radius: 12px;
}

.metadata-item {
    text-align: center;
}

.metadata-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink-muted);
    margin-bottom: 4px;
}

.metadata-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

/* ═══════════════════════════════════════════════════════════════
   ACTION BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--gold));
    color: white;
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-secondary);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   GENERIC MODAL (used by meetingTypeModal)
   ═══════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--line-soft);
    color: var(--ink-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--line);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   ORACLE ACCESS GATE
   ═══════════════════════════════════════════════════════════════ */

#oracleGate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    box-sizing: border-box;
}

#oracleGate.active {
    display: flex !important;
}

.oracle-gate-content {
    background: var(--surface);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.oracle-gate-header {
    padding: 28px 28px 20px;
    text-align: center;
    border-bottom: 1px solid var(--line-soft);
}

.oracle-gate-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.oracle-gate-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.oracle-gate-subtitle {
    font-size: 15px;
    color: var(--ink-secondary);
}

.oracle-gate-body {
    padding: 24px 28px;
}

.oracle-gate-section {
    margin-bottom: 20px;
}

.oracle-gate-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 12px;
}

.oracle-gate-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-secondary);
}

.oracle-gate-text p {
    margin-bottom: 12px;
}

.oracle-gate-text p:last-child {
    margin-bottom: 0;
}

.oracle-gate-divider {
    height: 1px;
    background: var(--line);
    margin: 24px 0;
}

.oracle-gate-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.oracle-gate-choice {
    padding: 20px;
    border-radius: 14px;
    border: 2px solid var(--line);
    background: var(--bg-alt);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.oracle-gate-choice:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.oracle-gate-choice.full-access {
    border-color: var(--success);
}

.oracle-gate-choice.full-access:hover {
    background: rgba(5, 150, 105, 0.08);
}

.oracle-gate-choice.work-safe {
    border-color: var(--gold);
}

.oracle-gate-choice.work-safe:hover {
    background: rgba(217, 119, 6, 0.08);
}

.oracle-gate-choice-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.oracle-gate-choice-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.oracle-gate-choice.full-access .oracle-gate-choice-title {
    color: var(--success);
}

.oracle-gate-choice.work-safe .oracle-gate-choice-title {
    color: var(--gold);
}

.oracle-gate-choice-desc {
    font-size: 13px;
    color: var(--ink-secondary);
    line-height: 1.5;
}

.oracle-gate-footer {
    padding: 20px 28px;
    background: var(--bg-alt);
    border-top: 1px solid var(--line-soft);
    border-radius: 0 0 20px 20px;
}

.oracle-gate-confirm {
    font-size: 13px;
    color: var(--ink-muted);
    text-align: center;
    line-height: 1.6;
}

/* Oracle Tab Footer */
.oracle-footer-disclaimer {
    margin-top: 24px;
    padding: 14px 20px;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-muted);
}

.oracle-footer-disclaimer .mode-indicator {
    font-weight: 600;
}

.oracle-footer-disclaimer .mode-indicator.full-access {
    color: var(--success);
}

.oracle-footer-disclaimer .mode-indicator.work-safe {
    color: var(--gold);
}

.oracle-footer-disclaimer .settings-link {
    color: var(--blue-500);
    cursor: pointer;
}

@media (max-width: 600px) {
    .oracle-gate-choices {
        grid-template-columns: 1fr;
    }

    .oracle-footer-disclaimer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Work Safe Mode - Hide psych content by default */
/* Individual toggles can override this */
body.work-safe-mode [data-psych-section="powerSignals"] {
    display: none !important;
}

body.work-safe-mode [data-psych-section="psychMarkers"] {
    display: none !important;
}

body.work-safe-mode [data-psych-section="unspokenConcerns"] {
    display: none !important;
}

body.work-safe-mode [data-psych-section="coachingNote"] {
    display: none !important;
}

/* Individual overrides - show even in work-safe mode */
body.show-powerSignals [data-psych-section="powerSignals"] {
    display: block !important;
}

body.show-psychMarkers [data-psych-section="psychMarkers"] {
    display: block !important;
}

body.show-unspokenConcerns [data-psych-section="unspokenConcerns"] {
    display: block !important;
}

body.show-coachingNote [data-psych-section="coachingNote"] {
    display: block !important;
}

/* Individual section hiding (when Full Details ON but toggle OFF) */
body.hide-powerSignals [data-psych-section="powerSignals"] {
    display: none !important;
}

body.hide-psychMarkers [data-psych-section="psychMarkers"] {
    display: none !important;
}

body.hide-unspokenConcerns [data-psych-section="unspokenConcerns"] {
    display: none !important;
}

body.hide-coachingNote [data-psych-section="coachingNote"] {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .signalboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .insights-grid,
    .risk-lever-grid,
    .leverage-grid {
        grid-template-columns: 1fr;
    }

    .tab-nav {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .signalboard {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .signal-card {
        padding: 12px;
    }

    .signal-value {
        font-size: 16px;
    }

    .overview-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════ */

@media print {

    .app-header,
    .tab-nav,
    .action-buttons,
    .settings-btn,
    .modal-overlay,
    .loading-overlay {
        display: none !important;
    }

    .tab-content {
        display: block !important;
        page-break-after: always;
    }

    body {
        background: white;
        color: black;
    }
}

/* ═══════════════════════════════════════════════════════════════
   CHAT INTEGRATION CSS - Intelligent Analyst v3.52
   ═══════════════════════════════════════════════════════════════ */

/* Chat Toggle Button in Header */
.chat-toggle-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #06b6d4 0%, #14b8a6 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* Split Screen Wrapper */
.split-screen-wrapper {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--surface);
}

.split-screen-wrapper.active {
    display: flex;
    flex-direction: column;
}

/* Split Header Bar */
.split-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.split-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.split-back-btn:hover {
    background: var(--hover);
    border-color: #06b6d4;
}

.split-view-toggles {
    display: flex;
    gap: 4px;
    background: var(--hover);
    padding: 4px;
    border-radius: 8px;
}

.split-view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--ink-muted);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.split-view-btn:hover {
    color: var(--ink);
}

.split-view-btn.active {
    background: var(--surface);
    color: #06b6d4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Split Container */
.split-screen-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.split-panel {
    overflow-y: auto;
    height: 100%;
}

.split-panel-chat {
    flex: 0 0 420px;
    min-width: 320px;
    max-width: 600px;
    border-right: 1px solid var(--border);
    background: var(--surface);
}

.split-panel-report {
    flex: 1;
    padding: 24px;
    background: var(--surface);
}

.split-divider {
    width: 6px;
    background: var(--border);
    cursor: col-resize;
    transition: background 0.2s;
    flex-shrink: 0;
}

.split-divider:hover {
    background: #06b6d4;
}

/* View collapse modes */
.split-screen-container.chat-collapsed .split-panel-chat,
.split-screen-container.chat-collapsed .split-divider {
    display: none;
}

.split-screen-container.report-collapsed .split-panel-report,
.split-screen-container.report-collapsed .split-divider {
    display: none;
}

.split-screen-container.report-collapsed .split-panel-chat {
    max-width: 100%;
    flex: 1;
}

/* Chat Panel */
.chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-logo {
    font-size: 24px;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--ink);
}

.chat-subtitle {
    font-size: 12px;
    color: var(--ink-muted);
}

.chat-context-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 12px;
    font-size: 11px;
    color: #06b6d4;
}

/* Chat Style Toggle */
.chat-style-toggle {
    display: flex;
    background: var(--hover);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.chat-style-btn {
    padding: 5px 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chat-style-btn:hover {
    color: var(--ink);
}

.chat-style-btn.active {
    background: var(--surface);
    color: #06b6d4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Bubbles */
.chat-message {
    display: flex;
    gap: 12px;
    animation: msgSlide 0.3s ease-out;
}

@keyframes msgSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background: var(--border);
    color: var(--ink-muted);
}

.chat-message.user .chat-avatar {
    background: linear-gradient(135deg, #06b6d4 0%, #14b8a6 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    position: relative;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, #06b6d4 0%, #14b8a6 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

/* Copy Button */
.chat-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--ink-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.2s;
}

.chat-message:hover .chat-copy-btn {
    opacity: 1;
}

.chat-copy-btn:hover {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.chat-copy-btn.copied {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

/* Typing Indicator */
.chat-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    background: #06b6d4;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-6px);
    }
}

/* Streaming cursor */
.chat-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background: #06b6d4;
    margin-left: 2px;
    animation: cursorBlink 1s infinite;
    vertical-align: text-bottom;
}

@keyframes cursorBlink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Chat Input Area */
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* File attachment preview */
.chat-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.chat-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 8px;
    font-size: 12px;
    color: var(--ink);
    max-width: 200px;
}

.chat-attachment-icon {
    font-size: 16px;
}

.chat-attachment-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-attachment-remove {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s;
}

.chat-attachment-remove:hover {
    background: rgba(239, 68, 68, 0.4);
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-wrapper.drag-over {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.chat-input-wrapper:focus-within {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.chat-attach-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-attach-btn:hover {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    color: var(--ink);
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
}

.chat-input::placeholder {
    color: var(--ink-muted);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #06b6d4 0%, #14b8a6 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Stop Generation Button */
.chat-stop-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.chat-stop-btn:hover {
    transform: scale(1.05);
}

.chat-stop-btn.visible {
    display: flex;
}

/* Code blocks in chat */
.chat-code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    margin: 8px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-code-block .keyword {
    color: #569cd6;
}

.chat-code-block .string {
    color: #ce9178;
}

.chat-code-block .comment {
    color: #6a9955;
}

.chat-code-block .number {
    color: #b5cea8;
}

.chat-code-block .function {
    color: #dcdcaa;
}

/* Empty State */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
}

.chat-empty-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 20px;
}

.chat-suggestion-btn {
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    margin: 4px 0;
    width: 100%;
    max-width: 280px;
}

.chat-suggestion-btn:hover {
    border-color: #06b6d4;
    background: rgba(6, 182, 212, 0.05);
}

/* Oracle Cards in Chat */
.oracle-card {
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 0 10px 10px 0;
    border-left: 4px solid;
}

.oracle-card strong {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.oracle-card .oracle-card-content {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--ink);
}

.oracle-card .oracle-card-content br {
    display: block;
    margin-bottom: 4px;
}

/* Action - Blue */
.oracle-card.action {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.oracle-card.action strong {
    color: #3b82f6;
}

/* Warning/Risk - Orange/Amber */
.oracle-card.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
}

.oracle-card.warning strong {
    color: #d97706;
}

/* Success/Insight - Green */
.oracle-card.success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}

.oracle-card.success strong {
    color: #059669;
}

/* Info/Signal - Purple */
.oracle-card.info {
    background: rgba(139, 92, 246, 0.1);
    border-left-color: #8b5cf6;
}

.oracle-card.info strong {
    color: #7c3aed;
}

/* Quote/Say This - Gold */
.oracle-card.quote {
    background: rgba(251, 191, 36, 0.1);
    border-left-color: #f59e0b;
}

.oracle-card.quote strong {
    color: #b45309;
}

/* Blockquotes in chat */
.chat-quote {
    border-left: 3px solid #b8860b;
    background: rgba(184, 134, 11, 0.08);
    padding: 8px 12px;
    margin: 8px 0;
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

/* Bullet points */
.chat-bullet {
    color: #06b6d4;
    font-weight: bold;
}

/* ═══════════════════════════════════════════════════════════════
   PAPER PLANE ANIMATION - First Chat Session
   ═══════════════════════════════════════════════════════════════ */
.paper-plane-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The report card that gets folded */
.plane-report-card {
    width: 280px;
    background: var(--surface, #fff);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform-origin: center center;
    position: relative;
}

.plane-report-header {
    font-weight: 700;
    font-size: 1rem;
    color: var(--ink, #1a1a1a);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plane-report-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plane-report-line {
    height: 8px;
    background: linear-gradient(90deg, var(--line, #e5e0d8) 0%, transparent 100%);
    border-radius: 4px;
}

.plane-report-line:nth-child(1) {
    width: 100%;
}

.plane-report-line:nth-child(2) {
    width: 85%;
}

.plane-report-line:nth-child(3) {
    width: 70%;
}

.plane-report-line:nth-child(4) {
    width: 90%;
}

/* Stage 1: Scrunch up the paper */
.plane-report-card.scrunching {
    animation: scrunchPaper 2s ease-in-out forwards;
}

@keyframes scrunchPaper {
    0% {
        transform: scale(1) rotate(0deg);
    }

    20% {
        transform: scale(0.95) rotate(-2deg);
    }

    40% {
        transform: scale(0.9) rotate(2deg) translateY(-5px);
    }

    60% {
        transform: scale(0.8) rotate(-2deg);
    }

    80% {
        transform: scale(0.7) rotate(1deg);
    }

    100% {
        transform: scale(0.6) rotate(0deg);
    }
}

/* Stage 2: Fold into paper plane shape */
.plane-report-card.folding {
    animation: foldToPlane 2s ease-in-out forwards;
}

@keyframes foldToPlane {
    0% {
        transform: scale(0.6) rotate(0deg) perspective(800px) rotateX(0deg);
        border-radius: 12px;
    }

    20% {
        transform: scale(0.55) rotate(-5deg) perspective(800px) rotateX(30deg);
        border-radius: 8px;
    }

    40% {
        transform: scale(0.5) rotate(-15deg) perspective(800px) rotateX(50deg) rotateY(10deg);
        border-radius: 4px;
    }

    60% {
        transform: scale(0.4) rotate(-25deg) perspective(800px) rotateX(60deg) rotateY(20deg);
        border-radius: 2px;
        width: 200px;
        padding: 15px;
    }

    80% {
        transform: scale(0.3) rotate(-30deg) perspective(800px) rotateX(70deg) rotateY(30deg);
        border-radius: 0;
        width: 150px;
        padding: 10px;
    }

    100% {
        transform: scale(0.2) rotate(-35deg) perspective(800px) rotateX(80deg) rotateY(40deg);
        opacity: 0;
        width: 100px;
        padding: 5px;
    }
}

/* The paper plane */
.paper-plane {
    position: absolute;
    font-size: 3.5rem;
    opacity: 0;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
    transform: rotate(-30deg);
}

/* Stage 3: Slow graceful flight */
.paper-plane.flying {
    animation: flyToChat 3s ease-in-out forwards;
}

@keyframes flyToChat {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(-30deg) scale(1);
    }

    15% {
        transform: translate(10vw, -8vh) rotate(-25deg) scale(0.95);
    }

    30% {
        transform: translate(22vw, -5vh) rotate(-32deg) scale(0.9);
    }

    45% {
        transform: translate(38vw, -10vh) rotate(-28deg) scale(0.85);
    }

    60% {
        transform: translate(52vw, -6vh) rotate(-35deg) scale(0.75);
    }

    75% {
        transform: translate(68vw, -12vh) rotate(-28deg) scale(0.65);
        opacity: 1;
    }

    90% {
        transform: translate(82vw, -4vh) rotate(-32deg) scale(0.5);
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        transform: translate(90vw, 5vh) rotate(-30deg) scale(0.4);
    }
}

/* Chat icon pulse when plane arrives */
.chat-toggle-btn.receiving {
    animation: pulseReceive 0.6s ease-out 3;
}

@keyframes pulseReceive {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 0 0 15px rgba(6, 182, 212, 0);
    }
}

/* ═══════════════════════════════════════════════════════════════
   LEFT CHAT DRAWER - Collapsible Panel v3.52
   ═══════════════════════════════════════════════════════════════ */

/* Drawer Container */
.chat-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: 380px;
    max-width: 90vw;
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

.chat-drawer.open {
    transform: translateX(0);
    visibility: visible;
}

/* Drawer Header */
.chat-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.chat-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-drawer-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
}

.chat-drawer-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #06b6d4 0%, #14b8a6 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.chat-drawer-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.chat-drawer-subtitle {
    font-size: 11px;
    color: var(--ink-muted);
}

.chat-drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--ink-muted);
    transition: all 0.2s;
}

.chat-drawer-close:hover {
    background: var(--line-soft);
    color: var(--ink);
}

/* Style Toggle in Drawer */
.chat-drawer-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line-soft);
    flex-shrink: 0;
}

.chat-drawer-style-toggle {
    display: flex;
    background: var(--line-soft);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.chat-drawer-style-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chat-drawer-style-btn:hover {
    color: var(--ink);
}

.chat-drawer-style-btn.active {
    background: var(--surface);
    color: #06b6d4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-drawer-context {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 12px;
    font-size: 11px;
    color: #06b6d4;
}

.chat-drawer-context-dot {
    width: 6px;
    height: 6px;
    background: #06b6d4;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Messages Container */
.chat-drawer-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Bubbles */
.chat-drawer-message {
    display: flex;
    gap: 10px;
    animation: drawerMsgSlide 0.3s ease-out;
}

@keyframes drawerMsgSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-drawer-message.user {
    flex-direction: row-reverse;
}

.chat-drawer-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.chat-drawer-message.assistant .chat-drawer-avatar {
    background: linear-gradient(135deg, #06b6d4 0%, #14b8a6 100%);
    color: white;
}

.chat-drawer-message.user .chat-drawer-avatar {
    background: var(--line);
    color: var(--ink-muted);
}

.chat-drawer-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
}

.chat-drawer-message.user .chat-drawer-bubble {
    background: linear-gradient(135deg, #06b6d4 0%, #14b8a6 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-drawer-message.assistant .chat-drawer-bubble {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    color: var(--ink);
    border-bottom-left-radius: 4px;
}

/* Markdown formatting in bubbles */
.chat-drawer-bubble strong {
    font-weight: 700;
}

.chat-drawer-bubble p {
    margin: 0 0 8px 0;
}

.chat-drawer-bubble p:last-child {
    margin-bottom: 0;
}

.chat-drawer-bubble .action-card {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(6, 182, 212, 0.1);
    border-left: 3px solid #06b6d4;
    border-radius: 0 8px 8px 0;
    font-size: 12px;
}

/* Typing Indicator */
.chat-drawer-typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background: var(--bg-alt);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.chat-drawer-typing span {
    width: 6px;
    height: 6px;
    background: var(--ink-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.chat-drawer-typing span:nth-child(1) {
    animation-delay: 0s;
}

.chat-drawer-typing span:nth-child(2) {
    animation-delay: 0.16s;
}

.chat-drawer-typing span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.7);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Area */
.chat-drawer-input-area {
    padding: 16px 20px;
    background: var(--bg-alt);
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

.chat-drawer-input-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-drawer-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.chat-drawer-input:focus {
    outline: none;
    border-color: #06b6d4;
}

.chat-drawer-input::placeholder {
    color: var(--ink-muted);
}

.chat-drawer-send {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, #06b6d4 0%, #14b8a6 100%);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-drawer-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

.chat-drawer-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Toggle Button (Floating) */
.chat-drawer-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    border: none;
    background: linear-gradient(135deg, #06b6d4 0%, #14b8a6 100%);
    border-radius: 16px;
    cursor: pointer;
    display: none;
    /* Hidden until report is shown */
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
    z-index: 999;
    transition: all 0.2s;
}

.chat-drawer-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

.chat-drawer-toggle.visible {
    display: flex;
}

.chat-drawer-toggle.has-context {
    animation: togglePulse 2s ease-in-out 3;
}

@keyframes togglePulse {

    0%,
    100% {
        box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
    }

    50% {
        box-shadow: 0 4px 24px rgba(6, 182, 212, 0.7), 0 0 0 8px rgba(6, 182, 212, 0.15);
    }
}

/* Backdrop overlay when drawer is open */
.chat-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.chat-drawer-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* Welcome state */
.chat-drawer-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
}

.chat-drawer-welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.chat-drawer-welcome-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.chat-drawer-welcome-text {
    font-size: 14px;
    color: var(--ink-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.chat-drawer-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.chat-drawer-suggestion {
    padding: 12px 16px;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 13px;
    color: var(--ink-secondary);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.chat-drawer-suggestion:hover {
    background: var(--surface);
    border-color: #06b6d4;
    color: var(--ink);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-drawer {
        width: 100%;
        max-width: 100%;
    }

    .chat-drawer-toggle {
        bottom: 16px;
        left: 16px;
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SMART TIMER - Analysis Progress
   ═══════════════════════════════════════════════════════════════ */
.analysis-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

.timer-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ink, #1a1a1a);
    margin-bottom: 0.5rem;
}

.timer-clock {
    position: relative;
    width: 120px;
    height: 120px;
}

.timer-circle-bg {
    fill: none;
    stroke: var(--line);
    stroke-width: 8;
}

.timer-circle-progress {
    fill: none;
    stroke: url(#timerGradient);
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.5s ease;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-elapsed {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ink);
}

.timer-unit {
    font-size: 0.75rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-phases {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 280px;
}

.timer-phase {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    background: var(--bg-alt);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.timer-phase.active {
    opacity: 1;
    background: var(--blue-50);
    border-left: 3px solid var(--blue-500);
}

.timer-phase.complete {
    opacity: 0.7;
}

.timer-phase-icon {
    width: 20px;
    text-align: center;
}

.timer-phase.complete .timer-phase-icon::after {
    content: '✓';
    color: var(--success);
}

.timer-phase.active .timer-phase-icon::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--blue-500);
    border-radius: 50%;
    animation: pulseDot 1s ease-in-out infinite;
}

.timer-phase:not(.active):not(.complete) .timer-phase-icon::after {
    content: '○';
    color: var(--ink-muted);
}

@keyframes pulseDot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.timer-phase-label {
    font-size: 0.85rem;
    color: var(--ink);
    flex: 1;
}

.timer-phase.active .timer-phase-label {
    font-weight: 600;
    color: var(--blue-600);
}

.timer-estimate {
    font-size: 0.85rem;
    color: var(--ink-muted);
    text-align: center;
    margin-top: 0.5rem;
}

.timer-estimate strong {
    color: var(--ink-secondary);
}

/* Mobile */
@media (max-width: 768px) {
    .split-screen-container {
        flex-direction: column;
    }

    .split-panel-chat {
        flex: none;
        max-width: 100%;
        height: 50%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .split-panel-report {
        height: 50%;
    }

    .split-divider {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   USER INFO BADGE
   ═══════════════════════════════════════════════════════════════ */
.user-info-badge {
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 16px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.user-info-badge.active {
    display: flex;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.9rem;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.2;
}

.user-plan {
    font-size: 0.75rem;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-plan.free {
    color: var(--ink-muted);
}

.user-plan.basic {
    color: var(--cyan);
}

.user-plan.pro {
    color: var(--teal);
}

.user-plan.enterprise {
    color: var(--gold);
}

/* =================================
   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(--bg-alt);
  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);
}

.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);
}

.config-toggle .toggle-switch{
  width:48px;
  height:26px;
  background:var(--line);
  border-radius:13px;
  position:relative;
  cursor:pointer;
  transition:background 0.2s;
}

.config-toggle .toggle-switch.active{
  background:var(--success);
}

.config-toggle .toggle-switch::after{
  content:'';
  position:absolute;
  width:22px;
  height:22px;
  background:white;
  border-radius:50%;
  top:2px;
  left:2px;
  transition:transform 0.2s;
}

.config-toggle .toggle-switch.active::after{
  transform:translateX(22px);
}

.form-hint{
  font-size:0.8rem;
  color:var(--ink-muted);
  font-style:italic;
}

.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);
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.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;
}

/* 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);
  }
}