/* ============================================
   Agile AI Companion -- Web Dashboard
   v0.5.0 -- Rebranded
   Aesthetic: Modern Professional
   Deep indigo + warm cream + coral accents
   ============================================ */

/* Fonts loaded via <link> in HTML templates (preconnect + consolidated URL) */

/* --- Tokens --- */
:root {
  /* Colors */
  --coral: #D97757;
  --coral-light: #E8A088;
  --coral-deep: #B85A3A;
  --cream: #FAF3EB;
  --cream-mid: #F0E6D8;
  --navy: #1A1A2E;
  --navy-soft: #2A2A42;
  --navy-muted: #3D3D5C;
  --sand: #E6D5C3;
  --sand-light: #F5EDE3;
  --white: #ffffff;
  --navy-deeper: #222240;
  --cream-dark: #E8E0D8;
  --charcoal: #2C2C2C;
  --warm-gray: #6B6257;
  --success: #4A7C59;
  --error: #C0392B;
  --warning: #D4A017;
  --accent-purple: #6C5CE7;
  --radius-pill: 24px;
  --input-bg: rgba(250, 243, 235, 0.95);

  /* Typography */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Manrope', 'DM Sans', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  
  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  /* Line Heights */
  --leading-tight: 1.2;
  --leading-normal: 1.4;
  --leading-relaxed: 1.65;
  
  /* Spacing Scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Border Radius */
  --radius: 16px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --radius-lg: 20px;

  /* Duration */
  --duration-fast: 0.15s;
  --duration-normal: 0.3s;
  --duration-slow: 0.6s;

  /* Composite tokens */
  --navy-gradient: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 50%, var(--navy-muted) 100%);
  --grain-overlay: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  
  /* Elevation/Shadows */
  --shadow-0: none;
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 4px 12px rgba(26, 26, 46, 0.08);
  --shadow-3: 0 8px 24px rgba(26, 26, 46, 0.12);
  --shadow-4: 0 12px 40px rgba(26, 26, 46, 0.16);
  
  /* Easing Functions */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bouncy: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Layout */
  --sidebar-width: 300px;
  --nav-height: 60px;

  /* Login page tokens (gold/amber palette) */
  --login-primary: #fbbf24;
  --login-primary-dark: #d97706;
  --login-bg: #fdfbf7;
  --login-text: #292524;
  --login-text-muted: #78716c;
  --login-card-bg: #ffffff;
  --login-card-border: #e7e5e4;
  --login-input-bg: #fafaf9;
  --login-input-border: #d6d3d1;
  --login-divider: #e7e5e4;
  --login-gradient-from: #fbbf24;
  --login-gradient-via: #fb923c;
  --login-gradient-to: #d97706;
  --login-badge-bg: rgba(255, 237, 213, 0.8);
  --login-badge-border: #fed7aa;
  --login-badge-text: #d97706;
  --login-star: #eab308;
  --login-glow: rgba(251, 191, 36, 0.6);
  --login-icon-bg-from: #fafaf9;
  --login-icon-bg-to: #f5f5f4;
  --login-footer-dot: #d6d3d1;
  --login-submit-text: #ffffff;
  --login-shadow-primary: rgba(251, 191, 36, 0.15);
  --login-shadow-primary-hover: rgba(251, 191, 36, 0.25);
  --login-flash-bg: rgba(192, 57, 43, 0.08);
  --login-flash-border: rgba(192, 57, 43, 0.15);
  --font-login: 'Manrope', system-ui, sans-serif;

  /* A2IC Chat tokens (light mode) */
  --a2ic-primary: #d69e2e;
  --a2ic-primary-dark: #b7791f;
  --a2ic-primary-glow: rgba(214, 158, 46, 0.2);
  --a2ic-sidebar-bg: #fdfbf2;
  --a2ic-sidebar-border: #e2e8f0;
  --a2ic-header-bg: rgba(255, 255, 255, 0.9);
  --a2ic-header-border: #e2e8f0;
  --a2ic-chat-bg: #fafaf8;
  --a2ic-ai-bubble-bg: #e8f0eb;
  --a2ic-ai-bubble-border: #cce0d2;
  --a2ic-ai-bubble-text: #2d3748;
  --a2ic-ai-accent: #40634a;
  --a2ic-user-bubble-bg: #fbece8;
  --a2ic-user-bubble-border: #f5d5cc;
  --a2ic-user-bubble-text: #2d3748;
  --a2ic-input-bg: #ffffff;
  --a2ic-input-border: #e2e8f0;
  --a2ic-input-focus: rgba(214, 158, 46, 0.3);
  --a2ic-border: #e2e8f0;
  --a2ic-text: #2d3748;
  --a2ic-text-muted: #718096;
  --a2ic-text-light: #a0aec0;
  --a2ic-surface-hover: #f7f5ee;
  --a2ic-on-primary: #ffffff;
  --a2ic-active-item-bg: #ffffff;
  --a2ic-active-item-border: #e2e8f0;
  --a2ic-active-item-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --a2ic-avatar-from: #d69e2e;
  --a2ic-avatar-to: #ed8936;
  --a2ic-avatar-gradient: linear-gradient(135deg, var(--a2ic-avatar-from), var(--a2ic-avatar-to));
  --a2ic-action-bg: #ffffff;
  --a2ic-action-border: #e2e8f0;
  --a2ic-action-text: #718096;
  --a2ic-pill-bg: #ffffff;
  --a2ic-pill-border: #e2e8f0;
  --a2ic-pill-text: #718096;
  --a2ic-pill-hover-bg: rgba(232, 240, 235, 0.5);
  --a2ic-pill-hover-text: #40634a;
  --a2ic-beta-bg: #e8f0eb;
  --a2ic-beta-text: #40634a;
  --a2ic-beta-border: #cce0d2;
  --a2ic-mode-bg: #f7fafc;
  --a2ic-mode-border: #e2e8f0;
  --a2ic-mode-active-bg: #2e4a35;
  --a2ic-mode-active-text: #ffffff;
  --a2ic-mode-inactive-text: #718096;
  --a2ic-scrollbar-track: #fdfbf2;
  --a2ic-scrollbar-thumb: #e2e8f0;
  --a2ic-scrollbar-thumb-hover: #cbd5e0;
  --a2ic-gradient-fade-from: rgba(255, 255, 255, 1);
  --a2ic-gradient-fade-to: transparent;
  --a2ic-font: 'Manrope', system-ui, sans-serif;
  --a2ic-sidebar-width: 320px;
  --a2ic-header-height: 64px;
  --pattern-mudcloth: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d69e2e' fill-opacity='0.08' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
  --pattern-kente: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f4c025' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--charcoal);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100%;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* --- Grain overlay --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: var(--grain-overlay);
  background-size: 200px;
}

a {
  color: var(--coral);
  text-decoration: none;
  transition: color 0.2s var(--ease-smooth);
}

a:hover {
  color: var(--coral-deep);
}

/* =============================================
   Navigation
   ============================================= */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(250, 243, 235, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--sand);
  box-shadow: var(--shadow-1);
}

.nav-inner {
  height: 100%;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.03em;
  white-space: nowrap;
  line-height: var(--leading-tight);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  width: 28px;
  height: 28px;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 6px;
}

.nav-brand span {
  color: var(--coral);
}

/* --- Status Pills --- */
.nav-status-pills {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--sand-light);
  border: 1px solid var(--sand);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--warm-gray);
  transition: all 0.3s var(--ease-smooth);
}

.status-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sand);
  transition: background 0.3s var(--ease-smooth);
  position: relative;
  flex-shrink: 0;
}

.status-pill-dot.connected {
  background: var(--success);
  animation: statusPulse 2s var(--ease-smooth) infinite;
}

.status-pill-dot.connected::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--success);
  opacity: 0.3;
  animation: statusRing 2s var(--ease-smooth) infinite;
}

.status-pill-dot.disconnected {
  background: var(--error);
  animation: statusPulseDisconnected 2s var(--ease-smooth) infinite;
}

.status-pill-label {
  letter-spacing: 0.02em;
}

/* --- Nav Separator --- */
.nav-separator {
  width: 1px;
  height: 24px;
  background: var(--sand);
  flex-shrink: 0;
}

/* --- Nav Avatar (shared) --- */
.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--coral-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.nav-guest-badge {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--coral-deep);
  background: linear-gradient(135deg, rgba(217, 119, 87, 0.12), rgba(217, 119, 87, 0.06));
  border: 1px solid rgba(217, 119, 87, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  white-space: nowrap;
}

/* --- Nav Profile Dropdown --- */
.nav-profile {
  position: relative;
}

.nav-profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.6rem 0.3rem 0.3rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.nav-profile-trigger:hover {
  background: var(--sand-light);
  border-color: var(--sand);
}

.nav-profile.open .nav-profile-trigger {
  background: var(--sand-light);
  border-color: var(--sand);
}

.nav-profile-photo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-profile-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--charcoal);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-profile-chevron {
  color: var(--warm-gray);
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-smooth);
}

.nav-profile.open .nav-profile-chevron {
  transform: rotate(180deg);
}

.nav-profile-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 260px;
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  padding: var(--space-2);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--duration-fast) var(--ease-smooth),
              transform var(--duration-fast) var(--ease-smooth),
              visibility var(--duration-fast);
}

.nav-profile.open .nav-profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: var(--space-3);
}

.dropdown-user-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.dropdown-user-avatar {
  width: 40px;
  height: 40px;
  font-size: var(--text-sm);
}

.dropdown-user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dropdown-user-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-email {
  font-size: var(--text-xs);
  color: var(--warm-gray);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-role-badge {
  padding: 0 var(--space-3) var(--space-2);
}

.dropdown-divider {
  height: 1px;
  background: var(--sand);
  margin: var(--space-1) var(--space-2);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--charcoal);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-smooth);
}

.dropdown-item:hover {
  background: var(--sand-light);
  color: var(--charcoal);
}

.dropdown-item-logout:hover {
  color: var(--error);
}

/* --- Nav Action Buttons --- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--warm-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-smooth);
  text-decoration: none;
}

.nav-action-btn:hover {
  background: var(--sand-light);
  color: var(--coral-deep);
}

/* --- Sidebar toggle (hamburger) --- */
.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--navy);
  border-radius: 1px;
  transition: all 0.25s ease;
}

/* =============================================
   App Layout -- Sidebar + Chat
   ============================================= */

.app-layout {
  display: flex;
  height: calc(100vh - var(--nav-height));
  margin-top: var(--nav-height);
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(to bottom, var(--white) 0%, var(--sand-light) 100%);
  border-right: 1px solid var(--sand);
  display: flex;
  flex-direction: column;
  transition: width 0.3s var(--ease-standard), margin-left 0.3s var(--ease-standard), border 0.3s var(--ease-standard);
}

.sidebar-header {
  padding: var(--space-6) var(--space-6) var(--space-3);
  border-bottom: 1px solid var(--sand-light);
}

.sidebar-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--warm-gray);
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--charcoal);
  text-align: left;
  transition: all 0.2s var(--ease-smooth);
  position: relative;
}

.sidebar-btn:hover {
  background: var(--sand-light);
  box-shadow: var(--shadow-1);
  transform: translateX(2px);
}

.sidebar-btn:active {
  transform: translateX(2px) scale(0.98);
}

.sidebar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.sidebar-btn.is-running {
  background: rgba(217, 119, 87, 0.08);
  color: var(--coral-deep);
  border-left-color: var(--coral);
  box-shadow: var(--shadow-1);
}

.sidebar-btn-number {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--sand);
  min-width: 1.4rem;
  transition: color 0.2s ease;
}

.sidebar-btn:hover .sidebar-btn-number,
.sidebar-btn.is-running .sidebar-btn-number {
  color: var(--coral-light);
}

.sidebar-btn-label {
  flex: 1;
  font-weight: 500;
}

.sidebar-btn-readonly {
  font-size: var(--text-xs);
  color: var(--warm-gray);
  font-style: italic;
}

/* --- Mini Jira toggle in sidebar --- */
.jira-mini-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.jira-mini-toggle input {
  display: none;
}

.jira-mini-slider {
  width: 28px;
  height: 14px;
  background: var(--sand);
  border-radius: 14px;
  position: relative;
  transition: background 0.25s ease;
}

.jira-mini-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.jira-mini-toggle input:checked + .jira-mini-slider {
  background: var(--coral);
}

.jira-mini-toggle input:checked + .jira-mini-slider::after {
  transform: translateX(14px);
}

.jira-mini-toggle.is-disabled {
  cursor: not-allowed;
  opacity: 0.4;
  pointer-events: none;
}

/* --- Sidebar footer --- */
.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--sand-light);
  background: rgba(255, 255, 255, 0.5);
}

.sidebar-run-all {
  width: 100%;
  justify-content: center;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-1);
}

.sidebar-run-all:hover:not(:disabled) {
  box-shadow: var(--shadow-2);
}

/* --- Sidebar overlay (mobile) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(26, 26, 46, 0.4);
  backdrop-filter: blur(2px);
}

.sidebar-overlay.visible {
  display: block;
}

/* =============================================
   Chat Main Area
   ============================================= */

.chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}

.chat-timeline {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-6) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  scroll-behavior: smooth;
}

/* --- Chat Messages --- */
.chat-message {
  display: flex;
  animation: chatBubbleIn 0.4s var(--ease-bouncy) both;
  will-change: transform, opacity;
}

.chat-message-user {
  justify-content: flex-end;
}

.chat-message-ai {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 90%;
  border-radius: var(--radius);
  position: relative;
}

.chat-message-user .chat-bubble {
  background: var(--navy);
  color: var(--cream);
  padding: var(--space-3) var(--space-6);
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-2);
}

.chat-message-user .chat-bubble p {
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: var(--leading-normal);
}

.chat-message-ai .chat-bubble {
  background: var(--navy-gradient);
  color: var(--cream);
  border: none;
  padding: var(--space-6) var(--space-6);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}

.chat-message-ai .chat-bubble::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain-overlay);
  background-size: 200px;
  opacity: 0.06;
  pointer-events: none;
}

/* --- AI bubble content overrides ---
   Cream-on-dark bubble theme: these tokens scope cream (#FAF3EB) at
   various opacities for text, borders and subtle fills inside AI bubbles.
   Defined on .chat-bubble so they cascade to both .chat-bubble-content
   and sibling .chat-bubble-meta. */
.chat-message-ai .chat-bubble {
  --bubble-text: rgba(250, 243, 235, 0.85);
  --bubble-text-muted: rgba(250, 243, 235, 0.7);
  --bubble-text-dim: rgba(250, 243, 235, 0.6);
  --bubble-text-faint: rgba(250, 243, 235, 0.5);
  --bubble-border: rgba(250, 243, 235, 0.15);
  --bubble-border-subtle: rgba(250, 243, 235, 0.08);
  --bubble-fill: rgba(250, 243, 235, 0.1);
}

.chat-message-ai .chat-bubble-content {
  position: relative;
  z-index: 1;
}

.chat-message-ai .chat-bubble-content h3 {
  color: var(--cream);
}

.chat-message-ai .chat-bubble-content p {
  color: var(--bubble-text);
}

.chat-message-ai .md-content {
  color: var(--cream);
}

.chat-message-ai .md-content h1,
.chat-message-ai .md-content h2,
.chat-message-ai .md-content h3,
.chat-message-ai .md-content h4,
.chat-message-ai .md-content h5,
.chat-message-ai .md-content h6 {
  color: var(--cream);
}

.chat-message-ai .md-content strong {
  color: var(--cream);
}

.chat-message-ai .md-content code {
  background: var(--bubble-fill);
  border-color: var(--bubble-border);
  color: var(--coral-light);
}

.chat-message-ai .md-content pre {
  background: rgba(0, 0, 0, 0.3);
  color: var(--cream);
}

.chat-message-ai .md-content pre code {
  background: none;
  border: none;
  color: inherit;
}

.chat-message-ai .md-content a {
  color: var(--coral-light);
}

.chat-message-ai .md-content blockquote {
  border-left-color: var(--coral-light);
  background: rgba(232, 160, 136, 0.08);
  color: var(--bubble-text-muted);
}

.chat-message-ai .md-content table th {
  color: var(--bubble-text-dim);
  border-bottom-color: var(--bubble-border);
}

.chat-message-ai .md-content table td {
  border-bottom-color: var(--bubble-border-subtle);
  color: var(--bubble-text);
}

.chat-message-ai .md-content hr {
  border-top-color: var(--bubble-border);
}

.chat-message-ai .md-content p {
  color: var(--bubble-text);
}

.chat-message-ai .md-content li {
  color: var(--bubble-text);
}

/* --- AI bubble meta overrides --- */
.chat-message-ai .chat-bubble-meta {
  border-top-color: var(--bubble-border);
  position: relative;
  z-index: 1;
}

.chat-message-ai .timing-badge {
  color: var(--bubble-text-faint);
}

.chat-message-ai .btn-copy,
.chat-message-ai .btn-export {
  color: var(--bubble-text-dim);
  border-color: var(--bubble-border);
}

.chat-message-ai .btn-copy:hover,
.chat-message-ai .btn-export:hover {
  color: var(--coral-light);
  border-color: var(--coral-light);
}

/* --- Workflow cards inside AI bubbles: reset to their own light colors --- */
.chat-message-ai .persona-card,
.chat-message-ai .story-card,
.chat-message-ai .review-panel,
.chat-message-ai .retro-section {
  color: var(--charcoal);
}

.chat-message-ai .persona-card h4,
.chat-message-ai .story-card h4,
.chat-message-ai .review-panel h4,
.chat-message-ai .retro-section h4 {
  color: var(--navy);
}

.chat-message-ai .persona-meta,
.chat-message-ai .story-user-story,
.chat-message-ai .story-meta,
.chat-message-ai .persona-list li,
.chat-message-ai .story-ac-list li,
.chat-message-ai .review-panel li,
.chat-message-ai .improvement-row {
  color: var(--charcoal);
}

.chat-message-ai .rice-table th {
  color: var(--warm-gray);
}

.chat-message-ai .rice-table td {
  color: var(--charcoal);
}

.chat-bubble-content {
  overflow-x: auto;
}

.chat-bubble-content > * {
  animation: contentStagger 0.3s ease both;
}

.chat-bubble-content h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

.chat-bubble-content p {
  font-size: var(--text-sm);
  color: var(--warm-gray);
  line-height: var(--leading-relaxed);
}

/* --- Welcome message --- */
.chat-welcome {
  animation: none;
}

.chat-welcome .chat-bubble {
  background: var(--navy-gradient);
  color: var(--cream);
  border: none;
  max-width: 600px;
  position: relative;
  overflow: hidden;
}

.chat-welcome .chat-bubble::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain-overlay);
  background-size: 200px;
  opacity: 0.1;
  pointer-events: none;
}

.chat-welcome .chat-bubble h3 {
  color: var(--cream);
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.chat-welcome .chat-bubble p {
  color: var(--bubble-text);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.chat-welcome-hint {
  margin-top: var(--space-4);
  font-size: var(--text-xs) !important;
  color: var(--bubble-text-faint) !important;
  font-style: italic;
}

/* --- Chat bubble meta (timing + actions) --- */
.chat-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--sand-light);
}

.timing-badge {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--warm-gray);
  font-variant-numeric: tabular-nums;
}

.chat-bubble-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-copy {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--warm-gray);
  background: none;
  border: 1px solid var(--sand);
  border-radius: var(--radius-xs);
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.btn-copy:hover {
  border-color: var(--coral-light);
  color: var(--coral-deep);
}

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

/* --- Typing indicator --- */
.typing-indicator {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  padding: var(--space-3) var(--space-6);
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--coral-light);
  border-radius: 50%;
  animation: typingBounce 1.2s var(--ease-smooth) infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

/* --- Skeleton Loaders --- */
.skeleton {
  background: linear-gradient(90deg, var(--sand-light) 25%, var(--sand) 50%, var(--sand-light) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s var(--ease-smooth) infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeletonPulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-bubble {
  height: 120px;
  width: 100%;
  max-width: 400px;
  margin-bottom: var(--space-4);
}

.skeleton-card {
  height: 200px;
  width: 100%;
  margin-bottom: var(--space-4);
}

.skeleton-line {
  height: 1em;
  width: 100%;
  margin-bottom: var(--space-2);
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-line.medium {
  width: 80%;
}

/* --- Error message --- */
.chat-message-error .chat-bubble {
  background: var(--white);
  border: 2px solid rgba(192, 57, 43, 0.3);
  padding: var(--space-4) var(--space-6);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-2);
  position: relative;
}

.chat-message-error .chat-bubble::before {
  content: '⚠';
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  font-size: var(--text-lg);
  color: var(--error);
  opacity: 0.5;
}

.chat-message-error .chat-bubble p {
  color: var(--error);
  font-size: var(--text-sm);
  font-weight: 500;
  padding-left: var(--space-8);
}

/* =============================================
   Buttons
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  text-decoration: none;
  position: relative;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
  transition: transform 0.15s var(--ease-bouncy);
}

.btn-primary {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  color: #fff;
  box-shadow: var(--shadow-1);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--coral-deep) 0%, var(--coral) 100%);
  box-shadow: 0 4px 20px rgba(217, 119, 87, 0.4);
  transform: translateY(-1px);
}

.btn-primary:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
  opacity: 0.8;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--sand);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--coral-light);
  background: var(--cream-mid);
  color: var(--coral-deep);
}

.btn-outline:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--sand-light);
  color: var(--charcoal);
  border: 2px solid var(--sand);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--cream-mid);
  border-color: var(--coral-light);
  color: var(--coral-deep);
}

.btn-sm {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-4);
}

.btn-md {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
}

.btn-lg {
  font-size: var(--text-lg);
  padding: var(--space-6) var(--space-12);
}

/* =============================================
   Fullscreen mode (hides sidebar)
   ============================================= */

.app-layout.fullscreen .sidebar {
  margin-left: calc(-1 * var(--sidebar-width));
}

.app-layout.fullscreen .chat-timeline {
  max-width: 900px;
  margin: 0 auto;
}

/* Fullscreen button inherits .nav-action-btn styles */

/* =============================================
   Toast Notifications
   ============================================= */

.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-4));
  right: var(--space-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-3);
  font-size: var(--text-sm);
  max-width: 340px;
  animation: slideInDown 0.3s var(--ease-smooth) both;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toast.toast-success {
  border-left: 3px solid var(--success);
}

.toast.toast-success::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  font-size: var(--text-lg);
}

.toast.toast-error {
  border-left: 3px solid var(--error);
}

.toast.toast-error::before {
  content: '×';
  color: var(--error);
  font-weight: 700;
  font-size: var(--text-lg);
  line-height: 1;
}

/* =============================================
   Workflow-specific result renderers
   (Kept from v0.3.0, displayed inside AI chat bubbles)
   ============================================= */

/* --- Persona Cards --- */
.persona-card {
  background: var(--sand-light);
  border: 1.5px solid var(--sand);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.2s var(--ease-smooth);
}

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

.persona-card h4 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.persona-meta {
  font-size: var(--text-sm);
  color: var(--warm-gray);
  margin-bottom: var(--space-4);
}

.persona-quote {
  font-style: italic;
  color: var(--coral-deep);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--coral);
  background: rgba(217, 119, 87, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.persona-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--coral);
  margin: 0.8rem 0 0.3rem;
}

.persona-list {
  list-style: none;
  padding: 0;
}

.persona-list li {
  font-size: var(--text-sm);
  color: var(--charcoal);
  padding: var(--space-1) 0;
  padding-left: var(--space-4);
  position: relative;
}

.persona-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 4px;
  height: 4px;
  background: var(--coral-light);
  border-radius: 50%;
}

/* --- RICE Table --- */
.north-star-panel {
  background: var(--navy-gradient);
  color: var(--cream);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}

.north-star-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain-overlay);
  background-size: 200px;
  opacity: 0.1;
  pointer-events: none;
}

.north-star-panel h4 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--coral-light);
  margin-bottom: var(--space-2);
}

.north-star-panel p {
  font-size: var(--text-sm);
  color: var(--bubble-text-muted);
}

.rice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-1);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.rice-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warm-gray);
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--sand);
  background: var(--sand-light);
}

.rice-table th:last-child {
  text-align: right;
}

.rice-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--sand-light);
  color: var(--charcoal);
  transition: background 0.2s var(--ease-smooth);
}

.rice-table tbody tr:nth-child(even) {
  background: rgba(245, 237, 227, 0.3);
}

.rice-table tbody tr:hover {
  background: var(--sand-light);
}

.rice-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--success);
}

.rice-bar {
  display: inline-block;
  height: 6px;
  background: var(--coral);
  border-radius: 3px;
  min-width: 4px;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* --- Story Panels --- */
.story-epic {
  background: var(--navy-gradient);
  color: var(--cream);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}

.story-epic::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain-overlay);
  background-size: 200px;
  opacity: 0.1;
  pointer-events: none;
}

.story-epic h4 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.story-epic p {
  font-size: var(--text-sm);
  color: var(--bubble-text-muted);
}

.story-card {
  background: var(--sand-light);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.2s var(--ease-smooth), transform 0.2s var(--ease-smooth);
}

.story-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.story-card h4 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.story-user-story {
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--warm-gray);
  margin-bottom: var(--space-4);
}

.story-ac-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--coral);
  margin-bottom: 0.3rem;
}

.story-ac-list {
  list-style: none;
  padding: 0;
  margin-bottom: 0.8rem;
}

.story-ac-list li {
  font-size: var(--text-sm);
  color: var(--charcoal);
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
  position: relative;
}

.story-ac-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 4px;
  height: 4px;
  background: var(--success);
  border-radius: 50%;
}

.story-meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--warm-gray);
}

.story-meta strong {
  color: var(--charcoal);
}

/* --- Backlog Review --- */
.health-gauge {
  text-align: center;
  padding: var(--space-8);
  margin-bottom: var(--space-6);
}

.health-score {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-2);
  animation: fadeInScale 0.6s var(--ease-bouncy) both;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.health-score.health-good { color: var(--success); }
.health-score.health-medium { color: var(--warning); }
.health-score.health-poor { color: var(--error); }

.health-label {
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: var(--space-2);
}

.health-summary {
  font-size: var(--text-sm);
  color: var(--warm-gray);
  max-width: 500px;
  margin: 0 auto;
}

.review-panel {
  background: var(--sand-light);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  padding: var(--space-6) var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-1);
}

.review-panel h4 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-3);
}

.review-panel ul {
  list-style: none;
  padding: 0;
}

.review-panel li {
  font-size: var(--text-sm);
  color: var(--charcoal);
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
  position: relative;
}

.review-panel li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 4px;
  height: 4px;
  background: var(--coral-light);
  border-radius: 50%;
}

.improvement-row {
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--sand);
  font-size: var(--text-sm);
}

.improvement-row:last-child {
  border-bottom: none;
}

.priority-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.priority-badge.high {
  background: rgba(192, 57, 43, 0.15);
  color: var(--error);
  border: 1px solid rgba(192, 57, 43, 0.2);
}

.priority-badge.medium {
  background: rgba(212, 160, 23, 0.15);
  color: var(--warning);
  border: 1px solid rgba(212, 160, 23, 0.2);
}

.priority-badge.low {
  background: rgba(74, 124, 89, 0.15);
  color: var(--success);
  border: 1px solid rgba(74, 124, 89, 0.2);
}

/* --- Release Notes Tabs --- */
.tab-container {
  margin-bottom: 1rem;
}

.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--sand);
  margin-bottom: 1.5rem;
}

.tab-btn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--warm-gray);
  background: none;
  border: none;
  padding: var(--space-3) var(--space-6);
  cursor: pointer;
  position: relative;
  transition: color 0.2s var(--ease-smooth);
}

.tab-btn:hover {
  color: var(--navy);
}

.tab-btn.active {
  color: var(--coral);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--coral);
  border-radius: 2px 2px 0 0;
  animation: tabSlideIn 0.3s var(--ease-smooth);
}

@keyframes tabSlideIn {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s var(--ease-smooth);
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-panel h4 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--navy);
  margin-bottom: var(--space-2);
}

.tab-panel .tab-intro {
  font-size: var(--text-sm);
  color: var(--warm-gray);
  margin-bottom: var(--space-4);
}

.tab-panel ul {
  list-style: none;
  padding: 0;
}

.tab-panel li {
  font-size: var(--text-sm);
  color: var(--charcoal);
  padding: var(--space-1) 0 var(--space-1) var(--space-4);
  position: relative;
}

.tab-panel li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 4px;
  height: 4px;
  background: var(--coral-light);
  border-radius: 50%;
}

.tab-panel .sub-section {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--sand-light);
}

.tab-panel .sub-section h5 {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--coral);
  margin-bottom: var(--space-2);
}

/* --- Retro Grid --- */
.retro-icebreaker {
  background: var(--navy-gradient);
  color: var(--cream);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}

.retro-icebreaker::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--grain-overlay);
  background-size: 200px;
  opacity: 0.1;
  pointer-events: none;
}

.retro-icebreaker h4 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--coral-light);
  margin-bottom: var(--space-2);
}

.retro-icebreaker p {
  font-size: var(--text-sm);
  color: var(--bubble-text-muted);
}

.retro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.retro-section {
  background: var(--sand-light);
  border: 1.5px solid var(--sand);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.2s var(--ease-smooth);
}

.retro-section:hover {
  box-shadow: var(--shadow-2);
}

.retro-section h4 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.retro-section.liked h4 { color: var(--success); }
.retro-section.learned h4 { color: #2E86C1; }
.retro-section.lacked h4 { color: var(--error); }
.retro-section.longed-for h4 { color: var(--warning); }

.retro-item {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

.retro-item strong {
  color: var(--navy);
  display: block;
}

.retro-item span {
  color: var(--warm-gray);
  font-size: 0.8rem;
}

.retro-item em {
  font-size: 0.75rem;
  color: var(--coral);
}

.retro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.retro-table caption {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  padding-bottom: var(--space-3);
}

.retro-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warm-gray);
  text-align: left;
  padding: var(--space-2) var(--space-4);
  border-bottom: 2px solid var(--sand);
}

.retro-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--sand-light);
  color: var(--charcoal);
}

/* =============================================
   Sidebar Chat Panel
   ============================================= */

.sidebar-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.a2ic-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.a2ic-history-delete {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--warm-gray);
  cursor: pointer;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.15s var(--ease-smooth);
  flex-shrink: 0;
}

.a2ic-history-item:hover .a2ic-history-delete {
  opacity: 1;
}

.a2ic-history-delete:hover {
  background: color-mix(in srgb, var(--error) 10%, transparent);
  color: var(--error);
}

.a2ic-history-rename {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--warm-gray);
  cursor: pointer;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.15s var(--ease-smooth);
  flex-shrink: 0;
}

.a2ic-history-item:hover .a2ic-history-rename {
  opacity: 1;
}

.a2ic-history-rename:hover {
  color: var(--a2ic-primary);
}

.a2ic-history-inline-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--a2ic-primary);
  color: var(--a2ic-text);
  font: inherit;
  font-size: 0.875rem;
  padding: 0;
  outline: none;
  min-width: 0;
}

.a2ic-history-inline-input:focus {
  border-bottom-color: var(--a2ic-primary);
  outline: none;
}

.a2ic-history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--a2ic-text-muted);
  text-align: center;
}

.a2ic-history-empty-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--a2ic-surface-hover, rgba(0, 0, 0, 0.04));
}

.a2ic-history-empty-icon .material-symbols-outlined {
  font-size: 1.5rem;
  opacity: 0.6;
}

.a2ic-history-empty-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  color: var(--a2ic-text-muted);
}

.a2ic-history-empty-hint {
  font-size: 0.75rem;
  opacity: 0.7;
  max-width: 180px;
  line-height: 1.5;
}


/* =============================================
   Mode Toggle (Chat / Workflows)
   ============================================= */

.mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-3) var(--space-6) 0;
  flex-shrink: 0;
}

.mode-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-6);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  background: transparent;
  color: var(--warm-gray);
  transition: all 0.25s var(--ease-smooth);
}

.mode-toggle-btn:hover {
  background: var(--sand-light);
  color: var(--charcoal);
}

.mode-toggle-btn.active {
  background: var(--coral);
  color: var(--cream);
  box-shadow: var(--shadow-1);
}

[data-theme="dark"] .mode-toggle-btn.active {
  background: var(--coral-deep);
  color: var(--navy);
}

/* --- Chat mode: sidebar stays visible for chat history --- */
.app-layout.chat-mode .sidebar {
  width: var(--sidebar-width);
}

/* --- Workflows mode: disable chat input --- */
.app-layout.workflows-mode .chat-input-container .chat-input {
  pointer-events: none;
  opacity: 0.5;
}

/* =============================================
   Chat Input Container (Gemini-style)
   ============================================= */

.chat-input-container {
  padding: var(--space-3) var(--space-6) var(--space-4);
  flex-shrink: 0;
}

.chat-input-container > .chat-input-textarea-wrap {
  background: var(--input-bg);
  border: 1px solid var(--sand);
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
  border-bottom: none;
  padding: var(--space-4) var(--space-6) var(--space-2);
  transition: border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.chat-input-container:focus-within > .chat-input-textarea-wrap {
  border-color: var(--coral-light);
}

.chat-input-container:focus-within {
  filter: drop-shadow(0 0 8px rgba(217, 119, 87, 0.08));
}

.chat-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--charcoal);
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  max-height: 120px;
  min-height: 1.5em;
  transition: color 0.2s var(--ease-smooth);
}

.chat-input::placeholder {
  color: var(--warm-gray);
  opacity: 0.6;
}

.chat-input:focus-visible {
  outline: none;
}

/* --- Toolbar row --- */
.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  background: var(--input-bg);
  border: 1px solid var(--sand);
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  border-top: 1px solid var(--sand-light);
  padding: var(--space-2) var(--space-4);
  transition: border-color 0.2s var(--ease-smooth);
}

.chat-input-container:focus-within .chat-toolbar {
  border-color: var(--coral-light);
  border-top-color: var(--sand-light);
}

.chat-toolbar-left,
.chat-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.chat-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: none;
  border: none;
  color: var(--warm-gray);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: all 0.2s var(--ease-smooth);
}

.chat-toolbar-btn:hover {
  background: var(--sand-light);
  color: var(--charcoal);
}

.chat-toolbar-label {
  font-size: var(--text-xs);
  font-weight: 500;
}

/* --- Send button --- */
.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--coral);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s var(--ease-smooth);
  box-shadow: var(--shadow-1);
  transform: scale(1);
}

.chat-send-btn:disabled {
  background: var(--sand);
  cursor: not-allowed;
  box-shadow: none;
  transform: scale(0.85);
  opacity: 0.6;
}

.chat-send-btn:not(:disabled):hover {
  background: var(--coral-deep);
  box-shadow: 0 4px 12px rgba(217, 119, 87, 0.4);
  transform: scale(1.08);
}

.chat-send-btn:not(:disabled):active {
  transform: scale(0.95);
}

/* =============================================
   Model Selector Dropdown
   ============================================= */

.model-selector-dropdown {
  position: relative;
}

.model-selector-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: none;
  border: 1px solid var(--sand);
  color: var(--charcoal);
  cursor: pointer;
  padding: var(--space-1) var(--space-3);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  transition: all 0.2s var(--ease-smooth);
  white-space: nowrap;
}

.model-selector-trigger:hover {
  background: var(--sand-light);
  border-color: var(--coral-light);
}

.model-selector-icon {
  display: flex;
  align-items: center;
}

.model-selector-chevron {
  transition: transform 0.2s var(--ease-smooth);
}

.model-selector-dropdown.open .model-selector-chevron {
  transform: rotate(180deg);
}

.model-selector-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-3);
  padding: var(--space-1);
  z-index: 60;
  animation: fadeDown 0.15s var(--ease-smooth);
}

.model-selector-dropdown.open .model-selector-menu {
  display: block;
}

.model-selector-option {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  transition: background 0.15s var(--ease-smooth);
  font-family: var(--font-body);
}

.model-selector-option:hover {
  background: var(--sand-light);
}

.model-selector-option.active {
  background: rgba(217, 119, 87, 0.08);
}

.model-option-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--charcoal);
}

.model-option-desc {
  font-size: var(--text-xs);
  color: var(--warm-gray);
}

[data-theme="dark"] .model-selector-trigger {
  border-color: var(--sand);
  color: #E8E0D8;
}

[data-theme="dark"] .model-selector-trigger:hover {
  background: var(--sand);
}

[data-theme="dark"] .model-selector-menu {
  background: var(--cream-mid);
  border-color: var(--sand);
}

[data-theme="dark"] .model-selector-option:hover {
  background: var(--sand);
}

[data-theme="dark"] .model-option-name {
  color: #E8E0D8;
}

@media (max-width: 768px) {
  .model-selector-label {
    display: none;
  }
}

/* =============================================
   Expert Mode Dropdown
   ============================================= */

.expert-mode-dropdown {
  position: relative;
}

.expert-mode-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: none;
  border: 1px solid var(--sand);
  color: var(--charcoal);
  cursor: pointer;
  padding: var(--space-1) var(--space-3);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  transition: all 0.2s var(--ease-smooth);
  white-space: nowrap;
}

.expert-mode-trigger:hover {
  background: var(--sand-light);
  border-color: var(--coral-light);
}

.expert-mode-icon {
  display: flex;
  align-items: center;
}

.expert-mode-chevron {
  transition: transform 0.2s var(--ease-smooth);
}

.expert-mode-dropdown.open .expert-mode-chevron {
  transform: rotate(180deg);
}

/* --- Menu (opens upward) --- */
.expert-mode-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-3);
  padding: var(--space-1);
  z-index: 60;
  animation: fadeDown 0.15s var(--ease-smooth);
}

.expert-mode-dropdown.open .expert-mode-menu {
  display: block;
}

.expert-mode-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  transition: background 0.15s var(--ease-smooth);
  font-family: var(--font-body);
}

.expert-mode-option:hover {
  background: var(--sand-light);
}

.expert-mode-option.active {
  background: rgba(217, 119, 87, 0.08);
}

.expert-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.expert-icon-general {
  background: rgba(217, 119, 87, 0.12);
  color: var(--coral);
}

.expert-icon-scrum {
  background: rgba(74, 124, 89, 0.12); /* --success at 12% */
  color: var(--success);
}

.expert-icon-pm {
  background: rgba(108, 92, 231, 0.12); /* --accent-purple at 12% */
  color: var(--accent-purple);
}

.expert-option-text {
  display: flex;
  flex-direction: column;
}

.expert-option-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--charcoal);
}

.expert-option-desc {
  font-size: var(--text-xs);
  color: var(--warm-gray);
}

/* Expert mode color indicators on trigger */
.expert-mode-trigger[data-active-mode="scrum-master"] {
  border-color: var(--success);
  color: var(--success);
}

.expert-mode-trigger[data-active-mode="product-manager"] {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

/* =============================================
   Animations
   ============================================= */

@keyframes chatBubbleIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-6px);
  }
}

@keyframes statusPulse {
  /* Colors derived from --success (#4A7C59) */
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(74, 124, 89, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(74, 124, 89, 0);
  }
}

@keyframes contentStagger {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes statusRing {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0;
    transform: scale(1.5);
  }
}

@keyframes statusPulseDisconnected {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(192, 57, 43, 0);
  }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* =============================================
   Accessibility -- Reduced motion
   ============================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .chat-timeline {
    scroll-behavior: auto;
  }
}

/* Focus visible for keyboard users */
:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 2px;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 1024px) {
  .sidebar {
    width: 280px;
  }
  
  .retro-grid {
    gap: var(--space-4);
  }
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-standard);
    width: 280px;
    box-shadow: var(--shadow-3);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .chat-timeline {
    padding: var(--space-4);
  }

  .chat-bubble {
    max-width: 95%;
  }

  .nav-profile-name {
    display: none;
  }

  .nav-profile-dropdown {
    right: -0.5rem;
    max-width: calc(100vw - 1rem);
  }

  .status-pill-label {
    display: none;
  }

  .nav-separator {
    display: none;
  }

  /* Dashboard footer */
  .site-footer {
    left: 0;
  }

  .retro-grid {
    grid-template-columns: 1fr;
  }

  .chat-input-container {
    padding: var(--space-2) var(--space-3) var(--space-3);
  }

  .chat-toolbar-label {
    display: none;
  }

  .expert-mode-label {
    display: none;
  }

  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    top: calc(var(--nav-height) + var(--space-2));
  }

  .toast {
    max-width: 100%;
  }
  
  .btn {
    min-height: 44px;
  }
  
  .sidebar-btn {
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .nav-status-pills {
    gap: 0.3rem;
  }

  /* .status-pill-label already hidden at 768px */

  .tab-nav {
    flex-wrap: wrap;
  }
}

/* =============================================
   Login page styles -- Centered grid layout
   Tokens: --login-* (defined in :root + dark mode)
   ============================================= */

/* --- Page --- */
.login-body {
  overflow: auto;
  height: 100%;
  font-family: var(--font-login);
  background-color: var(--login-bg);
  color: var(--login-text);
}

.login-page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background-color: var(--login-bg);
  background-image:
    radial-gradient(at 10% 10%, hsla(30, 20%, 90%, 1) 0px, transparent 50%),
    radial-gradient(at 90% 10%, hsla(30, 30%, 85%, 0.5) 0px, transparent 50%),
    radial-gradient(at 90% 90%, hsla(30, 20%, 90%, 1) 0px, transparent 50%),
    radial-gradient(at 10% 90%, hsla(30, 30%, 85%, 0.5) 0px, transparent 50%);
}

.login-weave-texture {
  background-image:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 1px, transparent 1px, transparent 10px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 1px, transparent 1px, transparent 10px);
}

.login-motif-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(45deg, #e5e5e5 25%, transparent 25%, transparent 75%, #e5e5e5 75%, #e5e5e5),
    linear-gradient(45deg, #e5e5e5 25%, transparent 25%, transparent 75%, #e5e5e5 75%, #e5e5e5);
  background-position: 0 0, 20px 20px;
  background-size: 40px 40px;
  opacity: 0.15;
}

.login-bottom-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8rem;
  background: linear-gradient(to top, rgba(245, 245, 244, 0.6), transparent);
  pointer-events: none;
  z-index: 0;
}

/* --- Header --- */
.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--space-6);
  position: relative;
  z-index: 10;
}

.login-header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.login-header-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--login-card-bg);
  border: 1px solid var(--login-card-border);
  color: var(--login-primary-dark);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.login-header-icon .material-symbols-outlined {
  font-size: var(--text-3xl);
  position: relative;
  z-index: 10;
}

.login-header-icon-glow {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--login-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px 4px var(--login-glow);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
}

.login-header-title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--login-text);
}

.login-header-help {
  display: none;
  background: none;
  border: none;
  color: var(--login-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-login);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-standard);
}

.login-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.login-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--login-card-border);
  background: var(--login-card-bg);
  color: var(--login-text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
}

.login-theme-toggle:hover {
  color: var(--login-primary-dark);
  border-color: var(--login-primary-dark);
}

.login-theme-toggle .material-symbols-outlined {
  font-size: var(--text-lg);
}

/* Show sun in dark mode, moon in light mode — extra specificity to beat
   the Google Material Symbols stylesheet which sets display on .material-symbols-outlined */
.login-theme-toggle .login-icon-sun { display: none; }
.login-theme-toggle .login-icon-moon { display: block; }

[data-theme="dark"] .login-theme-toggle .login-icon-sun { display: block; }
[data-theme="dark"] .login-theme-toggle .login-icon-moon { display: none; }

.login-header-help:hover {
  color: var(--login-primary-dark);
}

/* --- Main content --- */
.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  position: relative;
  z-index: 10;
}

.login-grid {
  width: 100%;
  max-width: 64rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

/* --- Hero (left column, hidden on mobile) --- */
.login-hero {
  display: none;
  flex-direction: column;
  gap: var(--space-6);
  color: var(--login-text);
  padding-right: var(--space-8);
}

.login-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  align-self: flex-start;
  border-radius: var(--radius-pill);
  background: var(--login-badge-bg);
  border: 1px solid var(--login-badge-border);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--login-badge-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-hero-badge .material-symbols-outlined {
  font-size: var(--text-sm);
}

.login-hero-headline {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--login-text);
}

.login-hero-highlight {
  color: var(--login-primary-dark);
}

.login-hero-description {
  font-size: var(--text-lg);
  color: var(--login-text-muted);
  max-width: 28rem;
  line-height: var(--leading-relaxed);
}

/* Social proof */
.login-social-proof {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.login-avatar-stack {
  display: flex;
}

.login-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--login-bg);
  background: var(--login-input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  color: var(--login-text-muted);
}

.login-avatar + .login-avatar {
  margin-left: -0.75rem;
}

.login-avatar .material-symbols-outlined {
  font-size: var(--text-xl);
}

.login-avatar-count {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--login-bg);
  background: var(--login-input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -0.75rem;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--login-text-muted);
  box-shadow: var(--shadow-1);
}

.login-stars {
  display: flex;
  color: var(--login-star);
  font-size: var(--text-sm);
}

.login-stars .material-symbols-outlined {
  font-size: var(--text-base);
  font-variation-settings: 'FILL' 1;
}

.login-social-label {
  font-size: var(--text-sm);
  color: var(--login-text-muted);
}

/* --- Login card (right column) --- */
.login-card-wrapper {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

.login-card {
  background: var(--login-card-bg);
  border: 1px solid var(--login-card-border);
  border-radius: var(--radius);
  padding: var(--space-8);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.login-card-gradient-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--login-gradient-from), var(--login-gradient-via), var(--login-gradient-to));
}

/* Card icon */
.login-card-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.login-card-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(to bottom right, var(--login-icon-bg-from), var(--login-icon-bg-to));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--login-card-border);
  color: var(--login-primary-dark);
  overflow: hidden;
}

.login-card-icon .material-symbols-outlined {
  font-size: var(--text-4xl);
  position: relative;
  z-index: 10;
}

.login-card-icon-glow {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--login-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px 4px var(--login-glow);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  animation: login-pulse 2s ease-in-out infinite;
}

@keyframes login-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.login-card-title {
  text-align: center;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--login-text);
  margin-bottom: var(--space-2);
}

.login-card-subtitle {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--login-text-muted);
  margin-bottom: var(--space-8);
}

/* Auth buttons area */
.login-auth-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Google button */
.login-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  height: 3rem;
  padding: 0 var(--space-6);
  border-radius: var(--radius-sm);
  border: 1px solid var(--login-input-border);
  background: var(--login-card-bg);
  color: var(--login-text);
  font-family: var(--font-login);
  font-size: var(--text-base);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  box-shadow: var(--shadow-1);
}

.login-google-btn:hover {
  background: var(--login-input-bg);
  color: var(--login-text);
  box-shadow: var(--shadow-2);
}

.login-google-btn:focus-visible {
  outline: 2px solid var(--login-primary);
  outline-offset: 2px;
}

.login-google-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  padding: var(--space-2) 0;
}

.login-divider-line {
  flex: 1;
  height: 1px;
  background: var(--login-divider);
}

.login-divider-text {
  flex-shrink: 0;
  margin: 0 var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--login-text-muted);
}

/* PIN form */
.login-pin-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-pin-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.login-pin-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--login-text);
}

.login-pin-label-hint {
  color: var(--login-text-muted);
  font-weight: 400;
}

.login-pin-input-wrap {
  position: relative;
}

.login-pin-input-icon {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  align-items: center;
  padding-left: var(--space-3);
  pointer-events: none;
  color: var(--login-text-muted);
}

.login-pin-input {
  width: 100%;
  height: 3rem;
  border-radius: var(--radius-sm);
  background: var(--login-input-bg);
  border: 1px solid var(--login-input-border);
  padding: 0 var(--space-4) 0 2.5rem;
  color: var(--login-text);
  font-family: var(--font-login);
  font-size: var(--text-base);
  transition: all var(--duration-fast) var(--ease-standard);
}

.login-pin-input::placeholder {
  color: var(--login-text-muted);
}

/* Wider spacing only for the PIN field */
#guest-pin {
  letter-spacing: 0.08em;
}
#guest-pin::placeholder {
  letter-spacing: 0.08em;
}

.login-pin-input:focus {
  outline: none;
  border-color: var(--login-primary-dark);
  box-shadow: 0 0 0 1px var(--login-primary-dark);
  background: var(--login-card-bg);
}

/* Submit button */
.login-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  height: 3rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(to right, var(--login-primary), var(--login-primary-dark));
  color: var(--login-submit-text);
  font-family: var(--font-login);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-standard);
  box-shadow: 0 4px 12px var(--login-shadow-primary);
}

.login-submit-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px var(--login-shadow-primary-hover);
}

.login-submit-btn:focus-visible {
  outline: 2px solid var(--login-primary-dark);
  outline-offset: 2px;
}

.login-submit-btn .material-symbols-outlined {
  transition: transform var(--duration-fast) var(--ease-standard);
}

.login-submit-btn:hover .material-symbols-outlined {
  transform: translateX(4px);
}

/* Flash messages */
.login-flash {
  background: var(--login-flash-bg);
  border: 1px solid var(--login-flash-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
  color: var(--error);
}

/* Card footer links */
.login-card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-top: var(--space-8);
  font-size: var(--text-xs);
  color: var(--login-text-muted);
}

.login-card-footer a {
  color: var(--login-text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}

.login-card-footer a:hover {
  color: var(--login-primary-dark);
}

.login-card-footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--login-footer-dot);
}

/* --- Page footer --- */
.login-footer {
  position: relative;
  z-index: 10;
  width: 100%;
  text-align: center;
  padding: var(--space-4);
  font-size: var(--text-xs);
  color: var(--login-text-muted);
}

.login-footer-heart {
  color: var(--login-primary-dark);
}

/* --- Screen reader helper --- */
.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;
}

/* --- Login dark mode overrides --- */
[data-theme="dark"] .login-page {
  background-color: var(--login-bg);
  background-image:
    radial-gradient(at 0% 0%, hsla(27, 96%, 43%, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, hsla(242, 48%, 25%, 0.2) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(27, 96%, 43%, 0.15) 0px, transparent 50%),
    radial-gradient(at 0% 100%, hsla(242, 48%, 25%, 0.2) 0px, transparent 50%);
}

[data-theme="dark"] .login-weave-texture {
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 10px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 10px);
}

[data-theme="dark"] .login-motif-overlay {
  display: none;
}

[data-theme="dark"] .login-bottom-gradient {
  background: linear-gradient(to top, rgba(34, 30, 16, 0.8), transparent);
}

[data-theme="dark"] .login-card {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .login-google-btn {
  background: var(--login-card-bg);
  border-color: var(--login-card-border);
  color: var(--login-text);
}

[data-theme="dark"] .login-google-btn:hover {
  background: var(--login-input-bg);
}

[data-theme="dark"] .login-submit-btn {
  color: var(--login-submit-text);
}

[data-theme="dark"] .login-avatar {
  border-color: var(--login-bg);
  background: var(--login-input-bg);
}

[data-theme="dark"] .login-avatar-count {
  border-color: var(--login-bg);
  background: var(--login-input-bg);
}

[data-theme="dark"] .login-footer-heart {
  color: var(--login-primary);
}

/* --- Login modal overrides --- */
.login-modal-card {
  font-family: var(--font-login);
  max-width: 500px;
}

.login-modal-card .modal-header {
  border-bottom-color: var(--login-card-border);
}

.login-modal-card .modal-header h3 {
  font-family: var(--font-login);
  color: var(--login-text);
}

.login-modal-body {
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.login-modal-body h4 {
  font-family: var(--font-login);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--login-text);
  margin: var(--space-4) 0 var(--space-2);
}

.login-modal-body h4:first-child {
  margin-top: 0;
}

.login-modal-body p,
.login-modal-body li {
  font-size: var(--text-sm);
  color: var(--login-text-muted);
  line-height: 1.6;
}

.login-modal-body p {
  margin-bottom: var(--space-3);
}

.login-modal-body ul {
  padding-left: var(--space-6);
  margin-bottom: var(--space-3);
}

.login-modal-body li {
  margin-bottom: var(--space-1);
}

.login-modal-body strong {
  color: var(--login-text);
  font-weight: 600;
}

[data-theme="dark"] .login-modal-card {
  background: var(--login-card-bg);
  border-color: var(--login-card-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="dark"] .login-modal-card .modal-header {
  border-bottom-color: var(--login-card-border);
}

[data-theme="dark"] .login-modal-card .modal-close {
  color: var(--login-text-muted);
}

[data-theme="dark"] .login-modal-card .modal-close:hover {
  color: var(--login-primary);
}

/* --- Login responsive: desktop (2 columns) --- */
@media (min-width: 1024px) {
  .login-header {
    padding: var(--space-6) var(--space-12);
  }

  .login-header-help {
    display: block;
  }

  .login-grid {
    grid-template-columns: 1fr 1fr;
  }

  .login-hero {
    display: flex;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .login-card-icon-glow {
    animation: none;
  }

  .login-submit-btn .material-symbols-outlined {
    transition: none;
  }

  .login-page .modal-overlay {
    animation: none;
  }

  .login-page .login-modal-card {
    animation: none;
  }
}

/* =============================================
   Performance Optimizations
   ============================================= */

/* will-change applied only during active animations via .is-running */
.sidebar-btn.is-running {
  will-change: transform;
}

.chat-timeline {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* =============================================
   Dark Mode
   ============================================= */

[data-theme="dark"] {
  --coral: #E8A088;
  --coral-light: #F0BBA8;
  --coral-deep: #D97757;
  --cream: #1A1A2E;
  --cream-mid: #222240;
  --navy: #FAF3EB;
  --navy-soft: #E6D5C3;
  --navy-muted: #C4B09C;
  --sand: #2A2A42;
  --sand-light: #222240;
  --white: #222240;
  --navy-deeper: #1A1A2E;
  --cream-dark: #E8E0D8;
  --charcoal: #E8E0D8;
  --warm-gray: #A09888;
  --success: #6BAF7C;
  --error: #E06050;
  --warning: #E8C040;
  --accent-purple: #9B8FFF;
  --input-bg: rgba(26, 26, 46, 0.95);

  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-dark-3: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-4: 0 12px 40px rgba(0, 0, 0, 0.35);

  /* Login dark mode overrides */
  --login-primary: #f4c025;
  --login-primary-dark: #d97706;
  --login-bg: #221e10;
  --login-text: #e7e5e4;
  --login-text-muted: #a8a29e;
  --login-card-bg: rgba(24, 22, 17, 0.9);
  --login-card-border: #393528;
  --login-input-bg: #27241b;
  --login-input-border: #544e3b;
  --login-divider: #393528;
  --login-gradient-from: #f4c025;
  --login-gradient-via: #A0522D;
  --login-gradient-to: #1a1a2e;
  --login-badge-bg: rgba(244, 192, 37, 0.2);
  --login-badge-border: transparent;
  --login-badge-text: #f4c025;
  --login-star: #f4c025;
  --login-glow: rgba(244, 192, 37, 0.8);
  --login-icon-bg-from: #27241b;
  --login-icon-bg-to: #1f1c14;
  --login-footer-dot: #544e3b;
  --login-submit-text: #221e10;
  --login-shadow-primary: rgba(244, 192, 37, 0.15);
  --login-shadow-primary-hover: rgba(244, 192, 37, 0.3);
  --login-flash-bg: rgba(192, 57, 43, 0.15);
  --login-flash-border: rgba(192, 57, 43, 0.25);
  --font-login: 'Manrope', system-ui, sans-serif;

  /* A2IC Chat tokens (dark mode) */
  --a2ic-primary: #f4c025;
  --a2ic-primary-dark: #dcb21c;
  --a2ic-primary-glow: rgba(244, 192, 37, 0.2);
  --a2ic-sidebar-bg: #181a18;
  --a2ic-sidebar-border: #2a302a;
  --a2ic-header-bg: rgba(24, 26, 24, 0.8);
  --a2ic-header-border: #2a302a;
  --a2ic-chat-bg: #121412;
  --a2ic-ai-bubble-bg: #1e231e;
  --a2ic-ai-bubble-border: #2a302a;
  --a2ic-ai-bubble-text: #e2e8f0;
  --a2ic-ai-accent: #f4c025;
  --a2ic-user-bubble-bg: #2e4a35;
  --a2ic-user-bubble-border: #40634a;
  --a2ic-user-bubble-text: #ffffff;
  --a2ic-input-bg: #1e231e;
  --a2ic-input-border: #2a302a;
  --a2ic-input-focus: rgba(244, 192, 37, 0.5);
  --a2ic-border: #2a302a;
  --a2ic-text: #e2e8f0;
  --a2ic-text-muted: #a0aec0;
  --a2ic-text-light: #718096;
  --a2ic-surface-hover: #2a302a;
  --a2ic-on-primary: #121412;
  --a2ic-active-item-bg: rgba(46, 74, 53, 0.2);
  --a2ic-active-item-border: rgba(46, 74, 53, 0.3);
  --a2ic-active-item-shadow: none;
  --a2ic-avatar-from: #f4c025;
  --a2ic-avatar-to: #2e4a35;
  --a2ic-action-bg: #2a302a;
  --a2ic-action-border: #2a302a;
  --a2ic-action-text: #a0aec0;
  --a2ic-pill-bg: #2a302a;
  --a2ic-pill-border: #2a302a;
  --a2ic-pill-text: #a0aec0;
  --a2ic-pill-hover-bg: rgba(244, 192, 37, 0.2);
  --a2ic-pill-hover-text: #f4c025;
  --a2ic-beta-bg: rgba(244, 192, 37, 0.2);
  --a2ic-beta-text: #f4c025;
  --a2ic-beta-border: rgba(244, 192, 37, 0.2);
  --a2ic-mode-bg: #2a302a;
  --a2ic-mode-border: #2a302a;
  --a2ic-mode-active-bg: #2e4a35;
  --a2ic-mode-active-text: #ffffff;
  --a2ic-mode-inactive-text: #a0aec0;
  --a2ic-scrollbar-track: #121412;
  --a2ic-scrollbar-thumb: #2a302a;
  --a2ic-scrollbar-thumb-hover: #40634a;
  --a2ic-gradient-fade-from: rgba(18, 20, 18, 1);
  --a2ic-gradient-fade-to: transparent;
  --pattern-mudcloth: none;
  --pattern-kente: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f4c025' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

[data-theme="dark"] body {
  background: var(--cream);
  color: var(--cream-dark);
}

[data-theme="dark"] body::before {
  opacity: 0.015;
}

[data-theme="dark"] .nav {
  background: rgba(26, 26, 46, 0.95);
  border-bottom-color: var(--sand);
}

[data-theme="dark"] .nav-brand {
  color: #FAF3EB;
}

[data-theme="dark"] .nav-guest-badge {
  color: var(--coral-light);
  background: linear-gradient(135deg, rgba(232, 160, 136, 0.15), rgba(232, 160, 136, 0.06));
  border-color: rgba(232, 160, 136, 0.25);
}

[data-theme="dark"] .nav-profile-trigger:hover,
[data-theme="dark"] .nav-profile.open .nav-profile-trigger {
  background: var(--sand);
  border-color: #3D3D5C;
}

[data-theme="dark"] .nav-profile-name {
  color: var(--cream-dark);
}

[data-theme="dark"] .nav-profile-dropdown {
  background: var(--navy-deeper);
  border-color: var(--sand);
  box-shadow: var(--shadow-dark-3);
}

[data-theme="dark"] .dropdown-user-name {
  color: var(--cream-dark);
}

[data-theme="dark"] .dropdown-user-email {
  color: var(--warm-gray);
}

[data-theme="dark"] .dropdown-divider {
  background: var(--sand);
}

[data-theme="dark"] .dropdown-item {
  color: var(--cream-dark);
}

[data-theme="dark"] .dropdown-item:hover {
  background: var(--sand);
}

[data-theme="dark"] .dropdown-item-logout:hover {
  color: var(--coral-light);
}

[data-theme="dark"] .nav-profile-chevron {
  color: var(--warm-gray);
}

[data-theme="dark"] .status-pill {
  background: var(--cream-mid);
  border-color: var(--sand);
}

[data-theme="dark"] .nav-separator {
  background: var(--sand);
}

[data-theme="dark"] .nav-action-btn {
  color: var(--warm-gray);
}

[data-theme="dark"] .nav-action-btn:hover {
  background: var(--sand);
  color: var(--coral-light);
}

/* --- Site Footer --- */
.site-footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  padding: var(--space-2) var(--space-6);
  border-top: 1px solid var(--sand);
  background: rgba(250, 243, 235, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  text-align: center;
  z-index: 10;
}

.footer-inner {
  max-width: 100%;
}

.footer-copyright {
  font-size: var(--text-xs);
  color: var(--warm-gray);
}

[data-theme="dark"] .site-footer {
  border-top-color: var(--sand);
  background: rgba(26, 26, 46, 0.95);
}

[data-theme="dark"] .footer-copyright {
  color: var(--warm-gray);
}

[data-theme="dark"] .sidebar {
  background: linear-gradient(to bottom, #1E1E34 0%, #16162A 100%);
  border-right-color: var(--sand);
}

[data-theme="dark"] .chat-main {
  background: var(--cream);
}

[data-theme="dark"] .chat-message-ai .chat-bubble {
  background: linear-gradient(135deg, var(--cream-mid) 0%, var(--sand) 50%, #33335A 100%);
  border: none;
}

[data-theme="dark"] .chat-message-ai .md-content,
[data-theme="dark"] .chat-message-ai .chat-bubble-content p,
[data-theme="dark"] .chat-message-ai .md-content p,
[data-theme="dark"] .chat-message-ai .md-content li {
  color: #E8E0D8;
}

[data-theme="dark"] .chat-message-ai .chat-bubble-content h3,
[data-theme="dark"] .chat-message-ai .md-content h1,
[data-theme="dark"] .chat-message-ai .md-content h2,
[data-theme="dark"] .chat-message-ai .md-content h3,
[data-theme="dark"] .chat-message-ai .md-content h4,
[data-theme="dark"] .chat-message-ai .md-content strong {
  color: #E8E0D8;
}

[data-theme="dark"] .chat-message-user .chat-bubble {
  background: #3D3D5C;
}

[data-theme="dark"] .chat-input-container > .chat-input-textarea-wrap {
  border-color: var(--sand);
}

[data-theme="dark"] .chat-toolbar {
  border-color: var(--sand);
  border-top-color: var(--sand);
}

[data-theme="dark"] .chat-input-container:focus-within > .chat-input-textarea-wrap {
  border-color: var(--coral-deep);
}

[data-theme="dark"] .chat-input-container:focus-within {
  filter: drop-shadow(0 0 8px rgba(185, 90, 58, 0.15));
}

[data-theme="dark"] .chat-input-container:focus-within .chat-toolbar {
  border-color: var(--coral-deep);
  border-top-color: var(--sand);
}

[data-theme="dark"] .chat-input {
  color: #E8E0D8;
}

[data-theme="dark"] .chat-send-btn {
  background: var(--coral-deep);
}

[data-theme="dark"] .chat-send-btn:disabled {
  background: var(--sand);
}

[data-theme="dark"] .expert-mode-trigger {
  border-color: var(--sand);
  color: #E8E0D8;
}

[data-theme="dark"] .expert-mode-trigger:hover {
  background: var(--sand);
}

[data-theme="dark"] .expert-mode-menu {
  background: var(--cream-mid);
  border-color: var(--sand);
}

[data-theme="dark"] .expert-mode-option:hover {
  background: var(--sand);
}

[data-theme="dark"] .expert-option-name {
  color: #E8E0D8;
}

[data-theme="dark"] .chat-toolbar-btn {
  color: var(--warm-gray);
}

[data-theme="dark"] .chat-toolbar-btn:hover {
  background: var(--sand);
  color: #E8E0D8;
}

[data-theme="dark"] .toast {
  background: var(--cream-mid);
  border-color: var(--sand);
  color: #E8E0D8;
}

[data-theme="dark"] .persona-card,
[data-theme="dark"] .story-card,
[data-theme="dark"] .review-panel,
[data-theme="dark"] .retro-section {
  background: var(--cream-mid);
  border-color: var(--sand);
}

[data-theme="dark"] .rice-table th {
  background: var(--cream-mid);
  border-bottom-color: var(--sand);
}

[data-theme="dark"] .rice-table td {
  border-bottom-color: var(--sand);
}

[data-theme="dark"] .rice-table tbody tr:nth-child(even) {
  background: rgba(42, 42, 66, 0.3);
}

[data-theme="dark"] .rice-table tbody tr:hover {
  background: var(--sand);
}

[data-theme="dark"] .sidebar-footer {
  background: rgba(22, 22, 42, 0.5);
  border-top-color: var(--sand);
}

[data-theme="dark"] .sidebar-header {
  border-bottom-color: var(--sand);
}

[data-theme="dark"] .sidebar-btn:hover {
  background: var(--sand);
}

[data-theme="dark"] .btn-outline {
  color: #E8E0D8;
  border-color: var(--sand);
}

[data-theme="dark"] .btn-outline:hover:not(:disabled) {
  border-color: var(--coral-deep);
  background: var(--sand);
  color: var(--coral-light);
}

[data-theme="dark"] .tab-nav {
  border-bottom-color: var(--sand);
}

[data-theme="dark"] .modal-card {
  background: var(--cream-mid);
  border-color: var(--sand);
}

[data-theme="dark"] .modal-input {
  background: var(--cream);
  border-color: var(--sand);
  color: #E8E0D8;
}

/* =============================================
   Markdown Content (.md-content)
   ============================================= */

.md-content {
  font-size: var(--text-sm);
  color: var(--charcoal);
  line-height: var(--leading-relaxed);
}

.md-content h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--navy);
  margin: var(--space-4) 0 var(--space-2);
  line-height: var(--leading-tight);
}

.md-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--navy);
  margin: var(--space-4) 0 var(--space-2);
  line-height: var(--leading-tight);
}

.md-content h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
  margin: var(--space-3) 0 var(--space-1);
}

.md-content h4, .md-content h5, .md-content h6 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--navy);
  margin: var(--space-3) 0 var(--space-1);
}

.md-content p {
  margin-bottom: var(--space-3);
  line-height: var(--leading-relaxed);
}

.md-content ul, .md-content ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-3);
}

.md-content li {
  margin-bottom: var(--space-1);
}

.md-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--sand-light);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--sand);
}

.md-content pre {
  background: var(--navy);
  color: var(--cream);
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: var(--space-4);
  font-size: var(--text-xs);
  line-height: 1.6;
}

.md-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.md-content blockquote {
  border-left: 3px solid var(--coral);
  padding: var(--space-2) var(--space-4);
  margin: var(--space-3) 0;
  background: rgba(217, 119, 87, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--warm-gray);
  font-style: italic;
}

.md-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.md-content table th {
  font-weight: 600;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 2px solid var(--sand);
  color: var(--warm-gray);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.md-content table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--sand-light);
}

.md-content hr {
  border: none;
  border-top: 1px solid var(--sand);
  margin: var(--space-6) 0;
}

.md-content a {
  color: var(--coral);
  text-decoration: underline;
}

.md-content strong {
  font-weight: 600;
  color: var(--navy);
}

[data-theme="dark"] .md-content code {
  background: var(--cream);
  border-color: var(--sand);
}

[data-theme="dark"] .md-content pre {
  background: #16162A;
}

/* =============================================
   Export Buttons
   ============================================= */

.btn-export {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--warm-gray);
  background: none;
  border: 1px solid var(--sand);
  border-radius: var(--radius-xs);
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}

.btn-export:hover {
  border-color: var(--coral-light);
  color: var(--coral-deep);
}

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

/* =============================================
   Clear Chat Button
   ============================================= */

#btn-clear-chat:hover {
  color: var(--error);
  background: rgba(192, 57, 43, 0.08);
}

/* =============================================
   Streaming Cursor
   ============================================= */

.streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--coral);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: cursorBlink 0.8s ease infinite;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.chat-message-streaming .chat-bubble {
  animation: borderPulse 2s ease infinite;
  border: 1px solid;
}

.chat-message-streaming .chat-bubble::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(232, 160, 136, 0.08) 25%, rgba(232, 160, 136, 0.15) 50%, rgba(232, 160, 136, 0.08) 75%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmerGlow 2s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.chat-message-streaming .chat-bubble-content,
.chat-message-streaming .typing-indicator {
  position: relative;
  z-index: 2;
}

@keyframes shimmerGlow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes borderPulse {
  0%, 100% {
    border-color: rgba(230, 213, 195, 0.3);
    box-shadow: 0 0 8px rgba(232, 160, 136, 0);
  }
  50% {
    border-color: rgba(232, 160, 136, 0.5);
    box-shadow: 0 0 16px rgba(232, 160, 136, 0.12);
  }
}

[data-theme="dark"] .chat-message-streaming .chat-bubble::after {
  opacity: 0.6;
}

/* =============================================
   Parameter Modal
   ============================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 26, 46, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  box-shadow: var(--shadow-4);
  width: 100%;
  max-width: 440px;
  margin: var(--space-4);
  animation: chatBubbleIn 0.3s var(--ease-bouncy);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--sand-light);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--navy);
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--text-2xl);
  color: var(--warm-gray);
  cursor: pointer;
  padding: 0 var(--space-1);
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--error);
}

.modal-body {
  padding: var(--space-6);
}

.modal-field {
  margin-bottom: var(--space-4);
}

.modal-field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warm-gray);
  margin-bottom: var(--space-2);
}

.modal-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--sand);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--charcoal);
  transition: border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
  outline: none;
}

.modal-input:focus {
  border-color: var(--coral-light);
  box-shadow: 0 0 0 4px rgba(217, 119, 87, 0.1);
}

.modal-footer {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--sand-light);
}

/* --- Jira Status Display --- */
.jira-status {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--sand);
  font-size: 0.85rem;
}

.jira-keys {
  color: var(--success);
  margin-bottom: 0.25rem;
}

.jira-key {
  display: inline-block;
  background: rgba(74, 124, 89, 0.12);
  color: var(--success);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

.jira-errors {
  color: var(--error);
}

.jira-error {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

[data-theme="dark"] .jira-status {
  border-top-color: var(--navy-muted);
}

[data-theme="dark"] .jira-key {
  background: rgba(74, 124, 89, 0.25);
}

/* --- Tool Action Badges (chat tool use) --- */
/* Badges render inside .chat-bubble (navy-gradient background), so colors
   must be light enough for WCAG AA contrast against dark surfaces. */
.tool-actions-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

.tool-action {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: var(--leading-normal);
  border-left: 3px solid transparent;
  transition: opacity var(--duration-fast) var(--ease-smooth);
}

.tool-action .material-symbols-outlined {
  font-size: 1rem;
  flex-shrink: 0;
}

.tool-action-success {
  background: rgba(74, 124, 89, 0.18);
  border-left-color: #7dcea0;
  color: #a8e6c3;
}

.tool-action-error {
  background: rgba(192, 57, 43, 0.18);
  border-left-color: #e57373;
  color: #f5a8a8;
}

.tool-action-info {
  background: rgba(108, 92, 231, 0.18);
  border-left-color: #a29bfe;
  color: #c8c3fe;
}

/* Light-theme standalone context (outside dark bubble) */
[data-theme="light"] .tool-actions-standalone .tool-action-success {
  background: rgba(74, 124, 89, 0.1);
  border-left-color: var(--success);
  color: var(--success);
}
[data-theme="light"] .tool-actions-standalone .tool-action-error {
  background: rgba(192, 57, 43, 0.1);
  border-left-color: var(--error);
  color: var(--error);
}
[data-theme="light"] .tool-actions-standalone .tool-action-info {
  background: rgba(108, 92, 231, 0.1);
  border-left-color: var(--accent-purple);
  color: var(--accent-purple);
}

/* =============================================
   Deprecated v0.3.0 classes (commented out)
   Keep for reference, not loaded.

   .hero, .hero-compact, .hero-content, .hero-badge, .hero-tagline
   .workflow-grid, .workflow-card, .workflow-number, .workflow-actions
   .loading-overlay, .loading-content, .loading-spinner, .loading-text, .loading-timer
   .result-section, .result-container, .result-header, .result-title
   .result-timestamp, .result-header-actions, .result-body
   .json-viewer, .footer, .footer-inner, .footer-brand, .footer-links
   .toggle-switch, .toggle-slider, .toggle-label, .toggle-placeholder, .btn-run
   ============================================= */

/* =============================================
   A2IC Chat Redesign Components
   v1.0.0 -- Following design/dark-chat.html + design/light-chat.html
   ============================================= */

/* --- Layout --- */
.a2ic-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  font-family: var(--a2ic-font);
}

/* --- Sidebar --- */
.a2ic-sidebar {
  width: var(--a2ic-sidebar-width);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--a2ic-sidebar-bg);
  border-right: 1px solid var(--a2ic-sidebar-border);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-standard);
}

.a2ic-sidebar-pattern {
  position: absolute;
  inset: 0;
  background-image: var(--pattern-mudcloth);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

[data-theme="dark"] .a2ic-sidebar-pattern {
  background-image: var(--pattern-kente);
  opacity: 1;
}

.a2ic-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.5rem 0;
  position: relative;
  z-index: 10;
}

.a2ic-brand-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--a2ic-avatar-gradient);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--a2ic-primary-glow);
  flex-shrink: 0;
}

.a2ic-brand-icon .material-symbols-outlined {
  font-size: 1.5rem;
  color: var(--a2ic-on-primary);
}

.a2ic-brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--a2ic-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.a2ic-brand-subtitle {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--a2ic-primary-dark);
  opacity: 0.8;
}

/* --- New Chat Button --- */
.a2ic-sidebar-actions {
  padding: 1.5rem;
  position: relative;
  z-index: 10;
}

.a2ic-new-chat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--a2ic-primary);
  color: var(--a2ic-on-primary);
  border: none;
  border-radius: 0.75rem;
  font-family: var(--a2ic-font);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  box-shadow: 0 4px 12px var(--a2ic-primary-glow);
}

.a2ic-new-chat-btn:hover {
  background: var(--a2ic-primary-dark);
  box-shadow: 0 6px 20px var(--a2ic-primary-glow);
}

.a2ic-new-chat-btn .material-symbols-outlined {
  font-size: 1.125rem;
  transition: transform 0.2s var(--ease-smooth);
}

.a2ic-new-chat-btn:hover .material-symbols-outlined {
  transform: rotate(90deg);
}

/* --- Chat History --- */
.a2ic-chat-history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 1rem;
  position: relative;
  z-index: 10;
}

.a2ic-chat-history .a2ic-history-list {
  padding: 0;
}

.a2ic-history-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--a2ic-text-light);
  padding: 0 0.5rem;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.a2ic-history-group-title:first-child {
  margin-top: 0.5rem;
}

@keyframes a2ic-fade-in-up {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.a2ic-history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--a2ic-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.15s var(--ease-smooth);
  text-decoration: none;
  border: 1px solid transparent;
  animation: a2ic-fade-in-up 0.2s var(--ease-smooth) both;
}

.a2ic-history-item:hover {
  background: var(--a2ic-surface-hover);
  color: var(--a2ic-text);
}

.a2ic-history-item.active {
  background: var(--a2ic-active-item-bg);
  border-color: var(--a2ic-active-item-border);
  color: var(--a2ic-text);
  box-shadow: var(--a2ic-active-item-shadow);
}

.a2ic-history-item .material-symbols-outlined {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.a2ic-history-item.active .material-symbols-outlined {
  color: var(--a2ic-primary);
}

.a2ic-history-item-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Workflows Drawer --- */
.a2ic-workflows-drawer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  height: calc(100% - 64px);
  background: var(--a2ic-sidebar-bg);
  z-index: 15;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--a2ic-sidebar-border);
}

.a2ic-workflows-drawer[hidden] {
  display: none;
}

.a2ic-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--a2ic-border);
}

.a2ic-drawer-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--a2ic-text-muted);
}

.a2ic-drawer-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--a2ic-text-muted);
  cursor: pointer;
  border-radius: 0.375rem;
  transition: all 0.15s var(--ease-smooth);
}

.a2ic-drawer-close:hover {
  background: var(--a2ic-surface-hover);
  color: var(--a2ic-text);
}

.a2ic-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.a2ic-drawer-footer {
  padding: 1rem;
  border-top: 1px solid var(--a2ic-border);
}

/* --- User Profile in Sidebar --- */
.a2ic-sidebar-profile {
  padding: 1rem;
  border-top: 1px solid var(--a2ic-sidebar-border);
  position: relative;
  z-index: 20;
  background: var(--a2ic-sidebar-bg);
  flex-shrink: 0;
}

.a2ic-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background 0.15s var(--ease-smooth);
  font-family: var(--a2ic-font);
  text-align: left;
}

.a2ic-profile-btn:hover {
  background: var(--a2ic-surface-hover);
}

.a2ic-profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.a2ic-profile-photo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  transition: border-color 0.15s var(--ease-smooth);
}

.a2ic-profile-btn:hover .a2ic-profile-photo {
  border-color: var(--a2ic-primary);
}

.a2ic-profile-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--a2ic-avatar-gradient);
  color: var(--a2ic-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.a2ic-profile-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--success);
  border: 2px solid var(--a2ic-sidebar-bg);
  border-radius: 50%;
}

.a2ic-profile-info {
  flex: 1;
  min-width: 0;
}

.a2ic-profile-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--a2ic-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.a2ic-profile-role {
  display: block;
  font-size: 0.75rem;
  color: var(--a2ic-text-muted);
}

.a2ic-profile-settings {
  color: var(--a2ic-text-light);
  font-size: 1.25rem;
  transition: color 0.15s var(--ease-smooth);
}

.a2ic-profile-btn:hover .a2ic-profile-settings {
  color: var(--a2ic-primary);
}

.a2ic-profile-guest {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  text-decoration: none;
  color: inherit;
}

/* Profile dropdown */
.a2ic-profile-dropdown {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 1rem;
  right: 1rem;
  background: var(--a2ic-input-bg);
  border: 1px solid var(--a2ic-border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-3);
  padding: 0.5rem;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.15s var(--ease-smooth),
              transform 0.15s var(--ease-smooth),
              visibility 0.15s;
}

.a2ic-sidebar-profile.open .a2ic-profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --- Header --- */
.a2ic-header {
  height: var(--a2ic-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--a2ic-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--a2ic-header-border);
  box-shadow: var(--shadow-1);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
}

[data-theme="dark"] .a2ic-header {
  box-shadow: none;
}

.a2ic-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.a2ic-mobile-menu {
  display: none;
  border: none;
  background: none;
  color: var(--a2ic-text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.a2ic-mobile-menu:hover {
  color: var(--a2ic-text);
}

.a2ic-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.a2ic-header-icon {
  color: var(--a2ic-primary);
  font-size: 1.5rem;
}

.a2ic-header-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--a2ic-text);
  letter-spacing: -0.01em;
}

.a2ic-beta-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--a2ic-beta-bg);
  color: var(--a2ic-beta-text);
  border: 1px solid var(--a2ic-beta-border);
  border-radius: 0.25rem;
  margin-left: 0.5rem;
}

.a2ic-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* --- Mode Selector (segmented control) --- */
.a2ic-mode-selector {
  display: flex;
  align-items: center;
  background: var(--a2ic-mode-bg);
  border: 1px solid var(--a2ic-mode-border);
  border-radius: 0.5rem;
  padding: 0.25rem;
}

.a2ic-mode-btn {
  padding: 0.375rem 0.75rem;
  border: none;
  background: none;
  border-radius: 0.375rem;
  font-family: var(--a2ic-font);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--a2ic-mode-inactive-text);
  cursor: pointer;
  transition: all 0.15s var(--ease-smooth);
  white-space: nowrap;
}

.a2ic-mode-btn:hover {
  color: var(--a2ic-text);
}

.a2ic-mode-btn.active {
  background: var(--a2ic-mode-active-bg);
  color: var(--a2ic-mode-active-text);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(64, 99, 74, 0.3);
}

/* --- Model Trigger (header variant) --- */
.a2ic-model-trigger {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: var(--a2ic-mode-bg);
  border: 1px solid var(--a2ic-mode-border);
  border-radius: 0.5rem;
  font-family: var(--a2ic-font);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--a2ic-text);
  cursor: pointer;
  transition: all 0.15s var(--ease-smooth);
}

.a2ic-model-trigger:hover {
  background: var(--a2ic-surface-hover);
  border-color: var(--a2ic-primary);
}

.a2ic-model-chevron {
  font-size: 1rem;
  color: var(--a2ic-text-muted);
  transition: transform 0.2s var(--ease-smooth);
}

.model-selector-dropdown.open .a2ic-model-chevron {
  transform: rotate(180deg);
}

/* Model dropdown position override for header */
.a2ic-header .model-selector-menu {
  top: calc(100% + 6px);
  bottom: auto;
}

/* --- Dark Mode Toggle (header) --- */
.a2ic-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--a2ic-border);
  background: var(--a2ic-mode-bg);
  border-radius: 0.5rem;
  color: var(--a2ic-text-muted);
  cursor: pointer;
  transition: all 0.15s var(--ease-smooth);
}

.a2ic-theme-toggle:hover {
  color: var(--a2ic-primary);
  border-color: var(--a2ic-primary);
}

.a2ic-theme-toggle .material-symbols-outlined {
  font-size: 1.125rem;
}

/* Show sun icon in dark, moon in light */
.a2ic-icon-dark { display: none; }
.a2ic-icon-light { display: flex; }
[data-theme="dark"] .a2ic-icon-dark { display: flex; }
[data-theme="dark"] .a2ic-icon-light { display: none; }

/* --- Chat Area --- */
.a2ic-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--a2ic-chat-bg);
  position: relative;
}

.a2ic-chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  scroll-behavior: smooth;
  max-width: 48rem;
  width: 100%;
  margin: 0 auto;
}

/* --- Message layout (avatar + body) --- */
.a2ic-msg-avatar {
  flex-shrink: 0;
}

.a2ic-ai-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--a2ic-avatar-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--a2ic-primary-glow);
}

.a2ic-ai-avatar .material-symbols-outlined {
  font-size: 1.25rem;
  color: var(--a2ic-on-primary);
}

.a2ic-user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--a2ic-border);
  flex-shrink: 0;
}

.a2ic-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.a2ic-msg-body {
  flex: 1;
  min-width: 0;
}

.a2ic-msg-meta {
  font-size: 0.75rem;
  color: var(--a2ic-text-light);
  font-weight: 500;
  margin-bottom: 0.25rem;
  padding-left: 0.25rem;
}

.a2ic-msg-meta-user {
  text-align: right;
}

/* --- AI Messages (new style) --- */
.a2ic-chat-area .chat-message {
  display: flex;
  gap: 1rem;
  animation: chatBubbleIn 0.4s var(--ease-bouncy) both;
}

.a2ic-chat-area .chat-message-ai {
  justify-content: flex-start;
}

.a2ic-chat-area .chat-message-user {
  flex-direction: row-reverse;
}

/* AI bubble override for new design */
.a2ic-chat-area .chat-message-ai .chat-bubble {
  background: var(--a2ic-ai-bubble-bg);
  border: 1.5px solid var(--a2ic-ai-bubble-border);
  color: var(--a2ic-ai-bubble-text);
  padding: 1.25rem;
  border-radius: 0 1rem 1rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  max-width: 85%;
  position: relative;
  overflow: visible;
}

.a2ic-chat-area .chat-message-ai .chat-bubble::before {
  display: none;
}

/*
 * AI bubble text color overrides — 4-level selectors
 * (.a2ic-chat-area .chat-message-ai .md-content p) are needed to
 * beat the base .md-content styles without resorting to !important.
 */
.a2ic-chat-area .chat-message-ai .chat-bubble-content h3 {
  color: var(--a2ic-ai-accent);
  font-family: var(--a2ic-font);
}

.a2ic-chat-area .chat-message-ai .chat-bubble-content p,
.a2ic-chat-area .chat-message-ai .md-content,
.a2ic-chat-area .chat-message-ai .md-content p,
.a2ic-chat-area .chat-message-ai .md-content li {
  color: var(--a2ic-ai-bubble-text);
}

.a2ic-chat-area .chat-message-ai .md-content h1,
.a2ic-chat-area .chat-message-ai .md-content h2,
.a2ic-chat-area .chat-message-ai .md-content h3,
.a2ic-chat-area .chat-message-ai .md-content h4,
.a2ic-chat-area .chat-message-ai .md-content strong {
  color: var(--a2ic-text);
}

.a2ic-chat-area .chat-message-ai .md-content code {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--a2ic-ai-accent);
}

[data-theme="dark"] .a2ic-chat-area .chat-message-ai .md-content code {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--a2ic-primary);
}

.a2ic-chat-area .chat-message-ai .md-content pre {
  background: rgba(0, 0, 0, 0.06);
  color: var(--a2ic-text);
}

[data-theme="dark"] .a2ic-chat-area .chat-message-ai .md-content pre {
  background: rgba(0, 0, 0, 0.3);
  color: var(--a2ic-text);
}

.a2ic-chat-area .chat-message-ai .md-content a {
  color: var(--a2ic-primary-dark);
}

.a2ic-chat-area .chat-message-ai .md-content blockquote {
  border-left: 3px solid var(--a2ic-primary);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--a2ic-border);
  border-left: 3px solid var(--a2ic-primary);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  color: var(--a2ic-text-muted);
  font-style: italic;
}

[data-theme="dark"] .a2ic-chat-area .chat-message-ai .md-content blockquote {
  background: transparent;
  border: none;
  border-top: 1px solid var(--a2ic-border);
  border-radius: 0;
  padding-top: var(--space-3);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-style: italic;
}

.a2ic-chat-area .chat-message-ai .md-content table th {
  color: var(--a2ic-text-muted);
  border-bottom-color: var(--a2ic-border);
}

.a2ic-chat-area .chat-message-ai .md-content table td {
  border-bottom-color: var(--a2ic-border);
  color: var(--a2ic-ai-bubble-text);
}

.a2ic-chat-area .chat-message-ai .md-content hr {
  border-top-color: var(--a2ic-border);
}

/* AI bubble meta override */
.a2ic-chat-area .chat-message-ai .chat-bubble-meta {
  border-top-color: var(--a2ic-ai-bubble-border);
}

.a2ic-chat-area .chat-message-ai .timing-badge {
  color: var(--a2ic-text-muted);
}

.a2ic-chat-area .chat-message-ai .btn-copy,
.a2ic-chat-area .chat-message-ai .btn-export {
  color: var(--a2ic-action-text);
  border-color: var(--a2ic-action-border);
  background: var(--a2ic-action-bg);
}

.a2ic-chat-area .chat-message-ai .btn-copy:hover,
.a2ic-chat-area .chat-message-ai .btn-export:hover {
  color: var(--a2ic-primary-dark);
  border-color: var(--a2ic-primary-dark);
}

/* User bubble override */
.a2ic-chat-area .chat-message-user .chat-bubble {
  background: var(--a2ic-user-bubble-bg);
  border: 1.5px solid var(--a2ic-user-bubble-border);
  color: var(--a2ic-user-bubble-text);
  padding: 1rem 1.25rem;
  border-radius: 1rem 0 1rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  max-width: 85%;
}

.a2ic-chat-area .chat-message-user .chat-bubble p {
  color: var(--a2ic-user-bubble-text);
  font-weight: 500;
}

/* Dark mode bubble overrides — design references: dark-chat.html */
[data-theme="dark"] .a2ic-chat-area .chat-message-ai .chat-bubble {
  background: var(--a2ic-ai-bubble-bg);
  border: none;
  border-left: 3px solid var(--a2ic-primary);
  color: var(--a2ic-ai-bubble-text);
}
[data-theme="dark"] .a2ic-chat-area .chat-message-user .chat-bubble {
  background: var(--a2ic-user-bubble-bg);
  border: 1px solid var(--a2ic-user-bubble-border);
  color: var(--a2ic-user-bubble-text);
}

/* Welcome message override */
.a2ic-chat-area .chat-welcome .chat-bubble {
  background: var(--a2ic-ai-bubble-bg);
  border: 1px solid var(--a2ic-ai-bubble-border);
  border-left: 4px solid var(--a2ic-primary);
  color: var(--a2ic-ai-bubble-text);
  max-width: 100%;
  overflow: visible;
}

.a2ic-chat-area .chat-welcome .chat-bubble::before {
  display: none;
}

.a2ic-chat-area .chat-welcome .chat-bubble h3 {
  color: var(--a2ic-text);
  font-family: var(--a2ic-font);
  font-size: 1.25rem;
  font-weight: 700;
}

.a2ic-chat-area .chat-welcome .chat-bubble p {
  color: var(--a2ic-ai-bubble-text);
  font-size: 0.875rem;
}

.a2ic-chat-area .chat-welcome .chat-welcome-hint {
  color: var(--a2ic-text-light) !important;
}

/* Error message in new layout */
.a2ic-chat-area .chat-message-error .chat-bubble {
  background: var(--a2ic-input-bg);
  border: 2px solid rgba(192, 57, 43, 0.3);
  border-left: 4px solid var(--error);
}

/* --- Message Actions (Copy / Thumbs / Regenerate) --- */
.a2ic-message-actions {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.a2ic-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--a2ic-action-border);
  background: var(--a2ic-action-bg);
  color: var(--a2ic-action-text);
  border-radius: 0.5rem;
  font-family: var(--a2ic-font);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease-smooth);
}

.a2ic-action-btn:hover {
  background: var(--a2ic-surface-hover);
  color: var(--a2ic-text);
  border-color: var(--a2ic-text-light);
}

.a2ic-action-btn .material-symbols-outlined {
  font-size: 0.875rem;
}

.a2ic-thumbs-btn.active {
  color: var(--a2ic-primary);
  border-color: var(--a2ic-primary);
}

.a2ic-capacity-warning {
  color: var(--a2ic-text-muted);
  font-size: 0.85rem;
}

/* --- Input Area --- */
.a2ic-input-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 1rem 1rem 1.5rem;
  background: linear-gradient(to top, var(--a2ic-gradient-fade-from) 60%, var(--a2ic-gradient-fade-to));
}

.a2ic-input-inner {
  max-width: 48rem;
  margin: 0 auto;
}

/* --- Suggestion Pills --- */
.a2ic-suggestions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.a2ic-suggestions::-webkit-scrollbar {
  display: none;
}

.a2ic-suggestion-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
  padding: 0.375rem 0.75rem;
  border-radius: 100px;
  background: var(--a2ic-pill-bg);
  border: 1px solid var(--a2ic-pill-border);
  color: var(--a2ic-pill-text);
  font-family: var(--a2ic-font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.a2ic-suggestion-pill:hover {
  background: var(--a2ic-pill-hover-bg);
  color: var(--a2ic-pill-hover-text);
  border-color: var(--a2ic-ai-bubble-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* --- Input Box --- */
.a2ic-input-box {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--a2ic-input-bg);
  border: 1px solid var(--a2ic-input-border);
  border-radius: 0.75rem;
  padding: 0.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  transition: border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.a2ic-input-box:focus-within {
  border-color: var(--a2ic-primary);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 0 0 3px var(--a2ic-input-focus);
}

.a2ic-input-attach {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: none;
  color: var(--a2ic-text-muted);
  cursor: pointer;
  border-radius: 0.5rem;
  transition: all 0.15s var(--ease-smooth);
  flex-shrink: 0;
  margin-bottom: 0.125rem;
}

.a2ic-input-attach:hover {
  color: var(--a2ic-text);
  background: var(--a2ic-surface-hover);
}

.a2ic-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: var(--a2ic-font);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--a2ic-text);
  padding: 0.625rem 0;
  max-height: 8rem;
  min-height: 2.75rem;
}

.a2ic-textarea::placeholder {
  color: var(--a2ic-text-light);
}

.a2ic-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: var(--a2ic-primary);
  color: var(--a2ic-on-primary);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s var(--ease-smooth);
  flex-shrink: 0;
  margin-bottom: 0.125rem;
  box-shadow: 0 2px 8px var(--a2ic-primary-glow);
}

.a2ic-send-btn:disabled {
  background: var(--a2ic-border);
  color: var(--a2ic-text-light);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

.a2ic-send-btn:not(:disabled):hover {
  background: var(--a2ic-primary-dark);
  box-shadow: 0 4px 12px var(--a2ic-primary-glow);
}

.a2ic-send-btn .material-symbols-outlined {
  font-size: 1.125rem;
}

/* --- Disclaimer --- */
.a2ic-disclaimer {
  text-align: center;
  font-size: 0.625rem;
  color: var(--a2ic-text-light);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* =============================================
   A2IC Responsive
   ============================================= */

@media (max-width: 768px) {
  .a2ic-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    box-shadow: var(--shadow-3);
  }

  .a2ic-sidebar.open {
    transform: translateX(0);
  }

  .a2ic-mobile-menu {
    display: flex;
  }

  .a2ic-mode-selector {
    display: none;
  }

  .a2ic-chat-area {
    padding: 1rem 0.75rem 6rem;
  }

  .a2ic-input-area {
    padding: 0.5rem 0.75rem 1rem;
  }

  .a2ic-suggestions {
    gap: 0.375rem;
  }
}

@media (max-width: 480px) {
  .a2ic-header-name {
    font-size: 0.875rem;
  }

  .model-selector-label {
    display: none;
  }
}

/* =============================================
   A2IC -- Override body styles for new layout
   ============================================= */

/* When using the A2IC layout, override body overflow */
body:has(.a2ic-layout) {
  overflow: hidden;
}

/* Hide old nav, old footer, old mode toggle for A2IC layout */
.a2ic-layout ~ .site-footer,
.a2ic-layout .mode-toggle {
  display: none;
}

/* Scrollbar styling for A2IC */
.a2ic-chat-area::-webkit-scrollbar {
  width: 8px;
}

.a2ic-chat-area::-webkit-scrollbar-track {
  background: var(--a2ic-chat-bg);
}

.a2ic-chat-area::-webkit-scrollbar-thumb {
  background: var(--a2ic-scrollbar-thumb);
  border-radius: 4px;
}

.a2ic-chat-area::-webkit-scrollbar-thumb:hover {
  background: var(--a2ic-scrollbar-thumb-hover);
}

.a2ic-chat-history::-webkit-scrollbar {
  width: 6px;
}

.a2ic-chat-history::-webkit-scrollbar-track {
  background: transparent;
}

.a2ic-chat-history::-webkit-scrollbar-thumb {
  background: var(--a2ic-scrollbar-thumb);
  border-radius: 3px;
}

/* --- Icon size utilities --- */
.material-symbols-outlined.a2ic-icon-sm { font-size: 0.875rem; }
.material-symbols-outlined.a2ic-icon-md { font-size: 1rem; }

/* --- Streaming cursor in A2IC layout --- */
.a2ic-chat-area .streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--a2ic-primary);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===========================================
   Error Pages
   =========================================== */

.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--cream);
  font-family: var(--font-body);
  padding: var(--space-8);
}

.error-card {
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-3);
}

.error-icon {
  font-size: 3.5rem;
  color: var(--coral);
  display: block;
  margin-bottom: var(--space-3);
}

.error-code {
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.error-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 var(--space-3);
}

.error-message {
  font-size: 0.95rem;
  color: var(--warm-gray);
  margin: 0 0 var(--space-8);
  line-height: 1.5;
}

.error-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.7rem 1.5rem;
  background: var(--coral);
  color: var(--white);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.error-back-btn:hover {
  background: var(--coral-deep);
}

.error-back-btn .material-symbols-outlined {
  font-size: 1.1rem;
}

[data-theme="dark"] .error-page {
  background: var(--navy);
}

[data-theme="dark"] .error-card {
  background: var(--navy-soft);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .error-code {
  color: var(--cream);
}

[data-theme="dark"] .error-title {
  color: var(--cream);
}

[data-theme="dark"] .error-message {
  color: var(--sand);
}

/* ===========================================
   Info Modal (dashboard)
   =========================================== */

button.dropdown-item {
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.info-modal-card {
  max-width: 540px;
  width: 92vw;
}

.info-modal-body {
  padding: 1rem 1.5rem 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--navy);
  max-height: 60vh;
  overflow-y: auto;
}

.info-modal-body h4 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.info-modal-body h4:first-child {
  margin-top: 0;
}

.info-modal-body ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.info-modal-body li {
  margin-bottom: 0.35rem;
}

.info-modal-body p {
  margin: 0.5rem 0;
}

[data-theme="dark"] .info-modal-body {
  color: var(--cream);
}

[data-theme="dark"] .info-modal-body h4 {
  color: var(--cream);
}

/* ===========================================
   Usage Badge
   =========================================== */

.a2ic-usage-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-display);
  background: var(--sand-light);
  color: var(--warm-gray);
  line-height: 1;
  white-space: nowrap;
}

.a2ic-usage-badge:empty {
  display: none;
}

.a2ic-usage-badge.usage-low {
  background: rgba(212, 160, 23, 0.12);
  color: var(--warning);
}

.a2ic-usage-badge.usage-empty {
  background: rgba(192, 57, 43, 0.12);
  color: var(--error);
}

[data-theme="dark"] .a2ic-usage-badge {
  background: var(--navy-muted);
  color: var(--sand);
}

[data-theme="dark"] .a2ic-usage-badge.usage-low {
  background: rgba(212, 160, 23, 0.2);
  color: var(--a2ic-primary);
}

[data-theme="dark"] .a2ic-usage-badge.usage-empty {
  background: rgba(192, 57, 43, 0.2);
  color: var(--coral-light);
}

/* =============================================
   Webinaire Guide Page (wbn-*)
   ============================================= */

/* --- Webinaire tokens (light) --- */
:root {
  --wbn-bg: var(--cream);
  --wbn-surface: var(--white);
  --wbn-surface2: var(--sand-light);
  --wbn-surface3: var(--cream-mid);
  --wbn-border: var(--sand);
  --wbn-border-mid: var(--cream-dark);
  --wbn-text: var(--charcoal);
  --wbn-text-mid: var(--warm-gray);
  --wbn-text-muted: #918b82;
  --wbn-accent: var(--coral);
  --wbn-accent-light: #fdf1e8;
  --wbn-accent-pale: #f8e8d8;
  --wbn-accent-deep: var(--coral-deep);
  --wbn-green: var(--success);
  --wbn-green-light: #e8f4ee;
  --wbn-blue: #2b4f82;
  --wbn-blue-light: #e8eef8;
  --wbn-red: var(--error);
  --wbn-red-light: #faeae9;
  --wbn-purple: var(--accent-purple);
  --wbn-purple-light: #f0ebf8;
  --wbn-shadow: var(--shadow-2);
  --wbn-prose-width: 75ch;
}

/* --- Dark mode overrides --- */
[data-theme="dark"] {
  --wbn-bg: #121412;
  --wbn-surface: #1e231e;
  --wbn-surface2: #181a18;
  --wbn-surface3: #2a302a;
  --wbn-border: #2a302a;
  --wbn-border-mid: #353c35;
  --wbn-text: #e8e0d8;
  --wbn-text-mid: #b0a898;
  --wbn-text-muted: #7a7268;
  --wbn-accent: var(--coral-light);
  --wbn-accent-light: rgba(217, 119, 87, 0.12);
  --wbn-accent-pale: rgba(217, 119, 87, 0.15);
  --wbn-accent-deep: var(--coral);
  --wbn-green: #6cb585;
  --wbn-green-light: rgba(74, 124, 89, 0.15);
  --wbn-blue: #6b9fd4;
  --wbn-blue-light: rgba(43, 79, 130, 0.15);
  --wbn-red: #e06b63;
  --wbn-red-light: rgba(192, 57, 43, 0.12);
  --wbn-purple: #9b8fd4;
  --wbn-purple-light: rgba(108, 92, 231, 0.12);
  --wbn-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* --- Top bar --- */
.wbn-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  background: var(--wbn-surface);
  border-bottom: 1px solid var(--wbn-border);
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(10px);
}

.wbn-topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.wbn-topbar-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--wbn-text-mid);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard);
}

.wbn-topbar-back:hover {
  color: var(--wbn-accent);
  background: var(--wbn-accent-light);
}

.wbn-topbar-back .material-symbols-outlined {
  font-size: 18px;
}

.wbn-topbar-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--wbn-text);
}

.wbn-theme-toggle {
  background: none;
  border: 1px solid var(--wbn-border);
  color: var(--wbn-text-mid);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-standard);
}

.wbn-theme-toggle:hover {
  border-color: var(--wbn-accent);
  color: var(--wbn-accent);
}

.wbn-theme-toggle .material-symbols-outlined {
  font-size: 18px;
}

.wbn-icon-light { display: inline; }
.wbn-icon-dark  { display: none; }
[data-theme="dark"] .wbn-icon-light { display: none; }
[data-theme="dark"] .wbn-icon-dark  { display: inline; }

/* --- Layout --- */
.wbn-app {
  display: flex;
  min-height: 100vh;
  background: var(--wbn-bg);
  color: var(--wbn-text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: var(--leading-relaxed);
}

.wbn-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--wbn-surface);
  border-right: 1px solid var(--wbn-border);
  padding: var(--space-8) 0;
  position: fixed;
  top: 52px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.wbn-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--pattern-mudcloth);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

[data-theme="dark"] .wbn-sidebar::before {
  background-image: var(--pattern-kente);
  opacity: 1;
}

.wbn-sidebar > * {
  position: relative;
  z-index: 1;
}

.wbn-main {
  margin-left: 220px;
  flex: 1;
  padding: var(--space-12) clamp(32px, 4vw, 72px) var(--space-16);
  max-width: 1400px;
  overflow-y: auto;
  height: calc(100vh - 52px);
}

.wbn-main::-webkit-scrollbar {
  width: 8px;
}

.wbn-main::-webkit-scrollbar-track {
  background: var(--wbn-bg);
}

.wbn-main::-webkit-scrollbar-thumb {
  background: var(--wbn-border-mid);
  border-radius: 4px;
}

.wbn-main::-webkit-scrollbar-thumb:hover {
  background: var(--wbn-text-muted);
}

.wbn-page-sub,
.wbn-section-desc,
.wbn-slide-note,
.wbn-persona-body,
.wbn-threat-desc,
.wbn-annotation,
.wbn-injection-note,
.wbn-info-red,
.wbn-info-green,
.wbn-step-desc {
  max-width: var(--wbn-prose-width);
}

/* --- Sidebar brand --- */
.wbn-brand {
  padding: 0 var(--space-6) var(--space-6);
  border-bottom: 1px solid var(--wbn-border);
  margin-bottom: var(--space-4);
}

.wbn-brand-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--wbn-text-muted);
  margin-bottom: var(--space-2);
}

.wbn-brand-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--wbn-text);
  line-height: var(--leading-tight);
}

.wbn-brand-accent {
  color: var(--wbn-accent);
}

/* --- Sidebar navigation --- */
.wbn-nav-label {
  padding: var(--space-2) var(--space-6) var(--space-1);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--wbn-text-muted);
}

.wbn-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-6);
  font-size: 13px;
  color: var(--wbn-text-mid);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-left: 2px solid transparent;
  transition: all var(--duration-fast) var(--ease-standard);
  font-family: var(--font-body);
  font-weight: 400;
}

.wbn-nav-item:hover {
  background: var(--wbn-surface2);
  color: var(--wbn-text);
}

.wbn-nav-item[aria-selected="true"] {
  color: var(--wbn-accent);
  border-left-color: var(--wbn-accent);
  background: var(--wbn-accent-light);
  font-weight: 500;
}

.wbn-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wbn-border-mid);
  flex-shrink: 0;
}

.wbn-nav-item[aria-selected="true"] .wbn-nav-dot {
  background: var(--wbn-accent);
}

/* --- Page header --- */
.wbn-page-header {
  margin-bottom: var(--space-12);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--wbn-border);
}

.wbn-page-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--wbn-text-muted);
  margin-bottom: 14px;
}

.wbn-page-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--wbn-text);
  margin-bottom: var(--space-2);
  letter-spacing: -0.5px;
}

.wbn-page-title em {
  font-style: italic;
  color: var(--wbn-accent);
}

.wbn-page-sub {
  font-size: var(--text-base);
  color: var(--wbn-text-muted);
  font-weight: 300;
}

/* --- Panels --- */
.wbn-panel {
  display: none;
}

.wbn-panel[aria-hidden="false"] {
  display: block;
}

/* --- Section titles --- */
.wbn-section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--wbn-text);
  margin-bottom: var(--space-2);
  letter-spacing: -0.3px;
}

.wbn-section-desc {
  font-size: var(--text-sm);
  color: var(--wbn-text-muted);
  margin-bottom: var(--space-6);
  font-weight: 300;
}

/* --- Module cards (accordion) --- */
.wbn-module-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.wbn-module {
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow var(--duration-normal) var(--ease-standard);
}

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

.wbn-module-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) 22px;
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  color: inherit;
}

.wbn-module-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--wbn-accent);
  min-width: 28px;
}

.wbn-module-info {
  flex: 1;
}

.wbn-module-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--wbn-text);
  margin-bottom: 2px;
}

.wbn-module-timing {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--wbn-text-muted);
  letter-spacing: 0.5px;
}

.wbn-module-tags {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.wbn-module-chevron {
  font-size: 12px;
  color: var(--wbn-text-muted);
  transition: transform var(--duration-normal) var(--ease-standard);
}

.wbn-module[aria-expanded="true"] .wbn-module-chevron {
  transform: rotate(180deg);
}

.wbn-module[aria-expanded="true"] {
  box-shadow: var(--wbn-shadow);
  border-color: var(--wbn-border-mid);
}

.wbn-module-body {
  display: none;
  border-top: 1px solid var(--wbn-border);
}

.wbn-module[aria-expanded="true"] .wbn-module-body {
  display: block;
}

/* --- Slide rows --- */
.wbn-slide-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  border-bottom: 1px solid var(--wbn-border);
}

.wbn-slide-row:last-child {
  border-bottom: none;
}

.wbn-slide-label {
  padding: 18px 0 var(--space-4) 22px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--wbn-text-muted);
  letter-spacing: 0.5px;
  display: flex;
  align-items: flex-start;
}

.wbn-slide-content {
  padding: var(--space-4) 22px var(--space-4) 0;
}

.wbn-slide-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--wbn-text);
  margin-bottom: var(--space-1);
}

.wbn-slide-note {
  font-size: 12px;
  color: var(--wbn-text-mid);
  line-height: 1.55;
  margin-bottom: var(--space-2);
}

/* --- Prompt block --- */
.wbn-prompt-block {
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--wbn-border);
}

.wbn-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 14px;
  background: var(--wbn-surface2);
  border-bottom: 1px solid var(--wbn-border);
}

.wbn-prompt-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.wbn-agent-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px var(--space-2);
  border-radius: 3px;
  font-weight: 500;
}

.wbn-tag-claude   { background: var(--wbn-accent-pale); color: var(--wbn-accent-deep); }
.wbn-tag-chatgpt  { background: var(--wbn-green-light); color: var(--wbn-green); }
.wbn-tag-gemini   { background: var(--wbn-blue-light);  color: var(--wbn-blue); }
.wbn-tag-copilot  { background: var(--wbn-purple-light); color: var(--wbn-purple); }
.wbn-tag-all      { background: var(--wbn-surface3); color: var(--wbn-text-mid); }
.wbn-tag-security { background: var(--wbn-red-light); color: var(--wbn-red); }

.wbn-prompt-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--wbn-text-muted);
  letter-spacing: 0.5px;
}

.wbn-copy-btn {
  background: none;
  border: 1px solid var(--wbn-border-mid);
  color: var(--wbn-text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all var(--duration-fast) var(--ease-standard);
}

.wbn-copy-btn:hover {
  border-color: var(--wbn-accent);
  color: var(--wbn-accent);
}

.wbn-copy-btn.copied {
  border-color: var(--wbn-green);
  color: var(--wbn-green);
}

.wbn-prompt-body {
  background: var(--wbn-surface);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--wbn-text-mid);
  white-space: pre-wrap;
}

.wbn-prompt-body .wbn-kw {
  color: var(--wbn-accent);
  font-weight: 500;
}

.wbn-prompt-body .wbn-comment {
  color: var(--wbn-text-muted);
}

/* --- Annotation --- */
.wbn-annotation {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--wbn-accent-light);
  border-left: 2px solid var(--wbn-accent);
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  color: var(--wbn-text-mid);
  line-height: 1.55;
}

.wbn-annotation-green {
  background: var(--wbn-green-light);
  border-left-color: var(--wbn-green);
}

.wbn-annotation-red {
  background: var(--wbn-red-light);
  border-left-color: var(--wbn-red);
}

/* --- Pills --- */
.wbn-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-weight: 500;
}

.wbn-pill-demo     { background: var(--wbn-accent-pale); color: var(--wbn-accent-deep); }
.wbn-pill-info     { background: var(--wbn-surface3);    color: var(--wbn-text-muted); }
.wbn-pill-security { background: var(--wbn-red-light);   color: var(--wbn-red); }

/* --- Agents grid --- */
.wbn-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.wbn-agent-card {
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius-sm);
  padding: 22px;
  transition: box-shadow var(--duration-fast) var(--ease-standard);
}

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

.wbn-agent-name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: 3px;
}

.wbn-agent-model {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--wbn-text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.wbn-agent-bar {
  height: 2px;
  border-radius: 2px;
  margin-bottom: 14px;
}

.wbn-agent-card-claude .wbn-agent-bar  { background: var(--wbn-accent); }
.wbn-agent-card-claude .wbn-agent-name { color: var(--wbn-accent); }
.wbn-agent-card-chatgpt .wbn-agent-bar  { background: var(--wbn-green); }
.wbn-agent-card-chatgpt .wbn-agent-name { color: var(--wbn-green); }
.wbn-agent-card-gemini .wbn-agent-bar  { background: var(--wbn-blue); }
.wbn-agent-card-gemini .wbn-agent-name { color: var(--wbn-blue); }
.wbn-agent-card-copilot .wbn-agent-bar  { background: var(--wbn-purple); }
.wbn-agent-card-copilot .wbn-agent-name { color: var(--wbn-purple); }

.wbn-agent-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.wbn-agent-item {
  font-size: 12px;
  color: var(--wbn-text-mid);
  padding: 5px 10px;
  background: var(--wbn-surface2);
  border-radius: 5px;
  line-height: 1.4;
}

/* --- Matrix table --- */
.wbn-matrix-wrap {
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.wbn-matrix-title {
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--wbn-text-muted);
  border-bottom: 1px solid var(--wbn-border);
  background: var(--wbn-surface2);
}

.wbn-matrix-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.wbn-matrix-wrap th {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--wbn-text-muted);
  padding: 10px var(--space-4);
  text-align: center;
  background: var(--wbn-surface2);
  border-bottom: 1px solid var(--wbn-border);
  font-weight: 500;
}

.wbn-matrix-wrap th:first-child {
  text-align: left;
}

.wbn-matrix-wrap td {
  padding: 10px var(--space-4);
  font-size: 12px;
  color: var(--wbn-text-mid);
  text-align: center;
  border-bottom: 1px solid var(--wbn-border);
}

.wbn-matrix-wrap td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--wbn-text);
}

.wbn-matrix-wrap tr:last-child td {
  border-bottom: none;
}

.wbn-matrix-wrap tr:hover td {
  background: var(--wbn-surface2);
}

.wbn-dot-primary {
  color: var(--wbn-accent);
  font-size: 15px;
  line-height: 1;
}

.wbn-dot-secondary {
  color: var(--wbn-border-mid);
  font-size: 15px;
  line-height: 1;
}

.wbn-matrix-legend {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--wbn-text-muted);
}

/* --- CRAFT grid --- */
.wbn-craft-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.wbn-craft-card {
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius-sm);
  padding: var(--space-4) 14px;
  text-align: center;
}

.wbn-craft-letter {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--wbn-accent);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.wbn-craft-word {
  font-size: 11px;
  font-weight: 600;
  color: var(--wbn-text);
  margin-bottom: var(--space-1);
}

.wbn-craft-desc {
  font-size: 10px;
  color: var(--wbn-text-muted);
  line-height: 1.4;
}

/* --- Comparison boxes --- */
.wbn-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.wbn-cmp-box {
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.wbn-cmp-header {
  padding: 10px var(--space-4);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--wbn-border);
  font-weight: 500;
}

.wbn-cmp-bad .wbn-cmp-header  { color: var(--wbn-red);   background: var(--wbn-red-light); }
.wbn-cmp-good .wbn-cmp-header { color: var(--wbn-green); background: var(--wbn-green-light); }

.wbn-cmp-body {
  padding: 14px var(--space-4);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.75;
  color: var(--wbn-text-mid);
  white-space: pre-wrap;
}

.wbn-cmp-result {
  padding: var(--space-2) var(--space-4) var(--space-3);
  font-size: 11px;
  font-style: italic;
}

.wbn-cmp-bad .wbn-cmp-result  { color: var(--wbn-red); }
.wbn-cmp-good .wbn-cmp-result { color: var(--wbn-green); }

/* --- Tips list --- */
.wbn-tips-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.wbn-tip-item {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: var(--space-3) var(--space-4);
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius-sm);
}

.wbn-tip-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--wbn-accent);
  min-width: 20px;
  padding-top: 1px;
}

.wbn-tip-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.wbn-tip-content {
  flex: 1;
  min-width: 0;
}

.wbn-tip-desc {
  font-size: 12px;
  color: var(--wbn-text-mid);
}

/* --- Threat box --- */
.wbn-threat-box {
  background: var(--wbn-red-light);
  border: 1px solid rgba(192, 57, 43, 0.2);
  border-radius: var(--radius-sm);
  padding: 20px var(--space-6);
  margin-bottom: var(--space-6);
}

.wbn-threat-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--wbn-red);
  margin-bottom: var(--space-2);
}

.wbn-threat-desc {
  font-size: 13px;
  color: var(--wbn-text-mid);
  line-height: 1.6;
}

/* --- Flow steps --- */
.wbn-flow-steps {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-6);
}

.wbn-flow-step {
  display: flex;
  gap: var(--space-4);
  align-items: stretch;
}

.wbn-flow-step-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 32px;
  flex-shrink: 0;
}

.wbn-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--wbn-border-mid);
  background: var(--wbn-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--wbn-text-mid);
  flex-shrink: 0;
  z-index: 1;
}

.wbn-step-circle-attacker { border-color: var(--wbn-red);    color: var(--wbn-red); }
.wbn-step-circle-victim   { border-color: var(--wbn-accent); color: var(--wbn-accent); }

.wbn-step-line {
  width: 1px;
  flex: 1;
  background: var(--wbn-border);
  margin: 2px 0;
}

.wbn-flow-step:last-child .wbn-step-line {
  display: none;
}

.wbn-step-card {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
}

.wbn-step-card-attacker { border-left: 2px solid var(--wbn-red); }
.wbn-step-card-victim   { border-left: 2px solid var(--wbn-accent); }

.wbn-step-role {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}

.wbn-step-role-attacker { color: var(--wbn-red); }
.wbn-step-role-victim   { color: var(--wbn-accent); }
.wbn-step-role-danger   { color: var(--wbn-red); }

.wbn-step-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}

.wbn-step-desc {
  font-size: 11px;
  color: var(--wbn-text-mid);
  line-height: 1.55;
}

/* --- Defenses grid --- */
.wbn-defenses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
}

.wbn-defense-item {
  padding: 14px var(--space-4);
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-left: 2px solid var(--wbn-green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.wbn-defense-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--wbn-green);
  margin-bottom: var(--space-1);
}

.wbn-defense-desc {
  font-size: 11px;
  color: var(--wbn-text-mid);
  line-height: 1.5;
}

/* --- Injection examples --- */
.wbn-injection-example {
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 6px;
}

.wbn-injection-header {
  padding: var(--space-3) var(--space-4);
  background: var(--wbn-surface2);
  font-size: 11px;
  font-weight: 600;
  color: var(--wbn-red);
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

.wbn-injection-body {
  padding: 14px var(--space-4);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.75;
  color: var(--wbn-text-mid);
  white-space: pre-wrap;
}

.wbn-injection-note {
  padding: var(--space-2) var(--space-4) var(--space-3);
  font-size: 11px;
  color: var(--wbn-text-muted);
}

/* --- Info / warning blocks --- */
.wbn-info-red {
  margin-bottom: 10px;
  padding: 10px 14px;
  background: var(--wbn-red-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--wbn-text-mid);
  border-left: 2px solid var(--wbn-red);
}

.wbn-info-green {
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-4);
  background: var(--wbn-green-light);
  border: 1px solid rgba(74, 124, 89, 0.2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--wbn-text-mid);
}

.wbn-info-green strong {
  color: var(--wbn-green);
}

/* --- Config section --- */
.wbn-config-section {
  margin-bottom: var(--space-12);
}

.wbn-persona-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 20px var(--space-6);
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
  flex-wrap: wrap;
}

.wbn-persona-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.wbn-avatar-mamadou  { background: var(--wbn-green-light); color: var(--wbn-green); }
.wbn-avatar-ibrahim  { background: var(--wbn-accent-pale); color: var(--wbn-accent-deep); }

.wbn-persona-info {
  flex: 1;
  min-width: 200px;
}

.wbn-persona-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--wbn-text);
  margin-bottom: 2px;
}

.wbn-persona-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--wbn-text-muted);
}

.wbn-persona-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.wbn-persona-body {
  background: var(--wbn-surface2);
  border: 1px solid var(--wbn-border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: var(--space-4) var(--space-6) 20px;
  margin-bottom: var(--space-4);
  font-size: 12px;
  color: var(--wbn-text-mid);
  line-height: 1.6;
}

.wbn-platform-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.wbn-platform-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--wbn-text-muted);
}

.wbn-config-block {
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
}

.wbn-config-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--space-4);
  background: var(--wbn-surface2);
  border-bottom: 1px solid var(--wbn-border);
}

.wbn-config-field-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--wbn-text-muted);
}

.wbn-config-field-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--wbn-text);
  padding: 10px var(--space-4);
  border-bottom: 1px solid var(--wbn-border);
  background: var(--wbn-surface);
}

.wbn-config-field-value-multi {
  white-space: pre-line;
  font-size: 11px;
  color: var(--wbn-text-mid);
  font-weight: 400;
}

/* --- Checklist --- */
.wbn-checklist {
  background: var(--wbn-surface);
  border: 1px solid var(--wbn-border);
  border-radius: var(--radius-sm);
  padding: 20px var(--space-6);
  margin-top: var(--space-2);
}

.wbn-checklist-title {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--wbn-text-muted);
  margin-bottom: var(--space-4);
}

.wbn-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-2);
}

.wbn-checklist-item {
  padding: var(--space-2) var(--space-3);
  background: var(--wbn-surface2);
  border-radius: 6px;
  font-size: 12px;
  color: var(--wbn-text-mid);
}

/* --- Utilities --- */
.wbn-mb8  { margin-bottom: var(--space-2); }
.wbn-mb16 { margin-bottom: var(--space-4); }
.wbn-mb24 { margin-bottom: var(--space-6); }
.wbn-mb32 { margin-bottom: var(--space-8); }
.wbn-mt8  { margin-top: var(--space-2); }
.wbn-mt12 { margin-top: var(--space-3); }
.wbn-section-subtitle {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--wbn-text);
  margin-bottom: var(--space-3);
}

/* --- Dashboard sidebar link --- */
.a2ic-webinaire-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  color: var(--a2ic-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--a2ic-font);
  border-top: 1px solid var(--a2ic-border);
  transition: color var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard);
}

.a2ic-webinaire-link:hover {
  color: var(--coral);
  background: var(--a2ic-surface-hover);
}

.a2ic-webinaire-link .material-symbols-outlined {
  font-size: 20px;
}

[data-theme="dark"] .a2ic-webinaire-link {
  color: var(--sand);
}

[data-theme="dark"] .a2ic-webinaire-link:hover {
  color: var(--coral-light);
  background: rgba(255, 255, 255, 0.05);
}

/* --- Login footer webinaire link --- */
.login-card-footer-webinaire {
  color: var(--login-text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: color var(--duration-fast) var(--ease-standard);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .wbn-sidebar {
    display: none;
  }
  .wbn-main {
    margin-left: 0;
    padding: var(--space-8) var(--space-6) var(--space-12);
  }
  .wbn-craft-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .wbn-agents-grid {
    grid-template-columns: 1fr;
  }
  .wbn-comparison {
    grid-template-columns: 1fr;
  }
  .wbn-defenses {
    grid-template-columns: 1fr;
  }
  .wbn-checklist-grid {
    grid-template-columns: 1fr;
  }
  .wbn-persona-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .wbn-craft-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .wbn-topbar-title {
    display: none;
  }
}

@media (max-width: 480px) {
  .wbn-main {
    padding: var(--space-4) var(--space-3) var(--space-8);
  }
  .wbn-slide-row {
    flex-direction: column;
    gap: var(--space-2);
  }
  .wbn-slide-label {
    min-width: unset;
  }
  .wbn-page-title {
    font-size: var(--text-xl);
  }
  .wbn-page-sub {
    font-size: var(--text-sm);
  }
  .wbn-section-title {
    font-size: var(--text-lg);
  }
  .wbn-craft-grid {
    grid-template-columns: 1fr;
  }
  .wbn-prompt-body {
    font-size: var(--text-xs);
  }
}
