:root {
  --ink: #f0fdff;
  --muted: #7dd3fc;
  --muted-dark: #64748b;
  --line: rgba(0, 240, 255, 0.20);
  --line-gold: rgba(212, 175, 55, 0.35);
  --paper: #030712;
  --panel: #05101e;
  --panel-raised: #081a2f;
  --accent: #d4af37;
  --accent-strong: #bf953f;
  --gold-metallic: linear-gradient(135deg, #c59b27 0%, #fbf2db 24%, #d4af37 48%, #8c6218 72%, #f8e5b9 88%, #aa771c 100%);
  --cyan-electric: #00f0ff;
  --cyan-glow: 0 0 16px rgba(0, 240, 255, 0.45);
  --gold-glow: 0 0 16px rgba(212, 175, 55, 0.50);
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ff4d4d;
  --violet: #9b7fd4;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.7);

  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-raised);
  color: var(--ink);
  cursor: pointer;
  padding: 0 16px;
  transition: border-color 0.15s, background 0.15s;
}

button:hover {
  border-color: var(--accent);
  background: #1e1e16;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 107, 135, 0.24);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  letter-spacing: 0;
}

h4 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 400px;
}

.side-rail,
.cart-panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px;
}

.cart-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
  display: grid;
  align-content: start;
  gap: 16px;
  max-height: 100vh;
  overflow: auto;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--gold-metallic);
  color: #0d0d08;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.5px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.brand-lockup p,
.status-strip span,
label span,
.summary-grid span,
.cart-header p,
.compact-row p,
.inventory-row p,
.movement-row p,
.report-subsection p {
  color: var(--muted);
  font-size: 13px;
}

.mode-list,
.status-strip,
.mode-status,
.demo-controls {
  display: grid;
  gap: 10px;
}

.mode-button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.mode-button.is-active,
.payment-button.is-active,
.primary-action {
  background: linear-gradient(135deg, #c59b27 0%, #fbf2db 24%, #d4af37 48%, #8c6218 72%, #f8e5b9 88%, #aa771c 100%) !important;
  color: #060e18 !important;
  border-color: #d4af37 !important;
  font-weight: 800 !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 3px 10px rgba(0, 0, 0, 0.5), 0 0 14px rgba(212, 175, 55, 0.4) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

.checkout-button {
  background: linear-gradient(135deg, #c59b27 0%, #fbf2db 22%, #d4af37 45%, #8c6218 68%, #f8e5b9 85%, #aa771c 100%) !important;
  color: #040810 !important;
  border: 2px solid #fbf2db !important;
  border-radius: 12px !important;
  font-weight: 900 !important;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9), 0 0 24px rgba(212, 175, 55, 0.65), 0 4px 14px rgba(0, 0, 0, 0.5) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) !important;
  transition: all 0.2s ease-out;
}

.checkout-button:hover {
  background: linear-gradient(135deg, #d4af37 0%, #ffffff 22%, #e5c158 45%, #9e7220 68%, #fbf2db 85%, #c59b27 100%) !important;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 1), 0 0 32px rgba(212, 175, 55, 0.85), 0 6px 20px rgba(0, 0, 0, 0.6) !important;
  transform: translateY(-1px);
}

.status-strip {
  margin-top: 28px;
}

.status-strip > div,
.mode-status > div,
.summary-grid > div,
.panel-block,
.cart-card,
.receipt-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-raised);
}

.status-strip > div,
.mode-status > div,
.summary-grid > div {
  padding: 12px;
  display: grid;
  gap: 4px;
}

.demo-controls {
  margin-top: 28px;
}

.mode-status {
  margin-top: 14px;
}

.mode-status strong {
  font-size: 14px;
}

.work-area {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.top-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.search-field {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.operator-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

label {
  display: grid;
  gap: 6px;
}

input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1c1c1e;
  color: #ffffff;
  padding: 0 12px;
}

select {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1c1c1e;
  color: #ffffff;
  padding: 0 12px;
}

select {
  min-height: 46px;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1c1c1e;
  color: #ffffff;
  padding: 12px;
}

select {
  min-height: 46px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}

.live-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.view {
  display: none;
}

.view.is-visible {
  display: grid;
  gap: 16px;
}

.section-heading,
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.quick-actions,
.category-row,
.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.panel-block {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.category-button {
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.22);
  color: #e0f7fa;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.category-button:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-electric);
  color: #ffffff;
}

.category-button.is-active {
  background: var(--gold-metallic) !important;
  color: #060e18 !important;
  border-color: #d4af37 !important;
  font-weight: 800 !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 0 14px rgba(212, 175, 55, 0.45) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.product-card {
  min-height: 145px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  border: 1px solid rgba(0, 240, 255, 0.24) !important;
  background: linear-gradient(135deg, #071526 0%, #040d18 100%) !important;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.product-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--cyan-electric) !important;
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.3) !important;
}

.product-card strong {
  font-size: 18px;
  color: #d4af37;
  background: linear-gradient(135deg, #fcf6ba 0%, #d4af37 45%, #f9e79f 70%, #aa771c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.price-row,
.cart-line-top,
.cart-line-bottom,
.totals-box div,
.receipt-line,
.receipt-total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.grand-total strong,
#grandTotal {
  color: #d4af37 !important;
  background: linear-gradient(135deg, #fcf6ba 0%, #d4af37 45%, #f9e79f 70%, #aa771c 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-weight: 900 !important;
}

.stock-pill {
  border-radius: 999px;
  padding: 3px 8px;
  background: #ecf7f1;
  color: var(--green);
  font-size: 12px;
}

.stock-pill.low {
  background: #fff7df;
  color: var(--amber);
}

.stock-pill.out {
  background: #fdecea;
  color: var(--red);
}

.product-form,
.setup-grid,
.setup-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 14px;
}

.guided-setup {
  border-color: rgba(23, 107, 135, 0.42);
}

.guided-setup.is-complete .setup-form {
  display: none;
}

.setup-state {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-strong);
  background: #eaf4f7;
  font-weight: 700;
}

.helper-text {
  color: var(--muted);
  font-size: 14px;
}

.csv-import,
.daily-close,
.needs-attention,
.owner-dashboard,
.operator-onboarding,
.demo-release,
.data-safety,
.install-local-app,
.spoken-guidance,
.release-readiness,
.accessibility-release,
.business-reporting,
.export-centre,
.stock-intelligence,
.admin-summary,
.close-history,
.cash-discrepancy-history,
.stock-movement-report {
  gap: 14px;
}

.report-subsection {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.warning-box {
  border: 1px solid var(--amber);
  border-radius: 8px;
  background: #fff7df;
  color: var(--ink);
  padding: 12px;
}

.warning-box ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.toggle-row {
  grid-template-columns: 24px 1fr;
  align-items: center;
  align-self: end;
}

.toggle-row input {
  min-height: 22px;
}

.inventory-table,
.orders-list {
  display: grid;
  gap: 10px;
}

.inventory-row,
.order-row,
.compact-row {
  display: grid;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.inventory-row {
  grid-template-columns: 1.4fr 0.6fr 0.5fr 0.4fr 1fr;
}

.order-row {
  grid-template-columns: 1fr auto auto auto;
}

.compact-row {
  grid-template-columns: 1fr auto;
}

.attention-row,
.stock-row,
.movement-row {
  display: grid;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.attention-row {
  grid-template-columns: 1fr auto;
}

.attention-row.high {
  border-color: var(--red);
}

.attention-row.medium,
.stock-row.needs-stock {
  border-color: var(--amber);
}

.stock-row {
  grid-template-columns: 1fr auto auto auto;
}

.movement-row {
  grid-template-columns: 1.4fr auto auto auto;
}

.movement-row.needs-stock {
  border-color: var(--amber);
}

.backup-reminder {
  border-left: 4px solid var(--accent);
  background: #eaf4f7;
  color: var(--accent-strong);
  padding: 10px 12px;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.onboarding-grid article,
.check-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.onboarding-grid article {
  display: grid;
  gap: 6px;
}

.onboarding-grid p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 10px;
}

.check-row strong {
  color: var(--green);
}

.check-row.needs-review strong {
  color: var(--amber);
}

.danger-zone {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 12px;
}

.danger-action {
  border-color: var(--red);
  color: var(--red);
  font-weight: 800;
}

.demo-release {
  border-color: rgba(36, 115, 95, 0.46);
}

.app-shell.demo-mode .mode-status > div:first-child {
  border-color: var(--green);
}

.app-shell.live-mode .mode-status > div:first-child {
  border-color: var(--accent);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.close-extra-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1.3fr);
  gap: 14px;
}

.summary-text {
  white-space: pre-wrap;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
}

.is-inactive {
  opacity: 0.62;
}

.warning-text {
  color: var(--amber);
}

.cart-card,
.receipt-panel {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.cart-items {
  min-height: 180px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.cart-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-controls button {
  width: 42px;
  padding: 0;
}

.totals-box {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  display: grid;
  gap: 8px;
}

.grand-total {
  padding-top: 8px;
  font-size: 24px;
}

.checkout-controls {
  display: grid;
  gap: 10px;
}

.payment-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.cash-box {
  display: none;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.cash-box.is-visible {
  display: grid;
}

.cash-box strong,
.checkout-button {
  font-size: 20px;
  font-weight: 800;
}

.checkout-button {
  min-height: 58px;
}

.receipt-content {
  min-height: 160px;
  display: grid;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.receipt-heading {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.receipt-total {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  font-size: 18px;
}

.empty-state {
  min-height: 112px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: var(--muted);
}

.large-text {
  font-size: 18px;
}

.large-text button,
.large-text input,
.large-text select {
  min-height: 52px;
}

.large-text h1 {
  font-size: 22px;
}

.large-text h2 {
  font-size: 26px;
}

.high-contrast {
  --ink: #000000;
  --muted: #303030;
  --line: #000000;
  --paper: #ffffff;
  --panel: #ffffff;
  --accent: #005fcc;
  --accent-strong: #003f88;
  --shadow: none;
}

.trial-mode .mode-status > div:first-child {
  border-color: var(--green);
  background: #eef7f3;
}

.safety-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.safety-grid strong {
  min-height: 64px;
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 6px solid var(--green);
  border-radius: 8px;
  padding: 12px;
  background: #f6fbf8;
  line-height: 1.35;
}

.shadow-safety .helper-text,
.fast-trial-logging .helper-text {
  max-width: 760px;
}

.trial-notes .primary-action {
  margin: 10px 0 12px;
}

.simple-mode .brand-lockup p,
.simple-mode .status-strip,
.simple-mode .product-card > span,
.simple-mode .operator-panel {
  display: none;
}


@media print {
  body {
    background: #fff;
  }

  button,
  input,
  select,
  textarea,
  .side-rail,
  .top-bar,
  .live-status,
  .checkout-controls,
  .cart-card,
  .demo-controls,
  .mode-status,
  .quick-actions,
  .guided-setup,
  .csv-import,
  .export-centre {
    display: none !important;
  }

  .app-shell,
  .work-area,
  .cart-panel,
  .view.is-visible,
  .receipt-panel {
    display: block;
    min-height: auto;
    max-height: none;
    overflow: visible;
    border: 0;
    padding: 0;
  }

  .view {
    display: none !important;
  }

  .view.is-visible {
    display: block !important;
  }

  .summary-grid,
  .two-column,
  .orders-list,
  .receipt-content {
    display: grid;
    gap: 8px;
  }

  .panel-block,
  .receipt-panel,
  .summary-grid > div,
  .compact-row,
  .order-row {
    border: 1px solid #000;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
  }
}

@media (max-width: 520px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .cart-header,
  .price-row,
  .cart-line-bottom {
    align-items: stretch;
    flex-direction: column;
  }
}

@media print {
  body * {
    visibility: hidden;
  }
  .receipt-panel, .receipt-panel * {
    visibility: visible;
  }
  .receipt-panel {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    box-shadow: none;
  }
  .receipt-actions {
    display: none !important;
  }
}

.setup-dialog {
  border: 1px solid #444;
  border-radius: 16px;
  padding: 24px;
  max-width: 520px;
  width: 92%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.85);
  background: #1c1c1e !important;
  color: #ffffff !important;
}

.setup-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.setup-dialog h2 {
  margin-top: 0;
  color: #ffffff !important;
}

.setup-dialog .field {
  margin-bottom: 16px;
}

.setup-dialog .field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #f0f0f5 !important;
}

.setup-dialog .field input[type="text"],
.setup-dialog .field input[type="number"] {
  width: 100%;
  padding: 12px;
  background: #2c2c2e !important;
  color: #ffffff !important;
  border: 1px solid #555555 !important;
  border-radius: 8px;
  font-size: 16px !important;
  font-weight: 700 !important;
}

.setup-dialog .field input::placeholder {
  color: #a0a0a5 !important;
}

/* ==========================================================================
   Responsive Workstation Layout Engine (Landscape, iPad Portrait & Mobile)
   ========================================================================== */

/* 1. Desktop & iPad Landscape (min-width: 1025px) */
@media (min-width: 1025px) {
  .app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 390px;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    max-width: 100vw;
  }

  .app-shell.no-cart {
    grid-template-columns: 240px minmax(0, 1fr) !important;
  }

  .side-rail {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    background: var(--panel);
    border-right: 1px solid var(--line);
    padding: 20px 16px;
    position: sticky;
    top: 0;
  }

  .work-area {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    max-width: 100%;
    padding: 24px;
  }

  .cart-panel {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    padding: 20px;
    background: var(--panel);
    border-left: 1px solid var(--line);
    display: grid;
    align-content: start;
    gap: 16px;
  }
}

/* 2. iPad Portrait, Landscape & Medium Tablets (up to 1280px) */
@media (max-width: 1280px) and (min-width: 681px) {
  .app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.95fr);
    grid-template-rows: auto 1fr;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    width: 100vw;
    max-width: 100vw;
  }

  .app-shell.no-cart {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr !important;
  }

  /* Spacious Horizontal Top Nav Header filling the banner */
  .side-rail {
    grid-column: 1 / -1;
    height: auto !important;
    max-height: none !important;
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 24px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
    background: var(--panel) !important;
    gap: 20px;
    z-index: 50;
  }

  .brand-lockup {
    margin-bottom: 0 !important;
    flex-shrink: 0;
  }

  .brand-lockup img {
    max-width: 250px !important;
    max-height: 56px !important;
    height: auto !important;
    width: auto !important;
  }

  .mode-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    margin: 0 !important;
    overflow-x: auto;
    flex: 1;
    justify-content: space-evenly !important;
  }

  .mode-button {
    flex: 1 !important;
    width: auto !important;
    min-height: 48px !important;
    padding: 10px 16px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    justify-content: center !important;
    text-align: center !important;
    letter-spacing: 0.3px;
  }

  .side-rail .status-strip {
    display: none !important;
  }

  /* Products / Sales catalog column on iPad Portrait */
  .work-area {
    grid-column: 1;
    height: calc(100vh - 60px) !important;
    max-height: calc(100vh - 60px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 16px !important;
  }

  .app-shell.no-cart .work-area {
    grid-column: 1 / -1 !important;
  }

  /* Cart & Checkout column on iPad Portrait */
  .cart-panel {
    grid-column: 2;
    height: calc(100vh - 60px) !important;
    max-height: calc(100vh - 60px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-width: 0 !important;
    padding: 16px !important;
    border-left: 1px solid var(--line) !important;
    border-top: none !important;
    background: var(--panel);
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 10px !important;
  }

  .product-card {
    min-height: 135px !important;
    padding: 10px !important;
  }
}

/* 3. Small Screen Phones (680px and below) */
@media (max-width: 680px) {
  .app-shell {
    display: block !important;
    min-height: 100vh !important;
    height: auto !important;
    overflow: visible !important;
  }

  .side-rail {
    height: auto !important;
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 12px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .brand-lockup {
    justify-content: center !important;
    margin-bottom: 10px !important;
  }

  .brand-lockup img {
    max-width: 140px !important;
  }

  .mode-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .mode-button {
    flex: 1 1 calc(50% - 6px) !important;
    min-height: 42px !important;
    font-size: 13px !important;
    justify-content: center !important;
  }

  .status-strip {
    display: none !important;
  }

  .work-area {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 14px !important;
  }

  .cart-panel {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 14px !important;
    border-left: none !important;
    border-top: 2px solid var(--line) !important;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .two-column {
    grid-template-columns: 1fr !important;
  }
}

/* Bulletproof Navigation Link Styling - Zero Purple Visited State */
a.mode-button,
a.mode-button:link,
a.mode-button:visited,
.side-rail a,
.side-rail a:link,
.side-rail a:visited,
.mode-list a,
.mode-list a:link,
.mode-list a:visited,
.mode-button,
.mode-button:link,
.mode-button:visited {
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  box-sizing: border-box;
  color: #00f0ff !important;
  -webkit-text-fill-color: #00f0ff !important;
  background: rgba(0, 240, 255, 0.08) !important;
  border: 1px solid rgba(0, 240, 255, 0.28) !important;
  font-weight: 700 !important;
  transition: all 0.2s ease;
}

a.mode-button:hover,
.side-rail a:hover,
.mode-list a:hover,
.mode-button:hover {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: rgba(0, 240, 255, 0.22) !important;
  border-color: #00f0ff !important;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5) !important;
}

a.mode-button.is-active,
a.mode-button.is-active:link,
a.mode-button.is-active:visited,
.side-rail a.is-active,
.side-rail a.is-active:link,
.side-rail a.is-active:visited,
.mode-list a.is-active,
.mode-list a.is-active:link,
.mode-list a.is-active:visited,
.mode-button.is-active,
.mode-button.is-active:link,
.mode-button.is-active:visited {
  background: linear-gradient(135deg, #c59b27 0%, #fbf2db 24%, #d4af37 48%, #8c6218 72%, #f8e5b9 88%, #aa771c 100%) !important;
  color: #040810 !important;
  -webkit-text-fill-color: #040810 !important;
  border: 1px solid #fbf2db !important;
  font-weight: 900 !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 3px 10px rgba(0, 0, 0, 0.5), 0 0 16px rgba(212, 175, 55, 0.5) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

/* Radar scan animation for contactless payment */
@keyframes radar-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.9;
    box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.7);
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
    box-shadow: 0 0 0 28px rgba(0, 240, 255, 0);
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.terminal-radar-active .radar-ping {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--cyan-electric);
  animation: radar-pulse 1.8s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  pointer-events: none;
}

/* Cash Touch Numpad & Quick Note Buttons */
.cash-numpad {
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  background: var(--panel);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.cash-quick-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.cash-note-btn {
  min-height: 40px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  background: rgba(212, 175, 55, 0.12) !important;
  color: var(--gold-bright) !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  border-radius: 6px !important;
  padding: 6px 4px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cash-note-btn:active,
.cash-note-btn:hover {
  background: var(--gold-bright) !important;
  color: #040810 !important;
  border-color: #fbf2db !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.5) !important;
}

.cash-note-btn.exact-btn {
  background: rgba(0, 240, 255, 0.15) !important;
  color: var(--cyan-electric) !important;
  border-color: rgba(0, 240, 255, 0.4) !important;
}

.cash-note-btn.exact-btn:active,
.cash-note-btn.exact-btn:hover {
  background: var(--cyan-electric) !important;
  color: #040810 !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.6) !important;
}

.cash-digits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.cash-digit-btn {
  min-height: 44px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  background: var(--panel-raised) !important;
  color: #f0fdff !important;
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.cash-digit-btn:active,
.cash-digit-btn:hover {
  background: rgba(0, 240, 255, 0.2) !important;
  color: var(--cyan-electric) !important;
  border-color: var(--cyan-electric) !important;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3) !important;
}

.cash-digit-btn.clear-btn {
  color: #ff5555 !important;
  background: rgba(255, 85, 85, 0.1) !important;
  border-color: rgba(255, 85, 85, 0.3) !important;
}

.cash-digit-btn.clear-btn:active,
.cash-digit-btn.clear-btn:hover {
  background: #ff5555 !important;
  color: #ffffff !important;
}

/* Contactless Terminal Minimalist Card & Color Emanation States */
.terminal-modal-card {
  background: #061423;
  border: 2px solid var(--cyan-electric);
  border-radius: 24px;
  width: 100%;
  max-width: 380px;
  padding: 22px 20px 24px;
  text-align: center;
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 240, 255, 0.25);
  transition: all 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Active scanning emanation (Cool Cyan Aura) */
.terminal-modal-card.state-scanning {
  background: radial-gradient(circle at center, rgba(0, 240, 255, 0.08) 0%, #05121f 100%);
  border-color: var(--cyan-electric) !important;
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.35), inset 0 0 25px rgba(0, 240, 255, 0.08) !important;
}

/* Approved emanation (Vibrant Emerald Green Aura) */
.terminal-modal-card.state-approved {
  background: radial-gradient(circle at center, rgba(0, 230, 118, 0.24) 0%, #03150a 100%) !important;
  border-color: #00e676 !important;
  box-shadow: 0 0 85px rgba(0, 230, 118, 0.7), inset 0 0 40px rgba(0, 230, 118, 0.25) !important;
}

.terminal-modal-card.state-approved #terminalRadar {
  border-color: #00e676 !important;
  box-shadow: 0 0 45px rgba(0, 230, 118, 0.8) !important;
  background: radial-gradient(circle, rgba(0, 230, 118, 0.25) 0%, rgba(3, 21, 10, 0) 70%) !important;
}

.terminal-modal-card.state-approved .radar-ping {
  border-color: #00e676 !important;
}

.terminal-modal-card.state-approved #contactlessDueAmount {
  color: #00e676 !important;
  background: none !important;
  -webkit-text-fill-color: #00e676 !important;
  text-shadow: 0 0 25px rgba(0, 230, 118, 0.85);
}

.terminal-modal-card.state-approved #terminalStatusMsg {
  color: #00e676 !important;
  text-shadow: 0 0 12px rgba(0, 230, 118, 0.6);
}

/* Declined emanation (Crimson Warning Red Aura) */
.terminal-modal-card.state-declined {
  background: radial-gradient(circle at center, rgba(255, 51, 68, 0.26) 0%, #190407 100%) !important;
  border-color: #ff3344 !important;
  box-shadow: 0 0 85px rgba(255, 51, 68, 0.7), inset 0 0 40px rgba(255, 51, 68, 0.25) !important;
}

.terminal-modal-card.state-declined #terminalRadar {
  border-color: #ff3344 !important;
  box-shadow: 0 0 45px rgba(255, 51, 68, 0.8) !important;
  background: radial-gradient(circle, rgba(255, 51, 68, 0.25) 0%, rgba(25, 4, 7, 0) 70%) !important;
}

.terminal-modal-card.state-declined .radar-ping {
  border-color: #ff3344 !important;
}

.terminal-modal-card.state-declined #contactlessDueAmount {
  color: #ff3344 !important;
  background: none !important;
  -webkit-text-fill-color: #ff3344 !important;
  text-shadow: 0 0 25px rgba(255, 51, 68, 0.85);
}

.terminal-modal-card.state-declined #terminalStatusMsg {
  color: #ff3344 !important;
  text-shadow: 0 0 12px rgba(255, 51, 68, 0.6);
}


