/* ---------- Tokens ---------- */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-sunken: #fbfaf7;
  --dialog: #f8f6f1;
  --border: #e7e3da;
  --border-strong: #d6d1c6;
  --text: #1d1c1a;
  --muted: #6b675f;
  --focus: #1f5fbf;

  --green: #2d5a27;
  --green-hover: #244a1f;
  --green-soft: #ebf2e9;
  --danger: #a3312a;
  --danger-soft: #fbeceb;

  /* Softly rounded, lightly separated: small radii and small gaps between grouped controls. */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 9px;
  --gap: 6px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-md: 0 6px 16px rgb(0 0 0 / 0.07);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  color-scheme: light;
}

/* Group palettes (data-color): --cat (stripe), --cat-ink (text/filled, AA on white), --cat-soft, --cat-line */
[data-color="tomato"]  { --cat: #c24a34; --cat-ink: #b03f2c; --cat-soft: #fbe9e5; --cat-line: #f1cdc5; }
[data-color="mustard"] { --cat: #d99a2b; --cat-ink: #8f5c0c; --cat-soft: #fbf1dd; --cat-line: #efd9ab; }
[data-color="slate"]   { --cat: #4d7b8c; --cat-ink: #3d6676; --cat-soft: #e8eff1; --cat-line: #c9d9de; }
[data-color="berry"]   { --cat: #c4547a; --cat-ink: #ab3f62; --cat-soft: #f9e8ed; --cat-line: #eecbd6; }
[data-color="herb"]    { --cat: #5a8a3c; --cat-ink: #3f6b26; --cat-soft: #ebf3e4; --cat-line: #cfe2c1; }
[data-color="plum"]    { --cat: #7d5ba6; --cat-ink: #654290; --cat-soft: #f0eaf7; --cat-line: #d9cbea; }
[data-color="teal"]    { --cat: #2f8a7e; --cat-ink: #1f6e63; --cat-soft: #e3f2ef; --cat-line: #c2e0da; }
[data-color="cocoa"]   { --cat: #8a5a3c; --cat-ink: #74482c; --cat-soft: #f4ebe4; --cat-line: #e2cfc1; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* no double-tap zoom delay on touch registers */
  overscroll-behavior: none;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.muted { color: var(--muted); }
.noscript { padding: 24px; text-align: center; }

.icon { width: 1.32em; height: 1.32em; flex: none; } /* 15% bigger */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-weight: 600;
  transition: background-color .15s, border-color .15s, transform .08s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-outline { background: var(--surface); border-color: var(--border); }
.btn-outline:hover { background: #f3f1ec; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--green-hover); }
.btn-primary:disabled { background: #a9b8a6; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.05rem; font-weight: 700; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 40px; padding: 0 8px; margin: -8px -8px 0 0;
  border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--muted); font-size: .85rem;
}
.btn-ghost:hover:not(:disabled) { color: var(--text); background: #f3f1ec; }
.btn-ghost:disabled { opacity: .4; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted);
}
.icon-btn:hover { color: var(--text); background: #f3f1ec; }

/* ---------- App shell ---------- */
.app { display: flex; flex-direction: column; height: 100dvh; }

.topbar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--safe-top)) calc(16px + var(--safe-right)) 10px calc(16px + var(--safe-left));
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  margin: 0; padding: 0; padding-inline-start: 44px;
  border: 0; background: none; color: inherit; font: inherit; line-height: 1.15; text-align: left;
}
.brand-mark { height: 50px; width: auto; flex: none; } /* the Sienna wordmark (assets/brand, npm run icons) */
.brand:hover .brand-mark { opacity: .8; }
.brand-name { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Tools: icon-only buttons, always laid out in the top bar. */
.tools { display: flex; align-items: center; }
.tools .icon-btn { width: 56px; height: 56px; }
.tools .icon-btn .icon { width: 30px; height: 30px; } /* 15% bigger */
.tools .icon-btn:disabled { opacity: .4; }
.tools .icon-btn:disabled:hover { color: var(--muted); background: none; }
.tools-tray { display: flex; justify-content: flex-end; gap: 2px; }
.tools-tray > * { flex: none; }
.net-status {
  padding: 4px 10px; border-radius: var(--radius-sm);
  background: #fdecc8; color: #7a4b00;
  font-size: .75rem; font-weight: 700;
}

.layout {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--order-width, minmax(320px, 380px));
}

/* ---------- Menu ---------- */
.menu {
  min-height: 0; overflow-y: auto;
  padding: 24px 24px calc(24px + var(--safe-bottom)) calc(16px + var(--safe-left));
}

/* Menu search: input above the groups, suggestions drop down over the grid. */
.menu-search { position: relative; margin-bottom: 12px; }
.menu-search-icon {
  position: absolute; top: 0; bottom: 0; left: 14px;
  display: grid; place-items: center; color: var(--muted); pointer-events: none;
}
.menu-search-icon .icon { width: 20px; height: 20px; }
.menu-search-input {
  width: 100%; min-height: 48px; padding: 0 48px 0 44px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: 1rem;
}
.menu-search-input::-webkit-search-cancel-button { display: none; } /* we draw our own clear button */
.menu-search-clear { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; }
.menu-search.has-kb .menu-search-clear { right: 48px; }
.menu-search-kb { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; }
.menu-search-kb.is-on { background: #2f6fd6; color: #fff; }
.menu-search.has-kb .menu-search-input { padding-right: 96px; }

/* On-screen keyboard: opens next to the box in use; drag the top bar to move it, the corner to
   resize it. Keys are sized from the keyboard's width (container units), so they grow with it. */
.osk {
  position: fixed; z-index: 1000; left: 16px; top: 16px;
  width: min(900px, calc(100vw - 24px)); padding: 0 14px 14px;
  background: #1f2328; color: #fff; border-radius: var(--radius-lg); box-shadow: 0 14px 40px rgb(0 0 0 / .4);
  touch-action: none; user-select: none; -webkit-user-select: none;
  container-type: inline-size;
}
.osk.is-dragging { box-shadow: 0 20px 50px rgb(0 0 0 / .5); opacity: .97; }
.osk-head { display: flex; align-items: center; gap: 8px; }
.osk-grip {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 0 4px; cursor: grab;
}
.osk.is-dragging .osk-grip { cursor: grabbing; }
.osk-title { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #aab1ba; }
.osk-hint { font-size: .75rem; color: #7d858f; }
.osk-hint::before { content: '⠿ '; }
.osk-close { color: #fff; }
.osk-close:hover { background: rgb(255 255 255 / .1); }
.osk-keys { display: grid; gap: clamp(5px, 1cqi, 10px); }
.osk-row { display: flex; gap: clamp(5px, 1cqi, 10px); }
.osk-key {
  flex: 1 1 0; min-width: 0; min-height: clamp(48px, 7cqi, 110px); padding: 0 4px;
  border: 0; border-radius: var(--radius-sm);
  background: #3a4048; color: #fff; font-size: clamp(1.1rem, 2.6cqi, 2.2rem); font-weight: 600;
  touch-action: manipulation;
}
.osk-key:active { background: #59616b; }
.osk-back, .osk-shift, .osk-clear, .osk-enter { background: #2b3036; font-size: clamp(.95rem, 2cqi, 1.6rem); }
.osk-shift, .osk-clear { flex-grow: 1.4; }
.osk-enter { flex-grow: 1.8; }
.osk-space { flex-grow: 5; }
.osk-shift.is-on { background: #2f6fd6; }
.osk-enter { background: #2d5a27; }
.osk-enter:active { background: #244a1f; }
/* Number pad (money, quantities): four big columns. */
.osk.is-pad .osk-key { min-height: clamp(56px, 17cqi, 130px); font-size: clamp(1.3rem, 7.5cqi, 2.6rem); }
.osk.is-pad .osk-back, .osk.is-pad .osk-clear, .osk.is-pad .osk-enter { flex-grow: 1; font-size: clamp(1rem, 5cqi, 1.8rem); }
.osk-resize {
  position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, #6b737d 50%, #6b737d 58%, transparent 58%, transparent 70%, #6b737d 70%, #6b737d 78%, transparent 78%);
  border-bottom-right-radius: var(--radius-lg);
}
/* The keyboard button beside the text box in use. */
.osk-toggle {
  position: fixed; z-index: 999; width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-md); touch-action: manipulation;
}
.osk-toggle[hidden] { display: none; }
.osk-toggle .icon { width: 22px; height: 22px; }
.osk-toggle.is-on { background: #2f6fd6; border-color: #2f6fd6; color: #fff; }
.menu-search-list {
  position: absolute; z-index: 20; top: 100%; left: 0; right: 0;
  max-height: min(60dvh, 420px); overflow-y: auto;
  margin: 4px 0 0; padding: 0; list-style: none; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-md);
}
.menu-search-option {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 14px; cursor: pointer;
}
.menu-search-option + .menu-search-option { border-top: 1px solid var(--border); }
.menu-search-option.is-active, .menu-search-option:hover { background: var(--cat-soft, #f3f1ec); }
.menu-search-option.is-active { box-shadow: inset 4px 0 0 var(--cat); }
.menu-search-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-search-name mark { background: none; color: var(--cat-ink); font-weight: 800; }
.menu-search-group { font-size: .8rem; color: var(--muted); }
.menu-search-price { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cat-ink); }
.menu-search-empty { padding: 16px 14px; color: var(--muted); }

.categories { display: flex; flex-wrap: wrap; gap: var(--gap); margin-bottom: 16px; }
.categories .chip[aria-pressed="true"] { position: relative; z-index: 1; }
.categories .chip { font-size: 1.18rem; }

.chip {
  min-height: 48px; padding: 0 20px;
  border: 1px solid var(--cat-line); border-radius: var(--radius-sm);
  background: var(--cat-soft); color: var(--cat-ink);
  font-weight: 600;
  transition: background-color .15s, color .15s;
}
.chip[aria-pressed="true"] { background: var(--cat-ink); border-color: var(--cat-ink); color: #fff; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(242px, 1fr));
  gap: 10px;
}

.item-card {
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden; /* clip the corner triangle to the rounded edge */
  min-height: 147px; padding: 21px 18px 18px 23px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .08s;
}
/* Each card carries its own accent (data-color) so neighbours are easy to tell apart. */
.item-tile[data-color] .item-card {
  background: color-mix(in srgb, var(--cat-soft) 55%, var(--surface));
  border-color: var(--cat-line);
}
/* Accent: a solid triangle in the card's top-left corner. */
.item-card::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 26px; height: 26px;
  background: var(--cat);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  pointer-events: none;
}
/* Tile = card + optional modifier icon button layered in its top-right corner. */
.item-tile { position: relative; display: grid; }
.item-tile:hover, .item-tile:focus-within { z-index: 1; }
.item-tile.has-mods .item-card { padding-right: 56px; }
.item-mods-btn {
  position: absolute; top: 8px; right: 8px;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  background: var(--surface); color: var(--cat-ink);
  border: 1px solid var(--cat-line); border-radius: var(--radius-sm);
  transition: background-color .15s;
}
.item-mods-btn:hover { background: var(--cat-soft); }
.item-mods-btn .icon { width: 20px; height: 20px; }
.item-card:hover { box-shadow: var(--shadow-md); }
.item-card:active { transform: scale(.98); }
.item-card.added { animation: added .35s ease-out; }
.item-name { font-size: 1.357rem; font-weight: 600; }
.item-desc { font-size: 1.086rem; color: var(--muted); }
.item-foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.item-card-price { margin-left: 8px; color: var(--muted); font-size: .92rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.totals-card dd { font-size: 1.5rem; }
.amount-note { display: block; margin-top: 4px; color: var(--muted); font-size: .92rem; }
.item-price { color: var(--cat-ink); font-size: 1.38rem; font-weight: 700; font-variant-numeric: tabular-nums; }

@keyframes added {
  40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cat) 30%, transparent); }
}

/* ---------- Current order ---------- */
.order {
  display: flex; flex-direction: column; min-height: 0;
  margin: 0 calc(12px + var(--safe-right)) calc(12px + var(--safe-bottom)) 0;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.order-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.order-header h2 { font-size: 1.05rem; font-weight: 700; }
.order-count { margin-top: 2px; font-size: .8rem; color: var(--muted); }

.order-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 20px; }
.order-lines { list-style: none; margin: 0; padding: 0; }

.line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 5.2rem 32px;
  align-items: center; gap: 6px;
  padding: 10px 0;
}
.line-name { display: block; font-size: 1.058rem; font-weight: 500; }
.line-each { display: block; font-size: .897rem; color: var(--muted); }
.line-mods { margin: 2px 0 4px; padding: 0 0 0 12px; list-style: none; font-size: .92rem; color: var(--text); opacity: .85; }
.line-mods li { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.line-mod-name { min-width: 0; overflow-wrap: anywhere; }
.line-mod-price { flex: none; padding-left: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.line-mod-no { color: var(--danger); font-weight: 700; letter-spacing: .01em; }
.stepper { display: flex; align-items: center; gap: 4px; }
.step {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface);
}
.step:hover { background: #f3f1ec; }
.qty { display: grid; place-items: center; min-width: 28px; text-align: center; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.line-total { text-align: right; font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.line .icon-btn { width: 32px; height: 32px; }
.line .line-edit { display: inline-grid; width: 28px; height: 28px; margin: -4px 0 -4px 2px; vertical-align: middle; }
.line-edit .icon { width: 15px; height: 15px; }

.order-empty { padding: 56px 12px; text-align: center; color: var(--muted); font-size: .9rem; }
.order-empty-title { margin-bottom: 4px; color: var(--text); font-weight: 600; }

.order-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-sunken);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.totals { margin: 0 0 16px; }
.totals-row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); font-size: .92rem; }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals-grand {
  align-items: baseline;
  margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.totals-grand dt { font-size: 1.15rem; font-weight: 700; }
.totals-grand dd { font-size: 1.84rem; font-weight: 800; letter-spacing: -.01em; }

/* ---------- Pages (full-width views that replace the register) ---------- */
.page {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 24px calc(24px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(16px + var(--safe-left));
}
.page-header { display: flex; align-items: center; gap: 12px; max-width: 880px; margin: 0 auto 24px; }
.page-heading { flex: 1; min-width: 0; }
.page-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.page-sub { margin-top: 2px; color: var(--muted); font-size: .9rem; }
.page-back { width: 44px; height: 44px; }

.menu-empty, .inv-empty { padding: 56px 12px; text-align: center; color: var(--muted); }
.menu-empty-title, .inv-empty-title { margin-bottom: 4px; color: var(--text); font-weight: 600; }
.menu-empty .btn { margin-top: 16px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent, #2563eb); font: inherit; text-decoration: underline; cursor: pointer; }
.link-btn:disabled { opacity: .5; cursor: default; }
.menu-grid-empty { grid-column: 1 / -1; padding: 32px 0; color: var(--muted); }

/* Settings: centred grid of XL cards, each a different shade of blue. */
[data-tone="azure"]    { --tone: #2f6fd6; --tone-ink: #1f4f9e; --tone-soft: #e8f0fc; --tone-line: #c6d8f5; }
[data-tone="cobalt"]   { --tone: #2a4fb8; --tone-ink: #213f93; --tone-soft: #e7ebf8; --tone-line: #c5cfee; }
[data-tone="sky"]      { --tone: #3b8fd9; --tone-ink: #1f6aa8; --tone-soft: #e6f2fc; --tone-line: #c2def5; }
[data-tone="navy"]     { --tone: #23417a; --tone-ink: #1c3461; --tone-soft: #e6eaf2; --tone-line: #c4cde0; }
[data-tone="steel"]    { --tone: #4a6c94; --tone-ink: #375477; --tone-soft: #eaeff5; --tone-line: #cbd7e5; }
[data-tone="cerulean"] { --tone: #1f88b8; --tone-ink: #176a90; --tone-soft: #e4f3f9; --tone-line: #bfe1ef; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* three across; fewer on narrower screens */
  gap: 20px; max-width: 1280px; margin: 24px auto 0;
}
@media (max-width: 900px) { .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
/* Wide rectangle (~2.5:1): icon on the left, title and description beside it. */
.settings-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  align-content: center; column-gap: 24px; row-gap: 4px;
  min-height: 210px; padding: 32px;
  background: linear-gradient(160deg, var(--tone-soft), color-mix(in srgb, var(--tone-soft) 40%, var(--surface)));
  border: 1px solid var(--tone-line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  color: var(--tone-ink); text-align: left;
  transition: box-shadow .15s, transform .08s;
}
.settings-card:hover { position: relative; z-index: 1; box-shadow: var(--shadow-md); }
.settings-card:active { transform: scale(.98); }
.settings-card-icon {
  grid-row: 1 / 3; align-self: center;
  display: grid; place-items: center;
  width: 96px; height: 96px; border-radius: var(--radius);
  background: var(--tone); color: #fff;
}
.settings-card-icon .icon { width: 48px; height: 48px; }
.settings-card-title { align-self: end; font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
.settings-card-desc { align-self: start; font-size: 1.02rem; color: var(--muted); }

/* Split pages (Users, Business Profile): vertical taskbar on the left (rectangular buttons, flush), active panel on the right. */
.split-layout {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 16px;
  max-width: 880px; margin: 0 auto;
}
.taskbar {
  display: flex; flex-direction: column;
  gap: var(--gap);
}
.taskbar-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 0 18px;
  border: 1px solid #c9d6ea; border-radius: var(--radius); background: #e8eef7;
  color: #2c4a78; font-size: 1.05rem; font-weight: 700; text-align: left;
  transition: background-color .15s, color .15s;
}
.taskbar-item:hover { background: #dbe5f3; }
.taskbar-item[aria-selected="true"] { background: #2f6fd6; border-color: #2f6fd6; color: #fff; }
.taskbar-item:focus-visible { outline-offset: 2px; }
.taskbar-item .icon { width: 22px; height: 22px; }
.split-panel {
  min-height: 114px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}

/* Auth gate: full-screen lock until the administrator is signed in. */
.auth-gate {
  width: 100vw; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 24px 16px;
  border: 0; background: var(--bg); color: var(--text);
  overflow-y: auto;
}
.auth-gate[open] { display: grid; place-items: center; }
.auth-gate::backdrop { background: var(--bg); }
.gate-card {
  width: min(420px, 100%); padding: 32px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.gate-brand { margin-bottom: 20px; font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; text-align: center; }
.gate-title { margin: 0 0 6px; font-size: 1.3rem; font-weight: 800; }
.gate-sub { margin-bottom: 20px; color: var(--muted); font-size: .92rem; }
.gate-links { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 12px; }
/* reCAPTCHA (sign-up, log-in): the floating badge would sit over checkout, so it is hidden and this line says so instead. */
.gate-recaptcha { margin: 12px 0 0; max-width: 360px; text-align: center; font-size: .75rem; color: var(--muted); }
.gate-recaptcha a { color: inherit; }
.grecaptcha-badge { visibility: hidden; }
.gate-link { margin: 0; }
.gate-sent { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--green-soft); color: var(--green); border-radius: var(--radius); font-weight: 600; }
.gate-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0; }

/* Users → Administrator */
.admin-account { display: flex; align-items: center; gap: 16px; padding: 24px; flex-wrap: wrap; }
.admin-avatar {
  display: grid; place-items: center; flex: none;
  width: 56px; height: 56px; border-radius: var(--radius);
  background: #2f6fd6; color: #fff;
}
.admin-avatar .icon { width: 28px; height: 28px; }
.admin-info { flex: 1; min-width: 180px; }
.admin-label { font-size: .82rem; color: var(--muted); }
.admin-name { font-size: 1.25rem; font-weight: 800; }
.admin-email { font-size: .9rem; color: var(--muted); }

/* Admin PIN: settings form (Users → Administrator) */
.admin-pin { padding: 20px 24px 24px; border-top: 1px solid var(--border); }
.admin-pin-title { margin: 0 0 4px; font-size: 1.05rem; font-weight: 800; }
.admin-pin-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 220px)); gap: 0 16px; }
.admin-pin-owner { max-width: 456px; }
.admin-pin-owner .field-hint { margin: 6px 0 0; }
.pin-input { letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.pin-input::placeholder { letter-spacing: normal; }
.form-actions.form-actions-start { justify-content: flex-start; }
.form-status:empty { display: none; }

/* Admin PIN: keypad prompt */
.dialog-pin { width: min(360px, calc(100vw - 32px)); }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 4px 0 20px; }
.pin-dots span { width: 16px; height: 16px; border: 2px solid var(--text); }
.pin-dots span.is-on { background: var(--text); }
.pin-pad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.pin-key {
  min-height: 60px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pin-key:hover:not(:disabled) { background: #f3f1ec; }
.pin-key:disabled { opacity: .45; }
.pin-key-ok { background: var(--green); border-color: var(--green); color: #fff; font-size: 1.1rem; }
.pin-key-ok:hover:not(:disabled) { background: var(--green-hover); }
.pin-forgot { display: block; margin: 14px auto 0; }
.pin-owner-hint { margin: 12px 0 0; }

/* Business Profile forms */
.profile-form { padding: 20px 24px 24px; }

/* Settings → Device & Sync */
.device-section { border-top: 1px solid var(--border); }
.device-where { padding: 16px 24px; }
.device-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; margin: 0; }
.device-facts dt { font-size: .82rem; color: var(--muted); }
.device-facts dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.device-id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 600; letter-spacing: .04em; }
.device-select { max-width: 240px; }
.device-select-wide { max-width: 420px; }
.sync-status { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-weight: 600; }
.sync-status .icon { width: 18px; height: 18px; flex: none; }
.sync-status.is-ok { color: var(--green); }
.sync-status.is-warn { color: var(--danger); }
.sync-counts { margin: 0 0 12px; }
.sync-details { margin: 4px 0 12px; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--muted); font-size: .9rem; }
.sync-details strong { color: var(--text); font-weight: 600; }

/* On/off switch: a real checkbox (role="switch"), drawn as a track and thumb. */
.switch { display: inline-flex; align-items: center; gap: 12px; margin: 4px 0 10px; cursor: pointer; font-weight: 600; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative; flex: none; width: 52px; height: 30px;
  border-radius: 999px; background: var(--border-strong); transition: background-color .15s;
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .15s;
}
.switch-input:checked ~ .switch-track { background: #2f6fd6; }
.switch-input:checked ~ .switch-track .switch-thumb { transform: translateX(22px); }
.switch-input:focus-visible ~ .switch-track { outline: 3px solid #2f6fd6; outline-offset: 2px; }
.switch-input:disabled ~ .switch-track { opacity: .45; }
/* A setting row (app-wide): name and description on the left, the switch at the far right. */
.switch-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; margin: 0; padding: 12px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--border); }
.switch-row:has(.switch-input:disabled) { cursor: default; }
.switch-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.switch-hint { font-size: .88rem; font-weight: 400; color: var(--muted); }
.switch-hint .switch-note { display: block; margin-top: 4px; color: var(--text); font-weight: 600; }
.switch-hint .switch-note:empty { display: none; }
.switch-list { margin-top: 6px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 16px; }
.text-area { min-height: 84px; padding: 10px 14px; resize: vertical; font: inherit; }

/* Billing */
.billing { max-width: 880px; margin: 0 auto; }
.billing-notice { margin-bottom: 16px; padding: 12px 14px; background: var(--green-soft); color: var(--green); font-weight: 600; }
.billing-current {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.billing-current-info { flex: 1; min-width: 200px; }
.billing-status { font-size: .9rem; color: var(--green); font-weight: 600; }
.billing-status-past_due, .billing-status-unpaid, .billing-status-incomplete { color: var(--danger); }
.billing-status-canceled { color: var(--muted); }
.billing-grace { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius); background: #fdecec; color: var(--danger); font-weight: 600; }
.billing-grace .icon { flex: none; margin-top: 2px; }
.emp-locked [data-action="edit"] { display: none; }
.billing-trial { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0; padding: 10px 12px; border-radius: var(--radius); background: #e6f3fa; color: #024e82; font-weight: 600; }
.billing-trial .icon { flex: none; margin-top: 2px; }
.billing-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 16px 0; align-items: stretch; }
.billing-plan {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease;
}
.billing-plan.is-current { background: #f2f7ff; }
.billing-plan-name { margin: 0; font-size: 1.25rem; font-weight: 800; }
.billing-plan-tagline { margin: 0; color: var(--muted); font-size: .92rem; }
.billing-plan-price { margin: 4px 0 0; color: var(--muted); }
.billing-plan-price span { font-size: 2.2rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.billing-plan-intro { margin: 6px 0 0; font-weight: 700; font-size: .92rem; }
.billing-plan-note { margin: 0; font-size: .85rem; color: var(--muted); text-align: center; }
.billing-features { flex: 1; margin: 6px 0 12px; padding: 0; list-style: none; display: grid; align-content: start; gap: 6px; }
.billing-features li { display: flex; align-items: center; gap: 8px; }
.billing-features .icon { color: var(--green); flex: none; }

/* Pro: ocean blue (like the PIN screen), a light sweeping across it, a gently glowing edge. */
.billing-plan.is-pro {
  overflow: hidden; isolation: isolate; color: #fff; border: 0;
  background: radial-gradient(120% 90% at 15% 0%, #0a8fc4 0%, transparent 60%),
              linear-gradient(160deg, #0369a1 0%, #024e82 50%, #01325c 100%);
  box-shadow: 0 10px 30px rgb(2 78 130 / 0.35);
  animation: pro-glow 4s ease-in-out infinite;
}
.billing-plan.is-pro::before { /* the sweep */
  content: ""; position: absolute; top: -40%; bottom: -40%; left: -60%; width: 45%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / 0.16), transparent);
  transform: rotate(12deg); animation: pro-sweep 5.5s ease-in-out infinite;
}
.billing-plan.is-pro::after { /* a slow swell along the bottom */
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -60px; height: 120px; z-index: -1;
  border-radius: 50%; background: rgb(10 143 196 / 0.35); filter: blur(18px);
  animation: pro-swell 7s ease-in-out infinite;
}
.billing-plan.is-pro:hover { transform: translateY(-4px); }
.billing-plan.is-pro .billing-plan-tagline,
.billing-plan.is-pro .billing-plan-price,
.billing-plan.is-pro .billing-plan-note { color: rgb(255 255 255 / 0.82); }
.billing-plan.is-pro .billing-plan-price span { color: #fff; }
.billing-plan.is-pro .billing-features .icon { color: #7dd3fc; }
.billing-plan.is-pro .btn-primary { background: #fff; color: #024e82; border-color: #fff; }
.billing-plan.is-pro .btn-primary:hover:not(:disabled) { background: #e0f2fe; }
.billing-plan.is-pro .btn-outline { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.6); }
.billing-plan-badge {
  position: absolute; top: 16px; right: 16px; padding: 4px 10px; border-radius: 999px;
  background: rgb(255 255 255 / 0.16); border: 1px solid rgb(255 255 255 / 0.35);
  font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  animation: pro-float 3s ease-in-out infinite;
}
@keyframes pro-sweep { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes pro-swell { 0%, 100% { transform: translateY(0) scaleX(1); } 50% { transform: translateY(-14px) scaleX(1.06); } }
@keyframes pro-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes pro-glow {
  0%, 100% { box-shadow: 0 10px 30px rgb(2 78 130 / 0.35), 0 0 0 1px rgb(125 211 252 / 0.25); }
  50% { box-shadow: 0 14px 38px rgb(3 105 161 / 0.5), 0 0 0 2px rgb(125 211 252 / 0.55); }
}

/* Compare all features: folded away under the cards. */
.billing-compare { margin: 0 0 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.billing-compare > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 52px; padding: 0 18px; cursor: pointer; font-weight: 700; list-style: none;
}
.billing-compare > summary::-webkit-details-marker { display: none; }
.billing-compare > summary .icon { transition: transform .2s ease; }
.billing-compare[open] > summary .icon { transform: rotate(180deg); }
.billing-compare-wrap { overflow-x: auto; padding: 0 8px 12px; }
.billing-compare-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.billing-compare-table th, .billing-compare-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.billing-compare-table thead th { font-size: 1rem; font-weight: 800; text-align: center; }
.billing-compare-table thead th:first-child { text-align: left; }
.billing-compare-table thead th.is-pro { color: #024e82; }
.compare-price { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); }
.compare-group th { padding-top: 18px; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.billing-compare-table tbody th[scope="row"] { font-weight: 600; }
.compare-blurb { display: block; font-size: .82rem; font-weight: 400; color: var(--muted); }
.billing-compare-table .compare-yes, .billing-compare-table .compare-no, .billing-compare-table .compare-text { width: 120px; text-align: center; }
.compare-yes .icon { color: var(--green); }
.compare-no { color: var(--muted); }
.compare-text { font-weight: 700; }
.billing-compare-table td.is-pro { background: #eef7fc; }
.billing-compare-table td.is-pro.compare-yes .icon { color: #0369a1; }

/* No plan (free trial ended): the plans cover the whole register. */
.plan-lock {
  width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0;
  padding: calc(20px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
  border: 0; background: var(--bg); overflow-y: auto;
}
.plan-lock::backdrop { background: var(--bg); }
.plan-lock-inner { max-width: 880px; margin: 0 auto; }
.plan-lock-header { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 16px; }
.plan-lock-header > div { flex: 1; }
.plan-lock-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: #e6f3fa; color: #0369a1; }
.plan-lock-title { margin: 0; font-size: 1.6rem; font-weight: 800; }
.plan-lock-sub { margin: 4px 0 0; color: var(--muted); }
@media (max-width: 560px) { .plan-lock-header { flex-wrap: wrap; } }

/* Users → Employees */
.emp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px 8px; }
.emp-list { display: grid; gap: var(--gap); margin: 0; padding: 8px 24px 24px; list-style: none; }
.emp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--surface-sunken);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.emp-row.is-inactive { opacity: .6; }
.emp-avatar {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: var(--radius);
  background: #2f6fd6; color: #fff; font-weight: 800; font-size: .9rem;
}
.emp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.emp-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.emp-contact { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-list .inv-empty { padding: 32px 12px; }

/* Staff: name chip in the top bar, "Who's working?" lock */
.staff-chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px 0 10px;
  background: #e8eef7; color: #1f4f9e;
  border: 1px solid #c9d6ea; border-radius: 999px;
  font-weight: 700;
}
.staff-chip:hover { background: #dbe5f3; }
.staff-chip .icon { width: 20px; height: 20px; }
/* "Enter user PIN": full-screen ocean blue, logo top-left, extra-large keys. */
.staff-lock {
  width: 100vw; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  border: 0; color: #fff; overflow-y: auto;
  background: radial-gradient(120% 90% at 20% 0%, #58687c 0%, transparent 60%),
              linear-gradient(160deg, #46556a 0%, #3b4859 45%, #2d3846 100%); /* brand night */
}
.staff-lock[open] { display: grid; place-items: center; }
.staff-lock::backdrop { background: #2d3846; }
.staff-logo {
  position: absolute; top: calc(20px + var(--safe-top)); left: calc(20px + var(--safe-left));
  width: auto; height: 160px; /* the stacked logo, reversed for the dark screen */
}
.staff-lock-body { display: flex; flex-direction: column; align-items: center; width: min(392px, 100%); }
.staff-title { margin: 0 0 20px; font-size: 2.1rem; font-weight: 800; letter-spacing: -.01em; text-align: center; }
.staff-lock .pin-dots { margin-bottom: 24px; gap: 16px; }
.staff-lock .pin-dots span { width: 20px; height: 20px; border-color: #fff; border-radius: 50%; }
.staff-lock .pin-dots span.is-on { background: #fff; }
.staff-lock .form-error { width: 100%; margin-bottom: 16px; background: #fff1f0; }
.staff-pad { width: 100%; gap: 12px; }
.staff-pad .pin-key {
  min-height: 96px; border: 1px solid rgb(255 255 255 / 0.28); border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 0.12); color: #fff;
  font-size: 2.2rem; font-weight: 700;
  backdrop-filter: blur(2px);
}
.staff-pad .pin-key:hover:not(:disabled) { background: rgb(255 255 255 / 0.22); }
.staff-pad .pin-key:active:not(:disabled) { background: rgb(255 255 255 / 0.32); }
.staff-pad .pin-key-ok { background: #fff; border-color: #fff; color: #252E37; font-size: 1.5rem; font-weight: 800; }
.staff-pad .pin-key-ok:hover:not(:disabled) { background: #EFE8D6; }
.staff-lock :focus-visible { outline-color: #9ee7ff; }
.staff-owner {
  margin-top: 24px; min-height: 48px; padding: 0 16px;
  border: 0; border-radius: var(--radius); background: none;
  color: #D9D2C2; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.staff-owner:hover:not(:disabled) { color: #fff; background: rgb(255 255 255 / 0.08); }
/* Log-in gate, in the same full-screen ocean blue as "Enter user PIN". */
.gate-blue .staff-lock-body { width: min(440px, 100%); }
.gate-blue .gate-sub { margin: -8px 0 24px; color: #D9D2C2; font-size: 1.05rem; text-align: center; }
.gate-blue .gate-recaptcha { color: #D9D2C2; }
.gate-blue .gate-form { width: 100%; }
.gate-blue .field { margin-bottom: 18px; }
.gate-blue .field-label { color: #EFE8D6; font-size: 1rem; margin-bottom: 8px; }
.gate-blue .text-input {
  min-height: 64px; padding: 0 18px;
  background: #fff; color: var(--text);
  border: 0; border-radius: var(--radius-lg);
  font-size: 1.2rem;
}
.gate-blue .gate-form .btn-primary {
  min-height: 72px; margin-top: 6px;
  background: #fff; color: #252E37; border-radius: var(--radius-lg);
  font-size: 1.3rem; font-weight: 800;
}
.gate-blue .gate-form .btn-primary:hover:not(:disabled) { background: #EFE8D6; }
.gate-blue .gate-form .btn-primary:disabled { background: rgb(255 255 255 / 0.7); }
.gate-blue .gate-links { margin-top: 18px; }
.gate-blue .gate-link {
  min-height: 44px; padding: 0 14px; color: #D9D2C2; font-size: 1rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}
.gate-blue .gate-link:hover:not(:disabled) { color: #fff; background: rgb(255 255 255 / 0.08); }
.gate-blue .form-error { width: 100%; margin-bottom: 16px; background: #fff1f0; }
.gate-blue .gate-sent { width: 100%; background: #fff; }
.gate-blue .gate-stores { display: grid; gap: 12px; width: 100%; }
.gate-blue .gate-store { min-height: 72px; background: #fff; color: #252E37; border-radius: var(--radius-lg); font-size: 1.25rem; font-weight: 800; }
.gate-blue .gate-store:hover { background: #EFE8D6; }
/* auth-action.html (links in account emails): the same blue screen, as a page. */
.action-page { display: grid; place-items: center; position: relative; }
.action-brand { margin: 0 0 6px; color: #D9D2C2; font-size: 1.15rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.gate-blue .action-open { display: flex; align-items: center; justify-content: center; margin-top: 16px; min-height: 72px; background: #fff; color: #252E37; border-radius: var(--radius-lg); font-size: 1.3rem; font-weight: 800; text-decoration: none; }
.gate-blue .action-open:hover { background: #EFE8D6; }
.gate-blue .gate-loading { color: #EFE8D6; }
.gate-blue .gate-loading .muted { color: #D9D2C2; }
.gate-blue .btn-block.btn-lg:not(.gate-form .btn-lg) { min-height: 72px; background: #fff; color: #252E37; font-size: 1.2rem; border-radius: var(--radius-lg); }

@media (max-width: 640px) {
  .staff-logo { height: 96px; } /* phones: keep the corner logo clear of the title */
  .staff-lock-body { padding-top: 88px; }
}
@media (max-height: 720px) {
  .staff-pad .pin-key { min-height: 76px; font-size: 1.9rem; }
  .staff-title { font-size: 1.7rem; margin-bottom: 14px; }
}

/* Reports → User Activity */
.activity-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 8px 0 4px; }
.activity-controls .field { margin: 0; min-width: 170px; }
.activity-controls .btn { min-height: 48px; }
.activity-summary { margin: 12px 0; overflow-x: auto; }
.activity-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.activity-table th, .activity-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.activity-table th:first-child { text-align: left; }
.activity-table thead th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.activity-failed { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--danger); font-weight: 600; font-size: .9rem; }
.activity-day + .activity-day { margin-top: 16px; }
.activity-day-title { margin: 0 0 6px; font-size: .95rem; font-weight: 800; }
.activity-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.activity-item {
  display: grid; grid-template-columns: 72px minmax(150px, 1.2fr) minmax(0, 2.4fr) auto; align-items: center; gap: 12px;
  padding: 8px 12px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .9rem;
}
.activity-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.activity-who { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 700; }
.activity-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-what { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.activity-detail { color: var(--muted); }
.activity-where { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.activity-sale .activity-what { color: var(--green); font-weight: 600; }
.activity-pin_failed .activity-what { color: var(--danger); font-weight: 600; }
@media (max-width: 860px) {
  .activity-item { grid-template-columns: 64px 1fr; }
  .activity-what, .activity-where { grid-column: 2; }
}

/* Admin PIN recovery */
.recovery-title { margin: 0 0 6px; font-size: 1.2rem; font-weight: 800; }
.recovery-text { margin: 0 0 16px; color: var(--muted); font-size: .92rem; }
.recovery-form .btn-lg { margin-top: 4px; }
.recovery-back { display: block; margin: 12px auto 0; }
.recovery-code-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.recovery-code {
  flex: 1; padding: 12px 14px; text-align: center;
  background: var(--surface); border: 2px dashed var(--border-strong); border-radius: var(--radius);
  font-size: 1.4rem; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums;
}
.recovery-on-blue { width: 100%; padding: 24px; background: var(--surface); color: var(--text); border-radius: var(--radius-lg); }
.emp-need-pin { margin: 0 24px 4px; }

/* Inventory */
.inv-groups { display: grid; gap: 12px; max-width: 880px; margin: 0 auto; }
.inv-group {
  padding: 12px 16px 12px 20px;
  background: var(--surface);
  border: 1px solid var(--border); border-left: 6px solid var(--cat);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.inv-group-header { display: flex; align-items: center; gap: 8px; }
.inv-group-title { flex: 1; min-width: 0; }
.inv-group-title h2 { font-size: 1.05rem; font-weight: 700; color: var(--cat-ink); }
.inv-count { font-size: .8rem; color: var(--muted); }
.inv-items { margin: 8px 0 4px; padding: 0; list-style: none; }
.inv-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.inv-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inv-item-name { font-weight: 600; }
.inv-item-desc { font-size: .8rem; color: var(--muted); }
.inv-item-price { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cat-ink); }
.inv-group .icon-btn { width: 40px; height: 40px; }
.inv-add-item { margin: 4px 0 0 -8px; color: var(--cat-ink); font-weight: 600; }

.swatch-dot { display: block; width: 14px; height: 14px; border-radius: 3px; background: var(--cat); flex: none; }

/* Forms */
.field { margin: 0 0 16px; }
.text-input {
  width: 100%; min-height: 48px; padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
}
select.text-input { appearance: auto; }
.inv-form .money-field { min-height: 48px; font-size: 1.05rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 4px; padding: 0; border: 0; }
.swatches .field-label { width: 100%; }
.swatch {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer;
}
.swatch .swatch-dot { width: 28px; height: 28px; }
.swatch:has(input:checked) { border-color: var(--cat-ink); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.form-actions { gap: 8px; }

/* Order panel resize handle (left edge; drag outward to widen) */
.order { position: relative; }
.order-resize {
  position: absolute; top: 12px; bottom: 12px; left: -10px; width: 12px;
  cursor: ew-resize; touch-action: none; border-radius: var(--radius-sm);
}
.order-resize::after {
  content: ""; position: absolute; top: 50%; left: 4px;
  width: 4px; height: 40px; margin-top: -20px; border-radius: 2px;
  background: var(--border-strong); opacity: 0; transition: opacity .15s;
}
.order-resize:hover::after, .order-resize:focus-visible::after, .is-resizing .order-resize::after { opacity: 1; }
.is-resizing { cursor: ew-resize; user-select: none; -webkit-user-select: none; }

/* Modifier groups (Inventory → Modifiers tab) */
.field-hint { margin: -2px 0 10px; color: var(--muted); font-size: .82rem; }
.mod-set { padding: 0; border: 0; }
.mod-editor-rules { margin: 8px 0; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.mod-editor-options { display: grid; gap: var(--gap); margin: 0 0 4px; padding: 0; list-style: none; }
.mod-editor-option { display: flex; align-items: stretch; }
.mod-editor-option { gap: var(--gap); }
.mod-editor-option .text-input { flex: 1; min-width: 0; min-height: 44px; }
.money-field-sm { flex: none; width: 112px; min-height: 44px; padding: 0 10px; font-size: .95rem; }
.mod-editor-option .icon-btn { flex: none; width: 40px; height: 40px; }
.mod-add-option { margin: 0; color: var(--green); font-weight: 600; }
.inv-item-mods { font-size: .78rem; color: var(--muted); font-style: italic; }

.inv-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 880px; margin: -8px auto 16px; }
.inv-tabs { display: flex; }
.inv-tabs { gap: var(--gap); }
.inv-toggle-all { margin: 0; }
.inv-toggle-all .icon { transition: transform .15s; }
.inv-toggle-all.is-collapsed .icon { transform: rotate(-90deg); }

/* Collapsible sections: the group name is the toggle. */
.inv-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; margin: 0 0 0 -6px; padding: 0 6px;
  border: 0; border-radius: var(--radius-sm); background: none;
  font: inherit; color: inherit; text-align: left;
}
.inv-toggle:hover { background: #f3f1ec; }
.inv-toggle .icon { width: 18px; height: 18px; flex: none; transition: transform .15s; }
.inv-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.inv-tabs .chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.inv-mod { --cat: var(--border-strong); --cat-ink: var(--text); }
.inv-mod-options { margin: 6px 0 2px; font-size: .9rem; }

/* Checklists: item → modifier groups, modifier group → items */
.check-list { display: grid; gap: var(--gap); }
.check-row:has(input:checked) { position: relative; z-index: 1; }
.check-row {
  align-items: flex-start; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.check-row:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.check-row input { margin-top: 2px; }
.check-text { display: flex; flex-direction: column; }
.check-sub { font-size: .78rem; color: var(--muted); }
.item-pick {
  margin-bottom: 0; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--cat); border-radius: var(--radius);
}
.item-pick + .item-pick { margin-top: 8px; }
.item-pick-all { font-weight: 700; color: var(--cat-ink); }
.item-pick-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; padding-left: 26px; }
.item-defaults .mod-choices { margin-bottom: 8px; }

/* Modifier picker (checkout) */
.mod-group { margin: 0 0 20px; padding: 0; border: 0; }
.mod-legend { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; margin-bottom: 8px; padding: 0; }
.mod-group-name { font-weight: 700; }
.mod-rule { font-size: .78rem; color: var(--muted); }
.mod-rule.is-required { color: var(--text); font-weight: 700; } /* a rule to follow, not an error */
.mod-option {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 14px; margin-bottom: var(--gap);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  cursor: pointer;
}
.mod-option input { width: 18px; height: 18px; flex: none; accent-color: var(--green); }
.mod-option-name { flex: 1; }
.mod-option-price { color: var(--muted); font-variant-numeric: tabular-nums; }
.mod-option:has(input:checked) { position: relative; z-index: 1; }
.mod-option:has(input:checked) { border-color: var(--green); background: var(--green-soft); }

/* ---------- Dialogs ---------- */
.dialog {
  width: min(448px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0; border-radius: var(--radius-lg);
  background: var(--dialog); color: var(--text);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.3);
}
.dialog-wide { width: min(640px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgb(24 22 18 / 0.62); }
.dialog[open] { animation: dialog-in .18s ease-out; }
.dialog-inner { padding: 24px; }
/* Open the drawer: confirming the float left at close-out. */
.drawer-form { display: grid; gap: 12px; }
.drawer-float { padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); text-align: center; }
.drawer-float-label { margin: 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.drawer-float-amount { margin: 4px 0 8px; font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.drawer-float .field-hint { margin: 0; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.dialog-title { font-size: 1.2rem; font-weight: 700; }
.dialog-sub { margin-top: 4px; color: var(--muted); font-size: .92rem; }
.dialog-close { margin: -6px -8px 0 0; }

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
}

/* Payment */
.amount-due { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.amount-label { color: var(--muted); font-size: .9rem; }
.amount-value { font-size: 3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }

.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 24px; padding: 0; border: 0; }
.method {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px;
  background: var(--surface);
  border: 2px solid var(--border-strong); border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.method .icon { width: 24px; height: 24px; margin-bottom: 4px; }
.method-label { font-weight: 600; }
.method-hint { font-size: .7rem; color: var(--muted); }
.method:has(input:checked) { position: relative; z-index: 1; }
.method:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.method:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.cash-panel { margin-bottom: 24px; }
.field-label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 600; }
.money-field {
  display: flex; align-items: center; gap: 6px;
  min-height: 52px; padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: 1.3rem; font-weight: 600;
}
.money-field:focus-within { outline: 3px solid var(--focus); outline-offset: 1px; }
.money-input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: none;
  font-size: inherit; font-weight: inherit; font-variant-numeric: tabular-nums;
}
.quick-tender { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: 10px; }
.chip-neutral { --cat-ink: var(--text); --cat-soft: var(--surface); --cat-line: var(--border-strong); min-height: 44px; padding: 0 16px; }
.chip-neutral:hover { background: #f3f1ec; }
.change-due { margin-top: 12px; font-size: 1.18rem; font-weight: 600; }
.change-due.is-short { color: var(--danger); }

.form-error {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 16px; padding: 10px 12px;
  background: var(--danger-soft); color: var(--danger);
  border-radius: var(--radius-sm); font-size: .9rem; text-align: left;
}

.processing, .done { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0 24px; text-align: center; }
.processing-text { color: var(--muted); }
.spinner {
  width: 44px; height: 44px;
  border: 4px solid #dfe7dc; border-top-color: var(--green); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.done-check { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--radius-lg); background: var(--green-soft); color: var(--green); }
.done-check .icon { width: 32px; height: 32px; }
.done-number { font-size: 1.6rem; font-weight: 800; }
.done-change { font-size: 1.475rem; font-weight: 700; color: var(--green); }

/* Orders history */
.orders-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-label { font-size: .78rem; color: var(--muted); }
.stat-value { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.orders-empty { padding: 32px 0; text-align: center; color: var(--muted); }

.orders-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: min(60dvh, 520px); overflow-y: auto;
  margin: 0; padding: 0; list-style: none;
}
.order-record { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.order-record summary {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  padding: 12px 14px;
  list-style: none; cursor: pointer;
}
.order-record summary::-webkit-details-marker { display: none; }
.order-no { font-weight: 700; font-variant-numeric: tabular-nums; }
.order-meta { color: var(--muted); font-size: .85rem; }
.badge { padding: 2px 8px; border-radius: var(--radius-sm); background: #eef0ec; font-size: .72rem; font-weight: 600; }
.order-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.record-lines { margin: 0; padding: 0 14px 12px; list-style: none; font-size: .88rem; }
.record-lines li { display: flex; justify-content: space-between; padding: 3px 0; }
.record-sub { color: var(--muted); }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; z-index: 10;
  left: 50%; bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 12px 10px 16px;
  background: #22211e; color: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  font-size: .9rem;
  animation: dialog-in .2s ease-out;
}
.toast-action { min-height: 36px; padding: 0 8px; border: 0; border-radius: var(--radius-sm); background: none; color: #b9dcb2; font-weight: 700; }
.toast-action:hover { background: rgb(255 255 255 / 0.08); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app { height: auto; min-height: 100dvh; }
  .brand { padding-inline-start: 0; }
  .layout { grid-template-columns: 1fr; }
  .order-resize { display: none; }
  .split-layout { grid-template-columns: 1fr; }
  .menu { overflow: visible; padding: 16px calc(16px + var(--safe-right)) 16px calc(16px + var(--safe-left)); }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); }
  .order { margin: 0 calc(12px + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(12px + var(--safe-left)); }
}

/* Standalone (installed) — the app owns the whole window. */
@media (display-mode: standalone) {
  body { user-select: none; -webkit-user-select: none; }
  input { user-select: text; -webkit-user-select: text; }
}

/* Orders: receipt numbers, refunds */
.order-record summary { display: flex; flex-wrap: wrap; }
.order-meta { flex: 1; min-width: 120px; }
.badge-refund { background: var(--danger-soft); color: var(--danger); }
.badge-refund.is-full { background: var(--danger); color: #fff; }
.order-amt.is-refunded { color: var(--muted); text-decoration: line-through; }
.record-refund { color: var(--danger); font-weight: 600; }
.order-actions { display: flex; justify-content: flex-end; padding: 0 14px 14px; }
.dialog-header-actions { display: flex; align-items: center; gap: 6px; }
.orders-download { min-height: 40px; }
/* Sales Report: fold-out box, cash / card boxes, sections */
.report-box > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.report-box > summary::-webkit-details-marker { display: none; }
.report-box > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.report-box[open] > summary::before { transform: rotate(90deg); }
.report-summary .admin-pin-title { margin: 0; font-size: 1.05rem; font-weight: 800; }
.report-summary-hint { margin: 0; }
.report-inner { margin-top: 10px; }
.recon { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 8px; }
.recon-box { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.recon-title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1rem; font-weight: 800; }
.recon-title .icon { width: 18px; height: 18px; color: var(--muted); }
.recon-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 0; font-size: .95rem; }
.recon-row.is-strong { font-weight: 800; }
.recon-row.is-line { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
.recon-row.is-muted { color: var(--muted); font-size: .88rem; }
.recon-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.recon-note { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; }
.recon-fee-note { margin: 6px 0 0; font-size: .85rem; }
.recon-verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; padding: 8px 10px; border-radius: var(--radius); font-weight: 700; }
.recon-verdict.is-loss { background: #fdecec; color: #b42318; }
.recon-verdict.is-even { background: #e6f4e6; color: #1f6b1f; }
.recon-verdict.is-surplus { background: #e3eefc; color: #1d55a8; }
.recon-verdict .diff-badge { background: #fff; }
.report-section { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.report-section > summary { cursor: pointer; padding: 10px 14px; font-weight: 800; }
.report-section-body { padding: 0 14px 12px; }
.report-orders { margin: 0; }
.exp-group { margin-bottom: 10px; }
.exp-group-title { display: flex; justify-content: space-between; margin: 4px 0 0; font-weight: 800; }
.exp-group-total { font-variant-numeric: tabular-nums; }
.exp-row.exp-row-static { grid-template-columns: auto 1fr auto; }
.order-refund { min-height: 44px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #8a2923; }
.btn-danger:disabled { background: #d4a5a1; }
.refund-top { display: flex; margin-bottom: 12px; }
.refund-whole { min-height: 48px; }
.refund-lines { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
.refund-line { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.refund-line-head, .refund-mods li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.refund-name { font-weight: 700; }
.refund-each { color: var(--muted); font-weight: 400; font-size: .85rem; }
.refund-mods { margin: 8px 0 0; padding: 8px 0 0 12px; list-style: none; border-top: 1px solid var(--border); display: grid; gap: 6px; font-size: .92rem; }
.refund-mods li.is-off { opacity: .55; }
.refund-count { width: 84px; min-height: 44px; }
.refund-total { margin: 4px 0 8px; font-size: 1.1rem; font-weight: 700; }
.refund-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 8px; }

/* Reports → Sales Reports: drawer, end of day, report */
.eod-box { border-bottom: 1px solid var(--border); }
.eod-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.eod-row .field { margin: 0; flex: 1; min-width: 220px; max-width: 320px; }
.eod-row .btn { min-height: 52px; }
.eod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 16px; }
.eod-card-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.eod-card-row .money-field { flex: 1; min-width: 150px; }
.eod-fee { min-height: 52px; white-space: nowrap; }
.eod-preview { display: grid; gap: 6px; margin: 0 0 12px; }
.eod-check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 12px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius); }
.eod-check-label { font-weight: 700; min-width: 120px; }
.eod-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--green-soft); color: var(--green); font-weight: 600; font-size: .9rem; }
.eod-note .icon { width: 16px; height: 16px; flex: none; }
.eod-note.is-flag { background: #fff4e5; color: #8a4b00; }
.eod-float { margin-bottom: 14px; }
.eod-deposit { font-weight: 700; color: var(--text); }
.sales-table tr.is-flag th { color: #8a4b00; }
.exp-box { margin: 4px 0 14px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.exp-box .sales-h3 { margin-top: 0; }
.exp-list { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 6px; }
.exp-row { display: grid; grid-template-columns: auto 1fr auto 36px; align-items: center; gap: 10px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.exp-type { font-weight: 700; font-size: .85rem; padding: 2px 8px; border-radius: var(--radius-sm); background: #eef0ec; white-space: nowrap; }
.exp-cash { background: #fff4e5; color: #8a4b00; }
.exp-payable { background: #fdecec; color: #b42318; }
.exp-receivable { background: #e3eefc; color: #1d55a8; }
.exp-detail { min-width: 0; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.exp-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.exp-editor { margin-bottom: 10px; }
.exp-totals { font-weight: 600; color: var(--text); }
.eod-confirm { margin-top: 8px; padding: 12px 14px; background: var(--surface-sunken); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.eod-confirm p { margin: 0 0 10px; font-weight: 600; }
.eod-confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Close-out differences: loss red, even green, surplus blue (always with the word, never colour alone). */
.diff-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; }
.diff-loss { background: #fdecec; color: #b42318; }
.diff-even { background: #e6f4e6; color: #1f6b1f; }
.diff-surplus { background: #e3eefc; color: #1d55a8; }
.sales-span { margin: 8px 0 12px; color: var(--muted); font-size: .9rem; }
.sales-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.sales-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sales-tile-value { font-size: 1.45rem; font-weight: 800; }
.sales-tile-sub { color: var(--muted); font-size: .8rem; }
.sales-tile.is-total { background: var(--surface-sunken); border-color: var(--border-strong); }
.sales-tile.is-loss .sales-tile-value { color: var(--danger); }
.sales-h3 { margin: 16px 0 8px; font-size: 1rem; font-weight: 800; }
.sales-checks { margin-bottom: 8px; }
.sales-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sales-table th, .sales-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.sales-table thead th { color: var(--muted); font-size: .78rem; font-weight: 600; }
.sales-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sales-table tr.is-strong th, .sales-table tr.is-strong td { font-weight: 800; }
.sales-table tr.is-gap th, .sales-table tr.is-gap td { padding-top: 18px; }
.sales-table td.is-loss { color: var(--danger); }
.sales-table .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }
.sales-refunds { display: block; overflow-x: auto; }

/* Reports → Analytics */
.viz { --viz-series: #2a78d6; --viz-grid: #e1e0d9; --viz-axis: #c3c2b7; --viz-muted: #898781; position: relative; transition: opacity .15s; }
.viz.is-loading { opacity: .5; }
.viz-card { margin-top: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.viz-card .sales-h3 { margin-top: 0; }
.viz-sub { margin-top: -4px; }
.viz-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.viz-chart { width: 100%; }
.viz-svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-base { stroke: var(--viz-axis); stroke-width: 1; }
.viz-tick { fill: var(--viz-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-label { fill: var(--text); font-size: 12px; font-weight: 700; }
.viz-bar { fill: var(--viz-series); }
.viz-hit { fill: transparent; }
.viz-mark { outline: none; cursor: default; }
.viz-mark:hover .viz-bar, .viz-mark:focus .viz-bar { fill: #1c5cab; }
.viz-mark:focus-visible .viz-hit { stroke: var(--focus); stroke-width: 2; }
.viz-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 120px;
  padding: 8px 10px; background: #1d1c1a; color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md); font-size: .82rem;
}
.viz-tip-head strong { font-size: .95rem; }
.viz-tip-row span, .viz-tip-head span { color: #d6d3cc; }
.viz-table { margin-top: 8px; }
.viz-table summary { cursor: pointer; color: var(--muted); font-size: .85rem; font-weight: 600; }
.viz-table .sales-table { margin-top: 6px; }
.viz-rank-name { font-weight: 600; }
.viz-rank-bar { display: block; height: 6px; margin-top: 4px; background: var(--viz-series); border-radius: 0 3px 3px 0; }
.viz-heat-wrap { overflow-x: auto; }
.viz-heat { display: grid; gap: 2px; min-width: 420px; }
.viz-heat-hour { color: var(--viz-muted); font-size: 11px; text-align: center; white-space: nowrap; }
.viz-heat-day { color: var(--muted); font-size: .8rem; font-weight: 600; align-self: center; }
.viz-heat-cell { height: 26px; border-radius: 3px; background: #f0efec; outline: none; }
.viz-heat-cell.is-empty { background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--border); }
.viz-heat-cell:not(.is-empty):hover, .viz-heat-cell:focus-visible { box-shadow: 0 0 0 2px #1d1c1a; }
.viz-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; color: var(--muted); font-size: .8rem; flex-wrap: wrap; }
.viz-legend-step { width: 22px; height: 12px; border-radius: 2px; }

/* Two-factor authentication */
.tfa-status { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 4px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.tfa-status .icon { width: 16px; height: 16px; }
.tfa-status.is-on { background: var(--green-soft); color: var(--green); }
.tfa-status.is-off { background: #eef0ec; color: var(--muted); }
.tfa-steps { margin: 8px 0 12px; padding-left: 20px; display: grid; gap: 12px; }
.tfa-steps li { line-height: 1.45; }
.tfa-qr { display: block; width: fit-content; margin: 10px 0 6px; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.tfa-qr svg { display: block; }
.tfa-key summary { cursor: pointer; color: var(--muted); font-size: .88rem; font-weight: 600; }
.tfa-key p { margin: 6px 0 0; font-size: .9rem; }
.tfa-secret { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .95rem; letter-spacing: .06em; word-break: break-all; background: var(--surface-sunken); padding: 2px 6px; border-radius: 4px; }
.tfa-code { display: block; max-width: 200px; margin-top: 6px; font-size: 1.4rem; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; }
.tfa-code-lg { max-width: none; width: 100%; font-size: 1.8rem; min-height: 60px; }
.tfa-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tfa-wait { color: var(--muted); }
/* On the blue sign-up screen */
.tfa-gate { width: 100%; color: #EFE8D6; }
.tfa-gate .tfa-steps { color: #fff; }
.tfa-gate .tfa-key summary, .tfa-gate .tfa-key p { color: #D9D2C2; }
.tfa-gate .tfa-secret { background: rgb(255 255 255 / .15); color: #fff; }
.tfa-gate .tfa-code { background: #fff; color: var(--text); border: 0; border-radius: var(--radius-lg); min-height: 60px; }
.tfa-gate .tfa-actions .btn-primary { background: #fff; color: #252E37; border-radius: var(--radius-lg); font-weight: 800; }
.tfa-gate .tfa-actions .btn-outline { background: transparent; color: #fff; border-color: rgb(255 255 255 / .5); }
.dialog-code { width: min(420px, calc(100vw - 32px)); }
.code-form .field-hint { margin-top: 8px; }
.code-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

/* Open Drawer / End of Day: three text sizes (L title, M labels and amounts, S notes),
   three colours (ink, muted, the green accent); loss / even / surplus badges carry status. */
.eod-box .eod-h { margin: 0 0 2px; font-size: 1.2rem; font-weight: 700; color: var(--text); }
.eod-box .eod-m { font-size: 1rem; font-weight: 700; color: var(--text); }
.eod-box .eod-s { margin: 0 0 10px; font-size: .85rem; font-weight: 400; color: var(--muted); }
.eod-box .eod-s.eod-flag { display: flex; align-items: center; gap: 6px; color: var(--text); font-weight: 700; }
.eod-box .eod-s .icon { width: 16px; height: 16px; }
.eod-box .field-label { font-size: 1rem; font-weight: 700; color: var(--text); }
.eod-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.eod-fields .eod-s { margin: 6px 0 0; }
.eod-box .eod-should { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 30px; margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
.eod-box .eod-fee { margin-top: 6px; padding: 0; min-height: 32px; font-size: .85rem; font-weight: 400; color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.eod-box .eod-preview { display: grid; gap: 0; margin: 4px 0 14px; }
.eod-box .eod-check { display: flex; align-items: center; gap: 12px; padding: 10px 0; background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.eod-box .eod-check-label { min-width: 56px; font-size: 1rem; font-weight: 700; color: var(--text); }
.eod-box .eod-check-value { flex: 1; font-size: 1rem; color: var(--muted); }
.eod-box .eod-preview .eod-s { margin: 8px 0 0; }
.eod-box .eod-deposit { margin: 10px 0 0; }
.eod-box .eod-deposit .eod-s { margin: 0; font-weight: 400; }
/* Expenses dialog */
.exp-total { margin: 4px 0 10px; font-weight: 700; }
.exp-body .field-hint { margin-bottom: 6px; }

/* Sales Report as a running list: L (section titles, net lines), M (rows), S (notes);
   ink, muted and the green accent (links) — status badges only for loss / even / surplus. */
.sales-body .rl-s { margin: 0 0 4px; font-size: .85rem; font-weight: 400; color: var(--muted); }
.sales-body .rl-m { margin: 6px 0 4px; font-size: 1rem; font-weight: 700; color: var(--text); }
.sales-body .rl-m .rl-s { font-weight: 400; }
.rl-block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.rl-h { margin: 0 0 6px; font-size: 1.2rem; font-weight: 700; color: var(--text); }
.rl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; font-size: 1rem; font-weight: 400; color: var(--text); }
.rl-l1 { padding-left: 0; }
.rl-l2 { padding-left: 20px; }
.rl-l3 { padding-left: 44px; font-size: .85rem; color: var(--muted); }
.rl-total { font-weight: 700; }
.rl-net { margin-top: 2px; font-size: 1.2rem; font-weight: 700; }
.rl-note { font-size: .85rem; font-weight: 400; color: var(--muted); }
.rl-value { font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.rl-indent { padding-left: 20px; }
.rl-link { padding: 0; border: 0; background: none; font: inherit; color: var(--green); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
/* Expenses dialog: open payables / receivables */
.exp-open { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.exp-h { margin: 0 0 2px; font-size: 1rem; font-weight: 700; }
.exp-row.exp-row-open { grid-template-columns: auto 1fr auto auto; }
.exp-settle { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 3 / -1; justify-content: flex-end; }
.exp-settle .text-input { min-height: 40px; max-width: 170px; }
.exp-mark { min-height: 36px; }
.exp-actions { display: flex; align-items: center; gap: 4px; }
.exp-more { position: relative; }
.exp-more > summary { list-style: none; cursor: pointer; min-width: 36px; min-height: 36px; display: grid; place-items: center; font-weight: 800; border-radius: var(--radius-sm); }
.exp-more > summary::-webkit-details-marker { display: none; }
.exp-more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; display: grid; min-width: 170px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / .14); }
.exp-more-menu button { display: flex; align-items: center; gap: 8px; justify-content: flex-start; min-height: 40px; padding: 0 10px; }
.exp-row-busy { grid-template-columns: auto 1fr; }
.exp-row-busy .exp-settle { grid-column: 1 / -1; justify-content: flex-start; }
.exp-row-busy .exp-settle .money-field { max-width: 140px; }
.exp-row-busy > .form-error { grid-column: 1 / -1; margin: 0; }
.exp-attention { border-top-color: #f0b4ae; }
.exp-attention .exp-h { display: flex; align-items: center; gap: 6px; color: #b42318; }
.exp-amount.is-loss { color: #b42318; }
.account-panel .text-input { width: 100%; }
.rl-sub { margin-top: 8px; }

/* Reports → Suppliers */
.sup-editor { margin: 8px 0 14px; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.sup-form .exp-h { margin-bottom: 8px; }
.sup-total { margin: 10px 0; font-weight: 700; }
.sup-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.sup-card { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sup-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sup-who { min-width: 0; }
.sup-name { margin: 0; font-size: 1.05rem; font-weight: 800; }
.sup-contact { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.sup-notes { margin: 4px 0 0; font-size: .88rem; color: var(--muted); font-style: italic; overflow-wrap: anywhere; }
.sup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sup-actions .btn { min-height: 38px; padding: 0 12px; font-size: .9rem; }
.sup-confirm { font-weight: 600; font-size: .9rem; }
.sup-session { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.sup-session-total { margin: 0 0 6px; font-weight: 600; font-size: .92rem; }
.sup-session .exp-list { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- On Hold ---------- */
.tool-badged { position: relative; }
.tool-badge {
  position: absolute; top: 4px; right: 4px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--green); color: #fff;
  font-size: .75rem; font-weight: 700; line-height: 20px; text-align: center; pointer-events: none;
}
.payment-print { margin-top: 10px; min-height: 52px; }
.payment-print .icon { width: 20px; height: 20px; }
/* Hold sits 20px under Print receipt: apart, so one isn't tapped for the other. */
.payment-hold { margin-top: 20px; min-height: 52px; }
.payment-hold .icon { width: 20px; height: 20px; }
.holds-list { margin-bottom: 12px; }
.hold-row { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 8px; }
.hold-row > .btn { min-height: 50px; }
.eod-holds { margin: 4px 0 16px; padding: 12px 14px; background: var(--surface-sunken); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.eod-holds .eod-m { margin: 0 0 2px; }
.eod-hold-actions { flex-wrap: wrap; gap: 8px; margin-top: 0; }
.eod-projection { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- Plan features, custom offer, registers ---------- */
.billing-offer { margin: 0 0 16px; padding: 16px 18px; background: var(--green-soft); border: 1px solid var(--green); border-radius: var(--radius-lg); }
.billing-offer .billing-plan-name { margin: 2px 0 0; }
.billing-offer .btn { margin-top: 10px; }
.billing-includes, .billing-registers { margin: 0 0 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.billing-includes-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.billing-includes-list li.is-off { color: var(--muted); text-decoration: line-through; }
.limit-list { margin: 8px 0 10px; padding: 0; list-style: none; display: grid; gap: 6px; }
.limit-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius); }
.limit-name { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.limit-seen { color: var(--muted); font-size: .85rem; }

/* ---------- Deactivate account ---------- */
.btn-danger-outline { background: var(--surface); color: var(--danger); border: 1px solid var(--danger); }
.deact-note { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: .9rem; }
.deact-note .icon { width: 16px; height: 16px; flex: none; }

/* ---------- Hardware: Sienna Services Companion and the receipt printer ---------- */
.hw-sub { margin: 18px 0 8px; font-size: .95rem; }
.hw-list { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 6px; }
.hw-printer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius); }
.hw-printer-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.hw-printer-name .icon { width: 18px; height: 18px; flex: none; color: var(--muted); }
.hw-printer-name small { display: block; color: var(--muted); font-weight: 400; font-size: .82rem; }
.badge-on { background: var(--green-soft); color: var(--green); }
.hw-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.hw-ip-form { margin-top: 12px; }
.hw-code { max-width: 180px; font-size: 1.4rem; letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.receipt-layout { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 24px; align-items: start; margin-top: 8px; }
.receipt-form .text-input { width: 100%; max-width: none; }
.receipt-auto { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.receipt-preview-wrap { position: sticky; top: 12px; }
.receipt-preview-logo { display: block; max-width: 100%; margin: 0 auto 4px; image-rendering: pixelated; }
.receipt-logo { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.receipt-logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.receipt-logo-box { display: grid; place-items: center; width: 192px; height: 80px; padding: 6px; background: #fff; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.receipt-logo-thumb { max-width: 100%; max-height: 100%; image-rendering: pixelated; }
.receipt-logo-empty { color: var(--muted); font-size: .9rem; }
.receipt-logo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.receipt-meta { margin: 6px 0 10px; border-bottom: 1px solid var(--border); }
.hw-language { margin-top: 10px; }
.receipt-preview { margin: 0; padding: 16px 14px 28px; background: #fff; color: #111; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.08); font: 11.5px/1.4 ui-monospace, Consolas, monospace; white-space: pre; overflow-x: auto; max-width: 100%; }
@media (max-width: 900px) { .receipt-layout { grid-template-columns: minmax(0, 1fr); } .receipt-preview-wrap { position: static; } }
.hw-prompt { display: grid; gap: 12px; }
.hw-prompt p { margin: 0; }
.hw-prompt-downloads { display: grid; gap: 6px; justify-items: center; }
.hw-prompt-other { color: var(--muted); font-size: .88rem; }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hw-settings { margin-top: 16px; padding-top: 4px; }
a.btn { text-decoration: none; }
.badge-on { white-space: nowrap; }

/* Settings cards the signed-in person's role doesn't open */
.settings-card { position: relative; }
.settings-card-lock {
  position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; background: rgb(255 255 255 / .85); color: #1d2a3a; font-size: .75rem; font-weight: 700;
}
.settings-card-lock[hidden] { display: none; }
.settings-card-lock .icon { width: 14px; height: 14px; }

/* Users → Roles */
.role-editor { margin: 8px 0 14px; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.role-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.role-card { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.role-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.role-head .field-hint { margin: 2px 0 0; }
.role-name { margin: 0; font-size: 1.05rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.role-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.role-actions .btn { min-height: 38px; padding: 0 12px; font-size: .9rem; }
.role-pages { display: grid; }
.role-switch { padding: 8px 0; }
.emp-role { margin-left: 6px; }
.emp-role.is-elevated { background: #e3eefc; color: #1d55a8; }

/* Sales Reports → Delete session permanently */
.report-delete { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.delete-warning { padding: 12px 14px; border: 1px solid #f1c4c0; border-radius: var(--radius); background: #fdf1f0; color: #7a2520; font-size: .92rem; }
.delete-warning p { margin: 0; }
.delete-warning ul { margin: 6px 0 8px; padding-left: 20px; }

/* Device & Sync → Hardware: a Receipt printer card and a Cash drawer card */
.hw-card + .hw-card { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.hw-current { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 6px 0 4px; padding: 14px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius); }
.hw-current-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-lg); background: #e3eefc; color: #1d55a8; flex: none; }
.hw-current-icon .icon { width: 22px; height: 22px; }
.hw-current-text { flex: 1; min-width: 160px; }
.hw-current-text p { margin: 0; }
.hw-current-name { font-weight: 800; font-size: 1.05rem; overflow-wrap: anywhere; }
.hw-paper { width: auto; min-width: 150px; }
.hw-empty { margin: 4px 0 8px; color: var(--muted); }
.hw-ip { max-width: 220px; }
.hw-ip-details { margin-top: 12px; }
.hw-ip-details summary { cursor: pointer; color: var(--muted); font-size: .92rem; }
.hw-ip-details[open] summary { margin-bottom: 8px; }
.hw-ip-details .hw-ip-form { margin-top: 0; }
.hw-choose-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.hw-forget { color: var(--danger); }



/* Sales Reports → Print with no receipt printer: the browser prints just the report. */
.print-only { display: none; }
@media print {
  body.printing-report * { visibility: hidden; }
  body.printing-report .sales-body, body.printing-report .sales-body * { visibility: visible; }
  body.printing-report .sales-body { position: absolute; inset: 0 auto auto 0; width: 100%; padding: 0 12mm; }
  body.printing-report .print-only { display: block; margin: 0 0 6px; }
  body.printing-report .report-delete { display: none; }
}

/* After 5+ hours away: where the register stands. */
.register-status-when { margin: 0; font-size: 1.35rem; font-weight: 800; }
.register-status.is-closed .register-status-when { color: var(--danger); }
.register-status.is-open .register-status-when { color: var(--green); }
.register-status .btn { margin-top: 8px; }

/* Offline banner (ui/offline-banner.js): across the top of every page. */
.offline-banner { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; background: #b42318; color: #fff; font-weight: 600; font-size: .92rem; line-height: 1.35; text-align: center; }
.offline-banner[hidden] { display: none; }
.offline-banner .icon { flex: none; }

/* Yes / no questions (ui/confirm-dialog.js). */
.confirm-dialog { max-width: 480px; }
.confirm-body { display: grid; gap: 10px; margin: 4px 0 16px; }
.confirm-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* Menu page: search, reorder arrows, hidden items, a gap before delete (so it isn't hit by mistake). */
.inv-search { flex: 1; max-width: 320px; min-height: 40px; }
.inv-arrows { display: inline-flex; gap: 2px; }
.inv-arrows .icon-btn:disabled { opacity: .3; cursor: default; }
.inv-gap { width: 14px; flex: none; }
.inv-item.is-hidden .inv-item-name, .inv-item.is-hidden .inv-item-price, .inv-item.is-hidden .inv-item-desc { opacity: .55; }
.inv-hidden-badge { margin-left: 8px; font-size: .72rem; vertical-align: middle; }
.input-num { max-width: 90px; }
.mod-editor-rules .field-row { align-items: flex-start; }
/* Modifier steppers (an option chosen more than once). */
.mod-stepper { display: flex; align-items: center; gap: 8px; }
.mod-step-controls { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.mod-step-count { min-width: 1.6em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.mod-step:disabled { opacity: .35; }
@media (max-width: 560px) { .inv-toolbar { flex-wrap: wrap; } .inv-search { order: 3; max-width: none; flex-basis: 100%; } }

/* Until someone is logged in (app.js revealWhen): the register is hidden behind the log-in blue, so
   it never flashes up before the log-in or PIN screen. */
html:not(.app-shown) .app { visibility: hidden; }
html:not(.app-shown) body {
  background: radial-gradient(120% 90% at 20% 0%, #58687c 0%, transparent 60%),
              linear-gradient(160deg, #46556a 0%, #3b4859 45%, #2d3846 100%) fixed;
}

/* Accounts receivable: the total owed beside the heading; the new-receivable form. */
.exp-open-total { font-weight: 600; color: var(--muted); }
.owed-form { display: grid; gap: 12px; margin: 4px 0 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.owed-form .exp-h { margin: 0; }
.owed-form .form-actions { margin-top: 2px; }
.owed-tax { margin-left: 4px; }

/* PIN boxes: an eye button inside the right edge (ui/reveal.js). */
.reveal-field { position: relative; display: block; }
.reveal-field > .pin-input { width: 100%; padding-right: 52px; }
.reveal-field > .reveal-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; }

/* A PIN shown in plain view (Users → employee, admin PIN). */
.pin-current { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pin-shown { min-width: 5.5ch; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: 700 1.25rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .18em; }
.pin-ask { display: flex; gap: 8px; margin-top: 8px; max-width: 320px; }
.pin-ask .reveal-field { flex: 1; }

/* Beside the wordmark: the version, and this register's session. */
.brand-version { align-self: flex-end; margin-bottom: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
/* Three columns: brand left, session centred, tools right (the session stays centred whatever their widths). */
.topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.topbar > .brand { grid-column: 1; justify-self: start; }
.topbar > .session-status { grid-column: 2; }
.topbar > .topbar-actions { grid-column: 3; justify-self: end; }
/* Just text (with the status dot): no background or outline. */
.session-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .88rem; color: var(--muted); white-space: nowrap;
}
.session-status .session-state { font-weight: 700; color: var(--text); }
.session-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa1a8; flex: none; }
.session-status.is-open .session-dot { background: #2e9d57; box-shadow: 0 0 0 3px rgb(46 157 87 / .18); }
@media (max-width: 1000px) { .session-status .session-when { display: none; } }
@media (max-width: 520px) { .brand-version, .session-status { display: none; } }

/* Analytics: the "N other items" row under the top 10. */
.viz-rank-other th, .viz-rank-other td { color: var(--muted); font-style: italic; }

/* Orders: find an earlier order (another day, or a receipt number). */
.orders-find { display: grid; gap: 6px; margin-bottom: 14px; }
.orders-find-row { display: flex; flex-wrap: wrap; gap: 8px; }
.orders-find-row input[type="date"] { flex: 0 0 170px; }
.orders-find-row input[type="search"] { flex: 1 1 220px; min-width: 0; }
.orders-summary .stat-sub { display: block; font-size: .78rem; color: var(--muted); }
