/* Prime — Luxury / Agentic-Antigravity design system
   Obsidian-black depth, champagne-gold, levitating glass. Calm, weightless, quiet-luxury.
   Rebuilt 2026-09-06 against the REAL DOM emitted by app.js + health-app.js.
   Every selector below maps to a class the JS actually emits. */
:root {
  --bg: #070608;
  --bg-2: #0c0a0e;
  --surface: rgba(20, 18, 22, 0.72);
  --surface-solid: #141216;
  --surface2: rgba(30, 27, 32, 0.6);
  --surface3: #211d24;
  --border: rgba(216, 188, 140, 0.14);
  --border-strong: rgba(216, 188, 140, 0.34);
  --ink: #f3ede2;
  --ink-soft: #d8d0c0;
  --muted: #8f8878;
  --gold: #d8bc8c;
  --gold-2: #b8945c;
  --gold-deep: #8a6d3f;
  --accent: var(--gold);
  --accent-hover: #e6cfa4;
  --good: #9ecf8f;
  --build: var(--gold);
  --check: #d98e7c;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 9999px;
  --serif: "Iowan Old Style", "Baskerville", "Didot", "Times New Roman", Georgia, serif;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  --ease-lux: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.5s var(--ease-lux);
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(216, 188, 140, 0.06) inset;
  --shadow-float: 0 30px 90px rgba(0, 0, 0, 0.65), 0 2px 0 rgba(216, 188, 140, 0.08) inset;
  --gold-grad: linear-gradient(135deg, #f0dcae 0%, #d8bc8c 38%, #a8853f 72%, #e6cfa4 100%);
}
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(1100px 600px at 85% -12%, rgba(216, 188, 140, 0.075), transparent 60%),
    radial-gradient(900px 700px at -15% 28%, rgba(138, 109, 63, 0.05), transparent 55%),
    radial-gradient(700px 500px at 50% 115%, rgba(216, 188, 140, 0.04), transparent 60%);
  background-attachment: fixed;
}
/* ambient aurora — antigravity glow */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 42% at 50% -8%, rgba(216, 188, 140, 0.10), transparent 70%);
  filter: blur(20px);
  animation: aurora 16s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { opacity: 0.7; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(10px); }
}

/* ---------- Top bar — frosted obsidian, gold hairline ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 54px;
  background: rgba(7, 6, 8, 0.6);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
  backdrop-filter: saturate(160%) blur(24px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand {
  font-family: var(--serif); font-weight: 600; font-size: 15px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink);
}
.topbar .brand span {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-left: 2px;
}
#nav { display: flex; gap: 6px; }
#nav button {
  background: none; border: none; color: var(--muted); font: inherit; font-size: 13px;
  cursor: pointer; padding: 6px 12px; border-radius: var(--radius-pill);
  letter-spacing: 0.02em; transition: color 0.25s, background 0.25s;
  -webkit-tap-highlight-color: transparent;
}
#nav button:hover { color: var(--gold); background: rgba(216, 188, 140, 0.07); }
#nav button:active { transform: scale(0.96); }

main { flex: 1; width: 100%; max-width: 660px; margin: 0 auto; position: relative; z-index: 1; overflow: hidden; }
footer.disclaimer {
  font-size: 11px; color: var(--muted); text-align: center;
  padding: 18px 20px; border-top: 1px solid var(--border); position: relative; z-index: 1;
  letter-spacing: 0.02em;
}

/* ---------- Screen container ---------- */
#screen {
  position: relative; width: 100%;
  min-height: calc(100vh - 118px);
  padding: 26px 20px 48px;
  overflow: hidden;
}
#screen.slide-in { animation: slideIn 0.6s var(--ease-lux) forwards; }
#screen.slide-out { animation: slideOut 0.6s var(--ease-lux) forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateY(26px) scale(0.995); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes slideOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes levitate {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ---------- Progress — liquid gold bar that grows proportionally ---------- */
.progress {
  position: fixed; top: 54px; left: 0; right: 0; height: 6px; z-index: 99;
  background: rgba(216, 188, 140, 0.10);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}
.progress i {
  display: block; height: 100%;
  background: var(--gold-grad);
  box-shadow: 0 0 14px rgba(216, 188, 140, 0.65), 0 0 4px rgba(255, 240, 200, 0.4);
  border-radius: 0 6px 6px 0;
  transition: width 0.7s var(--ease-lux);
}
/* Section intro card sits in the EXACT topbar↔footer gap, centred vertically */
#screen:has(> .card.intro) {
  min-height: calc(100dvh - 107px);
  padding: 0;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
}
/* ---------- Section intro — pure centred statement, card hugs the wording ---------- */
.card.intro {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}
.card.intro .lede {
  font-family: var(--serif);
  font-size: 24px; font-weight: 500; line-height: 1.42;
  letter-spacing: -0.005em; color: var(--ink);
}

/* ---------- Card — levitating glass ---------- */
.card {
  position: relative;
  background: linear-gradient(160deg, rgba(30, 27, 32, 0.85), rgba(16, 14, 18, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 34px 30px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  animation: fadeIn 0.55s var(--ease-lux);
  transition: transform 0.5s var(--ease-lux), border-color 0.5s, box-shadow 0.5s;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 60% at 50% 0%, rgba(216, 188, 140, 0.07), transparent 55%);
  opacity: 0.7;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-float);
  transform: translateY(-2px);
}
.card .section-title {
  position: relative;
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px; font-weight: 600;
}
.card .q {
  position: relative;
  font-family: var(--serif);
  font-size: 26px; font-weight: 500; line-height: 1.28;
  letter-spacing: -0.005em; margin-bottom: 26px; color: var(--ink);
}
.card .q .ex { font-family: var(--font); font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 10px; display: block; line-height: 1.5; }
.card .note { font-size: 13px; color: var(--muted); margin-top: 12px; line-height: 1.6; position: relative; }
.card.loading, .card.muted { color: var(--muted); font-size: 14px; position: relative; }

/* ---------- Options — luminous touch rows ---------- */
.opt {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 17px 20px;
  background: rgba(30, 27, 32, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer; font-size: 16px; color: var(--ink);
  transition: all 0.28s var(--ease-lux);
  margin-bottom: 11px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
.opt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(90% 120% at 0% 100%, rgba(216, 188, 140, 0.05), transparent 60%);
}
.opt:hover { border-color: var(--border-strong); transform: translateX(4px); }
.opt:active { transform: scale(0.985); }
.opt.sel {
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(216, 188, 140, 0.14), rgba(216, 188, 140, 0.04));
  box-shadow: 0 0 0 1px rgba(216, 188, 140, 0.2), 0 10px 30px rgba(138, 109, 63, 0.12);
}
.opt input[type=radio], .opt input[type=checkbox] {
  accent-color: var(--gold); width: 20px; height: 20px; flex: none;
}

/* ---------- Scale (0–10) — gold discs, ALL on one line ---------- */
/* 11 discs never wrap onto a lone trailing disc: the row scrolls instead.
   fit-content + max-width keeps it centred when it fits, scrollable when it
   doesn't (and avoids the centred-overflow left-clip bug). */
.scale { display: flex; gap: 8px; width: fit-content; max-width: 100%;
  margin: 10px auto 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding: 2px 2px 6px; }
.scale::-webkit-scrollbar { display: none; }
.scale button {
  flex: 0 0 auto;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(30, 27, 32, 0.6); border: 1px solid var(--border);
  color: var(--ink-soft); cursor: pointer; font: inherit; font-size: 15px;
  transition: all 0.2s var(--ease-lux);
  -webkit-tap-highlight-color: transparent;
}
.scale button:hover { border-color: var(--gold); transform: translateY(-2px); }
.scale button.sel {
  background: var(--gold-grad); border-color: transparent; color: #171310; font-weight: 700;
  box-shadow: 0 6px 20px rgba(216, 188, 140, 0.35);
}

/* ---------- Inputs ---------- */
.card input[type=number],
.card input[type=text],
.card input[type=email],
.card input[type=password],
.card input[type=date],
.card textarea,
.card select {
  width: 100%; background: rgba(12, 10, 14, 0.7);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--ink); font: inherit; font-size: 16px;
  padding: 15px 17px; margin-top: 10px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  -webkit-appearance: none; appearance: none;
}
.card input:focus, .card textarea:focus, .card select:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216, 188, 140, 0.16);
}
.numwrap { display: flex; flex-direction: column; gap: 10px; }
.unit-toggle {
  display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill);
  overflow: hidden; margin-top: 12px; align-self: flex-start;
}
.unit-toggle button {
  background: transparent; border: none; color: var(--muted);
  font: inherit; font-size: 13px; padding: 9px 18px; cursor: pointer; transition: all 0.2s;
}
.unit-toggle button.sel { background: var(--gold-grad); color: #171310; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 15px 22px;
  border: none; border-radius: var(--radius-pill);
  font: inherit; font-size: 15.5px; font-weight: 600; cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.3s var(--ease-lux); color: #fff; margin-top: 12px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn.primary, .btn-primary {
  background: var(--gold-grad); color: #191410;
  box-shadow: 0 10px 30px rgba(216, 188, 140, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.primary:hover, .btn-primary:hover { box-shadow: 0 14px 40px rgba(216, 188, 140, 0.35); }
.btn.ghost, .btn-ghost {
  background: rgba(30, 27, 32, 0.4); border: 1px solid var(--border); color: var(--ink-soft);
}
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); background: rgba(216, 188, 140, 0.06); }
.btn.danger, .btn-danger { background: linear-gradient(135deg, #a8543f, #8a3f2e); color: #fff; }
.row2 { display: flex; gap: 10px; }
.row2 .btn { margin-top: 0; }
.backlink {
  background: none; border: none; color: var(--gold); cursor: pointer;
  font: inherit; font-size: 14px; padding: 6px 0; margin-bottom: 14px;
  letter-spacing: 0.02em; transition: opacity 0.2s;
}
.backlink:hover { opacity: 0.8; text-decoration: underline; }

/* ---------- Landing / hero ---------- */
#screen h1 {
  font-family: var(--serif); font-weight: 500; line-height: 1.12;
  letter-spacing: 0.005em; color: var(--ink);
}
.hero { text-align: center; padding: 46px 0 24px; animation: fadeIn 0.7s var(--ease-lux); }
.hero h1 {
  font-family: var(--serif); font-size: 42px; font-weight: 500;
  letter-spacing: 0.01em; line-height: 1.08; margin-bottom: 14px;
}
.hero .lede { font-size: 16px; color: var(--muted); max-width: 520px; margin: 0 auto 28px; line-height: 1.6; }
.loop-card {
  background: linear-gradient(160deg, rgba(30, 27, 32, 0.8), rgba(14, 12, 16, 0.9));
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 26px 26px; margin: 0 0 22px; text-align: left;
  box-shadow: var(--shadow-card); position: relative;
  animation: fadeIn 0.6s var(--ease-lux), levitate 9s ease-in-out infinite;
}
.loop-card .q { font-family: var(--serif); font-size: 17px; font-weight: 400; font-style: italic; margin-bottom: 8px; color: var(--ink-soft); }
.loop-card .note { font-size: 13px; color: var(--muted); }

/* ---------- Section eyebrow ---------- */
.section-title { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); margin: 30px 0 10px; font-weight: 600; }

/* ---------- Results — Protect / Build / Check ---------- */
.pbc { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 18px 0; }
.pbc .col {
  border-radius: var(--radius-lg); padding: 20px;
  border: 1px solid var(--border); background: rgba(20, 18, 22, 0.6);
  transition: transform 0.3s var(--ease-lux), border-color 0.3s;
}
.pbc .col:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.pbc .protect { background: rgba(158, 207, 143, 0.05); border-color: rgba(158, 207, 143, 0.18); }
.pbc .build { background: rgba(216, 188, 140, 0.06); border-color: rgba(216, 188, 140, 0.2); }
.pbc .check { background: rgba(217, 142, 124, 0.05); border-color: rgba(217, 142, 124, 0.18); }
.pbc .pending { background: rgba(216, 188, 140, 0.05); border-color: rgba(216, 188, 140, 0.18); }
.pbc .unknown { background: rgba(143, 136, 120, 0.05); border-color: rgba(143, 136, 120, 0.18); }
.pbc h3 { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 10px; font-weight: 600; }
.pbc .protect h3 { color: var(--good); }
.pbc .build h3 { color: var(--build); }
.pbc .check h3 { color: var(--check); }
.pbc .pending h3 { color: var(--gold); }
.pbc .unknown h3 { color: var(--muted); }
.pbc ul { list-style: none; font-size: 13.5px; color: var(--ink-soft); }
.pbc li { margin-bottom: 7px; padding-left: 16px; position: relative; }
.pbc li:before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

.priorities {
  background: linear-gradient(160deg, rgba(30, 27, 32, 0.85), rgba(16, 14, 18, 0.92));
  border: 1px solid rgba(216, 188, 140, 0.28);
  border-radius: var(--radius-xl); padding: 26px;
  margin: 10px 0 18px; box-shadow: var(--shadow-card);
  animation: fadeIn 0.55s var(--ease-lux);
}
.priorities h3 { color: var(--gold); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; margin-bottom: 14px; }
.priorities ol { margin-left: 20px; font-size: 15.5px; color: var(--ink); line-height: 1.6; }
.priorities li { margin-bottom: 9px; }
.priorities li::marker { color: var(--gold); }

/* ---------- KPI chips ---------- */
.kpi { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  background: rgba(30, 27, 32, 0.55); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 7px 16px; font-size: 13px; color: var(--ink-soft);
}
.chip b { color: var(--gold); font-weight: 600; }
.chip.change { background: rgba(158, 207, 143, 0.08); border-color: rgba(158, 207, 143, 0.35); }
.chip.change b { color: var(--good); }

/* ---------- Start here ---------- */
.starthere {
  background: linear-gradient(160deg, rgba(30, 27, 32, 0.85), rgba(16, 14, 18, 0.92));
  border: 1px solid rgba(216, 188, 140, 0.28); border-radius: var(--radius-xl);
  padding: 26px; margin: 10px 0 18px; box-shadow: var(--shadow-card);
}
.starthere h3 { color: var(--gold); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; margin-bottom: 10px; }
.rec-title { font-family: var(--serif); font-size: 20px; font-weight: 500; margin: 10px 0 6px; color: var(--ink); }
.rec-exp { font-size: 14px; color: var(--muted); margin-bottom: 12px; line-height: 1.55; }
.rec-link { display: inline-block; color: var(--gold); font-size: 14px; text-decoration: none; margin-top: 4px; }
.rec-link:hover { text-decoration: underline; }

/* ---------- Prevention radar ---------- */
.pri { margin-bottom: 14px; border-left: 2px solid rgba(216, 188, 140, 0.3); padding-left: 16px; }
.pri-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.pri-state {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
  background: rgba(30, 27, 32, 0.6); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 3px 12px; white-space: nowrap;
}
.pri-note { font-size: 14.5px; color: var(--ink-soft); }
.pri-act { font-size: 13px; color: var(--gold); margin-top: 5px; }

/* ---------- Track comparison ---------- */
.cmp-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 16px 0; }
.cmp-row {
  background: rgba(30, 27, 32, 0.55); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  transition: border-color 0.25s;
}
.cmp-row:hover { border-color: var(--border-strong); }
.cmp-label { font-size: 13px; font-weight: 600; flex: 1 1 100%; color: var(--ink); }
.cmp-base, .cmp-cur { font-size: 14px; color: var(--muted); }
.cmp-arrow { color: var(--gold); font-size: 14px; }
.cmp-status { font-size: 11px; border-radius: var(--radius-pill); padding: 3px 12px; letter-spacing: 0.06em; }

/* ---------- Tests ---------- */
.test-hero {
  background: linear-gradient(160deg, rgba(30, 27, 32, 0.85), rgba(16, 14, 18, 0.92));
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow-card);
}
.test-hero h3 { font-family: var(--serif); font-size: 21px; font-weight: 500; margin-bottom: 6px; }
.test-meta { font-size: 13px; color: var(--muted); margin: 12px 0; line-height: 1.6; }
.safety {
  border-left: 2px solid var(--check); padding: 12px 16px;
  background: rgba(217, 142, 124, 0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 13px; margin: 12px 0; color: #e3a898; line-height: 1.55;
}

/* ---------- Clinician workspace ---------- */
.patient {
  background: rgba(30, 27, 32, 0.55); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 12px;
}
.badge {
  display: inline-block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  border-radius: var(--radius-pill); padding: 3px 12px;
  border: 1px solid var(--border); color: var(--muted);
}
.banner {
  background: rgba(30, 27, 32, 0.5); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 18px; font-size: 13px;
  color: var(--muted); margin-bottom: 16px; line-height: 1.55;
}
.count { color: var(--gold); font-weight: 600; }

/* ---------- Share/export + sparkline ---------- */
.share-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.share-bar button {
  flex: 1; min-width: 100px; padding: 11px 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: rgba(30, 27, 32, 0.5);
  color: var(--ink-soft); font: inherit; font-size: 13px; cursor: pointer;
  transition: all 0.25s;
}
.share-bar button:hover { border-color: var(--gold); background: rgba(216, 188, 140, 0.07); color: var(--gold); }
.chart-area {
  margin: 14px 0; padding: 14px;
  background: rgba(12, 10, 14, 0.6); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.chart-area svg { width: 100%; height: 60px; }
.sparkline { stroke: var(--gold); stroke-width: 2; fill: none; }
.sparkline-fill { fill: url(#spark-gradient); opacity: 0.15; }

/* ---------- Feature pills (Prime Health) ---------- */
.feature-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.feature-pill {
  padding: 10px 18px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: rgba(30, 27, 32, 0.5);
  color: var(--ink-soft); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: all 0.25s var(--ease-lux);
  -webkit-tap-highlight-color: transparent;
}
.feature-pill:hover { border-color: var(--gold); transform: translateY(-1px); color: var(--gold); }
.feature-pill .ico { font-size: 14px; }
.feature-pills { animation: fadeIn 0.4s var(--ease-lux); }

/* ---------- Health rows ---------- */
.dg-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 2px; border-bottom: 1px solid rgba(216, 188, 140, 0.08);
  font-size: 15px; color: var(--ink-soft);
}
.dg-row:last-child { border-bottom: none; }
.dg-row .g { color: var(--gold); font-weight: 600; }
.qs { display: flex; gap: 8px; flex-wrap: wrap; }
.q {
  flex: 1; min-width: 52px; text-align: center;
  background: rgba(30, 27, 32, 0.55); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 13px 6px; cursor: pointer;
  font-size: 15px; color: var(--ink); transition: all 0.2s var(--ease-lux);
  -webkit-tap-highlight-color: transparent;
}
.q:hover { border-color: var(--gold); transform: translateY(-1px); }
.q.on {
  background: var(--gold-grad); border-color: transparent; color: #191410;
  font-weight: 700; box-shadow: 0 8px 24px rgba(216, 188, 140, 0.25);
}
.row2 { display: flex; gap: 10px; }
.row2 input { flex: 1; }
.row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 2px; border-bottom: 1px solid rgba(216, 188, 140, 0.08);
  font-size: 15px; color: var(--ink-soft);
}
.row:last-child { border-bottom: none; }
.row .x { color: var(--check); cursor: pointer; padding: 0 8px; }
.slide-in { animation: slideIn 0.5s var(--ease-lux); }

/* ---------- Health-landing device card ---------- */
#hDevice .btn { width: auto; padding: 12px 26px; }
#pllHealthCard { animation: fadeIn 0.6s var(--ease-lux) 0.15s both, levitate 10s ease-in-out 0.5s infinite; }

/* ---------- Errors ---------- */
.err { color: var(--check); font-size: 13px; margin-top: 10px; }

/* ---------- Landing layout — phone screen split top/bottom ----------
   Health card = top half, Assessment card = bottom half, each centred.
   Cards hug their button at ~2x size (100% bigger than the gold pill). */
.landing {
  display: flex; flex-direction: column;
  justify-content: space-evenly;
  min-height: calc(100dvh - 250px);
  padding: 8px 0 12px;
}
/* Landing fills the EXACT space between top bar (54px) and footer (~53px),
   so space-evenly divides the blank into equal thirds: top = middle = bottom. */
#screen:has(> .landing) {
  min-height: calc(100dvh - 107px);
  padding: 0;
  display: flex; flex-direction: column;
}
#screen:has(> .landing) .landing {
  flex: 1; min-height: 0;
}
.landing > .card {
  flex: 0 0 auto; align-self: center;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center;
  padding: 26px 32px;
  border-radius: var(--radius-lg);
}
.landing .card .q { margin-bottom: 18px; }
.landing .card .note { margin-bottom: 20px; max-width: 300px; }
.landing .card .btn {
  margin-top: 0;
  width: min(330px, 90vw);       /* both CTAs identical width — symmetry */
  max-width: none;
  padding: 15px 20px;
  white-space: nowrap;           /* one line, never wraps */
  text-align: center;
  font-size: 15.5px;
}

/* ---------- Top bar brand — logo mark + wordmark ---------- */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { height: 27px; width: auto; flex: none; object-fit: contain; }
.brand-word {
  font-family: var(--serif); font-weight: 600; font-size: 13.5px;
  letter-spacing: 0.2em; color: var(--ink); white-space: nowrap;
}

/* ---------- Top-bar nav link (sign in when signed out) ----------
   Same button as the Enter CTA: gold gradient pill, dark text, soft glow.
   Auto-sized to fit the text. No hover — it's already a button. */
#nav .navlink {
  font-family: var(--font); font-weight: 600; font-size: 14px;
  letter-spacing: 0.02em; text-transform: none;
  background: var(--gold-grad); color: #191410;
  border: none; border-radius: var(--radius-pill);
  box-shadow: 0 10px 30px rgba(216, 188, 140, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  padding: 6px 22px; white-space: nowrap;
  margin: 8px 0;                 /* blank black space above + below the pill */
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
#nav .navlink:active { transform: scale(0.97); }
/* Signed-in username chip — quiet ghost pill, not another gold CTA */
#nav .navlink.userchip {
  background: rgba(30, 27, 32, 0.4); border: 1px solid var(--border);
  color: var(--ink-soft); box-shadow: none; font-size: 13px; padding: 7px 16px;
}
#nav .navlink.userchip:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Auth swap link ---------- */
.authswap {
  background: none; border: none; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer; padding: 12px 0 4px;
  width: 100%; text-align: center; letter-spacing: 0.02em;
  transition: color 0.2s;
}
.authswap:hover { color: var(--gold); text-decoration: underline; }

/* ---------- Auth — heading pair centred, equal air above & below ---------- */
#screen:has(> .authhead) {
  min-height: calc(100dvh - 107px);
  padding: 0 20px;
  display: flex; flex-direction: column;
}
.authhead { margin: auto 0; text-align: center; }
.authhead h1 { margin: 0; }
.authhead .lede { margin: 12px 0 0; font-size: 15px; color: var(--muted); line-height: 1.5; }
.authhead + .card { width: min(440px, 100%); margin-left: auto; margin-right: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .card { padding: 26px 20px; border-radius: 22px; }
  .card .q { font-size: 21px; }
  .hero h1 { font-size: 34px; }
  .scale button { width: 40px; height: 40px; }
  .pbc { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
