/* Invoice OS, a Proven Path Strategies product, sharing Forecourt OS's frame and look. Built to be used one handed
   on a phone at the end of a job: light by default (dark when the phone is), big targets, one main action per screen.
   Colours are Proven Path Strategies' own: navy #0F1E2E, teal #108599, cream paper, and the six colour spectrum
   (amber, gold, lime, green, sea, red) for the stripe and the figures. Type: Sora, DM Sans, JetBrains Mono.
   No inline styles in markup (the CSP blocks them); positions set by script use the CSSOM. */

:root {
  --bg: #fbfbf9; --card: #ffffff; --ink: #0f1e2e; --ink-2: #33424f; --muted: #5d6a76; --line: #e5e6e0; --soft: #f0f2ef;
  --accent: #0e7a8c; --accent-hi: #0b6474; --accent-ink: #ffffff; --teal-soft: #e5f2f4; --navy: #0f1e2e; --navy-2: #162a3e; --on-navy: #c9d3db;
  --green: #1f7a4f; --green-bg: #e3f4ea; --gold-bg: #fff1dc; --gold-ink: #8a5a12; --blue: #2c4766; --blue-bg: #e6ecf4; --red: #b5292f; --red-bg: #fbedee;
  --s1: #eda944; --s2: #f4c842; --s3: #d3dc55; --s4: #97c459; --s5: #3d8399; --s6: #b5292f;
  --grid: rgba(15, 30, 46, .03);
  --r: 14px; --r-lg: 20px; --shadow: 0 1px 2px rgba(15, 30, 46, .04), 0 6px 24px rgba(15, 30, 46, .05);
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --head: 'Sora', 'DM Sans', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1); --tabs: 72px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c141c; --card: #131e28; --ink: #e7ecf0; --ink-2: #c3ced7; --muted: #9aa8b4; --line: #22303c; --soft: #1a2733; --accent: #1d93a6; --accent-hi: #6ccad8; --accent-ink: #ffffff; --teal-soft: #0f2e36; --navy: #0a1520; --navy-2: #13263a; --green: #4cc38a; --green-bg: #122c1e; --gold-bg: #33270f; --gold-ink: #f0c27c; --blue: #a6bfe0; --blue-bg: #18263a; --red: #ec6a6f; --red-bg: #3a181b; --grid: rgba(255, 255, 255, .025); --shadow: none; }
}
@font-face { font-family: 'Sora'; src: url('/fonts/sora.woff') format('woff'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('/fonts/dmsans.woff') format('woff'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jbmono.woff') format('woff'); font-weight: 500; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background-color: var(--bg); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 28px 28px; color: var(--ink); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, .page-title { font-family: var(--head); letter-spacing: -.02em; }
/* the Proven Path Strategies colour stripe */
.stripe { display: flex; gap: 3px; height: 5px; }
.stripe span { flex: 1; }
.stripe span:nth-child(1) { background: var(--s1); } .stripe span:nth-child(2) { background: var(--s2); } .stripe span:nth-child(3) { background: var(--s3); } .stripe span:nth-child(4) { background: var(--s4); } .stripe span:nth-child(5) { background: var(--s5); } .stripe span:nth-child(6) { background: var(--s6); }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vh { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 14px; } .block { display: block; } .m0 { margin: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
/* the Invoice OS icon: the white I on the PROVEN colours */
.mark { display: inline-block; flex: none; width: 36px; height: 36px; background: url('../../icon.svg') center / contain no-repeat; }
.mark.sm { width: 30px; height: 30px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; transition: background .15s, scale .12s var(--ease), opacity .15s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; white-space: nowrap; }
.btn:active { scale: .96; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px rgba(14, 122, 140, .6); }
.btn-soft { background: var(--gold-bg); color: var(--gold-ink); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.is-busy { opacity: .65; cursor: progress; }
@media (hover: hover) { .btn-primary:hover { background: var(--accent-hi); } .btn-ghost:hover { background: var(--soft); } }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--soft); cursor: pointer; }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn[disabled] { opacity: .35; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; }
.row-btns { display: flex; gap: 8px; align-items: center; }
.row-btns.wrap { flex-wrap: wrap; }

/* ---------- the frame ---------- */
.shell { min-height: 100vh; }
.side { display: none; }
.stage { padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 16px); }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 13px; background: var(--navy); color: #fff; border-bottom: 0; }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--s1) 0 16.6%, var(--s2) 16.6% 33.3%, var(--s3) 33.3% 50%, var(--s4) 50% 66.6%, var(--s5) 66.6% 83.3%, var(--s6) 83.3%); }
.top .icon-btn { background: rgba(255, 255, 255, .1); color: #fff; }
.top .pill.gold { background: var(--s1); color: var(--navy); }
.top-title { font-size: 17px; margin: 0; flex: 1; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--card) 92%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabs .nav-link { display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; background: none; border: 0; padding: 8px 0; cursor: pointer; }
.tabs .nav-link[aria-current='page'] { color: var(--accent); }
.tab-add { justify-self: center; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 8px 20px -6px rgba(14, 122, 140, .7), inset 0 -3px 0 rgba(0, 0, 0, .12); transition: scale .12s var(--ease); }
.tab-add:active { scale: .92; }
.main { outline: none; transition: opacity .2s ease; }
.main.leaving { opacity: .5; }
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px 16px 24px; display: grid; gap: 16px; align-content: start; }
.page.narrow { max-width: 720px; }
.page > *, .stack > *, .stack-lg > *, .tab-panel > * { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-title { font: 600 26px/1.15 var(--head); letter-spacing: -.03em; margin: 0; }
.eyebrow { font: 500 11px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; min-height: 40px; }
.hide-phone { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 248px 1fr; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 0 14px 20px; background: var(--navy); color: #fff; }
  .side::before { content: ''; display: block; height: 5px; margin: 0 -14px 20px; background: linear-gradient(90deg, var(--s1) 0 16.6%, var(--s2) 16.6% 33.3%, var(--s3) 33.3% 50%, var(--s4) 50% 66.6%, var(--s5) 66.6% 83.3%, var(--s6) 83.3%); }
  .side-brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 20px; }
  .side-brand strong { display: block; font-size: 15px; }
  .side-brand span:not(.mark) { font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #6cc3cf; }
  .side .nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: var(--on-navy); text-decoration: none; font-weight: 600; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; position: relative; }
  .side .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .side .nav-link[aria-current='page'] { background: rgba(16, 133, 153, .28); color: #fff; }
  .side .nav-link[aria-current='page']::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--s1); }
  .side .nav-link[aria-current='page'] .ic { color: #6cc3cf; }
  .side-foot { margin-top: auto; display: grid; gap: 8px; }
  .demo-note { font-size: 13px; color: var(--navy); background: var(--s1); padding: 10px 12px; border-radius: 10px; margin: 0; }
  .side-foot .nav-link { color: var(--on-navy); }
  .top { background: color-mix(in srgb, var(--bg) 90%, transparent); color: var(--ink); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .top::after { display: none; }
  .top .icon-btn { background: var(--soft); color: var(--ink); }
  .tabs, .top .mark { display: none; }
  .stage { padding-bottom: 32px; }
  .top { padding: 16px 32px; }
  .page { padding: 24px 32px 40px; gap: 20px; }
  .hide-phone { display: inline-flex; }
}

/* ---------- cards, figures, lists ---------- */
.card-sec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
@media (min-width: 700px) { .card-sec { padding: 22px 24px; } }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head h3 { margin: 0; }
.count { min-width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; padding: 0 8px; }
.stack { display: grid; gap: 14px; } .stack-lg { display: grid; gap: 16px; }
.figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 699px) { .figures:not(.three) > .figure:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 700px) { .figures { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.figures.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .figures.three .figure-value { font-size: 19px; } .figures.three .figure { padding: 12px; } }
.figure { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 14px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.figure::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--fig, var(--accent)); }
.figure:nth-child(6n+1) { --fig: var(--s5); } .figure:nth-child(6n+2) { --fig: var(--s1); } .figure:nth-child(6n+3) { --fig: var(--s4); } .figure:nth-child(6n+4) { --fig: var(--s2); } .figure:nth-child(6n+5) { --fig: var(--s3); } .figure:nth-child(6n+6) { --fig: var(--s6); }
.figure-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.figure-value { font: 600 24px/1.15 var(--head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.figure-hint { font-size: 12px; color: var(--muted); }
.figure.neg .figure-value { color: var(--red); }
.tasks { display: grid; gap: 4px; }
.task, .lead-row, .car-row, .more-row, .car-link { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); text-decoration: none; transition: background .12s, scale .12s var(--ease); -webkit-tap-highlight-color: transparent; }
.task:hover, .lead-row:hover, .car-row:hover, .more-row:hover, .car-link:hover { background: var(--soft); }
.task:active, .lead-row:active, .car-row:active, .car-link:active { scale: .985; }
.task-text, .lead-main { flex: 1; min-width: 0; display: grid; }
.task-text span, .lead-main span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--soft); }
.task-ic.big { width: 52px; height: 52px; border-radius: 16px; }
.k-video, .k-viewing { background: var(--blue-bg); color: var(--blue); } .k-reserve, .k-aged { background: var(--gold-bg); color: var(--gold-ink); } .k-valuation, .k-sell { background: var(--green-bg); color: var(--green); } .k-photo { background: var(--red-bg); color: var(--red); } .k-sourcing { background: var(--gold-bg); color: var(--gold-ink); }
.all-clear { display: flex; gap: 10px; align-items: center; color: var(--green); padding: 8px 4px; }
.all-clear p { margin: 0; font-weight: 600; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick-btn { display: grid; justify-items: center; gap: 6px; padding: 16px 8px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.pill.green { background: var(--green-bg); color: var(--green); } .pill.gold { background: var(--gold-bg); color: var(--gold-ink); } .pill.blue { background: var(--blue-bg); color: var(--blue); } .pill.dark { background: rgba(0, 0, 0, .7); color: #fff; }
.pill.sm { font-size: 11px; padding: 2px 8px; margin-left: 6px; }
.tip { display: flex; gap: 10px; align-items: flex-start; background: var(--gold-bg); color: var(--gold-ink); border-radius: var(--r); padding: 12px 12px 12px 14px; }
.tip p, .tip span { margin: 0; flex: 1; font-size: 14px; }
.tip .icon-btn { background: transparent; color: inherit; }
.empty { text-align: center; padding: 32px 16px; display: grid; justify-items: center; gap: 4px; }
.empty-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--soft); display: grid; place-items: center; margin-bottom: 8px; color: var(--muted); }
.empty p { color: var(--muted); max-width: 40ch; }

/* ---------- stock ---------- */
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; }
.search input { border: 0; background: transparent; min-height: 48px; width: 100%; outline: none; }
.search:focus-within { outline: 2.5px solid var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-n { font-size: 12px; opacity: .7; }
.car-list > *, .lead-list > *, .tasks > * { min-width: 0; }
.car-list, .lead-list { display: grid; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px; }
.car-row .thumb { width: 96px; aspect-ratio: 4 / 3; flex: none; border-radius: 10px; overflow: hidden; background: var(--soft); display: grid; place-items: center; }
.car-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.car-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.car-row-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.car-row-main > *, .lead-main > *, .task-text > * { min-width: 0; }
.car-row-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-row-main > span { font-size: 14px; }
.car-row-price { font: 600 17px var(--head); font-variant-numeric: tabular-nums; flex: none; }
@media (max-width: 520px) { .car-row-price { display: none; } }
.no-photo { color: var(--muted); display: grid; place-items: center; }
.progress { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; margin: 2px 0; }
.progress .bar { display: block; height: 100%; background: linear-gradient(90deg, var(--s5), var(--accent) 60%, var(--s4)); border-radius: 99px; width: 0; }
.w10 { width: 10% !important; } .w20 { width: 20% !important; } .w30 { width: 30% !important; } .w40 { width: 40% !important; } .w50 { width: 50% !important; } .w60 { width: 60% !important; } .w70 { width: 70% !important; } .w80 { width: 80% !important; } .w90 { width: 90% !important; } .w100 { width: 100% !important; }

/* ---------- a car ---------- */
.car-head { display: grid; gap: 16px; }
@media (min-width: 760px) { .car-head { grid-template-columns: 320px 1fr; align-items: center; } }
.car-hero { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--soft); }
.car-hero img { width: 100%; height: 100%; object-fit: cover; }
.no-photo.big { position: relative; width: 100%; height: 100%; padding: 0; border: 0; border-radius: var(--r-lg); background: var(--soft); cursor: pointer; overflow: hidden; }
.no-photo.big img { width: 100%; height: 100%; object-fit: cover; }
.no-photo.big .add-photos { position: absolute; right: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 6px 16px -6px rgba(14, 122, 140, .6); }
.car-head-text { display: grid; gap: 4px; }
.car-head-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.car-title { font: 600 26px/1.15 var(--head); font-stretch: 110%; margin: 4px 0 0; }
.car-price { font: 600 24px var(--head); margin: 6px 0 10px; display: flex; gap: 10px; align-items: baseline; font-variant-numeric: tabular-nums; }
.car-price s { font-size: 16px; }
.tabbar { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabbar [role='tab'] { flex: none; min-height: 44px; padding: 10px 14px; border: 0; background: none; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.tabbar [role='tab'][aria-selected='true'] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { outline: none; }
.grid2, .grid3 { display: grid; gap: 14px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 13px; color: var(--muted); }
.tbl .n { text-align: right; font-variant-numeric: tabular-nums; }
.prep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 14px; }
.prep-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.prep-item:last-child { border-bottom: 0; }
.prep-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.prep-item.done .prep-dot { background: var(--green); border-color: var(--green); color: #fff; }
.prep-text { display: grid; gap: 2px; min-width: 0; }
.prep-row { font-size: 14px; color: var(--muted); }
.nudge { display: flex; gap: 10px; background: var(--gold-bg); color: var(--gold-ink); border-radius: var(--r); padding: 14px; }
.nudge p { margin: 0; }
.cost-add { display: grid; gap: 12px; margin-top: 14px; align-items: end; }
@media (min-width: 640px) { .cost-add { grid-template-columns: 1fr 1fr 2fr auto; } }
.doc-list, .activity, .members, .lessons, .video-reqs, .shots { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.doc-list li, .activity li, .members li, .video-reqs li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc-list li > span, .members li > span:not(.avatar) { flex: 1; }
.video-reqs li { flex-wrap: wrap; } .video-reqs li > div { flex: 1 1 220px; }
.video-req.focus { background: var(--gold-bg); border-radius: var(--r); padding: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 700; flex: none; }
.lessons a { display: flex; gap: 12px; align-items: center; padding: 12px 4px; text-decoration: none; border-bottom: 1px solid var(--line); }
.lessons a > span:nth-child(2) { flex: 1; }
.lesson-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-bg); color: var(--gold-ink); display: grid; place-items: center; }
.lesson { display: grid; gap: 14px; padding-left: 22px; font-size: 17px; }
.lesson li::marker { font-weight: 700; color: var(--accent); }
.practice { display: grid; gap: 14px; background: linear-gradient(135deg, var(--gold-bg), var(--card)); }
@media (min-width: 640px) { .practice { grid-template-columns: 1fr auto; align-items: center; } }

/* ---------- requests ---------- */
.lead-row.is-new .lead-main strong::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }
.lead-side { display: grid; justify-items: end; gap: 4px; flex: none; }
.lead-head { display: flex; gap: 14px; align-items: center; }
.car-link { background: var(--card); border: 1px solid var(--line); }
.car-link > span { flex: 1; }
.facts { display: grid; gap: 0; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: normal; }
.facts dd a[href^="mailto:"] { overflow-wrap: anywhere; }
.quote { margin: 0; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--card); border-radius: 0 var(--r) var(--r) 0; font-size: 17px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); }
input:not([type='checkbox']):not([type='radio']):not([type='range']), select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 16px; }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
/* iPhones size date and time boxes by their own rules, which made them wider than the card they sit in. With their
   built in look switched off they follow the same sizing as every other box. The picker still opens on a tap. */
input[type='date'], input[type='time'], input[type='datetime-local'], input[type='month'] { -webkit-appearance: none; appearance: none; display: block; box-sizing: border-box; min-width: 0; max-width: 100%; text-align: left; line-height: 1.5; }
input::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.5em; }
input, select, textarea { max-width: 100%; }
.field, .grid2 > *, .grid3 > *, .grid4 > * { min-width: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); outline-offset: 0; }
input[disabled], select[disabled], textarea[disabled] { opacity: .7; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.plate { font: 700 26px/1 var(--head) !important; letter-spacing: .08em; text-transform: uppercase; text-align: center; background: #f2c94c !important; color: #111 !important; border: 2px solid #111 !important; }
.plate::placeholder { color: rgba(17, 17, 17, .4); }
.code-input { font: 700 28px/1 var(--head) !important; letter-spacing: .3em; text-align: center; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; counter-reset: s; }
.stepper li { flex: 1; font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 10px; border-top: 3px solid var(--line); counter-increment: s; }
.stepper li::before { content: counter(s) '. '; }
.stepper li[aria-current='step'] { color: var(--ink); border-top-color: var(--accent); }
.stepper li.done { border-top-color: var(--green); }
.found { display: flex; gap: 10px; align-items: flex-start; background: var(--green-bg); color: var(--green); border-radius: var(--r); padding: 14px; }
.found p { margin: 0; display: grid; } .found span { font-size: 14px; }
.hours-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.faq-row { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.error { color: var(--red); font-weight: 600; margin: 0; min-height: 1em; }
.error:empty { display: none; }

/* ---------- sheets, toasts and the tour ---------- */
dialog.sheet { margin: auto auto 0; width: 100%; max-width: 100%; max-height: 92vh; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--card); color: var(--ink); translate: 0 100%; transition: translate .26s var(--ease); overflow: auto; }
dialog.sheet.on { translate: 0 0; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .45); }
@media (min-width: 700px) { dialog.sheet { margin: auto; max-width: 520px; border-radius: 22px; translate: 0 24px; opacity: 0; transition: translate .22s var(--ease), opacity .22s; } dialog.sheet.wide { max-width: 760px; } dialog.sheet.on { translate: 0 0; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 8px 20px; position: sticky; top: 0; background: var(--card); z-index: 2; }
.sheet-head h2 { font-size: 19px; margin: 0; }
.sheet-body { padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); }
.more-list { display: grid; gap: 4px; }
.more-row { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.more-row > span { flex: 1; display: grid; } .more-row > span span { font-size: 14px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 14px); z-index: 90; translate: -50% 20px; opacity: 0; pointer-events: none; display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 32px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: opacity .2s, translate .2s var(--ease); }
.toast.on { opacity: 1; translate: -50% 0; pointer-events: auto; }
.toast.bad { background: var(--red); color: #fff; }
.toast-act { background: none; border: 0; color: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
@media (min-width: 960px) { .toast { bottom: 28px; } }
.tour { position: fixed; inset: 0; z-index: 95; }
.tour-ring { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); transition: left .3s var(--ease), top .3s var(--ease), width .3s var(--ease), height .3s var(--ease); pointer-events: none; }
.tour.centre .tour-ring { left: 50%; top: 40%; width: 0; height: 0; }
.tour-card { position: fixed; width: min(360px, calc(100vw - 32px)); background: var(--card); color: var(--ink); border-radius: 18px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); outline: none; transition: left .3s var(--ease), top .3s var(--ease); }
.tour.centre .tour-card { left: 50% !important; top: 50% !important; translate: -50% -50%; }
.tour-card h2 { font-size: 19px; padding-right: 32px; }
.tour-x { position: absolute; right: 12px; top: 12px; }
.tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: grid; place-content: center; gap: 16px; padding: 24px 16px; }
.auth-card { width: min(420px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 28px 24px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.auth-brand { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.auth h1 { font: 600 28px var(--head); font-stretch: 110%; margin: 4px 0 0; }
.lede { color: var(--muted); margin: 0; }
.notice { background: var(--gold-bg); color: var(--gold-ink); padding: 10px 12px; border-radius: 10px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 14px; }
.auth-demo { gap: 12px; padding: 20px 24px; }
.auth-demo strong { font-size: 16px; }
.qr { justify-self: center; background: #fff; border-radius: 12px; padding: 8px; }
.secret { display: block; overflow-wrap: anywhere; background: var(--soft); padding: 8px; border-radius: 8px; margin-top: 6px; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
  .btn:active, .task:active, .tab-add:active { scale: 1; }
}
.deposit-line { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; color: var(--gold-ink); font-weight: 600; font-size: 14px; }
.buylog td:first-child { font-weight: 600; }
.buylog .best td:first-child::after { content: 'Best'; display: inline-block; margin-left: 6px; vertical-align: 2px; font-size: 11px; font-weight: 700; color: var(--gold-ink); background: var(--gold-bg); border-radius: 999px; padding: 2px 8px; }
.floor-edit { position: relative; touch-action: none; user-select: none; }
.floor-edit canvas { width: 100%; height: auto; display: block; border-radius: var(--r); }
.floor-edit .handle { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: grab; }
.cam-guide-toggle[aria-pressed='false'] { opacity: .7; }
.cam-view.no-guide .cam-guide, .cam-view.no-guide .cam-facing, .cam-view.no-guide .cam-tyres { display: none; }
.bg-compare { display: grid; gap: 8px; }
.bg-compare canvas { width: 100%; height: auto; border-radius: var(--r); }

/* ---------- reports ---------- */
.report-row strong { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.more-row > span.report-ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid !important; place-items: center; background: var(--teal-soft); color: var(--accent); }
.report-head { flex-wrap: wrap; align-items: flex-end; }
.report-head > div:first-child { flex: 1 1 320px; }
.export-btns .btn { flex: 1 1 auto; }
@media (max-width: 559px) { .export-btns { width: 100%; } .export-btns .btn { flex: 1 1 0; padding-left: 12px; padding-right: 12px; } }
.report-dates { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.report-dates .field { flex: 1 1 140px; }
.report-dates input { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); width: 100%; }
.report-loading { padding: 28px 4px; }
.tbl-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.report-tbl { font-size: 14px; }
.report-tbl th { white-space: nowrap; }
.report-tbl td { white-space: nowrap; }
.report-tbl td.wrapcell { white-space: normal; min-width: 240px; max-width: 360px; }
.report-tbl td.strong { font-weight: 700; color: var(--ink); }
.report-tbl tbody tr:nth-child(even) td { background: var(--soft); }
.report-tbl tfoot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.report-more { margin: 12px 0 0; }

/* Add a car: the Autotrader advert route */
.or-route { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.or-route p { margin: 0; display: grid; gap: 2px; flex: 1 1 220px; }
.or-route .muted { font-size: 14px; }
.check span { display: grid; gap: 2px; }
.check small { font-weight: 400; color: var(--muted); font-size: 13px; }
.warn[hidden] { display: none; }
.stack > .warn { align-items: flex-start; font-weight: 500; line-height: 1.45; }
.stack > .warn .ic { flex: none; margin-top: 1px; }

/* ---------- the Invoice OS logo in motion: the welcome animation (welcome.js) and the page loading mark ---------- */
/* Each coloured shard of the tile has a turn (--i) going clockwise and a direction it flies in from. */
.sh1 { --i: 0; --dx: -340px; --dy: -300px; --r: -16deg; }
.sh3 { --i: 1; --dx: 0px; --dy: -380px; --r: 10deg; }
.sh4 { --i: 2; --dx: 340px; --dy: -320px; --r: 18deg; }
.sh5 { --i: 3; --dx: 380px; --dy: 0px; --r: -10deg; }
.sh7 { --i: 4; --dx: 320px; --dy: 300px; --r: 14deg; }
.sh8 { --i: 5; --dx: 360px; --dy: 360px; --r: -18deg; }
.sh6 { --i: 6; --dx: 0px; --dy: 380px; --r: 12deg; }
.sh2 { --i: 7; --dx: -380px; --dy: 220px; --r: -12deg; }
.logo-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.logo-svg .sh, .logo-svg .lf { transform-box: fill-box; transform-origin: center; }

.welcome { display: none; }
html.ios-welcome body { overflow: hidden; }
html.ios-welcome .welcome { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; color: #fff; background-color: #0f1e2e; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 28px 28px; cursor: pointer; }
@media (prefers-color-scheme: dark) { html.ios-welcome .welcome { background-color: #0a1520; } }
.welcome-in { display: grid; justify-items: center; gap: 24px; }
.welcome-logo { width: 112px; height: 112px; animation: w-tile 1.3s cubic-bezier(.2, .7, .2, 1) both; }
.welcome .sh { animation: w-shard .72s cubic-bezier(.2, .9, .25, 1.12) both; animation-delay: calc(var(--i) * 60ms + 80ms); }
.welcome .lf { transform-origin: 50% 0; animation: w-f .55s cubic-bezier(.25, .9, .3, 1.25) .66s both; }
.welcome-word { display: grid; justify-items: center; gap: 12px; }
.welcome-word strong { font: 700 28px/1.1 var(--head); letter-spacing: -.02em; animation: w-up .5s cubic-bezier(.2, .7, .2, 1) .92s both; }
.welcome-by { display: flex; align-items: center; gap: 8px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #6cc3cf; animation: w-up .5s cubic-bezier(.2, .7, .2, 1) 1.04s both; }
.welcome-by img { width: 62px; height: auto; }
.welcome-stripe { display: block; width: 128px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #eda944 0 16.6%, #f4c842 16.6% 33.3%, #d3dc55 33.3% 50%, #97c459 50% 66.6%, #3d8399 66.6% 83.3%, #b5292f 83.3%); transform-origin: left; animation: w-line .62s cubic-bezier(.6, 0, .2, 1) 1.12s both; }
.welcome.waiting .sh { animation: w-chase 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * 150ms); }
.welcome.done { opacity: 0; transition: opacity .5s ease .1s; }
.welcome.done .welcome-in { transform: scale(.96) translateY(-8px); transition: transform .6s cubic-bezier(.4, 0, .2, 1); }
@keyframes w-shard { from { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(.5); } }
@keyframes w-f { from { opacity: 0; transform: translateY(-160px); } }
@keyframes w-tile { from { transform: scale(.84); } 62% { transform: scale(1.03); } to { transform: none; } }
@keyframes w-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes w-line { from { transform: scaleX(0); } }
@keyframes w-chase { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* moving between pages: the colour bar under the header, the loading mark when it takes a while, the page rising in */
.top { position: sticky; }
/* on phones a glint of light runs along the colour stripe under the header; on wide screens (no stripe) a colour bar grows */
.route-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; overflow: hidden; opacity: 0; pointer-events: none; z-index: 2; }
.route-bar::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 35%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95), transparent); transform: translateX(-100%); }
.route-bar.on { opacity: 1; }
.route-bar.on::before { animation: bar-glint .9s cubic-bezier(.4, 0, .2, 1) infinite; }
.route-bar.end { opacity: 0; transition: opacity .3s ease; }
@keyframes bar-glint { to { transform: translateX(300%); } }
@media (min-width: 960px) {
  .route-bar { right: auto; bottom: -1px; width: 0; height: 3px; overflow: visible; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, var(--s1), var(--s2), var(--s3), var(--s4), var(--s5), var(--s6)); }
  .route-bar::before { display: none; }
  .route-bar.on { animation: bar-grow 4s cubic-bezier(.08, .6, .2, 1) forwards; }
  .route-bar.end { width: 100%; opacity: 0; transition: width .2s ease, opacity .3s ease .2s; }
}
@keyframes bar-grow { to { width: 88%; } }
.route-wait { position: fixed; z-index: 40; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; opacity: 0; transform: scale(.8); pointer-events: none; transition: opacity .2s ease, transform .3s cubic-bezier(.2, .7, .2, 1.2); filter: drop-shadow(0 10px 24px rgba(15, 30, 46, .28)); }
.route-wait.on { opacity: 1; transform: none; }
.route-wait .sh { animation: w-chase 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * 130ms); }
@media (min-width: 960px) { .route-wait { left: calc(50% + 124px); } }
.main.entering > .page > * { animation: page-in .4s cubic-bezier(.2, .7, .2, 1) both; }
.main.entering > .page > :nth-child(2) { animation-delay: 40ms; }
.main.entering > .page > :nth-child(3) { animation-delay: 80ms; }
.main.entering > .page > :nth-child(4) { animation-delay: 120ms; }
.main.entering > .page > :nth-child(5) { animation-delay: 160ms; }
.main.entering > .page > :nth-child(n+6) { animation-delay: 200ms; }
@keyframes page-in { from { opacity: 0; translate: 0 12px; } }
@media (prefers-reduced-motion: reduce) {
  .welcome *, .welcome-logo, .route-wait *, .main.entering > .page > * { animation: none !important; }
  .route-bar { display: none; }
  .welcome.done .welcome-in { transform: none; }
}

/* phones: the bottom bar steps aside while the keyboard is up (see keyboardAware in main.js) */
@media (pointer: coarse) and (max-width: 959px) {
  html.typing .tabs { visibility: hidden; opacity: 0; pointer-events: none; }
}


/* ======================================================================================================== */
/* ---------- Invoice OS ---------- */
.side-new { margin: 0 4px 14px; width: calc(100% - 8px); }
.more-row .more-ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid !important; place-items: center; background: var(--teal-soft); color: var(--accent); }
.pill.red { background: var(--red-bg); color: var(--red); }
.red { color: var(--red); font-weight: 600; }
.left { justify-self: start; }
.k-overdue { background: var(--red-bg); color: var(--red); } .k-accepted { background: var(--green-bg); color: var(--green); } .k-draft { background: var(--soft); color: var(--ink-2); } .k-repeat { background: var(--blue-bg); color: var(--blue); }
.task-amount { font: 600 15px var(--head); font-variant-numeric: tabular-nums; flex: none; }
@media (max-width: 420px) { .task-amount { display: none; } }
a.figure { text-decoration: none; color: inherit; transition: translate .15s var(--ease), box-shadow .15s; }
@media (hover: hover) { a.figure:hover { translate: 0 -2px; box-shadow: 0 10px 28px -12px rgba(15, 30, 46, .25); } }
.quick-btn .ic { color: var(--accent); }

/* lists of invoices, quotes and customers */
.doc-list { display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px; }
.doc-list > * { min-width: 0; }
.doc-row { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: var(--r); text-decoration: none; transition: background .12s, scale .12s var(--ease); -webkit-tap-highlight-color: transparent; }
.doc-row + .doc-row { box-shadow: 0 -1px 0 var(--line); }
@media (hover: hover) { .doc-row:hover { background: var(--soft); box-shadow: none; } .doc-row:hover + .doc-row { box-shadow: none; } }
.doc-row:active { scale: .985; }
.doc-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.doc-main > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-main > span { font-size: 14px; }
.doc-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.doc-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-amount { font: 600 17px var(--head); font-variant-numeric: tabular-nums; flex: none; min-width: 84px; text-align: right; }
@media (max-width: 480px) { .doc-row { flex-wrap: wrap; row-gap: 0; } .doc-amount { order: -1; margin-left: auto; display: none; } }
.owed { display: grid; justify-items: end; flex: none; }
.owed strong { font: 600 16px var(--head); color: var(--red); font-variant-numeric: tabular-nums; }

/* one invoice, quote or repeat invoice */
.doc-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.doc-head .row-btns { flex-wrap: wrap; }
.doc-total { font: 600 30px/1 var(--head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 559px) { .action-bar > .btn-primary { flex: 1 1 100%; } .action-bar > .btn-ghost { flex: 1 1 calc(50% - 4px); padding-left: 10px; padding-right: 10px; } }
.from-links { margin-top: 12px; display: grid; gap: 8px; }
.card-sec.quiet { background: transparent; box-shadow: none; border-style: dashed; }
.card-sec.quiet .or-route { margin: 0; padding: 0; border: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.timeline li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.timeline .ic { color: var(--accent); margin-top: 2px; }
.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch-ui { width: 52px; height: 32px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.switch-ui::after { content: ''; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: translate .2s var(--ease); }
.switch input:checked + .switch-ui { background: var(--accent); }
.switch input:checked + .switch-ui::after { translate: 20px 0; }
.switch input:focus-visible + .switch-ui { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* the invoice as the customer sees it: always a white page, in the business's own colour */
.paper-wrap { max-width: 860px; width: 100%; }
.paper { --brand: #0f1e2e; --p-ink: #0f1e2e; --p-muted: #5d6a76; --p-line: #e7e8e3; position: relative; background: #fff; color: var(--p-ink); border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15, 30, 46, .05), 0 18px 48px -18px rgba(15, 30, 46, .22); overflow: hidden; display: grid; gap: 22px; padding: 0 22px 22px; font-size: 14.5px; }
@media (min-width: 700px) { .paper { padding: 0 44px 40px; gap: 28px; } }
.paper-band { height: 8px; margin: 0 -44px; background: var(--brand); }
.paper-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start; }
.paper-brand { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.paper-brand img { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.paper-brand div { display: grid; gap: 2px; min-width: 0; }
.paper-brand strong { font: 600 19px/1.2 var(--head); letter-spacing: -.01em; }
.paper-brand span { color: var(--p-muted); font-size: 13px; }
.paper-title { display: grid; justify-items: end; gap: 2px; margin-left: auto; text-align: right; position: relative; }
.paper-kind { font: 600 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--brand); }
.paper-title strong { font: 600 26px/1.1 var(--head); letter-spacing: -.02em; }
.paid-stamp { margin-top: 6px; font: 700 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #1f7a4f; border: 2px solid #1f7a4f; border-radius: 6px; padding: 5px 9px; rotate: -4deg; }
.paper-meta { display: grid; gap: 18px; padding-top: 18px; border-top: 1px solid var(--p-line); }
@media (min-width: 640px) { .paper-meta { grid-template-columns: 1.2fr 1fr 1fr; } }
.paper-meta > div { display: grid; gap: 3px; align-content: start; }
.paper-meta span:not(.lbl) { color: var(--p-muted); font-size: 13.5px; }
.lbl { font: 600 10.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--p-muted, var(--muted)); }
.reg { display: inline-block; justify-self: start; font: 700 14px/1 var(--head); letter-spacing: .06em; background: #f2c94c; color: #111; border-radius: 4px; padding: 5px 8px; }
.paper-dates { margin: 0; display: grid; gap: 6px; align-content: start; }
.paper-dates div { display: flex; justify-content: space-between; gap: 12px; }
.paper-dates dt { color: var(--p-muted); font-size: 13.5px; } .paper-dates dd { margin: 0; font-weight: 600; text-align: right; }
.paper-lines { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.paper-lines th { font: 600 10.5px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--p-muted); text-align: left; padding: 10px 8px; background: #f4f5f1; }
.paper-lines th:first-child { border-radius: 8px 0 0 8px; } .paper-lines th:last-child { border-radius: 0 8px 8px 0; }
.paper-lines td { padding: 12px 8px; border-bottom: 1px solid var(--p-line); vertical-align: top; }
.paper-lines .n { text-align: right; white-space: nowrap; }
.paper-lines td:last-child { font-weight: 600; }
.line-kind { display: block; font: 700 9.5px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--brand, var(--accent)); margin-bottom: 2px; }
.paper-lines td:first-child { min-width: 150px; }
@media (max-width: 520px) { .paper-lines th:nth-child(2), .paper-lines td:nth-child(2), .paper-lines th:nth-child(3), .paper-lines td:nth-child(3) { display: none; } }
.paper-totals { justify-self: end; width: min(320px, 100%); display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.paper-totals div { display: flex; justify-content: space-between; gap: 12px; color: var(--p-muted); }
.paper-totals .grand { margin-top: 4px; padding: 14px 16px; border-radius: 12px; background: var(--brand); color: #fff; font: 600 18px var(--head); }
.paper-notes { margin: 0; padding: 14px 16px; background: #f7f7f4; border-radius: 12px; white-space: pre-line; }
.paper-pay { border: 1px solid var(--p-line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 10px; }
.paper-pay .lbl { color: var(--brand); }
.paper-pay dl { margin: 0; display: grid; gap: 8px 24px; }
@media (min-width: 560px) { .paper-pay dl { grid-template-columns: 1fr 1fr; } }
.paper-pay dl div { display: flex; justify-content: space-between; gap: 12px; }
.paper-pay dt { color: var(--p-muted); } .paper-pay dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.paper-foot { border-top: 1px solid var(--p-line); padding-top: 16px; color: var(--p-muted); }
.paper-foot p { margin: 0 0 4px; } .paper-foot .small { font-size: 12.5px; }
.paper.is-paid .paper-totals .grand { background: #1f7a4f; }

/* writing an invoice, a quote or a repeat invoice */
.edit .card-sec h3 { margin: 0; }
.lines { display: grid; gap: 10px; }
.line-row { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); position: relative; }
.line-row::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--s5); }
.line-row.k-part::before { background: var(--s1); } .line-row.k-other::before { background: var(--s4); }
.line-top { display: grid; grid-template-columns: 112px 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 459px) { .line-top { grid-template-columns: 1fr auto; } .line-top input { grid-column: 1 / -1; order: 3; } }
.line-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.line-nums.has-vat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.line-nums label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.line-nums input, .line-nums select { min-height: 44px !important; padding: 8px 10px !important; font-variant-numeric: tabular-nums; }
.line-sum { display: grid; gap: 4px; justify-items: end; font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 10px; }
.line-amount { font: 600 17px var(--head); color: var(--ink); font-variant-numeric: tabular-nums; }
.edit-totals { justify-self: end; width: min(300px, 100%); display: grid; gap: 6px; padding-top: 6px; font-variant-numeric: tabular-nums; }
.edit-totals div { display: flex; justify-content: space-between; color: var(--muted); }
.edit-totals .grand { color: var(--ink); font: 600 22px var(--head); border-top: 2px solid var(--ink); padding-top: 10px; }
.add-lines .ic { color: inherit; }
.new-cust { padding: 14px; border-radius: var(--r); background: var(--teal-soft); }
.sticky-actions { position: sticky; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 10px); z-index: 20; display: flex; gap: 8px; justify-content: flex-end; padding: 10px; border-radius: 999px; background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sticky-actions .btn { flex: 1 1 0; }
@media (min-width: 960px) { .sticky-actions { bottom: 20px; } .sticky-actions .btn { flex: 0 0 auto; } }
html.typing .sticky-actions { bottom: 10px; }
.plate.sm { font-size: 16px !important; min-height: 44px !important; padding: 6px 8px !important; }
.veh-row { display: grid; grid-template-columns: 120px 1fr 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 519px) { .veh-row { grid-template-columns: 1fr 1fr auto; } .veh-row .plate { grid-column: 1 / -1; } }

/* customers */
.cust-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1000px) { .cust-grid { grid-template-columns: 1.1fr 1fr; } }
.cust-grid > * { min-width: 0; }

/* settings */
.choices { display: grid; gap: 10px; }
@media (min-width: 560px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; background: var(--card); transition: border-color .15s, background .15s; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.choice span { display: grid; gap: 3px; } .choice small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--teal-soft); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--sw); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: scale .12s var(--ease); }
.swatch[aria-checked='true'] { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--sw); }
.swatch:active { scale: .92; }
input[type='color'] { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.brand-preview { --brand: #0f1e2e; background: #fff; color: #0f1e2e; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.bp-band { height: 8px; background: var(--brand); }
.bp-head { display: flex; align-items: center; gap: 14px; padding: 18px; }
.bp-head img { width: 48px; height: 48px; border-radius: 10px; }
.bp-head div { display: grid; flex: 1; } .bp-head strong { font: 600 17px var(--head); } .bp-head span { color: #5d6a76; font-size: 13px; }
.bp-nologo { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; font: 700 22px var(--head); }
.bp-total { font: 600 15px var(--head) !important; color: #fff !important; background: var(--brand); border-radius: 999px; padding: 8px 14px; }
.days-row input { text-align: center; }
.plan-card { background: linear-gradient(160deg, var(--card) 55%, var(--teal-soft)); }
.plan-top { display: flex; align-items: center; gap: 12px; }
.plan-top > div { display: grid; flex: 1; } .plan-top strong { font: 600 18px var(--head); } .plan-top .muted { font-size: 13px; }
.plan-price { font: 600 28px var(--head) !important; letter-spacing: -.02em; } .plan-price small { font: 600 14px var(--font); color: var(--muted); }

/* the plain words about tax, and the terms */
.key-point { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r); background: var(--teal-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.key-point .ic { color: var(--accent); margin-top: 2px; }
.key-point p { margin: 0; display: grid; gap: 4px; } .key-point span { font-size: 15px; line-height: 1.55; }
.terms-card { width: min(480px, calc(100vw - 32px)); gap: 16px; }
.auth-brand .by-proven { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-left: auto; }
.auth-brand .by-proven img { width: 52px; height: auto; }
@media (prefers-color-scheme: dark) { .auth-brand .by-proven img, .welcome-by img { filter: brightness(1.15); } }
.terms-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.terms-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.terms-points .ic { color: var(--accent); margin-top: 2px; }
.terms-text { display: grid; gap: 4px; }
.terms-sec h3 { font-size: 16px; margin: 12px 0 6px; }
.terms-sec p { color: var(--ink-2); }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.share-btns .btn { flex: 1 1 0; }
.small-facts { font-size: 14px; }
.small-facts dd { overflow-wrap: anywhere; font-weight: 600; }

/* the page the customer opens: the business's branding, Invoice OS out of sight */
.pay-page { --brand: #0f1e2e; min-height: 100vh; background: #f6f6f3; color: #0f1e2e; color-scheme: light; display: grid; grid-template-rows: auto auto 1fr auto; }
.pay-demo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; padding: 10px 16px; background: #0f1e2e; color: #fff; font-size: 14px; font-weight: 600; }
.pay-demo .btn { background: #fff; color: #0f1e2e; min-height: 36px; }
.pay-band { height: 10px; background: var(--brand); }
.pay-main { width: 100%; max-width: 860px; margin: 0 auto; padding: 28px 16px 40px; display: grid; gap: 20px; align-content: start; }
.pay-brand { display: flex; gap: 14px; align-items: center; }
.pay-brand img { width: 64px; height: 64px; border-radius: 14px; }
.pay-brand div { display: grid; } .pay-brand strong { font: 600 21px var(--head); } .pay-brand span { color: #5d6a76; font-size: 14px; }
.pay-due { background: #fff; border-radius: 20px; padding: 24px; display: grid; gap: 8px; box-shadow: 0 1px 2px rgba(15, 30, 46, .05), 0 18px 48px -20px rgba(15, 30, 46, .25); border-top: 5px solid var(--brand); }
.pay-due .lbl { color: #5d6a76; }
.pay-amount { font: 600 44px/1.05 var(--head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pay-status { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 600; color: #33424f; }
.pay-status.ok { color: #1f7a4f; } .pay-status.late { color: #b5292f; }
.btn-brand { background: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px var(--brand); }
.pay-page .btn-ghost { border-color: #dcdcd6; color: #0f1e2e; }
.pay-bank { background: #fff; border-radius: 20px; padding: 22px 24px; display: grid; gap: 4px; border: 1px solid #e7e8e3; }
.pay-bank h2 { font-size: 19px; margin: 0; } .pay-bank .muted { color: #5d6a76; font-size: 14px; margin: 4px 0 10px; }
.copy-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #ecece7; }
.copy-row span { color: #5d6a76; } .copy-row strong { font: 600 17px var(--head); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.copy-row .icon-btn { background: #f0f2ef; color: #0f1e2e; }
.pay-page .paper { box-shadow: none; }
.pay-foot { padding: 20px 16px 32px; display: flex; justify-content: center; }
.pay-foot a { display: inline-flex; align-items: center; gap: 8px; font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #8a949d; text-decoration: none; opacity: .85; }
.pay-foot a:hover { opacity: 1; }
.pay-foot img { width: 62px; height: auto; }
.field { align-content: start; }
@media (min-width: 960px) { .sticky-actions { justify-self: end; padding: 8px; } }
.pay-page .paper .paper-pay { display: none; }
@media (max-width: 559px) { .action-bar > .btn-ghost { font-size: 14px; gap: 6px; padding-left: 8px; padding-right: 8px; } }
input[type='color']:not([type='checkbox']):not([type='radio']):not([type='range']) { width: 52px; min-height: 40px; height: 40px; padding: 3px; flex: none; }

/* ---------- the way in: sign in, creating an account, the demo ---------- */
.auth-card.wide { width: min(560px, calc(100vw - 32px)); }
.auth-switch { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.link-btn.strong { color: var(--accent); font-weight: 700; font-size: 14px; text-decoration: none; padding: 4px 2px; }
.demo-top { display: flex; gap: 12px; align-items: center; }
.demo-top div { display: grid; gap: 2px; }
.price-line { font-weight: 600; color: var(--ink-2); }
.centre { text-align: center; }
.auth .stepper { margin: 2px 0 0; }
.plan-choices { display: grid; gap: 10px; }
.plan-choice { position: relative; display: flex; gap: 14px; align-items: center; padding: 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--card); cursor: pointer; transition: border-color .15s, background .15s; }
.plan-choice input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }
.plan-choice:has(input:checked) { border-color: var(--accent); background: var(--teal-soft); }
.plan-choice-text { display: grid; gap: 2px; flex: 1; }
.plan-choice-text strong { font-size: 15px; }
.plan-choice-price { font: 600 24px/1.1 var(--head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-choice-price small { font: 600 14px var(--font); color: var(--muted); letter-spacing: 0; }
.plan-save { font-size: 13px; font-weight: 700; color: var(--green); }
.plan-choice.best::after { content: 'Best value'; position: absolute; right: 14px; top: -11px; font-size: 11px; font-weight: 800; letter-spacing: .02em; color: var(--navy); background: var(--s1); border-radius: 999px; padding: 4px 10px; }
.done-card { text-align: center; justify-items: center; }
.done-card .auth-brand { justify-self: stretch; }
.done-card .terms-points { text-align: left; justify-self: stretch; }
.done-tick { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--green-bg); color: var(--green); animation: tick-in .5s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes tick-in { from { scale: .4; opacity: 0; } }
.demo-pay h1 { font-size: 40px; }
