:root {
  --paper: #e9dcd0;
  --paper-deep: #e2d2c4;
  --sheet: #f7f1ea;
  --ink: #110e0d;
  --brown: #642a12;
  --rule: #e7c4a7;
  --gold: #c6a36a;
  --bg: #f4efe4;
  --muted: #5c5348;
  --wine: #8d3a32;
  --tile-blue: #1d4e8c;
  --night: #1a120e;
  --night-2: #2a211c;
  --ok: #2f6b3a;
  --warn: #8a5a00;
  --focus: #1d4e8c;
  --rail: 48px;
  --font: "EB Garamond", "Palatino Linotype", Palatino, serif;
  --tap: 48px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  background-image: url("../img/flora-tile.svg"), url("../img/flora-tile.svg");
  background-repeat: repeat-y, repeat-y;
  background-position: left top, right top;
  background-size: var(--rail) auto, var(--rail) auto;
  font-family: var(--font);
  line-height: 1.45;
}
body.kds-body {
  background: var(--night);
  background-image: none;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  background: #000;
  color: var(--paper);
  padding: 0.4rem 0.8rem;
}
.skip:focus { top: 0.5rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.paper {
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(90, 60, 30, 0.055) 0.6px, transparent 0.7px),
    radial-gradient(rgba(255, 255, 255, 0.4) 0.5px, transparent 0.6px);
  background-size: 7px 9px, 11px 13px;
}

.home, .qr-page, .admin, .staff {
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.2rem 1.25rem 4rem;
}
.mark {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 1.28rem;
  text-align: center;
}
.kicker {
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h1 {
  margin: 0.2rem 0 0;
  text-align: center;
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 500;
}
.lede {
  margin: 0 auto 1rem;
  max-width: 36rem;
  text-align: center;
  font-size: 1.3rem;
}
.gold-rule {
  width: 13rem;
  height: 2rem;
  margin: 0.45rem auto 1.1rem;
  background:
    url("../img/flora-tile.svg") center / 2rem 2rem no-repeat,
    linear-gradient(var(--gold), var(--gold)) left center / 4.2rem 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right center / 4.2rem 1px no-repeat;
}
.note {
  margin: 1rem auto;
  max-width: 36rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.98rem;
}
.home-actions, .link-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem 0;
}
.table-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr));
  gap: 0.45rem;
  margin: 0.6rem 0 1.4rem;
}
.table-picks a, .zone-switch button, .chip, .mesa, .icon-btn, .qty button, .line-btn, .reason, .pay-opt {
  min-height: var(--tap);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  margin: 0;
  padding: 0.45rem 1.2rem;
  border: 2px solid #000;
  background: transparent;
  color: #000;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}
.btn:hover, .btn:focus-visible, .btn.is-solid {
  background: #000;
  color: var(--paper);
}
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.danger { border-color: var(--wine); color: var(--wine); }
.btn.danger:hover, .btn.danger:focus-visible { background: var(--wine); color: var(--paper); }

.lang {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 0.8rem;
}
.lang button, .text-btn {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  padding: 0.35rem 0.1rem;
  font-size: 1.05rem;
  min-height: var(--tap);
  cursor: pointer;
}
.lang button.is-on, .text-btn.is-on { color: var(--brown); border-bottom-color: var(--brown); }

.guest {
  width: min(480px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  background-color: var(--sheet);
  background-image:
    radial-gradient(rgba(90, 60, 30, 0.055) 0.6px, transparent 0.7px),
    radial-gradient(rgba(255, 255, 255, 0.4) 0.5px, transparent 0.6px);
  background-size: 7px 9px, 11px 13px;
  padding-bottom: calc(8.2rem + env(safe-area-inset-bottom));
}
.tile-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 4.7rem;
  padding: 0.45rem 0.7rem;
  background-color: var(--tile-blue);
  background-image: url("../img/catalan-tile.svg");
  background-size: 140px 140px;
}
.brand-plaque {
  display: block;
  padding: 0.28rem 0.6rem 0.32rem;
  text-decoration: none;
  color: var(--ink);
  background: rgba(244, 239, 228, 0.94);
}
.brand-plaque .mark { font-size: 1.02rem; letter-spacing: 0.12em; text-align: left; }
.brand-plaque .kicker { margin: 0.1rem 0 0; font-size: 0.62rem; letter-spacing: 0.14em; text-align: left; }
.head-side { display: flex; align-items: center; gap: 0.35rem; }
.mesa, .icon-btn {
  border: 0;
  background: var(--bg);
  color: var(--ink);
  padding: 0.2rem 0.7rem;
  font-size: 1rem;
  font-weight: 700;
}
.icon-btn { width: var(--tap); padding: 0; }

.gate, .orders, .bill, .thanks, .menu-wrap { padding: 1.1rem 1rem 1.4rem; }
.gate h1 { font-size: 2.4rem; }
.banner {
  margin: 0;
  padding: 0.7rem 1rem;
  background: var(--night);
  color: var(--bg);
  text-align: center;
}
.banner a { color: var(--bg); }

.tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  margin: 0.2rem 0 0.4rem;
}
.tools input, .field input, .field textarea, .field select {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--ink);
  background: transparent;
  padding: 0.4rem 0.6rem;
  font-size: 1.05rem;
}
.chips {
  position: sticky;
  top: 4.7rem;
  z-index: 15;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.45rem 0.7rem;
  background: var(--sheet);
}
.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0 0.75rem;
  border: 1px solid var(--ink);
  background: transparent;
  text-decoration: none;
  color: var(--ink);
}
.course { margin: 0 0 1.6rem; scroll-margin-top: 9rem; }
.course h2 {
  margin: 0.4rem 0;
  text-align: center;
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.course h2::before, .course h2::after {
  content: "";
  display: inline-block;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0 0.45rem;
  background: url("../img/flora-tile.svg") center / contain no-repeat;
  vertical-align: middle;
}
.dish-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  border-bottom: 1px solid var(--rule);
}
.dish {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  padding: 0.7rem 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.dish-line {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
}
.dish-photo, .ph {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(60, 30, 10, 0.18));
}
.ph { background: transparent; }
.dish-name { font-size: 1.15rem; }
.dish-en { margin: 0.05rem 0 0; color: var(--muted); font-size: 0.95rem; font-style: italic; }
.dish-meta { margin: 0.15rem 0 0; color: var(--brown); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.dish-desc { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.95rem; }
.dish-may { color: var(--muted); }
.dish-pending { color: var(--warn); font-weight: 600; }
.allergen-notice, .allergen-warn {
  margin: 0.6rem auto; max-width: 40rem; padding: 0.55rem 0.8rem; border-radius: 6px;
  font-size: 0.95rem; line-height: 1.35; text-align: left;
}
.allergen-notice { color: var(--ink); background: var(--sheet); border-left: 4px solid var(--warn); }
.allergen-warn { color: #fff; background: var(--wine); }
.review-row { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 0.8rem; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--rule); }
.review-row .dish-meta { grid-column: 1 / -1; }
.review-ok { color: var(--ok); font-weight: 600; }
.price { font-size: 1.05rem; white-space: nowrap; }
.plus {
  width: var(--tap);
  height: var(--tap);
  border: 2px solid #000;
  background: #000;
  color: var(--paper);
  font-size: 1.5rem;
  line-height: 1;
}
.plus:disabled, .dish-row.is-off { opacity: 0.5; }
.sold { color: var(--wine); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.78rem; }

.dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 25;
  width: min(480px, 100%);
  transform: translateX(-50%);
  display: grid;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--rule);
}
.dock-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(17, 14, 13, 0.45);
}
.drawer {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 40;
  width: min(480px, 100%);
  max-height: min(92dvh, 760px);
  overflow: auto;
  transform: translateX(-50%);
  padding: 0.8rem 1rem calc(1.2rem + env(safe-area-inset-bottom));
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(90, 60, 30, 0.055) 0.6px, transparent 0.7px),
    radial-gradient(rgba(255, 255, 255, 0.4) 0.5px, transparent 0.6px);
  background-size: 7px 9px, 11px 13px;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.drawer h2 { margin: 0; font-size: 1.7rem; font-weight: 500; }
.hero-plate {
  width: min(280px, 70%);
  margin: 0.4rem auto 0.6rem;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(60, 30, 10, 0.18));
}
.fine { color: var(--muted); font-size: 0.92rem; font-style: italic; }
.mods { margin: 0.8rem 0; padding: 0; border: 0; }
.mods legend { font-size: 1.05rem; padding: 0; }
.opt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
  font-size: 1.05rem;
}
.qty {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.4rem 0 0.8rem;
}
.qty button {
  width: var(--tap);
  border: 2px solid #000;
  background: transparent;
  font-size: 1.4rem;
}
.qty strong { min-width: 1.4rem; text-align: center; font-size: 1.3rem; }
.field { display: block; margin: 0.5rem 0; }
.field span { display: block; margin-bottom: 0.2rem; }
.help { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.92rem; }
.error { color: var(--wine); }

.cart-line, .round-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.round {
  margin: 0.8rem 0 1rem;
}
.round-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
}
.pill {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border: 1px solid currentColor;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.st-submitted { color: var(--ink); }
.st-preparing, .st-accepted { color: var(--warn); }
.st-ready { color: var(--ok); }
.st-served { color: var(--muted); }
.st-cancelled, .st-rejected { color: var(--wine); }
.total-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
  font-size: 1.2rem;
}
.not-invoice {
  margin: 0.8rem 0;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 8.5rem;
  z-index: 50;
  width: min(440px, calc(100% - 1.4rem));
  transform: translateX(-50%);
  padding: 0.75rem 0.9rem;
  background: var(--night);
  color: var(--bg);
}

.staff-top, .kds-top, .admin-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.zone-switch { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.zone-switch button {
  border: 1px solid var(--ink);
  background: transparent;
  padding: 0 0.7rem;
}
.zone-switch button.is-on { background: #000; color: var(--paper); }
.health { display: flex; gap: 0.8rem; font-size: 0.95rem; }
.dot { color: var(--ok); }
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
  margin-top: 0.8rem;
}
.tile {
  min-height: 104px;
  border: 1px solid var(--ink);
  background: var(--sheet);
  padding: 0.55rem;
  text-align: left;
}
.tile strong { display: block; font-size: 1.25rem; }
.tile.is-bill { border-width: 2px; border-color: var(--wine); }
.tile.is-waiter { border-width: 2px; border-color: var(--brown); }
.tile.is-ready { box-shadow: inset 4px 0 0 var(--ok); }
.tile.is-free { color: var(--muted); }
.alerts { margin: 1rem 0; padding: 0; list-style: none; }
.alerts li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}
.panel {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--ink);
  background: var(--sheet);
}

.kds {
  min-height: 100dvh;
  color: var(--bg);
  background: var(--night);
}
.kds a { color: var(--bg); }
.kds-top { padding: 0.8rem 1rem 0; }
.kds h1 { color: var(--bg); font-size: 1.6rem; text-align: left; margin: 0; }
.kds-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 300px);
  gap: 0.75rem;
  overflow-x: auto;
  align-items: start;
  padding: 0.8rem 1rem 1.4rem;
}
.kds-card {
  background: var(--night-2);
  padding: 0.8rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.kds-card header { display: flex; justify-content: space-between; align-items: baseline; }
.kds-card .mesa-no { font-size: 2rem; line-height: 1; }
.kds-card .late { color: #f0b4a8; }
.kds-card .warm { color: #f3d7a4; }
.kds-card p { margin: 0.15rem 0; font-size: 1.2rem; }
.kds-card .mod { letter-spacing: 0.04em; text-transform: uppercase; font-size: 1rem; }
.kds-card .note-line { color: #f3d7a4; }
.kds-card .alg { color: #f0b4a8; font-size: 0.85rem; letter-spacing: 0.05em; }
.kds .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.kds .btn:hover, .kds .btn:focus-visible { background: #000; color: var(--bg); }
.ready-strip { padding: 0 1rem 1.5rem; color: var(--bg); }

.admin-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.admin-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
}
.switch { display: flex; align-items: center; gap: 0.4rem; min-height: var(--tap); }

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.qr-card {
  padding: 0.8rem;
  border: 1px solid var(--ink);
  background: var(--sheet);
  text-align: center;
  break-inside: avoid;
}
.qr-card img { width: 180px; height: 180px; margin: 0.4rem auto; }
.qr-card p { margin: 0.2rem 0; }

@media (max-width: 768px) {
  body { background-image: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  body { background: white; }
  .no-print { display: none !important; }
  .qr-page { max-width: none; }
}

/* ======================================================================
   a1 · staff + guest UX layer (touch targets >= 48px, WCAG AA contrast)
   ====================================================================== */
:root { --tap: 52px; --late: #9b1c1c; --amber: #7a4b00; --ready: #1f5f2c; --call: #8d3a32; --bill: #1d4e8c; }
.center { text-align: center; }
.btn { min-height: var(--tap); padding: 0.55rem 1.1rem; font-size: 1.05rem; border-radius: 10px; }
.btn-sm { min-height: 44px; padding: 0.35rem 0.8rem; font-size: 0.98rem; }
.btn-xl { min-height: 60px; font-size: 1.2rem; font-weight: 600; }
.btn-danger { background: #fff; color: var(--late); border: 2px solid var(--late); }
.btn-danger:hover { background: var(--late); color: #fff; }
.btn.is-pending { background: #e8f1e9; border-color: var(--ok); color: var(--ok); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.text-btn { background: none; border: 0; text-decoration: underline; padding: 0.4rem; min-height: 44px; font-size: inherit; }
.spinner { width: 42px; height: 42px; margin: 2rem auto 1rem; border-radius: 50%; border: 4px solid var(--rule); border-top-color: var(--brown); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } body.flash { animation: none !important; } }
.callout { border-left: 4px solid var(--gold); background: var(--sheet); padding: 0.75rem 1rem; border-radius: 6px; }
.callout.error { border-color: var(--late); color: #5c1010; background: #fbeeee; }
.callout.ok { border-color: var(--ok); color: #1c4424; background: #edf5ee; }
.banner-warn { background: #fff4d6; color: #4a3300; }
.empty { color: var(--muted); text-align: center; padding: 1.5rem 0.5rem; font-style: italic; }
.code-form input { font-size: 2rem; letter-spacing: 0.5em; text-align: center; min-height: 64px; width: 100%; }
.big-code { font-size: 2.6rem; letter-spacing: 0.3em; text-align: center; }
.big-code-inline { font-size: 1.4rem; letter-spacing: 0.15em; }
.plus { min-width: var(--tap); min-height: var(--tap); }
.plus-n { font-weight: 700; }
.qty-sm { min-width: 44px; min-height: 44px; border-radius: 50%; border: 1px solid var(--brown); background: #fff; font-size: 1.2rem; }
.cart-qty { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.stack { display: grid; gap: 0.6rem; }
.steps { display: flex; gap: 0.25rem; list-style: none; padding: 0; margin: 0.5rem 0 0.75rem; }
.steps li { flex: 1; text-align: center; font-size: 0.85rem; padding: 0.35rem 0.2rem; border-top: 4px solid var(--rule); color: var(--muted); }
.steps li.is-done { border-color: var(--ok); color: var(--ink); }
.steps li.is-now { font-weight: 700; border-color: var(--brown); }
.round-line.is-off { text-decoration: line-through; color: var(--muted); }
.toast { z-index: 90; }
.toast-error { background: var(--late) !important; color: #fff !important; }
.toast-ok { background: var(--ok) !important; color: #fff !important; }
.field { display: grid; gap: 0.3rem; margin: 0.6rem 0; }
.field input, .field select, .field textarea { min-height: 48px; font-size: 1.05rem; padding: 0.4rem 0.6rem; border: 1px solid #8a7a6a; border-radius: 8px; background: #fff; }
.field.inline { display: flex; align-items: center; gap: 0.5rem; }

/* ---------- staff chrome */
.staff { padding: 1rem clamp(0.75rem, 2vw, 1.5rem) 4rem; max-width: 1500px; margin: 0 auto; background: var(--bg); min-height: 100vh; }
.staff-bar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; justify-content: space-between; padding: 0.55rem 1rem; background: var(--tile-blue); color: #fff; }
.staff-bar h1 { margin: 0; font-size: 1.5rem; }
.staff-title { display: flex; gap: 0.7rem; align-items: baseline; }
.mark-sm { font-weight: 700; letter-spacing: 0.05em; opacity: 0.9; }
.staff-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.staff-nav a { color: #fff; text-decoration: none; padding: 0.6rem 0.9rem; border-radius: 8px; min-height: 44px; display: inline-flex; align-items: center; }
.staff-nav a[aria-current="page"], .staff-nav a:hover { background: rgba(255,255,255,0.18); }
.staff-tools { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.staff-bar .btn { background: #fff; color: var(--tile-blue); border-color: #fff; }
.staff-bar .kicker { color: #fff; }
.net { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.65rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem; }
.net.is-on { background: #e5f2e7; color: #174d22; }
.net.is-off { background: #fff1c7; color: #4a3300; }
.net.is-wait { background: #efe9df; color: #4a4036; }
.net-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(29, 78, 140, 0.35); } } /* ring, not opacity: keeps text contrast AA while pulsing */
.seg { display: inline-flex; border: 2px solid var(--tile-blue); border-radius: 10px; overflow: hidden; }
.seg > * { min-height: 48px; padding: 0.4rem 1rem; background: #fff; color: var(--tile-blue); border: 0; text-decoration: none; display: inline-flex; align-items: center; font-size: 1.05rem; }
.seg > .is-on { background: var(--tile-blue); color: #fff; font-weight: 700; }
body.flash { animation: flash 0.9s ease-out 2; }
@keyframes flash { 0% { box-shadow: inset 0 0 0 12px #f2b705; } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.age { margin-left: 0.4rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.age.is-warn { color: var(--amber); }
.age.is-late { color: var(--late); }

/* ---------- sign-in */
.signin { max-width: 860px; }
.signin-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 1rem; }
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 1rem 1.2rem; margin: 0 0 1rem; }
.card h2 { margin-top: 0; }

/* ---------- floor */
.floor-tools { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin: 0.75rem 0; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.lg { padding: 0.25rem 0.6rem; border-radius: 6px; font-size: 0.9rem; border: 2px solid transparent; }
.tiles { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.staff .tile { position: relative; min-height: 104px; border-radius: 12px; border: 3px solid transparent; padding: 0.7rem; text-align: left; display: flex; flex-direction: column; justify-content: space-between; font-size: 1rem; }
.tile-n { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.tile-sub { font-size: 0.95rem; }
.tile-badge { position: absolute; top: 6px; right: 8px; background: #fff; color: var(--late); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; font-weight: 700; }
.tl-free, .lg-free { background: #fff; color: #4a4038; border-color: #cbbcae; border-style: dashed; }
.tl-open, .lg-open { background: #e6eef8; color: #12305a; border-color: var(--tile-blue); }
.tl-ready, .lg-ready { background: var(--ready); color: #fff; }
.tl-call, .lg-call { background: var(--call); color: #fff; }
.tl-billreq, .lg-billreq { background: #f2b705; color: #2b1d00; }
.tl-late, .lg-late { background: #fff; color: var(--late); border-color: var(--late); }
.tl-call, .tl-ready { animation: pulse 1.8s infinite; }
.alert-strip { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin: 0.5rem 0 1rem; }
.alert-card { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: 10px; color: #fff; }
.alert-card.is-ack { opacity: 0.8; }
.al-call { background: var(--call); } .al-bill { background: #f2b705; color: #2b1d00; } .al-ready { background: var(--ready); }
.al-table { font-size: 1.6rem; font-weight: 700; min-width: 3.2rem; }
.al-what { flex: 1; }
.alert-card .age { color: inherit; }
.alert-card .btn { background: #fff; color: var(--ink); border-color: #fff; }
.drawer-wide { max-width: 640px; }

/* ---------- KDS (dark, high contrast) */
body.kds-body .staff { background: var(--night); color: #f6efe6; }
body.kds-body .kicker { color: #f6efe6; }
.kds-tools { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 0.75rem; }
body.kds-body .seg { border-color: #f6efe6; }
body.kds-body .seg > * { background: var(--night-2); color: #f6efe6; }
body.kds-body .seg > .is-on { background: #f6efe6; color: var(--night); }
.kds-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
.tk-group { display: grid; gap: 0.5rem; border: 2px dashed #6b5a4f; border-radius: 14px; padding: 0.5rem; }
.tk-group h2 { margin: 0.1rem 0.3rem; font-size: 1.2rem; color: #f2d8b0; }
.ticket { background: #fffaf3; color: #15100d; border-radius: 12px; overflow: hidden; border-top: 10px solid #8a7a6a; }
.ticket.tk-preparing { border-top-color: #f2b705; }
.ticket.is-warn { box-shadow: 0 0 0 3px #f2b705; }
.ticket.is-late { box-shadow: 0 0 0 4px #ff5a5a; }
.tk-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0.5rem 0.8rem; background: #efe4d6; font-size: 1.05rem; }
.tk-table { font-size: 1.7rem; font-weight: 700; }
.tk-lines { list-style: none; margin: 0; padding: 0.4rem 0.8rem; font-size: 1.2rem; }
.tk-lines li { padding: 0.35rem 0; border-bottom: 1px solid #e6d9c9; }
.tk-qty { display: inline-block; min-width: 2rem; font-size: 1.4rem; }
.tk-mod, .tk-note, .tk-all { display: block; margin-left: 2rem; font-size: 1rem; }
.tk-note { font-style: italic; color: #5a2b10; font-weight: 600; }
.tk-all { color: #8a1c1c; }
.bump { width: 100%; min-height: 64px; border: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em; }
.bump-preparing { background: #f2b705; color: #2b1d00; }
.bump-ready { background: var(--ready); color: #fff; }
.kds-ready { margin-top: 1rem; background: var(--night-2); border-radius: 12px; padding: 0.6rem 1rem; }
.kds-ready h2 { margin: 0 0 0.4rem; color: #bfe8c6; font-size: 1.2rem; }
.ready-row { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0; border-bottom: 1px solid #3b3029; font-size: 1.1rem; }
.kds-empty { color: #d7c9ba; font-size: 1.3rem; grid-column: 1 / -1; }
body.kds-body .callout { background: var(--night-2); color: #f6efe6; }
.off-panel { background: var(--sheet); color: var(--ink); border-radius: 12px; padding: 0.75rem 1rem; margin-bottom: 1rem; }
.off-grid { display: grid; gap: 0.45rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.off-btn { min-height: 52px; border-radius: 10px; border: 2px solid var(--ok); background: #fff; color: #1c4424; text-align: left; padding: 0.4rem 0.7rem; font-size: 1rem; }
.off-btn.is-off { border-color: var(--late); background: #fbeeee; color: #6b1212; text-decoration: line-through; }

/* ---------- admin + QR */
.admin .card h3 { margin: 1rem 0 0.4rem; }
.row-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.plain { list-style: none; padding: 0; } .plain li { padding: 0.45rem 0; border-bottom: 1px solid var(--rule); }
code.select { user-select: all; background: #fff; padding: 0.15rem 0.35rem; border-radius: 4px; word-break: break-all; }
.zone-grid { display: grid; gap: 0.35rem 0.8rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.zone-row { margin: 0; justify-content: space-between; }
input.select { width: 100%; font: inherit; font-size: 0.85rem; padding: 0.4rem; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
.dead-list li { padding: 0.3rem 0; }
.qr-sheet .qr-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.qr-card { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 0.75rem; text-align: center; margin: 0; break-inside: avoid; }
.qr-card img { margin: 0 auto; }
.qr-url { display: block; font-size: 0.7rem; word-break: break-all; color: var(--muted); }
@media print { .staff-bar, .no-print { display: none !important; } body { background: #fff; } }
@media (max-width: 600px) {
  .staff-bar { padding: 0.5rem; } .staff-title h1 { font-size: 1.2rem; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .alert-strip { grid-template-columns: 1fr; }
}

/* ======================================================================
   a1.5 · guest mobile pass (375x667 / 390x844 first): tidy one-row header,
   bottom sheets with sticky action bar (safe areas + dvh), transparent
   cutouts, segmented choices, toasts that never cover a sheet.
   ====================================================================== */
:root { --head: 3.75rem; --muted: #514739; --warn: #774d00; --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); }
body.has-sheet { overflow: hidden; }

/* header: one row, nothing wraps, everything >= 44px */
.guest .tile-bar {
  min-height: 0;
  height: calc(var(--head) + var(--safe-top));
  padding: var(--safe-top) max(0.6rem, env(safe-area-inset-right)) 0 max(0.6rem, env(safe-area-inset-left));
  flex-wrap: nowrap;
  gap: 0.5rem;
  box-shadow: 0 2px 6px rgba(17, 14, 13, 0.18);
}
.guest .brand-plaque {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 44px; min-width: 0; padding: 0.25rem 0.6rem; border-radius: 4px; white-space: nowrap;
}
.guest .brand-plaque .mark { font-size: 0.98rem; letter-spacing: 0.1em; line-height: 1.1; }
.guest .brand-plaque .kicker { font-size: 0.68rem; letter-spacing: 0.14em; line-height: 1.1; margin-top: 0.1rem; }
.guest .head-side { flex: none; gap: 0.4rem; }
.guest .mesa, .lang-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  min-height: 44px; min-width: 44px; padding: 0 0.85rem;
  border: 0; border-radius: 999px; background: var(--bg); color: var(--ink);
  font-size: 1rem; font-weight: 700; white-space: nowrap;
}
.lang-btn { padding: 0 0.7rem; letter-spacing: 0.04em; }
.globe {
  width: 1.05rem; height: 1.05rem; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23110e0d' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M2.5 12h19M12 2.5c3 3.2 3 15.8 0 19M12 2.5c-3 3.2-3 15.8 0 19'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* menu */
.guest { padding-bottom: calc(9.6rem + var(--safe-bottom)); }
.guest .chips { top: calc(var(--head) + var(--safe-top)); padding: 0.5rem 0.7rem; box-shadow: 0 1px 0 var(--rule); scrollbar-width: none; }
.guest .chips::-webkit-scrollbar { display: none; }
.guest .chip { min-height: 44px; padding: 0 1rem; border-radius: 999px; font-size: 1.02rem; background: #fffaf3; }
.guest .course { scroll-margin-top: calc(var(--head) + var(--safe-top) + 4.2rem); }
.guest .tools input { border-radius: 10px; background: #fffaf3; border-color: #7a6b5c; }
.guest .tools .btn { border-radius: 10px; }
.guest .dish { grid-template-columns: 76px minmax(0, 1fr); min-height: 88px; }
.guest .dish-photo, .guest .ph { width: 76px; height: 76px; object-fit: contain; background: none; border: 0; }
.guest .ph { background: url("../img/flora-tile.svg") center / 34px no-repeat; opacity: 0.55; }
.guest .dish-meta { font-size: 0.8rem; }
.guest .dish-name { font-size: 1.15rem; line-height: 1.25; }
.guest .price { font-weight: 600; }
.guest .plus { border-radius: 50%; width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
img.cut { background: none !important; border: 0 !important; box-shadow: none !important; }

/* dock */
.dock { box-shadow: 0 -6px 14px rgba(60, 30, 10, 0.1); padding-left: max(0.7rem, env(safe-area-inset-left)); padding-right: max(0.7rem, env(safe-area-inset-right)); }
.dock .btn { border-radius: 12px; }
.dock-cart { justify-content: space-between !important; gap: 0.6rem; padding: 0 1rem !important; }
.dock-cart .count { display: inline-grid; place-items: center; min-width: 1.9rem; height: 1.9rem; padding: 0 0.4rem; border-radius: 999px; background: var(--bg); color: var(--ink); font-size: 1rem; }
.dock-row .btn { min-height: 48px; background: #fffaf3; }
.dock-row .btn:hover, .dock-row .btn:focus-visible { background: #000; color: var(--paper); }

/* toast: under the header, never over a sheet (it is not rendered while one is open) */
.guest ~ .toast, .toast {
  top: calc(var(--head) + var(--safe-top) + 0.6rem); bottom: auto;
  border-radius: 12px; box-shadow: 0 8px 20px rgba(17, 14, 13, 0.25);
  font-size: 1.02rem; line-height: 1.3;
}

/* bottom sheet: head (title wraps) + scrollable body + sticky foot */
.drawer.sheet {
  display: flex; flex-direction: column; overflow: hidden; padding: 0;
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - var(--safe-top) - 1.25rem);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 30px rgba(17, 14, 13, 0.28);
}
.sheet-grip { flex: none; width: 42px; height: 5px; margin: 0.5rem auto 0; border-radius: 3px; background: #b3a291; }
.drawer.sheet .drawer-head { flex: none; align-items: flex-start; padding: 0.35rem 0.75rem 0.55rem 1rem; border-bottom: 1px solid var(--rule); }
.drawer.sheet .drawer-head h2 { padding-top: 0.35rem; font-size: 1.5rem; line-height: 1.2; overflow-wrap: anywhere; }
.close-btn { flex: none; width: 44px !important; height: 44px; min-height: 44px; border-radius: 50%; font-size: 1.7rem; line-height: 1; background: var(--bg); }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0.6rem 1rem 1.2rem; }
.sheet-foot {
  flex: none; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 1rem calc(0.6rem + var(--safe-bottom));
  background: var(--paper); border-top: 1px solid var(--rule);
  box-shadow: 0 -6px 12px rgba(60, 30, 10, 0.06);
}
.sheet-foot .btn-block { flex: 1 1 0; width: auto; }
.sheet-foot .qty { margin: 0; gap: 0.35rem; flex: none; }
.sheet-foot .qty button, .qty button { width: 48px; height: 48px; min-height: 48px; border-radius: 50%; font-size: 1.5rem; line-height: 1; background: #fffaf3; }
.qty button:disabled { opacity: 0.35; cursor: not-allowed; }
.add-btn { flex: 1 1 auto; justify-content: space-between !important; gap: 0.6rem; min-height: 52px !important; border-radius: 12px; padding: 0 1rem !important; }

.hero { margin: 0.2rem 0 0.4rem; text-align: center; }
.hero .hero-plate { display: block; width: min(260px, 74%); height: auto; max-height: 32vh; max-height: 32dvh; margin: 0 auto; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(60, 30, 10, 0.2)); }
.hero .ph.hero-plate { height: 140px; }
.hero figcaption { margin-top: 0.15rem; color: var(--muted); font-size: 0.82rem; letter-spacing: 0.03em; }
.sheet-gloss { margin: 0.1rem 0 0; text-align: center; color: var(--muted); font-size: 1.02rem; font-style: italic; }
.sheet-price { margin: 0.2rem 0; text-align: center; font-size: 1.45rem; font-weight: 600; }
.sheet-desc { margin: 0.35rem 0; text-align: center; font-size: 1.08rem; }
.sheet-allergens { text-align: center; }
.sheet-legal { margin: 0.9rem 0 0; color: var(--muted); font-size: 0.92rem; text-align: center; }
.sheet-sub { margin: 1rem 0 0.2rem; text-align: center; font-size: 1.1rem; font-weight: 600; }
.drawer.sheet .mods { margin: 0.9rem 0 0.4rem; }
.drawer.sheet .mods legend { margin-bottom: 0.45rem; font-weight: 600; font-size: 1.08rem; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.5rem; }
.choice-opt {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  min-height: 58px; padding: 0.45rem 0.85rem; border: 2px solid #8a7a6a; border-radius: 12px; background: #fffaf3; cursor: pointer;
}
.choice-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice-name { font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
.choice-price { color: var(--muted); font-size: 0.98rem; }
.choice-opt:has(input:checked) { border-color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1px var(--ink); }
.choice-opt:has(input:checked)::after { content: "✓"; position: absolute; top: 0.35rem; right: 0.6rem; font-weight: 700; }
.choice-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.note-box { margin-top: 0.6rem; }
.note-box summary { display: flex; align-items: center; min-height: 44px; color: var(--brown); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.note-box textarea { min-height: 72px; border-radius: 10px; background: #fffaf3; }

/* cart */
.drawer.sheet .cart-line { grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; }
.cart-photo { width: 52px; height: 52px; object-fit: contain; grid-row: span 2; }
.cart-line .ph.cart-photo { display: block; }
.cart-line > span:nth-of-type(1) { grid-column: 2; }
.cart-line .cart-qty { grid-column: 2; }
.cart-line .cart-price { grid-column: 3; grid-row: 1; font-weight: 600; white-space: nowrap; }
.qty-sm { width: 44px; height: 44px; background: #fffaf3; }

/* filters / language sheet */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 0.8rem; }
.lang-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin: 0.4rem 0 0.6rem; }
.lang-big button { min-height: 52px; border: 2px solid #8a7a6a; border-radius: 12px; background: #fffaf3; font-size: 1.08rem; font-weight: 600; }
.lang-big button.is-on { border-color: var(--ink); background: var(--ink); color: var(--paper); }

/* status + bill */
.guest .steps li { font-size: 0.92rem; }
.guest .round { padding: 0.6rem 0.8rem; border: 1px solid var(--rule); border-radius: 12px; background: #fffaf3; }
.guest .round-head h2 { font-size: 1.25rem; margin: 0; }
.guest .pay-opts { border: 0; padding: 0; margin: 1rem 0 0.4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.guest .pay-opt { justify-content: center; border: 2px solid #8a7a6a; border-radius: 12px; background: #fffaf3; }
.guest .pay-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #fff; }
.guest .not-invoice { font-size: 1.1rem; }
.drawer.sheet .cart-line .dish-en { display: block; font-size: 0.95rem; }

/* a1.8 in-app payment (only rendered when CONFIG.paymentsEnabled) */
.guest .pay-now { margin: 1rem 0; padding: 0.8rem; border: 2px solid var(--ink); border-radius: 14px; background: #fffaf3; }
.guest .pay-now .pay-opts { grid-template-columns: repeat(3, 1fr); }
.guest .pay-now legend { font-weight: 600; margin-bottom: 0.3rem; }
.guest .receipt code { font-size: 0.95em; letter-spacing: 0.04em; }

/* ---------- a1.9 owner dashboard: sticky switch strip + tabs ---------- */
/* The staff bar scrolls away on the dashboard; the switch strip is what stays pinned. */
.admin-top .staff-bar { position: static; }
.switch-strip { position: sticky; top: 0; z-index: 30; display: flex; gap: 0.5rem; align-items: flex-start; overflow-x: auto; padding: 0.5rem clamp(0.75rem, 2vw, 1.5rem); background: var(--sheet); border-bottom: 1px solid var(--rule); box-shadow: 0 2px 6px rgba(17, 14, 13, 0.08); scrollbar-width: thin; }
.sw-cell { display: flex; flex-direction: column; gap: 0.2rem; flex: 0 0 auto; max-width: 15rem; }
.sw { display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tap); padding: 0.35rem 0.75rem 0.35rem 0.4rem; border: 2px solid #cbbcae; border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 0.98rem; cursor: pointer; white-space: nowrap; }
.sw.is-ro { cursor: default; border-style: dashed; }
.sw-knob { position: relative; width: 2.6rem; height: 1.5rem; border-radius: 999px; background: #cbbcae; flex: none; transition: background 0.15s; }
.sw-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.5rem - 6px); height: calc(1.5rem - 6px); border-radius: 50%; background: #fff; transition: transform 0.15s; }
.sw.is-on { border-color: var(--ok); }
.sw.is-on .sw-knob { background: var(--ok); }
.sw.is-on .sw-knob::after { transform: translateX(1.1rem); }
.sw-state { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.sw[disabled] { opacity: 0.6; cursor: not-allowed; }
.sw-why { font-size: 0.82rem; color: var(--wine); white-space: normal; }
.sw-note { margin: 0; align-self: center; font-size: 0.85rem; white-space: nowrap; }
.tabs { display: flex; gap: 0.25rem; overflow-x: auto; margin: 0 0 1rem; border-bottom: 2px solid var(--rule); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { min-height: var(--tap); padding: 0.5rem 1rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; color: var(--muted); font: inherit; font-size: 1.08rem; cursor: pointer; white-space: nowrap; }
.tabs button.is-on { color: var(--ink); border-bottom-color: var(--tile-blue); font-weight: 700; }
.drawer.confirm { max-width: 460px; }
.btn-danger.is-solid { background: var(--wine); border-color: var(--wine); color: #fff; }
.tb-grid { display: grid; align-items: start; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tb-card { border: 2px solid #cbbcae; border-radius: 12px; padding: 0.7rem 0.8rem; background: #fff; display: flex; flex-direction: column; gap: 0.4rem; }
.tb-card header { display: flex; justify-content: space-between; align-items: center; }
.tb-card .btn { align-self: flex-start; }
.tb-free { border-style: dashed; }
.tb-open { border-color: var(--tile-blue); background: #f2f6fb; }
.tb-bill { border-color: #f2b705; background: #fff8e1; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.75rem; margin: 0; font-size: 0.95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv-wide { max-width: 32rem; }
.kpi-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi { border: 1px solid var(--rule); border-radius: 10px; padding: 0.7rem 0.9rem; background: #fff; }
.kpi h3 { margin: 0 !important; font-size: 1rem; color: var(--muted); font-weight: 500; }
.kpi-big { margin: 0.2rem 0 0.4rem; font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); text-align: right; }
table.data th[scope="row"], table.data thead th:first-child { text-align: left; }
table.data tfoot th, table.data tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }
.w-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rule); }
.w-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.w-actions select { min-height: 40px; }
.big-code { font-size: 2.6rem; font-weight: 700; letter-spacing: 0.3em; margin: 0.2rem 0 0.5rem; font-variant-numeric: tabular-nums; }

/* ---------- a1.9 waiter tablet ---------- */
.waiter .w-summary { margin: 0 0 0.75rem; font-size: 1.05rem; }
.w-names { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.w-name { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; min-height: 84px; padding: 0.8rem; border: 2px solid var(--tile-blue); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-size: 1.2rem; cursor: pointer; text-align: left; }
.w-name span { font-size: 0.9rem; color: var(--muted); }
.w-name[disabled] { opacity: 0.55; border-style: dashed; }
.pin-card { max-width: 380px; margin-left: auto; margin-right: auto; }
.pin-dots { display: flex; justify-content: center; gap: 0.7rem; margin: 0.8rem 0 1rem; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink); }
.pin-dots span.on { background: var(--ink); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 0.9rem; }
.pin-pad .btn { min-height: 64px; font-size: 1.5rem; }
.pin-pad .btn:not(.pin-key) { font-size: 1.05rem; }
.w-order { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); align-items: start; }
.w-cart { position: sticky; top: 0.75rem; }
.w-who { font-weight: 700; font-size: 1.1rem; padding: 0 0.3rem; }
.w-sections { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.4rem 0 0.6rem; scrollbar-width: thin; }
.w-sections .chip { white-space: nowrap; }
.w-items li { border-bottom: 1px solid var(--rule); }
.w-item { display: flex; justify-content: space-between; gap: 0.75rem; width: 100%; min-height: var(--tap); padding: 0.55rem 0.3rem; border: 0; background: none; color: var(--ink); font: inherit; font-size: 1.08rem; text-align: left; cursor: pointer; }
.w-item[disabled] { color: var(--muted); text-decoration: line-through; cursor: not-allowed; }
.w-line { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--rule); }
.w-line-ctl { display: flex; align-items: center; gap: 0.35rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .w-order { grid-template-columns: minmax(0, 1fr); }
  .w-cart { position: static; }
}
@media (max-width: 600px) {
  .switch-strip { padding: 0.4rem 0.5rem; }
  .sw { font-size: 0.9rem; padding-right: 0.55rem; }
  .sw-note { white-space: normal; min-width: 9rem; max-width: 9rem; }
  .tabs button { padding: 0.5rem 0.7rem; font-size: 1rem; }
  .kv dd { text-align: left; }
  .big-code { font-size: 2rem; }
}

/* ======================================================================
   a1.11 · sign-in card (every staff area: floor, KDS, waiter, admin, QR)
   One centred narrow card, Google first, then email + password, PIN tablets on their own tab.
   ====================================================================== */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: flex-start; justify-content: center; padding: clamp(1rem, 7vh, 4.5rem) 1rem 2rem; }
.auth-card { width: 100%; max-width: 400px; background-color: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 1.6rem 1.5rem 1.1rem; box-shadow: 0 1px 2px rgba(17, 14, 13, 0.06), 0 10px 30px rgba(17, 14, 13, 0.08); }
.auth-mark { font-size: 1.05rem; }
.auth-rule { width: 10rem; height: 1.4rem; margin: 0.3rem auto 0.7rem; background-size: 1.4rem 1.4rem, 3.2rem 1px, 3.2rem 1px; }
.auth-card h1 { margin: 0; font-size: 1.85rem; font-weight: 600; line-height: 1.15; }
.auth-sub { margin: 0.3rem 0 1.15rem; text-align: center; color: var(--muted); font-size: 1.02rem; }
.auth-sub strong { color: var(--ink); font-weight: 600; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 1.1rem; background: var(--paper); border-radius: 10px; }
.auth-tabs button { min-height: 44px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 1rem; font-weight: 600; }
.auth-tabs button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(17, 14, 13, 0.16); }
.auth-tabs button:disabled { cursor: not-allowed; }
.auth-msg:empty { display: none; }
.auth-msg .callout, .auth-card > .callout { margin: 0 0 1rem; }
.auth-alert { font-size: 0.98rem; line-height: 1.4; }
.btn.auth-google { gap: 0.65rem; background: #fff; color: var(--ink); border: 1px solid #8a7a6a; font-weight: 600; }
.btn.auth-google:hover, .btn.auth-google:focus-visible { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.g-logo { flex: none; }
.auth-alt { margin-top: 0.6rem; }
.auth-or { display: flex; align-items: center; gap: 0.75rem; margin: 1.1rem 0; color: var(--muted); font-size: 0.95rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.auth-form { margin: 0; }
.auth-field { margin: 0 0 0.95rem; }
.auth-field label { display: block; margin: 0 0 0.3rem; font-weight: 600; }
.auth-field input { width: 100%; min-height: 48px; padding: 0.5rem 0.75rem; border: 1px solid #8a7a6a; border-radius: 8px; background: #fff; font-size: 1.05rem; }
.auth-field input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.auth-field input[aria-invalid="true"] { border-color: var(--late); box-shadow: 0 0 0 1px var(--late); }
.auth-pass { position: relative; }
.auth-pass input { padding-right: 5.4rem; }
.auth-eye { position: absolute; top: 2px; right: 2px; bottom: 2px; min-width: 44px; padding: 0 0.85rem; border: 0; border-radius: 6px; background: transparent; color: var(--tile-blue); font-size: 0.98rem; font-weight: 600; }
.auth-eye:hover { text-decoration: underline; }
.auth-field input.auth-pin { font-size: 1.5rem; letter-spacing: 0.45em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-help { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.btn.auth-submit { gap: 0.55rem; margin-top: 0.2rem; }
.auth-forgot { margin: 0.55rem 0 0; text-align: center; }
.auth-forgot .text-btn { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--tile-blue); font-size: 0.98rem; }
.auth-who { margin: 0 0 1rem; text-align: center; overflow-wrap: anywhere; }
.auth-actions { display: grid; gap: 0.6rem; }
.auth-foot { margin-top: 1.25rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); text-align: center; }
.auth-fine { margin: 0 0 0.2rem; color: var(--muted); font-size: 0.88rem; }
.auth-foot .lang { gap: 0.1rem 0.9rem; }
.auth-foot .lang button { min-height: 44px; font-size: 0.95rem; }
.btn-spin { display: inline-block; flex: none; width: 1.05em; height: 1.05em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
body.kds-body .auth { background: var(--night); }
body.kds-body .auth-card { color: var(--ink); }
body.auth-enter #app > * { animation: auth-in 0.35s ease-out; }
@keyframes auth-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 360px) {
  .auth { padding: 0.75rem 0.5rem 1.5rem; }
  .auth-card { padding: 1.25rem 1rem 1rem; border-radius: 10px; }
  .auth-card h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { .btn-spin { animation: none; border-right-color: currentColor; opacity: 0.6; } body.auth-enter #app > * { animation: none; } }
@media print { .auth { display: none; } }
/* a1.11: the waiter PIN pad uses the same card language as the sign-in card. */
.pin-card { border-radius: 14px; box-shadow: 0 1px 2px rgba(17, 14, 13, 0.06), 0 10px 30px rgba(17, 14, 13, 0.08); }


/* ======================================================================
   a1.12 · staff console ("dashboard grade"): one shell for every signed-in
   staff screen. Slim top bar + user menu, owner left nav (desktop) / top tabs
   (tablet) / bottom tabs (phone), tokens with AA contrast, shared components.
   Everything is scoped to body.staff-body so the guest UI and the a1.11
   sign-in card are untouched.
   ====================================================================== */
body.staff-body {
  --s-bg: #f4efe4; --s-surface: #fffdf9; --s-surface-2: #f4ede3; --s-border: #e2d5c5; --s-border-strong: #a8957f;
  --s-text: #1d1714; --s-text-2: #5c5348; --s-accent: #1d4e8c; --s-accent-hover: #163d6e; --s-accent-weak: #e6eef8; --s-on-accent: #ffffff;
  --s-danger: #9b1c1c; --s-danger-weak: #fbe4e4; --s-ok: #1f5f2c; --s-ok-weak: #e5f2e7; --s-warn: #5a3a00; --s-warn-weak: #fff1c7;
  --s-gold: #b8935a; --s-brand: #642a12; --s-focus: #1d4e8c; --s-radius: 12px; --s-bar: 58px;
  --s-shadow: 0 1px 2px rgba(17, 14, 13, 0.06), 0 4px 14px rgba(17, 14, 13, 0.06);
  --s-shadow-lg: 0 2px 6px rgba(17, 14, 13, 0.1), 0 18px 40px rgba(17, 14, 13, 0.18);
  background: var(--s-bg); color: var(--s-text);
}
body.staff-body.kds-body {
  --s-bg: #17120f; --s-surface: #241c18; --s-surface-2: #30261f; --s-border: #4a3d35; --s-border-strong: #7d6b5d;
  --s-text: #f6efe6; --s-text-2: #d7c9ba; --s-accent: #8fb6ea; --s-accent-hover: #b2cdf1; --s-accent-weak: #22344d; --s-on-accent: #0d1b2e;
  --s-danger: #ff9b8f; --s-danger-weak: #3d1d1a; --s-ok: #8fd19e; --s-ok-weak: #1b3322; --s-warn: #ffd37a; --s-warn-weak: #3a2c10;
  --s-brand: #e9dcd0; --s-focus: #8fb6ea;
}
.staff-body :focus-visible { outline: 3px solid var(--s-focus); outline-offset: 2px; }
.staff-body .ico { flex: none; vertical-align: middle; }
.toast .ico { flex: none; vertical-align: -4px; margin-right: 0.35rem; }
.staff-body .staff { background: transparent; color: var(--s-text); }
.staff-body .muted, .staff-body .help { color: var(--s-text-2); }

/* ---------- top bar */
.sb { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 0.6rem; min-height: var(--s-bar);
  padding: env(safe-area-inset-top, 0px) max(0.75rem, env(safe-area-inset-right)) 0 max(0.75rem, env(safe-area-inset-left));
  background: var(--s-surface); color: var(--s-text); border-bottom: 2px solid var(--s-gold); box-shadow: 0 1px 8px rgba(17, 14, 13, 0.06); }
.sb-brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; color: var(--s-brand); font-size: 1.1rem; font-weight: 600; letter-spacing: 0.08em; text-decoration: none; white-space: nowrap; }
.sb-div { flex: none; width: 1px; height: 24px; background: var(--s-border); }
.sb-area { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 1.12rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nav { display: flex; gap: 0.2rem; margin-left: 0.5rem; }
.sb-link { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.75rem; border-radius: 8px; color: var(--s-text-2); font-size: 1rem; text-decoration: none; white-space: nowrap; }
.sb-link:hover { background: var(--s-surface-2); color: var(--s-text); }
.sb-link[aria-current="page"] { background: var(--s-accent-weak); color: var(--s-accent); font-weight: 600; }
.sb-tools { display: flex; align-items: center; gap: 0.45rem; margin-left: auto; flex: none; }
.sb-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--s-border); border-radius: 10px; background: var(--s-surface); color: var(--s-text-2); cursor: pointer; }
.sb-icon.is-on { color: var(--s-accent); }
.sb-icon:hover, .sb-user:hover { background: var(--s-surface-2); }
.sb-user { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0 0.55rem 0 0.3rem; border: 1px solid var(--s-border); border-radius: 999px; background: var(--s-surface); color: var(--s-text); font: inherit; font-size: 0.95rem; cursor: pointer; }
.sb-role { color: var(--s-text-2); white-space: nowrap; }
.sb-chev { width: 16px; height: 16px; color: var(--s-text-2); }
.sb .net { white-space: nowrap; }
.sb-skel { pointer-events: none; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--brown); color: #fff; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; }
.kds-body .avatar { background: #8a5a3c; }
.avatar-lg { width: 44px; height: 44px; font-size: 1rem; }
.avatar-sq { border-radius: 10px; background: var(--s-accent-weak); color: var(--s-accent); }

/* user menu (popover) */
.um-scrim { position: fixed; inset: 0; z-index: 44; background: transparent; }
.um { position: absolute; top: calc(100% + 6px); right: max(0.75rem, env(safe-area-inset-right)); z-index: 45; width: min(330px, calc(100vw - 1.5rem)); max-height: calc(100dvh - var(--s-bar) - 1rem); overflow: auto;
  padding: 0.4rem; border: 1px solid var(--s-border); border-radius: 14px; background: var(--s-surface); color: var(--s-text); box-shadow: var(--s-shadow-lg); animation: s-pop 0.14s ease-out; }
.um-who { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.6rem 0.7rem; }
.um-id { display: grid; gap: 0.25rem; min-width: 0; justify-items: start; }
.um-email { font-weight: 600; overflow-wrap: anywhere; }
.um-sec { padding: 0.4rem 0; border-top: 1px solid var(--s-border); }
.um-h { margin: 0.2rem 0.6rem 0.3rem; color: var(--s-text-2); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.um-item { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 44px; padding: 0 0.6rem; border: 0; border-radius: 8px; background: none; color: var(--s-text); font: inherit; font-size: 1rem; text-align: left; text-decoration: none; cursor: pointer; }
.um-item:hover { background: var(--s-surface-2); }
.um-item[aria-current="page"] { color: var(--s-accent); font-weight: 600; }
.um-state { margin-left: auto; color: var(--s-text-2); font-size: 0.9rem; }
.um-danger { color: var(--s-danger); }
.um .lang { display: flex; gap: 0.3rem; padding: 0 0.6rem; }
.um .lang button { flex: 1; min-height: 44px; padding: 0 0.4rem; border: 1px solid var(--s-border); border-radius: 8px; background: var(--s-surface); color: var(--s-text); font-size: 0.95rem; text-decoration: none; }
.um .lang button.is-on { border-color: var(--s-accent); background: var(--s-accent-weak); color: var(--s-accent); font-weight: 700; }

/* banners */
.net-banner { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem max(1rem, env(safe-area-inset-left)); background: #fff1c7; color: #4a3300; border-bottom: 1px solid #e8c96a; font-size: 1rem; }
.net-banner .ico { color: #774d00; }
.staff-body .banner { margin: 0; border-radius: 0; }

/* ---------- buttons */
.staff-body .btn { gap: 0.45rem; min-height: 44px; padding: 0.4rem 1rem; border: 1px solid var(--s-border-strong); border-radius: 10px; background: var(--s-surface); color: var(--s-text); font-size: 1rem; font-weight: 600; transition: background 0.12s, border-color 0.12s; }
.staff-body .btn:hover, .staff-body .btn:focus-visible { background: var(--s-surface-2); color: var(--s-text); }
.staff-body .btn-primary, .staff-body .btn.is-solid { background: var(--s-accent); border-color: var(--s-accent); color: var(--s-on-accent); }
.staff-body .btn-primary:hover, .staff-body .btn-primary:focus-visible, .staff-body .btn.is-solid:hover { background: var(--s-accent-hover); border-color: var(--s-accent-hover); color: var(--s-on-accent); }
.staff-body .btn-danger { background: var(--s-surface); border-color: var(--s-danger); color: var(--s-danger); }
.staff-body .btn-danger:hover, .staff-body .btn-danger:focus-visible, .staff-body .btn-danger.is-solid { background: var(--s-danger); border-color: var(--s-danger); color: var(--s-surface); }
.staff-body .btn-ghost { background: transparent; border-color: transparent; color: var(--s-accent); }
.staff-body .btn-ghost:hover, .staff-body .btn-ghost:focus-visible { background: var(--s-accent-weak); color: var(--s-accent); }
.staff-body .btn-sm { min-height: 44px; padding: 0.3rem 0.8rem; font-size: 0.95rem; }
.staff-body .btn-xl { min-height: 56px; font-size: 1.12rem; }
.staff-body .btn:disabled, .staff-body .btn[aria-disabled="true"] { opacity: 0.5; }
.staff-body .icon-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--s-border); border-radius: 10px; background: var(--s-surface); color: var(--s-text-2); cursor: pointer; }
.staff-body .icon-btn:hover { background: var(--s-surface-2); color: var(--s-text); }
.staff-body .icon-danger { color: var(--s-danger); }
.staff-body .icon-danger:hover { background: var(--s-danger-weak); color: var(--s-danger); }
.toast-act { flex: none; margin-left: auto; min-height: 44px; padding: 0 0.9rem; border: 1px solid rgba(255, 255, 255, 0.65); border-radius: 8px; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.toast-act:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- badges, stats, chips */
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.badge.tone-neutral { background: #ece4da; color: #3d342d; }
.badge.tone-info { background: #e6eef8; color: #12305a; }
.badge.tone-ok { background: #e5f2e7; color: #174d22; }
.badge.tone-warn { background: #fff1c7; color: #5a3a00; }
.badge.tone-danger { background: #fbe4e4; color: #7a1010; }
.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.stats { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 0 0 1rem; }
.stat { display: grid; gap: 0.1rem; padding: 0.6rem 0.9rem; border: 1px solid var(--s-border); border-left: 4px solid var(--s-border-strong); border-radius: 10px; background: var(--s-surface); }
.stat-n { font-size: 1.65rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--s-text-2); font-size: 0.9rem; }
.stat.is-big .stat-n { font-size: 2rem; }
.stat.tone-info { border-left-color: var(--s-accent); }
.stat.tone-ok { border-left-color: var(--s-ok); }
.stat.tone-warn { border-left-color: #c69214; }
.stat.tone-danger { border-left-color: var(--s-danger); }
.stat.tone-danger .stat-n { color: var(--s-danger); }
.staff-body .age { display: inline-flex; align-items: center; gap: 0.25rem; font-variant-numeric: tabular-nums; }
.staff-body .age .ico { width: 16px; height: 16px; }
.staff-body .age.is-warn { color: var(--s-warn); font-weight: 700; }
.staff-body .age.is-late { color: var(--s-danger); font-weight: 700; }
.count { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding: 0 0.45rem; border-radius: 999px; background: var(--s-danger, #9b1c1c); color: #fff; font-size: 0.9rem; font-weight: 700; }
.kds-body .count { color: #17120f; }

/* ---------- search, segmented filters, forms */
.search { position: relative; display: inline-flex; align-items: center; flex: 1 1 14rem; max-width: 22rem; }
.search .ico { position: absolute; left: 0.7rem; color: var(--s-text-2); pointer-events: none; }
.search input { width: 100%; min-height: 44px; padding: 0.35rem 0.75rem 0.35rem 2.3rem; border: 1px solid var(--s-border-strong); border-radius: 10px; background: var(--s-surface); color: var(--s-text); font: inherit; font-size: 1rem; }
.staff-body .seg { display: inline-flex; max-width: 100%; overflow-x: auto; border: 1px solid var(--s-border-strong); border-radius: 10px; scrollbar-width: none; }
.staff-body .seg::-webkit-scrollbar { display: none; }
.staff-body .seg > * { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; padding: 0 0.85rem; border: 0; background: var(--s-surface); color: var(--s-text); font-size: 1rem; white-space: nowrap; }
.staff-body .seg > * + * { border-left: 1px solid var(--s-border); }
.staff-body .seg > .is-on, .staff-body .seg > [aria-pressed="true"] { background: var(--s-accent); color: var(--s-on-accent); font-weight: 700; }
.seg-n { font-size: 0.8rem; font-variant-numeric: tabular-nums; opacity: 0.85; }
.staff-body .field input, .staff-body .field select, .staff-body .field textarea, .staff-body .lr-actions select, .staff-body .card-tools select {
  min-height: 44px; padding: 0.35rem 0.65rem; border: 1px solid var(--s-border-strong); border-radius: 10px; background: var(--s-surface); color: var(--s-text); font: inherit; font-size: 1rem; }
.staff-body .field label, .staff-body .field > span { font-weight: 600; }
.staff-body [aria-invalid="true"] { border-color: var(--s-danger) !important; box-shadow: 0 0 0 1px var(--s-danger); }
.field-err { display: flex; align-items: center; gap: 0.3rem; margin: 0.15rem 0 0; color: var(--s-danger); font-size: 0.9rem; }
.field-err:empty { display: none; }
.row-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; }
.row-form .field { margin: 0; flex: 1 1 11rem; }
.form-card { margin-top: 0.75rem; padding: 0.75rem 0.9rem; border: 1px dashed var(--s-border-strong); border-radius: 10px; background: var(--s-surface-2); }
.staff-body .callout { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.7rem; border-radius: 10px; }
.staff-body .callout > p { margin: 0; }
.staff-body .callout.warn { background: #fff1c7; color: #4a3300; border-color: #c69214; }

/* ---------- cards, empty states, skeletons */
.staff-body .card { padding: 1rem 1.1rem; border: 1px solid var(--s-border); border-radius: var(--s-radius); background: var(--s-surface); color: var(--s-text); box-shadow: var(--s-shadow); }
.staff-body .card + .card, .staff-body .card + .stats, .staff-body .stats + .card, .staff-body .kpi-grid + * { margin-top: 1rem; }
.staff-body .card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; font-size: 1.25rem; font-weight: 600; }
.card-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0 0 0.75rem; }
.card-hero .hero-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; }
.card-hero.is-paused { border-color: var(--s-danger); background: var(--s-danger-weak); }
.page-title { margin: 0.2rem 0 0.9rem; font-size: 1.6rem; font-weight: 500; }
.sec-title { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.5rem; font-size: 1.2rem; font-weight: 600; }
.grp-h { margin: 1rem 0 0.45rem; color: var(--s-text-2); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.empty-state { padding: 1.75rem 1rem; color: var(--s-text-2); text-align: center; }
.empty-ico { display: block; width: 36px; height: 36px; margin: 0 auto 0.5rem; color: var(--s-gold); }
.empty-title { margin: 0; color: var(--s-text); font-size: 1.1rem; font-weight: 600; }
.empty-body { margin: 0.25rem auto 0; max-width: 28rem; }
.skel-wrap { display: grid; gap: 0.75rem; }
.skel-tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.skel-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.skel { display: block; border-radius: 12px; background: linear-gradient(90deg, #ece4da 0%, #f7f1ea 50%, #ece4da 100%); background-size: 200% 100%; animation: s-skel 1.3s ease-in-out infinite; }
.kds-body .skel { background: linear-gradient(90deg, #2a211c 0%, #3a2e27 50%, #2a211c 100%); background-size: 200% 100%; }
.skel-tile { height: 104px; } .skel-row { height: 44px; } .skel-card { height: 140px; }
.more { display: flex; justify-content: center; margin: 0.75rem 0 0; }
.no-match { padding: 1rem; color: var(--s-text-2); text-align: center; }

/* ---------- data tables (sticky header; cards on phones) */
.staff-body .table-scroll { max-height: 70vh; overflow: auto; border: 1px solid var(--s-border); border-radius: 10px; }
.staff-body table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.98rem; }
.staff-body table.data th, .staff-body table.data td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--s-border); text-align: left; vertical-align: top; }
.staff-body table.data thead th { position: sticky; top: 0; z-index: 1; background: var(--s-surface-2); color: var(--s-text-2); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.staff-body table.data tbody tr:hover { background: var(--s-surface-2); }
.staff-body table.data tr.is-flag { background: var(--s-danger-weak); }
.staff-body table.data tfoot th, .staff-body table.data tfoot td { font-weight: 700; border-top: 2px solid var(--s-border-strong); border-bottom: 0; }
.staff-body .num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-note { display: block; color: var(--s-text-2); font-size: 0.85rem; }
@media (max-width: 767px) {
  .staff-body .table-scroll { max-height: none; overflow: visible; border: 0; }
  .staff-body table.data-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .staff-body table.data-cards, .staff-body table.data-cards tbody, .staff-body table.data-cards tfoot { display: block; }
  .staff-body table.data-cards tr { display: block; margin: 0 0 0.6rem; padding: 0.35rem 0.75rem; border: 1px solid var(--s-border); border-radius: 10px; background: var(--s-surface); }
  .staff-body table.data-cards td, .staff-body table.data-cards th { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border: 0; text-align: right; }
  .staff-body table.data-cards td::before, .staff-body table.data-cards tfoot th::before { content: attr(data-label); flex: none; color: var(--s-text-2); font-weight: 600; text-align: left; }
  .staff-body table.data-cards td:not([data-label])::before { content: none; }
  .staff-body .num { white-space: normal; }
}

/* ---------- lists, switches, meters, option cards */
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--s-border); }
.list-row:last-child { border-bottom: 0; }
.lr-main { display: grid; gap: 0.15rem; flex: 1 1 12rem; min-width: 0; }
.lr-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; color: var(--s-text-2); font-size: 0.9rem; }
.lr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.avail-list { display: grid; gap: 0.45rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.avail-row { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 48px; padding: 0.4rem 0.75rem; border: 1px solid var(--s-border); border-radius: 10px; background: var(--s-surface); color: var(--s-text); font: inherit; font-size: 1rem; text-align: left; cursor: pointer; }
.avail-row:hover { border-color: var(--s-border-strong); }
.avail-name { flex: 1; min-width: 0; }
.avail-row .sw-track { position: relative; display: block; flex: none; width: 2.6rem; height: 1.5rem; }
.avail-row .sw-knob { display: block; width: 100%; height: 100%; background: var(--s-ok); }
.avail-row .sw-knob::after { transform: translateX(1.1rem); }
.avail-row.is-off .sw-knob { background: var(--s-border-strong); }
.avail-row.is-off .sw-knob::after { transform: none; }
.avail-state { min-width: 5.5rem; color: var(--s-ok); font-size: 0.85rem; font-weight: 700; text-align: right; }
.avail-row.is-off { background: var(--s-danger-weak); }
.avail-row.is-off .avail-state { color: var(--s-danger); }
.avail-row.is-off .avail-name { color: var(--s-text-2); text-decoration: line-through; }
.meter { height: 8px; margin: 0.25rem 0 0.6rem; overflow: hidden; border: 1px solid var(--s-border); border-radius: 999px; background: var(--s-surface-2); }
.meter-bar { display: block; height: 100%; background: var(--s-ok); }
.meter-bar.m-0 { width: 0%; }
.meter-bar.m-5 { width: 5%; }
.meter-bar.m-10 { width: 10%; }
.meter-bar.m-15 { width: 15%; }
.meter-bar.m-20 { width: 20%; }
.meter-bar.m-25 { width: 25%; }
.meter-bar.m-30 { width: 30%; }
.meter-bar.m-35 { width: 35%; }
.meter-bar.m-40 { width: 40%; }
.meter-bar.m-45 { width: 45%; }
.meter-bar.m-50 { width: 50%; }
.meter-bar.m-55 { width: 55%; }
.meter-bar.m-60 { width: 60%; }
.meter-bar.m-65 { width: 65%; }
.meter-bar.m-70 { width: 70%; }
.meter-bar.m-75 { width: 75%; }
.meter-bar.m-80 { width: 80%; }
.meter-bar.m-85 { width: 85%; }
.meter-bar.m-90 { width: 90%; }
.meter-bar.m-95 { width: 95%; }
.meter-bar.m-100 { width: 100%; }
.staff-body .review-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--s-border); }
.staff-body .review-row > :first-child { flex: 1 1 12rem; }
.staff-body .review-row .dish-meta { flex-basis: 100%; margin: 0; color: var(--s-text-2); font-size: 0.85rem; letter-spacing: 0; text-transform: none; }
.opt-cards { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 0.4rem 0 0; }
.staff-body .opt-card { display: flex; align-items: center; gap: 0.6rem; min-height: 48px; padding: 0.7rem 0.9rem; border: 1px solid var(--s-border); border-radius: 10px; background: var(--s-surface); cursor: pointer; }
.staff-body .opt-card:has(input:checked), .staff-body .opt-card.is-on { border-color: var(--s-accent); background: var(--s-accent-weak); box-shadow: inset 0 0 0 1px var(--s-accent); }
.staff-body .opt-card input { width: 20px; height: 20px; accent-color: var(--s-accent); }

/* ---------- live controls (switch strip becomes a card in the page) */
.staff-body .switch-strip { position: static; display: block; margin: 0 0 1rem; padding: 0.7rem 0.85rem; overflow: visible; border: 1px solid var(--s-border); border-radius: var(--s-radius); background: var(--s-surface); box-shadow: var(--s-shadow); }
.lc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin: 0 0 0.5rem; color: var(--s-text-2); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.lc-title .muted { letter-spacing: 0; text-transform: none; font-weight: 400; }
.sw-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.staff-body .sw { border-width: 1px; border-color: var(--s-border-strong); background: var(--s-surface); color: var(--s-text); }
.staff-body .sw.is-on { border-color: var(--s-ok); background: var(--s-ok-weak); }
.staff-body .sw-note { white-space: normal; }

/* ---------- owner dashboard: left nav / top tabs / bottom tabs */
.dash { display: block; }
.dash-tabs { display: flex; gap: 0.25rem; }
.dash-tab { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0 0.8rem; border: 0; border-radius: 8px; background: none; color: var(--s-text-2); font: inherit; font-size: 1.02rem; text-align: left; white-space: nowrap; cursor: pointer; }
.dash-tab:hover { background: var(--s-surface); color: var(--s-text); }
.dash-tab.is-on, .dash-tab[aria-selected="true"] { background: var(--s-accent-weak); color: var(--s-accent); font-weight: 700; }
@media (min-width: 1024px) {
  .dash { display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; }
  .dash-nav { position: sticky; top: var(--s-bar); height: calc(100dvh - var(--s-bar)); padding: 1rem 0.7rem; border-right: 1px solid var(--s-border); background: var(--s-surface-2); }
  .dash-tabs { flex-direction: column; }
  .dash-tab.is-on { box-shadow: inset 3px 0 0 var(--s-accent); }
  .dash-main { margin: 0; max-width: 1240px; min-height: 0; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .dash-nav { position: sticky; top: var(--s-bar); z-index: 20; background: var(--s-surface); border-bottom: 1px solid var(--s-border); }
  .dash-tabs { overflow-x: auto; padding: 0 0.75rem; scrollbar-width: none; }
  .dash-tab { border-radius: 0; border-bottom: 3px solid transparent; }
  .dash-tab.is-on { background: none; border-bottom-color: var(--s-accent); }
}
@media (max-width: 767px) {
  .dash-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); border-top: 1px solid var(--s-border); background: var(--s-surface); box-shadow: 0 -4px 14px rgba(17, 14, 13, 0.08); }
  .dash-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
  .dash-tab { flex-direction: column; justify-content: center; gap: 0.1rem; min-height: 58px; padding: 0.3rem 0.1rem; border-radius: 0; font-size: 0.74rem; text-align: center; overflow: hidden; text-overflow: ellipsis; }
  .dash-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .dash-tab.is-on { background: none; box-shadow: inset 0 3px 0 var(--s-accent); }
  .dash-main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .dash ~ .toast { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- floor live: attention first, status chips, age colours */
.attn { margin: 0 0 1rem; }
.attn-none { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 1rem; padding: 0.6rem 0.9rem; border-radius: 10px; background: var(--s-ok-weak); color: var(--s-ok); font-weight: 600; }
.staff-body .alert-strip { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.staff-body .alert-card { flex-wrap: wrap; min-height: 64px; border-radius: 12px; box-shadow: var(--s-shadow); }
.al-sub { display: block; font-size: 0.9rem; opacity: 0.92; }
.al-btns { display: flex; gap: 0.4rem; margin-left: auto; }
.staff-body .alert-card .btn-secondary { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.7); color: inherit; }
.staff-body .al-bill .btn-secondary { background: rgba(255, 255, 255, 0.4); border-color: #2b1d00; }
.staff-body .alert-card .btn-primary { background: #fff; border-color: #fff; color: #1d1714; }
.staff-body .alert-card .age.is-warn, .staff-body .alert-card .age.is-late, .age-txt.is-warn, .age-txt.is-late { padding: 0 0.35rem; border-radius: 6px; background: #fff; }
.staff-body .alert-card .age.is-warn, .age-txt.is-warn { color: #6a4300; }
.staff-body .alert-card .age.is-late, .age-txt.is-late { color: #9b1c1c; font-weight: 700; }
.floor-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0 0 0.75rem; }
.tile-chip { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.92; }
.staff-body .tile { border-radius: 12px; }
.staff-body .tl-call, .staff-body .tl-ready { animation-iteration-count: 3; box-shadow: 0 0 0 3px rgba(17, 14, 13, 0.18); }
.staff-body .legend { margin-top: 1rem; }
.staff-body .drawer { z-index: 55; border-radius: 16px 16px 0 0; box-shadow: var(--s-shadow-lg); color: var(--s-text); }
.staff-body .scrim { z-index: 50; }
.panel-foot { position: sticky; bottom: calc(-1.2rem - env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 1rem -1rem 0; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--s-border); background: var(--paper); }
.total-big { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .staff-body .drawer-side { top: 0; right: 0; bottom: 0; left: auto; width: min(520px, 100%); max-width: none; max-height: none; height: 100dvh; transform: none; border-radius: 0; border-left: 1px solid var(--s-border); animation: s-side 0.16s ease-out; }
}

/* ---------- dialogs and toasts */
.dlg-scrim { z-index: 70 !important; background: rgba(17, 14, 13, 0.5); }
.dlg { position: fixed; top: 50%; left: 50%; z-index: 71; width: min(440px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 2rem); overflow: auto; transform: translate(-50%, -50%); padding: 1.25rem 1.25rem 1.1rem;
  border: 1px solid var(--s-border, #e2d5c5); border-radius: 16px; background: var(--s-surface, #fffdf9); color: var(--s-text, #1d1714); box-shadow: var(--s-shadow-lg); animation: s-dlg 0.16s ease-out; }
.dlg-ico { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--s-accent-weak, #e6eef8); color: var(--s-accent, #1d4e8c); }
.dlg-ico.is-danger { background: var(--s-danger-weak, #fbe4e4); color: var(--s-danger, #9b1c1c); }
.dlg h2 { margin: 0.75rem 0 0.35rem; font-size: 1.35rem; font-weight: 600; }
.dlg p { margin: 0; color: var(--s-text-2, #5c5348); line-height: 1.45; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }
@media (max-width: 480px) { .dlg-actions .btn { flex: 1 1 auto; } }
.staff-body .toast { top: auto; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.6rem 0.55rem 0.9rem; border-radius: 12px; box-shadow: var(--s-shadow-lg); }
.toast-text { flex: 1; min-width: 0; }

/* ---------- KDS: big tickets, new-ticket cue */
.kds-stats { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.kds-stats .chip { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 40px; margin: 0; padding: 0.2rem 0.75rem; border: 1px solid var(--s-border); border-radius: 999px; background: var(--s-surface); color: var(--s-text); font-size: 1rem; font-weight: 600; }
.kds-stats .chip.is-warn { background: #f2b705; border-color: #f2b705; color: #2b1d00; }
.kds-stats .chip.is-late { background: #c62828; border-color: #c62828; color: #fff; }
.staff-body .kds-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.staff-body .ticket { border-radius: 14px; }
.staff-body .tk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; }
.staff-body .tk-head .age { margin-left: auto; }
.tk-round { color: #5c5348; font-size: 0.95rem; }
.tk-name { color: #3d342d; font-size: 0.95rem; }
.staff-body .ticket .age.is-warn { color: #6a4300; }
.staff-body .ticket .age.is-late { color: #9b1c1c; }
.staff-body .tk-lines { font-size: 1.25rem; }
.staff-body .bump { display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 72px; }
.staff-body .bump .ico { width: 26px; height: 26px; }
.ticket.is-new { outline: 3px solid #8fb6ea; outline-offset: 2px; animation: s-new 1.4s ease-out 2; }
.kds-ready .btn-ghost { color: #b2cdf1; }

/* ---------- waiter: big targets, sticky cart bar, sent confirmation */
.w-who { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; white-space: nowrap; }
.staff-body .w-name { border-width: 1px; border-color: var(--s-border-strong); border-radius: 12px; flex-direction: row; align-items: center; gap: 0.7rem; }
.staff-body .w-name:hover { border-color: var(--s-accent); }
.staff-body .pin-pad .btn { min-height: 64px; border-radius: 12px; font-size: 1.5rem; }
.staff-body .w-sections .chip { min-height: 44px; padding: 0 1rem; border: 1px solid var(--s-border-strong); border-radius: 999px; background: var(--s-surface); color: var(--s-text); font-size: 1rem; }
.staff-body .w-sections .chip.is-on, .staff-body .w-sections .chip[aria-pressed="true"] { border-color: var(--s-accent); background: var(--s-accent); color: var(--s-on-accent); }
.staff-body .w-items li { border: 0; }
.staff-body .w-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0.6rem; min-height: 56px; margin: 0 0 0.4rem; padding: 0.45rem 0.6rem 0.45rem 0.85rem; border: 1px solid var(--s-border); border-radius: 12px; background: var(--s-surface); }
.staff-body .w-item:hover { border-color: var(--s-accent); }
.w-item-name { min-width: 0; }
.w-item-more { color: var(--s-text-2); }
.w-item-price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-item-add { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--s-accent); color: var(--s-on-accent); }
.staff-body .w-item[disabled] .w-item-add { background: var(--s-border-strong); }
.staff-body .w-line { align-items: center; padding: 0.5rem 0; border-color: var(--s-border); }
.w-line-main { display: grid; gap: 0.1rem; min-width: 0; }
.w-line-main small { color: var(--s-text-2); }
.qty-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--s-border-strong); border-radius: 50%; background: var(--s-surface); color: var(--s-text); cursor: pointer; }
.qty-n { min-width: 1.6rem; font-weight: 700; text-align: center; }
.w-line-amt { min-width: 4.5rem; text-align: right; }
.qty-group { display: inline-flex; align-items: center; gap: 0.5rem; }
.w-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.w-add-row .btn { flex: 1 1 10rem; }
#w-cart { scroll-margin-top: calc(var(--s-bar) + 0.5rem); }
.w-cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 36; display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem max(0.75rem, env(safe-area-inset-right, 0px)) calc(0.6rem + env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--s-border); background: var(--s-surface); box-shadow: 0 -4px 14px rgba(17, 14, 13, 0.1); }
.w-cartbar-sum { display: inline-flex; flex: 1; align-items: center; gap: 0.5rem; min-height: 48px; min-width: 0; color: var(--s-text); font-weight: 700; text-decoration: none; }
.w-cartbar .btn { min-height: 52px; padding: 0 1.2rem; }
main.has-cartbar { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
.has-cartbar ~ .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 861px) { .w-cartbar { display: none; } main.has-cartbar { padding-bottom: 4rem; } .has-cartbar ~ .toast { bottom: 1rem; } }
.sent-card { max-width: 560px; margin: 1.5rem auto; padding: 2rem 1.25rem; text-align: center; animation: s-dlg-in 0.22s ease-out; }
.sent-ico { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; background: var(--s-ok); color: #fff; }
.sent-ico .ico { width: 40px; height: 40px; }
.staff-body .sent-card h2 { justify-content: center; margin: 0 0 0.4rem; font-size: 1.8rem; }
.sent-actions { display: grid; gap: 0.6rem; margin-top: 1.25rem; }
@media (min-width: 600px) { .sent-actions { grid-template-columns: 1fr 1fr; } }

/* ---------- QR printing */
.page-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin: 0 0 1rem; }
.page-tools h2 { margin: 0; }

/* ---------- small screens: no horizontal scroll at 320px */
@media (max-width: 899px) { .sb-nav { display: none; } }
@media (min-width: 900px) { .um-areas { display: none; } }
@media (max-width: 600px) {
  .sb { gap: 0.4rem; }
  .sb-role, .sb-chev { display: none; }
  .sb-div { height: 18px; }
  .sb-user { padding: 0 0.25rem; }
  .sb .net { font-size: 0; gap: 0; padding: 0.45rem; }
  .sb-brand { font-size: 0.98rem; letter-spacing: 0.05em; }
  .sb-area { font-size: 1rem; }
  .page-title { font-size: 1.35rem; }
  .staff-body .card { padding: 0.85rem 0.8rem; }
  .search { max-width: none; flex-basis: 100%; }
  .al-btns { width: 100%; margin-left: 0; }
  .al-btns .btn { flex: 1; }
}
@media (max-width: 767px) {
  .sw-row { flex-wrap: nowrap; overflow-x: auto; margin: 0 -0.85rem; padding: 0 0.85rem 0.2rem; scroll-snap-type: x proximity; scrollbar-width: none; }
  .sw-row::-webkit-scrollbar { display: none; }
  .sw-row > * { scroll-snap-align: start; }
}
@media (max-width: 360px) { .sb-div { display: none; } }
@media (max-width: 420px) {
  .sb-icon[data-act="sound"] { display: none; }
  .w-who .avatar { display: none; }
  .w-who-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sb-tools [data-act="w-lock"] span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sb-tools [data-act="w-lock"] { min-width: 44px; padding: 0 0.6rem; }
}

@keyframes s-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes s-dlg { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes s-dlg-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes s-side { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes s-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes s-new { 0% { box-shadow: 0 0 0 0 rgba(143, 182, 234, 0.8); } 100% { box-shadow: 0 0 0 14px rgba(143, 182, 234, 0); } }
@media (prefers-reduced-motion: reduce) {
  .um, .dlg, .sent-card, .staff-body .drawer-side, .ticket.is-new, .skel, .staff-body .tl-call, .staff-body .tl-ready { animation: none !important; }
  .staff-body .btn, .staff-body .sw-knob, .staff-body .sw-knob::after { transition: none; }
}
@media print {
  .sb, .net-banner, .staff-body .banner, .dash-nav, .switch-strip, .toast, .w-cartbar, .page-tools { display: none !important; }
  body.staff-body { background: #fff; }
}

/* ======================================================================
   a1.14: connection banner + Reconnect, waiter-tablet checklist, "Try it yourself" card
   ====================================================================== */
.net-banner .nb-text { flex: 1 1 14rem; min-width: 0; }
.net-banner .nb-btn { flex: 0 0 auto; margin-left: auto; }
.staff-body .net-banner .btn-secondary { background: #fffdf9; color: #4a3300; border-color: #a07a1c; }
.staff-body .net-banner .btn-secondary:hover, .staff-body .net-banner .btn-secondary:focus-visible { background: #fff7de; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.4rem 0 0; }
.staff-body .card h3 { margin: 0 0 0.25rem; font-size: 1.08rem; font-weight: 600; line-height: 1.3; }

/* checklist */
.setup-card { border-top: 3px solid var(--s-gold); }
.setup-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.setup-head h2 { margin: 0 !important; }
.setup-head h2 .ico { color: var(--s-brand); }
.setup-steps { list-style: none; margin: 0.6rem 0 0; padding: 0; counter-reset: none; }
.setup-step { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0.75rem; padding: 0.8rem 0; border-top: 1px solid var(--s-border); }
.setup-step:first-child { border-top: 0; }
.step-mark { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border: 2px solid var(--s-border-strong); border-radius: 50%; background: var(--s-surface); color: var(--s-text-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.setup-step.is-next .step-mark { border-color: var(--s-accent); background: var(--s-accent-weak); color: var(--s-accent); }
.setup-step.is-done .step-mark { border-color: var(--s-ok); background: var(--s-ok); color: #fff; }
.setup-step.is-done .step-mark .ico { width: 18px; height: 18px; }
.setup-step.is-done h3 { color: var(--s-ok); }
.step-body { min-width: 0; }
.step-body > .note { margin: 0 0 0.4rem; }
.dev-name { margin: 0.6rem 0 0.1rem; }
.dev-id { margin: 0.3rem 0 0.2rem; padding: 0.6rem 0.75rem; border: 1px dashed var(--s-border-strong); border-radius: 10px; background: var(--s-surface-2); }
.dev-id-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; margin: 0; }
.dev-id-l { color: var(--s-text-2); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; cursor: help; }
.dev-id-code { font-size: 1rem; word-break: break-all; color: var(--s-text); user-select: all; -webkit-user-select: all; }
.dev-id.is-big { border-style: solid; border-color: var(--s-ok); background: var(--s-surface); color: var(--s-text); }
.dev-id.is-big .dev-id-code { font-size: 1.3rem; font-weight: 700; letter-spacing: 0.02em; }
.new-device { display: block !important; }
.new-device > p { margin: 0 0 0.4rem !important; }
details.help-box { margin: 0.8rem 0 0; border: 1px solid var(--s-border); border-radius: 10px; background: var(--s-surface-2); }
details.help-box > summary { display: flex; align-items: center; min-height: 44px; padding: 0.35rem 0.9rem; cursor: pointer; font-weight: 600; color: var(--s-accent); list-style-position: inside; }
details.help-box > summary:focus-visible { outline: 3px solid var(--s-focus); outline-offset: 2px; border-radius: 10px; }
.help-dl { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); gap: 0.45rem 1rem; margin: 0; padding: 0.2rem 0.9rem 0.9rem; }
.help-dl dt { font-weight: 700; }
.help-dl dd { margin: 0; color: var(--s-text-2); }

/* try it yourself */
.test-card { border-top: 3px solid var(--s-gold); }
.mode-line { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: baseline; margin: 0.3rem 0 0.5rem; }
.mode-l { color: var(--s-text-2); }
.test-steps { margin: 0.6rem 0 0; padding-left: 1.4rem; }
.test-steps > li { padding: 0.55rem 0 0.55rem 0.25rem; border-top: 1px solid var(--s-border); }
.test-steps > li:first-child { border-top: 0; }
.test-steps > li::marker { font-weight: 700; color: var(--s-text-2); }
.test-steps .note { margin: 0; }
.test-ok { margin: 0; }
.guest-link { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; margin-top: 0.3rem; }
.guest-qr { flex: 0 0 auto; width: 132px; height: 132px; padding: 4px; border: 1px solid var(--s-border); border-radius: 8px; background: #fff; }
.guest-link-main { flex: 1 1 14rem; min-width: 0; }
.staff-body input.select { min-height: 44px; color: var(--s-text); background: var(--s-surface); border-color: var(--s-border-strong); }
@media (max-width: 600px) {
  .net-banner { flex-wrap: wrap; }
  .net-banner .nb-btn { margin-left: 2rem; }
  .help-dl { grid-template-columns: 1fr; gap: 0.15rem; }
  .help-dl dd { margin-bottom: 0.5rem; }
  .setup-step { grid-template-columns: 2rem minmax(0, 1fr); gap: 0.6rem; }
  .step-mark { width: 2rem; height: 2rem; }
  .btn-row > .btn { flex: 1 1 auto; }
}
@media print { .test-card, .setup-card { display: none !important; } }
/* a1.14 polish: language links on the sign-in card were 41px wide (touch target 44px) */
.auth-foot .lang button { min-width: 44px; padding-left: 0.3rem; padding-right: 0.3rem; }
/* a1.14 polish: notes inside dashboard cards read left-aligned with the content (were centred, 36rem) */
.staff-body .card .note { margin: 0.4rem 0; max-width: 68ch; text-align: left; color: var(--s-text-2); }
.staff-body .card .step-body > .note { margin: 0 0 0.4rem; }
.staff-body .card .test-steps .note { margin: 0; }
.test-mini { margin: 0.6rem 0 0; }

/* ======================================================================
   a1.16 · VERI*FACTU: invoices tab, refund dialog, printable ticket.
   QR printed at 35 mm (spec v0.5.0: 30-40 mm), "QR tributario:" above, "VERI*FACTU" below.
   ====================================================================== */
.vf-card h3 { margin: 1rem 0 0.35rem; font-size: 1.05rem; }
.vf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }
.vf-grid .field .note { margin: 0; font-size: 0.9rem; }
.is-upper { text-transform: uppercase; }
.check { display: flex; align-items: center; gap: 0.6rem; min-height: 48px; margin: 0.4rem 0; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--ink, #2b2520); }
.vf-missing { margin: 0.25rem 0 0.5rem; padding-left: 1.2rem; line-height: 1.5; }
.vf-list { list-style: none; margin: 0.4rem 0; padding: 0; }
.vf-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rule, #e4dccf); }
.vf-qty { display: flex; align-items: center; gap: 0.4rem; }
.vf-qty input { width: 5rem; min-height: 44px; }
.vf-hash { font-size: 0.9rem; word-break: break-all; }
.vf-err { color: var(--late, #9b1c1c); word-break: break-word; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.vf-table { min-width: 720px; }
.vf-table td, .vf-table th { text-align: left; vertical-align: middle; }
.vf-table .num { text-align: right; }
.vf-acts { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.dlg-wide { width: min(560px, calc(100vw - 1.5rem)); }
.dlg-wide .field { margin-top: 0.8rem; }
.vf-receipt-wrap { position: fixed; z-index: 72; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); overflow: auto;
  background: #fff; border-radius: 14px; padding: 1rem; box-shadow: 0 12px 40px rgba(17, 14, 13, 0.25); }
.vf-receipt { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.92rem; color: #111; line-height: 1.35; }
.vf-receipt header { text-align: center; margin-bottom: 0.6rem; }
.vf-receipt header h2 { margin: 0 0 0.15rem; font-size: 1.1rem; }
.vf-receipt header p, .vf-rx-kind, .vf-rx-ref { margin: 0.1rem 0; }
.vf-rx-kind, .vf-rx-ref { padding: 0.4rem 0; border-top: 1px dashed #777; }
.vf-test, .vf-void { margin: 0 0 0.5rem; padding: 0.3rem; text-align: center; font-weight: 700; border: 2px solid #111; letter-spacing: 0.04em; }
.vf-void { color: var(--late, #9b1c1c); border-color: currentColor; }
.vf-rx-lines, .vf-rx-vat { width: 100%; border-collapse: collapse; margin: 0.3rem 0; border-top: 1px dashed #777; }
.vf-rx-lines td, .vf-rx-vat td, .vf-rx-vat th { padding: 0.15rem 0; text-align: left; font-weight: 400; }
.vf-rx-lines .num, .vf-rx-vat .num { text-align: right; }
.vf-rx-total { display: flex; justify-content: space-between; margin: 0.3rem 0; padding-top: 0.4rem; border-top: 1px dashed #777; font-size: 1.05rem; }
.vf-qr { margin: 0.8rem 0 0.2rem; text-align: center; }
.vf-qr-above, .vf-qr-below { margin: 0.15rem 0; font-weight: 700; }
.vf-qr-img { display: block; width: 35mm; height: 35mm; margin: 0 auto; image-rendering: pixelated; }
@media print {
  body.vf-printing #app > *:not(.vf-receipt-wrap) { display: none !important; }
  body.vf-printing .vf-receipt-wrap { position: static; transform: none; width: 72mm; max-height: none; overflow: visible; box-shadow: none; padding: 0; border-radius: 0; }
  body.vf-printing .scrim { display: none !important; }
}

/* ---------- a1.17 payments: guest split, floor payment block, close/record dialogs, bank settings ---------- */
.guest .pay-now .pay-opts:has(input[name="split"]) { grid-template-columns: 1fr; }
.guest .split-n { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 0.5rem 0; font-size: 1.1rem; }
.guest .split-n .icon-btn { min-width: 48px; min-height: 48px; font-size: 1.4rem; border: 2px solid var(--ink); border-radius: 12px; background: #fff; }
.guest .split-custom { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0 0.2rem; font-size: 1.1rem; }
.guest .split-custom input { width: 8rem; min-height: 48px; padding: 0.3rem 0.6rem; font-size: 1.2rem; border: 2px solid var(--ink); border-radius: 10px; }
.pay-block { margin: 0.8rem 0; padding: 0.7rem 0.8rem; border: 1px solid var(--s-border, #d9d1c5); border-radius: 12px; width: 100%; box-sizing: border-box; grid-column: 1 / -1; background: var(--s-surface-2, #faf7f2); }
.pay-block h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.pay-block .is-due strong { color: var(--s-warn, #8a5300); }
.pay-block .is-paid strong { color: var(--s-ok, #1e6b3a); }
.pay-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.25rem; font-size: 0.95rem; }
.pay-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem; align-items: center; }
.pay-block .btn-row .btn { flex: 1 1 10rem; min-height: 48px; }
.dlg-form { width: min(480px, calc(100vw - 1.5rem)); }
.dlg-form .field { margin-top: 0.8rem; }
.dlg-form .pay-opts { border: 0; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.4rem; }
.dlg-form .callout { margin-top: 0.8rem; }
.dlg-form .opt { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.pay-settings .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); align-items: start; gap: 0.4rem 1rem; margin-top: 0.8rem; }
.pay-settings fieldset.field { border: 0; padding: 0; margin: 0; }
.pay-settings .opt { display: flex; align-items: center; justify-content: flex-start; gap: 0.6rem; min-height: 44px; font-weight: 400; }
.pay-settings .field .opt input { width: 1.25rem; height: 1.25rem; min-height: 0; flex: 0 0 auto; padding: 0; margin: 0; }
.pay-settings .kv dd { white-space: normal; text-align: left; }
code.wrap { word-break: break-all; white-space: normal; }
.vf-rx-pay { display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 0.75rem; margin: 0.3rem 0 0.6rem; font-size: 0.95rem; }
.vf-rx-pay dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---- a1.18 Stock tab (inventory) */
.sk-alert { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 1rem; }
.sk-alert > span { flex: 1 1 16rem; }
.sk-head .sk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem; }
.sk-head .stat.is-warn { border-left-color: #c69214; }
.sk-head .stat .stat-n { font-size: 1.4rem; }
.sk-auto { margin-top: 1rem; display: grid; gap: 0.35rem; }
.sk-auto .note { margin: 0; }
.sk-fails { margin-top: 0.8rem; }
.sk-fails ul { margin: 0.4rem 0 0; padding-left: 1.2rem; font-size: 0.92rem; }
.sk-views { margin: 0 0 1rem; flex-wrap: wrap; }
.sk-low-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.sk-low-list li { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.45rem 0.6rem; border: 1px solid var(--s-border); border-radius: 8px; background: var(--s-surface); }
.sk-low-list li > span:first-child { flex: 1 1 12rem; }
.sk-low h2 .ico { color: #c69214; }
.sk-table .is-out, .sk-low-list .is-out { color: var(--s-danger); font-weight: 700; }
.sk-table .is-low { color: #7a5200; font-weight: 600; }
.sk-table .is-neg { color: var(--s-danger); font-variant-numeric: tabular-nums; }
.sk-table .is-pos { color: var(--s-ok); font-variant-numeric: tabular-nums; }
.sk-table tr.is-archived th, .sk-table tr.is-archived td { opacity: 0.6; }
.sk-table .row-acts { white-space: nowrap; text-align: right; }
.sk-table .row-acts .btn + .btn { margin-left: 0.25rem; }
.sk-table .note { font-weight: 400; font-size: 0.85rem; }
.qty-in { display: inline-flex; align-items: center; gap: 0.35rem; }
.num-in { width: 6.5rem; min-height: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.8rem; }
.sk-rline { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem 44px; gap: 0.4rem; align-items: center; margin: 0 0 0.45rem; }
.sk-rline .select { width: 100%; min-width: 0; }
.sk-rline .icon-btn { width: 44px; height: 44px; }
@media (max-width: 767px) {
  .staff-body .sk-table .row-acts { white-space: normal; justify-content: flex-end; flex-wrap: wrap; gap: 0.3rem; }
  .staff-body .sk-table .row-acts::before { content: none; }
  .sk-table .row-acts .btn + .btn { margin-left: 0; }
  .field-row { grid-template-columns: 1fr; }
}
.staff-body .sk-rline select { min-height: 44px; font: inherit; font-size: 0.95rem; padding: 0.35rem 0.5rem; color: var(--s-text); background: var(--s-surface); border: 1px solid var(--s-border-strong); border-radius: 10px; }

/* ---- a1.19 Cash tab (till), floor "Till" dialog and the printable X / Z report */
.ca { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.ca-help { min-width: 0; }
.ca-help li { overflow-wrap: anywhere; }
.ca .card { margin: 0; }
.ca-h { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin: 0 0 0.6rem; font-size: 1.15rem; }
.ca-h .note { font-weight: 400; font-size: 0.85rem; }
.ca-state { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin: 0 0 0.6rem; }
.ca-state .btn { margin-left: auto; }
.ca-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.6rem; margin: 0.4rem 0; }
.ca-stats .stat .stat-n { font-size: 1.3rem; }
.ca-stats .stat.is-key { border-left-color: var(--s-ok); }
.ca-stats .stat.is-key .stat-n { font-size: 1.5rem; }
.ca-hid { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 1rem; font-weight: 600; color: var(--s-text-2); }
.ca-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.ca-btns .btn { min-height: 44px; }
.ca-till .callout { margin: 0.4rem 0; }
.ca-tbl .note { display: block; font-weight: 400; font-size: 0.82rem; }
.ca-tbl td > span { display: inline-block; }
.ca-tbl tr.is-reversed td { opacity: 0.6; }
.ca-tbl tr.is-reversed td:nth-child(4) { text-decoration: line-through; }
.ca-tbl .row-acts { text-align: right; white-space: nowrap; }
.ca-note { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-set .ca-sw { display: grid; gap: 0.35rem; }
.ca-set .ca-sw .note { margin: 0 0 0.4rem; }
.ca-tol .select { max-width: 9rem; min-height: 44px; }
.ca-tills { border: 1px solid var(--s-border); border-radius: 10px; padding: 0.6rem 0.8rem; margin: 0.8rem 0 0; }
.ca-tills legend { font-weight: 600; padding: 0 0.3rem; }
.ca-trow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin: 0 0 0.5rem; }
.ca-trow .select { flex: 1 1 12rem; min-height: 44px; }
.ca-trow .opt { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; }
.ca-help ul { margin: 0.4rem 0 0; padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.ca-dlg { max-height: calc(100vh - 2rem); overflow: auto; }
.ca-dlg .seg { margin: 0.6rem 0; }
.ca-dlg textarea.select { width: 100%; min-height: 3.2rem; resize: vertical; font: inherit; }
.ca-dlg .field .select { width: 100%; box-sizing: border-box; min-height: 44px; }
.ca-dens { border: 0; padding: 0; margin: 0.6rem 0 0; }
.ca-dens legend { font-weight: 600; margin-bottom: 0.3rem; }
.ca-den-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.8rem, 1fr)); gap: 0.4rem 0.6rem; }
.ca-den { display: grid; grid-template-columns: 3.6rem 3.6rem 1fr; align-items: center; gap: 0.35rem; }
.ca-den label { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.ca-den .select { width: 100%; min-height: 44px; text-align: right; font-variant-numeric: tabular-nums; padding: 0.3rem 0.4rem; box-sizing: border-box; }
.ca-den-t { font-size: 0.82rem; color: var(--s-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-count-sum { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin: 0.8rem 0 0; padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--s-surface-2, #f6f1ea); }
.ca-count-sum > div { display: grid; gap: 0.1rem; }
.ca-count-sum span { font-size: 0.85rem; color: var(--s-text-2); }
.ca-count-sum strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.ca-count-sum .ca-var-ok strong { color: var(--s-ok); }
.ca-count-sum .ca-var-bad strong { color: var(--s-danger); }
.ca-count-sum.is-final strong { font-size: 1.45rem; }
.ca-fl-list { list-style: none; margin: 0.5rem 0; padding: 0; display: grid; gap: 0.6rem; }
.ca-fl-till { padding: 0.6rem 0.8rem; border: 1px solid var(--s-border); border-radius: 10px; }
.ca-fl-till .note { display: block; }
.ca-zdlg { width: min(760px, calc(100vw - 1.5rem)); }
.z-frame { margin-top: 0.6rem; padding: 0.8rem; background: #e9e4dc; border-radius: 10px; overflow: auto; }
/* The report itself: plain black on white, like paper, in every theme. */
.z-report { box-sizing: border-box; margin: 0 auto; padding: 4mm; background: #fff; color: #111; font: 12px/1.35 "Helvetica Neue", Arial, sans-serif; }
.z-report.z-72 { width: 72mm; }
.z-report.z-a4 { width: 100%; max-width: 180mm; padding: 10mm; font-size: 13px; }
.z-report h2 { margin: 0.2rem 0; font-size: 1.15em; }
.z-report h3 { margin: 0 0 0.25rem; font-size: 1em; text-transform: uppercase; letter-spacing: 0.04em; }
.z-head { text-align: center; padding-bottom: 0.4rem; border-bottom: 1px dashed #555; }
.z-brand { margin: 0; font-weight: 700; font-size: 1.15em; }
.z-meta { margin: 0.1rem 0; }
.z-id { font-family: ui-monospace, Menlo, monospace; font-size: 0.85em; }
.z-disclaimer { margin: 0.4rem 0 0; padding: 0.25rem; border: 1.5px solid #111; font-weight: 700; font-size: 0.9em; }
.z-sec { padding: 0.45rem 0; border-bottom: 1px dashed #555; break-inside: avoid; }
.z-tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.z-tbl th, .z-tbl td { padding: 0.08rem 0; text-align: right; font-weight: 400; vertical-align: top; }
.z-tbl th[scope="row"], .z-tbl thead th:first-child { text-align: left; }
.z-tbl thead th { font-size: 0.85em; border-bottom: 1px solid #999; }
.z-tbl tfoot th, .z-tbl tfoot td, .z-tbl .z-strong th, .z-tbl .z-strong td { font-weight: 700; }
.z-tbl tfoot th, .z-tbl tfoot td { border-top: 1px solid #999; }
.z-var-bad td { text-decoration: underline; }
.z-note { margin: 0.3rem 0 0; font-size: 0.92em; }
.z-warn { margin: 0; padding-left: 1.1em; }
.z-sign { padding-top: 0.6rem; }
.z-sign p { margin: 0.7rem 0 0; }
.z-a4 .z-tbl.z-5 th, .z-a4 .z-tbl.z-5 td { padding: 0.15rem 0.3rem; }
.z-72 .z-tbl.z-5 th, .z-72 .z-tbl.z-5 td { font-size: 0.9em; padding-left: 0.15rem; }
@media (max-width: 767px) {
  .ca-state .btn { margin-left: 0; }
  .ca-tbl .row-acts { white-space: normal; }
  .ca-note { max-width: none; white-space: normal; }
}
@media (max-width: 380px) {
  .ca-den-grid { grid-template-columns: 1fr 1fr; }
  .ca-den { grid-template-columns: 3.2rem 1fr; }
  .ca-den-t { display: none; }
}
@page z72 { margin: 2mm; }
@page zA4 { size: A4; margin: 12mm; }
@media print {
  body.ca-printing * { visibility: hidden !important; }
  body.ca-printing .z-report, body.ca-printing .z-report * { visibility: visible !important; }
  body.ca-printing .ca-zdlg { position: static !important; transform: none !important; max-height: none !important; overflow: visible !important; box-shadow: none !important; border: 0 !important; }
  body.ca-printing .z-frame { background: none; padding: 0; overflow: visible; }
  body.ca-printing .z-report { position: absolute; left: 0; top: 0; margin: 0; }
  body.ca-printing.ca-p72 .z-report { page: z72; width: 72mm; padding: 0; }
  body.ca-printing.ca-pa4 .z-report { page: zA4; width: 100%; max-width: none; padding: 0; }
}

/* a1.21: KDS language switcher (compact CA/ES/EN, always visible on tablets) */
.kds-lang { margin-left: auto; }
.lang-compact { gap: 0.2rem; flex-wrap: nowrap; }
.lang-compact button { min-width: var(--tap); padding: 0.35rem 0.5rem; font-weight: 600; letter-spacing: 0.04em; }
.lang-compact abbr { text-decoration: none; }
.kds-tools > * { min-width: 0; }
.kds .seg a, .kds .seg button { white-space: nowrap; }
.tk-name, .tk-mod, .tk-note, .tk-all { overflow-wrap: anywhere; }
.kds .lang-compact button { color: inherit; opacity: 0.75; }
.kds .lang-compact button.is-on { color: inherit; opacity: 1; border-bottom: 2px solid currentColor; }
