/* QR-beheer (qr-admin/): the shell and the movement of the platform and the
   restaurant app (Victor, 14 October 2026: "Pas het design van de app aan
   zodat hij exact zo vloeit als de andere"): porcelain and wine, a rail on a
   computer, the glass capsule tab bar with its sliding lens on a phone, pages
   swapped in place (app.js) with the same settle, progress line, orbs and
   toasts. The same tokens and values as platform-admin's shared-look block.
   No inline style anywhere (style-src 'self'). */

@font-face {
  font-family: "DigiSomm Display";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/digisomm-display-latin.woff2?v=2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DigiSomm Display";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/digisomm-display-latin-ext.woff2?v=2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Commissioner";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/commissioner-latin.woff2?v=1") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Commissioner";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/commissioner-latin-ext.woff2?v=1") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --page: #f6f5f8;
  --surface: #ffffff;
  --surface-3: #efedf2;
  --ink: #221b26;
  --muted: #5e5664;
  --faint: #857c8c;
  --line: #e3dfe7;
  --wine: #7a1b2e;
  --wine-ink: #ffffff;
  --wine-text: #7a1b2e;
  --wine-soft: #f4e8ec;
  --ok: #1f6b45;
  --ok-soft: #e3f2e9;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --error: #a3202f;
  --error-soft: #fbe9eb;
  --radius: 12px;
  --rail-width: 232px;
  --glass-fill: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.8);
  --glass-lens: rgba(255, 255, 255, 0.66);
  --glass-lens-edge: rgba(255, 255, 255, 0.95);
  --glass-shade: rgba(34, 27, 38, 0.1);
  --raise-2: rgba(34, 27, 38, 0.07);
  --raise-3: rgba(34, 27, 38, 0.13);
  --display: "DigiSomm Display", Georgia, serif;
  --text: "Commissioner", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #141116;
    --surface: #1d1920;
    --surface-3: #27222b;
    --ink: #f1edf4;
    --muted: #b3aab9;
    --faint: #8e8595;
    --line: #342e39;
    --wine: #b3344f;
    --wine-ink: #ffffff;
    --wine-text: #eb5d66;
    --wine-soft: #3a151d;
    --ok: #6fd19c;
    --ok-soft: #173326;
    --warn: #e7b25a;
    --warn-soft: #3a2f1c;
    --error: #ef8090;
    --error-soft: #3d2126;
    --glass-fill: rgba(40, 34, 44, 0.74);
    --glass-edge: rgba(255, 255, 255, 0.14);
    --glass-lens: rgba(255, 255, 255, 0.12);
    --glass-lens-edge: rgba(255, 255, 255, 0.24);
    --glass-shade: rgba(0, 0, 0, 0.4);
    --raise-2: rgba(0, 0, 0, 0.3);
    --raise-3: rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; overflow-x: clip; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 var(--text); -webkit-tap-highlight-color: transparent; overflow-x: clip; }
a { color: var(--wine-text); }
code { font-family: var(--mono); font-size: .92em; letter-spacing: .02em; }
h1, h2 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.25rem; margin-bottom: .4rem; }

.qr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qr-muted { color: var(--muted); }
.qr-help { margin-top: 1rem; font-size: .9rem; }
.qr-help-top { margin: -0.4rem 0 1rem; font-size: .9rem; max-width: 70ch; }
.qr-skip { position: absolute; left: -999px; top: 8px; z-index: 80; padding: 8px 12px; background: var(--surface); border-radius: 8px; }
.qr-skip:focus { left: 8px; }

.qr-icon { display: block; flex: 0 0 auto; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.qr-icon--cards { --icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%271.7%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Crect%20x=%273.5%27%20y=%273.5%27%20width=%276.5%27%20height=%276.5%27%20rx=%271.4%27/%3E%3Crect%20x=%2714%27%20y=%273.5%27%20width=%276.5%27%20height=%276.5%27%20rx=%271.4%27/%3E%3Crect%20x=%273.5%27%20y=%2714%27%20width=%276.5%27%20height=%276.5%27%20rx=%271.4%27/%3E%3Cpath%20d=%27M14%2014h2.5M19.5%2014h1M14%2017.25h1M17.25%2017.25h3.25M14%2020.5h3.25M20.5%2020.5h0%27/%3E%3C/svg%3E"); }
.qr-icon--scan { --icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%271.7%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M4%208.5V6a2%202%200%200%201%202-2h2.5M15.5%204H18a2%202%200%200%201%202%202v2.5M20%2015.5V18a2%202%200%200%201-2%202h-2.5M8.5%2020H6a2%202%200%200%201-2-2v-2.5%27/%3E%3Cpath%20d=%27M7.5%2012h9%27/%3E%3C/svg%3E"); }
.qr-icon--restaurants { --icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%271.7%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Cpath%20d=%27M4%209.5%205.5%204h13L20%209.5%27/%3E%3Cpath%20d=%27M4%209.5c0%201.4%201.1%202.5%202.7%202.5S9.3%2010.9%209.3%209.5c0%201.4%201.2%202.5%202.7%202.5s2.7-1.1%202.7-2.5c0%201.4%201.1%202.5%202.6%202.5S20%2010.9%2020%209.5%27/%3E%3Cpath%20d=%27M5.5%2012v8h13v-8%27/%3E%3Cpath%20d=%27M10%2020v-4.5h4V20%27/%3E%3C/svg%3E"); }
.qr-icon--batches { --icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%271.7%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Crect%20x=%276.5%27%20y=%273.5%27%20width=%2711%27%20height=%2714%27%20rx=%271.6%27/%3E%3Cpath%20d=%27M4%207.5v11a2%202%200%200%200%202%202h9%27/%3E%3Cpath%20d=%27M9.5%208h5M9.5%2011h5M9.5%2014h3%27/%3E%3C/svg%3E"); }
.qr-icon--log { --icon: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%271.7%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Ccircle%20cx=%2712%27%20cy=%2712%27%20r=%278.5%27/%3E%3Cpath%20d=%27M12%207.5V12l3%202%27/%3E%3C/svg%3E"); }

/* --- Shell: the rail on a computer ------------------------------------------- */

.qr-rail {
  position: fixed; inset: 0 auto 0 0; z-index: 20;
  display: flex; flex-direction: column; gap: 1.25rem;
  width: var(--rail-width); padding: 1.25rem .9rem;
  background: var(--surface); border-right: 1px solid var(--line);
}
.qr-brand { display: flex; align-items: center; gap: .7rem; padding: .2rem .5rem .6rem; color: var(--ink); text-decoration: none; }
.qr-brand span { display: grid; line-height: 1.15; }
.qr-brand strong { font-family: var(--display); font-size: 1.2rem; font-weight: 600; }
.qr-brand small { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.qr-nav { display: grid; gap: 2px; }
.qr-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; color: var(--muted); font-weight: 600; text-decoration: none; transition: background-color 160ms ease, color 160ms ease; }
@media (hover: hover) { .qr-nav a:hover { background: var(--surface-3); color: var(--ink); } }
.qr-nav a[aria-current="page"] { color: var(--wine-text); background: var(--wine-soft); }
.qr-rail-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .5rem; }
.qr-rail-foot form { margin: 0; }
.qr-env { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: #f26b1d; padding: .15rem .55rem; border-radius: 999px; }

.qr-main { min-height: 100vh; margin-left: var(--rail-width); }
.qr-bar { display: none; }
.page-body { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }

.qr-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.qr-head p { margin: 0; }

/* --- Notices and toasts ----------------------------------------------------- */

.qr-notice { margin: 0 0 1rem; padding: .7rem 1rem; border-radius: var(--radius); background: var(--wine-soft); color: var(--ink); }
.qr-notice--error { background: var(--error-soft); color: var(--error); }
.toast-region { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: grid; justify-items: end; gap: 8px; pointer-events: none; }
.toast { max-width: min(460px, calc(100vw - 32px)); margin: 0; padding: 10px 14px; color: #fff; background: #22201f; border-radius: 10px; box-shadow: 0 18px 40px -16px var(--raise-3); font-size: 13.5px; font-weight: 500; animation: toast-in 180ms ease-out; }
.toast--error { background: #9c2033; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* --- Controls --------------------------------------------------------------- */

label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
input[type="text"], input[type="search"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; min-height: 40px; padding: .5rem .7rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 400 15px/1.3 var(--text);
}
textarea { font-family: var(--mono); font-size: 14px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
html[data-modality="pointer"] .qr-shell :focus-visible:not(input, select, textarea) { outline: none; }
.qr-check { flex-direction: row; align-items: center; gap: .45rem; font-weight: 500; color: var(--ink); }
.qr-check input { width: 18px; height: 18px; accent-color: var(--wine); }

button { font: 600 15px/1 var(--text); cursor: pointer; color: inherit; }
.qr-primary, .qr-secondary { position: relative; min-height: 40px; padding: 0 1.1rem; border-radius: 10px; transition: transform 120ms ease, background-color 160ms ease, opacity 160ms ease; }
.qr-primary { background: var(--wine); color: var(--wine-ink); border: 1px solid var(--wine); }
.qr-primary:disabled { opacity: .45; cursor: default; }
.qr-secondary { background: var(--surface); color: var(--wine-text); border: 1px solid var(--wine); }
.qr-quiet { background: none; border: 0; padding: .4rem .2rem; color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
:is(.qr-primary, .qr-secondary):active { transform: scale(.98); }

/* --- Panels and forms ------------------------------------------------------- */

.qr-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin: 0 0 1.25rem; box-shadow: 0 1px 2px var(--raise-2), 0 10px 24px -20px var(--raise-3); }
.qr-panel > p { margin: 0 0 .9rem; }
.qr-quick { display: grid; gap: .6rem; margin-bottom: 1.25rem; }
.qr-fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px var(--raise-2); }
.qr-fold > summary { padding: .85rem 1.1rem; font-weight: 600; cursor: pointer; list-style-position: inside; }
.qr-fold > summary .qr-muted { font-weight: 400; margin-left: .35rem; }
.qr-fold[open] > summary { border-bottom: 1px solid var(--line); }
.qr-fold > form { padding: 1rem 1.1rem 1.1rem; }
details[open] > :not(summary) { animation: qr-settle 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.qr-row-form, .qr-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; }
.qr-row-form > label { flex: 1 1 160px; }
.qr-row-form > .qr-narrow, .qr-filter > .qr-narrow { flex: 0 1 110px; }
.qr-row-form > .qr-grow, .qr-filter > .qr-grow { flex: 2 1 220px; }
.qr-row-form > .qr-full { flex: 1 1 100%; }
.qr-row-form > .qr-check { flex: 1 1 100%; }
.qr-filter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; }
.qr-filter > label { flex: 1 1 140px; }
.qr-filter-actions { display: flex; align-items: center; gap: .6rem; }
.qr-stack { display: grid; gap: 1rem; }

/* --- Bulk ------------------------------------------------------------------- */

.qr-bulk-bar {
  position: sticky; top: 12px; z-index: 4;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem;
  padding: .8rem 1rem; margin-bottom: .6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 24px -20px var(--raise-3);
}
.qr-bulk-bar > label { flex: 1 1 170px; }
.qr-bulk-bar > .qr-check { flex: 0 0 auto; }
.qr-bulk-which { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.qr-scope { display: flex; gap: .5rem 1.25rem; flex-wrap: wrap; border: 0; margin: 0; padding: 0; }

/* --- Tables ----------------------------------------------------------------- */

.qr-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px var(--raise-2); }
.qr-table { width: 100%; border-collapse: collapse; }
.qr-table th { text-align: left; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.qr-table td { padding: .6rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.qr-table tr:last-child td { border-bottom: 0; }
@media (hover: hover) { .qr-table tbody tr:hover { background: var(--page); } }
.qr-table tr.is-disabled td { color: var(--muted); }
.qr-table td input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--wine); }
.qr-num, .qr-table .qr-num { text-align: right; font-variant-numeric: tabular-nums; }
.qr-slug { display: block; font-size: .82rem; }
.qr-codes { font-family: var(--mono); font-size: .82rem; color: var(--muted); }
.qr-badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--wine-soft); color: var(--wine-text); }
.qr-badge--warn { background: var(--warn-soft); color: var(--warn); }
.qr-badge--off { background: var(--surface-3); color: var(--muted); }
.qr-inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.qr-inline-form input[type="number"] { width: 90px; }
.qr-inline-form select { width: auto; max-width: 240px; }
.qr-row-link { display: inline-flex; align-items: center; gap: .35rem; margin-top: .45rem; font-size: .88rem; font-weight: 600; text-decoration: none; }
.qr-row-link .qr-icon { width: 16px; height: 16px; }
.qr-empty { padding: 2rem 1rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.qr-pages { display: flex; justify-content: center; gap: 1.25rem; margin-top: 1rem; }

/* --- Scanning --------------------------------------------------------------- */

.qr-scan { display: grid; gap: 1rem; max-width: 640px; }
.qr-scan-setup { display: grid; gap: .7rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.qr-scan-stage {
  position: relative; overflow: hidden;
  aspect-ratio: 3 / 4; max-height: 62vh; width: 100%;
  background: #120e13; border-radius: 18px;
  box-shadow: 0 18px 40px -22px var(--raise-3);
}
.qr-scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.qr-scan-frame { position: absolute; inset: 18% 14%; pointer-events: none; transition: transform 180ms cubic-bezier(0.34, 1.5, 0.5, 1); }
.qr-scan-frame span { position: absolute; width: 34px; height: 34px; border: 3px solid rgba(247, 244, 238, .92); }
.qr-scan-frame span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.qr-scan-frame span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 12px 0 0; }
.qr-scan-frame span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.qr-scan-frame span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 12px 0; }
.qr-scan-stage.is-hit .qr-scan-frame { transform: scale(1.06); }
.qr-scan-stage.is-hit .qr-scan-frame span { border-color: #6fd19c; }
.qr-scan-stage.is-again .qr-scan-frame span { border-color: #e7b25a; }
.qr-scan-idle { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .9rem; padding: 1.5rem; text-align: center; color: #f1edf4; }
.qr-scan-idle .qr-icon { width: 46px; height: 46px; opacity: .8; }
.qr-scan-idle .qr-muted { color: rgba(241, 237, 244, .72); max-width: 30ch; margin: 0; font-size: .9rem; }
.qr-scan-status { position: absolute; left: 50%; bottom: 14px; margin: 0; max-width: calc(100% - 28px); transform: translateX(-50%); padding: .4rem .8rem; border-radius: 999px; background: rgba(18, 14, 19, .72); color: #fff; font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.qr-scan-status:empty { display: none; }
.qr-scan-stop { position: absolute; top: 12px; right: 12px; padding: .45rem .8rem; border: 0; border-radius: 999px; background: rgba(18, 14, 19, .6); color: #fff; font-size: .82rem; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.qr-scan-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.qr-scan-tally { margin: 0; font-weight: 600; }
.qr-scan-tally span { font-weight: 500; color: var(--muted); }
.qr-scan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qr-scan-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .3rem .8rem; padding: .55rem .5rem .55rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; animation: qr-settle 220ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.qr-scan-list .number { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.2em; }
.qr-scan-list .what { display: grid; min-width: 0; }
.qr-scan-list .what code { color: var(--muted); font-size: .8rem; }
.qr-scan-list .state { font-size: .88rem; font-weight: 600; }
.qr-scan-list li[data-state="free"] .state { color: var(--ok); }
.qr-scan-list li[data-state="here"] .state { color: var(--muted); }
.qr-scan-list li[data-state="other"] { border-color: var(--warn-soft); background: color-mix(in srgb, var(--warn-soft) 45%, var(--surface)); }
.qr-scan-list li[data-state="other"] .state { color: var(--warn); }
.qr-scan-list li[data-state="unknown"], .qr-scan-list li[data-state="disabled"] { border-color: var(--error-soft); }
.qr-scan-list li[data-state="unknown"] .state, .qr-scan-list li[data-state="disabled"] .state { color: var(--error); }
.qr-scan-list .remove { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 1.3rem; line-height: 1; }
@media (hover: hover) { .qr-scan-list .remove:hover { background: var(--surface-3); } }
.qr-scan-actions { position: sticky; bottom: 12px; z-index: 3; display: flex; justify-content: flex-end; }
.qr-scan-actions .qr-primary { min-width: 12rem; min-height: 46px; box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--wine) 80%, transparent); }

/* --- Sign-in ---------------------------------------------------------------- */

.qr-entry { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.qr-entry-card { width: min(100%, 380px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.8rem 1.6rem; box-shadow: 0 18px 40px -24px var(--raise-3); }
.qr-entry-card h1 { margin-bottom: 1rem; }
.qr-entry-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.6rem; }
.qr-entry-brand div { display: grid; }
.qr-entry-brand strong { font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.qr-entry-brand span { color: var(--muted); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; }

/* --- Movement: the other panels' -------------------------------------------- */

@keyframes qr-settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.region-enter { animation: qr-settle 240ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.live-progress { position: fixed; top: 0; left: 0; z-index: 70; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, var(--wine) 40%, var(--wine) 60%, transparent); transform: translateX(-100%); opacity: 0; pointer-events: none; }
.live-progress.is-on { opacity: 1; animation: live-progress 900ms cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes live-progress { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.is-busy { position: relative; opacity: .65; pointer-events: none; }
.orb { --orb-accent: var(--wine); --orb-ink: var(--muted); display: block; flex: none; }
.orb-20 { width: 20px; height: 20px; }
.orb-64 { width: 64px; height: 64px; }
:is(button, a).is-busy.is-thinking { opacity: 1; color: transparent; }
.is-thinking > :not(.orb) { visibility: hidden; }
.orb-in-control { position: absolute; top: 50%; left: 50%; margin: -10px 0 0 -10px; }
.screen-orb { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none; animation: qr-settle 240ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.screen-orb > .orb { box-sizing: content-box; padding: 14px; background: var(--surface); border-radius: 50%; box-shadow: 0 18px 40px -16px var(--raise-3); }
@media (min-width: 861px) { .screen-orb { left: var(--rail-width); } }
main#main-content.is-loading { opacity: .55; transition: opacity 180ms ease; }

/* The glass tab bar exists on a phone only. */
.tab-bar { display: none; }

/* --- Phone: the top bar and the glass capsule ------------------------------- */

@media (max-width: 860px) {
  @view-transition { navigation: auto; }
  .qr-rail { display: none; }
  .qr-main { margin-left: 0; }
  .qr-bar {
    position: sticky; top: 0; z-index: 25;
    display: flex; align-items: center; gap: .6rem;
    padding: calc(.6rem + env(safe-area-inset-top, 0px)) 1rem .6rem;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    view-transition-name: qr-topbar;
  }
  .qr-bar-title { flex: 1; font-family: var(--display); font-size: 1.15rem; font-weight: 600; }
  .qr-bar-signout { margin: 0; }
  .page-body { padding: 1rem 1rem calc(100px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 1.6rem; }
  .qr-bar ~ .page-body .qr-head h1 { display: none; }
  .qr-head { margin-bottom: .8rem; }

  input[type="text"], input[type="search"], input[type="number"], input[type="password"], select, textarea { font-size: 16px; min-height: 44px; }
  .qr-primary, .qr-secondary { min-height: 44px; }
  .qr-bulk-bar { top: calc(58px + env(safe-area-inset-top, 0px)); }
  .toast-region { right: 16px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); left: 16px; justify-items: center; }
  /* Landscape on a phone, so the stage, the tally and the button above the
     tab bar fit on one screen while scanning. */
  .qr-scan-stage { aspect-ratio: 4 / 3; max-height: 40vh; border-radius: 16px; }
  .qr-scan-frame { inset: 10% 24%; }
  .qr-scan-idle { gap: .6rem; }
  .qr-scan-idle .qr-icon { width: 34px; height: 34px; }
  .qr-scan-actions { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .qr-scan-actions .qr-primary { width: 100%; }

  .qr-table thead { display: none; }
  .qr-table, .qr-table tbody, .qr-table tr, .qr-table td { display: block; }
  .qr-table tr { padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
  .qr-table td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .qr-table td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; }
  .qr-table td:first-child:not([data-label]) { justify-content: flex-start; }
  .qr-table td:first-child:not([data-label])::before { content: none; }
  .qr-table--tenants td[data-label="Restaurant"] { display: block; text-align: left; }
  .qr-table--tenants td[data-label="Restaurant"]::before { content: none; }
  .qr-table--tenants td[data-label="Koppelen"] { flex-direction: column; align-items: flex-end; }
  .qr-inline-form { justify-content: flex-end; }

  /* The tab bar: the restaurant app's glass capsule, the current tab under a
     lens with a touch of bordeaux that slides to the tab just tapped. */
  .tab-bar {
    position: fixed; z-index: 30;
    left: 50%; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    width: min(calc(100% - 24px), 440px); min-height: 60px; padding: 4px;
    background: var(--glass-fill);
    border: 1px solid var(--glass-edge);
    border-radius: 999px;
    box-shadow: inset 0 1px 0 var(--glass-lens-edge), inset 0 -1px 0 var(--glass-shade), 0 1px 2px var(--raise-2), 0 18px 40px -16px var(--raise-3);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    backdrop-filter: blur(24px) saturate(1.8);
    transform: translateX(-50%);
    isolation: isolate; overflow: hidden;
    view-transition-name: qr-tabbar;
  }
  .tab-bar::before {
    content: ""; position: absolute; inset: 0 0 auto; height: 50%;
    background: linear-gradient(180deg, color-mix(in srgb, var(--glass-lens-edge) 55%, transparent), transparent);
    border-radius: 999px 999px 0 0; opacity: .55; pointer-events: none;
  }
  .tab-indicator {
    position: absolute; top: 4px; bottom: 4px; left: 4px; z-index: 0;
    display: block; width: calc((100% - 8px) / 5); overflow: hidden;
    background: color-mix(in srgb, var(--wine) 11%, var(--glass-lens));
    border-radius: 999px;
    box-shadow: inset 0 1px 0 var(--glass-lens-edge), inset 0 0 0 1px var(--glass-edge), inset 0 -2px 4px var(--glass-shade), 0 8px 18px -10px color-mix(in srgb, var(--wine) 55%, transparent), 0 3px 10px -4px var(--glass-shade);
    pointer-events: none;
    transform: translateX(calc(var(--slot, 0) * 100%));
    transition: transform 460ms cubic-bezier(0.34, 1.4, 0.5, 1), opacity 180ms linear;
  }
  .tab-indicator::after { content: ""; position: absolute; inset: 2px 10px auto; height: 46%; background: linear-gradient(180deg, var(--glass-lens-edge), transparent); border-radius: 999px 999px 50% 50%; opacity: .7; }
  .tab-bar[data-active="0"] .tab-indicator { --slot: 0; }
  .tab-bar[data-active="1"] .tab-indicator { --slot: 1; }
  .tab-bar[data-active="2"] .tab-indicator { --slot: 2; }
  .tab-bar[data-active="3"] .tab-indicator { --slot: 3; }
  .tab-bar[data-active="4"] .tab-indicator { --slot: 4; }
  .tab-bar > a {
    position: relative; z-index: 1;
    display: grid; justify-items: center; align-content: center; gap: 2px;
    min-width: 0; min-height: 52px; padding: 5px 2px 4px;
    color: var(--faint); font: 500 10.5px/1.1 var(--text); text-decoration: none;
    border-radius: 999px; -webkit-user-select: none; user-select: none;
    touch-action: manipulation; transition: color 200ms ease;
  }
  .tab-bar .qr-icon { width: 21px; height: 21px; transition: transform 360ms cubic-bezier(0.34, 1.5, 0.5, 1); }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-bar[data-active="0"] > [data-tab="0"],
  .tab-bar[data-active="1"] > [data-tab="1"],
  .tab-bar[data-active="2"] > [data-tab="2"],
  .tab-bar[data-active="3"] > [data-tab="3"],
  .tab-bar[data-active="4"] > [data-tab="4"] { color: var(--wine-text); font-weight: 650; }
  .tab-bar[data-active="0"] > [data-tab="0"] .qr-icon,
  .tab-bar[data-active="1"] > [data-tab="1"] .qr-icon,
  .tab-bar[data-active="2"] > [data-tab="2"] .qr-icon,
  .tab-bar[data-active="3"] > [data-tab="3"] .qr-icon,
  .tab-bar[data-active="4"] > [data-tab="4"] .qr-icon { transform: translateY(-1px) scale(1.06); }
  .tab-bar > :active .qr-icon { transform: scale(.84); transition-duration: 90ms; }
}
::view-transition-old(root) { animation: 140ms ease-out both qr-vt-out; }
::view-transition-new(root) { animation: 260ms cubic-bezier(0.2, 0.7, 0.2, 1) both qr-vt-in; }
@keyframes qr-vt-out { to { opacity: 0; } }
@keyframes qr-vt-in { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  details[open] > :not(summary), .region-enter, .live-progress.is-on, .screen-orb, .toast, .qr-scan-list li { animation: none; }
  .tab-indicator, .tab-bar .qr-icon, .qr-scan-frame { transition: none; }
  :is(.qr-primary, .qr-secondary):active { transform: none; }
  main#main-content.is-loading { transition: none; }
}
