/* SamenShop webapp: same design as the app 0.10 (apps/mobile/src/layout.tsx): fixed top, only the list scrolls, adding at
   the bottom. Colours from the same tokens, light and dark follow the device. No inline styles (CSP style-src 'self'). */
:root {
  --bg: #f4f6f2; --surface: #ffffff; --surface2: #eef2ec; --line: #e8ece6; --border: #dfe5dc; --text: #1c2a23; --muted: #5a695f;
  --ring: #8a978f; --accent: #1e6a48; --accent-soft: rgba(30, 106, 72, 0.10); --on-accent: #ffffff; --amber: #8a5300;
  --amber-soft: #fff1d9; --danger: #b4462f; --focus: #d69a43;
  color-scheme: light dark;
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1311; --surface: #161c19; --surface2: #1d2521; --line: #242d28; --border: #2c3631; --text: #e9f0eb; --muted: #a3b1a8;
    --ring: #66756c; --accent: #7ed3a2; --accent-soft: rgba(126, 211, 162, 0.16); --on-accent: #0b2418; --amber: #f3b85e;
    --amber-soft: rgba(243, 184, 94, 0.13); --danger: #f09a83; --focus: #f3b85e;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100dvh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.1; margin: 0; }
h2 { font-size: 18px; margin: 0 0 6px; }
a { color: var(--accent); }

/* Brand */
.brand-row { display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.brand-name { font-size: 14px; font-weight: 600; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-inner { width: 100%; max-width: 420px; }
.login h1 { margin: 32px 0 4px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.login .card { padding: 18px; margin: 20px 0 14px; display: grid; gap: 6px; }
label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 8px; }
input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface2); }
input::placeholder { color: var(--muted); opacity: .85; }
.primary { min-height: 48px; margin-top: 14px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.secondary { min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--border); background: none; font-weight: 600; }
.link { border: 0; background: none; padding: 4px; font-weight: 700; }
.danger { color: var(--danger); }
.form-message { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.form-message:empty { display: none; }
/* Account aanmaken and Wachtwoord vergeten: two steps per form, each a fieldset without its own frame */
.login fieldset, .login .field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.login fieldset p { margin: 0 0 2px; }
.auth-links { display: grid; justify-items: start; gap: 2px; }
.auth-links .link { min-height: 44px; color: var(--accent); text-align: left; }

/* Signed in: a column with a fixed top and bottom; only the list scrolls */
.workspace { display: flex; flex-direction: column; height: 100dvh; max-width: 680px; margin: 0 auto; }
.top { position: relative; padding: 16px 16px 12px; display: grid; gap: 12px; border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; }
.avatar { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface2); font-weight: 700; }
.dot { position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.dot.off { background: var(--danger); }
.menu { position: absolute; z-index: 5; right: 16px; top: 64px; width: min(320px, calc(100vw - 32px)); padding: 14px; display: grid; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.menu-title { margin: 0; font-weight: 700; }
.menu p { margin: 0 0 6px; }
.menu-item { text-align: left; min-height: 44px; padding: 0 4px; border: 0; border-top: 1px solid var(--line); background: none; font-weight: 600; }
.password-form { display: grid; gap: 4px; padding-bottom: 8px; }
.invite-box { display: grid; gap: 6px; padding: 0 4px 10px; }
.menu .invite-code { margin: 2px 0; font-size: 24px; font-weight: 800; letter-spacing: .08em; user-select: all; }
.welcome { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); font-size: 14px; }
.welcome p { margin: 0 0 2px; }
.welcome .link { color: var(--accent); padding-left: 0; }
.card-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.card-actions .secondary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.login .welcome { margin-top: 20px; font-size: 15px; }
/* A tick with its sentence (the yes to the Sunday mail): not the wide input of the other fields */
.tick { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 500; color: var(--text); }
.tick input { flex: none; width: 22px; height: 22px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
#register-switch { justify-self: start; min-height: 44px; color: var(--accent); }
/* The Bonuskaart: black on white in both themes, so the till's scanner can read it. */
.card-dialog { width: min(560px, calc(100vw - 32px)); border: 0; border-radius: 18px; padding: 20px 16px; background: #fff; color: #111; }
.card-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.card-dialog h2 { margin: 0 0 12px; font-size: 1.3rem; }
.card-code svg { display: block; width: 100%; height: auto; background: #fff; }
.card-digits { margin: 6px 0 0; text-align: center; font-size: 1.25rem; letter-spacing: .12em; }
.card-hint { color: #555; text-align: center; }
.card-dialog label { color: #333; }
.card-dialog .primary { width: 100%; }
.progress-row { display: flex; align-items: center; gap: 10px; margin-top: -2px; }
progress { flex: 1; height: 5px; border: 0; border-radius: 3px; background: var(--line); overflow: hidden; appearance: none; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }

.list-area { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 24px; }
.notice { margin: 0 0 10px; font-size: 14px; color: var(--danger); }
.notice:empty, #queue-status:empty { display: none; }
#queue-status { margin: 0 0 10px; }
.list { list-style: none; margin: 0; padding: 0; }
#items:empty { display: none; }
.card.list { padding: 4px 0; }
.section-label { padding: 10px 16px 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.section-label + .item { border-top: 0; }
.list .section-label:not(:first-child) { border-top: 1px solid var(--line); margin-top: 4px; }
.item { display: flex; align-items: center; gap: 4px; min-height: 54px; padding: 3px 8px 3px 6px; border-top: 1px solid var(--line); margin-left: 0; }
.list > .item:first-child { border-top: 0; }
.check { flex: none; width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; }
.check::before { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ring); box-sizing: border-box; }
.item.purchased .check::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 900; display: grid; place-items: center; }
.item-content { flex: 1; min-width: 0; padding: 4px 0; }
.item-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.item.purchased .item-name { color: var(--muted); font-weight: 500; text-decoration: line-through; }
.item-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.item-meta:empty { display: none; }
.qty { flex: none; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 9px; border-radius: 8px; background: var(--surface2); font-size: 13px; font-weight: 600; }
.remove { flex: none; width: 36px; height: 40px; border: 0; background: none; color: var(--muted); font-size: 20px; opacity: .45; }
.item:hover .remove, .remove:focus-visible { opacity: 1; }
@media (hover: none) { .remove { opacity: .6; } }

/* Offer and dinner details inside a row */
details.offer, details.dinner { margin-top: 4px; }
details.offer > summary, details.dinner > summary { display: inline-block; list-style: none; cursor: pointer; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
details.offer > summary { background: var(--amber-soft); color: var(--amber); }
details.dinner > summary { color: var(--accent); padding-left: 0; font-size: 13px; }
summary::-webkit-details-marker { display: none; }
details.offer ul { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; gap: 6px; }
details.offer li { display: grid; font-size: 13px; }
details.offer li span { color: var(--muted); }
.dish { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dish p { margin: 4px 0; color: var(--muted); }
.dish .ingredients { color: var(--text); }
.dish .secondary { margin: 6px 8px 0 0; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.more { margin-top: 8px; }

/* In de tas */
.bag { margin-top: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.bag[open] { background: var(--surface); border-color: var(--surface); }
.bag > summary { display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 16px; cursor: pointer; color: var(--muted); font-weight: 600; list-style: none; }
.bag > summary::after { content: "▾"; margin-left: 8px; }
.bag[open] > summary::after { content: "▴"; }
.bag > summary .link { margin-left: auto; font-size: 13px; }
.bag:not([open]) .link { display: none; }
.bag .item:first-child { border-top: 1px solid var(--line); }

.empty { text-align: center; padding: 48px 24px; }

/* Adding, at the bottom */
.add-bar { padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.add-box { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 6px 0 16px; border-radius: 26px; background: var(--surface2); border: 1px solid var(--border); }
.add-box input { min-height: 0; height: 48px; padding: 0; border: 0; background: none; }
.add-box input:focus-visible { outline: none; }
.add-box:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.add-button { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font-size: 24px; font-weight: 700; line-height: 1; }
