:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ink: #0a0a0a;
  --ink-soft: #1f2937;
  --muted: #4b5563;
  --cream: #ffffff;
  --paper: #ffffff;
  --track: #f3f4f6;
  --line: #e5e7eb;
  --saffron: #c8102e;
  --saffron-dark: #a10d25;
  --saffron-soft: #fdecee;
  --green: #16a34a;
  --green-deep: #15803d;
  --green-soft: #dcfce7;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --blue: #2f6fed;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --font: "Inter", "Segoe UI", sans-serif;
  --display: "Inter", "Segoe UI", sans-serif;
  --radius: 0px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
/* Shared click. Press eases to 0.96 in 100ms; release springs back. Square corners stay. */
.click, button, .btn, [role="button"], summary, a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transform-origin: center;
  transition: transform 140ms cubic-bezier(0.22, 1.45, 0.36, 1), filter 120ms ease-out, box-shadow 120ms ease-out, background-color 80ms linear, color 80ms linear, border-color 80ms linear, opacity 80ms linear;
}
.click:active, button:active:not(:disabled), .btn:active:not(:disabled), [role="button"]:active, summary:active, a:active {
  transform: scale(0.96);
  filter: brightness(0.93);
  box-shadow: inset 0 2px 0 rgba(17, 24, 39, 0.16);
  transition: transform 100ms ease-out, filter 100ms ease-out, box-shadow 100ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .click, button, .btn, [role="button"], summary, a { transition: none; }
  .click:active, button:active:not(:disabled), .btn:active:not(:disabled), [role="button"]:active, summary:active, a:active {
    transform: none;
    transition: none;
  }
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 120ms; }
.tap-spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: tap-spin 0.6s linear infinite;
}
@keyframes tap-spin { to { transform: rotate(360deg); } }
.tap-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 24px;
  z-index: 80;
  margin: 0 auto;
  max-width: 420px;
  background: #111827;
  color: white;
  padding: 12px 14px;
  font-weight: 600;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 22px;
  background: var(--ink);
  color: white;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.03em; }
.mark {
  width: 32px; height: 28px; object-fit: contain; display: block;
}
.brand img.mark { background: transparent; }
.word { font-size: 20px; }
.loc-name { color: #d9d0c7; font-size: 14px; }
.top-spacer { flex: 1; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 6px 10px;
  background: #2a221c; color: #efe8e1; font-size: 13px; font-weight: 600;
}
.pill.ok { background: #e7f8ee; color: #0f7a34; }
.pill.warn { background: #fff4d8; color: #8a5a00; }
.pill.live { background: #e7f8ee; color: #0f7a34; }
.dot { width: 8px; height: 8px; border-radius: 99px; background: currentColor; display: inline-block; }

.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
h1 { font-size: 32px; letter-spacing: -0.04em; margin: 0; font-weight: 700; line-height: 1.15; }
h2 { font-size: 20px; letter-spacing: -0.02em; margin: 0 0 8px; font-weight: 700; line-height: 1.25; }
.sub { color: var(--muted); margin: 6px 0 0; font-size: 16px; line-height: 1.45; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn {
  border: 0; border-radius: var(--radius); padding: 12px 16px; font-weight: 650;
  background: var(--ink); color: white; min-height: 44px;
}
.btn.primary { background: var(--saffron); }
.btn.primary:hover { background: var(--saffron-dark); }
.btn.ghost { background: white; color: var(--ink); border: 1px solid var(--line); }
.btn.green { background: #1faf55; color: white; width: 100%; padding: 16px; font-size: 18px; border-radius: 0; }
.btn.green:hover { background: var(--green-deep); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.small { padding: 8px 12px; border-radius: 0; font-size: 14px; min-height: 44px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.card, .panel {
  background: var(--paper);
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: none;
}
.card { padding: 24px; }
.menu-block { margin-bottom: 22px; }
.menu-block h2 { font-size: 18px; margin: 0 0 10px; }
.dishes { display: grid; gap: 10px; }
.dish {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 16px;
  padding: 14px 16px; background: white; border-radius: 16px; box-shadow: var(--shadow);
}
.dish h3 { margin: 0; font-size: 16px; }
.dish p { margin: 4px 0 0; color: var(--muted); font-size: 14px; grid-column: 1; }
.price { font-weight: 700; }
.allergens { color: var(--danger); font-size: 12px; font-weight: 650; }
.soldout { opacity: 0.55; }

.cart { padding: 16px; }
.cart h2 { margin: 0 0 8px; font-size: 18px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--track); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.seg button { flex: 1 1 96px; border: 0; background: transparent; border-radius:8px; padding: 8px; font-weight: 700; }
.seg button.on { background: white; color: var(--saffron); box-shadow: none; }
.line { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
button.line { width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.muted { color: var(--muted); }
.totals { margin: 8px 0 12px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-size: 18px; font-weight: 800; padding-top: 6px; }
label { display: block; font-size: 14px; font-weight: 650; margin: 12px 0 6px; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 12px;
}
textarea { min-height: 72px; resize: vertical; }
.pay { display: flex; gap: 8px; }
.pay button { flex: 1; }
.banner {
  background: #fff6d8; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px;
}
.banner.bad { background: #fde8ea; color: #8d2436; }
.error { color: var(--danger); font-size: 14px; min-height: 1.2em; }
.sheet {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.45);
  display: grid; place-items: end center; padding: 16px; z-index: 20;
}
.sheet .panel { width: min(480px, 100%); padding: 18px; border-radius: 20px 20px 16px 16px; margin-bottom: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chip {
  border: 1px solid var(--line); background: white; border-radius: 999px; padding: 8px 12px; font-weight: 650;
}
.chip.on { background: var(--ink); color: white; border-color: var(--ink); }
.success { text-align: center; padding: 40px 16px; }
.success h1 { font-family: var(--display); font-weight: 620; font-size: 42px; }
.status-live { font-size: 20px; margin-top: 8px; }

.desk-grid { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
.code-box {
  border: 1px solid var(--line); background: #fff; text-align: center;
  padding: 18px 8px 14px; margin: 10px 0 12px;
}
.code {
  font-size: 56px; letter-spacing: 0.22em; font-weight: 800; margin: 0; line-height: 1.1;
}
.code.placeholder { color: #c4bdb6; letter-spacing: 0.28em; }
.code-count { margin: 10px 0 0; font-weight: 650; }
.device { padding: 12px 0; border-bottom: 1px solid var(--line); }
.narrow { max-width: 420px; margin: 40px auto; padding: 22px; }

.sim-shell { min-height: 100vh; display: flex; flex-direction: column; }
.sim-main { flex: 1; padding: 18px 18px 88px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.column {
  background: #efeae4; border-radius: 18px; padding: 12px; min-height: 240px;
  display: flex; flex-direction: column; gap: 10px;
}
.col-head { display: flex; align-items: center; gap: 8px; font-weight: 750; padding: 4px 4px 8px; }
.col-head .count { margin-left: auto; color: var(--muted); font-weight: 650; }
.ord {
  background: white; border-radius: 16px; padding: 12px 12px 10px; box-shadow: var(--shadow); text-align: left; border: 2px solid transparent; width: 100%;
}
.ord.new { border-color: var(--saffron); }
.ord-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.num { font-weight: 800; }
.tag { border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 750; }
.tag.delivery { background: #e8f0ff; color: #2456c9; }
.tag.collection { background: #fff1d6; color: #9a6208; }
.who { font-weight: 700; margin: 6px 0 2px; }
.items-preview { color: var(--ink-soft); font-size: 13px; line-height: 1.35; min-height: 2.6em; }
.ord-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--muted); }
.ord-foot strong { color: var(--ink); }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; background: white;
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line); padding: 8px 8px max(10px, var(--safe-bottom));
}
body:has(.bottomnav) { padding-bottom: calc(64px + var(--safe-bottom)); }
.bottomnav a, .bottomnav span {
  text-align: center; text-decoration: none; font-size: 12px; color: var(--muted); font-weight: 650;
}
.bottomnav .on { color: var(--saffron); }
.col-tabs { display: none; gap: 8px; margin-bottom: 12px; }
.col-tabs button.on { background: var(--ink); color: white; }

.alert {
  position: fixed; inset: 0; z-index: 30;
  background: #111827;
  color: white; overflow: auto;
  display: flex; flex-direction: column; align-items: center; padding: 28px 16px 32px;
}
.bell-wrap { width: 116px; height: 116px; border-radius: 50%; background: rgba(255,255,255,0.2); display: grid; place-items: center; margin-top: 12px; }
.bell { width: 84px; height: 84px; border-radius: 50%; background: white; display: grid; place-items: center; font-size: 40px; }
.alert h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.04em; margin: 18px 0 6px; text-align: center; }
.alert .lead { font-size: 18px; text-align: center; margin: 0 0 16px; }
.ticket {
  width: min(560px, 100%);
  background: rgba(255,255,255,0.16);
  border-radius: 16px; padding: 14px 16px; line-height: 1.45;
}
.allergy {
  display: inline-block; background: #ffe14a; color: #3d2a00; font-weight: 800;
  border-radius: 8px; padding: 3px 8px; font-size: 13px; margin-top: 8px;
}
.accept-label { margin: 16px 0 8px; font-weight: 750; letter-spacing: 0.04em; font-size: 13px; }
.times { display: flex; gap: 8px; width: min(560px, 100%); }
.times button {
  flex: 1; border: 0; border-radius: 12px; padding: 14px 6px; font-weight: 800;
  background: rgba(255,255,255,0.2); color: white;
}
.times button.on { background: white; color: var(--saffron-dark); }
.alert .btn.green { width: min(560px, 100%); margin-top: 12px; }
.reject { width: min(560px, 100%); margin-top: 14px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reject button { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.7); border-radius: 999px; padding: 6px 10px; }
.ring-note { margin-top: 14px; font-size: 13px; opacity: 0.92; }

button, .btn, input, select, textarea, .card, .panel, dialog {
  border-radius: 0 !important;
}
.reject button, .times button { min-height: 44px; border-radius: 0 !important; }
a.avatar { text-decoration: none; color: inherit; }
.security-grid { display: grid; gap: 16px; max-width: 100%; }
.security-form, .security-form input, .security-form button, .security-form p { max-width: 100%; overflow-wrap: anywhere; }
.security-field { display: grid; gap: 6px; font-weight: 650; margin-top: 12px; }
.security-form input, .security-form button, .security-form .btn { width: 100%; min-height: 44px; }
.secret { font-family: ui-monospace, monospace; letter-spacing: 0.04em; overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .security-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (max-width: 980px) {
  .layout, .desk-grid { grid-template-columns: 1fr; }
  .cart { position: static; }
  .col-tabs { display: flex; }
  .board { display: block; }
  .column { display: none; }
  .column.on { display: flex; }
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  h1 { font-size: 28px; }
}

/* Platform billing */
.bill-top { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; margin: 8px 0 12px; }
.bill-top > div { display: flex; flex-direction: column; gap: 4px; }
.bill-name { font-size: 22px; }
.bill-pill { display: inline-block; width: fit-content; padding: 2px 10px; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: 13px; font-weight: 600; }
.bill-pill.ok { background: #effaf3; color: #106b35; }
.bill-pill.warn { background: #fff1f0; color: #9b1c1c; }
.bill-features { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 4px; }
.bill-actions, .bill-choose { display: flex; flex-wrap: wrap; gap: 8px; }
.bill-invoices { display: grid; gap: 6px; }
.bill-inv { display: grid; grid-template-columns: 1fr 1fr auto auto auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.bill-grid { display: grid; gap: 8px; }
.bill-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.bill-row select, .bill-row input { width: 100%; }
@media (max-width: 720px) {
  .bill-inv { grid-template-columns: 1fr auto; }
  .bill-row { grid-template-columns: 1fr 1fr; }
}

/* Buttons: small rounded corners (9px) everywhere, premium rectangle, not pill and not square. Grouped steppers keep joined inner edges. */
button:not(.sp-fab):not(.sp-icon):not(.basket-bar):not(.cz-qty > button):not(.cz-mstep > button):not([role="switch"]):not(.switch):not(.toggle),
.btn, a.btn, input[type="submit"], input[type="button"], .add-btn, .cz-place, .cz-done, .cat-chips button, .cat-side button, .pill-tabs button {
  border-radius:8px !important;
}
.cz-qty, .cz-mstep { border-radius:8px !important; overflow: hidden; }
.cz-qty > button, .cz-mstep > button { border-radius: 0 !important; }
.cz-no{font-size:12px;font-weight:700;color:#6b6b73;margin-left:6px}.cz-bignum{font-size:22px;font-weight:800;letter-spacing:.04em;margin:6px 0 0}

/* b3 D4 busy mode */
.busy-mode { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line, #e6e6e6); }
.busy-mode h3 { margin: 0 0 4px; font-size: 15px; color: #111; }
.busy-choices { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.team-panel{margin-top:18px;display:grid;gap:10px}
.team-panel h3{margin:8px 0 0;font-size:15px;color:#111}
.team-perms{display:grid;grid-template-columns:max-content 1fr;gap:6px 14px;margin:0;font-size:14px;color:#111}
.team-perms dt{font-weight:700}.team-perms dd{margin:0}
.team-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 0;border-top:1px solid #eee}
.team-who{flex:1 1 200px;display:flex;flex-direction:column}
.team-row select,.team-row .btn{min-height:44px}
.team-log{margin:0;padding-left:18px;font-size:14px;color:#111;display:grid;gap:4px}
