/* PayBox Remote - iOS 26 "Liquid Glass" style design system.
   Tokens follow Apple's own system color roles (systemBackground,
   secondarySystemGroupedBackground, label/secondaryLabel, separator, the
   system blue tint) so light and dark mode both get real, tested contrast
   instead of a single palette just inverted. Defaults to the OS theme via
   prefers-color-scheme; .theme-light / .theme-dark on <html> force one. */

:root {
  --bg: #F2F2F7;
  --bg-elevated: #FFFFFF;
  --bg-grouped-inset: #FFFFFF;
  --label: #000000;
  --label-secondary: rgba(60, 60, 67, 0.6);
  --label-tertiary: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.29);
  --separator-opaque: #C6C6C8;
  --tint: #007AFF;
  --tint-pressed: #0062CC;
  --destructive: #FF3B30;
  --success: #34C759;
  --warning: #FF9500;
  --fill-secondary: rgba(120, 120, 128, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
/* The Android app draws under the status and navigation bar (edge to edge):
   Capacitor hands the real insets over as --safe-area-inset-* (js/native.js). */
:root.native-android {
  --safe-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}

@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) {
    --bg: #000000;
    --bg-elevated: #1C1C1E;
    --bg-grouped-inset: #1C1C1E;
    --label: #FFFFFF;
    --label-secondary: rgba(235, 235, 245, 0.6);
    --label-tertiary: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.65);
    --separator-opaque: #38383A;
    --tint: #0A84FF;
    --tint-pressed: #409CFF;
    --destructive: #FF453A;
    --success: #30D158;
    --warning: #FF9F0A;
    --fill-secondary: rgba(120, 120, 128, 0.24);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(28, 28, 30, 0.55);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

:root.theme-dark {
  --bg: #000000;
  --bg-elevated: #1C1C1E;
  --bg-grouped-inset: #1C1C1E;
  --label: #FFFFFF;
  --label-secondary: rgba(235, 235, 245, 0.6);
  --label-tertiary: rgba(235, 235, 245, 0.3);
  --separator: rgba(84, 84, 88, 0.65);
  --separator-opaque: #38383A;
  --tint: #0A84FF;
  --tint-pressed: #409CFF;
  --destructive: #FF453A;
  --success: #30D158;
  --warning: #FF9F0A;
  --fill-secondary: rgba(120, 120, 128, 0.24);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(28, 28, 30, 0.55);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; }

html {
  height: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  /* The viewport meta tag's user-scalable=no/maximum-scale=1 is NOT enough
     on its own - most modern mobile browsers (iOS Safari and Android Chrome
     both, at this point) ignore that for double-tap-to-zoom specifically,
     even though it still blocks pinch-zoom. touch-action: manipulation is
     the actual, reliably-honored way to kill double-tap zoom: it tells the
     browser only panning/single-tap gestures are meaningful here, so a
     double-tap on the employee-number/PIN keypad (or anywhere else) never
     triggers the zoom gesture in the first place. */
  touch-action: manipulation;
}

body {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a { color: var(--tint); text-decoration: none; }

/* ---------- Glass floating nav bar ----------
   iOS 26: a single slim floating glass capsule, not a full-width opaque bar
   with a stacked "large title" underneath - that dual-title pattern is the
   old (iOS 11-18) look. */

.nav-bar {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
}

.nav-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-glass {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 10px 16px;
  border-radius: 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
}

.nav-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-align: center;
}

/* A separate floating glass circle, not an inline text label - iOS 26's
   back control is its own small round "island", never a "< Back" pill
   merged into the title bar (that was the pre-26 look). */
.nav-circle-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tint);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
}
.nav-circle-btn:active { opacity: 0.45; }
.nav-circle-btn.hidden { display: none; }

.nav-btn {
  background: none;
  border: none;
  color: var(--tint);
  font-size: 17px;
  font-weight: 500;
  padding: 4px 2px;
  cursor: pointer;
  font-family: inherit;
}
.nav-btn:active { opacity: 0.4; }
.nav-btn[disabled] { color: var(--label-tertiary); cursor: default; }

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

.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}
.screen.active { display: flex; }

.tab-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.screen-body {
  flex: 1;
  overflow-y: auto;
  /* the last row clears the tab bar and the mic button above it (its menu stays tappable) */
  padding: 4px 16px calc(152px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.screen-body.centered {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 24px;
}

/* ---------- Login / auth branding ---------- */

#authApp {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Banner panel ----------
   A proper PayBox-branded banner (the app's own gradient, the real
   wordmark shown large) instead of a stock photo standing in for the
   brand - a top banner on the phone (below), the entire left half on
   desktop (see the @media block at the bottom of this section). A slow-
   drifting soft glow is the one bit of motion here - restrained, not a
   gimmick, just enough that the panel doesn't feel static. */
.login-photo-panel {
  position: relative;
  flex-shrink: 0;
  height: 28vh;
  min-height: 175px;
  max-height: 300px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 16px) 22px 22px;
  border-radius: 0 0 28px 28px;
}
.login-banner-panel {
  background: linear-gradient(160deg, var(--tint) 0%, #5E5CE6 100%);
}
.login-banner-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.28), transparent 55%);
  animation: login-banner-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes login-banner-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(5%, 6%) scale(1.1); }
}

.login-banner-logo {
  position: relative;
  z-index: 1;
  width: 128px;
  max-width: 46%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.22));
  transition: margin-left 0.15s ease;
}
/* The back button (.fab-left, position:absolute) and the logo both anchor
   to the panel's left edge - when the back button is showing, give the
   logo room instead of letting them overlap. */
#authBackBtn:not(.hidden) ~ .login-banner-logo {
  margin-left: 52px;
}

.login-photo-copy {
  position: relative;
  z-index: 1;
  color: #fff;
}
.login-photo-copy h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.18;
}
.login-photo-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.42;
  color: rgba(255, 255, 255, 0.85);
  max-width: 340px;
}

/* ---------- Form panel ---------- */

.login-form-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Content sits close under the photo panel as one tightly-composed block
   (title, fields, button/keypad all a fixed short distance apart) instead
   of either extreme: not stretched thin with the button marooned at the
   bottom of the viewport, and not centered in the remaining space either -
   which would leave an awkward gap up top, since the photo panel above
   this is its own fixed-height sibling. Calm empty space below is normal
   (that's how a real login card looks), the actual bug was emptiness
   *inside* the composition.
   Selector note: .screen-body.centered (two classes) outranks a plain
   .login-body (one class) on specificity alone regardless of source order,
   so this matches all three classes actually on the element to win. */
.screen-body.centered.login-body {
  justify-content: flex-start;
  padding-top: 30px;
  display: flex;
  flex-direction: column;
}

@keyframes login-step-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-step {
  display: flex;
  flex-direction: column;
  min-height: 0;
  animation: login-step-in 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  /* Mobile only - fills down to the bottom of the screen so the Continue/
     Verify button's margin-top:auto (above) has room to push against and
     land in the thumb-reachable zone at the very bottom, not right under
     the field. Reset to natural sizing on the desktop split-screen. */
  flex: 1;
}

.auth-step-title {
  text-align: center;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.auth-step-subtitle {
  text-align: center;
  margin-bottom: 22px;
}

.field-with-leading-icon {
  display: flex;
  align-items: center;
  gap: 10px;
}
.field-with-leading-icon i {
  flex-shrink: 0;
  font-size: 18px;
  color: var(--label-tertiary);
}
.field-with-leading-icon input {
  flex: 1;
  min-width: 0;
}

.login-footnote {
  text-align: center;
  font-size: 12px;
  color: var(--label-tertiary);
  margin: 28px 4px 0;
}

/* ---------- Employee login keypad ----------
   Mirrors the till's own on-screen PIN pad (pos-server's showPinDialog) -
   two stacked fields (employee number, then PIN) above a big numeric
   keypad, instead of the phone's small native keyboard. */

.keypad-fields {
  background: var(--bg-elevated);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  /* Fixed-height info display, not something that should ever get
     squeezed by the keypad below fighting it for space. */
  flex-shrink: 0;
}
.keypad-field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 12px 16px;
  position: relative;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}
.keypad-field-row + .keypad-field-row::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--separator);
}
.keypad-field-row i {
  font-size: 18px;
  color: var(--label-tertiary);
  flex-shrink: 0;
}
.keypad-field-row.active { opacity: 1; }
.keypad-field-row.active i { color: var(--tint); }
.keypad-field-row.done { opacity: 0.85; }
.keypad-field-row.done i { color: var(--success); }
.keypad-field-label {
  font-size: 15px;
  color: var(--label);
  flex-shrink: 0;
}
.keypad-field-value {
  flex: 1;
  text-align: right;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--label);
}

.keypad-dots {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.keypad-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fill-secondary);
  transition: background 0.12s ease, transform 0.12s ease;
}
.keypad-dots span.filled {
  background: var(--tint);
  transform: scale(1.1);
}

@keyframes keypad-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
.keypad-fields.keypad-error {
  animation: keypad-shake 0.4s ease;
}
.keypad-fields.keypad-error .keypad-dots span.filled { background: var(--destructive); }

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4vw;
  /* Sits close under the fields card, same "no dead gaps inside the
     composition" rule as every other step - any calm leftover space lands
     below the grid instead, which is where it belongs. */
  margin: 12px 0 0;
  flex-shrink: 0;
  width: 100%;
  max-width: 300px;
  align-self: center;
}
.keypad-key {
  aspect-ratio: 1;
  /* Capped, not just "1fr of the grid column" - on a wide phone that would
     make each key well over 100px, comically large; this keeps them a
     normal, comfortable PIN-pad size on any screen. */
  width: 100%;
  max-width: 64px;
  max-height: 64px;
  border: none;
  border-radius: 50%;
  background: var(--fill-secondary);
  color: var(--label);
  font-size: 24px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  transition: background 0.12s ease, transform 0.08s ease;
}
.keypad-key:hover { background: var(--separator); }
.keypad-key:active { background: var(--separator); transform: scale(0.94); }
.keypad-key.function {
  background: none;
  color: var(--label-secondary);
  font-size: 20px;
}
.keypad-key.function:active { background: var(--fill-secondary); }
.keypad-key[disabled] { opacity: 0.5; }

/* ---------- Desktop: split screen (photo left, form right) ----------
   This whole app is otherwise a phone-width layout (this is the mobile
   client), but the login screen itself is what a manager is realistically
   most likely to open from a laptop, so it gets a real desktop layout: the
   photo panel becomes the entire left half at full height (the classic
   Stripe/Linear-style auth split), the form panel becomes the right half
   with its content centered and capped to a sane reading width instead of
   stretching edge to edge. */
@media (min-width: 900px) {
  body { background: var(--bg); }

  #authApp {
    flex-direction: row;
  }

  .login-photo-panel {
    flex: 0 0 60%;
    height: 100%;
    max-height: none;
    min-height: 0;
    border-radius: 0;
    padding: calc(var(--safe-top) + 56px) 64px 64px;
  }
  .login-banner-logo { width: 180px; }
  .login-photo-copy h1 { font-size: 34px; max-width: 440px; }
  .login-photo-copy p { font-size: 16px; max-width: 400px; }

  .login-form-panel {
    align-items: center;
    justify-content: center;
    padding: 40px;
  }
  .screen-body.centered.login-body {
    flex: 0 1 auto;
    width: 100%;
    max-width: 380px;
    padding: 0;
    overflow: visible;
  }
  .login-footnote { margin-top: 24px; }

  /* The bottom-anchored button is a phone-only pattern (thumb reach on a
     tall screen) - on desktop the button belongs right under the field as
     part of the compact card, same as everything else in it. */
  .auth-step {
    flex: 0 1 auto;
  }
  .auth-step .btn-primary-arrow {
    margin-top: 22px;
    margin-bottom: 0;
  }
}

/* ---------- Grouped list ("card") ---------- */

.group-label {
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--label-secondary);
  margin: 20px 4px 6px;
}
.group-label:first-child { margin-top: 4px; }

.group-label.collapsible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding-right: 2px;
}
.group-label.collapsible i {
  font-size: 13px;
  transition: transform 0.2s ease;
}
.group-label.collapsible.collapsed i {
  transform: rotate(-90deg);
}
.collapsible-body {
  overflow: hidden;
  max-height: 600px;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}
.collapsible-body.collapsed {
  max-height: 0 !important;
  opacity: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

/* ---------- Online lookup hint (mirrors the till's own hint card) ---------- */

.hint-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 10px;
  margin: 4px 0 12px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.hint-card-media {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--fill-secondary);
  flex-shrink: 0;
  overflow: hidden;
}
.hint-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hint-card-body { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.hint-card-label { font-size: 11px; font-weight: 650; color: var(--tint); text-transform: uppercase; letter-spacing: 0.02em; }
.hint-card-text { font-size: 14px; color: var(--label); }
.hint-card-btn {
  border: none;
  border-radius: 980px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.hint-card-btn.dismiss { background: var(--fill-secondary); color: var(--label-secondary); }
.hint-card-btn.apply { background: var(--tint); color: white; }

.card {
  background: var(--bg-elevated);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 14px;
  position: relative;
}
.row + .row::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--separator);
}

.row-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-size: 17px; line-height: 1.3; }
.row-title-row { display: flex; align-items: center; gap: 6px; }
.row-subtitle { font-size: 13px; color: var(--label-secondary); margin-top: 1px; }

/* Small "i" info button next to a setting's title - opens a minimal popup
   with the explanation instead of a permanent subtitle line under every
   row, which reads as busier/cluttered at a glance. */
.row-info-btn {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: none;
  background: var(--fill-secondary);
  color: var(--label-tertiary);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.row-info-btn:active { opacity: 0.5; }
.row-value { color: var(--label-secondary); font-size: 17px; }
.row-chevron { color: var(--label-tertiary); font-size: 15px; }
.row.tappable { cursor: pointer; }
.row.tappable:active { background: var(--fill-secondary); }

.stock-pill {
  font-size: 10.5px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.stock-pill.ok { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.stock-pill.low { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.stock-pill.out { background: color-mix(in srgb, var(--destructive) 16%, transparent); color: var(--destructive); }

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

.field {
  background: var(--fill-secondary);
  border-radius: 16px;
  padding: 13px 16px;
  margin-bottom: 12px;
  border: 1.5px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}
/* The input itself has outline:none (no default browser ring), so the
   field container carries the focus indicator instead - still fully
   visible/accessible, just styled to match everything else here. */
.field:focus-within {
  border-color: var(--tint);
  background: var(--bg-elevated);
}
.field input, .field select {
  width: 100%;
  border: none;
  background: none;
  outline: none;
  font-size: 17px;
  color: var(--label);
  font-family: inherit;
  padding: 0;
}
.field input::placeholder { color: var(--label-tertiary); }
.field-label {
  font-size: 12px;
  color: var(--label-secondary);
  margin: 0 4px 6px;
}

/* A field with an inline action button (e.g. "scan this into the field"
   next to Barcode) - same field chrome, just a flex row instead of a bare
   input filling it. */
.field-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-input-row input {
  flex: 1;
  min-width: 0;
}
.field-icon-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--tint);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
}
.field-icon-btn:active { opacity: 0.7; }

/* ---------- Full-screen camera scan modal (scan-into-a-field) ----------
   Reuses .scan-shell/.scan-video/.scan-guide/.scan-status/.scan-placeholder
   from the Scan tab so the camera experience is identical everywhere it
   appears, just presented as an overlay on top of whatever form is open
   instead of a persistent tab. */
.barcode-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: #000;
}
.barcode-scan-overlay .nav-bar-plain { background: transparent; }
.barcode-scan-overlay .nav-title-plain { color: white; }

/* Plain <select> elements keep their platform-native popup chrome (light
   background) on Windows/Chrome regardless of the color/background set
   above, which made the closed box unreadable in dark mode - appearance:none
   plus a custom chevron and explicit <option> colors fixes both the closed
   box and (where the browser honors it) the open dropdown list. */
.field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238E8E93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 16px;
}
.field select option {
  background: var(--bg-elevated);
  color: var(--label);
}

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

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 980px;
  background: var(--tint);
  color: white;
  font-size: 17px;
  font-weight: 600;
  padding: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { background: var(--tint-pressed); }
.btn-primary:active { background: var(--tint-pressed); transform: scale(0.98); }

/* Label stays centered (untouched), the arrow sits pinned to the right
   edge instead of pushing the label over to make room for it. */
.btn-primary-arrow { position: relative; }
.btn-arrow {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

/* On the phone, the auth step's own Continue/Verify button anchors to the
   very bottom of the screen (thumb-reachable, generous clearance from the
   edge) rather than sitting right under the field - reserved for mobile
   only; on the desktop split-screen the button belongs right under the
   field as part of the compact centered card, not stranded at the bottom
   of a much taller viewport. */
.auth-step .btn-primary-arrow {
  margin-top: auto;
  margin-bottom: 12px;
}
.btn-primary[disabled] { background: var(--fill-secondary); color: var(--label-tertiary); cursor: default; }

.btn-secondary {
  width: 100%;
  border: none;
  border-radius: 980px;
  background: var(--fill-secondary);
  color: var(--tint);
  font-size: 17px;
  font-weight: 600;
  padding: 15px;
  cursor: pointer;
  font-family: inherit;
}
.btn-secondary:active { opacity: 0.6; }

.btn-destructive { color: var(--destructive); }

/* ---------- Status / pills / badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 590;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
}
.pill.success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.pill.destructive { background: color-mix(in srgb, var(--destructive) 16%, transparent); color: var(--destructive); }
.pill.neutral { background: var(--fill-secondary); color: var(--label-secondary); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.error-text {
  color: var(--destructive);
  font-size: 13px;
  min-height: 16px;
  margin: 4px 4px 0;
}

.helper-text {
  color: var(--label-secondary);
  font-size: 13px;
  line-height: 1.4;
  margin: 4px 4px 16px;
}

.otp-input {
  text-align: center;
  font-size: 28px !important;
  letter-spacing: 0.3em;
  font-weight: 600;
}

.empty-state {
  text-align: center;
  color: var(--label-secondary);
  font-size: 15px;
  padding: 40px 20px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--fill-secondary);
  border-top-color: var(--tint);
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Floating glass tab bar ----------
   Inset from the edges and rounded into a capsule, floating over the
   content rather than a flat, edge-to-edge bar sitting flush at the
   bottom - the current iOS 26 tab bar treatment. */

.tab-bar-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 16px calc(10px + var(--safe-bottom));
  pointer-events: none;
}

.tab-bar {
  pointer-events: auto;
  display: flex;
  gap: 2px;
  padding: 8px;
  border-radius: 26px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  max-width: 420px;
  width: 100%;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 7px;
  border-radius: 18px;
  background: none;
  border: none;
  color: var(--label-tertiary);
  cursor: pointer;
  font-family: inherit;
}
.tab-btn .tab-icon { font-size: 21px; line-height: 1; }
.tab-btn .tab-label { font-size: 10px; font-weight: 500; }
.tab-btn.active { color: var(--tint); background: color-mix(in srgb, var(--tint) 12%, transparent); }

/* ---------- Voice command (faster-whisper prototype) ----------
   See public/login.js (bindVoiceCommands et al). Floats above the tab bar
   rather than inside it - a distinct, occasional action, not a tab you
   live in. */

.voice-fab {
  position: absolute;
  right: 16px;
  bottom: calc(86px + var(--safe-bottom));
  z-index: 25;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, var(--tint), var(--tint-pressed));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.voice-fab:active { transform: scale(0.94); }
.voice-fab.hidden { display: none; }
.voice-fab.listening { animation: voice-fab-pulse 1.4s ease-in-out infinite; }
.voice-fab.busy i { animation: voice-fab-spin 0.9s linear infinite; }

@keyframes voice-fab-spin {
  to { transform: rotate(360deg); }
}

@keyframes voice-fab-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tint) 50%, transparent), var(--glass-shadow); }
  50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--tint) 0%, transparent), var(--glass-shadow); }
}

.voice-feedback {
  position: absolute;
  left: 50%;
  bottom: calc(156px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 26;
  width: min(calc(100% - 32px), 380px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
}
.voice-feedback.hidden { display: none; }

.voice-feedback-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: color-mix(in srgb, var(--tint) 16%, transparent);
  color: var(--tint);
}
.voice-feedback[data-status="processing"] .voice-feedback-icon i {
  animation: voice-fab-spin 0.9s linear infinite;
}
.voice-feedback[data-result="matched"] .voice-feedback-icon {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
}
.voice-feedback[data-result="error"] .voice-feedback-icon,
.voice-feedback[data-result="unmatched"] .voice-feedback-icon {
  background: color-mix(in srgb, var(--destructive) 14%, transparent);
  color: var(--destructive);
}

.voice-feedback-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.voice-feedback-copy strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--label);
}
.voice-feedback-copy span {
  font-size: 12px;
  color: var(--label-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-feedback-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--fill-secondary);
  color: var(--label-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
}

.voice-level {
  display: none;
  align-items: center;
  gap: 3px;
  height: 20px;
  flex: 0 0 auto;
}
.voice-feedback[data-status="listening"] .voice-level { display: flex; }
.voice-level span {
  width: 3px;
  height: 100%;
  border-radius: 999px;
  background: var(--tint);
  transform: scaleY(0.15);
  transform-origin: center;
  transition: transform 0.08s ease;
}

/* ---------- Search field ---------- */

.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--fill-secondary);
  border-radius: 980px;
  padding: 9px 14px;
  margin: 6px 0 14px;
}
.search-field input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 17px;
  color: var(--label);
  font-family: inherit;
}
.search-field input::placeholder { color: var(--label-tertiary); }

.hidden { display: none !important; }

/* ---------- Nav bar action button (save / add - right side text button) ---------- */

.nav-text-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--tint);
  font-size: 17px;
  font-weight: 600;
  padding: 0 2px;
  cursor: pointer;
  font-family: inherit;
  min-width: 44px;
  height: 44px;
}
.nav-text-btn:active { opacity: 0.4; }
.nav-text-btn[disabled] { color: var(--label-tertiary); cursor: default; }
.nav-text-btn.plus { font-size: 22px; line-height: 1; }

/* ---------- Toggle switch ---------- */

.toggle {
  position: relative;
  flex-shrink: 0;
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: var(--fill-secondary);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}
.toggle.on { background: var(--success); }
.toggle.on::after { transform: translateX(20px); }

.row-control { flex-shrink: 0; }

/* ---------- Form screens (sheet-style, slide over the tab bar) ---------- */

.form-screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.field-row {
  display: flex;
  gap: 10px;
}
.field-row .field { flex: 1; min-width: 0; }
/* a date field has a wide built-in minimum: two side by side spilled out */
.field input[type="date"], .field input[type="time"] { min-width: 0; }

.form-error {
  color: var(--destructive);
  font-size: 13px;
  margin: 2px 4px 12px;
  min-height: 16px;
}

.chip-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.chip-option {
  border: 1px solid var(--separator);
  background: var(--bg-elevated);
  color: var(--label);
  border-radius: 980px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.chip-option.selected {
  background: var(--tint);
  border-color: var(--tint);
  color: white;
}

/* ---------- Cash reconciliation ("theft detection") ---------- */

.cash-recon-card {
  background: var(--bg-elevated);
  border-radius: 20px;
  padding: 18px;
  margin: -6px 0 20px;
  box-shadow: var(--shadow);
}
.cash-recon-expected {
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 0.5px solid var(--separator);
}
.cash-recon-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--label-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.cash-recon-amount {
  display: block;
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--tint);
}
.cash-recon-date {
  display: block;
  font-size: 12px;
  color: var(--label-tertiary);
  margin-top: 4px;
}
.cash-recon-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.cash-recon-row { display: flex; justify-content: space-between; }
.cash-recon-row .positive { color: var(--success); font-weight: 600; }
.cash-recon-row .negative { color: var(--destructive); font-weight: 600; }

/* ---------- Account tab: hardware/kiosk card ---------- */

.account-card {
  background: var(--bg-elevated);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.account-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--fill-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--label-tertiary);
  flex-shrink: 0;
  overflow: hidden;
}
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-card-title { font-size: 19px; font-weight: 650; }
.account-card-subtitle { font-size: 13px; color: var(--label-secondary); margin-top: 2px; }
.account-hw-row {
  display: flex;
  gap: 8px;
}
.hw-status {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--fill-secondary);
  border-radius: 14px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 590;
}
.hw-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--label-tertiary); flex-shrink: 0; }
.hw-status.on .dot { background: var(--success); }
.hw-status.on { color: var(--success); }
.hw-status.off { color: var(--label-secondary); }

/* ---------- Camera scanner ---------- */

.scan-shell {
  flex: 1;
  position: relative;
  /* Theme-aware at rest (the "start scanning" placeholder) - only forced
     black once the live camera feed is actually showing (see .scanning,
     toggled in startScanTab/stopScanTab), otherwise light mode got a
     permanent black hole here even with no camera open. */
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.scan-shell.scanning {
  background: #000;
}
.scan-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-guide {
  position: relative;
  z-index: 2;
  width: 78%;
  max-width: 340px;
  aspect-ratio: 16 / 9;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.38);
}
.scan-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(24px + var(--safe-bottom) + 92px);
  z-index: 3;
  text-align: center;
  color: white;
  font-size: 14px;
  font-weight: 500;
  padding: 0 24px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
/* Barcode-detected review card - shown over the live camera feed once a
   barcode is read, before anything is actually done with it. Mirrors the
   till's own "green check to accept / red x to reject" scan review
   (js/mobileApp.js, mobile-scan-review). */
.scan-review-card {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: calc(28px + var(--safe-bottom) + 92px);
  transform: translateX(-50%);
  width: min(320px, calc(100% - 48px));
  background: rgba(28, 28, 30, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 16px;
  text-align: center;
  color: white;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  animation: scan-review-in 0.18s ease;
}
@keyframes scan-review-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.scan-review-label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}
.scan-review-value {
  display: block;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
  word-break: break-all;
}
.scan-review-actions {
  display: flex;
  justify-content: center;
  gap: 22px;
}
.scan-review-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  color: white;
}
.scan-review-btn:active { transform: scale(0.92); }
.scan-review-btn.reject { background: var(--destructive); }
.scan-review-btn.accept { background: var(--success); }

.scan-placeholder {
  color: var(--label-secondary);
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.scan-placeholder i { font-size: 40px; color: var(--label-tertiary); }

/* ---------- In-app confirm sheet + toast ----------
   Native confirm()/alert() are unavailable in some embedding browsers (they
   silently no-op there), so every destructive action and error message goes
   through this instead - it also just looks more like iOS than a native
   browser dialog would. */

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px calc(12px + var(--safe-bottom));
}
.confirm-sheet {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.confirm-body {
  padding: 20px 20px 16px;
  text-align: center;
}
.confirm-title { font-size: 16px; font-weight: 650; margin-bottom: 4px; }
.confirm-message { font-size: 13px; color: var(--label-secondary); line-height: 1.4; }
.confirm-actions { display: flex; flex-direction: column; border-top: 0.5px solid var(--separator); }
.confirm-btn {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 17px;
  padding: 14px;
  cursor: pointer;
  color: var(--tint);
  border-bottom: 0.5px solid var(--separator);
}
.confirm-btn:last-child { border-bottom: none; }
.confirm-btn:active { background: var(--fill-secondary); }
.confirm-btn.destructive { color: var(--destructive); font-weight: 600; }

.toast-wrap {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--safe-top) + 12px);
  z-index: 110;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  /* text only - a tap goes through to what it covers (Save, Back, ...) */
  pointer-events: none;
  max-width: 420px;
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--label);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.2s ease;
}
.toast.error i { color: var(--destructive); }
.toast.success i { color: var(--success); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Account tab media upload ---------- */

.media-preview {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--fill-secondary);
  margin: 10px 0;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-preview .empty { color: var(--label-tertiary); font-size: 13px; }

/* The receipt logo is dark ink on a white background (see the server-side
   conversion in pos-server/services/fileStorage.js) and can be any aspect
   ratio, unlike the customer-display photo above - "cover" would crop it
   and a dark app theme would swallow it entirely without an explicit white
   backdrop, so this variant fits the whole logo inside a fixed white card
   instead of filling/cropping it. */
.media-preview.logo-preview {
  aspect-ratio: 3/1;
  background: #ffffff;
}
.media-preview.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  box-sizing: border-box;
}

/* ---------- Report preview (X/Z report image, rendered on the till) ---------- */

.report-preview-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 16px;
  margin: 4px auto 20px;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.report-preview-card img {
  width: 100%;
  display: block;
  border-radius: 8px;
}

/* ---------- Plain header + floating action buttons ----------
   The "glass pill" title treatment stays only where it needs to float over
   scrolling content (see .nav-glass above, still used by nothing now but
   kept for reference/reuse). Every screen header here is instead a plain
   text title with its own independently-floating circular/pill buttons -
   they don't share a row or a background with the title, so they read as
   controls hovering over the screen rather than one bar. */

.nav-bar-plain {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  min-height: 34px;
  padding: calc(var(--safe-top) + 18px) 20px 12px;
  display: flex;
  align-items: center;
}

.nav-title-plain {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--label);
}

.fab {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tint);
  font-size: 17px;
  cursor: pointer;
  z-index: 25;
  padding: 0;
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.fab:active { opacity: 0.5; transform: scale(0.93); }
.fab.hidden { display: none; }
.fab-left { left: 16px; }
.fab-right { right: 16px; }

.fab-pill {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  right: 16px;
  border-radius: 980px;
  padding: 9px 18px;
  background: var(--tint);
  color: white;
  font-size: 15px;
  font-weight: 650;
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  border: none;
  z-index: 25;
  font-family: inherit;
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.fab-pill:active { background: var(--tint-pressed); transform: scale(0.96); }
.fab-pill[disabled] { background: var(--fill-secondary); color: var(--label-tertiary); }

/* ---- Hours ---- */
.hours-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
}
.hours-nav-label {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}
.hours-nav-btn {
  width: 44px !important;
  padding: 10px 0 !important;
  flex: 0 0 auto;
}
.fab-pill i {
  margin-right: 4px;
  vertical-align: -2px;
}

/* ======================================================================
   Wide screens (desktop / laptop): same app, same look - the floating tab
   bar becomes a glass sidebar, content gets room to breathe, sheets open as
   side panels, and a few desktop-only pages (Overview, Discounts, Reports,
   Activity, Hours) appear in the sidebar. Everything below only applies at
   min-width 1024px; phones never see any of it.
   ====================================================================== */

.desktop-only { display: none; }
.desktop-backdrop { display: none; }

@media (min-width: 1024px) {
  body { background: var(--bg); }

  #mainApp { flex-direction: row; }

  /* ---- Sidebar ---- */
  .tab-bar-wrap {
    position: relative;
    order: -1;
    flex: 0 0 272px;
    width: 272px;
    padding: 14px 0 14px 14px;
    justify-content: stretch;
    pointer-events: auto;
    z-index: 20;
  }
  .tab-bar {
    flex-direction: column;
    max-width: none;
    width: 100%;
    height: 100%;
    padding: 14px 12px;
    gap: 2px;
    border-radius: 28px;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar { display: none; }

  .tab-btn {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    color: var(--label-secondary);
    text-align: left;
  }
  .tab-btn .tab-icon { font-size: 21px; width: 24px; text-align: center; }
  .tab-btn .tab-label { font-size: 15px; font-weight: 600; }
  .tab-btn.desktop-only { display: flex; }
  .tab-btn:hover { background: var(--fill-secondary); }
  .tab-btn.active:hover { background: color-mix(in srgb, var(--tint) 14%, transparent); }

  /* order of the sidebar entries (the DOM stays in phone order) */
  .sidebar-brand { order: 0; }
  .tab-btn[data-tab="tabDashboard"] { order: 1; }
  .sidebar-label[data-order="catalog"] { order: 2; }
  .tab-btn[data-tab="tabProducts"] { order: 3; }
  .tab-btn[data-tab="tabVat"] { order: 4; }
  .tab-btn[data-tab="tabDiscounts"] { order: 5; }
  .sidebar-label[data-order="business"] { order: 6; }
  .tab-btn[data-tab="tabReports"] { order: 7; }
  .tab-btn[data-order="hours"] { order: 8; }
  /* The camera scanner is a phone feature: no Scan tab in the desktop sidebar. */
  .tab-btn[data-tab="tabScan"] { display: none; }
  .tab-btn[data-tab="tabActivity"] { order: 9; }
  .sidebar-label[data-order="manage"] { order: 10; }
  .tab-btn[data-tab="tabTeam"] { order: 11; }
  .tab-btn[data-tab="tabScan"] { order: 12; }
  .tab-btn[data-tab="tabAccount"] { order: 13; }
  .sidebar-foot { order: 99; }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 16px;
  }
  .sidebar-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--tint);
    color: #fff;
    font-size: 21px;
    flex: 0 0 auto;
  }
  .sidebar-brand-copy { display: flex; flex-direction: column; min-width: 0; }
  .sidebar-brand-copy strong { font-size: 16px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-brand-copy span { font-size: 12.5px; color: var(--label-secondary); }

  .sidebar-label {
    display: block;
    padding: 18px 14px 6px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--label-tertiary);
  }

  .sidebar-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 12px 8px 2px;
    border-top: 0.5px solid var(--separator);
  }
  .sidebar-user {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--label);
  }
  .sidebar-user i { font-size: 24px; color: var(--label-secondary); flex: 0 0 auto; }
  .sidebar-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar-signout {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--fill-secondary);
    color: var(--label-secondary);
    font-size: 18px;
    cursor: pointer;
    flex: 0 0 auto;
  }
  .sidebar-signout:hover { color: var(--destructive); }

  /* ---- Content: full-width scroll area, centered readable column ---- */
  .tab-screen { min-width: 0; }
  .nav-bar-plain {
    padding-left: max(32px, calc((100% - 1040px) / 2));
    padding-right: max(32px, calc((100% - 1040px) / 2));
    padding-top: 28px;
  }
  .nav-bar-plain[style] { padding-right: max(32px, calc((100% - 1040px) / 2)) !important; }
  .nav-title-plain { font-size: 30px; }
  .tab-screen .nav-bar-plain .fab-right,
  .tab-screen .nav-bar-plain .fab-pill {
    top: 26px;
    right: max(32px, calc((100% - 1040px) / 2));
  }
  .tab-screen .screen-body {
    padding: 8px max(32px, calc((100% - 1040px) / 2)) 100px;
  }

  .voice-fab { right: 24px; bottom: 24px; }
  .voice-feedback { left: auto; right: 24px; bottom: 90px; transform: none; }

  @media (hover: hover) {
    .row.tappable:hover { background: var(--fill-secondary); }
  }

  /* ---- Sheets become side panels with a dimmed backdrop ---- */
  .form-screen {
    inset: 0 0 0 auto;
    width: min(520px, 100vw);
    z-index: 40;
    border-left: 1px solid var(--separator);
    box-shadow: -24px 0 70px rgba(0, 0, 0, 0.22);
    animation: dsk-sheet-in 0.22s ease-out;
  }
  #hoursScreen,
  #zReportsListScreen,
  #discountsListScreen,
  #reportPreviewScreen { width: min(660px, 100vw); }
  .form-screen .nav-bar-plain { padding: 22px 20px 12px; }
  .form-screen .nav-bar-plain .fab-left { top: 18px; left: 16px; }
  .form-screen .nav-bar-plain .fab-pill { top: 20px; right: 16px; }
  .form-screen .screen-body { padding: 8px 20px 36px; }

  #mainApp:has(.form-screen:not(.hidden)) .desktop-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 39;
    background: rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: dsk-fade 0.18s ease-out;
  }

  /* wider data on wide screens */
  .report-preview-card { max-width: 460px; }
  .dsk-toolbar, .dsk-pager.desktop-only { display: flex; }
  .confirm-backdrop { align-items: center; }
  .media-preview { max-width: 460px; }
  .dsk-grid { display: grid; gap: 16px; }
  .dsk-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dsk-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dsk-grid.main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
}

@media (min-width: 1024px) and (max-width: 1260px) {
  .dsk-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #repDetail .dsk-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .dsk-grid.main { grid-template-columns: minmax(0, 1fr); }
}

@keyframes dsk-sheet-in { from { transform: translateX(36px); opacity: 0; } }
@keyframes dsk-fade { from { opacity: 0; } }

/* ---------- Desktop pages (Overview, Reports, Discounts, Activity) ----------
   Built from the same pieces as the phone screens: .card, .row, .group-label,
   .pill, .chip-option, plus the few extras below. */

.dsk-pad { padding: 18px 20px; }
.dsk-title { margin: 0 0 12px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.dsk-section { margin-bottom: 18px; }
.dsk-kpi { padding: 16px 18px; }
.dsk-kpi-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label-secondary); font-weight: 500; }
.dsk-kpi-value { margin-top: 6px; font-size: 28px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dsk-kpi-sub { margin-top: 2px; font-size: 13px; color: var(--label-secondary); min-height: 18px; }
.dsk-up { color: var(--success); }
.dsk-down { color: var(--destructive); }
.dsk-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; height: 230px; padding-top: 8px; }
.dsk-chart-y { position: relative; height: calc(100% - 26px); min-width: 22px; }
.dsk-chart-y span,
.dsk-chart-x span { position: absolute; color: var(--label-secondary); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dsk-chart-y span { right: 0; transform: translateY(-50%); }
.dsk-chart-plot { position: relative; min-width: 0; display: flex; flex-direction: column; }
.dsk-chart-plot svg { display: block; width: 100%; height: calc(100% - 26px); overflow: visible; }
.dsk-chart-x { position: relative; height: 26px; }
.dsk-chart-x span { top: 9px; transform: translateX(-50%); }
.dsk-chart .grid-line { stroke: var(--separator); stroke-width: 1; }
.dsk-chart .bar { fill: var(--tint); }
.dsk-chart .bar:hover { opacity: 0.75; }
.dsk-bar-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 7px 0; font-size: 15px; }
.dsk-bar-track { height: 8px; border-radius: 99px; background: var(--fill-secondary); overflow: hidden; }
.dsk-bar-fill { height: 100%; border-radius: 99px; background: var(--tint); }
.dsk-stack { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--fill-secondary); margin: 6px 0 12px; }
.dsk-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--label-secondary); }
.dsk-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dsk-num { font-variant-numeric: tabular-nums; }
.dsk-kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; font-size: 15px; }
.dsk-kv dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.dsk-kv dt { color: var(--label-secondary); }
.dsk-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.dsk-daylist { max-height: calc(100vh - 220px); overflow-y: auto; }
.dsk-day { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 16px; border: none; background: none; text-align: left; font-family: inherit; font-size: 15px; color: var(--label); cursor: pointer; position: relative; }
.dsk-day + .dsk-day::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: 0.5px; background: var(--separator); }
.dsk-day small { display: block; color: var(--label-secondary); font-size: 12.5px; }
.dsk-day.active { background: color-mix(in srgb, var(--tint) 12%, transparent); }
.dsk-day:hover { background: var(--fill-secondary); }
.dsk-day.active:hover { background: color-mix(in srgb, var(--tint) 16%, transparent); }
.dsk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.dsk-head h2 { margin: 0; font-size: 21px; letter-spacing: -0.01em; }
.dsk-head .grow { flex: 1; }
.dsk-btn { border: none; border-radius: 980px; padding: 9px 16px; background: var(--fill-secondary); color: var(--tint); font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.dsk-btn.primary { background: var(--tint); color: #fff; }
.dsk-btn:hover { opacity: 0.85; }
.dsk-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.dsk-table th { text-align: left; padding: 10px 16px; font-size: 12.5px; font-weight: 600; color: var(--label-secondary); border-bottom: 0.5px solid var(--separator); }
.dsk-table td { padding: 11px 16px; border-bottom: 0.5px solid var(--separator); }
.dsk-table tr:last-child td { border-bottom: none; }
.dsk-table .r { text-align: right; font-variant-numeric: tabular-nums; }
.dsk-table tr.tappable { cursor: pointer; }
.dsk-table tr.tappable:hover td { background: var(--fill-secondary); }
.dsk-sub { font-size: 13px; color: var(--label-secondary); }
.dsk-toolbar { gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.dsk-toolbar select { padding: 9px 12px; border-radius: 12px; border: 1px solid var(--separator); background: var(--bg-elevated); color: var(--label); font-family: inherit; font-size: 15px; }
.dsk-weekdays { display: flex; gap: 6px; margin-bottom: 12px; }
.dsk-weekdays button { width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--separator); background: var(--bg-elevated); color: var(--label); font-weight: 600; cursor: pointer; font-family: inherit; }
.dsk-weekdays button.selected { background: var(--tint); border-color: var(--tint); color: #fff; }
.dsk-results { border-radius: 14px; overflow: hidden; background: var(--bg-elevated); box-shadow: var(--shadow); margin-bottom: 12px; }
.dsk-results button { display: flex; justify-content: space-between; width: 100%; padding: 12px 14px; border: none; background: none; text-align: left; font-family: inherit; font-size: 15px; color: var(--label); cursor: pointer; border-bottom: 0.5px solid var(--separator); }
.dsk-results button:hover { background: var(--fill-secondary); }

.dsk-pager { align-items: center; justify-content: space-between; margin-top: 14px; font-size: 14px; color: var(--label-secondary); }
.dsk-pager-nav { display: flex; align-items: center; gap: 12px; }
.dsk-btn:disabled { opacity: 0.35; cursor: default; }

/* Employee hours turned off on the till: hide every Hours entry. */
body.hours-off .hours-entry { display: none !important; }

/* Category pills carry the group's own icon colour (set by the till); a selected
   pill is the usual filled tint with a white icon. */
.chip-option .chip-icon { margin-right: 6px; color: var(--g, currentColor); vertical-align: -2px; }
.chip-option.selected .chip-icon { color: #fff; }

/* Long product / group names wrap instead of getting squeezed or cut off. */
.row-title { overflow-wrap: anywhere; }

/* ---------- Skeleton loading + infinite scroll ---------- */
.skeleton-row { pointer-events: none; }
.sk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.sk {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--fill-secondary) 25%, color-mix(in srgb, var(--fill-secondary) 45%, transparent) 37%, var(--fill-secondary) 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease infinite;
}
.sk-title { height: 15px; }
.sk-sub { height: 11px; }
.sk-price { width: 54px; height: 15px; flex: 0 0 auto; }
@keyframes sk-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

.products-sentinel { min-height: 1px; }
.products-end-note { padding: 18px 8px 4px; text-align: center; font-size: 13px; color: var(--label-secondary); }
.products-retry {
  display: block;
  margin: 16px auto 4px;
  padding: 11px 20px;
  border: none;
  border-radius: 980px;
  background: var(--fill-secondary);
  color: var(--tint);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Voice commands: "what can I say" sheet ---------- */
.voice-help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px calc(12px + var(--safe-bottom));
}
.voice-help-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: var(--bg);
  padding: 20px 16px 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.voice-help-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 12px; font-size: 20px; }
.voice-help-close { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--fill-secondary); color: var(--label-secondary); font-size: 16px; cursor: pointer; }
.voice-help-langs { padding: 0 2px; }
.voice-help-tip { margin: 0 6px 10px; font-size: 13px; color: var(--label-secondary); }
.voice-help-list { overflow-y: auto; padding-bottom: 16px; }
@media (min-width: 1024px) { .voice-help-backdrop { align-items: center; } }

/* ---------- PDF viewer: reports open inside the app (pdf-export.js view) ---------- */
/* One row: close, the title (one line, cut off with ... when narrow), the
   actions. Below 640px the actions keep only their icon. */
.pdf-viewer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-top) + 14px) 16px 14px;
  flex-shrink: 0;
}
.pdf-viewer-title {
  flex: 1;
  min-width: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-viewer-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 980px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--fill-secondary);
  color: var(--tint);
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.pdf-viewer-btn i { font-size: 18px; }
.pdf-viewer-btn.primary { background: var(--tint); color: #fff; }
.pdf-viewer-btn.round { width: 44px; padding: 0; justify-content: center; background: var(--bg-elevated); color: var(--label); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 16px -10px rgba(0, 0, 0, 0.25); }
.pdf-viewer-btn:active { transform: scale(0.95); }
.pdf-viewer-btn:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
@media (hover: hover) { .pdf-viewer-btn:hover { filter: brightness(0.96); } }
@media (max-width: 640px) {
  .pdf-viewer-title { font-size: 17px; }
  .pdf-viewer-btn:not(.round) { width: 44px; padding: 0; justify-content: center; }
  .pdf-viewer-btn span { display: none; }
}
.pdf-viewer-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: var(--bg);
}
@media (min-width: 1024px) {
  #pdfViewerScreen { width: min(1080px, calc(100vw - 80px)); }
  .pdf-viewer-bar { padding-top: 18px; }
}

/* ---------- Hours page (wide screens): one big table, double-click a value ---------- */
.hrs-period { margin: 0 6px 0 0; }
.hrs-onclock { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.hrs-table .c { text-align: center; font-variant-numeric: tabular-nums; }
.hrs-table td { vertical-align: middle; }
.hrs-table tr.hrs-group td {
  background: color-mix(in srgb, var(--tint) 7%, transparent);
  padding-top: 13px;
  padding-bottom: 13px;
}
.hrs-table tr.hrs-flag td { color: var(--destructive); }
.hrs-table tfoot td { border-top: 1px solid var(--separator); padding-top: 14px; padding-bottom: 14px; }
.hrs-table td.hrs-cell { cursor: text; border-radius: 10px; transition: background 0.12s ease; }
.hrs-table td.hrs-cell:hover { background: var(--fill-secondary); }
.hrs-table td.editing { padding-top: 6px; padding-bottom: 6px; }
.hrs-table td.saving { opacity: 0.55; }
.hrs-input {
  width: 100%;
  min-width: 96px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1.5px solid var(--tint);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--label);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tint) 18%, transparent);
}
.hrs-del {
  border: none;
  background: none;
  color: var(--label-tertiary);
  font-size: 17px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
}
.hrs-table tr:hover .hrs-del { opacity: 1; }
.hrs-del:hover { color: var(--destructive); background: var(--fill-secondary); }
.hrs-hint { margin: 12px 4px 0; }
.hrs-input.nok { border-color: var(--destructive); box-shadow: 0 0 0 4px color-mix(in srgb, var(--destructive) 18%, transparent); }

/* ---------- List rows: Products, VAT groups, Team ----------
   Each item is its own rounded row, like the kassa's product list: the
   category's colour as a short bar, a bold name, the price up front. The same
   rows on a phone and on a wide screen. */
.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px 12px 12px 14px;
  background: var(--bg-elevated);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 18px -12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}
.item-row:active { transform: scale(0.985); }
.item-row:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
@media (hover: hover) {
  .item-row:hover { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 26px -14px rgba(0, 0, 0, 0.22); }
}
.item-bar {
  width: 6px;
  align-self: stretch;
  min-height: 40px;
  border-radius: 99px;
  background: var(--g, var(--fill-secondary));
  flex-shrink: 0;
}
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item-name { font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; overflow-wrap: anywhere; }
/* a touch stronger than --label-secondary: readable (AA) in dark mode too */
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 13px; color: color-mix(in srgb, var(--label) 64%, transparent); }
.item-sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.item-end { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.item-price { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-price small { font-size: 12.5px; font-weight: 600; letter-spacing: 0; color: color-mix(in srgb, var(--label) 64%, transparent); margin-left: 2px; }
.item-badge {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--tint);
  background: color-mix(in srgb, var(--tint) 12%, transparent);
}
.item-badge small { font-size: 12px; font-weight: 700; margin-left: 1px; }
.item-avatar {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--a, var(--tint));
}
.item-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  background: #5856D6;
}
.item-row.muted .item-avatar { background: var(--label-tertiary); }
.item-row.muted .item-name { color: var(--label-secondary); }
.item-chevron { flex-shrink: 0; color: var(--label-tertiary); font-size: 15px; margin-right: 2px; }
/* skeleton rows in the same shape */
.item-list .skeleton-row { background: var(--bg-elevated); border-radius: 18px; min-height: 68px; padding: 12px 16px; }
.item-list .row + .row::before { display: none; }

/* scrollbars in the app's own colours, not the browser default */
html, .screen-body, .dsk-daylist { scrollbar-width: thin; scrollbar-color: var(--label-tertiary) transparent; }

/* ---------- Sign in: Remember me ---------- */
.remember-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 4px;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.remember-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.remember-title { font-size: 16px; font-weight: 650; }
.remember-sub { font-size: 13px; line-height: 1.35; color: color-mix(in srgb, var(--label) 64%, transparent); }
.remember-row .toggle:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.remembered-who {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: -12px 0 18px;
  font-size: 14px;
  color: color-mix(in srgb, var(--label) 70%, transparent);
}
.remembered-who.hidden { display: none; }
.remembered-who i { font-size: 15px; }
.link-btn {
  border: none;
  background: none;
  padding: 4px 6px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--tint);
  cursor: pointer;
}
.link-btn:focus-visible { outline: 2px solid var(--tint); outline-offset: 1px; }
@media (hover: hover) { .link-btn:hover { background: var(--fill-secondary); } }

/* ---------- Product form: barcode on/off, price per piece / per kg ---------- */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 10px;
}
.field-label-row .field-label { margin: 0 4px; }
.toggle.small { width: 42px; height: 26px; }
.toggle.small::after { width: 22px; height: 22px; }
.toggle.small.on::after { transform: translateX(16px); }
.toggle:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
/* a two-way choice (iOS segmented control) */
.seg {
  display: inline-flex;
  flex-shrink: 0;
  padding: 2px;
  border-radius: 10px;
  background: var(--fill-secondary);
}
.seg-option {
  border: none;
  background: transparent;
  color: var(--label);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.seg-option.selected { background: var(--bg-elevated); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.seg-option:focus-visible { outline: 2px solid var(--tint); outline-offset: 1px; }
/* a switch that is off stays visible on a grey field */
.field .toggle:not(.on) { background: color-mix(in srgb, var(--label) 18%, transparent); }

/* ---------- Products: search + filter, three-dots menu, the archive ---------- */
.search-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.search-row .search-field { flex: 1; min-width: 0; margin: 0; }
.filter-btn {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--fill-secondary);
  color: var(--label);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.filter-btn.active { background: var(--tint); color: #fff; }
.filter-btn:active { transform: scale(0.94); }
.filter-btn:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.filter-count {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--destructive);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 99px;
  padding: 7px 10px 7px 13px;
  background: color-mix(in srgb, var(--tint) 13%, transparent);
  color: var(--tint);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.filter-chip i { font-size: 13px; opacity: 0.8; }
.filter-section { margin-bottom: 18px; }
.filter-section .chip-select { margin-bottom: 0; }
.seg.seg-wide { display: flex; width: 100%; }
.seg.seg-wide .seg-option { flex: 1; padding: 9px 12px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

.item-more {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--label-secondary);
  font-size: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.item-more.open { background: var(--fill-secondary); color: var(--label); }
.item-more:focus-visible { outline: 2px solid var(--tint); outline-offset: 1px; }
@media (hover: hover) { .item-more:hover { background: var(--fill-secondary); color: var(--label); } }
.item-pinned { color: var(--warning); font-size: 14px; margin-right: 5px; vertical-align: -1px; }
.item-row.archived .item-bar { opacity: 0.35; }
.item-row.archived .item-name, .item-row.archived .item-price { color: var(--label-secondary); }

.row-menu {
  position: fixed;
  z-index: 200;
  min-width: 228px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 0.5px solid var(--separator);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 18px 44px -12px rgba(0, 0, 0, 0.28);
  animation: row-menu-in 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes row-menu-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
.row-menu-head {
  padding: 8px 12px 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--label-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.row-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--label);
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.row-menu-item i { font-size: 19px; color: var(--label-secondary); }
.row-menu-item.danger, .row-menu-item.danger i { color: var(--destructive); }
.row-menu-item:focus-visible { outline: 2px solid var(--tint); outline-offset: -2px; }
.row-menu-item:active { background: var(--fill-secondary); }
@media (hover: hover) { .row-menu-item:hover { background: var(--fill-secondary); } }

/* ---------- "Add ..." card: the first item of Products, VAT groups, Team ---------- */
.add-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 14px 14px 14px 20px;
  border: none;
  border-radius: 18px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(118deg, #0A84FF 0%, #5E5CE6 58%, #8E5CF7 100%);
  color: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(40, 60, 160, 0.16), 0 14px 30px -16px rgba(60, 50, 200, 0.55);
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}
.add-card:active { transform: scale(0.985); }
.add-card:focus-visible { outline: 2px solid var(--tint); outline-offset: 3px; }
@media (hover: hover) { .add-card:hover { box-shadow: 0 2px 4px rgba(40, 60, 160, 0.18), 0 18px 36px -16px rgba(60, 50, 200, 0.65); } }
.add-card-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.add-card-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.add-card-sub { font-size: 13.5px; color: rgba(255, 255, 255, 0.86); }
.add-card-plus {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

/* ---------- Account: the settings in tabs (pills) ---------- */
.tab-pills {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  margin: 18px 0 6px;
  padding: 8px 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg);
  box-shadow: -16px 0 0 var(--bg), 16px 0 0 var(--bg);
}
.tab-pills::-webkit-scrollbar { display: none; }
.tab-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: none;
  border-radius: 99px;
  background: var(--fill-secondary);
  color: var(--label);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.tab-pill i { font-size: 17px; color: var(--label-secondary); transition: color 0.15s ease; }
.tab-pill.selected { background: var(--tint); color: #fff; }
.tab-pill.selected i { color: #fff; }
.tab-pill:active { transform: scale(0.96); }
.tab-pill:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
@media (hover: hover) { .tab-pill:not(.selected):hover { background: color-mix(in srgb, var(--label) 14%, transparent); } }
.settings-pane { animation: pane-in 0.18s ease-out; }
.settings-pane > .group-label:first-child { margin-top: 10px; }
@keyframes pane-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* phones: all five tabs fit without scrolling sideways (labels only) */
@media (max-width: 520px) {
  .tab-pills { gap: 6px; }
  .tab-pill { padding: 8px 12px; font-size: 14px; }
  .tab-pill i { display: none; }
}

/* Account tabs: swipe between them (the pane follows the finger), the pill row
   scrolls sideways with fades at the edges that still have more. */
#tabAccount .screen-body { touch-action: pan-y pinch-zoom; }
#tabAccount .settings-pane { transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1); }
.settings-pane.from-right { animation: pane-from-right 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
.settings-pane.from-left { animation: pane-from-left 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes pane-from-right { from { opacity: 0.4; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes pane-from-left { from { opacity: 0.4; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.tab-pills { scroll-behavior: smooth; overscroll-behavior-x: contain; cursor: default; }
.tab-pills.fade-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.tab-pills.fade-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px); mask-image: linear-gradient(90deg, transparent, #000 36px); }
.tab-pills.fade-left.fade-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }

/* ---------- Switching shops ---------- */
.shop-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0 0 12px;
  padding: 14px 14px 14px 16px;
  border: none;
  border-radius: 20px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  color: var(--label);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.14s ease;
}
.shop-card:active { transform: scale(0.985); }
.shop-card:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
@media (hover: hover) { .shop-card:hover { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 12px 26px -14px rgba(0, 0, 0, 0.22); } }
.shop-card-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  color: #fff;
  background: linear-gradient(135deg, #0A84FF, #5E5CE6);
}
.shop-card-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shop-card-label { font-size: 12.5px; font-weight: 600; color: color-mix(in srgb, var(--label) 60%, transparent); }
.shop-card-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-card-switch {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--tint) 13%, transparent);
  color: var(--tint);
  font-size: 14.5px;
  font-weight: 650;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.on { background: var(--success); }
.status-dot.off { background: var(--label-tertiary); }
.switch-veil {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 16px;
  font-weight: 600;
  animation: pane-in 0.2s ease-out;
}
@media (min-width: 1024px) {
  .sidebar-brand { cursor: pointer; border-radius: 16px; transition: background 0.12s ease; }
  .sidebar-brand:hover { background: var(--fill-secondary); }
  .sidebar-brand:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
  .sidebar-brand-caret { margin-left: auto; color: var(--label-tertiary); font-size: 16px; }
}

/* ---------- Product form: extra barcodes ---------- */
.extra-barcodes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.extra-barcode-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 5px 0 12px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--tint) 12%, transparent);
  color: var(--label);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.extra-barcode-chip > i { color: var(--tint); font-size: 16px; }
.extra-barcode-chip button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--label-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
/* "+ Extra barcode": a small pill right after the Barcode label */
.field-label-group { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.extra-barcode-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px 0 8px;
  border: none;
  border-radius: 99px;
  background: color-mix(in srgb, var(--tint) 12%, transparent);
  color: var(--tint);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.extra-barcode-add[hidden] { display: none; }
.extra-barcode-add i { font-size: 13px; }
.extra-barcode-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 4px 0 14px;
  border-radius: 99px;
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1.5px var(--tint);
}
.extra-barcode-new input { width: 150px; border: none; background: none; outline: none; font-family: inherit; font-size: 15px; color: var(--label); }
.extra-barcode-scan {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--tint);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ---------- Shops sheet: the shop you are in on top, the others below ---------- */
.shop-sheet { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }
.shop-here {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 18px 20px 20px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(125deg, #0A84FF 0%, #5E5CE6 60%, #8E5CF7 100%);
  box-shadow: 0 2px 4px rgba(40, 60, 160, 0.16), 0 16px 34px -18px rgba(60, 50, 200, 0.6);
}
.shop-here-icon {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.shop-here-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.shop-here-name { font-size: 21px; font-weight: 750; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-here-status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.9); }
.shop-here .status-dot.on { background: #6EF29A; box-shadow: 0 0 0 3px rgba(110, 242, 154, 0.25); }
.shop-here-check {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  background: #fff;
  color: #5E5CE6;
}
.shop-row .item-meta { gap: 7px; }
.shop-row.offline .item-icon { filter: grayscale(0.85); opacity: 0.55; }
.shop-way {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.shop-way.instant { color: var(--warning); background: color-mix(in srgb, var(--warning) 14%, transparent); }
.shop-way.pin { color: var(--label-secondary); background: var(--fill-secondary); }

/* Sheets: the close X top right, an action (Save, Done, PDF ...) just left of
   it, the title from the left edge. Android's back button still finds the X
   (js/native.js: .nav-bar-plain .fab-left). */
.form-screen .nav-bar-plain { padding-left: 20px !important; padding-right: 72px !important; }
.form-screen .nav-bar-plain:has(.fab-pill) { padding-right: 190px !important; }
.form-screen .nav-bar-plain .fab-left { left: auto; right: 16px; }
.form-screen .nav-bar-plain .fab-pill { right: 66px; }
@media (min-width: 1024px) {
  .form-screen .nav-bar-plain .fab-left { left: auto; right: 16px; }
  .form-screen .nav-bar-plain .fab-pill { right: 66px; }
}

/* The till's ticket, drawn from its layout (login.js renderReportPreviewDocument):
   always paper - white with near-black ink, whatever the app's theme. */
.tk-paper {
  width: 100%;
  margin: 0 auto;
  padding: 20px 18px 24px;
  border-radius: 16px;
  background: #ffffff;
  color: #101828;
  font-family: Consolas, "SFMono-Regular", "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.38;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.tk-text { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-text.size-sm { font-size: 12px; }
.tk-text.size-lg { font-size: 17px; }
.tk-text.size-xl { font-size: 24px; line-height: 1.15; }
.tk-text.align-center { text-align: center; }
.tk-text.align-right { text-align: right; }
.tk-text.weight-bold { font-weight: 700; }
.tk-text.weight-medium { font-weight: 600; }
.tk-kv { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 7px; }
.tk-kv strong { font-weight: 700; text-align: right; }
.tk-rule { border-top: 1px dashed #475467; margin: 10px 0; }
.tk-line { display: flex; flex-direction: column; gap: 3px; padding: 2px 0 6px; }
.tk-line + .tk-line { border-top: 1px dashed rgba(17, 17, 17, 0.18); padding-top: 8px; }
.tk-line-head { display: flex; justify-content: space-between; gap: 14px; font-weight: 700; }
.tk-line-detail { font-size: 11.5px; color: #475467; }
.tk-image { display: flex; justify-content: center; margin: 0 0 10px; }
.tk-image.align-left { justify-content: flex-start; }
.tk-image.align-right { justify-content: flex-end; }
.tk-image img { max-width: 100%; object-fit: contain; }
.tk-barcode { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 8px; }
.tk-barcode canvas { width: 100%; height: 70px; image-rendering: pixelated; }
.tk-barcode span { font-size: 12.5px; letter-spacing: 0.18em; }
.report-preview-card:has(.tk-paper) { padding: 0; background: none; border: 0; box-shadow: none; }
