:root {
  /* brand */
  --green: #3a5a40;
  --green-d: #2d4531;
  --blue: #2f6feb;
  --orange: #e08a1e;
  --served: #2f9e44;
  --danger: #c0392b;
  --plum: #7a5cc0;              /* take-away accent */
  /* surfaces & ink */
  --sand: #f4efe6;
  --card: #ffffff;
  --surface-2: #efeadf;         /* subtle inset: tracks, tags, grey buttons */
  --ink: #23271f;
  --muted: #7a7a70;
  --line: #e6e1d4;
  /* status tints (light bg + matching text) */
  --tint-green: #e7f0e6;  --on-green: #1e7a34;
  --tint-orange: #fbe8cf; --on-orange: #9a5a10;
  --tint-blue: #dde8fd;   --on-blue: #1f4fc4;
  --tint-grey: #eae6dc;   --on-grey: #5f5f57;
  /* ink on accent fills (green buttons, header, badges) */
  --on-accent: #fff;
  --on-accent-soft: rgba(255,255,255,.92);
  --glass: rgba(255,255,255,.15);          /* header buttons on the green bar */
  --glass-strong: rgba(255,255,255,.36);   /* ...pressed / "on" */
  --scrim: rgba(0,0,0,.4);                 /* behind modals, drawer, round sheet */
  --shadow-ink: rgba(0,0,0,.2);
  --focus-ring: 0 0 0 2px var(--card), 0 0 0 4px var(--ink);   /* reads on white and on green */
  /* geometry */
  --radius-xs: 8px; --radius-sm: 10px; --radius-md: 12px; --radius: 14px; --radius-lg: 18px;
  --radius-pill: 999px;
  --tap: 48px;
  /* spacing scale */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  /* elevation */
  --shadow-sm: 0 1px 2px rgba(35,39,31,.05), 0 1px 3px rgba(35,39,31,.06);
  --shadow-md: 0 3px 10px rgba(35,39,31,.10);
  /* layout */
  --page-max: 720px;            /* list screens stop growing past this on tablets */
  --gutter: max(14px, (100% - var(--page-max)) / 2);
  --foot-h: calc(68px + env(safe-area-inset-bottom));   /* .footbar incl. safe area */
  --plan-bg: #fbf9f4;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--sand);
  color: var(--ink);
  font-size: 16px;
  overscroll-behavior-y: none;
}
/* --app-h = window.innerHeight, set by app.js (see fitHeight there); 100dvh until then */
#app { height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); display: flex; flex-direction: column; overflow: hidden; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--green); color: var(--on-accent);
  display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  min-height: 54px;
}
/* one line each: a long group name used to wrap the title over two or three
   lines and push the whole screen down */
.topbar > div:not(.spacer) { min-width: 0; }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: .3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.back { flex: 0 0 auto; background: var(--glass); border: none; color: var(--on-accent);
  width: 42px; height: 42px; border-radius: var(--radius-sm); font-size: 22px; }

/* ---------- generic ---------- */
/* The footer bars are flex children of #app (not position:fixed), so .content
   simply ends where they begin - no per-screen padding guesses. Without a
   footer, .content itself clears the home indicator. The side gutter grows on
   tablets so lists and bills keep a readable width instead of spanning 1000px. */
.content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 14px var(--gutter) calc(20px + env(safe-area-inset-bottom)); }
.content:has(~ .footbar, ~ .split-bar) { padding-bottom: 20px; }
.btn {
  min-height: var(--tap); border: none; border-radius: var(--radius-md);
  background: var(--green); color: var(--on-accent); font-size: 16px; font-weight: 600;
  padding: 0 18px; cursor: pointer; white-space: nowrap;
}
.tab-actions .btn { padding: 0 10px; }
.tab-actions .btn:not(.grp-more) { flex: 1; }
.btn:active { transform: translateY(1px); }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--card); color: var(--green); border: 1.5px solid var(--green); }
.btn.grey { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.sm { min-height: 40px; font-size: 14px; padding: 0 12px; }
.btn.tiny { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: var(--radius-sm); font-weight: 600; }
.btn:disabled { cursor: default; }
.btn:disabled:active { transform: none; }
/* standalone "+ Neue Gruppe" / "+ Person" under a list */
.content > .btn.wide { margin-top: var(--s2); }
.spacer { flex: 1; }

/* Keyboard / switch-access focus. A two-tone ring (card + ink) stays visible
   on white cards and on the green header alike; mouse and touch never show it. */
:where(button, [role="button"], a, summary, input[type="checkbox"]):focus-visible {
  outline: none; box-shadow: var(--focus-ring); }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
  /* the payment spinner is the only progress cue - keep it, just slower */
  .su-spin { animation-duration: 3s !important; animation-iteration-count: infinite !important; }
}
.row { display: flex; gap: 10px; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.muted { color: var(--muted); }
.err { color: var(--danger); font-size: 14px; margin: 8px 0; min-height: 18px; }
.center-screen { flex: 1; display: flex; flex-direction: column; justify-content: center;
  align-items: center; gap: 18px; padding: 24px; }

/* ---------- login ---------- */
.brand { text-align: center; }
.brand .logo { font-size: 30px; font-weight: 800; color: var(--green); }
.brand .place { color: var(--muted); font-size: 14px; margin-top: 4px; }
.pin-display { display: flex; gap: 16px; justify-content: center; align-items: center; height: 44px; }
.pin-display .pd { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line);
  background: transparent; transition: background .1s, border-color .1s, transform .08s; }
.pin-display .pd.on { background: var(--green); border-color: var(--green); transform: scale(1.1); }
.pin-loading { height: 260px; display: flex; align-items: center; justify-content: center; }
.keypad { display: grid; grid-template-columns: repeat(3, 74px); gap: 14px; }
.keypad button { width: 74px; height: 74px; font-size: 26px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); font-weight: 600; padding: 0; }
.keypad button:active { background: var(--surface-2); }

/* ---------- server select ---------- */
.server-grid { display: grid; gap: 14px; width: 100%; max-width: 360px; }
.server-grid button { min-height: 72px; font-size: 20px; display: flex; align-items: center;
  justify-content: center; gap: 12px; }

/* ---------- floor plan ---------- */
/* two plans (Aussen/Innen) live in one horizontal snap strip; swipe or tap to switch */
/* fixed 14px sides (the strip's -14px margin relies on it); the dots sit right
   above the bottom edge, there is no footer to clear on this screen */
.plan-content.content { display: flex; flex-direction: column; gap: 10px;
  padding: 14px 14px calc(6px + env(safe-area-inset-bottom)); }
/* board header: person · tabs · menu, in one green row (replaces topbar+seg) */
.boardbar { position: sticky; top: 0; z-index: 20; background: var(--green);
  display: flex; align-items: center; gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 10px 8px; }
.boardbar .seg { flex: 1; padding: 0; min-width: 0; }
.boardbar .seg-btn { min-height: 38px; font-size: 13px; background: var(--glass);
  border-color: transparent; color: var(--on-accent-soft); }
.boardbar .seg-btn.active { background: var(--card); color: var(--green); border-color: var(--on-accent); }
.boardbar .seg-btn.active .seg-badge { background: var(--orange); color: var(--on-accent); }
.boardbar .hamb { flex: 0 0 auto; background: var(--glass); border: none; color: var(--on-accent);
  width: 38px; height: 38px; border-radius: var(--radius-sm); font-size: 19px; }

/* page dots under the plan — the strip is swipeable anyway, so a second full
   tab row above it was pure chrome. Tap target stays 28px; only the mark is small. */
.plan-dots { display: flex; gap: 4px; justify-content: center; padding-top: 2px; }
.plan-dot { width: 28px; height: 28px; padding: 0; border: none; background: none;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.plan-dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--line); transition: width .15s, background .15s; }
.plan-dot.active::after { width: 22px; border-radius: 4px; background: var(--green); }

.area-tabs { display: flex; gap: 8px; justify-content: center; }
.area-tab { min-height: 38px; padding: 7px 18px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.area-tab.active { background: var(--green); color: var(--on-accent); border-color: var(--green); }
.plan-strip { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -14px;
  flex: 0 1 min(calc(100vw - 28px), 620px); min-height: 0; }
.plan-strip::-webkit-scrollbar { display: none; }
.plan-page { flex: 0 0 100%; scroll-snap-align: center; padding: 0 14px; box-sizing: border-box;
  container-type: size; }
.plan-wrap { position: relative; width: 100%; max-width: 620px; margin: 0 auto;
  aspect-ratio: 1 / 1; background: var(--plan-bg); border: 2px solid var(--green);
  border-radius: var(--radius-lg); overflow: hidden; }
/* The square plan must fit the space between header and dots, not just the
   width: in landscape a width-sized square is taller than the screen and got
   clipped. The strip is as tall as the plan is wide, but may shrink to the
   leftover height; each page is a size container, so the plan takes whichever
   is smaller and the dots stay right under it. Old browsers keep 100%. */
.plan-page .plan-wrap { width: min(100%, 100cqh); }
.plan-empty { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 14px; }
.table-box {
  position: absolute; container-type: size; border: 2px solid var(--line); border-radius: var(--radius-xs);
  background: var(--card); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; line-height: 1.05; padding: 4px;
  text-align: center; overflow: hidden;
}
.table-box.round { border-radius: 50%; }
/* number + total scale to fill the box (container-query units; fixed fallback for old browsers) */
.table-box .tname { font-weight: 800; font-size: 15px; font-size: clamp(11px, 17cqw, 26px); }
/* Status = border. The fill stays white on every table, so the ring is the only
   thing that changes and reads from a distance. The old occupied tint sat at
   1.17:1 against white — invisible on a sunlit terrace. */
.table-box.occupied { border-width: 3px; border-color: var(--green-d); }
.table-box.st-bestellt  { border-color: var(--orange); }
/* Thickest ring on the only state that demands action right now: the food is
   finished and standing on the pass. "bestellt" is the kitchen's problem, not
   the server's. Width also carries the signal for colour-blind staff. */
.table-box.st-in_arbeit { border-color: var(--blue); border-width: 4px; }
.table-box.st-serviert  { border-color: var(--served); }
.table-box .badge { color: var(--muted); display: inline-flex;
  align-items: center; gap: 3px 5px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.table-box .bsum { font-weight: 500; color: var(--ink); font-size: 14px; font-size: clamp(10px, 13cqw, 20px); }
.table-box .dots { display: inline-flex; gap: 3px; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.bestellt { background: var(--orange); }
.dot.serviert { background: var(--served); }

/* ---------- Bestellungen (today's rounds, status-coloured) ---------- */
.ord-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ord-lg { font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: var(--radius-pill); }
.ord-card { background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-left: 5px solid var(--muted); box-shadow: var(--shadow-sm); }
.ord-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ord-head b { font-size: 15px; }
.ord-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill); white-space: nowrap; }
.ord-sub { font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.ord-items { font-size: 14px; line-height: 1.3; }
.ord-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; font-weight: 700; }
.ord-ordered { border-left-color: var(--orange); }
.ord-served  { border-left-color: var(--served); }
.ord-paid    { border-left-color: var(--muted); }
.ord-lg.ord-ordered, .ord-ordered .ord-badge { background: var(--tint-orange); color: var(--on-orange); }
.ord-lg.ord-served,  .ord-served .ord-badge  { background: var(--tint-green); color: var(--on-green); }
.ord-lg.ord-paid,    .ord-paid .ord-badge    { background: var(--tint-grey); color: var(--on-grey); }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); margin: 18px 4px 8px; font-weight: 700; }

/* ---------- tab / group cards ---------- */
.tab-card { padding: 12px 14px; margin-bottom: 12px; border-left: 6px solid var(--line); }
.tab-card .head { display: flex; align-items: center; gap: 8px; }
.tab-card .seat { background: var(--green); color: var(--on-accent); border-radius: var(--radius-xs);
  min-width: 30px; height: 30px; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; padding: 0 6px; }
.tab-card .title { font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tab-card .total { font-weight: 500; font-size: 18px; white-space: nowrap; }
.tab-card .meta { color: var(--muted); font-size: 13px; margin: 6px 0; }
.tab-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.grp-items { margin: 6px 0 2px; border-top: 1px dashed var(--line); padding-top: 6px; }
.grp-item { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 3px 2px; }
.grp-item > span:first-child { min-width: 0; }
.grp-item > span:last-child { flex: 0 0 auto; white-space: nowrap; }   /* "✓ CHF 42.00" never splits */
.grp-item.served { color: var(--muted); }
.grp-item.muted { color: var(--muted); }
.grp-main { cursor: pointer; }
.chev { color: var(--muted); font-weight: 700; }
.grp-more { flex: 0 0 auto; width: 52px; padding: 0; font-size: 22px; line-height: 1; }

/* status accent on group cards.
   Gruppenkarten sprechen dieselbe Sprache wie der Tischplan: die Klassen kommen
   aus tabStatus(), die Farben sind dieselben wie beim Tischrahmen. */
.tab-card.st-in_arbeit { border-left-color: var(--blue); }
.tab-card.st-bestellt  { border-left-color: var(--orange); }
.tab-card.st-serviert  { border-left-color: var(--served); }
.tab-card.st-empty     { border-left-color: var(--line); }

/* segmented view switch on the main page */
.seg { display: flex; gap: 6px; padding: 10px var(--gutter) 2px; }
.seg-btn { flex: 1; min-height: 42px; border: 1.5px solid var(--line); background: var(--card); border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center;
  justify-content: center; gap: 7px; white-space: nowrap; }
.seg-btn.active { background: var(--green); color: var(--on-accent); border-color: var(--green); }
.seg-badge { background: var(--orange); color: var(--on-accent); border-radius: var(--radius-pill); font-size: 12px; font-weight: 800; padding: 1px 7px; }
.seg-btn.active .seg-badge { background: var(--glass-strong); }

.kds-empty { flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--muted); font-size: 20px; padding: 24px; }
.kds-server { font-size: 13px; color: var(--muted); font-weight: 600; margin: -2px 0 6px; }
.kds-size { color: var(--muted); font-weight: 600; }

/* ---------- quantity steppers ---------- */
.qtybtn { flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 20px; font-weight: 700; }
.qty { min-width: 24px; text-align: center; font-weight: 700; }

/* ---------- sticky footer bar ---------- */
.footbar {
  flex: 0 0 auto; position: relative; z-index: 30;   /* above the round-sheet backdrop */
  background: var(--card); border-top: 1px solid var(--line);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.footbar .ftotal { font-size: clamp(18px, 5.6vw, 22px); font-weight: 800; white-space: nowrap; }
/* the main action may wrap onto two lines rather than push past the screen edge
   ("Bestätigen & kassieren" did not fit next to the total on a 390px phone) */
.footbar > .btn { flex: 0 1 auto; min-width: 0; white-space: normal; line-height: 1.15; }
.footbar > .round-toggle { flex: 0 0 auto; }
@media (max-width: 359px) {
  .footbar { gap: 8px; }
  .footbar > .btn { padding: 0 12px; }
  .round-toggle { padding: 8px 9px; }
}
/* the order screen's item grid is full-width, so its footer is too */
.order-content ~ .footbar { padding-left: 12px; padding-right: 12px; }
.footbar .ftotal small { font-size: 12px; color: var(--muted); font-weight: 600; display: block; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: var(--scrim); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center; }
/* max-height + scroll: the article form is taller than a landscape phone */
.modal { background: var(--card); width: 100%; max-width: 480px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: calc(var(--app-h, 100dvh) - 24px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain; }
.modal h3 { margin: 0 0 12px; }
/* same field style as .adm-input (1.5px border, colours) so all forms match */
.modal input:not([type=checkbox]), .modal select { width: 100%; min-height: var(--tap); font-size: 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px;
  background: var(--card); color: var(--ink); }
.modal input:focus-visible, .modal select:focus-visible, .adm-input:focus-visible {
  outline: 2px solid var(--green); outline-offset: 1px; }
.modal.center { text-align: center; }
.modal .section-title { margin-top: 16px; }
/* form building blocks (replace per-element inline margins) */
.field { display: block; margin-top: var(--s2); }
.field:first-child { margin-top: 0; }
.field-label { display: block; font-size: 14px; color: var(--muted); margin-bottom: var(--s1); }
.row > .field { flex: 1; min-width: 0; margin-top: 0; }
.row > .field.narrow { flex: 0 0 92px; }
.row.field { display: flex; }
.check-group { margin-top: var(--s3); }
.hint { font-size: 13px; color: var(--muted); margin: var(--s2) 0; }
.hint.center { text-align: center; }
/* the button column at the bottom of every modal, incl. its "Abbrechen" */
.modal-actions { display: flex; flex-direction: column; gap: var(--s2); margin-top: 14px; }
.modal-actions:first-child { margin-top: 0; }
.big-amount { font-size: 34px; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.pay-total { text-align: center; margin-bottom: 10px; }
.pay-total .big-amount { margin: 0; }
/* card-reader picker above the terminal button */
.su-select { margin-bottom: var(--s2); }
.pair-form { display: flex; flex-direction: column; gap: var(--s2); max-width: 320px; }

/* offline / sync indicator */
.sync-note { position: fixed; bottom: calc(var(--foot-h) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--orange); color: var(--on-accent); padding: 8px 14px; border-radius: var(--radius-pill);
  font-size: 13px; z-index: 35; box-shadow: 0 2px 8px var(--shadow-ink); }

/* connection state: a quiet strip, not an alarm - the app still shows the
   last known board underneath and only order entry is locked */
.offline-note { flex: 0 0 auto; background: var(--tint-orange); color: var(--on-orange);
  text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .01em;
  padding: calc(4px + env(safe-area-inset-top)) 10px 4px; }
.offline-note + .topbar { padding-top: 10px; }   /* the strip already carries the safe area */
.offline-note + .boardbar { padding-top: 8px; }
/* order entry is locked while offline; .btn already greys itself, the drawer
   item needs the hint (grey, not hidden, so it stays where staff expect it) */
.drawer-item[disabled] { opacity: .45; }
/* centred with auto margins, not left:50% + translate: that trick caps the
   shrink-to-fit width at half the screen and wrapped messages into a column */
.toast-note { position: fixed; bottom: calc(var(--foot-h) + 16px); left: 0; right: 0; margin: 0 auto;
  width: max-content; max-width: 82vw; background: var(--ink); color: var(--on-accent); padding: 9px 15px;
  border-radius: var(--radius-pill); font-size: 13px; text-align: center; z-index: 45;
  box-shadow: var(--shadow-md); }
/* failed write: red, wider, above modals and the terminal overlay */
.toast-note.err { background: var(--danger); font-weight: 600; font-size: 14px;
  border-radius: var(--radius-md); padding: 11px 16px; max-width: min(92vw, 440px); z-index: 210; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* Tagesübersicht — collapsible bills */
.day-summary { padding: 14px 16px; margin-bottom: 12px; display: flex;
  justify-content: space-between; align-items: center; }
.day-summary b { font-size: 22px; }
.day-card { padding: 0; margin-bottom: 8px; overflow: hidden; }
.day-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.day-main { flex: 1; min-width: 0; }
.day-title { font-weight: 700; }
.day-sub { font-size: 12px; margin-top: 1px; }
.day-total { white-space: nowrap; }
.day-body { padding: 2px 14px 12px; border-top: 1px solid var(--line); }
.day-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* analytics */
.an-presets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.an-dates { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.an-dates input[type=date] { flex: 1; min-width: 120px; min-height: 42px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 0 10px; font-size: 15px; background: var(--card); color: var(--ink); }
.an-tiles { display: flex; gap: 8px; margin-bottom: 8px; }
.an-tile { flex: 1; min-width: 0; position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 6px; text-align: center; overflow: hidden; box-shadow: var(--shadow-sm); }
.an-tile-v { font-size: clamp(15px, 4.4vw, 22px); font-weight: 800; color: var(--green);
  line-height: 1.15; overflow-wrap: anywhere; }
.an-tile-l { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.2; overflow-wrap: anywhere; }
.an-delta { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700; }
.an-delta.up { color: var(--served); }
.an-delta.down { color: var(--danger); }
.an-delta.flat { color: var(--muted); }
.an-cmp { font-size: 11px; text-align: center; margin: 6px 2px 0; }

/* Statistik sub-tabs + toggles */
.st-subtabs { display: flex; gap: 6px; margin: 4px 0 14px; }
.st-tab { flex: 1; padding: 8px 4px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card);
  color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.st-tab.active { background: var(--green); color: var(--on-accent); border-color: var(--green); }
.st-metric { display: inline-flex; margin: 2px 0 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.st-mbtn { padding: 6px 16px; background: var(--card); border: none; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.st-mbtn.active { background: var(--green); color: var(--on-accent); }

.an-card { padding: 12px 14px; }
.an-cap { font-size: 11px; margin-top: 8px; }
.an-hint { font-size: 12px; margin: 6px 2px 0; }

/* horizontal bars (magnitude — single green hue, value direct-labelled) */
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.hbar-lbl { font-weight: 600; overflow-wrap: anywhere; }
.hbar-val { font-weight: 700; white-space: nowrap; }
.hbar-track { height: 8px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--green); border-radius: 5px; }

/* vertical bars */
.vbars-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.vbars { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.vbar { flex: 1 1 0; min-width: 14px; height: 100%; display: flex; flex-direction: column; }
.vbar-track { position: relative; flex: 1 1 auto; min-height: 0; }
.vbar-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--green);
  border-radius: 4px 4px 0 0; min-height: 2px; }
.vbar-x { flex: 0 0 auto; height: 16px; line-height: 16px; font-size: 11px; color: var(--muted);
  text-align: center; overflow: hidden; white-space: nowrap; }

/* item list (tap → drill-down) */
.an-item { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 9px 2px;
  border: none; border-bottom: 1px solid var(--line); background: none; color: inherit; font: inherit;
  text-align: left; cursor: pointer; }
.an-item:last-child { border-bottom: none; }
.an-item:active { background: var(--surface-2); }
.an-item .an-q { min-width: 40px; font-weight: 800; }
.an-item .an-n { flex: 1; }
.an-item .an-s { font-weight: 700; white-space: nowrap; }
.an-back { margin-bottom: 10px; }
.an-prodhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.an-unsold { display: flex; flex-wrap: wrap; gap: 6px; }
.an-tag { font-size: 12px; padding: 3px 9px; background: var(--surface-2); border-radius: var(--radius-pill); color: var(--muted); }

/* ============ Phase 1b: new flow ============ */
.topbar .hamb { flex: 0 0 auto; background: var(--glass); border: none; color: var(--on-accent);
  width: 42px; height: 42px; border-radius: var(--radius-sm); font-size: 20px; }
.dot.in_arbeit { background: var(--blue); }
.btn.kitchen-btn { background: var(--ink); }

/* order screen: category bar + item grid (3 rows) + running round (lower half) */
.order-content.content { display: flex; flex-direction: column; min-height: 0; gap: 6px;
  overflow: hidden; padding: 8px 12px 0; }
.cat-bar { flex: 0 0 auto; display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.cat-bar::-webkit-scrollbar { display: none; }
/* minmax(0, 1fr), not 1fr: a plain 1fr track grows to the longest word, and one
   long name pushed the third column (and the confirm button) off-screen.
   The 12px padding (cancelled by the negative margin) is room for the corner
   badges, which overhang each tile by 6px sideways / 10px upwards; the 14px
   gap keeps the badges of two neighbouring selected tiles apart. */
.items-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 14px; align-content: start;
  padding: 10px 12px 4px; margin: 0 -12px; }
@media (max-width: 359px) {
  .items-scroll { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 600px) {
  .items-scroll { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
.cat-div { grid-column: 1 / -1; font-weight: 700; font-size: 12px; color: var(--muted);
  padding: 8px 2px 2px; background: var(--sand); }

/* collapsible "Aktuelle Runde" */
.round-toggle { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 12px; font-weight: 700; font-size: 14px; color: var(--ink); white-space: nowrap; }
.round-sheet-bg { position: fixed; inset: 0; background: var(--scrim); z-index: 29; }
.round-sheet { position: fixed; left: 0; right: 0; z-index: 30; background: var(--card);
  bottom: var(--foot-h); border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-width: var(--page-max); margin: 0 auto;
  box-shadow: 0 -6px 24px var(--shadow-ink); max-height: 56vh; display: flex; flex-direction: column;
  animation: slideup .16s ease; }
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.round-sheet-head { display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; font-weight: 800; border-bottom: 1px solid var(--line);
  background: var(--card); border-radius: var(--radius-lg) var(--radius-lg) 0 0; color: var(--ink); }
.cart-scroll { flex: 1; overflow-y: auto; padding: 2px 14px 12px; }
.cat-chip { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 64px; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius-md);
  background: var(--card); color: var(--ink); }
.cat-chip.sel { border-color: var(--green); background: var(--tint-green); }
.cat-ico { font-size: 22px; line-height: 1; }
.cat-name { font-size: 11px; text-align: center; line-height: 1.05; max-width: 70px; }
/* The top padding is the same whether or not the tile is selected: the badges
   sit in that strip, so selecting an item never re-wraps or truncates its name. */
.grid-item { position: relative; min-width: 0; min-height: 64px; border: 1.5px solid var(--line); border-radius: var(--radius-md);
  background: var(--card); padding: 14px 7px 7px; display: flex; flex-direction: column; justify-content: space-between;
  gap: 4px; text-align: left; color: var(--ink); cursor: pointer; -webkit-user-select: none; user-select: none; }
.grid-item.has { border-color: var(--green); background: var(--tint-green); }
/* flex-shrink 0: a line-clamped box inside a flex column otherwise collapses
   on narrow phones (the name vanished entirely at 320px) */
.grid-item .gi-name { flex-shrink: 0; font-size: 13px; font-weight: 600; line-height: 1.15;
  overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid-item .gi-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; min-width: 0; }
.grid-item .gi-price { font-weight: 700; font-size: 13px; }
.grid-item .gi-size { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Corner badges straddle the border, so they cover only the rounded corner and
   the fixed top strip - never the name. */
.grid-item .gi-qty { position: absolute; top: -10px; right: -6px; min-width: 24px; height: 24px;
  border-radius: var(--radius-pill); background: var(--green); color: var(--on-accent); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 6px;
  box-shadow: 0 0 0 2px var(--sand); }
/* mirrors the counter: remove one straight from the item grid, without opening
   the round sheet. Disappears with the last unit, because the line is gone then.
   The visible dot is 24px; the ::before widens the tap target to ~40px so a
   near miss doesn't hit the tile underneath and add one instead. */
.grid-item .gi-minus { position: absolute; top: -10px; left: -6px; width: 24px; height: 24px;
  padding: 0; border: none; border-radius: var(--radius-pill); background: var(--danger); color: var(--on-accent);
  font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--sand); }
.grid-item .gi-minus::before { content: ''; position: absolute; inset: -8px; }
.cart-line { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.cart-line .cl-name { flex: 1; min-width: 0; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.cart-line .cl-price { font-weight: 700; white-space: nowrap; min-width: 74px; text-align: right; }

/* sidebar drawer */
.drawer-bg { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 78%; max-width: 320px; z-index: 41;
  background: var(--card); box-shadow: -4px 0 20px var(--shadow-ink); padding: max(14px, env(safe-area-inset-top)) 0 14px;
  display: flex; flex-direction: column; animation: slidein .18s ease; }
@keyframes slidein { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head { font-weight: 800; font-size: 18px; padding: 10px 18px 14px; border-bottom: 1px solid var(--line); color: var(--green); }
.drawer-item { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; background: none;
  border: none; padding: 16px 18px; font-size: 16px; border-bottom: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.drawer-item .di-ic { display: inline-flex; color: var(--muted); flex: 0 0 auto; }
.drawer-item.danger { color: var(--danger); margin-top: auto; }
.drawer-item.danger .di-ic { color: var(--danger); }

/* kitchen display (basic; expanded in Phase 2) */
.kds-topbar h1 { font-size: 22px; flex: 0 0 auto; }
/* min(…, 100%): on a phone narrower than a card the grid used to scroll sideways */
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); gap: 13px; align-items: start; align-content: start; }
.kds-grid.content { padding-left: 14px; padding-right: 14px; }   /* the kitchen uses the full width */
.kds-card { background: var(--card); border: 1px solid var(--line); border-left: 7px solid var(--orange);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.kds-head { display: flex; justify-content: space-between; align-items: baseline; gap: 9px; margin-bottom: 7px; }
.kds-head b { font-size: 19px; line-height: 1.15; }
.kds-time { font-size: 14px; color: var(--muted); white-space: nowrap; }
.kds-time.warn { color: var(--orange); font-weight: 700; }
.kds-time.late { color: var(--danger); font-weight: 800; }
.kds-items { margin-bottom: 9px; }
.kds-item { font-size: 17px; padding: 4px 0; }
.kds-actions { display: flex; gap: 9px; align-items: center; margin-top: 9px; }
.kds-actions .btn { flex: 1; min-height: 42px; font-size: 15px; padding: 0 13px; border-radius: var(--radius-sm); }
.kds-card.ta { border-left-color: var(--plum); }
.kds-filterbar { flex: 0 0 auto; display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px; background: var(--card);
  border-bottom: 1px solid var(--line); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.kfilter-chip { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-pill); background: var(--card); font-size: 14px; color: var(--ink); }
.kfilter-chip.sel { background: var(--green); color: var(--on-accent); border-color: var(--green); }
.kfilter-chip.clear { border-color: var(--danger); color: var(--danger); }
.kds-hist { padding: 11px 15px; margin-bottom: 8px; border-left: 6px solid var(--muted); font-size: 15px; }
.kds-hist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 9px; }
.kds-hist-head b { font-size: 17px; }
.kh-right { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.kh-badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-pill); }
.kh-ready  { border-left-color: var(--blue); }
.kh-served { border-left-color: var(--served); }
.kh-paid   { border-left-color: var(--muted); }
.kh-ready  .kh-badge { background: var(--tint-blue); color: var(--on-blue); }
.kh-served .kh-badge { background: var(--tint-green); color: var(--on-green); }
.kh-paid   .kh-badge { background: var(--tint-grey); color: var(--on-grey); }
.kh-revert { margin-top: 8px; }
.hamb.on { background: var(--glass-strong); }
.kds-single { flex: 0 0 auto; width: 42px; height: 42px; padding: 0; font-size: 17px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; }
/* line icons in the header buttons (were emoji, which every device draws differently) */
.hamb { display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.hamb svg, .kds-single svg { display: block; }
.kds-item-btn { display: block; width: 100%; text-align: left; padding: 11px 38px 11px 11px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: 6px; background: var(--card); font-size: 17px; color: var(--ink); position: relative; }
.kds-item-btn:active { background: var(--tint-green); }
.kib-check { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--green); font-weight: 800; font-size: 18px; }
/* split view (two independent workstations on one screen) */
.kds-split { flex: 1 1 auto; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; gap: 4px; background: var(--green); }
.kds-pane { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--sand); }
.kds-pane .kds-filterbar { gap: 8px; padding: 10px; }
.pane-grid { flex: 1 1 auto; overflow-y: auto; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 10px; align-items: start; align-content: start; }
.kfilter-chip.ico { min-width: 50px; justify-content: center; font-size: 22px; padding: 0 9px; }

/* admin */
.adm-input { width: 100%; min-height: var(--tap); font-size: 16px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 0 12px; max-width: 320px; background: var(--card); color: var(--ink); }
.modal .adm-input { max-width: none; }
.adm-cat { margin-bottom: 16px; }
.adm-cat-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; padding: 6px 2px; }
.adm-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); }
.adm-row.off { opacity: .5; }
.adm-main { flex: 1; min-width: 0; }
.adm-name { font-weight: 600; overflow-wrap: anywhere; }
.adm-sub { font-size: 12px; color: var(--muted); }
.adm-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.adm-ic { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font-size: 15px; color: var(--ink); }
.adm-assign { flex: 0 1 45%; min-width: 0; min-height: 40px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 0 8px; background: var(--card); color: var(--ink); font-size: 15px; }
.adm-check { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-top: 6px; }
.adm-check input { width: 20px; height: 20px; }
/* move-group modal: prominent table grid + tucked-away merge */
/* visual move picker (full-screen plan) */
.move-overlay { position: fixed; inset: 0; z-index: 200; background: var(--sand);
  display: flex; flex-direction: column; padding: 14px calc(14px + env(safe-area-inset-right)) 20px calc(14px + env(safe-area-inset-left));
  padding-top: calc(14px + env(safe-area-inset-top)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.move-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.move-head b { font-size: 18px; }
.move-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.move-plan { margin: 6px 0 8px; }
.move-hint { font-size: 12px; color: var(--muted); text-align: center; }
.table-box.is-current { opacity: .45; outline: 2px dashed var(--muted); pointer-events: none; }
.mv-merge-link { display: block; width: 100%; margin-top: 14px; padding: 8px; background: none;
  border: none; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.mv-merge { margin-top: 6px; }
.merge-opt { text-align: left; margin-top: 6px; display: flex; justify-content: space-between; align-items: center; }
.su-spin { font-size: 30px; margin: 12px 0; display: inline-block; color: var(--green); animation: suspin 1s linear infinite; }
@keyframes suspin { to { transform: rotate(360deg); } }

/* checkout / Abschluss */
.bill { padding: 4px 14px; margin-bottom: 4px; }
.bill-line { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.bill-line:last-child { border-bottom: none; }
.bill-line:has(.bl-edit) { align-items: center; }
.bl-qty { min-width: 32px; font-weight: 700; }
.bl-name { flex: 1; min-width: 0; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.bl-price { font-weight: 700; white-space: nowrap; }
.bl-priceedit { background: none; border: none; font: inherit; font-weight: 700; color: var(--green);
  cursor: pointer; display: inline-flex; align-items: baseline; gap: 5px; padding: 2px 0; }
.bl-priceedit .pe-ic { font-size: 12px; opacity: .55; }
.bill-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 8px 2px; font-size: 20px; }
.bill-total b { font-size: 28px; }
.bill-round { text-align: right; padding: 0 8px; font-size: 13px; }
.pay-row { display: flex; gap: 10px; }
.pay-opt { flex: 1; min-width: 0; min-height: 62px; border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--card);
  font-size: 17px; font-weight: 700; color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 8px; }
.pay-opt.sel { border-color: var(--green); background: var(--tint-green); color: var(--green); }
.pay-check { width: 22px; height: 22px; border-radius: var(--radius-xs); border: 2px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }

/* split (Aufteilen) mode */
.split-hint { font-size: 13px; margin: 2px 2px 10px; }
.split-line { display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); }
.split-line:last-child { border-bottom: none; }
.split-line .sl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 2px;
  background: none; border: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.split-line .sl-check { flex: 0 0 auto; width: 24px; height: 24px; border-radius: var(--radius-xs); border: 2px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; color: var(--on-accent); }
.split-line .bl-name { flex: 1; }
.split-line.sel { background: var(--tint-green); }
.split-line.sel .sl-check { background: var(--green); border-color: var(--green); }
.split-line .bl-price { flex: 0 0 auto; font-weight: 700; white-space: nowrap; padding-right: 2px; }
/* Phones: name and price share the first line, the −/+ stepper drops to its own
   line under the price. Side by side, the stepper left the name ~70px and
   "Älplermagronen" broke mid-word. */
@media (max-width: 480px) {
  .split-line { flex-wrap: wrap; column-gap: 8px; }
  .split-line .sl-main { order: 1; }
  .split-line .bl-price { order: 2; }
  .split-line .sl-step { order: 3; flex: 1 0 100%; justify-content: flex-end; margin: -6px 0 10px; }
}
.sl-step { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.sl-step .qtybtn { width: 36px; height: 36px; }
.sl-n { min-width: 32px; text-align: center; font-weight: 700; font-size: 14px; }
.sl-n small { color: var(--muted); font-weight: 600; }
.split-bar { flex: 0 0 auto; position: relative; z-index: 30; background: var(--card); border-top: 1px solid var(--line);
  padding: 10px var(--gutter) calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.split-sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.split-sum b { font-size: 22px; font-weight: 800; }
.pay-opt.grey { opacity: .45; }

/* zusammen kassieren (multi-select) */
.pt-list { max-height: 42vh; overflow-y: auto; margin: 2px 0; }
.pt-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 2px; background: none;
  border: none; border-bottom: 1px solid var(--line); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pt-row:last-child { border-bottom: none; }
.pt-row .sl-check { flex: 0 0 auto; width: 24px; height: 24px; border-radius: var(--radius-xs); border: 2px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; color: var(--on-accent); }
.pt-row.sel { background: var(--tint-green); }
.pt-row.sel .sl-check { background: var(--green); border-color: var(--green); }
.pt-name { flex: 1; min-width: 0; }
.pt-sum { font-weight: 700; white-space: nowrap; }
.pt-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px;
  padding-top: 8px; border-top: 1px solid var(--line); font-size: 15px; }
.pt-total b { font-size: 20px; font-weight: 800; }
.pay-opt.sel .pay-check { background: var(--green); color: var(--on-accent); border-color: var(--green); }
.verwerfen { background: none; border: none; color: var(--muted); font-size: 13px;
  text-decoration: underline; min-height: 40px; padding: 0 6px; }
.checkout-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.ck-tools-right { display: flex; gap: 8px; align-items: center; }
/* Gruppiert | Runden as one joined control: less width than two loose buttons,
   so the toolbar stays on one line on a 390px phone */
.ck-view { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.ck-vbtn { min-height: 36px; border: none; background: var(--card); padding: 0 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.ck-vbtn + .ck-vbtn { border-left: 1.5px solid var(--line); }
.ck-vbtn.active { background: var(--green); color: var(--on-accent); }
/* "+ Diverses" belongs to the bill it extends: a dashed row at its end */
.bill-add { display: block; width: 100%; min-height: 44px; margin: 6px 0 2px; background: none;
  border: 1.5px dashed var(--line); border-radius: var(--radius-sm); color: var(--green);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.bill-add:active { background: var(--tint-green); }
.bill-round-sec { border-top: 1px dashed var(--line); padding-top: 2px; margin-top: 2px; }
.bill-round-sec:first-child { border-top: none; margin-top: 0; }
.bill-round-head { font-size: 12px; font-weight: 800; color: var(--muted); padding: 6px 0 2px; }
/* unavailable (sold out) menu item */
/* Faded content, struck price and a "ban" badge (ring + diagonal) in the counter's
   corner - no extra text line, so the tile keeps its height and nothing spills out.
   Deliberately not a filled red dot: that is the minus button.
   Grey and small on purpose: it marks the tile, it shouldn't shout. */
.grid-item.unavailable { cursor: default; border-style: dashed; }
.grid-item.unavailable .gi-name, .grid-item.unavailable .gi-foot { opacity: .45; }
.grid-item.unavailable .gi-price { text-decoration: line-through; }
.grid-item .gi-na { position: absolute; top: -7px; right: -4px; width: 18px; height: 18px; box-sizing: border-box;
  border: 2px solid var(--muted); border-radius: var(--radius-pill); background: var(--card);
  box-shadow: 0 0 0 2px var(--sand); }
.grid-item .gi-na::after { content: ''; position: absolute; left: -1px; right: -1px; top: 50%; height: 2px;
  margin-top: -1px; background: var(--muted); transform: rotate(-45deg); }
.adm-row.na .adm-name { text-decoration: line-through; }
.adm-ic.na { color: var(--danger); border-color: var(--danger); }
.bl-edit { display: inline-flex; align-items: center; gap: 6px; }
.bl-rm { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1.5px solid var(--danger);
  background: var(--card); color: var(--danger); font-size: 14px; }

/* ---------- receipt printer ---------- */
/* icon + label inside a button (Beleg, Quittung) */
.btn svg { vertical-align: -3px; }
.btn.tiny svg { margin-right: 2px; }
/* Abschluss: icon-only, so Gruppiert|Runden, Beleg and Bearbeiten share one row on a phone */
.btn.tiny.ck-print { width: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn.tiny.ck-print svg { margin: 0; }
/* admin has five tabs: tighter labels so "Statistik" still fits a 360px phone */
.adm-seg { gap: 4px; }
.adm-seg .seg-btn { font-size: 13px; padding: 0 2px; min-width: 0; }
/* Admin → Beleg form */
.adm-form { max-width: 480px; }
.adm-form .adm-input { max-width: none; }
.adm-form > .section-title:first-child { margin-top: 4px; }
.adm-text { min-height: 96px; padding: 10px 12px; line-height: 1.35; resize: vertical; font-family: inherit; }
.adm-save { margin-top: var(--s4); }
/* on/off switch: a real checkbox (keyboard, screen reader) drawn as a pill */
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.sw-text { font-size: 15px; font-weight: 600; }
.sw-text small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.sw { appearance: none; -webkit-appearance: none; flex: 0 0 auto; position: relative; width: 50px; height: 30px;
  margin: 0; border-radius: var(--radius-pill); background: var(--surface-2); border: 1.5px solid var(--line);
  cursor: pointer; transition: background .15s, border-color .15s; }
.sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 23px; height: 23px;
  border-radius: var(--radius-pill); background: var(--card); box-shadow: var(--shadow-sm); transition: transform .15s; }
.sw:checked { background: var(--green); border-color: var(--green); }
.sw:checked::after { transform: translateX(20px); }
.sw:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* printer connection + job list */
.pj-status { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }
.pj-dot { width: 10px; height: 10px; border-radius: var(--radius-pill); background: var(--muted); }
.pj-status.ok { color: var(--on-green); }
.pj-status.ok .pj-dot { background: var(--served); }
.pj-url { font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--muted); }
.pj-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s2); }
.pj-badge { flex: 0 0 auto; font-size: 12px; font-weight: 700; border-radius: var(--radius-pill); padding: 3px 9px; }
.pj-orange { background: var(--tint-orange); color: var(--on-orange); }
.pj-blue   { background: var(--tint-blue); color: var(--on-blue); }
.pj-green  { background: var(--tint-green); color: var(--on-green); }
.pj-grey   { background: var(--tint-grey); color: var(--on-grey); }
.pj-red    { background: var(--danger); color: var(--on-accent); }
.pj-err { color: var(--danger); font-weight: 600; }
.pj-row .adm-name { font-size: 15px; overflow-wrap: break-word; }

/* receipt logo editor */
.logo-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; }
.logo-prev { display: flex; justify-content: center; background: var(--card); padding: 6px 0; }
.logo-prev img { image-rendering: pixelated; max-width: 100%; }
.file-btn { display: inline-flex; align-items: center; cursor: pointer; }
.logo-opts { gap: 8px; }
.logo-range { width: 100%; accent-color: var(--green); }
/* receipt preview: an 80 mm roll, 48 monospace columns */
.paper-wrap { display: flex; justify-content: center; padding: 6px 0; }
.paper { width: 100%; max-width: 360px; background: #fff; color: #111; padding: 14px 10px 0;
  font-family: ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: min(12px, calc((100vw - 2 * var(--gutter) - 20px) / 29)); line-height: 1.25;
  box-shadow: var(--shadow-md); border-radius: 2px; }
.pl { white-space: pre; overflow: hidden; }
.pl > span { display: inline-block; transform-origin: top left; }
.pl-center { text-align: center; }
.pl-center > span { transform-origin: top center; }
.pl-right { text-align: right; }
/* no gap: a "Modern" receipt arrives as several stacked image strips */
.pl-img { display: flex; justify-content: flex-start; }
.pl-img.pl-center { justify-content: center; }
.pl-img img { image-rendering: pixelated; }
.pl-cut { height: 14px; margin: 0 -10px; background:
  linear-gradient(-45deg, var(--sand) 7px, transparent 0) 0 100% / 14px 14px repeat-x,
  linear-gradient(45deg, var(--sand) 7px, transparent 0) 0 100% / 14px 14px repeat-x; }
