/* Safariwatch certificate system — one plain stylesheet, no build step.
   Look (2026-11-19, review correction 7): the user's own model screens (docs/mockups/user-admin-screens.html).
   Deep teal menu, teal buttons and links, AMBER only for the key action (New installation, Renew, the open menu item),
   light grey page with white cards, plus a dark mode. Every screen works on a phone.
   Rules: spacing 8 / 16 / 24 / 40 · corners 6 (plates, tags) · 10 (fields, buttons) · 16 (cards, banners)
   · text 28 / 18 / 16 / 14 / 12 · headings and big numbers in Space Grotesk, text in Inter,
   serials / SIMs / certificate numbers in IBM Plex Mono (0/O and 1/I never mixed up)
   · teal = pressable · amber = the one key action · plate yellow only on plates · red only for problems. */

:root {
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --surface-2: #F6F8FA;       /* table heads, people rows, quiet panels */
  --line: #E2E8F0;
  --line-soft: #EDF1F5;
  --text: #0F1B2A;
  --muted: #5B6B7D;
  --brand: #0F766E;           /* teal: buttons, links, focus */
  --brand-hover: #115E59;
  --brand-ink: #FFFFFF;
  --brand-soft: #D9F2EE;      /* light teal: icon tiles, selected rows */
  --amber: #F59E0B;           /* the key action only */
  --amber-hover: #E08E05;
  --amber-ink: #1F1500;
  --amber-soft: #FEF3C7;
  --accent: #F59E0B;
  --accent-strong: #0F766E;
  --nav: #0B3B37;             /* side menu */
  --nav-text: #D3E5E1;
  --nav-group: #7DAAA3;
  --nav-active: #F59E0B;      /* the open menu item is amber, dark text */
  --nav-active-ink: #1F1500;
  --nav-hover: #11504A;
  --nav-line: #1E5751;
  --ok-on-nav: #7FE0B4;
  --ok: #15803D;   --ok-bg: #DCFCE7;
  --warn: #B45309; --warn-bg: #FEF3C7;
  --bad: #B91C1C;  --bad-bg: #FEE4E2;
  --info: #0F766E; --info-bg: #D9F2EE;
  --off: #4B5868;  --off-bg: #E8EDF2;
  --violet: #6D28D9; --violet-bg: #EDE9FE;
  --mark: #FFE58A;
  --plate: #FFD84D;
  --plate-ink: #111111;
  --radius: 10px;             /* fields and buttons */
  --radius-card: 16px;        /* cards and banners */
  --radius-sm: 6px;           /* plates and tags */
  --shadow: 0 1px 2px rgb(11 59 55 / .04), 0 2px 10px rgb(11 59 55 / .04);
  --shadow-pop: 0 12px 32px rgb(11 30 28 / .18);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  --monofont: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --side-w: 248px;
  --find-bg: #FFFFFF;          /* the Find box at the top */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1514; --surface: #101F1E; --surface-2: #152826; --line: #22403C; --line-soft: #1A3330; --text: #E4EFED; --muted: #93ADA8;
    --brand: #2DD4BF; --brand-hover: #5EEAD4; --brand-ink: #04201D; --brand-soft: #0F3B37; --accent-strong: #2DD4BF;
    --amber-soft: #3A2A0A; --find-bg: #17332F;
    --nav: #071F1D; --nav-text: #C2D8D4; --nav-group: #6F9A93; --nav-hover: #0E3532; --nav-line: #17403C;
    --ok: #4ADE80; --ok-bg: #0F2E1C; --warn: #FBBF24; --warn-bg: #3A2A0A; --bad: #F87171; --bad-bg: #3B1414;
    --info: #5EEAD4; --info-bg: #0F3B37; --off: #B5C1CF; --off-bg: #22312F; --violet: #C4B5FD; --violet-bg: #2A2245; --mark: #6B5410;
    --shadow: none; --shadow-pop: 0 12px 32px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1514; --surface: #101F1E; --surface-2: #152826; --line: #22403C; --line-soft: #1A3330; --text: #E4EFED; --muted: #93ADA8;
  --brand: #2DD4BF; --brand-hover: #5EEAD4; --brand-ink: #04201D; --brand-soft: #0F3B37; --accent-strong: #2DD4BF;
  --amber-soft: #3A2A0A; --find-bg: #17332F;
  --nav: #071F1D; --nav-text: #C2D8D4; --nav-group: #6F9A93; --nav-hover: #0E3532; --nav-line: #17403C;
  --ok: #4ADE80; --ok-bg: #0F2E1C; --warn: #FBBF24; --warn-bg: #3A2A0A; --bad: #F87171; --bad-bg: #3B1414;
  --info: #5EEAD4; --info-bg: #0F3B37; --off: #B5C1CF; --off-bg: #22312F; --violet: #C4B5FD; --violet-bg: #2A2245; --mark: #6B5410;
  --shadow: none; --shadow-pop: 0 12px 32px rgb(0 0 0 / .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); }
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
h1 { font: 700 1.75rem/1.2 var(--display); margin: 0 0 .25rem; letter-spacing: -.015em; }
h2 { font: 600 1.125rem/1.3 var(--display); margin: 1.5rem 0 .5rem; letter-spacing: -.005em; }
h3 { font-family: var(--display); }
p { margin: .25rem 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.display { font-family: var(--display); }
code, .mono { font-family: var(--monofont); font-size: .95em; font-weight: 500; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0; }
.ic { flex: 0 0 auto; display: block; }

/* Page title with breadcrumbs (model: "Dashboard / Vehicles", big title, one line under it) */
.crumbs { font-size: .8125rem; color: var(--muted); margin: 0 0 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin: 0 0 20px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head .actions { margin: 0; }

/* ---------------------------------------------------------------- shell
   Phones: teal header (logo, light/dark, bell, me) with Find under it, and a bottom bar; Menu opens tiles by section.
   Computers (≥ 900 px): teal side menu grouped by section (it folds to icons only and remembers that),
   Find at the top of every page with the bell and the amber key action next to it. */
.app { min-height: 100vh; }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 20; background: var(--nav); color: #fff; padding: 6px 8px 12px 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px; }
.top .brand { grid-row: 1; grid-column: 1; }
.top .top-tools { grid-row: 1; grid-column: 2; display: flex; align-items: center; gap: 2px; }
.top .searchbox { grid-row: 2; grid-column: 1 / -1; margin-right: 4px; background: var(--find-bg); }
.top .keyaction { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand .logo { width: 34px; height: 34px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.brand .logo img { display: block; width: 100%; height: 100%; }   /* the real mark (group 11), no longer the amber placeholder */
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand .brand-text strong { font: 700 1.1875rem/1.15 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.brand .brand-text small { font-size: .75rem; color: var(--nav-text); opacity: .85; white-space: nowrap; }
.top .brand .brand-text small { display: none; }
.iconbtn { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius); background: transparent; color: inherit; cursor: pointer; text-decoration: none; padding: 0; }
.iconbtn:hover { background: rgb(255 255 255 / .08); color: inherit; }
.theme-dark-ic { display: none; }
:root[data-theme="dark"] .theme-dark-ic { display: block; }
:root[data-theme="dark"] .theme-light-ic { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-dark-ic { display: block; }
  :root:not([data-theme="light"]) .theme-light-ic { display: none; }
}
.avatar { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: #2BB5A3; color: #062B27; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8125rem; }
.who { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.who:hover { color: inherit; }
.who .who-text { display: none; }
.top .who { padding: 0 5px; }

/* Bell: what needs attention, loaded when the page has opened (so it never slows a page down) */
.bell > summary { list-style: none; }
.bell > summary::-webkit-details-marker { display: none; }
.bell-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: #EF4444; box-shadow: 0 0 0 2px var(--nav); }
.bell .more-menu { left: auto; right: 0; width: min(340px, calc(100vw - 24px)); padding: 8px; color: var(--text); }
.bell-head { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 8px 8px; font-weight: 600; font-family: var(--display); }
.bell-list { display: flex; flex-direction: column; gap: 4px; }
.bell-list a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.bell-list a:hover { background: var(--surface-2); color: var(--text); }
.bell-list .bico { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.bell-list .grow { flex: 1 1 auto; min-width: 0; font-size: .9375rem; line-height: 1.3; }
.bell-list .grow span { display: block; font-size: .8125rem; color: var(--muted); }
.bell-list b { font-family: var(--display); font-size: 1.125rem; }
.bell-empty { padding: 8px 8px 12px; color: var(--muted); font-size: .9375rem; }

/* coloured icon squares (tiles, attention rows, bell): same colour = same kind of thing */
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-off { background: var(--off-bg); color: var(--off); }
.tone-violet { background: var(--violet-bg); color: var(--violet); }
.tone-amber { background: var(--amber-soft); color: var(--warn); }

.searchbox { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 4px 0 12px; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface); color: var(--text); }
.searchbox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.searchbox .ic { color: var(--muted); }
.searchbox input[type=search] { flex: 1 1 auto; min-width: 0; height: 40px; border: 0; outline: none; background: transparent; color: var(--text); font: 16px var(--sans); padding: 0; min-height: 0; box-shadow: none; }
.searchbox input[type=search]:focus { outline: none; }
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox .go { height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--brand); color: var(--brand-ink); font: 600 .875rem var(--sans); cursor: pointer; display: none; }
.searchbox .scan { width: 40px; height: 40px; border: 0; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.searchbox .clear { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px; }
.scanbox { margin: 0 0 1rem; }
.scanbox video { width: 100%; max-width: 420px; border-radius: var(--radius); background: #000; display: block; }

main.page { padding: 16px 16px 96px; max-width: 1320px; }

.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 68px; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.bottombar > a, .bottombar > details > summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .75rem; font-weight: 500; text-decoration: none; cursor: pointer; list-style: none; height: 100%; text-align: center; line-height: 1.15; }
.bottombar > details > summary::-webkit-details-marker { display: none; }
.bottombar > a[aria-current="page"] { color: var(--brand); font-weight: 600; }
.bottombar .main-action { color: var(--text); font-weight: 600; }
.bottombar .main-action .bubble { width: 36px; height: 36px; border-radius: 50%; background: var(--amber); color: var(--amber-ink); display: flex; align-items: center; justify-content: center; }

/* Phone menu: a sheet from the bottom with this person's items as tiles, by section */
.sheet[open] > summary::before { content: ""; position: fixed; inset: 0 0 68px; background: rgb(3 20 18 / .55); z-index: -1; }
.sheet-panel { position: fixed; left: 0; right: 0; bottom: 68px; max-height: calc(100vh - 140px); overflow-y: auto; background: var(--surface); color: var(--text); border-radius: 18px 18px 0 0; padding: 8px 16px 16px; box-shadow: var(--shadow-pop); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 8px; }
.sheet-head strong { font: 600 1.125rem var(--display); }
.sheet-sec { margin: 12px 0 6px; font-size: .6875rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: 8px 4px; border-radius: 14px; background: var(--surface-2); color: var(--text); font-size: .8125rem; font-weight: 600; text-decoration: none; text-align: center; line-height: 1.2; }
.sheet-grid a .ic { color: var(--brand); }
.sheet-grid a[aria-current="page"] { outline: 2px solid var(--amber); }
.sheet-links { display: flex; flex-direction: column; margin-top: 16px; border-top: 1px solid var(--line); }
.sheet-links a, .sheet-links button { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: 16px var(--sans); text-decoration: none; padding: 0; cursor: pointer; text-align: left; width: 100%; }
.sheet-links form { margin: 0; }
.sheet-links .danger { color: var(--bad); font-weight: 600; border-bottom: 0; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); transition: grid-template-columns .15s; }
  .side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; background: var(--nav); color: var(--nav-text); padding: 20px 14px 16px; scrollbar-width: thin; scrollbar-color: var(--nav-line) transparent; }
  .side-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 0 0 6px 6px; }
  .side-head .iconbtn { width: 36px; height: 36px; color: var(--nav-group); }
  .side-head .iconbtn:hover { color: #fff; background: var(--nav-hover); }
  .side nav { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; }
  .side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  .side nav a { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: var(--radius); color: var(--nav-text); font-size: .9375rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
  .side nav a:hover { background: var(--nav-hover); color: #fff; }
  .side nav a[aria-current="page"] { background: var(--nav-active); color: var(--nav-active-ink); font-weight: 600; }
  .side .grp-link { min-height: 30px !important; padding: 0 12px !important; font-size: .6875rem !important; font-weight: 600 !important; letter-spacing: .1em; text-transform: uppercase; color: var(--nav-group) !important; justify-content: space-between; }
  .side .grp-link .ic { opacity: 0; transition: opacity .1s; }
  .side .grp-link:hover .ic, .side .grp-link:focus-visible .ic, .side .grp-link[aria-current="page"] .ic { opacity: 1; }
  .side .grp-link[aria-current="page"] { background: transparent !important; color: #fff !important; }
  .soon { font-size: .7rem; border: 1px solid var(--nav-group); border-radius: 99px; padding: 0 .45rem; color: var(--nav-group); white-space: nowrap; margin-left: auto; }
  .side-foot { display: flex; align-items: center; gap: 4px; padding: 14px 4px 0; border-top: 1px solid var(--nav-line); }
  .side-foot .who { flex: 1 1 auto; padding: 4px; border-radius: var(--radius); }
  .side-foot .who:hover { background: var(--nav-hover); }
  .side-foot .who .who-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
  .side-foot .who-text strong { color: #fff; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-foot .who-text span { font-size: .8125rem; color: var(--nav-group); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-foot form { margin: 0; }
  .side-foot .iconbtn { width: 38px; height: 38px; color: var(--nav-group); }
  .side-foot .iconbtn:hover { color: #fff; background: var(--nav-hover); }
  .avatar { width: 38px; height: 38px; }

  /* folded menu: icons only, the name shows on hover (title) */
  :root[data-side="mini"] { --side-w: 76px; }
  :root[data-side="mini"] .side { padding: 20px 10px 16px; align-items: stretch; }
  :root[data-side="mini"] .side-head { flex-direction: column; padding: 0 0 6px; gap: 10px; }
  :root[data-side="mini"] .side .brand { justify-content: center; }
  :root[data-side="mini"] .side .brand-text,
  :root[data-side="mini"] .side nav .lbl,
  :root[data-side="mini"] .side .soon,
  :root[data-side="mini"] .side-foot .who-text { display: none; }
  :root[data-side="mini"] .side nav a { justify-content: center; padding: 0; }
  :root[data-side="mini"] .side .grp-link { min-height: 1px !important; height: 1px; margin: 4px 10px; background: var(--nav-line) !important; overflow: hidden; }
  :root[data-side="mini"] .side .grp-link .ic { display: none; }
  :root[data-side="mini"] .side-foot { flex-direction: column; padding-top: 12px; }
  :root[data-side="mini"] .side-foot .who { justify-content: center; }
  :root[data-side="mini"] .side-toggle .ic { transform: scaleX(-1); }

  .top { position: sticky; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); color: var(--text); padding: 16px 40px 12px; grid-template-columns: minmax(0, 560px) 1fr auto; gap: 12px; }
  .top .brand, .top .who { display: none; }
  .top .searchbox { grid-column: 1; grid-row: 1; margin: 0; border-color: var(--line); box-shadow: var(--shadow); }
  .top .top-tools { grid-column: 3; gap: 10px; }
  .top .searchbox .go { display: inline-flex; align-items: center; }
  .top .iconbtn { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
  .top .iconbtn:hover { background: var(--surface-2); }
  .top .keyaction { display: inline-flex; }
  .bell-dot { box-shadow: 0 0 0 2px var(--surface); }
  main.page { padding: 12px 40px 48px; }
  .bottombar { display: none; }
}

/* ---------------------------------------------------------------- building blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 16px; margin: 0 0 16px; }
.card > h2:first-child, .box > h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { display: block; text-decoration: none; color: var(--text); }
.tile strong { display: block; }
.tile.off { opacity: .6; }
label { display: block; font-weight: 600; margin: .75rem 0 .25rem; font-size: .9375rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .875rem; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); min-height: 44px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
input[aria-invalid="true"] { border: 2px solid var(--bad); }
input.pin { font-size: 1.6rem; letter-spacing: .6em; text-align: center; font-family: var(--monofont); }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; margin: .5rem 0; }
.check input { width: 1.2rem; height: 1.2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 600 .9375rem var(--sans); padding: 0 18px; min-height: 44px; border-radius: var(--radius); border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-ink); }
.btn.secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn.secondary .ic { color: var(--brand); }
.btn.secondary:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--text); }
/* amber = the one key action on a screen (New installation, Renew) */
.btn.key { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn.key:hover { background: var(--amber-hover); border-color: var(--amber-hover); color: var(--amber-ink); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .875rem; }
.btn.danger { background: var(--surface); border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn.block { width: 100%; margin-top: 1rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; align-items: center; }
.row { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row { grid-template-columns: 1fr 1fr; } .row.three { grid-template-columns: 1fr 1fr 1fr; } }

/* Messages */
.flash { border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 1rem; border: 1px solid; }
.flash.ok { background: var(--ok-bg); border-color: var(--ok); }
.flash.bad { background: var(--bad-bg); border-color: var(--bad); }
.error { color: var(--bad); font-size: .875rem; font-weight: 500; margin: .25rem 0 0; }

/* Status labels: filled, same colours everywhere. Green fine · amber act soon · red problem · grey closed · blue new */
.badge, .pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 600; line-height: 1; padding: 0 10px; min-height: 26px; border-radius: 99px; background: var(--off-bg); color: var(--off); white-space: nowrap; vertical-align: middle; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.ok, .pill.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad, .pill.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn, .pill.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info, .pill.info { background: var(--info-bg); color: var(--info); }
.pill.lg { min-height: 32px; font-size: .875rem; padding: 0 14px; }

/* Number plates look like a real plate, so they stand out in any list */
.plate { display: inline-block; line-height: 26px; min-height: 30px; padding: 0 9px; border: 2px solid #111; border-radius: var(--radius-sm); background: var(--plate); color: #111; font: 600 1rem var(--monofont); letter-spacing: .04em; white-space: nowrap; text-decoration: none; }
a.plate:hover { color: #111; box-shadow: 0 0 0 3px var(--brand-soft); }
.plate mark { background: #fff; }
.plate.lg { line-height: 38px; min-height: 44px; padding: 0 12px; border-width: 3px; font-size: 1.5rem; }
.plate.none { line-height: 26px; background: transparent; border: 2px dashed var(--muted); color: var(--muted); font: 600 .75rem var(--sans); letter-spacing: .06em; text-transform: uppercase; }

/* Filter chips ("Show: All · New installs · Unpaid …") */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; align-items: center; scrollbar-width: none; }
.chips .chips-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 .875rem var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer; }
.chip .n { font-weight: 500; opacity: .85; }
.chip[aria-current="true"], .chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip[aria-current="true"] .n, .chip[aria-pressed="true"] .n { opacity: 1; }
.chip:hover { color: inherit; border-color: var(--brand); }
@media (min-width: 900px) { .chip { min-height: 36px; } }

/* Problem banner at the top of a page: says what is wrong and the one action that fixes it */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px; border-radius: var(--radius-card); border: 1px solid color-mix(in srgb, currentColor 22%, transparent); margin: 0 0 16px; }
.banner .ic { align-self: flex-start; margin-top: 2px; }
.banner .banner-text { flex: 1 1 260px; }
.banner .banner-text > strong { display: block; }   /* the title only, not bold words in the text */
.banner .banner-text div { color: var(--text); font-size: .9375rem; }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.info { background: var(--info-bg); color: var(--info); }
.banner.off { background: var(--off-bg); color: var(--off); }

/* Section boxes and label / value details (Jendie's layout) */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); margin: 0 0 16px; overflow: hidden; }
.box > h2, .box-head { margin: 0; padding: 16px 20px 12px; font: 600 1.0625rem var(--display); }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.box-head h2 { margin: 0; font: 600 1.0625rem var(--display); }
.box-body { padding: 4px 20px 18px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin: 0; }
.kv > div { display: flex; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.kv dt { flex: 0 0 120px; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.kv dd { flex: 1 1 auto; min-width: 0; margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.kv.more-hidden > div:nth-child(n+5) { display: none; }
.lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: .875rem; }
.lines > div > span:first-child { color: var(--muted); }
.lines > div > span:last-child { font-weight: 500; text-align: right; }

/* Stat tiles on Home */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); color: var(--text); text-decoration: none; }
.stat:hover { border-color: var(--brand); color: var(--text); }
.stat .v { font: 700 1.75rem/1.2 var(--display); }
.stat .l { font-size: .875rem; color: var(--muted); line-height: 1.3; }
.stat .v.warn { color: var(--warn); }
.stat .v.bad { color: var(--bad); }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; } .stat { padding: 16px; } .stat .v { font-size: 1.875rem; } }

/* Section tiles (review correction 13): a menu section opens its actions as big tiles */
.stiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.stile { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 148px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: transform .12s, border-color .12s, box-shadow .12s; }
.stile:hover, .stile:focus-visible { color: var(--text); border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.stile .sico { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.stile strong { font: 600 1.0625rem/1.25 var(--display); }
.stile span.d { color: var(--muted); font-size: .875rem; line-height: 1.4; }
.stile .go { position: absolute; top: 18px; right: 16px; color: var(--muted); }
.stile:hover .go { color: var(--brand); }
.stile.key { border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); }
@media (max-width: 639px) { .stiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .stile { min-height: 132px; padding: 14px; } .stile span.d { display: none; } .stile .go { display: none; } }

/* Timeline (vehicle history) */
.timeline { list-style: none; margin: 0; padding: 8px 16px 12px; }
.timeline li { display: flex; gap: 14px; padding: 8px 0; }
.timeline .dot { flex: 0 0 auto; width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--off); }
.timeline .dot.ok { background: var(--ok); } .timeline .dot.warn { background: var(--warn); } .timeline .dot.bad { background: var(--bad); } .timeline .dot.info { background: var(--info); }
.timeline .when { font-size: .875rem; color: var(--muted); }

/* "More" drop-down (details/summary, no script needed) */
.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; min-width: 270px; padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.more-menu a, .more-menu button { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: 15px var(--sans); text-decoration: none; text-align: left; cursor: pointer; width: 100%; }
.more-menu a:hover, .more-menu button:hover { background: var(--surface-2); color: var(--text); }
.more-menu .danger { color: var(--bad); font-weight: 600; }
.more-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.more-menu form { margin: 0; }

/* Vehicle page (more in "vehicle page" near the end) */
.vactions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; align-items: center; }
.vactions form { margin: 0; }
.vcols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.vcols > .vmain { flex: 3 1 480px; min-width: 0; }
.vcols > .vside { flex: 2 1 320px; min-width: 0; }
.bigdate { font: 700 1.5rem/1.25 var(--display); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 14px 16px 16px; }
.photos figure { margin: 0; }
.photos img { width: 100%; border-radius: 8px; display: block; }
.photos figcaption { font-size: .8125rem; color: var(--muted); margin-top: 4px; }
@media (max-width: 899px) {
  .vactions.sticky { position: fixed; left: 0; right: 0; bottom: 68px; z-index: 28; margin: 0; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--line); flex-wrap: nowrap; }
  .vactions.sticky > .btn, .vactions.sticky > form { flex: 1 1 0; }
  .vactions.sticky > .btn.key { order: -1; flex: 2 1 0; }     /* the key action first on phones */
  .vactions.sticky > form .btn { width: 100%; }
  .vactions.sticky .hide-phone { display: none; }
  .vactions.sticky .more-menu { top: auto; bottom: calc(100% + 6px); left: auto; right: 0; }
  .has-sticky main.page { padding-bottom: 170px; }
  .plate.lg { font-size: 1.3rem; min-height: 38px; line-height: 32px; }
}

/* Search results */
.results { display: flex; flex-direction: column; gap: 12px; }
.result { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.result.exact { border: 2px solid var(--ok); }
.result .rtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.result .facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: .875rem; }
.result .facts span { display: block; font-size: .75rem; color: var(--muted); }
.result .facts b { font-weight: 500; overflow-wrap: anywhere; }
.result .ractions { display: flex; gap: 8px; flex-wrap: wrap; }
.result .ractions .btn { flex: 1 1 0; }
.ownercard { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ownercard .ico { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.ownercard .grow { flex: 1 1 auto; min-width: 0; }
@media (min-width: 900px) {
  .result { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; align-items: start; gap: 8px 20px; padding: 16px 20px; }
  .result .rtop { flex-direction: column; align-items: flex-start; }
  .result .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); background: transparent; padding: 0; }
  .result .ractions { flex-direction: column; align-items: stretch; }
  .result .ractions .btn { flex: 0 0 auto; }
}
.tips { padding: 14px 16px; border-radius: var(--radius); background: var(--brand-soft); line-height: 1.7; font-size: .9375rem; }

/* Lists (redesign step 4; the register look of review correction 7): installs, certificates, renewals share one pattern.
   Page head (x-list-head) → one white card (computers): status tabs, find and More filters (.ltools), "Showing N of M" (.lshowing),
   then a table (.lhead + .lrow grid, columns from --cols) with View / Renew at the right. Phones: the same rows as cards.
   The plate link (a.open) covers the whole row, so clicking anywhere opens the vehicle; buttons and ticks sit above it. */
.lsection { margin: 0 0 16px; }
.ltools { margin: 0 0 10px; }
.ltools-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ltools-row .ltabs { flex: 1 1 100%; min-width: 0; }
.ltools-end { display: flex; gap: 8px; flex: 1 1 100%; }
.lfind { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.lfind:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lfind input { flex: 1 1 auto; min-width: 0; height: 40px; border: 0; outline: none; padding: 0; background: transparent; color: var(--text); font: 1rem var(--sans); box-shadow: none; }
.lfind input:focus { box-shadow: none; }
.mbtn { position: relative; flex: 0 0 auto; min-height: 44px; padding: 0 12px; color: var(--text); }
.mcount { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: .75rem; }
.mpanel { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.js .mpanel:not(.open) { display: none; }
.mpanel-head { display: none; }
.mpanel-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 16px; }
.mpanel-fields label { margin-top: 0; font-size: .8125rem; }
.mpanel-actions { display: flex; gap: 8px; margin-top: 16px; }
.mpanel-actions .btn { flex: 1 1 0; max-width: 200px; }
.ltags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: .875rem; }
.ltag { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 4px 0 12px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.ltag a { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 4px; color: inherit; }
.ltag a:hover { background: color-mix(in srgb, var(--brand) 14%, transparent); color: inherit; }
.ltags-clear { font-weight: 600; }
.lshowing { margin: 0 0 10px; font-size: .875rem; color: var(--muted); }
.lshowing b { color: var(--text); font-weight: 600; }

.ltable { --cols: minmax(120px, 1fr) minmax(150px, 1.4fr) minmax(130px, 1fr) minmax(150px, 1.4fr) minmax(130px, 1fr) 150px; --minw: 960px; }
.lhead { display: none; }
.lrows { display: flex; flex-direction: column; gap: 12px; }
.lrow { position: relative; display: grid; grid-template-columns: auto minmax(min-content, 1fr) minmax(0, 1fr); grid-template-areas: "tick veh status" "main main main" "ref ref when" "act act act"; gap: 8px 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.lrow.ticked { border-color: var(--brand); background: var(--brand-soft); }
.lc { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.lc .sub { font-size: .8125rem; color: var(--muted); }
.lc b { font-weight: 500; }
.lc-tick { grid-area: tick; justify-content: center; margin-right: 8px; }
.lc-veh { grid-area: veh; align-items: flex-start; gap: 4px; }
.lc-main { grid-area: main; }
.lc-main b { font-weight: 600; font-size: 1rem; }
.lc-ref, .lc-when { background: var(--surface-2); padding: 8px 12px; font-size: .875rem; }
.lc-ref { grid-area: ref; border-radius: 8px 0 0 8px; }
.lc-when { grid-area: when; border-radius: 0 8px 8px 0; }
.lc-ref::before, .lc-when::before { content: attr(data-label); font-size: .75rem; color: var(--muted); }
.lc-status { grid-area: status; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: 6px; }
.lc-act { grid-area: act; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.lc-act:empty { display: none; }
.lc-act > .btn, .lc-act > form { flex: 1 1 0; }
.lc-act > form .btn { width: 100%; }
.lrow a.open::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.lrow .lc-tick, .lrow .lc-act, .lrow .lc a:not(.open), .lrow button, .lrow input { position: relative; z-index: 1; }
.lrow a.open:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.tick { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -8px -4px -8px -8px; cursor: pointer; }
.tick input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.lempty { padding: 24px 16px; color: var(--muted); }
.lpager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: .875rem; }
.lpager-btns { display: none; gap: 8px; }
.lpager-btns .btn { min-height: 40px; }
.lpager-btns [aria-disabled="true"] { color: var(--muted); opacity: .6; cursor: default; }
.lmore { flex: 1 1 100%; min-height: 48px; }
.bulkbar { position: sticky; bottom: 80px; z-index: 26; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--nav); color: #fff; box-shadow: var(--shadow-pop); }
.bulkbar .bulk-text { flex: 1 1 100%; font-weight: 600; }
.bulkbar .btn { flex: 1 1 0; background: transparent; border-color: var(--nav-line); color: #fff; }
.bulkbar .btn:hover { background: rgb(255 255 255 / .08); }
.bulkbar .btn.main { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.js .bulkbar.none { display: none; }
/* "Paid, but no certificate yet": an amber banner that opens to show the jobs */
details.stuck > summary { list-style: none; cursor: pointer; }
details.stuck > summary::-webkit-details-marker { display: none; }
details.stuck[open] > summary .btn { display: none; }
details.stuck > .tablewrap { margin: -4px 0 16px; }

@media (max-width: 899px) {
  /* More filters opens as a sheet from the bottom */
  .js .mpanel.open { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; max-height: 85vh; overflow-y: auto; border-radius: 16px 16px 0 0; border: 0; background: var(--surface); padding: 12px 16px 24px; box-shadow: 0 -10px 30px rgb(3 20 18 / .35); }
  .js .mpanel.open .mpanel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .js .mpanel.open .mpanel-head .iconbtn { color: var(--text); }
  .js .mpanel.open .mpanel-fields { grid-template-columns: 1fr; }
  .js .mpanel.open .mpanel-actions .btn { max-width: none; }
  .js body.sheet-open::after { content: ""; position: fixed; inset: 0; z-index: 39; background: rgb(3 20 18 / .55); }
  .js .mbtn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .js .mcount { position: absolute; top: -6px; right: -6px; }
  .lc-act .desk-only { display: none; }                                   /* the whole card opens the vehicle, so no View button */
  .lc-act:not(:has(> :not(.desk-only))) { display: none; }                 /* no empty strip under a card with nothing to press */
  .lc-act .btn.sm { min-height: 44px; }
  .lc-status { padding-left: 8px; }
  .lc-status .pill { white-space: normal; text-align: right; line-height: 1.25; padding: 4px 10px; }
}
@media (min-width: 900px) {
  .ltools-row { gap: 12px; }                                              /* the find box goes under the tabs when they need the room */
  .ltools-row .ltabs { flex: 0 1 auto; max-width: 100%; }
  .ltools-end { flex: 1 0 420px; }                                        /* fills what the tabs leave, or the whole line under them */
  .lsection { padding: 16px 16px 4px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); }
  .lsection .ltools { margin: 0 0 14px; }
  .lshowing { margin: 0 2px 12px; }
  .ltable { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
  .lhead, .lrow { display: grid; grid-template-columns: var(--cols); grid-template-areas: none; gap: 0 16px; align-items: center; padding: 12px 16px; min-width: var(--minw); }
  .lhead { min-height: 44px; padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .8125rem; font-weight: 600; color: var(--text); }
  .lrows { gap: 0; }
  .lrow { min-height: 68px; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; padding: 12px 16px; }
  .lrows > .lrow:first-child { border-top: 0; }
  .lrow:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
  .lrow.ticked { background: var(--brand-soft); }
  .lc { grid-area: auto; }
  .lc-ref, .lc-when { background: none; padding: 0; border-radius: 0; font-size: inherit; }
  .lc-ref::before, .lc-when::before { content: none; }
  .lc-status { justify-content: flex-start; align-items: center; }
  .lc-tick { margin: 0; }
  .lc-act { justify-content: flex-end; flex-wrap: nowrap; }
  .lc-act:empty { display: flex; }
  .lc-act > .btn, .lc-act > form { flex: 0 0 auto; }
  .lc-act .btn { min-height: 36px; padding: 0 12px; font-size: .875rem; white-space: nowrap; }
  .lc-act .phone-only { display: none; }
  .tick { width: 28px; height: 28px; margin: 0; }
  .lempty { padding: 24px 16px; }
  .lpager { margin: 0; padding: 12px 2px; }
  .lpager-btns { display: flex; }
  .lmore { display: none; }
  .bulkbar { bottom: 16px; }
  .bulkbar .bulk-text { flex: 1 1 auto; }
  .bulkbar .btn { flex: 0 0 auto; }
}

/* New install form (redesign step 5): installs/form + installs/review.
   Five numbered parts (.fpart), one per screen step by step (review correction 5; "Step by step" near the end, plus
   "Step by step: install and renewal"). Phones: a focused screen (body.focused: no search box, no bottom bar, a teal
   .fhead with back arrow, title and "saved" time), Back / Next stuck to the bottom (.wiz-nav / .fbar).
   Computers: two columns, the steps and a sticky "The certificate will say" card (.fpreview).
   Without JavaScript every part is open and the extras (steps, make buttons, stock sheet) stay hidden. */
.fhead { display: none; }
.js .nojs-only { display: none; }
.fpage-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin: 0 0 16px; }
.fpage-head h1 { margin: 0 0 4px; }
.fpage-head form { margin: 0; }
.fpage-sub { font-size: .875rem; color: var(--muted); }
.fcols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.fmain { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.faside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }

.fpart { padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); scroll-margin-top: 120px; }
.fpart > h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.0625rem; }
.fpart > h2 .hint { font-size: .8125rem; font-weight: 500; }
.fnum { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: .875rem; font-weight: 700; }
.fgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.fwide { grid-column: 1 / -1; }
.fwith { display: flex; gap: 8px; }
.fwith input { flex: 1 1 auto; min-width: 0; }
.fscan { flex: 0 0 auto; width: 52px; padding: 0; border-color: transparent; background: var(--brand-soft); color: var(--brand); }
.fscan:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.fpart .scanbox { margin: 12px 0 0; }
.fsmall-note { margin: 4px 0 0; }
.fstock-btn { min-height: 44px; font-weight: 600; margin-top: 2px; }
.fstock-none { margin: 6px 0 0; }
.fcode-paid { margin: .75rem 0 0; }
.fphotos-note { margin: 8px 0 0; }

/* the number plate field looks like a plate */
input.plate-input { max-width: 220px; background: var(--plate); color: var(--plate-ink); border: 2px solid var(--plate-ink); font: 600 1.25rem var(--monofont); letter-spacing: .04em; text-transform: uppercase; }
input.plate-input::placeholder { color: color-mix(in srgb, var(--plate-ink) 40%, transparent); text-transform: none; }
input.plate-input[aria-invalid="true"] { border-color: var(--bad); }

/* notes and hints under a field: green = done for you, red = can't be used, amber box = check this, blue box = a suggestion */
.fnote { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; font-size: .8125rem; font-weight: 500; }
.fnote .ic { margin-top: 2px; }
.fnote.ok { color: var(--ok); }
.fnote.bad { color: var(--bad); }
.fhint { display: flex; gap: 10px; margin-top: 12px; padding: 12px; border-radius: var(--radius); font-size: .875rem; }
.fhint .fhint-text { flex: 1 1 auto; min-width: 0; color: var(--text); }
.fhint.warn { background: var(--warn-bg); color: var(--warn); }
.fhint.warn strong { color: var(--warn); }
.fhint.warn .ic { margin-top: 1px; }
.fhint.info { flex-direction: column; gap: 8px; background: var(--info-bg); }
.fhint + .fhint { margin-top: 8px; }

/* make buttons above the Make field */
.fmakes { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.fmakes .chip { min-height: 40px; padding: 0 12px; }
.fmakes .chip[aria-pressed="true"], .fmakes .chip[aria-pressed="true"]:hover { color: var(--brand-ink); }

/* "Add KRA PIN or email" (phones only; computers always show them) */
.fmore-btn { min-height: 44px; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--brand); font: 600 .9375rem var(--sans); cursor: pointer; }

/* photo tiles: the whole tile opens the camera; after a photo it shows the picture and "Retake" */
.ptiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.ptile { position: relative; display: flex; flex-direction: column; gap: 6px; margin: 0; font-weight: 500; font-size: .8125rem; cursor: pointer; }
.ptile-pic { position: relative; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; overflow: hidden;
  border: 2px dashed color-mix(in srgb, var(--brand) 45%, transparent); border-radius: var(--radius); background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); color: var(--brand); font-size: .875rem; font-weight: 600; }
.ptile-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ptile-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ptile-retake { display: none; position: absolute; top: 8px; right: 8px; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 99px; background: var(--ok-bg); color: var(--ok); font-size: .75rem; font-weight: 600; }
.ptile-text { display: flex; flex-direction: column; gap: 2px; }
.ptile-label { color: var(--text); line-height: 1.3; }
.ptile-state { font-size: .75rem; color: var(--muted); }
.ptile.done .ptile-pic { border: 1px solid var(--line); background: var(--off-bg); }
.ptile.done .ptile-empty { display: none; }
.ptile.done .ptile-retake { display: inline-flex; }
.ptile.done .ptile-state { color: var(--ok); }
.ptile-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ptile:focus-within .ptile-pic { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
.ptile:hover .ptile-pic { border-color: var(--brand); }

/* the live certificate card (computers) and the check screen share it */
.fpreview { border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.fpreview-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px 12px; }
.fkicker { font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fpreview .plate.lg { font-size: 1.25rem; }
.frows { margin: 0; }
.frows > div { display: flex; gap: 12px; padding: 7px 16px; border-top: 1px solid var(--line-soft); }
.frows dt { flex: 0 0 104px; font-size: .8125rem; color: var(--muted); padding-top: 1px; }
.frows dd { flex: 1 1 auto; min-width: 0; margin: 0; font-size: .9375rem; font-weight: 500; overflow-wrap: anywhere; }
.frows dd.empty { color: var(--muted); font-weight: 400; font-family: var(--sans); font-size: .875rem; }

/* check screen */
.fcheck { max-width: 760px; }
.cgroup { border-top: 1px solid var(--line-soft); }
.cgroup-head { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 4px 4px 0 16px; }
.cgroup-head > span { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cgroup-head a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius); font-size: .875rem; font-weight: 600; text-decoration: none; }
.cgroup .frows > div { border-top: 0; padding: 4px 16px 8px; }
.cphotos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 4px 16px 16px; }
.cphotos figure { margin: 0; }
.cphotos img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; display: block; background: var(--off-bg); }
.cphotos figcaption { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.fbar { display: flex; gap: 8px; margin-top: 16px; }
.fbar form { margin: 0; }
.fbar .btn { min-height: 48px; font-size: 1rem; }

/* "Pick from my stock": a native <dialog> (Escape closes it, focus goes back) */
.fsheet { width: 100%; max-width: none; max-height: 85vh; margin: auto 0 0; padding: 0; border: 0; border-radius: 16px 16px 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
.fsheet[open] { display: flex; flex-direction: column; }
.fsheet::backdrop { background: rgb(3 20 18 / .55); }
.fsheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); }
.fsheet-head .iconbtn { color: var(--text); }
.fsheet-head .iconbtn:hover { background: var(--surface-2); }
.fsheet-title { font-size: 1.125rem; font-weight: 700; }
.fsheet-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; }
.fsheet-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: left; font: .875rem var(--sans); cursor: pointer; }
.fsheet-item:hover { border-color: var(--brand); }
.fsheet-item .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fsheet-item .ic { color: var(--muted); }
.fsheet-serial { font-size: 1rem; font-weight: 600; }
.fsheet-sub { font-size: .8125rem; color: var(--muted); }
.fsheet-foot { padding: 4px 4px 0; margin: 0; }

@media (max-width: 899px) {
  .focused .top, .focused .bottombar { display: none; }
  .focused .fhead { display: block; position: sticky; top: 0; z-index: 20; padding: 6px 12px 12px 4px; background: var(--nav); color: #fff; }
  .fhead-row { display: flex; align-items: center; gap: 4px; min-height: 44px; }
  .fhead-text { flex: 1 1 auto; min-width: 0; }
  .fhead-title { font-size: 1.125rem; font-weight: 700; line-height: 1.25; }
  .fhead-saved { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--nav-text); }
  .fhead-saved[hidden] { display: none; }
  .fhead-saved .ic { color: var(--ok-on-nav); }
  .focused main.page { padding: 12px 12px 0; }
  .focused .fpage-head h1, .focused .fpage-saved { display: none; }
  .fpage-head { margin-bottom: 12px; }
  .fpart { padding: 14px; }
  .fpart input:not([type=file]) { min-height: 48px; font-size: 1.0625rem; }
  .fpart input.plate-input { font-size: 1.25rem; }
  .js .fmore:not(.open) { display: none; }
  .faside { display: none; }
  .fbar { position: sticky; bottom: 0; z-index: 15; margin: 16px -12px 0; padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .in-popup .fbar { margin: 16px -16px 0; padding-left: 16px; padding-right: 16px; }
  .fbar > .btn { flex: 1 1 0; }
  .fbar > form { flex: 2 1 0; }
  .fbar .btn { width: 100%; min-height: 52px; }
  .fcheck .fpage-head { margin-bottom: 12px; }
  .fcheck .fpage-head h1 { display: none; }
}
@media (min-width: 900px) {
  .fgrid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .fpart { padding: 16px 20px 20px; }
  .fmore-btn { display: none !important; }
  .fmakes { display: none !important; }
  .faside { position: sticky; top: 96px; }
  .ptiles { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
  .ptile { flex-direction: row; align-items: center; gap: 12px; min-height: 72px; padding: 10px 14px; border: 2px dashed color-mix(in srgb, var(--brand) 45%, transparent); border-radius: var(--radius); background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); }
  .ptile.done { border: 1px solid var(--line); background: var(--surface); }
  .ptile-pic { width: 64px; height: 48px; flex: 0 0 auto; border: 0; border-radius: var(--radius-sm); background: var(--brand-soft); }
  .ptile.done .ptile-pic { border: 0; }
  .ptile-empty > span, .ptile.done .ptile-retake { display: none; }
  .ptile-label { font-weight: 600; font-size: .875rem; }
  .ptile-state { font-size: .8125rem; }
  .ptile:focus-within { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
  .ptile:focus-within .ptile-pic { outline: 0; }
  .ptile:hover { border-color: var(--brand); }
  .cphotos img { height: 160px; }
  .fbar { justify-content: flex-end; }
  .fsheet { max-width: 480px; margin: auto; border-radius: var(--radius); }
}

/* Tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { background: var(--surface-2); font-size: .8125rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.filters > * { flex: 1 1 150px; }
.filters label { margin-top: 0; font-size: .8125rem; }
.pager { display: flex; gap: 1rem; justify-content: space-between; margin: 1rem 0; }

/* Permission matrix */
.matrix th.role { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; padding: .6rem .3rem; font-size: .8125rem; text-transform: none; letter-spacing: 0; }
.matrix td.c { text-align: center; padding: .3rem; }
.matrix td.c input { width: 1.15rem; height: 1.15rem; }
.matrix tr.group td { background: var(--surface-2); font-weight: 700; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: var(--surface); min-width: 210px; z-index: 1; }
.matrix tr.group td:first-child, .matrix thead th:first-child { background: var(--surface-2); }

/* Sign-in and public pages */
.guest { min-height: 100vh; display: grid; place-items: start center; padding: 2rem 1rem; }
.guest .card { width: 100%; max-width: 420px; padding: 1.5rem; }
.guest .brand { color: var(--text); margin-bottom: 1rem; }
.guest .brand:hover { color: var(--text); }
.qr { display: block; width: 220px; height: 220px; margin: 1rem auto; background: #fff; padding: 8px; border-radius: 8px; }
.diff td:nth-child(2) { color: var(--bad); }
.diff td:nth-child(3) { color: var(--ok); }

/* ================================================================ dashboard (review correction 7: Home like the model) */
.dash-head { margin: 0 0 20px; }
.dash-date { font-size: .8125rem; color: var(--muted); margin: 0 0 2px; }
.dash-head h1 { margin: 0; }
.dash-head p { margin: 2px 0 0; font-size: .875rem; }
@media (min-width: 900px) { .dash-head h1 { font-size: 2rem; } }

/* four number tiles: label + icon square, big number, one line */
.dash-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.dash-tile { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.dash-tile:hover { border-color: var(--brand); color: var(--text); }
.dash-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dash-tile-label { font-size: .875rem; font-weight: 500; line-height: 1.3; }
.dash-ico { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.dash-tile-v { font: 700 1.875rem/1.1 var(--display); letter-spacing: -.02em; margin-top: 4px; }
.dash-tile-sub { font-size: .8125rem; line-height: 1.35; color: var(--muted); }
.dash-tile.alarm.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.dash-tile.alarm.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.dash-tile.alarm.bad .dash-tile-v { color: var(--bad); }
.dash-tile.alarm.warn .dash-tile-v { color: var(--warn); }
.dash-tile.alarm:hover { border-color: currentColor; }
@media (min-width: 900px) {
  .dash-tiles { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
  .dash-tile { padding: 18px 20px; }
  .dash-tile-label { font-size: .9375rem; }
  .dash-ico { width: 38px; height: 38px; }
  .dash-tile-v { font-size: 2.25rem; margin-top: 8px; }
}

/* Needs attention (wider, left) and Today by technician side by side; stacked on phones */
.dash-cols { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: flex-start; }
.dash-att { flex: 3 1 440px; min-width: 0; }
.dash-tech { flex: 2 1 300px; min-width: 0; }
.dash-chips { padding: 0 20px 12px; }
.dash-empty { margin: 0; padding: 0 20px 20px; color: var(--muted); }
.dash-att-list { display: flex; flex-direction: column; gap: 10px; padding: 0 20px 20px; }
.dash-more .dash-att-list { padding: 10px 0 0; }
.dash-more > summary { list-style: none; align-self: flex-start; }
.dash-more > summary::-webkit-details-marker { display: none; }
.dash-more[open] > summary { display: none; }
.dash-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid transparent; border-radius: 12px; background: color-mix(in srgb, var(--info-bg) 55%, var(--surface)); }
.dash-row.offline { background: color-mix(in srgb, var(--bad-bg) 60%, var(--surface)); }
.dash-row.expiring, .dash-row.unpaid { background: color-mix(in srgb, var(--warn-bg) 60%, var(--surface)); }
.dash-row:hover { border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.dash-row .dash-ico { width: 38px; height: 38px; }
.dash-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.dash-row .plate { font-size: .9375rem; min-height: 26px; line-height: 22px; padding: 0 7px; }
.dash-open::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.dash-row-line { font-size: .8125rem; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.dash-row-line .mono { color: var(--text); }
.dash-row-end { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.dash-row-end .btn { position: relative; z-index: 1; }
@media (max-width: 639px) {
  .dash-chips, .dash-att-list, .dash-empty, .dash-cols .box-head, .dash-recent .box-head { padding-left: 14px; padding-right: 14px; }
  .dash-row { flex-wrap: wrap; align-items: flex-start; padding: 12px; }
  .dash-row-main { flex: 1 1 0; }
  .dash-row-end { flex: 1 1 100%; flex-direction: row; align-items: center; justify-content: space-between; padding-left: 50px; }
  .dash-row-end .pill { white-space: normal; line-height: 1.25; padding: 4px 10px; }
}

/* Today by technician: one teal bar each, no chart library */
.dash-bars { list-style: none; margin: 0; padding: 0 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.dash-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 12px; }
.dash-bar-name { font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bars b { font: 600 .9375rem var(--display); }
.dash-bar { grid-column: 1 / -1; display: block; height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--brand) 10%, var(--surface-2)); overflow: hidden; }
.dash-bar > span { display: block; height: 100%; min-width: 10px; border-radius: inherit; background: var(--brand); }
@media (max-width: 639px) { .dash-bars { padding: 0 14px 16px; } }

/* Recent installations: a table on computers, cards on phones (no sideways scrolling) */
.dash-table { width: calc(100% - 40px); margin: 0 20px 12px; border-collapse: collapse; font-size: .9375rem; }
.dash-table th { padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8125rem; font-weight: 600; text-align: left; white-space: nowrap; }
.dash-table th:first-child { border-radius: 8px 0 0 0; }
.dash-table th:last-child { border-radius: 0 8px 0 0; }
.dash-table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table .dr-ref a { font-weight: 600; }
.dash-table .plate { font-size: .875rem; min-height: 26px; line-height: 22px; padding: 0 7px; }
.dash-table .sub { display: block; margin-top: 3px; font-size: .8125rem; color: var(--muted); }
.dash-table .dr-act { text-align: right; }
@media (max-width: 899px) {
  .dash-table, .dash-table tbody, .dash-table tr, .dash-table td { display: block; }
  .dash-table { width: auto; margin: 0 14px 14px; }
  .dash-table thead { display: none; }
  .dash-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 14px; margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--radius); }
  .dash-table tr:last-child { margin-bottom: 0; }
  .dash-table td { padding: 0; border: 0; min-width: 0; }
  .dash-table .dr-veh { grid-column: 1; grid-row: 1; }
  .dash-table .dr-status { grid-column: 2; grid-row: 1; align-self: start; text-align: right; }
  .dash-table .dr-status .pill { white-space: normal; line-height: 1.25; padding: 4px 10px; }
  .dash-table .dr-ref { grid-column: 1; grid-row: 2; }
  .dash-table .dr-act { grid-column: 2; grid-row: 2; }
  .dash-table .dr-tech, .dash-table .dr-dealer { grid-column: 1 / -1; font-size: .875rem; }
  .dash-table td[data-label]::before { content: attr(data-label) " "; color: var(--muted); }
}

/* "Who did them" (director, 2026-11-26): more lines per job than the other Home tables, so phones get an explicit order:
   vehicle + confirmed, started by, done by, paid, then when + View */
@media (max-width: 899px) {
  .dash-who .who-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .dash-who .who-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; }
  .dash-who .who-table td:nth-child(5) { grid-column: 1 / -1; grid-row: 4; font-size: .875rem; }
  .dash-who .who-table td.dr-ref { grid-column: 1; grid-row: 5; font-size: .875rem; }
  .dash-who .who-table td.dr-act { grid-column: 2; grid-row: 5; }
}

/* People with no install work (store keeper): their menu as section tiles */
.dash-sec { margin: 20px 0 10px; font-size: 1rem; color: var(--muted); }
.dash-stiles { margin: 0 0 8px; }
/* ================================================================ end dashboard */

/* ================================================================ lists (review correction 7: the register look) */
/* Status tabs (the model's "All · Active · Errors"): a grey bar, the tab in use white with a shadow, a count bubble in each.
   Phones: the bar is full width and scrolls sideways. */
.ltabs { display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--line) 60%, var(--surface)); overflow-x: auto; scrollbar-width: none; }
.ltabs::-webkit-scrollbar { display: none; }
.ltab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 9px; color: var(--text); font: 600 .9375rem var(--sans); text-decoration: none; white-space: nowrap; }
.ltab:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.ltab[aria-current="true"] { background: var(--surface); box-shadow: 0 1px 3px rgb(15 27 42 / .12), inset 0 0 0 1px var(--line-soft); }
.ltab .n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 20%, var(--line)); color: var(--text); font-size: .75rem; font-weight: 600; }
.ltab[aria-current="true"] .n { background: var(--brand-soft); color: var(--brand); }
/* One amber "New installation" per screen: computers show the list's own (in its page head) instead of the top bar's;
   phones keep the bottom bar's round one when it is there. */
body:has(.lkey) .top .keyaction { display: none; }
@media (max-width: 899px) {
  body:has(.bottombar .main-action[href$="/installs/new"]) .lkey,
  body:has(.bottombar .main-action[href$="/installs/new"]) .lhead-btns:not(:has(> :not(.lkey))) { display: none; }
}
/* ================================================================ end lists */

/* ================================================================ vehicle page (review corrections 7 and 8) */
/* Header card: truck tile, plate + state, one line, actions on the right (on phones the actions sit at the bottom) */
.vcard { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 18px 20px; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.vcard .vicon { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.vcard .vtitle { flex: 1 1 260px; min-width: 0; }
.vcard .vtitle-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.vcard h1 { margin: 0; }
.vcard .vtitle p { margin: 6px 0 0; color: var(--muted); font-size: .9375rem; }
.vcard .vactions { margin: 0; justify-content: flex-end; }
@media (min-width: 900px) { .vcard .more-menu { left: auto; right: 0; } }
@media (max-width: 899px) { .vcard { padding: 14px; gap: 12px; } .vcard .vicon { width: 44px; height: 44px; border-radius: 12px; } .vcard .vtitle { flex-basis: 200px; } }

/* Problem banner: icon in a tinted square, buttons on the right */
.vban { padding: 16px 18px; }
.vban .vban-ic { width: 44px; height: 44px; flex: 0 0 auto; align-self: flex-start; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, currentColor 14%, transparent); }
.vban .vban-ic .ic, .vban .vban-actions .ic { margin: 0; align-self: auto; }
.vban .banner-text { flex: 1 1 240px; }
.vban .vban-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.vban .vban-actions form { margin: 0; }
@media (max-width: 639px) { .vban .vban-actions { width: 100%; } .vban .vban-actions > * { flex: 1 1 auto; } .vban .vban-actions .btn { width: 100%; } }

/* Vehicle / device / installation: three cards, label left, value right */
.vgrid3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; margin: 0 0 16px; }
.vgrid3 > .box { margin: 0; }
@media (min-width: 640px) and (max-width: 1179px) { .vgrid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .vgrid3 > .box:last-child { grid-column: 1 / -1; } }
@media (min-width: 1180px) { .vgrid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vgrid3 .lines > div { padding: 10px 0; font-size: .9375rem; align-items: baseline; }
.vgrid3 .lines > div:first-child, .vside .lines > div:first-child { border-top: 0; }
.vgrid3 .lines > div > span:last-child { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.vgrid3 .lines .pill { font-size: .75rem; min-height: 22px; }
.vnote { margin: -8px 20px 16px; }

/* Last position: only a button until clicked; then facts and the map */
.vpos-ask { display: flex; align-items: center; justify-content: center; min-height: 160px; border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: 12px;
  background-color: color-mix(in srgb, var(--brand-soft) 45%, var(--surface));
  background-image: linear-gradient(color-mix(in srgb, var(--brand) 8%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--brand) 8%, transparent) 1px, transparent 1px);
  background-size: 32px 32px; }
.vpos-map { display: block; width: 100%; height: 280px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.vpos-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin-top: 12px; }
.vpos-facts span { display: block; font-size: .75rem; color: var(--muted); }
.vpos-facts b { font-weight: 600; overflow-wrap: anywhere; }
.vpos-msg { margin: 10px 0 0; }
.vpos-open { margin: 12px 0 0; }
@media (max-width: 639px) { .vpos-facts { grid-template-columns: 1fr 1fr; } .vpos-map { height: 220px; } }

/* People: initials, role, name, call button */
.vpeople { display: flex; flex-direction: column; gap: 10px; }
.vperson { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.vperson .vav { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .875rem; }
.vperson .vwho { flex: 1 1 120px; min-width: 0; }
.vperson .vwho small { display: block; font-size: .75rem; color: var(--muted); }
.vperson .vwho b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.vperson .btn { flex: 0 0 auto; }
.vcert-date { margin: 8px 0 10px; }
/* How it transmits (owner, 2026-11-26): the device's positions, newest first. A table on computers, a card per point on
   phones (column names from data-label). Paging and search: public/js/app.js "transmission log". */
.tlog .box-head { flex-wrap: wrap; }
.tlog-day { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.tlog-day label { margin: 0; font-size: .875rem; }
.tlog-day input { width: auto; flex: 0 1 190px; min-height: 40px; padding: .45rem .65rem; }
.tlog-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px; }
.tlog-tools label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; font-size: .875rem; }
.tlog-size select { width: auto; min-height: 40px; padding: .35rem .6rem; }
.tlog-find { flex: 0 1 300px; }
.tlog-find input { min-height: 40px; padding: .45rem .75rem; }
.tlog-msg { margin: 0; }
.tlog-none { margin: 12px 0 0; }
.tlog-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tlog-table th { padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8125rem; font-weight: 600; text-align: left; white-space: nowrap; }
.tlog-table th:first-child { border-radius: 8px 0 0 0; }
.tlog-table th:last-child { border-radius: 0 8px 0 0; }
.tlog-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tlog-table tbody tr:last-child td { border-bottom: 0; }
.tlog-table .t-date, .tlog-table .t-time { white-space: nowrap; }
.tlog-table .t-speed b { font-weight: 600; }
.tlog-table .t-speed .t-fast { color: var(--bad); }
.tlog-table .t-unit { display: none; }
.tlog-table .t-loc a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.tlog-table .sub { display: block; margin-top: 3px; font-size: .8125rem; color: var(--muted); }
.tlog-table .t-more { min-width: 190px; }
.tlog-table .t-more .pill { font-size: .75rem; min-height: 22px; margin: 2px 4px 2px 0; }
.tlog-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px 0 0; }
.tlog-pbtns { display: flex; gap: 8px; }
@media (max-width: 899px) {
  .tlog .box-head, .tlog .box-body { padding-left: 14px; padding-right: 14px; }
  .tlog-table, .tlog-table tbody, .tlog-table tr, .tlog-table td { display: block; }
  .tlog-table thead { display: none; }
  .tlog-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 14px; margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--radius); }
  .tlog-table tbody tr:last-child { margin-bottom: 0; }
  .tlog-table td, .tlog-table tbody tr:last-child td { padding: 0; border: 0; min-width: 0; }
  .tlog-table td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-family: var(--sans); }
  .tlog-table .t-date { grid-column: 1; grid-row: 1; font-weight: 600; }
  .tlog-table .t-time { grid-column: 2; grid-row: 1; font-weight: 600; text-align: right; }
  .tlog-table .t-speed { grid-column: 1; grid-row: 2; }
  .tlog-table .t-unit { display: inline; }
  .tlog-table .t-more { grid-column: 2; grid-row: 2 / span 2; min-width: 0; text-align: right; }
  .tlog-table .t-more .pill { margin: 0 0 4px 4px; }
  .tlog-table .t-lat { grid-column: 1; grid-row: 3; font-size: .8125rem; }
  .tlog-table .t-lng { grid-column: 1; grid-row: 4; font-size: .8125rem; }
  .tlog-table .t-loc { grid-column: 1 / -1; grid-row: 5; padding-top: 8px; border-top: 1px solid var(--line-soft); }
  .tlog-find { flex: 1 1 100%; }
  .tlog-pager { justify-content: center; text-align: center; }
  .tlog-pager .tlog-pbtns { width: 100%; }
  .tlog-pager .tlog-pbtns .btn { flex: 1 1 0; }
}

/* The NTSA page (2026-12-01): plate lookup, details, downloads, and the readings table above with a Violation column */
.ntsa-find-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ntsa-find-form label { margin: 0; font-weight: 600; }
.ntsa-find-form input { flex: 1 1 200px; max-width: 320px; text-transform: uppercase; }
.ntsa-list { display: grid; gap: 8px; }
.ntsa-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.ntsa-item:hover, .ntsa-item:focus-visible { border-color: var(--brand); color: var(--text); }
.ntsa-item-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.ntsa-kv dt { flex-basis: 130px; }
.ntsa-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ntsa-sub { margin: 14px 0 8px; }
.ntsa-stats { margin: 0 0 16px; }
.ntsa-dates .small { margin-left: 4px; }
.tlog-table tr.is-violation td { background: var(--bad-bg); }
.tlog-table .t-viol { white-space: nowrap; }
.tlog-table .t-viol .pill { font-size: .75rem; min-height: 22px; }
@media (max-width: 899px) {
  .tlog-table .t-viol { grid-column: 2; grid-row: 4; text-align: right; }
  .tlog-table tr.is-violation { border-color: var(--bad); }
  .ntsa-btns .btn { flex: 1 1 100%; justify-content: flex-start; }
  .ntsa-dates .small { flex-basis: 100%; margin: 0; }
}

/* The public check page: the log is wider than the check card, so it sits under it */
.guest-wide { width: 100%; max-width: 1100px; margin-top: 16px; }
.guest-wide .tlog { margin: 0; }
/* ================================================================ end vehicle page */

/* Visually hidden, still read by screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media print { .side, .top, .bottombar, .bell, .vactions, .fhead, .fbar { display: none !important; } .app { display: block; } }

/* account page: job group + what the person may do (review correction 3) */
.jobgrid { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.jobpick { margin: 0; min-height: 40px; }
.permgroups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.permgroup { margin: 0; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); min-width: 0; }
.permgroup legend { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; font: 600 1rem var(--display); }
.permgroup legend span { flex: 1 1 auto; }
.permgroup legend .linkbtn { font-family: var(--sans); font-weight: 500; }
.permgroup .perm { align-items: flex-start; margin: 6px 0; font-size: .9375rem; line-height: 1.35; }
.permgroup .perm input { margin-top: 1px; flex: 0 0 auto; }
.permgroup .perm.off { color: var(--muted); }

/* two-step card (review correction 2) */
.tfa { max-width: 420px; }
.tfa-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tfa-head h2 { margin: 0; }
.tfa-steps { padding-left: 1.25rem; margin: 0 0 8px; }
.tfa-key { text-align: center; }
.tfa-key code { display: inline-block; margin-top: 4px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: 1rem; letter-spacing: .04em; word-break: break-all; user-select: all; }
.tfa-form { margin-top: 8px; }
.tfa-hint { margin: 16px 0 0; padding: 8px 12px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); }

/* deactivate dialog (review correction 14) */
/* resources/views/partials/deactivate.blade.php.
   A <details>: the summary is the button; when open, the box is a centred modal (a sheet from the bottom on phones). Works without JS. */
.deact { display: inline-block; }
.deact > summary { list-style: none; }
.deact > summary::-webkit-details-marker { display: none; }
.deact-backdrop { position: fixed; inset: 0; z-index: 90; background: rgb(3 20 18 / .55); }
.deact-box { position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); text-align: left; white-space: normal; font-size: 1rem; }
.deact-box form { margin: 0; }
.deact-title { margin: 0 0 4px; font: 700 1.25rem/1.3 var(--display); }
.deact-means { color: var(--muted); margin: 0 0 16px; }
.deact-warn { margin: 0 0 12px; padding: 12px 16px; }
.deact-items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 16px; color: var(--text); font-size: .9375rem; }
.deact-items .mono { font-size: .9375rem; }
.deact-kind { display: inline-block; min-width: 3.6em; color: var(--muted); font-size: .8125rem; }
.deact-box label { margin-top: 4px; }
.deact-box select { width: 100%; }
.deact-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.deact-note { margin: 8px 0 0; }
.deact-error { margin: 0 0 8px; color: var(--bad); font-weight: 600; }
@media (max-width: 599px) {
  .deact-box { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 88vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; border-width: 1px 0 0; }
  .deact-actions .btn { flex: 1 1 100%; min-height: 48px; }
}

/* Home: device type split, today's installs by 2G / 4G (model screens; correction 12) */
.dash-types { margin: 0 20px 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.dash-types h3 { margin: 0 0 10px; font: 600 .9375rem var(--display); }
.dash-typebar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.dash-typebar > span { display: block; height: 100%; min-width: 6px; }
.t-2g { background: var(--brand); } .t-4g { background: var(--amber); } .t-x { background: var(--off); opacity: .45; }
.dash-typekey { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: .8125rem; color: var(--muted); }
.dash-typekey span { display: inline-flex; align-items: center; gap: 6px; }
.dash-typekey i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
@media (max-width: 639px) { .dash-types { margin: 0 14px 16px; } }

/* install form: SIM and model (corrections 11, 12, 15) */
.flabel { display: block; font-weight: 600; margin: .75rem 0 .25rem; font-size: .9375rem; }
.fsim-line { display: flex; align-items: flex-start; gap: 8px; margin: 0; min-height: 48px; padding: 12px 14px; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok); font-size: .9375rem; font-weight: 500; }
.fsim-line > span { color: var(--text); overflow-wrap: anywhere; }
.fsim-line .ic { flex: 0 0 auto; margin-top: 1px; }
.fsim-line .mono { font-weight: 600; }
.fsim-wait { display: none; }
.js .fsim[data-mode="wait"] .fsim-wait { display: block; }
.js .fsim[data-mode="wait"] .fsim-field { display: none; }
.fnote.warn { margin: 0 0 6px; color: var(--warn); }
.fdm-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 8px; }
.fdm-chips .chip { min-height: 40px; padding: 0 12px; font-family: var(--monofont); }
.fdm-chips .chip[aria-pressed="true"], .fdm-chips .chip[aria-pressed="true"]:hover { color: var(--brand-ink); }
.fdm-type { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand); font: 600 .6875rem var(--sans); letter-spacing: .02em; }
.chip[aria-pressed="true"] .fdm-type { background: color-mix(in srgb, var(--brand-ink) 22%, transparent); color: var(--brand-ink); }
.fdm-input { max-width: 260px; text-transform: uppercase; }
.fdm-input::placeholder { text-transform: none; }
.fsheet-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.fsheet-model { font-size: .8125rem; font-weight: 600; color: var(--muted); }
.fsheet-nosim { color: var(--warn); font-weight: 500; }

/* confirmation code (correction 16): the code box above Submit on the install check screen and the Renew screen,
   and the "Confirmation codes" choice in My account. Big digits, numeric keyboard, one-time-code autofill. */
.ccode { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); }
.ccode-head { display: flex; align-items: flex-start; gap: 10px; }
.ccode-head > .ic { flex: 0 0 auto; margin-top: 2px; color: var(--brand); }
.ccode-title { font: 600 1rem var(--display); }
.ccode-to { font-size: .9375rem; color: var(--muted); }
.ccode-to strong { color: var(--text); font-weight: 600; white-space: nowrap; }
.ccode-note { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--radius); background: var(--info-bg); color: var(--info); font-size: .875rem; }
.ccode label { margin-top: 12px; }
.ccode input.ccode-input { width: 100%; max-width: 280px; min-height: 56px; font: 600 1.75rem var(--monofont); letter-spacing: .4em; text-align: center; padding-left: .4em; }
.ccode-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ccode-foot form { margin: 0; }
.ccode-foot .btn { min-height: 44px; }
.ccode-hint { font-size: .8125rem; color: var(--muted); }
.cchoice { border: 0; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cchoice legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: .9375rem; }
.cchoice-item { display: flex; align-items: flex-start; gap: 10px; margin: 0; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 400; cursor: pointer; }
.cchoice-item:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.cchoice-item.off { opacity: .55; cursor: not-allowed; }
.cchoice-item input { margin-top: 3px; accent-color: var(--brand); width: 18px; height: 18px; flex: 0 0 auto; }
.cchoice-item > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 899px) {
  .ccode input.ccode-input { max-width: none; font-size: 2rem; }
  .ccode-foot .btn { flex: 1 1 auto; }
}

/* stock entry and pairing (corrections 9, 12, 15) */
.sadd-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.sadd-group legend { float: left; width: 100%; padding: 0 0 2px; margin: 20px 0 6px; font: 600 1rem var(--display); border-bottom: 1px solid var(--line-soft); }
.sadd-group legend + * { clear: both; }
.sadd-scanrow { display: flex; gap: 8px; align-items: stretch; }
.sadd-scanrow input { flex: 1 1 auto; min-width: 0; }
.sadd-scanrow .btn { flex: 0 0 auto; }
.sadd-form .error:empty { display: none; }
.sadd-new { display: grid; grid-template-columns: 1fr; gap: 0 12px; padding: 4px 12px 12px; margin-top: 8px; border-radius: var(--radius); background: var(--surface-2); }
@supports selector(:has(*)) {
  .sadd-new { display: none; }
  .sadd-form:has(#sadd-model option[value="__new"]:checked) .sadd-new { display: grid; }
  .recv:has(#kind option[value="sim"]:checked) .recv-device, .recv:has(#kind option[value="device"]:checked) .recv-sim { display: none; }
}
@media (min-width: 640px) { .sadd-new { grid-template-columns: 2fr 1fr; } }
.sadd-added { margin: 0 0 12px; padding: 8px 12px; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.sadd-added .mono { color: var(--text); }
.sadd-list { list-style: none; margin: 0; padding: 0 0 4px; }
.sadd-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line-soft); }
.sadd-item form { margin: 0; flex: 0 0 auto; }
.sadd-item > .btn { flex: 0 0 auto; margin-left: auto; }
.sadd-added .btn, .flash .flash-btn { margin: 6px 0 0; display: inline-flex; gap: 6px; }
.flash .flash-btn { margin-left: 8px; }
.sadd-what { min-width: 0; overflow-wrap: anywhere; }
.sadd-num { font-size: 1rem; }
.stk-scan { margin: 8px 0 0; padding: 8px; }
.stk-scan video { display: block; width: 100%; max-width: 420px; border-radius: var(--radius); background: #000; }
.stk-scan p { margin: 6px 0 0; }
.stk-pair { white-space: nowrap; }
.spair { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .spair { grid-template-columns: 2fr 1fr; align-items: start; } }
.spair h2 { margin-top: 0; }
.spair-recent, .smodels { list-style: none; margin: 0; padding: 0 0 4px; }
.spair-recent li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 20px; border-top: 1px solid var(--line-soft); }
.smodel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.smodel:first-child { border-top: 0; }
.smodel-name { display: flex; flex-direction: column; min-width: 0; }
.smodel-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.smodel-form select { width: auto; min-width: 130px; }
@media (max-width: 639px) {
  .sadd-item, .spair-recent li { padding: 10px 14px; }
  .smodel { padding: 12px 14px; }
  .smodel-form { width: 100%; }
  .smodel-form select { flex: 1 1 auto; }
}

/* ---- Step by step (review correction 5): [data-wizard] parts, one at a time (public/js/app.js). Without JS every part shows. */
.wiz-head { margin: 0 0 16px; }
.wiz-count { display: none; margin: 0 0 6px; font-weight: 600; font-size: .875rem; color: var(--muted); }
.wiz-steps { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; counter-reset: none; }
.wiz-steps li { flex: 1 1 0; min-width: 0; }
.wiz-dot { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 6px; border: 0; border-bottom: 3px solid var(--line); background: none; color: var(--muted); font: 600 .875rem var(--sans); text-align: left; cursor: pointer; }
.wiz-dot[disabled] { cursor: default; }
.wiz-n { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: .8125rem; }
.wiz-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz-steps li.done .wiz-dot { color: var(--text); border-bottom-color: var(--brand); }
.wiz-steps li.done .wiz-n { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.wiz-steps li.now .wiz-dot { color: var(--text); border-bottom-color: var(--amber); }
.wiz-steps li.now .wiz-n { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.wiz-dot:not([disabled]):hover .wiz-name { text-decoration: underline; }
.wiz-bar { display: none; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.wiz-bar span { display: block; height: 100%; background: var(--amber); transition: width .2s; }
.wiz [data-step][hidden], .wiz-check[hidden] { display: none !important; }
.wiz-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 0; }
.wiz-nav [hidden] { display: none !important; }
.wiz-gap { flex: 1 1 auto; }
.wiz-nav .wiz-actions { margin: 0; }
.wiz-check h2 { margin: 0 0 4px; }
.wiz-sums { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.wiz-sum { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 16px; }
.wiz-sum-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wiz-sum-head h3 { margin: 0; font-size: 1rem; }
.wiz-sum dl { margin: 8px 0 0; display: grid; gap: 6px; }
.wiz-sum dl > div { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 12px; }
.wiz-sum dt { color: var(--muted); font-size: .875rem; }
.wiz-sum dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; white-space: pre-line; }
@media (max-width: 639px) {
  .wiz-count, .wiz-bar { display: block; }
  .wiz-steps { display: none; }
  .wiz-sum dl > div { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 899px) {
  /* Back / Next stay at the bottom of the screen on phones */
  /* on full pages that keep the phone's bottom menu bar, sit just above it */
  body:not(.in-popup):not(.focused) .wiz-nav { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .wiz-nav { position: sticky; bottom: 0; z-index: 15; margin: 16px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .wiz-nav .btn, .wiz-nav .wiz-actions { flex: 1 1 0; }
  .wiz-nav .wiz-actions .btn { width: 100%; }
  .wiz-gap { display: none; }
}

/* ---- Pop-ups (review corrections 5 and 6): a <dialog> holding the form's page in an <iframe>; full screen on phones */
.popup { width: min(760px, calc(100vw - 32px)); height: min(860px, calc(100vh - 48px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: var(--radius-card); background: var(--bg); color: var(--text); box-shadow: var(--shadow-pop); overflow: hidden; }
.popup[open] { display: flex; flex-direction: column; }
.popup::backdrop { background: rgb(3 20 18 / .55); }
.popup-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; padding: 6px 8px 6px 20px; background: var(--nav); color: #fff; }
.popup-title { font: 700 1.125rem var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.popup-body { position: relative; flex: 1 1 auto; }
.popup-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); opacity: 0; }
.popup.ready iframe { opacity: 1; }
.popup-loading { margin: 0; padding: 24px; color: var(--muted); }
.popup.ready .popup-loading { display: none; }
html.popup-open { overflow: hidden; }
@media (max-width: 899px) {
  .popup { width: 100vw; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
}
/* the page inside a pop-up: no menus; its own big heading is in the pop-up's title bar */
body.in-popup { background: var(--bg); }
body.in-popup main.page { max-width: none; margin: 0; padding: 16px 20px 24px; }
body.in-popup main.page > h1:first-of-type, body.in-popup .not-in-popup { display: none; }
@media (max-width: 899px) { body.in-popup main.page { padding: 12px 16px 0; } }

/* ---- Quick entry on every home (review correction 6): big buttons, each opening its pop-up */
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 0 0 24px; }
.quick a { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); color: var(--text); font-weight: 600; text-decoration: none; }
.quick a:hover { border-color: var(--brand); }
.quick a .qico { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.quick a.key { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.quick a.key .qico { background: rgb(255 255 255 / .35); color: var(--amber-ink); }
@media (max-width: 639px) { .quick { grid-template-columns: 1fr 1fr; gap: 8px; } .quick a { min-height: 56px; padding: 10px; gap: 8px; font-size: .9375rem; } .quick a .qico { width: 34px; height: 34px; } }

/* ---- Step by step, the people / dealer / change forms (review group 5): a part's heading with a button beside it, links that
   only make sense on the full page, and the user form's check screen (the ticks listed per group) */
.part-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 8px; }
.part-head h2 { margin: 0; }
.permsum-n { display: block; font-size: .8125rem; font-weight: 400; }
.permsum { margin: 0; padding-left: 1.1em; font-weight: 500; }
.permsum li + li { margin-top: 2px; }
.permsum-note { margin: 8px 0 0; }
.wiz-sum dl.permsum-dl > div { padding-top: 6px; border-top: 1px solid var(--line); }
.wiz-sum dl.permsum-dl > div:first-child { padding-top: 0; border-top: 0; }
@media (max-width: 639px) { .permsum-n { display: inline; } .wiz-sum dl.permsum-dl dt { font-weight: 600; color: var(--text); } }

/* ---- Stock entry step by step (review correction 5): stock/add-panel, receive and move, each also a pop-up page */
.in-popup .stk-back { display: none; }
.stk-intro { margin-top: 0; }
.sadd-h { margin: 0 0 4px; font: 600 1.0625rem var(--display); }
.sadd-form .sadd-h { margin-bottom: 0; }
.sadd-need { margin: 0 0 12px; }
.sadd-need:empty { display: none; }
.sadd-foot { padding: 8px 20px 14px; border-top: 1px solid var(--line-soft); text-align: right; }
.sadd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin: 0; }
.sadd-facts dt { color: var(--muted); font-size: .875rem; }
.sadd-facts dd { margin: 0; font-weight: 600; font-size: 1.125rem; overflow-wrap: anywhere; }
.sadd-sum p { margin: 12px 0 0; }
.sadd-checklist { margin: 0 0 16px; }
.stk-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 0 0 16px; }
.stk-sum .card { margin: 0; }
.stk-sum strong { display: block; font: 700 1.6rem var(--display); }
.stk-sum .ok-n { color: var(--ok); }
.stk-sum .bad-n { color: var(--bad); }
.stk-done { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
@media (max-width: 899px) {
  /* the check pages' Save / Move stays at the bottom of the screen on phones, like the wizard's Back / Next */
  .stk-done { position: sticky; bottom: 0; z-index: 15; margin: 16px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .stk-done .btn { flex: 1 1 auto; }
  .sadd-foot { padding: 8px 14px 12px; }
}

/* ---- Step by step: new install and renewal (review group 5). The install form's parts in the wizard, its check screen
   drawn with the same step bar (installs/review), both also in a pop-up; the renew form (renewals/create). */
.fmain > .wiz-head { margin: 0 0 4px; }
.fmain > .wiz-nav { margin-top: 4px; }
.wiz .fpart > h2 .fnum { display: none; }        /* the step bar numbers the parts */
.fnext .btn, .fmain > .wiz-nav .btn { min-height: 48px; font-size: 1rem; }
.fnext { margin-top: 4px; }
a.wiz-dot { text-decoration: none; }
a.wiz-dot:hover .wiz-name { text-decoration: underline; }
.fcheck-steps { margin: 0 0 16px; }
.in-popup .fpage-head h1 { display: none; }      /* the pop-up's title bar says it */
.in-popup .fpage-head { margin-bottom: 8px; }
.in-popup .rn-back { display: none; }
.rn-form section > h2 { margin: 0 0 12px; font-size: 1.0625rem; }
.rn-form .rn-vehicles { margin: 0; }
.rn-pay-note { margin: 12px 0 0; }
.rn-form .ccode { margin-top: 16px; box-shadow: none; }
@media (max-width: 899px) {
  .focused .fmain > .wiz-nav { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .fmain > .wiz-nav { margin-bottom: 0; }
}
/* six quick-entry buttons: two even rows of three on computers (not five and one) */
@media (min-width: 640px) { .quick.q6 { grid-template-columns: repeat(3, 1fr); } }
/* the renew form's vehicles: plate, owner, expiry and channel; the price on the right only for those who may see it */
.rn-vehicles { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rn-vehicles li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 10px 14px; background: var(--surface); }
.rn-vehicles li + li { border-top: 1px solid var(--line-soft); }
.rn-v-text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.rn-v-text strong { color: var(--text); font-size: .9375rem; font-weight: 600; }
.rn-v-price { font-weight: 600; white-space: nowrap; }
.flash.bad + .rn-vehicles { margin-top: 12px; }
/* the renew page outside a pop-up keeps the phone bottom bar: Back / Next stick just above it, not under it */


/* Expenses tab (user, 2026-11-19). Computers: Date | What for | Category | How paid | Amount | View.
   Phones: the list cards, amount top left (where the plate sits on the installs list), category top right. */
.exp-tiles .exp-v { font-size: 1.5rem; }
.ltable.exp { --cols: 120px minmax(220px, 2fr) minmax(170px, 1fr) minmax(140px, 1fr) 140px 90px; --minw: 940px; }
.ltable.exp .lc-status .pill { white-space: normal; line-height: 1.25; padding: 4px 10px; }
.exp-amt a { font: 700 1.125rem var(--display); color: var(--text); text-decoration: none; white-space: nowrap; }
.exp-amt a.in { color: var(--ok); }
.lrow.exp-deleted .exp-amt a { color: var(--muted); text-decoration: line-through; }
.lhead .num { text-align: right; }
@media (min-width: 900px) {
  .exp-tiles .exp-v { font-size: 1.75rem; }
  .ltable.exp .exp-amt { align-items: flex-end; }
  .exp-amt a { font-size: 1rem; }
}
/* Group 10: petty cash by branch on the Expenses list, and the dealer's own expenses switch */
.exp-branches { list-style: none; margin: 0; padding: 0 0 8px; }
.exp-branches li + li { border-top: 1px solid var(--line-soft); }
.exp-branches a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 10px 20px; color: var(--text); text-decoration: none; }
.exp-branches a:hover b, .exp-branches a:focus-visible b { color: var(--accent-strong); }
.exp-branches b { font: 600 1rem var(--display); white-space: nowrap; }
.dl-exp-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.dl-exp-row h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dl-exp-row p { margin: 0; max-width: 60ch; }
.page-head .exp-sum { font: 700 2rem/1.1 var(--display); margin: 0; color: var(--text); }
.page-head .exp-sum.in { color: var(--ok); }

/* Validate M-Pesa code (group 6, docs/group-6-mpesa.html section 3): a pop-up from the job's page. The job it is for in a
   quiet chip, the payment found as label / value lines, full-width buttons (phone first). Renewal page: its actions row. */
.vc { max-width: 520px; }
.vc .btn { width: 100%; }
.vc-for { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); margin: 0 0 14px; font-size: .9375rem; overflow-wrap: anywhere; }
.vc-for .ic { flex: 0 0 auto; color: var(--brand); }
.vc-for + form label { margin-top: 0; }
.vc-code { text-transform: uppercase; letter-spacing: .04em; }
.vc-hint { margin: 6px 0 16px; }
.vc-found { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; background: var(--surface); }
.vc-found table { width: 100%; font-size: .9375rem; border-collapse: collapse; }
.vc-found th { text-align: left; font-weight: 500; font-size: inherit; color: var(--muted); padding: 4px 12px 4px 0; white-space: nowrap; vertical-align: top; width: 1%; border: 0; background: none; }
.vc-found td { padding: 4px 0; overflow-wrap: anywhere; border: 0; }
.vc-pill { margin: 0 0 14px; }
.vc-note { margin: 10px 0 0; }
.vc-other { margin: 14px 0 0; text-align: center; font-size: .9375rem; }
.rn-pay-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
@media (max-width: 639px) { .rn-pay-actions > * { flex: 1 1 auto; } .rn-pay-actions .btn { width: 100%; } }

/* M-Pesa payment prompt pop-up (group 6) */
.mp-for { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); margin: 0 0 14px; font-size: .9375rem; }
.mp-wait { text-align: center; padding: 18px 8px 6px; }
.mp-spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--amber); margin: 0 auto 12px; animation: mp-spin 1s linear infinite; }
@keyframes mp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mp-spin { animation: none; } }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.mp-ok { display: flex !important; align-items: center; gap: 6px; }

/* Company documents (status walk-through, user 2026-11-20). Computers: Document | Type | Added | Open / Download / Edit.
   Phones: the list cards (name on top, type and date side by side, buttons below). */
.ltable.docs { --cols: minmax(260px, 2fr) minmax(110px, .7fr) minmax(160px, 1fr) 240px; --minw: 820px; }
.ltable.docs .lc-main a.open { color: var(--text); text-decoration: none; }
@media (max-width: 899.98px) { .ltable.docs .lrow { grid-template-areas: "main main main" "ref ref when" "act act act"; } }
.ltabs:not(:has(.ltab)) { display: none; }   /* a list without quick filters: no empty bar */
.ltable.docs .lc-act > .btn:has(svg) { flex: 0 0 44px; }
@media (min-width: 900px) { .ltable.docs .lc-act { justify-content: flex-end; flex-wrap: nowrap; } .ltable.docs .lc-act > .btn { flex: 0 0 auto; } }

/* M-Pesa prompt waiting screen (group 7): a loading screen the person stays on. */
.mp-wait { padding: 28px 8px 8px; }
.mp-wait .mp-spin { width: 64px; height: 64px; border-width: 6px; margin-bottom: 18px; }
.mp-wait-h { font: 600 1.25rem/1.3 var(--display); margin: 0 0 8px; }
.mp-wait p { margin: 0 0 8px; }
.mp-clock { font: 600 1rem var(--monofont); color: var(--text); }
.mp-keep { color: var(--muted); }
.mp-wait .mp-late { text-align: left; margin: 14px 0 0; }
.mp-stop { text-align: center; margin: 18px 0 4px; }

/* My renewals due (group 7): the two-way switch "Vehicles I fitted" / "All" above the renewals list.
   Same grey bar as the status tabs; on phones the two halves share the width and long dealer names wrap. */
.lscope { margin: 0 0 10px; overflow: visible; }
.lscope .ltab { flex: 1 1 0; justify-content: center; min-width: 0; padding-block: 6px; white-space: normal; text-align: center; line-height: 1.2; }
@media (min-width: 900px) {
  .lscope { display: inline-flex; max-width: 100%; margin: 0 0 12px; }
  .lscope .ltab { flex: 0 1 auto; }
}

/* PIN reset by email (group 7): the local email outbox keeps the email's line breaks */
.devmail-body { white-space: pre-line; overflow-wrap: anywhere; min-width: 16rem; }

/* Director's "Renewals: who did them" on Home (group 7). Phones: plate + how confirmed, then who (with View), then when. */
@media (max-width: 639px) {
  .dash-who .box-head { padding-left: 14px; padding-right: 14px; }
  .dash-who .dash-table .dr-tech { grid-column: 1; grid-row: 2; }
  .dash-who .dash-table .dr-act { grid-column: 2; grid-row: 2; }
  .dash-who .dash-table .dr-dealer { grid-column: 1 / -1; grid-row: 3; }
}

/* Quick entry, the approved pop-up look (group-5-popups.html, user 2026-11-20): amber = this person's main action,
   a line under each label, the other icons coloured in turn. Phones: icon on top, words under it. */
.quick a .qtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quick a small { font-size: .8125rem; font-weight: 400; color: var(--muted); line-height: 1.3; }
.quick a.key small { color: color-mix(in srgb, var(--amber-ink) 78%, transparent); }
.quick a .qico.tone-info { background: var(--info-bg); color: var(--info); }
.quick a .qico.tone-ok { background: var(--ok-bg); color: var(--ok); }
.quick a .qico.tone-amber { background: var(--amber-soft); color: var(--warn); }
.quick a .qico.tone-violet { background: var(--violet-bg); color: var(--violet); }
@media (max-width: 639px) {
  .quick a { flex-direction: column; align-items: flex-start; min-height: 104px; padding: 12px; gap: 10px; }
  .quick a small { font-size: .75rem; }
}

/* Add stock: "same start for this batch" (group 8) */
.sadd-start { margin: 0 0 4px; }
.sadd-start label { margin-top: 0; font-size: .8125rem; }
.sadd-start input { max-width: 220px; min-height: 40px; }
.sadd-full { margin: 4px 0 0; min-height: 0; }
.sadd-full:empty { display: none; }

/* ===== Group 9 · technician job card: wizard, photos, check and close (agent C) ===== */
/* ===== end group 9 · technician ===== */

/* ===== Group 9 · office: new installation, open job cards, job page, homes (agent D) ===== */
/* New installation (mockup 2a): four numbered parts, two fields a row on computers, one on phones */
.oi-form .fpart + .fpart { margin-top: 12px; }
.oi-form .fpart > h2 { margin-bottom: 4px; }
.oi-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.oi-grid .wide { grid-column: 1 / -1; }
.oi-grid input, .oi-grid select { width: 100%; }
.oi-grid input.plate-input { max-width: none; }
.oi-when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.oi-when .wide { grid-column: 1 / -1; }
@media (min-width: 700px) { .oi-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.oi-later { margin: 8px 0 0; }
.oi-chips { flex-wrap: wrap; overflow: visible; }
.oi-chips .chip { position: relative; }
.oi-chips .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.oi-chips .chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.oi-chips .chip:focus-within { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
.oi-pick { margin-top: 12px; }
.oi-find input { min-height: 44px; }
.oi-units { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: 360px; overflow-y: auto; }
.oi-unit { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; min-height: 52px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font-weight: 400; cursor: pointer; }
.oi-unit input { width: 20px; height: 20px; flex: 0 0 auto; margin: 0; accent-color: var(--brand); }
.oi-unit .mono { display: block; font-weight: 600; }
.oi-unit .sub { display: block; font-size: .8125rem; color: var(--muted); }
.oi-unit.on, .oi-unit:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.oi-unit.off { opacity: .55; cursor: not-allowed; }   /* another branch's store: seen from the main branch, not sendable */
.oi-actions { margin-top: 16px; }
@media (max-width: 639px) { .oi-actions .btn { flex: 1 1 100%; } }

/* Job page of an open job card (mockup 5) */
.plate.none.lg { line-height: 38px; font-size: .875rem; }
.oi-assign > summary { list-style: none; cursor: pointer; }
.oi-assign > summary::-webkit-details-marker { display: none; }
.oi-assign[open] > summary .ic { transform: rotate(180deg); }
.oi-assign-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.oi-assign-form > div { flex: 1 1 260px; }
.oi-assign-form label { margin-top: 0; }
.oi-assign-form select { width: 100%; }
.oi-assign-form p { flex: 1 1 100%; margin: 0; }
.oi-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@media (min-width: 760px) { .oi-cols { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.oi-paid { color: var(--ok); font-weight: 600; }
.oi-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 4px 20px 18px; }
.oi-shot { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: .8125rem; font-weight: 600; text-align: center; min-width: 0; }
.oi-shot img, .oi-shot .oi-none { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); background: var(--surface-2); color: var(--muted); }
.oi-shot.done img { border-color: var(--ok); }

/* Open job cards list (mockup 6): tiles, then Vehicle · Job card · Technician · Started · Photos · Still needed */
.stat[aria-current="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.oi-table { --cols: minmax(130px, 1fr) 100px minmax(150px, 1.2fr) minmax(120px, 1fr) 100px minmax(150px, 1.2fr) 80px; --minw: 940px; }
.oi-old, .oi-old b { color: var(--warn); font-weight: 600; }
.oi-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.oi-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.oi-dots i.on { background: var(--ok); }
.oi-assign-link { font-size: .875rem; font-weight: 600; margin-left: 6px; }
@media (max-width: 899px) {
  .oi-table .lrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "veh ph" "main main" "ref when" "need need" "act act"; }
  .oi-table .oi-ph { grid-area: ph; align-items: flex-end; font-size: .875rem; }
  .oi-table .oi-need { grid-area: need; font-size: .875rem; }
  .oi-table .oi-need::before { content: attr(data-label); font-size: .75rem; color: var(--muted); }
}

/* Technician's home (mockup 1): My open job cards, each with Continue */
.oi-mine .oi-jcs { padding: 0 20px 8px; }
.oi-jc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.oi-jc:first-child { border-top: 0; padding-top: 4px; }
.oi-jc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 2px 0; }
.oi-jc .sub { font-size: .8125rem; color: var(--muted); }
.oi-jc .btn { width: auto; }
.oi-from { font-size: .75rem; font-weight: 600; color: var(--info); }

/* Group 9: the technician's job card (installs/form, installs/review), from the agreed mockup (screens 2–4).
   Device: tap one of yours (a list of the technician's units, the radio hidden, the row is the button). */
.jc-status-line { font-weight: 600; }
.jc-status[data-state="saved"] { color: var(--ok); }
.fhead-saved.jc-status[data-state="saved"] { color: var(--ok-on-nav); }
.fhead-saved.jc-status[data-state="offline"], .fhead-saved.jc-status[data-state="error"] { color: var(--amber); }
.jc-status[data-state="saving"], .jc-status[data-state="waiting"] { color: var(--muted); }
.jc-status[data-state="offline"], .jc-status[data-state="error"] { color: var(--warn); }
.jc-sep { margin: 0 4px; color: var(--muted); }
.jc-from { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--info-bg); color: var(--info); font-size: .875rem; }
.jc-from > span { color: var(--text); }
.jc-find { margin: 8px 0 4px; }
.jc-find input { width: 100%; min-height: 44px; }
.jc-pick { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: 420px; overflow-y: auto; }
.jc-pick-i { position: relative; display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; min-height: 56px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font-weight: 400; cursor: pointer; }
.jc-pick-i input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.jc-pick-i .grow { flex: 1 1 auto; min-width: 0; }
.jc-pick-serial { display: block; font-weight: 600; overflow-wrap: anywhere; }
.jc-pick-sub { display: block; font-size: .8125rem; color: var(--muted); }
.jc-nosim { color: var(--warn); font-weight: 600; }
.jc-pick-bad { display: block; font-size: .8125rem; color: var(--bad); font-weight: 600; }
.jc-pick-tick { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); color: transparent; }
.jc-pick-i:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.jc-pick-i:has(input:checked) .jc-pick-tick { border-color: var(--brand); background: var(--brand); color: var(--brand-ink); }
.jc-pick-i:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.jc-pick-i.gone { border-style: dashed; }
.jc-pick-note { margin: 8px 0 0; }
.jc-scan { margin-top: 10px; }
.jc-dm { margin-top: 12px; }
/* Photos: the one being taken large, the two below with a green tick when done */
.jc-howto { margin: 6px 0 12px; font-size: .875rem; color: var(--muted); }
.jc-howto b { display: block; font-size: .9375rem; color: var(--text); }
.jc-view { position: relative; display: flex; align-items: center; justify-content: center; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; width: 100%; max-width: 560px; background: #20262b; }
.jc-view img { display: block; width: 100%; height: 100%; object-fit: cover; }
.jc-view-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; position: absolute; inset: 0; background: var(--surface-2); border: 2px dashed var(--line); border-radius: 14px; color: var(--muted); font-weight: 600; }
.jc-corner { position: absolute; width: 26px; height: 26px; border: 3px solid #fff; opacity: .9; pointer-events: none; }
.jc-view-empty:not([hidden]) ~ .jc-corner { display: none; }
.jc-corner.c1 { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.jc-corner.c2 { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.jc-corner.c3 { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.jc-corner.c4 { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }
.jc-vlabel { position: absolute; left: 16px; bottom: 16px; padding: 4px 10px; border-radius: 8px; background: rgb(0 0 0 / .72); color: #fff; font: 600 .875rem var(--sans); }
.jc-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0 0; max-width: 560px; }
.jc-shot-wrap { min-width: 0; }
.jc-shot { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: .8125rem; font-weight: 600; text-align: center; color: var(--text); cursor: pointer; min-width: 0; }
.jc-shot .pic { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 2px solid var(--line); background: var(--surface-2); color: var(--muted); }
.jc-shot .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jc-shot .tick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; margin: 0; border-radius: 50%; background: var(--ok); color: #fff; display: none; align-items: center; justify-content: center; }
.jc-shot.done .pic { border-color: var(--ok); }
.jc-shot.done .tick { display: flex; }
.jc-shot.done .jc-shot-empty { display: none; }
.jc-shot.now .pic { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
.jc-shot .sub { font-weight: 500; color: var(--muted); }
.jc-shot.done .sub { color: var(--ok); }
.jc-shot-name { overflow-wrap: anywhere; }
.jc-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.jc-shot-wrap { position: relative; }
.jc-shot-wrap:has(.jc-file:focus-visible) .pic { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.jc-ph-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 0; font-size: .875rem; }
.jc-ph-msg { flex: 1 1 200px; }
.jc-ph-bar { flex: 1 1 100%; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.jc-ph-bar > span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.jc-ph-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
/* Check and close */
.jc-need-title { margin: 16px 0 8px; font-weight: 600; }
.jc-need { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.jc-need li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; min-height: 48px; }
.jc-need li + li { border-top: 1px solid var(--line-soft); }
.jc-need li .ic { flex: 0 0 auto; }
.jc-need li.ok .ic { color: var(--ok); }
.jc-need li.bad .ic { color: var(--warn); }
.jc-need li .grow { flex: 1 1 auto; min-width: 0; }
.jc-need li a { flex: 0 0 auto; font-weight: 600; }
.jc-ready { margin-bottom: 16px; }
.jc-count { margin-left: 6px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.jc-nophoto { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 4 / 3; border-radius: 10px; border: 2px dashed var(--line); background: var(--surface-2); color: var(--muted); font-size: .8125rem; font-weight: 600; }
.cphotos .jc-nophoto { aspect-ratio: auto; height: 120px; }
.jc-bar { align-items: center; }
.jc-bar form { flex: 1 1 auto; display: flex; }
.jc-bar form .btn { flex: 1 1 auto; }
.jc-only { flex: 1 1 auto; margin: 0; font-size: .875rem; color: var(--muted); }
.jc-later { margin: 12px 0 0; text-align: center; }
.jc-delete { margin: 20px 0 0; }
.jc-delete > summary { cursor: pointer; color: var(--bad); font-weight: 600; font-size: .875rem; }
.jc-delete form { margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.jc-delete input { width: 100%; }
.jc-delete .btn { margin-top: 10px; }
@media (max-width: 899px) { .oi-jc .btn.sm { min-height: 44px; } }
/* ===== end group 9 · office ===== */

/* ===== Group 9 · money: dealer balance, credit approval, make valid (agent B) ===== */
/* Dealer page (screen 8): devices held, owes us / in credit, the limit */
.dl-money { margin-top: 16px; }
.dl-money .stat .v.ok { color: var(--ok); }
.dl-pay { margin: 0; }
.dl-limit { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.dl-limit-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.dl-limit-row input { flex: 1 1 160px; max-width: 240px; margin: 0; }
.dl-limit-note { margin: 6px 0 0; }
@media (max-width: 599px) { .dl-limit-row input { max-width: none; } .dl-limit-row .btn { flex: 1 1 100%; } }

/* Unmatched payments: money held on a vehicle until its renewal is started */
.pay-held { display: inline-block; margin-top: 4px; color: var(--info); font-weight: 600; }

/* A job waiting for payment: credit line and "Make valid without payment" (payments/_job-actions) */
.ja { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0; }
.ja-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.ja-waive > summary { cursor: pointer; }
.ja-waive .deact-box input { width: 100%; }

/* Credit to approve (credit.final) */
.cf-list { display: grid; gap: 16px; }
.cf-item { margin: 0; }
.cf-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; margin-bottom: 8px; }
.cf-plate { margin: 0; }
.cf-sub { margin: 2px 0 0; }
.cf-amount { font: 700 1.25rem/1.2 var(--display); }
.cf-kv { margin: 0 -16px 12px; }
.cf-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.cf-actions form { margin: 0; }
.cf-refuse > summary { list-style: none; }
.cf-refuse > summary::-webkit-details-marker { display: none; }
.cf-refuse[open] > summary { display: none; }
.cf-refuse form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.cf-refuse label { flex: 1 1 100%; margin: 0; }
.cf-refuse input { flex: 1 1 220px; margin: 0; }
@media (max-width: 599px) { .cf-actions > form, .cf-actions > details, .cf-actions .btn { flex: 1 1 100%; width: 100%; } }
/* ===== end group 9 · money ===== */

/* ===== Group 9 · pulse settings (agent E) ===== */
/* Settings → Pulse settings: a plain reference table (scrolls sideways on a phone) and an "Add row" form under it */
.pulse-table table { min-width: 560px; }
.pulse-table td { vertical-align: middle; }
.pulse-table td.num { font-family: var(--monofont); font-weight: 600; font-variant-numeric: tabular-nums; }
.pulse-table .acts { white-space: nowrap; text-align: right; }
.pulse-table .acts > a, .pulse-table .acts .linkbtn { font-size: .875rem; font-weight: 600; margin-left: 12px; text-decoration: none; }
.pulse-table .acts form { display: inline; }
.pulse-table tr.editing td { background: var(--surface-2); vertical-align: top; }
.pulse-table tr.editing .acts { padding-top: .9rem; }
.pulse-add { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: start; margin: 16px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow); }
.pulse-add label { margin: 0 0 6px; font-size: .8125rem; line-height: 1.5; }
.pulse-add label .hint { font-size: inherit; }
.pulse-add .btn { align-self: start; }
.pulse-note { margin-top: 8px; }
@media (min-width: 700px) {
  .pulse-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px auto; }
  .pulse-add .btn { margin-top: calc(.8125rem * 1.5 + 6px); }
}
/* ===== end group 9 · pulse ===== */

/* ===== trip wires (owner, 2026-11-26): Home "Security alerts" and Admin → Security ===== */
.dash-sec-alerts.alarm { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.sec-counts { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0 20px 14px; font-size: .875rem; }
.sec-counts a { color: var(--muted); text-decoration: none; }
.sec-counts a:hover { color: var(--brand); }
.sec-counts strong { font: 600 1.25rem var(--display); color: var(--text); margin-right: 4px; }
.sec-counts strong.bad { color: var(--bad); }
.sec-chips { padding: 0 20px 12px; }
.sec-table .dr-veh strong { font-weight: 600; }
.sec-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.sec-who { flex: 1 1 260px; min-width: 0; }
.sec-who .sub { display: block; margin-top: 3px; font-size: .8125rem; color: var(--muted); overflow-wrap: anywhere; }
.sec-undo { flex: 1 1 300px; display: flex; gap: 8px; align-items: center; max-width: 460px; margin: 0; }
.sec-undo input { flex: 1 1 auto; min-width: 0; margin: 0; }
.sec-undo .btn { flex: 0 0 auto; }
.sec-path { overflow-wrap: anywhere; }
.sec-detail { margin: 0; padding-left: 18px; }
.sec-detail li { overflow-wrap: anywhere; }
.sec-trail { margin: 0; padding: 0 20px 16px 44px; font-size: .875rem; }
.sec-trail li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.sec-trail li:last-child { border-bottom: 0; }
.sec-trail .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-trail .p { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 639px) {
  .sec-counts, .sec-chips { padding-left: 14px; padding-right: 14px; }
  .sec-row { padding: 12px 14px; }
  .sec-undo { max-width: none; }
  .sec-trail { padding: 0 14px 14px 34px; }
}
a.badge { text-decoration: none; }
/* ===== end trip wires ===== */

/* ===== refunds and unmatched payments (2026-11-30, mockup docs/mockups/p2-1-invoices/MatchRefund.dc.html) =====
   Payments → Unmatched / Refunds: a table on computers, cards on phones. The pop-up (payments/refund.blade.php): three
   choices as radios, the panel under the ticked one shows (every panel shows in a browser without :has). */
.pay-tag { margin-top: 6px; }
.pay-table .nowrap { white-space: nowrap; }
.pay-do { display: flex; flex-wrap: wrap; gap: 6px; min-width: 180px; }
.pay-other { display: flex; flex-wrap: wrap; gap: 16px 32px; margin-top: 1rem; }
.pay-other > * { flex: 1 1 280px; min-width: 0; }
@media (max-width: 899px) {
  .tablewrap:has(> .pay-table) { border: 0; background: none; overflow: visible; }
  .pay-table, .pay-table tbody, .pay-table tr, .pay-table td { display: block; }
  .pay-table thead { display: none; }
  .pay-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px; margin: 0 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
  .pay-table td { padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .pay-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-family: var(--sans); font-size: .8125rem; }
  .pay-table .pt-when { grid-column: 1; grid-row: 1; font-weight: 600; }
  .pay-table .pt-amount { grid-column: 2; grid-row: 1; text-align: right; font: 600 1rem var(--display); }
  .pay-table .pt-full, .pay-table .pt-do { grid-column: 1 / -1; }
  .pay-table .pt-do { padding-top: 6px; }
  .pay-do .btn { flex: 1 1 auto; min-height: 44px; }
}
.mr h1[tabindex="-1"]:focus { outline: none; }   /* the pop-up focuses its heading for screen readers */
.mr-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; margin: 0 0 14px; }
.mr-head h1 { margin: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.mr-head p { margin: 4px 0 0; color: var(--muted); font-size: .9375rem; }
.mr-choices { border: 0; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mr-choices legend { font-weight: 700; margin: 0 0 10px; padding: 0; }
.mr-choice { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 400; cursor: pointer; }
.mr-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.mr-choice input { flex: 0 0 auto; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); }
.mr-choice .sub { display: block; margin-top: 2px; color: var(--muted); font-size: .875rem; }
.mr-panel { margin: 0 0 16px; }
.mr-panel > label:first-child, .mr-panel .row label { margin-top: 0; }
.mr-panel .row > div { margin-bottom: .75rem; }
.mr-note { flex: 1 1 240px; color: var(--muted); font-size: .8125rem; }
@supports selector(:has(*)) {
  .mr-panel { display: none; }
  .mr:has(#do-job:checked) .mr-job, .mr:has(#do-keep:checked) .mr-keep, .mr:has(#do-refund:checked) .mr-refund { display: block; }
}
/* ===== end refunds ===== */

/* ===== P2-1 invoices (Money → Invoices; mockup docs/mockups/p2-1-invoices/): list, form, one invoice, payment pop-up ===== */
/* list: number · client · date · due · total · still owed · status. Phones: number + status, client, due | still owed */
.inv-tiles .inv-v { font-size: 1.375rem; }
.ltable.inv { --cols: 64px minmax(170px, 2fr) 104px 104px 96px 100px minmax(120px, auto); --minw: 840px; }
.ltable.inv .lrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "veh status" "main main" "ref when"; }
.ltable.inv .inv-desk { display: none; }
.ltable.inv .inv-desk-only { display: none; }
.inv-no { font-size: 1.0625rem; font-weight: 600; color: var(--text); text-decoration: none; }
.ltable.inv .lc-when { align-items: flex-end; text-align: right; }
.inv-owed { font-weight: 700 !important; }
.inv-late { color: var(--bad); font-weight: 600; }
.lrow.inv-cancelled .lc-main b, .lrow.inv-cancelled .inv-no { text-decoration: line-through; color: var(--muted); }
@media (min-width: 900px) {
  .inv-tiles .inv-v { font-size: 1.75rem; }
  .ltable.inv .lrow { grid-template-columns: var(--cols); grid-template-areas: none; }
  .ltable.inv .inv-desk { display: flex; }
  .ltable.inv .inv-desk-only { display: inline; }
  .ltable.inv .inv-phone-only { display: none; }
  .ltable.inv .num, .ltable.inv .lc-when { align-items: flex-end; text-align: right; }
}

/* form: segmented Invoice / Proforma / Quotation and Installation / Renewal / Other (radios), the parts, the summary */
.inv-cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.inv-main { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.inv-aside { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.inv-main > .box, .inv-aside > .box, .inv-aside > .card { margin: 0; }
.inv-segs { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.inv-seg { display: inline-flex; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; min-width: 0; }
.inv-seg label { margin: 0; position: relative; flex: 1 1 auto; }
.inv-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.inv-seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; color: var(--muted); font-weight: 600; font-size: .9375rem; cursor: pointer; white-space: nowrap; }
.inv-seg label + label span { border-left: 1px solid var(--line); }
.inv-seg input:checked + span { background: var(--brand-soft); color: var(--brand); }
.inv-seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: -3px; }
.inv-seg-fixed { display: flex; flex-direction: column; justify-content: center; min-height: 44px; }
.inv-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.inv-two .fwide { grid-column: 1 / -1; }
@media (min-width: 640px) { .inv-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.inv-form .fpart > h2 { margin-bottom: 4px; }
.inv-form .fpart > label:first-child, .inv-two > div:first-child > label:first-child, .inv-two > div:nth-child(2) > label:first-child { margin-top: 0; }
.inv-segs + .inv-two, .inv-segs ~ .inv-two { margin-top: 12px; }
.inv-form textarea { width: 100%; font: inherit; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.inv-plates-box { font-family: var(--monofont) !important; font-size: .9375rem !important; line-height: 1.6; text-transform: uppercase; min-height: 120px; resize: vertical; }
.inv-plates-note { margin: 6px 0 0; }
.inv-plates-note strong { color: var(--text); }
.inv-form .fnote.warn { margin: 4px 0 0; }
.inv-help { margin: 8px 0 0; }
.inv-form:has(input[name="kind"][value="other"]:checked) .inv-for-units { display: none; }
.inv-form:has(input[name="kind"]:checked):not(:has(input[name="kind"][value="other"]:checked)) .inv-for-other { display: none; }
.inv-form:has(input[name="type"]:checked):not(:has(input[name="type"][value="invoice"]:checked)) .inv-only-invoice { display: none; }
.inv-more { margin-top: 12px; border-top: 1px solid var(--line-soft); }
.inv-more > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 48px; color: var(--brand); font-weight: 600; cursor: pointer; list-style: none; }
.inv-more > summary::-webkit-details-marker { display: none; }
.inv-more > summary .ic { transition: transform .15s; }
.inv-more[open] > summary .ic { transform: rotate(180deg); }
.inv-more > summary .hint { flex-basis: 100%; margin: -10px 0 6px 26px; }
/* item by item ("Other") */
.inv-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; grid-template-areas: "desc desc del" "qty price price" "amt amt amt"; gap: 0 12px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.inv-l-desc { grid-area: desc; } .inv-l-qty { grid-area: qty; } .inv-l-price { grid-area: price; } .inv-l-del { grid-area: del; color: var(--muted); }
.inv-l-del:hover { background: var(--bad-bg); color: var(--bad); }
.inv-l-amt { grid-area: amt; display: flex; justify-content: space-between; align-items: center; min-height: 36px; padding-top: 8px; }
.inv-l-label { font-size: .875rem; color: var(--muted); }
.inv-l-amt b { font-variant-numeric: tabular-nums; }
.inv-add { margin-top: 12px; }
@media (min-width: 640px) {
  .inv-line { grid-template-columns: minmax(0, 1fr) 72px 112px 92px 44px; grid-template-areas: "desc qty price amt del"; }
  .inv-l-amt { flex-direction: column; align-items: flex-end; justify-content: flex-end; min-height: 44px; padding: 0 0 10px; }
  .inv-l-amt .inv-l-label { font-size: .8125rem; }
}
/* summary on the right: subtotal, VAT, total; the amber Save names the total */
.inv-sum { padding: 8px 16px 12px; }
.inv-sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.inv-sum-row[hidden] { display: none; }
.inv-sum-row > span:first-child { color: var(--muted); }
.inv-sum-row.total { border-bottom: 0; font: 700 1.25rem var(--display); }
.inv-sum-row.total > span:first-child { color: var(--text); }
.inv-sum .inv-vat { margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 500; }
.inv-save, .inv-cancel { width: 100%; }
.inv-save { min-height: 52px; font-size: 1rem; }
.inv-bar { display: none; }
@media (min-width: 900px) { .inv-form .inv-aside { position: sticky; top: 16px; } }
@media (max-width: 899px) {
  .inv-form .inv-aside .inv-save { display: none; }
  .inv-bar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; gap: 12px; margin: 16px -12px 0; padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .inv-bar-total { flex: 1 1 auto; display: flex; flex-direction: column; line-height: 1.2; }
  .inv-bar-total b { font: 700 1.25rem var(--display); }
  .inv-bar .btn { flex: 0 0 45%; min-height: 52px; font-size: 1rem; }
  .inv-seg { display: flex; width: 100%; }
  .inv-seg span { padding: 0 8px; }
}

/* one invoice */
.inv-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.inv-title .mono { font-size: .9em; }
.inv-actions form { margin: 0; }
.inv-lines-table { border: 0; border-radius: 0; }
.inv-lines-table th:first-child, .inv-lines-table td:first-child, .inv-pay-table th:first-child, .inv-pay-table td:first-child { padding-left: 20px; }
.inv-lines-table th:last-child, .inv-lines-table td:last-child, .inv-pay-table th:last-child, .inv-pay-table td:last-child { padding-right: 20px; }
.inv-lines-table td, .inv-pay-table td { padding-top: 12px; padding-bottom: 12px; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-item { min-width: 220px; }
.inv-item-sum { display: none; font-size: .8125rem; color: var(--muted); margin-top: 6px; }
.inv-plates { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.inv-plates .plate { font-size: .875rem; min-height: 26px; line-height: 22px; padding: 0 7px; }
.inv-totals { margin-left: auto; max-width: 380px; padding: 4px 20px 16px; border-top: 1px solid var(--line); }
.inv-sum-row.owed { border-bottom: 0; font-weight: 700; }
.inv-sum-row.owed > span:first-child { color: var(--text); }
.inv-sum-row.owed.late { color: var(--bad); }
.inv-pay-table { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.inv-howpay { line-height: 1.6; }
.inv-kv { grid-template-columns: 1fr; }
.inv-kv dt { flex-basis: 90px; }
.inv-hist { padding-top: 0; }
.inv-hist .dot { background: var(--line); }
.inv-side-btns { display: flex; flex-direction: column; gap: 8px; }
.inv-side-btns form { margin: 0; }
.inv-side-btns .btn { width: 100%; }
.inv-cancel-box { margin: 0; }
.inv-cancel-box > summary { list-style: none; width: calc(100% - 32px); margin: 16px; }
.inv-cancel-box > summary::-webkit-details-marker { display: none; }
.inv-cancel-box[open] > summary { display: none; }
.inv-cancel-box .box-body { padding-top: 16px; }
.inv-cancel-box .box-body > p:first-of-type { margin-top: 0; }
@media (max-width: 639px) {
  .inv-actions { width: 100%; }
  .inv-actions > .btn, .inv-actions > form { flex: 1 1 calc(50% - 4px); }
  .inv-actions > form .btn { width: 100%; }
  .inv-actions > .btn.key, .inv-actions > form:has(.btn.key) { order: -1; flex-basis: 100%; }
  /* lines: the item with its plates on the full width, "24 × 8,500" under it, only the amount on the right */
  .inv-lines-table thead th:nth-child(2), .inv-lines-table thead th:nth-child(3), .inv-lines-table td:nth-child(2), .inv-lines-table td:nth-child(3) { display: none; }
  .inv-item { min-width: 0; }
  .inv-item-sum { display: block; }
  .inv-lines-table th:first-child, .inv-lines-table td:first-child, .inv-pay-table th:first-child, .inv-pay-table td:first-child { padding-left: 14px; }
  .inv-lines-table th:last-child, .inv-lines-table td:last-child, .inv-pay-table th:last-child, .inv-pay-table td:last-child { padding-right: 14px; }
  .inv-totals { max-width: none; padding: 4px 14px 14px; }
  .inv-pay-table th:nth-child(4), .inv-pay-table td:nth-child(4) { display: none; }   /* who put it here: on the payment's own page */
}

/* payment pop-up: the attach part */
.inv-attach { margin-top: 16px; }
.inv-attach > summary { list-style: none; cursor: pointer; min-height: 52px; }
.inv-attach > summary::-webkit-details-marker { display: none; }
.inv-attach > summary h2 { font-size: 1rem; }
.inv-attach[open] > summary .ic { transform: rotate(180deg); }
.inv-attach-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-attach-form input { flex: 1 1 220px; min-width: 0; text-transform: uppercase; }
.inv-attach-form input::placeholder { text-transform: none; }
.inv-attach-form .btn { flex: 0 0 auto; }
.inv-unm-h { margin: 20px 0 8px; font-size: .9375rem; }
.inv-unmatched { list-style: none; margin: 0; padding: 0; }
.inv-unmatched li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.inv-unm-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.inv-unm-amt { white-space: nowrap; }
.inv-unmatched form { margin: 0; }
@media (max-width: 639px) { .inv-unmatched form, .inv-unmatched form .btn { width: 100%; } .inv-unmatched .btn.sm { min-height: 44px; } .inv-attach-form .btn { flex: 1 1 100%; } }
/* ===== end P2-1 invoices ===== */

/* ===== P2-2 invoices from jobs (Money → Invoices → To invoice; mockup docs/mockups/p2-2-lpo-invoicing/) ===== */
/* To invoice list: client · LPO · installs · renewals · oldest job · amount · Make invoice. Phones: cards (client, oldest | amount, button) */
.ltable.invj { --cols: minmax(160px, 2fr) minmax(100px, 1fr) 60px 70px 104px 88px 136px; --minw: 820px; }
.ltable.invj .inv-desk { display: none; }
.ltable.invj .lc-when { align-items: flex-end; text-align: right; }
.inv-tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) {
  .ltable.invj .inv-desk { display: flex; }
  .ltable.invj .inv-phone-only { display: none; }
  .ltable.invj .num, .ltable.invj .lc-when { align-items: flex-end; text-align: right; }
  .inv-tiles-2 { max-width: 640px; }
}
/* Make invoice: one tappable row per job (tick, plate + what, reference · date · LPO · certificate, amount) */
.invj-all { margin: 0; min-height: 44px; }
.invj-list { list-style: none; margin: 0; padding: 0; }
.invj-list > li { border-top: 1px solid var(--line-soft); }
.invj-list > li:first-child { border-top: 0; }
.invj-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "tick what amt" "tick meta meta"; gap: 4px 12px; align-items: center;
  min-height: 56px; padding: 12px 16px 4px; margin: 0; cursor: pointer; font-weight: 400; }
.invj-row input { grid-area: tick; width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }
.invj-what { grid-area: what; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.invj-kind { font-weight: 600; }
.invj-meta { grid-area: meta; color: var(--muted); font-size: .875rem; }
.invj-amt { grid-area: amt; text-align: right; }
.invj-row:has(input:not(:checked)) .invj-what, .invj-row:has(input:not(:checked)) .invj-amt { opacity: .55; }
.invj-open { display: inline-block; padding: 0 16px 10px 56px; }
.invj-count { margin: 0; border-top: 1px solid var(--line-soft); }
.invj-side { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
.invj-side label { margin-top: 0; }
@media (min-width: 900px) {
  .invj-row { grid-template-columns: 28px minmax(220px, 1fr) minmax(0, 1.4fr) 110px; grid-template-areas: "tick what meta amt"; padding: 10px 16px; }
  .invj-open { padding: 0 16px 8px 56px; }
}
/* the invoice page: vehicles / jobs on it with their state */
.invj-explain { margin: 0; }
.invj-rows { list-style: none; margin: 0; padding: 0 0 4px; }
.invj-rows > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "plate main pill" "plate amt amt"; gap: 4px 12px; align-items: center;
  padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.invj-rows > li > .plate { grid-area: plate; align-self: start; }
.invj-rows-main { grid-area: main; font-size: .9375rem; }
.invj-rows-amt { grid-area: amt; font-variant-numeric: tabular-nums; color: var(--muted); }
.invj-rows > li > .pill { grid-area: pill; justify-self: end; }
@media (min-width: 900px) {
  .invj-rows > li { grid-template-columns: 120px minmax(0, 1fr) 90px 170px; grid-template-areas: "plate main amt pill"; }
  .invj-rows-amt { text-align: right; color: inherit; }
  .invj-rows > li > .pill { justify-self: start; }
}
/* ===== end P2-2 invoices from jobs ===== */

/* ===== Clients (Money → Clients; mockup docs/mockups/clients/): list, one client, form ===== */
/* list: client · KRA PIN · LPOs · invoices · owed · not invoiced · last invoice. Phones: cards (client, owed | not invoiced) */
.ltable.cl { --cols: minmax(190px, 2fr) 120px minmax(110px, 1fr) 76px 120px 104px 120px; --minw: 900px; }
.ltable.cl .inv-desk { display: none; }
.ltable.cl .lc-ref .pill { margin-left: 4px; }
.cl-tiles .dash-tile:last-child { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .ltable.cl .inv-desk { display: flex; }
  .ltable.cl .num, .ltable.cl .lc-when { align-items: flex-end; text-align: right; }
  .ltable.cl .lc-ref { flex-direction: row; justify-content: flex-end; align-items: center; }
  .cl-tiles .dash-tile:last-child { grid-column: auto; }
}
/* one client */
.cl-money .dash-tile-label { color: var(--muted); }
.cl-ok { color: var(--ok); }
.cl-bad { color: var(--bad); }
.cl-list { list-style: none; margin: 0; padding: 0 0 4px; }
.cl-list > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "no what pill" "no amt amt"; gap: 4px 12px; align-items: center;
  padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.cl-list > li[hidden] { display: none; }
.cl-no, .cl-list > li > .plate { grid-area: no; align-self: start; }
.cl-no { font-weight: 600; font-size: 1rem; min-width: 44px; }
.cl-what { grid-area: what; min-width: 0; }
.cl-amt { grid-area: amt; color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-amt b { color: var(--text); }
.cl-list > li > .pill { grid-area: pill; justify-self: end; }
.cl-more { margin: 0; border-top: 1px solid var(--line-soft); }
@media (min-width: 900px) {
  .cl-list > li { grid-template-columns: 110px minmax(0, 1fr) 150px 160px; grid-template-areas: "no what amt pill"; }
  .cl-amt { text-align: right; }
  .cl-list > li > .pill { justify-self: start; }
}
.cl-lpos { list-style: none; margin: 0; padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 14px; }
.cl-lpo-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.cl-left { color: var(--text); }
.cl-bar { display: block; height: 8px; margin-top: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.cl-bar > span { display: block; height: 100%; background: var(--brand); }
.cl-merge > summary { padding: 14px 16px; cursor: pointer; font-weight: 600; min-height: 44px; box-sizing: border-box; }
.cl-merge select { width: 100%; }
/* form */
.cl-form { max-width: 820px; }
.cl-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 16px; }
.cl-fields .fwide { grid-column: 1 / -1; }
.cl-actions { margin-top: 16px; }
@media (min-width: 640px) { .cl-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ===== end Clients ===== */

/* ===== P2-3 statements (Money → Statements; mockup docs/mockups/p2-3-statements/): month end, one statement, send, automatic ===== */
.stm-cr, .stm-in { color: var(--ok); }
.stm-owed { color: var(--bad); }
.stm-none { color: var(--bad); }
/* month end: the month picker, Show chips + buttons, the list (a table on computers, cards on phones), two hint cards */
.stm-month { display: flex; align-items: center; gap: 8px; margin: 0; }
.stm-month select { width: auto; min-width: 170px; }
.stm-arrow { padding: 0 10px; }
.stm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px; }
.stm-bar .chips { flex: 1 1 100%; min-width: 0; }
.stm-bar-note { flex: 1 1 100%; margin: 0; }
.stm-bar-btns { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.stm-bar-btns > .btn, .stm-bar-btns > span { flex: 1 1 auto; }
.stm-bar-btns > span .btn { width: 100%; }
.ltable.stm { --cols: 28px minmax(140px, 1.6fr) 84px 84px 84px 116px minmax(150px, 1fr) minmax(120px, .9fr); --minw: 900px; }
.ltable.stm .lc .sub { font-size: .8125rem; color: var(--muted); }
.stm-total { font-weight: 600; }
.stm-total .lc b { font-weight: 700; }
@media (max-width: 899px) {
  .ltable.stm .lrow { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "tick main main" "tick open close"; }
  .ltable.stm .lc-main .sub.mono { display: inline; }
  .ltable.stm .stm-desk { display: none; }
  .ltable.stm .stm-open, .ltable.stm .stm-close { background: var(--surface-2); padding: 8px 12px; font-size: .875rem; }
  .ltable.stm .stm-open { grid-area: open; border-radius: 8px 0 0 8px; }
  .ltable.stm .stm-close { grid-area: close; border-radius: 0 8px 8px 0; align-items: flex-end; text-align: right; }
  .ltable.stm .stm-open::before, .ltable.stm .stm-close::before { content: attr(data-label); font-size: .75rem; color: var(--muted); }
  .ltable.stm .stm-close .pill { margin-top: 4px; }
  .stm-total { background: var(--surface-2); }
}
@media (min-width: 900px) {
  .stm-bar .chips { flex: 1 1 auto; }
  .stm-bar-note { flex: 1 1 320px; }
  .stm-bar-btns { flex: 0 0 auto; }
  .stm-bar-btns > .btn, .stm-bar-btns > span { flex: 0 0 auto; }
  .ltable.stm .lrow, .ltable.stm .lhead { grid-template-columns: var(--cols); grid-template-areas: none; gap: 0 12px; }
  .ltable.stm .num { align-items: flex-end; text-align: right; }
  .ltable.stm .stm-close > span { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
  .ltable.stm .stm-desk { gap: 4px; }
  .ltable.stm .stm-phone { display: none; }
  .stm-total { background: var(--surface-2); }
}
.stm-hints { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 16px; }
.stm-hint { display: flex; align-items: flex-start; gap: 12px; }
.stm-hint .ic { color: var(--brand); margin-top: 2px; }
.stm-hint p { margin: 0; font-size: .875rem; color: var(--muted); }

/* one statement: the date bar, tiles, lines (table / stacked rows on phones), ageing, the two cards under them */
.stm-acc { font-size: .6em; color: var(--muted); font-weight: 600; vertical-align: middle; }
.stm-dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.stm-dates .chips { flex: 1 1 100%; }
.stm-or { padding-bottom: 12px; font-size: .875rem; }
.stm-field { flex: 1 1 130px; min-width: 0; }
.stm-field label { margin-top: 0; font-size: .8125rem; }
.stm-show { flex: 0 0 auto; }
.stm-dates .error { position: static; }
@media (min-width: 900px) { .stm-dates .chips { flex: 0 1 auto; } .stm-field { flex: 0 1 160px; } }
.stm-tiles .inv-v { font-size: 1.25rem; overflow-wrap: anywhere; }
@media (min-width: 900px) { .stm-tiles .inv-v { font-size: 1.625rem; } }
.stm-lines .tablewrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.stm-lines th:first-child, .stm-lines td:first-child { padding-left: 20px; }
.stm-lines th:last-child, .stm-lines td:last-child { padding-right: 20px; }
.stm-date { white-space: nowrap; }
.stm-bf td, .stm-cf td { background: var(--surface-2); font-weight: 600; }
.plate.stm-plate { font-size: .8125rem; min-height: 22px; line-height: 18px; padding: 0 6px; border-width: 2px; margin-left: 4px; vertical-align: middle; }
.stm-stack { display: none; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.stm-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-soft); font-size: .9375rem; }
.stm-line:first-child { border-top: 0; }
.stm-line > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.stm-line-end { background: var(--surface-2); }
.stm-w { font-size: .8125rem; color: var(--muted); font-weight: 400; }
.stm-amt { flex: 0 0 auto; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.stm-amt .stm-w { font-weight: 500; }
.stm-amt .stm-w.stm-owed { color: var(--bad); }
.stm-none-line { margin: 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
@media (max-width: 639px) { .stm-table { display: none; } .stm-stack { display: block; } }
.stm-age { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 16px 16px; }
.stm-age > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); min-width: 0; overflow-wrap: anywhere; }
.stm-age > div > span:first-child { font-size: .8125rem; color: var(--muted); }
.stm-age b { font: 700 1.25rem/1.2 var(--display); font-variant-numeric: tabular-nums; }
.stm-age .stm-age-late { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); color: var(--bad); }
.stm-age .stm-age-due { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); color: var(--warn); }
.stm-age > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 640px) { .stm-age { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0 20px 18px; } .stm-age > div:last-child:nth-child(odd) { grid-column: auto; } }
.stm-cols { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: flex-start; }
.stm-cols > .box { flex: 1 1 320px; min-width: 0; }
.stm-sent { list-style: none; margin: 0; padding: 0 0 4px; }
.stm-sent > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "when pill" "what what" "open open"; gap: 4px 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.stm-sent-when { grid-area: when; font-weight: 600; font-size: .875rem; }
.stm-sent-what { grid-area: what; min-width: 0; overflow-wrap: anywhere; }
.stm-sent-err { display: block; color: var(--bad); }
.stm-sent > li > .pill, .stm-sent > li > .num { grid-area: pill; justify-self: end; }
.stm-sent > li > a, .stm-sent > li > span:last-child:empty { grid-area: open; }
@media (min-width: 640px) {
  .stm-sent > li { grid-template-columns: 96px minmax(0, 1fr) auto 48px; grid-template-areas: "when what pill open"; }
  .stm-sent > li > a { justify-self: end; }
}

/* send pop-up */
.stm-opt { margin: 12px 0; }
.stm-opt .check { margin-top: 0; font-weight: 600; }
.stm-opt p { margin: 6px 0 0; }
.stm-sms { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: .875rem; overflow-wrap: anywhere; }
@media (max-width: 639px) { .stm-send-btns > .btn { flex: 1 1 0; } .stm-send-btns > .btn.key { flex-basis: 100%; order: -1; } }

/* automatic sending */
.stm-when { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 0 0 8px; }
.stm-say { color: var(--muted); font-size: .875rem; padding-bottom: 12px; }
.stm-find { padding: 0 16px 12px; }
.stm-alist { list-style: none; margin: 0; padding: 0; }
.stm-arow { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "tick name name" ". when how" ". last last"; gap: 6px 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.stm-arow[hidden] { display: none; }
.stm-ahead { display: none; }
.stm-atick { grid-area: tick; }
.stm-aname { grid-area: name; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.stm-awhen { grid-area: when; min-width: 0; }
.stm-ahow { grid-area: how; min-width: 0; }
.stm-alast { grid-area: last; }
.stm-anone { grid-column: 2 / -1; }
.stm-anote { margin: 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
@media (min-width: 900px) {
  .stm-arow { grid-template-columns: 64px minmax(180px, 1.4fr) 200px 160px minmax(150px, 1fr); grid-template-areas: "tick name when how last"; }
  .stm-ahead { display: grid; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .8125rem; font-weight: 600; padding: 8px 16px; }
  .stm-ahead > span { grid-area: auto; }
  .stm-anone { grid-column: 3 / -1; }
  .stm-find { max-width: 420px; }
}
.stm-reports { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.stm-report { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.stm-report .check { margin-top: 0; font-weight: 600; }
.stm-report p { margin: 4px 0; }
@media (min-width: 900px) { .stm-reports { grid-template-columns: 1fr 1fr; } }
.stm-goes { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.stm-goes-h { margin: 0 0 4px; font-size: 1rem; }
.stm-extra { max-width: 420px; margin-top: 8px; }
/* the wallet page: "Latest entries" with the link to the full statement */
.stm-wallet-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 1.5rem 0 .5rem; }
.stm-wallet-head h2 { margin: 0; }
.lrow .stm-desk { min-width: 0; }
.lrow .stm-desk .pill { white-space: normal; line-height: 1.3; padding-block: 3px; }                        /* "By itself · 1 Dec, 08:00" wraps in its column */
/* ===== end P2-3 statements ===== */

/* === P2-4 petty cash === (mockup docs/mockups/p2-4-suppliers-petty-cash/ screens 5–8)
   Money → Expenses → Requests (.ltable.pc: No. | Who asked | For | KES | Where it stands | buttons; phones: cards),
   the Petty cash statement tab (.ltable.pcs), Petty cash → My requests (.pc-mine cards), the ask and pay-out pop-ups,
   Home → "Waiting for you" for the director (.pc-dir cards). Refuse opens a reason box under the button (.pc-refuse). */
.pc-tiles .dash-tile-sub { overflow-wrap: anywhere; }
.pc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.pc-bar .chips { flex: 1 1 100%; min-width: 0; }
.pc-branch select { min-height: 44px; }
.ltable.pc { --cols: 76px minmax(130px, 1fr) minmax(170px, 1.5fr) 72px minmax(150px, 1.1fr) 196px; --minw: 900px; }
.ltable.pc .lrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "veh amt" "who who" "main main" "status status" "act act"; }
.pc-no { font-weight: 600; color: var(--text); text-decoration: none; }
.lc.pc-who { grid-area: who; }
.lc.pc-amt { grid-area: amt; font: 700 1.125rem var(--display); text-align: right; align-items: flex-end; }
.ltable.pc .lc-status { justify-content: flex-start; flex-direction: column; align-items: flex-start; padding-left: 0; gap: 4px; }
.ltable.pc .lc-status .pill { white-space: normal; text-align: left; line-height: 1.25; padding: 4px 10px; }
.ltable.pc .lc-act { align-items: flex-start; }
.pc-grp { padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pc-none { padding: 4px 14px 8px; color: var(--muted); font-size: .875rem; }
.pc-act > form { flex: 1 1 0; }
.pc-refuse { flex: 1 1 0; position: relative; }
.pc-refuse > summary { list-style: none; width: 100%; }
.pc-refuse > summary::-webkit-details-marker { display: none; }
.pc-refuse[open] { flex-basis: 100%; }
.pc-refuse[open] > summary { display: none; }
.pc-refuse form { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.pc-refuse form label { margin: 0; font-size: .8125rem; }
.pc-refuse form .btn { width: 100%; }
@media (min-width: 900px) {
  .pc-bar .chips { flex: 0 1 auto; }
  .pc-bar .pc-branch { margin-left: auto; }
  .ltable.pc .lrow { grid-template-columns: var(--cols); grid-template-areas: none; }
  .ltable.pc .lrow .lc { grid-area: auto; }                                 /* the phone card's named areas off, or cells run into extra rows */
  .ltable.pc .lrows { gap: 0; }
  .ltable.pc .pc-grp { border-radius: 0; border-top: 1px solid var(--line); min-width: var(--minw); }
  .ltable.pc .pc-none { min-width: var(--minw); padding: 10px 16px; }
  .ltable.pc .lc.pc-amt { font-size: 1rem; }
  .ltable.pc .lc-act { justify-content: flex-end; flex-wrap: wrap; }
  .pc-act > form, .pc-refuse { flex: 0 0 auto; }
  .pc-refuse[open] { flex-basis: 100%; }
  .pc-refuse form { text-align: left; }
}

/* the petty cash statement: Date | What | In | Out | Balance */
.pc-stm-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px 12px; align-items: end; margin: 0 0 12px; }
.pc-stm-form label { margin-top: 0; font-size: .8125rem; }
.pc-stm-go .btn { width: 100%; }
.pc-stm-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.pc-stm-sum > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.pc-stm-sum span { font-size: .8125rem; color: var(--muted); }
.pc-stm-sum b { font: 700 1.125rem var(--display); }
.pc-stm-sum .pc-in, .ltable.pcs .pcs-in { color: var(--ok); }
.ltable.pcs { --cols: 110px minmax(260px, 3fr) 110px 110px 120px; --minw: 760px; }
.ltable.pcs .lrow { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "date date date" "main main main" "in out bal"; }
.pcs-date { grid-area: date; font-size: .875rem; color: var(--muted); }
.ltable.pcs .pcs-in { grid-area: in; }
.ltable.pcs .pcs-out { grid-area: out; }
.ltable.pcs .pcs-bal { grid-area: bal; font-weight: 700; }
.ltable.pcs .pcs-in:not(:empty)::before, .ltable.pcs .pcs-out:not(:empty)::before, .ltable.pcs .pcs-bal::before { content: attr(data-label); font-size: .75rem; font-weight: 400; color: var(--muted); }
.ltable.pcs .pcs-bf .pcs-bal::before { content: "Balance"; }
.ltable.pcs .lc-main a.open { color: var(--text); text-decoration: none; }
.lrow.pcs-bf { background: var(--surface-2); }
.pc-stm-note { margin: 12px 2px; }
@media (min-width: 900px) {
  .pc-stm-form { grid-template-columns: 220px 170px 170px 120px; }
  .pc-stm-sum { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ltable.pcs .lrow { grid-template-columns: var(--cols); grid-template-areas: none; }
  .ltable.pcs .lrow .lc { grid-area: auto; }
  .ltable.pcs .lrows { gap: 0; }
  .ltable.pcs .num { text-align: right; align-items: flex-end; }
  .ltable.pcs .pcs-in::before, .ltable.pcs .pcs-out::before, .ltable.pcs .pcs-bal::before { content: none !important; }
  .pcs-date { color: var(--text); }
}

/* Petty cash → My requests */
.pc-mine { list-style: none; margin: 0; padding: 0 16px 12px; display: grid; gap: 10px; }
.pc-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pc-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pc-card-what { color: var(--text); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.pc-card-what .mono { color: var(--muted); font-size: .8125rem; }
.pc-card-amt { font: 700 1.125rem var(--display); white-space: nowrap; }
.pc-card-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; }
.pc-card-desc { margin: 6px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.pc-card-why { margin: 4px 0 0; font-style: italic; }
.pc-receipt, .pc-cancel { margin-top: 8px; }
.pc-receipt .btn { cursor: pointer; }
.pc-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; }
.pc-receipt { position: relative; }
@media (min-width: 900px) { .pc-mine { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }

/* the ask pop-up: big amount box and tap-to-fill categories, made for a phone */
.pc-ask .pc-amount { font: 700 1.5rem var(--display); }
.pc-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pc-cats .chip { min-height: 36px; }
.pc-show-act { align-items: flex-start; }
.pc-show-act .pc-refuse { flex: 0 0 auto; min-width: 200px; }
.pc-show-act .pc-refuse[open] { flex: 1 1 100%; max-width: 420px; }
.pc-show-act .pc-receipt { margin-top: 0; }

/* the pay-out pop-up */
.pc-pay-sum { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin: 0 0 16px; }
.pc-pay-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pc-pay-amt { font: 700 1.5rem var(--display); white-space: nowrap; }
.pc-pay-dl, .pc-dcard-dl { margin: 8px 0 0; display: grid; gap: 4px; }
.pc-pay-dl > div, .pc-dcard-dl > div { display: flex; gap: 12px; font-size: .875rem; }
.pc-pay-dl dt, .pc-dcard-dl dt { flex: 0 0 110px; color: var(--muted); }
.pc-pay-dl dd, .pc-dcard-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.pc-pay-sum p { margin: 8px 0 0; }
@supports selector(:has(*)) {
  .pc-pay .pc-pay-mpesa { display: none; }
  .pc-pay:has(#pm-mpesa:checked) .pc-pay-mpesa { display: block; }
}

/* Home → Waiting for you (the director) */
.pc-dir-lead { margin: -6px 20px 10px; }
.pc-dir-cards { display: grid; gap: 12px; padding: 0 16px 16px; }
.pc-dcard { padding: 14px; border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); border-radius: 12px; background: var(--surface); }
.pc-dcard-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pc-dcard-amt { font: 700 1.5rem var(--display); white-space: nowrap; }
.pc-dcard-what { margin: 4px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.pc-dcard p.small { margin: 8px 0 0; }
.pc-short { color: var(--bad); font-weight: 700; }
.pc-spent { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); }
.pc-dcard-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pc-dcard-act > form { flex: 1 1 0; }
.pc-dcard-act > form .btn { width: 100%; }
@media (min-width: 900px) { .pc-dir-cards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
/* === end P2-4 petty cash === */

/* === P2-4 suppliers === (Money → Suppliers; mockup docs/mockups/p2-4-suppliers-petty-cash/ screens 1–4) */
/* list: supplier · open bills · we owe · next due · last paid · stock with no bill. Phones: cards (supplier, we owe | next due, stock) */
.ltable.sup { --cols: minmax(200px, 2fr) 84px 130px minmax(170px, 1.2fr) 130px minmax(120px, 1fr); --minw: 920px; }
.ltable.sup .lrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "main main" "ref when" "stock stock"; }
.ltable.sup .sup-desk { display: none; }
.ltable.sup .sup-stock { grid-area: stock; flex-direction: row; }
.ltable.sup .sup-stock:has(.sup-desk-only) { display: none; }
.ltable.sup .lc-when { align-items: flex-end; text-align: right; }
.ltable.sup .lc-when .pill, .ltable.sup .lc-ref .pill { margin-top: 4px; white-space: normal; line-height: 1.25; }
.lrow.sup-off .lc-main b { color: var(--muted); }
.sup-tiles .inv-v { overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .ltable.sup .lrow { grid-template-columns: var(--cols); grid-template-areas: none; }
  .ltable.sup .sup-desk { display: flex; }
  .ltable.sup .sup-stock, .ltable.sup .sup-stock:has(.sup-desk-only) { display: flex; grid-area: auto; }
  .ltable.sup .num { align-items: flex-end; text-align: right; }
  .ltable.sup .lc-when { align-items: flex-start; text-align: left; }
}
/* one supplier */
.sup-top { margin-bottom: 16px; }
.sup-top > .box { margin: 0; }
.sup-kv { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.sup-owed { margin: 0; font: 700 1.75rem/1.2 var(--display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sup-age { padding: 0 16px 16px; }
@media (min-width: 640px) { .sup-age { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 20px 18px; } .sup-age > div:last-child:nth-child(odd) { grid-column: auto; } }
.sup-tabs { margin: 0 0 12px; }
.sup-empty { padding-top: 16px; }
.sup-explain { margin: 0; }
.sup-table tfoot td { background: var(--surface-2); }
@media (max-width: 639px) { .sup-table .sup-hide-phone { display: none; } .sup-table td, .sup-table th { padding-left: 10px; padding-right: 10px; } }
.sup-list .cl-amt .small { display: block; color: var(--muted); font-weight: 400; }
.sup-list > li.sup-deleted .cl-no, .sup-list > li.sup-deleted .cl-amt b { text-decoration: line-through; color: var(--muted); }
.sup-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sup-acts form { margin: 0; }
@media (max-width: 899px) { .sup-receipts > li { grid-template-areas: "no what pill" "no amt amt"; } .sup-acts .btn.sm { min-height: 44px; } }
@media (min-width: 900px) { .sup-receipts > li { grid-template-columns: 70px minmax(0, 1fr) minmax(220px, auto) 130px; } .sup-acts { justify-content: flex-end; } }
.sup-stmt .stm-dates { margin-top: 8px; }
.sup-attach { border-top: 1px solid var(--line-soft); }
/* new bill: lines (item full width, then how many | price | stock, amount; one row on computers), VAT, deliveries */
.sup-lines { border-top: 1px solid var(--line-soft); margin-top: 8px; }
.sup-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; grid-template-areas: "item item del" "qty price price" "kind amt amt"; gap: 0 12px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.sup-line label { margin-top: 6px; font-size: .8125rem; }
.sup-l-item { grid-area: item; } .sup-l-qty { grid-area: qty; } .sup-l-price { grid-area: price; } .sup-l-kind { grid-area: kind; } .sup-l-del { grid-area: del; color: var(--muted); }
.sup-l-amt { grid-area: amt; display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; min-height: 44px; padding-bottom: 10px; }
.sup-l-amt b { font-variant-numeric: tabular-nums; }
@media (min-width: 700px) {
  .sup-line { grid-template-columns: minmax(0, 1fr) 80px 110px 120px 96px 44px; grid-template-areas: "item qty price kind amt del"; }
}
.sup-vat { margin: 16px 0 0; padding: 0; border: 0; }
.sup-vat legend { font-weight: 600; margin-bottom: 6px; }
.sup-seg { display: flex; flex-wrap: wrap; }
.sup-seg span { white-space: normal; text-align: center; padding: 6px 12px; }
.sup-sum { padding: 8px 0 0; }
.sup-ticks { margin: 16px 0 0; padding: 0; border: 0; }
.sup-ticks legend { font-weight: 600; }
.sup-tick { padding: 10px 4px 4px; border-top: 1px solid var(--line-soft); }
.sup-tick[hidden] { display: none; }
/* pay: the bills with their ticks and amounts */
.sup-alloc { border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; }
.sup-arow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-top: 1px solid var(--line-soft); }
.sup-arow:first-child { border-top: 0; }
.sup-atick { flex: 1 1 220px; display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 400; min-height: 44px; cursor: pointer; }
.sup-atick input { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
.sup-ain { flex: 0 1 140px; min-width: 0; text-align: right; }
.sup-after { margin: 8px 0 0; font-weight: 600; }
.sup-rate b { color: var(--text); }
/* === end P2-4 suppliers === */
