/* Inter, kept with GAKA (GAKA 1.122.1): from Google it held the whole page back when Google could not be reached */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Brand: Qstructs Systems logo — navy → bright blue (Q ring, QSTRUCTS), maroon (SYSTEMS), copper (Q tail) */
:root {
  --navy: #1b2a5e;
  --blue: #2a6fdb;
  --maroon: #8a1c27;
  --copper: #d4844f;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --border: #dce3ef;
  --text: #18213f;
  --muted: #5f6b87;
  --accent: #1f3f8f;          /* buttons, active nav, chart columns */
  --accent-ink: #ffffff;
  --accent-soft: #e5ecfa;
  --link: #2361c6;
  --second: #8a1c27;          /* maroon: brand second colour, headings on paper, highlights */
  --second-soft: #f7e7e8;
  --out-bubble: #e3ebfa;
  --danger: #d1242f;
  --ok: #1f7a4d;
  --brand-gradient: linear-gradient(135deg, #2a7fe8 0%, #1b2a5e 70%);
  --radius: 12px;
  --nav-h: 62px;
  --topbar-h: 68px;            /* measured by shell.js once the page is drawn */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1324;
    --surface: #161d33;
    --surface-2: #1e2742;
    --border: #2b3656;
    --text: #e8ecf7;
    --muted: #9ba6c2;
    --accent: #5d93f2;
    --accent-ink: #0b1020;
    --accent-soft: #1d2d55;
    --link: #7eaaf6;
    --second: #e2737c;
    --second-soft: #3a1a20;
    --out-bubble: #1f3060;
    --danger: #ff6b6b;
    --ok: #4cc58a;
    --brand-gradient: linear-gradient(135deg, #2a7fe8 0%, #22337a 80%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
h2 { font-size: 1rem; margin: 0 0 .75rem; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; word-break: break-all; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.neg { color: var(--danger); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dim { opacity: .55; }
.stack { display: grid; gap: .6rem; }
.boot, .empty { color: var(--muted); padding: 2rem 1rem; text-align: center; }

/* ---------- controls ---------- */
input, select, textarea, .qsearch {
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .7rem;
  width: 100%;
  min-width: 0;
}
/* A load's note beside its money (GAKA 1.127.0, public/js/load-notes.js): two lines at most, the rest on a tap */
.ln { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .25rem .5rem; max-width: 100%; margin-top: .2rem; font-size: .82rem; line-height: 1.35; white-space: normal; }
.ln-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; max-width: 34rem; padding: .1rem .5rem; border-left: 2px solid var(--copper); border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, var(--copper) 9%, transparent); cursor: pointer; overflow-wrap: anywhere; }
.ln-text.open { -webkit-line-clamp: unset; }
.ln-driver { border-left-color: var(--link); background: color-mix(in srgb, var(--link) 9%, transparent); }
.ln-pen { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .3rem; border: 0; background: none; color: var(--muted); font: inherit; font-size: .78rem; cursor: pointer; border-radius: 6px; }
.ln-pen:hover { color: var(--text); background: var(--surface-2); }
td .ln { position: relative; flex-wrap: nowrap; flex-direction: column; gap: .15rem; }
td .ln:not(.ln-empty):has(.ln-pen) { padding-right: 1.6rem; }
td .ln:not(.ln-empty) .ln-pen { position: absolute; right: 0; top: 0; }
td .ln-text { max-width: 14rem; -webkit-line-clamp: 1; }
td.remit-note .ln-text { -webkit-line-clamp: 2; }
/* An empty pencil shows on the row under the mouse only; on touch screens it is faint */
.ln-empty .ln-pen { opacity: 0; }
:is(tr, article):hover .ln-empty .ln-pen, .ln-empty .ln-pen:focus-visible { opacity: 1; }
@media (hover: none) { .ln-empty .ln-pen { opacity: .55; } }
/* The × that empties a search box (GAKA 1.126.0, public/js/search-box.js); boxes with their own keep theirs */
input[type=search]:not(:placeholder-shown), .qsearch:not(:empty) { padding-right: 2.3rem; background-repeat: no-repeat; background-position: right .7rem center; background-size: .85rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 3l10 10M13 3L3 13' stroke='%23889' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
input[type=search]::-webkit-search-cancel-button { display: none; }
:is(.search-bar, .chat-search, .pickbox) :is(input[type=search], .qsearch) { background-image: none; }
input:focus, select:focus, textarea:focus, .qsearch:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }

.btn {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: .55rem 1rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost-danger { color: var(--danger); }
.btn.sm { padding: .3rem .65rem; font-size: .85rem; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: none; color: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: .2rem .5rem; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button {
  font: inherit; border: 0; background: none; color: var(--muted); padding: .55rem .8rem; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.chips { display: flex; gap: .4rem; overflow-x: auto; padding: .25rem 0 .75rem; }
.chip { font: inherit; font-size: .85rem; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .3rem .8rem; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.badge.s-closed { background: #fff1c2; color: #7a5600; }
.badge.s-assigned { background: #dfe9ff; color: #2846a0; }
.badge.s-in_transit { background: #e6dcff; color: #5530a8; }
.badge.s-delivered { background: #d8f3e4; color: #17633e; }
.badge.s-paid { background: #17633e; color: #fff; }
.badge.s-cancelled { background: #fde2df; color: #9b2218; text-decoration: line-through; }
@media (prefers-color-scheme: dark) {
  .badge.s-closed { background: #4a3a0c; color: #ffd866; }
  .badge.s-assigned { background: #1c2b52; color: #9db6ff; }
  .badge.s-in_transit { background: #2f2153; color: #c3adff; }
  .badge.s-delivered { background: #143d29; color: #7fe0ae; }
  .badge.s-paid { background: #2c9a63; color: #08130d; }
  .badge.s-cancelled { background: #4a1a15; color: #ff9d92; }
}
.badge.s-issued { background: #dfe9ff; color: #2846a0; }
.badge.s-accepted { background: #d8f3e4; color: #17633e; }
.badge.s-declined, .badge.s-void { background: #fde2df; color: #9b2218; }
/* Needed on (GAKA 1.146.0): quick days and whether the day is a confirmed job or a promise (public/js/ui.js neededChips) */
.needed-pick { display: grid; gap: .35rem; grid-column: 1 / -1; margin: -.2rem 0 .3rem; }
.needed-chips .chip { font-weight: 600; }
.needed-note { display: block; padding: .45rem .7rem; border-radius: 10px; font-size: .84rem; line-height: 1.4; }
.needed-note:empty { display: none; }
.needed-note.confirmed { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.needed-note.promise { background: color-mix(in srgb, var(--copper, #d08a3c) 16%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--copper, #d08a3c) 50%, transparent); }
/* Driver cash risk (GAKA 1.151.0): the mark beside a driver, Drivers to watch, and the note when dispatching */
.risk-badge { margin-left: .35rem; font-weight: 700; white-space: nowrap; }
.risk-badge.high { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.risk-badge.watch { background: color-mix(in srgb, var(--copper, #d08a3c) 20%, transparent); color: var(--copper, #d08a3c); }
.risk-card { border-left: 4px solid var(--danger); margin-bottom: .8rem; }
.risk-card .task-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.risk-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.risk-list li .risk-badge { margin: 0 .4rem 0 0; }
.risk-note { grid-column: 1 / -1; padding: .55rem .75rem; border-radius: 10px; font-size: .86rem; line-height: 1.45; }
.risk-note.high { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); }
.risk-note.watch { background: color-mix(in srgb, var(--copper, #d08a3c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--copper, #d08a3c) 45%, transparent); }
/* A promise (GAKA 1.146.0): a job more than 3 days ahead, not confirmed yet; and the Needed on line on a document */
.promise-badge { background: color-mix(in srgb, var(--copper, #d08a3c) 20%, transparent); color: var(--copper, #d08a3c); border: 1px solid color-mix(in srgb, var(--copper, #d08a3c) 45%, transparent); font-weight: 700; }
.doc-needed { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .2rem 0 .5rem; }
/* A load that looks recorded twice (GAKA 1.145.0): on Money flow cards, Driver cash rows and the load page; pressing it asks to remove it */
.dup-badge { border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); font: inherit; font-size: .76rem; font-weight: 700; cursor: pointer; }
button.dup-badge:hover { background: color-mix(in srgb, var(--danger) 24%, transparent); }
.dup-badge.asked { cursor: default; border-color: var(--border); background: var(--surface-2); color: var(--muted); }
.money-dup { margin: -.2rem 0 .1rem; }
.dup-mark:empty { display: none; }
/* A draft invoice given to the customer (GAKA 1.141.0): with them, not yet a sale */
.badge.s-given { background: #fff1d6; color: #8a5300; }
@media (prefers-color-scheme: dark) {
  .badge.s-given { background: #43300f; color: #ffcf7a; }
  .badge.s-issued { background: #1c2b52; color: #9db6ff; }
  .badge.s-accepted { background: #143d29; color: #7fe0ae; }
  .badge.s-declined, .badge.s-void { background: #4a1a15; color: #ff9d92; }
}
.pill { font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; }
.pill.on { background: #d8f3e4; color: #17633e; }
.pill.off { background: var(--surface-2); color: var(--muted); }

.avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
  background: var(--accent-soft); color: var(--accent);
}
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }

/* ---------- toast & modal ---------- */
/* Toasts stack at the bottom centre: success with a green tick, errors in red */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 100;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: .45rem; justify-items: center; width: min(92vw, 480px); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: .55rem; pointer-events: auto;
  background: var(--text); color: var(--bg); padding: .65rem 1rem; border-radius: 10px;
  max-width: 100%; box-shadow: 0 6px 24px rgb(0 0 0 / .2); animation: pop .15s ease-out;
}
/* A weak connection (public/js/core.js): a thin moving line while something asked for is on its way, and a small note */
.net-line { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 3px; z-index: 130; overflow: hidden; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 18%, transparent); }
.net-line::after { content: ''; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--accent); border-radius: 3px; animation: net-run 1.1s ease-in-out infinite; }
@keyframes net-run { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .net-line::after { animation: none; left: 0; width: 100%; opacity: .6; } }
.net-pill { position: fixed; z-index: 125; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + .55rem); display: flex; align-items: center; gap: .55rem;
  max-width: calc(100vw - 1.5rem); padding: .3rem .4rem .3rem .8rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: 0 4px 14px rgb(0 0 0 / .18); }
.net-pill:not(:has(button)) { padding-right: .8rem; }
.net-pill.offline { border-color: color-mix(in srgb, #d97706 55%, var(--border)); }
.net-pill button { font: inherit; font-size: .76rem; padding: .15rem .6rem; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink, #fff); cursor: pointer; }
.toast-ic { flex: none; width: 1.15rem; height: 1.15rem; margin-top: .05rem; }
.toast-ic svg { width: 100%; height: 100%; display: block; }
.toast.ok .toast-ic { color: #3ccb7f; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* A field with a problem: red outline and a short message under it */
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.field .field-error, .check .field-error { color: var(--danger); font-size: .8rem; font-weight: 600; }
.check .field-error { width: 100%; }
.check.invalid { flex-wrap: wrap; }
/* Required fields are marked with a red star after the label */
.field.required > span::after { content: ' *'; color: var(--danger); font-weight: 700; }
/* The sign-in screens are short and every box is needed, so they carry no stars */
.login-card .field.required > span::after { content: none; }

.modal-wrap { position: fixed; inset: 0; background: rgb(20 12 8 / .45); display: grid; place-items: center; padding: 1rem; z-index: 50;
  grid-template-columns: minmax(0, 1fr); }   /* the window is never wider than the screen, whatever is inside it */
.modal { background: var(--surface); border-radius: 14px; width: min(100%, 460px); max-height: 92dvh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
.modal.wide { width: min(100%, 720px); }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem .4rem 1.2rem; }
.modal header h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: .4rem 1.2rem 1.2rem; overflow-y: auto; overscroll-behavior: contain; }
/* While any window is open the page behind it stays still: scrolling over the dimmed area, or past the end of the
   window's own list, no longer moves the page underneath. The gutter keeps the page from jumping sideways. */
html:has(.modal-wrap) { overflow: hidden; scrollbar-gutter: stable; }
.modal-wrap { overscroll-behavior: contain; }
@media (max-width: 600px) {
  .modal-wrap { place-items: end stretch; padding: 0; }
  .modal { width: 100%; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

.form { display: flex; flex-wrap: wrap; gap: .8rem; }
.form > p { margin: 0; width: 100%; }
/* align-content: start keeps a field's label and box at the top: when its neighbour in the row is taller (a long hint),
   the box would otherwise stretch down, out of line with the one beside it */
.field { display: grid; gap: .25rem; width: 100%; align-content: start; }
.field.half { width: calc(50% - .4rem); }
.field > span { font-size: .85rem; font-weight: 600; }
.field small { color: var(--muted); font-size: .8rem; }
.check { display: flex; gap: .55rem; align-items: center; width: 100%; cursor: pointer; flex-wrap: wrap; }
/* A tick box's hint and message sit under its label, lined up with the text */
.check > small { flex-basis: 100%; margin: -.2rem 0 0 1.65rem; }
/* Anything marked hidden stays hidden, whatever display its classes give it (fields switched off by another choice) */
[hidden] { display: none !important; }
.check input { width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--accent); }
.form-actions { width: 100%; display: flex; justify-content: flex-end; padding-top: .3rem; }
@media (max-width: 420px) { .field.half { width: 100%; } .form-actions .btn { width: 100%; } }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(100%, 360px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.8rem; display: grid; gap: 1rem; }
.login-brand { display: flex; align-items: center; gap: .7rem; justify-content: center; }
.login-brand img { width: 44px; height: 44px; }
.login-brand h1 { font-size: 1.6rem; letter-spacing: .08em; color: var(--accent); }
.login { background: var(--brand-gradient); }
.login-card { box-shadow: 0 20px 60px rgb(0 0 0 / .25); border-top: 4px solid var(--second); }
.login-card .btn.primary { background: var(--second); border-color: var(--second); }
.login-card .btn.primary:hover { background: var(--maroon); filter: brightness(1.15); }
.error-text { color: var(--danger); margin: 0; min-height: 1.2em; font-size: .9rem; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; }
.nav {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
}
.nav .brand { display: none; }
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font: inherit; font-size: .72rem; border: 0; background: none; cursor: pointer; min-width: 0;
}
.nav a:hover { text-decoration: none; }
.nav a.active { color: var(--accent); font-weight: 600; }
/* Phones: in Chats the bottom bar's Chats button is WhatsApp green, like the rest of the chat screen */
@media (max-width: 899px) {
  .nav a.active[href="#/chats"] { color: #008069; }
  @media (prefers-color-scheme: dark) { .nav a.active[href="#/chats"] { color: #00a884; } }
}
.nav-icon { font-size: 1.3rem; line-height: 1; }
.nav-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 899px) { .nav a { font-size: .64rem; } }
.main { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 900px) {
  .nav {
    top: 0; right: auto; width: 210px; height: 100dvh; padding: 1rem .7rem;
    flex-direction: column; gap: .2rem; border-top: 0; border-right: 1px solid var(--border);
  }
  .nav .brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: .08em; padding: .2rem .6rem 1.2rem; font-size: 1.1rem; color: #fff; }
  .nav .brand img { width: 30px; height: 30px; }
  /* Desktop sidebar in the logo's navy, links in white */
  .nav { background: linear-gradient(180deg, #1b2a5e 0%, #142049 100%); border-right: 0; }
  .nav a { color: rgb(255 255 255 / .74); }
  .nav a.active, .nav a:not(.active):hover { color: #fff; }
  .nav a.active { background: rgb(255 255 255 / .12) !important; box-shadow: inset 3px 0 0 var(--copper); }
  .nav a:not(.active):hover { background: rgb(255 255 255 / .07) !important; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: .7rem; font-size: .95rem; padding: .6rem .7rem; border-radius: 8px; }
  .nav a.active { background: var(--accent-soft); }
  .nav a:not(.active):hover { background: var(--surface-2); }
  .nav-icon { font-size: 1.1rem; width: 1.4rem; text-align: center; }
  .main { margin-left: 210px; padding-bottom: 0; }
  .toasts { bottom: 24px; }
}

/* ---------- pages ---------- */
.page { padding: 1rem; max-width: 1100px; margin: 0 auto; }
.page.narrow { max-width: 760px; }
.page.wide { max-width: none; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin: .3rem 0 1rem; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.toolbar input[type=search], .toolbar .qsearch { max-width: 420px; }
.inline { display: flex; align-items: center; gap: .4rem; font-size: .9rem; }
.inline input { width: auto; }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.back-link { display: inline-block; margin-bottom: .4rem; font-weight: 600; }
.section-title { margin: 1.5rem 0 .6rem; color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: .9rem; display: block; color: inherit; }
a.card:hover { text-decoration: none; border-color: var(--accent); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem 1.2rem; }
.info > span { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.info > div { overflow-wrap: anywhere; white-space: pre-line; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 0 0 .9rem 1.1rem; border-left: 2px solid var(--border); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline li:last-child { border-left-color: transparent; }

/* order list: cards on phones, table-like rows on desktop */
.order-list { display: grid; gap: .5rem; }
.order-row {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "id cust total" "qty qty status" "date date who";
  gap: .2rem .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .7rem .85rem; color: inherit;
}
.order-row:hover { text-decoration: none; border-color: var(--accent); }
.o-id { grid-area: id; font-weight: 700; color: var(--muted); }
.o-cust { grid-area: cust; display: grid; }
.o-total { grid-area: total; font-weight: 700; text-align: right; }
.o-qty { grid-area: qty; }
.o-status { grid-area: status; text-align: right; }
.o-date { grid-area: date; font-size: .85rem; }
.o-who { grid-area: who; font-size: .85rem; text-align: right; }
@media (min-width: 1000px) {
  .order-list { gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
  .order-row { grid-template-columns: 4rem minmax(0, 2.2fr) 1.2fr 7rem 9rem 7rem minmax(0, 1fr); grid-template-areas: "id cust qty total status date who"; align-items: center; border: 0; border-radius: 0; border-bottom: 1px solid var(--border); }
  .order-row:last-child { border-bottom: 0; }
  .order-row:hover { background: var(--surface-2); }
  .o-status, .o-who { text-align: left; }
}

.task-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; flex-wrap: wrap; }
.task-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.task-actions:empty { display: none; }
/* driver cards */
.delivery { display: grid; gap: .45rem; }
.delivery.active { border: 2px solid var(--accent); }
.delivery .big { font-size: 1.15rem; font-weight: 700; }
.delivery .task-actions .btn { flex: 1; padding: .8rem; }
.note { background: var(--surface-2); padding: .5rem .7rem; border-radius: 8px; white-space: pre-line; }

/* reports */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem; margin-bottom: .9rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; display: grid; gap: .2rem; }
.stat span { font-size: .8rem; }
.stat strong { font-size: 1.3rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.page > .tabs { margin-bottom: 1rem; }

/* ---------- navigation overflow (phones) ---------- */
.nav-more { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font: inherit; font-size: .64rem; border: 0; background: none; cursor: pointer; }
.nav-more.active { color: var(--accent); font-weight: 600; }
@media (max-width: 899px) {
  .nav .nav-extra { display: none; }
  .nav a { position: relative; }
  .nav a .nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }
  /* The bottom bar in the favourites' own order, More last */
  .nav a.fav { order: var(--fav-order, 50); }
  .nav-more { order: 99; }
}
@media (min-width: 900px) { .nav-more { display: none; } }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.more-item { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .9rem .5rem; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface); font: inherit; cursor: pointer; }
.more-item:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- period navigator ---------- */
.period { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.period select, .period input { width: auto; }
.period .year-input { width: 6.5rem; }
.icon-btn.sm-icon { font-size: 1.3rem; padding: .1rem .45rem; }
.period-label { font-size: .85rem; }
.toolbar > select { width: auto; max-width: 100%; }

/* ---------- figures ---------- */
.stats.compact { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.stats.compact .stat { padding: .55rem .8rem; }
.stats.compact .stat strong { font-size: 1.1rem; }
.stat small { font-size: .78rem; }
.stat.hero { grid-column: span 2; }
.stat.hero strong { font-size: 2.2rem; line-height: 1.1; }
.stat.hero { background: var(--brand-gradient); border: 0; color: #fff; }
.stat.hero .muted { color: rgb(255 255 255 / .8); }
@media (max-width: 420px) { .stat.hero { grid-column: span 1; } }
a.stat.link { color: inherit; }
a.stat.link:hover { border-color: var(--accent); text-decoration: none; }
.refreshing { opacity: .55; transition: opacity .15s; }

.today { display: grid; gap: .6rem; }
.today-figs { display: flex; flex-wrap: wrap; gap: .6rem 2rem; }
.today-figs > div { display: grid; }
.today-figs span { font-size: .8rem; }
.today-msg { margin: 0; padding: .6rem .8rem; border-radius: 8px; background: var(--second-soft); border-left: 4px solid var(--second); }

.top-card { display: grid; gap: .15rem; border-left: 4px solid var(--copper); }
.top-card strong { font-size: 1.4rem; }

.meter-wrap { display: flex; align-items: center; gap: .5rem; min-width: 140px; }
.meter { flex: 1; height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.meter.full i { background: var(--ok); }
.meter-wrap span { font-size: .85rem; font-variant-numeric: tabular-nums; min-width: 3ch; }
td.stars { color: var(--copper); letter-spacing: .05em; white-space: nowrap; }
.page-head h1 { color: var(--accent); }
tr.me td { background: var(--accent-soft); }

/* ---------- spreadsheet-style tables ---------- */
table.sheet th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
table.sheet td, table.sheet th { padding: .45rem .55rem; font-size: .88rem; vertical-align: middle; }
table.sheet td { white-space: normal; }
table.sheet th { padding-inline: .4rem; letter-spacing: .02em; }
table.sheet tfoot td, table tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; }
tr.click { cursor: pointer; }
/* A heading between groups of rows, such as the days on Loads */
tr.group-row td, tr.group-row:hover td { background: var(--surface-2); color: var(--accent); font-weight: 700; font-size: .85rem; padding-block: .5rem; border-top: 2px solid var(--border); }
tr.click:hover td { background: var(--surface-2); }
.page.wide .table-wrap { max-height: 70vh; overflow: auto; }
small.block { display: block; }
.nowrap { white-space: nowrap; }
tr.row-in td { background: color-mix(in srgb, var(--ok) 8%, transparent); }
.table-toggle { margin-top: .75rem; }
.table-toggle summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }
.file-grid { display: grid; gap: .9rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1100px) { .file-grid { grid-template-columns: minmax(0, 1fr); } }  /* minmax(0, …): a wide table scrolls inside its card instead of widening the page (GAKA 1.154.2) */

.load-preview { width: 100%; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding: .6rem .8rem; border-radius: 8px; background: var(--surface-2); font-size: .9rem; }

/* ---------- daily column chart ---------- */
.cchart { position: relative; display: grid; grid-template-columns: auto 1fr; gap: .5rem; height: 220px; padding-bottom: 1.4rem; }
.caxis { display: flex; flex-direction: column; justify-content: space-between; font-size: .72rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.cplot { position: relative; }
.cgrid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.cgrid i { display: block; border-top: 1px solid var(--border); }
.ccols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.cslot { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.cbar { position: relative; width: 100%; max-width: 24px; min-height: 0; background: var(--accent); border-radius: 4px 4px 0 0; transition: filter .1s; }
.cslot:hover .cbar, .cslot:focus-visible .cbar { filter: brightness(1.15); }
.cslot:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); border-radius: 4px; }
.cx { position: absolute; top: 100%; margin-top: .3rem; font-size: .68rem; color: var(--muted); white-space: nowrap; }
.cpeak { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 2px; font-size: .72rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); display: grid; padding: .35rem .6rem; border-radius: 8px; background: var(--text); color: var(--bg); font-size: .8rem; pointer-events: none; white-space: nowrap; z-index: 3; }
.chart-tip strong { font-size: .9rem; }

/* ---------- grouped menu & module search ---------- */
.nav-group, .nav-search { display: none; }

/* The search button: a pill with a magnifier, a label and key caps for the shortcut */
.svg-icon { display: inline-flex; flex: none; }
.svg-icon svg { display: block; }
.search-trigger {
  display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 2.6rem; padding: .45rem .55rem .45rem .85rem;
  font: inherit; font-size: .9rem; text-align: left; cursor: pointer; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / .04); transition: border-color .15s, box-shadow .15s, background .15s, color .15s;
}
.search-trigger .svg-icon { color: var(--accent); }
.search-trigger .st-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-trigger:hover { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-trigger:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.st-keys { display: flex; gap: .2rem; flex: none; }
.st-keys kbd {
  display: inline-grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 .35rem;
  font: 600 .68rem/1 system-ui, sans-serif; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px;
}
@media (pointer: coarse) { .st-keys { display: none; } }   /* no keyboard shortcut on phones */
.actions .search-pill { width: auto; min-width: 15rem; }

/* In the navy sidebar: frosted glass with the copper accent */
.nav .search-trigger {
  border-color: rgb(255 255 255 / .16); background: rgb(255 255 255 / .07); color: rgb(255 255 255 / .72);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .06); backdrop-filter: blur(6px);
}
.nav .search-trigger .svg-icon { color: var(--copper); }
.nav .search-trigger:hover, .nav .search-trigger:focus-visible { background: rgb(255 255 255 / .13); border-color: rgb(255 255 255 / .35); color: #fff; box-shadow: 0 0 0 3px rgb(212 132 79 / .25); }
.nav .st-keys kbd { color: rgb(255 255 255 / .75); background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .22); }

/* The input inside the search window */
.search-field { position: relative; display: block; }
.search-field .svg-icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--accent); pointer-events: none; }
.search-field input, .search-field .qsearch { padding: .75rem .9rem .75rem 2.6rem; border-radius: 999px; font-size: 1rem; }
/* A proper search bar (GAKA 1.70.4, "Find a module"): 52px high, rounded, a soft fill, the magnifier inside, a clear
   button, and a glow when typing. Phones get a real search input (no browser look) at 16px, so iPhones do not zoom. */
.search-bar input, .search-bar .qsearch { min-height: 3.25rem; padding: .85rem 3rem .85rem 3rem; border-radius: 14px; font-size: 1.02rem;
  background: var(--surface-2); border: 1px solid var(--border-strong, var(--border)); -webkit-appearance: none; appearance: none; line-height: 1.4; }
.search-bar input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-bar input::placeholder { color: var(--muted); }
.search-bar input:focus, .search-bar .qsearch:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.search-bar .svg-icon { left: 1rem; }
.search-bar .svg-icon svg { width: 20px; height: 20px; }
.search-clear { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); width: 2.1rem; height: 2.1rem; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.search-clear:hover { color: var(--text); background: var(--border); }
.search-clear[hidden] { display: none; }
/* Someone else is writing a reply in this chat (GAKA 1.71.0): a quiet strip above the reply box */
.typing-strip { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; padding: .45rem .9rem; margin: 0 .75rem .35rem; border-radius: 12px;
  background: var(--accent-soft); color: var(--text); font-size: .88rem; }
.typing-strip[hidden] { display: none; }
.typing-claude { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .82rem; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: typing-dot 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing-dots i { animation: none; opacity: .7; } }

/* Phones: sections are invisible wrappers so favourite links still sit in the bottom bar */
.nav-sect { display: contents; }
.nav-fold { display: none; }
.nav-badge { min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: var(--copper); color: #fff;
  font-size: .7rem; font-weight: 700; display: inline-grid; place-items: center; margin-left: auto; }

@media (min-width: 900px) {
  .nav { overflow-y: auto; scrollbar-width: thin; }
  /* Collapsible group headers: click to fold a group away, click again to bring it back */
  .nav-group {
    display: flex; align-items: center; gap: .4rem; width: 100%; margin: .55rem 0 .1rem; padding: .35rem .7rem;
    font: inherit; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: rgb(255 255 255 / .55); background: none; border: 0; border-radius: 6px; cursor: pointer; text-align: left;
  }
  .nav-group:hover, .nav-group:focus-visible { color: #fff; background: rgb(255 255 255 / .06); outline: none; }
  .nav-group span:first-child { flex: 1; }
  .nav-group .nav-count { font-size: .68rem; font-weight: 600; letter-spacing: 0; opacity: 0; transition: opacity .15s; }
  .nav-group[aria-expanded="false"] .nav-count { opacity: .8; }
  .nav-group .chev { transition: transform .18s; font-size: .8rem; }
  .nav-group[aria-expanded="false"] .chev { transform: rotate(-90deg); }
  .nav-sect { display: flex; flex-direction: column; gap: .15rem; }
  .nav-sect.closed { display: none; }
  .nav-fold {
    display: inline-block; margin-left: auto; padding: .15rem .5rem; font: inherit; font-size: .68rem; font-weight: 600; letter-spacing: .02em;
    color: rgb(255 255 255 / .7); background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .15); border-radius: 999px; cursor: pointer;
  }
  .nav-fold:hover { color: #fff; background: rgb(255 255 255 / .15); }
  .nav-fold { white-space: nowrap; }
  .nav-search { display: flex; width: auto; margin: 0 .2rem .6rem; }
  .nav a { padding-block: .45rem; }
}
.more-group { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: .3rem; }
.search-results { display: grid; gap: .25rem; max-height: 55dvh; overflow-y: auto; }
.search-item { display: grid; grid-template-columns: 1.6rem 1fr auto; align-items: center; gap: .5rem; text-align: left; font: inherit; padding: .55rem .7rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.search-item:hover, .search-item.picked { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- finance & accounts ---------- */
.fin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem 2rem; }
.fin-grid h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .3rem 0 .4rem; }
.fin-row { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.inline-form input { width: 10rem; }
.budget-settings { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-bottom: .8rem; }
.budget-input { width: 7.5rem; padding: .3rem .45rem; text-align: right; }
.edit-table td { padding: .25rem; border: 0; }
.edit-table input, .edit-table select { width: 100%; min-width: 6rem; }
.narrow-table { max-width: 720px; }
.payslip { margin-top: 1rem; }
.customer-card { border-left: 4px solid var(--accent); }
.handover { border-left: 4px solid var(--copper); }
.handover-toast { background: var(--accent); color: var(--accent-ink); }
.handover-toast a { color: inherit; text-decoration: underline; font-weight: 700; }
.late-row td { background: #fff4e5; }
.check-banner { padding: .5rem .8rem; border-radius: 8px; margin-bottom: .8rem; font-weight: 600; font-size: .9rem; }
.check-banner.ok { background: #d8f3e4; color: #17633e; }
.check-banner.warn { background: #fff4e5; color: #8a4b00; }
@media (prefers-color-scheme: dark) {
  .check-banner.ok { background: #143d29; color: #7fe0ae; }
  .check-banner.warn { background: #3d2a0c; color: #ffc46b; }
  .late-row td { background: #2e2410; }
}
.inline-check { width: auto; }
tr.subtotal td { font-weight: 700; background: var(--surface-2); }
/* Floating "save changes" bar under a sheet being edited (driver cash, budget, catalogue prices) */
.save-bar {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; justify-content: flex-end;
  padding: .7rem 1rem; margin-top: .8rem; border-radius: 12px; background: var(--surface); border: 2px solid var(--accent);
  box-shadow: 0 8px 30px rgb(0 0 0 / .15);
}
.save-bar > span { margin-right: auto; }
@media (min-width: 900px) { .save-bar { bottom: 12px; } }
/* ---------- printing forms (dispatch file, cash remittance) ---------- */
.print-only, .print-head, .print-title, .print-only-inline, .print-only-block { display: none; }
@media print {
  .print-only { display: table-cell; }
  .print-only-inline { display: inline; }
  .print-only-block { display: block; }
  .print-head.form-head { display: flex; }
  .remit-table td, .remit-table th { font-size: 9pt; padding: 4px 5px; border: 1px solid #999; }
  tr.given-row td, .late-row td { background: none; }
  .page:has(.remit-table) { page: remit; }
  .print-head, .print-title { display: block; }
  .print-head h2 { margin: 0 0 .3rem; }
  td.sign { min-width: 6rem; }
  .page.wide .table-wrap { max-height: none; overflow: visible; }
  .stats { display: flex; flex-wrap: wrap; gap: .5rem; }
  .card { border: 0; padding: 0; break-inside: auto; }
  table.sheet th { position: static; }
  a { color: inherit; }
}

/* ---------- documents ---------- */
.pick-list { display: grid; gap: .3rem; max-height: 50dvh; overflow-y: auto; }
.pick { font: inherit; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .8rem; cursor: pointer; }
.pick:hover { border-color: var(--accent); }

.ed-wrap { width: 100%; }
.ed-items th, .ed-items td { padding: .25rem; border: 0; }
.ed-items td:first-child { min-width: 200px; width: 100%; }
.ed-qty input { width: 90px; }
.ed-price input { width: 110px; }
.ed-amount { white-space: nowrap; }
.ed-totals { width: 100%; text-align: right; font-size: .95rem; }

/* The document always looks like white paper, in light or dark mode */
.paper {
  --ink: #1d1714; --soft: #6b5e55; --rule: #ddd3cb;
  background: #fff; color: var(--ink); border-radius: 6px; padding: 2.2rem 2rem; margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / .08), 0 8px 30px rgb(0 0 0 / .06); position: relative; font-size: .92rem;
}
.paper.void::after, .paper.draft::after {
  content: "VOID"; position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-20deg);
  font-size: 6rem; font-weight: 900; color: rgb(180 35 24 / .14); pointer-events: none; letter-spacing: .1em;
}
.paper.draft::after { content: "DRAFT"; color: rgb(0 0 0 / .07); }
.p-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; border-bottom: 3px solid #1b2a5e; padding-bottom: 1rem; margin-bottom: 1.2rem; }
.p-company { font-size: 1.35rem; font-weight: 800; color: #1b2a5e; }
.p-doc { color: #8a1c27; }
.p-small { color: var(--soft); font-size: .82rem; }
.p-title { text-align: right; }
.p-doc { font-size: 1.3rem; font-weight: 800; letter-spacing: .06em; }
.p-number { font-weight: 700; margin-bottom: .3rem; }
.p-label { color: var(--soft); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.p-pre { white-space: pre-line; }
.p-parties { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.p-items { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.p-items th { color: var(--soft); border-bottom: 2px solid var(--rule); }
.p-items td, .p-items th { padding: .5rem .4rem; border-bottom: 1px solid var(--rule); white-space: normal; }
.p-items tfoot td { border: 0; padding: .25rem .4rem; text-align: right; }
.p-items tfoot td.num { width: 8rem; }
.p-items .p-total td { font-size: 1.1rem; font-weight: 800; border-top: 2px solid var(--ink); padding-top: .5rem; }
.p-empty { color: var(--soft); text-align: center; }
.p-receipt { text-align: center; padding: 1.2rem; border: 1px dashed var(--rule); border-radius: 8px; margin-bottom: 1.2rem; display: grid; gap: .25rem; }
.p-amount { font-size: 2.2rem; font-weight: 800; }
.p-sign { display: grid; gap: 1.2rem; margin: 1.5rem 0; }
.p-notes { margin-top: 1rem; }
.p-foot { margin-top: 1.5rem; padding-top: .7rem; border-top: 1px solid var(--rule); color: var(--soft); text-align: center; font-size: .82rem; }
.paper .num { text-align: right; }
@media (max-width: 600px) { .paper { padding: 1.2rem 1rem; } .p-title { text-align: left; } }

@media print {
  body { background: #fff; }
  /* The app's top bar (page name, refresh, profile) never prints: printed pages carry their own heading. Left in, it
     sat alone on the first sheet whenever the page prints on its own sheet setup (the landscape remittance form). */
  .nav, .topbar, .no-print, .toasts, .modal-wrap { display: none !important; }
  .main { margin: 0; padding: 0; }
  .page { padding: 0; max-width: none; }
  .paper { box-shadow: none; border-radius: 0; padding: 0; margin: 0; }
  @page { margin: 14mm; }
}

/* ---------- product catalogue & orders to prepare ---------- */
/* Product / manufacturer code chip (AP-CB) */
.code-tag { display: inline-block; margin-right: .35rem; padding: .05rem .4rem; border-radius: 5px; font: 600 .74rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .02em; color: var(--navy, var(--accent)); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); vertical-align: middle; }
.product-note { display: block; margin-top: .25rem; color: var(--muted); }
.product-note.warn { color: var(--danger); font-weight: 600; }
table.catalogue .group-row td { background: var(--surface-2); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cell-input { width: 7rem; text-align: right; padding: .3rem .45rem; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--copper) 7%, var(--surface)); }
.cell-input.changed { border-color: var(--copper); box-shadow: 0 0 0 2px color-mix(in srgb, var(--copper) 25%, transparent); }
td.strong { font-weight: 700; }
.stat.warn { border-left: 4px solid var(--copper); }
.stat.bad { border-left: 4px solid var(--danger); }

.prep-list { display: grid; gap: .8rem; }
.prep-card { display: grid; gap: .6rem; border-left: 4px solid var(--blue, var(--accent)); }
.prep-card.late { border-left-color: var(--danger); }
.prep-card .task-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.prep-title { color: inherit; font-size: 1.05rem; margin-right: auto; }
.prep-grid { display: grid; gap: .6rem 1.2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.prep-grid .small.block, .muted.block { display: block; }
.prep-stock { font-size: .85rem; }

/* ---------- table alignment everywhere ----------
   Every row lines up: cells centred vertically (so text and buttons share a line), figures right-aligned in
   tabular digits, action buttons at the right edge, and headers sitting on the same baseline as their column. */
th, td { vertical-align: middle; }
thead th { vertical-align: bottom; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td .btn.sm { margin-block: -.2rem; }
td > .btn + .btn, td > .btn + a.btn, td > a.btn + .btn { margin-left: .35rem; }
td:last-child:has(> .btn), td:last-child:has(> a.btn) { text-align: right; white-space: nowrap; width: 1%; }
td small.block, td .muted.block { margin-top: .1rem; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
tfoot td { vertical-align: middle; }
/* Printed papers (pay slips, documents) and the Excel-style sheets keep their own row colours */
.payslip tbody tr:hover td, .paper tbody tr:hover td { background: none; }

/* ---------- company logo on documents, forms and pay slips ---------- */
.p-logo { display: block; height: 58px; width: auto; max-width: 100%; margin-bottom: .35rem; }
.p-logo.sm { height: 44px; }
.ps-brand { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ps-brand .p-logo { height: 54px; margin: 0; }
.ps-brand .ps-company { font-size: 1.35rem; text-align: right; }
@media (max-width: 600px) { .p-logo { height: 44px; } .ps-brand .ps-company { text-align: left; } }
@media print { .p-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- product pictures ---------- */
.pthumb { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: var(--surface-2); cursor: zoom-in; vertical-align: middle; font: inherit; font-size: .68rem; color: var(--muted); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pthumb.empty { cursor: pointer; border-style: dashed; }
.pthumb.lg { width: 72px; height: 72px; }
.pthumb.inline { width: 36px; height: 36px; margin-right: .45rem; float: left; }
.pthumb:hover, .pthumb:focus-visible { border-color: var(--accent); outline: none; }
.product-pic { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; }
.pbig { display: grid; justify-items: center; gap: .5rem; }
.pbig img { max-width: 100%; max-height: 60vh; border-radius: 10px; border: 1px solid var(--border); }

.guide-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-left: 4px solid var(--copper); }
.guide-card h2 { margin: 0 0 .2rem; }
.guide-card p { margin: 0; }
.setup-key { display: inline-block; font-size: 1rem; letter-spacing: .06em; padding: .3rem .5rem; user-select: all; word-break: break-all; }
.setup-steps { margin: .3rem 0 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.setup-steps .no-marker { list-style: none; margin-left: -1.2rem; }
/* ---------- top bar with the signed-in person (top right) ---------- */
.content { min-width: 0; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .45rem max(16px, env(safe-area-inset-right, 0px)) .45rem max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
/* ‹ Back in the top bar (public/js/shell.js goBack): every page reached from another page */
.topbar-back { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; margin-right: .35rem; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 1.5rem; line-height: 1; padding-bottom: .15rem; cursor: pointer; flex: none; }
.topbar-back:hover, .topbar-back:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.topbar-back[hidden] { display: none; }
/* The title stays next to the arrow (the top bar spreads its pieces apart) */
.topbar-back + .topbar-title { margin-right: auto; }
.topbar-title { font-weight: 700; color: var(--muted); font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip { display: flex; align-items: center; gap: .6rem; padding: .25rem .3rem .25rem .8rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.profile-chip:hover, .profile-chip:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.profile-text { display: grid; text-align: right; line-height: 1.15; }
.profile-text strong { font-size: .9rem; }
.profile-text small { font-size: .72rem; color: var(--muted); }
@media (max-width: 480px) { .profile-text small { display: none; } }
img.avatar { object-fit: cover; padding: 0; }
.avatar.lg { width: 3rem; height: 3rem; font-size: 1.1rem; }
.avatar.xl { width: 5.5rem; height: 5.5rem; font-size: 1.8rem; }
.account-head { display: flex; align-items: center; gap: .8rem; }
.profile-edit { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
@media (min-width: 900px) { .content { margin-left: 210px; } .main { margin-left: 0; } }

/* ---------- inactivity warning ---------- */
.idle-warning { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; max-width: min(92vw, 560px); padding: .7rem .9rem; border-radius: 10px;
  background: var(--surface); border: 2px solid var(--copper); box-shadow: 0 10px 30px rgb(0 0 0 / .25); }
@media (min-width: 900px) { .idle-warning { bottom: 24px; } }

/* ---------- searchable pickers, product lines on documents ---------- */
.select-search { margin-bottom: .3rem; font-size: .88rem; padding: .35rem .6rem; }
/* A search box (GAKA 1.67.0): an editable line that looks like a text box, so Edge never pops its suggestions over it */
.qsearch { display: block; box-sizing: border-box; min-height: 2.6rem; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: clip; cursor: text; -webkit-user-modify: read-write-plaintext-only; }
.qsearch.select-search { min-height: 0; }
.qsearch:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.qsearch br { display: none; }
/* The letters that matched what was typed */
.pickbox-row b.hit { font-weight: 800; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 3px; }
/* The ranked list of a search box above a visible drop-down (a document line): it floats over the line below */
.pickbox-above { position: relative; }
.pickbox-above .pickbox-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.25)); }
/* One-box picker: type, choose from the list under it, the choice shows ticked */
select.pickbox-native { position: absolute; width: 1px !important; max-width: 1px !important; min-width: 0 !important; height: 1px; min-height: 0; padding: 0; border: 0; overflow: hidden; opacity: 0; pointer-events: none; }  /* never wider than 1px, whatever a toolbar sets (GAKA 1.154.2) */
.pickbox { display: block; min-width: 0; }
.pickbox-chosen { display: flex; align-items: center; gap: .5rem; min-height: 2.6rem; padding: .3rem .4rem .3rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-weight: 600; transition: background .4s, border-color .4s; }
.pickbox-chosen.fresh { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pickbox-chosen[hidden] { display: none; }
.pickbox-chosen .ellipsis { flex: 1; min-width: 0; }
.pickbox-chosen:not(.fresh) .pickbox-tick { display: none; }
.pickbox-tick { flex: none; display: grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--ok); color: #fff; font-size: .8rem; }
.pickbox-clear { flex: none; width: 2rem; height: 2rem; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: 1.1rem; cursor: pointer; }
.pickbox-clear:hover { background: var(--surface); }
.pickbox-list { max-height: 14rem; overflow-y: auto; margin-top: .25rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.pickbox-row { display: block; width: 100%; padding: .55rem .7rem; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pickbox-row:hover, .pickbox-row.on { background: var(--accent-soft); }
.pickbox-none { padding: .55rem .7rem; }
.add-new { justify-self: start; margin-top: .35rem; }
/* Where a sale stands: its steps and what happens next */
.journey { display: grid; gap: .5rem; margin: .4rem 0 .8rem; padding: .7rem .9rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.page .journey { padding: .7rem .9rem; }
.journey-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.journey-steps li { flex: 1 1 5.5rem; padding: .3rem .5rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: .8rem; }
.journey-steps li a { color: inherit; }
.journey-steps li strong, .journey-steps li small { display: block; }
.journey-steps li.done { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--text); }
.journey-steps li.now { background: var(--accent); color: #fff; }
.journey-next { margin: 0; font-weight: 600; font-size: .92rem; }
.my-steps ul { list-style: none; margin: 0; padding: 0; display: grid; }
.my-steps li a { display: flex; flex-wrap: wrap; gap: .1rem .7rem; padding: .5rem 0; border-top: 1px solid var(--border); color: inherit; }
.more-actions { position: relative; }
.more-actions summary { list-style: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 20; display: grid; gap: .3rem; min-width: 12rem; padding: .5rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); }
/* Picture viewer: turn, zoom and move */
.iv-tools { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.iv-level { min-width: 3.2rem; text-align: center; font-size: .85rem; }
/* Always the same place and size on every screen (GAKA 1.133.1): the window never needs scrolling to see the picture */
.iv-stage { position: relative; height: clamp(260px, calc(100vh - 250px), 78vh); overflow: hidden; border-radius: 10px; background: var(--surface-2); touch-action: none; cursor: default; outline: none; }
.iv-stage:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.iv-stage.zoomed { cursor: grab; }
.iv-stage.zoomed.moving { cursor: grabbing; }
.iv-img { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center; user-select: none; }
.iv-stage:not(.moving) .iv-img { transition: transform .12s ease-out; }
/* The map in the corner: the whole picture, and the part on screen */
.iv-map { position: absolute; right: .6rem; bottom: .6rem; overflow: hidden; border-radius: 8px; background: rgba(0, 0, 0, .55); box-shadow: 0 4px 16px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .25); cursor: pointer; touch-action: none; }
.iv-map-img { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center; opacity: .85; pointer-events: none; user-select: none; }
.iv-map-box { position: absolute; border: 2px solid #fff; border-radius: 3px; background: rgba(255, 255, 255, .15); box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); pointer-events: none; }
.iv-hint { position: absolute; left: 50%; bottom: .6rem; transform: translateX(-50%); padding: .25rem .7rem; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; pointer-events: none; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.iv-stage.zoomed .iv-hint:not([hidden]) { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .iv-stage .iv-img { transition: none; } }
/* Date boxes: DD/MM/YYYY text in front of the real date input (public/js/dates.js) */
.date-box { position: relative; display: inline-block; width: 10.5rem; flex: none; }
.field .date-box { display: block; width: 100%; align-self: start; font-size: inherit; font-weight: inherit; }
.field.required > .date-box::after { content: none; }
.date-text { padding-right: 2.3rem; }
.date-text.date-bad { border-color: var(--danger); }
.date-pick { position: absolute; top: 0; right: 0; bottom: 0; width: 2.2rem; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.date-pick:hover { color: var(--text); }
.date-real { position: absolute; right: 0; bottom: 0; width: 2.2rem; height: 100%; padding: 0; opacity: 0; pointer-events: none; }
/* Phones (GAKA 1.89.3, the CEO: "The delivery date is not working"): an iPhone does not open a hidden date box from the
   calendar button, so on touch screens the real (invisible) date box lies over the button and the tap opens it itself */
@media (pointer: coarse) { .date-real { pointer-events: auto; z-index: 1; width: 2.6rem; min-width: 0; font-size: 16px; cursor: pointer; } }
/* An iPhone gives time boxes a width of their own, so "Needed by (time)" stuck out of the window: keep it inside its
   column, its time on the left like the other boxes (Safari on iPhone only, the one browser with -webkit-touch-callout) */
input[type="time"] { min-width: 0; max-width: 100%; }
/* Grey suggestions in text boxes (public/js/keyboard.js, GAKA 1.91.0): Tab or a tap takes them */
.ghost-text { position: absolute; z-index: 2; margin: 0; overflow: hidden; pointer-events: none; color: transparent; background: transparent; border-color: transparent; }
.ghost-typed { visibility: hidden; }
.ghost-rest { color: var(--muted); opacity: .8; pointer-events: auto; cursor: pointer; }
.ghost-key { display: inline-block; margin-left: .45em; padding: 0 .35em; border: 1px solid var(--border); border-radius: 4px; font-size: .7em; line-height: 1.5; vertical-align: middle; color: var(--muted); }
@media (pointer: coarse) { .ghost-key { display: none; } }
/* GAKA's own time boxes (public/js/times.js, GAKA 1.90.0): 12-hour or 24-hour as chosen in My profile */
.time-box { position: relative; display: inline-block; width: 9rem; flex: none; }
.field .time-box { display: block; width: 100%; align-self: start; }
.time-text { padding-right: 2.3rem; }
.time-text.time-bad { border-color: var(--danger); }
.time-pick { position: absolute; top: 0; right: 0; bottom: 0; width: 2.2rem; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.time-pick:hover { color: var(--text); }
.time-real { position: absolute; right: 0; bottom: 0; width: 2.2rem; height: 100%; padding: 0; opacity: 0; pointer-events: none; }
.tp-pop { position: fixed; z-index: 1000; padding: .5rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.tp-cols { display: flex; gap: .25rem; }
.tp-col { display: flex; flex-direction: column; gap: 2px; height: 13.5rem; overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
.tp-item { min-width: 3.2rem; padding: .45rem .6rem; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.tp-item:hover { background: var(--surface-2); }
.tp-item.on { background: var(--accent); color: #fff; font-weight: 600; }
.tp-actions { display: flex; justify-content: space-between; gap: .5rem; margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border); }
@supports (-webkit-touch-callout: none) { input[type="time"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; text-align: left; } }
select[size]:not([size="0"]) { height: auto; }
.ed-product { min-width: 260px; display: grid; gap: .25rem; }
.ed-product select { font-size: .85rem; }
.p-code { font-size: .78em; color: #5b6475; margin-top: .1rem; }
.p-goods { margin-top: 1rem; }

/* The document editor needs room: the product column shows code · manufacturer · product in full */
.modal.xwide { width: min(100%, 1040px); }
.ed-items td:first-child { min-width: 340px; }
.ed-product { min-width: 340px; }
select[size]:not([size="0"]) { padding: .25rem; }
select[size]:not([size="0"]) option { padding: .4rem .55rem; border-radius: 6px; }
select[size]:not([size="0"]) option:checked { background: var(--accent-soft); color: var(--text); }
.ed-add { width: 100%; }
/* On a phone the line table scrolls sideways inside the form instead of widening the whole window */
.ed-wrap { min-width: 0; max-width: 100%; }
.ed-hint { margin-right: auto; align-self: center; max-width: 30rem; }
.form-actions { gap: .5rem; flex-wrap: wrap; }
.doc-next { margin: .2rem 0 0; padding: .55rem .8rem; border-radius: 8px; background: var(--accent-soft); }
.warn-text { color: var(--second); font-weight: 600; }

/* Driver suggestions on a quotation or invoice */
.driver-tips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.dt { font: inherit; font-size: .85rem; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .35rem .6rem; cursor: pointer; }
.dt:hover { border-color: var(--accent); }
.dt.chosen { border-color: var(--accent); background: var(--accent-soft); }
.dt.warn { border-style: dashed; border-color: var(--second); }

/* Customer of a load: invoices waiting for bricks first, then other customers */
.cust-picker { display: grid; gap: .4rem; }
.cp-results { display: grid; gap: .3rem; max-height: 42dvh; overflow-y: auto; }
.cp-head { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-top: .2rem; }
.cp-item { font: inherit; text-align: left; display: grid; gap: .1rem; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .7rem; cursor: pointer; }
.cp-item:hover { border-color: var(--accent); }
.cp-line { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.cp-results > .btn { justify-self: start; }
.cp-chosen { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding: .55rem .75rem; border-radius: 8px; background: var(--accent-soft); }
.load-customer { padding-bottom: .4rem; border-bottom: 1px solid var(--border); }
.no-customer { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; border-left: 4px solid var(--copper); }
.no-customer h2 { margin: 0 0 .2rem; }
.no-customer p { margin: 0; max-width: 46rem; }
.link-doc { display: flex; gap: .8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .55rem .75rem; margin-bottom: .6rem; border-radius: 8px; background: var(--accent-soft); font-size: .9rem; }

/* Driver reports */
.report-due { border-left: 4px solid var(--copper); }
.report-form { margin-top: .4rem; }
.star-row { width: 100%; display: flex; gap: .6rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.star-row > span { font-size: .9rem; font-weight: 600; }
.stars { display: flex; gap: .15rem; }
.star { font-size: 1.5rem; line-height: 1; background: none; border: 0; padding: .1rem .15rem; cursor: pointer; color: var(--muted); opacity: .45; }
.star.on, .star:hover { color: var(--copper); opacity: 1; }
.reports { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.reports li { padding: .5rem .7rem; border-radius: 8px; background: var(--surface-2); }

/* Phone numbers: country code, then the number typed any way */
.phone-row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: .4rem; }

/* ---------- sortable columns (⇅ on every list heading) ---------- */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover, th.sortable:focus-visible { color: var(--text); }
th .sort-arrow { margin-left: .3rem; font-size: .8em; opacity: .45; }
th[aria-sort="ascending"] .sort-arrow, th[aria-sort="descending"] .sort-arrow { opacity: 1; color: var(--accent); }
th.num .sort-arrow { margin-left: .25rem; }

/* wide pages keep forms readable */
.page.wide form.card, .page.wide .worklog-form { max-width: 820px; }

td.wrap { white-space: normal; min-width: 14rem; }
.pre-wrap { white-space: pre-wrap; }
/* =====================================================================
   Interface refinement: typography, surfaces, controls and data tables.
   Kept last so it settles the earlier rules into one consistent system.
   ===================================================================== */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f5f7fa;
  --surface-2: #f2f4f8;
  --border: #e4e8ef;
  --border-strong: #d0d6e1;
  --text: #111827;
  --muted: #667085;
  --radius: 10px;
  --shadow-xs: 0 1px 2px rgb(16 24 40 / .05);
  --shadow-sm: 0 1px 3px rgb(16 24 40 / .07), 0 1px 2px rgb(16 24 40 / .04);
  --shadow-lg: 0 16px 40px rgb(16 24 40 / .14);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1222; --surface-2: #1b2340; --border: #273152; --border-strong: #34406a; --text: #eef1f8; --muted: #98a2bd;
    --shadow-xs: none; --shadow-sm: 0 1px 2px rgb(0 0 0 / .4); --shadow-lg: 0 16px 40px rgb(0 0 0 / .5); }
}
body { font-family: var(--font); font-size: 14.5px; line-height: 1.5; letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
.st-keys kbd { font-family: var(--font); }
h1 { font-size: 1.45rem; font-weight: 650; letter-spacing: -.022em; }
h2 { font-size: .95rem; font-weight: 600; letter-spacing: -.01em; }
.page-head h1 { color: var(--text); }
.page-head { margin: .4rem 0 1.1rem; }
.page { padding: 1.25rem 1.5rem 2rem; }
@media (max-width: 700px) { .page { padding: 1rem; } }
.muted { color: var(--muted); }
td, .num, .stat strong { font-variant-numeric: tabular-nums; }

/* icons */
.ic { display: inline-flex; flex: none; line-height: 0; }
.ic svg { width: 1.1em; height: 1.1em; }
.ic-inline { margin-right: .35rem; vertical-align: -.14em; color: var(--muted); }
a .ic-inline { color: inherit; opacity: .75; }
a.tel { white-space: nowrap; }
.nav-icon.ic svg { width: 19px; height: 19px; }
@media (min-width: 900px) { .nav-icon.ic { width: 20px; justify-content: center; } .nav-icon.ic svg { width: 18px; height: 18px; } }
.search-item .ic { color: var(--accent); justify-content: center; }
.btn .ic svg { width: 16px; height: 16px; }

/* surfaces */
.card, .stat { border-color: var(--border); box-shadow: var(--shadow-sm); }
.card { padding: 1.1rem 1.2rem; }
.card > h2:first-child, .card .task-top h2 { font-size: .98rem; }
.stat { padding: .85rem 1rem; gap: .15rem; }
.stat > span:first-child { font-size: .76rem; font-weight: 500; letter-spacing: .01em; }
.stat strong { font-size: 1.35rem; font-weight: 650; letter-spacing: -.02em; }
.stats.compact .stat strong { font-size: 1.12rem; }
.stat.hero { box-shadow: 0 8px 24px rgb(27 42 94 / .22); }
.section-title { font-size: .74rem; font-weight: 600; letter-spacing: .07em; }

/* controls */
.btn { font-weight: 550; border-color: var(--border-strong); box-shadow: var(--shadow-xs); transition: background .15s, border-color .15s, box-shadow .15s, color .15s; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.btn.primary { box-shadow: 0 1px 2px rgb(31 63 143 / .28), inset 0 1px 0 rgb(255 255 255 / .08); }
.btn.sm { padding: .32rem .7rem; font-size: .82rem; border-radius: 7px; }
.btn.ghost-danger { border-color: var(--border); }
.btn.ghost-danger:hover { background: #fef3f2; border-color: #fecdca; }
input, select, textarea, .qsearch { border-color: var(--border-strong); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus, .qsearch:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field > span { font-size: .82rem; font-weight: 550; color: var(--text); }
.chip { font-weight: 500; border-color: var(--border-strong); }
.tabs button { font-weight: 500; }
.tabs button.active { font-weight: 600; }

/* tables */
.table-wrap { border-radius: 8px; }
th { font-size: .7rem; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
table.sheet thead th { background: var(--surface-2); border-bottom: 1px solid var(--border); }
table.sheet td { border-bottom-color: var(--border); }
tbody tr { transition: background .1s; }
tbody tr:hover > td { background: rgb(16 24 40 / .022); }
@media (prefers-color-scheme: dark) { tbody tr:hover > td { background: rgb(255 255 255 / .03); } }
tr.group-row td { background: var(--surface-2); font-weight: 600; font-size: .8rem; letter-spacing: .02em; color: var(--muted); }
tr.subtotal td { font-weight: 600; background: var(--surface-2); }

/* badges and banners */
.badge { font-weight: 550; font-size: .72rem; padding: .16rem .55rem; letter-spacing: .01em; }
.badge.s-cancelled-plain { background: #fef3f2; color: #b42318; }
@media (prefers-color-scheme: dark) { .badge.s-cancelled-plain { background: #4a1a15; color: #ff9d92; } }
.check-banner { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500; border: 1px solid transparent; border-radius: 8px; padding: .6rem .8rem; }
.check-banner > .ic { margin-top: .1rem; }
.check-banner > .ic svg { width: 17px; height: 17px; }
.check-banner.ok { background: #ecfdf3; color: #05603a; border-color: #abefc6; }
.check-banner.warn { background: #fffaeb; color: #93370d; border-color: #fedf89; }
.check-banner.bad { background: #fef3f2; color: #912018; border-color: #fecdca; border-left-width: 1px; }
@media (prefers-color-scheme: dark) {
  .check-banner.ok { background: #0f2d1f; color: #7fe0ae; border-color: #1d4a33; }
  .check-banner.warn { background: #33240b; color: #fec84b; border-color: #4e3810; }
  .check-banner.bad { background: #3a1416; color: #ffb3b3; border-color: #5c2226; }
}
.pos { color: var(--ok); font-weight: 600; }

/* menu */
@media (min-width: 900px) {
  .nav a { font-size: .9rem; font-weight: 450; border-radius: 7px; }
  .nav a.active { font-weight: 550; }
  .nav .brand { letter-spacing: .14em; font-weight: 700; }
}

/* top bar and modals */
.topbar { background: rgb(255 255 255 / .82); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { .topbar { background: rgb(13 18 34 / .82); } }
.modal { border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal header h2 { font-weight: 650; letter-spacing: -.015em; }
.modal-wrap { background: rgb(16 24 40 / .45); backdrop-filter: blur(2px); }
.toast { border-radius: 10px; font-weight: 500; box-shadow: var(--shadow-lg); }

/* brick grades and the transport line on documents */
.grade-tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: .12rem .5rem; border-radius: 6px; background: #f4ebff; color: #5925dc; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .grade-tag { background: #2c1c5c; color: #c8b6ff; } }
.sub-head { font-size: .9rem; font-weight: 600; margin: .4rem 0 0; }
.ed-transport td { background: var(--surface-2); border-top: 1px dashed var(--border-strong); }
.ed-t-label { display: flex; align-items: center; font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.ed-transport select { min-width: 9.5rem; }

.link-btn { border: 0; background: none; padding: 0 0 0 .4rem; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
/* "Showing matches from all of November 2026 · Search all time" under a search box (public/js/ui.js searchNote) */
.search-wide { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; margin: -.25rem 0 .5rem; }
.search-wide::before { content: ''; width: .45rem; height: .45rem; margin-right: .35rem; border-radius: 50%; background: var(--accent); }
/* sign-in page: forgot password */
/* The lock screen of a remembered phone (public/js/device-lock.js): who it is, fingerprint/face, the PIN */
.lock-who { display: grid; justify-items: center; gap: .3rem; text-align: center; }
.lock-avatar { width: 4rem; height: 4rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; color: #fff; background: var(--second); }
.lock-pin-label { display: grid; gap: .35rem; font-weight: 600; font-size: .9rem; }
.lock-pin { font-size: 1.4rem; letter-spacing: .2em; text-align: center; padding: .55rem 3.6rem; width: 100%; }
.lock-bio { font-weight: 600; }
/* GAKA 1.95.2: the PIN box with Show/Hide inside it on the right */
.lock-pin-box { position: relative; display: block; }
.lock-peek { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); min-height: 2.2rem; padding: 0 .7rem; border: 0;
  border-radius: 8px; background: none; color: var(--link); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.lock-peek:hover, .lock-peek:focus-visible { background: var(--surface-2); }
/* Unlock always looks pressable: white on maroon, dark on the pink of dark mode; while working it keeps its colour and
   shows a spinner and "Unlocking…" (a greyed-out button looked like GAKA had stopped) */
.login-card .btn.lock-go { display: flex; align-items: center; justify-content: center; gap: .55rem; min-height: 3rem; font-size: 1.02rem; font-weight: 700; color: #fff; }
.lock-spin { display: none; width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: gaka-spin .7s linear infinite; }
.lock-go.is-busy { pointer-events: none; }
.lock-go.is-busy .lock-spin { display: inline-block; }
@media (prefers-color-scheme: dark) { .login-card .btn.lock-go { color: #1a0d10; } .login-card .btn.lock-go:hover { background: var(--second); } }
/* My remembered devices */
.device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.device-list > li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; border: 1px solid var(--border); border-radius: 10px; padding: .55rem .75rem; }
.device-list .badge { margin-left: .4rem; }
.login-forgot { justify-self: center; padding: .2rem; font-size: .88rem; }
.login-card h2 { margin: 0; font-size: 1.05rem; text-align: center; }

.profile-chip.upd-dot { position: relative; }
.profile-chip.upd-dot::after { content: ''; position: absolute; top: 2px; right: 2px; width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
/* GAKA Update (GAKA 1.132.0): the line in the Account window and its window, like Windows Update */
.upd-line { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .35rem .55rem .35rem .35rem; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); transition: border-color .2s, background .2s, box-shadow .2s; }
.upd-line:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); }
.upd-line.is-done { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.upd-line-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: .8rem; padding: .4rem .5rem; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.upd-line-main:focus-visible, .upd-ring:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The circle at the right end: check (it turns while checking), or update when a new version waits */
.upd-ring { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--surface-2, var(--surface)); color: var(--accent); font: inherit; font-weight: 800; font-size: 1.1rem; cursor: pointer; transition: border-color .2s, background .2s, transform .15s; }
.upd-ring:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.upd-ring:active:not(:disabled) { transform: scale(.92); }
.upd-ring:disabled { cursor: default; }
.upd-ring .svg-icon { display: grid; }
.upd-ring.go { border: 0; background: var(--accent); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.is-done .upd-ring { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); color: var(--ok); }
.upd-spin { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--accent) 22%, transparent); border-top-color: var(--accent); animation: upd-turn .8s linear infinite; }
@keyframes upd-turn { to { transform: rotate(360deg); } }
.upd-mark.is-checking svg { animation: upd-turn 1.1s linear infinite; }
/* The green tick: comes in with a small pop, stays a few seconds, then the arrows come back */
.upd-done { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 800; font-size: 1.1rem;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ok) 18%, transparent); animation: upd-pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.upd-mark.big .upd-done { width: 4.4rem; height: 4.4rem; font-size: 2.2rem; box-shadow: 0 0 0 9px color-mix(in srgb, var(--ok) 16%, transparent); }
@keyframes upd-pop { from { transform: scale(.3); opacity: 0; } }
.upd-mark.is-idle svg, .upd-mark.is-new svg { animation: upd-fade .35s ease-out; }
@keyframes upd-fade { from { opacity: 0; transform: rotate(-90deg) scale(.7); } }
@media (prefers-reduced-motion: reduce) { .upd-spin, .upd-mark.is-checking svg, .upd-done, .upd-mark svg { animation: none !important; } .upd-spin { border-color: var(--accent); } }
.upd-line.upd-new { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 22%, transparent); }
.upd-line-words { flex: 1; min-width: 0; display: grid; }
.upd-line-words small { color: var(--muted); font-size: .82rem; }
.upd-chev { flex: none; color: var(--muted); display: grid; }
.upd-mark { --upd: var(--ok); position: relative; flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; color: #3b8beb; }
.upd-new .upd-mark { --upd: var(--accent); }
.upd-line.upd-new .upd-mark { color: var(--accent); }
.upd-mark .svg-icon { display: grid; }
.upd-mark.big { width: 5.5rem; height: 5.5rem; }
.upd-mark.big svg { width: 5rem; height: 5rem; stroke-width: 1.6; }
.upd-badge { position: absolute; right: -.1rem; bottom: -.05rem; display: grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--upd); color: #fff; font-size: .7rem; font-weight: 800; box-shadow: 0 0 0 2px var(--surface); }
.upd-mark.big .upd-badge { width: 2.2rem; height: 2.2rem; font-size: 1.2rem; right: -.2rem; bottom: -.1rem; box-shadow: 0 0 0 3px var(--surface); }
.upd-new .upd-mark .upd-badge { animation: upd-pulse 2s ease-in-out infinite; }
@keyframes upd-pulse { 50% { box-shadow: 0 0 0 3px var(--surface), 0 0 0 9px color-mix(in srgb, var(--upd) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .upd-new .upd-mark .upd-badge { animation: none; } }
.upd-page { display: grid; gap: .9rem; }
.upd-hero { display: flex; align-items: center; gap: 1.4rem; padding: .6rem .2rem 1rem; }
.upd-hero-words { flex: 1; min-width: 0; }
.upd-hero h3 { margin: 0; font-size: 1.55rem; font-weight: 700; line-height: 1.2; }
.upd-hero p { margin: .3rem 0 0; color: var(--muted); }
.upd-hero .btn { flex: none; white-space: nowrap; }
.upd-sect-title { font-weight: 700; margin-top: .2rem; }
.upd-latest { display: grid; gap: .55rem; padding: .9rem 1rem; border-radius: 12px; background: var(--surface-2, var(--surface)); border: 1px solid var(--border); }
.upd-opt { border-radius: 12px; background: var(--surface-2, var(--surface)); border: 1px solid var(--border); overflow: hidden; }
.upd-opt-row { display: flex; align-items: center; gap: 1rem; width: 100%; padding: 1rem 1.1rem; border: 0; background: none; color: var(--text); font: inherit; text-align: left; }
button.upd-opt-row { cursor: pointer; }
button.upd-opt-row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.upd-opt-icon { flex: none; display: grid; color: var(--text); }
.upd-opt-words { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.upd-opt-words small { color: var(--muted); font-size: .84rem; }
.upd-opt .upd-chev { transition: transform .2s; }
.upd-opt.open .upd-chev { transform: rotate(90deg); }
.upd-switch { flex: none; display: flex; align-items: center; gap: .6rem; }
.upd-opt-more { padding: .2rem 1.1rem 1.1rem 3.5rem; }
.upd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.upd-list li { display: grid; gap: .1rem; padding-left: .9rem; position: relative; font-size: .9rem; }
.upd-list li::before { content: ''; position: absolute; left: 0; top: .5rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }
.upd-list li span { color: var(--muted); }
.upd-history { display: grid; gap: 1.1rem; max-height: 50vh; overflow-y: auto; padding-right: .3rem; }
.upd-rel { display: grid; gap: .5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.upd-rel:last-child { border-bottom: 0; }
.upd-rel-head { display: flex; align-items: center; gap: .5rem; }
.upd-ver { font-weight: 800; font-size: 1.05rem; }
.upd-ver.upd-latest-ver { color: var(--accent); }
.upd-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .1rem .45rem; border-radius: 999px; color: #fff; background: var(--accent); }
.upd-tag.mine { background: var(--ok); }
.upd-help { display: grid; gap: .8rem; }
.upd-help p { margin: .15rem 0 0; color: var(--muted); font-size: .9rem; }
@media (max-width: 600px) {
  .upd-hero { flex-wrap: wrap; gap: 1rem; }
  .upd-mark.big { width: 4.2rem; height: 4.2rem; }
  .upd-mark.big svg { width: 3.8rem; height: 3.8rem; }
  .upd-hero h3 { font-size: 1.3rem; }
  .upd-hero .btn { width: 100%; }
  .upd-opt-row { gap: .75rem; padding: .9rem; }
  .upd-opt-more { padding: .2rem .9rem 1rem; }
}

/* "A new version of GAKA is ready" */
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px); z-index: 120; display: flex; align-items: center; gap: .8rem;
  padding: .6rem .7rem .6rem 1rem; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 500;
  /* GAKA 1.96.3: as wide as the words need (up to the screen less 2rem), so "New Update" never squeezes them into a column */
  width: max-content; max-width: calc(100vw - 2rem); }
.update-bar > .btn { flex: none; white-space: nowrap; }
@media (min-width: 900px) { .update-bar { bottom: 24px; } }

/* Boxes with an × to empty them (the email on the sign-in screen) */
.clear-wrap { position: relative; display: block; }
.clear-wrap input { width: 100%; padding-right: 2.6rem; }
.clear-x { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 1.9rem; height: 1.9rem; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font: inherit; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.clear-x:hover, .clear-x:focus-visible { background: var(--border); color: var(--text); }
.clear-x[hidden] { display: none; }

/* Password boxes: Show / Hide inside the box, on the right */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 4.2rem; }
.pw-eye { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--link);
  font: inherit; font-size: .85rem; font-weight: 600; padding: .3rem .5rem; cursor: pointer; border-radius: 6px; }
.pw-eye:hover { background: var(--surface-2); }

/* "Install GAKA on this device" — same place and look as the update bar */
.install-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 120;
  display: flex; align-items: center; gap: .7rem; width: max-content; max-width: calc(100vw - 32px); padding: .55rem .7rem;
  border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 500; }
.install-bar img { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.install-bar .btn:not(.primary) { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 40%, transparent); }
@media (min-width: 900px) { .install-bar { bottom: 24px; } }
@media (max-width: 520px) { .install-bar { flex-wrap: wrap; } .install-bar span { flex: 1 1 calc(100% - 48px); } }
.install-steps { margin: 0; padding-left: 1.3rem; display: grid; gap: .55rem; line-height: 1.45; }

/* ---------- layout fixes found on the screenshots ---------- */
.code-tag { color: var(--accent); }                          /* readable on light and dark */
table.sheet td.nowrap, table.sheet th.nowrap { white-space: nowrap; }
table.catalogue td:nth-child(3) { min-width: 13rem; }       /* product names on one or two lines */
.cell-input { width: 6rem; }
.pos-grid > .empty { grid-column: 1 / -1; }                  /* "no products yet" across the whole area */
.biz-select { max-width: 320px; }

/* Transport line: its description and how it is settled side by side; the number of trucks under the quantity */
.ed-t-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 12rem); gap: .25rem; }
/* One driver/truck picker per truck: number, search, list */
.truck-rows { display: grid; gap: .4rem; }
.truck-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 9.5rem; gap: .4rem; align-items: start; }
.truck-row > span { padding-top: .65rem; }
/* Bricks on each truck of a big order (hidden when one truck carries everything) */
.truck-qty-wrap { display: flex; align-items: center; gap: .3rem; }
.truck-qty-wrap input { width: 100%; min-width: 0; }
.truck-rows.one-truck .truck-qty-wrap { display: none; }
.truck-rows.one-truck .truck-row { grid-template-columns: 6.5rem minmax(0, 1fr); }
@media (max-width: 640px) {
  .truck-row, .ed-t-line, .truck-rows.one-truck .truck-row { grid-template-columns: 1fr; }
}

/* Phones: the bottom bar holds the favourite modules and More; the menu's search box is for computers only
   (search stays available in More and with Ctrl+K) */
.nav .nav-search { display: none; }
@media (min-width: 900px) { .nav .nav-search { display: flex; } }

/* Delivery reminder alarm: on top of everything until "Got it" */
.alarm { position: fixed; z-index: 200; top: 16px; left: 50%; transform: translateX(-50%); width: min(92vw, 460px); display: grid; gap: .6rem;
  padding: 1rem; border-radius: 14px; background: var(--surface); border: 2px solid var(--copper); box-shadow: var(--shadow-lg); }
.alarm-head { display: flex; gap: .5rem; align-items: center; font-size: 1.05rem; }
.alarm-head svg { width: 22px; height: 22px; color: var(--copper); }
.alarm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; max-height: 50dvh; overflow-y: auto; }
.alarm-list li { padding: .5rem .6rem; border-radius: 8px; background: var(--surface-2); }
.alarm .btn { justify-self: end; }

/* ---------- top bar: refresh button and the profile chip ---------- */
.topbar-actions { display: flex; align-items: center; gap: .5rem; flex: none; }
.refresh-btn { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--accent); cursor: pointer; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s, transform .15s; }
.refresh-btn:hover, .refresh-btn:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.refresh-btn:active { transform: scale(.94); }
/* Sound in the profile menu (public/js/shell.js soundSwitch): bell, "Sound" and a sliding switch */
.sound-row { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.sound-row-icon { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--surface); color: var(--accent); flex: none; }
.sound-row-text { flex: 1; min-width: 0; }
.switch { position: relative; width: 2.9rem; height: 1.6rem; border-radius: 999px; border: none; padding: 0; cursor: pointer; flex: none; background: var(--border-strong, #5a6178); transition: background .2s; }
.switch .switch-knob { position: absolute; top: .2rem; left: .2rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .35); transition: transform .2s; }
.switch.on { background: var(--ok); }
.switch.on .switch-knob { transform: translateX(1.3rem); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The CEO's Logistics switch on the Requisitions page (same row and switch as Sound) */
.req-flow-row { margin: .75rem 0; }

.refresh-btn.spin .svg-icon, .ptr.spin .svg-icon { animation: gaka-spin .8s linear infinite; }
@keyframes gaka-spin { to { transform: rotate(360deg); } }
.profile-chip { gap: .55rem; padding: .22rem .65rem .22rem .22rem; box-shadow: var(--shadow-xs);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(120deg, color-mix(in srgb, var(--accent) 45%, var(--border)), color-mix(in srgb, var(--copper) 55%, var(--border))) border-box;
  border: 1px solid transparent; transition: box-shadow .15s, transform .15s; }
.profile-chip:hover, .profile-chip:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm); border-color: transparent; }
.profile-chip:active { transform: scale(.98); }
.chip-avatar { position: relative; display: grid; padding: 2px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--copper)); }
.chip-avatar .avatar { width: 34px; height: 34px; font-size: .8rem; border: 2px solid var(--surface); }
/* Signed in and online */
.chip-avatar::after { content: ''; position: absolute; right: 0; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: #22a06b; border: 2px solid var(--surface); }
.profile-chip .profile-text { text-align: left; }
.profile-chip .profile-text small { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-caret { display: grid; color: var(--muted); }
@media (max-width: 480px) { .chip-caret { display: none; } .profile-chip { padding-right: .5rem; } }

/* ---------- pull down to refresh (phones and tablets) ---------- */
html { overscroll-behavior-y: contain; }
.ptr { position: fixed; z-index: 150; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 50%; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--muted); box-shadow: var(--shadow-lg);
  transform: translate(-50%, calc(var(--pull, 0px) - 56px)) rotate(var(--turn, 0deg)); opacity: 0; pointer-events: none; transition: opacity .15s; }
.ptr.on { opacity: 1; }
.ptr.ready, .ptr.spin { color: var(--accent); }
.ptr.spin { transform: translate(-50%, 40px); transition: transform .2s; }

/* ---------- computer sidebar: icons only until the mouse moves onto it (unless pinned open) ---------- */
.nav-pin { display: none; }
@media (min-width: 900px) {
  .nav .brand { gap: .5rem; }
  .nav-pin { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; flex: none; padding: 0; border-radius: 50%; cursor: pointer;
    color: rgb(255 255 255 / .75); background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .15); }
  .nav-pin:hover, .nav-pin:focus-visible { color: #fff; background: rgb(255 255 255 / .16); outline: none; }
  .nav-pin[aria-pressed="true"] { color: var(--copper); }
  .shell .nav { transition: width .22s ease, box-shadow .22s ease; }
  .shell .content { transition: margin-left .22s ease; }
  .shell.nav-auto .content { margin-left: 68px; }
  .shell.nav-auto .nav { width: 68px; overflow-x: hidden; transition-delay: .3s; }
  /* Opens over the page (the page does not jump), after a short pause so passing the mouse across does not open it */
  .shell.nav-auto .nav:hover, .shell.nav-auto .nav:has(:focus-visible) { width: 230px; transition-delay: .12s; box-shadow: 12px 0 40px rgb(10 16 40 / .35); }
  .shell.nav-auto .nav:not(:hover):not(:has(:focus-visible)) :is(.nav-label, .brand-name, .nav-fold, .nav-pin, .nav-group, .st-label, .st-keys, .nav-count) { display: none; }
  .shell.nav-auto .nav:not(:hover):not(:has(:focus-visible)) .nav-sect.closed { display: flex; }
  .shell.nav-auto .nav:not(:hover):not(:has(:focus-visible)) a { justify-content: center; padding-inline: 0; }
  .shell.nav-auto .nav:not(:hover):not(:has(:focus-visible)) .brand { justify-content: center; padding-inline: 0; }
  .shell.nav-auto .nav:not(:hover):not(:has(:focus-visible)) .search-trigger { justify-content: center; padding: .45rem; }
  .shell.nav-auto .nav:not(:hover):not(:has(:focus-visible)) .nav-search { margin-inline: 0; }
  .shell.nav-auto .nav:not(:hover):not(:has(:focus-visible)) .nav-badge { position: absolute; top: 2px; right: 4px; min-width: 1rem; height: 1rem; font-size: .6rem; }
  .shell.nav-auto .nav a { position: relative; white-space: nowrap; }
}

/* ---------- phones and tablets: the page stays put ----------
   Never wider than the screen and no sideways bounce; no double-tap zoom (pinch zoom still works, for reading);
   text the phone does not enlarge by itself; and form boxes at 16px, so an iPhone does not zoom in when one is tapped
   (and leave the page zoomed and sliding sideways). !important because module styles set smaller text on some boxes. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: clip; overscroll-behavior-x: none; }
body { touch-action: manipulation; }
img, video, canvas, iframe { max-width: 100%; }
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
}
/* A photo opened from a chat or Files, in GAKA's own viewer on phones */
.file-view { display: block; max-width: 100%; max-height: 70dvh; margin: 0 auto; border-radius: 10px; object-fit: contain; }

/* ---------- phones: feel like an installed app ----------
   No grey flash on tap, buttons and rows press in, holding a button or a chat does not select text or open the
   browser's link preview (a chat's long press opens GAKA's own menu), and pages slide in gently. */
@media (pointer: coarse) {
  html { -webkit-tap-highlight-color: transparent; }
  .nav, .nav-more, .btn, .chip, .filter-chip, .tabs button, .conv-item, .icon-btn, .profile-chip, .refresh-btn, .stat.link, .card.task {
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .btn:active, .nav a:active, .nav-more:active, .chip:active, .filter-chip:active, .conv-item:active, .icon-btn:active, .stat.link:active, .card.task:active {
    transform: scale(.97); transition: transform .06s; }
  .main > * { animation: gaka-page-in .18s ease-out; }
}
@keyframes gaka-page-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .main > * { animation: none; } }

/* Account window: Light / Dark / Automatic */
.theme-pick { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.theme-pick .chips { padding: 0; }

/* Search boxes: what this person usually searches for, under the box (public/js/recent-searches.js) */
.recent-searches { position: absolute; z-index: 400; max-width: calc(100vw - 32px); padding: .3rem; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 28px rgb(0 0 0 / .18); }
.recent-head { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: .35rem .55rem .25rem; }
.recent-row { display: flex; align-items: center; border-radius: 8px; }
.recent-row:hover { background: var(--surface-2); }
.recent-term { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; padding: .5rem .55rem; font: inherit; color: var(--text);
  background: none; border: 0; cursor: pointer; text-align: left; }
.recent-ico { color: var(--muted); font-size: .95rem; width: 1rem; text-align: center; }
.recent-x { flex: none; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.05rem; cursor: pointer; }
.recent-x:hover { background: var(--border); color: var(--text); }

/* Account window: GAKA's version, at the bottom */
.app-version { text-align: center; margin: .2rem 0 0; }

/* GAKA's camera (public/js/camera.js): the live picture, then the photo taken */
.cam-frame { border-radius: 12px; overflow: hidden; background: #000; display: grid; place-items: center; }
.cam-video, .cam-shot { display: block; width: 100%; max-height: 62vh; object-fit: contain; }

/* Fuel requisitions: the company vehicle, its odometer reading and photo */
.fuel-box { border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem .8rem; display: grid; gap: .6rem; }
.fuel-box legend { padding: 0 .3rem; font-weight: 600; font-size: .9rem; }
.fuel-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.fuel-row .field { flex: 1 1 10rem; }
.fuel-shot { display: flex; align-items: center; gap: .6rem; }
.fuel-shot img { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; }
.fuel-line { margin-top: .2rem; }

/* Manufacturer cards: one card per manufacturer with its figures (Stock › Bricks received, Loads › By manufacturer) */
.mfr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .8rem; }
.mfr-card { display: grid; gap: .6rem; align-content: start; }
.mfr-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.mfr-top h2 { margin: 0; font-size: 1.05rem; }
.mfr-figures { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.mfr-figures strong { font-size: 1.35rem; }
.mfr-layers { line-height: 1.5; }
.mfr-card .actions { display: flex; gap: .4rem; flex-wrap: wrap; }
/* Loads by manufacturer: the figures in three columns, and the latest loads under them */
.mfr-figures.three { grid-template-columns: repeat(3, 1fr); }
.mfr-figures.three strong { font-size: 1.15rem; }
.mfr-recent { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; font-size: .85rem; }
.mfr-recent li { display: flex; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--border); padding-top: .25rem; }
.mfr-recent a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bricks dispatched (public/js/dispatch-stats.js): today against yesterday per manufacturer, and day by day */
.dispatch-today { display: grid; gap: .8rem; }
.dt-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.dt-head h2 { margin: 0; }
.dt-totals { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; }
.dt-big { font-size: 2rem; font-weight: 800; line-height: 1.05; }
.dt-rows { display: grid; gap: .45rem; }
.dt-row { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) 6rem 7.5rem; align-items: center; gap: .6rem; }
.dt-name { display: flex; align-items: center; gap: .4rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-bar { position: relative; height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.dt-bar-y, .dt-bar-t { position: absolute; left: 0; height: 100%; border-radius: inherit; }
.dt-bar-y { top: 0; background: color-mix(in srgb, var(--muted) 35%, transparent); }
/* today: a thinner bar over yesterday's */
.dt-bar-t { top: 20%; height: 60%; background: linear-gradient(90deg, var(--accent), var(--ok)); }
.dt-num { text-align: right; font-variant-numeric: tabular-nums; }
.dt-chg { text-align: right; font-variant-numeric: tabular-nums; }
.dt-key { margin: 0; }
.dt-swatch { display: inline-block; width: .9rem; height: .55rem; border-radius: 3px; vertical-align: middle; }
.dt-swatch.t { background: linear-gradient(90deg, var(--accent), var(--ok)); }
.dt-swatch.y { background: color-mix(in srgb, var(--muted) 35%, transparent); }
tr.dd-today td { background: var(--accent-soft); }
.dd-share { display: grid; gap: .35rem; margin-top: .9rem; }
.dd-share-row { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr) 4.5rem 3rem; align-items: center; gap: .6rem; }
@media (max-width: 600px) {
  .dt-row { grid-template-columns: minmax(0, 1fr) 4.5rem 5.5rem; }
  .dt-row .dt-bar { grid-column: 1 / -1; grid-row: 2; }
  .dd-share-row { grid-template-columns: minmax(0, 1fr) 4rem 2.5rem; }
  .dd-share-row .dt-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* A PDF opened inside GAKA (public/js/pdf-viewer.js): its pages one under the other, the width of the window */
.pdf-view { display: grid; gap: .7rem; }
.pdf-pages { display: grid; gap: .6rem; justify-items: center; max-height: 75vh; overflow-y: auto; padding: .4rem; border-radius: 8px; background: var(--surface-2); }
.pdf-page { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .2); }
/* The original on a document's or load's page (GAKA 1.129.0): the paper on a soft desk, then what happened to it, folded */
.pdf-sheet { display: grid; gap: 1rem; justify-items: center; margin: .4rem 0 1rem; padding: clamp(.4rem, 2vw, 1.4rem); border-radius: 14px; background: var(--surface-2); min-height: 12rem; }
.pdf-sheet .pdf-page { max-width: 820px; border-radius: 3px; box-shadow: 0 2px 4px rgb(0 0 0 / .18), 0 12px 32px rgb(0 0 0 / .22); }
.pdf-sheet-wait { align-self: center; color: var(--muted); font-size: .9rem; }
.fold { margin-bottom: .6rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.fold > summary { display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem; cursor: pointer; font-weight: 600; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: '›'; display: inline-block; width: 1rem; color: var(--muted); transition: transform .15s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary small { font-weight: 400; color: var(--muted); }
.fold > .card { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.fold > .card > h2:first-child, .fold > .card > .task-top > h2:first-child { display: none; }

/* The sales person's next step after Logistics put the trucks on (public/js/shell.js alertNextStep): stays until acted on */
.next-step-toast { display: grid; gap: .55rem; max-width: min(26rem, calc(100vw - 2rem)); background: var(--surface); color: var(--text); border: 1px solid var(--accent);
  border-left: 4px solid var(--accent); }
.next-step-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* Phones: no bottom menu inside a conversation (public/js/chats.js marks the page "in-chat"), as in WhatsApp */
@media (max-width: 899px) {
  body.in-chat .nav { display: none; }
  body.in-chat .main { padding-bottom: 0; }
}

/* ---------- phones: scrolling like an app (GAKA 1.49.0; the moving parts are in public/js/shell.js appLikeScroll) ---------- */
/* The ↑ button: only on phones, far down a long page */
.to-top { position: fixed; z-index: 19; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
  color: var(--accent); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:active { transform: scale(.92); }
/* Above a floating Save bar or the Home question box, never over their buttons */
body:has(.save-bar, .ai-compose) .to-top { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 5.5rem); }
@media (min-width: 900px) { .to-top { display: none; } }
@media (max-width: 899px) {
  /* Tables show their full length, so the page scrolls as one; inside a table the finger only swipes sideways */
  .page.wide .table-wrap { max-height: none; overflow-y: visible; }
  /* A sideways swipe at the end of a table, tab row or chip row stays there (no browser "back" or page wobble) */
  .table-wrap, .chips, .tabs { overscroll-behavior-x: contain; }
  /* The top bar slides away going down (body.topbar-away) and back going up */
  .topbar { transition: transform .22s ease; will-change: transform; }
  body.topbar-away .topbar { transform: translateY(calc(-100% - env(safe-area-inset-top, 0px))); }
  /* A solid top bar: the see-through blur costs every frame of scrolling on low-cost phones */
  .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
  /* Long lists: the phone skips drawing the rows that are off the screen (their size is remembered once seen) */
  .order-list > .order-row { content-visibility: auto; contain-intrinsic-size: auto 120px; }
  .column > .card.task { content-visibility: auto; contain-intrinsic-size: auto 200px; }
}
@media (max-width: 899px) and (prefers-reduced-motion: reduce) { .topbar, .to-top { transition: none; } }

/* "Never miss a customer: turn on notifications" (public/js/shell.js offerNotifications, GAKA 1.50.0), above the phone menu */
.notify-card { position: fixed; z-index: 120; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  width: min(30rem, calc(100vw - 24px)); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem .8rem; align-items: start;
  padding: .9rem 1rem; border-radius: 16px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-left: 4px solid #25d366; box-shadow: var(--shadow-lg); animation: notify-in .25s ease-out; }
.notify-card-icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; color: #fff; background: #25d366; }
.notify-card-text { display: grid; gap: .15rem; font-size: .9rem; line-height: 1.35; }
.notify-card-text strong { font-size: .98rem; }
.notify-card-actions { grid-column: 2; display: flex; gap: .45rem; flex-wrap: wrap; }
@keyframes notify-in { from { opacity: 0; transform: translate(-50%, 14px); } }
@media (min-width: 900px) { .notify-card { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .notify-card { animation: none; } }

/* ---------- Chat labels (Chats and Customers; public/js/chats/labels.js) ---------- */
.label-tags { display: inline-flex; flex-wrap: wrap; gap: .25rem; margin-right: .35rem; vertical-align: middle; }
.label-tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 600; line-height: 1.4; padding: 0 .45rem; border-radius: 999px;
  color: var(--text); background: color-mix(in srgb, var(--lc) 18%, transparent); border: 1px solid color-mix(in srgb, var(--lc) 45%, transparent); }
.label-tag::before { content: ''; width: .45rem; height: .45rem; border-radius: 50%; background: var(--lc); }
/* A private label: a dashed edge and a small lock, so nobody mistakes it for one the team sees */
.label-tag.private { border-style: dashed; }
.label-tag.private::after { content: '🔒'; font-size: .6rem; opacity: .7; }
/* Group headings in the label windows ("Team labels", "Only you see these", "New label") */
.label-group { margin-top: .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.label-pick { display: grid; gap: .35rem; }
.label-row { align-items: center; padding: .15rem 0; }
.label-new { display: grid; gap: .4rem; padding-top: .6rem; border-top: 1px solid var(--border); }
.label-form { display: grid; gap: .55rem; }
.label-form-row { display: flex; gap: .4rem; align-items: center; }
.label-form-row input { flex: 1; min-width: 0; }
/* The colours: round swatches, the chosen one ringed */
.label-swatches { display: flex; flex-wrap: wrap; gap: .45rem; }
.label-swatch { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--surface); background: var(--lc); cursor: pointer; padding: 0;
  box-shadow: 0 0 0 1px var(--border); transition: transform .12s, box-shadow .12s; }
.label-swatch:hover { transform: scale(1.1); }
.label-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--lc); transform: scale(1.1); }
.label-swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Make or change labels: one row per label */
.label-manage { display: grid; gap: .25rem; }
.label-manage-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem .6rem; border-radius: 10px; background: var(--surface-2); }
.label-manage-row.editing { display: block; }
.label-manage-main { display: grid; gap: .2rem; justify-items: start; min-width: 0; }
.label-manage-actions { display: flex; gap: .35rem; flex: none; }
@media (pointer: coarse) { .label-swatch { width: 2rem; height: 2rem; } }

/* ---------- who is online (GAKA 1.63.0): a green dot for online now, grey otherwise (title: last seen) ---------- */
.pres-dot { display: inline-block; width: .62rem; height: .62rem; border-radius: 50%; background: var(--border-strong, #c4cbd8);
  box-shadow: 0 0 0 2px var(--surface); vertical-align: middle; flex: none; }
.pres-dot.on { background: #22c55e; }
/* On an avatar: the dot sits on its lower right corner */
.pres-wrap { position: relative; }
.pres-wrap > .pres-dot { position: absolute; right: -1px; bottom: -1px; }
.pres-words.on { color: var(--ok); font-weight: 600; }
.pres-inline { white-space: nowrap; }

/* The on/off switch (Claude in Chats; who can pause Claude in Settings, GAKA 1.72.0) */
.claude-switch { flex: none; display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .7rem .3rem .35rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.claude-switch-knob { width: 1.9rem; height: 1.1rem; border-radius: 999px; background: var(--border-strong, #888); position: relative; transition: background .2s; }
.claude-switch-knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: calc(1.1rem - 4px); height: calc(1.1rem - 4px); border-radius: 50%; background: #fff; transition: transform .2s; }
.claude-switch.on { color: var(--text); border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); }
.claude-switch.on .claude-switch-knob { background: var(--ok); }
.claude-switch.on .claude-switch-knob::after { transform: translateX(.8rem); }

/* Truck lines in a form: lay-by collections and paid goods releases (GAKA 1.79.0: shared) */
.extra-truck { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .8rem; border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem; margin: .3rem 0; }
.extra-truck > .task-top { grid-column: 1 / -1; }
.extra-truck label { display: grid; gap: .25rem; }
.extra-trucks { grid-column: 1 / -1; width: 100%; }
.extra-trucks .extra-truck { width: 100%; box-sizing: border-box; }
@media (max-width: 520px) { .extra-truck { grid-template-columns: 1fr; } }

/* ---------- "Are you sure?" beside the button pressed (public/js/ask.js, GAKA 1.82.6) ---------- */
.ask-layer { position: fixed; inset: 0; z-index: 300; background: rgb(10 14 30 / .18); }
.ask-card { position: fixed; width: min(360px, calc(100vw - 24px)); display: grid; gap: .45rem; padding: .95rem 1rem .85rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: 12px;
  box-shadow: 0 18px 48px rgb(0 0 0 / .32); animation: ask-in .14s ease-out; }
.ask-card.risky { border-top-color: var(--danger); }
.ask-title { font-size: 1rem; line-height: 1.35; }
.ask-detail { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; white-space: pre-line; }
.ask-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .35rem; }
/* The little arrow pointing at the button (below the button: on top of the card; above it: at its bottom) */
.ask-arrow { position: absolute; top: -8px; left: calc(var(--arrow, 50%) - 7px); width: 14px; height: 14px; transform: rotate(45deg);
  background: var(--surface); border-left: 1px solid var(--border); border-top: 3px solid var(--accent); }
.ask-card.risky .ask-arrow { border-top-color: var(--danger); }
.ask-card.above .ask-arrow { top: auto; bottom: -8px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
/* Phones: a sheet at the bottom, where the thumb is */
.ask-card.sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; border-radius: 16px 16px 0 0; padding: 1.1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  animation: ask-up .18s ease-out; }
.ask-card.sheet .ask-arrow { display: none; }
.ask-card.sheet .ask-actions .btn { flex: 1; min-height: 44px; }
@keyframes ask-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes ask-up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .ask-card, .ask-card.sheet { animation: none; } }

/* Who created and changed it, under a page title (public/js/record-history.js, GAKA 1.82.0) */
.who-line { margin: .1rem 0 .8rem; }
.ask-input { width: 100%; }
.ask-input.invalid { border-color: var(--danger); }

/* ---------- The period calendar (public/js/ui.js calendarPopover, GAKA 1.84.0) ---------- */
.period-btn { display: inline-flex; align-items: center; gap: .55rem; font: inherit; font-weight: 600; padding: .5rem .8rem; min-height: 40px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.period-btn:hover, .period-btn[aria-expanded="true"] { border-color: var(--accent); }
.period-btn .cal-ic { color: var(--muted); font-size: .95rem; }
.cal-pop { position: fixed; z-index: 70; width: min(340px, calc(100vw - 16px)); display: grid; gap: .55rem; padding: .75rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 48px rgb(0 0 0 / .3); }
.cal-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; padding: .2rem; border-radius: 10px; background: var(--surface-2); }
.cal-tab { font: inherit; font-size: .85rem; font-weight: 600; padding: .4rem 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.cal-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cal-grid { display: grid; gap: .15rem; }
.cal-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: .15rem; border-radius: 8px; }
.cal-names span { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: .2rem 0; }
.cal-names span:first-child, .cal-names span:last-child { color: var(--accent); }
.cal-day, .cal-month { display: grid; place-items: center; padding: 0; font: inherit; font-variant-numeric: tabular-nums; aspect-ratio: 1; min-height: 38px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; }
.cal-month { aspect-ratio: auto; padding: .7rem 0; }
.cal-day.other { color: var(--muted); opacity: .55; }
.cal-day:hover, .cal-month:hover, .cal-row.pick-week:hover .cal-day { background: var(--surface-2); }
.cal-day.today, .cal-month.today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 700; }
.cal-day.chosen, .cal-month.chosen, .cal-row.chosen .cal-day { background: var(--accent); color: #fff; font-weight: 700; opacity: 1; }
.cal-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; }
.cal-foot { display: flex; justify-content: space-between; gap: .3rem; border-top: 1px solid var(--border); padding-top: .45rem; }

/* "This looks like load #…": the same sale sent again can replace the old job (GAKA 1.86.1) */
.repeat-replace { padding: .5rem .7rem; border-radius: 10px; border-left: 4px solid var(--warn, #d97706); background: color-mix(in srgb, var(--warn, #d97706) 10%, transparent); }
.repeat-replace p { margin: 0; }

/* Where a document line's bricks come from, under its product (GAKA 1.86.2) */
.ed-mfr { color: var(--muted); font-size: .8rem; }
.ed-mfr strong { color: var(--text); }

/* A document on a phone (GAKA 1.86.2, the CEO's screenshot of INV-00101): the Amount column ran off the page. The fixed
   8rem total column and the wide header lettering are relaxed so all four columns fit at 360-400 px. */
@media (max-width: 600px) {
  .p-items { font-size: .82rem; table-layout: auto; }
  .p-items th { font-size: .62rem; letter-spacing: .02em; }
  .p-items td, .p-items th { padding: .45rem .2rem; }
  .p-items td.num, .p-items th.num { white-space: nowrap; }
  .p-items tfoot td.num { width: auto; }
  .p-items .p-total td { font-size: .95rem; }
}

/* Pop-ups (GAKA 1.86.6): × on each, swipe away, Clear all and +N more; on a computer bottom-right and smaller */
.toast { position: relative; padding-right: 2rem; touch-action: pan-y; user-select: none; }
.toast-x { position: absolute; top: .3rem; right: .35rem; border: 0; background: none; color: inherit; opacity: .6; font-size: 1.15rem; line-height: 1;
  cursor: pointer; padding: .15rem .3rem; border-radius: 6px; }
.toast-x:hover { opacity: 1; background: rgb(127 127 127 / .18); }
.toast-tools { display: flex; gap: .4rem; justify-content: flex-end; pointer-events: auto; order: -1; }
.toast-tools:empty { display: none; }
.toast-tool { font: inherit; font-size: .78rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; box-shadow: 0 2px 8px rgb(0 0 0 / .18); }
@media (min-width: 900px) {
  .toasts { left: auto; right: 18px; transform: none; width: min(380px, 40vw); justify-items: stretch; }
  .toast { font-size: .86rem; padding: .55rem 2rem .55rem .8rem; }
}

/* Recovery codes (GAKA 1.87.0): two columns of codes, easy to read and copy by hand */
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1.5rem; padding-left: 1.6rem; margin: .2rem 0; }
.recovery-codes code { font-size: 1.05rem; letter-spacing: .06em; font-weight: 600; }

/* Long drop-downs as a box to type in, everywhere (GAKA 1.88.2): in toolbars and filters they keep a usable width */
.toolbar .pickbox, .filters .pickbox, .chips + .pickbox { min-width: 13rem; flex: 0 1 18rem; }
td .pickbox { min-width: 10rem; }

/* ---------- Fitting every screen (GAKA 1.88.7, the CEO 17 November 2026: "fitting well on all screens") ---------- */
/* A long word in a figure tile ("COMMUNICATION") breaks inside the tile instead of running past it */
.stat { min-width: 0; }
.stat strong, .stat small, .stat span { overflow-wrap: anywhere; }
/* Orders to prepare: the card and its blocks never wider than a small phone; long places break */
.prep-card, .prep-card > *, .prep-grid > * { min-width: 0; }
.prep-grid { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); }
.prep-card a, .prep-card .note { overflow-wrap: anywhere; }
.prep-card .task-actions { flex-wrap: wrap; }
/* Delivery schedule on a phone: the date and the buttons on top, the customer across, the truck and sales person under */
@media (max-width: 999px) {
  .order-row.sched-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id status" "cust cust" "total qty"; }
  .sched-row .o-total { text-align: left; font-weight: 500; }
  .sched-row .o-qty { text-align: right; }
}
/* The Documents list on phones: who made it and who changed it wrap, never cut */
@media (max-width: 999px) { .doc-row .doc-who > span { white-space: normal; overflow: visible; } }
/* GAKA 1.88.7: on a phone a schedule row's truck wraps rather than being cut */
@media (max-width: 999px) { .sched-row .o-total.ellipsis { white-space: normal; overflow: visible; overflow-wrap: anywhere; } }
@media (max-width: 999px) { .sched-row:has(.o-qty:empty) .o-total { grid-column: 1 / -1; } }

/* "Powered by GAKA" under the sign-in form of a renamed installation (GAKA 1.101.0) */
.powered-by { margin: .2rem 0 0; text-align: center; font-size: .75rem; color: var(--muted); letter-spacing: .02em; }

/* Other products on the same truck (GAKA 1.108.0): one row per product under the quantity. The row wraps, so on a phone
   the product takes its own line and the bricks and price share the next */
.mix-field { display: grid; gap: .45rem; }
.mix-rows { display: grid; gap: .45rem; }
.mix-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .5rem; border: 1px dashed var(--line, #d9dde6); border-radius: 10px; }
.mix-row select, .mix-row > div { flex: 2 1 240px; min-width: 0; }
.mix-row input { flex: 1 1 110px; min-width: 0; }
.mix-row .icon-btn { flex: 0 0 auto; }
.mix-row input[placeholder^="Buying"], .mix-row .mix-note { flex-basis: 100%; }
.mix-add { justify-self: start; }

/* One customer, one sales person (GAKA 1.124.0): held loads and what management decide */
.held-load { border-color: var(--danger, #d93025); }
.held-row { display: grid; gap: .5rem; padding: .7rem 0; border-top: 1px solid var(--line, rgb(128 128 128 / .25)); }
.held-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .6rem; }
.held-side { padding: .6rem .8rem; border-radius: 10px; background: var(--surface-2, rgb(128 128 128 / .1)); }
.owner-line { margin: -.2rem 0 .6rem; }
/* The bottom bar steps aside while the Account or GAKA Update window shows the same Update now (GAKA 1.132.0) */
body:has(.upd-line) .update-bar, body:has(.upd-page) .update-bar { display: none; }
.upd-latest .upd-list li span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* Import contacts (GAKA 1.134.0) */
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.imp { display: grid; gap: 1rem; }
.imp > p { margin: 0; }
.imp-tiles { display: grid; gap: .6rem; }
.imp-tile { display: flex; align-items: center; gap: .9rem; width: 100%; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.imp-tile:hover:not(:disabled) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.imp-tile:active:not(:disabled) { transform: scale(.99); }
.imp-tile:disabled { opacity: .55; cursor: not-allowed; }
.imp-ic { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.imp-ic.wa { background: color-mix(in srgb, #25d366 18%, transparent); color: #1faa55; }
.imp-words { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.imp-words small { color: var(--muted); font-size: .84rem; }
.imp-go { flex: none; color: var(--muted); font-size: 1.4rem; line-height: 1; }
.imp-wa { display: flex; gap: .9rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 14px; background: var(--surface-2, var(--surface)); }
.imp-how summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.imp-how ul { margin: .5rem 0 0; padding-left: 1.2rem; display: grid; gap: .35rem; font-size: .9rem; }
.imp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.imp-sum { display: flex; flex-wrap: wrap; gap: .4rem; }
.imp-pill { padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.imp-pill.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.imp-pill.have { background: var(--surface-2, var(--surface)); color: var(--muted); }
.imp-pill.bad { background: color-mix(in srgb, var(--danger, #d33) 14%, transparent); color: var(--danger, #d33); }
.imp-all { display: flex; align-items: center; gap: .4rem; font-size: .9rem; cursor: pointer; }
.imp-cols, .imp-row { display: grid; grid-template-columns: 1.6rem minmax(9rem, 1.3fr) minmax(8rem, 1fr) minmax(7rem, 1fr) minmax(10rem, 1.3fr); gap: .5rem; align-items: center; }
.imp-cols { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 .5rem; }
.imp-list { display: grid; gap: .35rem; max-height: min(55vh, 520px); overflow-y: auto; padding-right: .2rem; }
.imp-row { padding: .35rem .5rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.imp-row input[type=text] { width: 100%; min-width: 0; }
.imp-row.muted-row { opacity: .7; }
.imp-row.bad-row { border-color: color-mix(in srgb, var(--danger, #d33) 50%, var(--border)); }
.imp-state { font-size: .8rem; line-height: 1.3; }
.imp-state.ok { color: var(--muted); font-variant-numeric: tabular-nums; }
.imp-state.have { color: var(--muted); }
.imp-state.bad { color: var(--danger, #d33); }
.imp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.imp-done { display: grid; justify-items: center; gap: .5rem; text-align: center; padding: 1rem 0; }
.imp-done h3 { margin: 0; font-size: 1.3rem; }
.imp-done p { margin: 0; }
.imp-done-ic { display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--ok); color: #fff; font-size: 1.7rem; font-weight: 800; box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok) 16%, transparent); }
.imp-skipped { width: 100%; text-align: left; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2, var(--surface)); }
.imp-skipped ul { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .88rem; color: var(--muted); max-height: 30vh; overflow-y: auto; }
.imp-done .imp-foot { width: 100%; justify-content: center; }
.msg-add-contact { margin-top: .4rem; }
@media (max-width: 700px) {
  .imp-cols { display: none; }
  .imp-row { grid-template-columns: 1.6rem 1fr 1fr; grid-template-areas: 'box name name' 'box phone place' 'box state state'; }
  .imp-row > input[type=checkbox] { grid-area: box; align-self: start; margin-top: .6rem; }
  .imp-row > [name=imp_name] { grid-area: name; }
  .imp-row > [name=imp_phone] { grid-area: phone; }
  .imp-row > [name=imp_place] { grid-area: place; }
  .imp-row > .imp-state { grid-area: state; }
}
.imp-all { white-space: nowrap; flex-direction: row; }
.imp-all input, .imp-row > input[type=checkbox] { width: auto; flex: none; margin: 0; }
/* Costs for other sales (GAKA 1.135.0) */
.src { display: grid; gap: 1rem; }
.src-top { display: grid; grid-template-columns: 1fr 1fr auto; gap: .8rem; align-items: center; }
.src-usual { display: grid; gap: .1rem; padding: .7rem .9rem; border-radius: 12px; background: var(--surface-2, var(--surface)); }
.src-usual strong { font-size: 1.15rem; }
.src-list { display: grid; gap: .5rem; }
.src-card { display: grid; grid-template-columns: 1fr auto auto; gap: .9rem; align-items: center; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.src-card.latest { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 12%, transparent); }
.src-card.off { opacity: .6; }
.src-main { display: grid; gap: .15rem; min-width: 0; }
.src-name { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.src-tag { font-size: .7rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.src-tag.off { background: var(--surface-2, var(--surface)); color: var(--muted); }
.src-cost { display: grid; justify-items: end; text-align: right; gap: .05rem; }
.src-cost strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.src-far { color: var(--warn, #b7791f); font-weight: 600; }
.src-btns { display: flex; gap: .3rem; }
.src-empty { margin: 0; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2, var(--surface)); }
.src-jobs h3 { margin: 0 0 .4rem; font-size: .95rem; }
.src-job-list { display: grid; gap: .2rem; }
.src-job { display: grid; grid-template-columns: 4.5rem 6.5rem 1fr 1fr auto; gap: .6rem; align-items: center; padding: .35rem .5rem; border-radius: 8px; color: inherit; text-decoration: none; font-size: .9rem; }
.src-job:hover { background: var(--surface-2, var(--surface)); }
.src-job strong { font-variant-numeric: tabular-nums; }
.src-hist { display: grid; gap: .5rem; }
.src-hist-row { display: grid; gap: .1rem; padding: .5rem .7rem; border-radius: 10px; background: var(--surface-2, var(--surface)); }
.src-guide { display: grid; gap: .35rem; padding: .7rem .9rem; border-radius: 12px; background: var(--surface-2, var(--surface)); }
.src-guide-row { display: flex; justify-content: space-between; gap: 1rem; }
.src-warn { margin: .2rem 0 0; padding: .45rem .6rem; border-radius: 8px; background: color-mix(in srgb, var(--warn, #b7791f) 14%, transparent); color: var(--warn, #b7791f); font-weight: 600; }
.deliv-tag { font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.job-cost { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.cost-todo { font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--warn, #b7791f) 16%, transparent); color: var(--warn, #b7791f); }
@media (max-width: 700px) {
  .src-top { grid-template-columns: 1fr 1fr; }
  .src-top .btn { grid-column: 1 / -1; }
  .src-card { grid-template-columns: 1fr auto; }
  .src-btns { grid-column: 1 / -1; }
  .src-job { grid-template-columns: 4rem 1fr auto; }
  .src-job > :nth-child(2), .src-job > :nth-child(4) { display: none; }
}
.cost-confirm { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; border-left: 4px solid var(--warn, #b7791f); }
.cost-confirm h2 { margin: 0 0 .2rem; }
.cost-confirm p { margin: 0; max-width: 46rem; }
/* Share our catalogue (GAKA 1.136.0) */
.cs { display: grid; gap: .9rem; }
.cs-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.cs-top input[type=search] { flex: 1 1 14rem; min-width: 0; }
.cs-toggle { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.cs-toggle input { width: auto; margin: 0; }
.cs-count { margin-left: auto; color: var(--muted); font-size: .88rem; }
.cs-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: 1rem; align-items: start; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; max-height: min(60vh, 560px); overflow-y: auto; padding-right: .2rem; }
.cs-item { display: grid; grid-template-columns: auto 3rem 1fr; grid-template-areas: 'box pic words' 'box pic price'; align-items: center; column-gap: .6rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.cs-item.on { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.cs-item > input[type=checkbox] { grid-area: box; width: auto; margin: 0; }
.cs-pic { grid-area: pic; width: 3rem; height: 3rem; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2, var(--surface)); color: var(--muted); font-weight: 800; }
.cs-pic img { width: 100%; height: 100%; object-fit: cover; }
.cs-words { grid-area: words; display: grid; min-width: 0; }
.cs-words strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-words small { font-size: .8rem; }
.cs-special { grid-area: price; width: 100%; margin-top: .3rem; padding: .25rem .5rem; font-size: .85rem; }
.cs-side { display: grid; gap: .8rem; position: sticky; top: 0; }
.cs-preview { display: grid; gap: .4rem; }
.cs-card { display: grid; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: color-mix(in srgb, #25d366 7%, var(--surface)); }
.cs-card-img { aspect-ratio: 1.91 / 1; background: var(--surface-2, var(--surface)); display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.cs-card-img img { width: 100%; height: 100%; object-fit: cover; }
.cs-card-text { display: grid; gap: .2rem; padding: .6rem .75rem; }
.cs-card-text span { font-size: .85rem; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cs-card-text small { color: var(--muted); font-size: .75rem; }
.cs-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.cs-actions .btn.primary { grid-column: 1 / -1; }
.cs-actions .cs-wa { color: #1faa55; border-color: color-mix(in srgb, #25d366 50%, var(--border)); }
@media (max-width: 760px) {
  .cs-body { grid-template-columns: 1fr; }
  .cs-side { position: static; }
  .cs-grid { max-height: 45vh; }
}
/* Status pictures with their captions (GAKA 1.143.0): picture, caption to paste, Copy and Share */
.st-win { display: grid; gap: .75rem; }
.st-win > .btn { justify-self: start; }
.st-row { display: grid; grid-template-columns: 96px 1fr; gap: .8rem; align-items: start; padding: .7rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.st-pic { width: 96px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.st-body { display: grid; gap: .45rem; min-width: 0; }
.st-caption { margin: 0; padding: .55rem .7rem; border-radius: 10px; background: var(--surface); border: 1px dashed var(--border); font-family: inherit; font-size: .85rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.st-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
@media (max-width: 480px) { .st-row { grid-template-columns: 72px 1fr; } .st-pic { width: 72px; } }

/* A tick box's label stays beside the box when it wraps (GAKA 1.137.0) */
.check > span { flex: 1 1 0; min-width: 0; }
.check > input[type=checkbox] { align-self: flex-start; margin-top: .2rem; }
/* Receipts one tap away (GAKA 1.138.0) */
.rcpt-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; padding: .7rem .9rem; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border)); background: color-mix(in srgb, var(--ok) 6%, var(--surface)); }
.rcpt-title { font-weight: 700; font-size: .9rem; }
.rcpt-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.rcpt-chip { display: inline-flex; align-items: baseline; gap: .45rem; padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; transition: border-color .15s, background .15s; }
.rcpt-chip:hover { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); }
.rcpt-chip span { font-variant-numeric: tabular-nums; }
.rcpt-chip small { color: var(--muted); }

/* When it was made and changed, in Documents (GAKA 1.139.0) */
.doc-when { font-variant-numeric: tabular-nums; opacity: .9; }

/* Price guidance (GAKA 1.155.0): the usual prices for a product under its price, and a flag when a price stands out */
.price-guide { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; margin-top: .4rem; padding: .45rem .6rem; border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 7%, transparent); font-size: .82rem; line-height: 1.4; }
.price-guide.flagged { background: color-mix(in srgb, var(--copper, #d08a3c) 10%, transparent); }
.price-guide.compact { display: block; padding: .3rem .45rem; font-size: .74rem; }
.price-guide.compact > span { display: block; }
.pg-flag { font-weight: 700; padding: .05rem .45rem; border-radius: 999px; }
.pg-flag.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pg-flag.warn { color: var(--copper, #d08a3c); background: color-mix(in srgb, var(--copper, #d08a3c) 18%, transparent); }
.pg-flag.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 15%, transparent); }
.price-guide.compact .pg-flag { display: inline-block; margin-bottom: .15rem; }
.pg-margin.neg strong { color: var(--danger); }
