:root {
  --primary: #111111;
  --primary-light: #333333;
  --bg: #F9FAFB;
  --card: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --success: #10B981;
  --error: #EF4444;
  --line: #3730d8; /* accent used only inside graphs */
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh; min-height: 100dvh;
}

.ob { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* top bar */
.ob-top { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.25rem 0.4rem; padding-top: max(0.9rem, env(safe-area-inset-top)); }
.ob-back { border: none; background: none; font-size: 1.4rem; line-height: 1; color: var(--text-secondary); cursor: pointer; width: 28px; height: 28px; flex-shrink: 0; visibility: hidden; }
.ob-back.show { visibility: visible; }
.ob-brand { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.4rem; }
.ob-brand img { width: 22px; height: 22px; border-radius: 6px; }
.ob-progress { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.ob-progress-bar { height: 100%; width: 0%; background: var(--primary); border-radius: 99px; transition: width 0.35s ease; }
.ob-top .spacer { width: 28px; flex-shrink: 0; }

.ob-body { flex: 1; display: flex; flex-direction: column; padding: 1.25rem 1.25rem 0; overflow-y: auto; }
.step { display: flex; flex-direction: column; flex: 1; animation: fade 0.28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-light); margin-bottom: 0.5rem; }
.q-title { font-size: 1.35rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 0.35rem; }
.q-sub { font-size: 0.92rem; color: var(--text-secondary); margin-bottom: 1.1rem; }

/* options */
.options { display: flex; flex-direction: column; gap: 0.6rem; }
.opt { display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--border); border-radius: 13px; padding: 0.9rem 1rem; font-size: 0.98rem; font-weight: 600; color: var(--text); cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.1s; }
.opt:hover { border-color: var(--primary-light); }
.opt:active { transform: scale(0.985); }
.opt.selected { border-color: var(--primary); background: #f3f3f5; }
.opt-emoji { font-size: 1.25rem; line-height: 1; flex-shrink: 0; }
.opt-text { flex: 1; }
.opt-sub { display: block; font-size: 0.78rem; font-weight: 400; color: var(--text-secondary); margin-top: 0.1rem; }
.opt-check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.78rem; }
.opt.single .opt-check { border-radius: 50%; }
.opt.selected .opt-check { background: var(--primary); border-color: var(--primary); }
.multi-hint { text-align: center; font-size: 0.8rem; color: var(--text-light); margin-top: 0.9rem; }

/* footer */
.ob-foot { padding: 0.9rem 1.25rem; padding-bottom: max(0.9rem, env(safe-area-inset-bottom)); }
.btn { display: block; width: 100%; text-align: center; background: var(--primary); color: #fff; border: none; border-radius: 12px; padding: 1rem; font-size: 1.02rem; font-weight: 700; cursor: pointer; text-decoration: none; transition: background 0.15s, transform 0.1s, opacity 0.15s; }
.btn:hover { background: var(--primary-light); }
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.foot-note { text-align: center; font-size: 0.78rem; color: var(--text-light); margin-top: 0.55rem; }
.ob-skip { display: block; width: 100%; text-align: center; background: none; border: none; color: var(--text-light); font-size: 0.8rem; cursor: pointer; margin-top: 0.5rem; text-decoration: underline; }

/* centered visual steps */
.centered { align-items: center; justify-content: center; text-align: center; }
.big-emoji { font-size: 4rem; line-height: 1; margin-bottom: 1.2rem; }
.centered h2 { font-size: 1.45rem; font-weight: 800; margin-bottom: 0.6rem; line-height: 1.25; }
.centered p { color: var(--text-secondary); font-size: 0.98rem; max-width: 340px; }

/* loader intro */
.li-img { width: 150px; height: 150px; border-radius: 24px; object-fit: cover; margin-bottom: 1.4rem; box-shadow: 0 12px 36px rgba(0,0,0,0.14); }
.li-bar { width: 100%; max-width: 320px; height: 10px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: 1.4rem; }
.li-bar > div { height: 100%; width: 0%; background: var(--primary); border-radius: 99px; transition: width 0.2s linear; }
.li-pct { font-size: 0.85rem; color: var(--text-secondary); margin-top: 0.5rem; }

/* stat / graph */
/* science card (replaces the illustrative graphs) */
.sci-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem; margin: 0.5rem 0; text-align: center; }
.sci-emoji { font-size: 2.2rem; margin-bottom: 0.6rem; }
.sci-text { font-size: 0.98rem; line-height: 1.55; color: var(--text); }

/* per-day week input + steppers (app habits_week parity) */
.wk-list { margin: 0.6rem 0 0.4rem; }
.wk-row { display: flex; align-items: center; justify-content: space-between; padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.wk-row:last-child { border-bottom: none; }
.wk-day { font-weight: 600; color: var(--text-light); min-width: 3.2em; }
.wk-day.active { color: var(--text); }
.wk-ctrl { display: flex; align-items: center; gap: 0.4rem; }
.wk-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); font-size: 1.3rem; line-height: 1; color: var(--text); cursor: pointer; }
.wk-btn:active { background: var(--border); }
.wk-val { min-width: 4.6em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-total { text-align: center; font-size: 0.95rem; color: var(--text-secondary); margin-top: 0.7rem; }
.wk-total b { color: var(--text); }
.cost-wrap { margin-top: 1rem; }
.cost-wrap .wk-row { border-bottom: none; justify-content: center; gap: 1.2rem; }
.cost-wrap .wk-day { min-width: auto; font-size: 1.6rem; }

/* weekly target + reduction badge */
.tg-wrap { margin-top: 1rem; }
.tg-wrap .wk-row { border-bottom: none; justify-content: center; gap: 1.2rem; }
.tg-badge { text-align: center; font-weight: 700; color: var(--success); margin-top: 0.9rem; min-height: 1.3em; }

/* savings payoff stats */
.sv-stats { display: flex; flex-direction: column; gap: 1.4rem; align-items: center; margin: 1.6rem 0 1rem; }
.sv-val { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; text-align: center; font-variant-numeric: tabular-nums; }
.sv-lbl { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); text-align: center; margin-top: 0.15rem; }
.source-note { text-align: center; font-size: 0.72rem; color: var(--text-light); margin-top: 0.6rem; }

/* likert */
.likert-q { text-align: center; }
.likert-q .small { font-size: 0.85rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; margin-bottom: 0.8rem; }
.likert-q h2 { font-size: 1.25rem; font-weight: 800; line-height: 1.3; margin-bottom: 1.6rem; max-width: 380px; margin-left: auto; margin-right: auto; }
.likert-row { display: flex; justify-content: center; gap: 0.5rem; }
.likert-btn { width: 60px; height: 60px; border: 1.5px solid var(--border); background: var(--card); border-radius: 14px; font-size: 1.6rem; cursor: pointer; transition: border-color 0.15s, transform 0.1s; }
.likert-btn:hover { border-color: var(--primary-light); }
.likert-btn:active { transform: scale(0.92); }
.likert-ends { display: flex; justify-content: space-between; max-width: 340px; margin: 0.6rem auto 0; font-size: 0.72rem; color: var(--text-light); }

/* building */
.build-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.5rem; }
.build-row .build-label { display: flex; justify-content: space-between; font-size: 0.92rem; font-weight: 600; margin-bottom: 0.35rem; }
.build-row .build-track { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.build-row .build-fill { height: 100%; width: 0%; background: var(--primary); border-radius: 99px; transition: width 0.3s linear; }
.build-check { color: var(--success); font-weight: 800; }

/* modal popup */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,20,30,0.55); display: none; align-items: center; justify-content: center; padding: 1.25rem; z-index: 50; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 18px; padding: 1.4rem 1.25rem; width: 100%; max-width: 380px; text-align: center; }
.modal h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 1rem; }
.modal-opts { display: flex; gap: 0.75rem; }
.modal-opts button { flex: 1; border: 1.5px solid var(--border); background: var(--card); border-radius: 12px; padding: 0.9rem; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.modal-opts button:hover { border-color: var(--primary); }

/* narrative / before-after */
.narrative-text { font-size: 1rem; line-height: 1.6; color: var(--text); }
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1rem; }
.ba-col h4 { text-align: center; font-size: 1rem; margin-bottom: 0.8rem; }
.ba-item { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.9rem; padding: 0.4rem 0; }
.ba-x { color: var(--error); font-weight: 800; flex-shrink: 0; }
.ba-ck { color: var(--success); font-weight: 800; flex-shrink: 0; }

/* testimonial */
.testi-card { background: #f3f3f6; border-radius: 16px; padding: 1.4rem; text-align: center; }
.testi-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--border); margin: 0 auto 0.75rem; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; overflow: hidden; }
.testi-avatar img { width: 100%; height: 100%; object-fit: cover; }
.testi-name { font-weight: 700; }
.testi-role { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.6rem; }
.testi-quote { font-size: 0.95rem; color: var(--text); line-height: 1.55; }

/* social proof (app-parity testimonials) */
.sp-card { margin-bottom: 0.8rem; padding: 1.1rem 1.4rem; }
.sp-card .testi-quote { margin: 0.35rem 0 0.55rem; }
.sp-stars { color: #f5a623; font-size: 0.9rem; letter-spacing: 2px; }
.sp-title { font-weight: 800; margin-top: 0.15rem; }

/* info screens with a benefits list */
.info-bullets { display: inline-block; text-align: left; margin-top: 0.9rem; }

/* result / download (was paywall) */
.result h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; text-align: center; margin-bottom: 0.3rem; }
.result .r-sub { text-align: center; color: var(--text-secondary); margin-bottom: 1.2rem; }
.highlight-card { background: var(--primary); color: #fff; border-radius: 16px; padding: 1.2rem 1.4rem; margin-bottom: 1rem; text-align: center; }
.highlight-card .big { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.highlight-card .cap { font-size: 0.82rem; opacity: 0.75; margin-top: 0.3rem; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.summary-cell { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem; }
.summary-cell .lbl { font-size: 0.72rem; color: var(--text-secondary); }
.summary-cell .val { font-weight: 700; font-size: 0.92rem; margin-top: 0.15rem; }
.checklist { list-style: none; padding: 0; margin: 0.5rem 0; }
.checklist li { display: flex; gap: 0.55rem; align-items: flex-start; padding: 0.35rem 0; font-size: 0.93rem; }
.checklist .ck { color: var(--success); font-weight: 800; flex-shrink: 0; }
