/* Full Set Accounting — the whole look, in one file.
 *
 * No framework and no build step. That is a deliberate trade: a Malaysian shop
 * runs this on a VPS behind a slow line, and every megabyte of framework is a
 * second the invoice screen does not open. What is here loads once and caches.
 *
 * The rules that matter in an ACCOUNTING interface specifically:
 *
 *   1. Money is right-aligned and uses tabular figures. Columns of numbers that
 *      do not line up cannot be scanned, and scanning is the whole job.
 *   2. A negative is red AND carries a minus sign. Colour alone fails for the
 *      ~8% of men with a red-green deficiency, and this is money.
 *   3. The company you are in is visible at all times. Posting to the wrong set
 *      of books is the classic disaster and it is silent.
 *   4. DRAFT and POSTED never look similar. One is a piece of paper, the other
 *      is permanent.
 */

:root {
  --ink:            #14171f;
  --ink-2:          #454b5a;
  --ink-3:          #6b7280;
  --line:           #e3e6ec;
  --line-2:         #eef0f4;
  --bg:             #f6f7f9;
  --surface:        #ffffff;
  --surface-2:      #fafbfc;

  --brand:          #0b6b5f;   /* deep teal — reads as money without being a bank cliché */
  --brand-ink:      #ffffff;
  --brand-soft:     #e6f2f0;
  --brand-line:     #b9d9d3;

  --pos:            #0a7d52;   /* a credit / a gain */
  --neg:            #b4232b;   /* a debit you did not want / a loss */
  --warn:           #8a5a00;
  --warn-soft:      #fdf5e3;
  --warn-line:      #ecd9a8;

  --radius:   10px;
  --radius-s: 7px;
  --shadow:   0 1px 2px rgba(20,23,31,.06), 0 4px 12px rgba(20,23,31,.05);
  --shadow-lg:0 8px 30px rgba(20,23,31,.12);

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
          "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eaef; --ink-2: #a9b0be; --ink-3: #7e8698;
    --line: #2a2f3a; --line-2: #232833;
    --bg: #12151b; --surface: #191d25; --surface-2: #1e222b;
    --brand: #2aa596; --brand-ink: #05201c;
    --brand-soft: #14312d; --brand-line: #23554e;
    --pos: #3fbf87; --neg: #f2696f;
    --warn: #e0b458; --warn-soft: #2c2415; --warn-line: #4b3d1c;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 640; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }

/* ─────────────────────────── shell ─────────────────────────── */

.shell { display: flex; min-height: 100vh; }

.side {
  width: 232px; flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.brand {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line-2);
}
.brand-mark {
  font-weight: 700; font-size: .95rem; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px;
}
.brand-dot {
  width: 9px; height: 9px; border-radius: 3px;
  background: var(--brand); flex: none;
}
.brand-sub { font-size: .72rem; color: var(--ink-3); margin-top: 2px; }

/* 🔴 Which set of books you are in. Always on screen, never a dropdown you have
 * to open to check — posting to the wrong company is silent and expensive. */
.company-picker { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.company-picker label {
  display: block; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-3); margin-bottom: 5px;
}
.company-picker select {
  width: 100%; padding: 7px 9px; font-size: .86rem;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface-2); color: var(--ink); font-family: inherit;
}

nav.menu { padding: 10px 10px 20px; overflow-y: auto; flex: 1; }
nav.menu .group {
  font-size: .67rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); padding: 14px 8px 5px; font-weight: 600;
}
nav.menu a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--radius-s);
  color: var(--ink-2); font-size: .88rem; text-decoration: none;
}
nav.menu a:hover { background: var(--surface-2); color: var(--ink); }
nav.menu a.on {
  background: var(--brand-soft); color: var(--brand); font-weight: 600;
}
nav.menu a .ic { width: 16px; text-align: center; opacity: .85; font-size: .9em; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px; border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.topbar .spacer { flex: 1; }
.who { font-size: .82rem; color: var(--ink-3); text-align: right; line-height: 1.3; }
.who strong { display: block; color: var(--ink); font-weight: 600; }

.page { padding: 24px 26px 60px; max-width: 1180px; width: 100%; }
.page-head {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head .spacer { flex: 1; }
.page-head p.lede { margin: 4px 0 0; color: var(--ink-3); font-size: .88rem; }

/* ─────────────────────────── cards & tables ─────────────────────────── */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 18px;
}
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 12px;
}
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

/* A form that sits on one line inside a table cell or a card head — a picker
   and its button, an amount and its confirm. Without this the label, the field
   and the button stack and the row grows to three lines. */
.inline-form { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-form input, .inline-form select {
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 6px 9px; font: inherit; font-size: .86rem;
}

/* A card that folds away — used where a form is occasionally needed but should
   not be the first thing on the screen (adding a fixed asset, say). The native
   marker is replaced by one that matches the rest of the interface; the browser
   default is a small black triangle that sits at a different baseline in every
   browser and looks like a rendering fault next to a styled card. */
details.card > summary {
  cursor: pointer; list-style: none; user-select: none;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after {
  content: "＋"; margin-left: auto; font-size: 1.05rem; line-height: 1;
  color: var(--ink-3); transition: transform .15s ease;
}
details.card[open] > summary::after { content: "－"; }
details.card > summary:hover { background: var(--surface-2); }
details.card > summary:focus-visible {
  outline: 2px solid var(--brand); outline-offset: -2px;
}
/* Closed, the heading IS the whole card, so its bottom border reads as a stray
   line under a one-row box. */
details.card:not([open]) > summary { border-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  text-align: left; font-weight: 600; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3);
  padding: 9px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
tfoot td {
  font-weight: 650; border-top: 2px solid var(--line);
  border-bottom: none; background: var(--surface-2);
}

/* 🔴 Money. Tabular figures so digits line up column-wise — a ledger you cannot
 * scan vertically is a ledger nobody checks. */
.num, td.num, th.num {
  text-align: right; font-family: var(--mono);
  font-variant-numeric: tabular-nums; font-size: .86rem;
  white-space: nowrap;
}
.num.neg { color: var(--neg); }
.num.pos { color: var(--pos); }
.num.big { font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; }
.muted { color: var(--ink-3); }
.small { font-size: .8rem; }
.code { font-family: var(--mono); font-size: .82rem; }

/* ─────────────────────────── status ─────────────────────────── */

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 20px; font-size: .72rem;
  font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  border: 1px solid transparent;
}
/* DRAFT and POSTED must never be mistakable for one another. One is a piece of
 * paper somebody is still working on; the other is in the ledger for good. */
.tag.draft  { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag.posted { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.tag.void   { background: var(--line-2); color: var(--ink-3); border-color: var(--line); }
.tag.open   { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag.locked { background: var(--line-2); color: var(--ink-3); border-color: var(--line); }

/* ─────────────────────────── stats ─────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow);
}
.stat .label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); font-weight: 600;
}
.stat .value {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 1.55rem; font-weight: 650; letter-spacing: -.02em; margin-top: 6px;
}
.stat .foot { font-size: .76rem; color: var(--ink-3); margin-top: 3px; }

/* ─────────────────────────── forms ─────────────────────────── */

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: .8rem; font-weight: 600;
  margin-bottom: 5px; color: var(--ink-2);
}
.field .hint { font-size: .76rem; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=password], input[type=email], input[type=date],
input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; font-size: .9rem; font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
input.num, td input.num {
  text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1 1 190px; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius-s); font-size: .87rem;
  font-weight: 600; font-family: inherit; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--neg); border-color: var(--neg); background: transparent; }
.btn.small { padding: 5px 10px; font-size: .8rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ─────────────────────────── messages ─────────────────────────── */

.note {
  border-radius: var(--radius-s); padding: 11px 14px; font-size: .87rem;
  margin-bottom: 16px; border: 1px solid;
}
.note.err  { background: color-mix(in srgb, var(--neg) 8%, transparent); border-color: color-mix(in srgb, var(--neg) 35%, transparent); color: var(--neg); }
.note.ok   { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }
.note.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.note strong { font-weight: 700; }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 1.5rem; margin-bottom: 8px; opacity: .5; }

/* ─────────────────────────── login ─────────────────────────── */

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 520px at 15% -10%, var(--brand-soft), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 30px 28px;
}
.login-card h1 { font-size: 1.25rem; margin-bottom: 3px; }
.login-card .sub { color: var(--ink-3); font-size: .85rem; margin-bottom: 22px; }

/* ─────────────────────────── report ─────────────────────────── */

.report-title { text-align: center; margin-bottom: 20px; }
.report-title h2 { font-size: 1.15rem; }
.report-title .who { text-align: center; font-size: .88rem; color: var(--ink-2); }
.report-title .when { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }

tr.section td { font-weight: 650; background: var(--surface-2); }
tr.total td { font-weight: 650; border-top: 1px solid var(--line); }
tr.grand td {
  font-weight: 700; border-top: 2px solid var(--ink-2);
  border-bottom: 3px double var(--ink-2);
}
td.indent { padding-left: 30px; }

/* ─────────────────────────── responsive ─────────────────────────── */

@media (max-width: 860px) {
  .side {
    position: fixed; left: 0; top: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: var(--shadow-lg);
  }
  .side.open { transform: none; }
  .page { padding: 18px 15px 50px; }
  .topbar { padding: 12px 15px; }
  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (min-width: 861px) { .menu-toggle { display: none; } }

.scroll-x { overflow-x: auto; }

@media print {
  .side, .topbar, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .card { border: none; box-shadow: none; }
}

/* ─────────────────── the "still needs an answer" badge ─────────────────── */
/* On every page. A warning that only appears on the screen where the problem
 * lives is a warning nobody sees — and not opening that screen is precisely
 * the failure it exists to catch. */
.nudge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 20px; font-size: .8rem; font-weight: 600;
  background: var(--warn-soft); color: var(--warn);
  border: 1px solid var(--warn-line); text-decoration: none;
}
.nudge:hover { text-decoration: none; filter: brightness(.97); }
.nudge .dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  flex: none;
}
.nudge .age { opacity: .75; font-weight: 500; }
.nudge.urgent {
  background: color-mix(in srgb, var(--neg) 10%, transparent);
  color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, transparent);
}
.nudge.urgent .dot { animation: nudge-pulse 2.4s ease-in-out infinite; }
@keyframes nudge-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
@media (prefers-reduced-motion: reduce) { .nudge.urgent .dot { animation: none } }
@media (max-width: 700px) { .nudge .age { display: none } }

/* A day the till never sent. Loud on purpose: it leaves no other trace, and
   the whole cost of missing it lands at year end. */
tr.missing-day td { background: var(--bad-soft, rgba(220, 38, 38, .06)); }
tr.missing-day td:first-child { box-shadow: inset 3px 0 0 var(--bad, #dc2626); }


/* ── the work list on the dashboard ──────────────────────────────────────── */
/* A coloured bar down the left, not colour alone: roughly one man in twelve has
   a red-green deficiency, and this is the list that decides what gets done. */
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { border-bottom: 1px solid var(--line); }
.todo-list li:last-child { border-bottom: none; }
.todo-list a {
  display: block; padding: 11px 14px 11px 16px;
  text-decoration: none; color: inherit; border-left: 4px solid transparent;
}
.todo-list a:hover { background: var(--surface-2, rgba(0,0,0,.03)); }
.todo-list strong { display: block; margin-bottom: 2px; }
.todo-list li.sev-blocking  a { border-left-color: var(--neg, #dc2626); }
.todo-list li.sev-attention a { border-left-color: var(--warn, #b45309); }
.todo-list li.sev-watch     a { border-left-color: var(--line-2, #cbd5e1); }
.todo-list li.sev-blocking strong::before { content: "▲ "; color: var(--neg, #dc2626); }


/* ═══════════════════════════════════════════════════════════════════════════
 * POLISH — 2026-08-12
 *
 * Not a redesign. The bones were right; these are the things that make an
 * accounting screen feel finished rather than merely working.
 *
 * Every rule below earns its place by making a NUMBER easier to read or a
 * STATE harder to misread. Nothing here is decoration for its own sake — a
 * shop owner checking his takings at 11pm does not need a gradient, he needs
 * to find the row that is wrong.
 *
 * `color-mix()` is used in places. On a browser that does not support it the
 * whole declaration is dropped, which is why every one of those rules is a
 * BACKGROUND tint and never the only thing carrying meaning: a note still has
 * its coloured left border, a danger button still has red text. The screen
 * degrades to plainer, never to ambiguous.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ── tables: the thing people actually stare at ─────────────────────────── */

/* 🔴 A sticky header. Scroll down a hundred invoices and the column headings
   are gone — so "which of these numbers is the tax" becomes a guess, and the
   only fix is scrolling back up. */
.card-body.tight table thead th {
  position: sticky; top: 0; z-index: 2;
  box-shadow: inset 0 -1px 0 var(--line);
}

/* Zebra striping at very low contrast. Enough to hold the eye on one row
   across a wide table; not enough to fight the hover state or to print badly. */
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
tbody tr:hover td { background: var(--brand-soft); }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
tbody tr td { transition: background .09s ease; }

/* A row whose number is the point: give the money column its own weight. */
td.num { font-weight: 500; }
tfoot td.num, tr.total td { font-weight: 700; }
tr.total td { background: var(--surface-2); }

/* ── the numbers themselves ─────────────────────────────────────────────── */

/* 🔴 Zero is not the same as nothing, and it should not shout like a figure.
   A column of real amounts with the occasional 0.00 reads faster when the
   zeros recede. */
.num.zero, td.num:where(:not(.neg):not(.pos)) { font-variant-numeric: tabular-nums; }

.stat { position: relative; overflow: hidden; }
/* A hairline of brand colour along the top edge — enough to make the strip of
   figures read as one unit rather than four floating boxes. */
.stat::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--brand), transparent 70%);
  opacity: .55;
}
.stat .value { line-height: 1.15; }
.stat .value.neg { color: var(--neg); }
.stat .value.pos { color: var(--pos); }

/* ── cards: hierarchy, so the important one is obviously the important one ─ */

.card { transition: box-shadow .12s ease, border-color .12s ease; }
.card-head h2 { font-size: 1rem; letter-spacing: -.005em; }

/* The card carrying the thing to act on. Used by the fresh-token panel and the
   stock-take plan — both are "read this before you click". */
.card.accent { border-color: var(--brand-line); box-shadow: var(--shadow-lg); }
.card.accent > .card-head { background: var(--brand-soft); border-bottom-color: var(--brand-line); }
.card.accent > .card-head h2 { color: var(--brand); }

/* The work list is the first thing on the dashboard; give it presence. */
.card.todo { border-color: var(--line); }
.card.todo .card-head { background: var(--surface-2); }

/* ── notes: four voices, and they must not sound alike ─────────────────── */

.note {
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 16px;
  font-size: .87rem; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2);
  border-left: 3px solid var(--line);
}
.note strong { color: var(--ink); }
.note.err  { background: color-mix(in srgb, var(--neg) 7%, var(--surface));
             border-color: color-mix(in srgb, var(--neg) 25%, var(--line));
             border-left-color: var(--neg); color: var(--ink); }
.note.warn { background: var(--warn-soft); border-color: var(--warn-line);
             border-left-color: var(--warn); color: var(--ink); }
.note.ok   { background: var(--brand-soft); border-color: var(--brand-line);
             border-left-color: var(--brand); color: var(--ink); }

/* ── buttons: one primary per screen, and it should look like it ────────── */

.btn {
  transition: background .1s ease, border-color .1s ease, transform .04s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { box-shadow: 0 1px 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn.danger {
  border-color: color-mix(in srgb, var(--neg) 35%, var(--line));
  color: var(--neg); background: color-mix(in srgb, var(--neg) 6%, var(--surface));
}
.btn.danger:hover { background: color-mix(in srgb, var(--neg) 12%, var(--surface)); }

/* ── empty states: say what to do, not just that there is nothing ───────── */

.empty { padding: 34px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 1.8rem; opacity: .3; margin-bottom: 6px; line-height: 1; }
.empty h2 { font-size: 1rem; color: var(--ink-2); margin-bottom: 4px; }
.empty p { margin: 4px 0 0; font-size: .87rem; }

/* ── the sidebar: the current page should be unmistakable ──────────────── */

nav.menu a { transition: background .1s ease, color .1s ease; }
nav.menu a.on { box-shadow: inset 2px 0 0 var(--brand); }
nav.menu a.on .ic { opacity: 1; }

/* ── focus: visible, because this is a keyboard-heavy job ───────────────── */

input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px;
  border-radius: var(--radius-s);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}

/* ── printing: none of the app, all of the numbers ─────────────────────── */

@media print {
  .side, .topbar, .no-print, nav.menu, .btn-row { display: none !important; }
  .shell, .main { display: block; }
  .page { padding: 0; max-width: none; }
  .card { border: none; box-shadow: none; break-inside: avoid; margin-bottom: 10px; }
  .card-head { border-bottom: 1px solid #999; padding-left: 0; }
  tbody tr:nth-child(even) td, tbody tr:hover td { background: transparent; }
  tbody tr:hover td:first-child { box-shadow: none; }
  body { background: #fff; font-size: 11pt; }
  thead { display: table-header-group; }   /* repeat headings on every page */
}

/* ── smaller screens: the owner checks this on a phone in the shop ─────── */

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side {
    width: auto; height: auto; position: static;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  nav.menu { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  nav.menu .group { display: none; }
  nav.menu a { padding: 6px 10px; font-size: .82rem; }
  .page { padding: 16px 14px 48px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .stat .value { font-size: 1.3rem; }
  .row { flex-direction: column; }
  .topbar { padding: 10px 14px; }
}

/* Somebody who has asked for less motion gets less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── classes the templates ask for and nothing was answering ──────────────
 *
 * 🔴 Found by comparing every class used in a template against every class the
 * stylesheet defines. All four were silently doing nothing: a field that never
 * grew, forms that broke onto their own lines, a checkbox that would not sit
 * beside its label, and the one-time token shown in body text.
 *
 * No test caught them, and no test could have — the markup was present, so the
 * assertions passed. Only looking at what the CSS actually answers finds this. */

/* A field that takes the rest of the row. Without it every field in a .row is
   the same width, so a 60-character description box sits next to a date. */
.field.grow { flex: 1 1 260px; min-width: 0; }

/* A form that is part of a sentence rather than a block of its own — the
   settle button beside an amount, the revoke button in a table cell. */
form.inline, .inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }

/* A checkbox and its words on one line, and clickable together. */
.inline-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .84rem; font-weight: 500; color: var(--ink-2);
  margin-top: 6px; cursor: pointer;
}
.inline-check input { width: auto; margin: 0; }

/* 🔴 The one time a machine token is ever shown. It gets copied by hand as
   often as by button, so it is monospace, large enough to read a character at
   a time, and it wraps rather than scrolling out of sight. */
.token-plain {
  font-family: var(--mono); font-size: 1rem; letter-spacing: .01em;
  background: var(--surface-2); border: 1px dashed var(--brand-line);
  border-radius: var(--radius-s); padding: 12px 14px; margin: 8px 0;
  word-break: break-all; user-select: all; line-height: 1.5;
}
