:root {
  --bg: #f6f7f9; --card: #ffffff; --ink: #1c2430; --muted: #5d6b7c; --line: #dde3ea;
  --brand: #0f5c4d; --brand-ink: #ffffff; --brand-soft: #e3f1ee; --warn: #8a5300; --warn-bg: #fff4e0;
  --bad: #a31d2a; --bad-bg: #fdeaec; --ok: #12633a; --ok-bg: #e4f5ec;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11161c; --card: #1a2129; --ink: #e8edf2; --muted: #9aa8b8; --line: #2c3743;
    --brand: #4cc2a8; --brand-ink: #08201a; --brand-soft: #16312c; --warn: #f0b45a; --warn-bg: #33270f;
    --bad: #ff8a95; --bad-bg: #3a1a1e; --ok: #66d49a; --ok-bg: #12301f; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header.top { background: var(--card); border-bottom: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header.top .brand { font-weight: 700; color: var(--brand); }
header.top .who { color: var(--muted); font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 80px; }
main.wide { max-width: 1180px; }
h1 { font-size: 24px; margin: 8px 0 4px; } h2 { font-size: 19px; margin: 0 0 12px; } h3 { font-size: 16px; margin: 16px 0 6px; }
p.lead { color: var(--muted); margin-top: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 14px 0; }
label.field { display: block; font-weight: 600; margin: 14px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 14px; display: block; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
.yn { display: flex; gap: 10px; }
.yn label { position: relative; flex: 1; text-align: center; padding: 11px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--bg); font-weight: 600; }
.yn input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.yn input:checked + span { color: var(--brand-ink); }
.yn label:has(input:checked) { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.yn label:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 1px; }
button, .btn { font: inherit; font-weight: 600; padding: 11px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.danger { color: var(--bad); }
button.small, .btn.small { padding: 5px 10px; font-size: 14px; font-weight: 500; }
button:disabled { opacity: .55; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.steps { display: flex; gap: 6px; margin: 10px 0 4px; }
.steps div { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps div.done { background: var(--brand); } .steps div.now { background: var(--brand); opacity: .55; }
.steplabel { color: var(--muted); font-size: 14px; }
.banner { padding: 12px 14px; border-radius: 8px; margin: 12px 0; }
.banner.warn { background: var(--warn-bg); color: var(--warn); } .banner.bad { background: var(--bad-bg); color: var(--bad); } .banner.ok { background: var(--ok-bg); color: var(--ok); }
.slot { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 12px 0; }
.slot.done { border-color: var(--ok); }
.slot .title { font-weight: 600; } .slot .tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.tag.req { background: var(--warn-bg); color: var(--warn); } .tag.opt { background: var(--line); color: var(--muted); } .tag.ok { background: var(--ok-bg); color: var(--ok); }
.filelist { list-style: none; padding: 0; margin: 8px 0; }
.filelist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 14px; word-break: break-all; }
.filebtn { position: relative; overflow: hidden; display: inline-block; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.err { color: var(--bad); font-size: 14px; min-height: 1.2em; margin-top: 6px; }
.note { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 6px; margin: 10px 0; border-bottom: 1px solid var(--line); }
.tabs button { border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; }
.tabs button.on { border-bottom-color: var(--brand); color: var(--brand); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr.click { cursor: pointer; } tr.click:hover { background: var(--brand-soft); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 14px; cursor: pointer; }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--line); white-space: nowrap; }
.status.Submitted, .status.In-Review { background: var(--brand-soft); color: var(--brand); }
.status.Missing-Documents { background: var(--warn-bg); color: var(--warn); }
.status.Ready-for-Preparation, .status.Completed { background: var(--ok-bg); color: var(--ok); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } @media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }
dl.qa dt { font-weight: 600; margin-top: 10px; } dl.qa dd { margin: 2px 0 0; color: var(--muted); white-space: pre-wrap; }
.sr { position: absolute; left: -9999px; }

.mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; }
.narrow { max-width: 420px; margin: 40px auto; }
.stats { gap: 18px; margin: 6px 0 12px; }
input.search { max-width: 340px; }
.card.tablecard { padding: 0; overflow-x: auto; }
.stepon { font-weight: 700; color: var(--brand); } .stepoff { color: var(--muted); }

/* checklist cards */
.hh-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 8px; align-items: center; margin: 8px 0; }
.hh-row.me { grid-template-columns: 1fr; padding: 8px 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 720px) { .hh-row { grid-template-columns: 1fr; padding-bottom: 10px; border-bottom: 1px dashed var(--line); } }
.small-select, .small-input { width: auto; max-width: 100%; padding: 6px 8px; font-size: 14px; flex: 1 1 160px; }
.persontag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600; }
.warn-text { color: var(--warn); margin-top: 6px; }
button.linklike { background: none; border: none; padding: 4px 0; color: var(--brand); font-weight: 500; text-decoration: underline; }
textarea.note-area { min-height: 60px; font-size: 14px; }
.slot .row { gap: 8px; }
.sr { position: absolute; left: -9999px; }
.doc-group h3 { margin-top: 22px; }
.tag.later { background: var(--warn-bg); color: var(--warn); }

/* ===== Phone-first overrides (clients are mostly on phones) ===== */
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { font-size: 17px; line-height: 1.5; }
main { padding-bottom: 32px; }
main.has-nav { padding-bottom: 120px; }
h1 { font-size: 26px; line-height: 1.25; }
h2 { font-size: 21px; }
p.lead { font-size: 18px; }
.note { font-size: 15px; }
.hint { font-size: 15px; }

/* big, easy-to-hit controls (16px+ text also stops iPhones zooming into fields) */
button, .btn { min-height: 48px; font-size: 17px; padding: 12px 20px; border-radius: 10px; }
button.small, .btn.small { min-height: 44px; padding: 8px 14px; font-size: 16px; }
button.big, .btn.big { min-height: 58px; font-size: 19px; }
.chip { min-height: 40px; padding: 6px 14px; }
.tabs button { min-height: 44px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], select, textarea {
  min-height: 48px; font-size: 17px; padding: 12px 14px; border-radius: 10px; }
input[type=date] { -webkit-appearance: none; appearance: none; }
select { background-color: var(--bg); }
.full { width: 100%; margin-top: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack > * { width: 100%; }
.full-btn { width: 100%; }
.who-name { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Back / Continue always visible at the bottom */
.navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
.navbar-in { max-width: 760px; margin: 0 auto; display: flex; gap: 12px; }
.navbar-in > * { flex: 1; }
.navbar-in button { width: 100%; }

/* progress at the top of each step */
.progress-top { margin: 4px 0 12px; }
.steps div { height: 8px; }
.steplabel { font-size: 15px; }

/* checklist items */
.slot { background: var(--card); border-radius: 12px; padding: 16px; margin: 14px 0; }
.slot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.slot .title { font-size: 18px; font-weight: 700; }
.slot .tag { margin-left: 0; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.actions > * { flex: 1 1 160px; }
.actions button, .actions .btn { width: 100%; }
.filepick { display: block; }
.filepick button { width: 100%; }
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
progress { display: block; width: 100%; height: 12px; margin-top: 10px; accent-color: var(--brand); }
.check { display: flex; gap: 12px; align-items: center; font-weight: 600; margin-top: 12px; cursor: pointer; }
.check input { width: 26px; height: 26px; flex: none; min-height: 0; }
.step-q { display: block; font-weight: 700; font-size: 18px; margin: 20px 0 4px; }
.help { color: var(--brand); font-size: 16px; margin-top: 8px; min-height: 1.2em; }
.hint-label { display: block; font-size: 14px; color: var(--muted); margin: 2px 0 2px; }
.how { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: s; }
.how li { counter-increment: s; display: flex; gap: 14px; align-items: center; margin: 14px 0; font-size: 18px; }
.how li::before { content: counter(s); flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.filelist li { padding: 10px 0; font-size: 16px; }
textarea.note-area { min-height: 70px; font-size: 16px; }
button.linklike { min-height: 44px; font-size: 16px; }

@media (max-width: 520px) {
  main { padding: 14px 12px 28px; }
  main.has-nav { padding-bottom: 120px; }
  .card { padding: 16px; border-radius: 12px; }
  header.top { padding: 10px 12px; }
  .actions > * { flex: 1 1 100%; }
  .hh-row { gap: 10px; }
}
.check { min-height: 48px; }
html { scroll-padding-bottom: 130px; }
