/* ==========================================================================
   CardioPredict AI - Enterprise Design System & Styling Tokens
   Specification: website-designer-pro Skill Guidelines
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* Surface & Canvas Hierarchy */
  --canvas-bg: #0b0f17;
  --surface-0: #0f172a;
  --surface-1: #1e293b;
  --surface-2: rgba(30, 41, 59, 0.75);
  --surface-card: rgba(30, 41, 59, 0.6);
  --border-subtle: rgba(51, 65, 85, 0.6);
  --border-glow: rgba(34, 211, 238, 0.4);

  /* Brand Accents */
  --accent-cyan: #22d3ee;
  --accent-cyan-dark: #0891b2;
  --accent-cyan-glow: rgba(34, 211, 238, 0.35);
  --accent-indigo: #6366f1;
  --accent-indigo-glow: rgba(99, 102, 241, 0.3);

  /* Clinical Status Colors */
  --status-low: #10b981;
  --status-low-bg: rgba(16, 185, 129, 0.15);
  --status-mod: #f59e0b;
  --status-mod-bg: rgba(245, 158, 11, 0.15);
  --status-high: #ef4444;
  --status-high-bg: rgba(239, 68, 68, 0.15);

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-mono: #38bdf8;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --container-max: 1280px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --header-height: 72px;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--canvas-bg);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 1440px) {
  html {
    font-size: 17.5px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15.5px;
  }
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: radial-gradient(circle at 15% 15%, rgba(34, 211, 238, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 85% 65%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
              var(--canvas-bg);
}

/* Ambient Grid Overlay */
.bg-grid {
  position: fixed;
  inset: 0;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(11, 15, 23, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 750;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0f17;
  font-size: 1.3rem;
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}

.brand-name span {
  color: var(--accent-cyan);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  white-space: nowrap;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-cyan);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Theme Toggle Button (Dark vs Day Mode) */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid var(--accent-cyan);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  animation: darkBtnPulse 2.2s infinite ease-in-out;
  position: relative;
}

.theme-toggle-btn:hover {
  border-color: #67e8f9;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.3), 0 0 20px rgba(34, 211, 238, 0.5);
  transform: translateY(-2px);
}

.theme-toggle-btn:active {
  transform: translateY(1px) scale(0.97);
}

.theme-toggle-icon {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

.theme-toggle-btn:hover .theme-toggle-icon {
  transform: rotate(25deg) scale(1.15);
}

.theme-toggle-tag {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Micro Switch Slider */
.theme-toggle-switch {
  width: 32px;
  height: 18px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: all 0.25s ease;
  position: relative;
}

.theme-toggle-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-cyan);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateX(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Flashing / Pulsing Outline Keyframes */
@keyframes darkBtnPulse {
  0%, 100% {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5), 0 3px 12px rgba(34, 211, 238, 0.2);
  }
  50% {
    border-color: #67e8f9;
    box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.25), 0 0 20px rgba(34, 211, 238, 0.45);
  }
}

@keyframes dayBtnPulse {
  0%, 100% {
    border-color: #0284c7;
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.55), 0 3px 12px rgba(2, 132, 199, 0.2);
  }
  50% {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 5px rgba(2, 132, 199, 0.28), 0 0 20px rgba(2, 132, 199, 0.45);
  }
}

/* API Status Indicator Badge */
.api-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--status-low);
  box-shadow: 0 0 8px var(--status-low);
  animation: pulseDot 2s infinite ease-in-out;
}

.status-dot.offline {
  background-color: var(--status-high);
  box-shadow: 0 0 8px var(--status-high);
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* ==========================================================================
   Buttons & Micro-Interactions
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #00b4d8);
  color: #0b0f17;
  box-shadow: 0 0 20px var(--accent-cyan-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.6);
}

.btn-secondary {
  background: var(--surface-1);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed !important;
  filter: grayscale(0.5);
  box-shadow: none !important;
  transform: none !important;
}

.btn:disabled:hover,
.btn[disabled]:hover {
  box-shadow: none !important;
  transform: none !important;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: var(--radius-full);
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 24px;
  color: #ffffff;
}

.hero-title-highlight {
  color: #ffffff;
  font-weight: 850;
  letter-spacing: -0.025em;
  text-shadow: 0 0 35px rgba(255, 255, 255, 0.4);
}

.hero-title .glow-text {
  background: linear-gradient(135deg, var(--accent-cyan), #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 50px;
}

/* Trust Metrics Strip (3-Pillar Layman Trust Strip) */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 24px 32px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 70px;
}

@media (max-width: 860px) {
  .metrics-strip {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 12px;
}

.metric-icon-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  perspective: 600px;
}

.metric-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.metric-item:hover .metric-icon-img {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 14px 28px -4px rgba(34, 211, 238, 0.4), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.metric-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  line-height: 1;
}

.metric-value {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.metric-label {
  font-size: 0.90rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.45;
  text-transform: none;
  letter-spacing: normal;
}

/* ==========================================================================
   Main Clinical Dashboard & Triage Layout
   ========================================================================== */
.triage-section {
  padding: 40px 0 80px;
}

.section-header {
  margin-bottom: 32px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
}

.triage-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 960px) {
  .triage-grid {
    grid-template-columns: 1fr;
  }
}

/* Panels & Cards */
.card-panel {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: border-color 0.3s ease;
}

.card-panel:hover {
  border-color: rgba(51, 65, 85, 0.9);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent-cyan);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select {
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-glow);
}

.form-select option {
  background: var(--surface-0);
  color: var(--text-main);
}

/* Calculated Live Vitals Display */
.derived-metrics {
  display: flex;
  gap: 16px;
  padding: 14px;
  background: var(--surface-0);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
  margin-bottom: 16px;
}

.derived-item {
  flex: 1;
  text-align: center;
}

.derived-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.derived-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-mono);
}

/* Clinical Safety Protocol Disclaimer */
.clinical-safety-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 20px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.clinical-safety-card:hover {
  border-color: rgba(245, 158, 11, 0.65);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.16);
}

.clinical-safety-card.acknowledged {
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.05);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.12);
}

.clinical-safety-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.clinical-safety-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #f59e0b;
  cursor: pointer;
  border-radius: 4px;
}

.clinical-safety-card.acknowledged .clinical-safety-checkbox {
  accent-color: var(--accent-cyan);
}

.clinical-safety-warning-icon {
  font-size: 1rem;
  margin-right: 4px;
  display: inline-block;
  vertical-align: -1px;
}

.clinical-safety-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.clinical-safety-highlight {
  color: #fbbf24;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.clinical-safety-card.acknowledged .clinical-safety-text {
  color: var(--text-main);
}

/* ==========================================================================
   Prediction & TreeSHAP Display
   ========================================================================== */
.risk-meter-box {
  background: var(--surface-0);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.risk-level-tag {
  display: inline-block;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.risk-level-tag.low {
  background: var(--status-low-bg);
  color: var(--status-low);
  border: 1px solid var(--status-low);
}

.risk-level-tag.moderate {
  background: var(--status-mod-bg);
  color: var(--status-mod);
  border: 1px solid var(--status-mod);
}

.risk-level-tag.elevated {
  background: var(--status-high-bg);
  color: var(--status-high);
  border: 1px solid var(--status-high);
}

.risk-percentage-val {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--text-main);
}

.risk-latency {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* TreeSHAP Bars */
.shap-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shap-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shap-card {
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease;
}

.shap-card:hover {
  transform: translateY(-2px);
}

.shap-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.94rem;
}

.shap-feature-name {
  font-weight: 600;
  color: var(--text-main);
}

.shap-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
}

.shap-card.driver .shap-score {
  color: var(--status-high);
}

.shap-card.protective .shap-score {
  color: var(--status-low);
}

.shap-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.shap-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.shap-card.driver .shap-bar-fill {
  background: linear-gradient(90deg, #f87171, var(--status-high));
}

.shap-card.protective .shap-bar-fill {
  background: linear-gradient(90deg, #34d399, var(--status-low));
}

.shap-clinical-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   RAG Chatbot Assistant Section
   ========================================================================== */
.chat-section {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  margin-bottom: 70px;
}

/* LLM Switch Bar & Toggle Group */
.llm-switch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.llm-switch-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.llm-toggle-group {
  display: flex;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 4px;
}

.llm-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.llm-toggle-btn:hover {
  color: var(--text-main);
}

.llm-toggle-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan-dark), var(--accent-cyan));
  color: #0b0f17;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--accent-cyan-glow);
}

/* 24-Hour Visitor Quota Pill & Info Bar */
.quota-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  background: rgba(34, 211, 238, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(34, 211, 238, 0.35);
  transition: all 0.25s ease;
}

.llm-toggle-btn.active .quota-pill {
  background: rgba(11, 15, 23, 0.4);
  color: #0b0f17;
  border-color: rgba(11, 15, 23, 0.3);
}

.quota-pill.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.llm-toggle-btn.active .quota-pill.warning {
  background: rgba(245, 158, 11, 0.35);
  color: #0b0f17;
  border-color: rgba(180, 83, 9, 0.5);
}

.quota-pill.exhausted {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.45);
}

.llm-toggle-btn.active .quota-pill.exhausted {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
  border-color: rgba(220, 38, 38, 0.6);
}

.quota-pill.unlimited {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.llm-toggle-btn.active .quota-pill.unlimited {
  background: rgba(16, 185, 129, 0.35);
  color: #0b0f17;
  border-color: rgba(5, 150, 105, 0.5);
}

.quota-info-bar {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.65);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
  border-left: 3px solid var(--accent-cyan);
  line-height: 1.45;
  transition: all 0.2s ease;
}

.api-key-drawer {
  background: var(--surface-0);
  border: 1px dashed var(--accent-cyan-dark);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

.api-key-drawer.hidden {
  display: none;
}

.api-key-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.api-key-input {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.api-key-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-glow);
}

.engine-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  margin-right: 6px;
}

.engine-tag.local {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-low);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.engine-tag.api {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.discovery-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.chip-btn {
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.chip-btn:hover {
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.chat-history {
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  min-height: 260px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.chat-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  max-width: 85%;
  line-height: 1.6;
  font-size: 0.97rem;
  animation: fadeInUp 0.3s ease;
}

.chat-bubble.user {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  align-self: flex-end;
}

.chat-bubble.assistant {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--text-main);
  align-self: flex-start;
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.05);
}

.source-tag {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.chat-input-bar {
  display: flex;
  gap: 12px;
}

.chat-input-field {
  flex: 1;
  background: var(--surface-0);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 14px 18px;
  font-size: 0.95rem;
  outline: none;
  font-family: var(--font-sans);
}

.chat-input-field:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px var(--accent-cyan-glow);
}

/* ==========================================================================
   Medical Disclaimer Banner
   ========================================================================== */
.disclaimer-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: #fbbf24;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 60px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-0);
  padding: 60px 0 30px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(51, 65, 85, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ==========================================================================
   Day Mode (Eye-Comfort Soft White Theme)
   Designed for comfortable reading without harsh glare
   ========================================================================== */
html[data-theme="day"],
:root[data-theme="day"] {
  /* Eye-Comfort Canvas & Surfaces */
  --canvas-bg: #f8fafc;
  --surface-0: #ffffff;
  --surface-1: #ffffff;
  --surface-2: #f1f5f9;
  --surface-card: rgba(255, 255, 255, 0.92);
  --border-subtle: #e2e8f0;
  --border-glow: rgba(2, 132, 199, 0.3);

  /* Accents tailored for daylight contrast */
  --accent-cyan: #0284c7;
  --accent-cyan-dark: #0369a1;
  --accent-cyan-glow: rgba(2, 132, 199, 0.22);
  --accent-indigo: #4f46e5;
  --accent-indigo-glow: rgba(79, 70, 229, 0.18);

  /* Status Colors */
  --status-low: #059669;
  --status-low-bg: rgba(16, 185, 129, 0.12);
  --status-mod: #d97706;
  --status-mod-bg: rgba(245, 158, 11, 0.12);
  --status-high: #dc2626;
  --status-high-bg: rgba(239, 68, 68, 0.12);

  /* Typography */
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-mono: #0284c7;
}

/* Day Mode Element Refinements */
html[data-theme="day"] body {
  background: radial-gradient(circle at 15% 15%, rgba(2, 132, 199, 0.05) 0%, transparent 40%),
              radial-gradient(circle at 85% 65%, rgba(99, 102, 241, 0.04) 0%, transparent 40%),
              var(--canvas-bg);
  color: var(--text-main);
}

html[data-theme="day"] .bg-grid {
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
}

html[data-theme="day"] .site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

html[data-theme="day"] .brand-name {
  color: #0f172a;
}

html[data-theme="day"] .brand-name span {
  color: #0284c7;
}

html[data-theme="day"] .nav-link {
  color: #475569;
}

html[data-theme="day"] .nav-link:hover,
html[data-theme="day"] .nav-link.active {
  color: #0284c7;
}

html[data-theme="day"] .card-panel {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
}

html[data-theme="day"] .card-panel:hover {
  border-color: #cbd5e1;
}

html[data-theme="day"] .hero-badge {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0284c7;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

html[data-theme="day"] .hero-title {
  color: #0f172a;
  -webkit-text-fill-color: #0f172a;
  background: none;
}

html[data-theme="day"] .hero-title-highlight {
  color: #0f172a;
  -webkit-text-fill-color: #0f172a;
  font-weight: 850;
  text-shadow: none;
}

html[data-theme="day"] .glow-text {
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
}

html[data-theme="day"] .hero-subtitle {
  color: #475569;
}

html[data-theme="day"] .btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

html[data-theme="day"] .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

html[data-theme="day"] .btn-secondary {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

html[data-theme="day"] .btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

html[data-theme="day"] .form-input,
html[data-theme="day"] .form-select,
html[data-theme="day"] .chat-input-field {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="day"] .form-input:focus,
html[data-theme="day"] .form-select:focus,
html[data-theme="day"] .chat-input-field:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

html[data-theme="day"] .form-select option {
  background: #ffffff;
  color: #0f172a;
}

html[data-theme="day"] .derived-metrics {
  background: #f8fafc;
  border-color: #cbd5e1;
}

html[data-theme="day"] .risk-meter-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="day"] .shap-container {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="day"] .shap-item {
  background: #ffffff;
  border-color: #e2e8f0;
}

html[data-theme="day"] .chat-section {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
}

html[data-theme="day"] .chat-history {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="day"] .chat-bubble.user {
  background: #0284c7;
  color: #ffffff;
  border: none;
}

html[data-theme="day"] .chat-bubble.assistant {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

html[data-theme="day"] .api-key-drawer {
  background: #f8fafc;
  border-color: #38bdf8;
}

html[data-theme="day"] .api-key-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="day"] .chip-btn {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

html[data-theme="day"] .chip-btn:hover {
  border-color: #0284c7;
  color: #0284c7;
  background: #f0f9ff;
}

html[data-theme="day"] .site-footer {
  background: #f8fafc;
  border-top-color: #e2e8f0;
}

html[data-theme="day"] .disclaimer-banner {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(217, 119, 6, 0.35);
  color: #92400e;
}

html[data-theme="day"] .clinical-safety-card {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(217, 119, 6, 0.35);
}

html[data-theme="day"] .clinical-safety-card:hover {
  border-color: rgba(217, 119, 6, 0.6);
  background: rgba(245, 158, 11, 0.12);
}

html[data-theme="day"] .clinical-safety-highlight {
  color: #b45309;
}

html[data-theme="day"] .clinical-safety-text {
  color: #1e293b;
}

html[data-theme="day"] .form-label {
  color: #0f172a;
  font-weight: 600;
}

html[data-theme="day"] .metrics-strip {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
}

html[data-theme="day"] .metric-value {
  color: #0f172a;
}

html[data-theme="day"] .metric-label {
  color: #475569;
}

html[data-theme="day"] .metric-icon-img {
  border-color: rgba(226, 232, 240, 0.85);
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
}

html[data-theme="day"] .metric-item:hover .metric-icon-img {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 12px 24px -4px rgba(8, 145, 178, 0.22), 0 4px 10px rgba(15, 23, 42, 0.08);
}

html[data-theme="day"] .shap-clinical-desc {
  color: #475569;
}

html[data-theme="day"] .llm-switch-bar {
  background: #f8fafc;
  border-color: #e2e8f0;
}

html[data-theme="day"] .llm-toggle-group {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

html[data-theme="day"] .llm-toggle-btn {
  color: #64748b;
}

html[data-theme="day"] .llm-toggle-btn:hover {
  color: #0f172a;
}

html[data-theme="day"] .llm-toggle-btn.active {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.25);
}

html[data-theme="day"] .llm-toggle-btn.active .quota-pill {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

html[data-theme="day"] .quota-info-bar {
  background: #f1f5f9;
  border-left-color: #0284c7;
  color: #334155;
}

html[data-theme="day"] .theme-toggle-btn {
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
  border: 2px solid #0284c7;
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.22);
  animation: dayBtnPulse 2.2s infinite ease-in-out;
}

html[data-theme="day"] .theme-toggle-btn:hover {
  background: #ffffff;
  border-color: #0369a1;
  box-shadow: 0 0 0 5px rgba(2, 132, 199, 0.25), 0 6px 20px rgba(2, 132, 199, 0.35);
  transform: translateY(-2px);
}

html[data-theme="day"] .theme-toggle-switch {
  background: rgba(2, 132, 199, 0.18);
  border-color: rgba(2, 132, 199, 0.4);
}

html[data-theme="day"] .theme-toggle-thumb {
  background: #0284c7;
  transform: translateX(14px);
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

html[data-theme="day"] .api-badge {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}
