/* Client management dashboard. Layout: a dark sidebar (a bottom bar on phones), the page on a warm neutral, white
   cards; the brand's chocolate for actions, status colours only for status. */
:root {
  --bg: #f4efe9;
  --surface: #ffffff;
  --surface-2: #faf6f1;
  --ink: #24160d;
  --muted: #7a685b;
  --line: #e8ded4;
  --brand: #47210c;
  --brand-ink: #f6eadc;
  --side: #2a160a;
  --side-ink: #eedfce;
  --side-muted: #b49d88;
  --good: #23784a; --good-bg: #e2f2e8;
  --bad: #b4232c;  --bad-bg: #fae4e5;
  --warn: #935600; --warn-bg: #fcefd8;
  --info: #2457c5; --info-bg: #e4ecfc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42, 22, 10, .06), 0 8px 24px -16px rgba(42, 22, 10, .25);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.45 Jost, "Century Gothic", Futura, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* The loading cup (loader.css): the dashboard's ink, and Tablepour's ember for the steam. */
:root { --loader-ink: var(--brand); --loader-steam: #e2643a; }

/* ── Frame ──────────────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; background: var(--side); color: var(--side-ink); }
.brandmark { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 600; letter-spacing: .02em; }
.brandmark span { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-ink); color: var(--side); display: grid; place-items: center; font-weight: 700; }
.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; font-weight: 500; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav:hover { background: rgba(255, 255, 255, .06); }
.nav.on { background: rgba(255, 255, 255, .12); color: #fff; }
.nav .count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .75rem; font-weight: 600; text-align: center; }
.side .spacer { flex: 1; }
.side .who { padding: 10px 12px; font-size: .82rem; color: var(--side-muted); overflow-wrap: anywhere; }
.side .who button { display: block; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--side-ink); font-weight: 600; }

.page { padding: 26px 32px 56px; min-width: 0; }
.head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { margin: 0; font: 600 1.55rem/1.2 Jost, sans-serif; }
.head p { margin: 4px 0 0; color: var(--muted); }
.head .grow { flex: 1; min-width: 220px; }
.head .tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Buttons, fields ────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; background: var(--brand); color: var(--brand-ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.small { padding: 6px 11px; font-size: .88rem; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: default; }
.linkish { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.search input { width: 240px; max-width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.segmented { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.segmented button { padding: 6px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 500; }
.segmented button.on { background: var(--brand); color: var(--brand-ink); }
select.filter { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; margin-bottom: 5px; font-size: .84rem; color: var(--muted); font-weight: 500; }
.field input, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.field input:focus { border-color: var(--brand); outline: none; }
.problem { margin: 6px 0 12px; color: var(--bad); font-weight: 500; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 14px; cursor: pointer; }
.check input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.check small { display: block; margin-top: 2px; color: var(--muted); font-size: .85rem; }
.hint { margin: -6px 0 14px; color: var(--muted); font-size: .85rem; }

/* ── Cards, KPIs ────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > h2 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 16px 18px 12px; font: 600 1rem/1.3 Jost, sans-serif; }
.card > h2 .more { margin-left: auto; font-size: .88rem; font-weight: 500; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi .label { color: var(--muted); font-size: .84rem; font-weight: 500; }
.kpi .value { margin: 6px 0 4px; font: 600 1.9rem/1 Jost, sans-serif; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.kpi .sub { color: var(--muted); font-size: .84rem; }
.meter { height: 6px; margin: 8px 0 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.meter.warn i { background: var(--warn); }
.meter.bad i { background: var(--bad); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.stack { display: grid; gap: 14px; }

/* ── Needs attention ────────────────────────────────────────────────────────── */
.alerts { list-style: none; margin: 0; padding: 0 8px 8px; }
.alerts li { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-top: 1px solid var(--line); }
.alerts li:first-child { border-top: 0; }
.alerts .sev { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.alerts .sev svg { width: 16px; height: 16px; }
.sev.bad { background: var(--bad-bg); color: var(--bad); }
.sev.warn { background: var(--warn-bg); color: var(--warn); }
.sev.info { background: var(--info-bg); color: var(--info); }
.alerts .what { flex: 1; min-width: 0; }
.alerts .what b { display: block; font-weight: 600; }
.alerts .what span { color: var(--muted); font-size: .86rem; }
.calm { display: flex; align-items: center; gap: 10px; padding: 6px 18px 18px; color: var(--good); font-weight: 500; }
.calm svg { width: 18px; height: 18px; }

/* ── Tables (rows of a grid; on phones each row is a card) ──────────────────── */
.table { width: 100%; }
.table .tr { display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: center; padding: 11px 18px; border-top: 1px solid var(--line); }
.table .tr.th { border-top: 0; padding-top: 4px; padding-bottom: 8px; color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.table .tr.click { cursor: pointer; }
.table .tr.click:hover { background: var(--surface-2); }
.table .num { font-variant-numeric: tabular-nums; }
.table .right { text-align: right; justify-self: end; }
.table .muted { color: var(--muted); font-size: .88rem; }
.who-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who-cell .name { font-weight: 600; overflow-wrap: anywhere; }
.who-cell .code { color: var(--muted); font-size: .84rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.logo { flex: none; width: 38px; height: 38px; border-radius: 50%; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); padding: 3px; }
.logo.none { display: grid; place-items: center; padding: 0; font-weight: 700; color: var(--brand); }
.logo.big { width: 56px; height: 56px; }
.empty { padding: 26px 18px; color: var(--muted); text-align: center; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.plain { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.plain::before { display: none; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #c9bcb0; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }

/* ── Demo requests ──────────────────────────────────────────────────────────── */
.requests { display: grid; gap: 14px; }
.request { padding: 16px 18px; }
.request-head { display: flex; align-items: flex-start; gap: 12px; }
.request-head .grow { flex: 1; min-width: 0; }
.request-head h2 { margin: 0 0 2px; font: 600 1.1rem/1.3 Jost, sans-serif; overflow-wrap: anywhere; }
.request-contact { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.request-message { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.request-edit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.request-edit .field { margin: 0; }
.request-edit .grow { flex: 1; min-width: 200px; }
.request-edit select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; }

.owner-letter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.owner-letter .muted { font-size: .86rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── A cafe's page ──────────────────────────────────────────────────────────── */
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: .9rem; text-decoration: none; }
.back:hover { color: var(--ink); }
.cafe-head { align-items: center; margin-bottom: 14px; }
.cafe-head h1 { overflow-wrap: anywhere; }
.cafe-head p { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.card.pad { padding: 4px 18px 18px; }
.card.pad > h2 { padding: 14px 0 10px; }
.card.pad > p { margin: 0 0 10px; }
form.card.pad { padding-top: 18px; }
.narrow { max-width: 640px; }
.kpi .value.small-value { font-size: 1.4rem; }
.kpi .sub a { color: var(--brand); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.fact { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.fact span { display: block; color: var(--muted); font-size: .8rem; }
.fact b { font: 600 1.2rem/1.3 Jost, sans-serif; font-variant-numeric: tabular-nums; }
.section-title { margin: 20px 0 8px; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.links .row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.links .row span { width: 72px; flex: none; color: var(--muted); font-size: .86rem; }
.links .row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.device { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.device:first-child { border-top: 0; }
.device .grow { flex: 1; min-width: 0; }
/* Look: four themes to pick from, each sample split into its light and dark halves, and a small copy of the menu page
   in the picked colours (the same variables the cafe's pages use, cafe.js). */
.themes { margin: 6px 0 16px; padding: 0; border: 0; }
.themes legend { padding: 0; margin-bottom: 4px; font-size: .84rem; color: var(--muted); font-weight: 500; }
.themes .hint { margin: 0 0 10px; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.theme { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.theme:hover { background: var(--surface-2); }
.theme input { position: absolute; opacity: 0; pointer-events: none; }
.theme:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.theme:has(input:checked)::after { content: "✓"; position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.theme:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.theme-sample { display: grid; grid-template-columns: 1fr 1fr; height: 64px; margin-bottom: 6px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.theme-sample .half { position: relative; background: var(--sand); }
.theme-sample i { position: absolute; left: 12%; right: 12%; top: 16px; height: 14px; border-radius: 4px; background: var(--cream); }
.theme-sample b { position: absolute; left: 12%; top: 38px; width: 44%; height: 12px; border-radius: 999px; background: var(--choc); }
.theme-name { font-weight: 600; }
.theme-text { color: var(--muted); font-size: .82rem; line-height: 1.3; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 8px; }
.preview-head .section-title { margin: 0; }
.preview-head .segmented button { padding: 4px 12px; font-size: .86rem; }
.preview { margin: 0 0 16px; padding: 18px 14px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--sand); color: var(--choc); transition: background-color .25s, color .25s; }
.preview * { transition: background-color .25s, color .25s, border-color .25s; }
.pv-hero { text-align: center; }
.pv-logo { display: block; width: 140px; max-width: 60%; height: auto; margin: 0 auto 4px; border-radius: 6px; }
.pv-wordmark { font-size: 1.5rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; }
.pv-tagline { margin: 0 0 8px; color: var(--muted); font-size: .85rem; }
.pv-tagline:empty { display: none; }
.pv-button { display: inline-block; padding: 6px 16px; border-radius: 999px; background: var(--choc); color: var(--sand-light); font-size: .8rem; font-weight: 600; letter-spacing: .04em; }
.pv-chips { position: relative; display: flex; gap: 6px; margin: 14px -14px 18px; padding: 8px 14px; background: var(--choc); }
.pv-chips::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: radial-gradient(circle at 9px 0, var(--choc) 8px, transparent 8.5px) 0 0 / 18px 8px repeat-x; }
.pv-chips span { padding: 3px 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); color: var(--sand-light); font-size: .78rem; }
.pv-chips span.on { background: var(--sand); border-color: var(--sand); color: var(--choc); }
.pv-section { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font: 600 .82rem/1.2 Jost, sans-serif; letter-spacing: .22em; text-transform: uppercase; }
.pv-section::before, .pv-section::after { content: ""; flex: 1; height: 2px; background: var(--choc); opacity: .55; }
.pv-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pv-item { overflow: hidden; border-radius: 10px; background: var(--cream); }
.pv-photo { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--sand-light); font-size: 1.5rem; }
.pv-photo em { position: absolute; top: 6px; left: 6px; padding: 2px 6px; border-radius: 999px; background: var(--choc); color: var(--sand-light); font: 600 .55rem Jost, sans-serif; font-style: normal; letter-spacing: .12em; text-transform: uppercase; }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 6px 7px; font-size: .78rem; font-weight: 500; }
.pv-price { padding: 1px 7px; border-radius: 999px; background: var(--choc); color: var(--sand-light); font-weight: 600; font-size: .72rem; }
.pv-item.sold { color: var(--muted); }
.pv-item.sold .pv-price { background: transparent; color: var(--muted); text-decoration: line-through; padding-right: 0; }
.pv-footer { margin: 12px 0 8px; text-align: center; color: var(--muted); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; }
.pv-footer:empty { display: none; }
@media (max-width: 480px) { .pv-items { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pv-items .pv-item:nth-child(3) { display: none; } }
.pictures { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.copy-box { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: .88rem; overflow-wrap: anywhere; user-select: all; }

/* ── Dialogs, toast, sign-in ────────────────────────────────────────────────── */
dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 22px 20px; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px -24px rgba(36, 22, 13, .55); }
dialog::backdrop { background: rgba(36, 22, 13, .4); }
dialog h2 { margin: 0 0 12px; font: 600 1.15rem/1.3 Jost, sans-serif; }
dialog.ask { width: min(390px, calc(100vw - 32px)); }
dialog.ask p { margin: 0 0 16px; color: var(--muted); }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); }
.signin { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.signin form { width: min(380px, 100%); padding: 26px 24px; }
.signin h1 { margin: 0 0 4px; font: 600 1.4rem/1.2 Jost, sans-serif; }
.signin p { margin: 0 0 18px; color: var(--muted); }

/* ── Working… (pressed button and a bar along the top) ──────────────────────── */
.busy-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 3px; overflow: hidden; pointer-events: none; }
.busy-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; background: var(--brand); animation: busy-slide 1.1s ease-in-out infinite; }
@keyframes busy-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
button.busy { position: relative; color: transparent !important; pointer-events: none; }
button.busy svg { visibility: hidden; }
button.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 1.05em; height: 1.05em; border-radius: 50%; border: 2px solid var(--spin, var(--brand)); border-right-color: transparent; animation: busy-spin .7s linear infinite; }
.btn.busy:not(.ghost) { --spin: var(--brand-ink); }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-bar::after { animation-duration: 3s; } button.busy::after { animation-duration: 2s; } }

/* ── Help: the owner's manual ───────────────────────────────────────────────── */
.help-link { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 6px; vertical-align: middle; border-radius: 50%; color: var(--muted); }
.help-link:hover { background: var(--surface-2); color: var(--brand); }
.help-link svg { width: 20px; height: 20px; }
.manual { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.manual-toc { display: grid; gap: 2px; position: sticky; top: 18px; }
.manual-toc a { padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.manual-toc a:hover { background: var(--surface); }
.manual-toc a.on { background: var(--brand); color: var(--brand-ink); }
.manual-body { padding: 4px 22px 20px; line-height: 1.6; max-width: 820px; }
.manual-body > h2 { padding: 16px 0 6px; font-size: 1.25rem; }
.manual-body h3 { margin: 20px 0 6px; font-size: 1rem; }
.manual-body p, .manual-body li { max-width: 68ch; }
.manual-body a { color: var(--brand); }
.manual-note { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--info-bg); border-left: 4px solid var(--info); }
.manual-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .95rem; }
.manual-table th, .manual-table td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.manual-table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 900px) {
  .manual { grid-template-columns: minmax(0, 1fr); }
  .manual-toc { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .manual-toc a { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); }
  .manual-body { padding: 4px 16px 18px; }
}

/* ── Narrow screens: bottom bar, cards instead of table rows ────────────────── */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
.phone-sign-out { display: none; margin: 28px auto 0; border: 0; background: none; color: var(--muted); text-decoration: underline; }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 15; height: auto; flex-direction: row; justify-content: space-around; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .brandmark, .side .spacer, .side .who { display: none; }
  .nav { flex-direction: column; gap: 3px; padding: 6px 8px; font-size: .72rem; position: relative; }
  .nav .count { position: absolute; top: 0; right: 4px; margin: 0; min-width: 18px; font-size: .68rem; }
  .page { padding: 18px 16px 96px; }
  .head h1 { font-size: 1.3rem; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; }
  .phone-sign-out { display: block; }
  .table .tr { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .table .tr.th { display: none; }
  .table .tr > [data-label] { font-size: .88rem; }
  .table .tr > [data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: .78rem; }
  .table .right { text-align: left; justify-self: start; }
  /* A short table (the overview's) keeps its columns. */
  .table.keep .tr { grid-template-columns: var(--cols); }
  .table.keep .tr.th { display: grid; }
  .table.keep .right { text-align: right; justify-self: end; }
  .table.keep .tr > [data-label]::before { content: none; }
  .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
#contact .request-edit { margin-top: 6px; padding-top: 0; border-top: 0; }
