[hidden] { display: none !important; }
:root {
  --bg: #f5f6f2; --surface: #fff; --ink: #1d2318; --muted: #626b5a; --line: #dde2d6;
  --brand: #4a6b2a; --brand-ink: #fff; --brand-soft: #eaf0e1; --danger: #b3261e; --ok: #2e7d32; --warn: #a15c00;
  --radius: 12px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14170f; --surface: #1d2117; --ink: #e8ecdf; --muted: #a2ab96; --line: #333a2b;
    --brand: #8fb35f; --brand-ink: #10140b; --brand-soft: #27301c; --danger: #ff8a80; --ok: #81c784; --warn: #ffb74d; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
.topbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); display: inline-block; }
.tabs { display: flex; gap: 4px; }
.tab { border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; color: var(--muted); font: inherit; cursor: pointer; }
.tab.active { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.banner { background: #fff4e0; color: #5c3b00; padding: 10px 16px; font-size: 14px; border-bottom: 1px solid #f0d9a8; }
@media (prefers-color-scheme: dark) { .banner { background: #3a2c10; color: #ffe0a3; border-color: #5a4518; } }

.banner.error { background: #fde7e5; color: #8c1d18; border-color: #f3c1bc; }
@media (prefers-color-scheme: dark) { .banner.error { background: #3d1512; color: #ffb4ab; border-color: #5c2420; } }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; list-style: none; padding: 0; margin: 4px 0 16px; counter-reset: s; }
.steps li { font-size: 13px; color: var(--muted); padding-top: 8px; border-top: 4px solid var(--line); counter-increment: s; }
.steps li::before { content: counter(s) ". "; }
.steps li.active, .steps li.complete { color: var(--ink); border-color: var(--brand); font-weight: 600; }
fieldset { border: 0; margin: 0; padding: 20px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
legend { font-size: 20px; font-weight: 700; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
legend + * { clear: both; }
.field { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
label, .label { font-size: 14px; font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.grid3 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 12px 0; }
.check input { width: 20px; min-height: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 4px; }
.seg label { padding: 10px 16px; cursor: pointer; font-weight: 500; position: relative; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--brand); color: var(--brand-ink); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: -2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); font-weight: 600; }
.plans { display: grid; gap: 10px; }
.plan { text-align: left; border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; font: inherit; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.plan[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.plan h3 { margin: 0; font-size: 17px; }
.plan .price { font-weight: 700; font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.plan p { margin: 0; color: var(--muted); font-size: 14px; grid-column: 1 / -1; }
.plan .meta { font-size: 13px; color: var(--muted); text-align: right; }
.adjust { margin: 12px 0; } .adjust summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 14px; }
.quote { background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.quote div span { display: block; font-size: 12px; color: var(--muted); } .quote div strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.review { display: grid; gap: 4px; margin-bottom: 14px; font-size: 15px; }
.review dl { display: grid; grid-template-columns: 150px 1fr; gap: 4px 12px; margin: 0; }
.review dt { color: var(--muted); } .review dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .review dl { grid-template-columns: 1fr; } .review dd { margin-bottom: 6px; } }
.sigwrap { position: relative; border: 1px dashed var(--muted); border-radius: 10px; background: #fff; }
#sigPad { width: 100%; height: 170px; display: block; touch-action: none; border-radius: 10px; }
.sigwrap .link { position: absolute; top: 6px; right: 8px; }
.link { background: none; border: 0; color: var(--brand); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 6px; }
.btn { font: inherit; font-weight: 600; border-radius: 10px; padding: 12px 18px; min-height: 46px; cursor: pointer; border: 1px solid transparent; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn:disabled { opacity: .6; cursor: progress; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; max-width: 320px; }
.error { color: var(--danger); font-size: 13px; margin: 0; min-height: 0; }
.error:empty { display: none; }
.form-error { margin-top: 12px; font-size: 14px; }
.done { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.done h2 { margin-top: 0; color: var(--ok); }
.list-head { display: flex; justify-content: space-between; align-items: center; }
.sublist { display: grid; gap: 10px; }
.sub { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 6px; }
.sub .top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sub .muted { color: var(--muted); font-size: 14px; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge.synced { background: #e3f2e4; color: #1b5e20; } .badge.failed { background: #fde7e5; color: #8c1d18; }
.badge.needs_review { background: #fff1d6; color: #7a4600; } .badge.dry { background: #ececec; color: #444; }
.sub .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.empty { color: var(--muted); text-align: center; padding: 30px; }

.combo { display: flex; gap: 6px; }
.combo input { flex: 1; min-width: 0; }
.combo select { width: 72px; flex: none; }
.paychoices { display: grid; gap: 10px; }
.paychoice { display: flex; gap: 12px; align-items: center; border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; font-weight: 400; }
.paychoice input { width: 20px; min-height: 20px; height: 20px; flex: none; accent-color: var(--brand); }
.paychoice span { display: flex; flex-direction: column; }
.paychoice small { color: var(--muted); font-size: 13px; }
.paychoice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.secure-note { background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 12px 0; }
.quote .wide { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
