:root{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}[hidden]{display:none!important}
/* Layout: one column on a phone with the job's tabs along the bottom; from tablet up, work on the left and the price on the right.
   Colour: VroomFlow violet for action (brand/README.md), highlighter yellow for anything that still needs a look. */
:root {
  --bg: #EDF1F5; --surface: #FFFFFF; --surface-2: #F4F7FA; --sunk: #E4EAF0;
  --ink: #14233B; --ink-2: #3B4B63; --muted: #5C6C82; --line: #D5DDE6; --line-2: #B9C6D3;
  --accent: #6243D0; --accent-2: #5234B5; --accent-ink: #FFFFFF; --accent-soft: #EEEAFC; --accent-text: #5B3CC4;
  --logo-ink: #111111; --logo-accent: #8B6CF0;
  --mark: #FFD43A; --mark-soft: #FFF3BF; --mark-ink: #5C4500; --mark-line: #E6B800;
  --good: #19703F; --good-soft: #DFF2E6; --bad: #B3261E; --bad-soft: #FCE9E7; --bad-ink: #FFFFFF;
  --panel: #1C1733; --panel-ink: #FFFFFF; --panel-muted: #B9B1D6; --panel-line: #342C52;
  --shadow: 0 1px 2px rgba(20, 35, 59, .06), 0 4px 14px rgba(20, 35, 59, .06);
  --focus: 0 0 0 3px rgba(98, 67, 208, .32);
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Barlow Semi Condensed", "Arial Narrow", "Atkinson Hyperlegible Next", system-ui, sans-serif;
  --r: 10px; --r-s: 7px;
  --bar: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0C131C; --surface: #141D29; --surface-2: #18232F; --sunk: #101923;
    --ink: #E4EAF1; --ink-2: #B3BFCF; --muted: #8C9AAD; --line: #263444; --line-2: #37485C;
    --accent: #A994FF; --accent-2: #BBAAFF; --accent-ink: #120B2E; --accent-soft: #251D48; --accent-text: #B4A3FF;
    --logo-ink: #FFFFFF; --logo-accent: #8B6CF0;
    --mark: #F2C83A; --mark-soft: #352C0B; --mark-ink: #F6DE85; --mark-line: #8A7216;
    --good: #55C58F; --good-soft: #0F2A1E; --bad: #F2796E; --bad-soft: #361613; --bad-ink: #2B0A07;
    --panel: #221C3B; --panel-ink: #F3F1FA; --panel-muted: #AEA6CC; --panel-line: #3B3260;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    --focus: 0 0 0 3px rgba(169, 148, 255, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0C131C; --surface: #141D29; --surface-2: #18232F; --sunk: #101923;
  --ink: #E4EAF1; --ink-2: #B3BFCF; --muted: #8C9AAD; --line: #263444; --line-2: #37485C;
  --accent: #A994FF; --accent-2: #BBAAFF; --accent-ink: #120B2E; --accent-soft: #251D48; --accent-text: #B4A3FF;
  --logo-ink: #FFFFFF; --logo-accent: #8B6CF0;
  --mark: #F2C83A; --mark-soft: #352C0B; --mark-ink: #F6DE85; --mark-line: #8A7216;
  --good: #55C58F; --good-soft: #0F2A1E; --bad: #F2796E; --bad-soft: #361613; --bad-ink: #2B0A07;
  --panel: #221C3B; --panel-ink: #F3F1FA; --panel-muted: #AEA6CC; --panel-line: #3B3260;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  --focus: 0 0 0 3px rgba(169, 148, 255, .4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
#root { min-height: 100%; }
h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-family: var(--display); font-weight: 600; letter-spacing: .005em; line-height: 1.2; }
h1 { font-size: 1.375rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-s); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.icon { flex: none; }
.loading { padding: 40px 16px; color: var(--muted); }

/* ---- page frame */
.page { min-height: 100%; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding-inline: 16px; padding-block: 16px 32px; }
.wrap-narrow { max-width: 760px; }
.page-job .wrap { padding-bottom: calc(var(--bar) + 32px + env(safe-area-inset-bottom, 0px)); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.cols > * { min-width: 0; }
.side { order: -1; }

.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-title { flex: 1 1 auto; min-width: 0; }
.topbar-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-title p { font-size: .8125rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topbar-side { display: flex; align-items: center; gap: 8px; flex: none; }
.topbar-total { font-family: var(--display); font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.topbar-todo { font-size: .8125rem; background: var(--mark-soft); color: var(--mark-ink); padding: 4px 8px; border-radius: var(--r-s); white-space: nowrap; }
.topbar .btn-quiet span { display: none; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--bar); border: 0; background: none; color: var(--muted); font-size: .75rem; padding: 6px 2px; }
.tab-on { color: var(--accent-text); font-weight: 600; }
.tab-on::before { content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 3px; background: var(--accent); border-radius: 0 0 3px 3px; }
.tab-dot { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--mark); color: #3D2E00; font-size: .6875rem; font-weight: 700; line-height: 18px; text-align: center; }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; text-align: center; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--sunk); }
.btn-small { min-height: 36px; padding: 4px 10px; font-size: .875rem; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: var(--bad-ink); }
.btn-danger:hover { background: var(--bad); filter: brightness(.94); }
.btn-rec { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.btn-wide { width: 100%; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-s); background: none; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.confirm { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: .875rem; }

/* ---- small parts */
.pill { display: inline-block; padding: 1px 7px; border-radius: 5px; font: 600 .75rem/1.5 var(--font); letter-spacing: 0; vertical-align: middle; white-space: nowrap; }
.pill-plain { background: var(--sunk); color: var(--ink-2); }
.pill-info { background: var(--accent-soft); color: var(--accent-text); }
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-mark { background: var(--mark-soft); color: var(--mark-ink); }
.note { font-size: .875rem; color: var(--muted); max-width: 62ch; }
.lede { color: var(--muted); }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--bar) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 60; margin: 0 auto; max-width: 520px; padding: 12px 14px; border-radius: var(--r); background: var(--panel); color: var(--panel-ink); box-shadow: var(--shadow); font-size: .9375rem; }
.toast-warn { background: var(--mark); color: #3D2E00; }

/* ---- fields */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label, .opt-label { font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.field-box { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); }
.field-box:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.field-box input { flex: 1 1 auto; min-width: 0; width: 100%; border: 0; background: none; padding: 8px 0; outline: none; }
.field-box input:focus-visible { box-shadow: none; }
.field-unit { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.field-hint { font-size: .8125rem; color: var(--muted); }
.field-mark .field-box { background: var(--mark-soft); border-color: var(--mark-line); }
.field-small .field-box { min-height: 40px; }
.field-small { max-width: 190px; }
textarea { width: 100%; min-height: 44px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); resize: vertical; line-height: 1.45; }
textarea:focus-visible { border-color: var(--accent); }
::placeholder { color: var(--muted); opacity: .75; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-align: left; }
.chip:hover { border-color: var(--accent); }
.chip-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chips-mark .chip:not(.chip-on) { background: var(--surface); border-color: var(--mark-line); }
.said { display: block; font-size: .8125rem; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.said::before { content: "From your notes: "; font-style: normal; }

.section { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section-sub { font-size: .875rem; color: var(--muted); margin-top: -6px; max-width: 65ch; }
.grid-2, .grid-3 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.empty { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 20px 16px; }
.empty-list { list-style: disc; padding-left: 20px; color: var(--ink-2); }
.scroll-x { overflow-x: auto; }

/* ---- jobs */
.jobs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.jobs { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.jobs:empty { display: none; }
.jobs li + li { border-top: 1px solid var(--line); }
.job { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: none; text-align: left; }
.job:hover { background: var(--surface-2); }
.job-main { display: flex; flex-direction: column; min-width: 0; }
.job-name { font-family: var(--display); font-weight: 600; font-size: 1.1875rem; }
.job-sub { color: var(--ink-2); }
.job-ref { font-size: .8125rem; color: var(--muted); }
.job-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.job-total { font-family: var(--display); font-weight: 600; font-size: 1.375rem; font-variant-numeric: tabular-nums; }
.job-todo { font-size: .8125rem; background: var(--mark-soft); color: var(--mark-ink); padding: 2px 8px; border-radius: 5px; }
.picker { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.picker-title { font-family: var(--display); font-weight: 600; font-size: 1.125rem; }
.picker-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.picker-item { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface-2); text-align: left; }
.picker-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.picker-trade { font-size: .8125rem; color: var(--muted); }
.picker-name { font-family: var(--display); font-weight: 600; font-size: 1.1875rem; }

/* ---- job: scope */
.who { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.part { display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.part-head { display: flex; align-items: center; gap: 10px; }
.part-name { flex: 1 1 auto; min-width: 0; font: 600 1.375rem/1.2 var(--display); border: 0; border-bottom: 1px dashed var(--line-2); background: none; padding: 4px 0; }
.part-name:focus-visible { box-shadow: none; border-bottom: 2px solid var(--accent); }
.part-kind { font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.notes { display: flex; flex-direction: column; gap: 8px; }
.notes-box { font-size: 1rem; }
.notes-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notes-actions .btn-primary { flex: 1 1 180px; }
.notes-report { font-size: .9375rem; color: var(--ink-2); background: var(--accent-soft); border-radius: var(--r-s); padding: 8px 12px; }
.also { display: flex; flex-direction: column; gap: 6px; }
.also-list { display: flex; flex-direction: column; gap: 6px; }
.also-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); }
.ask { display: flex; flex-direction: column; gap: 14px; background: var(--mark-soft); border: 1px solid var(--mark-line); border-radius: var(--r); padding: 14px 16px; }
.ask h3 { color: var(--mark-ink); }
.ask .opt-label { color: var(--ink); }
.ready { display: flex; align-items: center; gap: 8px; color: var(--good); font-weight: 600; }
.measure { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.measure-fields { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.measure-fields > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sketch { width: 100%; max-width: 360px; height: auto; justify-self: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); }
.sketch-room { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; }
.sketch-unknown { stroke: var(--mark-line); stroke-dasharray: 7 6; fill: var(--mark-soft); }
.sketch-dim line { stroke: var(--accent); stroke-width: 1.2; }
.sketch-label { fill: var(--accent-text); font: 600 13px var(--font); }
.sketch-area { fill: var(--ink); font: 600 22px var(--display); }
.sketch-note { fill: var(--muted); font: 12px var(--font); }
.sketch-missing { fill: var(--mark-ink); font-weight: 700; }
.opts { display: grid; gap: 16px 20px; grid-template-columns: minmax(0, 1fr); }
.opt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.more { border-top: 1px solid var(--line); padding-top: 12px; }
.more > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.more[open] > summary { margin-bottom: 12px; }
.add-part { display: flex; flex-direction: column; gap: 8px; }

/* ---- job: price */
.sum { background: var(--panel); color: var(--panel-ink); border-radius: var(--r); padding: 18px 18px 10px; }
.sum-top { display: flex; flex-direction: column; padding-bottom: 12px; }
.sum-label { font-size: .875rem; color: var(--panel-muted); }
.sum-total { font: 700 2.5rem/1.1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.sum-note { font-size: .8125rem; color: var(--panel-muted); }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--panel-line); font-size: .9375rem; }
.sum-row span:first-child { color: var(--panel-muted); }
.sum-strong { font-weight: 700; }
.sum-strong span:first-child { color: var(--panel-ink); }
.warn { display: flex; gap: 12px; background: var(--mark-soft); border: 1px solid var(--mark-line); border-radius: var(--r); padding: 12px 14px; color: var(--ink); }
.warn > .icon { color: var(--mark-ink); margin-top: 2px; }
.warn > div { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.warn-title { font-weight: 700; }
.warn ul { list-style: disc; padding-left: 18px; font-size: .9375rem; }
.stage { display: flex; flex-direction: column; }
.stage h3 { font-size: .9375rem; color: var(--muted); font-family: var(--font); font-weight: 600; padding: 8px 0 4px; }
.line { border-top: 1px solid var(--line); }
.line-head { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; grid-template-areas: "name amount chev" "meta amount chev"; column-gap: 10px; align-items: center; width: 100%; min-height: 52px; padding: 8px 0; border: 0; background: none; text-align: left; }
.line-head:hover .line-name { color: var(--accent-text); }
.line-name { grid-area: name; font-weight: 600; }
.line-meta { grid-area: meta; display: flex; gap: 12px; flex-wrap: wrap; font-size: .8125rem; color: var(--muted); }
.line-amount { grid-area: amount; font-weight: 600; }
.line-head > .icon { grid-area: chev; color: var(--muted); transition: transform .15s; }
.line-open .line-head > .icon { transform: rotate(180deg); }
.line-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 14px; }
.line-part { display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; }
.line-part-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.working { font-size: .875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.line-edit { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 2px; }
.line-edit-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.extra { display: grid; grid-template-columns: minmax(0, 1fr) 120px 40px; gap: 8px; align-items: end; }

/* ---- tables */
.tbl { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.tbl th { text-align: left; font-size: .8125rem; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line-2); }
.tbl th.num { text-align: right; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td:first-child, .tbl th:first-child { padding-left: 0; }
.tbl td:last-child, .tbl th:last-child { padding-right: 0; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line-2); }
.tbl-wide { min-width: 460px; }
.tbl .working { color: var(--muted); }

/* ---- plan */
.facts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.fact { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.fact-num { font: 700 1.75rem/1.15 var(--display); }
.fact-label { font-size: .875rem; color: var(--muted); }
.plan { display: flex; flex-direction: column; gap: 14px; counter-reset: step; }
.plan li { display: flex; flex-direction: column; gap: 4px; counter-increment: step; }
.plan-row { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.plan-name::before { content: counter(step) ". "; color: var(--muted); font-weight: 400; }
.plan-bar { height: 8px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.plan-bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.plan-sub { font-size: .8125rem; color: var(--muted); }

/* ---- customer quote */
.paper { display: flex; flex-direction: column; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 18px; box-shadow: var(--shadow); min-width: 0; }
.paper-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 3px solid var(--ink); }
.paper-biz { font: 700 1.625rem/1.15 var(--display); }
.paper-contact { font-size: .875rem; color: var(--muted); max-width: 40ch; }
.paper-ref { font-size: .875rem; color: var(--ink-2); }
.paper-kind { font: 600 1.125rem/1.2 var(--display); color: var(--ink); }
.paper-for h2 { font-size: 1.5rem; margin-top: 10px; }
.paper-name { font-weight: 700; }
.paper-table { width: 100%; border-collapse: collapse; }
.paper-table td { padding: 12px 0; border-top: 1px solid var(--line); vertical-align: top; }
.paper-table td.num { padding-left: 16px; font-weight: 600; }
.paper-stage { font-weight: 700; }
.paper-table ul, .paper-terms ul { list-style: disc; padding-left: 18px; color: var(--ink-2); font-size: .9375rem; }
.paper-total { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 3px solid var(--ink); }
.paper-total-row { display: flex; justify-content: space-between; gap: 16px; }
.paper-grand { font: 700 1.75rem/1.2 var(--display); }
.paper-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.paper-grid h3, .paper-terms h3 { margin-bottom: 4px; }
.paper-pay li { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.paper-terms li + li { margin-top: 3px; }
.send { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.send-status { display: flex; flex-direction: column; gap: 6px; }

/* ---- settings */
.rate-list { display: flex; flex-direction: column; }
.rate-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.rate-name { display: flex; flex-direction: column; min-width: 0; }
.rate-unit { font-size: .8125rem; color: var(--muted); }
.rate-row .field { flex: 0 0 150px; }
.learned { display: flex; flex-direction: column; gap: 6px; background: var(--accent-soft); border-radius: var(--r-s); padding: 10px 12px; }
.learned-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

@media (min-width: 560px) {
  .grid-2, .who { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .who > :last-child { grid-column: 1 / -1; }
  .measure { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
  .sketch { justify-self: start; }
  .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paper { padding: 32px; }
  .paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar .btn-quiet span { display: inline; }
}
@media (min-width: 900px) {
  .tabs { position: sticky; top: calc(57px + env(safe-area-inset-top, 0px)); bottom: auto; display: flex; justify-content: center; gap: 4px; border-top: 0; border-bottom: 1px solid var(--line); padding: 0 16px; }
  .tab { flex-direction: row; gap: 8px; min-height: 48px; padding: 8px 18px; font-size: .9375rem; }
  .tab-on::before { top: auto; bottom: 0; left: 10px; right: 10px; border-radius: 3px 3px 0 0; }
  .tab-dot { position: static; }
  .page-job .wrap { padding-bottom: 32px; }
  .cols { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .side { order: 0; position: sticky; top: calc(122px + env(safe-area-inset-top, 0px)); }
  .toast { bottom: 24px; }
  .who { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .who > :last-child { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .topbar, .tabs, .side, .toast, .q-act, .q-foot, .q-note { display: none !important; }
  body { background: #FFFFFF; }
  .paper { border: 0; box-shadow: none; padding: 0; }
  .wrap, .q-wrap { padding: 0; max-width: none; }
}

/* ---- signing in, and the account parts of settings */
.page-door { align-items: center; justify-content: flex-start; padding: 24px 16px 40px; }
.door { width: 100%; max-width: 420px; margin-top: min(12vh, 96px); display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 20px; box-shadow: var(--shadow); }
.door h1 { font-size: 1.625rem; }
.door-brand { margin: 0 0 4px; }
.brand-logo { display: block; height: 22px; width: auto; }
.brand-logo-vroom { fill: var(--logo-ink); }
.brand-logo-flow { fill: var(--logo-accent); }
.door-form { display: flex; flex-direction: column; gap: 12px; }
.door-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.door-or { text-align: center; color: var(--muted); font-size: .875rem; }
.door-sent { color: var(--ink-2); }
.door-code { font: 600 1.5rem/1.2 var(--display); letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.door-error { background: var(--bad-soft); color: var(--bad); border-radius: var(--r-s); padding: 8px 12px; font-size: .9375rem; }
.sync { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: .8125rem; color: var(--muted); white-space: nowrap; vertical-align: middle; }
.sync-ok { color: var(--good); }
.sync-wait { background: var(--mark-soft); color: var(--mark-ink); padding: 1px 8px; border-radius: 5px; white-space: normal; }
.offer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r); padding: 12px 16px; margin-bottom: 12px; }
.offer-title { font-family: var(--display); font-weight: 600; font-size: 1.0625rem; }
.acct { overflow-wrap: anywhere; }
.invite { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 720px) { .invite { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; } }
.who-row { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }

/* ---- first-run setup, logo */
.door-wide { max-width: 720px; margin-top: 24px; }
.door-wide h2 { margin-top: 8px; }
.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-thumb { max-width: 160px; max-height: 64px; object-fit: contain; background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--r-s); padding: 4px; }
.logo-none { color: var(--muted); font-size: .875rem; }
.paper-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.paper-logo { max-width: 120px; max-height: 72px; object-fit: contain; flex: none; }

/* ---- sending a quote, and the customer's page */
.send-link { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.send-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.send-row .btn-primary { flex: 1 1 auto; }
.send-state { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r-s); background: var(--accent-soft); color: var(--ink); font-weight: 600; font-size: .9375rem; }
.send-state-accepted { background: var(--good-soft); color: var(--good); }
.send-state-declined { background: var(--bad-soft); color: var(--bad); }
.send-state-seen { background: var(--mark-soft); color: var(--mark-ink); }
#quote-link { font-size: .8125rem; color: var(--ink-2); }
.q-wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.q-note { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.q-note-title { font: 600 1.1875rem/1.2 var(--display); }
.q-note-good { background: var(--good-soft); border-color: var(--good); }
.q-note-good .q-note-title { color: var(--good); }
.q-note-mark { background: var(--mark-soft); border-color: var(--mark-line); }
.q-note-bad { background: var(--bad-soft); border-color: var(--bad); }
.q-act { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 2px solid var(--accent); border-radius: var(--r); padding: 18px 16px; }
.q-form { display: flex; flex-direction: column; gap: 12px; }
.q-row { display: flex; gap: 10px; flex-wrap: wrap; }
.q-row .btn-primary { flex: 1 1 220px; min-height: 52px; font-size: 1.0625rem; }
.q-foot { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ---- recording a visit */
.visit { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent); }
.visit-on { background: var(--bad-soft); border-color: var(--bad); }
.visit-title { display: flex; align-items: center; gap: 8px; font: 600 1.0625rem/1.2 var(--display); font-variant-numeric: tabular-nums; }
.visit-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: visit-pulse 1.4s ease-in-out infinite; }
@keyframes visit-pulse { 50% { opacity: .25; } }

/* ---- practice mode and the demo */
.practice-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 8px 16px; background: var(--mark); color: #3D2E00; font-size: .875rem; }
.practice-bar p { min-width: 0; }
.practice-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.practice-bar .btn { border-color: rgba(61, 46, 0, .35); background: rgba(255, 255, 255, .55); color: #3D2E00; }
.practice-bar .btn-ink { background: #3D2E00; border-color: #3D2E00; color: #FFF3BF; }
.practice-bar .btn-danger { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
.door-demo { border-top: 1px solid var(--line); padding-top: 12px; display: flex; justify-content: center; }
.demo-cover { position: fixed; inset: 0; z-index: 80; overflow-y: auto; background: var(--bg); }
.demo-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--mark); color: #3D2E00; font-size: .875rem; }
.q-note-plain { background: var(--surface); }
