/* ══════════════════════════════════════════════════════════════════════════════
   INNATE — Moss Chiropractic of Inverness
   Design System: Light cream bg, MC blue primary, yellow nerve lines
   Fonts: Inter (body + display)
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── 1. CUSTOM PROPERTIES ────────────────────────────────────────────────────── */

:root {
  --bg:           #fafaf8;
  --bg-raised:    #ffffff;

  --mc-blue:      #1a6ab1;
  --mc-blue-dim:  rgba(26,106,177,0.08);
  --mc-blue-glow: rgba(26,106,177,0.25);
  --mc-blue-border: rgba(26,106,177,0.2);

  --mc-grey:      #4a4a4a;
  --mc-grey-dim:  rgba(74,74,74,0.08);
  --mc-grey-border: rgba(74,74,74,0.15);

  /* Semantic aliases */
  --primary:      var(--mc-blue);
  --primary-dim:  var(--mc-blue-dim);
  --primary-glow: var(--mc-blue-glow);
  --primary-border: var(--mc-blue-border);

  --green:        #5CB87A;
  --green-dim:    rgba(92,184,122,0.1);

  --red:          #c8102e;
  --red-dim:      rgba(200,16,46,0.08);
  --orange:       #e67e22;
  --amber:        #d4a44a;

  --nerve-yellow: #d4a017;
  --nerve-yellow-dim: rgba(212,160,23,0.15);
  --nerve-yellow-bright: #f5c518;

  --vagus-green:  #2ecc71;

  --text:         #1a1a2e;
  --text-2:       #555770;
  --text-3:       #8e90a6;

  --glass:        rgba(0,0,0,0.02);
  --glass-hover:  rgba(0,0,0,0.04);
  --glass-border: rgba(0,0,0,0.06);

  --grad-btn:     linear-gradient(135deg, #1a6ab1 0%, #155a96 100%);

  --font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm:   10px;
  --radius:      14px;
  --radius-lg:   18px;
  --radius-full: 9999px;
  --blur:        blur(16px);

  --footer-height: 60px;
}

/* ── 2. RESET & BASE ─────────────────────────────────────────────────────────── */

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

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* UI sprint: scroll lock — body never scrolls. Only the report
   (.results-screen) and the spine diagram screen (.neuro-screen) opt back
   in via overflow-y: auto on their own containers. */
body {
  touch-action: pan-x pan-y;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: light;
}

#app {
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

* { font-family: inherit; }

img, video, svg { display: block; max-width: 100%; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

input, select, textarea { font-family: var(--font-body); }

/* ── 3. ANIMATIONS ──────────────────────────────────────────────────────────── */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

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

@keyframes gentlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(200,16,46,0.3); }
  50%      { box-shadow: 0 0 14px rgba(200,16,46,0.5); }
}

/* Whiplash cascade ring — amber overlay (NOT a fill) on top of grey/
   red/purple base. Slow 2.6s pulse: the outer glow softens and expands,
   the inner ring holds steady. Applied by symptom-map.js when
   spineState.getLevelState reports whiplash=true. */
@keyframes whiplashPulse {
  0%, 100% { box-shadow: 0 0 0 2.5px rgba(245,158,11,0.95), 0 0 6px rgba(245,158,11,0.45); }
  50%      { box-shadow: 0 0 0 2.5px rgba(245,158,11,0.95), 0 0 12px rgba(245,158,11,0.75); }
}
.whiplash-lit { animation: whiplashPulse 2.6s ease-in-out infinite; }

@keyframes blueGlow {
  0%   { box-shadow: 0 0 0 0 rgba(26,106,177,0.4); }
  70%  { box-shadow: 0 0 0 12px rgba(26,106,177,0); }
  100% { box-shadow: 0 0 0 0 rgba(26,106,177,0); }
}

@keyframes meshDrift {
  0%   { background-position: 0% 0%, 100% 100%, 0% 100%, 100% 0%; }
  100% { background-position: 3% 3%, 97% 97%, 3% 97%, 97% 3%; }
}

.animate-up   { animation: cardFadeUp 300ms ease forwards; }
.animate-up-2 { animation: cardFadeUp 300ms ease forwards; animation-delay: 60ms; opacity: 0; }
.animate-up-3 { animation: cardFadeUp 300ms ease forwards; animation-delay: 120ms; opacity: 0; }
.animate-up-4 { animation: cardFadeUp 300ms ease forwards; animation-delay: 180ms; opacity: 0; }

/* ── 4. MESH BACKGROUND ─────────────────────────────────────────────────────── */

.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(26,106,177,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 70%, rgba(92,184,122,0.03) 0%, transparent 55%);
  animation: meshDrift 12s infinite alternate ease-in-out;
}

/* ── 5. PERSISTENT FOOTER — every screen ─────────────────────────────────────── */

.mc-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  /* Total height = visible bar (--footer-height) + iPhone home-indicator
     safe area. With box-sizing:border-box (global reset), padding-bottom
     is included in height, so the visible 60px bar sits ABOVE the home
     indicator strip and footer items align inside that 60px content box. */
  height: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px));
  padding: 0 14px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.04);
}

.mc-footer-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
  cursor: pointer;
}

.mc-footer-name {
  flex: 1;
  font: 600 12px/1.2 var(--font-body);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-footer-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--mc-blue-dim);
  border: 1px solid var(--mc-blue-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  text-decoration: none;
}

.mc-footer-btn:active { background: rgba(26,106,177,0.15); }

.mc-footer-btn svg { width: 16px; height: 16px; fill: var(--mc-blue); }

/* Content padding to not overlap footer. Fix #5: 14px horizontal fallback
   so regular scan screens that don't set inline padding get edge breathing
   room. !important on padding-bottom because several renderers ship inline
   `padding: ... 0` shorthands (e.g. pi-page-2 "Why we scan") that would
   otherwise zero out the footer clearance and bury the inline-nav button
   behind the persistent .mc-footer. */
.screen-content {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-inline: 14px;
  padding-bottom: calc(var(--footer-height, 60px) + env(safe-area-inset-bottom, 0px) + 14px);
  box-sizing: border-box;
  touch-action: pan-y;
  overscroll-behavior: none;
}

.screen-content > * {
  max-height: 100%;
  box-sizing: border-box;
}

* {
  overscroll-behavior: none;
}

.innate-page-content button.innate-cta, .innate-scrollable button:last-child {
  margin-bottom: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px) + 14px);
}

/* ── 6. COMMON COMPONENTS ────────────────────────────────────────────────────── */

/* --- Buttons --- */

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  background: var(--grad-btn);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--mc-blue-glow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn-primary:active { transform: scale(0.97); }

/* B-10.3.34: PI-flow primary variant — red gradient. Applied as
   .btn-primary.pi on buttons in the PI flow only. */
.btn-primary.pi {
  background: linear-gradient(135deg, #c8102e 0%, #8b0a1d 100%);
  box-shadow: 0 2px 8px rgba(200,16,46,0.3);
}

/* Sprint 3 Item 24: pregnancy-flow primary variant — lavender. */
.btn-primary.preg {
  background: linear-gradient(135deg, #9B59B6 0%, #7d3f99 100%);
  box-shadow: 0 2px 8px rgba(155,89,182,0.3);
}

/* Sprint 3 Item 25: pediatric/scoliosis-flow primary variant — green. */
.btn-primary.peds {
  background: linear-gradient(135deg, #5CB87A 0%, #3a7a39 100%);
  box-shadow: 0 2px 8px rgba(92,184,122,0.3);
}

/* B-10.3.16/.3.18: pinned flow-CTA utility. Anchors a primary button to the
   bottom of the viewport so it stays in the same spot across flow pages
   (intake / demographics / PI intake / balance / questionnaire) regardless
   of content height. Partner class .innate-pinned-screen adds enough bottom
   padding so content can scroll above the pinned button without clipping.
   Fix #2: bottom offset includes --footer-height so the CTA renders ABOVE
   the persistent footer (z:500), and z-index is lifted above the footer so
   the button never gets painted over. Pinned-screen padding-bottom grows
   to clear the new CTA position (footer + CTA + content gap). */
.innate-pinned-cta {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--footer-height) + 12px);
  left: 14px;
  right: 14px;
  width: auto;
  max-width: 448px;
  margin-left: auto;
  margin-right: auto;
  z-index: 600;
}
.innate-pinned-screen {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--footer-height) + 96px) !important;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--mc-blue-border);
  background: var(--bg-raised);
  color: var(--mc-blue);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease;
}

.btn-secondary:active { transform: scale(0.97); }

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-3);
  font: 12px var(--font-body);
  cursor: pointer;
  text-decoration: underline;
  padding: 8px;
}

/* --- Cards --- */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-blue {
  background: var(--bg-raised);
  border: 1.5px solid var(--mc-blue-border);
  border-radius: var(--radius);
  padding: 16px;
}

/* --- CTA Banner (always closing, gently) --- */

.cta-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--mc-blue-dim);
  border: 1px solid var(--mc-blue-border);
  color: var(--mc-blue);
  font: 600 12px/1.3 var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.cta-inline:active { background: rgba(26,106,177,0.12); }

/* --- Disclaimer --- */

.disclaimer {
  font: 12px/1.5 var(--font-body);
  color: var(--text-3);
  text-align: center;
  max-width: 340px;
  margin: 12px auto 0;
}

/* ── 7. CAMERA SCREEN ────────────────────────────────────────────────────────── */

.cam-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #000;
  overflow: hidden;
  z-index: 9999;
}

body.cam-active .sticky-nav,
body.cam-active header,
body.cam-active footer,
body.cam-active .bottom-nav {
  display: none !important;
}

.cam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 150ms;
}
.cam-flash.active { opacity: 1; }

.cam-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
  z-index: 10;
}

.cam-brand {
  font: 600 11px var(--font-body);
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.12em;
}

.cam-privacy {
  position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px; padding: 8px 15px;
  font-size: 12px; color: rgba(255,255,255,0.9);
  display: flex; align-items: center; gap: 8px;
  animation: fadeIn 400ms ease forwards; z-index: 10;
}
.cam-privacy.fading { opacity: 0; transition: opacity 800ms ease; }

.cam-instructions {
  position: absolute;
  bottom: 200px; left: 16px; right: 16px;
  text-align: center; pointer-events: none; z-index: 10;
}

.cam-instr-line {
  display: block;
  font: 700 15px/1.5 var(--font-body);
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}

.cam-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  padding: 16px 32px calc(env(safe-area-inset-bottom, 0px) + 28px);
  display: flex; justify-content: center; align-items: center; gap: 32px;
  background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
}

.cam-level-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.cam-level-track {
  width: 80px; height: 40px; border-radius: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(26,106,177,0.4);
  position: relative; overflow: hidden;
}

.cam-level-center-mark {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 2px; height: 16px; background: rgba(26,106,177,0.4);
}

.cam-level-bubble {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  transition: left 80ms linear, top 80ms linear;
}

.cam-level-bubble.on-level {
  background: var(--green);
  box-shadow: 0 0 10px rgba(92,184,122,0.6);
}

.cam-level-label {
  font: 600 11px var(--font-body);
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.08em;
  transition: color 200ms;
}
.cam-level-label.level-ok { color: var(--green); }

.cam-capture-btn {
  width: 80px; height: 80px; border-radius: 50%;
  background: transparent;
  border: 3px solid rgba(255,255,255,0.85);
  cursor: pointer; position: relative;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform 100ms;
}
.cam-capture-btn:active { transform: scale(0.93); }

@keyframes camPulse {
  0%   { box-shadow: 0 0 0 0 rgba(26,106,177,0.5); }
  70%  { box-shadow: 0 0 0 15px rgba(26,106,177,0); }
  100% { box-shadow: 0 0 0 0 rgba(26,106,177,0); }
}

.cam-capture-btn.pulsing { animation: camPulse 1.5s infinite; }
.cam-capture-inner { width: 22px; height: 22px; border-radius: 50%; background: #fff; }

.cam-error {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.9);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: #fff; text-align: center; padding: 40px; z-index: 20;
}
.cam-error.visible { display: flex; }

/* Skip photo */
.cam-skip-btn {
  position: absolute; bottom: 8px; left: 14px; right: 14px;
  min-height: 44px; border-radius: 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  font: 500 12px var(--font-body);
  cursor: pointer; text-align: center; z-index: 11;
}

/* ── 7b. SCANNER HUD (MediaPipe) ─────────────────────────────────────────────── */

.scanner-active {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;          /* fallback for browsers without dvh */
  height: 100dvh;
  max-height: 100dvh;
  background: #0a0e14;
  z-index: 1000;          /* above .mc-footer (z-index: 500) */
  overflow: hidden;
}

/* Defensive: any rendered .mc-footer must hide while the scanner is
   mounted, regardless of which screen-name path triggered the mount. */
body:has(.scanner-active) .mc-footer { display: none !important; }

/* Live preview area sits between the topbar (height + iOS notch
   safe-area) and the capture-area (160px incl. safe-area). Constrain
   explicitly so the video never extends past the bottom controls —
   capture button stays on-screen at iPhone SE / 14 viewport heights. */
.scanner-active #innate-scan-vid,
.scanner-active #innate-scan-cvs {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  left: 0; right: 0;
  bottom: calc(160px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  height: auto;
}

.scanner-hud {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; pointer-events: none;
}
.scanner-hud > * { pointer-events: auto; }

.scanner-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 12px) + 12px) 14px 10px;
  background: linear-gradient(180deg, rgba(10,14,20,.85) 0%, transparent 100%);
}

.scan-steps { display: flex; gap: 6px; }

.scan-step {
  font: 600 10px/1 var(--font-body);
  letter-spacing: 0.8px; padding: 6px 12px;
  border-radius: 16px; background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.3); transition: all .2s;
}
.scan-step.active { background: rgba(26,106,177,.15); color: var(--mc-blue); }
.scan-step.done { background: rgba(92,184,122,.12); color: var(--green); }

.level-wrap {
  position: absolute; bottom: 165px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
}
.level-label {
  font: 600 11px/1 var(--font-body);
  letter-spacing: 0.5px; color: rgba(255,255,255,.5);
  text-align: center; white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.privacy-badge {
  position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 12px; padding: 12px 16px; text-align: center; max-width: 260px;
  transition: opacity .6s; z-index: 25;
}
.priv-shield { font-size: 16px; margin-bottom: 4px; }
.priv-title  { font: 600 12px/1.3 var(--font-body); color: rgba(255,255,255,.7); margin-bottom: 2px; }
.priv-body   { font: 12px/1.4 var(--font-body); color: rgba(255,255,255,.35); }

.scan-prompt-text {
  position: absolute; bottom: 192px; left: 0; right: 0;
  text-align: center; font: 700 16px/1.3 var(--font-body);
  color: rgba(255,255,255,.95); letter-spacing: 0.3px; z-index: 15;
  text-shadow: 0 1px 8px rgba(0,0,0,.65);
  padding: 0 18px;
}
.scan-prompt-sub {
  position: absolute; bottom: 158px; left: 0; right: 0;
  text-align: center; font: 500 12px/1.4 var(--font-body);
  color: rgba(255,255,255,.78); letter-spacing: 0.2px; z-index: 15;
  text-shadow: 0 1px 8px rgba(0,0,0,.55);
  padding: 0 18px;
}

.countdown-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; z-index: 40;
}
.countdown-number {
  font: 700 80px var(--font-body);
  color: var(--mc-blue);
  text-shadow: 0 0 40px rgba(26,106,177,.4);
}
@keyframes countPop {
  0%   { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1);   opacity: 1; }
}
.countdown-number.pop { animation: countPop .3s ease; }

.capture-area {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 150px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(0deg, rgba(10,14,20,.95) 0%, rgba(10,14,20,.7) 60%, transparent 100%);
  padding-bottom: env(safe-area-inset-bottom, 12px); z-index: 20;
}

.capture-btn {
  width: 80px; height: 80px; border-radius: 50%;
  border: none; background: transparent; cursor: pointer;
  position: relative; display: flex; align-items: center; justify-content: center;
}
.capture-btn:active { transform: scale(0.92); }

.cap-ring-outer {
  position: absolute; inset: 0; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.7); transition: border-color .2s;
}
.cap-ring-inner {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255,255,255,.85); transition: background .15s, transform .1s;
}
.capture-btn:active .cap-ring-inner { transform: scale(0.9); background: #fff; }
.capture-btn.ready .cap-ring-outer { border-color: var(--mc-blue); box-shadow: 0 0 14px var(--mc-blue-glow); }
.capture-btn.ready .cap-ring-inner { background: var(--mc-blue); }

.capture-delay-btn {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.7); font-size: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  transition: opacity .2s, border-color .2s;
}
.capture-delay-btn:disabled { opacity: .25; cursor: default; }
.capture-delay-btn:not(:disabled):active { transform: translateY(-50%) scale(.9); }
.delay-icon { font-size: 14px; line-height: 1; }
.delay-text { font: 600 9px/1 var(--font-body); letter-spacing: .5px; }

.capture-skip-btn {
  position: absolute; left: 14px; right: 14px; bottom: 8px;
  min-height: 48px; border-radius: 12px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.8); font: 600 12px/1.3 var(--font-body);
  cursor: pointer; padding: 12px 16px; text-align: center;
}
.capture-skip-btn:active { background: rgba(255,255,255,.2); }

.capture-btn:disabled .cap-ring-outer { border-color: rgba(255,255,255,.2); }
.capture-btn:disabled .cap-ring-inner { background: rgba(255,255,255,.2); }

/* B-1b validity gate states ─────────────────────────────────────────── */
.capture-btn.gated        { cursor: not-allowed; opacity: .5; filter: grayscale(1); }
.capture-btn.gated:active { transform: none; }
@keyframes innateCapPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(26,106,177,.45); }
  50%      { box-shadow: 0 0 0 10px rgba(26,106,177,0); }
}
.capture-btn.ready:not(.gated) .cap-ring-outer { animation: innateCapPulse 1.6s ease-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .capture-btn.ready:not(.gated) .cap-ring-outer { animation: none; }
}

.scan-cam-err {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: 14px; background: rgba(0,0,0,.9); z-index: 50;
}

/* ── 8. ANNOTATION (Posture Analysis) ────────────────────────────────────────── */

.ann-screen { position: fixed; inset: 0; background: #000; overflow: hidden; }
.ann-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ann-overlay { position: absolute; inset: 0; pointer-events: none; }
.ann-overlay svg { width: 100%; height: 100%; }

.ann-zone-line { stroke-width: 3; transition: opacity 80ms; }
.ann-overlay.snapped .ann-zone-line { opacity: 1; }

.ann-dot { r: 5; }
.ann-dot.affected.critical { fill: var(--red); animation: gentlePulse 2s infinite; }
.ann-dot.affected:not(.critical) { fill: var(--amber); }

.ann-hit-zones { position: absolute; inset: 0; }
.ann-hit-zone { position: absolute; left: 0; right: 0; cursor: pointer; min-height: 44px; }
.ann-hit-zone:active { background: rgba(26,106,177,0.06); }

.ann-bottom-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 80px);
  display: flex; gap: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  z-index: 15;
}

.ann-continue-btn {
  flex: 1; height: 56px; border-radius: var(--radius);
  background: var(--grad-btn); color: #fff;
  font: 700 14px var(--font-body);
  cursor: pointer; transition: opacity 300ms;
}

.ann-card-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  transform: translateY(100%);
  transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--bg-raised);
  border: 1px solid var(--glass-border); border-bottom: none;
  border-radius: 18px 18px 0 0;
  padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.ann-card-drawer.open { transform: translateY(0); }

.ann-card-handle { width: 36px; height: 4px; background: rgba(0,0,0,0.1); border-radius: 2px; margin: 0 auto 14px; }
.ann-card-level { font: 700 40px var(--font-body); color: var(--mc-blue); line-height: 1; margin-bottom: 4px; }
.ann-card-name { font: 700 15px var(--font-body); color: var(--text); margin-bottom: 14px; }
.ann-card-content { font: 13px/1.6 var(--font-body); color: var(--text-2); }

.ann-nerve-pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--nerve-yellow-dim); border: 1px solid rgba(212,160,23,0.3);
  color: #8b6914; font-size: 12px; margin: 3px 3px 3px 0;
}

.ann-organ-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; color: var(--text-2); }
.ann-organ-row::before { content: '\2022'; color: var(--mc-blue); }

.ann-symptom-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; color: var(--text-2); }
.ann-symptom-row::before { content: '\2022'; color: var(--red); }

.ann-edu-text { font: 13px/1.6 var(--font-body); color: var(--text-2); }
.ann-card-hint { font: 12px var(--font-body); color: var(--mc-blue); text-align: center; margin-top: 14px; }

/* ── 9. BALANCE TEST ─────────────────────────────────────────────────────────── */

/* Balance styles are injected inline by balance.js — only overrides here */

/* ── 10. NEUROPATHOLATOR ─────────────────────────────────────────────────────── */

.neuro-screen {
  position: fixed; inset: 0;
  height: 100%;
  background: var(--bg); z-index: 100;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--footer-height, 60px) + env(safe-area-inset-bottom, 0px) + 16px);
}

.neuro-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top, 12px) + 10px) 12px 10px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--glass-border);
}

.neuro-title { font: 700 14px/1.2 var(--font-body); color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neuro-badge { font: 600 12px/1 var(--font-body); color: var(--mc-blue); background: var(--mc-blue-dim); padding: 4px 10px; border-radius: 8px; }
.neuro-close { width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.04); border: none; color: var(--text-2); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.neuro-body {
  position: relative;
}

/* Spine SVG container */
.neuro-spine-wrap {
  display: flex; justify-content: center;
  padding: 14px 0 calc(var(--footer-height) + 80px);
  min-height: 100%;
}

/* Vertebra hit areas */
.vert-hit { cursor: pointer; transition: opacity 0.15s; }
.vert-hit:hover { opacity: 0.8; }

/* Vertebra states */
.vert-body { fill: #fff; stroke: #bbb; stroke-width: 1; transition: all 0.2s; }
.vert-body.flagged { fill: rgba(200,16,46,0.08); stroke: var(--red); animation: glowPulse 2s infinite; }
.vert-body.tapped { stroke: var(--mc-blue); stroke-width: 2; filter: drop-shadow(0 0 6px var(--mc-blue-glow)); }

/* Nerve lines */
.nerve-line { stroke: var(--nerve-yellow); stroke-width: 1.5; fill: none; opacity: 0.2; transition: all 0.3s; }
.nerve-line.active { opacity: 1; stroke: var(--nerve-yellow-bright); stroke-width: 2; }
.nerve-line.flagged { opacity: 0.6; stroke: #e6a817; filter: drop-shadow(0 0 4px rgba(200,16,46,0.3)); }

/* Vagus nerve */
.vagus-line { stroke: var(--vagus-green); stroke-width: 2; fill: none; opacity: 0; transition: opacity 0.5s; }
.vagus-line.active { opacity: 0.8; }

/* Organ labels */
.organ-label { font: 12px/1.3 var(--font-body); fill: var(--text-3); transition: all 0.2s; cursor: pointer; }
.organ-label.active { fill: var(--text); font-weight: 600; }
.organ-label.vagus-active { fill: var(--vagus-green); font-weight: 600; }

/* Level label (left side) */
.level-id { font: 700 11px var(--font-body); fill: var(--text-3); transition: fill 0.2s; }
.level-id.flagged { fill: var(--red); }
.level-id.tapped { fill: var(--mc-blue); }

/* Card — 4-level deep */
/* Card sits ABOVE footer. All content visible without scrolling. */
.neuro-card {
  position: fixed;
  bottom: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px));
  left: 0; right: 0; z-index: 110;
  background: rgba(255,255,255,0.18); /* Task 9.6: NSM card background */
  border-top: 1px solid var(--glass-border);
  border-radius: 16px 16px 0 0;
  padding: 14px 16px 16px;
  max-height: calc(100vh - var(--footer-height) - env(safe-area-inset-bottom, 0px) - 40px);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.2,.9,.3,1);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.neuro-card.open { transform: translateY(0); }

.neuro-card-handle { width: 36px; height: 4px; border-radius: 2px; background: rgba(0,0,0,0.1); margin: 0 auto 12px; cursor: grab; }
.neuro-card-level { font: 700 28px var(--font-body); color: var(--mc-blue); line-height: 1; margin-bottom: 4px; }
.neuro-card-name { font: 600 16px var(--font-body); color: var(--text); margin-bottom: 10px; }
.neuro-card-hook { font: 500 14px/1.6 var(--font-body); color: var(--text-2); margin-bottom: 7px; font-style: italic; }

.neuro-card-section { font: 700 10px/1 var(--font-body); letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); margin: 12px 0 6px; }

.neuro-card-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.neuro-organ-chip {
  padding: 10px 14px; border-radius: 12px;
  background: var(--mc-blue-dim); border: 1px solid var(--mc-blue-border);
  color: var(--mc-blue); font: 500 13px var(--font-body);
  cursor: pointer; transition: all 0.15s; min-height: 44px;
  display: inline-flex; align-items: center;
}
.neuro-organ-chip:active { background: rgba(26,106,177,0.15); }

.neuro-symptom-chip {
  padding: 10px 14px; border-radius: 12px;
  background: var(--red-dim); border: 1px solid rgba(200,16,46,0.15);
  color: var(--red); font: 500 13px var(--font-body);
  cursor: pointer; min-height: 44px;
  display: inline-flex; align-items: center;
}

.neuro-adjacent-chip {
  padding: 10px 15px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--glass-border); min-height: 48px;
  color: var(--text-2); font: 600 12px var(--font-body);
  cursor: pointer;
}

.neuro-card-text { font: 14px/1.6 var(--font-body); color: var(--text-2); margin-bottom: 7px; }
.neuro-card-revelation { font: 14px/1.6 var(--font-body); color: var(--text); margin-bottom: 7px; }

.neuro-card-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px; border-radius: 12px;
  background: var(--grad-btn); color: #fff;
  font: 700 13px var(--font-body);
  cursor: pointer; margin-top: 12px;
  text-decoration: none;
}

.neuro-card-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.04); border: none;
  color: var(--text-3); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Progress footer — now inline (non-sticky) per v2.1c; main nav lives in sticky top */
.neuro-footer {
  padding: 12px 14px calc(var(--footer-height) + env(safe-area-inset-bottom, 0px) + 16px);
  display: flex; align-items: center; gap: 8px;
  box-sizing: border-box;
}
.neuro-progress { font: 500 12px var(--font-body); color: var(--text-3); flex: 1; min-width: 0; }
.neuro-progress strong { color: var(--mc-blue); font-weight: 700; }
.neuro-continue {
  height: 44px; padding: 0 16px; border-radius: 12px;
  background: var(--grad-btn); color: #fff;
  font: 700 12px var(--font-body);
  cursor: pointer; box-shadow: 0 2px 8px var(--mc-blue-glow);
  flex-shrink: 0; transition: transform .1s;
  max-width: calc(100vw - 32px); box-sizing: border-box;
}
.neuro-continue:active { transform: scale(.96); }

/* Treatment card modal */
.treatment-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 200ms ease;
}
.treatment-card {
  width: 100%; max-width: 500px;
  max-height: 85vh;
  background: var(--bg-raised);
  border-radius: 16px 16px 0 0;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 12px) + 18px);
  box-shadow: 0 -4px 18px rgba(0,0,0,0.12);
}
.treatment-card-hook { font: 600 15px/1.4 var(--font-body); color: var(--text); margin-bottom: 14px; }
.treatment-card-body { font: 12px/1.65 var(--font-body); color: var(--text-2); margin-bottom: 14px; }

/* ── 11. PAIN MAP / QUESTIONNAIRE ────────────────────────────────────────────── */

.pm-zone {
  position: absolute; border-radius: 4px; cursor: pointer;
  border: 1.5px solid transparent;
  min-width: 28px; min-height: 28px;
  transition: background .12s, border-color .12s;
}
.pm-zone.selected {
  background: rgba(200,16,46,0.2);
  border-color: rgba(200,16,46,0.5);
}

/* Mini card for per-area questions */
.pm-mini-card {
  position: fixed; bottom: calc(var(--footer-height) + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; z-index: 50;
  background: var(--bg-raised);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px 16px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.2,.9,.3,1);
}
.pm-mini-card.open { transform: translateY(0); }

.pm-mini-option {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--glass-border);
  color: var(--text); font: 500 13px var(--font-body);
  cursor: pointer; text-align: left; margin-bottom: 8px;
  transition: all 0.15s;
}
.pm-mini-option:active { transform: scale(0.98); }
.pm-mini-option.selected { background: var(--mc-blue-dim); border-color: var(--mc-blue); color: var(--mc-blue); }

/* ── 12. LEAD CAPTURE ────────────────────────────────────────────────────────── */

.lead-wrap {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px 18px calc(var(--footer-height) + 18px);
  background: var(--bg);
}

.lead-header-title { font: 700 18px/1.2 var(--font-body); color: var(--text); text-align: center; margin-bottom: 8px; }
.lead-header-sub { font: 13px/1.5 var(--font-body); color: var(--text-3); text-align: center; max-width: 316px; margin: 0 auto 28px; }

.lead-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }

.lead-field-label { font: 600 12px var(--font-body); color: var(--text-2); margin-bottom: 6px; }

.lead-input {
  width: 100%; height: 52px; padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--bg-raised);
  font: 13px var(--font-body); color: var(--text);
  transition: border-color 0.15s;
}
.lead-input:focus { outline: none; border-color: var(--mc-blue); }
.lead-input::placeholder { color: var(--text-3); }

.lead-consent {
  display: flex; gap: 10px; align-items: flex-start;
  font: 12px/1.4 var(--font-body); color: var(--text-3);
}
.lead-consent input { width: 16px; height: 16px; accent-color: var(--mc-blue); flex-shrink: 0; margin-top: 2px; }

.lead-error { color: var(--red); font: 12px var(--font-body); text-align: center; padding: 8px; }

.btn-lead {
  width: 100%; min-height: 44px; border-radius: var(--radius);
  background: var(--grad-btn); color: #fff;
  font: 700 14px var(--font-body);
  cursor: pointer; border: none;
  box-shadow: 0 2px 8px var(--mc-blue-glow);
  transition: transform 0.1s;
}
.btn-lead:active { transform: scale(0.97); }
.btn-lead:disabled { opacity: 0.4; cursor: default; }

.lead-success {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
}
.lead-success-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--green-dim); color: var(--green); font: 700 18px var(--font-body); display: flex; align-items: center; justify-content: center; }
.lead-success-title { font: 700 22px var(--font-body); color: var(--text); }
.lead-success-sub { font: 12px/1.5 var(--font-body); color: var(--text-3); max-width: 300px; }

/* ── 13. RESULTS REPORT ──────────────────────────────────────────────────────── */

.results-screen {
  height: 100%;
  max-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding-bottom: calc(var(--footer-height, 60px) + env(safe-area-inset-bottom, 0px) + 16px);
}

.results-header {
  text-align: center;
  padding: 14px 18px 16px;
}

.results-header-logo { width: 80px; height: 80px; object-fit: contain; margin: 0 auto 12px; }
.results-header-practice { font: 700 15px/1.2 var(--font-body); color: var(--text); margin-bottom: 4px; }
.results-header-doctor { font: 500 12px var(--font-body); color: var(--text-2); margin-bottom: 4px; }
.results-header-patient { font: 600 14px var(--font-body); color: var(--mc-blue); margin-bottom: 4px; }
.results-header-date { font: 12px var(--font-body); color: var(--text-3); }

.results-section {
  padding: 0 16px;
  margin-bottom: 18px;
}

.results-section-title {
  font: 700 14px var(--font-body); color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
}

.results-finding {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.results-finding-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 6px;
}
.results-finding-text { font: 14px/1.5 var(--font-body); color: var(--text-2); }

/* Share card */
.share-card-wrap {
  margin: 18px 16px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Action buttons */
.results-actions {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0 16px; margin-bottom: 18px;
}

.results-action-btn {
  width: 100%; min-height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 13px var(--font-body); cursor: pointer;
  transition: transform 0.1s;
}
.results-action-btn:active { transform: scale(0.97); }

.results-action-btn.primary {
  background: var(--grad-btn); color: #fff;
  border: none; box-shadow: 0 2px 8px var(--mc-blue-glow);
}
.results-action-btn.secondary {
  background: var(--bg-raised); color: var(--mc-blue);
  border: 1px solid var(--mc-blue-border);
}

/* Family prompt */
.family-prompt {
  margin: 0 16px 18px;
  padding: 16px;
  border-radius: 14px;
  background: var(--mc-blue-dim);
  border: 1px solid var(--mc-blue-border);
  text-align: center;
}
.family-prompt-text { font: 13px/1.5 var(--font-body); color: var(--text-2); }
.family-prompt-text strong { color: var(--text); }

/* ── 14. PREVIEW BANNER ──────────────────────────────────────────────────────── */

#preview-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9000;
  padding: 6px 14px;
  background: rgba(212,164,74,0.95);
  color: #fff; text-align: center;
  font: 600 12px/1.4 var(--font-body);
  letter-spacing: 0.5px;
}
.preview-banner-icon { margin-right: 6px; }
.preview-banner-sub { display: block; font-weight: 400; font-size: 11px; opacity: 0.8; }

/* ── 15. UTILITY ─────────────────────────────────────────────────────────────── */

@keyframes annPulse {
  0%, 100% { r: 5; opacity: 1; }
  50%      { r: 7; opacity: 0.7; }
}

.legal-footer {
  font: 11px/1.4 var(--font-body);
  color: var(--text-3);
  text-align: center;
  padding: 14px 16px;
  max-width: 360px;
  margin: auto auto 0;
}

/* Score bars (results) */
.score-bar-wrap { margin-bottom: 12px; }
.score-bar-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font: 600 11px/1 var(--font-body); letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 6px;
}
.score-bar-track { height: 6px; border-radius: 3px; background: rgba(0,0,0,0.04); overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }

/* Score ring */
.score-ring-outer { width: 180px; height: 180px; position: relative; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.score-ring-svg { width: 180px; height: 180px; }
.score-ring-track { fill: none; stroke: rgba(0,0,0,0.06); stroke-width: 6; }
.score-ring-progress { fill: none; stroke-width: 6; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.2s ease; }
.score-ring-inner { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-display-grade { font: 700 28px var(--font-body); line-height: 1; }
.score-display-number { font: 700 44px var(--font-body); line-height: 1; margin: 4px 0; }
.score-display-label { font: 600 10px var(--font-body); letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-3); }
.score-display-verdict { font: 700 12px var(--font-body); letter-spacing: 0.5px; text-transform: uppercase; margin-top: 4px; }

/* Page dots (top) */
.page-dots-top {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 10;
}
.page-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(0,0,0,0.12); transition: all 200ms; cursor: pointer;
}
.page-dot.active { background: var(--mc-blue); width: 18px; border-radius: 4px; }

/* Innate logo styles (used in results header) */
.innate-logo-small { text-align: center; margin-bottom: 14px; }
.innate-logo-word { font: 700 14px var(--font-body); letter-spacing: 0.15em; color: var(--mc-blue); }
.innate-logo-tag { display: block; font: 12px var(--font-body); color: var(--text-3); letter-spacing: 0.05em; }

/* Penalty toggle */
.penalty-toggle {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; cursor: pointer; margin-top: 12px;
}
.penalty-toggle-label { font: 500 12px var(--font-body); color: var(--mc-blue); }
.penalty-toggle-arrow { font-size: 12px; color: var(--mc-blue); transition: transform 0.2s; }
.penalty-toggle.open .penalty-toggle-arrow { transform: rotate(180deg); }

/* Penalty list */
.penalty-list-wrap { padding: 0 4px; }
.penalty-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.03);
  font: 12px var(--font-body); color: var(--text-2);
}
.penalty-item-value { color: var(--red); font-weight: 600; }

/* Red zone cards */
.rz-grid { display: flex; flex-direction: column; gap: 8px; }
.red-zone-card {
  background: var(--bg-raised); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 12px 14px; cursor: pointer;
  transition: all 0.15s;
}
.red-zone-card.critical { border-color: rgba(200,16,46,0.2); }
.red-zone-card:active { transform: scale(0.98); }

.rz-card-main { display: flex; align-items: center; gap: 8px; }
.rz-level { font: 700 16px var(--font-body); flex-shrink: 0; width: 40px; }
.rz-info { flex: 1; }
.rz-zone-label { font: 600 12px var(--font-body); color: var(--text); }
.rz-symptoms { font: 12px/1.4 var(--font-body); color: var(--text-3); margin-top: 2px; }

/* Spine page layout */
.spine-page-layout { display: flex; gap: 14px; padding: 0 14px; }
.spine-svg-col { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rz-col { flex: 1; min-width: 0; }

.spine-legend { display: flex; gap: 8px; flex-wrap: wrap; }
.legend-dot-item { display: flex; align-items: center; gap: 4px; font: 11px var(--font-body); color: var(--text-3); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* Section headings in results */
.rp-inner { width: 100%; max-width: 500px; padding: 12px 16px; }
.rp-section-heading { font: 700 16px var(--font-body); color: var(--text); text-align: center; margin-bottom: 8px; }

/* Score bars container */
.score-bars-wrap { width: 100%; max-width: 360px; margin: 16px auto 0; }

/* Degeneration timeline */
.degen-timeline { padding: 0 16px; }
.degen-stage {
  padding: 14px; border-radius: 12px;
  background: var(--bg-raised); border: 1px solid var(--glass-border);
  margin-bottom: 12px;
}
.degen-stage-label { font: 700 12px var(--font-body); margin-bottom: 8px; }
.degen-stage-text { font: 12px/1.6 var(--font-body); color: var(--text-2); }

/* Care plan */
.care-phase {
  padding: 14px; border-radius: 12px;
  background: var(--bg-raised); border: 1px solid var(--glass-border);
  margin-bottom: 10px;
}
.care-phase-title { font: 700 13px var(--font-body); color: var(--mc-blue); margin-bottom: 6px; }
.care-phase-text { font: 12px/1.6 var(--font-body); color: var(--text-2); }

/* ── 16. PRINT STYLESHEET ──────────────────────────────────────────────────── */

@media print {
  @page { margin: 0.5in; }

  /* Hide non-print elements */
  .mc-footer,
  .mesh-bg,
  #btn-download, #btn-download-top,
  #btn-share, #btn-share-top,
  #share-modal,
  #share-canvas,
  .page-dots-top,
  #preview-banner,
  .neuro-footer,
  .cam-screen,
  .scanner-active {
    display: none !important;
  }

  /* QR code section */
  img[src*="qrserver"] {
    display: none !important;
  }

  body {
    background: #fff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  .results-screen {
    max-width: 100% !important;
    padding: 0 !important;
    min-height: auto !important;
  }

  .results-screen > div {
    max-width: 100% !important;
    box-shadow: none !important;
  }

  /* Preserve colors */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Minimum font size */
  body, p, span, div, li, td, th {
    font-size: max(11px, inherit) !important;
  }

  /* Spine SVG — don't break across pages */
  svg {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    width: 100% !important;
  }

  /* Cards full width */
  .results-screen div[style*="max-width:680px"] {
    max-width: 100% !important;
  }
}

/* ── Flow Selection screen — V2 audit Item 2 ─────────────────────────────── */
/* 4 tiles in a 2×2 grid (Posture / Scoliosis-Pediatric / Pregnancy / PI). */

.flow-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}

.flow-tile {
  background: #ffffff;
  border: 1px solid var(--mc-grey-border);
  border-radius: var(--radius);
  padding: 18px 14px;
  min-height: 130px;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  font: inherit;
}

.flow-tile:active,
.flow-tile:focus-visible {
  border-color: var(--mc-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--mc-blue-glow);
  outline: none;
}

.flow-tile-title {
  font: 600 15px/1.25 Inter, system-ui, sans-serif;
  color: var(--text);
}

.flow-tile-sub {
  font: 400 12px/1.35 Inter, system-ui, sans-serif;
  color: var(--text-3);
}

/* Sprint 3 Item 42: highlight the recommended tile + a subtle nudge variant
   for the 14-17 band that doesn't auto-flip the flow. */
.flow-tile-recommended {
  border-color: var(--mc-blue);
  border-width: 2px;
  box-shadow: 0 4px 14px var(--mc-blue-glow);
  position: relative;
}
.flow-tile-nudge {
  border-color: rgba(26,106,177,0.4);
  border-width: 1.5px;
}
.flow-tile-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--mc-blue);
  color: #fff;
  font: 700 10px/1 Inter, system-ui, sans-serif;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 6px var(--mc-blue-glow);
}

/* ── Welcome splash animated intro ─────────────────────────────────── */

.innate-splash .splash-practice {
  opacity: 0;
  transform: translateY(8px);
  animation: splashPracticeIn 1.2s ease-out 0s forwards;
}
@keyframes splashPracticeIn {
  to { opacity: 1; transform: translateY(0); }
}

.innate-splash .splash-hero-img {
  opacity: 0;
  transform: scale(0) rotateY(0deg);
  animation:
    splashHeroFade   200ms ease-out 1.2s forwards,
    splashHeroSpin   1.5s 1.2s forwards,
    splashHeroSettle 400ms cubic-bezier(0.34,1.56,0.64,1) 2.7s forwards;
}

/* Fade-in (runs concurrently with spin) */
@keyframes splashHeroFade {
  to { opacity: 1; }
}

/* Y-axis rotation with non-uniform speed:
   0→150° linear (slow show of front)
   150→210° fast (mirror flash hidden in motion blur)
   210→360° linear (return to front)
   Hero stays at scale(1.2) throughout the spin. */
@keyframes splashHeroSpin {
  0%   { transform: scale(1.4) rotateY(0deg);   animation-timing-function: linear;     }
  42%  { transform: scale(1.4) rotateY(150deg); animation-timing-function: ease-in;    }
  58%  { transform: scale(1.4) rotateY(210deg); animation-timing-function: linear;     }
  75%  { transform: scale(1.4) rotateY(270deg); animation-timing-function: ease-out;   }
  100% { transform: scale(1.4) rotateY(360deg); animation-timing-function: ease-out;   }
}

/* Settle from 1.4 → 1.0 with a soft overshoot */
@keyframes splashHeroSettle {
  0%   { transform: scale(1.4) rotateY(360deg); }
  100% { transform: scale(1.0) rotateY(360deg); }
}

.innate-splash .splash-content > * {
  opacity: 0;
  animation: splashContentIn 600ms ease-out forwards;
}
.innate-splash .splash-content > *:nth-child(1) { animation-delay: 3.1s; }
.innate-splash .splash-content > *:nth-child(2) { animation-delay: 3.3s; }
.innate-splash .splash-content > *:nth-child(3) { animation-delay: 3.5s; }

.innate-splash .splash-cta {
  opacity: 0;
  animation: splashContentIn 600ms ease-out 3.7s forwards;
}

@keyframes splashContentIn {
  to { opacity: 1; }
}

/* Reduced motion — skip every animation, show everything immediately */
@media (prefers-reduced-motion: reduce) {
  .innate-splash .splash-practice,
  .innate-splash .splash-hero-img,
  .innate-splash .splash-content > *,
  .innate-splash .splash-cta {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }
}
