/* Layout: één smalle kolom, tabbalk onderaan; de verdeling is gezet als een bon met stippellijnen tussen naam en bedrag. */
:root {
  --bg: #EDF0EA;
  --surface: #F8FAF6;
  --ink: #16221B;
  --muted: #55655A;
  --rule: #B4C0B6;
  --brand: #1F4D3A;
  --on-brand: #F4F8F4;
  --amber: #B9770E;
  --warn-bg: #F6E7C3;
  --warn-fg: #5E3D00;
  --ok-bg: #D8E9DD;
  --ok-fg: #17382A;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111915;
    --surface: #1A2520;
    --ink: #E5ECE6;
    --muted: #9AAA9F;
    --rule: #38473E;
    --brand: #74C29B;
    --on-brand: #0E1813;
    --amber: #E3A53A;
    --warn-bg: #3A2D12;
    --warn-fg: #F0D08E;
    --ok-bg: #1E3A2C;
    --ok-fg: #BFE3CE;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-text-size-adjust: 100%;
}
.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
[hidden] { display: none !important; }

/* header */
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.top > * { min-width: 0; }
.place { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
h1 { font: 700 clamp(30px, 8.5vw, 46px)/0.95 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 4px 0 0; }
.sum { text-align: right; min-width: 0; }
.sum .lab { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.sum .val { font: 700 clamp(26px, 8vw, 32px)/1 var(--display); color: var(--brand); font-variant-numeric: tabular-nums; }

h2 { font: 700 22px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; margin: 22px 0 10px; text-wrap: balance; }
h2 small { font: 500 14px var(--body); text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.hint { color: var(--muted); margin: 0 0 12px; }
.empty { color: var(--muted); padding: 14px 0; }

.note { background: var(--warn-bg); color: var(--warn-fg); border: 1px solid var(--amber); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; font-size: 15px; }

/* form controls */
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 4px; }
input[type="text"], input[inputmode], select {
  width: 100%; min-height: 46px; padding: 8px 12px; font-size: 16px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 6px;
}
textarea { width: 100%; min-height: 140px; padding: 8px 12px; font-size: 16px; background: var(--bg); border: 1px solid var(--rule); border-radius: 6px; margin-top: 8px; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 14px; display: grid; gap: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > input { flex: 1 1 140px; min-width: 0; }

.btn {
  min-height: 46px; padding: 8px 18px; border-radius: 6px; cursor: pointer; font-weight: 600;
  background: transparent; border: 1px solid var(--rule);
}
.btn.primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn.small { min-height: 40px; padding: 4px 14px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 6px 8px; min-height: 36px; color: var(--brand); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--amber); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 22px; cursor: pointer; }
.stepper button[disabled] { opacity: .3; cursor: default; }
.stepper output { min-width: 34px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper.on { border-color: var(--brand); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 500;
  background: transparent; border: 1px solid var(--rule);
}
.chip[aria-pressed="true"], .chip.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); font-weight: 600; }
span.chip { cursor: default; min-height: 32px; padding: 2px 12px; font-size: 15px; }

.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin: 0 -2px; scrollbar-width: thin; }
.cats .chip { flex: 0 0 auto; }

/* menu */
.menu { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.mi { padding: 12px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 8px; }
.mi-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mi-name { font-size: 18px; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.price { background: none; border: 0; padding: 6px 0 6px 8px; cursor: pointer; font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.price.missing { font: 600 14px var(--body); color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.mi-act { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.mi-price-form { display: flex; gap: 8px; }
.mi-price-form input { flex: 1; min-width: 0; }
.tag { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-left: 8px; }

/* gedeelde bestellingen */
.shared { display: grid; gap: 10px; }
.sh { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; display: grid; gap: 10px; }
.sh.mine { border-color: var(--brand); }
.sh-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.sh-top strong { font-size: 18px; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.amt { font: 700 24px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* afrekenen */
.msg { padding: 8px 10px; border-radius: 6px; font-size: 15px; font-weight: 500; }
.msg.ok { background: var(--ok-bg); color: var(--ok-fg); }
.msg.warn { background: var(--warn-bg); color: var(--warn-fg); }
.msg.idle { color: var(--muted); padding: 0; font-weight: 400; }
.msg .link { color: inherit; }
.result { border-top: 2px solid var(--ink); }
details.who { border-bottom: 1px solid var(--rule); }
details.who summary { list-style: none; cursor: pointer; padding: 12px 0; display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; align-items: baseline; }
details.who summary::-webkit-details-marker { display: none; }
.nm { font: 700 24px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.nm .me { font: 600 12px var(--body); letter-spacing: .08em; color: var(--brand); margin-left: 6px; vertical-align: middle; }
.lead { border-bottom: 2px dotted var(--rule); align-self: end; height: .8em; min-width: 12px; }
.tot { font: 700 28px/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay { grid-column: 1 / -1; font-size: 14px; color: var(--muted); margin-top: 2px; }
.pay b { color: var(--brand); font-weight: 600; }
ul.lines { list-style: none; margin: 0; padding: 0 0 12px; display: grid; gap: 4px; }
ul.lines li { display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; align-items: baseline; font-size: 15px; }
ul.lines li .t { overflow-wrap: anywhere; min-width: 0; }
ul.lines li .v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.grand { display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; align-items: baseline; padding: 12px 0; }
.admin { margin-top: 26px; padding-top: 14px; border-top: 1px dotted var(--rule); }
.admin summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.admin .card { margin-top: 10px; }
.person-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px dotted var(--rule); }

/* tab bar */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--surface); border-top: 1px solid var(--rule);
  padding-top: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.tabs-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tab { min-height: 48px; border-radius: 6px; border: 1px solid transparent; background: none; cursor: pointer; font-weight: 600; font-size: 15px; line-height: 1.15; padding: 4px 6px; }
.tab small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tab[aria-current="page"] { background: var(--brand); color: var(--on-brand); }
.tab[aria-current="page"] small { color: var(--on-brand); opacity: .85; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 9; max-width: min(520px, calc(100% - 32px));
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 6px; font-weight: 500; font-size: 15px;
}

@media (min-width: 520px) { h1 { font-size: 56px; } }
@media (prefers-reduced-motion: no-preference) { .chip, .btn, .tab { transition: background-color .12s, color .12s; } }

/* ---- rollen: gebruiker en organisator ---- */
.menu { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.dr-wrap { border-bottom: 1px solid var(--rule); }
.dr { display: flex; align-items: stretch; gap: 4px; }
.dr-main {
  flex: 1; min-width: 0; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: none; border: 0; padding: 8px 4px; text-align: left; cursor: pointer; font-size: 18px; font-weight: 500;
}
.dr-main:active { background: var(--surface); }
.dr-main[disabled] { cursor: default; opacity: .6; }
.dr-name { overflow-wrap: anywhere; min-width: 0; }
.badge {
  flex: none; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 999px; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand); font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums;
}
.dr-min {
  flex: none; width: 52px; min-height: 56px; background: none; border: 0; border-left: 1px solid var(--rule);
  font-size: 26px; cursor: pointer; color: var(--muted);
}
.dr .price { align-self: center; }
.dr-wrap .mi-price-form { padding: 0 4px 12px; }

.ate { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 14px; margin-bottom: 4px; }
.ate.todo { border-color: var(--amber); }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yn-btn {
  min-height: 60px; border-radius: 8px; border: 1px solid var(--rule); background: transparent; cursor: pointer;
  font-size: 18px; font-weight: 600;
}
.yn-btn[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.yn-btn[disabled] { opacity: .6; cursor: default; }

.acting { background: var(--surface); border: 1px solid var(--brand); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.addfold { margin-top: 18px; }
.addfold summary, .foot summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 6px 0; }
.addfold .card { margin-top: 10px; }
.foot { margin-top: 28px; padding-top: 14px; border-top: 1px dotted var(--rule); }
.foodsum { grid-template-columns: 1fr 1fr; }
.foodsum .amt { font-size: 28px; }
.bigsum { font: 700 64px/1 var(--display); color: var(--brand); font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.pay-to { font-size: 18px; margin: 0 0 14px; }
.p-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 0 14px; }
.p-tools .chip { min-height: 36px; padding: 2px 14px; }

/* ---- koppen, maten en zoeken ---- */
.grp {
  font: 700 18px/1.1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--brand);
  margin: 0; padding: 18px 4px 6px; border-bottom: 1px solid var(--rule); text-wrap: balance;
}
.menu > .grp:first-child { padding-top: 12px; }
.dr-text { display: grid; gap: 1px; min-width: 0; }
.dr-info { font-size: 13px; font-weight: 400; color: var(--muted); }
.dr-name .tag { margin-left: 8px; color: var(--brand); }
.dr-big {
  flex: none; align-self: center; min-height: 44px; padding: 0 14px; margin: 0 4px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--brand); color: var(--brand); font-weight: 600; font-size: 15px;
}
.dr-big:active { background: var(--brand); color: var(--on-brand); }
.dr-big[disabled] { opacity: .5; cursor: default; }
.badge.lg { height: 30px; font: 600 14px/1 var(--body); padding: 0 10px; background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.dr-main { gap: 8px; }
.dr-main .badge { margin-left: auto; }
.dr-main .badge + .badge { margin-left: 0; }
.search { margin: 4px 0 12px; }
input[type="search"] {
  width: 100%; min-height: 46px; padding: 8px 12px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px;
}
.mi-price-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.mi-price-form > div { flex: 1 1 110px; min-width: 0; }
.mi-price-form > .btn { flex: none; }

.imp-list { margin: 0; padding-left: 18px; font-size: 14px; }
.imp-prev { margin-top: 8px; max-height: 260px; overflow: auto; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 14px; }
