/* Policy Lens v3 — new design (Figma "Policy lens final flow 2").
   Loaded after styles.css: tokens + shell + the screens that changed. */
:root {
  --brand: #6C3FB5;          /* primary buttons */
  --brand-700: #5A2FA0;
  --brand-900: #452075;      /* logo, headings on light */
  --ink-900: #311042;        /* big headlines */
  --ink: #1B1230;
  --muted: #6B6578;
  --line: #E8E3F0;
  --hl: #FFDA46;             /* highlighter yellow */
  --hl-soft: #FFF3C2;
  --ok: #1FA45B;
  --bg-top: #F8F3FE;
  --bg-bot: #FFFBED;
  --radius: 20px;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, #FBF8F3 55%, var(--bg-bot) 100%) fixed;
  min-height: 100vh; display: flex; flex-direction: column;
}
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url('grid.svg') center bottom / cover no-repeat; }

/* ---------- header ---------- */
.topbar { background: rgba(255,255,255,.92); backdrop-filter: blur(6px); color: var(--ink); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar .in { max-width: 1440px; padding: 0 32px; height: 74px; gap: 12px; }
.brand { gap: 12px; font-weight: 700; font-size: 22px; color: var(--brand-900); letter-spacing: -.01em; }
.brand svg { width: 36px; height: 36px; }
.brand .by { font-weight: 600; font-size: 12px; color: #C9780A; letter-spacing: .08em; text-transform: uppercase; margin-left: 2px; align-self: flex-end; padding-bottom: 5px; }
.brand .by b { color: inherit; font-weight: inherit; }
.brand-link { background: none; border: 0; padding: 0; cursor: pointer; display: flex; align-items: center; gap: 12px; font-family: inherit; }
.topbar .ghost, .btn-hdr {
  background: #fff; color: var(--brand-900); border: 2px solid var(--brand-900); border-radius: 10px;
  padding: 9px 22px; font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit;
}
.topbar .ghost:hover, .btn-hdr:hover { background: var(--brand-900); color: #fff; }

/* ---------- stepper ---------- */
.stepbar { background: #fff; border-bottom: 1px solid var(--line); }
.stepbar ol { list-style: none; margin: 0 auto; padding: 0 24px; max-width: 1180px; height: 74px; display: flex; align-items: center; gap: 14px; justify-content: center; }
.stepbar li { display: flex; align-items: center; gap: 10px; color: #6B6578; font-size: 15px; font-weight: 500; white-space: nowrap; }
.stepbar li .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #BDBAC4; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.stepbar li.on { color: var(--brand-900); font-weight: 700; }
.stepbar li.on .n { background: var(--brand); box-shadow: 0 0 0 3px rgba(108,63,181,.18); }
.stepbar li.done { color: var(--ok); }
.stepbar li.done .n { background: var(--ok); }
.stepbar .ln { flex: 1 1 40px; min-width: 24px; max-width: 320px; height: 2px; background: #C9C6D0; border-radius: 2px; }
.stepbar .ln.on { background: var(--brand); }
.stepbar .ln.done { background: var(--ok); }

/* ---------- stage + cards ---------- */
.stage { max-width: 1440px; padding: 0 24px 64px; margin: 0 auto; flex: 1; width: 100%; }
.stage.pad { padding-top: 64px; }
.dcard { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 24px 60px -34px rgba(69,32,117,.35); margin: 0 auto; padding: 48px 56px; max-width: 700px; }
.dcard.w-md { max-width: 760px; } .dcard.w-lg { max-width: 900px; } .dcard.w-sm { max-width: 600px; }
.dcard h2 { font-size: 30px; font-weight: 700; line-height: 1.2; margin: 0 0 10px; color: var(--ink-900); letter-spacing: -.01em; }
.dcard .sub { color: #4F4860; font-size: 16px; margin: 0 0 26px; }
.dcard .sub b { color: var(--ink); }
.dcard .foot-note { text-align: center; font-size: 13px; color: var(--muted); margin: 18px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); color: var(--brand-900); font-size: 13px; font-weight: 600; border-radius: 999px; padding: 6px 14px; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-900); display: inline-block; }
.pill.yellow { background: var(--hl); border-color: var(--hl); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.pill.yellow i { background: var(--ink-900); }
.pill.lav { background: #EEE9FB; border-color: #EEE9FB; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }

/* ---------- buttons + inputs ---------- */
.btn { border-radius: 12px; font-weight: 600; font-family: inherit; cursor: pointer; transition: transform .06s, background .15s, box-shadow .15s; }
.btn.primary { background: var(--brand); color: #fff; border: 1px solid var(--brand); padding: 17px 22px; font-size: 17px; }
.btn.primary:hover { background: var(--brand-700); }
.btn.primary:active { transform: translateY(1px); }
.btn.primary[disabled] { opacity: .5; cursor: not-allowed; }
.btn.outline { background: #fff; color: var(--ink); border: 1.5px solid var(--line); padding: 16px 22px; font-size: 17px; }
.btn.outline:hover { border-color: var(--brand); color: var(--brand); }
.btn.dark-outline { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.btn.block { display: block; width: 100%; }
.btn.sm { padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.btn.link { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 600; text-decoration: none; }
.actions { display: flex; gap: 16px; margin-top: 26px; }
.actions .btn { flex: 1; }
.actions .btn:first-child:last-child { flex: 1; }
.actions.split-1-2 .btn:first-child { flex: 1; } .actions.split-1-2 .btn:last-child { flex: 1.15; }

.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 8px; color: var(--ink); }
.input, select.input, textarea.input {
  width: 100%; background: #fff; border: 1px solid #E4DFEC; border-radius: 12px; padding: 17px 18px; font-size: 17px; color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 1px 2px rgba(69,32,117,.04); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #8C8798; letter-spacing: .04em; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(108,63,181,.14); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23444' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 42px; }
.err { color: #C2413A; font-size: 14px; margin-top: 8px; min-height: 0; }
.err:empty { display: none; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.with-icon { position: relative; }
.with-icon > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #5E5870; pointer-events: none; }
.with-icon .input { padding-left: 46px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #4F4860; margin: 6px 0 20px; }
.chk input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); }
.chk a { color: var(--brand); font-weight: 600; }
.or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- landing ---------- */
.land { max-width: 1120px; margin: 0 auto; padding: 56px 24px 40px; }
.land .pill { margin-bottom: 34px; }
.legalese { position: relative; font-size: 17px; line-height: 1.45; color: rgba(79,72,96,.38); max-width: 900px; margin: 0; }
.legalese mark { background: var(--hl-soft); color: var(--ink); font-weight: 600; padding: 1px 4px; border-radius: 3px; }
.land h1 { font-size: clamp(38px, 6.2vw, 70px); line-height: 1.04; font-weight: 800; color: var(--ink-900); letter-spacing: -.03em; margin: 22px 0 22px; }
.land h1 mark { background: var(--hl); color: inherit; padding: 0 12px; border-radius: 4px; display: inline-block; margin-top: 4px; }
.land .lead { font-size: 18px; max-width: 640px; color: var(--ink); margin: 38px 0 32px; }
.land .cta { display: flex; gap: 16px; flex-wrap: wrap; }
.land .cta .btn { padding: 17px 32px; font-size: 17px; }
.land .stats { display: flex; margin-top: 52px; padding-top: 30px; border-top: 1px solid #CFCAD8; max-width: 900px; }
.land .stat { padding: 0 34px; border-left: 1px solid #CFCAD8; background: none; box-shadow: none; border-radius: 0; min-width: 0; }
.land .stat:first-child { border: 0; padding-left: 0; }
.land .stat b { font-size: 38px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.land .stat:nth-child(2) b { color: var(--brand); }
.land .stat span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin-top: 4px; }

/* ---------- journey choice ---------- */
.choose { max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 36px 32px; box-shadow: 0 24px 60px -34px rgba(69,32,117,.3); }
.choose h2 { font-size: 30px; margin: 0 0 8px; color: var(--ink-900); }
.choose .sub { color: #4F4860; margin: 0 0 24px; }
.opt-card { border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; margin-bottom: 16px; background: #fff; }
.opt-card .oh { display: flex; gap: 16px; align-items: flex-start; }
.opt-card .oi { width: 44px; height: 44px; border-radius: 12px; background: #F1ECFA; color: var(--brand); display: grid; place-items: center; flex: none; }
.opt-card h3 { margin: 0 0 4px; font-size: 18px; color: var(--ink); }
.opt-card p { margin: 0 0 14px; color: #5A5368; font-size: 14.5px; }
.opt-card .btn { width: 100%; margin-top: 8px; }
.trust { text-align: center; color: #4F4860; font-size: 13px; margin: 26px 0 0; }
.trust b { color: var(--ink); font-weight: 600; }
.trust .ok { color: var(--ok); }
.trust small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------- family chips ---------- */
.famrow { display: flex; flex-wrap: wrap; gap: 12px; }
.fchip { display: inline-flex; align-items: center; gap: 10px; background: #EEEBFB; border: 1px solid #E1DCF6; border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.fchip b { font-weight: 600; } .fchip .ag { color: #6B6578; font-size: 13px; }
.fchip input { width: 54px; border: 0; background: #fff; border-radius: 6px; padding: 6px 8px; font-size: 14px; text-align: center; font-weight: 600; }
.fchip button { background: none; border: 0; cursor: pointer; color: #444; font-size: 16px; padding: 0; line-height: 1; }
.addchip { border: 1.5px dashed #6B6578; background: transparent; border-radius: 10px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--ink); }
.addchip:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- analysing ---------- */
.anl { max-width: 640px; margin: 0 auto; text-align: center; }
.anl .big { width: 120px; height: 120px; border-radius: 28px; background: #fff; border: 1px solid var(--line); margin: 0 auto 26px; display: grid; place-items: center; box-shadow: 0 20px 50px -26px rgba(69,32,117,.45); position: relative; }
.anl .big .cnt { position: absolute; right: -52px; top: -12px; background: var(--hl); border-radius: 12px; padding: 6px 12px; font-size: 12px; font-weight: 700; color: var(--ink-900); line-height: 1.15; text-align: left; }
.anl .big .cnt b { display: block; font-size: 20px; }
.anl h2 { margin: 0 0 6px; font-size: 28px; color: var(--ink-900); }
.anl .sub { color: #5A5368; margin: 0 0 24px; }
.anl ul { list-style: none; padding: 0; margin: 0 auto 22px; display: grid; gap: 0; text-align: left; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.anl li { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #F1EDF6; font-size: 15px; color: var(--ink); }
.anl li:last-child { border: 0; }
.anl li .st { margin-left: auto; font-size: 13px; font-weight: 600; color: #6B6578; }
.anl li.done .st { color: var(--ok); }
.anl li .dot { width: 22px; height: 22px; border-radius: 50%; background: #E9E5F0; flex: none; display: grid; place-items: center; }
.anl li.done .dot { background: var(--ok); color: #fff; }
.anl li.run .dot { border: 3px solid #E4DCF6; border-top-color: var(--brand); background: transparent; animation: spin 0.9s linear infinite; }
.anl .legal { color: var(--muted); font-size: 12.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- footer ---------- */
.foot { max-width: 760px; margin: 0 auto; padding: 26px 24px 34px; text-align: center; color: #6B6578; font-size: 12.5px; background: none; border: 0; }

/* ---------- responsive shell ---------- */
@media (max-width: 860px) {
  .topbar .in { padding: 0 16px; height: 60px; }
  .brand { font-size: 18px; } .brand svg { width: 30px; height: 30px; }
  .brand .by { display: none; }
  .stage { padding: 0 14px 90px; } .stage.pad { padding-top: 20px; }
  .dcard { padding: 28px 20px; border-radius: 20px; }
  .dcard h2 { font-size: 24px; }
  .stepbar ol { height: 56px; padding: 0 14px; gap: 8px; justify-content: flex-start; overflow-x: auto; }
  .stepbar li { font-size: 13px; } .stepbar li .n { width: 24px; height: 24px; }
  .stepbar li:not(.on) span { display: none; } .stepbar .ln { min-width: 14px; }
  .land { padding: 28px 18px 24px; }
  .legalese { font-size: 13.5px; }
  .land .lead { font-size: 16px; margin: 24px 0 22px; }
  .land .cta .btn { flex: 1 1 100%; text-align: center; }
  .land .stat { padding: 0 16px; } .land .stat b { font-size: 28px; } .land .stat span { font-size: 10px; }
  .choose { padding: 24px 18px; border-radius: 20px; }
  .actions { flex-direction: column-reverse; gap: 10px; }
}

/* ---- form/upload bits from final flow ---- */
.dcard h2.q { font-size: 28px; color: var(--ink-900); margin: 6px 0 18px; letter-spacing: -.01em; }
.dcard .sub { color: #5A5368; margin: -6px 0 20px; }
.input.lg { height: 74px; font-size: 18px; padding: 0 28px; letter-spacing: .02em; }
.dcard .btn.block { width: 100%; height: 64px; font-size: 18px; border-radius: 14px; }
.dcard .dropzone { border: 2px dashed #CDBEEA; background: #FBF9FF; border-radius: 18px; padding: 44px 16px; cursor: pointer; }
.dcard .dropzone:hover, .dcard .dropzone.over { background: #F3ECFC; border-color: var(--brand); }
.dcard .dropzone b { color: var(--ink-900); }
.dcard .actions { display: flex; gap: 12px; justify-content: space-between; margin-top: 22px; }
.dcard .actions .btn { flex: 1; }
.dcard .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* family checklist (step 3) */
.dcard h2.q.c { text-align: center; }
.dcard .sec { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #ECE7F3; margin: 22px 0 10px; padding-bottom: 8px; }
.dcard .sec h4 { margin: 0; font-size: 16px; color: var(--ink-900); } .dcard .sec span { font-size: 12px; color: #6B6578; }
.mrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #ECE7F3; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.mrow .chk { display: flex; gap: 12px; align-items: center; cursor: pointer; } .mrow .chk input { width: 18px; height: 18px; accent-color: #1AA365; }
.mrow b { font-size: 14px; color: var(--ink-900); } .mrow small { display: block; font-size: 12px; color: #6B6578; }
.mrow .pill { font-style: normal; background: #EEE7FA; color: var(--brand-900); border-radius: 99px; padding: 2px 10px; font-size: 11px; margin-left: 8px; }
.mrow .age { width: 96px; height: 40px; text-align: center; font-weight: 700; padding: 0 8px; }
.mrow.col { display: block; } .mrow .top { display: flex; justify-content: space-between; align-items: center; }
.mrow .step { display: inline-flex; align-items: center; gap: 14px; border: 1px solid #ECE7F3; border-radius: 10px; padding: 6px 12px; }
.mrow .step button { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--ink-900); }
.mrow .kid { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #F1EDF6; margin-top: 10px; padding-top: 10px; font-size: 13px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .two .mrow { margin: 0; }
.fine { margin-top: 18px; border-top: 1px solid #ECE7F3; padding-top: 12px; } .fine summary { cursor: pointer; font-weight: 700; color: var(--brand-900); margin-bottom: 10px; }
.amber { color: #D07A00; font-weight: 700; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }

/* report polish to match design */
#app > .report, .report { max-width: 1200px; margin-inline: auto; }
.section-title h3 { color: var(--ink-900); font-size: 26px; letter-spacing: -.01em; }
.expert-strip { background: #fff; border: 1px solid #E8E1F3; border-radius: 16px; }
.pill-y { display: inline-block; background: var(--hl); color: var(--brand-900); font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 4px 12px; border-radius: 99px; }

/* ---------- mSite / app ---------- */
.mcards { display: none; }
@media (max-width: 700px) {
  .mcards { display: grid; gap: 14px; }
  body:not(.show-full) .table-wrap { display: none; }
  body.show-full .mcards .mcard { display: none; }
  .mcard { background: #fff; border: 1px solid #E8E1F3; border-radius: 18px; padding: 16px; }
  .mcard.mine { border-color: var(--brand); }
  .mcard header small { color: #6B6578; } .mcard h4 { margin: 2px 0 8px; font-size: 18px; color: var(--ink-900); }
  .mcard .ms { display: inline-block; background: var(--hl); color: var(--brand-900); font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 99px; }
  .mk { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #F1EDF6; font-size: 13.5px; }
  .mk span { color: #6B6578; flex: none; max-width: 42%; } .mk b { font-weight: 600; text-align: right; }
  .mk.k b { color: var(--ink-900); }
  .mcard details summary { cursor: pointer; color: var(--brand); font-weight: 700; padding: 10px 0; }
  .mcard .th-act { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
  .mcard .cell { display: block; }
  .full-tbl { width: 100%; }
  .table-wrap { overflow-x: auto; }
  .site-header, header.hdr { padding-inline: 16px; }
  .stage.pad { padding: 18px 14px 96px; }
  .dcard { padding: 22px 18px; border-radius: 18px; }
  .dcard h2.q { font-size: 23px; }
  .input.lg { height: 60px; }
  .stepbar ol { gap: 6px; overflow-x: auto; } .stepbar li.ln { display: none; } .stepbar li span:last-child { font-size: 12px; }
}
/* bottom tab bar (installed app / phone) */
.tabbar { display: none; }
@media (max-width: 700px) {
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid #E8E1F3; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar button { background: none; border: 0; display: grid; gap: 2px; justify-items: center; font: 600 11px 'Public Sans', sans-serif; color: #6B6578; padding: 6px 12px; cursor: pointer; }
  .tabbar button.on { color: var(--brand); }
  .tabbar svg { width: 22px; height: 22px; }
  .foot { padding-bottom: 80px; }
}
@media (max-width: 700px) { .voice-fab { bottom: calc(84px + env(safe-area-inset-bottom)) !important; } }

/* one-question-at-a-time choices */
.mcq { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 8px; }
.mcq-opt { position: relative; border: 1.5px solid #DCD2EE; background: #fff; border-radius: 14px; padding: 18px 12px; font: 700 17px 'Public Sans', sans-serif; color: var(--ink-900); cursor: pointer; transition: .15s; }
.mcq-opt:hover, .mcq-opt:focus-visible { border-color: var(--brand); background: #F7F2FD; transform: translateY(-1px); }
.mcq-opt.on { border-color: var(--brand); background: #EFE6FB; }
.mcq-opt .rec { display: block; font-style: normal; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: #8a5b00; background: var(--hl); border-radius: 99px; padding: 2px 8px; margin: 6px auto 0; width: max-content; }
.orline { display: flex; align-items: center; gap: 14px; margin: 14px 0; color: #8b8498; font-size: 13px; }
.orline::before, .orline::after { content: ''; flex: 1; height: 1px; background: #E6DFF1; }
.input.sel { padding-right: 40px; }

/* grouped comparison table */
.grp-tools { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 8px; font-size: 13px; color: #6B6578; }
table.cmp tr.grp { cursor: pointer; background: #F6F1FC; }
table.cmp tr.grp:hover { background: #EFE6FB; }
table.cmp tr.grp > th { text-align: left; padding: 16px 14px; color: var(--ink-900); font-size: 15px; font-weight: 700; }
table.cmp tr.grp small { display: block; font-weight: 400; font-size: 12px; color: #6B6578; margin: 2px 0 0 22px; }
table.cmp tr.grp .chev { display: inline-block; width: 18px; transition: transform .15s; color: var(--brand); }
table.cmp tr.grp.open .chev { transform: rotate(90deg); }
table.cmp tr.grp td.gsum { font-size: 13px; font-weight: 600; color: var(--brand-900); vertical-align: middle; }
table.cmp tr.grp.open td.gsum { visibility: hidden; }
table.cmp tr.grow[hidden] { display: none; }
.mcard details { border-top: 1px solid #F1EDF6; } .mcard details summary em { font-style: normal; background: #EFE6FB; color: var(--brand-900); border-radius: 99px; padding: 1px 8px; font-size: 11px; margin-left: 6px; }
@media (max-width: 700px) { body:not(.show-full) .grp-tools { display: none; } }
