/* IRS System UI. Follows docs/DESIGN.md: mobile-first, brand blue #1000FF, max width 640px. */
:root {
  --brand: #1000FF;
  --brand-dark: #0a00a8;
  --brand-tint: #E9E8FF;
  --bg: #F4F4F8;
  --card: #FFFFFF;
  --border: #D6D6E4;
  --divider: #E6E6EF;
  --text: #12122A;
  --muted: #5B5D78;
  --good: #1F7A48;   --good-bg: #DFF1E6;
  --warn: #A46500;   --warn-bg: #FBEFD4;
  --bad: #B4302A;    --bad-bg: #F9E0DD;
  --neutral: #5B5D78; --neutral-bg: #EBEBF2;
  --plate-bg: #0E0E14; --plate-text: #F5F5F0;
  --font-head: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; font-family: var(--font-body); font-size: 14px; line-height: 1.45;
  background: var(--bg); color: var(--text);
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2 { font-family: var(--font-head); text-transform: uppercase; margin: 0; }
code { background: var(--brand-tint); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

/* ---- page frame: one centred column, bottom nav below ---- */
.app { max-width: 640px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.main { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.has-nav .main { padding-bottom: 96px; }   /* room for the fixed bottom nav */

/* ---- header band ---- */
.band { background: var(--brand); color: #fff; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.band-row { display: flex; align-items: center; gap: 12px; }
.band-logo { height: 60px; width: auto; flex: none; display: block; }  /* enlarged at Andrew's request (mockup was 40px) */
.page-login .band-logo { height: 76px; }
@media (max-width: 380px) { .band-logo { height: 52px; } .page-login .band-logo { height: 64px; } }
.band-mark { font-family: var(--font-head); font-weight: 700; font-size: 24px; letter-spacing: .05em; }
.band-text { flex: 1; min-width: 0; border-left: 1px solid rgba(255, 255, 255, .35); padding-left: 12px; }
.band-title { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: .03em; text-transform: uppercase; line-height: 1; }
.band-title.big { font-size: 26px; }
.band-sub { font-size: 12px; opacity: .85; margin-top: 3px; }
.band-chip { font-size: 12px; background: rgba(255, 255, 255, .16); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .14); color: #fff;
  display: grid; place-items: center; position: relative; cursor: pointer; text-decoration: none;
}
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: #FFB020; border: 2px solid var(--brand); }

.counters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.counter { background: rgba(255, 255, 255, .12); border-radius: 10px; padding: 8px 6px; text-align: center; }
.counter b { display: block; font-family: var(--font-head); font-weight: 700; font-size: 24px; line-height: 1; }
.counter span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; opacity: .85; margin-top: 3px; }
.counter.hi { background: #fff; color: var(--brand); }
.counter.hi span { opacity: 1; font-weight: 600; }

/* ---- sections, cards, rows ---- */
.section { display: flex; flex-direction: column; gap: 8px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.section-head h2 { font-size: 19px; letter-spacing: .04em; }
.section-head span { font-size: 12px; color: var(--muted); }
.section-head a { font-size: 13px; font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.row { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid var(--divider); align-items: center; }
.row:last-child { border-bottom: 0; }
.stripe { width: 8px; align-self: stretch; border-radius: 4px; background: var(--neutral); }
.stripe.red { background: var(--bad); } .stripe.amber { background: var(--warn); }
.row-body { flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-detail { font-size: 12px; color: var(--muted); }
.row-age { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row-link { font-size: 13px; font-weight: 600; text-decoration: none; padding: 10px 4px; }
.empty { padding: 16px 12px; color: var(--muted); }

.pill {
  display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px; color: var(--neutral); background: var(--neutral-bg);
}
.pill.good { color: var(--good); background: var(--good-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }

.plate {
  display: inline-block; background: var(--plate-bg); color: var(--plate-text); font-family: var(--font-head);
  font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .08em; padding: 0 8px; border-radius: 4px;
}
.pill.brand { color: var(--brand); background: var(--brand-tint); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile-num { font-family: var(--font-head); font-weight: 700; font-size: 30px; }
.tile-num small { font-size: 15px; color: var(--muted); font-weight: 600; }
.tile-num.bad { color: var(--bad); }

.people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 8px; }
.person { text-align: center; }
.person b { display: block; font-weight: 600; }
.person span { font-size: 12px; color: var(--good); }
.person span.no { color: var(--bad); }

/* ---- buttons and forms ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font: 600 15px var(--font-body); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn.secondary { background: #fff; color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #8E2420; border-color: #8E2420; }
.danger-zone { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--divider); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  font: 400 16px var(--font-body); color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.alert { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.alert.bad { color: var(--bad); background: var(--bad-bg); }
.alert.good { color: var(--good); background: var(--good-bg); }

.signed-in { text-align: center; font-size: 12px; color: var(--muted); }
.signed-in form { display: inline; }
.link-btn { background: none; border: 0; padding: 8px 4px; color: var(--brand); font: 600 12px var(--font-body); cursor: pointer; }

/* ---- bottom nav ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 640px;
  background: #fff; border-top: 1px solid var(--border); display: grid; padding: 6px 4px 18px; z-index: 10;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0;
  text-decoration: none; color: var(--muted); font-size: 11px;
}
.bottom-nav a.active { color: var(--brand); font-weight: 600; }

/* ---- stock list ---- */
.search { display: flex; align-items: center; gap: 8px; background: #fff; color: var(--muted); border-radius: 12px; padding: 0 12px; height: 44px; }
.search input { border: 0; outline: 0; flex: 1; font: inherit; font-size: 15px; color: var(--text); background: transparent; min-width: 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 999px;
  padding: 7px 12px; font: 500 13px var(--font-body); text-decoration: none; white-space: nowrap;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.list-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.list-meta select { border: 0; background: transparent; color: var(--muted); font: inherit; padding: 4px 0; }
.cars { display: flex; flex-direction: column; gap: 10px; }
.car-card {
  text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px;
}
.car-photo {
  position: relative; width: 72px; height: 72px; border-radius: 10px; background: #E6E6F2; color: #8A8CA8;
  display: grid; place-items: center; overflow: hidden;
}
.car-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.car-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.car-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.car-title { font-weight: 600; }
.car-price { font-family: var(--font-mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.bar-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); }
.bar { height: 5px; border-radius: 3px; background: var(--divider); overflow: hidden; }
.bar.floor { height: 6px; }
.bar > span { display: block; height: 100%; border-radius: 3px; background: var(--good); }
.bar.amber > span { background: var(--warn); }
.bar.red > span { background: var(--bad); }
.bar-meta.red { color: var(--bad); font-weight: 600; }
.bar-meta.amber { color: var(--warn); }
.flags { display: flex; gap: 5px; flex-wrap: wrap; font-size: 11.5px; }
.flag { padding: 2px 7px; border-radius: 4px; color: var(--neutral); background: var(--neutral-bg); }
.flag.good { color: var(--good); background: var(--good-bg); }
.flag.warn { color: var(--warn); background: var(--warn-bg); }
.flag.bad { color: var(--bad); background: var(--bad-bg); font-weight: 600; }
.fab {
  position: sticky; bottom: 92px; align-self: flex-end; margin-top: auto; background: var(--brand); color: #fff;
  text-decoration: none; border-radius: 999px; padding: 14px 20px; font-weight: 600; display: flex;
  align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(16, 0, 255, .35);
}
.fab:hover { color: #fff; background: var(--brand-dark); }

/* ---- car detail ---- */
.car-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.back { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 4px; padding: 10px 0; font-size: 14px; }
.back:hover { color: #fff; }
.back.edit { justify-content: flex-end; font-weight: 600; }
.car-head { display: flex; align-items: center; gap: 12px; }
.car-head-text { min-width: 0; }
.car-head-title { font-weight: 600; font-size: 16px; }
.plate.big { font-size: 30px; padding: 2px 12px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.strip a {
  flex: none; width: min(78%, 300px); height: 200px; border-radius: 12px; overflow: hidden; scroll-snap-align: start;
  background: #E6E6F2; border: 1px solid var(--border);
}
.strip a img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip a.broken img { display: none; }
.geran-missing { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stagebar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.seg { height: 6px; border-radius: 3px; background: var(--divider); }
.seg.done { background: var(--brand); opacity: .45; }
.seg.now { background: var(--brand); }
.stage-labels { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.stage-labels .now { color: var(--brand); font-weight: 600; }
.switches { padding: 2px 12px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--divider); }
.switch:last-child { border-bottom: 0; }
.switch input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.switch-warn { display: block; font-size: 12px; color: var(--bad); }
.switch-note { display: block; font-size: 12px; color: var(--muted); }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.details .mono { font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; }
.details .span-all { grid-column: 1 / -1; }
.bad-text { color: var(--bad); }

/* ---- add car wizard ---- */
.has-bar .main { padding-bottom: 110px; }
.progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; font-size: 11px; }
.pstep { display: flex; flex-direction: column; gap: 5px; opacity: .75; }
.pstep span { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); }
.pstep.done span { background: #fff; }
.pstep.cur { font-weight: 600; opacity: 1; }
.banner { display: flex; gap: 12px; align-items: center; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.35; }
.scanned-banner { background: var(--brand-tint); }
.warn-banner { background: var(--warn-bg); color: var(--warn); }
.plain-banner { background: var(--neutral-bg); color: var(--muted); }
.banner-icon { width: 56px; height: 40px; flex: none; border-radius: 6px; background: #fff; border: 1px solid #C9C6FF; display: grid; place-items: center; color: var(--brand); }
.wizard-card { display: flex; flex-direction: column; gap: 11px; padding: 14px; }
.wfield { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; min-width: 0; }
.wfield .hint, .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.wfield input, .wfield select, .wfield textarea {
  font: 16px var(--font-body); padding: 10px 12px; border: 1px solid var(--border); background: #fff;
  border-radius: 10px; color: var(--text); min-width: 0; width: 100%;
}
.wfield input.mono, input.mono { font: 500 15px var(--font-mono); letter-spacing: .03em; }
.wfield input.scanned { border-color: var(--brand); background: var(--brand-tint); }
.wfield input.edited { border-color: var(--warn); background: var(--warn-bg); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.segmented label { display: block; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 11px; background: var(--bg); font-weight: 500; cursor: pointer; }
.segmented input:checked + span { background: var(--brand); color: #fff; font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
.group { border: 1px solid var(--divider); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.plain:disabled .wfield { color: var(--muted); }
.plain:disabled input { background: var(--divider); color: var(--muted); cursor: not-allowed; }
.group legend { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 4px; }
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 0 0 10px; }
.notice svg { flex: none; margin-top: 1px; }
.notice.good { background: var(--good-bg); color: var(--good); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.wizard-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 640px; z-index: 10;
  background: #fff; border-top: 1px solid var(--border); padding: 10px 16px 22px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.wizard-bar.single { grid-template-columns: 1fr; }
.wizard-bar .btn { height: 48px; }
.inline-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.photo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.grow { flex: 1; min-width: 0; }
.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: #E6E6F2; display: block; }
.pdf-tile { width: 72px; height: 72px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); display: grid; place-items: center; font-weight: 700; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
.photo-cell { position: relative; display: flex; flex-direction: column; gap: 2px; }
.photo-cell .thumb { width: 100%; height: auto; aspect-ratio: 1; }
.cover-pill { position: absolute; top: 4px; left: 4px; }
.photo-actions { display: flex; justify-content: space-between; }
.photo-actions form { margin: 0; }
.link-btn.danger { color: var(--bad); }
.review .car-line { margin-bottom: 4px; }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 10px 0 0; }
.summary dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.summary dd { margin: 0; overflow-wrap: anywhere; }
.summary .mono { font-family: var(--font-mono); font-size: 13px; }

/* ---- setup page (before Google is connected) ---- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 8px 0; border-bottom: 1px solid var(--divider); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { display: inline-block; width: 1.4em; font-weight: 700; }
.checklist .ok .tick { color: var(--good); }
.checklist .todo .tick { color: var(--warn); }
.note { margin: 12px 0 4px; }
.note-list { margin: 0; padding-left: 20px; color: var(--muted); }
.error { color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.card h1, .card h2 { color: var(--text); margin-bottom: 8px; }
/* Privacy Policy (D45): plain reading text */
.prose h2 { font-size: 17px; letter-spacing: .03em; margin-top: 16px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { line-height: 1.5; overflow-wrap: anywhere; }
.prose ul { padding-left: 20px; margin: 8px 0; }

/* ---- prospects (docs/design/Prospects.html, D46) ---- */
.due-card { display: flex; align-items: center; gap: 12px; background: #fff; color: var(--text); border-radius: 12px; padding: 10px 12px; }
.due-num { font-family: var(--font-head); font-weight: 700; font-size: 32px; color: var(--brand); line-height: 1; }
.due-num span { font-size: 18px; color: var(--muted); }
.due-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; }
.ring { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--brand) 0 var(--pct), var(--divider) var(--pct) 100%); }
.ring span { width: 32px; height: 32px; border-radius: 50%; background: #fff; }
.p-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.p-card.done { gap: 6px; opacity: .85; text-decoration: none; }
.p-name { font-weight: 600; font-size: 15px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.p-wants { font-size: 13px; }
.p-note { font-size: 13px; background: var(--bg); border-radius: 8px; padding: 8px 10px; color: #3A3C55; overflow-wrap: anywhere; }
.p-note.owner { background: var(--brand-tint); color: var(--text); }
.p-flag { font-size: 12px; font-weight: 600; color: var(--bad); }
.p-actions { display: flex; gap: 8px; }
.p-actions .btn { flex: 1; }
.p-history { font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.segmented.three-way { grid-template-columns: repeat(3, minmax(0, 1fr)); }
details.group summary { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; padding: 4px 0; }
a.person { color: var(--text); text-decoration: none; }
.person span.wait { color: var(--warn); }
.person span.none { color: var(--muted); }
.person small { display: block; font-size: 11px; color: var(--muted); }
.home-due { border: 1px solid var(--border); text-decoration: none; }

/* ---- bookings (Phase 2, docs/design/CarDetail.html + Deal.html) ---- */
.booking-card { display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; }
.booking-card.closed { opacity: .7; }
.qnum { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--divider, #E6E6EF); color: var(--text); font-size: 12px; margin-right: 6px; }
.qnum.first { background: var(--brand); color: #fff; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---- loan applications (Phase 3, docs/design/Deal.html) ---- */
.loan-card { display: flex; flex-direction: column; gap: 8px; }
.loan-card .p-name { color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.loan-card.offer { border: 2px solid var(--good); }
.loan-card.closed { opacity: .7; }
.loan-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; font-size: 12px; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.add-dashed { border: 1.5px dashed var(--brand); background: var(--brand-tint); color: var(--brand); }

/* ---- paperwork after approval (Phase 4, docs/design/Paperwork.html) ---- */
.pw-progress { height: 8px; border-radius: 999px; background: var(--divider); overflow: hidden; }
.pw-progress span { display: block; height: 100%; background: var(--good); }
.step { display: flex; flex-direction: column; gap: 8px; }
.step-head { display: flex; gap: 12px; align-items: flex-start; }
.step-mark { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--neutral-bg, #EBEBF2); color: var(--muted); font-size: 13px; font-weight: 600; }
.step.done .step-mark { background: var(--good); color: #fff; }
.step.current { border: 2px solid var(--warn); background: var(--warn-bg); }
.step.current .step-mark { background: var(--warn); color: #fff; }
.step.later { opacity: .6; }

/* ---- customer form sections (D64) ---- */
.form-sections { display: flex; flex-direction: column; gap: 12px; }

/* D71: lender tick list on Send to lenders */
.lender-ticks { border: 0; padding: 0; margin: 0; }
.lender-ticks legend { padding: 0; margin-bottom: 4px; }
.lender-ticks .is-used { color: var(--muted); opacity: .6; }

/* ---- the Runner's My tasks (Part 2) ---- */
.task .task-who { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- insurance renewals (Phase 5, docs/design/Renewals.html) ---- */
.counters.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 10px; }
a.counter { color: inherit; text-decoration: none; }
.policy-card { display: flex; flex-direction: column; gap: 8px; }
.policy-card .p-name { color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.policy-card.bad { border: 2px solid var(--bad); }
.policy-card.warn { border: 2px solid var(--warn); }
.policy-row { display: block; color: inherit; text-decoration: none; }
.loan-figures.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---- reports (Phase 6, D80): tables scroll inside their card on a phone, never the page ---- */
.table-wrap { padding: 0; overflow-x: auto; }
table.report { width: 100%; border-collapse: collapse; font-size: 13px; }
table.report th, table.report td { padding: 8px 10px; border-bottom: 1px solid var(--divider); text-align: left; white-space: nowrap; }
table.report th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
table.report .num { text-align: right; }
table.report tr.total td { font-weight: 600; background: var(--bg, #F4F4F8); }
table.report tr.red td, table.report tr.red td.num { color: var(--bad); }
table.report tr.amber td { color: var(--warn); }
table.report small { color: var(--muted); }

/* ---- knowledge bank (Phase 6, D81) ---- */
.article-body { white-space: pre-wrap; line-height: 1.5; margin-top: 8px; }

/* ---- FAQ (D84) ---- */
details.faq { border-bottom: 1px solid var(--divider); padding: 12px 14px; }
details.faq:last-child { border-bottom: 0; }
details.faq > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 8px; align-items: baseline; }
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 400; }
details.faq[open] > summary::after { content: "\2013"; }
.faq-answer { white-space: pre-wrap; line-height: 1.5; margin: 8px 0; }
.faq-suggest { cursor: pointer; font-weight: 600; color: var(--brand); }

/* ---- Next step (D89) ---- */
.next-step { border-left: 4px solid var(--brand); }
.next-step.warn { border-left-color: var(--warn); }
.next-step.bad { border-left-color: var(--bad); }
.next-step-text { font-weight: 600; margin: 4px 0 8px; }
.next-step-list { margin: 0 0 8px; padding-left: 18px; line-height: 1.6; }
