:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(255,255,255,0.08);
  --panel-strong: rgba(255,255,255,0.13);
  --text: #f7fbff;
  --muted: #a8b8c9;
  --line: rgba(255,255,255,0.14);
  --brand: #0a7cff;
  --brand-2: #20d7a6;
  --warn: #ffd166;
  --danger: #ff6b6b;
  --radius: 28px;
  --shadow: 0 24px 80px rgba(0,0,0,0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body {
  background:
    radial-gradient(circle at top left, rgba(10,124,255,0.38), transparent 34rem),
    radial-gradient(circle at 90% 12%, rgba(32,215,166,0.18), transparent 24rem),
    linear-gradient(180deg, #08192b 0%, var(--bg) 44%, #050a12 100%);
  color: var(--text);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
/* Mobile-first: the app fills the device viewport edge to edge. The framed
   "phone card" look is desktop-browser preview only (see the 780px query). */
.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0 0 calc(96px + env(safe-area-inset-bottom, 0px));
  position: relative;
}
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 12px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), #65b5ff);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(10,124,255,0.35);
  font-weight: 900;
}
.phone-card {
  background: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}
.header {
  padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 8px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(7,17,31,0.96), rgba(7,17,31,0.76));
  backdrop-filter: blur(20px);
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { color: var(--brand-2); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 29px; letter-spacing: -0.05em; line-height: 1.02; margin-top: 8px; }
h2 { font-size: 21px; letter-spacing: -0.03em; }
h3 { font-size: 16px; }
p { color: var(--muted); line-height: 1.45; }
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--panel);
  font-size: 12px;
  white-space: nowrap;
}
.content { padding: 14px 18px 24px; display: grid; gap: 16px; }
.hero {
  border-radius: 30px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(10,124,255,0.25), rgba(32,215,166,0.12)),
    var(--panel);
  border: 1px solid var(--line);
}
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.btn {
  border: 0;
  border-radius: 18px;
  padding: 13px 14px;
  color: var(--text);
  background: var(--panel-strong);
  font-weight: 800;
  min-height: 48px;
}
.btn.primary { background: linear-gradient(135deg, var(--brand), #6ab9ff); color: white; }
.btn.green { background: linear-gradient(135deg, #0abf8d, var(--brand-2)); color: #04110d; }
.btn.ghost { border: 1px solid var(--line); background: rgba(255,255,255,0.05); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 15px;
  min-height: 126px;
  display: grid;
  gap: 10px;
}
.card.full { grid-column: 1 / -1; }
.icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.12);
  font-size: 22px;
}
.meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.tag {
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  color: rgba(255,255,255,0.82);
  font-size: 11px;
  padding: 6px 8px;
}
.input-panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 14px;
  background: rgba(255,255,255,0.08);
}
textarea, input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border-radius: 20px;
  padding: 13px 14px;
  outline: none;
}
textarea { min-height: 108px; resize: none; }
.form-grid { display: grid; gap: 10px; margin-top: 12px; }
.answer {
  border: 1px solid rgba(32,215,166,0.28);
  background: rgba(32,215,166,0.08);
  border-radius: 26px;
  padding: 16px;
  display: grid;
  gap: 12px;
}
.answer strong { color: var(--text); }
.source-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.confidence { color: var(--brand-2); font-weight: 900; }
.list { display: grid; gap: 10px; }
.item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.06);
}
.item small { color: var(--muted); display: block; margin-top: 4px; line-height: 1.35; }
.progress { height: 9px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: inherit; }
.nav {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(492px, calc(100% - 28px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  padding: 9px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: rgba(5,12,22,0.9);
  backdrop-filter: blur(24px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.36);
}
.nav button {
  border: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 18px;
  padding: 9px 4px;
  display: grid;
  gap: 4px;
  place-items: center;
  font-size: 11px;
}
.nav button.active { color: white; background: rgba(10,124,255,0.25); }
.nav b { font-size: 17px; }
.mapbox {
  min-height: 250px;
  border-radius: 30px;
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    radial-gradient(circle at 40% 40%, rgba(10,124,255,0.35), transparent 10rem),
    #0c2035;
  background-size: 32px 32px, 32px 32px, auto, auto;
}
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 16px;
  padding: 10px;
  background: white;
  color: #07111f;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(0,0,0,0.32);
}
.pin small { display: block; color: #475569; font-weight: 700; }
.report-preview {
  background: #f6f8fb;
  color: #081524;
  border-radius: 24px;
  padding: 17px;
  display: grid;
  gap: 10px;
}
.report-preview p, .report-preview small { color: #4b5870; }
.locked { opacity: 0.78; }
.notice { color: var(--warn); }
/* Desktop-browser preview only: restore the framed phone-card mockup. */
@media (min-width: 780px) {
  .app-shell { width: min(1100px, 100%); margin: 0 auto; padding: 14px 14px 96px; }
  .phone-card {
    background: rgba(5,12,22,0.68);
    border: 1px solid var(--line);
    border-radius: 36px;
    overflow: hidden;
    min-height: calc(100vh - 28px);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
    display: grid;
    grid-template-columns: 420px 1fr;
  }
  .header { grid-column: 1 / -1; padding: 18px 18px 8px; }
  .content { grid-template-columns: 1fr 1fr; align-content: start; }
  .content > .hero, .content > .full, .content > .input-panel { grid-column: 1 / -1; }
  .nav { width: min(720px, calc(100% - 28px)); bottom: 15px; }
  .onboard-shell { width: min(520px, 100%); margin: 0 auto; padding: 14px; }
  .onboard-shell .phone-card { display: block; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   v2 ADDITIONS — onboarding, survey, paywall, upsell overlay, loading
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Onboarding shell ──────────────────────────────────────────────────── */
.onboard-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}
.onboard-screen {
  padding: calc(36px + env(safe-area-inset-top, 0px)) 22px calc(28px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 14px;
  min-height: 100vh;
  min-height: 100dvh;
  align-content: center;
}
.onboard-logo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--brand), #65b5ff);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 28px;
  box-shadow: 0 16px 40px rgba(10,124,255,0.4);
  margin: 0 auto 8px;
}

/* ─── Progress bar ──────────────────────────────────────────────────────── */
.onboard-progress {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.onboard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: inherit;
  transition: width 0.35s ease;
}

/* ─── Survey ────────────────────────────────────────────────────────────── */
.survey-counter {
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.survey-options { display: grid; gap: 10px; }
.survey-option {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--text);
  text-align: left;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.survey-option:hover,
.survey-option:focus {
  border-color: var(--brand);
  background: rgba(10,124,255,0.12);
  outline: none;
}

/* ─── Calculation reveal ────────────────────────────────────────────────── */
.calc-reveal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.calc-stat {
  background: linear-gradient(135deg, rgba(10,124,255,0.18), rgba(32,215,166,0.08));
  border: 1px solid rgba(32,215,166,0.2);
  border-radius: 20px;
  padding: 20px 14px;
  text-align: center;
}
.calc-num {
  display: block;
  font-size: 34px;
  font-weight: 900;
  color: var(--brand-2);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 6px;
}
.calc-stat small { color: var(--muted); font-size: 12px; line-height: 1.4; }

/* ─── Rating + priming ──────────────────────────────────────────────────── */
.star-row {
  font-size: 40px;
  color: var(--warn);
  letter-spacing: 4px;
  text-align: center;
  padding: 8px 0;
}
.priming-icon {
  font-size: 52px;
  text-align: center;
  line-height: 1;
}

/* ─── Paywall (onboarding) ──────────────────────────────────────────────── */
.paywall-screen { align-content: start; padding-top: 28px; }
.paywall-cards  { display: grid; gap: 12px; }
.paywall-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  background: var(--panel);
  display: grid;
  gap: 10px;
  position: relative;
  text-align: left;
}
.paywall-card.recommended {
  border-color: var(--brand);
  background: rgba(10,124,255,0.09);
}
.paywall-badge {
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--brand);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.06em;
}
.paywall-price {
  font-size: 34px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.paywall-price span { font-size: 16px; color: var(--muted); font-weight: 500; }
.paywall-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
}

/* ─── In-app upsell overlay ─────────────────────────────────────────────── */
.upsell-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,10,20,0.85);
  backdrop-filter: blur(18px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.upsell-card {
  background: rgba(8,18,32,0.98);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 32px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
  display: grid;
  gap: 14px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55);
}

/* ─── Loading dots ──────────────────────────────────────────────────────── */
.loading-dots { display: flex; gap: 9px; justify-content: center; margin-bottom: 12px; }
.loading-dots span {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--brand);
  animation: dot-pulse 1.3s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.22s; background: var(--brand-2); }
.loading-dots span:nth-child(3) { animation-delay: 0.44s; }
@keyframes dot-pulse {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
  40%            { transform: scale(1);    opacity: 1; }
}
