/*
 * Plotercafé Voorraad — the one stylesheet.
 *
 * Tokens and components follow docs/design/STIJLGIDS.md; where docs/design/mockup-afwijkingen.md
 * differs, that file wins (--green is #2A7C4E, fonts are self-hosted).
 * No Bootstrap, no framework, no icon font (CLAUDE.md).
 */

/* ── Fonts (self-hosted IBM Plex, SIL OFL — see fonts/LICENSE.txt) ──────────────────────────── */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-Regular.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-Medium.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/IBMPlexSans-Bold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/IBMPlexMono-Medium.woff2') format('woff2'); }

/* ── Tokens (STIJLGIDS §2, §4) ──────────────────────────────────────────────────────────────── */
:root {
    --navy: #14213D;
    --bg: #EEF1F5;
    --surface: #FFFFFF;
    --border: #D5DBE5;
    --ink: #14213D;
    --ink-2: #3A4966;
    --ink-3: #5B6B85;
    --ink-4: #8A97AD;
    --ink-on-navy: #AEB8CC;
    --amber: #E9A23B;
    --green: #2A7C4E; /* mockup-afwijkingen §5: 5.13:1 for white text */
    --slate: #5B6B85;
    --r: 6px;
    --r-card: 8px;
    --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

/* ── Base ───────────────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.4; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
a { color: var(--ink); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 4px solid var(--amber); outline-offset: 3px; }
.eyebrow { font: 500 14px var(--mono); letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }
.help { font-size: 19px; color: var(--ink-2); line-height: 1.45; }
.link { font-size: 16px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons (STIJLGIDS §4, §5.5) */
.btn { height: 72px; border-radius: var(--r); font-size: 24px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 28px; text-decoration: none; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-confirm { height: 76px; background: var(--green); color: #fff; }
.btn-secondary { height: 56px; border: 2px solid var(--navy); font-size: 17px; padding: 0 20px; gap: 8px; background: var(--surface); }
.btn-next { background: var(--amber); color: var(--navy); font-weight: 700; }
.btn[disabled] { opacity: .45; cursor: default; }

/* Blazor's own error bar and validation */
#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--surface); border-top: 4px solid var(--slate); padding: 12px 20px; font-size: 17px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }
.validation-message { color: var(--ink-2); font-size: 15px; }
.invalid { border-color: var(--slate) !important; }

/* ── Sign-in (BareLayout) ───────────────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 32px 40px; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 32px; }
.auth-card .field input { height: 56px; font-size: 20px; }
.notice { border: 2px solid var(--slate); border-radius: var(--r); padding: 12px 16px; font-size: 17px; color: var(--ink-2); background: var(--surface); }
.notice.ok { border-color: var(--green); }

/* Print status (Beheer → Printer, and wherever a label is printed). No red: a failure is a neutral
   notice with one navy button (STIJLGIDS §1.4). */
.print-connection { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.print-connection .tag { font-size: 14px; padding: 4px 10px; }
.print-state { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.print-state strong { color: var(--ink); }
.print-state.done strong { color: var(--green); display: inline-flex; align-items: center; gap: 6px; }

/* PIN pad: large enough for a touch screen (STIJLGIDS §4: at least 56 px, 10 px apart) */
.pin { max-width: 420px; }
.pin-display { display: flex; gap: 10px; justify-content: center; }
.pin-display span { width: 48px; height: 60px; border: 2px solid var(--border); border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; }
.pin-display span.filled { border-color: var(--navy); }
.pin-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-pad button { height: 76px; border-radius: var(--r); background: var(--surface); border: 2px solid var(--border); font-size: 34px; font-weight: 700; }
.pin-pad button.small { font-size: 20px; font-weight: 600; color: var(--ink-2); }
.pin-pad button:active { background: var(--amber); border-color: var(--navy); }

/* ── Forms (management) ─────────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=search], .field input:not([type]), .field select, .field textarea {
    font: inherit; font-size: 17px; height: 44px; padding: 0 12px; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--ink); width: 100%;
}
.field textarea { height: auto; min-height: 80px; padding: 10px 12px; }
.field .hint { font-size: 14px; color: var(--ink-3); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--navy); }

/* ── Management shell (ManageLayout) ────────────────────────────────────────────────────────── */
/* Sidebar on the left, as in the budgetboek app: 232 px with symbol and name from 1280 px, 68 px
   with only the symbols from 641 px (title + aria-label name them), the compact bar below. The
   sidebar sticks to the viewport; the page scrolls beside it, so the sticky shop heads of the
   shopping list still hang from the top edge. minmax(0, 1fr): a wide table cannot push the page
   under or past the sidebar. */
.manage { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.manage-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; background: var(--navy); color: #fff; }
.manage-side .brand { font: 500 13px var(--mono); letter-spacing: .08em; color: var(--ink-on-navy); text-transform: uppercase; padding: 0 12px 18px; }
.manage-side a, .manage-side button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r); color: #fff; text-decoration: none; font-family: inherit; font-size: 15px; font-weight: 600; background: none; border: none; width: 100%; text-align: left; cursor: pointer; }
.manage-side a:hover, .manage-side button:hover { background: rgba(255,255,255,.1); }
.manage-side a:focus-visible, .manage-side button:focus-visible { outline: 4px solid var(--amber); outline-offset: -4px; }
.manage-side a.active { background: var(--amber); color: var(--navy); }
.manage-side svg { flex: 0 0 auto; }
.manage-side .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-side .spacer { margin: auto 4px 8px; padding-top: 12px; border-bottom: 1px solid rgba(255,255,255,.18); }
.manage-side .ghost { border: 2px solid rgba(255,255,255,.35); }
.manage-side form { display: block; }
@media (max-width: 1279px) {
    .manage { grid-template-columns: 68px minmax(0, 1fr); }
    .manage-side { padding: 16px 12px; align-items: center; }
    .manage-side .brand, .manage-side .label { display: none; }
    .manage-side a, .manage-side button { justify-content: center; padding: 0; width: 44px; }
    .manage-side .spacer { align-self: stretch; }
}

/* Compact bar on a phone (ManageLayout): one line — brand, the current page, Menu. The links fold
   open under it as a list over the page (js/menu.js closes it after a choice). Not sticky, like the
   full bar, so the sticky shop heads of the shopping list still stick to the very top. */
.manage-compact { display: none; }
@media (max-width: 640px) {
    .manage { display: flex; flex-direction: column; }
    .manage-side { display: none; }
    .manage-compact { display: flex; align-items: center; gap: 10px; position: relative; min-height: 52px; padding: 0 8px 0 16px; background: var(--navy); color: #fff; }
    .manage-compact .brand { font: 500 12px var(--mono); letter-spacing: .08em; color: var(--ink-on-navy); text-transform: uppercase; white-space: nowrap; }
    .manage-current { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .manage-menu summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--r); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
    .manage-menu summary::-webkit-details-marker { display: none; }
    .manage-menu summary:focus-visible { outline: 4px solid var(--amber); outline-offset: -4px; }
    .manage-menu[open] summary { background: rgba(255,255,255,.14); }
    .manage-menu-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 12px; background: var(--navy); border-top: 1px solid rgba(255,255,255,.18); box-shadow: 0 8px 18px rgba(20,33,61,.25); }
    .manage-menu-list a, .manage-menu-list button { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: var(--r); color: #fff; text-decoration: none; font-size: 16px; font-weight: 600; background: none; border: none; width: 100%; text-align: left; font-family: inherit; }
    .manage-menu-list a.active { background: var(--amber); color: var(--navy); }
    .manage-menu-list .spacer { height: 1px; margin: 6px 4px; background: rgba(255,255,255,.18); }
    .manage-menu-list .ghost { border: 2px solid rgba(255,255,255,.35); }
    .manage-menu-list form { display: block; }
    .manage-menu-list svg { display: none; }
}
.manage-main { flex: 1; min-width: 0; padding: 24px 28px 48px; max-width: 1180px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.manage-main h1 { font-size: 30px; }
.manage-main h2 { font-size: 21px; }
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.toolbar .field { min-width: 180px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.reasons { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.b { height: 44px; padding: 0 16px; border-radius: var(--r); font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border: 2px solid var(--navy); background: var(--surface); color: var(--navy); white-space: nowrap; }
.b.primary { background: var(--navy); color: #fff; }
.b.confirm { background: var(--green); border-color: var(--green); color: #fff; }
.b.quiet { border-color: var(--border); }
.b.small { height: 34px; padding: 0 10px; font-size: 14px; }
.b[disabled] { opacity: .45; cursor: default; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; font-size: 16px; }
.table th { text-align: left; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--border); background: #F7F9FB; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { color: var(--ink-3); }
.table tr.inactive a:not(.b) { color: var(--ink-3); }
.table tr.inactive .thumb img { filter: grayscale(1); opacity: .6; }
.table a { font-weight: 600; }
.tag { display: inline-block; font: 500 12px var(--mono); letter-spacing: .04em; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border); color: var(--ink-2); background: var(--bg); white-space: nowrap; }
.tag.ok { border-color: var(--green); color: var(--green); background: var(--surface); }
.tag.off { border-style: dashed; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--border); border-radius: var(--r); padding: 6px 10px; background: var(--surface); font-size: 15px; cursor: pointer; }
.chip.on { border-color: var(--navy); background: #F2F4F8; }
.days { display: flex; gap: 8px; flex-wrap: wrap; }
.days button { min-width: 52px; height: 44px; border: 2px solid var(--border); border-radius: var(--r); font-weight: 600; background: var(--surface); }
.days button.on { background: var(--amber); border-color: var(--navy); }
.zone-head { font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }

/* Zo werkt het: short paragraphs for a colleague, one column that stays readable. */
.prose { max-width: 760px; display: flex; flex-direction: column; gap: 10px; }
.prose h2 { margin-top: 16px; }
.prose p { margin: 0; line-height: 1.5; }
.prose ul { margin: 0; padding-left: 22px; line-height: 1.5; }

/* Nieuw artikel: three big choices — a chip grown up, with a sentence under the word. On a phone
   they stack. */
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kind { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 76px; padding: 12px 14px; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); text-align: left; cursor: pointer; }
.kind strong { font-size: 18px; }
.kind span { font-size: 14px; color: var(--ink-3); line-height: 1.35; }
.kind.on { border-color: var(--navy); background: #F2F4F8; }
@media (max-width: 640px) {
    .kinds, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Purchase price (PriceInput, VatSwitch; Verpakking bewerken and Prijzen) ────────────────── */
/* A narrow field, amounts right-aligned in tabular figures so a column of prices reads down. The
   line underneath is the live "= 2,64 incl. btw" on excl., or why the amount is not taken: a
   plain note, never red. */
.price { display: inline-flex; flex-direction: column; gap: 4px; width: 132px; flex: none; }
.price input, .field .price input { font: inherit; font-size: 17px; height: 44px; padding: 0 12px; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--ink); width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
.price input[aria-invalid] { border-color: var(--slate); border-style: dashed; }
.price-note { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.price-row { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.price-row .chips { min-height: 44px; align-items: center; }

/* Prijzen: one table for the laptop; on a phone it scrolls sideways rather than squeezing. */
.table-scroll { overflow-x: auto; border-radius: var(--r-card); }
.table.prices { min-width: 760px; }
.table.prices td { vertical-align: middle; }
.price-visual { display: block; width: 64px; height: 48px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.price-cell { display: inline-flex; align-items: flex-start; gap: 8px; }
.price-cell .tag { margin-top: 12px; }

/* ── Package photo (Verpakking bewerken) ────────────────────────────────────────────────────── */
/* Cropped like the tiles on the tablet (object-fit: cover), so what you see is what they see. */
.photo-edit { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.photo-frame { width: 200px; height: 200px; flex: none; border: 2px solid var(--border); border-radius: var(--r); background: #F4F6F9; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame.empty { border-style: dashed; }
.photo-frame.new { border-color: var(--navy); }
.photo-side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 12px; }
.photo-drop { border: 2px dashed var(--slate); border-radius: var(--r); background: #F7F9FB; padding: 22px 20px; font-size: 17px; color: var(--ink-2); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.photo-drop.over { border-color: var(--navy); background: #F2F4F8; }
/* A mouse means a laptop: no camera to open, so Foto nemen would only repeat Bestand kiezen. */
@media (pointer: fine) { .photo-camera { display: none; } }
/* The waiting block photo.js fills while the photo waits for the connection; while it shows, the
   buttons and the text step aside so a second tap cannot start another photo. */
.photo-wait:empty { display: none; }
.photo-wait { display: flex; align-items: center; gap: 12px; font-size: 17px; color: var(--ink-2); }
.photo-wait img { width: 72px; height: 72px; flex: none; object-fit: cover; border: 2px solid var(--navy); border-radius: var(--r); }
.photo-drop:has(.photo-wait:not(:empty)) > :not(.photo-wait) { display: none; }
.spinner { width: 20px; height: 20px; flex: none; border: 3px solid var(--border); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.thumb { width: 44px; height: 44px; flex: none; border: 1px solid var(--border); border-radius: 4px; background: #F4F6F9; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.empty { border-style: dashed; font: 500 10px var(--mono); color: var(--ink-4); text-align: center; line-height: 1.1; }
.table.thumbs td { vertical-align: middle; }

/* ── Barcodes koppelen ──────────────────────────────────────────────────────────────────────── */
.link-card { border: 2px solid var(--navy); padding: 24px 28px; gap: 12px; }
/* A scan hint is a status, never a field: no box around the icon, no text cursor, no focus ring. */
.scan-hint { display: flex; align-items: center; gap: 18px; font-size: 22px; font-weight: 600; padding: 14px 0; cursor: default; user-select: none; }
.scan-hint svg { flex: none; color: var(--navy); }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); font-weight: 600; text-decoration: none; }
.tabs a.on { background: var(--amber); border-color: var(--navy); color: var(--navy); }

/* Tab "Eerst scannen" */
.sf-top { position: sticky; top: 0; z-index: 10; display: flex; flex-direction: column; gap: 10px; background: var(--bg); padding: 8px 0; margin: -8px 0; }
.sf-scan { background: #F2F4F8; border: 0; border-left: 6px solid var(--navy); padding: 20px 24px; gap: 10px; cursor: default; }
.sf-scan.known { border-left-color: var(--green); }
.sf-code { font-size: 34px; letter-spacing: .04em; line-height: 1.1; }
.sf-status { font-size: 22px; font-weight: 600; }
.sf-undo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 19px; }
.sf-search input[type=search] { height: 56px; font-size: 20px; }
.sf-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sf-filters .b.on { background: var(--navy); color: #fff; }
.sf-group { display: flex; flex-direction: column; gap: 10px; }
.sf-product { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.sf-product-name { font-size: 19px; font-weight: 700; padding: 2px 4px 0; }
.sf-row { width: 100%; min-height: 56px; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 10px 14px; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); }
.sf-row:hover { border-color: var(--navy); }
.sf-row .sf-main { font-size: 18px; flex: 1 1 260px; }
.sf-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sf-facts .sf-where { color: var(--ink-3); font-size: 15px; }
.sf-facts .chip { cursor: inherit; padding: 2px 8px; }

/* ── Voorraad (StockPage) ───────────────────────────────────────────────────────────────────── */
/* One row per product that opens to its packages × places. States are a word in a tag, never
   colour alone and never red (STIJLGIDS §2): below the minimum is a navy outline, too old a
   slate one, "never counted" and "lies on no place" dashed. */
.tag.short { border-color: var(--navy); color: var(--navy); background: var(--surface); }
.tag.stale { border-color: var(--slate); color: var(--ink-2); background: var(--surface); }
.stock-list { display: flex; flex-direction: column; gap: 8px; }
.stock-product { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.stock-product.open { border-color: var(--navy); }
.stock-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; }
.stock-toggle { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 6px; border: 0; background: transparent; text-align: left; border-radius: var(--r); cursor: pointer; }
.stock-visual { width: 72px; height: 56px; flex: none; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.stock-name { flex: 1 1 180px; display: flex; flex-direction: column; font-size: 17px; }
.stock-name .muted { font-size: 14px; }
.stock-amount { flex: 0 1 190px; display: flex; flex-direction: column; font-size: 16px; }
.stock-amount .muted { font-size: 14px; }
.stock-tags { flex: 0 1 230px; display: flex; flex-wrap: wrap; gap: 4px; }
.stock-caret { color: var(--ink-3); font-size: 16px; }
.stock-detail { border-top: 1px solid var(--border); padding: 10px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.stock-package { display: flex; flex-direction: column; gap: 4px; }
.stock-package-name { display: flex; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.stock-place { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-height: 44px; padding: 4px 0 4px 12px; border-left: 3px solid var(--border); }
.stock-where { flex: 1 1 180px; font-size: 16px; }
.stock-count { flex: 0 1 240px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 16px; }
.stock-edit { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 6px 12px; border-left: 3px solid var(--amber); }
.stock-edit .pad { flex: none; max-width: 560px; grid-auto-rows: 60px; }
.stock-edit .key.word { font-size: 20px; }
@media (max-width: 640px) {
    .manage-main { padding: 16px 16px 40px; }
    .stock-head { padding-right: 8px; }
    .stock-amount, .stock-tags { flex-basis: 100%; }
    .stock-edit .pad.levels { grid-template-columns: repeat(2, 1fr); }
}

/* ── Boodschappenlijst (ShoppingListPage) ───────────────────────────────────────────────────── */
/* Phone-first: used in the shop. One group per shop with a head that stays in view while its
   cards scroll; a card is the package photo left, the text right. The package name and article
   number are buttons that copy (js/copy.js), with a hint that turns into "Gekopieerd". */
.buy-shop, .buy-check { display: flex; flex-direction: column; gap: 8px; }
.buy-check { margin-top: 18px; }
.buy-check p { margin: 0; }
.buy-shop-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 10px 0 0; padding: 10px 2px 8px; background: var(--bg); border-bottom: 2px solid var(--navy); }
.buy-shop-count { font: 500 13px var(--mono); letter-spacing: .04em; color: var(--ink-3); white-space: nowrap; }
.buy-card { display: flex; gap: 12px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.buy-visual { width: 96px; height: 80px; flex: none; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.buy-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.buy-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.buy-title strong { font-size: 18px; line-height: 1.2; }
.buy-copy { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); text-align: left; font-size: 16px; }
.buy-copy-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.buy-copy-hint { flex: none; font: 500 12px var(--mono); letter-spacing: .04em; color: var(--ink-3); }
.buy-copy.copied { border-color: var(--green); background: var(--surface); }
.buy-copy.copied .buy-copy-hint { color: var(--green); }
.buy-copy.mono .buy-copy-text { font-family: var(--mono); }
.buy-package { font-size: 16px; }
.buy-ref { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.buy-ref .buy-copy { width: auto; flex: 1; }
.buy-need { font-size: 18px; font-weight: 700; color: var(--navy); }
.buy-small { font-size: 14px; }
.buy-notice { padding: 6px 10px; font-size: 14px; }
@media (max-width: 640px) {
    .buy-visual { width: 72px; height: 64px; }
}

/* ══ Counting flow (docs/design/telflow.html, reference 1024 × 700) ═══════════════════════════ */
/* One column over the full height that is really there: in Chrome with its address bar and as the
   installed app (decision 52) that height differs, so dvh, with vh as the fallback. The top bar and
   the bottom (strip, confirm button) never shrink; the middle does, and what still does not fit
   scrolls inside the middle, never the page. Checked at 1280 × 800, 1280 × 650 and 1024 × 600. */
.tablet { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; overflow: hidden; }

/* Mission bar (STIJLGIDS §5.1) */
.topbar { background: var(--navy); color: #fff; padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex: none; }
.topbar .zone { font: 500 14px var(--mono); letter-spacing: .04em; color: var(--ink-on-navy); flex: none; text-transform: uppercase; }
.topbar .left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.missions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; flex: 1; max-width: 760px; min-width: 0; }
.mission { height: 40px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 600; padding: 0 8px; min-width: 0; }
.mission span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mission svg { flex: none; }
.mission.done { background: var(--green); color: #fff; }
.mission.now { background: var(--amber); color: var(--navy); font-weight: 700; }
.mission.todo { border: 2px dashed rgba(255,255,255,.35); color: var(--ink-on-navy); }
.btn-ghost-light { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 2px solid rgba(255,255,255,.35); border-radius: var(--r); font-size: 16px; color: #fff; flex: none; text-decoration: none; }
.pause-icon { display: flex; gap: 4px; }
.pause-icon span { width: 5px; height: 18px; background: currentColor; border-radius: 1px; }

.tbody { flex: 1; display: flex; min-height: 0; overflow: hidden; }
.tmain { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; }
.tmain > * { flex-shrink: 0; }
/* The confirm button stays in view, also when the middle has to scroll. */
.tmain > .btn-confirm { position: sticky; bottom: 0; }

/* Step rail (STIJLGIDS §5.2) */
.rail { width: 200px; padding: 28px 22px; display: flex; flex-direction: column; border-right: 1px solid var(--border); flex: none; min-height: 0; overflow: hidden; }
.step { display: flex; gap: 12px; }
.step .col { display: flex; flex-direction: column; align-items: center; }
.step .dot { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex: none; }
.step .line { width: 3px; height: 56px; background: var(--border); }
.step .txt { padding-top: 8px; }
.step .name { font-size: 20px; font-weight: 700; }
.step .sub { font-size: 14px; color: var(--ink-3); }
.step.todo .dot { border: 3px solid var(--border); color: var(--ink-4); }
.step.todo .name { color: var(--ink-4); }
.step.now .dot { background: var(--amber); color: var(--navy); }
.step.done .dot { background: var(--green); color: #fff; }
.step.done .line { background: var(--green); }
.step.done .sub { color: var(--green); }
.step.skipped .dot { border: 3px solid var(--ink-4); color: var(--ink-3); }
.step.skipped .dot i { width: 16px; height: 3px; background: currentColor; border-radius: 2px; }
.step.skipped .name { color: var(--ink-3); }
/* Not the 44 px table thumbnail of the management screens, which shares the class name. */
.rail .thumb { margin-top: auto; display: flex; flex-direction: column; gap: 6px; width: auto; height: auto; border: 0; border-radius: 0; background: none; overflow: visible; }
.rail .thumb .tname { font-size: 15px; font-weight: 600; }
.rail-thumb { width: 150px; height: 120px; }

/* Product strip (STIJLGIDS §5.3) */
.strip { background: var(--surface); border-top: 1px solid var(--border); padding: 12px 28px; display: flex; gap: 8px; align-items: center; flex: none; overflow-x: auto; }
.strip .lbl { font: 500 12px var(--mono); color: var(--ink-3); width: 92px; line-height: 1.3; flex: none; }
.strip .lbl small { display: block; color: var(--ink-4); font: inherit; }
.tile { width: 100px; height: 72px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 18px; position: relative; flex: none; }
.tile.todo { border: 2px solid var(--border); background: var(--surface); overflow: hidden; }
/* A counted tile keeps its product visible, so a guest can find the one to check: same size and
   visual as a waiting tile, with a green border and a green bar carrying the check and the count. */
.tile.done { border: 2px solid var(--green); background: var(--surface); overflow: hidden; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; }
.tile.done .visual { flex: 1; min-height: 0; height: auto; padding: 2px 4px; }
.tile.done .visual .vname { font-size: 12px; line-height: 1.05; }
.tile.done .tally { flex: none; height: 24px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 18px; font-weight: 700; line-height: 1; white-space: nowrap; }
.tile.current { outline: 3px solid var(--amber); outline-offset: 2px; }
.tile.locking { animation: lock .5s ease-out; }
/* "Tel alleen wat nog dicht is." on Geteld and the typed total (decision 58). */
.closed-only { font-size: 20px; font-weight: 700; color: var(--ink); }
/* Which package, over the photo, when the product has more than one that is counted (decision 58). */
.tile-pkg { position: absolute; top: 0; left: 0; right: 0; padding: 1px 4px; background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 600; line-height: 1.25; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
@keyframes lock { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* Package visual: a photo, or (for most packages, which have none) name and content, readable
   on its own (mockup-afwijkingen §3). Never an empty frame or a generic icon. */
.visual { width: 100%; height: 100%; border-radius: var(--r); overflow: hidden; background: #F4F6F9; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px; gap: 4px; color: var(--ink); }
.visual img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.visual.has-photo { padding: 0; }
.visual .vname { font-weight: 700; line-height: 1.1; overflow-wrap: break-word; hyphens: auto; max-width: 100%; }
.visual .vsub { color: var(--ink-2); line-height: 1.15; }
.visual.hero .vname { font-size: 40px; } .visual.hero .vsub { font-size: 26px; }
.visual.hero img { object-fit: contain; }
.visual.msg .vname { font-size: 24px; } .visual.msg .vsub { font-size: 18px; }
.visual.rail .vname { font-size: 18px; } .visual.rail .vsub { font-size: 15px; }
.visual.card .vname { font-size: 24px; } .visual.card .vsub { font-size: 18px; }
.visual.small .vname { font-size: 17px; } .visual.small .vsub { font-size: 15px; }
.visual.tile { padding: 4px 5px; gap: 1px; background: transparent; }
.visual.tile .vname { font-size: 13px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.visual.tile .vsub { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.visual.dim { filter: grayscale(.6); opacity: .85; }

/* Text roles */
.h-screen { font-size: 42px; font-weight: 700; line-height: 1.05; }
.h-question { font-size: 38px; font-weight: 700; line-height: 1.1; }
.h-product { font-size: 44px; font-weight: 700; line-height: 1.05; }
.h-card { font-size: 32px; font-weight: 700; line-height: 1.15; }
.mark { background: var(--amber); padding: 0 10px; border-radius: 4px; }

/* Number tiles (STIJLGIDS §5.4) */
.pad { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(60px, 1fr); gap: 10px; flex: 1 1 0; }
.pad.levels { grid-template-columns: repeat(4, 1fr); }
.key { border-radius: var(--r); background: var(--surface); border: 2px solid var(--border); font-size: 38px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-direction: column; line-height: 1; }
.key.more { font-size: 24px; color: var(--ink-2); }
.key.word { font-size: 30px; }
.key.chosen { background: var(--amber); border-color: var(--navy); }
.key.chosen small { font-size: 13px; font-weight: 600; margin-top: 4px; }
.key.preset { border-color: var(--navy); border-width: 3px; }
/* "Meer": a telephone keypad (decision 61) — the number big on top, then 1 2 3 / 4 5 6 / 7 8 9 / ⌫ 0 ✓. */
.more-pad { display: flex; flex-direction: column; gap: 10px; flex: 1 1 0; width: 100%; max-width: 480px; min-height: 0; }
.more-display { flex: none; height: 96px; border-radius: var(--r); background: var(--surface); border: 3px solid var(--navy); font-size: 80px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pad.phone { grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(52px, 1fr); }
.pad.phone .key { font-size: 40px; }
.pad.phone .key.erase { color: var(--ink-2); }
.pad.phone .key.ok { background: var(--green); border-color: var(--green); color: #fff; }

/* Rule strip: what is a full package */
.rule { display: flex; gap: 12px; }
.rule > div { flex: 1; display: flex; align-items: center; gap: 12px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--r); padding: 10px 14px; }
.rule .yes { border-color: var(--green); }
.rule .t { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 700; }
.rule .yes .t { color: var(--green); }
.rule .no .t { color: var(--ink-3); }
.rule .s { font-size: 17px; color: var(--ink-2); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.card.msg { width: 680px; max-width: 100%; border: 2px solid var(--slate); padding: 28px 32px; display: flex; gap: 26px; align-items: center; text-align: left; }
.card.msg.ok { border-color: var(--green); }
.card.done { width: 600px; max-width: 100%; border: 0; background: var(--green); color: #fff; padding: 26px 30px; display: flex; align-items: center; gap: 22px; text-align: left; }
.frame { border-radius: var(--r); overflow: hidden; flex: none; position: relative; }
/* The big photo on Gevonden and Geteld shrinks with the height of the screen. */
.hero-frame { width: min(300px, 42vh); height: min(300px, 42vh); width: min(300px, 42dvh); height: min(300px, 42dvh); outline: 4px solid var(--green); outline-offset: 4px; }
.intro-tile { height: 72px; border: 2px solid var(--border); }
/* "Er ligt niets meer": one tile size however many are left, from the left, five abreast on the
   tablet (landscape, next to the rail). The photo is shown whole, never cropped (decision 61). */
.pick-grid { flex: 1 1 0; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, 184px); grid-auto-rows: 190px; gap: 14px; justify-content: start; align-content: start; }
.pick-tile { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; border-width: 2px; }
.pick-tile .frame { flex: 1; min-height: 0; width: 100%; }
.pick-tile .visual.has-photo { background: transparent; }
.pick-tile .visual img { object-fit: contain; }
.pick-tile .visual.card .vname { font-size: 20px; } .pick-tile .visual.card .vsub { font-size: 16px; }
.pick-label { flex: none; font-size: 16px; font-weight: 600; line-height: 1.2; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tally-count { font-size: 72px; }
.unknown-box { width: 180px; height: 180px; flex: none; border-radius: var(--r); border: 3px dashed var(--ink-4); display: flex; align-items: center; justify-content: center; font-size: 80px; font-weight: 700; color: var(--ink-4); }

.scanbox { width: 340px; height: 170px; border: 3px solid var(--navy); border-radius: var(--r-card); position: relative; display: flex; align-items: center; justify-content: center; background: var(--surface); }
.scanbox::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 3px; background: var(--amber); }
.toast { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--green); border-radius: var(--r); padding: 10px 18px; font-size: 18px; white-space: nowrap; }
.center { flex: 1; display: flex; flex-direction: column; align-items: safe center; justify-content: safe center; gap: 20px; text-align: center; padding: 24px; position: relative; min-height: 0; overflow-y: auto; }
.fade { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fade, .tile.locking { animation: none; } }

.overlay { position: absolute; inset: 0; background: rgba(20,33,61,.94); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; z-index: 50; padding: 24px; }
.overlay .link { color: var(--ink-on-navy); }

/* Shelf done: the bar grows into the whole screen */
.shelfdone { flex: 1; background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 32px 44px; gap: 22px; overflow: auto; }
.shelfdone .tiles { display: grid; grid-template-columns: repeat(4, 110px); gap: 10px; align-content: safe center; max-height: 100%; overflow-y: auto; }
.shelfdone .tiles div { height: 100px; border-radius: var(--r); background: var(--green); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; padding: 4px; text-align: center; gap: 2px; }
.shelfdone .tiles div small { font-size: 12px; font-weight: 500; line-height: 1.1; max-height: 2.2em; overflow: hidden; }
.shelfdone .tiles div.missing { background: transparent; border: 2px dashed rgba(255,255,255,.35); color: var(--ink-on-navy); }

/* Vandaag tellen */
.today { flex: 1; overflow: auto; padding: 28px 36px; display: flex; flex-direction: column; gap: 18px; }
.today-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.today-tile { min-height: 132px; border-radius: var(--r-card); background: var(--surface); border: 2px solid var(--border); padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; text-align: left; text-decoration: none; color: var(--ink); }
.today-tile .tname { font-size: 24px; font-weight: 700; line-height: 1.15; }
.today-tile .tstate { font-size: 17px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.today-tile.resume { border: 3px solid var(--amber); }
.today-tile.resume .tstate { color: var(--navy); font-weight: 600; }
.today-tile.done { background: var(--green); border-color: var(--green); color: #fff; }
.today-tile.done .tstate { color: #fff; }
h1:focus { outline: none; }

/* A lower tablet screen (Chrome with its address bar, 1024 × 600): the same screens, tighter. */
@media (max-height: 720px) {
    .topbar { padding-top: 10px; padding-bottom: 10px; }
    .rail { padding: 18px 18px; }
    .step .dot { width: 38px; height: 38px; font-size: 18px; }
    .step .line { height: 28px; }
    .step .txt { padding-top: 5px; }
    .rail-thumb { width: 130px; height: 80px; }
    .h-screen { font-size: 34px; }
    .h-question { font-size: 30px; }
    .h-product { font-size: 36px; }
    .h-card { font-size: 26px; }
    .tally-count { font-size: 56px; }
    .center { gap: 14px; padding: 16px 24px; }
    .tmain { padding-top: 16px !important; padding-bottom: 16px !important; gap: 12px !important; }
    .btn { height: 60px; }
    .btn-confirm { height: 64px; }
    .btn-secondary { height: 50px; }
    .scanbox { width: 280px; height: 120px; }
    .scanbox svg { width: 110px; height: 55px; }
    .card.msg { padding: 20px 24px; }
    .intro-tile { height: 56px; }
    .pick-grid { grid-template-columns: repeat(auto-fill, 164px); grid-auto-rows: 168px; gap: 12px; }
    .strip { padding-top: 8px; padding-bottom: 8px; }
    .tile { height: 64px; }
    .rule > div { padding: 6px 12px; }
    .more-display { height: 76px; font-size: 64px; }
    .pad.phone .key { font-size: 34px; }
    .shelfdone { padding: 22px 36px; gap: 16px; }
    .today { padding: 20px 32px; }
}
