:root {
  --navy: #0f2a4a;
  --teal: #1c7293;
  --teal-2: #065a82;
  --gold: #c9962b;
  --gold-2: #f2a007;
  --gold-light: #f4d17a;
  --leaf: #2e7d5b;
  --rose: #b33a3a;
  --ink: #0e2230;
  --ink-2: #233247;
  --muted: #5a6b7b;
  --line: #e1e7ee;
  --paper: #ffffff;
  --soft: #f5f8fb;
  --white: #ffffff;
  --grad: linear-gradient(135deg, #0f2a4a 0%, #1c5577 55%, #1c7293 100%);
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 42, 74, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; background: var(--paper); }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(12px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
}
.brand { display: flex; gap: 12px; align-items: center; flex: 0 0 auto; }
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: #fff;
  background: var(--grad);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-family: Georgia, Cambria, serif;
  font-weight: 700;
}
.brand-name { font-family: Georgia, Cambria, serif; font-weight: 700; font-size: 18px; color: var(--navy); }
.brand-sub { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }

.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; }
.nav button {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 9px 11px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}
.nav button.active, .nav button:hover { background: #eaf3f8; color: var(--teal-2); }
.cta-btn {
  border: 0;
  background: var(--navy);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}
.cta-btn:hover { background: var(--gold-2); color: #1b1300; }

.content { min-width: 0; }
.topbar {
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  background: rgba(246, 248, 250, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 3;
}
.page { max-width: 1180px; padding: 46px 24px 80px; margin: 0 auto; }
.home-page { padding-top: 0; }
.page-title { margin: 0; font-family: Georgia, Cambria, serif; font-size: clamp(2.2rem, 4vw, 3.4rem); color: var(--navy); line-height: 1.12; }
.subtle { color: var(--muted); }

.auth-screen, .splash, .onboarding {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #0f2a4a, #1c5577, #1c7293);
}
.auth-panel, .onboard-panel {
  width: min(520px, 100%);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.splash-card { color: var(--white); text-align: center; }
.splash-card .brand-mark { width: 76px; height: 76px; margin: 0 auto 18px; font-size: 30px; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 2px 8px rgba(15, 42, 74, 0.04);
}
.card.clickable:hover { border-color: var(--teal); box-shadow: var(--shadow); }
.stat { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.stat-value { font-family: Georgia, Cambria, serif; color: var(--navy); font-size: 34px; font-weight: 700; }

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
}
.btn.primary { background: var(--gold-2); color: #261a02; }
.btn.navy { background: var(--navy); color: var(--white); }
.btn.ghost { border-color: var(--line); }
.btn.ghost-dark { border-color: rgba(255,255,255,0.42); color: #fff; background: transparent; }
.btn.ghost-dark:hover { background: rgba(255,255,255,0.08); border-color: #fff; }
.btn.danger { background: var(--rose); color: var(--white); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { font-weight: 700; color: var(--ink-2); }
.field small { color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--white);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(28, 114, 147, 0.12);
}
input[type="range"] { padding: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }

.segmented, .pills { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented button, .pill {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 9px 11px;
  border-radius: 999px;
  color: var(--ink-2);
}
.segmented button.active, .pill.active { border-color: var(--teal); background: #e8f3f6; color: var(--teal-2); }

.banner {
  background: #eaf4f1;
  color: #174c39;
  border-left: 4px solid var(--leaf);
  padding: 14px 16px;
  border-radius: var(--radius);
}
.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 44px 0 28px;
  max-width: 760px;
}
.section-head:first-child { margin-top: 0; }
.section-head h2 {
  font-family: Georgia, Cambria, serif;
  color: var(--navy);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.14;
  margin: 0;
}
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.page-head { margin-bottom: 36px; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
}
.hero-panel {
  position: relative;
  overflow: hidden;
  margin: 0 -24px 0;
  padding: 80px min(320px, 24vw) 96px 24px;
  background: var(--grad);
  color: #fff;
}
.hero-panel::after {
  content: "";
  position: absolute;
  right: -160px;
  top: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(242, 160, 7, 0.22), transparent 70%);
  pointer-events: none;
}
.hero-panel h1 {
  position: relative;
  max-width: 18ch;
  margin: 12px 0 18px;
  color: #fff;
  font-family: Georgia, Cambria, serif;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1.05;
}
.hero-panel h1 span { color: var(--gold-light); }
.hero-panel .lead {
  position: relative;
  max-width: 64ch;
  color: #cfe0ec;
  font-size: 1.15rem;
}
.hero-actions { position: relative; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-visual {
  position: absolute;
  right: 24px;
  bottom: 38px;
  width: min(430px, 36vw);
  opacity: 0.92;
}
.hero-visual svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 24px 50px rgba(0,0,0,0.22)); }
.pillars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 880px;
  margin-top: 32px;
}
.pillar {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.pillar .num { color: var(--gold-light); font-family: Georgia, Cambria, serif; font-size: 14px; font-weight: 700; }
.pillar .t { color: #fff; font-weight: 700; font-size: 14px; margin-top: 4px; }
.pillar .d { color: #b7cfe0; font-size: 12px; margin-top: 4px; line-height: 1.45; }
.site-section {
  padding: 76px 0;
  scroll-margin-top: 86px;
}
.site-section.alt {
  background: var(--soft);
  margin-left: -24px;
  margin-right: -24px;
  padding-left: 24px;
  padding-right: 24px;
}
.eval-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 28px;
  align-items: start;
}
.form-card { box-shadow: none; }
.result-card { position: sticky; top: 96px; align-self: start; }
.briefing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.briefing-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: 0 2px 8px rgba(15,42,74,0.04);
}
.briefing-col h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--navy);
  font-family: Georgia, Cambria, serif;
}
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot.rose { background: var(--rose); }
.dot.teal { background: var(--teal); }
.dot.navy { background: var(--navy); }
.dot.gold { background: var(--gold); }
.count {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.briefing-list { padding-left: 22px; margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.briefing-list li { margin-bottom: 11px; line-height: 1.5; }
.briefing-list li::marker { color: var(--gold); font-weight: 700; }
.hallmarks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.hallmark {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.hallmark:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); }
.hallmark .hm-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eaf3f8, #fcefd3);
  display: grid;
  place-items: center;
  color: var(--teal-2);
  font-weight: 800;
  font-family: Georgia, Cambria, serif;
  margin-bottom: 10px;
}
.hallmark h3 { font-size: 1rem; margin: 0 0 6px; }
.hallmark p { color: var(--muted); font-size: 13px; margin: 0; }
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.news-col {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.news-col h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--navy); }
.news-col ul { list-style: none; padding: 0; margin: 0; }
.news-col li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.news-col li:last-child { border-bottom: 0; }
.news-col li a { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); font-size: 14px; }
.news-col li a:hover { color: var(--teal-2); }
.kind { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.supps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.supp {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.supp:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gold); }
.supp .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.supp h3 { font-size: 1.05rem; margin: 0; }
.supp .tag {
  font-size: 10px;
  letter-spacing: .08em;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  font-weight: 800;
  white-space: nowrap;
}
.tag-strong { background: #e8f4ee; color: #1f6b4a; }
.tag-moderate { background: #fff3d6; color: #8c6a0f; }
.tag-emerging { background: #f0eafe; color: #5c36a6; }
.tag-rx { background: #ffe4e4; color: #8c2020; }
.supp p.use { color: var(--muted); font-size: 13px; margin: 8px 0 14px; }
.supp .links { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.supp .links a { color: var(--teal-2); border-bottom: 1px dashed var(--teal); }
.disclaimer {
  background: #fff8e5;
  border: 1px solid #f2da8c;
  border-radius: var(--radius);
  padding: 18px 22px;
  color: #6b5012;
  font-size: 13px;
  margin-top: 28px;
}
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: start; }
.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.stat-card .num { font-family: Georgia, Cambria, serif; font-weight: 700; color: var(--teal-2); font-size: 28px; line-height: 1; }
.stat-card .lab { color: var(--muted); font-size: 12px; margin-top: 4px; }
.comment-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.comment-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 16px; }
.comment-note { color: var(--muted); font-size: 13px; }
footer {
  background: #0b1a2a;
  color: #b7cfe0;
  padding: 40px 24px;
  margin: 0 -24px -80px;
}
footer h3 { color: #fff; font-size: 1rem; }
footer p, footer li { font-size: 13px; color: #b7cfe0; }
footer button {
  border: 0;
  background: transparent;
  color: var(--gold-light);
  padding: 4px 0;
}
.foot-grid { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 30px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-bottom { max-width: 1180px; margin: 28px auto 0; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 18px; font-size: 12px; color: #6f8aa0; }
.dark-result {
  background: var(--grad);
  color: var(--white);
  border: 0;
}
.age-number { font-family: Georgia, Cambria, serif; font-size: clamp(56px, 9vw, 88px); color: var(--gold-light); font-weight: 700; line-height: 1; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.badge.Strong { background: rgba(46, 125, 91, 0.14); color: #1d6043; }
.badge.Moderate { background: rgba(242, 160, 7, 0.16); color: #7a5100; }
.badge.Emerging { background: rgba(28, 114, 147, 0.14); color: #065a82; }
.badge.Prescription { background: rgba(179, 58, 58, 0.14); color: #8f2929; }
.delta-good { background: rgba(46, 125, 91, 0.25); color: #b7e0c5; }
.delta-bad { background: rgba(179, 58, 58, 0.25); color: #f0b9b9; }
.delta-neutral { background: rgba(255, 255, 255, 0.14); color: #e2ebf2; }
.meter { height: 12px; background: rgba(255, 255, 255, 0.18); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #f2a007, #f4d17a); }
.factor-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.16); }
.factor-row:last-child { border-bottom: 0; }
.positive { color: #f0b9b9; }
.negative { color: #b7e0c5; }

.chat { display: grid; align-content: start; gap: 12px; height: min(58vh, 560px); min-height: 320px; overflow: auto; padding-right: 4px; scroll-behavior: smooth; }
.bubble { max-width: min(720px, 88%); padding: 13px 15px; border-radius: 8px; line-height: 1.5; white-space: pre-wrap; }
.bubble.assistant { background: var(--white); border: 1px solid var(--line); }
.bubble.user { background: var(--navy); color: var(--white); justify-self: end; }
.bubble.pending { display: inline-flex; align-items: center; gap: 5px; width: fit-content; min-width: 58px; }
.bubble.pending span { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: typingDot 1s infinite ease-in-out; }
.bubble.pending span:nth-child(2) { animation-delay: 0.14s; }
.bubble.pending span:nth-child(3) { animation-delay: 0.28s; }
.chat-input { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 14px; }
.chat-input textarea {
  min-height: 46px;
  max-height: 150px;
  line-height: 1.45;
  resize: vertical;
}
.chat-input .btn { align-self: end; min-height: 46px; }

@keyframes typingDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.42; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.mobile-nav { display: none; }
.error { color: var(--rose); font-weight: 700; min-height: 20px; }
.error-bubble { background: #fff0f0; border: 1px solid rgba(179, 58, 58, 0.32); color: #8f2929; border-radius: 8px; padding: 11px 13px; font-weight: 700; margin: 12px 0; }
.success { color: var(--leaf); font-weight: 700; }
.disclaimer { font-size: 12px; color: rgba(255, 255, 255, 0.78); line-height: 1.5; }

@media (max-width: 900px) {
  .nav-inner { align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; overflow-x: auto; width: 100%; flex-wrap: nowrap; }
  .nav button { white-space: nowrap; }
  .cta-btn { position: absolute; right: 18px; top: 18px; }
  .topbar { position: static; padding: 18px 20px; height: auto; align-items: flex-start; gap: 12px; }
  .page { padding: 30px 18px 56px; }
  .home-page { padding-top: 0; }
  .hero-panel { margin: 0 -18px; padding: 58px 18px 64px; }
  .hero-visual { position: relative; right: auto; bottom: auto; width: 100%; margin-top: 30px; }
  .pillars { grid-template-columns: 1fr; }
  .grid.two, .grid.three, .form-grid, .eval-wrap, .briefing-grid, .comment-row, .about-grid, .foot-grid { grid-template-columns: 1fr; }
  .result-card { position: static; }
  .site-section.alt { margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px; }
  footer { margin-left: -18px; margin-right: -18px; margin-bottom: -56px; }
  .page-title { font-size: 26px; }
}
