/* ================================================================
   SYMPTOSCAN — AI DIAGNOSTIC SYSTEM
   style.css — v3.0 Redesign
   ================================================================

   TABLE OF CONTENTS
   ─────────────────────────────────────────────────────────────
   01. Design Tokens & CSS Custom Properties
   02. Global Reset
   03. Ambient Background Canvas
   04. Layout Utilities & Visibility System
   05. Typography System (Syne + Outfit + JetBrains Mono)
   06. Navbar & Navigation            [z-index: 2000]
   07. Button System (Gradient + Animated)
   08. View & Section Architecture
   09. Panel System                   [overflow: visible]
   10. Landing Hero
   11. Scanner Visualization (signature element)
   12. Feature Row (below hero)
   13. Dashboard View
   14. Combobox Symptom Selector      [z-index: 2500]
       14a. Chips / Selected Tags
       14b. Search Input + Icon
       14c. Floating Dropdown Tray
       14d. Dropdown Items & States
   15. Diagnosis Result View
   16. Differential Diagnoses (Top-3)
   17. Analytics View
   18. History Cards
   19. Profile View
   20. Auth Modal System              [z-index: 9999]
   21. Toast Notification System
   22. Loading Veil                   [z-index: 9999]
   23. Keyframe Animation Engine
   24. Responsive Breakpoints
   ─────────────────────────────────────────────────────────────
*/


/* ================================================================
   01. DESIGN TOKENS & CSS CUSTOM PROPERTIES
   ================================================================ */
:root {
  /* ── Background Scale ─────────────────────────────────── */
  --bg:   #03050E;
  --s1:   #08101F;
  --s2:   #0C1529;
  --s3:   #111D38;
  --s4:   #162240;

  /* ── Border Alpha Scale ───────────────────────────────── */
  --b1: rgba(99, 130, 210, .07);
  --b2: rgba(99, 130, 210, .14);
  --b3: rgba(99, 130, 210, .24);
  --b4: rgba(99, 130, 210, .38);

  /* ── Primary Accent (Electric Cyan) ──────────────────── */
  --accent:    #22D3EE;
  --ac-dim:    rgba(34, 211, 238, .08);
  --ac-glow:   rgba(34, 211, 238, .22);
  --ac-text:   #67E8F9;
  --ac-border: rgba(34, 211, 238, .25);

  /* ── Secondary Accent (Vivid Violet) ─────────────────── */
  --accent2:    #A855F7;
  --ac2-dim:    rgba(168, 85, 247, .10);
  --ac2-glow:   rgba(168, 85, 247, .22);
  --ac2-text:   #C084FC;
  --ac2-border: rgba(168, 85, 247, .28);

  /* ── Master Gradients ─────────────────────────────────── */
  --grad:      linear-gradient(135deg, var(--accent), var(--accent2));
  --grad-r:    linear-gradient(135deg, var(--accent2), var(--accent));
  --grad-text: linear-gradient(135deg, var(--ac-text) 0%, #B78BFF 100%);

  /* ── Semantic Status Colors ───────────────────────────── */
  --ok:   #10B981;
  --warn: #F59E0B;
  --err:  #EF4444;
  --info: #818CF8;

  /* ── Derived Text Colors ──────────────────────────────── */
  --ok-text:   #34D399;
  --warn-text: #FCD34D;
  --err-text:  #FCA5A5;

  /* ── Text Scale ───────────────────────────────────────── */
  --text:  #EEF2FF;
  --dim:   #94A3B8;
  --muted: #475569;
  --faint: #1E2D4D;

  /* ── Font Families ────────────────────────────────────── */
  --fd: 'Syne', system-ui, sans-serif;          /* Display / Headings   */
  --fb: 'Outfit', system-ui, sans-serif;         /* Body / UI            */
  --fm: 'JetBrains Mono', 'Courier New', monospace; /* Mono / Data       */

  /* ── Border Radii ─────────────────────────────────────── */
  --r1: 6px;
  --r2: 10px;
  --r3: 16px;
  --r4: 22px;
  --r5: 32px;

  /* ── Box Shadows ──────────────────────────────────────── */
  --shadow-sm: 0 2px 8px rgba(0,0,0,.45);
  --shadow-md: 0 8px 28px rgba(0,0,0,.55);
  --shadow-lg: 0 20px 56px rgba(0,0,0,.70);
  --glow-cyan:   0 0 22px rgba(34,211,238,.28), 0 0 56px rgba(34,211,238,.08);
  --glow-violet: 0 0 22px rgba(168,85,247,.28), 0 0 56px rgba(168,85,247,.08);

  /* ── Transitions ──────────────────────────────────────── */
  --ease:   cubic-bezier(.4, 0, .2, 1);
  --spring: cubic-bezier(.16, 1, .3, 1);
  --fast:   .15s;
  --std:    .25s;
  --slow:   .4s;

  /* ── Z-Index Canonical Stack ──────────────────────────── */
  /* Body content          0 – 99  */
  /* Floating panels           100 */
  /* Sticky navbar            2000 */
  /* Symptom dropdown         2500 */
  /* Auth overlay / veil      9999 */
}


/* ================================================================
   02. GLOBAL RESET
   ================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fb);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img     { display: block; }
a       { color: inherit; text-decoration: none; }
button  { cursor: pointer; font: inherit; border: none; background: none; }
ul      { list-style: none; }
input,
textarea { font: inherit; }

main, nav { position: relative; z-index: 1; }


/* ================================================================
   03. AMBIENT BACKGROUND CANVAS
   ── Three gradient orbs + dot grid, all fixed behind content
   ================================================================ */
.bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Gradient blur orbs — violet, cyan, a faint mid */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.orb-violet {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(168,85,247,.18), transparent 70%);
  top: -240px; left: -180px;
  animation: orbDrift 22s ease-in-out infinite;
}

.orb-cyan {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(34,211,238,.14), transparent 70%);
  bottom: -120px; right: -100px;
  animation: orbDrift 18s ease-in-out 4s infinite reverse;
}

.orb-mid {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(168,85,247,.07), transparent 70%);
  top: 45%; left: 35%;
  animation: orbDrift 28s ease-in-out 9s infinite;
}

/* Subtle dot grid overlay */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(99,130,210,.08) 1px, transparent 1px);
  background-size: 32px 32px;
}


/* ================================================================
   04. LAYOUT UTILITIES & VISIBILITY SYSTEM
   ================================================================ */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

/* JS toggles — !important is intentional */
.hidden { display: none !important; }

.mono { font-family: var(--fm); }

/* Gradient text utility */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ================================================================
   05. TYPOGRAPHY SYSTEM
   ================================================================ */
h1 {
  font-family: var(--fd);
  font-size: clamp(1.4rem, 3vw, 4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.025em;
}

h2 {
  font-family: var(--fd);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.015em;
}

/* Italic em inside h1 / h2 → gradient treatment */
h1 em, h2 em {
  font-style: italic;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-right: 4px;
}

h3 {
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.3;
  font-family: var(--fd);
}

h4 {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-family: var(--fb);
}

p { color: var(--dim); }

/* Eyebrow pill */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--ac-text);
  background: linear-gradient(135deg, rgba(34,211,238,.08), rgba(168,85,247,.06));
  border: 1px solid rgba(34,211,238,.2);
  padding: 5px 14px;
  border-radius: 999px;
  font-family: var(--fm);
}

.eyebrow-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

/* Section label above headings */
.section-label {
  display: block;
  font-family: var(--fm);
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ac-text);
  margin-bottom: 6px;
}


/* ================================================================
   06. NAVBAR & NAVIGATION
   ── z-index: 2000
   ================================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: rgba(3, 5, 14, .82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--b1);
}

/* Gradient shimmer line at navbar bottom */
.navbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(34,211,238,.35) 30%,
    rgba(168,85,247,.35) 70%,
    transparent 100%);
  pointer-events: none;
}

.navbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}

/* Brand lockup */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
  border-radius: 6px;
  background: transparent;
}

.brand-text {
  font-family: var(--fd);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .02em;
  background: linear-gradient(135deg, var(--text), var(--ac-text));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  margin-left: 20px;
}

.nav-item {
  padding: 5px 12px;
  font-size: .84rem;
  font-weight: 500;
  color: var(--dim);
  border-radius: var(--r1);
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
  position: relative;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 50%;
  width: 0; height: 2px;
  background: var(--grad);
  border-radius: 1px;
  transform: translateX(-50%);
  transition: width var(--std) var(--spring);
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}

.nav-item:hover::after { width: 70%; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* User chip */
.nav-user { position: relative; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 4px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.user-chip:hover {
  border-color: var(--ac-border);
  box-shadow: 0 0 0 3px var(--ac-dim);
}

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ac-dim), var(--ac2-dim));
  border: 1px solid var(--ac-border);
  color: var(--ac-text);
  font-family: var(--fm);
  font-size: .65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .04em;
  flex-shrink: 0;
}

.user-chip-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 178px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--r3);
  padding: 6px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(34,211,238,.05);
  z-index: 2100;
  backdrop-filter: blur(12px);
}

.dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  font-size: .84rem;
  color: var(--dim);
  border-radius: var(--r2);
  width: 100%;
  text-align: left;
  transition: background var(--fast), color var(--fast);
}

.dd-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.dd-item.danger:hover { background: rgba(239,68,68,.1); color: var(--err); }

.dd-sep { height: 1px; background: var(--b1); margin: 5px 0; }


/* ================================================================
   07. BUTTON SYSTEM
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 18px;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .01em;
  border-radius: var(--r2);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--fast) var(--ease);
  position: relative;
  overflow: hidden;
  font-family: var(--fb);
  isolation: isolate;
}

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

/* Ripple prep */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.08);
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
  border-radius: inherit;
  z-index: -1;
}
.btn:active:not(:disabled)::after { opacity: 1; }

/* Primary — gradient fill */
.btn-primary {
  background: var(--grad);
  color: #050A18;
  border: none;
  font-weight: 800;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-r);
  opacity: 0;
  transition: opacity var(--std) var(--ease);
  z-index: -1;
}

.btn-primary:hover:not(:disabled)::before { opacity: 1; }

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(34,211,238,.35), 0 0 56px rgba(168,85,247,.15);
  transform: translateY(-1px);
}

/* Outline — bordered */
.btn-outline {
  background: transparent;
  color: var(--dim);
  border-color: var(--b3);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--ac-border);
  color: var(--ac-text);
  background: var(--ac-dim);
  box-shadow: 0 0 16px var(--ac-glow);
}

/* Secondary */
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--b2);
}

.btn-secondary:hover:not(:disabled) { background: var(--s2); border-color: var(--b3); }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--dim);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-color: var(--b1);
}

/* Size variants */
.btn-sm  { padding: 4px 12px; font-size: .78rem; border-radius: var(--r1); }
.btn-lg  { padding: 11px 24px; font-size: .9rem; }
.btn-xl  { padding: 14px 32px; font-size: .96rem; border-radius: var(--r3); letter-spacing: .02em; }


/* ================================================================
   08. VIEW & SECTION ARCHITECTURE
   ================================================================ */
.view { padding: 52px 0; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

.section-header h2 { margin: 10px;
 }


/* ================================================================
   09. PANEL SYSTEM
   ── overflow: visible so absolute children (dropdown) are not clipped
   ================================================================ */
.panel {
  border-radius: var(--r3);
  padding: 26px;
  position: relative;
  overflow: visible !important;
}

/* Glass — primary input/content panels */
.panel-glass {
  background: rgba(8,16,31,.7);
  border: 1px solid var(--b2);
  backdrop-filter: blur(12px);
}

/* Soft — secondary info panels */
.panel-soft {
  background: var(--s2);
  border: 1px solid var(--b1);
}

/* Glow — result primary panel with cyan border glow */
.panel-glow {
  background: var(--s1);
  border: 1px solid var(--ac-border);
  box-shadow: 0 0 0 1px rgba(34,211,238,.04),
              var(--glow-cyan);
}

/* Gradient border trick via ::before */
.panel-grad {
  background: var(--s1);
  border: 1px solid transparent;
  background-clip: padding-box;
}

.panel-grad::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--ac-border), var(--ac2-border));
  z-index: -1;
}


/* ================================================================
   10. LANDING HERO
   ================================================================ */
.view-hero {
  padding: 72px 0 60px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: center;
  min-height: 500px;
}

/* Copy block */
.hero-copy h1 {
  margin: 16px 0 18px;
}

.h1-coda {
  display: block;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 2px;
}

.hero-desc {
  font-size: 1.05rem;
  max-width: 480px;
  line-height: 1.8;
  color: var(--dim);
  margin-bottom: 38px;
}

/* CTA row */
.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

/* Stats strip */
.hero-stats {
  display: flex;
  align-items: stretch;
  gap: 24px;
  padding-top: 36px;
  border-top: 1px solid var(--b1);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-item strong {
  font-family: var(--fm);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.02em;
}

.stat-item span {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: .03em;
}

.stat-sep {
  width: 1px;
  background: var(--b2);
  flex-shrink: 0;
}


/* ================================================================
   11. SCANNER VISUALIZATION  (SIGNATURE ELEMENT)
   ── A radar-style rotating sweep with concentric rings,
      orbital nodes, crosshairs, and floating stat chips.
      100 % CSS — zero JS, zero images.
   ================================================================ */
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 440px;
}

/* Root container — sets all coordinate space */
.scanner-wrap {
  position: relative;
  width: 380px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Concentric rings ─────────────────────────────── */
.s-ring {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
}

.sr-outer {
  width: 100%; height: 100%;
  border-width: 1px;
  border-color: rgba(34,211,238,.18);
  animation: ringPulse 3.5s ease-in-out infinite;
}

.sr-mid {
  width: 66%; height: 66%;
  border-width: 1px;
  border-color: rgba(168,85,247,.22);
  animation: ringPulse 3.5s ease-in-out .6s infinite;
}

.sr-inner {
  width: 35%; height: 35%;
  border-width: 1px;
  border-color: rgba(34,211,238,.30);
  animation: ringPulse 3.5s ease-in-out 1.2s infinite;
}

/* ── Rotating conic sweep ────────────────────────── */
.s-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(34,211,238,.14) 0deg,
    rgba(34,211,238,.06) 30deg,
    transparent 60deg,
    transparent 360deg
  );
  clip-path: circle(50%);
  animation: scanRotate 4s linear infinite;
}

/* ── Rotating arm wrapper ─────────────────────────── */
.s-arm-wrap {
  position: absolute;
  inset: 0;
  animation: scanRotate 4s linear infinite;
}

/* Line from center outward */
.s-arm-line {
  position: absolute;
  left: 50%; top: 50%;
  width: 46%;
  height: 2px;
  margin-top: -1px;
  transform-origin: 0 50%;
  background: linear-gradient(to right, rgba(34,211,238,.95), transparent);
  box-shadow: 0 0 12px rgba(34,211,238,.5), 0 0 4px rgba(34,211,238,.8);
}

/* ── Crosshair lines ──────────────────────────────── */
.s-cross-h, .s-cross-v {
  position: absolute;
  background: rgba(99,130,210,.12);
}

.s-cross-h { left: 0; right: 0; top: 50%; height: 1px; margin-top: -.5px; }
.s-cross-v { top: 0; bottom: 0; left: 50%; width: 1px; margin-left: -.5px; }

/* ── Center core ──────────────────────────────────── */
.s-core {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,.15), rgba(168,85,247,.10));
  border: 1px solid var(--ac-border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: var(--glow-cyan);
}

.s-core-glow {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,.12), transparent 70%);
  animation: coreGlow 2.5s ease-in-out infinite;
}

.s-core-icon {
  font-size: 1.6rem;
  color: var(--ac-text);
  position: relative;
  z-index: 1;
  animation: iconBreath 3s ease-in-out infinite;
}

/* ── Orbital data nodes ───────────────────────────── */
.s-node {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(34,211,238,.7);
}

/* Positioned around the outer ring (% of 380px wrapper) */
.sn-1 { top:  2%; left: 50%; transform: translate(-50%,-50%); }
.sn-2 { top: 26%; right: 4%; background: var(--accent2); box-shadow: 0 0 12px rgba(168,85,247,.7); }
.sn-3 { bottom: 10%; right: 16%; }
.sn-4 { bottom: 3%; left: 42%; }
.sn-5 { top: 42%; left: 3%; }
.sn-6 { top: 10%; left: 16%; background: var(--accent2); box-shadow: 0 0 12px rgba(168,85,247,.7); }

/* Pulse animation on nodes */
.s-node { animation: nodeBlink 2.8s ease-in-out infinite; }
.sn-2, .sn-6 { animation-delay: 1.4s; }
.sn-3, .sn-5 { animation-delay: .7s; }
.sn-4       { animation-delay: 2.1s; }

/* ── Floating stat chips ──────────────────────────── */
.hero-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(8,16,31,.88);
  backdrop-filter: blur(18px);
  border: 1px solid var(--b2);
  border-radius: var(--r3);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(34,211,238,.06);
  min-width: 130px;
  z-index: 10;
}

/* Individual chip positions & staggered float */
.hc-top    { top: 4%;  right: -4%; animation: chipFloat 5s ease-in-out infinite; }
.hc-left   { bottom: 24%; left: -6%; animation: chipFloat 5s ease-in-out 1.8s infinite; }
.hc-bottom { bottom: 4%; right: 2%;  animation: chipFloat 5s ease-in-out 3.4s infinite; }

.hc-icon { font-size: 1.1rem; flex-shrink: 0; }

.hc-label {
  display: block;
  font-family: var(--fm);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

.hc-val {
  display: block;
  font-family: var(--fm);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-top: 2px;
}


/* ================================================================
   12. FEATURE ROW (below hero)
   ================================================================ */
.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 64px;
  padding-top: 60px;
  border-top: 1px solid var(--b1);
}

.feat-card {
  padding: 26px 22px;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r3);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color var(--std) var(--ease),
              transform var(--std) var(--spring),
              box-shadow var(--std) var(--ease);
  position: relative;
  overflow: hidden;
}

/* Corner glow on hover */
.feat-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--ac-glow);
  filter: blur(24px);
  opacity: 0;
  transition: opacity var(--std) var(--ease);
  pointer-events: none;
}

.feat-card:hover::before { opacity: 1; }

.feat-card:hover {
  border-color: var(--ac-border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Icon orb */
.feat-icon {
  width: 44px; height: 44px;
  border-radius: var(--r2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.feat-icon-cyan {
  background: var(--ac-dim);
  border: 1px solid var(--ac-border);
  color: var(--ac-text);
}

.feat-icon-violet {
  background: var(--ac2-dim);
  border: 1px solid var(--ac2-border);
  color: var(--ac2-text);
}

.feat-icon-green {
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.22);
  color: #34D399;
}

.feat-body h3 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.feat-body p {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}


/* ================================================================
   13. DASHBOARD VIEW
   ================================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
  overflow: visible !important;
}

#view-dashboard { overflow: visible !important; }

/* Shared form elements */
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--dim);
  margin-bottom: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  font-family: var(--fm);
}

.form-input {
  display: block;
  width: 100%;
  background: var(--s3);
  border: 1px solid var(--b2);
  border-radius: var(--r2);
  padding: 11px 14px;
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color var(--fast), box-shadow var(--fast);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ac-dim), 0 0 16px rgba(34,211,238,.1);
}

.form-input::placeholder { color: var(--muted); }

.textarea {
  resize: vertical;
  min-height: 130px;
  font-family: var(--fb);
  line-height: 1.65;
}

/* Panel footer */
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--b1);
  flex-wrap: wrap;
}

.hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .77rem;
  color: var(--muted);
}

/* How-it-works guide list */
.how-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.how-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .84rem;
  color: var(--dim);
  padding: 10px 14px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--b1);
  border-radius: var(--r2);
  line-height: 1.5;
  transition: border-color var(--fast), background var(--fast);
}

.how-item:hover {
  border-color: var(--b2);
  background: rgba(255,255,255,.035);
}

.how-num {
  font-family: var(--fm);
  font-size: .68rem;
  font-weight: 700;
  color: var(--ac-text);
  background: var(--ac-dim);
  border: 1px solid var(--ac-border);
  border-radius: var(--r1);
  padding: 3px 8px;
  flex-shrink: 0;
  letter-spacing: .05em;
  line-height: 1.6;
}

.how-item-secure .how-num,
.how-num-lock {
  color: var(--ac2-text);
  background: var(--ac2-dim);
  border-color: var(--ac2-border);
  font-size: .9rem;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* ================================================================
   14. COMBOBOX SYMPTOM SELECTOR SYSTEM
   ================================================================ */
.combobox-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
  overflow: visible !important;
}

/* 14a. Selected chips area */
.selected-chips-area {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-bottom: 10px;
  min-height: 0;
}

.symptom-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(34,211,238,.10), rgba(168,85,247,.08));
  border: 1px solid rgba(34,211,238,.28);
  color: var(--ac-text);
  padding: 6px 13px;
  border-radius: 100px;
  font-family: var(--fb);
  font-size: .84rem;
  font-weight: 600;
  transition: background var(--fast), border-color var(--fast), transform var(--fast);
  animation: chipScaleIn .2s var(--spring);
}

.symptom-chip:hover {
  background: linear-gradient(135deg, rgba(34,211,238,.16), rgba(168,85,247,.12));
  border-color: rgba(34,211,238,.45);
  transform: scale(1.02);
}

.symptom-chip-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none; border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  opacity: .55;
  transition: opacity var(--fast);
}
.symptom-chip-close:hover { opacity: 1; }

/* 14b. Search input + icon */
.combobox-wrapper {
  position: relative;
  width: 100%;
  overflow: visible !important;
}

.input-with-icon { position: relative; width: 100%; }

.search-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  z-index: 10;
  font-size: 1rem;
}

.combobox-input {
  padding-left: 42px !important;
  text-transform: lowercase;
}

/* 14c. Floating dropdown tray — z-index: 2500 */
.symptom-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--s2);
  border: 1px solid var(--b3);
  border-radius: var(--r3);
  max-height: 268px;
  overflow-y: auto;
  z-index: 2500;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(34,211,238,.06);
  padding: 6px;
  backdrop-filter: blur(12px);
}

.symptom-dropdown-menu::-webkit-scrollbar { width: 5px; }
.symptom-dropdown-menu::-webkit-scrollbar-track { background: transparent; }
.symptom-dropdown-menu::-webkit-scrollbar-thumb { background: var(--b2); border-radius: 100px; }
.symptom-dropdown-menu::-webkit-scrollbar-thumb:hover { background: var(--b3); }

/* 14d. Dropdown items */
.symptom-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--r2);
  color: var(--dim);
  font-family: var(--fb);
  font-size: .88rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
  text-transform: capitalize;
  font-weight: 500;
}

.symptom-dropdown-item:hover,
.symptom-dropdown-item.focused {
  background: var(--s3);
  color: var(--ac-text);
}

.symptom-dropdown-item.selected-item {
  color: rgba(34,211,238,.35);
  background: rgba(34,211,238,.02);
  cursor: not-allowed;
}

.symptom-dropdown-empty {
  padding: 18px;
  text-align: center;
  font-size: .84rem;
  color: var(--muted);
  font-family: var(--fb);
}


/* ================================================================
   15. DIAGNOSIS RESULT VIEW
   ================================================================ */
.result-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  align-items: start;
}

.result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}

/* Disease name — gradient on render */
.disease-name {
  font-family: var(--fd);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.12;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-date {
  font-family: var(--fm);
  font-size: .7rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Severity badges */
.sev-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--fm);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  flex-shrink: 0;
}

.sev-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.sev-low    { background: rgba(16,185,129,.1);  color: var(--ok);   border: 1px solid rgba(16,185,129,.25); }
.sev-medium { background: rgba(245,158,11,.1);  color: var(--warn); border: 1px solid rgba(245,158,11,.25); }
.sev-high   { background: rgba(239,68,68,.1);   color: var(--err);  border: 1px solid rgba(239,68,68,.25); }

/* Confidence block */
.conf-block {
  margin-bottom: 24px;
  padding: 18px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--b1);
  border-radius: var(--r3);
}

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

.conf-label {
  font-family: var(--fm);
  font-size: .7rem;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .09em;
}

.conf-value {
  font-family: var(--fm);
  font-size: 1.7rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* Progress track */
.conf-track {
  height: 6px;
  background: var(--s4);
  border-radius: 999px;
  overflow: hidden;
}

.conf-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent2), var(--accent), #A7F3D0);
  border-radius: 999px;
  transition: width 1.2s var(--spring);
  box-shadow: 0 0 14px rgba(34,211,238,.45);
  position: relative;
  overflow: hidden;
}

/* Shimmer after fill */
.conf-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shimmer 2s ease-in-out 1.4s 1 forwards;
}

/* Insight */
.insight-section { margin-bottom: 20px; }
.insight-section:last-child { margin-bottom: 0; }
.insight-section h4 { margin-bottom: 8px; }
.insight-section p { font-size: .88rem; line-height: 1.75; color: var(--dim); margin: 0; }

/* Detail blocks */
.detail-block { margin-bottom: 22px; }
.detail-block:last-child { margin-bottom: 0; }
.detail-block h4 { margin-bottom: 10px; }

.symptoms-box {
  font-family: var(--fm);
  font-size: .77rem;
  color: var(--dim);
  background: var(--s3);
  border: 1px solid var(--b1);
  border-radius: var(--r2);
  padding: 12px 14px;
  line-height: 1.7;
  letter-spacing: .01em;
}

/* Precautions list */
.prec-list { display: flex; flex-direction: column; gap: 7px; }

.prec-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .84rem;
  color: var(--dim);
  padding: 10px 13px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--b1);
  border-radius: var(--r2);
  line-height: 1.55;
  transition: border-color var(--fast), background var(--fast);
}

.prec-item:hover {
  border-color: var(--b2);
  background: rgba(255,255,255,.035);
}

.prec-item::before {
  content: '—';
  color: var(--accent);
  font-family: var(--fm);
  font-size: .68rem;
  flex-shrink: 0;
  margin-top: 3px;
}


/* ================================================================
   16. DIFFERENTIAL DIAGNOSES — TOP-3
   ================================================================ */
.top3-section { margin-top: 28px; }

.top3-section-header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 28px;
  margin-bottom: 22px;
  padding: 24px 0 20px;
  border-top: 1px solid var(--b1);
}

.top3-header-left { display: flex; flex-direction: column; gap: 5px; }

.top3-header-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--fm);
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--ac-text);
}

.top3-eyebrow-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

.top3-heading {
  font-family: var(--fd);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: -.01em;
  line-height: 1.15;
}

.top3-subheading {
  font-size: .8rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
  max-width: 380px;
}

.top3-header-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--b2), transparent);
  border-radius: 1px;
}

.top3-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}

/* Top-3 card base */
.top3-card {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r3);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--std) var(--ease),
              transform var(--std) var(--spring),
              box-shadow var(--std) var(--ease);
}

.top3-card:hover {
  transform: translateY(-3px);
  border-color: var(--b3);
  box-shadow: var(--shadow-md);
}

/* Rank variants */
.top3-primary {
  border-color: var(--ac-border);
  background: linear-gradient(145deg, var(--s1) 60%, rgba(34,211,238,.04));
  box-shadow: 0 0 32px rgba(34,211,238,.06);
}

.top3-secondary {
  border-color: rgba(168,85,247,.18);
}

.top3-tertiary { border-color: var(--b1); }

/* Card header */
.top3-header { display: flex; flex-direction: column; gap: 6px; }

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

.top3-rank-badge {
  font-family: var(--fm);
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--b1);
  padding: 3px 9px;
  border-radius: var(--r1);
  flex-shrink: 0;
}

.top3-primary .top3-rank-badge {
  color: var(--ac-text);
  background: var(--ac-dim);
  border-color: var(--ac-border);
}

.top3-disease-name {
  font-family: var(--fd);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}

.top3-conf-val {
  font-family: var(--fm);
  font-size: .9rem;
  font-weight: 700;
  color: var(--ac-text);
  flex-shrink: 0;
}

/* Fill bar colors by risk level */
.top3-fill-high {
  background: linear-gradient(90deg, var(--err), #FCA5A5);
  box-shadow: 0 0 8px rgba(239,68,68,.35);
}
.top3-fill-medium {
  background: linear-gradient(90deg, var(--warn), #FCD34D);
  box-shadow: 0 0 8px rgba(245,158,11,.30);
}
.top3-fill-low {
  background: linear-gradient(90deg, var(--ok), #6EE7B7);
  box-shadow: 0 0 8px rgba(16,185,129,.30);
}

/* Card body */
.top3-body { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }

.top3-label {
  display: block;
  font-family: var(--fm);
  font-size: .63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--muted);
  margin-bottom: 6px;
}

.top3-desc-block, .top3-prec-block { display: flex; flex-direction: column; }

.top3-desc-text { font-size: .81rem; color: var(--dim); line-height: 1.65; margin: 0; }

.top3-prec-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }

.top3-prec-list li {
  position: relative;
  padding: 6px 10px 6px 20px;
  font-size: .78rem;
  color: var(--dim);
  background: rgba(255,255,255,.02);
  border: 1px solid var(--b1);
  border-radius: var(--r1);
  line-height: 1.45;
}

.top3-prec-list li::before {
  content: '—';
  position: absolute;
  left: 7px; top: 6px;
  color: var(--accent);
  font-family: var(--fm);
  font-size: .66rem;
}

/* Mobile stacking */
@media (max-width: 820px) { .top3-grid { grid-template-columns: 1fr; } }

@media (max-width: 600px) {
  .top3-section-header { grid-template-columns: 1fr; gap: 0; padding: 18px 0 14px; }
  .top3-header-rule { display: none; }
  .top3-subheading { max-width: 100%; }
}


/* ================================================================
   17. ANALYTICS VIEW
   ================================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.stat-block {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r3);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--std), transform var(--std);
}

.stat-block:hover { transform: translateY(-2px); border-color: var(--b2); }

/* Corner glow orb */
.stat-block::after {
  content: '';
  position: absolute;
  top: -24px; right: -24px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--ac-glow);
  filter: blur(22px);
  pointer-events: none;
  opacity: .8;
}

.stat-block-warn::after  { background: rgba(245,158,11,.2); }
.stat-block-violet::after { background: rgba(168,85,247,.2); }

.stat-block-icon {
  font-size: 1.2rem;
  color: var(--ac-text);
  margin-bottom: 4px;
}

.stat-block-warn .stat-block-icon { color: var(--warn-text); }
.stat-block-violet .stat-block-icon { color: var(--ac2-text); }

.stat-block-label {
  font-family: var(--fm);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--muted);
}

.stat-block-val {
  font-family: var(--fm);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.02em;
}

/* Symptom tag cloud */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  font-family: var(--fm);
  font-size: .74rem;
  font-weight: 600;
  color: var(--ac-text);
  background: var(--ac-dim);
  border: 1px solid var(--ac-border);
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: .02em;
}

.tag-empty {
  font-size: .84rem;
  color: var(--muted);
}


/* ================================================================
   18. HISTORY CARDS — PREMIUM ACCORDION
   ================================================================ */
.history-list { display: flex; flex-direction: column; gap: 12px; }

.hist-item {
  display: flex;
  flex-direction: column;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r3);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--fast), box-shadow var(--fast), transform var(--fast);
}

.hist-item:hover {
  border-color: var(--ac-border);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(34,211,238,.06);
  transform: translateY(-1px);
}

/* Card header */
.hist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.75rem;
  cursor: pointer;
  user-select: none;
  gap: 2rem;
}

.hist-main { flex: 1; min-width: 0; }

.hist-disease {
  font-family: var(--fd);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-transform: capitalize;
  margin: 0 0 .25rem;
  letter-spacing: -.01em;
  line-height: 1.25;
}

.hist-symptoms-preview {
  font-size: .83rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-side {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-shrink: 0;
}

.hist-date {
  font-family: var(--fm);
  font-size: .76rem;
  color: var(--muted);
}

.hist-conf {
  font-family: var(--fm);
  font-size: .88rem;
  font-weight: 700;
  color: var(--ok-text);
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.18);
  padding: .25rem .65rem;
  border-radius: 6px;
}

.hist-toggle {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--b1);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}

.hist-header:hover .hist-toggle {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-color: var(--b2);
}

.hist-toggle i {
  display: inline-block;
  transition: transform .22s var(--ease);
  font-size: 1rem;
}

.hist-toggle[aria-label="Collapse"] i {
  transform: rotate(180deg);
  color: var(--ac-text);
}

/* Details tray */
.hist-details {
  border-top: 1px solid var(--b1);
  background: rgba(0,0,0,.18);
  padding: 1.75rem;
}

.hist-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
}

.hist-block { display: flex; flex-direction: column; gap: .6rem; }

.hist-block strong {
  font-family: var(--fm);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
}

.hist-block p,
.hist-precautions-list li { color: var(--dim); font-size: .88rem; line-height: 1.6; margin: 0; }

.hist-symptoms-detailed { text-transform: capitalize; }

.hist-precautions-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .5rem;
}

.hist-precautions-list li { position: relative; padding-left: 1.25rem; text-transform: capitalize; }

.hist-precautions-list li::before {
  content: '•';
  position: absolute; left: 0; top: -1px;
  color: var(--ok-text);
  font-weight: bold;
  font-size: 1.1rem;
}

/* Delete button */
.hist-delete-btn {
  background: rgba(239,68,68,.04);
  border: 1px solid rgba(239,68,68,.15);
  color: var(--err);
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: all var(--fast);
}

.hist-delete-btn:hover {
  background: var(--err);
  color: #fff;
  border-color: var(--err);
  box-shadow: 0 0 14px rgba(239,68,68,.4);
}

.hist-delete-btn i { font-size: 1rem; }

/* Empty state */
.hist-empty {
  text-align: center;
  padding: 64px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hist-empty-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ac-dim), var(--ac2-dim));
  border: 1px solid var(--b2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--ac-text);
  margin-bottom: 8px;
}

.hist-empty p { color: var(--muted); font-size: .88rem; }

/* Mini top-3 inside expanded card */
.hist-top3-mini { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }

.hist-top3-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--b1);
  border-radius: var(--r1);
}

.hist-top3-rank {
  font-family: var(--fm);
  font-size: .64rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  width: 26px;
  flex-shrink: 0;
}

.hist-top3-disease { flex: 1; color: var(--text); font-size: .84rem; font-weight: 500; text-transform: capitalize; }
.hist-top3-conf { font-family: var(--fm); font-size: .82rem; color: var(--ac-text); font-weight: 700; flex-shrink: 0; }

/* Legacy selectors (JS compatibility) */
.hist-symptoms { font-family: var(--fm); font-size: .86rem; color: var(--muted); line-height: 1.8; }
.hist-precautions { display: grid; gap: 10px; }
.hist-precautions strong { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ac-text); }
.hist-precautions ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist-precautions li { font-family: var(--fm); font-size: .82rem; color: var(--dim); padding: 10px 12px; background: rgba(255,255,255,.02); border: 1px solid var(--b1); border-radius: var(--r1); }


/* ================================================================
   19. PROFILE VIEW
   ================================================================ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.prof-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--ac-dim), var(--ac2-dim));
  border: 2px solid var(--ac-border);
  color: var(--ac-text);
  font-family: var(--fm);
  font-size: 1rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .04em;
  box-shadow: var(--glow-cyan);
}

.prof-top { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }

.prof-name { font-family: var(--fd); font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.prof-email { font-size: .82rem; color: var(--muted); margin-top: 4px; }

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--b1);
}

.stat-row:last-child { border-bottom: none; }
.stat-row span { font-size: .84rem; color: var(--dim); }
.stat-row strong { font-family: var(--fm); font-size: .9rem; color: var(--text); }


/* ================================================================
   20. AUTH MODAL SYSTEM — z-index: 9999
   ================================================================ */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(3,5,14,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn var(--std) var(--ease);
}

.modal {
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: var(--r4);
  padding: 36px;
  width: 100%;
  max-width: 410px;
  position: relative;
  box-shadow: var(--shadow-lg), var(--glow-violet);
  animation: slideUp var(--std) var(--spring);
}

/* Gradient border on modal */
.modal::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(34,211,238,.15), rgba(168,85,247,.15), rgba(34,211,238,.1));
  z-index: -1;
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: var(--r1);
  color: var(--dim);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}

.modal-close:hover { background: rgba(239,68,68,.1); color: var(--err); border-color: rgba(239,68,68,.25); }

/* Modal brand row */
.modal-brand {
    display: flex;
    align-items: flex-start;   /* Aligns icon perfectly with the top line of text */
    gap: 16px;
    margin-bottom: 28px;
    width: 100%;
}

.modal-brand-icon {
    width: 42px; 
    height: 42px;
    border-radius: var(--r2);
    background: linear-gradient(135deg, var(--ac-dim), var(--ac2-dim));
    border: 1px solid var(--ac-border);
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: var(--ac-text);
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 4px;           /* Subtle nudge down to match capital letter alignment */
}

.modal-brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;              /* Core fix: stops the font from pushing left over the icon */
}

.modal-brand h2 {
    font-family: var(--fb) !important;
    font-size: 2.4rem !important;        
    font-weight: 800;                    
    letter-spacing: -0.03em;             
    color: var(--text);                  
    margin: 0 0 6px 0 !important;
    line-height: 1.1 !important;    
    display: inline-block;
    width: 100%;
    
    /* CORE FIX FOR CLIPPING: */
    padding: 8px 0 4px 0 !important; /* Gives the tops of tall letters a safe rendering zone */
    overflow: visible !important;   /* Forces browser to show the whole font shape */
}
.modal-brand h2 span {
    background: var(--grad-text);        /* Uses your custom cyan-to-violet gradient text variable */
    -webkit-background-clip: text;       /* Clips the background grid strictly to the text outline */
    -webkit-text-fill-color: transparent;/* Makes the inner text color transparent to let gradient show */
    disp.modal-brand h2 span {
    background: var(--grad-text);        
    -webkit-background-clip: text;       
    -webkit-text-fill-color: transparent;
    display: inline-block;
    padding-right: 0.06em;               
}lay: inline-block;
    padding-right: 0.05em;               /* Safe buffer zone to prevent the wide font from clipping */
}
.modal-sub { 
    font-size: .84rem; 
    color: var(--muted); 
    line-height: 1.4;
    margin: 0 !important;              
    padding: 0 !important;           /* Hard reset to destroy any lingering 54px shift */
    text-align: left;
}

/* Social buttons */
.social-grid { display: flex; flex-direction: column; gap: 9px; margin-bottom: 22px; }

.social-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 15px;
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--r2);
  color: var(--text);
  font-size: .84rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast), transform var(--fast);
}

.social-btn:hover { border-color: var(--b3); background: var(--s3); transform: translateX(2px); }
.social-icon { width: 17px; height: 17px; flex-shrink: 0; }

/* Email/pass divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--fm);
  font-size: .68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .10em;
  margin-bottom: 16px;
}

.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--b1); }

.auth-fields { display: flex; flex-direction: column; gap: 9px; }

.auth-err {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--r2);
  padding: 10px 14px;
  font-size: .82rem;
  color: var(--err-text);
  margin-bottom: 10px;
}

.auth-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  margin-top: 18px;
  font-size: .78rem;
  color: var(--muted);
}

.auth-switch {
  font-size: .78rem; font-weight: 700;
  color: var(--ac-text);
  background: none; border: none; cursor: pointer;
  transition: color var(--fast);
}
.auth-switch:hover { color: var(--accent); text-decoration: underline; }


/* ================================================================
   21. TOAST NOTIFICATION SYSTEM
   ================================================================ */
.toast-wrap {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(8,16,31,.92);
  border: 1px solid var(--b2);
  border-radius: var(--r3);
  font-size: .84rem;
  color: var(--text);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  max-width: 320px;
  backdrop-filter: blur(14px);
  animation: toastSlideIn var(--std) var(--spring);
}

.toast i { font-size: 1rem; flex-shrink: 0; }

.toast-ok   { border-left: 3px solid var(--ok);   }
.toast-err  { border-left: 3px solid var(--err);  }
.toast-warn { border-left: 3px solid var(--warn); }
.toast-info { border-left: 3px solid var(--info); }

.toast-ok   i { color: var(--ok-text); }
.toast-err  i { color: var(--err-text); }
.toast-warn i { color: var(--warn-text); }
.toast-info i { color: var(--info); }


/* ================================================================
   22. LOADING VEIL — z-index: 9999
   ================================================================ */
.loading-veil {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(3,5,14,.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  animation: fadeIn var(--fast) var(--ease);
}

/* Mini scanner in veil */
.veil-scanner {
  position: relative;
  width: 110px; height: 110px;
  display: flex; align-items: center; justify-content: center;
}

.veil-ring {
  position: absolute;
  border-radius: 50%;
  border-style: solid;
}

.vr1 { width: 100%; height: 100%; border-width: 1px; border-color: rgba(34,211,238,.25); animation: ringPulse 2.2s ease-in-out infinite; }
.vr2 { width: 62%;  height: 62%;  border-width: 1px; border-color: rgba(168,85,247,.30); animation: ringPulse 2.2s ease-in-out .45s infinite; }

.veil-arm-wrap {
  position: absolute;
  inset: 0;
  animation: scanRotate 1.8s linear infinite;
}

.veil-arm {
  position: absolute;
  left: 50%; top: 50%;
  width: 46%;
  height: 2px;
  margin-top: -1px;
  transform-origin: 0 50%;
  background: linear-gradient(to right, rgba(34,211,238,.95), transparent);
  box-shadow: 0 0 10px rgba(34,211,238,.55);
}

.veil-core {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ac-dim), var(--ac2-dim));
  border: 1px solid var(--ac-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--ac-text);
  font-size: 1rem;
  box-shadow: var(--glow-cyan);
  z-index: 5;
}

.loading-text {
  font-family: var(--fm);
  font-size: .72rem;
  color: var(--dim);
  letter-spacing: .18em;
  text-transform: uppercase;
  animation: textFade 1.5s ease-in-out infinite;
}

/* Legacy spinner (kept for backward compat) */
.spin {
  width: 42px; height: 42px;
  border: 2.5px solid var(--b1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}


/* ================================================================
   23. KEYFRAME ANIMATION ENGINE
   ================================================================ */

/* Continuous rotation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scanner arm rotation */
@keyframes scanRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Ring pulsing */
@keyframes ringPulse {
  0%, 100% { opacity: .85; }
  50%       { opacity: .35; }
}

/* Ambient orb drift */
@keyframes orbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(28px, -36px) scale(1.04); }
  66%       { transform: translate(-18px, 22px) scale(.96); }
}

/* Center icon subtle breath */
@keyframes iconBreath {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .75; transform: scale(.93); }
}

/* Core glow pulse */
@keyframes coreGlow {
  0%, 100% { opacity: .8; transform: scale(1); }
  50%       { opacity: .35; transform: scale(1.15); }
}

/* Node blink */
@keyframes nodeBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 12px rgba(34,211,238,.7); }
  50%       { opacity: .35; box-shadow: none; }
}

/* Eyebrow dot pulse */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(34,211,238,.4); }
  50%       { opacity: .55; transform: scale(.9); box-shadow: 0 0 8px 2px rgba(34,211,238,.15); }
}

/* Chip float */
@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Fade out */
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(14px); }
}

/* Slide up — modals */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Toast slide in from right */
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Chip scale in */
@keyframes chipScaleIn {
  from { opacity: 0; transform: scale(.88); }
  to   { opacity: 1; transform: scale(1); }
}

/* Confidence bar shimmer */
@keyframes shimmer {
  from { left: -100%; }
  to   { left: 200%; }
}

/* Loading text fade */
@keyframes textFade {
  0%, 100% { opacity: .6; }
  50%       { opacity: 1; }
}


/* ================================================================
   24. RESPONSIVE BREAKPOINTS
   ================================================================ */

/* ── Tablet / Narrow Desktop (≤ 900px) ─────────────────── */
@media (max-width: 900px) {

  .hero-grid { grid-template-columns: 1fr; min-height: auto; }

  /* Show scanner below copy on tablet, scaled down */
  .hero-visual { min-height: 320px; }

  .scanner-wrap { width: 280px; height: 280px; }

  .hc-top   { top: 2%; right: 2%; }
  .hc-left  { bottom: 5%; left: 2%; }
  .hc-bottom { display: none; }

  .feature-row { grid-template-columns: 1fr; gap: 12px; margin-top: 44px; padding-top: 44px; }

  .dash-grid   { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .stats-row   { grid-template-columns: 1fr 1fr; }
  .profile-grid { grid-template-columns: 1fr; }

  .nav-links { display: none; }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

}

/* ── Mobile (≤ 680px) ──────────────────────────────────── */
@media (max-width: 680px) {

  .view { padding: 36px 0; }

  .hist-header { flex-direction: column; align-items: flex-start; gap: .85rem; padding: 1.25rem; }
  .hist-side { width: 100%; justify-content: space-between; border-top: 1px solid var(--b1); padding-top: .75rem; }
  .hist-content { grid-template-columns: 1fr; gap: 1.5rem; }
  .hist-details { padding: 1.25rem; }
  .hist-delete-btn { width: 36px; height: 36px; }

  .modal { padding: 28px 20px; }

  .scanner-wrap { width: 220px; height: 220px; }
  .hero-visual { min-height: 260px; }
  .hc-left, .hc-bottom { display: none; }
  .hc-top { right: 4%; top: 4%; }

}

/* ── Small Mobile (≤ 480px) ────────────────────────────── */
@media (max-width: 480px) {

  .stats-row { grid-template-columns: 1fr; }

  h1 { font-size: 2.2rem; }

  .hero-visual { display: none; } /* hide scanner on tiny screens */

  .modal { border-radius: var(--r3); }

}