/*
 * The business app. A menu down the left; each page has a top bar with its
 * title and its main actions on the right, and its content below in cards.
 * One blue for actions; status in soft coloured labels. Light and dark.
 */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/instrument-sans-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: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/fonts/instrument-sans-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/plex-mono-400-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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/plex-mono-400-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/plex-mono-500-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;
}

:root {
  color-scheme: light;
  --ground: #f3f4f1;
  --surface: #ffffff;
  --side: #fbfbf9;
  --field: #ffffff;
  --ink: #16202a;
  --ink-2: #34403c;
  --muted: #5e6a66;
  --line: #e1e4df;
  --line-strong: #cfd4cd;
  --hover: #eef0ec;
  --accent: #1f4f8a;
  --accent-hover: #163b68;
  --accent-soft: #e4ebf4;
  --accent-ink: #16395f;
  --on-accent: #ffffff;
  --error: #a3231b;
  --warn-bg: #fcefd8;
  --warn-ink: #7e4b00;
  --warn-line: #f0d6a8;
  --ok-bg: #e1f0e2;
  --ok-ink: #236628;
  --neutral-bg: #eeefec;
  --neutral-ink: #4b5753;
  --void-bg: #fbe7e5;
  --void-ink: #9a2119;
  --font: 'Instrument Sans', system-ui, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #111517;
    --surface: #1a1f22;
    --side: #151a1c;
    --field: #13181a;
    --ink: #e6e9e7;
    --ink-2: #c9cfcc;
    --muted: #9ca6a2;
    --line: #2c3336;
    --line-strong: #3c4549;
    --hover: #222a2d;
    --accent: #8ab4f0;
    --accent-hover: #a9c8f4;
    --accent-soft: #1e2b3b;
    --accent-ink: #bfd6f7;
    --on-accent: #0e1a2b;
    --error: #f08a80;
    --warn-bg: #3a2a10;
    --warn-ink: #f5d9a8;
    --warn-line: #6b4d1c;
    --ok-bg: #1c2e1d;
    --ok-ink: #a6d8a9;
    --neutral-bg: #262d30;
    --neutral-ink: #c3cac7;
    --void-bg: #3a1d1b;
    --void-ink: #f2a79f;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; }
h2 { font-size: 17px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 700; margin: 16px 0 8px; }
p { margin: 0 0 10px; }

/* ------------------------------------------------------------ the shell */

.shell { display: flex; min-height: 100vh; }
.side {
  width: 236px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px 14px;
  background: var(--side);
  border-right: 1px solid var(--line);
}
.biz { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.biz-mark {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px;
}
.biz-name { display: flex; flex-direction: column; min-width: 0; }
.biz-name strong { font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.biz-name button.link { font-size: 12.5px; color: var(--muted); font-weight: 500; text-align: left; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--ink-2); font-size: 15px; font-weight: 500;
}
.nav:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.side .grow { flex-grow: 1; min-height: 16px; }
.me { display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 0; margin-top: 8px; border-top: 1px solid var(--line); font-size: 14px; }
.me > * { align-self: flex-start; }
.me a { color: var(--ink-2); font-weight: 500; }
/* Who is signed in; their own settings are the "Your account" link under it, beside Sign out. */
.me-name { color: var(--muted); }
.me-links { display: flex; gap: 16px; align-items: baseline; }
.me button.link { color: var(--muted); font-weight: 500; font-size: 14px; text-align: left; }

.work { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.banner { margin: 0; padding: 10px 32px; background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid var(--warn-line); }
/* A demo business (src/control/demo.js): said on every page, in the app's own blue. */
.demo-banner { background: var(--accent-soft); color: var(--accent-ink); border-bottom-color: var(--line); }
.notice { margin: 0; padding: 10px 32px; background: var(--accent-soft); color: var(--accent-ink); border-bottom: 1px solid var(--line); }
/* A support visit (support.js): who, until when, and why, on every page. */
.support-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.support-banner span { flex: 1 1 320px; }
.support-banner button { margin: 0; }
.support-about { padding: 0 16px 12px; }
tr.support-opened td { background: var(--side); }
tr.support-opened ol { margin: 0; padding-left: 20px; font-variant-numeric: tabular-nums; }

/* A page: the top bar, then the content. */
.top {
  position: sticky; top: 0; z-index: 5;
  min-height: 64px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  padding: 12px 32px;
  background: var(--side); border-bottom: 1px solid var(--line);
}
.top h1 { margin: 0; font-size: 20px; }
.top .crumb { font-size: 14.5px; color: var(--muted); }
.top .crumb-sep { color: var(--line-strong); }
.top .grow { flex-grow: 1; }
.top .actions { flex-wrap: nowrap; }
.content { padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.content > * { margin-top: 0; margin-bottom: 0; }

/* Pages without the menu: signing in, links, choosing a business. */
body.plain .shell { display: block; }
body.plain #view {
  max-width: 460px; margin: 8vh auto 40px; padding: 28px 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
body.plain #view form { max-width: none; }
/* "Your clients" (clients.js): on its own, but wide, for a table. */
body.plain.wide #view { max-width: 1160px; margin: 32px auto 48px; display: flex; flex-direction: column; gap: 18px; }
body.plain.wide #view form.narrow-card { max-width: 620px; }
.clients-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.clients-head h1 { margin: 0 0 4px; }
.table-filter { padding: 14px 16px 6px; }
td.wrap { overflow-wrap: anywhere; min-width: 12em; }
td.when { white-space: nowrap; }
ul.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* The owner's choice whether their accountant may see their books, and the
   business's choice of document layout. */
fieldset.consent, fieldset.layout-choice { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 6px 0 16px; }
fieldset.consent legend, fieldset.layout-choice legend { font-weight: 600; padding: 0 6px; }
fieldset.consent label.check, fieldset.layout-choice label.check { align-items: flex-start; margin: 8px 0; }
.layout-about { display: block; color: var(--muted); font-size: 13.5px; font-weight: 400; }
.layout-in-use { margin: 0 0 4px; }
.look-sub { margin: 28px 0 10px; font-size: 15px; }
/* How documents look: the settings, and a live sample beside them on a wide
   screen, under them on a narrow one. */
.look-layout { display: grid; grid-template-columns: minmax(0, 640px) minmax(320px, 1fr); gap: 24px; align-items: start; }
.look-settings { display: grid; gap: 24px; min-width: 0; }
.doc-preview-card { position: sticky; top: 16px; min-width: 0; }
.doc-preview { position: relative; overflow: hidden; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f3f4f6; }
/* Drawn at a document's own width, then scaled to fit (documentPreview). */
.doc-preview-frame { position: absolute; top: 0; left: 0; width: 940px; border: 0; transform-origin: 0 0; pointer-events: none; }
/* Narrow: one column, the sample straight after the choices it shows. */
@media (max-width: 1000px) {
  .look-layout { grid-template-columns: minmax(0, 1fr); }
  .look-settings { display: contents; }
  .look-settings > * { max-width: 640px; }
  .look-settings > :last-child { order: 3; }
  .doc-preview-card { position: static; max-width: 640px; order: 2; }
}

/* --------------------------------------------------------------- pieces */

.card, fieldset, .panel, .table-wrap {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.card { padding: 20px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
fieldset { margin: 0; padding: 18px 20px 20px; min-width: 0; }
legend { float: left; width: 100%; padding: 0; margin: 0 0 14px; font-size: 16px; font-weight: 700; }
legend + * { clear: both; }
.panel { padding: 16px 20px; border-color: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); max-width: 760px; }
/* A document's PDF, to drag into a WhatsApp Web chat or an email (public/app/documents.js, sharePanel). */
.pdf-drag { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin: 12px 0 4px; padding: 10px 14px; border: 1px dashed var(--accent); border-radius: 8px; background: var(--accent-soft); cursor: grab; user-select: none; }
.pdf-drag:active { cursor: grabbing; }
.panel h2 { margin-top: 0; }

.hint { color: var(--muted); font-size: 13.5px; margin: 2px 0 0; }
.error { color: var(--error); font-size: 13.5px; margin: 2px 0 0; }
.error:empty { display: none; }
.warn { color: var(--error); font-weight: 600; }
/* An unlock code to read out to a till. */
.unlock-code { margin-top: 8px; white-space: normal; text-align: left; }
.unlock-code .code { font-size: 28px; letter-spacing: 0.12em; margin: 6px 0; }
/* None left in stock, or fewer than none. */
.nil-stock { color: var(--error); font-weight: 600; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.form-errors:empty { display: none; }
.form-errors { color: var(--error); background: var(--void-bg); border: 1px solid var(--void-ink); border-radius: 8px; padding: 6px 14px; margin: 0 0 14px; }
.form-errors ul { margin: 4px 0; padding-left: 18px; }

/* Buttons: blue for the main action, outlined for the others. */
button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; margin: 0;
  font: 600 14px/1 var(--font); white-space: nowrap;
  color: var(--on-accent); background: var(--accent);
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  text-decoration: none;
}
button:hover, a.button:hover { background: var(--accent-hover); color: var(--on-accent); text-decoration: none; }
button:disabled { opacity: 0.55; cursor: default; }
/* The one action that ends something: cancelling the subscription (billing.js). */
button.danger { background: #b91c1c; }
button.danger:hover { background: #991b1b; }
.cancel-card > summary { cursor: pointer; list-style: none; }
.cancel-card > summary::-webkit-details-marker { display: none; }
.cancel-card > summary h2::after { content: ' ▾'; font-size: 14px; color: var(--muted); }
.cancel-card[open] > summary h2::after { content: ' ▴'; }
/* Busy (public/shared/busy.js): waiting on the server, a circle turning beside its words. */
button[aria-busy="true"]:disabled { opacity: 1; cursor: progress; }
.spinner {
  width: 14px; height: 14px; flex: none; box-sizing: border-box;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
button.secondary, a.button.secondary { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
button.secondary:hover, a.button.secondary:hover { background: var(--hover); color: var(--ink); }
button.link { height: auto; padding: 0; background: none; border: 0; color: var(--accent); font-weight: 600; }
button.link:hover { background: none; color: var(--accent-hover); text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.card .actions:not(:last-child), form .actions:not(:last-child) { margin-bottom: 16px; }

/* Fields. */
form { max-width: none; }
form.narrow, section.narrow { max-width: 560px; }
label { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink-2); margin: 0 0 6px; }
input, textarea, select {
  width: 100%; height: 40px; padding: 0 12px;
  font: 15px var(--font); color: var(--ink);
  background: var(--field); border: 1px solid var(--line-strong); border-radius: 8px;
}
textarea { height: auto; padding: 9px 12px; line-height: 1.45; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, textarea:disabled, select:disabled { opacity: 0.7; background: var(--hover); }
input[type=checkbox], input[type=radio] { width: auto; height: auto; accent-color: var(--accent); }
input[type=color] { width: 4.5em; height: 40px; padding: 3px; }
input[type=file] { height: auto; padding: 7px; }
input[type=search] { -webkit-appearance: none; }
input.short { width: 7em; }
.field { margin-bottom: 14px; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 14.5px; color: var(--ink); margin: 6px 0 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Tables. In a card, with quiet header and row lines. */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 16px; vertical-align: top; }
th { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--side); border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.mono { font-family: var(--mono); font-size: 13px; white-space: nowrap; color: var(--muted); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--hover); }
tr.voided td { color: var(--muted); text-decoration: line-through; }
td.row-actions { white-space: nowrap; }
td.row-actions button + button { margin-left: 6px; }
td button { margin-top: 0; }

/* Status labels. */
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral-ink); }
.chip.issued, .chip.pay-due, .chip.import-new { background: var(--accent-soft); color: var(--accent-ink); }
.chip.void, .chip.import-problem { background: var(--void-bg); color: var(--void-ink); }
.chip.pay-part_paid, .chip.import-update { background: var(--warn-bg); color: var(--warn-ink); }
.chip.pay-paid, .chip.shopify { background: var(--ok-bg); color: var(--ok-ink); }
.chip.pay-written_off { background: var(--void-bg); color: var(--void-ink); }
.chip.shopify { height: 20px; font-size: 11px; padding: 0 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Tabs: pills with counts (documents), or underlined (settings). */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.tab { height: 36px; padding: 0 14px; color: var(--ink-2); background: transparent; border: 1px solid transparent; }
.tab:hover { background: var(--hover); color: var(--ink); }
.tab.active { color: var(--surface); background: var(--ink); }
.tab .count { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral-ink); }
.tab.active .count { background: var(--ink-2); color: var(--surface); }
.subtabs { display: flex; flex-wrap: wrap; gap: 0 22px; padding: 0 32px; background: var(--side); border-bottom: 1px solid var(--line); }
.subtabs a { padding: 12px 2px; font-size: 15px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.subtabs a:hover { color: var(--ink); text-decoration: none; }
.subtabs a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* Facts about one thing: label, value. */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 500; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.filters input[type=search] { flex: 1 1 280px; width: auto; }
.filters select { width: auto; min-width: 12em; }
.filters label.check { margin: 0; }
/* Signing on screen: a white box the width of its card, three times as wide as it is high. */
.signature-box { display: grid; gap: 4px; justify-items: start; }
.signature-pad { width: 100%; max-width: 600px; height: auto; aspect-ratio: 3 / 1; border: 1px dashed var(--line); border-radius: 8px; background: #ffffff; touch-action: none; cursor: crosshair; }
.signature-shown { display: block; width: 100%; max-width: 300px; height: auto; border-bottom: 1px solid var(--line); }

/* The laundry board: a column for each stage, a card for each ticket. */
.laundry-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: start; }
.laundry-column { display: grid; gap: 8px; }
.laundry-column h2 { font-size: 14px; margin: 0; }
.laundry-card { display: grid; gap: 4px; padding: 12px; }
.laundry-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* The kitchen screen: a card for each order, the first in first. */
.kitchen-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; align-items: start; margin-bottom: 24px; }
.kitchen-order { display: grid; gap: 8px; padding: 14px 16px; justify-items: start; }
.kitchen-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; font-size: 17px; }
.kitchen-lines { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 16px; }
/* Courses held for the waiter to fire: there to plan, not yet to make. */
.kitchen-board.held .kitchen-order { color: var(--muted); }
/* An extra's categories, ticked, in columns. */
.check-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr)); gap: 0 16px; }
.check-columns label.check { margin: 4px 0; }

/* Staff commission: a person's own rates set in under theirs, and under them in the report. */
.indent { padding-left: 24px; }
.commission-person { display: grid; gap: 6px; padding-block: 10px; border-top: 1px solid var(--line); }
.commission-person:first-child { border-top: 0; }
.commission-person > .link { justify-self: start; }

/* The bookings diary: hours down the side, a column for each person or thing, bookings placed by time. */
.diary-nav input[type=date] { width: auto; }
.diary-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin: 12px 0; }
.diary { display: grid; min-width: min-content; }
.diary-head { position: sticky; top: 0; padding: 10px 12px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); background: var(--surface); }
.diary-hour { box-sizing: border-box; padding: 2px 8px 0 0; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.diary-col { position: relative; border-left: 1px solid var(--line); cursor: pointer;
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 72px); }
.diary-booking { position: absolute; left: 4px; right: 4px; box-sizing: border-box; display: flex; flex-direction: column; gap: 1px; overflow: hidden;
  padding: 4px 8px; border-radius: 8px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; line-height: 1.3; text-decoration: none; cursor: pointer; }
.diary-booking.short { flex-direction: row; align-items: baseline; gap: 6px; white-space: nowrap; }
.diary-booking.short > * { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.diary-booking:hover { text-decoration: none; filter: brightness(0.97); }
.diary-booking.done { border-left-color: var(--ok-ink); background: var(--ok-bg); color: var(--ok-ink); }
/* A line of one's own on a service contract: the description takes the room. */
.own-line { margin-top: 10px; }
.own-line input:not(.short) { flex: 1 1 260px; width: auto; }
.search-box { position: relative; }

.suggestions { list-style: none; padding: 0; margin: 6px 0 0; }
.suggestions:empty { display: none; }
.suggestions li { padding: 0; }
.suggestions li + li { border-top: 1px solid var(--hover); }
.suggestions { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.suggestions li > button.link, .suggestions li.product-match { padding: 9px 12px; }
.suggestions li > button.link { display: flex; width: 100%; justify-content: flex-start; color: var(--ink); font-weight: 500; text-align: left; white-space: normal; }
.suggestions li > button.link:hover { background: var(--hover); text-decoration: none; }
.suggestions li.hint { padding: 9px 12px; }
li.product-match { display: flex; gap: 12px; align-items: center; }
li.product-match button.link { color: var(--ink); font-weight: 500; text-align: left; white-space: normal; }

/* Product pictures. */
img.product-pic { display: block; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
img.product-pic.small { width: 40px; height: 40px; padding: 2px; }
img.product-pic.large { width: 140px; height: 140px; padding: 6px; }
th.pic, td.pic { width: 56px; padding-right: 0; }

/* ----------------------------------------------------------------- home */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; }
.kpi .label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .sub { font-size: 13.5px; color: var(--muted); }
.kpi.warn { border-color: var(--warn-line); }
.kpi.warn .label, .kpi.warn .value { color: var(--warn-ink); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.attn { display: flex; flex-direction: column; margin: 0 -20px -8px; }
.attn-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--hover); }
.attn-row .what { flex-grow: 1; font-size: 14.5px; }
.attn-row button, .attn-row a.button { height: 34px; padding: 0 12px; font-size: 13.5px; }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick a.button { height: 44px; }
.status-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--ok-ink); flex-shrink: 0; }
.status-dot.busy { background: var(--accent); }
.status-dot.bad { background: var(--error); }

/* The setup checklist on Home (public/app/setup.js). */
.setup { border-color: var(--accent-soft); }
.setup-bar { height: 6px; border-radius: 999px; background: var(--neutral-bg); overflow: hidden; margin: 0 0 6px; }
.setup-bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.setup-list { list-style: none; margin: 0 -20px; padding: 0; }
.setup-step { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 11px 20px; border-top: 1px solid var(--hover); }
.setup-list .setup-step:first-child { border-top: 0; }
.setup-mark { width: 24px; height: 24px; border-radius: 999px; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.setup-mark .ico { width: 16px; height: 16px; stroke-width: 2.4; }
.setup-step.done .setup-mark { background: var(--ok-bg); border-color: var(--ok-ink); color: var(--ok-ink); }
.setup-step.skipped .setup-mark { border-style: dashed; }
.setup-what { display: flex; flex-direction: column; min-width: 0; }
.setup-what button.link { font-size: inherit; }
.setup-step.done .setup-what strong, .setup-step.skipped .setup-what strong { color: var(--muted); font-weight: 600; }
.setup-do { display: flex; align-items: center; gap: 14px; }
.setup-do a.button { height: 34px; padding: 0 12px; font-size: 13.5px; }
.setup-foot { margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--hover); }
@media (max-width: 720px) {
  .setup-step { grid-template-columns: 24px minmax(0, 1fr); align-items: start; }
  .setup-do { grid-column: 2; padding-top: 4px; }
}

/* Help (public/app/help.js): pages kept to a readable width. */
.help-lead { font-size: 16px; color: var(--ink-2); max-width: 68ch; }
.help-search { width: 100%; max-width: 440px; }
.help-groups { display: flex; flex-direction: column; gap: 22px; }
.help-group h2 { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.help-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; color: var(--ink); }
.help-card:hover { text-decoration: none; border-color: var(--accent); color: var(--ink); }
.help-card strong { color: var(--accent); }
.help-article { max-width: 68ch; }
.help-article > * { margin: 0 0 12px; }
.help-article h2 { margin: 26px 0 8px; }
.help-article ul, .help-article ol { padding-left: 22px; }
.help-article li { margin-bottom: 6px; }
.help-steps li::marker { font-weight: 700; color: var(--accent); }
.help-note { padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.help-note a { color: inherit; text-decoration: underline; }
.help-more { max-width: 68ch; padding-top: 16px; border-top: 1px solid var(--line); }
.help-more h2 { font-size: 15px; }
.help-more ul { margin: 0; padding-left: 20px; }
.table-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; }
/* A label beside its input, in a page's top bar (a customer's history). */
.inline-field { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.inline-field input[type="date"] { width: 160px; }
.table-head h2 { margin: 0; }
.global-search { position: relative; flex: 0 1 440px; min-width: 220px; }
.global-search input { padding-left: 40px; }
.global-search .ico { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.search-results {
  position: absolute; top: 46px; left: 0; right: 0; z-index: 10;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 32, 0.14); padding: 6px 0; max-height: 70vh; overflow-y: auto;
}
.search-results h3 { margin: 8px 16px 4px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.search-results a { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 16px; color: var(--ink); }
.search-results a:hover { background: var(--hover); text-decoration: none; }
.search-results .none { padding: 8px 16px; color: var(--muted); margin: 0; }

/* ------------------------------------------------------ document editor */

.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.doc-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.rail .actions { flex-direction: column; align-items: stretch; }
.rail .actions > * { width: 100%; }
.rail .actions button[value=issue] { height: 44px; }

table.lines th, table.lines td { padding: 10px 10px; vertical-align: middle; }
table.lines td { border-bottom: 1px solid var(--hover); }
table.lines .item { display: flex; gap: 12px; align-items: flex-start; }
table.lines .item > div { flex: 1; min-width: 0; }
table.lines td.fit, table.lines th.fit { width: 1%; white-space: nowrap; }
table.lines .item textarea { width: 100%; min-width: 150px; resize: vertical; }
table.lines td > input { width: 6.5em; }
.line-extras { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; }
.line-extras label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.line-extras input { width: 6.5em; height: 32px; font-size: 14px; }
.line-extras select { width: auto; height: 32px; font-size: 14px; padding: 0 8px; }
.line-extras .serials-label { flex: 1 1 100%; }
.line-extras input.serials { flex: 1; width: auto; min-width: 0; font-family: var(--mono); }
table.lines .amount { font-weight: 600; }
table.lines .line-sku { margin: 4px 0 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }
button.icon { width: 34px; height: 34px; padding: 0; background: transparent; color: var(--muted); border: 1px solid transparent; }
button.icon:hover { background: var(--void-bg); color: var(--void-ink); }
/* Quantity: − and + either side of the box, joined into one control. */
.stepper { display: inline-flex; align-items: stretch; height: 40px; }
.stepper input.qty { width: 3.4em; min-width: 3.4em; text-align: center; border-radius: 0; font-weight: 600; }
.stepper button.step { width: 34px; height: auto; padding: 0; font-size: 18px; line-height: 1; color: var(--ink); background: var(--hover); border: 1px solid var(--line-strong); }
.stepper button.step:first-child { border-radius: 8px 0 0 8px; border-right: 0; }
.stepper button.step:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
/* A weighed product's quantity: typed, with its unit, no stepping by one. */
.stepper.measured { align-items: center; gap: 6px; }
.stepper.measured input.qty { width: 5em; border-radius: 8px; }
.stepper.measured .unit { color: var(--muted); font-size: 14px; }
.stepper button.step:hover { background: var(--line); }
.stepper button.step:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.add-line { margin-top: 12px; }

.totals-box table { width: 100%; }
.totals-box td { border: 0; padding: 5px 0; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.totals-box td:first-child { color: var(--muted); }
.totals-box tr.grand td { border-top: 1px solid var(--ink); padding-top: 12px; font-size: 18px; font-weight: 700; color: var(--ink); }

.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.history-list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; border-top: 1px solid var(--hover); font-size: 14px; }
.history-list li:first-child { border-top: 0; padding-top: 0; }
.history-table { width: auto; font-size: 14px; }
.history-table td { padding: 6px 18px 6px 0; border-bottom: 1px solid var(--hover); vertical-align: top; }
.history-table .when { white-space: nowrap; color: var(--muted); }
.history-table .who { color: var(--muted); }
.preview-frame { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f3f4f6; }
iframe.preview { display: block; width: 100%; height: 1150px; border: 0; background: #f3f4f6; transform-origin: 0 0; }

/* ---------------------------------------------------------- the rest */

.balance { font-size: 22px; font-weight: 700; margin: 0 0 10px; }
table.ageing { width: 100%; }
table.ageing tfoot th { border-top: 1px solid var(--ink); background: var(--surface); color: var(--ink); font-size: 14.5px; text-transform: none; letter-spacing: 0; }
table.ageing tfoot th.num, td.strong { font-weight: 700; }
.statement-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.statement-row label { display: flex; align-items: center; gap: 8px; margin: 0; }
.statement-row input { width: auto; }
.account h3 { margin-top: 20px; }
.account .actions, .account .statement-row { margin: 14px 0; }
.account .table-wrap { border-radius: 10px; }

ol.steps { max-width: 70ch; padding-left: 22px; }
ol.steps li { margin: 4px 0; }
ul.issues { max-width: 80ch; padding-left: 20px; }
.notice-inline { color: var(--accent); font-weight: 600; }

.import-help { max-width: 72ch; color: var(--muted); padding-left: 20px; margin: 0; }
.import-help li { margin: 4px 0; }
.file-pick { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-weight: 600; }
.file-pick input { width: auto; }
.import-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.import-preview td { vertical-align: top; }
.import-preview ul { margin: 0; padding-left: 18px; }
.import-columns summary { cursor: pointer; color: var(--muted); }
.import-columns summary .link { color: var(--accent); font-weight: 600; }
.import-columns .table-wrap { max-width: 560px; margin-top: 8px; }
.import-from { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 16px 0 0; }
.import-from input, .import-from select { width: auto; }

.logo-preview { margin: 8px 0 12px; }
.logo-preview img { display: block; max-width: 260px; max-height: 130px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.panel input[readonly] { font-family: var(--mono); font-size: 13px; }

.picker { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.picker button { width: 100%; justify-content: flex-start; height: 48px; font-size: 15px; }

/* ------------------------------------------------------------- narrower */

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid, .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
}

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 20;
    flex-direction: row; align-items: center; gap: 4px; overflow-x: auto;
    padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .side nav { flex-direction: row; gap: 2px; }
  .biz { padding: 0 8px 0 0; }
  .biz-name strong { white-space: nowrap; overflow-wrap: normal; }
  .biz-name button.link, .side .grow { display: none; }
  .nav { padding: 8px 10px; white-space: nowrap; }
  .me { flex-direction: row; border-top: 0; margin: 0 0 0 8px; padding: 0; white-space: nowrap; }
  .me-name { display: none; }
  .top { position: static; padding: 12px 16px; }
  .top .actions { flex-wrap: wrap; }
  .global-search { flex: 1 1 100%; }
  .content { padding: 16px 16px 40px; }
  .subtabs { padding: 0 16px; }
  .banner, .notice { padding: 10px 16px; }
}

@media (max-width: 600px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .quick { grid-template-columns: minmax(0, 1fr); }
  body.plain #view { margin: 16px; padding: 22px 20px; }
}

/* ---------------------------------------------------------------- bank */

.panel.warn-note { border-color: var(--warn-line); box-shadow: inset 3px 0 0 var(--warn-ink); background: var(--warn-bg); color: var(--warn-ink); margin: 0 0 16px; }
.bank-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bank-actions input, .bank-actions select { width: auto; min-width: 0; height: 34px; font-size: 13.5px; }
.bank-actions button { height: 34px; padding: 0 12px; font-size: 13.5px; }
.action-clear { color: var(--ok-ink); font-weight: 600; }
.action-record { color: var(--accent-ink); font-weight: 600; }
.action-unmatched { color: var(--warn-ink); font-weight: 600; }

/* ------------------------------------------------------------- repairs */

.pre { white-space: pre-line; }
.job-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.job-photos figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.job-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--side); }
.timeline { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.timeline li { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--hover); }
.timeline li .hint { white-space: nowrap; }
.note-form { display: flex; gap: 10px; align-items: flex-start; }
.note-form textarea { flex: 1; }
.inline-form select { width: auto; }
.inline-form input:not(.short) { flex: 1; min-width: 160px; max-width: none; }
@media (max-width: 600px) {
  .timeline li { flex-direction: column; gap: 4px; }
}

/* ------------------------------------------------- serials and warranty */

.model-chips:not(:empty) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 14px; }
.chip.model { height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 13px; }
.chip.model:hover { border-color: var(--accent); }
.chip.model.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.serial-set { margin: 16px 0; }
.serial-set .field { margin-bottom: 0; }
/* Sizes and colours: the options of a new one, and its versions' table with inputs in it. */
.option-set { margin: 16px 0; }
table.versions td { vertical-align: middle; }
.category-serials:not(:empty) { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: -4px 0 14px; padding: 10px 14px; background: var(--side); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.category-serials .check { margin: 0; }
.category-serials input.short { width: 4.5em; }
/* Expenses (expenses.js): the period's figures, by category; the filters' date labels. */
.expense-summary { display: flex; flex-wrap: wrap; gap: 8px 40px; align-items: flex-start; }
.expense-summary .facts { margin: 0; }
.by-category { list-style: none; margin: 0; padding: 0; min-width: 240px; }
.by-category li { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.by-category li:last-child { border-bottom: 0; }
.filters label.range { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.filters label.range input { width: auto; }
a.button.small { padding: 4px 10px; font-size: 13px; min-height: 0; }
/* Print labels (labels.js): the list beside the sheet choices and the preview. */
.labels-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); gap: 20px; align-items: start; }
.labels-grid .card { max-width: none; }
.labels-grid .finder { position: relative; margin-bottom: 12px; }
.labels-grid .inline-form { margin-bottom: 12px; }
.label-rows td.remove { width: 1%; white-space: nowrap; }
.label-rows input.short { width: 5em; }
.labels-grid .preview-frame { margin-top: 12px; }
a.button[aria-disabled=true] { opacity: .5; pointer-events: none; }
@media (max-width: 960px) { .labels-grid { grid-template-columns: 1fr; } }
.serial-card { display: flex; flex-direction: column; gap: 10px; }
.serial-card .card-head { align-items: flex-start; flex-wrap: wrap; }
.serial-card h2 { margin: 0; font-size: 20px; }
.serial-card h3 { margin: 4px 0 6px; font-size: 14px; }
.serial-card .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.claim-form { max-width: 560px; border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------------------------------------------------------- end of day */

.card .table-wrap.flush { border: 0; border-radius: 0 0 12px 12px; margin: 0 -20px -20px; }
.z-row > td { background: var(--side); }
.z-details { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px; }
.z-table { width: 100%; table-layout: auto; }
.z-table th { background: none; border: 0; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--muted); padding: 4px 16px 4px 0; white-space: nowrap; }
/* Long values ("01-10-2026 13:13 by …") wrap inside the column, not under the next one. */
.z-table td { padding: 4px 0; white-space: normal; overflow-wrap: anywhere; }
.z-details ul { margin: 0; padding-left: 18px; }
.z-details h4 { margin: 0 0 6px; font-size: 13.5px; }
.count-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; max-width: 240px; }
.count-list li { display: flex; justify-content: space-between; gap: 12px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form input { max-width: 220px; }
@media (max-width: 760px) {
  .z-details { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- stock */

.stock-card { display: flex; flex-direction: column; gap: 12px; }
.stock-card h2, .stock-card p { margin: 0; }
.stock-card .inline-form input { max-width: 260px; }
.stock-card .table-wrap.flush { margin-top: 4px; }
.delivery-totals { display: flex; justify-content: flex-end; align-items: flex-start; }
.delivery-totals dl.facts { grid-template-columns: max-content max-content; font-variant-numeric: tabular-nums; }
.delivery-totals dd { text-align: right; }
table.lines input.short { width: 7em; }

/* ------------------------------------------------------ two-step sign-in */

.two-step-step { display: flex; flex-direction: column; gap: 12px; }
.two-step-step label { display: flex; flex-direction: column; gap: 6px; margin: 0; font-weight: 600; font-size: 14px; }
.two-step-step input { max-width: 260px; }
.two-step-how { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.two-step-scan { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
svg.qr { display: block; border: 1px solid var(--line); border-radius: 8px; max-width: 100%; height: auto; }
.two-step-key { font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em; word-break: break-all; }
ol.recovery-codes { columns: 2; font-family: var(--mono); font-size: 15px; margin: 8px 0 12px; padding-left: 24px; }
ol.recovery-codes li { margin: 3px 0; }

/* -------------------------------------------------------------- reports */

.report-filters { gap: 10px 18px; }
.span-pick { display: flex; align-items: center; gap: 8px; }
.span-pick input { width: 160px; }
label.pick { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; font-size: 14.5px; color: var(--ink); }
label.pick select { width: auto; }
.stack.loading { opacity: 0.55; transition: opacity 0.15s; }
table.report tfoot td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 700; background: var(--surface); }
table.report td .hint { font-size: 12.5px; font-weight: 400; white-space: nowrap; }
table.report td.nowrap { white-space: nowrap; }
table.vat201 tr.vat-section td { background: var(--side); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding-top: 10px; padding-bottom: 10px; }
table.vat201 tr.vat-total td { font-weight: 700; border-top: 1px solid var(--line-strong); }
table.vat201 td.mono { color: var(--muted); }
form.mapping h3 { margin: 18px 0 4px; font-size: 15px; }
form.mapping h3:first-of-type { margin-top: 0; }
.mapping-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 18px; margin: 10px 0 6px; }
.mapping-grid label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); }
form.mapping input.missing, form.mapping select.missing { border-color: var(--error); box-shadow: 0 0 0 3px var(--void-bg); }
@media (max-width: 600px) {
  .span-pick { flex: 1 1 100%; }
  .span-pick input { flex: 1; width: auto; min-width: 0; }
}
