:root {
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Modern Emerald & Clinical Slate Palette */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-dark: #064e3b;
  --primary-light: rgba(5, 150, 105, 0.08);
  --primary-glow: rgba(5, 150, 105, 0.25);
  --primary-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
  --primary-gradient-subtle: linear-gradient(135deg, rgba(5, 150, 105, 0.12) 0%, rgba(4, 120, 87, 0.05) 100%);
  
  --accent-clay: #d97706;
  --accent-lavender: #8b5cf6;
  --accent-sky: #0284c7;
  --accent-teal: #0d9488;
  
  /* Surfaces & Ambient Lighting (Light Mode) */
  --bg: #f8fafc;
  --bg-gradient: radial-gradient(at 0% 0%, rgba(5, 150, 105, 0.04) 0px, transparent 50%),
                  radial-gradient(at 100% 0%, rgba(217, 119, 6, 0.02) 0px, transparent 50%),
                  radial-gradient(at 50% 100%, rgba(2, 132, 199, 0.03) 0px, transparent 50%);
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-input: #f1f5f9;
  --bg-elevated: #ffffff;
  
  /* Typography Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  /* Borders & Dividers */
  --border: rgba(226, 232, 240, 0.9);
  --border-subtle: rgba(241, 245, 249, 0.95);
  --border-focus: #059669;
  --border-highlight: rgba(255, 255, 255, 0.85);
  
  /* Multi-layered Ambient Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 8px 22px -4px rgba(15, 23, 42, 0.07), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 36px -6px rgba(15, 23, 42, 0.09), 0 6px 16px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 24px rgba(5, 150, 105, 0.25);
  --shadow-card-inner: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  
  --glass-blur: none;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  
  /* Badges & Clinical Categories */
  --badge-cognitive: #059669;
  --badge-depression: #8b5cf6;
  --badge-anxiety: #0284c7;
  --badge-trauma: #e11d48;
  --badge-substance: #d97706;
  --badge-clinical: #475569;
  
  /* Severity Colors */
  --severity-normal: #16a34a;
  --severity-mild: #d97706;
  --severity-moderate: #ea580c;
  --severity-severe: #dc2626;
  
  /* Safe Area Variables */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  
  /* AdMob Banner Dynamic Clearance */
  --admob-banner-height: 0px;
}

body.has-admob-banner {
  --admob-banner-height: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding-top: 0;
  padding-left: var(--sal);
  padding-right: var(--sar);
}

canvas {
  touch-action: none !important;
}

/* Allow text selection where appropriate */
input, textarea, .result-card, .test-instructions, .report-text, .clinical-note {
  user-select: text;
  -webkit-user-select: text;
}

h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.25; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
h4 { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.text-muted { color: var(--text-muted); }

/* App Layout */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: transparent;
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.03);
  padding-top: 0;
}

.page {
  display: none;
  min-height: calc(100vh - 80px);
  padding-bottom: calc(130px + var(--sab));
  overflow: visible;
  transform: translateZ(0);
}

.card, .test-card, .history-item, .quick-start-card {
  contain: content;
}

.page.active {
  display: block;
  animation: pageTransitionIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ==========================================================================
   Header with Solid Surface
   ========================================================================== */
.header {
  padding: calc(10px + var(--sat)) 16px 10px;
  background: var(--bg-card-solid);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.04);
  transform: translateZ(0);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.greeting {
  flex-grow: 1;
  min-width: 0;
}

.date {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  margin-bottom: 3px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.label {
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  margin-bottom: 3px;
  display: block;
}

#user-greeting-title, .header h1 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 0;
}

/* ==========================================================================
   Custom Premium Buttons & Icon Buttons
   ========================================================================== */
.icon-btn {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  touch-action: manipulation;
  flex-shrink: 0;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.back-btn:hover {
  transform: translateX(-2px) !important;
}

.icon-btn:active {
  transform: scale(0.92);
  transition-duration: 0.08s;
}

.notification-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  background-color: var(--severity-severe);
  border-radius: 50%;
  border: 2px solid var(--bg-card-solid);
  box-shadow: 0 0 6px var(--severity-severe);
}
.notification-badge.hidden {
  display: none;
}

/* Content Container */
.content {
  padding: 12px 16px 24px;
}

/* Section Headers */
.section-header {
  margin: 18px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-header h2 {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 800;
  margin-bottom: 2px;
}

.section-header .section-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-header .link-btn {
  font-size: 12.5px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.18s ease, transform 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.section-header .link-btn:hover {
  color: var(--primary-hover);
  background: var(--primary-light);
  transform: translateX(2px);
}

.section-header .link-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Modern SaaS / Mobile Cards
   ========================================================================== */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-card-inner), var(--shadow-xs);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-inner), var(--shadow-sm);
  border-color: rgba(5, 150, 105, 0.22);
}

.card:active {
  transform: scale(0.988);
  transition-duration: 0.08s;
}

/* ==========================================================================
   Dashboard Stats
   ========================================================================== */
.stats-section { margin-bottom: 18px; }

.stat-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.primary-stat {
  background: var(--primary-gradient);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 20px -4px var(--primary-glow);
}
.primary-stat h3 { color: rgba(255, 255, 255, 0.9); font-weight: 600; font-size: 12.5px; }
.primary-stat .stat-value { font-size: 26px; font-weight: 800; margin-top: 3px; letter-spacing: -0.03em; color: #ffffff; }
.primary-stat p { color: rgba(255, 255, 255, 0.82); }

.stats-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.stats-row .stat-card {
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
}
.stats-row h3 { font-size: 11.5px; color: var(--text-secondary); font-weight: 600; }
.stats-row .stat-value { font-size: 20px; font-weight: 800; margin-top: 3px; color: var(--text-primary); letter-spacing: -0.02em; }

/* ==========================================================================
   Quick Start Horizontal Scroll Cards
   ========================================================================== */
.horizontal-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }

.quick-start-card {
  min-width: 144px;
  max-width: 154px;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 2px;
  box-shadow: var(--shadow-card-inner), var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.quick-start-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-inner), var(--shadow-sm);
  border-color: var(--border-focus);
}

.quick-start-card:active {
  transform: scale(0.976);
}

.quick-start-card h3 {
  font-size: 12px;
  font-weight: 700;
  margin: 8px 0 10px;
  line-height: 1.35;
  flex-grow: 1;
  color: var(--text-primary);
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* ==========================================================================
   Button System
   ========================================================================== */
.btn-start-test {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
  touch-action: manipulation;
}

.btn-start-test:hover {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px -2px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-start-test:active {
  transform: scale(0.96);
}

/* Lists */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.empty-state svg { margin-bottom: 10px; opacity: 0.65; width: 40px; height: 40px; }
.empty-state p { font-size: 13.5px; font-weight: 500; color: var(--text-secondary); }

/* Info Banner */
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--primary-light);
  border: 1px solid rgba(5, 150, 105, 0.16);
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 18px;
  box-shadow: var(--shadow-xs);
}
.info-banner p { color: var(--text-primary); font-size: 12.5px; margin: 0; line-height: 1.45; }
.info-banner svg { color: var(--primary); flex-shrink: 0; margin-top: 1px; width: 18px; height: 18px; }

/* Floating Action Button - Disabled to prevent overlapping with history and content */
.fab-btn, #new-assessment-btn {
  display: none !important;
}

/* ==========================================================================
   Floating Glassmorphic Bottom Navigation Dock
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: calc(6px + var(--sab));
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  width: calc(100% - 20px);
  max-width: 440px;
  background: var(--bg-card);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 4px 4px;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-card-inner), 0 6px 20px -2px rgba(0, 0, 0, 0.08);
  z-index: 100;
  height: 52px;
  box-sizing: border-box;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), opacity 0.2s ease;
  will-change: transform;
}

.top-nav-brand, .top-nav-right {
  display: none;
}

.top-nav-items {
  display: flex;
  width: 100%;
  justify-content: space-around;
  align-items: center;
}

@media (min-width: 480px) and (max-width: 767px) {
  .bottom-nav {
    position: fixed;
    bottom: calc(8px + var(--sab));
    left: 50%;
    transform: translateX(-50%);
  }
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
  padding: 5px 6px;
  border-radius: 14px;
  position: relative;
  width: auto;
  min-width: 52px;
  touch-action: manipulation;
}

.nav-item svg {
  width: 19px;
  height: 19px;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.nav-item:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.nav-item.active svg {
  transform: scale(1.08);
  filter: drop-shadow(0 2px 4px var(--primary-glow));
}

/* Tests Page Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  margin-top: 14px;
  margin-bottom: 4px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.search-bar:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.search-bar input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 13.5px;
  background: transparent;
  color: var(--text-primary);
  font-weight: 500;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar svg { color: var(--text-muted); flex-shrink: 0; margin-right: 8px; width: 18px; height: 18px; }

.category-section { margin-top: 14px; }

.category-title {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 800;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.count-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.test-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-card-inner), var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  contain: content;
}
.test-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-inner), var(--shadow-sm);
  border-color: var(--border-focus);
}
.test-card:active {
  transform: scale(0.98);
}
.test-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.badge-label { font-size: 10px; font-weight: 700; }
.test-card h4 { margin-bottom: 4px; font-size: 12.5px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; color: var(--text-primary); }
.test-card p { font-size: 11px; color: var(--text-secondary); margin-bottom: 12px; flex-grow: 1; line-height: 1.4; }
.test-card.full-width { grid-column: span 2; }

/* Filter Chips (History Page) */
.filter-chips {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
  touch-action: manipulation;
}

.chip:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.chip:active {
  transform: scale(0.94);
}

.chip.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 6px var(--primary-glow);
}

/* ==========================================================================
   Assessment Page Flow & Forms
   ========================================================================== */
.assessment-header { padding-bottom: 0; }
.progress-container {
  height: 7px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  margin-top: 18px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-clay) 100%);
  width: 0%;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 10px var(--primary-glow);
}

.client-info-card { margin-top: 18px; margin-bottom: 24px; }
.input-group { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.input-group input {
  padding: 13px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 14.5px;
  background: var(--bg);
  color: var(--text-primary);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.input-group input:focus {
  border-color: var(--primary);
  background: var(--bg-card-solid);
  box-shadow: 0 0 0 3.5px var(--primary-light), var(--shadow-sm);
}

/* Focused Tactile Question Cards & Option Pills */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card-inner), var(--shadow-xs);
  transition: all 0.22s cubic-bezier(0.2, 0, 0, 1);
}

.question-card:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-card-inner), 0 8px 25px -4px var(--primary-glow);
}

.question-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
  margin-bottom: 18px;
  letter-spacing: -0.015em;
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
  user-select: none;
  touch-action: manipulation;
}

.option-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(3px);
}

.option-item:active {
  transform: scale(0.98);
}

.option-item.selected {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  font-weight: 700;
  color: var(--primary) !important;
  box-shadow: 0 4px 14px -2px var(--primary-glow);
}

.option-item input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.bottom-nav-actions {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  padding: 16px 20px calc(16px + var(--sab));
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
}

@media (min-width: 480px) {
  .bottom-nav-actions { position: absolute; }
}

.btn-primary, .btn-secondary {
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  flex: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.18s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
}

.btn-primary:active, .btn-secondary:active {
  transform: scale(0.976);
  transition-duration: 0.08s;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 16px -2px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 24px -2px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ==========================================================================
   Result Page with Staggered Visual Flow
   ========================================================================== */
.result-card { text-align: center; margin-top: 20px; }
.score-display { display: flex; justify-content: center; margin: 28px 0; }
.score-circle {
  width: 176px; height: 176px; border-radius: 50%;
  background: conic-gradient(var(--primary) 0%, rgba(5, 150, 105, 0.12) 0%);
  display: flex; justify-content: center; align-items: center;
  position: relative;
  box-shadow: 0 14px 38px -8px var(--primary-glow);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.score-circle::before {
  content: ''; position: absolute; width: 150px; height: 150px;
  background: var(--bg-card); border-radius: 50%;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.04);
}
.score-circle-inner { position: relative; z-index: 1; display: flex; flex-direction: column; }
#result-score-value { font-size: 52px; font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -0.035em; }
#result-score-max { font-size: 14.5px; color: var(--text-muted); font-weight: 600; margin-top: 5px; }

.severity-badge {
  display: inline-block; padding: 9px 22px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 13.5px; margin-bottom: 24px;
  background: var(--primary-light); color: var(--primary);
  border: 1.5px solid rgba(5, 150, 105, 0.28);
  box-shadow: 0 4px 16px -2px var(--primary-glow);
  letter-spacing: 0.2px;
}

.result-details { text-align: left; margin-bottom: 32px; }
.interpretation { font-size: 16px; font-weight: 700; margin-bottom: 14px; line-height: 1.5; color: var(--text-primary); }
.clinical-note {
  font-size: 13.5px; color: var(--text-secondary);
  background: var(--bg-card);
  padding: 16px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  line-height: 1.6;
  box-shadow: var(--shadow-xs);
}
.subscales { margin-top: 20px; }

.action-buttons { display: flex; flex-direction: column; gap: 12px; }
.disclaimer-banner {
  margin-top: 24px; padding: 14px 18px;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.22);
  color: #92400e; font-size: 12.5px;
  border-radius: var(--radius-sm); text-align: left;
  line-height: 1.55;
}

/* ==========================================================================
   Modals & Dialogs
   ========================================================================== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.72);
  z-index: 1000;
  display: flex; justify-content: center; align-items: center;
  padding: 16px;
  animation: modalFadeIn 0.18s ease forwards;
}
.modal-container {
  background: var(--bg-card-solid);
  width: 100%; max-width: 480px;
  border-radius: var(--radius-lg);
  padding: 26px;
  animation: modalSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transform: translateZ(0);
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSlideUp {
  from { transform: translateY(24px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ==========================================
   Desktop Responsive Styles (min-width: 768px)
   ========================================== */
@media (min-width: 768px) {
  #app {
    max-width: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
    min-height: 100vh !important;
  }

  .page {
    flex-grow: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 64px) !important;
    overflow-y: auto !important;
    padding: 32px 40px 60px !important;
    display: none;
  }

  .page.active {
    display: block !important;
  }

  .header {
    padding: 16px 0 16px !important;
    max-width: 1080px !important;
    margin: 0 auto !important;
    background: transparent !important;
    position: relative !important;
    z-index: 100 !important;
  }

  .content {
    padding: 0 !important;
    max-width: 1080px !important;
    margin: 0 auto !important;
  }

  /* Desktop Top Navigation Bar (Converted from Bottom Bar) */
  .bottom-nav {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    height: 64px !important;
    min-height: 64px !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 32px !important;
    border-bottom: 1px solid var(--border) !important;
    border-right: none !important;
    border-top: none !important;
    border-left: none !important;
    background: rgba(var(--bg-card-rgb, 255, 255, 255), 0.90) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-radius: 0 !important;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.04) !important;
    transform: none !important;
    order: -1 !important;
    z-index: 1000 !important;
    margin: 0 !important;
  }

  .bottom-nav::before {
    display: none !important;
  }

  .top-nav-brand {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    user-select: none !important;
    flex-shrink: 0 !important;
  }

  .top-nav-logo {
    width: 32px !important;
    height: 32px !important;
    object-fit: contain !important;
  }

  .top-nav-brand-title {
    font-size: 19px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: var(--primary) !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
  }

  .top-nav-items {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: auto !important;
  }

  .nav-item {
    flex-direction: row !important;
    gap: 8px !important;
    width: auto !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    text-align: center !important;
    justify-content: center !important;
    height: 38px !important;
    color: var(--text-secondary) !important;
    margin-bottom: 0 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .nav-item:hover {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
    transform: translateY(-1px) !important;
  }

  .nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px -2px var(--primary-glow) !important;
  }

  .nav-item.active svg {
    color: #ffffff !important;
  }

  .nav-item.active::before {
    display: none !important;
  }

  .nav-item svg {
    width: 18px !important;
    height: 18px !important;
  }

  .top-nav-right {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-shrink: 0 !important;
  }

  .top-nav-profile-pill {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 5px 12px 5px 6px !important;
    border-radius: 24px !important;
    border: 1px solid var(--border) !important;
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: var(--shadow-xs) !important;
  }

  .top-nav-profile-pill:hover {
    border-color: var(--primary) !important;
    background: var(--primary-light) !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-sm) !important;
  }

  .top-nav-avatar {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    overflow: hidden !important;
  }

  .top-nav-username {
    max-width: 140px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .top-nav-arrow {
    display: inline-block !important;
    font-size: 10px !important;
    opacity: 0.65 !important;
    margin-left: 3px !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .top-nav-profile-pill[aria-expanded="true"] .top-nav-arrow {
    transform: rotate(180deg) !important;
  }

  /* Top Nav User Options Dropdown */
  .top-nav-dropdown {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    right: 0 !important;
    min-width: 260px !important;
    background: var(--bg-card, #ffffff) !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    border-radius: 18px !important;
    padding: 10px !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    z-index: 1200 !important;
    animation: authDropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .top-nav-dropdown .user-dropdown-header {
    border-radius: 12px !important;
    transition: background 0.18s ease !important;
  }

  .top-nav-dropdown .user-dropdown-header:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.04)) !important;
  }

  /* Home Page Layout Grid */
  .stats-section {
    display: grid !important;
    grid-template-columns: 1fr 1.5fr !important;
    gap: 20px !important;
    align-items: stretch !important;
  }

  .stats-row {
    margin-top: 0 !important;
    height: 100% !important;
  }

  .horizontal-scroll {
    display: flex !important;
    gap: 10px !important;
    overflow-x: auto !important;
    padding-bottom: 10px !important;
    padding-top: 4px !important;
    scroll-snap-type: x proximity;
  }

  .quick-start-card {
    flex: 0 0 162px !important;
    min-width: 155px !important;
    max-width: 170px !important;
    margin-bottom: 0 !important;
  }

  /* Test Kitabxanası Grid layout - sıx və səliqəli məsafə */
  .grid-2col {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 10px !important;
  }

  .list-layout {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 10px !important;
  }

  .test-card.full-width {
    grid-column: span 1 !important; /* Make it uniform with others on desktop grid */
  }

  /* History list */
  #history-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 20px !important;
  }

  /* Landing & Welcome containers */
  .landing-container, .welcome-container {
    max-width: 520px !important;
    margin: 40px auto !important;
  }

  /* Assessment wizard card & actions */
  .client-info-card, .question-card, #assessment-form {
    max-width: 720px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .bottom-nav-actions {
    position: static !important;
    max-width: 720px !important;
    margin: 24px auto 0 !important;
    padding: 24px 0 !important;
    background: transparent !important;
    border-top: none !important;
  }

  /* Result report card */
  .result-card {
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 32px !important;
  }
}

/* ==========================================
   Trail Making Test (TMT) Interactive Styles
   ========================================== */

.tmt-intro-screen {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.tmt-intro-icon {
  width: 72px;
  height: 72px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.tmt-intro-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.tmt-intro-title {
  font-size: 1.3em;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  font-weight: 700;
}

.tmt-intro-desc {
  font-size: 0.95em;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.tmt-partA-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9em;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px dashed var(--border);
}

.tmt-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 28px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(13, 110, 110, 0.2);
}

.tmt-start-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.tmt-intro-hint {
  font-size: 0.8em;
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 0;
}

/* TMT Active Playing Field */
.tmt-test-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
}

.tmt-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.tmt-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tmt-info-label {
  font-size: 0.7em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.tmt-info-value {
  font-size: 1.05em;
  font-weight: 700;
  color: var(--text-primary);
  font-mono: monospace;
}

.tmt-part-label {
  color: var(--primary);
}

.tmt-timer-item .tmt-info-value {
  color: var(--primary);
  font-size: 1.15em;
  font-family: monospace;
  min-width: 90px;
  text-align: center;
}

.tmt-field {
  position: relative;
  width: 100%;
  height: 480px;
  background: #ffffff;
  border-radius: 16px;
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow);
  overflow: hidden;
  touch-action: manipulation;
}

@media (max-width: 479.98px) {
  .tmt-field {
    height: 420px;
  }
}

.tmt-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.tmt-line {
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.85;
}

.tmt-node {
  position: absolute;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #334155;
  color: #1e293b;
  font-size: 1.1em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  outline: none;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.tmt-node:hover {
  transform: scale(1.1);
}

.tmt-node-letter {
  border-color: #0284c7;
  color: #0369a1;
}

.tmt-node-active {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px var(--primary-light), 0 4px 10px rgba(13, 110, 110, 0.3) !important;
  animation: tmtPulse 1.5s infinite;
}

@keyframes tmtPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.tmt-node-completed {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3) !important;
  animation: none !important;
}

.tmt-node-error {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  animation: tmtShake 0.4s ease-in-out !important;
  box-shadow: 0 0 0 4px #fee2e2 !important;
}

@keyframes tmtShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* Completion Screen */
.tmt-complete-screen {
  border-top: 4px solid #10b981;
}

.tmt-complete-icon {
  width: 80px;
  height: 80px;
  background: #ecfdf5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.tmt-complete-badge {
  background: #ecfdf5;
  color: #059669;
}

.tmt-results-summary {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  text-align: left;
}

.tmt-results-section-title {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.tmt-result-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9em;
  color: var(--text-primary);
  border-bottom: 1px solid #f1f5f9;
}

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

.tmt-result-highlight {
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 8px 10px;
  border-radius: 8px;
  margin-top: 8px;
}

/* Print & PDF Export Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .bottom-nav, .fab-btn, .header, .action-buttons, .back-btn, #modal-overlay {
    display: none !important;
  }

  .page {
    display: none !important;
  }

  #result-page.active {
    display: block !important;
  }

  #result-container {
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .score-circle {
    box-shadow: none !important;
    border: 4px solid #0d6e6e !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #e2e8f0 !important;
    break-inside: avoid;
  }
}


/* ═══════════════════════════════════════════════════════════════
   GOLDEN STROOP TEST — Interactive Module Styles
   ═══════════════════════════════════════════════════════════════ */

/* ─── Intro Screens ──────────────────────────────────────────── */
.stroop-intro-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 20px 35px;
  border-radius: var(--radius);
  animation: fadeIn 0.35s ease;
}

.stroop-intro-icon {
  margin-bottom: 12px;
}

.stroop-intro-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.stroop-intro-title {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.35;
}

.stroop-intro-desc {
  font-size: 0.92em;
  color: var(--text-primary);
  line-height: 1.6;
  max-width: 400px;
  margin-bottom: 18px;
}

.stroop-part-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--primary-light);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88em;
  color: var(--primary-dark);
  margin-bottom: 18px;
  width: 100%;
  max-width: 360px;
}

.stroop-part-summary span {
  font-weight: 500;
}

.stroop-part-summary strong {
  font-weight: 700;
}

.stroop-input-hint-banner {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.8em;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  width: 100%;
  max-width: 400px;
}

.stroop-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 36px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(13, 110, 110, 0.25);
}

.stroop-start-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

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

/* ─── Interactive Container ─────────────────────────────────── */
.stroop-interactive-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.3s ease;
}

/* ─── HUD (Heads-Up Display) ────────────────────────────────── */
.stroop-hud {
  padding: 14px 16px 10px;
  border-radius: var(--radius);
}

.stroop-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stroop-hud-title {
  font-size: 0.78em;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stroop-hud-timer {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stroop-hud-metrics {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}

.stroop-hud-metric {
  font-size: 0.85em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.stroop-hud-metric strong {
  font-weight: 700;
}

.stroop-progress-bar-wrap {
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.stroop-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 3px;
  transition: width 0.25s ease;
}

/* ─── Stimulus Card ─────────────────────────────────────────── */
.stroop-stimulus-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 30px 20px;
  border-radius: var(--radius);
  transition: background-color 0.15s, box-shadow 0.15s;
  user-select: none;
  -webkit-user-select: none;
}

.stroop-stimulus-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.stroop-stimulus-word {
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1.2;
}

/* Color shape for Stage 2 */
.stroop-stimulus-shape {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Error flash animation */
.stroop-stimulus-card.stroop-error-flash {
  background-color: #fef2f2 !important;
  box-shadow: inset 0 0 0 2px #ef4444 !important;
  animation: stroopShake 0.2s ease;
}

@keyframes stroopShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ─── Response Button Grid ──────────────────────────────────── */
.stroop-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stroop-color-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 10px;
  background: #ffffff;
  border: 2px solid var(--btn-color);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background-color 0.12s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 80px;
}

.stroop-color-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.stroop-color-btn:active,
.stroop-color-btn.active {
  transform: scale(0.96);
  background-color: var(--btn-color);
}

.stroop-color-btn:active .stroop-btn-label,
.stroop-color-btn.active .stroop-btn-label {
  color: #ffffff;
}

.stroop-color-btn:active .stroop-kbd-hint,
.stroop-color-btn.active .stroop-kbd-hint {
  color: rgba(255, 255, 255, 0.7);
}

.stroop-btn-indicator {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--btn-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.stroop-btn-label {
  font-size: 0.95em;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.12s;
}

.stroop-kbd-hint {
  font-size: 0.72em;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.12s;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 479.98px) {
  .stroop-stimulus-card {
    min-height: 140px;
    padding: 24px 16px;
  }

  .stroop-stimulus-word {
    font-size: 2rem !important;
  }

  .stroop-stimulus-shape {
    width: 75px;
    height: 75px;
  }

  .stroop-color-btn {
    min-height: 72px;
    padding: 14px 8px;
  }

  .stroop-btn-label {
    font-size: 0.88em;
  }

  .stroop-btn-indicator {
    width: 18px;
    height: 18px;
  }
}

/* ─── Digit Span Interactive Module Styles ───────────────────── */
@keyframes digitScale {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.digit-key-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
  min-height: 54px;
  box-shadow: var(--shadow-sm);
}

.digit-key-btn:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}

.digit-key-btn:active {
  transform: scale(0.95);
  background-color: var(--primary);
  color: #ffffff;
}

.digit-key-btn.action-key {
  font-weight: 600;
  font-size: 0.9em;
}

.digit-key-btn[data-action="clear"] {
  background: var(--bg);
  color: var(--text-secondary);
}

.digit-key-btn.btn-key-delete,
.digit-key-btn[data-action="delete"] {
  background: rgba(200, 70, 48, 0.12);
  color: #c84630;
  border-color: rgba(200, 70, 48, 0.25);
}

.digit-input-display-box {
  background: var(--bg);
  border: 2px solid var(--border);
}

.digit-input-chip {
  animation: digitScale 0.15s ease-out;
}

.digit-span-prev-summary div {
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 479.98px) {
  .digit-key-btn {
    padding: 12px 8px;
    font-size: 1.2rem;
    min-height: 48px;
  }
  #digit-presentation-area {
    font-size: 4rem !important;
  }
}

/* ==========================================================================
   DARK THEME (OLED Obsidian & Luminous Emerald)
   ========================================================================== */
[data-theme="dark"] {
  --primary: #10b981;
  --primary-hover: #34d399;
  --primary-dark: #059669;
  --primary-light: rgba(16, 185, 129, 0.14);
  --primary-glow: rgba(16, 185, 129, 0.32);
  --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --primary-gradient-subtle: linear-gradient(135deg, rgba(16, 185, 129, 0.16) 0%, rgba(5, 150, 105, 0.06) 100%);
  
  --accent-clay: #f59e0b;
  --accent-lavender: #a78bfa;
  --accent-sky: #38bdf8;
  --accent-teal: #14b8a6;
  
  --bg: #070b14;
  --bg-gradient: radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
                  radial-gradient(at 100% 0%, rgba(245, 158, 11, 0.05) 0px, transparent 50%),
                  radial-gradient(at 50% 100%, rgba(56, 189, 248, 0.05) 0px, transparent 50%);
  --bg-card: rgba(15, 23, 42, 0.92);
  --bg-card-solid: #0f172a;
  --bg-card-hover: #1e293b;
  --bg-input: #1e293b;
  --bg-elevated: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-focus: #10b981;
  --border-highlight: rgba(255, 255, 255, 0.08);
  
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.55), 0 2px 8px -2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 32px -4px rgba(0, 0, 0, 0.65), 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 48px -8px rgba(0, 0, 0, 0.8), 0 8px 20px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 32px rgba(16, 185, 129, 0.3);
  --shadow-card-inner: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  
  --badge-cognitive: #10b981;
  --badge-depression: #c084fc;
  --badge-anxiety: #38bdf8;
  --badge-trauma: #fb7185;
  --badge-substance: #fbbf24;
  --badge-clinical: #94a3b8;
}

[data-theme="dark"] body {
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
}

[data-theme="dark"] .welcome-container,
[data-theme="dark"] .landing-container {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-card-inner), var(--shadow-lg);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"] {
  background: #111827 !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="number"]:focus {
  border-color: var(--primary) !important;
  background: #0f172a !important;
  box-shadow: 0 0 0 3.5px var(--primary-light) !important;
}

[data-theme="dark"] .card {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: var(--shadow-card-inner), var(--shadow);
}

[data-theme="dark"] .bottom-nav {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-card-inner), 0 10px 30px -4px rgba(0,0,0,0.6);
}

[data-theme="dark"] .header {
  background: #0b1120;
  border-bottom-color: var(--border);
}

[data-theme="dark"] .search-bar {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .search-bar input {
  background: transparent;
  color: var(--text-primary);
}

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

[data-theme="dark"] .chip.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

[data-theme="dark"] .modal-overlay {
  background: rgba(8, 14, 10, 0.85);
}

[data-theme="dark"] .modal-container {
  background: #131d16;
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="dark"] .option-item {
  border-color: var(--border) !important;
  background: var(--bg-card);
}

[data-theme="dark"] .option-item.selected {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

[data-theme="dark"] .severity-badge {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(82, 183, 136, 0.3);
}

/* Theme transition */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition: background-color 0.3s ease, color 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Theme toggle button */
.theme-toggle-btn {
  position: relative;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  border: 1px solid var(--border);
  background: var(--bg-card-solid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
[data-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(45, 212, 191, 0.15);
  border-color: var(--primary);
}

[data-theme="dark"] .nav-item {
  color: var(--text-secondary);
}

[data-theme="dark"] .nav-item:hover {
  background-color: rgba(45, 212, 191, 0.12);
  color: var(--primary);
}

[data-theme="dark"] .nav-item.active {
  background-color: rgba(45, 212, 191, 0.15);
  color: var(--primary);
}

[data-theme="dark"] .bottom-nav-actions {
  background: rgba(15, 23, 42, 0.95);
  border-top-color: var(--border);
}

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

[data-theme="dark"] .btn-secondary:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #070a11;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 18px -2px var(--primary-glow);
}

[data-theme="dark"] .client-info-card {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] .result-card {
  background: var(--bg-card);
}

[data-theme="dark"] .quick-start-card {
  background: var(--bg-card);
}

[data-theme="dark"] .info-banner {
  background: rgba(45, 212, 191, 0.08) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .info-banner p,
[data-theme="dark"] .info-banner svg {
  color: var(--primary) !important;
}

[data-theme="dark"] .progress-container {
  background: var(--border);
}

[data-theme="dark"] .assessment-header {
  background: var(--bg);
}

/* ================================================ */
/* DARK THEME - Interactive Test Modules (inline)   */
/* ================================================ */

/* Universal: any card/div inside assessment with white bg */
[data-theme="dark"] #assessment-form .card,
[data-theme="dark"] #assessment-form > div > .card,
[data-theme="dark"] #assessment-form [style*="background:#fff"],
[data-theme="dark"] #assessment-form [style*="background: #fff"],
[data-theme="dark"] #assessment-form [style*="background:#ffffff"],
[data-theme="dark"] #assessment-form [style*="background: #ffffff"],
[data-theme="dark"] #assessment-form [style*="background: white"],
[data-theme="dark"] #assessment-form [style*="background:white"] {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

/* Light gray backgrounds (#f8fafc, #f0f9ff, #eff6ff, etc) */
[data-theme="dark"] #assessment-form [style*="background:#f8f"],
[data-theme="dark"] #assessment-form [style*="background: #f8f"],
[data-theme="dark"] #assessment-form [style*="background:#f0f"],
[data-theme="dark"] #assessment-form [style*="background: #f0f"],
[data-theme="dark"] #assessment-form [style*="background:#eff"],
[data-theme="dark"] #assessment-form [style*="background: #eff"],
[data-theme="dark"] #assessment-form [style*="background:#ecf"],
[data-theme="dark"] #assessment-form [style*="background: #ecf"] {
  background: rgba(45, 212, 191, 0.06) !important;
  border-color: var(--border) !important;
}

/* Option labels (GAD-7, PHQ-9, PCL-5) - unselected */
[data-theme="dark"] #assessment-form label[style*="background: #fff"],
[data-theme="dark"] #assessment-form label[style*="background:#fff"],
[data-theme="dark"] #assessment-form label[style*="background: white"],
[data-theme="dark"] #assessment-form label[style*="background:#ffffff"] {
  background: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

/* Option labels - selected (blue bg) */
[data-theme="dark"] #assessment-form label[style*="background: #eff6ff"],
[data-theme="dark"] #assessment-form label[style*="background:#eff6ff"] {
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: #3b82f6 !important;
}

/* Dark text colors inside modules */
[data-theme="dark"] #assessment-form [style*="color:#1e293b"],
[data-theme="dark"] #assessment-form [style*="color: #1e293b"],
[data-theme="dark"] #assessment-form [style*="color:#334155"],
[data-theme="dark"] #assessment-form [style*="color: #334155"],
[data-theme="dark"] #assessment-form [style*="color:#1e3a8a"],
[data-theme="dark"] #assessment-form [style*="color: #1e3a8a"],
[data-theme="dark"] #assessment-form [style*="color:#1a1a2e"],
[data-theme="dark"] #assessment-form [style*="color: #1a1a2e"] {
  color: var(--text-primary) !important;
}

/* Secondary text colors */
[data-theme="dark"] #assessment-form [style*="color:#64748b"],
[data-theme="dark"] #assessment-form [style*="color: #64748b"],
[data-theme="dark"] #assessment-form [style*="color:#475569"],
[data-theme="dark"] #assessment-form [style*="color: #475569"] {
  color: var(--text-secondary) !important;
}

/* Blue accent text */
[data-theme="dark"] #assessment-form [style*="color:#1e40af"],
[data-theme="dark"] #assessment-form [style*="color: #1e40af"] {
  color: #60a5fa !important;
}

/* Borders */
[data-theme="dark"] #assessment-form [style*="border:1px solid #e2e8f0"],
[data-theme="dark"] #assessment-form [style*="border: 1px solid #e2e8f0"],
[data-theme="dark"] #assessment-form [style*="border:1px solid #cbd5e1"],
[data-theme="dark"] #assessment-form [style*="border: 1px solid #cbd5e1"],
[data-theme="dark"] #assessment-form [style*="border:2px solid #e2e8f0"],
[data-theme="dark"] #assessment-form [style*="border: 2px solid #e2e8f0"] {
  border-color: var(--border) !important;
}

/* Select dropdowns and inputs inside modules */
[data-theme="dark"] #assessment-form select,
[data-theme="dark"] #assessment-form input[type="text"],
[data-theme="dark"] #assessment-form input[type="number"],
[data-theme="dark"] #assessment-form textarea,
[data-theme="dark"] #assessment-form select[style*="background:#fff"],
[data-theme="dark"] #assessment-form select[style*="background: #fff"],
[data-theme="dark"] #assessment-form select[style*="background:white"],
[data-theme="dark"] #assessment-form select[style*="background: white"] {
  background: var(--bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

/* Canvas containers (CDT, Stroop, TMT) */
[data-theme="dark"] #assessment-form canvas {
  border-color: var(--border) !important;
}

/* Word chips / tags in COWAT, etc */
[data-theme="dark"] #assessment-form [style*="display:inline-flex"][style*="background:#fff"],
[data-theme="dark"] #assessment-form [style*="display: inline-flex"][style*="background:#fff"] {
  background: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

/* Word list area (COWAT) */
[data-theme="dark"] #assessment-form [style*="background:#f8fafc"][style*="border:1px solid #e2e8f0"],
[data-theme="dark"] #assessment-form [style*="background: #f8fafc"] {
  background: var(--bg) !important;
  border-color: var(--border) !important;
}

/* General h3, h4, p, span inside assessment */
[data-theme="dark"] #assessment-form h3,
[data-theme="dark"] #assessment-form h4 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] #assessment-form p {
  color: var(--text-secondary) !important;
}

/* Result page dark */
[data-theme="dark"] #result-page .card,
[data-theme="dark"] #result-page .result-card {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] #result-page h2,
[data-theme="dark"] #result-page h3,
[data-theme="dark"] #result-page h4 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] #result-page p,
[data-theme="dark"] #result-page .text-muted {
  color: var(--text-secondary) !important;
}

/* Bottom nav actions (Geri/İrəli buttons bar) */
[data-theme="dark"] .bottom-nav-actions {
  background: var(--bg-card) !important;
  border-top-color: var(--border) !important;
}

/* Test category cards in library */
[data-theme="dark"] .test-card {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .test-card h4,
[data-theme="dark"] .test-card h3 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .test-card p {
  color: var(--text-secondary) !important;
}

/* History page */
[data-theme="dark"] #history-list .card {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}

/* Settings page */
[data-theme="dark"] .settings-section {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}

/* ================================================ */
/* DARK THEME - TMT Module                          */
/* ================================================ */
[data-theme="dark"] .tmt-field {
  background: #0f172a !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .tmt-node {
  background: var(--bg-card) !important;
  border-color: #94a3b8 !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .tmt-node-letter {
  border-color: #38bdf8 !important;
  color: #7dd3fc !important;
}

[data-theme="dark"] .tmt-node-active {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(45,212,191,0.2), 0 4px 10px rgba(45,212,191,0.3) !important;
}

[data-theme="dark"] .tmt-node-error {
  box-shadow: 0 0 0 4px rgba(239,68,68,0.2) !important;
}

[data-theme="dark"] .tmt-partA-summary {
  background: var(--bg) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .tmt-complete-icon {
  background: rgba(16,185,129,0.1) !important;
}

[data-theme="dark"] .tmt-complete-badge {
  background: rgba(16,185,129,0.1) !important;
  color: #34d399 !important;
}

[data-theme="dark"] .tmt-results-summary {
  background: var(--bg) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .tmt-result-row {
  color: var(--text-primary) !important;
  border-bottom-color: var(--border) !important;
}

/* ================================================ */
/* DARK THEME - Stroop Module                       */
/* ================================================ */
[data-theme="dark"] .stroop-display-card,
[data-theme="dark"] .stroop-intro-card,
[data-theme="dark"] .stroop-result-card {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .stroop-info-bar {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}

/* ================================================ */
/* DARK THEME - CDT Module                          */
/* ================================================ */
[data-theme="dark"] #cdt-canvas {
  background: #1e293b !important;
}

[data-theme="dark"] .cdt-toolbar {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .cdt-scoring-card {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

/* ================================================ */
/* DARK THEME - COWAT Module                        */
/* ================================================ */
[data-theme="dark"] #cowat-word-list {
  background: var(--bg) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .cowat-word-chip {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}

/* ================================================ */
/* DARK THEME - Digit Span Module                   */
/* ================================================ */
[data-theme="dark"] .digit-span-intro-card,
[data-theme="dark"] .digit-span-display-card,
[data-theme="dark"] .digit-span-answer-card {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] #digit-presentation-area {
  color: var(--primary) !important;
}

[data-theme="dark"] .digit-key-btn {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .digit-key-btn:hover {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

[data-theme="dark"] .digit-key-btn[data-action="clear"] {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] .digit-key-btn.btn-key-delete,
[data-theme="dark"] .digit-key-btn[data-action="delete"] {
  background: rgba(255, 143, 163, 0.15) !important;
  color: #ff8fa3 !important;
  border-color: rgba(255, 143, 163, 0.3) !important;
}

[data-theme="dark"] .digit-input-display-box {
  background: rgba(12, 20, 16, 0.85) !important;
  border-color: var(--border) !important;
}

/* ================================================ */
/* DARK THEME - GAD-7 / PHQ-9 / PCL-5 Sticky Bar   */
/* ================================================ */
[data-theme="dark"] #assessment-form [style*="border-left: 5px solid"] {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}

[data-theme="dark"] #assessment-form [style*="border-left: 5px solid #2563eb"] {
  border-left-color: #3b82f6 !important;
}

/* Likert instruction box */
[data-theme="dark"] #assessment-form [style*="background: #dbeafe"],
[data-theme="dark"] #assessment-form [style*="background:#dbeafe"],
[data-theme="dark"] #assessment-form [style*="background: #eff6ff"],
[data-theme="dark"] #assessment-form [style*="background:#eff6ff"] {
  background: rgba(59, 130, 246, 0.1) !important;
  border-color: var(--border) !important;
}

/* Dot progress indicators */
[data-theme="dark"] #assessment-form [style*="background: #e2e8f0"],
[data-theme="dark"] #assessment-form [style*="background:#e2e8f0"] {
  background: var(--border) !important;
}

/* Radio circle unselected */
[data-theme="dark"] #assessment-form [style*="border: 2px solid #cbd5e1"] {
  border-color: var(--text-muted) !important;
  background: var(--bg) !important;
}

/* ================================================ */
/* LANGUAGE SWITCHER                                */
/* ================================================ */
.lang-switcher {
  position: relative;
  display: inline-block;
  z-index: 1001;
}

.lang-switcher-btn {
  display: flex !important;
  align-items: center;
  gap: 5px;
  padding: 0 12px !important;
  height: 38px !important;
  border-radius: var(--radius-pill) !important;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: auto !important;
  flex-shrink: 0;
}

.lang-switcher-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.lang-code {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 172px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 99999;
  overflow: hidden;
  animation: langDropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-dropdown.show {
  display: block;
}

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

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.15s ease;
  text-align: left;
}

.lang-option:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.lang-option.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.lang-opt-flag {
  font-size: 18px;
  line-height: 1;
}

/* Dark theme overrides */
[data-theme="dark"] .lang-dropdown {
  background: #131d16 !important;
  border-color: var(--border) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .lang-option:hover {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
}

[data-theme="dark"] .lang-option.active {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
}

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

[data-theme="dark"] .lang-switcher-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* Welcome Screen 5-Language Selector */
.welcome-lang-selector {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.welcome-lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.welcome-lang-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.welcome-lang-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(13, 110, 110, 0.25);
}

.welcome-lang-chip .chip-flag {
  font-size: 15px;
  line-height: 1;
}

.welcome-lang-chip .chip-name {
  font-size: 12px;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .welcome-lang-chip {
  background: #1e2430;
  border-color: #2e3848;
  color: #94a3b8;
}

[data-theme="dark"] .welcome-lang-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(45, 212, 191, 0.1);
}

[data-theme="dark"] .welcome-lang-chip.active {
  background: var(--primary);
  color: #11141a;
  border-color: var(--primary);
}

/* Landing Page Animations & Styling */
.landing-logo-wrapper img {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.landing-container:hover .landing-logo-wrapper img {
  transform: scale(1.05);
}

#btn-landing-start {
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#btn-landing-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 110, 110, 0.4);
}

#btn-landing-start:active {
  transform: scale(0.98);
}

.landing-features div {
  transition: all 0.2s ease;
}

.landing-features div:hover {
  transform: translateX(4px);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ================================================ */
/* AI PSYCHOLOGICAL ASSISTANT CHATBOT STYLES       */
/* ================================================ */

/* Hide chatbot floating elements if any exist */
body.in-assessment #psychometrica-chatbot-widget,
body.in-assessment .chatbot-floating-btn,
body.in-assessment .chatbot-window,
#assessment-page.active ~ #psychometrica-chatbot-widget,
#result-page.active ~ #psychometrica-chatbot-widget {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.chatbot-btn-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.4;
  z-index: -1;
  animation: chatbotPulse 2.5s infinite;
}

@keyframes chatbotPulse {
  0% { transform: scale(1); opacity: 0.5; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.chatbot-btn-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #ef4444;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

/* Chat Window Modal */
.chatbot-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 460px;
  height: 620px;
  max-height: calc(100vh - 110px);
  max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatbotSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatbotSlideUp {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatbot-window-exit {
  opacity: 0 !important;
  transform: translateY(12px) scale(0.97) !important;
  transition: all 0.2s ease !important;
}

/* Header */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.chatbot-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.chatbot-status-indicator {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
}

.chatbot-header-info h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.chatbot-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.chatbot-header-btn:hover {
  background: var(--primary-light);
  color: var(--text-primary);
}

/* Disclaimer Bar */
.chatbot-disclaimer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(13, 110, 110, 0.06);
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1px solid rgba(13, 110, 110, 0.08);
}

.chatbot-disclaimer-badge {
  font-size: 12px;
}

/* Messages Container */
.chatbot-messages-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg);
  scroll-behavior: smooth;
}

.chatbot-msg-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.chatbot-msg-row.user-row {
  justify-content: flex-end;
}

.chatbot-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}

.chatbot-msg-bubble {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.user-bubble {
  background: var(--primary);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(13, 110, 110, 0.2);
}

.user-bubble .chatbot-msg-text {
  color: #ffffff;
}

.user-bubble .chatbot-msg-time {
  color: rgba(255, 255, 255, 0.7);
  display: block;
  font-size: 10px;
  text-align: right;
  margin-top: 4px;
}

.assistant-bubble {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.assistant-bubble .chatbot-msg-time {
  color: var(--text-muted);
  display: block;
  font-size: 10px;
  margin-top: 6px;
}

.chatbot-bullet-line {
  margin: 3px 0;
  padding-left: 4px;
}

.chatbot-bullet {
  color: var(--primary);
  font-weight: bold;
}

/* Recommendations Box */
.chatbot-recommendations-box {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chatbot-rec-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.chatbot-test-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.chatbot-test-card:hover {
  border-color: var(--primary);
}

.chatbot-test-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.chatbot-test-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.chatbot-test-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.chatbot-test-why {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.chatbot-test-why strong {
  color: var(--text-primary);
}

.chatbot-test-disclaimer {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.chatbot-test-action-btn {
  width: 100%;
  padding: 8px 12px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.chatbot-test-action-btn:hover {
  background: var(--primary-dark);
}

/* Safety Card (Qaynar xətt nömrələri olmadan, qayğı və təhlükəsizlik) */
.assistant-bubble.safety-mode {
  border-color: #f59e0b;
  background: #fffbeb;
}

.chatbot-safety-card {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
}

.chatbot-safety-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #b45309;
  font-weight: 700;
  margin-bottom: 4px;
}

.chatbot-safety-guidance {
  font-size: 12px;
  color: #92400e;
  line-height: 1.4;
  margin: 0;
}

/* Advice Box */
.chatbot-advice-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--primary-light);
  border-radius: 10px;
  border: 1px solid rgba(13, 110, 110, 0.1);
}

.chatbot-advice-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 6px;
}

.chatbot-advice-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.chatbot-advice-list li {
  margin-bottom: 4px;
}

.chatbot-pro-note {
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px dashed var(--border);
}

/* Typing Dots */
.thinking-bubble {
  padding: 12px 18px;
}

.chatbot-typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chatbot-typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.chatbot-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

/* Suggestions Container */
.chatbot-suggestions-container {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.chatbot-suggestions-container::-webkit-scrollbar {
  display: none;
}

.chatbot-chip {
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--primary-light);
  border: 1px solid rgba(13, 110, 110, 0.15);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  outline: none;
  flex-shrink: 0;
}

.chatbot-chip:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.chatbot-chip.highlight {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}

.chatbot-chip.highlight:hover {
  background: #f59e0b;
  color: #ffffff;
}

/* Footer / Input */
.chatbot-footer {
  padding: 10px 14px 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.chatbot-input-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 6px 4px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-input-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(13, 110, 110, 0.12);
}

.chatbot-textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 13.5px;
  color: var(--text-primary);
  padding: 8px 0;
  max-height: 100px;
  line-height: 1.35;
}

.chatbot-textarea::placeholder {
  color: var(--text-muted);
}

.chatbot-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: scale(1.04);
}

.chatbot-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Mobile Responsiveness */
@media (max-width: 639px) {
  .chatbot-floating-btn {
    display: none !important;
  }

  .chatbot-window {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 86vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
}

/* Dark Theme Overrides */
[data-theme="dark"] .chatbot-floating-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px var(--primary-glow);
}

[data-theme="dark"] .chatbot-window {
  background: #131d16;
  border-color: var(--border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .chatbot-header,
[data-theme="dark"] .chatbot-footer,
[data-theme="dark"] .chatbot-suggestions-container {
  background: #131d16;
  border-color: var(--border);
}

[data-theme="dark"] .chatbot-disclaimer-bar {
  background: rgba(45, 212, 191, 0.08);
  color: #2dd4bf;
  border-color: rgba(45, 212, 191, 0.15);
}

[data-theme="dark"] .chatbot-messages-container {
  background: #11141a;
}

[data-theme="dark"] .assistant-bubble {
  background: #1e2430;
  border-color: #2e3848;
  color: #f1f5f9;
}

[data-theme="dark"] .chatbot-test-card {
  background: #181c24;
  border-color: #2e3848;
}

[data-theme="dark"] .chatbot-test-card:hover {
  border-color: #2dd4bf;
}

[data-theme="dark"] .chatbot-advice-box {
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.15);
}

[data-theme="dark"] .chatbot-advice-title,
[data-theme="dark"] .chatbot-rec-title {
  color: #2dd4bf;
}

[data-theme="dark"] .chatbot-chip {
  background: rgba(45, 212, 191, 0.1);
  color: #2dd4bf;
  border-color: rgba(45, 212, 191, 0.2);
}

[data-theme="dark"] .chatbot-chip:hover {
  background: #2dd4bf;
  color: #11141a;
}

[data-theme="dark"] .chatbot-input-form {
  background: #11141a;
  border-color: #2e3848;
}

[data-theme="dark"] .chatbot-pro-note {
  background: #181c24;
  border-color: #2e3848;
}

[data-theme="dark"] .assistant-bubble.safety-mode {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
}

/* ================================================ */
/* PSYCHOMETRICA PREMIUM FOOTER SYSTEM              */
/* ================================================ */

.app-footer {
  width: 100%;
  max-width: 900px;
  margin: 44px auto 0;
  padding: 20px 16px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 10;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.app-footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.footer-brand {
  font-weight: 700;
  color: var(--text-primary);
}

.footer-dot {
  color: var(--text-muted);
  font-weight: 700;
  opacity: 0.6;
}

.footer-author {
  color: var(--text-secondary);
}

.footer-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.footer-nav-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-nav-link:hover,
.footer-nav-link:focus {
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
  outline: none;
}

.footer-separator {
  color: var(--border);
  font-size: 10px;
  user-select: none;
}

.footer-version-row {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

.footer-version-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ================================================ */
/* ABOUT, SUPPORT, TERMS & PRIVACY PAGES STYLING   */
/* ================================================ */

.legal-page-container {
  padding: 28px 24px;
  border-radius: 20px;
  margin-top: 16px;
  margin-bottom: 24px;
}

.about-hero {
  text-align: center;
  padding: 20px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.about-logo {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  margin-bottom: 14px;
}

.about-hero h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.about-tagline {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px;
  font-weight: 500;
}

.about-badge-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.about-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 28px;
}

.about-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.about-info-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.about-info-val {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 700;
}

.legal-section {
  margin-bottom: 28px;
}

.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-section p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 10px;
}

.about-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.about-feature-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.2s ease;
}

.about-feature-box:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.feature-icon-mini {
  font-size: 22px;
  margin-bottom: 8px;
}

.about-feature-box h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.about-feature-box p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Support Page Accordion / Items */
.support-intro-box {
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.support-intro-box h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 6px;
}

.support-intro-box p {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.faq-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.2s ease;
}

.faq-question {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.faq-q-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.faq-question strong {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 700;
}

.faq-answer {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  padding-left: 34px;
}

/* Legal Header Block */
.legal-header-block {
  padding: 14px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.legal-header-block h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 6px;
}

.legal-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.legal-date {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Dark Theme Overrides for Footer and Legal Pages */
[data-theme="dark"] .app-footer {
  border-top-color: var(--border);
}

[data-theme="dark"] .footer-version-badge {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .about-info-grid,
[data-theme="dark"] .about-feature-box,
[data-theme="dark"] .faq-item {
  background: var(--bg-card);
  border-color: var(--border);
}

@media (max-width: 639px) {
  .app-footer {
    margin-top: 24px;
    padding: 20px 16px 85px; /* extra padding to clear floating island dock */
  }

  .footer-meta-row {
    font-size: 12px;
  }

  .footer-nav-row {
    gap: 4px;
  }

  .footer-nav-link {
    font-size: 12px;
    padding: 3px 6px;
  }
}

[data-theme="dark"] .chatbot-safety-guidance {
  color: #fcd34d;
}

/* ==========================================================================
   Android Native Safe Area & Touch Optimizations
   ========================================================================== */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

body {
  padding-top: var(--sat);
  padding-left: var(--sal);
  padding-right: var(--sar);
}

/* Allow text selection in inputs, textareas, and results */
input, textarea, .result-card, .test-instructions, .report-text, .clinical-note {
  user-select: text;
  -webkit-user-select: text;
}

/* Interactive Canvas Touch Tuning for Clock Drawing and TMT */
canvas#cdt-canvas,
canvas.cdt-drawing-canvas,
.tmt-interactive-container canvas,
.interactive-test-canvas {
  touch-action: none !important;
  -ms-touch-action: none !important;
}

/* Chatbot window safe area clearance */
#chatbot-window {
  bottom: calc(65px + var(--sab)) !important;
  max-height: calc(100vh - 75px - var(--sat) - var(--sab)) !important;
}

body.has-admob-banner #chatbot-window {
  bottom: calc(125px + var(--sab)) !important;
  max-height: calc(100vh - 135px - var(--sat) - var(--sab)) !important;
}

/* ==========================================================================
   Mobile Performance & Fluid 60/120fps Touch Acceleration
   ========================================================================== */
html, body {
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.page {
  overflow: visible;
}

/* Tactile instant mobile press feedback */
button:active, .btn-primary:active, .btn-secondary:active, .chip:active, .test-card:active {
  transform: scale(0.975);
  transition: transform 0.06s ease;
}

/* Smooth inertia scrolling on content areas */
.content, .history-container, #history-list, .test-categories-container, .modal-container {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Empty state styling enhancement */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 12px;
  opacity: 0.65;
}

.empty-state p {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ==========================================================================
   Zero-Layout-Shift Shimmer Skeleton Loading
   ========================================================================== */
@keyframes skeletonShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, rgba(226, 232, 240, 0.6) 25%, rgba(241, 245, 249, 0.9) 50%, rgba(226, 232, 240, 0.6) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-sm);
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.7) 25%, rgba(51, 65, 85, 0.9) 50%, rgba(30, 41, 59, 0.7) 75%);
  background-size: 200% 100%;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 6px;
}

.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
  border-radius: 8px;
}

.skeleton-card {
  padding: 18px 20px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.skeleton-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==========================================================================
   Staggered Reveal Animations
   ========================================================================== */
@keyframes fadeInUpStagger {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-stagger-1 { animation: fadeInUpStagger 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.04s both; }
.animate-stagger-2 { animation: fadeInUpStagger 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.10s both; }
.animate-stagger-3 { animation: fadeInUpStagger 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both; }
.animate-stagger-4 { animation: fadeInUpStagger 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both; }
.animate-stagger-5 { animation: fadeInUpStagger 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both; }

/* PDF Snapshot Freeze & Print Rules - Force 100% Opacity inside result container */
body.pdf-exporting #result-container,
body.pdf-exporting #result-container * {
  animation: none !important;
  transition: none !important;
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* ==========================================================================
   PDF Generation Waiting Overlay (Modal)
   ========================================================================== */
.pdf-loading-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  touch-action: none;
  user-select: none;
  pointer-events: auto;
}

.pdf-loading-modal-backdrop.active {
  opacity: 1;
}

.pdf-loading-card {
  background: var(--bg-card-solid, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 24px;
  padding: 32px 28px 26px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: scale(0.92) translateY(8px);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.pdf-loading-modal-backdrop.active .pdf-loading-card {
  transform: scale(1) translateY(0);
}

.pdf-loading-shimmer-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #059669, #10b981, #34d399, #059669);
  background-size: 200% 100%;
  animation: pdfShimmerMove 2s linear infinite;
}

.pdf-loading-icon-wrap {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-loading-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.22) 0%, rgba(5, 150, 105, 0) 70%);
  animation: pdfRingPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.pdf-loading-icon-circle {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.12) 0%, rgba(16, 185, 129, 0.06) 100%);
  border: 1.5px solid rgba(5, 150, 105, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-loading-spinner-orbit {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: var(--primary, #059669);
  border-right-color: rgba(5, 150, 105, 0.35);
  animation: pdfSpinOrbit 1.1s linear infinite;
}

.pdf-loading-file-icon {
  color: var(--primary, #059669);
  filter: drop-shadow(0 2px 4px rgba(5, 150, 105, 0.25));
}

.pdf-loading-title {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.02em;
}

.pdf-loading-desc {
  margin: 0 0 20px 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary, #64748b);
}

.pdf-loading-bar-track {
  width: 100%;
  height: 5px;
  background: var(--border, #e2e8f0);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 18px;
}

.pdf-loading-bar-thumb {
  position: absolute;
  height: 100%;
  width: 45%;
  border-radius: 999px;
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
  box-shadow: 0 0 10px rgba(5, 150, 105, 0.5);
  animation: pdfBarSlide 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.pdf-loading-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-light, rgba(5, 150, 105, 0.08));
  color: var(--primary, #059669);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

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

@keyframes pdfSpinOrbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pdfRingPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.45; }
  50% { transform: scale(1.15); opacity: 0.95; }
}

@keyframes pdfBarSlide {
  0% { left: -45%; width: 45%; }
  50% { left: 30%; width: 60%; }
  100% { left: 100%; width: 45%; }
}

[data-theme="dark"] .pdf-loading-card {
  background: #131d16;
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .pdf-loading-bar-track {
  background: rgba(255, 255, 255, 0.08);
}

@media print {
  #pdf-loading-modal {
    display: none !important;
  }
}

/* ==========================================================================
   Chatbot Floating Trigger Pulse Ring
   ========================================================================== */
@keyframes ambientGlowPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.45), 0 8px 24px -4px var(--primary-glow);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(5, 150, 105, 0), 0 12px 28px -4px var(--primary-glow);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0), 0 8px 24px -4px var(--primary-glow);
  }
}

.chatbot-floating-btn {
  animation: ambientGlowPulse 3s infinite cubic-bezier(0.4, 0, 0.6, 1);
  transition: all 0.22s cubic-bezier(0.2, 0, 0, 1) !important;
}

.chatbot-floating-btn:hover {
  transform: scale(1.08) translateY(-2px) !important;
}

.chatbot-floating-btn:active {
  transform: scale(0.92) !important;
}

/* ==========================================================================
   Toast / Micro Feedback Notification
   ========================================================================== */
.toast-container {
  position: fixed;
  top: calc(16px + var(--sat));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 40px);
  max-width: 400px;
}

.toast-item {
  background: var(--bg-card-solid);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  animation: toastSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

.toast-item.toast-success {
  border-left: 4px solid var(--primary);
}

@keyframes toastSlideDown {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Full-Screen Native Chatbot Panel (#chatbot-page) - Glassmorphic Portal
   (Permanently locked to Deep Obsidian Cyber-Glass realm matching mockup)
   ========================================================================== */
#chatbot-page.page,
#chatbot-page {
  position: relative !important;
  height: 100vh !important;
  max-height: 100vh !important;
  display: none;
  flex-direction: row !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  box-sizing: border-box !important;
  isolation: isolate;
  
  /* Specialty Theme Variables (Default: General / Cosmic Indigo) */
  --aurora-1: rgba(99, 102, 241, 0.45);
  --aurora-2: rgba(168, 85, 247, 0.35);
  --aurora-3: rgba(59, 130, 246, 0.3);
  --specialty-glow: rgba(99, 102, 241, 0.55);
  --specialty-accent: #6366f1;
  background: radial-gradient(circle at 50% 10%, #0d1322 0%, #080c16 50%, #04060b 100%) !important;
  transition: background 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] #chatbot-page.page,
[data-theme="light"] #chatbot-page.page,
[data-theme="light"] #chatbot-page,
[data-theme="dark"] #chatbot-page {
  background: radial-gradient(circle at 50% 10%, #0d1322 0%, #080c16 50%, #04060b 100%) !important;
}

/* Specialty Modes Ambient Auras */
#chatbot-page.page[data-specialty="anxiety"],
#chatbot-page[data-specialty="anxiety"] {
  --aurora-1: rgba(16, 185, 129, 0.48);
  --aurora-2: rgba(6, 182, 212, 0.38);
  --aurora-3: rgba(52, 211, 153, 0.32);
  --specialty-glow: rgba(16, 185, 129, 0.6);
  --specialty-accent: #10b981;
}

#chatbot-page.page[data-specialty="depression"],
#chatbot-page[data-specialty="depression"] {
  --aurora-1: rgba(245, 158, 11, 0.45);
  --aurora-2: rgba(236, 72, 153, 0.38);
  --aurora-3: rgba(139, 92, 246, 0.32);
  --specialty-glow: rgba(245, 158, 11, 0.6);
  --specialty-accent: #f59e0b;
}

#chatbot-page.page[data-specialty="trauma"],
#chatbot-page[data-specialty="trauma"] {
  --aurora-1: rgba(59, 130, 246, 0.5);
  --aurora-2: rgba(99, 102, 241, 0.42);
  --aurora-3: rgba(14, 165, 233, 0.35);
  --specialty-glow: rgba(59, 130, 246, 0.6);
  --specialty-accent: #3b82f6;
}

#chatbot-page.page[data-specialty="cognitive"],
#chatbot-page[data-specialty="cognitive"] {
  --aurora-1: rgba(139, 92, 246, 0.5);
  --aurora-2: rgba(14, 165, 233, 0.42);
  --aurora-3: rgba(236, 72, 153, 0.35);
  --specialty-glow: rgba(139, 92, 246, 0.6);
  --specialty-accent: #8b5cf6;
}

#chatbot-page.page[data-specialty="sleep"],
#chatbot-page[data-specialty="sleep"] {
  --aurora-1: rgba(79, 70, 229, 0.48);
  --aurora-2: rgba(49, 46, 129, 0.65);
  --aurora-3: rgba(124, 58, 237, 0.38);
  --specialty-glow: rgba(124, 58, 237, 0.6);
  --specialty-accent: #7c3aed;
}

/* Living Aurora Portal Background */
.chatbot-aurora-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  opacity: 0.95;
}

.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  will-change: transform, opacity;
  transition: background 0.8s ease;
}

.aurora-orb-1 {
  top: -15%;
  left: -10%;
  width: 540px;
  height: 540px;
  background: var(--aurora-1);
  animation: auroraDrift1 18s infinite alternate ease-in-out;
}

.aurora-orb-2 {
  bottom: -15%;
  right: -10%;
  width: 580px;
  height: 580px;
  background: var(--aurora-2);
  animation: auroraDrift2 22s infinite alternate ease-in-out;
}

.aurora-orb-3 {
  top: 35%;
  left: 30%;
  width: 460px;
  height: 460px;
  background: var(--aurora-3);
  animation: auroraDrift3 15s infinite alternate ease-in-out;
}

@keyframes auroraDrift1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.15); }
  100% { transform: translate(-30px, 70px) scale(0.95); }
}

@keyframes auroraDrift2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, -50px) scale(1.2); }
  100% { transform: translate(40px, -60px) scale(0.9); }
}

@keyframes auroraDrift3 {
  0% { transform: translate(0, 0) scale(0.9); opacity: 0.65; }
  50% { transform: translate(40px, -40px) scale(1.25); opacity: 0.98; }
  100% { transform: translate(-50px, 30px) scale(1); opacity: 0.75; }
}

#chatbot-page.page.active {
  display: flex !important;
  transform: none !important;
}

/* =================================================== */
/* 1. LEFT SIDEBAR DOCK (Brand + Tools + History)      */
/* =================================================== */
.chatbot-sidebar-dock {
  width: 248px;
  flex-shrink: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(13, 17, 28, 0.94) 0%, rgba(9, 13, 22, 0.98) 100%);
  backdrop-filter: blur(32px) saturate(210%);
  -webkit-backdrop-filter: blur(32px) saturate(210%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04), 4px 0 24px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 25;
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  overflow: hidden;
}

/* Brand Header */
.chatbot-brand-header {
  padding: calc(12px + var(--sat)) 12px 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  position: relative;
  transition: padding 0.25s ease;
}

.chatbot-brand-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

/* Glowing Jewel Brand Avatar */
.chatbot-brand-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.32) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.chatbot-brand-avatar:hover {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.6) !important;
}

.brand-avatar-ring {
  position: absolute;
  inset: -1px;
  border-radius: 10px;
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
  pointer-events: none;
  animation: spinAvatarRing 24s linear infinite;
}

@keyframes spinAvatarRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.brand-avatar-letter {
  font-size: 16px;
  font-weight: 900;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  line-height: 1;
  position: relative;
  z-index: 2;
  font-family: inherit;
}

.chatbot-brand-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chatbot-brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-brand-title {
  font-size: 14.5px;
  font-weight: 800;
  margin: 0;
  color: #ffffff !important;
  letter-spacing: -0.2px;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatbot-brand-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  display: inline-block;
  flex-shrink: 0;
  animation: pulseActiveDot 2.4s ease-in-out infinite;
}

@keyframes pulseActiveDot {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

.chatbot-brand-badge {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #c084fc !important;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  width: fit-content;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-badge-sparkle {
  color: #f472b6;
  font-size: 9px;
  animation: sparkleTwinkle 2.5s ease-in-out infinite;
}

@keyframes sparkleTwinkle {
  0%, 100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
    filter: drop-shadow(0 0 4px #f472b6);
  }
}

.chatbot-brand-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* 3-line Toggle Collapse/Expand Button */
.chatbot-sidebar-toggle-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.chatbot-sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.chatbot-sidebar-toggle-btn:active {
  transform: scale(0.95);
}

.chatbot-sidebar-close {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.chatbot-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Sidebar Action: New Chat Button (Aesthetic, Compact Pill) */
.chatbot-sidebar-action-wrap {
  padding: 8px 12px 5px;
  flex-shrink: 0;
  transition: padding 0.25s ease;
}

.chatbot-btn-new-chat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  min-height: 38px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.92) 0%, rgba(139, 92, 246, 0.92) 50%, rgba(168, 85, 247, 0.92) 100%);
  background-size: 200% auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: -0.1px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  user-select: none;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.chatbot-btn-new-chat::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s ease;
}

.chatbot-btn-new-chat:hover::after {
  left: 140%;
}

.chatbot-btn-new-chat:hover {
  background-position: right center;
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.chatbot-btn-new-chat:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.chatbot-new-chat-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chatbot-new-chat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.chatbot-new-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* Sidebar Tab Switcher (Tarixçə / Alətlər) */
.chatbot-sidebar-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  margin: 4px 12px 6px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: margin 0.25s ease, padding 0.25s ease;
}

.chatbot-sidebar-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.chatbot-sidebar-tab:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.chatbot-sidebar-tab.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.07) 100%) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.chatbot-history-count-badge {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.3);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #e0e7ff;
  font-weight: 800;
  line-height: 1.2;
}

/* Sidebar Panes */
.chatbot-sidebar-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  transition: padding 0.25s ease;
}

.chatbot-sidebar-pane::-webkit-scrollbar {
  width: 4px;
}

.chatbot-sidebar-pane::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-sidebar-pane::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

.chatbot-sidebar-pane::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* History List & Items */
.chatbot-history-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chatbot-history-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
  box-sizing: border-box;
}

.chatbot-history-item:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.chatbot-history-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.14) 100%) !important;
  border-color: rgba(139, 92, 246, 0.48) !important;
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

.chatbot-history-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #6366f1 0%, #d946ef 100%);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.85);
}

.chatbot-history-item-icon-wrap {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: #a5b4fc;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.chatbot-history-item:hover .chatbot-history-item-icon-wrap {
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.4);
}

.chatbot-history-item.active .chatbot-history-item-icon-wrap {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.45);
}

.chatbot-history-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chatbot-history-item-title {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.chatbot-history-item.active .chatbot-history-item-title {
  color: #ffffff;
  font-weight: 700;
}

.chatbot-history-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #94a3b8;
  line-height: 1;
}

.chatbot-history-item-date {
  font-size: 10px;
  color: #94a3b8;
}

.chatbot-history-item-count {
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 9px;
  font-weight: 700;
  color: #cbd5e1;
}

.chatbot-history-delete-btn {
  opacity: 0;
  visibility: hidden;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.chatbot-history-item:hover .chatbot-history-delete-btn {
  opacity: 0.65;
  visibility: visible;
}

.chatbot-history-delete-btn:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #ef4444 !important;
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

/* Empty History State */
.chatbot-history-empty {
  padding: 30px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chatbot-history-empty-art {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.empty-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16) 0%, rgba(168, 85, 247, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #a5b4fc;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.18);
  animation: floatEmptyArt 4s ease-in-out infinite;
}

@keyframes floatEmptyArt {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.chatbot-history-empty-title {
  margin: 0 0 4px 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.chatbot-history-empty-desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #94a3b8;
  max-width: 190px;
}

/* Tools Nav Section */
.chatbot-tools-nav-section {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chatbot-tools-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chatbot-tool-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-sizing: border-box;
  position: relative;
}

.chatbot-tool-item:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateX(3px);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
}

.chatbot-tool-item:active {
  transform: scale(0.98);
}

.chatbot-tool-item.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--specialty-accent);
  box-shadow: 0 3px 12px var(--specialty-glow);
}

.tool-item-icon {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.chatbot-tool-item:hover .tool-item-icon {
  transform: scale(1.06);
}

/* Tool category accents */
.tool-icon-breathing {
  background: rgba(14, 165, 233, 0.16) !important;
  border-color: rgba(14, 165, 233, 0.35) !important;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.tool-icon-grounding {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.tool-icon-mood {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.tool-icon-finder {
  background: rgba(168, 85, 247, 0.16) !important;
  border-color: rgba(168, 85, 247, 0.35) !important;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.2);
}

.tool-icon-gad7 {
  background: rgba(234, 179, 8, 0.16) !important;
  border-color: rgba(234, 179, 8, 0.35) !important;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.2);
}

.tool-icon-phq9 {
  background: rgba(99, 102, 241, 0.16) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.tool-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.tool-item-title {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.3;
}

.tool-item-desc {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.tool-item-chevron {
  font-size: 16px;
  color: #64748b;
  font-weight: 400;
  transition: transform 0.2s ease, color 0.2s ease;
  margin-left: 2px;
}

.chatbot-tool-item:hover .tool-item-chevron {
  transform: translateX(2px);
  color: #c084fc;
}

/* Sidebar Footer */
.chatbot-sidebar-footer {
  padding: 8px 12px calc(10px + var(--sab)) 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.25) 100%);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: padding 0.25s ease;
}

.chatbot-sidebar-footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 2px;
}

.chatbot-cloud-status-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  flex-shrink: 0;
  animation: pulseCloudDot 2.8s ease-in-out infinite;
}

@keyframes pulseCloudDot {
  0%, 100% {
    opacity: 0.7;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
  }
}

.chatbot-cloud-status-text {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatbot-sidebar-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-sidebar-clear-btn:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #fca5a5 !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.18);
}

.chatbot-sidebar-clear-btn:active {
  transform: translateY(0);
}

/* =================================================== */
/* COLLAPSIBLE / NARROW MINI-DOCK (Basanda daralır)     */
/* =================================================== */
#chatbot-page.sidebar-collapsed .chatbot-sidebar-dock {
  width: 66px !important;
}

#chatbot-page.sidebar-collapsed .chatbot-brand-header {
  padding: calc(10px + var(--sat)) 6px 8px;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#chatbot-page.sidebar-collapsed .chatbot-brand-left {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0;
}

#chatbot-page.sidebar-collapsed .chatbot-brand-info {
  display: none !important;
}

#chatbot-page.sidebar-collapsed .chatbot-brand-actions {
  width: 100%;
  display: flex;
  justify-content: center;
}

#chatbot-page.sidebar-collapsed .chatbot-sidebar-action-wrap {
  padding: 6px 8px;
  display: flex;
  justify-content: center;
}

#chatbot-page.sidebar-collapsed .chatbot-btn-new-chat {
  width: 42px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  justify-content: center;
  border-radius: 10px;
}

#chatbot-page.sidebar-collapsed .chatbot-btn-new-chat span[data-i18n],
#chatbot-page.sidebar-collapsed .chatbot-new-chat-badge {
  display: none !important;
}

#chatbot-page.sidebar-collapsed .chatbot-new-chat-left {
  gap: 0;
  justify-content: center;
}

#chatbot-page.sidebar-collapsed .chatbot-new-chat-icon {
  background: transparent;
  border: none;
  box-shadow: none;
  width: auto;
  height: auto;
}

#chatbot-page.sidebar-collapsed .chatbot-sidebar-tabs {
  margin: 4px 6px 6px;
  padding: 3px;
  flex-direction: column;
  gap: 4px;
}

#chatbot-page.sidebar-collapsed .chatbot-sidebar-tab {
  padding: 8px 0;
  justify-content: center;
}

#chatbot-page.sidebar-collapsed .chatbot-sidebar-tab span {
  display: none !important;
}

#chatbot-page.sidebar-collapsed .chatbot-sidebar-pane {
  padding: 6px;
}

#chatbot-page.sidebar-collapsed .chatbot-history-item {
  padding: 6px 0;
  justify-content: center;
}

#chatbot-page.sidebar-collapsed .chatbot-history-item.active::before {
  top: 4px;
  bottom: 4px;
  width: 2.5px;
}

#chatbot-page.sidebar-collapsed .chatbot-history-item-content,
#chatbot-page.sidebar-collapsed .chatbot-history-delete-btn {
  display: none !important;
}

#chatbot-page.sidebar-collapsed .chatbot-history-empty {
  padding: 16px 2px;
}

#chatbot-page.sidebar-collapsed .chatbot-history-empty-title,
#chatbot-page.sidebar-collapsed .chatbot-history-empty-desc {
  display: none !important;
}

#chatbot-page.sidebar-collapsed .empty-icon-circle {
  width: 32px;
  height: 32px;
}

#chatbot-page.sidebar-collapsed .chatbot-tool-item {
  padding: 6px 0;
  justify-content: center;
}

#chatbot-page.sidebar-collapsed .tool-item-text,
#chatbot-page.sidebar-collapsed .tool-item-chevron {
  display: none !important;
}

#chatbot-page.sidebar-collapsed .chatbot-sidebar-footer {
  padding: 6px;
  align-items: center;
}

#chatbot-page.sidebar-collapsed .chatbot-sidebar-footer-status {
  display: none !important;
}

#chatbot-page.sidebar-collapsed .chatbot-sidebar-clear-btn {
  padding: 0;
  width: 38px;
  height: 34px;
  justify-content: center;
  border-radius: 8px;
}

#chatbot-page.sidebar-collapsed .chatbot-sidebar-clear-btn span {
  display: none !important;
}

/* =================================================== */
/* 2. MAIN CHAT AREA (Full Room on Desktop)            */
/* =================================================== */
.chatbot-main-area {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  overflow: hidden;
}

.chatbot-top-bar {
  display: none !important;
}

#chatbot-clear-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #fca5a5 !important;
}

/* =================================================== */
/* 2. CHAT STREAM CONTENT (Full Space)                 */
/* =================================================== */
.chatbot-page-content {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  width: 100% !important;
  padding: 20px 24px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  position: relative !important;
  z-index: 5 !important;
  background: transparent !important;
}

.chatbot-full-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding-bottom: 12px !important;
  min-height: 100%;
  box-sizing: border-box;
}

body.has-admob-banner .chatbot-full-messages {
  padding-bottom: 12px !important;
}

/* Chat Message Bubbles */
.chat-msg {
  display: flex;
  gap: 12px;
  max-width: 88%;
  animation: chatMsgIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-assistant {
  align-self: flex-start;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: var(--specialty-accent) !important;
  box-shadow: 0 0 22px var(--specialty-glow) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.chat-bubble {
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  word-break: break-word;
}

/* Glassmorphic Assistant Bubble */
.chat-msg-assistant .chat-bubble {
  background: rgba(20, 26, 42, 0.72) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  color: #f8fafc !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  border-top-left-radius: 4px;
}

.chat-msg-assistant .chat-bubble p {
  color: #f8fafc !important;
  margin: 0 0 8px 0;
}

.chat-msg-assistant .chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-msg-assistant .chat-bubble strong {
  color: #ffffff !important;
}

/* Glassmorphic User Bubble */
.chat-msg-user .chat-bubble {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(79, 70, 229, 0.96) 100%) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
  border-top-right-radius: 4px;
}

.chat-bubble-time {
  font-size: 10px;
  opacity: 0.7;
  color: #94a3b8 !important;
  margin-top: 5px;
  text-align: right;
}

/* Glassmorphic Recommendation Cards in Chat */
.chat-test-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

.chat-test-cards-wrap .test-card {
  background: rgba(18, 24, 38, 0.78) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 18px !important;
  padding: 16px 18px !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  transition: all 0.25s ease !important;
  color: #f8fafc !important;
}

.chat-test-cards-wrap .test-card:hover {
  transform: translateY(-2px);
  border-color: var(--specialty-accent) !important;
  box-shadow: 0 14px 36px var(--specialty-glow) !important;
}

.chat-test-cards-wrap .test-card h3,
.chat-test-cards-wrap .test-card h4,
.chat-test-cards-wrap .test-card strong,
.chat-test-cards-wrap .test-card .test-card-title {
  color: #ffffff !important;
  font-size: 15px !important;
  margin-bottom: 6px !important;
}

.chat-test-cards-wrap .test-card p,
.chat-test-cards-wrap .test-card span,
.chat-test-cards-wrap .test-card .test-card-desc {
  color: #cbd5e1 !important;
  font-size: 12.5px !important;
  line-height: 1.5 !important;
}

.chat-test-cards-wrap .test-card .badge,
.chat-test-cards-wrap .test-card .test-badge {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--specialty-accent) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.chat-test-cards-wrap .test-card .btn-start-test,
.chat-test-cards-wrap .test-card .btn-primary {
  margin-top: 12px !important;
  width: 100% !important;
  background: linear-gradient(135deg, var(--specialty-accent) 0%, rgba(79, 70, 229, 0.95) 100%) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 10px 16px !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  box-shadow: 0 4px 18px var(--specialty-glow) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.chat-test-cards-wrap .test-card .btn-start-test:hover,
.chat-test-cards-wrap .test-card .btn-primary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 22px var(--specialty-glow) !important;
}

/* =================================================== */
/* 3. GEMINI FLOATING CAPSULE PROMPT DOCK              */
/* =================================================== */
.chatbot-bottom-bar {
  flex: 0 0 auto !important;
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  width: calc(100% - 32px) !important;
  max-width: 820px !important;
  margin: 6px auto 14px auto !important;
  z-index: 20 !important;
  background: rgba(14, 20, 32, 0.85) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 28px !important;
  padding: 8px 14px !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
  box-sizing: border-box;
}

/* Suggestions Horizontal Scroll */
.chatbot-suggestions-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chatbot-suggestions-scroll::-webkit-scrollbar {
  display: none;
}

.chatbot-chip {
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.chatbot-chip:hover {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 0 16px var(--specialty-glow);
  transform: translateY(-1px);
}

.chatbot-chip:active {
  transform: scale(0.96);
}

/* Input Form Wrap */
.chatbot-input-form-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-input-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-input-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.chatbot-input-btn.send-btn {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--specialty-accent) 0%, rgba(79, 70, 229, 0.95) 100%) !important;
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 18px var(--specialty-glow);
}

.chatbot-input-btn.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 22px var(--specialty-glow);
}

.chatbot-input-btn.mic-btn.recording {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  animation: micPulse 1.2s infinite ease-in-out;
}

@keyframes micPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

#chatbot-textarea {
  flex: 1;
  border: none;
  background: transparent !important;
  color: #f8fafc !important;
  padding: 8px 6px;
  font-size: 14px;
  line-height: 1.45;
  resize: none;
  max-height: 80px;
  outline: none;
  box-sizing: border-box;
}

#chatbot-textarea::placeholder {
  color: #94a3b8 !important;
}

/* =================================================== */
/* 4. RESPONSIVE BREAKPOINTS (Mobile vs Desktop)       */
/* =================================================== */
@media (max-width: 859px) {
  #chatbot-page.page {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(66px + var(--sab)) !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: none;
    flex-direction: column !important;
    transform: none !important;
    z-index: 90 !important;
  }

  body.has-admob-banner #chatbot-page.page {
    bottom: calc(126px + var(--sab)) !important;
  }

  .chatbot-sidebar-dock {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 295px;
    max-width: 86vw;
    z-index: 120;
    transform: translateX(-100%);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.85);
  }

  #chatbot-page.sidebar-open .chatbot-sidebar-dock {
    transform: translateX(0);
  }

  .chatbot-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 16, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 110;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  #chatbot-page.sidebar-open .chatbot-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .chatbot-sidebar-close {
    display: flex !important;
  }

  .chatbot-menu-toggle-btn {
    display: flex !important;
  }

  .chatbot-top-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: calc(8px + var(--sat)) 12px 10px 12px !important;
    background: rgba(10, 14, 24, 0.88) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    z-index: 30;
    box-sizing: border-box;
    width: 100%;
  }

  .chatbot-top-bar-left,
  .chatbot-top-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .chatbot-top-bar-center {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    justify-content: center;
    cursor: pointer;
  }

  .chatbot-top-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px var(--specialty-glow) !important;
    position: relative;
    flex-shrink: 0;
  }

  .chatbot-top-avatar-letter {
    font-size: 15px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, var(--specialty-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
  }

  .chatbot-top-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    border: 1.5px solid #0a0e18;
    box-shadow: 0 0 6px #10b981;
  }

  .chatbot-top-title-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: left;
  }

  .chatbot-top-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #f8fafc !important;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chatbot-top-subtitle {
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--specialty-accent) !important;
    text-transform: uppercase;
    line-height: 1.2;
  }

  .chatbot-back-btn,
  .chatbot-menu-toggle-btn,
  .chatbot-top-clear-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .chatbot-back-btn:active,
  .chatbot-menu-toggle-btn:active,
  .chatbot-top-clear-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.14) !important;
  }

  .chatbot-top-clear-btn {
    color: #f87171 !important;
  }

  .chatbot-page-content {
    padding: 12px 14px !important;
  }

  .chatbot-bottom-bar {
    width: calc(100% - 16px) !important;
    margin: 4px auto 6px auto !important;
    padding: 6px 12px !important;
    border-radius: 24px !important;
  }
}

/* Desktop Screens (>= 860px) */
@media (min-width: 860px) {
  #chatbot-page.page {
    width: 100% !important;
    height: calc(100vh - 64px) !important;
    max-height: calc(100vh - 64px) !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: none;
    flex-direction: row !important;
    transform: none !important;
  }

  #chatbot-page.page.active {
    display: flex !important;
  }

  .chatbot-sidebar-backdrop {
    display: none !important;
  }

  .chatbot-menu-toggle-btn {
    display: none !important;
  }

  .chatbot-sidebar-close {
    display: none !important;
  }
}

/* ─── Interactive Psychological Widgets (Glassmorphic Dark) ─── */
.chatbot-widget-card {
  background: rgba(18, 24, 38, 0.88) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 20px !important;
  padding: 18px !important;
  margin-top: 12px !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  text-align: center;
  color: #f8fafc !important;
}

[data-theme="dark"] .chatbot-widget-card,
[data-theme="light"] .chatbot-widget-card {
  background: rgba(18, 24, 38, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.13) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

.chatbot-widget-card p {
  color: #cbd5e1 !important;
}

.chatbot-widget-card h4 {
  color: #ffffff !important;
}

/* 1. Box Breathing Widget */
.breathing-circle-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breathing-circle {
  width: 85px;
  height: 85px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 110, 110, 0.45) 0%, rgba(10, 15, 25, 0.95) 100%) !important;
  border: 3px solid var(--specialty-accent, #0d6e6e) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 4s ease-in-out, box-shadow 4s ease-in-out;
  box-shadow: 0 0 24px rgba(13, 110, 110, 0.35) !important;
}

.breathing-circle.inhale {
  transform: scale(1.32);
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.5) !important;
}

.breathing-circle.hold {
  transform: scale(1.32);
}

.breathing-circle.exhale {
  transform: scale(0.85);
  box-shadow: 0 0 10px rgba(13, 110, 110, 0.2) !important;
}

.breathing-circle.rest {
  transform: scale(0.85);
}

.breathing-phase-text {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--specialty-accent, #38bdf8) !important;
  margin-top: 4px;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
}

.breathing-countdown {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff !important;
  margin: 4px 0 12px;
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.3) !important;
}

.widget-action-btn {
  padding: 9px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--specialty-accent, #0d6e6e) 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
  transition: all 0.2s ease;
}

.widget-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.35) !important;
}

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

/* 2. Grounding 5-4-3-2-1 Widget */
.grounding-step-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.32) !important;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.grounding-step-icon {
  font-size: 34px;
  margin: 2px 0 4px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.grounding-step-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff !important;
  margin: 0 0 6px 0;
  letter-spacing: -0.2px;
}

.grounding-step-text {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8 !important;
  margin-bottom: 10px;
  line-height: 1.4;
}

.grounding-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}

.grounding-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.grounding-chip:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
}

.grounding-chip.checked {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.grounding-chip.checked::after {
  content: " ✓";
  font-weight: 800;
}

.grounding-progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.grounding-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2) !important;
  transition: all 0.2s ease;
  cursor: pointer;
}

.grounding-dot:hover {
  background: rgba(255, 255, 255, 0.45) !important;
  transform: scale(1.15);
}

.grounding-dot.active {
  background: var(--specialty-accent, #38bdf8) !important;
  transform: scale(1.3);
  box-shadow: 0 0 10px var(--specialty-accent, #38bdf8) !important;
}

.grounding-restart-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f1f5f9 !important;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
}

.grounding-restart-btn:hover {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

/* 3. Mood Tracker Widget */
.mood-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.mood-chip-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  cursor: pointer;
  transition: all 0.18s ease;
}

.mood-chip-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  transform: translateY(-2px);
}

.mood-chip-btn:active, .mood-chip-btn.selected {
  border-color: var(--specialty-accent, #38bdf8) !important;
  background: rgba(13, 110, 110, 0.5) !important;
  box-shadow: 0 0 16px var(--specialty-glow, rgba(56, 189, 248, 0.35)) !important;
  transform: scale(1.08);
}

.mood-chip-emoji {
  font-size: 20px;
}

.mood-chip-num {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9 !important;
  margin-top: 2px;
}

.mood-feedback-box {
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  color: #e0f2fe !important;
  line-height: 1.45;
}

/* ============================================================ */
/* GEMINI-STYLE HERO EMPTY STATE                                */
/* ============================================================ */
.chatbot-hero-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52vh;
  padding: 40px 24px 20px;
  text-align: center;
  animation: heroFadeIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
  margin: auto 0;
}

.chatbot-hero-state.hidden {
  display: none !important;
}

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

.chatbot-hero-content {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.chatbot-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: rgba(56, 189, 248, 0.16) !important;
  border: 1px solid rgba(56, 189, 248, 0.38) !important;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #7dd3fc !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.2) !important;
  margin-bottom: 6px;
}

.chatbot-hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: heroDotPulse 2s ease-in-out infinite;
}

@keyframes heroDotPulse {
  0%, 100% { opacity: 0.7; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.3); }
}

.chatbot-hero-greeting {
  font-size: clamp(34px, 5.5vw, 54px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* "Salam," sözü - parlaq təmiz ağ və oxunaqlı */
.chatbot-hero-salute {
  color: #ffffff !important;
  text-shadow: 0 2px 24px rgba(255, 255, 255, 0.28);
}

[data-theme="dark"] .chatbot-hero-salute,
[data-theme="light"] .chatbot-hero-salute {
  color: #ffffff !important;
}

/* "İbrahim" adı - canlı axıcı Gemini qradiyenti */
.chatbot-hero-name {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 28%, #c084fc 60%, #f472b6 100%) !important;
  background-size: 200% 200% !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  animation: geminiGradientFlow 5s ease infinite;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  filter: drop-shadow(0 2px 18px rgba(129, 140, 248, 0.55));
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.chatbot-hero-name:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 4px 22px rgba(192, 132, 252, 0.75));
}

.chatbot-hero-edit-icon {
  font-size: 0.45em;
  opacity: 0.65;
  vertical-align: middle;
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chatbot-hero-name:hover .chatbot-hero-edit-icon {
  opacity: 1;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  transform: scale(1.2);
}

@keyframes geminiGradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* "Bu gün sizə necə kömək edə bilərəm?" - açıq gümüşü-ağ, tam aydın oxunaqlı */
.chatbot-hero-question {
  font-size: clamp(21px, 3.2vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
  color: #f1f5f9 !important;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .chatbot-hero-question,
[data-theme="light"] .chatbot-hero-question {
  color: #f1f5f9 !important;
}

/* Alt izah mətni - yumşaq açıq mavi-boz ton, tam kontrastlı */
.chatbot-hero-subtitle {
  font-size: clamp(13.5px, 1.6vw, 15.5px);
  font-weight: 500;
  color: #cbd5e1 !important;
  max-width: 560px;
  line-height: 1.6;
  margin: 6px 0 0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .chatbot-hero-subtitle,
[data-theme="light"] .chatbot-hero-subtitle {
  color: #cbd5e1 !important;
}
/* ================================================ */
/* CHATBOT HERO - Recent Assessment Banner Card      */
/* ================================================ */
.chatbot-hero-recent-card {
  width: 100%;
  max-width: 620px;
  margin: 18px 0 6px;
  animation: heroRecentFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes heroRecentFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-recent-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.36), 0 0 20px rgba(56, 189, 248, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.25s ease;
}

.hero-recent-inner:hover {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42), 0 0 25px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.hero-recent-icon {
  font-size: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.hero-recent-meta {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.hero-recent-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #38bdf8;
  margin-bottom: 3px;
}

.hero-recent-title {
  font-size: 14px;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.hero-recent-title strong {
  color: #ffffff;
  font-weight: 700;
}

.hero-recent-btn {
  flex-shrink: 0;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
  transition: all 0.2s ease;
}

.hero-recent-btn:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px) scale(1.03);
}

.hero-recent-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Discuss with Bot button on Results screen - Neurotic Bot Cosmic Glass Style */
#btn-discuss-with-bot,
.btn-discuss-bot {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 48%, #a855f7 100%) !important;
  background-size: 200% 200% !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 12px !important;
  padding: 13px 22px !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35) !important;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 12px rgba(14, 165, 233, 0.28) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  animation: botButtonGlowPulse 4s ease-in-out infinite, geminiBtnGradient 6s ease infinite !important;
}

#btn-discuss-with-bot:hover,
.btn-discuss-bot:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 48%, #c084fc 100%) !important;
  box-shadow: 0 8px 28px rgba(168, 85, 247, 0.55), 0 0 20px rgba(56, 189, 248, 0.45) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  transform: translateY(-2px) scale(1.02) !important;
}

#btn-discuss-with-bot:active,
.btn-discuss-bot:active {
  transform: translateY(0) scale(0.98) !important;
}

#btn-discuss-with-bot svg,
.btn-discuss-bot svg {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
  transition: transform 0.25s ease;
}

#btn-discuss-with-bot:hover svg,
.btn-discuss-bot:hover svg {
  transform: scale(1.15) rotate(-6deg);
}

@keyframes geminiBtnGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes botButtonGlowPulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.38), 0 0 12px rgba(14, 165, 233, 0.25);
  }
  50% {
    box-shadow: 0 6px 26px rgba(168, 85, 247, 0.55), 0 0 18px rgba(56, 189, 248, 0.42);
  }
}

@media (max-width: 640px) {
  .hero-recent-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .hero-recent-btn {
    width: 100%;
    justify-content: center;
  }
  .hero-recent-title {
    white-space: normal;
  }
}

/* ==========================================================================
   AUTHENTICATION & USER PROFILE STYLES (Firebase Cloud Auth)
   ========================================================================== */
.auth-header-btn-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 999px;
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-auth-trigger:hover {
  background: var(--primary-light, rgba(13, 110, 110, 0.08));
  border-color: var(--primary, #0d6e6e);
  color: var(--primary, #0d6e6e);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(13, 110, 110, 0.12);
}

.btn-auth-trigger .auth-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary, #0d6e6e);
}

.auth-btn-label {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-btn-arrow {
  font-size: 11px;
  opacity: 0.6;
}

/* User Dropdown */
.auth-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: authDropdownFadeIn 0.18s ease-out;
}

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

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.user-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light, #e0f2fe);
  color: var(--primary, #0d6e6e);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--border, #cbd5e1);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-info-text strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info-text small {
  font-size: 11.5px;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border, #e2e8f0);
  margin: 6px 4px;
}

.user-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary, #334155);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.user-dropdown-item:hover {
  background: var(--primary-light, rgba(13, 110, 110, 0.08));
  color: var(--primary, #0d6e6e);
}

.user-dropdown-item.item-logout {
  color: #ef4444;
}

.user-dropdown-item.item-logout:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Auth Modal Overlay & Card */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.auth-modal-overlay.active {
  opacity: 1;
}

.auth-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
  animation: authModalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authModalScale {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--border-light, #f1f5f9);
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.15s ease;
}

.auth-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.auth-modal-brand {
  text-align: center;
  margin-bottom: 22px;
}

.auth-brand-logo {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(13, 110, 110, 0.2);
}

.auth-modal-brand h2 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 6px;
}

.auth-modal-brand p {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  line-height: 1.45;
}

/* Tabs */
.auth-tabs-nav {
  display: flex;
  background: var(--border-light, #f1f5f9);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 9px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: var(--bg-card, #ffffff);
  color: var(--primary, #0d6e6e);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Google Sign-in Button */
.btn-google-auth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 16px;
  background: #ffffff;
  border: 1.5px solid #dadce0;
  border-radius: 12px;
  color: #3c4043;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-google-auth:hover {
  background: #f8fafc;
  border-color: #c2c7d0;
  box-shadow: 0 4px 12px rgba(60, 64, 67, 0.12);
}

.auth-divider {
  position: relative;
  text-align: center;
  margin: 18px 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border, #e2e8f0);
}

.auth-divider span {
  position: relative;
  background: var(--bg-card, #ffffff);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
}

/* Form Fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary, #334155);
}

.auth-field input,
.auth-field select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input, #f8fafc);
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--primary, #0d6e6e);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.15);
}

.auth-forgot-row {
  display: flex;
  justify-content: flex-end;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary, #0d6e6e);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.btn-auth-submit {
  width: 100%;
  padding: 12px;
  background: var(--primary, #0d6e6e);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(13, 110, 110, 0.3);
  margin-top: 4px;
}

.btn-auth-submit:hover {
  background: #095050;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13, 110, 110, 0.4);
}

.btn-auth-submit:disabled,
.btn-google-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Alert */
.auth-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
  line-height: 1.4;
}

.alert-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* Toast Notification */
.auth-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: #0f172a;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100000;
  pointer-events: none;
}

.auth-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Dark theme overrides */
[data-theme="dark"] .btn-auth-trigger {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .btn-auth-trigger:hover {
  background: rgba(13, 110, 110, 0.25);
  border-color: #14b8a6;
  color: #14b8a6;
}

[data-theme="dark"] .auth-user-dropdown,
[data-theme="dark"] .auth-modal-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .user-dropdown-item {
  color: #cbd5e1;
}

[data-theme="dark"] .top-nav-dropdown .user-dropdown-header:hover {
  background: #334155 !important;
}

[data-theme="dark"] .user-dropdown-item:hover {
  background: rgba(13, 110, 110, 0.25);
  color: #14b8a6;
}

[data-theme="dark"] .auth-field input,
[data-theme="dark"] .auth-field select {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .auth-tabs-nav {
  background: #0f172a;
}

[data-theme="dark"] .auth-tab-btn.active {
  background: #1e293b;
  color: #14b8a6;
}

[data-theme="dark"] .btn-google-auth {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .auth-divider span {
  background: #1e293b;
}

/* ==========================================================================
   User Profile & Account Hub Page Styles (#profile-page)
   ========================================================================== */
#profile-page .content {
  max-width: 920px;
  margin: 0 auto;
}

/* Hero Card */
.profile-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(139, 92, 246, 0.06) 100%), var(--bg-card);
}

.profile-hero-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

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

.profile-avatar-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 6px 20px var(--primary-glow);
  border: 3px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
  user-select: none;
}

.profile-info-wrap {
  flex: 1;
  min-width: 240px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-name-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.profile-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-edit-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.profile-email-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 4px 0 10px;
}

.profile-tags-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-role {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.18);
}

.badge-date {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* Stats Section */
.profile-stats-section {
  margin-bottom: 24px;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.profile-stat-card {
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon-pill {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.icon-tests {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
}

.icon-latest {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.icon-bot {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

.stat-desc {
  display: block;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Cards & Actions */
.profile-card {
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.profile-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 16px;
}

.profile-action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-profile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-profile-action.action-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px -2px var(--primary-glow);
}

.btn-profile-action.action-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px -2px var(--primary-glow);
}

.btn-profile-action.action-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-profile-action.action-secondary:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Danger Zone */
.profile-danger-card {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.03) 0%, var(--bg-card) 100%);
}

.danger-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.danger-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.danger-header h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.danger-header p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.btn-profile-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-profile-danger:hover {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* Auth Buttons */
.profile-auth-action-wrap {
  margin-top: 10px;
  margin-bottom: 40px;
}

.btn-profile-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-profile-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-profile-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px -2px var(--primary-glow);
  transition: all 0.2s ease;
}

.btn-profile-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -2px var(--primary-glow);
}

/* Dark mode adjustments */
[data-theme="dark"] .profile-hero-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.12) 100%), #1e293b;
}

[data-theme="dark"] .profile-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .profile-stat-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .profile-edit-btn {
  background: #0f172a;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .btn-profile-action.action-secondary {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .btn-profile-logout {
  background: #1e293b;
  border-color: #334155;
}

