/* NephroScan GH design system
   Palette drawn from laterite soil, cocoa, and kente: warm earth base,
   kente gold as the single action colour, green/red kept for risk meaning. */
:root {
  --earth-950: #170f0b;
  --earth-900: #201510;
  --earth-850: #2a1b14;
  --earth-800: #362319;
  --clay-600: #6b4431;
  --line: rgba(242, 231, 216, 0.12);
  --line-strong: rgba(242, 231, 216, 0.22);
  --sand-50: #f7efe3;
  --sand-200: #e6d6c1;
  --sand-400: #b9a28a;
  --gold-300: #f1c56f;
  --gold-400: #e8b04b;
  --gold-600: #b9811f;
  --green-400: #5cc088;
  --green-500: #3fa36b;
  --red-400: #ef6f5c;
  --red-500: #e0533f;
  --kente-green: #1f6b3a;
  --kente-red: #b3261e;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.06rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.3rem + 0.9vw, 2.05rem);
  --step-3: clamp(2rem, 1.6rem + 1.8vw, 3rem);
  --step-4: clamp(2.6rem, 1.7rem + 4.4vw, 5.4rem);

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 9px;
  --shadow: 0 24px 60px -24px rgba(8, 3, 1, 0.75);
  --z-stage: 0;
  --z-content: 2;
  --z-bar: 20;
  --z-skip: 30;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--earth-950);
  color: var(--sand-50);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg, video, iframe { max-width: 100%; display: block; }
a { color: var(--gold-300); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 3px; border-radius: 6px; }

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: var(--z-skip); background: var(--gold-400); color: var(--earth-950); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; }
.skip-link:focus { top: 12px; }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- 3D stage ---------- */
#kidney-stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: var(--z-stage); pointer-events: none; }
.stage-shade {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(90% 70% at 78% 30%, transparent 0%, rgba(23, 15, 11, 0.35) 60%, rgba(23, 15, 11, 0.85) 100%),
    linear-gradient(180deg, rgba(23, 15, 11, 0) 0%, rgba(23, 15, 11, 0.2) 100%);
}
.stage-fallback #kidney-stage { background: url("/static/img/kidney-fallback.svg") no-repeat 85% 30% / min(52vw, 620px); }
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Kente ---------- */
.kente-band {
  height: 18px;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(23,15,11,.9) 46px 50px, transparent 50px 96px),
    repeating-linear-gradient(90deg,
      var(--gold-400) 0 22px, var(--kente-green) 22px 30px, var(--gold-400) 30px 38px,
      var(--kente-red) 38px 58px, #120b08 58px 62px, var(--kente-red) 62px 70px,
      var(--gold-400) 70px 80px, var(--kente-green) 80px 96px);
  box-shadow: inset 0 3px 0 rgba(23,15,11,.55), inset 0 -3px 0 rgba(23,15,11,.55);
}
.kente-band.thin { height: 8px; box-shadow: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: 0.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .18s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .94rem; }
.btn-gold { background: var(--gold-400); color: #1a0f07; box-shadow: 0 10px 30px -12px rgba(232, 176, 75, .7); }
.btn-gold:hover { background: var(--gold-300); }
.btn-red { background: var(--red-500); color: #fff8f2; }
.btn-red:hover { background: var(--red-400); }
.btn-ghost { background: rgba(247, 239, 227, .04); border-color: var(--line-strong); color: var(--sand-50); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--gold-400); background: rgba(232, 176, 75, .08); }
.btn-quiet { background: transparent; color: var(--sand-200); padding: 0 12px; }
.btn-quiet:hover { color: var(--gold-300); }
.btn[disabled] { opacity: .55; cursor: progress; }
.link-btn { background: none; border: 0; padding: 6px 2px; color: var(--gold-300); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; font-size: .95rem; }
.link-btn:hover { color: var(--sand-50); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: var(--z-bar);
  display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gutter);
  background: linear-gradient(180deg, rgba(23,15,11,.88), rgba(23,15,11,.6));
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--sand-50); text-decoration: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-name b { margin-left: 4px; padding: 1px 6px 2px; border-radius: 6px; background: var(--kente-green); color: var(--gold-300); font-size: .8rem; vertical-align: 3px; font-weight: 700; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--sand-200); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: .96rem; transition: color .2s, background-color .2s; }
.nav a:hover { color: var(--sand-50); background: rgba(247,239,227,.06); }
.nav a.is-current { color: var(--earth-950); background: var(--sand-50); }

/* ---------- Layout ---------- */
main { position: relative; z-index: var(--z-content); }
.section { max-width: var(--max); margin: 0 auto; padding: clamp(64px, 9vw, 120px) var(--gutter) clamp(72px, 10vw, 136px); scroll-margin-top: 64px; }
.section-head { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.section-head h2 { font-size: var(--step-3); }
.section-head p { color: var(--sand-200); margin-top: 10px; max-width: 62ch; }
.motif { width: 52px; height: 52px; fill: none; stroke: var(--gold-400); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; margin-top: 4px; }

.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(42, 27, 20, .86), rgba(32, 21, 16, .9));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(247,239,227,.06);
  backdrop-filter: blur(10px);
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: calc(100dvh - 65px); display: grid; grid-template-rows: 1fr auto auto; }
.hero-copy { align-self: center; max-width: var(--max); width: 100%; margin: 0 auto; padding: clamp(40px, 8vh, 96px) var(--gutter) 32px; }
.hero-greet { font-family: var(--font-display); color: var(--gold-300); font-size: var(--step-1); font-weight: 500; margin-bottom: 18px; }
.hero-title { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.035em; line-height: .98; max-width: 11ch; }
.hero-lede { margin-top: 24px; max-width: 52ch; color: var(--sand-200); font-size: var(--step-1); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-facts {
  max-width: var(--max); width: 100%; margin: 0 auto; padding: 0 var(--gutter) 36px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
}
.hero-facts div { padding: 18px 24px 4px 0; border-top: 1px solid var(--line-strong); margin-right: 24px; }
.hero-facts dt { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); color: var(--gold-300); font-variant-numeric: tabular-nums; }
.hero-facts dd { margin: 4px 0 0; color: var(--sand-400); font-size: var(--step--1); max-width: 34ch; }

/* page-load orchestration, hero only */
@media (prefers-reduced-motion: no-preference) {
  .hero-greet, .hero-title, .hero-lede, .hero-actions, .hero-facts { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
  .hero-title { animation-delay: .08s; }
  .hero-lede { animation-delay: .18s; }
  .hero-actions { animation-delay: .28s; }
  .hero-facts { animation-delay: .45s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Check ---------- */
.check-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 24px; align-items: start; }
.form { padding: clamp(20px, 3vw, 36px); }
.stepper { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0; margin: 0 0 28px; }
.stepper li { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--sand-400); padding-top: 12px; border-top: 3px solid var(--earth-800); transition: color .25s, border-color .25s; }
.stepper li span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); font-family: var(--font-display); font-weight: 600; font-size: .82rem; flex: none; }
.stepper li.is-active { color: var(--sand-50); border-top-color: var(--gold-400); }
.stepper li.is-active span { background: var(--gold-400); color: var(--earth-950); border-color: var(--gold-400); }
.stepper li.is-done { color: var(--sand-200); border-top-color: var(--gold-600); }
.stepper li.is-done span { background: var(--gold-600); border-color: var(--gold-600); color: var(--earth-950); }

.step { border: 0; margin: 0; padding: 0; display: none; min-width: 0; }
.step.is-active { display: grid; gap: 22px; animation: stepIn .35s ease both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step.is-active { animation: none; } }

.field label, .field .label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--sand-50); }
.hint { margin-top: 6px; font-size: var(--step--1); color: var(--sand-400); }
.hint b { color: var(--gold-300); }
.input-unit { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: rgba(23,15,11,.6); transition: border-color .2s, box-shadow .2s; }
.input-unit:focus-within { border-color: var(--gold-400); box-shadow: 0 0 0 4px rgba(232,176,75,.15); }
.input-unit input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; padding: 14px 16px; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.input-unit input::placeholder { color: rgba(185,162,138,.6); }
.input-unit span { display: grid; place-items: center; padding: 0 16px; color: var(--sand-400); border-left: 1px solid var(--line); font-size: .92rem; }
.field.has-error .input-unit, .field.has-error .segmented { border-color: var(--red-400); }
.field-error { color: var(--red-400); font-size: var(--step--1); margin-top: 6px; }

.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: rgba(23,15,11,.6); }
.segmented.seg-6 { grid-template-columns: repeat(6, 1fr); }
.segmented label { margin: 0; position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: grid; place-items: center; min-height: 44px; border-radius: 10px; color: var(--sand-200); font-weight: 500; transition: background-color .2s, color .2s; }
.segmented label:hover span { background: rgba(247,239,227,.06); }
.segmented input:checked + span { background: var(--sand-50); color: var(--earth-950); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--gold-300); outline-offset: 2px; }

.form-error { margin-top: 18px; color: var(--red-400); font-size: .95rem; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-actions #btn-sample { margin-right: auto; }
.form-actions #btn-back + #btn-sample { margin-left: 0; }

/* Result */
.result { padding: clamp(20px, 3vw, 32px); position: sticky; top: 88px; min-height: 420px; }
.result-empty { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 8px 8px 16px; }
.result-empty img { width: min(300px, 80%); height: auto; margin-bottom: 8px; }
.result-empty h3 { font-size: var(--step-1); }
.result-empty p { color: var(--sand-400); max-width: 36ch; }

.skel { border-radius: var(--r-md); background: linear-gradient(90deg, var(--earth-800) 0%, var(--earth-850) 40%, var(--earth-800) 80%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel-gauge { width: 220px; height: 120px; margin: 10px auto 24px; border-radius: 120px 120px 12px 12px; }
.skel-line { height: 18px; margin: 12px 0; }
.skel-line.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.gauge-wrap { position: relative; width: min(280px, 100%); margin: 0 auto; }
.gauge { width: 100%; height: auto; overflow: visible; }
.gauge path { fill: none; stroke-width: 16; stroke-linecap: round; }
.gauge-track { stroke: var(--earth-800); }
.gauge-fill { stroke: url(#gauge-grad); stroke-dasharray: 0 100; transition: stroke-dasharray 1.2s cubic-bezier(.2,.8,.2,1); }
.gauge-readout { position: absolute; inset: auto 0 0; text-align: center; }
.gauge-value { display: block; font-family: var(--font-display); font-weight: 800; font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.gauge-label { color: var(--sand-400); font-size: .9rem; }
.tier { display: flex; justify-content: center; margin-top: 18px; }
.tier span { padding: 5px 14px; border-radius: 8px; font-weight: 600; font-size: .92rem; }
.tier-low span { background: rgba(63,163,107,.16); color: var(--green-400); }
.tier-moderate span { background: rgba(232,176,75,.16); color: var(--gold-300); }
.tier-high span { background: rgba(224,83,63,.18); color: var(--red-400); }
.result-headline { text-align: center; font-size: var(--step-1); margin: 12px auto 4px; max-width: 26ch; }

.model-row { margin: 18px 0 4px; display: grid; gap: 10px; }
.seg-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(23,15,11,.55); }
.seg-mini button { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--sand-200); font-size: .88rem; font-weight: 500; cursor: pointer; transition: background-color .2s, color .2s; padding: 0 6px; }
.seg-mini button:hover { background: rgba(247,239,227,.06); color: var(--sand-50); }
.seg-mini button[aria-pressed="true"] { background: var(--sand-50); color: var(--earth-950); font-weight: 600; }
.second-opinion { font-size: .88rem; color: var(--sand-400); }
.second-opinion b { color: var(--sand-50); font-variant-numeric: tabular-nums; }
.second-opinion.is-split { color: var(--gold-300); }
.range-note { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid rgba(232,176,75,.35); background: rgba(232,176,75,.08); font-size: .85rem; color: var(--sand-200); }
.ask-note { margin-top: 14px; font-size: .82rem; color: var(--sand-400); }

.mini-head { font-size: 1rem; margin: 26px 0 12px; color: var(--sand-200); font-weight: 600; }
.factors { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.factor { display: grid; grid-template-columns: 9.5rem 1fr; gap: 12px; align-items: center; font-size: .93rem; }
.factor-bar { position: relative; height: 10px; background: var(--earth-800); border-radius: 6px; }
.factor-bar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.factor-bar i { position: absolute; top: 0; bottom: 0; border-radius: 6px; transition: width .9s cubic-bezier(.2,.8,.2,1); width: 0; }
.factor-bar i.up { left: 50%; background: var(--red-500); }
.factor-bar i.down { right: 50%; background: var(--green-500); }
.factor small { display: block; color: var(--sand-400); font-size: .8rem; }
.factor-legend { display: flex; justify-content: space-between; font-size: .78rem; color: var(--sand-400); margin: 6px 0 0 calc(9.5rem + 12px); }

.flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.flag { font-size: .85rem; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line-strong); color: var(--sand-200); }
.flag b { color: var(--gold-300); font-weight: 600; }

.guidance { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.guidance li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--sand-200); }
.guidance .ico { width: 20px; height: 20px; color: var(--gold-400); margin-top: 3px; }
.refer { margin-top: 22px; padding: 18px; border-radius: var(--r-md); background: rgba(224,83,63,.1); border: 1px solid rgba(224,83,63,.35); display: grid; gap: 14px; }
.refer p { color: var(--sand-50); }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.fineprint { margin-top: 22px; font-size: .8rem; color: var(--sand-400); line-height: 1.5; }

/* ---------- How ---------- */
.how-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.video-frame { margin: 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow); background: #0e0906; aspect-ratio: 16 / 9; }
.video-frame video { width: 100%; height: 100%; object-fit: cover; }
.how-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 4px; }
.how-steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.how-steps li::before { content: counter(s); grid-row: span 2; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--kente-green); color: var(--gold-300); font-family: var(--font-display); font-weight: 700; }
.how-steps h3 { font-size: 1.12rem; margin-top: 6px; }
.how-steps p { color: var(--sand-400); margin-top: 6px; font-size: .96rem; }

/* ---------- Care ---------- */
.search { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search-box { flex: 1 1 420px; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 18px; border-radius: 999px; background: rgba(32,21,16,.92); border: 1px solid var(--line-strong); transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: var(--gold-400); box-shadow: 0 0 0 4px rgba(232,176,75,.15); }
.search-box .ico { color: var(--gold-400); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 10px 0; font-size: 1.05rem; }
.quick-towns { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.quick-towns button, .chips button { border: 1px solid var(--line-strong); background: rgba(32,21,16,.7); color: var(--sand-200); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: .9rem; transition: border-color .2s, background-color .2s, color .2s; }
.quick-towns button:hover, .chips button:hover { border-color: var(--gold-400); color: var(--sand-50); }
.chips button[aria-selected="true"] { background: var(--sand-50); color: var(--earth-950); border-color: var(--sand-50); font-weight: 600; }
.status-line { min-height: 1.6em; color: var(--sand-400); font-size: .95rem; margin: 8px 0 18px; }
.status-line.is-error { color: var(--red-400); }

.care-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.care-map { padding: 18px; position: sticky; top: 88px; min-height: 420px; }
.gh-map { width: 100%; max-height: min(640px, calc(100vh - 150px)); }
.gh-land { fill: rgba(31,107,58,.22); stroke: var(--gold-400); stroke-width: 2; stroke-linejoin: round; }
.pin-centre circle { fill: var(--gold-400); stroke: var(--earth-950); stroke-width: 3; cursor: pointer; transition: r .2s; }
.pin-centre.is-near circle { fill: var(--red-500); }
.pin-centre text { fill: var(--sand-200); font-size: 15px; font-family: var(--font-body); paint-order: stroke; stroke: var(--earth-950); stroke-width: 4px; }
.pin-origin circle.core { fill: var(--sand-50); }
.pin-origin circle.pulse { fill: none; stroke: var(--sand-50); stroke-width: 2; transform-origin: center; transform-box: fill-box; animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
.pin-line { stroke: var(--sand-50); stroke-width: 1.5; stroke-dasharray: 5 6; opacity: .6; }
.gmap-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.gmap iframe { width: 100%; height: 520px; border: 0; border-radius: var(--r-md); background: var(--earth-800); }

.care-lists { display: grid; gap: 28px; }
.list-block h3 { font-size: var(--step-1); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: .75rem; font-weight: 600; color: var(--green-400); background: rgba(63,163,107,.14); padding: 3px 9px; border-radius: 6px; letter-spacing: 0; }
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
@media (prefers-reduced-motion: no-preference) { .live-badge::before { animation: blink 1.8s ease-in-out infinite; } }
@keyframes blink { 50% { opacity: .3; } }
.places { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.empty-note { color: var(--sand-400); padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.place { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 16px 18px; border-radius: var(--r-md); background: rgba(32,21,16,.82); border: 1px solid var(--line); transition: border-color .2s; }
.place:hover { border-color: var(--line-strong); }
.place.is-first { border-color: rgba(232,176,75,.55); background: linear-gradient(180deg, rgba(232,176,75,.09), rgba(32,21,16,.85)); }
.place h4 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.005em; }
.place .meta { color: var(--sand-400); font-size: .88rem; }
.place .dist { font-family: var(--font-display); font-weight: 700; color: var(--gold-300); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.place .dist small { display: block; font-family: var(--font-body); color: var(--sand-400); font-weight: 400; font-size: .75rem; }
.place-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.place-actions a, .place-actions button { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--sand-50); text-decoration: none; cursor: pointer; transition: border-color .2s, background-color .2s; }
.place-actions a:hover, .place-actions button:hover { border-color: var(--gold-400); background: rgba(232,176,75,.08); }
.place-actions .ico { width: 16px; height: 16px; }
.tag-renal { font-size: .72rem; color: var(--red-400); border: 1px solid rgba(239,111,92,.4); border-radius: 5px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.emergency { margin-top: 32px; padding: 16px 20px; border-left: 4px solid var(--red-500); background: rgba(224,83,63,.08); border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--sand-200); }
.emergency a { font-weight: 700; color: var(--sand-50); }

/* ---------- Labs ---------- */
.labs-top { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 24px; margin-bottom: 36px; }
.ask { padding: 24px; }
.ask img { width: 100%; max-width: 280px; height: auto; margin: -4px auto 12px; }
.ask h3 { font-size: var(--step-1); margin-bottom: 12px; }
.ask-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ask-list li { color: var(--sand-400); font-size: .93rem; padding-left: 16px; border-left: 2px solid var(--gold-600); }
.ask-list b { display: block; color: var(--sand-50); font-weight: 600; }
.live-map { padding: 18px; display: grid; grid-template-rows: auto 1fr; }
.live-map-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.live-map-head h3 { font-size: var(--step-1); }
.live-map iframe { width: 100%; min-height: 380px; height: 100%; border: 0; border-radius: var(--r-md); background: var(--earth-800); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 18px; scrollbar-width: thin; }
.chips button { flex: none; }
.lab-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lab { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--r-md); background: rgba(32,21,16,.86); border: 1px solid var(--line); }
.lab .brand-tag { align-self: flex-start; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 5px; }
.brand-tag.mds { background: rgba(232,176,75,.15); color: var(--gold-300); }
.brand-tag.syn { background: rgba(63,163,107,.15); color: var(--green-400); }
.brand-tag.hosp { background: rgba(224,83,63,.15); color: var(--red-400); }
.lab h4 { font-size: 1.05rem; font-weight: 600; }
.lab .meta { color: var(--sand-400); font-size: .9rem; }
.lab .place-actions { margin-top: auto; padding-top: 10px; }
.lab iframe { width: 100%; height: 220px; border: 0; border-radius: 10px; margin-top: 10px; background: var(--earth-800); }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: var(--z-content); background: var(--earth-950); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter) 120px; display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px 48px; }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; color: var(--sand-400); max-width: 44ch; }
.footer-brand strong { color: var(--sand-50); }
.motif-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.motif-key li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; font-size: .86rem; color: var(--sand-400); }
.motif-key svg { width: 30px; height: 30px; fill: none; stroke: var(--gold-400); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.motif-key b { display: block; color: var(--sand-50); }
.footer-legal { grid-column: 1 / -1; font-size: .8rem; color: var(--sand-400); border-top: 1px solid var(--line); padding-top: 20px; }

/* ---------- Mobile tab bar ---------- */
.tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .check-grid, .care-grid, .how-grid, .labs-top { grid-template-columns: minmax(0, 1fr); }
  .result, .care-map { position: relative; top: 0; }
  .gh-map { max-height: 420px; margin: 0 auto; }
}
@media (max-width: 760px) {
  .nav, .topbar-cta { display: none; }
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
  .hero { min-height: calc(100svh - 60px); }
  .hero-copy { align-self: end; padding-top: 38vh; }
  .hero-title { max-width: 12ch; }
  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts div { display: grid; grid-template-columns: 3.2rem 1fr; align-items: baseline; padding: 12px 0 6px; margin-right: 0; }
  .hero-facts dt { font-size: 1.6rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .section-head { grid-template-columns: 1fr; gap: 12px; }
  .motif { width: 40px; height: 40px; }
  .stepper li { flex-direction: column; align-items: flex-start; gap: 6px; font-size: .8rem; }
  .segmented.seg-6 { grid-template-columns: repeat(3, 1fr); }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn-gold { flex: 1 1 100%; order: 3; }
  .factor { grid-template-columns: 7rem 1fr; }
  .factor-legend { margin-left: calc(7rem + 12px); }
  .search-box { flex-basis: 100%; }
  #btn-locate { width: 100%; }
  .gmap iframe { height: 360px; }
  .footer-inner { grid-template-columns: 1fr; }
  .motif-key { grid-template-columns: 1fr; }
  .emergency { margin-bottom: 8px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: var(--z-bar);
    background: rgba(32,21,16,.92); backdrop-filter: blur(16px); border: 1px solid var(--line-strong); border-radius: 20px; padding: 6px;
    box-shadow: 0 16px 40px -10px rgba(0,0,0,.7);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; color: var(--sand-400); text-decoration: none; font-size: .72rem; font-weight: 600; border-radius: 14px; }
  .tabbar a.is-current { color: var(--earth-950); background: var(--gold-400); }
  .tabbar .ico { width: 22px; height: 22px; }
}

/* ---------- Print summary ---------- */
@media print {
  #kidney-stage, .stage-shade, .grain, .topbar, .tabbar, .hero, .how, .care, .labs, .footer, .form, .section-head p, .result-actions, .refer .btn, .seg-mini { display: none !important; }
  body { background: #fff; color: #111; }
  .section { padding: 0; }
  .check-grid { display: block; }
  .panel { background: #fff; border: 0; box-shadow: none; backdrop-filter: none; }
  .result { position: static; }
  .gauge-value, .result-headline, .mini-head, .guidance li, .factor, .fineprint, .flag, .second-opinion, .range-note { color: #111 !important; }
  .gauge-track { stroke: #ddd; }
}
