/* ReadySWPPP app (UI, Nov 14 2026): checker, builder, map editor, preview, pay, ready, account.
   Phone first (375 px). Colors, radius, tap size and fonts come from tokens.css (load it first).
   Rules: one primary (yellow) action per screen; status colors only for status; 48 px tap targets; 17 px text. */

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg-soft); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
#app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
img, svg { max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
h1[tabindex="-1"]:focus, [tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
h1[tabindex="-1"]:focus-visible { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 900; background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 52px;
}
.top__brand { font-weight: 800; color: var(--brand); text-decoration: none; font-size: 1.05rem; letter-spacing: -0.01em; margin-right: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; white-space: nowrap; }
.top__brand svg { width: 22px; height: 22px; }
.top__btn {
  min-height: 40px; min-width: 44px; padding: 6px 10px; white-space: nowrap; flex: 0 0 auto; border: 1px solid var(--line); background: var(--bg);
  border-radius: 8px; color: var(--brand); font-weight: 700; font-size: .88rem; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.top__saved { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.top__saved--warn { color: var(--warn); }

/* ---------- page column ---------- */
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 16px 16px 24px; flex: 1 0 auto; }
.wrap--wide { max-width: 1100px; }

/* ---------- progress ---------- */
.progress { margin: 0 0 12px; }
.progress__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.progress__label { font-size: .85rem; font-weight: 700; color: var(--muted); }
.progress__saved { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.progress__saved--warn { color: var(--warn); font-weight: 700; }
.progress__steps { background: none; border: 0; padding: 0; min-height: 40px; color: var(--brand); font-size: .85rem; font-weight: 700; cursor: pointer; text-decoration: underline; }
.progress__bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.progress__bar > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .25s ease; }

/* ---------- screens ---------- */
.screen h1 { font-size: 1.5rem; margin: 4px 0 8px; letter-spacing: -0.01em; }
.screen h2 { font-size: 1.12rem; margin: 20px 0 8px; }
.help { color: var(--muted); margin: 0 0 16px; font-size: .95rem; }
.help--tight { margin-bottom: 8px; }
.small { font-size: .85rem; color: var(--muted); }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
  padding: 10px 18px; border-radius: var(--radius); border: 2px solid transparent; font-weight: 700;
  cursor: pointer; text-decoration: none; line-height: 1.2; text-align: center; background: var(--bg); color: var(--brand);
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: var(--ink); border-color: var(--accent); box-shadow: 0 1px 0 var(--accent-dark); }
.btn--primary:active { background: var(--accent-dark); }
.btn--ghost { border-color: var(--brand); color: var(--brand); background: var(--bg); }
.btn--plain { border-color: var(--line); color: var(--ink); background: var(--bg); }
.btn--danger { border-color: var(--bad); color: var(--bad); background: var(--bg); }
.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 40px; padding: 6px 12px; font-size: .9rem; }
.btn__sub { display: block; font-weight: 500; font-size: .85rem; }
.link {
  background: none; border: 0; padding: 0 2px; color: var(--brand); text-decoration: underline; cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; text-align: left;
}
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-top: 8px; }

/* bottom action bar of a wizard screen: stays reachable above long content */
.actions {
  position: sticky; bottom: 0; z-index: 800; background: var(--bg); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.actions__in { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.actions__in .btn--primary { flex: 1 1 auto; }
.actions__sum { flex: 0 1 auto; align-self: center; font-weight: 800; color: var(--brand-dark); font-size: .95rem; line-height: 1.15; min-width: 0; }
.actions__sum small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.actions__back { flex: 0 0 auto; }

/* ---------- choices ---------- */
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 12px 14px; text-align: left;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; color: var(--ink);
}
.opt:hover { border-color: var(--brand); }
.opt[aria-checked="true"], .opt[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.opt__dot { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); position: relative; }
.opt[aria-checked="true"] .opt__dot { border-color: var(--brand); }
.opt[aria-checked="true"] .opt__dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.opt__box { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 5px; border: 2px solid var(--muted); position: relative; }
.opt[aria-pressed="true"] .opt__box { border-color: var(--brand); background: var(--brand); }
.opt[aria-pressed="true"] .opt__box::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.opt__text { display: block; font-weight: 700; }
.opt__sub { display: block; color: var(--muted); font-size: .88rem; font-weight: 400; margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 99px; background: var(--bg);
  cursor: pointer; font-size: .92rem; color: var(--ink);
}
.chip--ex { border-radius: 10px; text-align: left; padding: 8px 12px; line-height: 1.35; }
.chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }

/* ---------- fields ---------- */
.field { display: block; margin: 0 0 14px; }
.field__label { display: block; font-weight: 700; margin-bottom: 6px; }
.field__hint { display: block; color: var(--muted); font-size: .85rem; margin-top: 4px; }
.field__err { display: block; color: var(--bad); font-size: .88rem; margin-top: 4px; font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1.5px solid #AEB7C2; border-radius: 8px;
  background: var(--bg); font-size: 17px; /* 16+ keeps iOS from zooming */
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand-soft); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input--num { max-width: 140px; text-align: right; }
.unit { color: var(--muted); font-size: .92rem; }
.search { display: flex; gap: 8px; }
.search .input { flex: 1 1 auto; min-width: 0; }

/* ---------- cards, notes ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card + .card { margin-top: 12px; }
.card__title { font-weight: 800; font-size: 1.02rem; margin: 0 0 8px; }
.note { border-radius: 8px; padding: 10px 12px; font-size: .93rem; background: var(--brand-soft); color: var(--brand-dark); }
.note--warn { background: var(--warn-soft); color: var(--warn); }
.note--bad { background: var(--bad-soft); color: var(--bad); }
.note--ok { background: var(--ok-soft); color: var(--ok); }
.note + .note { margin-top: 8px; }

/* ---------- "we found" site facts ---------- */
.found { margin-top: 14px; }
.found__title { font-weight: 800; color: var(--brand-dark); margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.facts li:first-child { border-top: 0; }
.facts__k { color: var(--muted); font-size: .85rem; padding-top: 1px; }
.facts__v { min-width: 0; overflow-wrap: anywhere; }
.facts__v strong { font-weight: 700; }
.facts__src { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.facts li.is-new { animation: factIn .35s ease both; }
@keyframes factIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.missing { color: var(--warn); font-weight: 700; }
.missing-field { display: flex; gap: 8px; margin-top: 6px; }
.missing-field .input { min-height: 44px; }
.skel {
  display: block; height: .95em; border-radius: 6px; margin: 3px 0;
  background: linear-gradient(90deg, #E5EAF0 25%, #F4F6F9 37%, #E5EAF0 63%); background-size: 400% 100%; animation: skel 1.3s ease infinite;
}
.skel--w60 { width: 60%; } .skel--w80 { width: 80%; } .skel--w40 { width: 40%; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.spin { width: 16px; height: 16px; border: 2.5px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- address candidates ---------- */
.cands { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.cand { width: 100%; text-align: left; min-height: 52px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; }
.cand:hover, .cand:focus-visible { border-color: var(--brand); }
.cand__sub { display: block; font-size: .82rem; color: var(--muted); }

/* ---------- maps ---------- */
.map { width: 100%; height: 300px; border-radius: var(--radius); border: 1px solid var(--line); background: #DDE3EA; z-index: 0; }
.map--tall { height: 45vh; min-height: 280px; }
/* phones: the tools and the drawing bar (Done) sit right under a map short enough for both to show (Ray r2) */
.editor__dock { background: var(--bg); }
.maphint { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
.map-pill {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 700; background: rgba(20,24,31,.82); color: #fff;
  font-size: .8rem; padding: 6px 10px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; pointer-events: none; white-space: nowrap;
}
.map-pill .spin { border-color: rgba(255,255,255,.35); border-top-color: #fff; width: 13px; height: 13px; }
.mapbox { position: relative; }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px; }
.rs-north { background: rgba(255,255,255,.92); border-radius: 8px; padding: 4px 6px 2px; box-shadow: 0 1px 4px rgba(0,0,0,.25); text-align: center; line-height: 1; }
.rs-north svg { width: 22px; height: 30px; display: block; margin: 0 auto; }
.rs-north span { font-size: 11px; font-weight: 800; color: var(--ink); }
.rs-legend { background: rgba(255,255,255,.95); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.25); font-size: 12px; max-width: 200px; }
.rs-legend__btn { border: 0; background: none; font-weight: 800; padding: 8px 10px; min-height: 36px; cursor: pointer; width: 100%; text-align: left; color: var(--ink); }
.rs-legend ul { list-style: none; margin: 0; padding: 0 10px 8px; max-height: 180px; overflow: auto; }
.rs-legend li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.rs-legend__sym { flex: 0 0 26px; height: 16px; display: inline-flex; align-items: center; justify-content: center; }
.rs-pin { width: 30px; height: 42px; }
.rs-mk { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); color: #fff; font-size: 12px; font-weight: 800; }
.rs-mk--sq { border-radius: 6px; }
.rs-mk--sugg { outline: 3px dashed #fff; outline-offset: 2px; }
/* round 4: a control the engine names (too much water reaches it) glows red under its line until fixed */
.rs-halo { animation: rs-halo 1.6s ease-in-out infinite; }
@keyframes rs-halo { 50% { stroke-opacity: .25; } }
.rs-flag { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #D32F2F; color: #fff; font-size: 15px; font-weight: 900; line-height: 1; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
@media (prefers-reduced-motion: reduce) { .rs-halo { animation: none; } }
.rs-vtx { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.rs-vtx--first { background: var(--accent); }
.rs-arrow-label { color: #fff; font-weight: 800; text-shadow: 0 1px 2px #000; font-size: 12px; white-space: nowrap; }

/* ---------- map editor ---------- */
.editor { display: grid; gap: 10px; }
.editor__map { position: relative; }
.editor__bar {
  margin-top: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px;
}
.editor__bar p { margin: 0; font-size: .92rem; font-weight: 600; }
.editor__bar .row .btn { flex: 1 1 0; }
.dirline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); font-size: .92rem; }
.dirline__arrow { font-size: 1.3rem; font-weight: 800; line-height: 1; }
.dirline .link { min-height: 36px; }
.toolstrip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tool { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 64px; max-width: 84px; min-height: 56px; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; color: var(--ink); }
.tool[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.tool__label { font-size: .68rem; line-height: 1.1; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tool__sym { height: 22px; display: inline-flex; align-items: center; }
.editor__below:empty { display: none; }
@media (max-width: 899px) { .editor__side .palette, .editor__side .tl__group, .editor__side > .section-title:first-child { display: none; } }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pal {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px; border: 1.5px solid var(--line);
  border-radius: 8px; background: var(--bg); cursor: pointer; text-align: left; font-size: .9rem; color: var(--ink);
}
.pal[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.pal__sym { flex: 0 0 26px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.pal__n { margin-left: auto; font-size: .78rem; color: var(--muted); }
.suggest { border: 2px dashed var(--brand); }
.featlist { list-style: none; margin: 0; padding: 0; }
.featlist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.featlist li:first-child { border-top: 0; }
/* round 4: a sediment control against the area that drains to it (the engine's sentence, a two-bar meter, buttons) */
.featlist li.need-drain { display: block; padding: 10px 0; }
.need-drain__msg { margin: 0 0 8px; font-size: .92rem; line-height: 1.4; }
.need-drain__btns { gap: 8px; }
.need-drain [data-drain-more] { margin-top: 6px; }
.meter { display: grid; gap: 4px; margin: 0 0 8px; }
.meter__row { display: grid; grid-template-columns: minmax(5.5em, auto) 1fr auto; align-items: center; gap: 8px; font-size: .85rem; }
.meter__k { color: var(--muted); }
.meter__track { height: 10px; background: var(--bg-soft); border-radius: 5px; overflow: hidden; }
.meter__bar { display: block; height: 100%; border-radius: 5px; }
.meter__bar--over { background: var(--bad); }
.meter__bar--ok, .meter__bar--limit { background: var(--ok); }
.meter__v { white-space: nowrap; font-variant-numeric: tabular-nums; }
.compass { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 56px); gap: 6px; justify-content: center; margin: 8px 0; }
.compass button { border: 1.5px solid var(--line); border-radius: 8px; background: var(--bg); font-weight: 800; cursor: pointer; }
.compass button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.compass .compass__c { border: 0; background: none; font-size: .75rem; color: var(--muted); cursor: default; }

/* ---------- calculator ---------- */
.calc { display: grid; gap: 2px; }
.calc__row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.calc__row:first-child { border-top: 0; }
.calc__row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--brand); }
.calc__name { font-weight: 700; display: block; }
.calc__typ { display: block; color: var(--muted); font-size: .8rem; }
.calc__num { display: flex; align-items: center; gap: 4px; }
.calc__num .input { width: 104px; min-height: 44px; text-align: right; padding: 6px 8px; }
.calc__total { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; font-size: 1.05rem; }
.calc__total span { display: block; font-weight: 500; font-size: .85rem; color: var(--brand-dark); }
.toggle2 { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--brand); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.toggle2 button { min-height: 44px; border: 0; background: var(--bg); color: var(--brand); font-weight: 700; cursor: pointer; padding: 6px; }
.toggle2 button[aria-pressed="true"] { background: var(--brand); color: #fff; }

/* ---------- result ---------- */
.verdict { border-radius: var(--radius); padding: 16px; background: var(--bg); border: 1px solid var(--line); border-left: 6px solid var(--brand); }
.verdict__kicker { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 4px; }
.verdict h1 { font-size: 1.45rem; margin: 0 0 8px; }
.verdict p { margin: 0 0 12px; }
.verdict--none { border-left-color: var(--ok); }
.verdict--low_erosion { border-left-color: var(--ok); }
.verdict--out { border-left-color: var(--warn); }
.verdict .btn { margin-top: 4px; }
.section-title { font-size: 1.1rem; font-weight: 800; margin: 22px 0 8px; }
.gloss { list-style: none; margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px dashed var(--line); font-size: .86rem; color: var(--muted); }
.gloss li + li { margin-top: 4px; }
.fold { margin-top: 12px; }
.fold > summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.fold__n { font-size: .75rem; font-weight: 800; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; color: var(--muted); }
.tl__note { font-size: .82rem; color: var(--warn); font-weight: 600; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines.card, .tl.card { padding: 2px 14px; }
.lines > li { padding: 10px 0; border-top: 1px solid var(--line); }
.lines > li:first-child { border-top: 0; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl-card { padding: 4px 14px 6px; }
.tl__group { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 2px; }
.tl__item { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.tl__item:first-child { border-top: 0; }
.tl__date { font-weight: 800; color: var(--brand-dark); font-size: .92rem; }
.tl__date small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
.tl__label { font-weight: 700; }
.tl__rule { color: var(--muted); font-size: .88rem; }
.cite {
  display: inline-flex; align-items: center; min-height: 32px; padding: 3px 10px; margin: 4px 6px 0 0; border-radius: 99px;
  border: 1px solid #B9D4E1; background: var(--brand-soft); color: var(--brand-dark); font-size: .8rem; font-weight: 700; cursor: pointer;
}
.cite::before { content: "§"; margin-right: 4px; opacity: .7; }
.flag { display: flex; gap: 10px; align-items: flex-start; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 800; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--info { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- bottom sheet ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(20,24,31,.5); z-index: 2000; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2001; background: var(--bg); border-radius: 16px 16px 0 0;
  max-height: 86vh; overflow: auto; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 24px rgba(0,0,0,.25);
}
.sheet__grip { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 4px auto 10px; }
.sheet__head { display: flex; align-items: flex-start; gap: 8px; }
.sheet__head h2 { font-size: 1.12rem; margin: 6px 0 8px; flex: 1 1 auto; }
.sheet__x { flex: 0 0 auto; min-width: 44px; min-height: 44px; border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
.quote { margin: 8px 0 0; padding: 10px 12px; border-left: 4px solid var(--brand); background: var(--bg-soft); font-size: .95rem; }
.quote__part { display: block; font-size: .8rem; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.cite-item + .cite-item { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 8vh; width: 600px; transform: translateX(-50%); border-radius: 16px; max-height: 84vh; }
}

/* ---------- toast ---------- */
.toast { pointer-events: none; position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3000; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 99px; font-size: .9rem; box-shadow: 0 2px 10px rgba(0,0,0,.3); max-width: calc(100% - 32px); text-align: center; }

/* ---------- builder: steps menu, lists ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li + li { border-top: 1px solid var(--line); }
.steps button { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; cursor: pointer; padding: 6px 2px; color: var(--ink); }
.steps__n { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-soft); border: 1.5px solid var(--line); font-weight: 800; font-size: .85rem; flex: 0 0 auto; }
.steps__n--done { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps__n--now { background: var(--brand); border-color: var(--brand); color: #fff; }
.person { display: flex; gap: 10px; align-items: center; }
.person__name { font-weight: 700; }
.bmp { padding: 12px 0; border-top: 1px solid var(--line); }
.bmp:first-child { border-top: 0; }
.bmp__head { display: flex; align-items: center; gap: 8px; }
.bmp__name { font-weight: 800; flex: 1 1 auto; }
.bmp__why { color: var(--muted); font-size: .9rem; margin: 4px 0 6px; }
.bmp__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .9rem; }
.more { margin-top: 10px; }
.more > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: var(--brand); font-weight: 600; font-size: .92rem; }
.more__body { padding: 6px 0 0; }
.bmp__note { margin-top: 6px; }
.bmp__note summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; color: var(--brand); font-weight: 600; }
.featlist-box summary { cursor: pointer; }
.bmp__meta .select { width: auto; min-height: 40px; padding: 4px 8px; font-size: 15px; }

/* ---------- preview ---------- */
.complete { border-radius: var(--radius); padding: 14px; background: var(--ok-soft); border: 1px solid #BFE0CB; }
.complete--no { background: var(--warn-soft); border-color: #F1D79A; }
.complete__head { font-weight: 800; font-size: 1.05rem; color: var(--ok); display: flex; gap: 8px; align-items: center; }
.complete--no .complete__head { color: var(--warn); }
.complete ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 280px; overflow: auto; }
.complete li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; padding: 4px 0; font-size: .88rem; }
.complete li b { font-weight: 700; color: var(--ink); }
.complete__tick { color: var(--ok); font-weight: 800; }
.complete__miss { color: var(--bad); font-weight: 800; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.08); padding: 18px 16px; position: relative; overflow: hidden; font-size: .92rem; }
.paper::before {
  content: attr(data-watermark); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 4.2rem; font-weight: 900; color: rgba(14,90,122,.10); transform: rotate(-28deg); pointer-events: none; letter-spacing: .08em; white-space: nowrap;
}
.paper h2 { font-size: 1.05rem; margin: 18px 0 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.paper h2:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.paper table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.paper td, .paper th { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
.paper .reqs { font-size: .72rem; color: var(--muted); }
.frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.problems li { margin: 6px 0; }

.paper details.sec { border-top: 1px solid var(--line); padding: 8px 0; position: relative; z-index: 1; }
.paper details.sec:first-of-type { border-top: 0; }
.paper summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.paper .blk { margin: 8px 0 12px; }
.paper .blk__t { font-size: .95rem; margin: 10px 0 4px; }
.paper .blk p { margin: 4px 0; }
.paper ul, .paper ol { padding-left: 20px; margin: 4px 0; }
.sigline { border-bottom: 1.5px solid var(--ink); padding: 18px 0 4px; margin: 6px 0 10px; }
.map.is-drawing { cursor: crosshair; }
.editor__main { min-width: 0; }
.editor--single { grid-template-columns: minmax(0, 1fr) !important; }
.editor--single .editor__side { display: none; }

/* ---------- pay + ready ---------- */
.pay { text-align: center; padding: 22px 16px; }
.waitlist__h { font-size: 1.5rem; margin: 4px 0 8px; }
.pay__amount { font-size: 2.6rem; font-weight: 900; letter-spacing: -0.02em; margin: 4px 0 2px; color: var(--ink); }
.pay__what { margin: 0 0 18px; color: var(--ink); }
.pay__fine { margin-top: 12px; font-size: .85rem; color: var(--muted); }
/* the Pay button with the sample beside it (Linda, Nov 14) */
.pay__row { display: flex; align-items: center; justify-content: center; gap: 8px 16px; flex-wrap: wrap; }
.pay__row .btn--primary { flex: 1 1 160px; }
.pay__sample { flex: 0 0 auto; }
/* the preview: the plan, and its price box (above it on a phone, beside it on a desktop) */
.review { display: flex; flex-direction: column; gap: 14px; }
.review__main { min-width: 0; }
.buy { padding: 16px; margin: 0; }
.buy .pay__amount { font-size: 2rem; margin: 0 0 2px; }
.buy .pay__what { margin: 0 0 12px; font-size: .95rem; }
.buy .waitlist__h { font-size: 1.15rem; }
.pkg { list-style: none; margin: 0; padding: 0; }
.pkg li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.pkg li:first-child { border-top: 0; }
.pkg__icon { flex: 0 0 36px; height: 44px; border-radius: 4px; background: var(--bad-soft); color: var(--bad); font-size: .62rem; font-weight: 900; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.pkg__name { font-weight: 700; display: block; }
.pkg__sub { font-size: .82rem; color: var(--muted); display: block; }
.pkg a.btn { margin-left: auto; flex: 0 0 auto; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.todo li:first-child { border-top: 0; }
.todo input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--ok); }
.todo__when { display: block; font-size: .85rem; color: var(--muted); }
.offer { border: 2px solid var(--brand); border-radius: var(--radius); padding: 16px; background: var(--bg); }
.offer h2 { margin: 0 0 6px; font-size: 1.2rem; }
.consent { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; font-size: .9rem; margin: 12px 0; }
.consent input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--brand); }

/* ---------- account ---------- */
.plans { list-style: none; margin: 0; padding: 0; }
.plans li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.plans li:first-child { border-top: 0; }
.plans__name { font-weight: 700; display: block; }
.plans__sub { display: block; font-size: .85rem; color: var(--muted); }
.plans .btn { margin-left: auto; flex: 0 0 auto; }

/* ---------- footer ---------- */
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px 16px 24px; border-top: 1px solid var(--line); background: var(--bg); }
.foot a { color: var(--muted); margin: 0 6px; }
.foot p { margin: 4px 0; }
.foot__census { font-size: .72rem; max-width: 560px; margin: 6px auto 0 !important; }

/* ---------- wider screens ---------- */
@media (min-width: 900px) {
  .wrap { padding-top: 28px; }
  .screen h1 { font-size: 1.75rem; }
  .map { height: 380px; }
  .editor { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .toolstrip { display: none; } /* desktops: the full palette sits beside the map */
  .editor__side { max-height: calc(100vh - 140px); overflow: auto; }
  .map--tall { height: calc(100vh - 170px); }
  .actions { position: static; border-top: 0; background: transparent; padding: 18px 0 0; }
  /* the bar keeps to the content column, and its main button to a sensible width */
  .actions__in { max-width: 560px; padding: 0 16px; }
  .actions--wide .actions__in { max-width: 1100px; }
  .actions__in .btn--primary { flex: 0 1 auto; min-width: 220px; margin-left: auto; }
  .review { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
  .review--one { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
  .review > .buy { grid-column: 2; grid-row: 1; position: sticky; top: 76px; }
  .review > .review__main { grid-column: 1; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .skel, .spin { animation: none; }
  .facts li.is-new { animation: none; }
  .progress__bar > span { transition: none; }
}

/* Stage 1: "checkout opens soon" (site/static/js/launch-note.js) above the app; hidden unless checkout is closed */
.launch-note { background: var(--brand-soft); color: var(--brand-dark); border-bottom: 1px solid rgba(10, 63, 86, .12); padding: 8px max(16px, env(safe-area-inset-left, 0px)); margin: 0; font-size: .9rem; line-height: 1.35; text-align: center; }
.launch-note[hidden] { display: none; }
