:root {
  --bg: #f3f4f1;
  --panel: #ffffff;
  --ink: #17201e;
  --muted: #5d6b67;
  --line: #dde2de;
  --accent: #d9480f;
  --ok: #1f7a3d;
  --warn: #a15c00;
  --bad: #b3261e;
  --radius: 8px;
  --gap: 12px;
  font-size: 15px;
}
/* Colour themes (Settings > Shop settings, setting `theme`): green, indigo, sky blue, navy blue, purple.
   A theme is a set of values for the brand's colours, chosen by data-theme on <html> (applyTheme in public/money.js);
   with no attribute the look is navy blue, the default (the navy block comes first and carries :root; the others override it). A brand colour is never written as a literal anywhere else:
   every screen uses these variables, so every theme works. In each theme white on --brand and --brand-2, and --brand
   on white and on --soft, pass WCAG AA. Not themed: printed documents, the online shop (it has its own accent) and
   the developer console (its page says data-theme="green", so it stays green). */
:root, [data-theme="navy"] {
  --brand: #1b2a4e; --brand-2: #27478f; --brand-deep: #141f3b; --brand-2-deep: #1f3a78;
  --soft: #e9edf6; --soft-2: #d9e0f1; --soft-line: #9db0db; --tint: #f7f8fc; --tint-2: #f2f5fb;
  --on-brand: #fff; --on-brand-muted: #d7ddec; --on-brand-dim: #bcc5dc; --on-brand-faint: #94a0c0; --on-brand-line: #62709a;
  --brand-hi: #ffb066; --ring: rgba(39, 71, 143, .2);
}
[data-theme="green"] {
  --brand: #14433f;             /* the top bar; text in the brand colour */
  --brand-2: #0e7a6b;           /* main buttons, the line under the open entry, focus */
  --brand-deep: #0f3330;        /* a darker panel in the brand colour */
  --brand-2-deep: #0a6a5d;      /* a main button under the mouse */
  --soft: #e8f1ee;              /* the tint: a row under the mouse, tags, notes */
  --soft-2: #d7ece2;            /* a stronger tint */
  --soft-line: #8fcfc2;         /* a border in the brand's light shade */
  --tint: #f7faf9;              /* the lightest tint: a long list's row under the mouse */
  --tint-2: #f2faf8;            /* a chosen row or choice */
  --on-brand: #fff;             /* text on --brand and --brand-2 */
  --on-brand-muted: #d4e6e1;    /* quieter text on them: the tabs that are not open */
  --on-brand-dim: #b9d4cd;      /* a label on them */
  --on-brand-faint: #8fb3ab;    /* a small heading on --brand-deep */
  --on-brand-line: #5d8a83;     /* a border on them */
  --brand-hi: #ffb066;          /* the mark of the open tab on --brand, a button on it */
  --ring: rgba(14, 122, 107, .18);   /* the glow round a focused search box */
}
[data-theme="indigo"] {
  --brand: #312e81; --brand-2: #4f46e5; --brand-deep: #272462; --brand-2-deep: #4338ca;
  --soft: #eceefb; --soft-2: #dfe2fa; --soft-line: #a9aff0; --tint: #f8f8fe; --tint-2: #f3f4fe;
  --on-brand: #fff; --on-brand-muted: #dcddf5; --on-brand-dim: #c3c5ee; --on-brand-faint: #a2a5dd; --on-brand-line: #7275b8;
  --brand-hi: #ffb066; --ring: rgba(79, 70, 229, .2);
}
[data-theme="sky"] {
  --brand: #0369a1; --brand-2: #0273b0; --brand-deep: #075985; --brand-2-deep: #026399;
  --soft: #e8f4fb; --soft-2: #d3eaf8; --soft-line: #8cc8ea; --tint: #f6fafd; --tint-2: #eff8fd;
  --on-brand: #fff; --on-brand-muted: #e3f2fb; --on-brand-dim: #cfe8f7; --on-brand-faint: #a9d3ec; --on-brand-line: #5ea3cc;
  --brand-hi: #ffb066; --ring: rgba(2, 115, 176, .2);
}
[data-theme="purple"] {
  --brand: #4c1d7a; --brand-2: #7e22ce; --brand-deep: #3b1661; --brand-2-deep: #6b21a8;
  --soft: #f3ecfa; --soft-2: #e8dbf6; --soft-line: #c4a2ea; --tint: #fbf8fe; --tint-2: #f8f2fd;
  --on-brand: #fff; --on-brand-muted: #e6dbf3; --on-brand-dim: #d0bfe8; --on-brand-faint: #b39dd4; --on-brand-line: #8765ad;
  --brand-hi: #ffb066; --ring: rgba(126, 34, 206, .2);
}
/* Tick boxes, radio buttons, sliders and progress bars take the theme's colour, not the browser's blue. The browser
   draws the tick in white on it: white on --brand-2 passes WCAG AA in every theme (see above). */
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: var(--brand-2); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; line-height: 1.35; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.hide { display: none !important; }
.bad { color: var(--bad); }
.good { color: var(--ok); }
.warnc { color: var(--warn); }
.nowrap { white-space: nowrap; }

/* shell */
.top { display: flex; align-items: center; gap: 4px; background: var(--brand); color: var(--on-brand); padding: 0 12px; height: 48px; position: sticky; top: 0; z-index: 20; }
.brand { font-weight: 700; letter-spacing: .3px; margin-right: 14px; white-space: nowrap; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--on-brand-muted); text-decoration: none; padding: 12px 11px 11px; line-height: 22px; white-space: nowrap; border-bottom: 3px solid transparent; }
.nav a:hover { color: var(--on-brand); }
.nav a.on { color: var(--on-brand); border-bottom-color: var(--brand-hi); font-weight: 600; }
.navmore { position: relative; flex: none; }
.navmore[hidden] { display: none; }
.navmore > button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--on-brand-muted); font: inherit; padding: 12px 11px 11px; line-height: 22px; white-space: nowrap; cursor: pointer; }
.navmore > button:hover { color: var(--on-brand); }
.navmore.dot > button::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 5px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.navmenu { position: absolute; right: 0; top: 100%; display: flex; flex-direction: column; min-width: 190px; background: var(--brand); border-radius: 0 0 8px 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); padding: 4px 0; z-index: 40; }
.navmenu[hidden] { display: none; }
.navmenu a { color: var(--on-brand-muted); text-decoration: none; padding: 10px 16px; white-space: nowrap; }
.navmenu a:hover { color: var(--on-brand); background: rgba(255, 255, 255, .08); }
.navmenu .badge { margin-left: 5px; padding: 0 6px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .75rem; }
.navmenu .badge:empty { display: none; }
.who { display: flex; gap: 8px; align-items: center; white-space: nowrap; font-size: .85rem; color: var(--on-brand-muted); }
.who button { background: none; border: 1px solid var(--on-brand-line); color: var(--on-brand); border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.page { padding: var(--gap); max-width: 1500px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--gap); }
.head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); margin-bottom: var(--gap); flex-wrap: wrap; }

/* controls */
input, select, textarea { background: #fff; border: 1px solid #b9c3be; border-radius: 6px; padding: 8px 10px; min-height: 38px; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: var(--brand-2); }
label.f { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; color: var(--muted); }
label.f > input, label.f > select, label.f > textarea { font-size: 1rem; color: var(--ink); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--gap); }
.btn { border: 1px solid #b9c3be; background: #fff; border-radius: 6px; padding: 8px 13px; min-height: 38px; cursor: pointer; font-weight: 500; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-2-deep); }
.btn.danger { color: var(--bad); border-color: #e0b4b0; }
.btn.small { padding: 4px 9px; min-height: 30px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
a.btn { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.seg { display: inline-flex; border: 1px solid #b9c3be; border-radius: 6px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: #fff; padding: 8px 13px; min-height: 38px; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand-2); color: var(--on-brand); }

/* tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid #edf0ed; vertical-align: middle; }
th.num { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--soft); }
tr.off td { color: var(--muted); text-decoration: line-through; }
.tag { display: inline-block; font-size: .75rem; padding: 1px 7px; border-radius: 10px; background: var(--soft); color: var(--brand); }
.tag.warn { background: #fdf0d9; color: var(--warn); }
.tag.bad { background: #fbe6e4; color: var(--bad); }
.tag.owner { background: #fdf0d9; color: var(--warn); }

.nav .badge { margin-left: 5px; padding: 0 6px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .75rem; }
.nav .badge:empty { display: none; }

/* item photos */
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.photo { position: relative; margin: 0; width: 96px; height: 96px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo figcaption { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; justify-content: space-between; align-items: flex-end; gap: 4px; }
.photo figcaption .x { background: var(--panel); border-radius: 50%; }
.photo.add { display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; color: var(--brand); border-style: dashed; font-size: .85rem; }

/* editing a saved bill */
.editbar { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; background: #fdf0d9; color: var(--warn); border: 1px solid #f1d3a1; border-radius: var(--radius); padding: 8px 12px; }
.editbar b { color: var(--ink); }

/* rights on the Users screen */
.rights { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 16px; }
.rights h3 { grid-column: 1 / -1; margin-top: 8px; font-size: .9rem; color: var(--muted); }
.rights label { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.rights input { width: auto; min-height: 0; }
.ulist tr.off td.u-acts { text-decoration: none; }   /* a switched-off user's row is struck through, not its buttons */
/* Users & rights on a phone: each user is a block, with the buttons (Rights first) on a line of their own under the name */
@media (max-width: 860px) {
  .ulist, .ulist tbody { display: block; }
  .ulist tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
  .ulist tr:first-child, .ulist .u-n { display: none; }
  .ulist td { border: 0; padding: 0 4px; }
  .ulist .u-acts { grid-column: 1 / -1; padding-top: 6px; text-align: left; white-space: normal; }
  .ulist .u-acts .btn { margin: 0 4px 4px 0; }
}

/* colour theme swatches (Settings): each button carries its theme in data-theme, so the colours inside it are that theme's */
.theme-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); gap: 8px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 3px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); cursor: pointer; font-size: .82rem; text-align: center; }
.theme-opt .theme-sw { width: calc(100% - 6px); }
.theme-opt:hover { border-color: var(--brand-2); }
.theme-opt.on { border-color: var(--brand-2); background: var(--soft); color: var(--brand); font-weight: 600; }
.theme-sw { display: flex; width: 100%; height: 34px; border-radius: 6px; overflow: hidden; }
.theme-sw i { flex: 1; background: var(--brand); }
.theme-sw i:nth-child(2) { background: var(--brand-2); }
.theme-sw i:nth-child(3) { background: var(--soft-2); }

/* pos */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); height: calc(100vh - var(--bars-h, 48px)); padding: var(--gap); }
.pos-main { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.scanbox { position: relative; }
.scanbox input { font-size: 1.25rem; min-height: 52px; border: 2px solid var(--brand-2); padding-left: 14px; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #9fb0aa; border-radius: 0 0 8px 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); z-index: 15; max-height: 52vh; overflow-y: auto; }
.sug { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #edf0ed; align-items: center; }
.sug.on, .sug:hover { background: var(--soft); }
.sug .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partybar { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; flex-wrap: wrap; }
.partybar .pname { font-weight: 600; }
.cart { flex: 1; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-y: auto; }
.cart table { min-width: 560px; }
.cart th { position: sticky; top: 0; background: #f7f8f6; z-index: 1; }
.cart td input { min-height: 34px; padding: 4px 6px; text-align: right; width: 84px; }
.cart .nm { font-weight: 600; }
.cart tr.flash td { background: #dff3e7; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: 2px 8px; line-height: 1; }
.x:hover { color: var(--bad); }
.chip { border: 1px solid #e5c389; background: #fdf0d9; color: #7a4600; font-size: .75rem; border-radius: 10px; padding: 0 7px; cursor: pointer; }
.pos-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.totalbox { background: var(--brand); color: var(--on-brand); border-radius: var(--radius); padding: 12px 14px; }
.totalbox .lbl { font-size: .85rem; color: var(--on-brand-dim); }
.totalbox .amt { font-size: 2.3rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sumrow { display: flex; justify-content: space-between; padding: 2px 0; font-variant-numeric: tabular-nums; }
.paybtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* Billing: what else a bill can become or carry (quotation, order, return, gift voucher, salesman, delivery, advance)
   is one strip under the bill, so the column on the right holds only the total and the ways to pay, and fits a
   laptop screen without scrolling. On a phone the strip scrolls sideways. */
.posbar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.posbar:empty { display: none; }
.posbar .paybtns { display: flex; flex-wrap: wrap; gap: 6px; }
/* Hold, Recall, Last bill and Clear in the strip: on a phone only (a desktop has them in the right-hand column) */
.posbar .phonebtns { display: none; }
.posbar:not(:has(> :not(.phonebtns))) { display: none; }
.posbar .btn { min-height: 36px; padding: 5px 12px; white-space: nowrap; }
/* The discount and, for those who may backdate, the bill's date side by side. */
.posfields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; align-items: end; margin-top: 6px; }
.paybtn { border: 1px solid #b9c3be; background: #fff; border-radius: var(--radius); padding: 11px 8px; cursor: pointer; font-weight: 600; font-size: 1rem; }
.paybtn:hover { background: var(--soft); }
.paybtn.main { grid-column: 1 / -1; background: var(--brand-2); border-color: var(--brand-2); color: var(--on-brand); font-size: 1.15rem; padding: 14px 8px; }
.paybtn.main:hover { background: var(--brand-2-deep); }
.key { font-size: .72rem; opacity: .75; font-weight: 500; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 5px; }
.mobilebar { display: none; }

.scanrow { display: flex; gap: 8px; align-items: stretch; }
.scanrow .scanbox { flex: 1; min-width: 0; }
.camera { display: none; }
.touch .camera { display: block; background: var(--brand-2); border-color: var(--brand-2); color: var(--on-brand); font-weight: 600; padding: 8px 16px; }
.partybar { position: relative; }
.partybar .suggest { top: calc(100% + 2px); }
.partybar .sug { grid-template-columns: minmax(0, 1fr) auto auto; }

/* variant table */
.vfilters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vfilters #vq { flex: 1 1 220px; width: auto; }
.vfilters select { width: auto; max-width: 170px; }
.vtable { max-height: 54vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.vtable th { position: sticky; top: 0; background: #f7f8f6; z-index: 1; }
.vtable td { padding: 4px 8px; cursor: pointer; }
.vtable td.vq { width: 76px; }
.vtable .vq input { width: 62px; min-height: 32px; padding: 3px 6px; text-align: right; }
.vtable tr.on td { background: var(--soft); }
.vtable tr.picked td { background: #dff3e7; }
.vtable tr.nostock td { color: var(--muted); }
.vtable .vjoin { display: none; }

/* camera */
#camui { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; }
#camui video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The guide suits both kinds of sticker: a square for a QR code, and a line across it (a little wider) to lay the bars of a barcode along. */
.cam-aim { position: absolute; left: 50%; top: 46%; width: 56vmin; height: 56vmin; width: min(72vw, 44vh); height: min(72vw, 44vh); transform: translate(-50%, -50%); border: 3px solid rgba(255, 255, 255, .85); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
.cam-aim::after { content: ''; position: absolute; left: -9%; right: -9%; top: 50%; margin-top: -1px; border-top: 2px solid rgba(255, 255, 255, .7); }
.cam-good .cam-aim { border-color: #5fe08a; }
.cam-bad .cam-aim { border-color: #ff7a6e; }
.cam-top { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: rgba(0, 0, 0, .55); }
.cam-top .btn, .cam-bottom .btn { color: var(--ink); }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: rgba(0, 0, 0, .7); display: flex; flex-direction: column; gap: 8px; }
#cammsg { font-size: 1.05rem; font-weight: 600; min-height: 1.4em; }
.cam-good #cammsg { color: #8ff0ae; }
.cam-bad #cammsg { color: #ffb0a8; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--gap); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stat .l { font-size: .8rem; color: var(--muted); }
.stat .v { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--gap); align-items: start; }

/* modal */
.backdrop { position: fixed; inset: 0; background: rgba(15, 25, 22, .5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; z-index: 50; overflow-y: auto; }
.dialog { background: #fff; border-radius: 10px; width: 100%; max-width: 520px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 16px 48px rgba(0, 0, 0, .3); }
.dialog.wide { max-width: 900px; }
.dialog:focus { outline: none; }
.dialog .head { margin: 0; }
.dlgfoot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.bigtotal { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.payin { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; }
.change { background: #dff3e7; color: #155d2e; border-radius: 6px; padding: 8px 12px; font-size: 1.2rem; font-weight: 600; display: flex; justify-content: space-between; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--brand); }
.logincard { background: #fff; border-radius: 12px; padding: 22px; width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; }
.logincard h1 { text-align: center; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pinpad button { min-height: 52px; font-size: 1.25rem; border: 1px solid #b9c3be; background: #fff; border-radius: 8px; cursor: pointer; }
.pinpad button:hover { background: var(--soft); }

/* toast */
#toasts { position: fixed; right: 14px; bottom: 14px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(92vw, 400px); }
.toast { background: #17201e; color: #fff; border-radius: 8px; padding: 10px 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.toast.bad { background: var(--bad); }
.toast.good { background: var(--ok); }

/* label preview */
.labelprev { width: 100mm; max-width: 100%; height: 25mm; border: 1px dashed #9fb0aa; background: #fff; overflow: hidden; }

@media (max-width: 860px) {
  .pos { display: flex; flex-direction: column; height: auto; min-height: calc(100vh - var(--bars-h, 48px)); padding: 8px 8px 84px; }
  .cart { min-height: 40vh; overflow: visible; }
  .cart table { min-width: 0; }
  .cart th.c-amt, .cart td.c-amt { display: none; }
  .cart td input { width: 62px; }
  .pos-side .paybtns, .pos-side .totalbox { display: none; }
  .posbar, .posbar .paybtns { flex-wrap: nowrap; }
  .posbar { overflow-x: auto; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
  .posbar .paybtns { flex: none; }
  .posbar .phonebtns { display: flex; }
  .posbar:not(:has(> :not(.phonebtns))) { display: flex; }
  .mobilebar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--brand); color: var(--on-brand); padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); align-items: center; justify-content: space-between; gap: 10px; z-index: 30; }
  .mobilebar .amt { font-size: 1.5rem; font-weight: 700; }
  .mobilebar button { background: var(--brand-hi); color: #33210f; border: 0; border-radius: 8px; padding: 12px 22px; font-weight: 700; font-size: 1rem; }
  .brand { display: none; }
  .who span { display: none; }
  .key { display: none; }
  .vtable .vc, .vtable .c-bar { display: none; }
  .vtable .vjoin { display: table-cell; }
  .vfilters select { flex: 1 1 40%; max-width: none; }
  .vtable { max-height: 48vh; }
  input, select { font-size: 16px; }
  .scanbox input { font-size: 1.1rem; }
  /* a tick box stays on one line with its words (a long label would otherwise wrap the box onto a line of its own) */
  label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { flex-wrap: nowrap; align-items: flex-start; }
  label > input[type="checkbox"], label > input[type="radio"] { flex: none; width: auto; min-height: 0; margin-top: 3px; }
}

/* second menu row: the screens of the open tab (billing app tabs and the developer console) */
.subnav { display: flex; gap: 2px; overflow-x: auto; background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 12px; position: sticky; top: 48px; z-index: 19; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { color: var(--muted); text-decoration: none; padding: 9px 11px 8px; white-space: nowrap; border-bottom: 3px solid transparent; font-size: .92rem; }
.subnav a:hover { color: var(--ink); }
.subnav a.on { color: var(--brand); border-bottom-color: var(--brand-2); font-weight: 600; }
.subnav a.locked { opacity: .55; }
.subnav .badge { margin-left: 5px; padding: 0 6px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .75rem; }
.subnav .badge:empty { display: none; }
.nav a.locked { opacity: .55; }
/* The bar's headings and their menus (public/boot.js, MENU). */
.subnav .grp { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font: inherit; font-size: .92rem; padding: 9px 11px 8px; white-space: nowrap; cursor: pointer; flex: none; }
.subnav .grp::after { content: ''; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; border-bottom-width: 0; vertical-align: middle; opacity: .7; }
.subnav .grp:hover, .subnav .grp[aria-expanded="true"] { color: var(--ink); }
.subnav .grp.on { color: var(--brand); border-bottom-color: var(--brand-2); font-weight: 600; }
.subnav .grp.locked { opacity: .55; }
.subnav a { flex: none; }
.subnav .crumb { margin-left: auto; align-self: center; color: var(--muted); font-size: .82rem; white-space: nowrap; padding-left: 16px; }
.submenu { position: fixed; z-index: 45; min-width: 210px; max-width: calc(100vw - 16px); max-height: calc(100vh - 110px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 10px 28px rgba(0, 0, 0, .16); padding: 6px 0; }
.submenu[hidden] { display: none; }
.submenu a { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; padding: 9px 18px 9px 16px; white-space: nowrap; font-size: .95rem; break-inside: avoid; }
.submenu a:hover, .submenu a:focus { background: var(--soft); outline: none; }
.submenu a.on { color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-2); }
.submenu a.locked { opacity: .55; }
.submenu .badge { padding: 0 6px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .75rem; }
.submenu .badge:empty { display: none; }
.submenu.two { columns: 2; column-gap: 0; }
@media (max-width: 860px) {
  .subnav .crumb { display: none; }
  .submenu { left: 8px !important; right: 8px; }
  .submenu.two { columns: 1; }
}
/* licence banners (due, grace, read-only, maintenance, announcements) */
.banner { display: flex; gap: var(--gap); align-items: center; flex-wrap: wrap; padding: 8px 14px; font-size: .9rem; border-bottom: 1px solid var(--line); }
.banner.warn { background: #fdf0d9; color: #7a4600; }
.banner.bad { background: #fbe6e4; color: var(--bad); }
.banner.info { background: var(--soft); color: var(--brand); }
.banner .grow { min-width: 200px; }
.banner button { background: none; border: 1px solid currentColor; color: inherit; border-radius: 6px; padding: 3px 9px; cursor: pointer; }
/* a feature that is not in the plan */
.locked-box { max-width: 520px; margin: 8vh auto; text-align: center; }
.locked-box .panel { display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 24px; }
.bar { height: 8px; background: #edf0ed; border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand-2); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }
