:root {
  --bg-dark: #080c14;
  --bg-card: #0f172a;
  --bg-card-hover: #17223b;
  --bg-input: #070b12;
  --border-color: #1e293b;
  --border-glow: #334155;
  --border-accent: rgba(139, 92, 246, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.25);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.25);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.25);
  --accent-rose: #f43f5e;
  --accent-rose-glow: rgba(244, 63, 94, 0.25);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, "Courier New", monospace;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(139, 92, 246, 0.15);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.55;
  background-image: 
    radial-gradient(circle at 10% 12%, rgba(139, 92, 246, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 18%, rgba(6, 182, 212, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  overflow-x: hidden;
}

/* Mandatory CSS constraints */
input, select, textarea {
  min-width: 0;
  font-family: inherit;
}

.brand {
  min-width: 0;
}

.brand-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-switcher {
  flex-shrink: 0;
}

.app-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 70px 20px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 20px var(--accent-purple-glow);
  flex-shrink: 0;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-pro-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.lang-switcher {
  display: flex;
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.lang-btn.active {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-purple-glow);
}

/* Key Metrics HUD */
.hud-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.hud-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.hud-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
}

.hud-card.highlight {
  border-color: rgba(139, 92, 246, 0.5);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.08) 0%, #0f172a 100%);
}

.hud-card.emerald {
  border-color: rgba(16, 185, 129, 0.4);
}

.hud-card.cyan {
  border-color: rgba(6, 182, 212, 0.4);
}

.hud-card.amber {
  border-color: rgba(245, 158, 11, 0.4);
}

.hud-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hud-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hud-value {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.hud-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.hud-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 6px;
}

.badge-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.badge-tag.positive {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Main Input & Control Container */
.main-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

/* Input Mode Tabs */
.input-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.input-mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-tab-btn {
  background: #0a0f1d;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.mode-tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-color: var(--border-glow);
}

.mode-tab-btn.active {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.samples-dropdown-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Quick Samples Toolbar */
.samples-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  background: #0a0f1d;
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.samples-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.btn-sample {
  background: #111a2e;
  border: 1px solid #1e293b;
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sample:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--accent-purple);
  color: #fff;
  transform: translateY(-1px);
}

.btn-sample-action {
  background: transparent;
  border: 1px solid #334155;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.15s;
}

.btn-sample-action:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--accent-rose);
  color: #fda4af;
}

/* Input Panes */
.pane-content {
  display: none;
}

.pane-content.active {
  display: block;
}

/* Mode: Textarea */
.textarea-container {
  position: relative;
  margin-bottom: 16px;
}

.editor-textarea {
  width: 100%;
  height: 220px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--font-mono);
}

.editor-textarea:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
}

.textarea-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.file-upload-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--accent-cyan);
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}

.file-upload-btn-label:hover {
  background: rgba(6, 182, 212, 0.1);
}

/* Mode: YouTube & Podcast URLs */
.url-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.url-input-field {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  outline: none;
  font-family: var(--font-mono);
  transition: border-color 0.2s;
}

.url-input-field:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.2);
}

.btn-fetch-meta {
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-fetch-meta:hover {
  background: #27354f;
  border-color: var(--accent-purple);
}

/* Video Preview Card */
.video-preview-card {
  display: flex;
  gap: 16px;
  background: #090e1a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
  align-items: center;
}

.video-thumb {
  width: 140px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  background: #1e293b;
  flex-shrink: 0;
}

.video-meta-info {
  flex: 1;
  min-width: 0;
}

.video-meta-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-meta-author {
  font-size: 12.5px;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.video-meta-tags {
  display: flex;
  gap: 8px;
  font-size: 11px;
}

/* Audio Player Preview Card */
.audio-preview-card {
  background: #090e1a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
}

.audio-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.audio-stream-player {
  width: 100%;
  height: 38px;
  outline: none;
}

/* Extraction Settings & Parameters */
.settings-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 12px;
  background: #0b1120;
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  align-items: center;
}

.setting-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.setting-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.setting-select:focus {
  border-color: var(--accent-purple);
}

.api-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.api-status-badge:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent-purple);
}

/* Action Buttons Container */
.action-buttons-row {
  display: flex;
  gap: 12px;
}

.btn-generate {
  flex: 2;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border: none;
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.4);
  transition: all 0.2s ease;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.55);
  filter: brightness(1.1);
}

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

.btn-fast-heuristic {
  flex: 1;
  background: #111c33;
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #67e8f9;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-fast-heuristic:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* Processing Progress Indicator */
.processing-card {
  display: none;
  background: #0c1322;
  border: 1px solid var(--accent-purple);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
  text-align: center;
}

.processing-card.active {
  display: block;
}

.processing-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px auto;
}

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

.processing-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.processing-steps-list {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.proc-step {
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.proc-step.done {
  color: var(--accent-emerald);
}

.proc-step.current {
  color: var(--accent-purple);
  font-weight: 700;
}

/* Results Section */
.results-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

.results-card.active {
  display: block;
}

.results-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.result-title-group {
  flex: 1;
  min-width: 0;
}

.result-doc-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 6px;
}

.result-meta-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.res-badge {
  background: #111a2e;
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.res-badge.highlight-purple {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  font-weight: 600;
}

.res-badge.highlight-green {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  font-weight: 600;
}

.result-actions-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action-sm {
  background: #111a2e;
  border: 1px solid #1e293b;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-action-sm:hover {
  background: #1a2742;
  border-color: var(--accent-purple);
  transform: translateY(-1px);
}

.btn-action-sm.primary {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  box-shadow: 0 2px 10px var(--accent-purple-glow);
}

.btn-action-sm.primary:hover {
  filter: brightness(1.15);
}

/* Result View Tabs */
.result-tabs-row {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.result-tabs-row::-webkit-scrollbar {
  display: none;
}

.result-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.result-tab-btn:hover {
  color: #fff;
}

.result-tab-btn.active {
  color: #c4b5fd;
  border-bottom-color: var(--accent-purple);
}

/* Results Content Sections */
.result-view-panel {
  display: none;
}

.result-view-panel.active {
  display: block;
}

/* View 1: Executive Dashboard */
.executive-summary-box {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(6, 182, 212, 0.06) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.exec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.exec-title {
  font-size: 15px;
  font-weight: 800;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exec-copy-btn {
  background: transparent;
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.exec-copy-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
}

.exec-sentence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exec-sentence-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.6;
  color: #f1f5f9;
}

.exec-bullet-num {
  background: rgba(139, 92, 246, 0.3);
  color: #e9d5ff;
  font-weight: 700;
  font-size: 11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Section Headings inside dashboard */
.dash-section-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin: 28px 0 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Key Insights Cards */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.insight-card {
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.insight-card:hover {
  border-color: rgba(6, 182, 212, 0.5);
  transform: translateY(-2px);
  background: #0e172a;
}

.insight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.timestamp-pill {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.3);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.timestamp-pill:hover {
  background: rgba(6, 182, 212, 0.3);
}

.insight-headline {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.4;
}

.insight-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Action Checklist */
.checklist-container {
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.checklist-progress-text {
  font-size: 12.5px;
  color: var(--accent-emerald);
  font-weight: 600;
}

.checklist-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #070c17;
  border: 1px solid #162032;
  padding: 12px 14px;
  border-radius: 8px;
  transition: all 0.15s;
}

.checklist-item:hover {
  border-color: #27354f;
}

.checklist-item.completed {
  opacity: 0.6;
  background: #040810;
}

.checklist-item.completed .task-text {
  text-decoration: line-through;
  color: var(--text-dim);
}

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-emerald);
  margin-top: 2px;
}

.task-info {
  flex: 1;
}

.task-text {
  font-size: 13.5px;
  color: #e2e8f0;
  line-height: 1.5;
  margin-bottom: 4px;
}

.task-badges {
  display: flex;
  gap: 6px;
  font-size: 11px;
}

.priority-tag {
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.priority-tag.high {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.priority-tag.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-tag.low {
  background: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Golden Nuggets Callouts */
.nuggets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.nugget-card {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.07) 0%, #0b1120 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  position: relative;
}

.nugget-quote-mark {
  font-size: 26px;
  line-height: 1;
  color: var(--accent-amber);
  margin-bottom: 6px;
}

.nugget-quote-text {
  font-size: 13.5px;
  font-style: italic;
  color: #fef3c7;
  line-height: 1.6;
  margin-bottom: 8px;
}

.nugget-author {
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: right;
  font-weight: 600;
}

/* View 2: Full Markdown Editor */
.markdown-viewer-wrap {
  position: relative;
}

.markdown-textarea {
  width: 100%;
  height: 520px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  outline: none;
  resize: vertical;
}

/* View 3: Timeline view */
.timeline-container {
  padding: 10px 0 10px 20px;
  border-left: 2px solid #1e293b;
  margin-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-cyan);
  border: 2px solid var(--bg-dark);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.timeline-content-card {
  background: #0b1120;
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}

/* Modal: Custom API Key Config */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: #0d1527;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-body {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.keys-list {
  background: #070b14;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px;
  margin: 12px 0;
  font-family: var(--font-mono);
  font-size: 12px;
}

.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  color: #94a3b8;
}

.key-item.active {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  font-weight: 600;
}

.custom-key-input {
  width: 100%;
  background: #070b14;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  margin-top: 8px;
}

.custom-key-input:focus {
  border-color: var(--accent-purple);
}

/* Educational Section */
.educational-section {
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.edu-heading {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.edu-card {
  background: #070b14;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 18px;
}

.edu-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.edu-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.edu-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* FAQ Accordion Section */
.faq-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
}

.faq-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid #1e293b;
  border-radius: 8px;
  overflow: hidden;
  background: #070b14;
}

.faq-question {
  padding: 14px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-question:hover {
  background: rgba(255, 255, 255, 0.02);
}

.faq-answer {
  display: none;
  padding: 0 18px 14px 18px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid #141d2f;
}

.faq-item.open .faq-answer {
  display: block;
  padding-top: 12px;
}

.faq-icon-arrow {
  transition: transform 0.2s;
}

.faq-item.open .faq-icon-arrow {
  transform: rotate(180deg);
}

/* Portal Return Link */
.portal-backlink-wrap {
  text-align: center;
  padding: 20px 0 10px 0;
  border-top: 1px solid var(--border-color);
  margin-top: 20px;
}

.portal-backlink {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.portal-backlink:hover {
  color: #fff;
}

.portal-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 8px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e1b4b;
  border: 1px solid var(--accent-purple);
  color: #e0e7ff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .hud-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .insights-grid {
    grid-template-columns: 1fr;
  }
  .nuggets-grid {
    grid-template-columns: 1fr;
  }
  .edu-grid {
    grid-template-columns: 1fr;
  }
  .settings-strip {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .hud-grid {
    grid-template-columns: 1fr;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .settings-strip {
    grid-template-columns: 1fr;
  }
  .action-buttons-row {
    flex-direction: column;
  }
  .result-actions-toolbar {
    width: 100%;
  }
  .result-actions-toolbar .btn-action-sm {
    flex: 1;
    justify-content: center;
  }
}

/* Print Styles */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .header, .hud-grid, .main-input-card, .educational-section, .faq-section, .portal-backlink-wrap, .result-tabs-row, .result-actions-toolbar, .exec-copy-btn {
    display: none !important;
  }
  .results-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: block !important;
  }
  .result-view-panel {
    display: block !important;
  }
  .executive-summary-box, .insight-card, .checklist-container, .nugget-card {
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .exec-title, .dash-section-title, .result-doc-title, .insight-headline {
    color: #000 !important;
  }
  .exec-sentence-item, .insight-body, .task-text {
    color: #333 !important;
  }
}
