/*
 * Shared plain-CSS component classes for every lane. Uses logical properties
 * throughout (margin-inline, padding-inline, border-inline-start, inset-
 * inline-start, text-align: start/end) so [dir=rtl] mirrors automatically —
 * never add a physical left/right override in a lane's own stylesheet.
 * Depends on shared/tokens.css being loaded first.
 */

/* ---------- Back-office shell ------------------------------------------ */

.bx-shell {
  display: flex;
  block-size: 100vh;
  background: var(--page-bg);
  overflow: hidden;
}

.bx-sidebar {
  inline-size: var(--sidebar-w);
  flex: none;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: inset -1px 0 0 var(--hairline);
  overflow: hidden;
}

.bx-sidebar__brand {
  block-size: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 20px;
}

/* The brand symbol (decision #70) is an <img> with its own green box: no accent background behind it. */
.bx-sidebar__mark {
  inline-size: 30px;
  block-size: 30px;
  flex: none;
}

/* A class, not an inline style, so the collapsed rail can hide it. */
.bx-sidebar__brandtext { display: flex; flex-direction: column; line-height: 16px; min-inline-size: 0; flex: 1; }

.bx-sidebar__mark img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

.bx-sidebar__branch {
  margin: 4px 16px 12px;
  block-size: var(--control-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  background: var(--page-bg);
  font: 500 13px var(--font-sans);
  color: var(--ink-strong);
  cursor: pointer;
  width: calc(100% - 32px);
}

.bx-nav {
  flex: 1;
  padding-inline: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.bx-nav__divider {
  block-size: 1px;
  margin: 8px 10px;
  background: var(--hairline);
}

.bx-nav__label {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 6px 10px;
}

.bx-nav__item {
  block-size: var(--nav-item-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline: 10px;
  border-radius: var(--radius-control);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: start;
  width: 100%;
}

.bx-nav__item[aria-current='page'] {
  color: var(--accent-strong);
  font-weight: 600;
  background: var(--accent-tint);
}

.bx-nav__item svg {
  flex: none;
}

.bx-nav__badge {
  min-inline-size: 20px;
  block-size: 20px;
  padding-inline: 6px;
  border-radius: var(--radius-pill);
  background: var(--subtle);
  color: var(--ink);
  font-size: var(--text-2xs);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-start: auto;
}

.bx-sidebar__user {
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 var(--hairline);
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.bx-avatar {
  inline-size: 34px;
  block-size: 34px;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}

.bx-topbar {
  block-size: var(--topbar-h);
  flex: none;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 24px;
  box-shadow: inset 0 -1px 0 var(--hairline);
}

.bx-topbar__search {
  inline-size: 440px;
  max-inline-size: 45vw;
  block-size: var(--control-h);
  border-radius: var(--radius-pill);
  background: var(--subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-inline-start: 16px;
  padding-inline-end: 8px;
}

.bx-topbar__search input {
  flex: 1;
  border: 0;
  background: transparent;
  font: 400 14px var(--font-sans);
  color: var(--ink-strong);
  outline: none;
  min-inline-size: 0;
}

.bx-lang-toggle {
  display: flex;
  background: var(--subtle);
  border-radius: var(--radius-pill);
  padding: 2px;
  gap: 2px;
}

.bx-lang-toggle button {
  block-size: var(--control-h-sm);
  padding-inline: 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font: 600 12px var(--font-sans);
  color: var(--mute-text);
  cursor: pointer;
}

.bx-lang-toggle button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink-strong);
}

/* Language picker (shell.js langSwitcher). */
.bx-lang-select {
  block-size: var(--control-h-sm);
  padding-inline: 10px 26px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--subtle) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236B7280' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  font: 600 12px var(--font-sans);
  color: var(--ink-strong);
  cursor: pointer;
  appearance: none;
}
[dir='rtl'] .bx-lang-select {
  padding-inline: 10px 26px;
  background-position: left 10px center;
}
.bx-lang-select--dark {
  background-color: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
}
.bx-lang-select--dark option { color: var(--ink-strong); background: var(--surface); }
.bx-lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bx-main {
  flex: 1;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bx-content {
  flex: 1;
  min-block-size: 0;
  box-sizing: border-box;
  padding: var(--section-gap);
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
  overflow: auto;
}

.bx-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
}

.bx-pretitle {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.bx-h1 {
  margin: 4px 0 0;
  font-size: var(--text-lg);
  line-height: var(--text-lg-line);
  font-weight: 600;
  color: var(--ink-strong);
}

.bx-h2 {
  margin: 0;
  font-size: var(--text-md);
  line-height: var(--text-md-line);
  font-weight: 600;
  color: var(--ink-strong);
}

.bx-why {
  margin: 2px 0 0;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.bx-crumb {
  block-size: 26px;
  padding-inline: 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  color: var(--ink-muted);
}

.bx-crumb--accent {
  color: var(--accent-strong);
  background: var(--accent-tint);
}

/* ---------- Buttons ----------------------------------------------------- */

.btn {
  block-size: var(--control-h);
  padding-inline: 16px;
  border-radius: var(--radius-control);
  font: 600 14px var(--font-sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-sizing: border-box;
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--outline {
  background: var(--surface);
  color: var(--ink-strong);
  border-color: var(--control-border);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-strong);
  border-color: transparent;
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--sm {
  block-size: var(--control-h-sm);
  padding-inline: 10px;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.btn--lg {
  block-size: 48px;
  padding-inline: 20px;
  font-size: 16px;
}

.btn--icon {
  padding-inline: 0;
  inline-size: var(--control-h);
  border-radius: var(--radius-pill);
}

/* ---------- Inputs / selects --------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-muted);
}

.input,
.select {
  block-size: var(--control-h);
  padding-inline: 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  font: 400 14px var(--font-sans);
  color: var(--ink-strong);
  outline: none;
  box-sizing: border-box;
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

/* ---------- Cards -------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  box-sizing: border-box;
  overflow: hidden;
}

.card__body {
  padding: var(--card-pad-y) var(--card-pad-x);
}

/* KPI tile */
.kpi {
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.kpi__icon {
  inline-size: 48px;
  block-size: 48px;
  border-radius: var(--radius-card);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
}

.kpi__label {
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

.kpi__value {
  font-size: var(--text-lg);
  line-height: var(--text-lg-line);
  font-weight: 600;
  color: var(--ink-strong);
}

.kpi__sub {
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

/* ---------- Tables --------------------------------------------------------- */

.table {
  border-collapse: collapse;
  inline-size: 100%;
}

.table th {
  block-size: var(--table-header-h);
  box-sizing: border-box;
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: start;
  padding-inline: 12px;
  background: var(--page-bg);
  border-block-end: 1px solid var(--hairline);
  white-space: nowrap;
}

.table td {
  block-size: var(--table-row-h);
  box-sizing: border-box;
  padding-inline: 12px;
  border-block-end: 1px solid var(--hairline);
  font-size: var(--text-sm);
  vertical-align: middle;
}

.table th:first-child,
.table td:first-child {
  padding-inline-start: 20px;
}

.table th:last-child,
.table td:last-child {
  padding-inline-end: 20px;
}

.table .r {
  text-align: end;
}

/* ---------- Badges --------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  block-size: 22px;
  padding-inline: 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
}

.badge--ok { background: var(--success-tint); color: var(--success); }
.badge--warn { background: var(--warning-tint); color: var(--warning); }
.badge--bad { background: var(--danger-tint); color: var(--danger); }
.badge--acc { background: var(--accent-tint); color: var(--accent-strong); }
.badge--mute { background: var(--mute-tint); color: var(--mute-text); }

/* ---------- Tabs ------------------------------------------------------------ */

.tabs {
  display: flex;
  gap: 4px;
  border-block-end: 1px solid var(--hairline);
}

.tabs__item {
  block-size: 40px;
  padding-inline: 14px;
  border: 0;
  background: transparent;
  font: 500 14px var(--font-sans);
  color: var(--ink-muted);
  cursor: pointer;
  border-block-end: 2px solid transparent;
}

.tabs__item[aria-selected='true'] {
  color: var(--accent-strong);
  font-weight: 600;
  border-block-end-color: var(--accent);
}

/* ---------- Modal / drawer / toast ------------------------------------------ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  min-inline-size: 360px;
  max-inline-size: min(560px, 92vw);
  max-block-size: 86vh;
  overflow: auto;
}

.modal__header {
  padding: var(--card-pad-y) var(--card-pad-x);
  border-block-end: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__body {
  padding: var(--card-pad-y) var(--card-pad-x);
}

.modal__footer {
  padding: var(--card-pad-y) var(--card-pad-x);
  border-block-start: 1px solid var(--hairline);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  inline-size: min(420px, 92vw);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.toast-stack {
  font-family: var(--font-sans); /* it sits outside <body>, so it sets its own type */
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: var(--ink-strong);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-card);
  max-inline-size: 360px;
}

.toast--ok { background: var(--success); }
.toast--bad { background: var(--danger); }

/* ---------- Empty state ------------------------------------------------------ */

.empty {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  color: var(--ink-muted);
}

.empty__title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--ink-strong);
}

.empty__hint {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  max-inline-size: 40ch;
}

/* ============================================================ */
/* Till (full-screen, touch) — its own sizes per ui-shell-tokens */
/* ============================================================ */

.till {
  block-size: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
  overflow: hidden;
}

.till__status {
  block-size: 52px;
  flex: none;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent) 70%, color-mix(in srgb, var(--accent) 80%, #fff));
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-inline: 16px;
  font-size: 13px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 6px 16px -12px color-mix(in srgb, var(--accent) 80%, #000);
}
/* In the till bar: plain text is status; anything clickable is a clear pill button. */
.till__status .btn,
.till__status button,
.till__status a,
.till__status select {
  min-block-size: 32px;
  padding-inline: 12px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .34);
  color: #fff !important;
  font: 600 12.5px var(--font-sans);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color .12s ease;
}
.till__status .btn:hover,
.till__status button:hover,
.till__status a:hover,
.till__status select:hover { background-color: rgba(255, 255, 255, .28); }
.till__status :is(.btn, button, a, select):focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.till__status select option { color: var(--ink-strong); background: var(--surface); }
@media (prefers-reduced-motion: reduce) { .till__status :is(.btn, button, a, select) { transition: none; } }

/* ---------- Help bubble (kit.js help()) ------------------------------------- */
.help-q {
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-tint);
  color: var(--accent-strong);
  font: 700 12px/1 var(--font-sans);
  display: inline-grid;
  place-items: center;
  cursor: help;
  vertical-align: middle;
  padding: 0;
  flex: none;
}
.help-q:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.till__status .help-q { min-block-size: 0; inline-size: 22px; block-size: 22px; padding: 0; }
.help-pop {
  position: fixed;
  z-index: 80;
  max-inline-size: 300px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink-strong);
  color: #fff;
  font: 400 13px/1.45 var(--font-sans);
  box-shadow: 0 12px 28px -12px rgba(15, 23, 42, .5);
}
.help-pop strong { display: block; margin-block-end: 2px; }
.help-pop a { color: #C7D2FE; }

.till__body {
  flex: 1;
  min-block-size: 0;
  display: flex;
}

.till__tiles {
  flex: 1.4;
  min-inline-size: 0;
  padding: 12px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--till-tile-w), 1fr));
  gap: 10px;
  align-content: start;
  /* Rows fit their tile: in a scrolling grid, auto rows stay at the tiles' minimum
     height once the list overflows, which crushed names and prices (QA, 27 Sep 2026). */
  grid-auto-rows: max-content;
}

.tile {
  inline-size: 100%;
  min-block-size: var(--till-tile-h);
  min-inline-size: var(--till-touch-min);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  cursor: pointer;
  text-align: start;
  box-sizing: border-box;
}

.tile__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-strong);
  line-height: 1.25;
}

.tile__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--ink-muted);
}

.tile__price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent-strong);
}

.till__cart {
  flex: 1;
  min-inline-size: 320px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: inset 1px 0 0 var(--hairline);
}

.cart-lines {
  flex: 1;
  min-block-size: 0;
  overflow: auto;
}

.cart-line {
  min-block-size: var(--till-touch-min);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-block-end: 1px solid var(--hairline);
}
/* Table-based carts (traders counter and bill) use the same class on <tr>: keep them
   table rows so their cells line up with the header (QA, 27 Sep 2026). */
tr.cart-line { display: table-row; padding: 0; }

.cart-line__name {
  flex: 1;
  min-inline-size: 0;
  font-size: 14px;
  color: var(--ink-strong);
}

.cart-line__qty {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  font-size: 13px;
}

.cart-line__amount {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-strong);
  min-inline-size: 8ch;
  text-align: end;
}

.till__totals {
  padding: 14px;
  border-block-start: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.till__total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--ink);
}

.till__total-row--grand {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-strong);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px;
}

.keypad button {
  min-block-size: var(--till-touch-min);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-strong);
  cursor: pointer;
}

.till__pay-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
}

.pay-btn {
  min-block-size: 56px;
  border: 0;
  border-radius: var(--radius-control);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

.pay-btn--secondary {
  background: var(--ink-strong);
}

/* ---------- Colour and pictures (shared/media.js) ------------------------- */
/* Elements built by media.js carry --c, --c-tint and --c-ink: one hue from
   the category palette in tokens.css. */

/* Product tile with a photo (or a coloured stand-in) on top. */
.tile--media {
  padding: 0;
  overflow: hidden;
  justify-content: flex-start;
  border-block-start: 3px solid var(--c, var(--hairline));
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile--media:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--c, #000) 60%, transparent);
}
.tile--media:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tile--media .media {
  inline-size: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0;
}
.tile--media .tile__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px 10px;
  flex: 1;
}
@media (prefers-reduced-motion: reduce) {
  .tile--media { transition: none; }
  .tile--media:hover { transform: none; }
}

/* A picture box: a photo, a monogram or a book cover. */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--c-tint, var(--subtle));
  border-radius: var(--radius-control);
  flex: none;
}
.media > img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}
.media--sm { inline-size: 40px; block-size: 40px; }
.media--md { inline-size: 56px; block-size: 56px; }
.media--lg { inline-size: 88px; block-size: 88px; }

/* Stand-in when there is no photo: initials on the category tint. */
.media--mono {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-ink, var(--ink-muted));
  font-weight: 700;
  letter-spacing: .02em;
  background:
    radial-gradient(circle at 80% 15%, color-mix(in srgb, var(--c, #999) 22%, transparent) 0 28%, transparent 29%),
    var(--c-tint, var(--subtle));
}
.media--mono.media--sm { font-size: 14px; }
.media--mono.media--md { font-size: 18px; }
.media--mono.media--lg { font-size: 26px; }
.tile--media .media--mono { font-size: 26px; }

/* Book cover drawn from the title: a coloured board with a spine. */
.media--cover {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px 8px 8px 14px;
  color: #fff;
  background: linear-gradient(160deg, var(--c, #555), color-mix(in srgb, var(--c, #555) 60%, #000));
  box-shadow: inset 6px 0 0 color-mix(in srgb, var(--c, #555) 55%, #000);
}
[dir='rtl'] .media--cover {
  padding: 8px 14px 8px 8px;
  box-shadow: inset -6px 0 0 color-mix(in srgb, var(--c, #555) 55%, #000);
}
.media--cover .cover__title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.media--cover.media--lg .cover__title { font-size: 11px; }
.media--cover.media--sm .cover__title,
.media--cover.media--md .cover__title { display: none; }
.media--cover .cover__rule {
  block-size: 3px;
  inline-size: 40%;
  background: rgba(255, 255, 255, .7);
  border-radius: 2px;
  margin-block-end: 6px;
}

/* Coloured person avatar (extends .bx-avatar). */
.bx-avatar--hue {
  background: var(--c-tint);
  color: var(--c-ink);
}

/* Category chip / filter pill in the category's colour. */
.chip-cat {
  display: inline-flex;
  inline-size: fit-content;
  max-inline-size: 100%;
  align-items: center;
  gap: 6px;
  block-size: 28px;
  padding-inline: 12px;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--c, var(--hairline)) 35%, transparent);
  background: var(--c-tint, var(--subtle));
  color: var(--c-ink, var(--ink));
  font: 600 12px var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
}
.chip-cat::before {
  content: '';
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--c, var(--ink-muted));
}
.chip-cat[aria-pressed='true'] {
  background: var(--c, var(--accent));
  border-color: var(--c, var(--accent));
  color: #fff;
}
.chip-cat[aria-pressed='true']::before { background: rgba(255, 255, 255, .85); }

/* KPI tile in a palette hue: tinted icon well and a coloured top edge. */
.kpi--hue {
  border-block-start: 3px solid var(--c);
}
.kpi--hue .kpi__icon {
  background: var(--c-tint);
  color: var(--c-ink);
}

/* Page header band in the segment accent. */
.bx-hero {
  border-radius: var(--radius-card);
  padding: 20px 24px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 55%, #fff) 0%, transparent 55%),
    linear-gradient(135deg, var(--accent), var(--accent-strong));
}
.bx-hero .bx-h1,
.bx-hero .bx-pretitle,
.bx-hero .bx-why { color: #fff; }
.bx-hero .bx-why { opacity: .9; }

/* In a till grid, photo tiles stay compact so a cashier sees 3+ rows. */
.till__tiles .tile--media .media { aspect-ratio: 16 / 9; }
.till__tiles .tile--media .tile__body { padding: 6px 8px 8px; gap: 4px; }
.till__tiles .tile--media .media--mono { font-size: 20px; }

/* ---------- Screen kit (shared/kit.js) ------------------------------------ */
.kit-tabs {
  display: flex;
  gap: 4px;
  border-block-end: 1px solid var(--hairline);
  margin-block-end: 16px;
  overflow-x: auto;
}
.kit-tab {
  border: 0;
  background: none;
  padding: 10px 14px;
  font: 600 13px var(--font-sans);
  color: var(--ink-muted);
  border-block-end: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.kit-tab[aria-selected='true'] {
  color: var(--accent-strong);
  border-block-end-color: var(--accent);
}
.kit-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.kit-dl {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
}
.kit-dl dt { color: var(--ink-muted); }
.kit-dl dd { margin: 0; color: var(--ink-strong); overflow-wrap: anywhere; }

.kit-drawer-wrap {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  z-index: 50;
  display: flex;
  justify-content: flex-end;
}
.kit-drawer {
  inline-size: min(480px, 100vw);
  block-size: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 32px -16px rgba(15, 23, 42, .35);
}
.kit-drawer__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-block-end: 1px solid var(--hairline);
}
.kit-drawer__body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.kit-drawer__foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 20px;
  border-block-start: 1px solid var(--hairline);
}
.table tbody tr[tabindex]:hover { background: var(--subtle); }

/* A category chip used as a label (no click): flatter, no pointer. */
.chip-cat--static {
  cursor: default;
  border-color: transparent;
  block-size: 24px;
  padding-inline: 10px;
}

/* Clickable table rows: a quiet chevron at the row end says "opens". */
.table tbody tr[tabindex] td:last-child::after {
  content: '›';
  margin-inline-start: 8px;
  color: var(--ink-muted);
  font-weight: 700;
}
[dir='rtl'] .table tbody tr[tabindex] td:last-child::after { content: '‹'; }
.table tbody tr[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }



/* ---------- Collapsible sidebar and top-bar user chip ---------------------- */
.bx-nav { overflow-x: hidden; }
.bx-sidebar { transition: inline-size .15s ease; }
.bx-sidebar__collapse {
  inline-size: 28px;
  block-size: 28px;
  flex: none;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink-muted);
  font: 700 14px var(--font-sans);
  cursor: pointer;
}
.bx-sidebar__collapse:hover { color: var(--accent-strong); border-color: var(--accent); }
[dir='rtl'] .bx-sidebar__collapse { transform: scaleX(-1); }
.bx-shell--collapsed .bx-sidebar { inline-size: 64px; }
.bx-shell--collapsed .bx-sidebar__brand { padding-inline: 10px; flex-direction: column; justify-content: center; block-size: auto; padding-block: 10px; gap: 6px; }
.bx-shell--collapsed .bx-sidebar__brandtext,
.bx-shell--collapsed .bx-sidebar__branch,
.bx-shell--collapsed .bx-nav__label,
.bx-shell--collapsed .bx-nav__text,
.bx-shell--collapsed .bx-nav__badge { display: none; }
.bx-shell--collapsed .bx-nav { padding-inline: 8px; }
.bx-shell--collapsed .bx-nav__item { justify-content: center; padding-inline: 0; }
@media (prefers-reduced-motion: reduce) { .bx-sidebar { transition: none; } }

.bx-userchip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--surface);
  max-inline-size: 220px;
}
.bx-userchip .bx-avatar { inline-size: 28px; block-size: 28px; font-size: 12px; }
.bx-userchip__text { display: flex; flex-direction: column; line-height: 15px; min-inline-size: 0; }
.bx-userchip__name { font-size: 12.5px; font-weight: 600; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bx-userchip__role { font-size: 11px; color: var(--ink-muted); white-space: nowrap; }
/* ---------- Dockable number pad (shared/numpad.js) ------------------------- */
.bx-numpad-toggle {
  /* Physical offsets on purpose: writing-mode below would turn logical ones sideways. */
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  writing-mode: vertical-rl;
  padding: 12px 6px;
  border: 0;
  border-start-start-radius: 10px;
  border-end-start-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: 700 12px var(--font-sans);
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: 0 6px 16px -8px rgba(15, 23, 42, .5);
}
[dir='rtl'] .bx-numpad-toggle { right: auto; left: 0; border-radius: 0 10px 10px 0; }
.bx-numpad-toggle[aria-pressed='true'] { background: var(--ink-strong); }
.bx-numpad {
  position: fixed;
  inset-inline-end: 34px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  z-index: 70;
  inline-size: 236px;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .45);
}
.bx-numpad__head { display: flex; justify-content: space-between; align-items: center; font: 600 13px var(--font-sans); color: var(--ink-strong); margin-block-end: 4px; }
.bx-numpad__hint { font-size: 11px; color: var(--ink-muted); margin-block-end: 8px; }
.bx-numpad--armed .bx-numpad__hint { display: none; }
.bx-numpad__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bx-numpad__key {
  block-size: 52px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--subtle);
  font: 700 20px var(--font-mono);
  color: var(--ink-strong);
  cursor: pointer;
  touch-action: manipulation;
}
.bx-numpad__key:active { background: var(--accent-tint); }
.bx-numpad__key--muted { font-size: 16px; color: var(--ink-muted); }
.bx-numpad__key--enter { background: var(--accent); color: #fff; border-color: var(--accent); }
.bx-numpad__close { block-size: 28px; inline-size: 28px; font-size: 13px; background: none; }
/* Room for the tab (and for the open pad) so neither covers content. */
html.bx-numpad-on body { padding-inline-end: 26px; }
html.bx-numpad-on.bx-numpad-open body { padding-inline-end: 276px; }
@media print { .bx-numpad, .bx-numpad-toggle { display: none !important; } html.bx-numpad-on body { padding-inline-end: 0 !important; } }


/* ---------- Forms: modal, side panel, wizard (shared/forms.js) ------------- */
.modal--form { inline-size: min(720px, 94vw); max-inline-size: min(720px, 94vw); display: flex; flex-direction: column; }
.modal--wizard { inline-size: min(820px, 96vw); max-inline-size: min(820px, 96vw); display: flex; flex-direction: column; }
.modal--form .modal__body, .modal--wizard .modal__body { overflow-y: auto; flex: 1; }
.modal--form .modal__header, .modal--wizard .modal__header,
.modal--form .modal__footer, .modal--wizard .modal__footer { position: sticky; background: var(--surface); z-index: 1; }
.modal--form .modal__header, .modal--wizard .modal__header { inset-block-start: 0; }
.modal--form .modal__footer, .modal--wizard .modal__footer { inset-block-end: 0; }
.kit-form__footer { display: flex; gap: 8px; justify-content: flex-end; inline-size: 100%; }
.kit-form__sub { margin: 0 0 12px; color: var(--ink-muted); font-size: 13px; }
.kit-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.kit-form__field { display: flex; flex-direction: column; gap: 6px; min-inline-size: 0; }
.kit-form__field--full, .kit-form__section { grid-column: 1 / -1; }
.kit-form__section { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-block: 6px 2px; border-block-end: 1px solid var(--hairline); font: 700 12px var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); }
.kit-form__section small { font: 400 12px var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--ink-muted); }
.kit-form__req { color: var(--danger); }
.kit-form__hint { font-size: 12px; color: var(--ink-muted); }
.kit-form__error { font-size: 12px; color: var(--danger); min-block-size: 0; }
.kit-form__error:empty { display: none; }
.kit-form .input.is-invalid, .kit-form .select.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.kit-form__alert { padding: 10px 12px; border-radius: 8px; background: var(--danger-tint); color: var(--danger); font-size: 13px; margin-block-end: 12px; }
.kit-form__textarea { block-size: auto; padding-block: 8px; resize: vertical; }
.kit-form__group { display: flex; align-items: stretch; }
.kit-form__group > .input { flex: 1; min-inline-size: 0; border-radius: 0; }
.kit-form__group > :first-child { border-start-start-radius: var(--radius-control); border-end-start-radius: var(--radius-control); }
.kit-form__group > :last-child { border-start-end-radius: var(--radius-control); border-end-end-radius: var(--radius-control); }
.kit-form__affix, .kit-form__step { display: grid; place-items: center; padding-inline: 12px; border: 1px solid var(--control-border); background: var(--subtle); color: var(--ink-muted); font: 600 13px var(--font-sans); }
.kit-form__group > :not(:first-child) { margin-inline-start: -1px; }
.kit-form__step { cursor: pointer; min-inline-size: 40px; font-size: 18px; color: var(--ink-strong); }
.kit-form__step:hover { background: var(--accent-tint); }
.kit-form__num { text-align: end; font-variant-numeric: tabular-nums; }
.kit-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink-strong); }
.kit-switch__input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; }
.kit-switch__track { inline-size: 40px; block-size: 22px; border-radius: 999px; background: var(--control-border); position: relative; transition: background .15s; flex: none; }
.kit-switch__track::after { content: ''; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; inline-size: 16px; block-size: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.kit-switch__input:checked + .kit-switch__track { background: var(--accent); }
.kit-switch__input:checked + .kit-switch__track::after { transform: translateX(18px); }
[dir='rtl'] .kit-switch__input:checked + .kit-switch__track::after { transform: translateX(-18px); }
.kit-switch__input:focus-visible + .kit-switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.kit-drawer--form { inline-size: min(560px, 100vw); }
.kit-drawer--form .kit-form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kit-wizard__steps { list-style: none; display: flex; gap: 6px; margin: 0 0 18px; padding: 0; overflow-x: auto; }
.kit-wizard__step { display: flex; align-items: center; gap: 8px; flex: 1; min-inline-size: max-content; padding: 8px 10px; border-radius: 10px; background: var(--subtle); color: var(--ink-muted); font-size: 13px; }
.kit-wizard__step.is-current { background: var(--accent-tint); color: var(--accent-strong); font-weight: 700; }
.kit-wizard__step.is-done { color: var(--success); }
.kit-wizard__dot { inline-size: 24px; block-size: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--hairline); font: 700 12px var(--font-sans); flex: none; }
.kit-wizard__step.is-current .kit-wizard__dot { background: var(--accent); color: #fff; border-color: var(--accent); }
.kit-wizard__step.is-done .kit-wizard__dot { background: var(--success); color: #fff; border-color: var(--success); }
.kit-wizard__title { margin: 0 0 6px; font-size: 18px; color: var(--ink-strong); }
.kit-wizard__review { display: grid; gap: 6px; }
.kit-wizard__row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-block-end: 1px dashed var(--hairline); font-size: 14px; }
.kit-wizard__row span { color: var(--ink-muted); }
@media (max-width: 600px) {
  .kit-form__grid, .kit-drawer--form .kit-form__grid { grid-template-columns: 1fr; }
  .kit-wizard__label { display: none; }
  .kit-wizard__step.is-current .kit-wizard__label { display: inline; }
}
@media (prefers-reduced-motion: reduce) { .kit-switch__track, .kit-switch__track::after { transition: none; } }


/* ---------- Phone and tablet shell (html.bx-phone / .bx-tablet from device.js) ---------- */
.bx-topbar__burger, .bx-topbar__more { display: none; }
.bx-topbar__tools { display: flex; align-items: center; gap: 8px; }
/* Desktop: the search gives up width first and the pickers are capped, so the tools
   ("Reset demo data" last) never run past the right edge, the number pad's strip included. */
html:not(.bx-phone):not(.bx-tablet) .bx-topbar__search { flex: 0 100 440px; min-inline-size: 160px; }
html:not(.bx-phone):not(.bx-tablet) .bx-topbar__tools { flex: 0 1 auto; min-inline-size: 0; }
html:not(.bx-phone):not(.bx-tablet) .bx-topbar__tools > * { flex-shrink: 0; }
html:not(.bx-phone):not(.bx-tablet) .bx-topbar__tools > select { max-inline-size: 170px; }
html:not(.bx-phone):not(.bx-tablet) .bx-topbar__tools .btn { white-space: nowrap; }
html:not(.bx-phone):not(.bx-tablet) .bx-topbar__tools > .bx-userchip { flex-shrink: 1; min-inline-size: 0; max-inline-size: 160px; overflow: hidden; }
.bx-nav-backdrop { display: none; }
html.bx-phone .bx-shell { block-size: 100vh; }
html.bx-phone .bx-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 95;
  inline-size: min(300px, 86vw);
  transform: translateX(-105%);
  transition: transform .2s ease;
  box-shadow: 12px 0 32px -16px rgba(15, 23, 42, .5);
}
[dir='rtl'].bx-phone .bx-sidebar, html.bx-phone[dir='rtl'] .bx-sidebar { transform: translateX(105%); }
html.bx-phone .bx-shell--navopen .bx-sidebar { transform: none; }
html.bx-phone .bx-shell--navopen .bx-nav-backdrop { display: block; position: fixed; inset: 0; z-index: 94; background: rgba(15, 23, 42, .35); }
html.bx-phone .bx-sidebar__collapse { display: none; }
html.bx-phone .bx-shell--collapsed .bx-sidebar { inline-size: min(300px, 86vw); }
html.bx-phone .bx-shell--collapsed .bx-nav__text,
html.bx-phone .bx-shell--collapsed .bx-nav__label { display: revert; }
html.bx-phone .bx-shell--collapsed .bx-sidebar__brandtext { display: flex; }
html.bx-phone .bx-topbar { padding-inline: 10px; gap: 8px; position: relative; }
html.bx-phone .bx-topbar__burger,
html.bx-phone .bx-topbar__more {
  display: grid;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface);
  font-size: 18px;
  color: var(--ink-strong);
  cursor: pointer;
  flex: none;
}
html.bx-phone .bx-topbar__search { flex: 1; min-inline-size: 0; }
html.bx-phone .bx-topbar__tools {
  display: none;
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 10px;
  z-index: 96;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  inline-size: min(300px, 92vw);
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .45);
}
html.bx-phone .bx-topbar__tools.is-open { display: flex; }
html.bx-phone .bx-topbar__tools .bx-lang-select,
html.bx-phone .bx-topbar__tools .btn { inline-size: 100%; block-size: 40px; }
html.bx-phone .bx-userchip { max-inline-size: none; }
html.bx-phone .bx-userchip__text { display: flex; }
html.bx-phone .bx-content { padding: 14px; }
html.bx-tablet .bx-topbar { gap: 8px; padding-inline: 14px; }
html.bx-tablet .bx-topbar__search { max-inline-size: 220px; }
html.bx-tablet .bx-userchip__text { display: none; }
@media (prefers-reduced-motion: reduce) { html.bx-phone .bx-sidebar { transition: none; } }


/* ---------- Live search dropdown (shared/search.js) ------------------------ */
.bx-combo {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 97;
  inline-size: max(100%, 360px);
  max-inline-size: 92vw;
  max-block-size: min(420px, 70vh);
  overflow-y: auto;
  padding: 6px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .45);
}
.bx-combo__group { padding: 8px 10px 4px; font: 700 11px var(--font-sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-muted); }
.bx-combo__item { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.bx-combo__item.is-active { background: var(--accent-tint); }
.bx-combo__label { font-size: 14px; color: var(--ink-strong); font-weight: 600; }
.bx-combo__sub { font-size: 12px; color: var(--ink-muted); }
.bx-combo mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; padding-inline: 1px; }
.bx-combo__empty { padding: 12px; color: var(--ink-muted); font-size: 13px; }
html.bx-phone .bx-combo { position: fixed; inset-inline: 8px; inset-block-start: 58px; inline-size: auto; }

/* KPI tiles: two per row on phones (the inline grid can't know the device). */
html.bx-phone .kit-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
html.bx-phone .kit-stats .kpi { padding: 12px; gap: 10px; }
html.bx-phone .kit-stats .kpi__icon { inline-size: 36px; block-size: 36px; }

/* Tablets fold the top-bar pickers into the same "⋯" sheet as phones
   (re-audit: Language and Reset ran off the right edge at 768px). */
html.bx-tablet .bx-topbar { position: relative; }
html.bx-tablet .bx-topbar__more {
  display: grid;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface);
  font-size: 18px;
  color: var(--ink-strong);
  cursor: pointer;
  flex: none;
}
html.bx-tablet .bx-topbar__tools {
  display: none;
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 14px;
  z-index: 96;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  inline-size: 320px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .45);
}
html.bx-tablet .bx-topbar__tools.is-open { display: flex; }
html.bx-tablet .bx-topbar__tools .bx-lang-select,
html.bx-tablet .bx-topbar__tools .btn { inline-size: 100%; block-size: 40px; }
html.bx-tablet .bx-topbar__tools .bx-userchip__text { display: flex; }
html.bx-tablet .bx-topbar__search { max-inline-size: none; flex: 1; }


/* Line-items field (forms.js type: 'lines') */
.kit-lines__wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: 10px; }
.kit-lines { margin: 0; }
.kit-lines th { font-size: 11px; }
.kit-lines td { padding: 6px 8px; vertical-align: middle; }
.kit-lines .input, .kit-lines .select { block-size: 36px; min-inline-size: 80px; }
.kit-lines__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kit-lines__total { font-weight: 700; color: var(--ink-strong); }
.kit-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kit-lines .r { text-align: end; }
.kit-lines__withunit { display: inline-flex; align-items: center; gap: 6px; }
.kit-lines__unit { font-size: 12px; color: var(--ink-muted); min-inline-size: 2ch; }
.kit-lines .is-invalid, .kit-form .is-invalid { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

.kit-wizard__lines { display: flex; flex-direction: column; gap: 6px; padding-block: 6px; }
.kit-wizard__lines > span { font-size: 13px; color: var(--ink-muted); }

/* Line tables: cap the dropdowns (they size to the longest product name) and
   narrow the number cells; a form holding one gets a wider window. */
.kit-lines .select { inline-size: 100%; min-inline-size: 150px; max-inline-size: 300px; }
.kit-lines .input.kit-form__num { inline-size: 96px; min-inline-size: 0; }
.modal--form:has(.kit-lines), .modal--wizard:has(.kit-lines) { inline-size: min(980px, 96vw); max-inline-size: min(980px, 96vw); }

/* Page parts never shrink: bx-content is a fixed-height scrolling column, and once a
   page is taller than the screen its children were squeezed (a tab bar with overflow
   shrank to 1px, QA 27 Sep 2026). The column scrolls instead. */
.bx-content > * { flex-shrink: 0; }

/* Country picker (country.js countrySwitcher): flag · country · currency. */
.bx-country { display: inline-flex; min-inline-size: 0; }
.bx-country__btn { display: inline-flex; align-items: center; gap: 7px; max-inline-size: 230px; white-space: nowrap; }
.bx-country__btn .bx-flag, .bx-country__opt .bx-flag { flex: none; border-radius: 3px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .18); }
.bx-country__name { overflow: hidden; text-overflow: ellipsis; min-inline-size: 0; }
.bx-country__cur { font-weight: 500; opacity: .7; }
.bx-country__list { z-index: 120; overflow-y: auto; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--hairline); box-shadow: 0 18px 40px -16px rgba(15, 23, 42, .45); }
.bx-country__head { padding: 6px 10px 8px; font-size: 12px; color: var(--ink-muted); border-block-end: 1px solid var(--hairline); margin-block-end: 4px; }
.bx-country__opt { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink-strong); outline: none; }
.bx-country__opt:hover, .bx-country__opt:focus { background: var(--accent-tint); }
.bx-country__opt[aria-selected='true'] { font-weight: 700; }
.bx-country__opt[aria-selected='true']::after { content: '✓'; grid-column: 3; justify-self: end; color: var(--accent-strong); margin-inline-start: 6px; }
.bx-country__opt[aria-selected='true'] .bx-country__opt-cur { display: none; }
.bx-country__opt-cur { font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.till__status .bx-country__btn { max-inline-size: 190px; }
html.bx-phone .bx-country__btn { max-inline-size: 100%; }

/* ==== Resto shell, typography and spacing (owner, 27 Sep 2026: "I liked the Resto
   UX tokens … typography and spacing. Try that." Measurements:
   docs/research/restaurant/getstocky-review.md §10, docs/ui-shell-tokens.md) ==== */

/* Sidebar: 40 px items that never squeeze (the scrolling nav had crushed them to 20 px),
   11 px section labels with 16/6 spacing, and sections that open and close. */
.bx-nav { gap: 0; padding-block-end: 16px; }
.bx-nav > *, .bx-nav__items > * { flex-shrink: 0; }
.bx-nav__group { display: flex; flex-direction: column; flex-shrink: 0; }
.bx-nav__items { display: flex; flex-direction: column; gap: 2px; }
.bx-nav__item { padding-inline: 12px; gap: 12px; }
.bx-nav__label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  inline-size: 100%; padding: 16px 12px 6px; margin: 0; border: 0; background: none;
  font: 600 var(--text-2xs) var(--font-sans); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-muted); cursor: pointer; text-align: start; border-radius: var(--radius-control);
}
.bx-nav__label:hover { color: var(--ink-strong); }
.bx-nav__label:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bx-nav__chev { font-size: 10px; transition: transform .15s ease; }
.bx-nav__group.is-closed .bx-nav__chev { transform: rotate(-90deg); }
.bx-nav__group.is-closed .bx-nav__items { display: none; }
/* The icon rail shows every item; sections only group them. */
.bx-shell--collapsed .bx-nav__group .bx-nav__items { display: flex; }
.bx-shell--collapsed .bx-nav__group + .bx-nav__group { border-block-start: 1px solid var(--hairline); margin-block-start: 6px; padding-block-start: 6px; }
@media (prefers-reduced-motion: reduce) { .bx-nav__chev { transition: none; } }

/* Top bar: the pill search carries a "/" hint; the signed-in name in the accent. */
.bx-kbd {
  flex: none; min-inline-size: 22px; block-size: 22px; padding-inline: 6px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline); border-radius: 4px; background: var(--surface);
  font: 500 12px var(--font-mono); color: var(--ink-muted);
}
.bx-userchip__name { color: var(--accent-strong); font-size: 13px; }

/* Page header: Resto's calm header instead of a colour band: an accent pretitle, a
   20/28 title and a one-line why in muted grey. */
.bx-hero { background: none; color: var(--ink); padding: 0; border-radius: 0; }
.bx-hero .bx-pretitle { color: var(--accent-strong); }
.bx-hero .bx-h1 { color: var(--ink-strong); }
.bx-hero .bx-why { color: var(--ink-muted); opacity: 1; }
.bx-greeting { display: grid; gap: 2px; }
.bx-greeting__hello { font: 600 18px/26px var(--font-sans); color: var(--ink-strong); }
.bx-greeting__date { font-size: 14px; color: var(--ink-muted); }

/* KPI cards: a tinted 48 px icon tile, a 12 px grey label, a 20/28 weight-600 value in
   the body font (monospace stays for tables), and an optional trend line. */
.kpi { padding: 20px 24px; gap: 16px; align-items: center; }
.kpi--hue { border-block-start: 0; }
.kpi__icon { border-radius: 10px; }
.kpi__label { font-size: 13px; }
.kpi__value { font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.kpi__trend { font-size: 12.5px; color: var(--ink-muted); display: inline-flex; align-items: center; gap: 4px; }
.kpi__trend b { font-weight: 600; }
.kpi__trend--up b { color: var(--success); }
.kpi__trend--down b { color: var(--danger); }
.kit-stats { gap: 16px !important; }

/* listView paging (kit.js): one quiet row under long lists. */
.kit-pager { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-block-start: 1px solid var(--hairline); font-size: 13px; color: var(--ink-muted); }
.kit-pager:empty { display: none; }

/* A tile that can't be sold right now (a restaurant's "86"): greyed, labelled, not tappable. */
.tile--soldout { opacity: .5; filter: grayscale(1); cursor: not-allowed; }
.tile__soldout {
  display: inline-block; margin-block-start: 4px; padding: 1px 6px; border-radius: 4px;
  background: var(--danger-tint); color: var(--danger); font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
