/* Dhaka staff app. Look = design/mockups-v2. Phone first; tablet layout from 900px. */

:root {
  --navy: #1C2B41;
  --navy-2: #24364F;
  --navy-3: #2B3F5C;
  --line-dark: #44536B;
  --gold: #DEB77A;
  --paper: #F4F1EA;
  --card: #FFFFFF;
  --line: #DDD5C5;
  --line-2: #CFC5B0;
  --line-soft: #EDE7DB;
  --muted: #5B6577;
  --cream: #D9CDB8;
  --decor: #ECE6D9;
  --gold-wash: #FAF3E6;
  --panel: #FBF9F4;
  --ok: #7BD3A4;
  --danger: #B3402E;
  /* Table phases beyond navy / gold (owner feedback 2026-11-22). The brief's #1F8A5B gives
     white text 4.33:1, so the green is one step darker: 4.98:1. Navy on the orange: 4.99:1. */
  --ph-bill: #1D7F54;
  --ph-next: #E0812B;
  /* From the Login mockup: idle avatar and empty PIN dot. */
  --avatar-idle: #3A4C66;
  --dot-idle: #8794A8;

  --r-12: 12px;
  --r-14: 14px;
  --r-16: 16px;
  --r-18: 18px;
  --tap: 44px;
  --band: repeating-linear-gradient(90deg, var(--gold) 0 12px, var(--navy) 12px 16px);
  --font: 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

/* --- base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--navy); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--navy);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.screen--paper :focus-visible, .dialog :focus-visible { outline-color: var(--navy); }
.screen--paper .appbar :focus-visible { outline-color: var(--gold); }

.icon { flex: none; }

/* --- screens ------------------------------------------------------------- */

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.screen--navy { background: var(--navy); color: #FFFFFF; }
.screen--paper { background: var(--paper); color: var(--navy); }

.topbar { align-self: stretch; display: flex; justify-content: flex-end; }

.band { align-self: stretch; height: 5px; flex: none; background: var(--band); }

.logo { height: auto; }

/* --- language pill ------------------------------------------------------- */

.langs {
  display: flex;
  flex: none;
  background: var(--navy-2);
  border: 1px solid var(--line-dark);
  border-radius: 22px;
  padding: 3px;
}
.langs__btn {
  position: relative;
  min-width: 44px;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 19px;
  background: transparent;
  color: var(--cream);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}
.langs__btn:lang(bn) { min-width: 54px; }
/* Tap target 44px tall: the hit area reaches over the pill's padding. */
.langs__btn::after { content: ''; position: absolute; inset: -3px 0; }
.langs__btn[aria-pressed='true'] { background: var(--gold); color: var(--navy); font-weight: 700; }

/* --- buttons, chips, fields, notices -------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-14);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}
.btn--block { width: 100%; }
.btn--gold { background: var(--gold); color: var(--navy); font-weight: 700; }
.btn--navy, .btn--primary { background: var(--navy); color: #FFFFFF; }
.btn--secondary { background: var(--card); color: var(--navy); border-color: var(--line-2); }
.btn--danger { background: var(--danger); color: #FFFFFF; }
.btn--ghost { min-height: var(--tap); background: transparent; color: var(--gold); border-color: var(--gold); }
.btn:disabled { opacity: 0.6; }

.chip {
  display: inline-block;
  border-radius: 8px;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.chip--gold { background: var(--gold); color: var(--navy); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 600; color: var(--cream); }
.field__input {
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--r-14);
  background: var(--navy-2);
  color: #FFFFFF;
  font-size: 16px;
}
.field__input:focus-visible { outline-offset: 0; border-color: var(--gold); }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-12);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.35;
}
.notice .icon { margin-top: 1px; }
.notice--error { background: var(--danger); color: #FFFFFF; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-18); }

.powered {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border-radius: var(--r-12);
  padding: 4px 12px 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}
.powered img { height: 32px; width: auto; }
/* On paper screens the paper chip needs an edge to read as a chip. */
.screen--paper .powered { background: var(--card); border: 1px solid var(--line); }

/* --- pair ---------------------------------------------------------------- */

.pair {
  align-items: center;
  padding: calc(22px + var(--safe-t)) calc(22px + var(--safe-r)) calc(24px + var(--safe-b)) calc(22px + var(--safe-l));
}
.pair__body {
  width: 100%;
  max-width: 420px;
  margin: auto 0;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.logo--pair { width: 180px; }
.pair__intro { align-self: stretch; display: flex; gap: 14px; align-items: flex-start; }
.pair__icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-2);
  border: 1px solid var(--line-dark);
  color: var(--gold);
}
.pair__title { font-size: 20px; font-weight: 700; line-height: 1.25; }
.pair__text { margin-top: 4px; font-size: 15px; color: var(--cream); line-height: 1.45; }
.pair__body > .pair__title, .pair__body > .pair__text { text-align: center; }
.pair__form { align-self: stretch; display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.pair__form .btn { margin-top: 4px; }

/* --- login (mockup: Login.dc.html) --------------------------------------- */

.login {
  align-items: center;
  gap: 14px;
  padding: calc(22px + var(--safe-t)) calc(22px + var(--safe-r)) calc(20px + var(--safe-b)) calc(22px + var(--safe-l));
}
.login__body, .login__side {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.login__brand { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.logo--login { width: 216px; }
.tagline { font-size: 14.5px; color: var(--cream); text-align: center; line-height: 1.35; }
.login .band { height: 4px; }
.login__who { align-self: stretch; display: flex; flex-direction: column; gap: 8px; }
.login__label { font-size: 15px; font-weight: 600; color: var(--cream); line-height: 1.5; }

.people {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  /* Two rows visible; more people scroll. */
  max-height: 200px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.people__msg {
  grid-column: 1 / -1;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--cream);
  font-size: 14.5px;
  text-align: center;
}
.person {
  height: 96px;
  min-width: 0;
  border-radius: var(--r-16);
  border: 2px solid var(--line-dark);
  background: var(--navy-2);
  color: #FFFFFF;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.person__avatar {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: var(--avatar-idle);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.person__name, .person__role {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}
.person__name { font-size: 14px; font-weight: 600; line-height: 1.15; }
.person__role { font-size: 11.5px; color: var(--cream); line-height: 1.1; }
.person[aria-pressed='true'] { border-color: var(--gold); background: var(--navy-3); }
.person[aria-pressed='true'] .person__avatar { background: var(--gold); color: var(--navy); }

.pin { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pin__prompt {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  color: var(--cream);
  text-align: center;
}
.pin__prompt--error {
  background: var(--danger);
  color: #FFFFFF;
  font-weight: 500;
  border-radius: var(--r-12);
  padding: 1px 10px 1px 8px;
}
.pin__dots { display: flex; gap: 14px; padding: 0 0 6px; }
.pin__dot {
  width: 16px;
  height: 16px;
  border-radius: 8px;
  border: 2px solid var(--dot-idle);
}
.pin__dot.is-on { background: var(--gold); border-color: var(--gold); }
.pin__dots.is-shaking { animation: shake 0.42s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

.keypad {
  align-self: stretch;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.key {
  height: 52px;
  border-radius: var(--r-16);
  border: 1px solid var(--line-dark);
  background: var(--navy-2);
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}
.key--quiet { border-color: var(--navy); background: var(--navy); font-size: 15px; }
.key:not(:disabled):active { background: var(--navy-3); }
.key--quiet:not(:disabled):active { background: var(--navy-2); }
.keypad.is-waiting .key { opacity: 0.45; }

.login__foot { display: flex; justify-content: center; }

/* --- phone shell (mockup: Main.dc.html) ------------------------------------ */

.appbar {
  background: var(--navy);
  color: #FFFFFF;
  padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) 12px calc(16px + var(--safe-l));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.logo--bar { height: 48px; width: auto; }
.appbar__me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.appbar__who { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.appbar__name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appbar .chip { line-height: 1.3; }
.langcycle {
  flex: none;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 22px;
  border: 1px solid var(--line-dark);
  background: var(--navy-2);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

/* "?" — How it works (components/help.js); same round button as the language one. */
.helpbtn {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid var(--line-dark);
  background: var(--navy-2);
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.helpbtn--desk { border-radius: var(--r-12); background: transparent; }
.dialog--help { max-width: 480px; }
.dialog--help .dialog__title { font-size: 22px; }
.dialog--help .dialog__body { max-height: 66vh; max-height: 66dvh; overflow-y: auto; }
.dialog--help .dialog__actions .btn { flex: 1; min-height: 52px; font-size: 17px; }
.help { color: var(--navy); font-size: 17px; line-height: 1.4; }
.help__title { margin: 10px 0 8px; font-size: 15px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.help__key, .help__steps { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.help__key { list-style: none; }
.help__row { display: flex; align-items: flex-start; gap: 12px; }
.help__row .legend__dot { width: 26px; height: 26px; border-radius: 8px; margin-top: 0; }
.help__steps { padding-left: 26px; }
.help__steps li::marker { font-weight: 700; color: var(--navy); }

.strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px calc(16px + var(--safe-r)) 8px calc(16px + var(--safe-l));
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.strip--danger { background: var(--danger); color: #FFFFFF; }
/* Connection lost: one bar above whatever screen is showing (app.js). */
.netbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + var(--safe-t)) calc(16px + var(--safe-r)) 8px calc(16px + var(--safe-l));
  background: var(--danger);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.phone__body { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.bottomnav {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--card);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 6px calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l));
}
.bottomnav__item {
  min-height: 52px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: var(--r-12);
  text-align: center;
}
.bottomnav__item[aria-current='page'] { color: var(--navy); font-weight: 700; }

/* --- shared bits on paper ----------------------------------------------------- */

.empty { padding: 18px 4px; text-align: center; font-size: 15px; color: var(--muted); }
.section-title { font-size: 15px; font-weight: 700; margin: 4px 2px 0; }
.field-error { color: var(--danger); font-size: 14px; font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack--tight { gap: 6px; }
.center { display: flex; justify-content: center; }

.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper__btn {
  width: 44px;
  height: 44px;
  border-radius: var(--r-12);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper__btn--plus { border-color: var(--gold); background: var(--gold); }
.stepper__btn:disabled { opacity: 0.4; }
.stepper__value { min-width: 32px; text-align: center; font-size: 18px; font-weight: 700; }

.lfield { display: flex; flex-direction: column; gap: 6px; }
.lfield__label { font-size: 14px; font-weight: 600; color: var(--navy); }
.input {
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-12);
  background: var(--card);
  color: var(--navy);
  font-size: 16px;
}
.input:focus-visible { outline: 2px solid var(--navy); outline-offset: 0; }

.pill {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--navy);
  font-size: 14.5px;
  font-weight: 500;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.btn--sm { min-height: 44px; padding: 0 14px; font-size: 15px; }

.schip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  padding: 0 8px 0 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  white-space: nowrap;
}
.schip--free { background: var(--card); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.schip--eating { background: var(--navy); color: #FFFFFF; }
.schip--send { background: var(--gold); color: var(--navy); }
.schip--next { background: var(--ph-next); color: var(--navy); }
.schip--bill { background: var(--ph-bill); color: #FFFFFF; }

/* "12 min" with a clock, inline in a sub line. */
.since { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.since svg { flex: none; opacity: 0.8; }

.openbtn {
  flex: none;
  min-height: 48px;
  padding: 0 14px 0 16px;
  border: 0;
  border-radius: var(--r-14);
  background: var(--gold);
  color: var(--navy);
  font-size: 15.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --- room map screen ------------------------------------------------------------ */

.rooms { flex: 1; display: flex; flex-direction: column; }
.rooms__wait { padding: 40px 16px; text-align: center; color: var(--muted); }
.rooms__foot { flex: 1; display: flex; align-items: center; justify-content: center; padding: 14px 16px; }

.tabs { padding: 12px 16px 8px; display: grid; gap: 8px; }
.tab {
  min-width: 0;
  height: 44px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-12);
  background: var(--card);
  color: var(--navy);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab[aria-selected='true'] { border-color: var(--navy); background: var(--navy); color: #FFFFFF; font-weight: 600; }

.roompanel, .takepanel { display: flex; flex-direction: column; }

/* Room map, look "Sala di notte" kept light (owner 2026-11-23: "leave it white themed ... like
   the dots for chairs"). White floor with a faint gold diamond lattice and a gold double
   hairline, hatched Cassa, Ingresso tab; chairs as dots around each table; busy tables filled
   in the phase colours of phase.js with a soft ring and a raised shadow. */
.map {
  --floor-line: rgba(222, 183, 122, 0.55);
  --tile-shadow: 0 5px 12px rgba(28, 43, 65, 0.14), 0 1px 2px rgba(28, 43, 65, 0.1);
  margin: 0 16px;
  background-color: var(--card);
  background-image:
    linear-gradient(45deg, rgba(222, 183, 122, 0.075) 25%, transparent 25%, transparent 75%, rgba(222, 183, 122, 0.075) 75%),
    linear-gradient(45deg, rgba(222, 183, 122, 0.075) 25%, transparent 25%, transparent 75%, rgba(222, 183, 122, 0.075) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
  border: 1px solid var(--floor-line);
  border-radius: var(--r-18);
  box-shadow: inset 0 0 0 5px var(--card), inset 0 0 0 6px rgba(222, 183, 122, 0.3);
  overflow: hidden;
}
.map__room { position: relative; width: 100%; }
.map__decor {
  position: absolute;
  min-height: 26px;
  background: repeating-linear-gradient(135deg, var(--paper) 0 6px, var(--decor) 6px 12px);
  border: 1px solid rgba(222, 183, 122, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.15;
  color: #7A5A23; /* dark gold: 5.1:1 on the hatching */
  text-align: center;
}
.map__decor.is-bottom { top: auto !important; bottom: 0; border-bottom: 0; }
.map__decor.is-top { border-top: 0; }
.map__decor--cassa { flex-direction: column; gap: 4px; border-left: 0; }
.map__decor--entrance { background: var(--paper); letter-spacing: 0.14em; font-size: 11px; }
.map__join { position: absolute; z-index: 0; background: var(--line-2); transition: background-color 0.4s ease; }
.map__join.is-eating { background: var(--navy); }
.map__join.is-send { background: var(--gold); }
.map__join.is-next { background: var(--ph-next); }
.map__join.is-bill { background: var(--ph-bill); }

.map__table {
  /* chair dot colour and the soft ring, per phase */
  --chair: #D6CCB8;
  --ring: rgba(28, 43, 65, 0);
  position: absolute;
  z-index: 1;
  left: var(--cx);
  top: var(--cy);
  width: max(46px, calc(var(--w) - 6px));
  height: max(46px, calc(var(--h) - 6px));
  transform: translate(-50%, -50%);
  /* 4px: the amount never touches the border (fit() in roommap.js measures inside it). */
  padding: 0 4px;
  border-radius: var(--r-12);
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--navy);
  box-shadow: 0 0 0 4px var(--ring), var(--tile-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease, scale 0.12s ease;
}
.map__table:active { scale: 0.94; }
/* Busy tables over free ones: their corner chips are never covered by a neighbour. */
.map__table[data-busy='true'] { z-index: 2; }
.map__num { font-size: 20px; font-weight: 700; line-height: 1.05; }
/* Never squeezed: fit() in roommap.js must see when the lines do not fit. */
.map__num, .map__sub { flex: none; }
.map__sub {
  max-width: 100%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
}
.map__table.is-free .map__sub { color: var(--muted); }
.map__full, .map__short { display: inline-flex; align-items: center; gap: 2px; }

/* Chairs: dots along the long sides, a little out from the tabletop, tinted by the phase. */
.map__chairs { position: absolute; inset: 0; pointer-events: none; }
/* Place and size come from js/chairs.js (inline left / top / width / height). */
.map__chair {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 3px;
  background: var(--chair);
  transition: background-color 0.4s ease;
}
.map__chair:not([data-side]) { visibility: hidden; }

/* Time open: white pill on the top-right corner, border and text in the phase colour. */
.map__meta {
  --chip: var(--navy);
  position: absolute;
  top: -14px; /* sits on the corner, clear of the number on small tiles */
  right: -7px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--chip-line, var(--chip));
  color: var(--chip);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 5px rgba(28, 43, 65, 0.14);
  pointer-events: none;
}
.map__micon { display: inline-flex; flex: none; }
/* Smaller chip forms, chosen by roommap.js so no chair sits under it: no icon, then "12'". */
.map__tshort { display: none; }
.map__table[data-chip='bare'] .map__micon,
.map__table[data-chip='short'] .map__micon,
.map__table[data-chip='short'] .map__time { display: none; }
.map__table[data-chip='short'] .map__tshort { display: inline; }
.map__table[data-chip='short'] .map__meta { padding: 0 5px; }
.map__table[data-mark='icon'] .map__paidtext { display: none; }
.map__table[data-mark='icon'] .map__paid { padding: 0 4px; }
/* Partly paid: small white mark on the bottom-left corner. */
.map__paid {
  position: absolute;
  bottom: -9px;
  left: -6px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px 0 5px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--ph-bill);
  color: var(--ph-bill);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 15px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(28, 43, 65, 0.14);
  pointer-events: none;
}
.map__shine { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }

/* Wide, low tiles: number and amount on one row. */
.map__table[data-fit='wide'], .map__table[data-fit='wideshort'] {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-content: center;
  align-items: baseline;
  column-gap: 6px;
}
.map__table[data-fit='full'] .map__short,
.map__table[data-fit='wide'] .map__short,
.map__table[data-fit='short'] .map__full,
.map__table[data-fit='wideshort'] .map__full,
.map__table[data-fit='none'] .map__sub { display: none; }
.map__table[data-fit='short'] .map__sub { font-size: 11px; }
.map__table[data-fit='wide'] .map__sub, .map__table[data-fit='wideshort'] .map__sub { font-size: 13px; }

.map__table.is-free { --chair: #D6CCB8; }
.map__table.is-member { --chair: #C9BFAA; }
.map__table.is-eating {
  --chair: rgba(28, 43, 65, 0.5); --ring: rgba(28, 43, 65, 0.1);
  background: var(--navy); border-color: var(--navy); color: #FFFFFF;
}
.map__table.is-send {
  --chair: #DEB77A; --ring: rgba(222, 183, 122, 0.28);
  background: var(--gold); border-color: #CFA463; color: var(--navy);
}
.map__table.is-next {
  --chair: rgba(224, 129, 43, 0.7); --ring: rgba(224, 129, 43, 0.2);
  background: var(--ph-next); border-color: var(--ph-next); color: var(--navy);
}
.map__table.is-bill {
  --chair: rgba(29, 127, 84, 0.6); --ring: rgba(29, 127, 84, 0.2);
  background: var(--ph-bill); border-color: var(--ph-bill); color: #FFFFFF;
}
/* Chip text on white: navy / dark orange / green, every one 4.5:1 or more. */
.map__table.is-eating .map__meta { --chip: var(--navy); }
.map__table.is-send .map__meta { --chip: var(--navy); --chip-line: #CFA463; }
.map__table.is-next .map__meta { --chip: #9A4A0E; --chip-line: var(--ph-next); }
.map__table.is-bill .map__meta { --chip: var(--ph-bill); }
.map__table.is-selected { border-color: var(--navy); --ring: rgba(28, 43, 65, 0.28); }
.map__table:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* --- map motion (CSS only; none at all under prefers-reduced-motion) --- */
@keyframes map-pop { from { opacity: 0; scale: 0.8; translate: 0 8px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes map-breathe-bill {
  0%, 100% { box-shadow: 0 0 0 4px rgba(29, 127, 84, 0.22), var(--tile-shadow); }
  50% { box-shadow: 0 0 0 10px rgba(29, 127, 84, 0.07), 0 0 18px 3px rgba(29, 127, 84, 0.38); }
}
@keyframes map-breathe-next {
  0%, 100% { box-shadow: 0 0 0 4px rgba(224, 129, 43, 0.22), var(--tile-shadow); }
  50% { box-shadow: 0 0 0 9px rgba(224, 129, 43, 0.07), 0 0 16px 2px rgba(224, 129, 43, 0.36); }
}
@keyframes map-shine { 0% { background-position: 150% 0; } 60%, 100% { background-position: -60% 0; } }

/* Pop-in: only while the map carries is-entering (a room just opened), 45 ms apart. */
.map.is-entering .map__table { animation: map-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) calc(var(--i, 0) * 45ms) both; }
.map__table.is-bill { animation: map-breathe-bill 1.8s ease-in-out 0.6s infinite; }
.map__table.is-next { animation: map-breathe-next 2.6s ease-in-out 0.6s infinite; }
.map.is-entering .map__table.is-bill {
  animation: map-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) calc(var(--i, 0) * 45ms) both, map-breathe-bill 1.8s ease-in-out 0.6s infinite;
}
.map.is-entering .map__table.is-next {
  animation: map-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) calc(var(--i, 0) * 45ms) both, map-breathe-next 2.6s ease-in-out 0.6s infinite;
}
.map__table.is-send .map__shine::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  background-size: 250% 100%;
  animation: map-shine 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .map__table, .map.is-entering .map__table, .map__table.is-bill, .map__table.is-next,
  .map.is-entering .map__table.is-bill, .map.is-entering .map__table.is-next,
  .map__table.is-send .map__shine::after { animation: none; }
  /* none at all on the map (the global rule above would still run 0.01 ms transitions) */
  .map, .map *, .map *::before, .map *::after { transition: none !important; }
  .map__table:active { scale: none; }
}

/* Summary chips over the map: "5 di 11 occupati", "17 coperti", "1 conto chiesto". */
.roomsum { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.roomsum:empty { display: none; }
.sumchip {
  display: inline-block; /* not flex: the spaces around the bold numbers must stay */
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}
.sumchip b { color: var(--navy); font-weight: 700; }
.sumchip--bill { background: #E8F3ED; border-color: rgba(29, 127, 84, 0.35); color: #176644; }
.sumchip--bill b { color: #176644; }
/* Small phones: the three chips stay on one row (13 px is the floor). */
@media (max-width: 379.98px) {
  .roomsum { gap: 5px; }
  .sumchip { padding: 3px 8px; font-size: 13px; }
}
/* "In sala ora": tablet only (desk layout below). */
.insala { display: none; }
.roomsum--side { padding: 0; }

.selcard {
  margin: 10px 16px 0;
  min-height: 70px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-16);
  padding: 10px 10px 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.selcard__text { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; }
.selcard__title { font-size: 17px; font-weight: 700; line-height: 1.25; }
.selcard__sub { font-size: 16px; color: var(--muted); line-height: 1.3; }
/* Free table card: the guests, then "Open table" across the card when the row is too narrow. */
.selcard .selcard__row { flex-wrap: wrap; }
.openbtn--big { flex: 1 1 150px; min-height: 52px; padding: 0 16px 0 20px; font-size: 17px; justify-content: center; }
.selcard__covers { display: flex; align-items: center; gap: 10px; }
.selcard__row { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Colour key (components/phasekey.js): swatch + icon + short name per phase. */
.pkey {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--navy);
}
.pkey__item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 24px; }
/* Room map: under the map, held in sight above the bottom bar on short phones (with the chosen
   free table's card) so it never sits under the bar edge. */
.roomfoot {
  position: sticky;
  bottom: calc(71px + var(--safe-b)); /* the bottom bar's height */
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px 8px;
  background: var(--paper);
}
.roomfoot .selcard { margin: 0; }
.pkey--map { padding: 2px 4px 0; }
.pkey--list { justify-content: flex-start; padding: 0 2px 2px; }
.legend__dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.legend__dot--free { background: var(--card); border: 2px solid var(--line-2); color: var(--muted); }
.legend__dot--eating { background: var(--navy); color: #FFFFFF; }
.legend__dot--send { background: var(--gold); color: var(--navy); }
.legend__dot--next { background: var(--ph-next); color: var(--navy); }
.legend__dot--bill { background: var(--ph-bill); color: #FFFFFF; }

.eventhost:empty { display: none; }
.eventcard {
  margin: 0 16px;
  padding: 18px 16px 16px;
  border-radius: var(--r-18);
  background: var(--navy);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.eventcard__kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.eventcard__title { font-size: 22px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.eventcard__line { font-size: 15px; color: var(--cream); }
.eventcard__since { margin-left: auto; color: var(--cream); font-weight: 600; letter-spacing: 0; text-transform: none; }
.eventcard .openbtn { align-self: flex-end; margin-top: 10px; }

.takepanel { padding: 0 16px; gap: 10px; }
.takelist { display: flex; flex-direction: column; gap: 8px; }
.orow {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-14);
  background: var(--card);
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.orow__icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.orow__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.orow__title { font-size: 16px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orow__sub { font-size: 13.5px; color: var(--muted); line-height: 1.3; }
.orow__end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 15.5px; }

/* --- my tables -------------------------------------------------------------------- */

.mine { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 0; }
.today {
  background: var(--navy);
  color: #FFFFFF;
  border-radius: var(--r-18);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.today__title { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold); }
.today__grid { display: grid; grid-template-columns: 1.15fr 1.15fr 0.7fr; gap: 10px; }
.today__cell { display: flex; flex-direction: column; min-width: 0; }
.today__cell span { font-size: 13px; color: var(--cream); line-height: 1.3; }
.today__cell b { font-size: 20px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.today .field-error { color: #FFFFFF; }

/* --- order screen (mockup: Order.dc.html) -------------------------------------------- */

.order { padding-bottom: calc(var(--sheet-h, 160px) + 8px); }
body:has(.bottomnav) .toasts { bottom: calc(84px + var(--safe-b)); }
body:has(.order) .toasts { bottom: calc(var(--sheet-h, 160px) + 12px); }
.ohead {
  /* Above the sheet's scrim (z 8): Back and the three dots work with "This order" open. */
  position: relative;
  z-index: 10;
  background: var(--navy);
  color: #FFFFFF;
  padding: calc(14px + var(--safe-t)) calc(10px + var(--safe-r)) 14px calc(16px + var(--safe-l));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ohead__left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ohead__back, .ohead__more {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-12);
  border: 1px solid var(--line-dark);
  background: transparent;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ohead__more { border-color: transparent; }
.ohead__text { display: flex; flex-direction: column; min-width: 0; }
/* From the till: "Torna al conto" in words, gold so it reads as the way back. */
.ohead__back.ohead__back--bill {
  width: auto;
  padding: 0 12px 0 8px;
  gap: 4px;
  border-color: var(--gold);
  color: var(--gold);
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
}
.ohead__title { font-size: 20px; font-weight: 700; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ohead__sub {
  min-height: 24px;
  margin: -2px 0 -4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-size: 13px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-align: left;
  position: relative;
}
/* 44 px tall hit area around the small guests line. */
.ohead__sub::after { content: ''; position: absolute; inset: -10px -6px; }
.ohead__sub:disabled::after, .ohead__sub.is-static .icon { display: none; }
.ohead__sub:disabled { cursor: default; }
.ohead__right { display: flex; align-items: center; gap: 2px; flex: none; }
.ohead__sum { display: flex; flex-direction: column; align-items: flex-end; }
.ohead__tlabel { font-size: 12.5px; color: var(--cream); line-height: 1.2; }
.ohead__total { font-size: 20px; font-weight: 700; line-height: 1.15; white-space: nowrap; }

.order__wait { padding: 30px 16px; text-align: center; color: var(--muted); }

.menu { display: flex; flex-direction: column; }
/* Search on top of the dish list; it scrolls away, the chips and the course switch stay. */
.search {
  flex: none;
  margin: 12px 16px 0;
  height: 52px;
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0 4px 0 14px;
  gap: 8px;
}
.search:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(222, 183, 122, 0.45); }
.search__icon { flex: none; display: inline-flex; color: var(--muted); }
.search__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--navy);
  outline: none;
}
.search__input::placeholder { color: var(--muted); opacity: 1; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 20px;
  background: var(--panel);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menuhead {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--paper);
  padding-bottom: 4px;
}
.coursebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 16px;
  padding: 4px 4px 4px 12px;
  border-radius: var(--r-14);
  background: var(--card);
  border: 1px solid var(--line);
}
.coursebar.is-manual { border-color: var(--gold); background: var(--gold-wash); }
.coursebar__label { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.coursebar.is-manual .coursebar__label { color: var(--navy); }
.seg--course { background: var(--card); }
.seg--course .seg__btn { width: auto; min-width: 48px; padding: 0 12px; font-size: 16px; }
.seg--course .seg__btn:first-child { min-width: 64px; font-size: 15px; }
.cats {
  /* Never squeezed by a short flex parent (counter on a phone): overflow-x makes min-height 0. */
  flex: none;
  background: var(--paper);
  padding: 10px 16px 8px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding: 0 16px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none;
  scroll-snap-align: start;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: var(--navy);
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.cat[aria-selected='true'] { border-color: var(--navy); background: var(--navy); color: #FFFFFF; font-weight: 600; }
.cat--popular { border-color: var(--gold); background: var(--gold-wash); }
.cat--popular[aria-selected='true'] { border-color: var(--navy); }

.items { padding: 6px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-14);
  padding: 8px 8px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.item__text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* The whole row adds one: it is the tap target, so it says so. */
.item { min-height: 64px; scroll-margin: 150px 0 calc(var(--sheet-h, 160px) + 12px); cursor: pointer; user-select: none; -webkit-user-select: none; transition: border-color 0.15s ease; }
.item.is-in { border-color: var(--gold); }
.item.is-hit { animation: item-hit 0.45s ease-out; }
@keyframes item-hit {
  0% { background: #F6E6C8; }
  100% { background: var(--card); }
}
.item__label, .line__label { display: block; min-width: 0; }
.item__name { display: block; font-size: 17px; font-weight: 600; line-height: 1.25; }
.item__bn { display: block; font-size: 14.5px; font-weight: 500; line-height: 1.3; color: var(--navy-3); }
.item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.item__price { font-size: 15px; font-weight: 500; color: var(--muted); line-height: 1.3; font-variant-numeric: tabular-nums; }
.item__cat { font-size: 13px; color: var(--muted); }
.item__to {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px 0 5px;
  border-radius: 7px;
  background: var(--navy);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 20px;
}
.items__none { padding: 18px 4px; color: var(--muted); font-size: 15px; text-align: center; }
.item__act { flex: none; display: flex; align-items: center; gap: 8px; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty__n { width: 28px; text-align: center; font-size: 18px; font-weight: 700; }
.iconbtn {
  width: 44px;
  height: 44px;
  border-radius: var(--r-12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  background: var(--card);
  border: 1px solid var(--line-2);
}
.iconbtn--soft { border-color: var(--line); }
.iconbtn--gold { border-color: var(--gold); background: var(--gold); }

.scrim { position: fixed; inset: 0; z-index: 8; background: rgba(15, 25, 42, 0.32); }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  max-height: 70vh;
  max-height: 70dvh;
  margin: 0 auto;
  max-width: 640px;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 0 calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 -6px 18px rgba(28, 43, 65, 0.06);
}
.sheet.is-open { box-shadow: 0 -10px 30px rgba(15, 25, 42, 0.18); }
.sheet__handle {
  flex: none;
  min-height: 52px;
  padding: 8px 0 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  text-align: left;
}
.sheet__grip { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); }
.sheet__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sheet__title { font-size: 16px; font-weight: 700; display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sheet__count { font-size: 13.5px; font-weight: 400; color: var(--muted); }
.sheet__total { font-size: 16px; font-weight: 700; white-space: nowrap; }
/* What is waiting, in words; the whole summary (two rows) opens the sheet. */
.sheet__row--status { align-items: center; }
.sheet__status { font-size: 14.5px; font-weight: 600; color: var(--navy); line-height: 1.3; }
.sheet__status[data-state='next']::before,
.sheet__status[data-state='send']::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 3px;
  background: var(--gold);
  vertical-align: 1px;
}
.sheet__status[data-state='next']::before { background: var(--ph-next); }
/* Two clean states, no rotation in between: up when closed (it opens upward), down when open. */
.sheet__more { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; color: var(--muted); transform: rotate(-90deg); }
.sheet.is-open .sheet__more { transform: rotate(90deg); }
.sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet__empty { font-size: 15px; color: var(--muted); padding: 6px 0; }
.sheet__actions { flex: none; display: flex; flex-direction: column; gap: 2px; }

.course {
  border: 1px solid var(--line);
  border-radius: var(--r-14);
  padding: 8px 12px 6px;
  display: flex;
  flex-direction: column;
}
.course--ready { border-color: var(--gold); background: var(--gold-wash); }
.course__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0 2px; }
.course__title { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.course__status {
  padding: 0 7px;
  border-radius: 7px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  line-height: 20px;
  white-space: nowrap;
}
.course__status.is-ready { background: var(--gold); box-shadow: none; color: var(--navy); }
.course__status.is-sent { background: transparent; }
.course--muted .course__title, .course:not(.course--ready) .course__title { color: var(--muted); }
.course__side { font-size: 13px; color: var(--muted); text-align: right; }
.line {
  width: 100%;
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-align: left;
  font-size: 15.5px;
  line-height: 1.3;
}
.line + .line { border-top: 1px solid var(--line-soft); }
/* A held line: the dish opens its dialog, the 1 2 3 beside it moves it to another course. */
.line--tap { padding: 0; }
.line__open {
  width: 100%;
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-align: left;
  font: inherit;
}
.line--course { flex-direction: row; align-items: center; gap: 10px; }
.line--course .line__open { flex: 1; min-width: 0; }
.seg--line { flex: none; border-radius: 10px; }
.seg--line .seg__btn { width: 44px; height: 44px; font-size: 15px; }
.course--ready .seg--line { border-color: #E3CFA6; }
.course--ready .line + .line { border-top-color: #F1E4CB; }
.line__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.line__main { display: flex; gap: 5px; min-width: 0; }
.line__qty { flex: none; font-weight: 700; }
.line__name { display: block; }
.line__bn { display: block; font-size: 13.5px; color: var(--navy-3); }
.line__price { flex: none; white-space: nowrap; }
.line__note { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.course--muted .line { color: var(--muted); }
.line.is-void .line__main { text-decoration: line-through; }
.line.is-void .line__price { font-size: 13px; }

.agreed {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: var(--r-14);
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 15px;
}
.agreed b { font-size: 18px; }

.hint { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); line-height: 1.3; }

.sendbtn {
  min-height: 56px;
  border: 0;
  border-radius: var(--r-16);
  background: var(--navy);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 14px;
  line-height: 1.2;
}
.sendbtn--gold { background: var(--gold); color: var(--navy); font-weight: 700; }
.sendbtn--asked { background: var(--card); color: var(--navy); border: 2px solid var(--ph-bill); }
.sendbtn:disabled { opacity: 0.55; }
.linkbtn {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.linkbtn:disabled { opacity: 0.5; }
.sendbtn--asked[aria-disabled='true'] { cursor: default; }
/* After a send: what went out + a big "Back to the room" (order.js). */
.sentnote {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-16);
  background: var(--gold-wash);
  border: 1px solid var(--gold);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sentnote[hidden] { display: none; }
.sentnote__text { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.sentnote__text .icon { flex: none; color: var(--ph-bill); }
.sentnote__actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px; }
.sentnote__actions .btn { min-height: 52px; font-size: 17px; }
.sentnote__stay { min-height: 52px; font-size: 16px; }
.sentnote__back { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--navy); font-weight: 700; }

/* --- order dialogs ----------------------------------------------------------------- */

.dialog .dialog__body { color: var(--navy); }
.dialog--menu .dialog__body, .dialog--picks .dialog__body { max-height: 60vh; overflow-y: auto; }
.actions { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.action {
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-14);
  background: var(--card);
  color: var(--navy);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.action--danger { color: var(--danger); border-color: #E7C8C1; }
.picks__room { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.pick {
  min-height: 60px;
  border: 2px solid var(--line-2);
  border-radius: var(--r-14);
  background: var(--card);
  color: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}
.pick b { font-size: 19px; }
.pick span { font-size: 12px; color: var(--muted); }
.pick--busy { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.pick--busy span { color: var(--cream); }

.lined { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.lined__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lined__label { font-size: 14px; font-weight: 600; }
.lined__weigh { display: flex; align-items: center; gap: 10px; }
.lined__grams { font-size: 18px; font-weight: 700; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-12); overflow: hidden; }
.seg__btn {
  width: 52px;
  height: 44px;
  border: 0;
  background: var(--card);
  color: var(--navy);
  font-size: 17px;
  font-weight: 600;
}
.seg__btn + .seg__btn { border-left: 1px solid var(--line-2); }
.seg__btn[aria-pressed='true'] { background: var(--navy); color: #FFFFFF; }

.weigh { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.weigh__show {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 14px;
  border-radius: var(--r-14);
  background: var(--gold-wash);
  border: 1px solid var(--gold);
}
.weigh__grams { font-size: 28px; font-weight: 700; line-height: 1.1; }
.weigh__price { font-size: 18px; font-weight: 600; }
.weigh__chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.weigh__keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wkey {
  height: 50px;
  border-radius: var(--r-14);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--navy);
  font-size: 22px;
  font-weight: 600;
}
.wkey--quiet { background: var(--card); font-size: 15px; }
.weigh__error { color: var(--danger); font-size: 14px; font-weight: 500; }
.dialog--weigh .dialog__title, .dialog--line .dialog__title { padding-right: 20px; }

/* --- toast + dialog ------------------------------------------------------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-b));
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  border-radius: var(--r-14);
  background: var(--navy);
  color: #FFFFFF;
  border: 1px solid var(--line-dark);
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 6px 20px rgba(15, 25, 42, 0.25);
  animation: toast-in 0.18s ease-out;
}
.toast--error { background: var(--danger); border-color: var(--danger); }
.toast--ok { background: var(--ok); border-color: var(--ok); color: var(--navy); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--r-18);
  background: var(--card);
  color: var(--navy);
}
.dialog::backdrop { background: rgba(15, 25, 42, 0.55); }
.dialog__title { padding: 20px 20px 0; font-size: 19px; font-weight: 700; line-height: 1.3; }
.dialog__body { padding: 8px 20px 0; font-size: 15.5px; color: var(--muted); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 20px; flex-wrap: wrap; }

/* --- tablet --------------------------------------------------------------- */

@media (min-width: 900px) {
  .login { padding-left: calc(40px + var(--safe-l)); padding-right: calc(40px + var(--safe-r)); }
  .login__body {
    flex: 1;
    width: 100%;
    max-width: 1060px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: center;
    gap: 72px;
  }
  .login__side { gap: 18px; align-self: center; }
  .logo--login { width: 250px; }
  .tagline { font-size: 16px; }
  .login__label { font-size: 16px; }
  .people {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
    max-height: 322px; /* three rows */
  }
  .person { height: 104px; }
  .person__avatar { width: 42px; height: 42px; border-radius: 21px; font-size: 15px; }
  .person__name { font-size: 15px; }
  .person__role { font-size: 12.5px; }
  .pin {
    align-self: center;
    gap: 10px;
    padding: 28px 24px 24px;
    background: var(--navy-2);
    border: 1px solid var(--line-dark);
    border-radius: var(--r-18);
  }
  .pin__prompt { font-size: 16px; }
  .pin__dots { padding-bottom: 10px; }
  .keypad { gap: 10px; }
  .key { height: 60px; background: var(--navy-3); }
  .key--quiet { background: var(--navy-2); border-color: var(--navy-2); }
  .key:not(:disabled):active { background: var(--line-dark); }
  .key--quiet:not(:disabled):active { background: var(--navy-3); }
}

/* --- motion --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .pin__dots.is-shaking { animation: none; }
}

/* --- cashier / admin desk (look: design/mockups-v2/Cassa.dc.html) ----------- */

.desk {
  flex: none;
  min-height: 68px;
  padding: var(--safe-t) calc(24px + var(--safe-r)) 0 calc(24px + var(--safe-l));
  background: var(--navy);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.desk__left, .desk__right { display: flex; align-items: center; min-width: 0; }
.desk__left { gap: 22px; }
.desk__right { gap: 18px; }
.logo--desk { height: 50px; width: auto; }
.desk__nav { display: flex; gap: 6px; }
.desk__navbtn {
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-dark);
  border-radius: var(--r-12);
  background: transparent;
  color: #FFFFFF;
  font-size: 15.5px;
  font-weight: 500;
  white-space: nowrap;
}
.desk__navbtn[aria-current='page'] { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 600; }
.printers {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  border-radius: var(--r-12);
  background: transparent;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
}
.printers__one { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.printers__one.is-on .icon { color: var(--ok); }
.printers__one.is-off, .printers__one.is-stuck {
  background: var(--danger);
  color: #FFFFFF;
  border-radius: 10px;
  padding: 3px 9px 3px 7px;
  font-weight: 600;
}
.desk__langcycle { display: none; }
.desk__me { display: flex; align-items: center; gap: 8px; }
.desk__avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
}
.desk__who { display: flex; flex-direction: column; min-width: 0; }
.desk__name { font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.desk__role { font-size: 12.5px; color: var(--cream); line-height: 1.2; white-space: nowrap; }
.desk__out {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-dark);
  border-radius: var(--r-12);
  background: transparent;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deskscreen__body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bottomnav--desk { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.toolbtn {
  flex: none;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-14);
  background: var(--card);
  color: var(--navy);
  font-size: 15.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.toolbtn--icon { width: 48px; padding: 0; justify-content: center; }
.toolbtn:disabled { opacity: 0.55; }

/* open orders */
.cash { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.olist { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.olist__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 2px 4px; }
.olist__title { font-size: 18px; font-weight: 700; }
.olist__count { font-size: 14px; color: var(--muted); white-space: nowrap; }
.olist__items { display: flex; flex-direction: column; gap: 10px; }
.olist__empty { padding: 28px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; text-align: center; }
.olist__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 2px 0; font-size: 13.5px; color: var(--muted); }
.ocard {
  flex: none;
  min-height: 76px;
  border-radius: var(--r-16);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--navy);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.ocard { position: relative; overflow: hidden; padding-left: 20px; }
.ocard.is-selected { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
/* Phase colour as a bar on the left edge (the card itself stays white). */
.ocard__bar { position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--line-2); }
.ocard--eating .ocard__bar { background: var(--navy); }
.ocard--send .ocard__bar { background: var(--gold); }
.ocard--next .ocard__bar { background: var(--ph-next); }
.ocard--bill .ocard__bar { background: var(--ph-bill); }
.ocard.is-selected.ocard--eating .ocard__bar { background: var(--cream); }
.ocard__mark { flex: none; min-width: 52px; font-size: 32px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ocard__mark--letter { font-size: 26px; }
.ocard__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ocard__who { font-size: 15px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard__status { font-size: 13.5px; line-height: 1.25; display: flex; align-items: flex-start; gap: 5px; min-width: 0; }
/* Wraps to a second line rather than cutting what is waiting. */
.ocard__status > span:last-child { min-width: 0; overflow-wrap: anywhere; padding-top: 1px; }
.ocard__picon { flex: none; display: inline-flex; width: 20px; height: 20px; border-radius: 6px; align-items: center; justify-content: center; background: var(--panel); color: var(--navy); box-shadow: inset 0 0 0 1px var(--line-soft); }
.ocard--send .ocard__picon { background: var(--gold); box-shadow: none; }
.ocard--next .ocard__picon { background: var(--ph-next); box-shadow: none; }
.ocard--eating .ocard__picon { background: var(--navy); color: #FFFFFF; box-shadow: none; }
.ocard--bill .ocard__picon { background: var(--ph-bill); color: #FFFFFF; box-shadow: none; }
.ocard.is-selected .ocard__picon { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.ocard__end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ocard__total { flex: none; font-size: 19px; font-weight: 700; white-space: nowrap; }
.ocard__end .since { font-size: 12.5px; color: var(--muted); }
.ocard.is-selected .since { color: var(--cream); }

/* the bill */
.bill { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.bill__main { display: flex; flex-direction: column; gap: 14px; min-height: 0; flex: 1 1 auto; }
.bill__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bill__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bill__title { font-size: 26px; font-weight: 700; line-height: 1.15; }
.bill__sub { font-size: 14.5px; color: var(--muted); }
.bill__tools { display: flex; gap: 8px; }
/* "Ordine · aggiungi piatti": always with its words (the cashier adds dishes from here). */
.toolbtn--order { white-space: nowrap; }
/* Dishes not sent yet: send them from the bill (the order is a link for edits). */
.heldbox__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 0 6px; }
.heldbox__send { flex: 1 1 220px; min-height: 52px; font-size: 16.5px; font-weight: 700; gap: 8px; }
.bill__back {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-12);
  background: var(--card);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bill__gap { flex: 1 1 0; }
.bill__empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--muted); font-size: 15px; padding: 40px 12px; }
.bill__empty .icon { color: var(--line-2); margin-bottom: 6px; }
.bill__emptyTitle { font-size: 19px; font-weight: 700; color: var(--navy); }

.blines {
  flex: 0 1 auto;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-18);
  padding: 6px 20px;
  display: flex;
  flex-direction: column;
}
.blines__scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.bline {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 110px 110px 44px;
  gap: 12px;
  padding: 8px 0;
  min-height: 52px;
  align-items: center;
  font-size: 16.5px;
  border-bottom: 1px solid var(--line-soft);
}
.bline--event, .blines--event .bline--head { grid-template-columns: 56px minmax(0, 1fr) 44px; }
.bline--head {
  min-height: 0;
  padding: 10px 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom-color: var(--line);
}
.bline__qty { font-weight: 700; white-space: nowrap; }
.bline__item { display: flex; flex-direction: column; min-width: 0; }
.bline__label { display: flex; flex-direction: column; }
.bline__name { font-weight: 500; line-height: 1.3; }
.bline__bn { font-size: 13.5px; color: var(--navy-3); }
.bline__by { font-size: 13px; color: var(--muted); line-height: 1.3; }
.bline__unit { text-align: right; color: var(--muted); white-space: nowrap; }
.bline__total { text-align: right; font-weight: 600; white-space: nowrap; }
.bline__act { display: flex; justify-content: flex-end; }
.bline__cancel {
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: var(--r-12);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bline__cancel:hover { border-color: #E7C8C1; color: var(--danger); }
.bline.is-void .bline__qty, .bline.is-void .bline__name, .bline.is-void .bline__unit, .bline.is-void .bline__total { text-decoration: line-through; color: var(--muted); }
.blines__none { padding: 14px 0; font-size: 15px; color: var(--muted); }
.heldbox {
  margin: 10px 0 4px;
  padding: 8px 14px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-14);
  background: var(--panel);
  color: var(--muted);
}
.heldbox__title { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 0 4px; }
.heldbox__row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 4px 0; font-size: 15px; }
.heldbox__total { text-align: right; }
.blines__sum { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 0 12px; }
.blines__sum span { font-size: 18px; font-weight: 700; }
.blines__total { font-size: 34px; font-weight: 700; line-height: 1; white-space: nowrap; }

.evbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--gold);
  border-radius: var(--r-16);
  background: var(--gold-wash);
}
.evbox__text { display: flex; flex-direction: column; min-width: 0; }
.evbox__kicker { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.evbox__label { font-size: 19px; line-height: 1.3; }
.evbox__line { font-size: 14.5px; color: var(--muted); }

/* payment */
.pay { flex: none; display: flex; flex-direction: column; gap: 12px; }
.pay__methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pay__method {
  min-height: 80px;
  border-radius: var(--r-16);
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--navy);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.pay__method[aria-checked='true'] { border: 2px solid var(--navy); padding: 7px 15px; }
.pay__mtext { display: flex; flex-direction: column; min-width: 0; }
.pay__mname { font-size: 18px; font-weight: 700; line-height: 1.2; }
.pay__sub { font-size: 13.5px; color: var(--muted); line-height: 1.2; }
.pay__detail { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 14px; }
/* Cash: the change helper is optional, a button until it is wanted. */
.pay__detail--cash { flex-direction: column; align-items: stretch; gap: 10px; }
.pay__calc { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; }
.pay__calcbox { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px 14px; padding: 12px 14px; border-radius: var(--r-14); background: var(--panel); border: 1px solid var(--line); }
.pay__field { display: flex; flex-direction: column; gap: 4px; }
.pay__euro { position: relative; display: block; }
.pay__euro > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 18px; font-weight: 600; color: var(--muted); }
.input--money { width: 150px; padding-left: 30px; font-size: 19px; font-weight: 700; }
.pay__quick { display: flex; flex-wrap: wrap; gap: 8px; }
.pay__quick .pill { min-height: 48px; font-weight: 600; }
.pay__change { align-self: center; font-size: 15.5px; font-weight: 600; color: var(--muted); }
.pay__change.is-big { font-size: 24px; font-weight: 700; color: var(--navy); }
.pay__change.is-error { color: var(--danger); }
.pay__splitcard { display: flex; align-items: center; height: 48px; font-size: 19px; font-weight: 700; }
.pay__foot { display: flex; align-items: center; gap: 14px; }
.pay__notes { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pay__why { font-size: 14.5px; font-weight: 600; color: var(--danger); }
.pay__remind { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); line-height: 1.3; }
.paybtn {
  flex: none;
  min-height: 64px;
  padding: 0 30px;
  border: 0;
  border-radius: var(--r-18);
  background: var(--gold);
  color: var(--navy);
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
}
.paybtn:disabled { opacity: 0.45; }

/* After a payment: full width, until closed or 6 s. */
.cash__paid:empty, .sale__paid:empty { display: none; }
.cash__paid { padding: 12px 16px 0; }
.paidnote {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 10px 16px;
  border-radius: var(--r-16);
  background: var(--ph-bill);
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  animation: paidnote-in 0.2s ease-out;
}
.paidnote__icon { flex: none; display: inline-flex; width: 36px; height: 36px; border-radius: 18px; background: rgba(255, 255, 255, 0.18); align-items: center; justify-content: center; }
.paidnote__text { flex: 1; min-width: 0; }
.paidnote__close { flex: none; width: 44px; height: 44px; border: 0; border-radius: var(--r-12); background: transparent; color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; }
@keyframes paidnote-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* counter sale */
.counter { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sale__menu { display: flex; flex-direction: column; min-height: 0; }
.sale { padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.sale .lfield .input { width: 100%; }
.sline {
  width: 100%;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 100px;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--navy);
  font-size: 16.5px;
  text-align: left;
}
.sline__name { display: flex; flex-direction: column; min-width: 0; }

/* day report */
.reportscreen { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.reportscreen__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.reportscreen__title { font-size: 26px; font-weight: 700; line-height: 1.15; }
.reportscreen__date { display: flex; flex-direction: column; gap: 4px; }
.input--date { width: 200px; }
.report { display: flex; flex-direction: column; gap: 16px; }
.rnote { padding: 10px 14px; border: 1px solid var(--gold); border-radius: var(--r-14); background: var(--gold-wash); font-size: 14.5px; font-weight: 600; }
.rcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-16); padding: 12px 16px; display: flex; flex-direction: column; }
.rcard__label { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.rcard__value { font-size: 24px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.rcard--strong { background: var(--navy); border-color: var(--navy); color: #FFFFFF; grid-column: 1 / -1; }
.rcard--strong .rcard__label { color: var(--cream); }
.report__cols { display: grid; gap: 16px; }
.report__col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rpanel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-18); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.rpanel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rpanel__title { font-size: 16px; font-weight: 700; }
.rpanel__side { font-size: 14px; color: var(--muted); }
.rpanel .empty { padding: 8px 0; text-align: left; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bars__row { display: grid; grid-template-columns: 80px minmax(0, 1fr) 92px; gap: 10px; align-items: center; font-size: 14.5px; }
.bars__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars__track { height: 14px; background: var(--line-soft); border-radius: 7px; overflow: hidden; display: block; }
.bars__fill { display: block; height: 14px; background: var(--navy); border-radius: 7px; }
.bars__total { text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bars__fill--gold { background: var(--gold); }
.bars__name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; }
.bars__sub { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars--wide .bars__row, .bars--people .bars__row { grid-template-columns: 132px minmax(0, 1fr) 112px; }
/* A person's bar opens to their dishes. */
.bars--people { gap: 6px; }
.pbar { border-radius: var(--r-12); }
.bars__row--btn {
  min-height: 52px;
  padding: 4px 6px 4px 8px;
  margin: 0 -6px 0 -8px;
  width: calc(100% + 14px);
  border: 0;
  border-radius: var(--r-12);
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 14.5px;
  text-align: left;
}
.bars__row--btn:hover, .bars__row--btn[aria-expanded='true'] { background: var(--panel); }
.bars__row--btn .bars__total { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.bars__chev { display: inline-flex; color: var(--muted); transform: rotate(90deg); }
.bars__row--btn[aria-expanded='true'] .bars__chev { transform: rotate(-90deg); }
.pdishes { margin: 2px 0 6px; padding: 4px 12px; border-left: 3px solid var(--gold); background: var(--panel); border-radius: 0 var(--r-12) var(--r-12) 0; }
.pdishes__row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 88px; gap: 8px; padding: 6px 0; font-size: 14px; }
.pdishes__row + .pdishes__row { border-top: 1px solid var(--line-soft); }
.pdishes__qty, .pdishes__total { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pdishes__total { font-weight: 600; }
.rlist { display: flex; flex-direction: column; }
.rlist__row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 0; font-size: 15px; }
.rlist__row + .rlist__row { border-top: 1px solid var(--line-soft); }
.rlist__time { color: var(--muted); font-size: 14px; }
.rlist__main { display: flex; flex-direction: column; min-width: 0; }
.rlist__main span { font-size: 13.5px; color: var(--muted); }
.rlist__amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rlist__row--act { grid-template-columns: 48px minmax(0, 1fr) auto auto; align-items: center; }
.rlist__btn { display: inline-flex; align-items: center; gap: 6px; }

/* statistics */
.srange { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.seg--presets { flex-wrap: wrap; background: var(--card); }
.seg--presets .seg__btn { width: auto; padding: 0 14px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.srange__custom { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: flex; flex-direction: column; gap: 16px; }
.stats[aria-busy='true'] { opacity: 0.6; transition: opacity 0.2s ease 0.15s; }
.stats__empty { padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-18); }
.stats__empty .icon { color: var(--line-2); margin-bottom: 6px; }
.stats__emptyTitle { font-size: 19px; font-weight: 700; color: var(--navy); }
.stools { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
.seg--sort .seg__btn { width: auto; padding: 0 14px; font-size: 15px; }
.stools .lfield { min-width: 180px; }
.stable { display: flex; flex-direction: column; }
.stable__head, .stable__row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.4fr) 76px minmax(90px, 1fr) 92px;
  gap: 10px;
  align-items: center;
}
.stable__head { font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
.stable__row { padding: 9px 0; font-size: 15px; }
.stable__row + .stable__row { border-top: 1px solid var(--line-soft); }
.stable .is-end { text-align: right; justify-self: end; }
.stable__rank { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.stable__row:nth-child(-n+4) .stable__rank { color: var(--navy); }
.stable__name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.stable__name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.stable__name small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stable__qty, .stable__total { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stable__total { font-weight: 700; }
.stable__barcol { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stable__barcol .bars__track { flex: 1; min-width: 30px; }
.stable__share { flex: none; width: 52px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.never { display: flex; flex-wrap: wrap; gap: 6px; }
.never__item { padding: 4px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-soft); font-size: 13.5px; }
@media (max-width: 599.98px) {
  /* Presets as separate pills: a segmented box that wraps breaks its own borders. */
  .seg--presets { border: 0; border-radius: 0; background: none; gap: 8px; overflow: visible; }
  .seg--presets .seg__btn, .seg--presets .seg__btn + .seg__btn { border: 1px solid var(--line-2); border-radius: 22px; background: var(--card); }
  .seg--presets .seg__btn[aria-pressed='true'] { border-color: var(--navy); background: var(--navy); }
  .stable__head, .stable__row { grid-template-columns: 22px minmax(0, 1fr) 60px 84px; gap: 8px; }
  .stable__name b, .stable__name small { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .stable__barcol { display: none; }
  .bars--wide .bars__row, .bars--people .bars__row { grid-template-columns: 104px minmax(0, 1fr) 96px; }
  .rlist__row--act { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .rlist__row--act .rlist__btn { grid-column: 2 / -1; justify-self: start; }
}
.dtable { display: flex; flex-direction: column; }
.dtable__head, .dtable__row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 100px; gap: 10px; align-items: center; }
.dtable__head { font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.dtable__row { padding: 9px 0; font-size: 15px; }
.dtable__row + .dtable__row { border-top: 1px solid var(--line-soft); }
.dtable .is-end { text-align: right; justify-self: end; }
.dtable__sort {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.dtable__sort[aria-pressed='true'] { color: var(--navy); text-decoration: underline; text-underline-offset: 4px; }
.dtable__sort.is-end { text-align: right; }
/* Narrow screens: give the dish name the room (rows are separate grids, so widths stay fixed). */
@media (max-width: 599.98px) {
  .dtable__head, .dtable__row { grid-template-columns: minmax(0, 1fr) 72px 88px; gap: 8px; }
}

/* events in the room screen */
.evstart {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 14px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-14);
  background: var(--panel);
  font-size: 14.5px;
}
.evstart__text { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.evgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.evgrid .input { width: 100%; }

/* print jobs dialog */
.dialog--jobs { width: min(760px, calc(100vw - 32px)); }
.dialog--jobs .dialog__body { max-height: 64vh; overflow-y: auto; }
.jobs__head, .jobs__row { display: grid; grid-template-columns: 52px 128px minmax(0, 1fr) 112px 104px; gap: 10px; align-items: center; }
.jobs__head { font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.jobs__row { padding: 6px 0; color: var(--navy); font-size: 14.5px; }
.jobs__row + .jobs__row { border-top: 1px solid var(--line-soft); }
.jobs__time { color: var(--muted); }
.jobs__what { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.jobs__what span { color: var(--muted); font-size: 13.5px; }
.jchip { display: inline-block; border-radius: 8px; padding: 0 8px; font-size: 12px; font-weight: 700; line-height: 22px; white-space: nowrap; }
.jchip--queued { background: var(--gold-wash); border: 1px solid var(--gold); line-height: 20px; }
.jchip--printing { background: var(--gold); }
.jchip--done { background: var(--ok); }
.jchip--failed { background: var(--danger); color: #FFFFFF; }

/* phone: one view at a time, nav at the bottom */
@media (max-width: 899.98px) {
  .desk { min-height: 0; padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l)); gap: 8px; }
  .logo--desk { height: 44px; }
  .desk__nav, .desk__langs, .desk__who, .printers__text { display: none; }
  .desk__right { gap: 8px; }
  .printers { gap: 6px; padding: 0 6px; }
  .printers__one.is-off, .printers__one.is-stuck { padding: 3px 5px; }
  .desk__langcycle { display: block; }
  .desk__avatar { width: 36px; height: 36px; font-size: 13.5px; }
  .cash--bill .olist, .cash--list .bill { display: none; }
  .bill__title { font-size: 22px; }
  .toolbtn span { display: none; }
  .toolbtn { width: 48px; padding: 0; justify-content: center; }
  /* The order button keeps its words: a full row under the title. */
  .bill__head { flex-wrap: wrap; row-gap: 10px; }
  .bill__tools { display: contents; }
  .toolbtn--order { order: 5; flex: 1 1 100%; width: auto; padding: 0 16px; }
  .toolbtn--order span { display: inline; }
  .blines { padding: 4px 12px; }
  .bline { grid-template-columns: 58px minmax(0, 1fr) 76px 44px; gap: 8px; font-size: 15.5px; }
  .bline--event, .blines--event .bline--head { grid-template-columns: 58px minmax(0, 1fr) 44px; }
  .bline .bline__unit { display: none; }
  .blines__total { font-size: 28px; }
  .pay__methods { gap: 8px; }
  .pay__method { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 8px 10px; }
  .pay__method[aria-checked='true'] { padding: 7px 9px; }
  .pay__method .icon { width: 22px; height: 22px; }
  .pay__sub { display: none; }
  .pay__foot { flex-direction: column; align-items: stretch; }
  .paybtn { justify-content: center; padding: 0 16px; }
  .pay__quick { gap: 6px; }
  .pay__quick .pill { padding: 0 10px; }
  .sale__menu { border-bottom: 1px solid var(--line); max-height: 46vh; overflow-y: auto; }
  .jobs__head { display: none; }
  .jobs__row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .jobs__row > :nth-child(2) { display: none; }
  .jobs__row > :nth-child(4) { grid-column: 2; grid-row: 2; }
  .jobs__row > :nth-child(5) { grid-column: 3; grid-row: 1 / span 2; }
}

/* tablet: the mockup's two columns, the page itself does not scroll */
@media (min-width: 900px) {
  .deskscreen { height: 100vh; height: 100dvh; min-height: 0; }
  .bottomnav--desk { display: none; }
  .cash { display: grid; grid-template-columns: 380px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .cash__paid { grid-column: 1 / -1; padding: 14px 20px 0; }
  .cash__paid:empty { display: block; padding: 0; }
  .olist { border-right: 1px solid var(--line); padding: 20px; min-height: 0; }
  .olist__items { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .bill { padding: 20px 24px; }
  .bill__back { display: none; }
  .counter { display: grid; grid-template-columns: minmax(0, 1fr) 460px; }
  .sale__menu { border-right: 1px solid var(--line); overflow-y: auto; }
  .sale { padding: 20px 24px; }
  .counter .pay__methods { gap: 8px; }
  .counter .pay__method { padding: 8px 12px; gap: 8px; }
  .counter .pay__method[aria-checked='true'] { padding: 7px 11px; }
  .counter .pay__sub { display: none; }
  .counter .pay__foot { flex-direction: column; align-items: stretch; }
  .counter .paybtn { justify-content: center; }
  .reportscreen { padding: 20px 24px; }
  .rcards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .rcard--strong { grid-column: auto; }
  .report__cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .rooms--desk .deskscreen__body { overflow-y: auto; }
}

/* desk header: full labels from 1280 px, short ones on smaller tablets and phones */
.desk .is-short { display: none; }
@media (max-width: 1279.98px) {
  .desk .is-full { display: none; }
  .desk .is-short { display: inline; }
  .desk__navbtn { padding: 0 14px; }
  .desk__left { gap: 16px; }
  .desk__right { gap: 14px; }
}

/* room map on the desk tablet: the map as large as the screen height allows (scaled with the
   room's own proportions, --ar from roommap.js), and beside it the "In sala ora" panel (the
   numbers + what needs doing now), the chosen free table and the colour key. */
@media (min-width: 900px) {
  .rooms--desk .rooms { width: 100%; max-width: 1440px; margin: 0 auto; }
  .rooms--desk .roompanel {
    display: grid;
    grid-template-columns: auto minmax(340px, 1fr);
    grid-template-areas: 'event event' 'map insala' 'map card' 'map legend' 'map .';
    grid-template-rows: auto auto auto auto 1fr;
    align-items: start;
    gap: 14px 0;
    padding-bottom: 12px;
  }
  .rooms--desk .eventhost { grid-area: event; margin: 0 16px; }
  .rooms--desk .roomsum:not(.roomsum--side) { display: none; }
  .rooms--desk .map {
    grid-area: map;
    margin: 0 20px 0 16px;
    width: min(calc(100vw - 32px - 20px - 360px), calc((100dvh - 168px) * var(--ar, 0.76)));
  }
  .rooms--desk .map__num { font-size: 23px; }
  .rooms--desk .map__sub { font-size: 13px; }
  .rooms--desk .map__meta { font-size: 12px; line-height: 18px; }
  .rooms--desk .insala {
    grid-area: insala;
    margin: 0 16px 0 0;
    padding: 16px 16px 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-18);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
  }
  .rooms--desk .insala[hidden] { display: none; }
  .insala__title { font-size: 19px; font-weight: 700; line-height: 1.2; }
  .insala__sub { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
  .attn { display: flex; flex-direction: column; gap: 8px; max-height: calc(100dvh - 400px); overflow-y: auto; overscroll-behavior: contain; }
  .attn__row { width: 100%; text-align: left; }
  .attn__empty { font-size: 15px; color: var(--muted); padding: 4px 0 6px; }
  .rooms--desk .roomfoot { display: contents; }
  .rooms--desk .selcard { grid-area: card; margin: 0 16px 0 0; }
  .rooms--desk .pkey--map { grid-area: legend; justify-content: flex-start; padding: 0 16px 0 4px; }
  .rooms--desk .takepanel { max-width: 640px; width: 100%; margin: 0 auto; }
  .counter .cats { position: static; flex-wrap: wrap; overflow: visible; }
  .counter .menuhead { position: static; }
}
.evstart { margin: 0 16px 10px; }
.rooms--desk .evstart { margin: 0; }

/* --- admin (look: design/mockups-v2/Admin.dc.html) -------------------------- */

.bottomnav--five { grid-template-columns: repeat(5, minmax(0, 1fr)); padding-left: calc(6px + var(--safe-l)); padding-right: calc(6px + var(--safe-r)); }
.admin { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.admin__links {
  position: relative;
  display: flex;
  gap: 8px;
  padding: 12px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin__links::-webkit-scrollbar { display: none; }
.admin__link {
  flex: none;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: var(--navy);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.admin__link[aria-current='page'] { border-color: var(--navy); background: var(--navy); color: #FFFFFF; font-weight: 600; }
.admin__export { display: none; }
.admin__powered { order: 3; display: flex; justify-content: center; padding: 4px 16px 18px; }
.admin__main { order: 2; padding: 14px 16px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.admin__col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.ahead { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.ahead__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; }
.ahead__title { font-size: 24px; font-weight: 700; line-height: 1.2; }
.ahead__sub { font-size: 14px; color: var(--muted); line-height: 1.4; }
.ahead__side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.addbtn {
  flex: none;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-14);
  background: var(--gold);
  color: var(--navy);
  font-size: 15.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.astat { display: flex; flex-direction: column; justify-content: center; min-height: 48px; padding: 4px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-14); }
.astat__label { font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.astat__value { font-size: 20px; font-weight: 700; line-height: 1.2; }

.switch {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.switch__track { flex: none; position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--line-2); transition: background 0.15s ease; }
.switch__knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 9px; background: #FFFFFF; transition: transform 0.15s ease; }
.switch[aria-checked='true'] .switch__track { background: var(--navy); }
.switch[aria-checked='true'] .switch__knob { transform: translateX(16px); }
.switch[aria-checked='false'] { color: var(--muted); }
.switch:disabled { opacity: 0.55; }

.admin .seg__btn, .dialog--form .seg__btn { width: auto; min-width: 52px; padding: 0 14px; font-size: 15px; }
.dialog--form { width: min(540px, calc(100vw - 32px)); }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lfield .input { width: 100%; }
.input--select { appearance: none; padding-right: 36px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231C2B41' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.input--pin { letter-spacing: 0.3em; font-size: 20px; }
.dialog--roles .action { justify-content: space-between; }
.action.is-current { border: 2px solid var(--navy); padding: 0 13px; }

/* staff */
.slist { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-18); padding: 4px 16px; display: flex; flex-direction: column; }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) 112px 104px 92px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.srow:last-child { border-bottom: 0; }
.srow__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.srow__avatar { flex: none; width: 40px; height: 40px; border-radius: 20px; background: var(--navy); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.srow.is-off .srow__avatar { background: var(--dot-idle); }
.srow__text { display: flex; flex-direction: column; min-width: 0; }
.srow__name { font-size: 16px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow__today { font-size: 13px; color: var(--muted); line-height: 1.25; }
.srow__role, .srow__pin { height: 44px; border-radius: var(--r-12); border: 1px solid var(--line-2); background: var(--card); color: var(--navy); font-size: 14.5px; padding: 0 6px; }
.srow__role { font-weight: 700; }
.srow__role.is-owner { background: var(--gold); border-color: var(--gold); }
.srow__pin { font-weight: 500; }
.srow__state { display: flex; justify-content: flex-end; }
.perms { display: flex; flex-direction: column; gap: 10px; padding: 18px 0 0; border-top: 1px solid var(--line); }
.perms__title { font-size: 18px; font-weight: 700; }
.perm { display: grid; grid-template-columns: minmax(0, 1fr) 76px 66px 54px; gap: 6px; align-items: center; font-size: 14.5px; min-height: 34px; border-bottom: 1px solid var(--line-soft); }
.perm--head { min-height: 0; padding-bottom: 6px; border-bottom-color: var(--line); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.perm__role { text-align: center; overflow: hidden; text-overflow: ellipsis; }
.perm__text { line-height: 1.25; padding: 4px 0; }
.perm__mark { display: flex; justify-content: center; color: var(--navy); }
.perm__mark.is-no { color: #9AA1AE; }
.perms__gap { flex: 1 1 0; }
.perms__note { font-size: 13px; color: var(--muted); line-height: 1.35; }

/* menu */
.cats--admin { position: static; margin: 0 -16px; padding: 0 16px; background: none; }
.mpanel { display: flex; flex-direction: column; gap: 14px; }
.msettings { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-16); padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.msettings__one { display: flex; align-items: center; gap: 12px; }
.msettings__label { font-size: 14px; font-weight: 600; color: var(--muted); }
.mlist { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-18); padding: 4px 16px 6px; display: flex; flex-direction: column; }
.mlist__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.mlist__title { font-size: 16px; font-weight: 700; }
.mlist__count { font-size: 14px; color: var(--muted); }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 150px auto; gap: 14px; align-items: center; padding: 8px 0; }
.mrow + .mrow { border-top: 1px solid var(--line-soft); }
.mrow__name { display: flex; flex-direction: column; min-width: 0; }
.mrow__dish { font-size: 16px; font-weight: 600; line-height: 1.25; }
.mrow__bn { font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--navy-3); }
.mrow__price { font-size: 15px; font-weight: 600; white-space: nowrap; text-align: right; }
.mrow.is-off .mrow__dish, .mrow.is-off .mrow__bn, .mrow.is-off .mrow__price { color: var(--muted); opacity: 0.7; }
.mrow.is-off .mrow__dish { text-decoration: line-through; text-decoration-thickness: 1px; }

/* tables */
.troom__all { display: flex; flex-direction: column; gap: 16px; }
.troom { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-18); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.troom__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.troom__titles { display: flex; flex-direction: column; }
.troom__title { font-size: 18px; font-weight: 700; line-height: 1.25; }
.troom__count { font-size: 14px; color: var(--muted); }
.troom__body { display: flex; flex-direction: column; gap: 14px; }
.troom__map .map { margin: 0; background: var(--panel); }
.map--static .map__table { cursor: default; }
.tlist { display: flex; flex-direction: column; }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) 76px auto auto; gap: 12px; align-items: center; padding: 4px 0; }
.trow + .trow { border-top: 1px solid var(--line-soft); }
.trow__name { font-size: 16px; }
.trow__seats { font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.trow.is-off .trow__name, .trow.is-off .trow__seats { color: var(--muted); opacity: 0.7; }

/* printers */
.pcards { display: grid; gap: 14px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-18); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.pcard.is-off { border-color: #E7C8C1; }
.pcard__top { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.pcard__icon { flex: none; width: 44px; height: 44px; border-radius: var(--r-12); background: var(--paper); display: flex; align-items: center; justify-content: center; }
.pcard__name { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; }
.pchip { flex: none; border-radius: 8px; padding: 0 10px; font-size: 12.5px; font-weight: 700; line-height: 26px; }
.pchip--on { background: var(--ok); color: var(--navy); }
.pchip--off { background: var(--danger); color: #FFFFFF; }
.pcard__line { font-size: 14.5px; color: var(--muted); }
.pcard__line.is-bad { color: var(--danger); font-weight: 600; }
.pcard__key { align-self: flex-start; margin-top: 8px; }
.keybox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.keybox__key { flex: 1 1 220px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-12); background: var(--paper); color: var(--navy); font: 600 17px/1.4 ui-monospace, Menlo, Consolas, monospace; word-break: break-all; user-select: all; }

/* bill layout */
.bill2 { display: grid; gap: 16px; align-items: start; }
.bform { display: flex; flex-direction: column; gap: 14px; }
.bform__actions { display: flex; justify-content: flex-end; }
.bpreview { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.bpreview__title { font-size: 16px; font-weight: 700; }
.paper {
  align-self: center;
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  padding: 20px 14px 24px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-bottom: 2px dashed var(--line-2);
  border-radius: 4px 4px 0 0;
  color: #1A1A1A;
  font: 400 12.5px/1.55 ui-monospace, Menlo, Consolas, 'Courier New', monospace;
}
.paper__row { white-space: pre; min-height: 1.55em; }
.paper__row.is-big { font-size: 25px; line-height: 1.3; font-weight: 700; }
.paper__row.is-bold { font-weight: 700; }
.paper__row.is-fixed { background: var(--gold-wash); }
.paper__gap { padding: 12px 0; text-align: center; font-family: var(--font); font-size: 13px; font-style: italic; color: var(--muted); }
.bpreview__legend { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.bpreview__swatch { flex: none; width: 14px; height: 14px; border-radius: 3px; background: var(--gold-wash); border: 1px solid var(--gold); }

/* export */
.xdates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.xdates__note { flex: 1 1 220px; padding-bottom: 12px; }
.xcards { display: grid; gap: 14px; }
.xcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-18); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.xcard__title { font-size: 17px; font-weight: 700; }
.xcard__sub { flex: 1; font-size: 14px; color: var(--muted); line-height: 1.4; }
.xcard__file { font: 12.5px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--muted); }
.xcard .btn { margin-top: 8px; min-height: 48px; }

@media (max-width: 899.98px) {
  .admin__side { display: contents; }
  .srow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; row-gap: 8px; }
  .srow__who { grid-column: 1 / -1; }
  .mrow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .mrow__price { grid-column: 2; grid-row: 1; align-self: start; padding-top: 2px; }
  .mrow .switch { grid-column: 1; grid-row: 2; justify-self: start; }
  .mrow__edit { grid-column: 2; grid-row: 2; justify-self: end; }
  .trow { grid-template-columns: minmax(0, 1fr) auto auto; }
  .trow__seats { grid-column: 1; grid-row: 2; }
  .trow .switch { grid-column: 2; grid-row: 1 / span 2; }
  .trow > .btn { grid-column: 3; grid-row: 1 / span 2; }
  .formgrid { grid-template-columns: minmax(0, 1fr); }
  .paper { font-size: 10px; }
  .paper__row.is-big { font-size: 20px; }
}

@media (min-width: 900px) {
  .admin { display: grid; grid-template-columns: 216px minmax(0, 1fr); }
  .admin__side { border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
  .admin__links { flex-direction: column; gap: 6px; padding: 0; overflow: visible; flex: 1 1 auto; }
  .admin__link { height: 48px; border: 0; border-radius: var(--r-12); background: transparent; font-size: 15.5px; padding: 0 14px; justify-content: flex-start; text-align: left; white-space: normal; line-height: 1.2; }
  .admin__link[aria-current='page'] { background: var(--navy); }
  .admin__link--export { display: none; }
  .admin__export {
    display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; flex: none;
    border: 1px solid var(--line-2); border-radius: var(--r-12); background: var(--card); color: var(--navy);
    font-size: 15px; font-weight: 600; text-align: left; line-height: 1.15;
  }
  .admin__export[aria-current='page'] { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
  .admin__powered { padding: 8px 0 0; }
  .admin__main { padding: 20px 22px; overflow-y: auto; overscroll-behavior: contain; }
  .admin__main--staff { display: grid; grid-template-columns: minmax(0, 1fr) 400px; padding: 0; gap: 0; overflow: hidden; }
  .admin__main--staff .admin__col { padding: 20px 22px; overflow-y: auto; }
  .admin__main--staff .perms { border-top: 0; border-left: 1px solid var(--line); padding: 20px 18px; background: var(--panel); overflow-y: auto; }
  .troom__body { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
  .cats--admin { margin: 0; padding: 0; flex-wrap: wrap; overflow: visible; }
  .pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bill2 { grid-template-columns: minmax(0, 1fr) auto; }
  .xcards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* One-line names cut with an ellipsis: room above and below the line for tall glyphs (Bengali
   vowel signs, descenders such as "J") so overflow: hidden does not shave them, row height unchanged. */
.person__name, .appbar__name, .orow__title, .ohead__title, .ocard__who, .bars__name, .srow__name, .perm__role {
  padding-block: 0.14em;
  margin-block: -0.14em;
}

/* Phone desk header: icons only for the printers, tight gaps (the 1280 px rules above would
   otherwise bring the short labels and the wide gaps back). */
@media (max-width: 899.98px) {
  .desk .printers__text { display: none; }
  .desk .desk__left { gap: 8px; }
  .desk .desk__right { gap: 8px; }
}

/* Bengali: no tracking on the small-caps style headings (letter-spacing pulls Bengali
   clusters apart and made "পরিমাণ" run into the next column). */
html:lang(bn) body *:not(.input--pin) { letter-spacing: 0; }

/* Tablet counter: the ticket keeps room for at least two lines and the total; when the pay
   panel needs more height than the screen has, the right column scrolls (it was squeezing the
   lines to half a row). */
@media (min-width: 900px) {
  .counter .sale { gap: 10px; padding: 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
  .counter .sale .blines { flex: 1 0 auto; min-height: 150px; }
}

/* Phone screens opened on a tablet (a waiter on the shared tablet): the content keeps a phone
   column in the middle and the room map fits the screen height instead of running off it. */
@media (min-width: 700px) {
  .phone .phone__body { width: 100%; max-width: 760px; margin-inline: auto; }
  .phone .rooms .map { width: min(100% - 32px, (100dvh - 320px) * var(--ar, 0.76)); margin-inline: auto; }
}

/* Phones (owner feedback round 2): the lines staff read to know what to do next are 16 px at
   least. Same weights and colours; only the size moves. (Map tiles keep their fitted sizes.) */
@media (max-width: 899.98px) {
  .sheet__status, .sheet__count, .sheet__empty, .item__price, .item__bn,
  .ocard__who, .ocard__status, .orow__sub, .pay__remind, .hint, .tab, .olist__count { font-size: 16px; }
}

/* ---------------------------------------------------------------------------
   Discount and split bill at the till (2026-11-23)
   --------------------------------------------------------------------------- */
.bsum { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 10px 0 12px; }
.bsum .blines__sum { padding: 4px 0 0; }
.bsum__rows { display: flex; flex-direction: column; border-bottom: 1px solid var(--line-soft); padding-bottom: 6px; }
.bsum__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; font-size: 16px; color: var(--muted); }
.bsum__row > span:last-child { font-weight: 600; white-space: nowrap; color: var(--navy); }
.bsum__row--disc { color: var(--navy); }
.bsum__disc { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.bsum__x {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-12);
  background: var(--card);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bsum__label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.bsum__btn { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.blines__sum .bsum__btn span { font-size: 15px; font-weight: 600; }
/* Splitting: the dishes are in the panel (each pays their own), the bill shows only its sums. */
.bill--split .blines__scroll, .bill--split .bline--head { display: none; }
.bill__paid { font-size: 15px; font-weight: 700; color: var(--ph-bill); }
.bill__parts { flex: none; display: flex; flex-direction: column; gap: 8px; }

.ocard.is-partly .ocard__total { color: var(--ph-bill); }
.ocard.is-partly.is-selected .ocard__total { color: var(--ok); }
.map__table[data-partly='true'] .map__full .icon { opacity: 0.9; }

.pay__methods--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pay__why.is-info { color: var(--navy); }

/* the split panel */
.split { display: flex; flex-direction: column; gap: 10px; }
.split__modes { align-self: flex-start; background: var(--card); }
.split__mode { width: auto; padding: 0 16px; font-size: 16px; }
.split__label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.split__paid { display: flex; flex-direction: column; gap: 8px; }
.split__people { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.split__people .split__label { flex-basis: 100%; }
.split__quick { display: flex; flex-wrap: wrap; gap: 8px; }
.split__count { min-width: 48px; font-size: 17px; font-weight: 700; }
.split__count[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.split__count:disabled { opacity: 0.4; }
.split__hint { font-size: 15px; font-weight: 600; color: var(--navy); }
.split__tools { display: flex; flex-wrap: wrap; gap: 8px; }

.part {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-14);
  background: var(--card);
}
.part__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.part__who { font-size: 17px; }
.part__amount { font-size: 24px; white-space: nowrap; }
.part__share { font-size: 13.5px; color: var(--muted); margin-top: -6px; }
.part__remind { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); line-height: 1.3; }
.part__pay { display: flex; flex-wrap: wrap; gap: 8px; }
.part__btn { flex: 1 1 120px; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; }
.part__calcbtn { display: inline-flex; align-items: center; gap: 6px; }
.part--paid { flex-direction: row; align-items: center; gap: 12px; background: var(--panel); }
.part__check { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ph-bill); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.part__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.part--paid .part__who { color: var(--ph-bill); }
.part__sub { font-size: 14px; color: var(--muted); }
.part__dishes { font-size: 14px; color: var(--navy); overflow-wrap: anywhere; }
.part__acts { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.part__acts .btn { display: inline-flex; align-items: center; gap: 6px; }
.part--own { border-color: var(--gold); background: var(--gold-wash); }

/* each pays their own: the bill's dishes with a counter */
.olines { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-14); background: var(--card); padding: 2px 12px; }
.oline { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; min-height: 56px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); font-size: 16px; }
.oline:last-child { border-bottom: 0; }
.oline__qty { font-weight: 700; white-space: nowrap; }
.oline__name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.oline__some { font-size: 13px; color: var(--ph-bill); }
.oline__price { font-weight: 600; white-space: nowrap; text-align: right; min-width: 64px; }
.oline__ctl { display: flex; justify-content: flex-end; }
.oline__paid { font-size: 14px; font-weight: 600; color: var(--ph-bill); padding: 0 6px; }
.oline.is-paid .oline__qty, .oline.is-paid .oline__name { color: var(--muted); text-decoration: line-through; }
.oline.is-chosen { background: var(--gold-wash); }
.oline__toggle {
  width: 48px;
  height: 48px;
  border-radius: var(--r-12);
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.oline__toggle[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }

/* the discount dialog */
.disc { display: flex; flex-direction: column; gap: 12px; min-width: min(420px, 80vw); }
.disc__tabs { align-self: flex-start; }
.disc__tab { width: auto; min-width: 64px; padding: 0 14px; }
.disc__quick { display: flex; flex-wrap: wrap; gap: 8px; }
.disc__chip { min-width: 64px; font-size: 16px; font-weight: 700; }
.disc__chip[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: #FFFFFF; }
.input--disc { width: 180px; }
.pay__euro--pct { display: inline-block; align-self: flex-start; }
.pay__euro--pct > span { left: auto; right: 14px; }
.pay__euro--pct .input--disc { padding-left: 12px; padding-right: 34px; }
.disc__live { font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.35; }
.disc__problem { font-size: 14.5px; font-weight: 600; color: var(--danger); }

@media (max-width: 599.98px) {
  .pay__methods--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oline { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .oline__price { grid-column: 2; grid-row: 2; text-align: left; min-width: 0; }
  .oline__ctl { grid-column: 3; grid-row: 1 / span 2; }
  .part--paid { flex-wrap: wrap; }
  .part__acts { flex-basis: 100%; justify-content: flex-start; }
}
@media (min-width: 900px) {
  /* With the split panel open the bill column scrolls as one, the dishes keep a fixed height. */
  .bill--split { overflow-y: auto; overscroll-behavior: contain; }
  .bill--split .bill__main { flex: none; }
  .bill--split .blines__scroll { max-height: 34vh; }
  .rcards { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 899.98px) {
  /* A control brought into view (keyboard focus, a scroll to it) stops above the sticky bottom nav. */
  html { scroll-padding-bottom: calc(84px + var(--safe-b)); }
}

/* Admin · Devices: name and the on/off switch only. */
.srow--device { grid-template-columns: minmax(0, 1fr) auto; }
.srow--device .srow__avatar { background: var(--navy); }
.srow__warn { font-size: 13px; line-height: 1.25; color: var(--danger, #B3261E); font-weight: 600; }

/* A warning under a field that still lets you save (e.g. a note the ticket cannot print). */
.field-warn { display: flex; align-items: flex-start; gap: 6px; margin: -4px 0 0; color: var(--danger); font-size: 14px; font-weight: 500; line-height: 1.35; }
.field-warn svg { flex: none; margin-top: 2px; }
