:root {
  --bg: #080e1a;
  --bg2: #0d1625;
  --bg3: #111d2e;
  --card: #131f33;
  --card2: #192540;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text: #e2e8f0;
  --muted: #64748b;
  --accent: #e53e3e;
  --accent2: #fc8181;
  --accent3: #feb2b2;
  --blue: #3b82f6;
  --green: #22c55e;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 32px rgba(0,0,0,0.4);
}

/* ── Light mode ─────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg2: #eaf0f8;
  --bg3: #dde6f2;
  --card: #ffffff;
  --card2: #eef2f9;
  --border: rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.13);
  --text: #1a202c;
  --muted: #64748b;
  --accent: #dc2626;
  --accent2: #ef4444;
  --accent3: #fca5a5;
  --shadow: 0 4px 32px rgba(0,0,0,0.10);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f6fb;
    --bg2: #eaf0f8;
    --bg3: #dde6f2;
    --card: #ffffff;
    --card2: #eef2f9;
    --border: rgba(0,0,0,0.08);
    --border2: rgba(0,0,0,0.13);
    --text: #1a202c;
    --muted: #64748b;
    --accent: #dc2626;
    --accent2: #ef4444;
    --accent3: #fca5a5;
    --shadow: 0 4px 32px rgba(0,0,0,0.10);
  }
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/*NAV*/
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 2rem;
  height: 60px;
  background: rgba(8,14,26,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .nav { background: rgba(244,246,251,0.92); }

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo-icon {
  font-size: 1.3rem;
  color: var(--accent);
  animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.2); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  56% { transform: scale(1); }
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links a {
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--card);
}

.nav-links a.active {
  color: var(--accent2);
}

.chatbot-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s;
  white-space: nowrap;
}
.chatbot-btn:hover { background: #c53030; }

/* ── Theme toggle ─────────────────────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
  color: var(--text);
}
.theme-toggle:hover { background: var(--card2); border-color: var(--accent); }

/*HERO*/
.hero, .page-hero {
  position: relative;
  padding: 120px 2rem 60px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(229,62,62,0.15);
  animation: pulseRing 3s ease infinite;
}
.r1 { width: 300px; height: 300px; animation-delay: 0s; }
.r2 { width: 500px; height: 500px; animation-delay: 1s; }
.r3 { width: 700px; height: 700px; animation-delay: 2s; }

@keyframes pulseRing {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); }
}

.hero-content { position: relative; z-index: 1; }

.hero-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  background: rgba(229,62,62,0.12);
  border: 1px solid rgba(229,62,62,0.3);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 1.2rem;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1rem;
}

.accent { color: var(--accent); }

.hero-sub {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
}

/*CONTAINER*/
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/*PREDICT SECTION*/
.predict-section {
  padding: 0 0 5rem;
}

.predict-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

.form-card, .guide-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.card-header p {
  color: var(--muted);
  font-size: 0.88rem;
}

.predict-form {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.unit {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.field-group input,
.field-group select {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--accent);
}

.field-group select { cursor: pointer; }
.field-group select option { background: var(--bg2); }

.bmi-display .bmi-value {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-head);
  color: var(--accent2);
}

.predict-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 2rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}

.predict-btn:hover {
  background: #c53030;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(229,62,62,0.3);
}

.result-box {
  margin: 0 1.75rem 1.75rem;
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  animation: fadeIn 0.4s ease;
}

.result-box.high-risk {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}

.result-box.low-risk {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #86efac;
}

.hidden { display: none !important; }

/* GUIDE CARD */
.guide-list {
  padding: 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.guide-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.guide-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.guide-item strong {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.guide-item p {
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
}

.guide-cta {
  display: block;
  padding: 1rem 1.75rem 1.5rem;
  color: var(--accent2);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s;
}
.guide-cta:hover { color: var(--accent3); }

/*CHATBOT WIDGET*/
.chat-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 54px;
  height: 54px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(229,62,62,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.2s, opacity 0.2s;
  animation: heartbeat 1.5s ease infinite;
}
.chat-fab:hover { transform: scale(1.1); }
.chat-fab.fab-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  animation: none;
}

.chat-widget {
  position: fixed;
  bottom: 5.5rem;
  right: 2rem;
  width: 360px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  display: flex;
  flex-direction: column;
  max-height: 480px;
  animation: slideUp 0.3s ease;
}

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

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

.chat-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-family: var(--font-head);
  font-size: 0.95rem;
}

.chat-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: blink 1.5s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.chat-header button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg.bot .rmsg-inner, .msg.bot {
  background: var(--bg2);
  border-radius: 12px 12px 12px 4px;
  padding: 0.9rem 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 90%;
}

.msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-radius: 12px 12px 4px 12px;
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  max-width: 80%;
}

.quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.quick-btns button {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s;
}
.quick-btns button:hover { background: var(--border2); }

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

.chat-input-row input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
}
.chat-input-row input:focus { border-color: var(--accent); }

.chat-input-row button {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1.1rem;
  padding: 0 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.chat-input-row button:hover { background: #c53030; }

/*RISK PAGE*/
body.risk-page {
  overflow: hidden;
  height: 100vh;
}

.risk-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 60px);
  margin-top: 60px;
}

.risk-sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.risk-sidebar-inner {
  padding: 2rem 1.5rem;
}

.sidebar-logo {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.risk-sidebar h2 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.risk-sidebar p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.step-item {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.83rem;
  color: var(--muted);
  border-left: 2px solid transparent;
  transition: all 0.25s;
}

.step-item.active {
  background: rgba(229,62,62,0.1);
  border-left-color: var(--accent);
  color: var(--accent2);
  font-weight: 600;
}

.step-item.done {
  color: var(--green);
  border-left-color: var(--green);
}

.step-item.done::before {
  content: '✓ ';
}

/* RISK MAIN CHAT */
.risk-main {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.risk-chat {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rmsg {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
}
.rmsg.visible { opacity: 1; transform: translateY(0); }

.rmsg.bot { align-self: flex-start; max-width: 680px; }
.rmsg.user { align-self: flex-end; max-width: 400px; }

.rmsg.bot .rmsg-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px;
  padding: 1.1rem 1.3rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.rmsg.user .rmsg-inner {
  background: var(--accent);
  color: white;
  border-radius: 16px 4px 16px 16px;
  padding: 0.8rem 1.1rem;
  font-size: 0.95rem;
}

.tip-box {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #93c5fd;
  line-height: 1.5;
}

.risk-input-area {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--card);
}

.rinput-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.rinput {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
}
.rinput:focus { border-color: var(--accent); }

.rinput-unit {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.rnext-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.2s;
  white-space: nowrap;
}
.rnext-btn:hover { background: #c53030; }

.ropt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ropt-btn {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.ropt-btn:hover { background: var(--accent); border-color: var(--accent); color: white; }

.analyzing {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.analyze-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* RESULT CARD in chat */
.result-card {
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.result-card.high {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
}

.result-card.low {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.25);
}

.result-icon { font-size: 2rem; margin-bottom: 0.5rem; }

.result-label {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.prob-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.prob-fill { height: 100%; border-radius: 4px; transition: width 1s ease; }

.result-card p { font-size: 0.88rem; color: var(--muted); margin-top: 0.75rem; }

.result-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--accent2);
  font-size: 0.88rem;
  font-weight: 600;
}
.result-link:hover { color: var(--accent3); }

/*REDUCE PAGE*/
.reduce-section {
  padding: 0 0 5rem;
}

.reduce-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.reduce-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.reduce-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.reduce-card[data-color="red"]::before { background: #ef4444; }
.reduce-card[data-color="orange"]::before { background: #f97316; }
.reduce-card[data-color="blue"]::before { background: #3b82f6; }
.reduce-card[data-color="purple"]::before { background: #a855f7; }
.reduce-card[data-color="green"]::before { background: #22c55e; }
.reduce-card[data-color="teal"]::before { background: #14b8a6; }
.reduce-card[data-color="yellow"]::before { background: #eab308; }
.reduce-card[data-color="pink"]::before { background: #ec4899; }

.reduce-card:hover {
  transform: translateY(-3px);
  border-color: var(--border2);
}

.reduce-icon { font-size: 2rem; margin-bottom: 0.75rem; }

.reduce-card h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.reduce-tag {
  display: inline-block;
  background: var(--bg2);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.reduce-card p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.reduce-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.reduce-card ul li {
  font-size: 0.84rem;
  color: var(--text);
  padding-left: 1.2rem;
  position: relative;
}

.reduce-card ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent2);
  font-size: 0.75rem;
}

.reduce-cta-bar {
  text-align: center;
  padding: 2.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.reduce-cta-bar p {
  color: var(--muted);
  font-size: 0.95rem;
}

.cta-btn {
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.cta-btn:hover { background: #c53030; }
.cta-btn.outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text);
}
.cta-btn.outline:hover { background: var(--card2); }

/*FAQ PAGE*/
.faq-section {
  padding-top: 60px;
  min-height: 100vh;
  background: var(--bg);
}

.faq-header {
  text-align: center;
  padding: 4rem 2rem 3rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.faq-badge {
  display: inline-block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.faq-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.faq-header p {
  color: var(--muted);
  font-size: 0.95rem;
}

.faq-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.faq-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s;
}

.faq-item.open {
  border-color: rgba(229,62,62,0.3);
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}
.faq-q:hover { color: var(--accent2); }

.faq-item.open .faq-q { color: var(--accent2); }

.faq-arrow {
  color: var(--accent);
  font-size: 0.7rem;
  transition: transform 0.25s;
  flex-shrink: 0;
}

.faq-item:not(.open) .faq-arrow {
  transform: rotate(-90deg);
}

.faq-a {
  display: none;
  padding: 0 1.25rem 1.1rem;
}

.faq-item.open .faq-a {
  display: block;
}

.faq-a p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}
.faq-a strong { color: var(--text); }

/* VISUALIZE PAGE*/
.viz-section {
  padding: 0 0 5rem;
}

.viz-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.viz-control-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.viz-control-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.viz-control-group select {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}
.viz-control-group select:focus { border-color: var(--accent); }

.viz-info-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.83rem;
  color: var(--muted);
}

.viz-explain {
  background: var(--card);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.5rem;
  margin-bottom: 1.75rem;
}

.viz-explain h3 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: #93c5fd;
}

.viz-explain p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.viz-explain code {
  background: var(--bg2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--accent2);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.chart-sub {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}

.chart-card canvas {
  max-height: 260px;
}

.chart-card.wide canvas {
  max-height: 300px;
}

.viz-note {
  margin-top: 1.75rem;
  padding: 1rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--muted);
}
.viz-note strong { color: var(--text); }

/*ANIMATIONS*/
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/*SCROLLBAR*/
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/*RESPONSIVE*/
/* ── Tablet ≤900px ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .predict-grid    { grid-template-columns: 1fr; }
  .charts-grid     { grid-template-columns: 1fr; }
  .chart-card.wide { grid-column: auto; }
  .faq-container   { grid-template-columns: 1fr; }
  .risk-layout     { grid-template-columns: 1fr; }
  .risk-sidebar    { display: none; }
  .nav-links       { display: none; }
  .chatbot-btn     { display: none; }
  .hamburger       { display: flex; margin-left: auto; }
  .theme-toggle    { margin-left: 0; }
}

/* ── Mobile ≤600px ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav { padding: 0 1rem; gap: 0.5rem; }

  /* Hide AI Assistant text on tiny screens, keep icon */
  .chatbot-btn .btn-label { display: none; }
  .chatbot-btn { padding: 0.4rem 0.65rem; }

  /* Stack ALL form rows to single column */
  .form-row,
  .form-row.three { grid-template-columns: 1fr !important; }

  /* Hyper section: full width, no overflow */
  .hyper-section { padding: 1rem; overflow: hidden; }
  .hyper-section .form-row.three { grid-template-columns: 1fr !important; }

  /* Padding adjustments */
  .predict-form { padding: 1rem; }
  .container    { padding: 0 1rem; }
  .hero, .page-hero { padding: 90px 1rem 40px; }
  .hero-title   { font-size: 2rem; }

  /* Reduce cards single col */
  .reduce-grid { grid-template-columns: 1fr; }

  /* Viz controls stack */
  .viz-controls { flex-direction: column; align-items: stretch; }
  .viz-control-group { flex-direction: column; align-items: flex-start; }
  .viz-control-group select { width: 100%; }

  /* Chat widget full width */
  .chat-widget { width: calc(100vw - 2rem); right: 1rem; bottom: 5rem; }

  /* FAQ padding */
  .faq-header    { padding: 2rem 1rem 1.5rem; }
  .faq-container { padding: 1.5rem 1rem 3rem; }
}

/* ── Hamburger button (hidden on desktop) ──────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav drawer ─────────────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border2);
  z-index: 99;
  padding: 0.75rem;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  animation: drawerDown 0.2s ease;
}
.mobile-nav.open { display: flex; }

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

.mobile-nav a {
  display: block;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.15s;
}
.mobile-nav a:hover  { background: var(--bg2); color: var(--text); }
.mobile-nav a.active { background: rgba(229,62,62,0.1); color: var(--accent2); font-weight: 600; }
/* ── Hypertension Optional Section (Index.html) ─────────────────────────── */
.hyper-section {
  margin: 1.5rem 0 0;
  padding: 1.25rem 1.5rem;
  background: rgba(249,115,22,0.05);
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: 14px;
  overflow: hidden;
}
/* Align all 3 hypertension dropdowns at the same baseline */
.hyper-section .form-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.hyper-section .field-group {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}
.hyper-section .field-group label {
  white-space: normal;
  word-break: break-word;
}
.hyper-section-header {
display: flex;
align-items: flex-start;
gap: 0.75rem;
margin-bottom: 1rem;
}
.hyper-icon { font-size: 1.4rem; line-height: 1; }
.hyper-section-header strong {
display: block;
font-family: var(--font-head);
font-weight: 700;
color: #f97316;
font-size: 1rem;
}
.hyper-optional {
font-size: 0.8rem;
color: var(--muted);
display: block;
margin-top: 2px;
}

/* ── Guide divider for hypertension params ───────────────────────────────── */
.guide-divider {
font-family: var(--font-head);
font-weight: 700;
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #f97316;
padding: 0.75rem 0 0.25rem;
border-top: 1px solid rgba(249,115,22,0.2);
margin-top: 0.5rem;
}

/* ── Reduce Hypertension section ─────────────────────────────────────────── */
.hyper-reduce-header {
text-align: center;
margin: 3.5rem 0 2rem;
padding: 2rem;
background: rgba(249,115,22,0.05);
border: 1px solid rgba(249,115,22,0.15);
border-radius: 16px;
}
.hyper-reduce-badge {
display: inline-block;
background: rgba(249,115,22,0.12);
color: #f97316;
border: 1px solid rgba(249,115,22,0.25);
border-radius: 20px;
padding: 0.3rem 1rem;
font-size: 0.82rem;
font-weight: 600;
letter-spacing: 0.06em;
text-transform: uppercase;
margin-bottom: 0.75rem;
}
.hyper-reduce-header h2 {
font-family: var(--font-head);
font-size: 1.8rem;
font-weight: 800;
color: var(--text);
margin: 0 0 0.4rem;
}
.hyper-reduce-header p { color: var(--muted); margin: 0; }

/* ── FAQ hypertension header ─────────────────────────────────────────────── */
.faq-hyper-header {
text-align: center;
padding: 3rem 2rem 1.5rem;
max-width: 700px;
margin: 0 auto;
}
.faq-hyper-header h2 {
font-family: var(--font-head);
font-size: 2rem;
font-weight: 800;
margin: 0.5rem 0 0.4rem;
}
.faq-hyper-header p { color: var(--muted); }