/* Serve Mais. Values come from the Penpot file "Serve Mais - Design v2", page "1 · Fundamentos" (docs/plano-novo-layout.md).
   Order: tokens → base → components → screens. Colors only through the tokens below, so the dark theme covers everything. */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  /* Brand: the same for every establishment (plano-novo-layout 4.5) */
  --brand: #c2410c;
  --on-brand: #fff;
  --brand-text: #c2410c;
  --brand-soft: #fbe9e1;

  /* Neutrals */
  --bg: #f5f5f4;
  --surface: #fff;
  --fill: #f5f5f4; /* stepper, timer, segmented control */
  --line: #e7e5e4;
  --line-strong: #d6d3d1; /* free table, switch off */
  --text: #1c1917;
  --text-2: #44403c;
  --muted: #6b6560;
  --faint: #a8a29e;
  --ink: #1c1917; /* the dashboard's main button */
  --on-ink: #fff;
  --green-on-ink: #86efac; /* a change up or down on an --ink card (Resumo) */
  --red-on-ink: #fca5a5;
  --link: #1d4ed8;
  --overlay: rgb(28 25 23 / 0.4);

  /* States: always with an icon or text too, never color alone. Amber = someone has to go to the table. */
  --amber: #f59e0b;
  --on-amber: #1c1917;
  --amber-text: #b45309;
  --amber-soft: #fef3c7;
  --amber-line: rgb(245 158 11 / 0.5);
  --blue: #2563eb;
  --blue-text: #1d4ed8;
  --blue-soft: #dbeafe;
  --blue-line: #93c5fd;
  --green: #16a34a;
  --green-text: #15803d;
  --green-soft: #dcfce7;
  --green-line: #bbf7d0;
  --purple: #7c3aed;
  --on-purple: #fff;
  --purple-text: #6d28d9;
  --purple-soft: #ede9fe;
  --purple-line: #4c1d95;
  --red: #dc2626;
  --red-text: #b91c1c;
  --red-soft: #fee2e2;
  --red-line: #fecaca;
  --slate: #475569;
  --slate-text: #475569;
  --slate-soft: #e2e8f0;
  --on-state: #fff; /* text on a solid state color, and the switch's knob; the same in the dark theme */

  /* Spacing */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 48px;

  /* Type: the system font loads at once (RQ-01). Inputs never below 16px, or the iPhone zooms in. */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-xs: 0.75rem; /* 12: tab labels */
  --t-help: 0.8125rem; /* 13: help text, badges */
  --t-sm: 0.875rem; /* 14: descriptions */
  --t-button: 0.9375rem; /* 15: buttons */
  --t-md: 1rem; /* 16: body and fields */
  --t-h3: 1.125rem; /* 18: card titles */
  --t-lg: 1.25rem; /* 20 */
  --t-xl: 1.5rem; /* 24 */
  --t-title: 1.625rem; /* 26: screen titles */
  --t-2xl: 2rem; /* 32: totals, table numbers */

  /* Shape */
  --r-sm: 8px;
  --r-md: 10px; /* buttons, fields */
  --r-lg: 12px; /* cards */
  --r-xl: 16px; /* sections */
  --r-sheet: 20px;
  --r-full: 999px;
  --shadow: 0 2px 8px rgb(0 0 0 / 0.08);
  --shadow-up: 0 -2px 12px rgb(0 0 0 / 0.1);
  --shadow-pop: 0 8px 24px rgb(0 0 0 / 0.14);

  --tap: 44px; /* smallest touch target */

  /* The main action: dark in the dashboard, brand on the customer's page */
  --accent: var(--ink);
  --on-accent: var(--on-ink);
}

/* No dark board in Penpot (plano-novo-layout 3.1): inverted neutrals, states keep their hue on dark fills. Paper stays light. */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --brand-text: #fb923c;
    --brand-soft: rgb(194 65 12 / 0.25);
    --bg: #0c0a09;
    --surface: #1c1917;
    --fill: #292524;
    --line: #33302d;
    --line-strong: #44403c;
    --text: #f5f5f4;
    --text-2: #d6d3d1;
    --muted: #a8a29e;
    --faint: #78716c;
    --ink: #f5f5f4;
    --on-ink: #1c1917;
    --green-on-ink: #15803d;
    --red-on-ink: #b91c1c;
    --link: #93c5fd;
    --overlay: rgb(0 0 0 / 0.6);
    --amber-text: #fbbf24;
    --amber-soft: rgb(245 158 11 / 0.16);
    --amber-line: rgb(245 158 11 / 0.45);
    --blue: #3b82f6;
    --blue-text: #93c5fd;
    --blue-soft: rgb(59 130 246 / 0.18);
    --blue-line: rgb(59 130 246 / 0.45);
    --green-text: #4ade80;
    --green-soft: rgb(22 163 74 / 0.18);
    --green-line: rgb(22 163 74 / 0.45);
    --purple-text: #c4b5fd;
    --purple-soft: rgb(124 58 237 / 0.22);
    --purple-line: #a78bfa;
    --red-text: #f87171;
    --red-soft: rgb(220 38 38 / 0.18);
    --red-line: rgb(220 38 38 / 0.45);
    --slate: #64748b;
    --slate-text: #cbd5e1;
    --slate-soft: rgb(100 116 139 / 0.25);
    --shadow: 0 2px 8px rgb(0 0 0 / 0.4);
    --shadow-up: 0 -2px 12px rgb(0 0 0 / 0.5);
    --shadow-pop: 0 8px 24px rgb(0 0 0 / 0.6);
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 400 var(--t-md) / 1.4 var(--font);
  color: var(--text);
  background: var(--bg);
}
h1,
h2,
h3,
p {
  margin: 0;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
a {
  color: var(--link);
}
img {
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.muted {
  color: var(--muted);
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}
.grow {
  flex: 1;
}
.money,
.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Off screen but still focusable and read: a file input or checkbox inside a label styled as a button */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Icons (public/icons.svg): stroke in the color of the text around them. The star has no fill of its own, so a rating can fill it. */
.i {
  flex: none;
  vertical-align: middle;
  fill: none;
}

/* ---------- Components ---------- */

/* Buttons: one filled action per context; the rest outlined (.secondary), plain (.ghost) or in the ⋯ menu */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 var(--s4);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent);
  font: 600 var(--t-button) / 1.2 var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:hover:not(:disabled),
.button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
.ghost {
  background: transparent;
  color: var(--muted);
}
label.button:has(:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
button.danger,
.button.danger {
  background: var(--red);
  color: var(--on-state);
}
button.icon,
.button.icon {
  width: var(--tap);
  padding: 0;
}
.brand,
.customer-page {
  --accent: var(--brand);
  --on-accent: var(--on-brand);
}
.back {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  font-weight: 600;
  text-decoration: none;
}

/* Touch targets drawn under 44px (chips, ⋯, ×, ‹, switches, links in a line) keep their look; an invisible layer makes
   them 44px. A scroller would clip the layer, so a chip row keeps room for it (.chips). */
:where(.chips a, a.chip, button.chip, .switch, .menu > summary, .close, .calendar header button, .back, .segmented label, .toggle a, .review-list a, .roles > summary, .role-help > summary, .fee-paid) {
  position: relative;
}
:where(.chips a, a.chip, button.chip, .switch, .menu > summary, .close, .calendar header button, .back, .segmented label, .toggle a, .review-list a, .roles > summary, .role-help > summary, .fee-paid)::after {
  content: "";
  position: absolute;
  inset: min(0px, 50% - var(--tap) / 2);
}

/* Fields */
input:not([type="checkbox"], [type="radio"], [type="file"]),
select,
textarea {
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: 400 var(--t-md) / 1.3 var(--font);
}
textarea {
  resize: vertical;
}
input[type="file"] {
  font: 400 var(--t-sm) var(--font);
  color: var(--muted);
}
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  accent-color: var(--ink);
}
::placeholder {
  color: var(--faint);
}
fieldset {
  min-width: 0;
  margin: 0;
}
/* Floated, the legend is a plain child laid out inside the fieldset instead of sitting on its top edge. */
legend {
  float: left;
  width: 100%;
  padding: 0;
  font-size: var(--t-h3);
  font-weight: 700;
}

/* Switch (Disponível / Esgotado, on/off settings): a checkbox that only looks different */
input[type="checkbox"].switch {
  appearance: none;
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--line-strong);
  cursor: pointer;
  transition: background 0.15s;
}
input[type="checkbox"].switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--on-state);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  transition: transform 0.15s;
}
input[type="checkbox"].switch:checked {
  background: var(--green);
}
input[type="checkbox"].switch:checked::before {
  transform: translateX(20px);
}

/* Badge: a state as dot + text on a soft background */
.badge,
.status,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--muted);
  font-size: var(--t-help);
  font-weight: 600;
  white-space: nowrap;
}
.badge::before,
.status::before,
.tag::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.amber,
.status-pending_confirmation {
  background: var(--amber-soft);
  color: var(--amber-text);
}
.blue,
.status-preparing {
  background: var(--blue-soft);
  color: var(--blue-text);
}
.green,
.status-on_the_way {
  background: var(--green-soft);
  color: var(--green-text);
}
.purple {
  background: var(--purple-soft);
  color: var(--purple-text);
}
.red,
.status-canceled,
.tag.sold-out {
  background: var(--red-soft);
  color: var(--red-text);
}
.slate {
  background: var(--slate-soft);
  color: var(--slate-text);
}

/* Pill: the customer's table ("Mesa 7") */
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--s3);
  border-radius: var(--r-full);
  background: var(--brand);
  color: var(--on-brand);
  font-size: var(--t-sm);
  font-weight: 700;
  white-space: nowrap;
}

/* Chips: category shortcuts, filters, periods. The active one is dark. */
.chips {
  display: flex;
  gap: var(--s2);
  margin-block: -4px;
  padding-block: 4px; /* room for a 36px chip's 44px touch target, which the scroll would clip */
  overflow-x: auto;
  scrollbar-width: none;
}
.chip,
.chips a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.chip[aria-current],
.chip.active,
.chips a[aria-current] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

/* Timer: age of an order. Gray up to 10 min, amber 10–20, red above (thresholds set by dashboard.js) */
.timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.timer.warn {
  background: var(--amber-soft);
  color: var(--amber-text);
}
.timer.late {
  background: var(--red-soft);
  color: var(--red-text);
}

/* Stepper: − 2 + */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: var(--s1);
  border-radius: var(--r-lg);
  background: var(--fill);
}
.stepper button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
}
.stepper output {
  min-width: 28px;
  text-align: center;
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Card and section */
.card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.section {
  display: grid;
  gap: var(--s4);
  padding: var(--s5);
  border-radius: var(--r-xl);
  background: var(--surface);
}

/* Banner: a state in a sentence (pedido aguardando, conta pedida, erro…) */
.banner,
.notice,
.error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: var(--s3) 14px;
  border-radius: var(--r-lg);
  background: var(--fill);
  color: var(--text-2);
  font-size: var(--t-sm);
  font-weight: 600;
}
.notice {
  background: var(--green-soft);
  color: var(--green-text);
}
.banner.amber {
  background: var(--amber-soft);
  color: var(--amber-text);
}
.banner.purple {
  background: var(--purple-soft);
  color: var(--purple-text);
}
.banner.red {
  background: var(--red-soft);
  color: var(--red-text);
}
.banner.blue {
  background: var(--blue-soft);
  color: var(--blue-text);
}
/* Who serves the table, above the customer's orders */
.banner.waiter {
  margin-bottom: var(--s3);
}
.error {
  background: var(--red-soft);
  color: var(--red-text);
}

/* Empty state */
.empty {
  display: grid;
  justify-items: center;
  gap: var(--s2);
  padding: var(--s7) var(--s4);
  color: var(--muted);
  text-align: center;
}
.empty .i {
  width: 40px;
  height: 40px;
  color: var(--faint);
}

/* Toast: a passing confirmation */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--s4) + env(safe-area-inset-bottom));
  z-index: 40;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 2 * var(--s4));
  padding: var(--s3) var(--s4);
  border-radius: var(--r-lg);
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
  box-shadow: var(--shadow-pop);
}

/* Sheet: every <dialog> rises from the bottom on a phone and sits in the middle on a tablet */
dialog {
  width: 100%;
  max-width: 100%;
  max-height: 90vh;
  margin: auto auto 0;
  padding: var(--s4);
  border: 0;
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--surface);
  color: var(--text);
  overscroll-behavior: contain;
}
dialog::before,
.menu > :not(summary)::before {
  content: "";
  display: block;
  justify-self: center;
  width: 40px;
  height: 5px;
  margin: -8px auto var(--s2);
  border-radius: var(--r-full);
  background: var(--line);
}
.menu > :not(summary)::before {
  margin: var(--s1) auto calc(-1 * var(--s1));
}
dialog::backdrop {
  background: var(--overlay);
}
@media (min-width: 600px) {
  dialog {
    width: min(460px, calc(100% - 2rem));
    margin: auto;
    padding: var(--s6);
    border-radius: var(--r-xl);
  }
  dialog::before {
    display: none;
  }
}

/* Sheet header (SheetHead in src/views/panel.tsx): title and a round × of 44px */
.sheet-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.sheet-head h2 {
  flex: 1;
  font-size: var(--t-lg);
  font-weight: 700;
}
.sheet-head .close,
.menu > :not(summary) .sheet-head .close {
  justify-content: center;
  width: var(--tap);
  min-height: var(--tap);
  padding: 0;
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--text);
}
@media (min-width: 600px) {
  dialog .sheet-head {
    align-items: flex-start;
  }
  dialog .sheet-head h2 {
    font-weight: 800;
  }
  dialog .sheet-head .close {
    width: 36px;
    min-height: 36px;
    border-radius: var(--r-sm);
    background: transparent;
  }
}

/* ⋯ menu: <details class="menu"><summary>…</summary><div>actions</div></details>. A sheet on a phone, a dropdown from 900px. */
.menu {
  position: relative;
}
.menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  list-style: none;
  cursor: pointer;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu[open] > summary::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 29;
  background: var(--overlay);
  cursor: default;
}
.menu > :not(summary) {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: grid;
  gap: var(--s3);
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--s2) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom));
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.menu > :not(summary) :is(button, a) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--s4);
  min-height: 56px;
  padding: 0 var(--s2);
  border: 0;
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--text);
  font-size: var(--t-md);
  font-weight: 500;
  text-decoration: none;
}
.menu form {
  display: grid;
}
.menu hr {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.menu > :not(summary) :is(button, a):hover {
  background: var(--fill);
  filter: none;
}
.menu > :not(summary) .danger {
  color: var(--red-text);
}
@media (min-width: 900px) {
  .menu[open] > summary::before {
    background: transparent;
  }
  .menu > :not(summary) {
    position: absolute;
    inset: calc(100% + 6px) 0 auto auto;
    gap: 0;
    min-width: 15rem;
    max-height: none;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
  }
  .menu > :not(summary)::before,
  .menu .sheet-head {
    display: none;
  }
  .menu > :not(summary) :is(button, a) {
    gap: 10px;
    min-height: var(--tap);
    padding: 0 10px;
    border-radius: var(--r-sm);
    font-size: var(--t-button);
  }
  .menu hr {
    margin: 6px 0;
  }
}

/* Logo, or the initials in its place */
.logo {
  flex: none;
  width: var(--logo, 40px);
  height: var(--logo, 40px);
  border-radius: var(--r-md);
  object-fit: contain;
  background: var(--surface);
}
span.logo {
  display: inline-grid;
  place-items: center;
  background: var(--brand);
  color: var(--on-brand);
  font-size: calc(var(--logo, 40px) * 0.4);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ---------- Screens ---------- */

.offline {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: var(--s3) var(--s4);
  background: var(--red);
  color: var(--on-state);
  font-weight: 700;
  text-align: center;
}

/* Dashboard shell (plano-novo-layout 3.1, Penpot "Casca · celular" and the top of the page 4 boards). One markup: on a phone,
   a top bar with the screen's title and a tab bar fixed at the bottom; from 900px, one bar on top with the menu in it. */
.panel {
  --tabbar: calc(76px + env(safe-area-inset-bottom));
  padding-bottom: var(--tabbar);
}
.appbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 57px;
  padding: 0 var(--s3) 0 var(--s4);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.appbar .logo {
  border-radius: var(--r-sm);
}
.heading {
  flex: 1;
  display: grid;
  min-width: 0;
}
.heading h1 {
  overflow: hidden;
  font-size: var(--t-lg);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.place {
  color: var(--muted);
  font-size: var(--t-xs);
}
.heading:has(.live) .place {
  display: none;
}
/* "● Ao vivo" / "● Sem conexão" (dashboard.js), next to the red banner of RQ-04 */
.live {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  color: var(--green-text);
  font-size: var(--t-xs);
  font-weight: 600;
}
.live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
.live.off {
  color: var(--red-text);
}
.live.off::before {
  background: var(--red);
}
#sound {
  flex: none;
}

/* The user's menu: the avatar opens it */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--slate-soft);
  color: var(--slate-text);
  font-size: var(--t-sm);
  font-weight: 700;
}
.account > summary {
  width: var(--tap);
  border: 0;
  background: transparent;
}
.account > summary :not(.avatar) {
  display: none;
}
.identity {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.identity .avatar {
  width: 44px;
  height: 44px;
  font-size: var(--t-h3);
}
.identity strong {
  display: block;
  font-size: var(--t-md);
}
.identity .muted {
  font-size: var(--t-help);
  font-weight: 500;
}
.role {
  padding: 2px var(--s2);
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 600;
  white-space: nowrap;
}
/* The owner's color; the other roles bring theirs (.blue, .green…, in the team screen) */
:where(.role) {
  background: var(--brand-soft);
  color: var(--brand-text);
}
.role.plain {
  background: var(--fill);
  color: var(--text-2);
}
.menu > :not(summary) .danger {
  background: transparent;
}
.wide-only {
  display: none;
}

/* Aparência (ThemePicker in src/views/layout.tsx): a segmented control made of radios */
.theme {
  display: grid;
  gap: var(--s2);
  padding: 0;
  border: 0;
}
.theme legend {
  margin-bottom: var(--s2);
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 600;
}
.theme small {
  color: var(--muted);
  font-size: var(--t-xs);
}
.segmented {
  display: flex;
  gap: var(--s1);
  padding: var(--s1);
  border-radius: var(--r-lg);
  background: var(--fill);
}
.segmented label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 500;
  cursor: pointer;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented label:has(:checked) {
  background: var(--surface);
  color: var(--brand-text);
  font-weight: 700;
  box-shadow: var(--shadow);
}
.segmented label:has(:focus-visible) {
  outline: 2px solid var(--blue);
}

/* Tab bar: icon in a pill over the label; the current screen's pill is dark */
.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 20;
  display: flex;
  gap: var(--s1);
  padding: var(--s2) var(--s2) calc(var(--s4) + env(safe-area-inset-bottom));
  background: var(--surface);
  box-shadow: var(--shadow-up);
}
.tabbar > a,
.tabbar > .menu,
.tabbar > .menu > summary {
  flex: 1;
}
.tabbar > a,
.tabbar > .menu > summary {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  width: auto;
  height: auto;
  min-height: 52px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 600;
  text-decoration: none;
}
.tab-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 30px;
  border-radius: var(--r-full);
}
.tabbar > a[aria-current],
.tabbar > .menu > summary[aria-current],
.tabbar > .menu[open] > summary {
  color: var(--text);
  font-weight: 700;
}
.tabbar > a[aria-current] .tab-icon,
.tabbar > .menu > summary[aria-current] .tab-icon,
.tabbar > .menu[open] > summary .tab-icon {
  background: var(--ink);
  color: var(--on-ink);
}
/* While the Gestão sheet is open, its tab is the active one */
.tabbar:has(> .menu[open]) > a[aria-current] {
  color: var(--muted);
  font-weight: 600;
}
.tabbar:has(> .menu[open]) > a[aria-current] .tab-icon {
  background: transparent;
  color: inherit;
}
.tabbar > .menu > summary > .i,
.tabbar .current {
  display: none;
}
/* Open calls and bill requests on "Mesas" */
.alerts {
  position: absolute;
  top: -4px;
  left: calc(50% + 8px);
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: var(--r-full);
  background: var(--red);
  color: var(--on-state);
  font-size: var(--t-xs);
  font-weight: 700;
}
.alerts:empty {
  display: none;
}
/* The Gestão sheet rises from the tab bar, which stays visible */
.management[open] > summary::before {
  inset: 0 0 var(--tabbar);
}
.management > div {
  bottom: var(--tabbar);
}
.management > div a {
  min-height: 64px;
  font-size: var(--t-md);
  font-weight: 600;
}
.management > div a[aria-current] {
  background: var(--fill);
}
.management small {
  display: block;
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 400;
}

/* A toast clears the tab bar */
body:has(.tabbar) > .toast {
  bottom: calc(76px + env(safe-area-inset-bottom) + var(--s4));
}

/* Calls bar: a chip per waiter call (amber) and bill request (purple), under the top bar of the live screens */
#calls:empty {
  display: none;
}
.calls {
  display: flex;
  gap: var(--s2);
  padding: var(--s2) var(--s4);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.calls li {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 52px;
  padding: 0 var(--s1) 0 14px;
  border: 1px solid var(--amber);
  border-radius: var(--r-full);
  background: var(--amber-soft);
  color: var(--amber-text);
  font-size: var(--t-sm);
  white-space: nowrap;
}
.calls strong {
  font-size: var(--t-md);
}
.calls :is(button, .button) {
  border-radius: var(--r-full);
  background: var(--amber);
  color: var(--on-amber);
  font-size: var(--t-sm);
  font-weight: 700;
}
.calls .bill {
  border-color: var(--purple);
  background: var(--purple-soft);
  color: var(--purple-text);
}
.calls .bill .button {
  background: var(--purple);
  color: var(--on-purple);
}

@media (min-width: 900px) {
  .panel {
    padding-bottom: 0;
  }
  .appbar {
    gap: 6px;
    min-height: 61px;
    padding: 0 var(--s5);
  }
  .appbar .logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }
  /* The title goes to the content (or the menu's pill); the establishment's name and "Ao vivo" go to the bar */
  .heading {
    display: contents;
  }
  .heading h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .place,
  .heading:has(.live) .place {
    display: block;
    margin: 0 var(--s4) 0 var(--s1);
    color: var(--text);
    font-size: var(--t-md);
    font-weight: 700;
    white-space: nowrap;
  }
  .live {
    order: 2;
    min-height: 32px;
    padding: 0 var(--s3);
    border-radius: var(--r-full);
    background: var(--green-soft);
    font-size: var(--t-help);
  }
  .live.off {
    background: var(--red-soft);
  }
  #sound {
    order: 1;
  }
  .account {
    order: 3;
  }
  .account > summary {
    gap: var(--s2);
    width: auto;
    padding: 0 var(--s2);
    color: var(--text);
    font-weight: 600;
  }
  .account > summary :not(.avatar) {
    display: inline;
  }
  .account > summary .avatar {
    width: 30px;
    height: 30px;
    font-size: var(--t-help);
  }
  .account > summary:hover,
  .account[open] > summary {
    background: var(--fill);
  }
  .account > div {
    width: 300px;
  }
  .identity {
    padding: 10px;
  }
  .wide-only {
    display: block;
  }
  .theme {
    padding: 6px 10px var(--s2);
  }
  .theme legend {
    font-size: var(--t-help);
  }
  .segmented {
    border-radius: var(--r-md);
  }
  .segmented label {
    min-height: 34px;
    font-size: var(--t-help);
  }

  /* The tab bar becomes the menu in the top bar: icon and label side by side, the current screen in a dark pill */
  .tabbar {
    position: static;
    gap: 6px;
    margin-right: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }
  .tabbar > a,
  .tabbar > .menu,
  .tabbar > .menu > summary {
    flex: none;
  }
  .tabbar > a,
  .tabbar > .menu > summary {
    flex-direction: row;
    gap: var(--s2);
    min-height: var(--tap);
    padding: 0 14px;
    border-radius: var(--r-md);
    color: var(--text);
    font-size: var(--t-button);
    font-weight: 600;
  }
  .tab-icon {
    width: auto;
    height: auto;
  }
  .tab-icon .i {
    width: 18px;
    height: 18px;
  }
  .tabbar > a:hover,
  .tabbar > .menu > summary:hover,
  .tabbar > .menu[open] > summary {
    background: var(--fill);
    font-weight: 600;
  }
  .tabbar > a[aria-current],
  .tabbar > .menu > summary[aria-current] {
    background: var(--ink);
    color: var(--on-ink);
    font-weight: 600;
  }
  .tabbar > a[aria-current] .tab-icon,
  .tabbar > .menu > summary[aria-current] .tab-icon,
  .tabbar > .menu[open] > summary .tab-icon {
    background: transparent;
    color: inherit;
  }
  .tabbar:has(> .menu[open]) > a[aria-current] {
    color: var(--on-ink);
  }
  .tabbar > .menu > summary > .i,
  .tabbar .current {
    display: inline;
  }
  .alerts {
    position: static;
    border: 0;
  }
  .management[open] > summary::before {
    inset: 0;
  }
  .management > div {
    inset: calc(100% + 6px) auto auto 0;
    width: 300px;
  }
  .management > div a {
    gap: var(--s3);
    min-height: 56px;
    font-size: var(--t-button);
  }
  .management small {
    font-size: var(--t-xs);
    font-weight: 500;
  }

  .calls {
    padding: var(--s2) var(--s5);
  }
  body:has(.tabbar) > .toast {
    bottom: var(--s6);
  }
}

.message {
  display: grid;
  gap: var(--s3);
  max-width: 30rem;
  margin: 0 auto;
  padding: 28px var(--s4) var(--s8);
  text-align: center;
  font-size: var(--t-md);
}
.message h2 {
  font-size: var(--t-title);
  font-weight: 800;
}
.message > .muted {
  font-size: var(--t-sm);
}
.halo {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 0 auto var(--s2);
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand-text);
}
.halo.gray {
  background: var(--fill);
  color: var(--faint);
}

/* Avaliação da visita (Cliente · Agradecimento): a row of 5 radio stars per score */
.review {
  gap: 14px;
  padding: var(--s4);
  border-radius: 14px;
  text-align: start;
}
.review hgroup {
  display: grid;
  gap: 2px;
}
.review h3 {
  font-size: 1.0625rem;
  font-weight: 700;
}
.review hgroup p {
  font-size: var(--t-help);
}
.score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: 0;
  border: 0;
}
.score legend {
  width: auto;
  font-size: var(--t-button);
  font-weight: 600;
}
.stars {
  display: flex;
}
/* 30 × 44: the board's 24px star with its 6px gap, as tall as a tap */
.stars label {
  position: relative; /* keeps the hidden radio, and the browser's "pick one" bubble, on the star */
  display: grid;
  place-items: center;
  width: 30px;
  height: var(--tap);
  color: var(--line-strong);
  cursor: pointer;
}
.stars label:has(:checked),
.stars label:has(~ label :checked) {
  color: var(--amber);
}
.stars label:has(:checked) .i,
.stars label:has(~ label :checked) .i {
  fill: currentColor;
}
.stars label:has(:focus-visible) {
  outline: 2px solid var(--blue);
  border-radius: var(--r-sm);
}
.review textarea {
  min-height: 72px;
}
.review button {
  min-height: 48px;
  margin-top: 6px;
  border-radius: 14px;
  font-size: 1.0625rem;
}

/* Customer page (plano-novo-layout 3.2, Penpot page 2). On a tablet or computer, the same phone layout in a centered column. */
.customer-page {
  --gutter: max(var(--s4), calc(50% - 20rem + var(--s4))); /* % of the viewport where it's used: 40rem wide, centered */
  --tabs: calc(76px + env(safe-area-inset-bottom));
}
.topbar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 65px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topbar h1 {
  font-size: 1.0625rem;
  font-weight: 700;
}
.customer {
  display: grid;
  padding: var(--s4) var(--gutter) calc(var(--tabs) + 84px);
}
.customer > section {
  display: grid;
  align-content: start;
  gap: var(--s3);
}
.customer h2 {
  font-size: 1.375rem;
  font-weight: 700;
}

/* Cardápio: the chips stay on top while the menu scrolls; a card per item, the photo on the right with its + */
#menu > .chips {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: calc(-1 * var(--s4)) calc(-1 * var(--gutter)) 0;
  padding: var(--s3) var(--gutter) var(--s1);
  background: var(--bg);
}
#menu > section {
  display: grid;
  gap: var(--s3);
  scroll-margin-top: 64px;
}
#menu > section + section {
  margin-top: var(--s3);
}
#menu h2 {
  font-size: var(--t-lg);
}
.item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.item[data-item] {
  cursor: pointer;
}
.item:not([data-item]) {
  opacity: 0.6;
}
.item .grow {
  display: grid;
  gap: var(--s1);
}
.item h3 {
  font-size: var(--t-md);
  font-weight: 600;
  line-height: 1.3;
}
.item .muted {
  font-size: var(--t-help);
  line-height: 1.35;
}
.price {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.item:not([data-item]) .price strong {
  color: var(--muted);
}
.price .badge {
  min-height: 22px;
  font-size: var(--t-xs);
}
.item .photo {
  flex: none;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: var(--r-md);
  background: var(--fill);
}
.item .add {
  align-self: flex-end;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  box-shadow: var(--shadow);
}
.item .photo + .add {
  position: absolute;
  right: var(--s4);
  bottom: var(--s4);
}
.clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* The bar of the cart, over the tabs while it has items */
.cart-bar {
  position: fixed;
  inset: auto var(--gutter) calc(var(--tabs) + var(--s3));
  z-index: 15;
  justify-content: flex-start;
  gap: 10px;
  min-height: 56px;
  border-radius: 14px;
  font-size: var(--t-md);
  font-weight: 700;
  text-align: left;
  box-shadow: var(--shadow);
}

/* Tab bar: Cardápio · Pedidos · Conta · Garçom · Configurações; the current one in the brand's color */
.tabs {
  position: fixed;
  inset: auto 0 0;
  z-index: 20;
  display: flex;
  padding: var(--s2) max(var(--s2), calc(50% - 20rem + var(--s2))) calc(var(--s4) + env(safe-area-inset-bottom));
  background: var(--surface);
  box-shadow: var(--shadow-up);
}
.tabs > a {
  flex: 1;
  flex-direction: column;
  gap: var(--s1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: transparent;
  color: var(--muted);
  font: 500 var(--t-xs) / 1.3 var(--font);
  text-decoration: none;
  white-space: nowrap;
}
.tabs > a[aria-current] {
  color: var(--brand-text);
  font-weight: 700;
}
.with-count {
  position: relative;
  display: grid;
}
.tabs .count {
  position: absolute;
  top: -3px;
  left: calc(100% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 0.6875rem;
}
.tabs .count:empty {
  display: none;
}
.customer-page > .toast {
  bottom: calc(var(--tabs) + 84px);
}

/* Sheets: the item's detail and the cart */
.customer-page dialog {
  padding: var(--s3) 20px 28px;
}
.customer-page dialog::before {
  margin: 0 auto 14px;
}
.customer-page dialog .form {
  gap: 14px;
}
.customer-page .sheet-head h2 {
  font-size: 1.375rem;
}
@media (min-width: 600px) {
  .customer-page dialog {
    padding: var(--s6);
  }
}
#detail img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 14px;
}
#detail .title {
  display: grid;
  gap: 6px;
}
#detail h2 {
  font-size: 1.375rem;
  font-weight: 700;
}
#detail .title p {
  font-size: var(--t-button);
}
#detail .row {
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 6px;
}
#detail .row > button {
  min-height: 52px;
  padding: 0 var(--s3);
  border-radius: var(--r-lg);
  font-size: var(--t-md);
}
.customer-page .stepper button {
  width: var(--tap);
  min-height: var(--tap);
  border-radius: var(--r-md);
}
#detail .stepper output {
  font-size: var(--t-h3);
}
#cart-lines {
  display: grid;
  gap: 14px;
  max-height: 45vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#cart-lines li {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}
#cart-lines p {
  display: grid;
  gap: 2px;
}
#cart-lines strong {
  font-weight: 600;
}
#cart-lines small {
  color: var(--amber-text);
  font-size: var(--t-help);
}
#cart-lines small:empty {
  display: none;
}
#cart-lines .muted {
  font-size: var(--t-sm);
}
.stepper .remove {
  color: var(--red-text);
}
#cart-status:empty,
#paused:empty {
  display: none;
}
/* Orders paused (plano-novo-layout 3.7): the warning stands in for "Enviar pedido" */
#cart:has(#paused > *) [type="submit"] {
  display: none;
}
#cart [type="submit"] {
  min-height: 56px;
  border-radius: 14px;
  font-size: 1.0625rem;
}

/* Pedidos: a card per order with its trail, the waiting one with the amber banner; delivered ones compact at the end */
.orders {
  display: grid;
  gap: var(--s3);
}
.orders .card {
  gap: var(--s3);
  padding: var(--s4);
  border-radius: 14px;
}
.orders header .muted {
  font-size: var(--t-sm);
}
.orders .banner {
  align-items: center;
  padding: 10px var(--s3);
  border-radius: var(--r-md);
  font-weight: 500;
}
.orders .lines li {
  font-weight: 600;
}
.orders .lines b {
  font-weight: inherit;
}
.orders .note {
  padding: 0;
  background: none;
  font-weight: 400;
}
/* The icon walks the line: at the start while preparing, halfway on the way; the circle at the end is "Entregue" */
.trail {
  --at: 0%;
  display: grid;
  gap: 6px;
  color: var(--blue);
}
.trail.on_the_way {
  --at: 50%;
  color: var(--green);
}
.trail .track {
  position: relative;
  height: 28px;
  background:
    linear-gradient(currentColor, currentColor) 0 50% / var(--at) 4px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 50% / 100% 4px no-repeat;
}
.trail .track::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}
.trail .i {
  position: absolute;
  left: var(--at);
  transform: translateX(calc(-1 * var(--at)));
  background: var(--surface);
}
.trail .steps {
  position: relative;
  height: 16px;
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 500;
}
.trail .steps span {
  position: absolute;
  right: 0;
}
.trail .steps b {
  position: absolute;
  left: var(--at);
  transform: translateX(calc(-1 * var(--at)));
  color: var(--blue);
  font-weight: 700;
}
.trail.on_the_way .steps b {
  color: var(--green-text);
}
.delivered-order {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 var(--s4);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: var(--t-help);
  font-weight: 600;
  opacity: 0.75;
}
.delivered-order .grow {
  overflow: hidden;
  font-size: var(--t-button);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delivered-order .ok {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--fill);
}

/* Conta: the total with "Pedir a conta" (or the purple "Conta pedida"), the call, then the bill */
#bill .card {
  padding: var(--s2) 20px;
  border-radius: var(--r-xl);
  box-shadow: none;
}
#bill .table-total {
  gap: 6px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.table-total .muted {
  font-size: var(--t-sm);
  font-weight: 600;
}
.table-total strong {
  font-size: 2.125rem;
  font-weight: 800;
  line-height: 1.3;
}
.table-total button {
  min-height: 52px;
  margin-top: 10px;
  border-radius: var(--r-lg);
  font-size: var(--t-md);
}
.table-total small {
  font-size: var(--t-help);
  font-weight: 400;
}
#waiter > button {
  min-height: 52px;
  border-radius: var(--r-lg);
  font-size: var(--t-md);
}
#bill .banner,
#waiter .banner {
  align-items: center;
  gap: var(--s3);
  padding: 14px;
  font-weight: 400;
}
#bill .banner b,
#waiter .banner b {
  display: block;
  font-size: var(--t-md);
  font-weight: 700;
}
.table-total .banner {
  margin-top: 10px;
}
#bill > .banner,
#waiter > .banner {
  padding: 14px var(--s4);
  border-radius: var(--r-xl);
}
#bill > .muted {
  font-size: var(--t-help);
}
#bill .bill td {
  padding: 12px 0;
}
#bill .bill tfoot th {
  padding: 14px 0 10px;
}
#bill .bill .total,
#bill .bill .total .money {
  font-size: 1.0625rem;
}

/* Configurações: the name and the theme, on this phone */
#preferences {
  display: grid;
  gap: var(--s4);
}
#preferences .card > label {
  display: grid;
  gap: 6px;
  font-size: var(--t-sm);
  font-weight: 600;
}
#settings .card {
  gap: var(--s3);
  padding: var(--s4);
  border-radius: 14px;
}
#settings small {
  font-size: var(--t-help);
  font-weight: 400;
}
#settings .theme legend {
  margin-bottom: var(--s3);
  color: var(--text);
  font-size: var(--t-sm);
}
#settings .segmented label {
  min-height: 40px;
}
#preferences > button {
  min-height: 56px;
  margin-top: 6px;
  border-radius: 14px;
  font-size: 1.0625rem;
}

/* Bill: quantity, item and amount per line; the total in reais under a rule */
table.bill {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-button);
}
.bill td {
  padding: 9px 0;
  vertical-align: top;
}
.bill td:first-child {
  width: 36px;
  color: var(--muted);
  font-weight: 700;
}
.bill .money {
  padding-left: var(--s3);
  text-align: right;
  font-weight: 600;
}
.bill tfoot th {
  padding: var(--s2) 0 0;
}
.bill tfoot tr:first-child > * {
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}
/* Subtotal and service fee (plano-novo-layout 3.6) */
.bill tfoot td,
.bill tfoot td:first-child {
  width: auto;
  padding-bottom: 0;
  color: var(--muted);
  font-weight: 400;
}
.bill .total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--t-h3);
  font-weight: 700;
}
.bill .total .money {
  font-size: var(--t-title);
  font-weight: 800;
}
/* Order board (plano-novo-layout 4.2, Penpot "Painel · Quadro de pedidos"). On a phone, one list grouped by status with chips
   that jump to each group; from 900px, a column per status side by side, Entregue narrower. */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--s3);
  padding: var(--s4);
}
.board > .chips {
  margin-right: calc(-1 * var(--s4));
}
.board .chip {
  min-height: var(--tap);
}
.board .chip .num {
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 700;
}
.column {
  display: grid;
  align-content: start;
  gap: var(--s3);
  scroll-margin-top: var(--s4);
}
.column > h2 {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0 var(--s3);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--t-button);
  font-weight: 700;
}
/* Each status's color: the strip before the column's name, its count and the chip's dot */
.col-pending_confirmation {
  --col: var(--amber);
}
.col-preparing {
  --col: var(--blue);
}
.col-on_the_way {
  --col: var(--green);
}
.col-delivered {
  --col: var(--faint);
}
.column > h2::before,
.board .chip::before {
  content: "";
  flex: none;
  width: 4px;
  height: 24px;
  border-radius: 2px;
  background: var(--col);
}
.board .chip::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--muted);
  font-size: var(--t-help);
  font-weight: 700;
}
.column > h2 .count {
  margin-left: auto;
  background: var(--col);
  color: var(--on-state);
}

/* An order's card: table and timer, who and when, the items, the actions */
.card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
}
.card header strong {
  font-size: 1.375rem;
  font-weight: 800;
}
.order p {
  font-size: var(--t-help);
}
.lines {
  display: grid;
  gap: 6px;
}
.lines li {
  display: flex;
  gap: var(--s2);
  font-size: var(--t-button);
  font-weight: 500;
}
.lines b {
  min-width: 22px;
  font-weight: 800;
}
.lines li > span {
  display: grid;
  gap: var(--s1);
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s2);
}
.actions > button {
  flex: 1;
}
.actions > .menu {
  margin-right: auto;
}
.actions > .menu > summary {
  border-radius: var(--r-sm);
}
/* The main action takes the color of where it sends the order; delivered keeps the dark one */
.actions > .to-preparing {
  background: var(--slate);
  color: var(--on-state);
}
.actions > .to-on_the_way {
  background: var(--blue);
  color: var(--on-state);
}
.menu .sheet-head .muted {
  font-weight: 400;
}

/* Entregue: just the table and when, faded */
.delivered {
  padding: var(--s1) var(--s3);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.delivered li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 600;
}
.delivered li .muted {
  color: var(--faint);
  font-size: var(--t-help);
  font-weight: 400;
}
.delivered a {
  flex: 1;
  align-self: stretch;
  display: grid;
  place-items: center;
  text-decoration: none;
}

@media (min-width: 900px) {
  .board {
    display: flex;
    align-items: flex-start;
    padding: var(--s5);
  }
  .board > .chips {
    display: none;
  }
  .column {
    flex: 1 1 0;
    min-width: 0;
    gap: 10px;
  }
  .column.col-delivered {
    flex: 0 0 190px;
  }
  .delivered li {
    min-height: 40px;
  }
  /* The ⋯ of a card opens to the right, under it */
  .actions > .menu > :not(summary) {
    inset: calc(100% + 6px) auto auto 0;
  }
  .actions > button {
    flex: none;
  }
}
.note {
  justify-self: start;
  width: fit-content;
  margin-top: 2px;
  padding: 2px var(--s2);
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber-text);
  font-size: var(--t-help);
  font-weight: 600;
}
.is-new {
  animation: flash 1s ease-in-out 4;
}
@keyframes flash {
  50% {
    background: var(--amber-soft);
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-new {
    animation: none;
    outline: 2px solid var(--amber);
  }
}

/* Login: a card in the middle, no bars */
.login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: var(--s4);
}
.login form {
  width: 100%;
  max-width: 400px;
  padding: var(--s6);
  border-radius: var(--r-sheet);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.login .mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: var(--on-ink);
}
.login h1 {
  font-size: var(--t-xl);
  font-weight: 800;
}
.login .muted {
  font-size: var(--t-sm);
}
.login button {
  min-height: 52px;
  border-radius: var(--r-lg);
  font-size: var(--t-md);
  font-weight: 700;
}
@media (min-width: 600px) {
  .login form {
    padding: var(--s7);
  }
}

/* Trocar senha (PasswordForm in src/views/panel.tsx) */
.secret {
  position: relative;
  display: grid;
}
.secret input {
  padding-right: 52px;
}
.secret button {
  position: absolute;
  top: 2px;
  right: 2px;
  min-height: 44px;
}
.form small {
  font-size: var(--t-help);
  font-weight: 500;
}
.form .actions > * {
  flex: 1;
  padding: 0 var(--s2);
}
@media (min-width: 600px) {
  .form .actions {
    justify-content: flex-end;
  }
  .form .actions > * {
    flex: none;
    padding: 0 18px;
  }
}

/* A management screen (Cardápio, Cadastro de mesas). On a phone the title is in the top bar and the actions split the width;
   from 900px the title heads the content, with the actions on its right. */
.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--s3);
  padding: var(--s4);
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}
.page-head > .grow {
  flex-basis: 100%;
}
.page-head h2 {
  display: none;
}
.page-head > :is(button, .button) {
  flex: 1;
  padding: 0 var(--s2);
}

#dishes {
  display: grid;
  gap: inherit; /* the page's */
}

/* Cardápio (Penpot "Painel · Cardápio (dona)"): a card per category; per item the photo, the name, the price with the state
   under it on a phone (in columns from 900px), the sold-out switch and the ⋯ */
.category {
  display: grid;
  padding: var(--s1) var(--s4);
  border-radius: var(--r-xl);
  background: var(--surface);
}
.category > header {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 56px;
}
.category h3 {
  font-size: var(--t-lg);
  font-weight: 700;
}
.category > header .muted {
  font-size: var(--t-sm);
}
.category > header > .menu {
  margin-left: auto;
}
.category > p {
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
  font-size: var(--t-sm);
}
.dish {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto;
  grid-template-areas:
    "photo name switch more"
    "photo meta switch more";
  align-items: center;
  gap: 2px var(--s3);
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
}
.thumb {
  grid-area: photo;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--r-sm);
}
span.thumb {
  display: grid;
  place-items: center;
  background: var(--fill);
  color: var(--faint);
}
.dish strong {
  grid-area: name;
  font-weight: 600;
  line-height: 1.3;
}
/* On a phone, "R$ 42,00 · Disponível" under the name; the state goes under the price when the line is short */
.dish .meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 6px;
  font-size: var(--t-sm);
}
.dish .price {
  font-weight: 600;
}
.dish .price::after {
  content: " ·";
  color: var(--muted);
  font-weight: 400;
}
.dish .state {
  color: var(--green-text);
  font-weight: 700;
}
.dish .state.out {
  color: var(--red-text);
}
.dish .switch {
  grid-area: switch;
}
.dish .menu {
  grid-area: more;
}
.dish.inactive :is(strong, .price) {
  color: var(--muted);
}
.dish.inactive .thumb {
  opacity: 0.4;
}
.dish.inactive .state {
  display: none; /* the "—" of a wide screen */
}

/* Cadastro de mesas: a row per table, by number */
.rows {
  gap: 0;
  padding: var(--s1) var(--s4);
}
.rows li {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 68px;
  padding: var(--s2) 0;
}
.rows li + li {
  border-top: 1px solid var(--line);
}
.rows .table-num {
  display: block;
  width: 44px;
  height: 44px;
  padding: 0 var(--s1);
  border-radius: var(--r-md);
  line-height: 44px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--fill);
  color: var(--text-2);
  font-size: var(--t-md);
}
.rows strong {
  font-weight: 600;
}
.rows .inactive :is(.table-num, strong) {
  color: var(--muted);
}

@media (min-width: 900px) {
  .page {
    gap: var(--s4);
    padding: var(--s5);
  }
  .page-head {
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }
  .page-head > .grow {
    flex-basis: 0;
  }
  .page-head h2 {
    display: block;
    flex: 1;
    font-size: var(--t-title);
    font-weight: 800;
  }
  .page-head > :is(button, .button) {
    flex: none;
    padding: 0 var(--s4);
  }
  .category,
  .rows {
    padding: 6px var(--s5);
  }
  .category > header {
    min-height: 54px;
    gap: 10px;
  }
  .category h3 {
    font-size: var(--t-h3);
  }
  .category > header .muted {
    font-size: var(--t-button);
  }
  .category .menu > summary {
    width: 40px;
    height: 40px;
  }
  /* In columns: name (and "Inativo"), price, state and switch, ⋯ */
  .dish {
    grid-template-columns: 48px auto auto minmax(0, 1fr) 100px 112px 48px 40px;
    grid-template-areas: "photo name badge . price state switch more";
    gap: var(--s4);
    min-height: 68px;
    padding: 10px 0;
  }
  .dish .meta {
    display: contents;
  }
  .dish .price {
    grid-area: price;
    font-size: var(--t-md);
  }
  .dish .price::after {
    content: none;
  }
  .dish .badge {
    grid-area: badge;
    margin-left: -6px;
  }
  .dish .state {
    grid-area: state;
    justify-self: end;
    margin-right: -6px;
  }
  .dish.inactive .state {
    display: block;
    grid-column: state-start / switch-end;
    margin: 0;
    color: var(--muted);
    font-weight: 400;
  }
}

/* Configurações (Penpot "Painel · Configurações"): Operação first on a phone; from 900px Estabelecimento on the left, Operação
   on the right and "Salvar alterações" in the head. It shows only while something changed (dashboard.js). */
.page-head p {
  font-size: var(--t-sm);
}
.settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: inherit; /* the page's */
}
.settings .section {
  padding: var(--s4);
}
.settings h2 {
  font-size: var(--t-h3);
  font-weight: 700;
}
.operation {
  order: -1;
  gap: var(--s1);
}
.establishment > label,
.logo-field > .label {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* a long time zone doesn't widen the field past the card */
  gap: 6px;
  font-size: var(--t-sm);
  font-weight: 600;
}
.establishment small {
  font-size: var(--t-help);
  font-weight: 400;
}
.establishment :is([name="name"], select) {
  min-height: 48px;
}
.logo-field {
  --logo: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s2) var(--s4);
}
.logo-field > .label {
  grid-column: 1 / -1;
}
.logo-field .logo {
  border-radius: 14px;
}
.logo-field > div {
  display: grid;
  gap: var(--s2);
}
/* The logo hides the initials, unless it's being removed */
.logo-field:has(img.logo:not([hidden])):not(:has(:checked)) span.logo,
.logo-field:has(:checked) img.logo {
  display: none;
}
.remove {
  color: var(--red-text);
}
.remove span + span,
.remove:has(:checked) span:first-of-type {
  display: none;
}
.remove:has(:checked) span + span {
  display: inline;
}
.select {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.select select {
  appearance: none;
  padding-inline: 42px 40px;
  text-overflow: ellipsis;
}
.select .i {
  position: absolute;
  top: 50%;
  left: 14px;
  translate: 0 -50%;
  color: var(--muted);
  pointer-events: none;
}
.select .i:last-child {
  left: auto;
  right: 14px;
}
.page-head .action-bar > button {
  flex: 1;
}
/* A row of Operação: the icon in a box, title and hint, the switch or the number */
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}
.option + .option {
  border-top: 1px solid var(--line);
}
.option-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--fill);
  color: var(--text-2);
}
.option strong {
  display: block;
  font-size: var(--t-button);
  font-weight: 600;
}
.option small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--t-help);
  line-height: 1.35;
}
.amount {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-height: var(--tap);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--t-sm);
}
.amount:has(:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.amount input {
  width: calc(var(--digits) * 1ch + 2px); /* as wide as the largest value */
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 600;
  text-align: right;
  appearance: textfield;
}
.amount input:focus-visible {
  outline: none;
}
@media (min-width: 900px) {
  .settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings .section {
    padding: var(--s5);
  }
  .operation {
    order: 0;
  }
  .page-head .action-bar {
    position: static;
    padding: 0;
    background: none;
    box-shadow: none;
  }
  .page-head .action-bar > button {
    flex: none;
    min-height: var(--tap);
    padding: 0 var(--s4);
    border-radius: var(--r-md);
    font-size: var(--t-button);
  }
}

/* Planos (plano-novo-layout 3.11, Penpot "Painel · Planos (dona)" and "Planos — fazer upgrade (WhatsApp)"). The plan's card is
   a link to Planos in Configurações (› on a phone, "Gerenciar plano" as a button from 900px) and plain on top of Planos. The
   plans stack on a phone and sit side by side from 900px, the current one with the brand's border. */
.plan-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px var(--s3);
  padding: var(--s3) var(--s2) var(--s3) var(--s3);
  color: var(--text);
  font-size: var(--t-md);
  text-decoration: none;
}
.plan-banner .muted {
  font-weight: 500;
}
p.plan-banner {
  padding: 14px var(--s4);
}
p.plan-banner strong {
  font-weight: 800;
}
a.plan-banner .plan-icon {
  grid-row: span 2;
}
a.plan-banner > .i {
  grid-area: 1 / 3 / 3;
  margin: 0 var(--s3);
}
.plan-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--amber-soft);
  color: var(--amber-text);
}
.manage {
  grid-column: 2;
  color: var(--brand-text);
  font-size: var(--t-sm);
  font-weight: 600;
}
.role.ink {
  background: var(--ink);
  color: var(--on-ink);
}
.plans {
  display: grid;
  gap: var(--s3);
}
.plan {
  align-content: start;
  gap: 14px;
  padding: var(--s4);
}
.plan.current {
  border: 2px solid var(--brand);
}
.plan h3 {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 1.375rem;
  font-weight: 800;
}
.plan > .muted {
  font-size: var(--t-sm);
  font-weight: 500;
}
.plan .price {
  display: flex;
  align-items: baseline;
  gap: var(--s1);
  color: var(--muted);
  font-size: var(--t-button);
  font-weight: 500;
}
.plan .price strong {
  color: var(--text);
  font-size: var(--t-2xl);
  font-weight: 800;
  line-height: 1.3;
}
.plan button {
  min-height: 46px;
}
.plan button:disabled {
  opacity: 1;
  border-color: transparent;
  background: var(--fill);
  color: var(--muted);
}
.plan hr {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.plan small {
  margin-bottom: -4px;
  color: var(--muted);
  font-size: var(--t-help);
  font-weight: 700;
}
.plan ul {
  display: grid;
  gap: 10px;
}
.plan li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--t-button);
  font-weight: 500;
}
.plan li .i {
  margin-top: 1px;
  color: var(--green);
}
.whatsapp-message {
  display: grid;
  gap: 6px;
  padding: 14px var(--s4);
  border: 1px solid var(--green-line);
  border-radius: var(--r-lg);
  background: var(--green-soft);
  font-size: var(--t-button);
  font-weight: 500;
}
.whatsapp-message small {
  color: var(--muted);
  font-size: var(--t-xs);
}
.button.whatsapp {
  background: var(--green);
  color: var(--on-state);
}
/* A limit or a feature out of the plan (PlanLimit in src/views/panel.tsx), with "Ver planos" for the owner */
.plan-note {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 500;
}
.plan-note .i {
  margin-top: 1px;
}
.plan-note a,
.error a {
  color: inherit;
  font-weight: 700;
}
.plan-note a {
  color: var(--brand-text);
}
.chip[aria-disabled="true"] {
  opacity: 0.45;
}
@media (min-width: 900px) {
  a.plan-banner {
    padding: var(--s3) var(--s3) var(--s3) var(--s4);
  }
  a.plan-banner .plan-icon {
    grid-row: auto;
  }
  a.plan-banner > .i {
    display: none;
  }
  .manage {
    grid-area: 1 / 3;
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    color: var(--text);
    font-size: var(--t-button);
  }
  .plans {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s4);
  }
  .plan {
    padding: var(--s6);
  }
}

/* Equipe (Penpot "Painel · Equipe"): a card with a row per person, and "Perfis de acesso" folded under it on a phone. On a
   phone a row is the name, "@ana · Agora" and the roles; from 900px, columns under a header and the profiles card on the right. */
.team {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: inherit; /* the page's */
}
#staff {
  gap: 0;
  padding: var(--s1) var(--s4);
}
.people-head {
  display: none;
}
.people li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-areas:
    "avatar name more"
    "avatar meta more"
    "avatar roles more";
  align-items: center;
  gap: 2px var(--s3);
  padding: 14px 0;
}
.people li + li {
  border-top: 1px solid var(--line);
}
.people .avatar {
  grid-area: avatar;
  align-self: start;
  width: 40px;
  height: 40px;
}
.people strong {
  grid-area: name;
  font-weight: 600;
}
/* "@ana · Agora", wrapping after the username when it's long */
.people .meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  column-gap: 6px;
  font-size: var(--t-sm);
}
.people .username {
  color: var(--muted);
}
.people .seen {
  color: var(--text-2);
}
.people .seen::before {
  content: "· ";
  color: var(--muted);
}
.people .row {
  grid-area: roles;
  gap: 6px;
  margin-top: var(--s1);
}
.people .menu {
  grid-area: more;
  align-self: start;
}
.people .inactive :is(strong, .seen) {
  color: var(--faint);
}
.people .inactive .avatar {
  opacity: 0.5;
}
.roles {
  display: block;
  padding: var(--s4);
}
.roles > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--s3);
  list-style: none;
  cursor: pointer;
}
.roles > summary::-webkit-details-marker,
.role-help > summary::-webkit-details-marker {
  display: none;
}
.roles h3 {
  font-size: var(--t-md);
  font-weight: 700;
}
.roles small {
  font-size: var(--t-help);
}
.roles > summary > * {
  grid-column: 1;
}
.roles > summary .i {
  grid-area: 1 / 2 / 3;
}
:is(.roles, .role-help)[open] > summary .i {
  rotate: 180deg;
}
.role-guide {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin: var(--s3) 0 0;
}
.role-guide dd {
  margin: 0 0 var(--s2);
  color: var(--text-2);
  font-size: var(--t-sm);
}
/* Novo usuário and Editar: the roles as chips that light up in the brand color, with a ✓ */
.user-form > p.muted {
  font-size: var(--t-sm);
}
.form input:disabled {
  background: var(--fill);
  color: var(--muted);
}
.form .field {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  font-size: var(--t-sm);
  font-weight: 600;
}
.field legend {
  font-size: var(--t-sm);
  font-weight: 600;
}
.form .choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: var(--t-button);
  font-weight: 500;
  cursor: pointer;
}
.choice .i {
  display: none;
}
.choice:has(:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-text);
  font-weight: 600;
}
.choice:has(:checked) .i {
  display: block;
}
.choice:has(:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.generated input {
  padding-right: 84px;
}
.generated button {
  color: var(--brand-text);
  font-weight: 700;
}
.role-help > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  color: var(--brand-text);
  font-size: var(--t-sm);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
/* Redefinir senha: shown once, in a font where l and 1 don't look alike; a tap selects it all */
.new-password {
  display: block;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: var(--fill);
  font: 700 var(--t-xl) / 1.3 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.05em;
  text-align: center;
  user-select: all;
}
@media (min-width: 600px) {
  dialog:has(.user-form) {
    width: min(520px, calc(100% - 2rem));
  }
}
@media (min-width: 900px) {
  .team {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
  #staff {
    padding: 0 var(--s5) var(--s1);
  }
  .people-head,
  .people li {
    display: grid;
    grid-template-columns: 40px minmax(0, 5fr) minmax(0, 8fr) 11rem 36px;
    column-gap: var(--s3);
  }
  .people-head {
    align-items: center;
    min-height: 44px;
    color: var(--muted);
    font-size: var(--t-xs);
    font-weight: 600;
    text-transform: uppercase;
  }
  .people-head > :first-child {
    grid-column: 1 / 3;
  }
  .people li {
    grid-template-areas:
      "avatar name roles seen more"
      "avatar user roles seen more";
    min-height: 65px;
    padding: var(--s3) 0;
    border-top: 1px solid var(--line);
  }
  .people .avatar,
  .people .menu {
    align-self: center;
  }
  .people .meta {
    display: contents;
  }
  .people .username {
    grid-area: user;
  }
  .people .seen {
    grid-area: seen;
    color: var(--text);
    font-size: var(--t-button);
  }
  .people .seen::before {
    content: none;
  }
  .people .row {
    margin: 0;
  }
  .people .menu > summary {
    width: 36px;
    height: 36px;
  }
  .roles {
    padding: var(--s5) 22px;
  }
  .roles h3 {
    font-size: var(--t-h3);
  }
  /* Always open beside the list. A browser without ::details-content keeps it folded, still a tap away. */
  @supports selector(::details-content) {
    .roles::details-content {
      content-visibility: visible;
    }
    .roles > summary {
      pointer-events: none;
    }
    .roles > summary .i {
      display: none;
    }
  }
  .role-help {
    display: none;
  }
}

.preview {
  display: block;
  max-width: 12rem;
  max-height: 8rem;
  object-fit: contain;
  border-radius: var(--r-md);
}
.form {
  display: grid;
  gap: var(--s4);
}
.form label {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* a long <option> doesn't widen the field past the card */
  gap: 6px;
  font-size: var(--t-sm);
  font-weight: 600;
}

/* Resumo (plano-novo-layout 3.9, Penpot "Painel · Resumo", "… período (7 dias)" and "… escolher período"). One markup: on a
   phone the cards stack and the other numbers share a card; from 900px four number cards, then two rows of two cards. */
.summary {
  padding-bottom: var(--s6);
}
.period {
  display: grid;
  grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap);
  gap: var(--s2);
}
.period-title {
  gap: var(--s2);
  min-width: 0;
  padding: 0 var(--s2);
  font-size: var(--t-md);
  font-weight: 700;
}
.period-title span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* The chips run to the screen's edges */
.periods {
  grid-column: 1 / -1;
  margin: var(--s1) calc(-1 * var(--s4)) 0;
  padding: 0 var(--s4);
}
.periods .chip {
  min-height: var(--tap);
  padding: 0 var(--s4);
}
/* The date button: in the summary from 900px, in Comentários always */
.date-button {
  display: inline-flex;
  gap: var(--s2);
  min-width: 163px;
  padding: 0 14px;
  color: var(--text);
}
.period .date-button {
  display: none;
}
.rise {
  color: var(--green-text);
}
.fall {
  color: var(--red-text);
}

.totals {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s3);
}
.revenue {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: var(--s4);
  border-radius: var(--r-xl);
  background: var(--ink);
  color: var(--on-ink);
}
.revenue > span,
.revenue small {
  color: color-mix(in srgb, var(--on-ink) 82%, transparent);
}
.revenue > span {
  font-size: var(--t-sm);
  font-weight: 600;
}
.revenue strong {
  font-size: var(--t-2xl);
  font-weight: 800;
  line-height: 1.3;
}
.revenue small {
  font-size: var(--t-xs);
  font-weight: 500;
}
.revenue .rise {
  color: var(--green-on-ink);
}
.revenue .fall {
  color: var(--red-on-ink);
}
/* Opens Comentários with the low grades; the one under Faturamento on a phone ends in › */
.summary .low {
  align-items: center;
  padding: var(--s3);
  text-decoration: none;
}
.summary .low .i ~ .i {
  margin-left: auto;
}
.kpis {
  display: grid;
  padding: var(--s1) var(--s4);
  border-radius: var(--r-xl);
  background: var(--surface);
}
.kpi {
  display: grid;
  grid-template: "label value" auto "note value" auto / minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px var(--s3);
  padding: var(--s3) 0;
}
.kpi + .kpi {
  border-top: 1px solid var(--line);
}
.kpi > span {
  grid-area: label;
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 600;
}
.kpi strong {
  grid-area: value;
  font-size: var(--t-xl);
  font-weight: 800;
}
.kpi small {
  grid-area: note;
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 500;
}

/* On a phone the rows are just the page's cards */
.summary-row {
  display: contents;
}
.summary .section {
  align-content: start;
  padding: var(--s4);
}
.summary hgroup {
  display: grid;
  gap: 2px;
}
.summary h2 {
  font-size: var(--t-h3);
  font-weight: 700;
}
.summary hgroup p {
  color: var(--muted);
  font-size: var(--t-help);
  font-weight: 500;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
}
/* Por dia / Por hora */
.toggle {
  flex-basis: 100%;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--fill);
}
.toggle a {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.toggle a[aria-current] {
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* Movimento: a bar per hour or day, its height by --h (0 to 1). The peak is solid with its value on top. */
.bars,
.top-items ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: var(--s1);
  height: 196px;
  contain: inline-size; /* takes the card's width: 13 hours' labels, hidden ones too, would widen the card past a phone */
}
.bars li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  height: 100%;
}
.bar {
  align-self: stretch;
  height: max(3px, calc(var(--h) * 150px));
  border-radius: 4px;
  background: color-mix(in srgb, var(--brand) 35%, transparent);
}
.zero .bar {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.peak .bar {
  background: var(--brand);
}
.bars .value,
.bars .label {
  font-size: var(--t-xs);
  white-space: nowrap;
}
.bars .value {
  color: var(--brand-text);
  font-weight: 700;
}
.zero .value {
  color: var(--faint);
  font-weight: 500;
}
.bars .label {
  color: var(--muted);
  font-weight: 500;
}
.peak .label {
  color: var(--text);
  font-weight: 700;
}
.bars .minor {
  visibility: hidden;
}
.highlights {
  display: grid;
  gap: var(--s2);
  margin: 0;
}
.highlights div {
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
}
.highlights dt {
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 500;
}
.highlights dd {
  margin: 0;
  font-weight: 700;
  text-align: end;
}

/* Itens mais pedidos: the bar under each item, by quantity against the first */
.top-items ol {
  display: grid;
  gap: var(--s5);
}
.top-items li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px var(--s2);
}
.top-items li::after {
  content: "";
  grid-column: 1 / -1;
  height: 6px;
  border-radius: var(--r-full);
  background: linear-gradient(to right, var(--brand) calc(var(--w) * 100%), var(--fill) 0);
}
.top-items .name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 500;
}
.top-items .money {
  font-size: var(--t-help);
}

/* Avaliação dos clientes: the grade, its stars (whole ones lit) and a bar per score out of 5 */
.ratings {
  display: flex;
  flex-direction: column;
}
.overall {
  display: flex;
  align-items: center;
  gap: 14px;
}
.overall > strong {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.3;
}
.overall small {
  display: block;
  margin-top: var(--s1);
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 500;
}
.rating {
  display: flex;
  gap: 3px;
  color: var(--amber);
}
.rating span {
  display: flex;
  opacity: 0.3;
}
.rating .on {
  opacity: 1;
}
.rating .i,
.grade .i {
  fill: currentColor;
}
.scores {
  display: grid;
  gap: var(--s3);
  margin: 0;
}
.scores div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: var(--s3);
}
.scores div::before {
  content: "";
  grid-area: 1 / 2;
  height: 10px;
  border-radius: var(--r-full);
  background: linear-gradient(to right, var(--amber) calc(var(--w) * 100%), var(--fill) 0);
}
.scores dt {
  grid-area: 1 / 1;
  font-size: var(--t-button);
  font-weight: 500;
}
.scores dd {
  grid-area: 1 / 3;
  margin: 0;
  font-size: var(--t-button);
  font-weight: 700;
  text-align: end;
}

/* Comentários: the 3 latest on a phone, 4 from 900px */
.comments {
  gap: 0;
}
.comments hgroup {
  padding-bottom: var(--s3);
}
.comments li {
  display: grid;
  grid-template: "grade table" "text text" "scores scores" / auto minmax(0, 1fr);
  align-items: center;
  gap: 6px var(--s2);
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
}
.comments li:nth-child(4) {
  display: none;
}
.see-all {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  margin: -12px 0; /* a 44px touch target that doesn't push the title */
  color: var(--brand-text);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.grade {
  grid-area: grade;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 3px var(--s2) 3px 6px;
  border-radius: var(--r-full);
  font-size: var(--t-help);
  font-weight: 700;
}
.comments li strong {
  grid-area: table;
  font-size: var(--t-help);
  font-weight: 600;
}
.comments li p {
  grid-area: text;
}
.comments li small {
  grid-area: scores;
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 500;
}

/* Escolher período: a sheet on a phone; from 900px a dropdown under the date button, shortcuts on the left */
.picker {
  display: grid;
  gap: var(--s4);
}
.shortcuts {
  display: flex;
  gap: var(--s2);
  margin: 0 calc(-1 * var(--s4));
  padding: 0 var(--s4);
  overflow-x: auto;
  scrollbar-width: none;
}
.shortcuts .chip {
  min-height: var(--tap);
  padding: 0 var(--s4);
  font-weight: 500;
}
.calendar {
  display: grid;
  gap: 10px;
}
.calendar header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.calendar header button {
  color: var(--text);
}
.calendar h3 {
  font-size: var(--t-md);
  font-weight: 700;
}
.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.weekday {
  display: grid;
  place-items: center;
  height: 24px;
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 600;
}
.day {
  display: grid;
  place-items: center;
  min-height: var(--tap);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-size: var(--t-sm);
  font-weight: 500;
}
span.day {
  color: var(--line-strong);
}
.day[aria-current] {
  border-color: var(--ink);
}
.day.inside {
  background: var(--brand-soft);
  color: var(--brand-text);
}
.day.edge {
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}
.picker footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}
.picker footer p {
  grid-column: 1 / -1;
  display: grid;
  gap: 1px;
}
.picker footer strong {
  font-size: var(--t-sm);
}
.picker footer small {
  color: var(--muted);
  font-size: var(--t-xs);
  font-weight: 500;
}
.picker footer :is(button, .button) {
  min-height: 48px;
}

@media (min-width: 900px) {
  .summary {
    gap: var(--s5);
  }
  .summary .narrow-only {
    display: none;
  }
  .period {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .period-title {
    padding: 0 var(--s1);
    border: 0;
    background: transparent;
    font-size: var(--t-xl);
    font-weight: 800;
  }
  .period-title .i {
    display: none;
  }
  /* The chips become a segmented control */
  .periods {
    gap: 2px;
    margin: 0 0 0 auto;
    padding: 3px;
    border-radius: var(--r-md);
    background: var(--line);
  }
  .periods .chip {
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--muted);
    font-weight: 500;
  }
  .periods .chip[aria-current] {
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    box-shadow: var(--shadow);
  }
  .period .date-button {
    display: inline-flex;
  }
  .totals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s4);
  }
  .kpis {
    display: contents;
  }
  .revenue,
  .kpi {
    align-content: center;
    min-height: 132px;
    padding: 22px;
    border-radius: var(--r-xl);
  }
  .kpi {
    grid-template: "label" "value" "note" / minmax(0, 1fr);
    gap: 6px;
    background: var(--surface);
  }
  .kpi + .kpi {
    border-top: 0;
  }
  .kpi strong {
    font-size: 1.875rem;
    line-height: 1.3;
  }
  .revenue strong {
    font-size: 2.125rem;
  }
  .kpi small,
  .revenue small {
    font-size: var(--t-help);
  }
  .summary-row {
    display: grid;
    grid-template-columns: minmax(0, 784fr) minmax(0, 440fr);
    gap: var(--s4);
  }
  .reviews-row {
    grid-template-columns: minmax(0, 440fr) minmax(0, 784fr);
  }
  .summary .section {
    padding: 22px var(--s6) var(--s6);
  }
  .toggle {
    flex-basis: auto;
    border-radius: var(--r-sm);
  }
  .toggle a {
    min-height: 30px;
    border-radius: 6px;
    font-size: var(--t-help);
  }
  .bars {
    gap: var(--s2);
  }
  .bars:not([data-dense]) .minor {
    visibility: visible;
  }
  .highlights {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s5) var(--s7);
  }
  .highlights div {
    display: grid;
    gap: 2px;
  }
  .highlights dt {
    font-size: var(--t-xs);
    font-weight: 600;
  }
  .highlights dd {
    font-size: var(--t-button);
    text-align: start;
  }
  .top-items .name,
  .top-items strong {
    font-size: var(--t-button);
  }
  .ratings .low {
    margin-top: auto;
  }
  .comments li {
    grid-template: "grade table scores" "text text text" / auto minmax(0, 1fr) auto;
    column-gap: 10px;
    padding: 14px 0;
  }
  .comments li:first-child {
    border-top: 0;
  }
  .comments li:nth-child(4) {
    display: grid;
  }
  .comments li p {
    font-size: var(--t-button);
    font-weight: 500;
  }
  #period {
    width: 620px;
    margin: 135px var(--s5) auto auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop);
  }
  #period::backdrop {
    background: transparent;
  }
  .picker {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 0;
  }
  .picker .sheet-head {
    display: none;
  }
  .shortcuts {
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: var(--s3) var(--s2);
    border-right: 1px solid var(--line);
    background: var(--bg);
  }
  .shortcuts .chip {
    justify-content: flex-start;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    font-size: var(--t-sm);
  }
  .shortcuts .chip:hover {
    background: var(--fill);
    filter: none;
  }
  .calendar {
    align-content: start;
    padding: var(--s4) var(--s5);
  }
  .calendar header button {
    width: 28px;
    min-height: 28px;
  }
  .calendar h3 {
    font-size: var(--t-button);
  }
  .picker footer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--s3) var(--s4);
  }
  .picker footer p {
    margin-right: auto;
  }
  .picker footer :is(button, .button) {
    min-height: var(--tap);
    padding: 0 18px;
    font-weight: 700;
  }
}

/* Comentários (plano-novo-layout 3.10, Penpot "Painel · Comentários dos clientes"): on a phone the filters run to the screen's
   edges with Ordenar under them; from 900px the title heads the page with the date on its right, and each card has its grade
   on the left and "Ver pedidos" on the right. A low grade gets a red border. The head (.sub-head) is Planos' too. */
.sub-head {
  display: grid;
  justify-items: start;
  gap: var(--s3);
}
.sub-head hgroup {
  display: grid;
  gap: var(--s1);
}
.sub-head p {
  color: var(--muted);
  font-size: var(--t-sm);
  font-weight: 500;
}
.sub-head .back {
  color: var(--brand-text);
  font-size: var(--t-sm);
}
.review-tools {
  display: grid;
  gap: var(--s1);
}
.filters {
  margin: 0 calc(-1 * var(--s4));
  padding: 0 var(--s4);
}
.filters .chip {
  min-height: var(--tap);
}
.filters .chip:not(:first-child)::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.filters .low::before {
  background: var(--red-text);
}
.filters .mid::before {
  background: var(--amber);
}
.filters .good::before {
  background: var(--green);
}
.filters small {
  color: var(--muted);
  font-size: var(--t-help);
}
.filters [aria-current] small {
  color: inherit;
  opacity: 0.7;
}
.sort {
  justify-self: end;
}
.sort > summary {
  width: auto;
  gap: 6px;
  padding: 0 var(--s1);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--t-help);
  font-weight: 600;
}
.sort b {
  color: var(--text);
  font-size: var(--t-sm);
  font-weight: 600;
}
.sort [aria-current] {
  font-weight: 700;
}
.sort [aria-current] .i {
  margin-left: auto;
}
.review-list {
  display: grid;
  gap: var(--s3);
}
.review-list li {
  display: grid;
  grid-template: "grade table" "text text" "scores scores" "link link" / auto minmax(0, 1fr);
  align-items: center;
  gap: var(--s2) var(--s3);
  padding: var(--s4) var(--s4) var(--s1);
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surface);
}
.review-list .low {
  border-color: var(--red-line);
}
.review-list .grade {
  justify-content: center;
  min-width: 76px;
  min-height: 37px;
  border-radius: var(--r-md);
  font-size: var(--t-md);
  font-weight: 800;
}
.review-list .grade .i {
  width: 16px;
  height: 16px;
}
.review-list strong {
  grid-area: table;
  font-size: var(--t-sm);
  font-weight: 700;
}
.review-list p {
  grid-area: text;
  font-weight: 500;
}
.review-list small {
  grid-area: scores;
  color: var(--muted);
  font-size: var(--t-help);
  font-weight: 500;
}
.review-list a {
  grid-area: link;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: var(--tap);
  color: var(--brand-text);
  font-size: var(--t-sm);
  font-weight: 600;
  text-decoration: none;
}
.footnote {
  color: var(--muted);
  font-size: var(--t-help);
  font-weight: 500;
}
@media (min-width: 900px) {
  .sub-head {
    display: flex;
    align-items: flex-end;
  }
  .sub-head hgroup {
    flex: 1;
  }
  .sub-head h2 {
    font-size: var(--t-title);
    font-weight: 800;
  }
  .reviews ~ #period {
    margin-top: 172px; /* under its date button */
  }
  .review-tools {
    display: flex;
    align-items: center;
    gap: var(--s2);
  }
  .filters {
    margin: 0;
    padding: 0;
  }
  .filters .chip {
    min-height: 38px;
  }
  .sort {
    margin-left: auto;
  }
  .review-list {
    gap: 10px;
  }
  .review-list li {
    grid-template: "grade table scores link" "grade text text text" / auto auto minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: var(--s4) var(--s5);
  }
  .review-list .grade {
    align-self: start;
    margin-right: 6px;
  }
  .review-list a {
    min-height: 0;
  }
}

/* A sub-screen's ‹ (Panel's `back`): on a phone it takes the logo's place in the top bar; from 900px the content has the link */
.up {
  color: var(--text);
}
.appbar:has(.up) {
  padding-left: var(--s1);
}
@media (max-width: 899px) {
  .appbar:has(.up) .logo {
    display: none;
  }
}

/* A bar fixed above the tab bar: the table detail's main action on a phone, Lançar pedido's total */
.action-bar {
  position: fixed;
  inset: auto 0 var(--tabbar);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s2) var(--s4) var(--s3);
  background: var(--bg);
  box-shadow: var(--shadow-up);
}
.action-bar > :is(button, .button) {
  min-height: 52px;
  border-radius: var(--r-lg);
  font-size: var(--t-md);
  font-weight: 700;
}
.panel:has(.action-bar:not([hidden])) {
  padding-bottom: calc(var(--tabbar) + 72px);
}

/* A table's state, on its card, its count and the detail's number: free is empty, waiting for a waiter to take it light amber,
   occupied light blue, calling full amber, asking for the bill full purple; blocked is free with a lock */
.state-free,
.state-blocked {
  background: var(--surface);
  color: var(--faint);
}
.state-waiting {
  background: var(--amber-soft);
  color: var(--amber-text);
}
.state-occupied {
  background: var(--blue-soft);
  color: var(--blue-text);
}
.state-calling {
  background: var(--amber);
  color: var(--on-amber);
}
.state-bill {
  background: var(--purple);
  color: var(--on-purple);
}

/* Table map (plano-novo-layout 4.3, Penpot "Painel · Mapa de mesas"): the counts on top, then a card per table by its number */
.map {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--s3);
  padding: var(--s4);
}
.map > .chips {
  margin-right: calc(-1 * var(--s4));
}
.counts .chip {
  gap: var(--s2);
  min-height: 40px;
  padding: 0 14px 0 6px;
  font-size: var(--t-button);
}
.counts b {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: var(--r-full);
  font-size: var(--t-sm);
  font-weight: 800;
}
.counts .state-free {
  border: 1px dashed var(--line-strong);
  background: var(--fill);
  color: var(--muted);
}
.tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: var(--s2);
}
.table-card {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  min-height: 148px;
  padding: var(--s3);
  border-radius: var(--r-xl);
  font-size: var(--t-help);
  text-decoration: none;
}
.table-card .top {
  display: flex;
  align-items: flex-start;
  gap: var(--s1);
  margin-bottom: auto;
}
.table-card strong {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--t-2xl);
  font-weight: 800;
  line-height: 1.1;
}
.table-card .label {
  font-size: var(--t-sm);
  font-weight: 700;
}
.table-card .meta {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}
.table-card.state-free,
.table-card.state-blocked {
  border: 2px dashed var(--line-strong);
}
.table-card:is(.state-free, .state-blocked) .label {
  color: var(--muted);
}
.table-card.state-waiting {
  border: 2px dashed var(--amber);
}
.table-card.state-occupied {
  border: 1px solid var(--blue-line);
}
.table-card .waiter {
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-card.state-calling {
  border: 3px solid var(--amber-text);
}
.table-card.state-bill {
  border: 3px solid var(--purple-line);
}

/* Table detail (plano-novo-layout 4.4, Penpot "Painel · Detalhe da mesa"): the table with its ⋯ and main action, then its
   orders and bill, side by side from 900px */
.table-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: var(--s3);
  max-width: 80rem;
  margin: 0 auto;
  padding: var(--s4);
}
.table-detail .section {
  gap: 0;
  padding: var(--s2) var(--s4);
}
.table-detail .columns > :last-child {
  padding-bottom: var(--s5);
}
.table-detail h2 {
  font-size: var(--t-h3);
  font-weight: 700;
}
.table-detail .section > h2,
.table-detail .section > header {
  display: flex;
  align-items: center;
  min-height: 52px;
}
.table-detail .table-head {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4) var(--s3) var(--s4) var(--s4);
}
.table-head .row {
  gap: var(--s1) 10px;
}
.table-head h2 {
  font-size: var(--t-xl);
  font-weight: 800;
}
.table-head .muted {
  margin-top: 6px;
  font-size: var(--t-sm);
}
.table-head > .menu > summary {
  border-radius: var(--r-lg);
}
.table-head .action-bar > * {
  flex: 1;
}
.table-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 14px;
  font-size: var(--t-2xl);
  font-weight: 800;
}
.table-num:is(.state-free, .state-blocked) {
  background: var(--fill);
  color: var(--muted);
}
button.call {
  background: var(--amber);
  color: var(--on-amber);
}
.table-detail .columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--s3);
}
.table-orders > li {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.table-orders > li > :first-child {
  display: grid;
  gap: 6px;
}
.table-orders .row {
  gap: 10px;
}
.table-orders .row .muted {
  font-size: var(--t-sm);
  font-weight: 600;
}
.table-orders .done {
  opacity: 0.7;
}
.closed .table-orders .done {
  opacity: 1; /* a closed table's orders are all done */
}

/* Fechar mesa (Penpot "Painel · Fechar mesa"): a receipt, in a tall sheet on a phone and a card in the middle from 600px */
.receipt {
  gap: var(--s3);
}
.receipt .sheet-head h2 {
  font-size: var(--t-xl);
  font-weight: 800;
}
.receipt .sheet-head + .muted {
  margin-top: calc(-1 * var(--s2));
  font-size: var(--t-sm);
}
.receipt .bill td {
  padding: 7px 0;
}
.receipt .bill tfoot tr:first-child > * {
  border-top-style: dashed;
}
/* "Cliente pagou a taxa de serviço": off, the fee is struck out and the total goes without it */
.receipt .fee-paid {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: var(--t-sm);
  font-weight: 600;
}
.fee-paid .muted {
  white-space: nowrap;
}
.unpaid-fee,
.receipt:has([name="serviceFeePaid"]:not(:checked)) .total .money:not(.unpaid-fee) {
  display: none;
}
.receipt:has([name="serviceFeePaid"]:not(:checked)) .total .unpaid-fee {
  display: inline;
}
.receipt:has([name="serviceFeePaid"]:not(:checked)) .bill .fee,
.unpaid .bill .fee {
  color: var(--faint);
  text-decoration: line-through;
}
.receipt .bill .total .money {
  font-size: 1.875rem;
}
button.paid {
  min-height: 54px;
  border-radius: var(--r-lg);
  background: var(--green);
  color: var(--on-state);
  font-size: var(--t-md);
  font-weight: 700;
}
.paid + .muted {
  font-size: var(--t-help);
  text-align: center;
}
button.link {
  background: transparent;
  color: var(--link);
}

/* Lançar pedido (proposta 5.6): the menu, compact, with − 0 + per item and the order's total in the bar at the bottom */
.staff-order {
  display: grid;
  gap: var(--s4);
  max-width: 48rem;
  margin: 0 auto;
  padding: var(--s4);
}
.staff-order > h2 {
  font-size: var(--t-xl);
  font-weight: 800;
}
#staff-order {
  display: grid;
  gap: var(--s5);
}
#staff-order section {
  display: grid;
  gap: var(--s2);
}
#staff-order h3 {
  font-size: var(--t-h3);
  font-weight: 700;
}
#staff-order ul {
  border-radius: var(--r-lg);
  background: var(--surface);
}
.pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s2) var(--s3);
  min-height: 60px;
  padding: var(--s2) 14px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}
.pick:first-child {
  border-top: 0;
}
.pick small {
  display: block;
  font-size: var(--t-sm);
  font-weight: 500;
}
.pick [name="notes"] {
  grid-column: 1 / -1;
}
.pick .stepper button {
  width: var(--tap);
  min-height: var(--tap);
}
.stepper input {
  width: var(--tap);
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}
.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button,
.amount input::-webkit-inner-spin-button,
.amount input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
#order-sum {
  font-weight: 700;
}

@media (min-width: 900px) {
  .up {
    display: none;
  }
  .appbar:has(.up) {
    padding-left: var(--s5);
  }
  .action-bar {
    bottom: 0;
    padding: var(--s3) var(--s5);
  }
  .panel:has(.action-bar:not([hidden])) {
    padding-bottom: 76px;
  }

  .map {
    gap: 18px;
    padding: var(--s5);
  }
  .map > .chips {
    margin-right: 0;
  }
  .tables {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
  }
  .table-card {
    min-height: 140px;
    padding: 14px;
  }
  .table-card strong {
    font-size: 2.375rem;
  }
  .table-card .meta {
    flex-flow: row wrap;
    justify-content: space-between;
    column-gap: var(--s1);
  }

  .table-detail {
    gap: var(--s4);
    padding: var(--s5);
  }
  .table-detail .section {
    padding: var(--s2) var(--s5);
  }
  .table-detail .table-head {
    min-height: 88px;
    padding: var(--s3) var(--s6);
  }
  .table-num {
    width: 64px;
    height: 64px;
  }
  .table-head > .menu > summary {
    width: 48px;
    height: 48px;
  }
  /* The main action goes back into the table's header */
  .table-head .action-bar {
    position: static;
    padding: 0;
    background: none;
    box-shadow: none;
  }
  .table-head .action-bar > :is(button, .button) {
    min-height: 48px;
    padding: 0 22px;
  }
  .panel:has(:is(.table-head, .page-head) .action-bar) {
    padding-bottom: 0;
  }
  .table-detail .columns {
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: var(--s4);
  }
  .table-orders > li {
    display: flex;
    align-items: center;
    gap: var(--s4);
  }
  .table-orders > li > :first-child {
    flex: 1;
  }

  .staff-order {
    padding: var(--s5);
  }
}

/* QR codes for printing (RF-A06) */
.print-bar {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s4);
}
.qr-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8cm, 1fr));
  gap: 1cm;
  padding: 1cm;
}
.qr-card {
  display: grid;
  justify-items: center;
  gap: 0.4cm;
  padding: 0.8cm;
  border: 1px dashed #a8a29e; /* cutting guide, on paper */
  background: #fff;
  color: #1c1917;
  text-align: center;
  break-inside: avoid;
}
.qr-card h2 {
  font-size: 26pt;
}
.qr-card svg {
  width: 6cm;
  height: 6cm;
}
@media print {
  .no-print {
    display: none;
  }
  body {
    background: #fff;
  }
  .qr-sheet {
    padding: 0;
  }
}
