/* ============================================================
   Arcanic AI — Premium Scientific Design System
   Theme: Deep Obsidian & Midnight Navy with Glassmorphism
   Typography: Plus Jakarta Sans & JetBrains Mono
   ============================================================ */

:root {
  /* Surface Colors */
  --bg-app: #080c16;
  --bg-primary: #080c16;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-hover: rgba(22, 33, 58, 0.85);
  --bg-input: rgba(10, 15, 30, 0.8);
  --bg-subtle: rgba(255, 255, 255, 0.03);

  /* Border Tokens */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --border-card: rgba(255, 255, 255, 0.07);

  /* Brand & Accents */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.3);
  --secondary: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Radius & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --shadow-card: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  /* Surface Colors */
  --bg-app: #f1f5f9;
  --bg-primary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(248, 250, 252, 0.98);
  --bg-input: #ffffff;
  --bg-subtle: #f8fafc;

  /* Border Tokens */
  --border-subtle: rgba(148, 163, 184, 0.35);
  --border-focus: rgba(99, 102, 241, 0.6);
  --border-card: rgba(203, 213, 225, 0.7);

  /* Brand & Accents */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.25);
  --secondary: #0284c7;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;

  /* Typography Colors */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  /* Shadows */
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
}

/* Theme Toggle Button */
.btn-theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.btn-theme-toggle:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

/* Light Theme Overrides */
[data-theme="light"] body {
  background-color: var(--bg-app);
  color: var(--text-main);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(56, 189, 248, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

[data-theme="light"] .logo-text {
  background: linear-gradient(to right, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .nav-tabs {
  background: rgba(241, 245, 249, 0.95);
  border: 1px solid rgba(203, 213, 225, 0.8);
}

[data-theme="light"] .nav-btn {
  color: #475569;
}

[data-theme="light"] .nav-btn:hover {
  color: #0f172a;
  background: rgba(226, 232, 240, 0.7);
}

[data-theme="light"] .nav-btn.active {
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: #ffffff;
}

[data-theme="light"] .glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .audio-playback-bar,
[data-theme="light"] .recorder-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .timer-display {
  color: #0f172a;
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .mode-selector {
  background: #e2e8f0;
}

[data-theme="light"] .mode-btn {
  color: #475569;
}

[data-theme="light"] .mode-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .upload-dropzone {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .upload-dropzone:hover {
  background: #f1f5f9;
  border-color: var(--primary);
}

[data-theme="light"] .upload-dropzone .upload-text {
  color: #1e293b;
}

[data-theme="light"] .upload-dropzone .upload-hint {
  color: #64748b;
}

[data-theme="light"] .transcript-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .transcript-text {
  color: #1e293b;
}

[data-theme="light"] .section-label,
[data-theme="light"] .text-white {
  color: #0f172a !important;
}

[data-theme="light"] .meeting-summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] .summary-text {
  color: #1e293b;
}

[data-theme="light"] .empty-hint {
  color: #64748b;
}

[data-theme="light"] .realtime-col {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .realtime-col-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .cue-tag {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

[data-theme="light"] .cue-answer {
  color: #475569;
  border-left-color: #fcd34d;
}

[data-theme="light"] .decision-badge {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

[data-theme="light"] .action-item-card {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .minutes-doc-paper {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .md-title,
[data-theme="light"] .md-topic,
[data-theme="light"] .md-section-title {
  color: #0f172a;
}

[data-theme="light"] .md-meta-row,
[data-theme="light"] .md-list li {
  color: #334155;
}

[data-theme="light"] .md-actions-table th {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] .md-actions-table td {
  border-color: #e2e8f0;
  color: #334155;
}

[data-theme="light"] #aiFloatingPanel {
  background: rgba(255, 255, 255, 0.96);
  border-color: #cbd5e1;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .ai-panel-header {
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .chat-bubble.bot-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #e2e8f0;
}

[data-theme="light"] .chat-bubble.user-bubble {
  background: var(--primary);
  color: #ffffff;
}

[data-theme="light"] .chat-input-field {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] .chip-item {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

[data-theme="light"] .chip-item:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 15, 30, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.4);
}

/* ============================================================
   Top Header & Navigation
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(8, 12, 22, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-tabs {
  display: flex;
  gap: 0.25rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.nav-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-btn.active {
  background: rgba(99, 102, 241, 0.16);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.4);
  font-weight: 600;
  box-shadow: none;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-emerald);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.dot-pulse {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ============================================================
   Layout Containers & Grid System
   ============================================================ */
.main-container {
  max-width: 1460px;
  margin: 1.5rem auto;
  padding: 0 1.5rem 3rem 1.5rem;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.28s ease-out forwards;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dual Column Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(380px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.workspace-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.workspace-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.sticky-card {
  position: sticky;
  top: 5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.85rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Badges */
.badge-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.badge-ai {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(56, 189, 248, 0.25));
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.4);
}

.lang-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.lang-selector-wrapper:hover {
  border-color: var(--accent-primary);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

.lang-icon {
  font-size: 0.85rem;
}

.lang-select {
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding: 0;
}

.lang-select option {
  background: #0f172a;
  color: #f8fafc;
}

/* Streaming Real-Time Token & Live Card Highlights */
.transcript-item.is-live {
  border-left: 3px solid var(--accent-cyan) !important;
  background: rgba(56, 189, 248, 0.08) !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
  animation: liveCardPulse 2s infinite ease-in-out;
}

@keyframes liveCardPulse {
  0% { box-shadow: 0 0 5px rgba(56, 189, 248, 0.1); }
  50% { box-shadow: 0 0 15px rgba(56, 189, 248, 0.25); }
  100% { box-shadow: 0 0 5px rgba(56, 189, 248, 0.1); }
}

.live-typing-indicator {
  display: inline-block;
  width: 6px;
  height: 12px;
  background: var(--accent-cyan);
  margin-left: 4px;
  vertical-align: middle;
  animation: blinkTyping 0.8s infinite;
}

@keyframes blinkTyping {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================================================
   Mode Selector & Form Controls
   ============================================================ */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.mode-btn {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.mode-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #c7d2fe;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.form-row {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-input, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ============================================================
   Recording Box & Controls
   ============================================================ */
.recorder-box {
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  margin-bottom: 1.2rem;
}

.timer-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #f8fafc;
  margin-bottom: 0.6rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.waveform-canvas {
  width: 100%;
  height: 60px;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  background: rgba(15, 23, 42, 0.5);
}

.control-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.btn-record {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-record:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
}

.btn-record.recording {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
  animation: pulse-rec 1.5s infinite;
}

@keyframes pulse-rec {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.record-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.8rem;
}

/* Upload Dropzone */
.upload-dropzone {
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.8rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: var(--transition);
}

.upload-dropzone:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.04);
}

.upload-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.upload-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upload-status {
  font-size: 0.85rem;
  color: var(--secondary);
  margin-top: 0.8rem;
}

/* Buttons */
.btn {
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.btn-primary {
  background: #4f46e5;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: #4338ca;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary:disabled, .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.92rem;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

/* ============================================================
   Audio Playback Bar
   ============================================================ */
.audio-playback-bar {
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.seek-track {
  flex: 1;
}

.time-meta {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.seek-slider {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  height: 4px;
}

/* ============================================================
   Transcript Containers
   ============================================================ */
.transcript-container {
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.4rem;
}

.transcript-item {
  background: rgba(8, 12, 22, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  transition: var(--transition);
}

.transcript-item:hover {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.25);
}

.transcript-item.karaoke-active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.transcript-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.speaker-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: #a5b4fc;
}

.time-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.transcript-text {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.5;
}

/* Empty State */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.empty-state p {
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
}
.empty-state span {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.empty-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
  padding: 0.4rem 0;
}

/* ============================================================
   Cornell Notes Layout
   ============================================================ */
.cornell-section {
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 1rem;
}
.cornell-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}

.text-indigo { color: #a5b4fc; }
.text-emerald { color: #34d399; }
.text-white { color: #f8fafc; }

.cue-tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
}

.cue-answer {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  line-height: 1.45;
}

.minute-bullet {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.decision-badge {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  color: #6ee7b7;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-card {
  background: rgba(8, 12, 22, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.5rem;
}
.action-task {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.3rem;
}
.action-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.action-assignee {
  color: #38bdf8;
}

/* ============================================================
   Tab Online Specifics
   ============================================================ */
.online-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.select-meeting {
  min-width: 300px;
}

.btn-tool {
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
}

.cornell-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .cornell-grid {
    grid-template-columns: 1fr;
  }
}

.transcript-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.transcript-count {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.transcript-list {
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 0.3rem;
}

/* ============================================================
   Embedded AI Assistant (cono-3.5) Co-Pilot Cards
   ============================================================ */
.ai-assistant-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.15);
}

.ai-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-status-indicator {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

.ai-context-badge {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}
.ai-context-badge strong {
  color: #c7d2fe;
}

/* Quick Chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.chip-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.chip-item:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

/* Chat Window */
.chat-container {
  height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0.8rem;
  background: rgba(8, 12, 22, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.9rem;
}

.chat-bubble {
  display: flex;
  gap: 0.6rem;
  max-width: 90%;
  animation: fadeIn 0.2s ease-out;
}

.user-bubble {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.bot-bubble {
  align-self: flex-start;
}

.bubble-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-bubble .bubble-avatar {
  background: rgba(56, 189, 248, 0.2);
}

.bubble-content {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #f1f5f9;
}

.user-bubble .bubble-content {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  border-color: transparent;
}

/* Chat Input Bar */
.chat-input-bar {
  display: flex;
  gap: 0.5rem;
}

.chat-input-field {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.chat-input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-chat {
  padding: 0.65rem 1.1rem;
  font-size: 0.82rem;
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-focus);
  color: #fff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s ease-out;
  pointer-events: none;
  z-index: 1000;
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

/* Utility Spacing */
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

/* ============================================================
   BẢN TÓM TẮT + BIÊN BẢN CUỘC HỌP (meeting documents)
   ============================================================ */

.docs-generated-at {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.meeting-summary-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md, 12px);
  padding: 1rem 1.25rem;
  line-height: 1.7;
  font-size: 0.95rem;
}

.meeting-summary-box .summary-text {
  margin: 0;
  white-space: pre-line;
}

/* Biên bản dạng text — khối chữ đơn giản, dễ đọc, dễ copy */
.full-minutes-doc {
  margin-top: 0.5rem;
}

/* Biên bản = trang giấy trắng, kiểu văn bản hành chính (giống mẫu Google Docs) */
.minutes-doc-paper {
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid #d7dce3;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  padding: 2.2rem 2.6rem;
  max-width: 820px;
  margin: 0 auto;
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.02rem;
  line-height: 1.65;
}

.md-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 0 0.2rem;
}

.md-topic {
  text-align: center;
  font-weight: 700;
  margin: 0 0 1.2rem;
}

.md-meta { margin-bottom: 1.1rem; }

.md-meta-row { margin-bottom: 0.15rem; }

.md-meta-label { font-weight: 700; }

.md-section { margin-bottom: 1rem; }

.md-section-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.md-list {
  margin: 0.1rem 0 0.3rem 1.4rem;
  padding: 0;
}

.md-list li { margin-bottom: 0.2rem; }

.md-time {
  color: #555555;
  font-size: 0.92em;
}

.md-empty { color: #777777; }

.md-subtitle {
  font-weight: 700;
  margin: 0.45rem 0 0.2rem;
}

.md-endline {
  margin-top: 1rem;
  font-style: italic;
  color: #475569;
  font-size: 0.95em;
}

.md-actions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.3rem;
  font-size: 0.95em;
}

.md-actions-table th,
.md-actions-table td {
  border: 1px solid #cbd5e1;
  padding: 5pt 8pt;
  text-align: left;
  vertical-align: top;
}

.md-actions-table th {
  font-weight: 700;
  background: rgba(99, 102, 241, 0.08);
}

.md-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 2.2rem;
  padding: 0 2rem;
}

.md-sign-col { text-align: center; }

.md-sign-role { font-weight: 700; }

.md-sign-hint {
  font-size: 0.85em;
  font-style: italic;
  color: #64748b;
  margin-top: 2.6rem;
}

.offline-docs-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* ============================================================
   NÚT + PANEL TRỢ LÝ AI NỔI (dùng chung cả 2 tab)
   ============================================================ */

#aiFab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #1a1e2e;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 1200;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#aiFab:hover {
  background: #252a40;
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

#aiFloatingPanel {
  position: fixed;
  right: 24px;
  bottom: 80px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 140px);
  background: #121520;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  z-index: 1201;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#aiFloatingPanel.open {
  display: flex;
}

.ai-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.ai-panel-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.05rem;
  cursor: pointer;
  line-height: 1;
}

.ai-panel-close:hover { color: #ffffff; }

.ai-context-label {
  padding: 0.55rem 1.1rem 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

#aiFloatingPanel .quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem 0.2rem;
}

#aiFloatingPanel .chat-container {
  height: 280px;
  margin: 0.5rem 1.1rem;
  overflow-y: auto;
}

#aiFloatingPanel .chat-input-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem 1.1rem 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

#aiFloatingPanel .chat-input-field {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  color: #e2e8f0;
  font-size: 0.9rem;
}

#aiFloatingPanel .chat-input-field:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.6);
}

/* ============================================================
   GHI ÂM OFFLINE — BẢN THU GỌN (compact)
   ============================================================ */

/* Stack 1 cột full width (thay workspace-grid 2 cột ở tab offline) */
.workspace-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#tab-offline .recorder-box {
  padding: 1.1rem 1rem 1rem;
  margin-bottom: 1rem;
}

#tab-offline .timer-display {
  font-size: 2.1rem;
  margin-bottom: 0.4rem;
}

#tab-offline .waveform-canvas {
  height: 46px;
  margin-bottom: 0.7rem;
}

#tab-offline .btn-record {
  width: 52px;
  height: 52px;
  font-size: 1.45rem;
}

#tab-offline .control-buttons { gap: 0.7rem; }

#tab-offline .mode-selector {
  gap: 0.6rem;
  margin-bottom: 1rem;
}

#tab-offline .mode-btn {
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
}

#tab-offline .upload-dropzone { padding: 1.4rem 1.2rem; }

#tab-offline .upload-icon {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
}

#tab-offline .btn-block {
  padding: 0.75rem;
  font-size: 0.9rem;
}

#tab-offline .btn-block {
  padding: 0.6rem;
  font-size: 0.85rem;
}

/* ============================================================
   BOT AUTHENTICATION MODAL (1 LẦN DUY NHẤT)
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

.bot-auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.25rem;
}

.bot-auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.bot-auth-tab.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.bot-auth-tab:hover:not(.active) {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.bot-auth-panel {
  display: none;
}

.bot-auth-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-help {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 4px;
}

.modal-footer {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
}

/* Auth clickable badges */
#meetBotAuthBadge,
#teamsBotAuthBadge {
  cursor: pointer;
  transition: var(--transition);
}

#meetBotAuthBadge:hover,
#teamsBotAuthBadge:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
