:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-muted: #f8f9fb;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e4e6eb;
  --blue: #0071e3;
  --blue-dark: #005bb8;
  --blue-soft: #eaf3ff;
  --green: #16853f;
  --green-soft: #eaf8ef;
  --amber: #b65c00;
  --amber-soft: #fff3e3;
  --red: #d92d20;
  --red-soft: #fff0ef;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius: 16px;
  --radius-lg: 22px;
  --motion-fast: 140ms;
  --motion-base: 200ms;
  --motion-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Inter, "SF Pro Text", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }

button { cursor: pointer; }

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

button, input, textarea { min-height: 44px; }

:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.35);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.page-shell { min-height: 100vh; }

.app-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.brand-block { display: flex; align-items: baseline; gap: 12px; }
.brand-block h1 { margin: 0; font-size: 1.25rem; }
.brand-block .eyebrow { display: none; }
.brand-copy { margin: 0; color: var(--muted); font-size: 0.85rem; }
.header-meta, .header-status, .mode-switch { display: flex; align-items: center; gap: 10px; }

.mode-switch {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
}

.mode-switch button {
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.mode-switch button[data-active="true"] { background: var(--blue); color: white; }

.status-pill, .store-pill, .shift-pill, .cart-count-pill, .review-badge, .stock {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.status-pill, .shift-pill { padding: 7px 11px; background: var(--green-soft); color: var(--green); }
.status-pill::before, .shift-pill::before { width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; content: ""; }
.store-pill { padding: 7px 11px; background: var(--surface-muted); color: var(--muted); }

.terminal-shell {
  display: grid;
  min-height: calc(100vh - 72px);
  grid-template-columns: 230px minmax(520px, 1fr) 420px;
  background: var(--surface);
}

.panel { background: var(--surface); }

.left-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 24px 16px 16px;
  border-right: 1px solid var(--line);
}

.terminal-logo { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; border-bottom: 1px solid var(--line); }
.terminal-logo h2 { margin: 0; font-size: 1rem; }
.terminal-logo p { margin: 3px 0 0; color: var(--muted); font-size: 0.75rem; }
.logo-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; background: var(--blue); color: white; font-weight: 800; }

.employee-card { padding: 22px 8px 14px; text-align: center; }
.employee-card h3 { margin: 10px 0 4px; }
.employee-card p { margin: 3px 0; color: var(--muted); font-size: 0.86rem; }
.employee-avatar, .customer-avatar {
  display: grid;
  width: 68px;
  height: 68px;
  margin: auto;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #e2aa38, #b36c13);
  color: white;
  font-weight: 700;
}
.employee-card .shift-pill { margin-top: 12px; }

.rail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 18px; }
.rail-stats article { padding: 8px 4px; border-radius: 10px; background: var(--surface-muted); text-align: center; }
.rail-stats span { display: block; color: var(--muted); font-size: 0.62rem; }
.rail-stats strong { display: block; margin-top: 4px; font-size: 0.9rem; }

.side-nav { display: grid; gap: 5px; }
.side-link { min-height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: left; }
.side-link.active { background: var(--blue-soft); color: var(--blue); font-weight: 650; }
.rail-actions { display: grid; gap: 8px; margin-top: auto; }

.terminal-center { min-width: 0; border-right: 1px solid var(--line); background: #fafbfc; }
.shortcut-toolbar { display: flex; min-height: 64px; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.shortcut-button { display: inline-flex; min-height: 42px; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.shortcut-key { display: grid; min-width: 28px; height: 28px; place-items: center; border: 1px solid #d4d7dd; border-radius: 7px; background: var(--surface-muted); font-weight: 700; font-size: 0.78rem; }

.catalog-panel { min-height: calc(100vh - 136px); padding: 18px 20px 26px; }
.search-shell { display: flex; align-items: end; gap: 10px; }
.search-field { display: grid; flex: 1; gap: 6px; }
.field-label { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.search-field input, .dialog-card input, .dialog-card textarea {
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}
.dialog-card textarea { min-height: 96px; padding-block: 12px; resize: vertical; }
.scan-button { min-width: 68px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--blue); }

.catalog-filters { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.category-row, .aux-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.category-row button, .ghost-chip {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}
.category-row button[data-active="true"] { border-color: var(--blue); background: var(--blue); color: white; }
.toggle { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; color: var(--muted); font-size: 0.82rem; }
.toggle input { min-height: auto; }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)); gap: 12px; }
.product-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.product-media { display: grid; aspect-ratio: 1.15 / 1; place-items: center; overflow: hidden; background: linear-gradient(#fff, #f6f7f9); }
.product-media img { width: 100%; height: 100%; padding: 10px; object-fit: contain; }
.product-copy { display: grid; gap: 6px; padding: 11px; }
.product-card h3 { min-height: 2.65em; margin: 0; overflow: hidden; font-size: 0.9rem; line-height: 1.3; }
.product-sku, .product-brand { margin: 0; overflow: hidden; color: var(--muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.product-meta { display: grid; gap: 5px; }
.product-meta > strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.stock { padding: 0; background: transparent; }
.stock-ok { color: var(--green); }
.stock-low { color: var(--amber); }
.stock-out { color: var(--red); }
.review-badge { padding: 5px 8px; background: var(--amber-soft); color: var(--amber); }
.add-button, .pay-button, .secondary-button, .danger-button, .load-more-button {
  border-radius: 11px;
  font-weight: 650;
}
.add-button { min-height: 42px; border: 0; background: var(--blue); color: white; }
.add-button:hover:not(:disabled), .pay-button:hover:not(:disabled) { background: var(--blue-dark); }
.add-button:disabled { background: #eceef1; color: #777b82; }
.catalog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; }
.catalog-footer p { margin: 0; color: var(--muted); font-size: 0.8rem; }
.load-more-button { min-width: 110px; padding: 0 15px; border: 1px solid var(--line); background: var(--surface); color: var(--blue); }

.cart-panel { min-width: 0; padding: 20px 18px; overflow: auto; }
.cart-panel-header { display: flex; align-items: center; justify-content: space-between; }
.cart-panel-header h2 { margin: 2px 0 0; font-size: 1.35rem; }
.eyebrow { margin: 0; color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; }
.cart-count-pill { padding: 7px 10px; background: var(--blue-soft); color: var(--blue); }
.customer-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.customer-main { display: flex; min-width: 0; align-items: center; gap: 10px; }
.customer-avatar { width: 46px; height: 46px; flex: 0 0 46px; margin: 0; }
.customer-card h3 { margin: 0; font-size: 0.92rem; }
.customer-card p { margin: 3px 0 0; overflow: hidden; color: var(--muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.inline-action, .ghost-button, .danger-link { min-height: 36px; padding: 6px; border: 0; background: transparent; color: var(--blue); }
.danger-link { color: var(--red); }

.cart-list { display: grid; gap: 8px; }
.cart-item { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.cart-item-media { display: grid; width: 58px; height: 58px; place-items: center; overflow: hidden; border-radius: 10px; background: var(--surface-muted); }
.cart-item-media img { width: 100%; height: 100%; padding: 4px; object-fit: contain; }
.cart-item-copy { min-width: 0; }
.cart-item-copy h4 { margin: 0; overflow: hidden; font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-copy p { margin: 4px 0; color: var(--muted); font-size: 0.68rem; }
.cart-item-copy strong { font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.cart-item-actions { display: grid; gap: 4px; justify-items: end; }
.stepper { display: flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; }
.stepper button { min-width: 32px; min-height: 32px; border: 0; border-radius: 6px; background: transparent; }
.stepper span { min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.empty-cart, .empty-state { display: grid; gap: 6px; padding: 24px 14px; border: 1px dashed #cfd3da; border-radius: 12px; color: var(--muted); text-align: center; }
.empty-cart span, .empty-state p { margin: 0; font-size: 0.82rem; }

.cart-controls { display: flex; gap: 10px; margin: 14px 0; }
.discount-stack { flex: 1; }
.discount-control { display: grid; gap: 4px; }
.discount-control input { width: 100%; min-height: 28px; accent-color: var(--blue); }
.discount-stack p { margin: 3px 0 8px; color: var(--muted); font-size: 0.65rem; }
.hold-actions { display: grid; align-content: end; gap: 6px; }
.secondary-button, .danger-button { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.danger-button { border-color: #ffb9b3; color: var(--red); }

.totals { display: grid; gap: 8px; margin: 12px 0; }
.totals > div { display: flex; justify-content: space-between; gap: 12px; }
.totals dt, .totals dd { margin: 0; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.totals .discount-line { color: var(--red); }
.totals .grand-total { margin-top: 3px; padding-top: 10px; border-top: 1px solid var(--line); }
.totals .grand-total dt, .totals .grand-total dd { font-size: 1.25rem; font-weight: 750; }
.payment-actions { display: grid; gap: 8px; }
.pay-button { min-height: 54px; padding: 0 18px; border: 0; background: var(--blue); color: white; font-size: 1rem; }
.pay-button:disabled { background: #cfd3da; color: #6e6e73; }

.success-panel, .mobile-success { padding: 18px; border: 1px solid #bfe7cd; border-radius: 14px; background: #fbfefc; text-align: center; }
.success-icon { display: grid; width: 64px; height: 64px; margin: 0 auto 10px; place-items: center; border: 3px solid #78cc96; border-radius: 50%; color: var(--green); font-size: 2rem; }
.success-panel h3, .mobile-success h3 { margin: 0 0 5px; }
.success-panel p, .mobile-success p { margin: 0 0 10px; color: var(--muted); }
.success-panel dl, .mobile-success dl { display: grid; gap: 6px; margin: 12px 0; }
.success-panel dl div, .mobile-success dl div { display: flex; justify-content: space-between; }
.success-panel dt, .success-panel dd, .mobile-success dt, .mobile-success dd { margin: 0; font-size: 0.8rem; }

.placeholder-image { display: grid; width: 100%; height: 100%; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #eef3f8, #f9fafb); color: #8491a3; }
.placeholder-image span { font-size: 2rem; font-weight: 800; }
.placeholder-image.small { width: 58px; height: 58px; }

.mobile-shell { display: none; }

.overlay-dialog { width: min(92vw, 520px); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24); }
.overlay-dialog::backdrop { background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px); }
.dialog-card { display: grid; gap: 14px; padding: 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 2px 0 0; }
.dialog-card label { display: grid; gap: 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-actions .pay-button { min-height: 44px; }
.icon-button { display: grid; width: 44px; min-height: 44px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text); font-size: 1.2rem; }
.held-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.held-card div:first-child { display: grid; gap: 3px; }
.held-card span { color: var(--muted); font-size: 0.72rem; }
.held-actions { display: flex; gap: 5px; }
.held-actions button { min-height: 38px; border: 0; background: transparent; color: var(--blue); }

.toast { position: fixed; z-index: 1000; right: 18px; bottom: 18px; max-width: min(380px, calc(100vw - 36px)); padding: 12px 16px; border-radius: 12px; background: #1d1d1f; color: white; box-shadow: var(--shadow); }
.toast[data-tone="success"] { background: #116b32; }
.toast[data-tone="warning"] { background: #8b4a00; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.fatal-error { width: min(640px, calc(100% - 32px)); margin: 80px auto; padding: 24px; border-radius: 18px; background: white; box-shadow: var(--shadow); }

body[data-mode="mobile"] .terminal-shell { display: none; }
body[data-mode="mobile"] .mobile-shell { display: block; }

.mobile-shell { width: min(100%, 430px); min-height: calc(100vh - 90px); margin: 18px auto; padding: 0 14px 88px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.mobile-header { position: sticky; z-index: 5; top: 0; padding: 18px 0 12px; background: rgba(255, 255, 255, 0.96); }
.mobile-header-top, .mobile-header-meta, .mobile-titlebar, .section-head, .target-row, .order-card { display: flex; align-items: center; justify-content: space-between; }
.mobile-header h2, .mobile-titlebar h3, .section-head h3 { margin: 0; }
.mobile-header-meta { margin-top: 8px; }
.mobile-panel { display: grid; gap: 14px; padding-top: 8px; }
.mobile-home-card { padding: 18px; border-radius: 16px; background: linear-gradient(135deg, #0872ed, #0563d7); color: white; }
.mobile-home-card p { margin: 0 0 8px; }
.mobile-home-card > strong { display: block; font-size: 1.9rem; }
.target-row { margin-top: 16px; font-size: 0.78rem; }
.progress-track { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.28); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: white; }
.mobile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mobile-stats article { padding: 12px 6px; border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.mobile-stats strong, .mobile-stats span { display: block; }
.mobile-stats span { margin-top: 4px; color: var(--muted); font-size: 0.68rem; }
.mobile-quick-actions { display: grid; gap: 7px; }
.quick-action-card { display: flex; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; }
.action-copy { display: grid; gap: 3px; }
.action-copy small { color: var(--muted); }
.action-arrow { color: var(--muted); font-size: 1.4rem; }
.order-card { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.order-card p { margin: 4px 0 0; color: var(--muted); font-size: 0.72rem; }
.order-meta { text-align: right; }
.mobile-search .field-label { display: none; }
.mobile-product-list { display: grid; gap: 9px; }
.mobile-product-list .product-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); }
.mobile-product-list .product-media { aspect-ratio: auto; min-height: 116px; }
.mobile-product-list .product-copy { padding: 10px; }
.mobile-product-list .product-card h3 { min-height: auto; }
.mobile-product-list .add-button { width: 100%; }
.mobile-load-more { width: 100%; }
.customer-card.mobile { margin-top: 0; }
.cart-list.compact .cart-item { grid-template-columns: 48px minmax(0, 1fr) auto; padding-inline: 0; }
.cart-list.compact .cart-item-media, .cart-list.compact .placeholder-image.small { width: 48px; height: 48px; }
.mobile-cart-actions, .mobile-success-actions { display: grid; gap: 8px; }
.mobile-cart-actions { position: sticky; z-index: 10; bottom: 74px; padding: 10px 0; background: rgba(255, 255, 255, 0.97); }
.mobile-success-frame { display: grid; gap: 12px; }
.mobile-nav { position: fixed; z-index: 20; left: 50%; bottom: 10px; display: grid; width: min(calc(100% - 28px), 402px); grid-template-columns: repeat(4, 1fr); transform: translateX(-50%); padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14); }
.mobile-nav button { min-height: 48px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.mobile-nav button[data-active="true"] { background: var(--blue-soft); color: var(--blue); font-weight: 650; }

@media (max-width: 1260px) and (min-width: 901px) {
  .terminal-shell { grid-template-columns: 190px minmax(460px, 1fr) 350px; }
  .product-grid { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .rail-stats { grid-template-columns: 1fr; }
  .brand-copy, .header-status { display: none; }
  .cart-controls { display: grid; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .app-header { min-height: 64px; padding-inline: 16px; }
  .brand-copy, .header-status, .mode-switch { display: none; }
  .terminal-shell { min-height: calc(100vh - 64px); grid-template-columns: minmax(0, 1fr) 340px; }
  .left-rail { display: none; }
  .terminal-center { min-width: 0; }
  .shortcut-toolbar { overflow-x: auto; padding-inline: 14px; }
  .shortcut-button { flex: 0 0 auto; }
  .catalog-panel { padding-inline: 14px; }
  .catalog-filters { align-items: flex-start; flex-direction: column; }
  .product-grid { grid-template-columns: repeat(2, minmax(145px, 1fr)); }
  .cart-panel { padding-inline: 14px; }
  .cart-controls { display: grid; }
}

@media (max-width: 767px) {
  .app-header, .terminal-shell { display: none !important; }
  .mobile-shell { display: block; width: 100%; min-height: 100vh; margin: 0 auto; border-radius: 0; box-shadow: none; }
}

/* Salesperson access and desktop viewport repair */
.sales-auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(360px, 480px);
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
  padding: clamp(28px, 6vw, 88px);
  background: #f5f6f7;
}
.sales-auth-brand { max-width: 560px; }
.sales-auth-brand h1 { margin: 10px 0 14px; font-size: clamp(2.5rem, 5vw, 4.8rem); letter-spacing: -.055em; }
.sales-auth-brand p:last-child { max-width: 440px; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.sales-auth-card { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 22px 70px rgba(24,32,44,.11); }
.sales-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 22px; padding: 4px; border-radius: 10px; background: #f1f2f4; }
.sales-auth-tabs button { min-height: 42px; border: 0; border-radius: 7px; background: transparent; color: #626a74; font-weight: 700; }
.sales-auth-tabs button[data-active="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(20,28,40,.1); }
.sales-auth-card form { display: grid; gap: 15px; }
.sales-auth-card label { display: grid; gap: 7px; color: #4d555f; font-size: .76rem; font-weight: 700; }
.sales-auth-card input { width: 100%; min-height: 50px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: #fafafb; color: var(--text); }
.sales-auth-card input:focus { border-color: var(--blue); outline: 3px solid rgba(20,110,245,.12); }
.sales-auth-card .pay-button { margin-top: 4px; }
.field-help { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.form-error { margin: 0; color: var(--red); font-size: .76rem; }
.application-success { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: .76rem; }
.header-cashier { min-height: 36px; padding: 5px 9px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.header-cashier:hover { background: #f1f3f5; }
.utility-dialog-card { width: min(620px, calc(100vw - 36px)); }
.salesperson-profile { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafafb; }
.salesperson-profile .employee-avatar { width: 48px; height: 48px; flex: 0 0 48px; margin: 0; }
.salesperson-profile div { display: grid; gap: 3px; }
.salesperson-profile span,
.salesperson-profile small { color: var(--muted); font-size: .72rem; }
.desktop-order-list { display: grid; gap: 8px; max-height: 52vh; overflow-y: auto; }
.desktop-order-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.desktop-order-row div { display: grid; gap: 3px; }
.desktop-order-row span { color: var(--muted); font-size: .72rem; }

@media (min-width: 768px) {
  html,
  body { width: 100%; height: 100%; overflow: hidden; }
  body { position: fixed; inset: 0; }
  body > .page-shell { height: 100%; overflow: hidden; }
  .terminal-shell { max-height: calc(100vh - 64px); overflow: hidden; contain: strict; }
  .terminal-bottom-nav { position: relative; z-index: 20; }
}

@media (max-width: 767px) {
  .sales-auth-shell { grid-template-columns: 1fr; align-content: center; gap: 22px; padding: calc(28px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }
  .sales-auth-brand h1 { font-size: 2.35rem; }
  .sales-auth-brand p:last-child { font-size: .86rem; }
  .sales-auth-card { padding: 20px; border-radius: 16px; }
}

@media (max-width: 430px) {
  .mobile-shell { padding-inline: 12px; }
  .mobile-product-list .product-card { grid-template-columns: 82px minmax(0, 1fr); }
  .customer-card.mobile { align-items: flex-start; }
  .customer-card.mobile .inline-action { min-width: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* User-supplied OLA brand asset */
.sales-auth-brand-logo,
.logo-mark-image,
.mobile-brand-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.sales-auth-brand-logo {
  width: 40px;
  height: 40px;
}

.logo-mark-image {
  width: 40px;
  height: 40px;
}

.mobile-brand-logo {
  width: 38px;
  height: 38px;
}

@media (max-width: 767px) {
  .mobile-header-top { gap: 10px; }
  .mobile-brand { flex: 1; margin-right: auto; }
  .sales-auth-brand-logo { width: 36px; height: 36px; }
}

/* ImageGen v4 refinement: premium beauty retail workstation */
:root {
  --bg: #f6f4f0;
  --surface: #fffefc;
  --surface-muted: #f7f5f1;
  --text: #171717;
  --muted: #77736d;
  --line: #e7e2da;
  --blue: #1f5fd1;
  --blue-dark: #174ba6;
  --blue-soft: #eef4ff;
  --green: #277a47;
  --green-soft: #edf8f0;
  --amber: #a85b0a;
  --amber-soft: #fff4e8;
  --premium: #b38a4a;
  --shadow: 0 12px 30px rgba(54, 44, 31, 0.055);
  --shadow-card: 0 5px 16px rgba(54, 44, 31, 0.045);
  --radius: 16px;
  --radius-lg: 20px;
}

body { background: var(--bg); }

button, .product-card { transition: border-color var(--motion-fast) var(--motion-ease), background-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-base) var(--motion-ease), transform var(--motion-fast) var(--motion-ease); }

@media (hover: hover) {
  .product-card:hover { border-color: #d8d0c5; box-shadow: 0 10px 24px rgba(54, 44, 31, 0.08); transform: translateY(-1px); }
  .compact-add:hover:not(:disabled) { transform: translateY(-1px) scale(1.035); }
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  min-height: 64px;
  grid-template-columns: 1fr auto 1fr;
  padding: 8px 24px;
  border-color: var(--line);
  background: rgba(255, 254, 252, 0.96);
  backdrop-filter: blur(14px);
}

.brand-block { grid-column: 1; gap: 10px; }
.brand-block::before { width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid var(--premium); border-radius: 7px 50%; content: ""; transform: rotate(45deg); }
.brand-block h1 { font-size: 1.12rem; letter-spacing: -0.015em; }
.brand-copy { color: #8b857c; font-size: 0.78rem; }
.header-meta { display: contents; }
.mode-switch { grid-column: 2; justify-self: center; border-color: #ded8cf; background: #faf9f6; }
.mode-switch button { min-width: 94px; color: #625e58; font-weight: 650; }
.mode-switch button[data-active="true"] { background: var(--blue); box-shadow: 0 5px 12px rgba(31, 95, 209, 0.16); }
.header-status { grid-column: 3; justify-self: end; }
.header-sales { display: flex; min-height: 40px; align-items: center; gap: 12px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.header-sales span { color: var(--muted); font-size: 0.72rem; }
.header-sales strong { font-size: 0.88rem; font-variant-numeric: tabular-nums; }

.terminal-shell { min-height: calc(100vh - 64px); grid-template-columns: 204px minmax(610px, 1fr) 410px; background: var(--bg); }
.left-rail { padding: 18px 14px 14px; border-color: var(--line); background: #fffefc; }
.terminal-logo { gap: 9px; padding: 0 6px 16px; border-color: var(--line); }
.terminal-logo h2 { font-size: 0.94rem; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--blue); }

.employee-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  column-gap: 11px;
  padding: 18px 6px 14px;
  text-align: left;
}
.employee-avatar { width: 54px; height: 54px; grid-row: 1 / 5; margin: 0; background: linear-gradient(145deg, #d4ad61, #b77a22); }
.employee-card h3 { margin: 1px 0 2px; font-size: 0.92rem; }
.employee-card p { margin: 0; font-size: 0.72rem; }
.employee-card .shift-pill { min-height: 28px; margin: 6px 0 0; padding: 4px 8px; font-size: 0.68rem; }

.rail-section-title { margin: 10px 5px 7px; color: #514d47; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; }
.rail-stats { gap: 0; margin: 0 0 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fbfaf7; }
.rail-stats article { padding: 10px 2px; border-radius: 0; background: transparent; }
.rail-stats article + article { border-left: 1px solid var(--line); }
.rail-stats span { font-size: 0.58rem; }
.rail-stats strong { font-size: 0.82rem; }

.side-nav { gap: 3px; }
.side-link { position: relative; min-height: 46px; padding-left: 17px; color: #393633; font-size: 0.88rem; }
.side-link.active { background: var(--blue-soft); color: var(--blue); }
.side-link.active::before { position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px; border-radius: 99px; background: var(--blue); content: ""; }
.rail-actions .secondary-button { background: #faf9f6; }

.terminal-center { border-color: var(--line); background: var(--bg); }
.shortcut-toolbar { min-height: 62px; padding: 9px 18px; border-color: var(--line); background: #fffefc; }
.shortcut-button { min-height: 40px; padding: 6px 11px; border-color: var(--line); border-radius: 10px; background: #fff; font-size: 0.82rem; }
.shortcut-key { min-width: 27px; height: 27px; border-color: #d9d3ca; background: #f9f7f3; }

.catalog-panel { min-height: calc(100vh - 126px); padding: 17px 18px 28px; background: var(--bg); }
.search-shell { gap: 8px; }
.search-shell .field-label { display: none; }
.search-field input { min-height: 48px; padding-inline: 16px; border-color: var(--line); border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.scan-button { min-height: 48px; border-color: var(--line); background: #fff; }
.catalog-filters { margin: 12px 0 15px; }
.category-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.category-row::-webkit-scrollbar { display: none; }
.category-row button, .ghost-chip { min-height: 38px; padding-inline: 12px; border-color: transparent; background: transparent; color: #625e58; }
.category-row button { flex: 0 0 auto; white-space: nowrap; }
.category-row button[data-active="true"] { border-color: var(--blue); background: var(--blue); box-shadow: 0 4px 10px rgba(31,95,209,.14); }
.aux-filters { flex: 0 0 auto; }
.toggle { padding: 0 4px; font-size: 0.75rem; }
.ghost-chip { border-color: var(--line); background: #fff; }

.product-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; }
.product-card { overflow: hidden; border-color: var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-card); }
.product-media { aspect-ratio: 1.08 / 1; background: linear-gradient(180deg, #f9f7f3 0%, #f4f1ec 100%); }
.product-media img { padding: 13px; }
.product-copy { gap: 5px; padding: 11px 12px 12px; }
.product-card h3 { min-height: 2.5em; font-size: 0.86rem; line-height: 1.25; }
.product-sku { color: #8c867e; font-size: 0.65rem; }
.product-brand { color: #817b73; font-size: 0.68rem; }
.product-footer { display: flex; min-height: 48px; align-items: end; justify-content: space-between; gap: 8px; margin-top: 2px; }
.product-meta { min-width: 0; gap: 3px; }
.product-meta > strong { font-size: 1rem; }
.stock { font-size: 0.68rem; }
.review-badge { padding: 3px 7px; font-size: 0.65rem; }
.compact-add { display: grid; width: 44px; min-width: 44px; height: 44px; min-height: 44px; place-items: center; padding: 0; border-radius: 50%; font-size: 1.55rem; font-weight: 400; box-shadow: 0 5px 12px rgba(31,95,209,.17); }
.compact-add:disabled { background: #ece8e1; box-shadow: none; }
.catalog-footer { color: var(--muted); }

.cart-panel { position: sticky; top: 64px; display: flex; height: calc(100vh - 64px); flex-direction: column; padding: 18px 18px 14px; border-color: var(--line); background: #fffefc; }
.cart-panel-header h2 { font-size: 1.35rem; }
.cart-count-pill { background: var(--blue-soft); }
.customer-card { margin: 12px 0; padding: 11px 12px; border-color: var(--line); background: #fff; box-shadow: var(--shadow-card); }
.customer-avatar { background: linear-gradient(145deg, #cfaa60, #b37519); }
.cart-list { max-height: 32vh; overflow-y: auto; }
.empty-cart { min-height: 190px; align-content: center; border-color: #d9d3ca; background: #fdfcf9; }
.empty-bag { position: relative; display: block; width: 34px; height: 29px; margin: 0 auto 8px; border: 1.5px solid #989087; border-radius: 3px; }
.empty-bag::before { position: absolute; top: -10px; left: 8px; width: 16px; height: 12px; border: 1.5px solid #989087; border-bottom: 0; border-radius: 10px 10px 0 0; content: ""; }
.cart-controls { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 12px 0 8px; }
.discount-stack p { margin-bottom: 6px; }
.discount-stack .secondary-button { border: 0; padding-inline: 4px; color: var(--blue); text-align: left; }
.hold-actions { display: grid; grid-template-columns: 1fr; }
.hold-actions .secondary-button { min-width: 110px; }
.totals { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.payment-actions { margin-top: 4px; }
.pay-button { min-height: 52px; background: var(--blue); box-shadow: 0 8px 18px rgba(31,95,209,.16); }
.register-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.68rem; }

@media (max-width: 1260px) and (min-width: 1024px) {
  .terminal-shell { grid-template-columns: 178px minmax(470px, 1fr) 350px; }
  .product-grid { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
  .brand-copy, .header-sales { display: none; }
  .employee-card { grid-template-columns: 46px 1fr; }
  .employee-avatar { width: 46px; height: 46px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .app-header { display: grid; }
  .mode-switch { display: flex; }
  .terminal-shell { grid-template-columns: minmax(0, 1fr) 330px; }
  .product-grid { grid-template-columns: repeat(2, minmax(145px, 1fr)); }
  .cart-panel { top: 64px; height: calc(100vh - 64px); }
}

@media (max-width: 767px) {
  .mobile-shell { background: #f8f6f2; }
  .mobile-header { background: rgba(255,254,252,.96); }
  .mobile-product-list .product-card { grid-template-columns: 94px minmax(0, 1fr); box-shadow: var(--shadow-card); }
  .mobile-product-list .product-media { min-height: 132px; }
  .mobile-product-list .product-footer { align-items: center; }
  .mobile-product-list .compact-add { width: 44px; min-width: 44px; }
  .mobile-nav { border-color: var(--line); background: rgba(255,254,252,.97); }
}

/* ImageGen v5: black luxury retail interface */
:root {
  color-scheme: dark;
  --bg: #050506;
  --surface: #101012;
  --surface-muted: #141416;
  --text: #f4f4f5;
  --muted: #9b9ba1;
  --line: rgba(255, 255, 255, 0.085);
  --blue: #5b7cff;
  --blue-dark: #6f8eff;
  --blue-soft: rgba(91, 124, 255, 0.13);
  --green: #4ccb7f;
  --green-soft: rgba(76, 203, 127, 0.12);
  --amber: #e6a55a;
  --amber-soft: rgba(230, 165, 90, 0.12);
  --red: #ff6b63;
  --red-soft: rgba(255, 107, 99, 0.12);
  --premium: #c7a467;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.24);
}

html, body { background: var(--bg); color: var(--text); }
body { background-image: radial-gradient(circle at 44% -20%, rgba(80, 80, 90, 0.08), transparent 36%); }
::selection { background: rgba(91, 124, 255, 0.35); color: #fff; }

:focus-visible { outline-color: rgba(91, 124, 255, 0.78); }
input, textarea { caret-color: #8fa5ff; }
input::placeholder, textarea::placeholder { color: #6f6f76; opacity: 1; }
input[type="checkbox"], input[type="range"] { accent-color: var(--blue); }

.app-header {
  grid-template-columns: 1fr auto;
  border-color: var(--line);
  background: rgba(5, 5, 6, 0.96);
  box-shadow: 0 1px 0 rgba(255,255,255,.025);
}
.brand-block::before { border-color: var(--premium); box-shadow: 0 0 18px rgba(199,164,103,.09); }
.brand-block h1 { color: #f5f4f2; }
.brand-copy { color: #77777d; }
.header-status { grid-column: 2; }
.status-pill, .shift-pill { background: var(--green-soft); color: var(--green); }
.store-pill { background: #101012; color: #aaa7a2; border: 1px solid var(--line); }
.header-sales { border-color: var(--line); background: #0d0d0f; }
.header-sales span { color: #85858b; }
.header-sales strong { color: #efeeeb; }

.terminal-shell { background: #080809; }
.panel, .left-rail, .cart-panel { background: #080809; }
.left-rail { border-color: var(--line); }
.terminal-logo { border-color: var(--line); }
.terminal-logo h2 { color: #f4f4f5; }
.terminal-logo p, .employee-card p { color: #89898f; }
.logo-mark { background: transparent; color: var(--premium); border: 1px solid rgba(199,164,103,.55); }
.employee-avatar, .customer-avatar { background: linear-gradient(145deg, #c7a467, #8f6427); color: #080809; }
.rail-section-title { color: #a9a6a0; }
.rail-stats { border-color: var(--line); background: #0e0e10; }
.rail-stats article + article { border-color: var(--line); }
.rail-stats span { color: #77777e; }
.rail-stats strong { color: #f0efec; }
.side-link { color: #c7c7ca; }
.side-link:hover { background: #111114; color: #fff; }
.side-link.active { background: #151519; color: #85a0ff; }
.side-link.active::before { background: var(--blue); box-shadow: 0 0 14px rgba(91,124,255,.25); }
.rail-actions .secondary-button { background: #0f0f11; }

.terminal-center { border-color: var(--line); background: #080809; }
.shortcut-toolbar { border-color: var(--line); background: #080809; }
.shortcut-button { border-color: var(--line); background: #0e0e10; color: #dedde0; }
.shortcut-button:hover { border-color: rgba(255,255,255,.16); background: #141417; }
.shortcut-key { border-color: rgba(255,255,255,.14); background: #17171a; color: #f0f0f2; }

.catalog-panel { background: #080809; }
.search-field input, .dialog-card input, .dialog-card textarea {
  border-color: var(--line);
  background: #0d0d0f;
  color: #f1f1f3;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.search-field input:focus { border-color: rgba(91,124,255,.72); box-shadow: 0 0 0 3px rgba(91,124,255,.12); }
.scan-button { border-color: var(--line); background: #0d0d0f; color: #91a8ff; }
.category-row button, .ghost-chip { color: #b1b1b6; }
.category-row button:hover { background: #111114; color: #fff; }
.category-row button[data-active="true"] { border-color: rgba(91,124,255,.65); background: rgba(91,124,255,.16); color: #9cb0ff; box-shadow: inset 0 0 0 1px rgba(91,124,255,.08); }
.ghost-chip { border-color: var(--line); background: #0d0d0f; }
.toggle { color: #9a9aa0; }

.product-card { border-color: var(--line); background: #101012; box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,.025); }
.product-media { background: radial-gradient(circle at 50% 38%, #242427 0%, #18181b 38%, #111113 76%); }
.product-media img { filter: brightness(.88) contrast(1.04); }
.product-copy { background: #101012; }
.product-card h3 { color: #f0f0f2; }
.product-sku { color: #717178; }
.product-brand { color: #898990; }
.product-meta > strong { color: #f4f3f0; }
.stock-ok { color: var(--green); }
.stock-low { color: var(--amber); }
.stock-out { color: var(--red); }
.review-badge { background: var(--amber-soft); color: #efb66f; border: 1px solid rgba(230,165,90,.24); }
.compact-add { background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(36,69,183,.32); }
.compact-add:hover:not(:disabled) { background: #6c89ff; }
.compact-add:disabled { background: #2b2b2f; color: #77777e; border: 1px solid var(--line); }
.load-more-button { border-color: var(--line); background: #0e0e10; color: #a9b8ff; }
.catalog-footer { color: #78787e; }

.cart-panel { border-color: var(--line); background: #0b0b0d; box-shadow: -10px 0 34px rgba(0,0,0,.12); }
.cart-panel-header h2 { color: #f5f4f2; }
.cart-count-pill { background: rgba(91,124,255,.12); color: #8da5ff; }
.customer-card { border-color: var(--line); background: #111113; box-shadow: inset 0 1px 0 rgba(255,255,255,.025); }
.customer-card h3 { color: #f2f2f3; }
.customer-card p { color: #8d8d93; }
.inline-action, .ghost-button { color: #86a0ff; }
.cart-item { border-color: var(--line); background: #0f0f11; border-radius: 12px; }
.cart-item-media { background: #18181b; }
.cart-item-copy h4, .cart-item-copy strong { color: #eeeef0; }
.stepper { border-color: var(--line); background: #151518; }
.stepper button { color: #e4e4e6; }
.empty-cart { border-color: rgba(255,255,255,.12); background: #0d0d0f; color: #929298; }
.empty-bag, .empty-bag::before { border-color: #8b8b91; }
.discount-stack p { color: #76767d; }
.discount-stack .secondary-button { color: #86a0ff; }
.secondary-button { border-color: var(--line); background: #111113; color: #dedde0; }
.secondary-button:hover { background: #17171a; border-color: rgba(255,255,255,.15); }
.danger-button { border-color: rgba(255,107,99,.25); background: rgba(255,107,99,.06); color: #ff8580; }
.totals { border-color: var(--line); }
.totals dt, .totals dd { color: #d1d1d4; }
.totals .discount-line { color: var(--red); }
.totals .discount-line dt, .totals .discount-line dd { color: var(--red); }
.totals .grand-total dt, .totals .grand-total dd { color: #f5f4f2; }
.pay-button { background: #f2efe8; color: #0b0b0c; box-shadow: 0 10px 24px rgba(0,0,0,.34); }
.pay-button:hover:not(:disabled) { background: #fffdf8; }
.pay-button:disabled { background: #252528; color: #66666d; box-shadow: none; }
.register-meta { border-color: var(--line); color: #6f6f76; }
.success-panel, .mobile-success { border-color: rgba(76,203,127,.26); background: #0d120f; }
.success-icon { border-color: rgba(76,203,127,.45); color: var(--green); }

.placeholder-image { background: radial-gradient(circle at 50% 35%, #242427, #141416 70%); color: #77777e; }
.overlay-dialog { background: #101012; color: #f4f4f5; box-shadow: 0 28px 90px rgba(0,0,0,.65); }
.overlay-dialog::backdrop { background: rgba(0,0,0,.72); }
.dialog-card { background: #101012; }
.held-card { border-color: var(--line); background: #151518; }
.held-card span { color: #898990; }
.toast { background: #19191c; color: #f2f2f3; border: 1px solid var(--line); }

.mobile-shell { background: #050506; color: var(--text); }
.mobile-header { background: rgba(5,5,6,.96); border-bottom: 1px solid var(--line); }
.mobile-home-card { background: #111113; border: 1px solid var(--line); color: #f4f4f5; }
.progress-track { background: #242428; }
.progress-track span { background: var(--premium); }
.mobile-stats article, .quick-action-card, .order-card { border-color: var(--line); background: #101012; color: #f2f2f3; }
.mobile-stats span, .action-copy small, .order-card p { color: #8e8e94; }
.mobile-product-list .product-card { background: #101012; }
.mobile-cart-actions { background: rgba(5,5,6,.97); }
.mobile-nav { border-color: var(--line); background: rgba(11,11,13,.97); box-shadow: 0 16px 38px rgba(0,0,0,.46); }
.mobile-nav button { color: #85858b; }
.mobile-nav button[data-active="true"] { background: rgba(91,124,255,.14); color: #9db0ff; }

@media (hover: hover) {
  .product-card:hover { border-color: rgba(255,255,255,.15); background: #131316; box-shadow: 0 16px 36px rgba(0,0,0,.32); }
}

@media (max-width: 1260px) and (min-width: 1024px) {
  .app-header { grid-template-columns: 1fr auto; }
  .header-status { display: flex; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .app-header { grid-template-columns: 1fr; }
  .header-status { display: none; }
}

@media (max-width: 767px) {
  .mobile-shell { background: #050506; }
  .mobile-header { background: rgba(5,5,6,.96); }
  .mobile-product-list .product-media { background: radial-gradient(circle at 50% 40%, #232326, #131315 72%); }
  .mobile-nav { background: rgba(11,11,13,.97); }
}

/* Appearance variants: deliberately hidden behind Tweaks so the POS stays operationally quiet. */
:root { --product-image-brightness: .88; }

.product-media img,
.cart-item-media img { filter: brightness(var(--product-image-brightness, .88)) contrast(1.04); }

.tweaks-trigger {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 950;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  background: rgba(18,18,20,.78);
  color: #8b8b91;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .04em;
  transition: border-color .18s ease, color .18s ease, transform .18s ease, background .18s ease;
}

.tweaks-trigger:hover,
.tweaks-trigger[aria-expanded="true"] {
  border-color: rgba(255,255,255,.2);
  background: rgba(27,27,30,.94);
  color: #f4f4f5;
  transform: translateY(-1px);
}

.tweaks-panel {
  position: fixed;
  right: 18px;
  bottom: 64px;
  z-index: 1000;
  width: min(316px, calc(100vw - 36px));
  padding: 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(17,17,19,.96);
  box-shadow: 0 24px 80px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(24px);
}

.tweaks-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.tweaks-head span {
  display: block;
  color: #74747b;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .14em;
}

.tweaks-head h2 { margin: 4px 0 0; font-size: 1rem; font-weight: 650; }
.tweaks-head .icon-button { min-width: 34px; min-height: 34px; color: #9b9ba1; }

.theme-options { display: grid; gap: 7px; }

.theme-options > button {
  display: grid;
  min-height: 52px;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: #0d0d0f;
  color: #d8d8dc;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.theme-options > button:hover { border-color: rgba(255,255,255,.16); background: #151518; }
.theme-options > button:active { transform: scale(.985); }
.theme-options > button[aria-pressed="true"] { border-color: rgba(91,124,255,.56); background: rgba(91,124,255,.1); }
.theme-options strong,
.theme-options small { display: block; }
.theme-options strong { font-size: .78rem; }
.theme-options small { margin-top: 2px; color: #7f7f86; font-size: .66rem; }

.theme-dot {
  display: block;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.theme-dot.obsidian { background: linear-gradient(135deg, #050506 52%, #5b7cff 52%); }
.theme-dot.carbon { background: linear-gradient(135deg, #0a0b0d 52%, #7c8daa 52%); }
.theme-dot.noir-gold { background: linear-gradient(135deg, #030303 52%, #c7a467 52%); }

.brightness-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  margin-top: 14px;
  color: #aaaab0;
  font-size: .72rem;
}

.brightness-control output { color: #f2f2f3; font-variant-numeric: tabular-nums; }
.brightness-control input { width: 100%; min-height: 26px; grid-column: 1 / -1; }

body[data-theme="carbon"] {
  --bg: #0a0b0d;
  --surface: #15171b;
  --surface-muted: #1a1c21;
  --line: rgba(205,218,236,.1);
  --blue: #7c8daa;
  --blue-dark: #91a1bc;
  --blue-soft: rgba(124,141,170,.15);
  --premium: #a8a094;
}

body[data-theme="carbon"] .terminal-shell,
body[data-theme="carbon"] .left-rail,
body[data-theme="carbon"] .terminal-center,
body[data-theme="carbon"] .shortcut-toolbar,
body[data-theme="carbon"] .catalog-panel { background: #0c0d0f; }
body[data-theme="carbon"] .cart-panel { background: #101114; }
body[data-theme="carbon"] .product-card,
body[data-theme="carbon"] .product-copy,
body[data-theme="carbon"] .mobile-stats article,
body[data-theme="carbon"] .quick-action-card,
body[data-theme="carbon"] .order-card { background: #15171b; }
body[data-theme="carbon"] .product-media { background: radial-gradient(circle at 50% 38%, #2a2d33, #1b1d22 42%, #131519 78%); }
body[data-theme="carbon"] .category-row button[data-active="true"],
body[data-theme="carbon"] .mobile-nav button[data-active="true"] { color: #b4c1d6; }

body[data-theme="noir-gold"] {
  --bg: #030303;
  --surface: #11100e;
  --surface-muted: #171511;
  --line: rgba(225,204,163,.11);
  --blue: #c7a467;
  --blue-dark: #d8b777;
  --blue-soft: rgba(199,164,103,.14);
  --premium: #d4b779;
}

body[data-theme="noir-gold"] .terminal-shell,
body[data-theme="noir-gold"] .left-rail,
body[data-theme="noir-gold"] .terminal-center,
body[data-theme="noir-gold"] .shortcut-toolbar,
body[data-theme="noir-gold"] .catalog-panel { background: #060605; }
body[data-theme="noir-gold"] .cart-panel { background: #0b0a08; }
body[data-theme="noir-gold"] .product-card,
body[data-theme="noir-gold"] .product-copy,
body[data-theme="noir-gold"] .mobile-stats article,
body[data-theme="noir-gold"] .quick-action-card,
body[data-theme="noir-gold"] .order-card { background: #11100e; }
body[data-theme="noir-gold"] .product-media { background: radial-gradient(circle at 50% 38%, #29251d, #191711 43%, #100f0c 78%); }
body[data-theme="noir-gold"] .category-row button[data-active="true"],
body[data-theme="noir-gold"] .mobile-nav button[data-active="true"],
body[data-theme="noir-gold"] .inline-action,
body[data-theme="noir-gold"] .ghost-button,
body[data-theme="noir-gold"] .discount-stack .secondary-button { color: #e1c48b; }
body[data-theme="noir-gold"] .compact-add { color: #080706; box-shadow: 0 8px 18px rgba(104,75,26,.32); }
body[data-theme="noir-gold"] .theme-options > button[aria-pressed="true"] { border-color: rgba(199,164,103,.56); background: rgba(199,164,103,.1); }

@media (max-width: 767px) {
  .tweaks-trigger { right: 12px; bottom: 82px; }
  .tweaks-panel { right: 12px; bottom: 126px; width: calc(100vw - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  .tweaks-trigger,
  .theme-options > button { transition: none; }
}

/* ImageGen v12: Square white terminal implementation */
:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-muted: #f4f5f6;
  --text: #15171a;
  --muted: #68707b;
  --line: #e3e5e8;
  --blue: #146ef5;
  --blue-dark: #0b5fd7;
  --blue-soft: #edf4ff;
  --green: #1f8f55;
  --green-soft: #edf8f2;
  --amber: #c67818;
  --amber-soft: #fff5e8;
  --red: #d94b45;
  --red-soft: #fff0ef;
  --shadow: 0 18px 50px rgba(24, 32, 44, 0.12);
  --shadow-card: none;
  --product-image-brightness: 1;
}

html,
body { background: var(--bg); color: var(--text); }
body { background-image: none; }
::selection { background: #cfe1ff; color: #0b3474; }
:focus-visible { outline-color: rgba(20,110,245,.42); }
input,
textarea { caret-color: var(--blue); }
input::placeholder,
textarea::placeholder { color: #9299a3; }

.app-header {
  display: flex;
  min-height: 64px;
  grid-template-columns: none;
  padding: 0 22px;
  border-color: var(--line);
  background: rgba(255,255,255,.97);
  box-shadow: none;
}
.brand-block { align-items: center; gap: 18px; }
.brand-block::before,
.brand-block .eyebrow,
.brand-copy,
.header-sales { display: none; }
.brand-block h1 { color: var(--text); font-size: 1.18rem; letter-spacing: -.025em; }
.header-meta,
.header-status { display: flex; align-items: center; gap: 18px; }
.header-status { grid-column: auto; }
.status-pill,
.store-pill { min-height: 32px; padding: 0; border: 0; background: transparent; }
.status-pill { color: var(--green); }
.store-pill { order: -1; color: #3d434b; }
.header-cashier { color: var(--text); font-size: .82rem; font-weight: 650; }
.global-language-switch {
  position: fixed;
  top: 14px;
  right: 350px;
  z-index: 1100;
  display: flex;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(247,248,249,.96);
}
.global-language-switch button {
  min-width: 42px;
  min-height: 26px;
  padding: 2px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #69717b;
  font-size: .68rem;
  font-weight: 700;
}
.global-language-switch button:hover { color: var(--text); }
.global-language-switch button[data-active="true"] { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(26,35,49,.1); }

.terminal-shell {
  display: grid;
  height: calc(100vh - 64px);
  min-height: 680px;
  grid-template-columns: minmax(0, 1fr) 410px;
  grid-template-rows: minmax(0, 1fr) 76px;
  grid-template-areas:
    "center cart"
    "nav nav";
  background: var(--bg);
}
.left-rail { display: none; }
.terminal-center {
  grid-area: center;
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-color: var(--line);
  background: var(--surface);
}

.shortcut-toolbar {
  display: flex;
  min-height: 62px;
  flex: 0 0 62px;
  align-items: stretch;
  justify-content: space-between;
  gap: 20px;
  padding: 0 18px;
  border-color: var(--line);
  background: var(--surface);
}
.terminal-tabs { display: flex; align-items: stretch; gap: 4px; }
.terminal-tabs button {
  position: relative;
  min-width: 88px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #4f5660;
  font-size: .82rem;
  font-weight: 650;
}
.terminal-tabs button::after {
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}
.terminal-tabs button:hover { color: var(--text); }
.terminal-tabs button[data-active="true"] { color: var(--blue); }
.terminal-tabs button[data-active="true"]::after { background: var(--blue); }
.shortcut-actions { display: flex; align-items: center; gap: 7px; }
.shortcut-button {
  min-height: 36px;
  gap: 5px;
  padding: 4px 8px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #545b64;
  font-size: .72rem;
}
.shortcut-button:hover { border-color: #c9cdd2; background: #f8f9fa; color: var(--text); }
.shortcut-key {
  min-width: 24px;
  height: 24px;
  border-color: var(--line);
  border-radius: 6px;
  background: var(--surface-muted);
  color: #555c66;
  font-size: .65rem;
}

.catalog-panel {
  min-height: 0;
  flex: 1;
  padding: 16px 18px 24px;
  overflow-y: auto;
  background: var(--surface);
}
.search-shell { align-items: center; gap: 8px; }
.search-shell .field-label { display: none; }
.search-field input,
.dialog-card input,
.dialog-card textarea {
  min-height: 50px;
  border-color: var(--line);
  border-radius: 10px;
  background: #fafafb;
  color: var(--text);
  box-shadow: none;
}
.search-field input:focus {
  border-color: rgba(20,110,245,.72);
  box-shadow: 0 0 0 3px rgba(20,110,245,.11);
}
.scan-button {
  min-width: 72px;
  min-height: 50px;
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--blue);
}
.catalog-filters { margin: 12px 0; }
.category-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.category-row::-webkit-scrollbar { display: none; }
.category-row button,
.ghost-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 12px;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  color: #4e555e;
}
.category-row button:hover { background: #f1f3f5; color: var(--text); }
.category-row button[data-active="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: none;
}
.aux-filters { flex: 0 0 auto; }
.aux-filters .ghost-chip { display: none; }
.toggle { color: #69717c; font-size: .72rem; }

.product-grid { grid-template-columns: repeat(4, minmax(148px, 1fr)); gap: 10px; }
.product-card,
.quick-tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: none;
}
.product-card {
  transition: border-color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}
.product-media { aspect-ratio: 1.18 / 1; background: #f8f8f8; }
.product-media img,
.cart-item-media img { padding: 12px; filter: none; mix-blend-mode: multiply; }
.product-copy { gap: 4px; padding: 9px 10px 10px; background: var(--surface); }
.product-card h3 { min-height: 2.45em; color: var(--text); font-size: .78rem; line-height: 1.24; text-wrap: pretty; }
.product-sku { color: #9a9fa7; font-size: .58rem; }
.product-brand { color: #747b85; font-size: .62rem; }
.product-footer { min-height: 46px; align-items: end; }
.product-meta { gap: 2px; }
.product-meta > strong { color: var(--text); font-size: .9rem; }
.stock { font-size: .61rem; }
.stock-ok { color: var(--green); }
.stock-low { color: var(--amber); }
.stock-out { color: var(--red); }
.review-badge { border: 0; background: var(--amber-soft); color: var(--amber); }
.compact-add {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  box-shadow: none;
  font-size: 1.35rem;
}
.compact-add:hover:not(:disabled) { background: var(--blue-dark); }
.compact-add:disabled { border: 1px solid var(--line); background: #eceef1; color: #9da3ac; }
.load-more-button { border-color: var(--line); background: var(--surface); color: var(--blue); }
.catalog-footer { color: #7c838d; }

.quick-tile {
  display: grid;
  min-height: 190px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  color: #252a30;
  text-align: center;
}
.quick-tile:hover { border-color: #cbd0d6; transform: translateY(-1px); }
.quick-tile-aqua { background: #eaf8f7; }
.quick-tile-rose { background: #fff0f1; }
.quick-tile-lilac { background: #f2effc; }
.quick-tile-sand { background: #fff5e8; }
.quick-tile-mark {
  width: 25px;
  height: 32px;
  border: 2px solid currentColor;
  border-radius: 6px 6px 3px 3px;
  opacity: .56;
}
.quick-tile strong { font-size: 1rem; }
.quick-tile small { color: #707781; font-size: .68rem; }
.terminal-favorites-empty { grid-column: 1 / -1; min-height: 320px; align-content: center; }

.cart-panel {
  position: static;
  grid-area: cart;
  display: flex;
  min-height: 0;
  height: auto;
  flex-direction: column;
  padding: 16px 16px 12px;
  overflow: hidden;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}
.cart-panel-header { flex: 0 0 auto; }
.cart-panel-header .eyebrow { display: none; }
.cart-panel-header h2 { color: var(--text); font-size: 1.15rem; }
.cart-count-pill { background: var(--blue-soft); color: var(--blue); }
.customer-card {
  flex: 0 0 auto;
  margin: 12px 0 0;
  padding: 11px 4px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.customer-avatar { width: 40px; height: 40px; flex-basis: 40px; background: #eef0f3; color: #343a42; }
.customer-card h3 { color: var(--text); }
.customer-card p { color: var(--muted); }
.inline-action,
.ghost-button { color: var(--blue); }
.cart-list { min-height: 140px; max-height: 31vh; flex: 1 1 auto; overflow-y: auto; }
.cart-item {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 11px 0;
  border-color: var(--line);
  border-radius: 0;
  background: transparent;
}
.cart-item-media { width: 52px; height: 52px; border-radius: 8px; background: #f7f7f8; }
.cart-item-copy h4,
.cart-item-copy strong { color: var(--text); }
.stepper { border-color: var(--line); background: #f7f8f9; }
.stepper button { color: var(--text); }
.empty-cart { min-height: 180px; border-color: var(--line); background: #fbfbfc; color: #777f89; }
.empty-bag,
.empty-bag::before { border-color: #9ca3ad; }
.cart-controls { flex: 0 0 auto; grid-template-columns: 1fr auto; margin: 10px 0 6px; }
.discount-control,
#discount-note { display: none; }
.discount-stack .secondary-button { color: var(--blue); }
.hold-actions { display: flex; }
.secondary-button { border-color: var(--line); background: var(--surface); color: #30363d; }
.secondary-button:hover { border-color: #cbd0d6; background: #f8f9fa; }
.totals { margin-top: auto; border-color: var(--line); }
.totals dt,
.totals dd { color: #3e454d; }
.totals .discount-line dt,
.totals .discount-line dd { color: var(--blue); }
.totals .grand-total dt,
.totals .grand-total dd { color: var(--text); }
.payment-actions { flex: 0 0 auto; }
.payment-actions .secondary-button { display: none; }
.pay-button {
  min-height: 54px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  box-shadow: none;
}
.pay-button:hover:not(:disabled) { background: var(--blue-dark); }
.pay-button:disabled { background: #e8eaed; color: #9ba1aa; }
.register-meta { display: none; }

.terminal-bottom-nav {
  grid-area: nav;
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.98);
}
.terminal-bottom-nav button {
  display: grid;
  min-height: 76px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #555d67;
  font-size: .7rem;
}
.terminal-bottom-nav button:hover { background: #f7f8fa; color: var(--text); }
.terminal-bottom-nav button[data-active="true"] { color: var(--blue); }
.nav-symbol { min-height: 18px; font-size: 1.18rem; line-height: 1; }

.overlay-dialog { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.overlay-dialog::backdrop { background: rgba(22,27,34,.38); }
.dialog-card { background: var(--surface); }
.held-card { border-color: var(--line); background: #fafafb; }
.held-card span { color: var(--muted); }
.toast { border: 1px solid #252a30; background: #20242a; color: #fff; }
.toast:not([hidden]) { animation: toast-in var(--motion-base) var(--motion-ease); }
button[aria-busy="true"] { cursor: progress; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.placeholder-image { background: #f3f4f5; color: #8b929c; }
.success-panel { border-color: #bfe4cf; background: #f2fbf6; }
.success-icon { border-color: #9ed4b7; color: var(--green); }

@media (hover: hover) {
  .product-card:hover { border-color: #c8cdd3; background: var(--surface); box-shadow: none; transform: translateY(-1px); }
}

@media (max-width: 1260px) and (min-width: 1024px) {
  .terminal-shell { grid-template-columns: minmax(0, 1fr) 360px; }
  .product-grid { grid-template-columns: repeat(3, minmax(145px, 1fr)); }
  .shortcut-actions .shortcut-button span:last-child { display: none; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .app-header { display: flex; }
  .header-status { display: flex; }
  .header-cashier { display: none; }
  .terminal-shell { grid-template-columns: minmax(0, 1fr) 330px; }
  .product-grid { grid-template-columns: repeat(2, minmax(145px, 1fr)); }
  .shortcut-actions { display: none; }
  .terminal-tabs button { min-width: 76px; }
  .global-language-switch { right: 250px; }
}

@media (max-width: 767px) {
  :root {
    color-scheme: dark;
    --bg: #050506;
    --surface: #101012;
    --surface-muted: #141416;
    --text: #f4f4f5;
    --muted: #9b9ba1;
    --line: rgba(255,255,255,.085);
    --blue: #5b7cff;
    --blue-dark: #6f8eff;
    --blue-soft: rgba(91,124,255,.13);
  }
  .terminal-bottom-nav { display: none; }
  .global-language-switch { top: 13px; right: 12px; }
  .mobile-header-top > .icon-button { display: none; }
  .product-media img,
  .cart-item-media img { mix-blend-mode: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .product-card,
  .quick-tile { transition: none; }
}

/* ImageGen v13: Square iOS mobile implementation */
@media (max-width: 767px) {
  :root {
    color-scheme: light;
    --bg: #f5f5f6;
    --surface: #ffffff;
    --surface-muted: #f4f4f5;
    --text: #111214;
    --muted: #676d75;
    --line: #e4e5e7;
    --blue: #146ef5;
    --blue-dark: #075ed7;
    --blue-soft: #edf4ff;
    --green: #16834c;
    --green-soft: #edf8f2;
  }

  html,
  body {
    min-height: 100%;
    background: var(--surface);
    color: var(--text);
  }

  body { min-height: 100dvh; }
  .page-shell { min-height: 100dvh; }
  .global-language-switch { display: none; }

  .mobile-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0 16px;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
    border-radius: 0;
    background: var(--surface);
    box-shadow: none;
  }

  .mobile-header {
    position: sticky;
    z-index: 20;
    top: 0;
    margin-inline: -16px;
    padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
    background: rgba(255,255,255,.97);
    backdrop-filter: saturate(160%) blur(18px);
  }

  body[data-mobile-screen="cart"] .mobile-header,
  body[data-mobile-screen="payment"] .mobile-header,
  body[data-mobile-screen="success"] .mobile-header { display: none; }

  .mobile-header-top { min-height: 52px; }
  .mobile-brand { display: grid; gap: 2px; }
  .mobile-brand strong { font-size: 1.18rem; letter-spacing: -.035em; }
  .mobile-brand span { color: #4f555d; font-size: .72rem; font-weight: 560; }
  .mobile-brand em { color: var(--green); font-style: normal; }

  .mobile-cart-trigger {
    position: relative;
    display: grid !important;
    width: 46px;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }
  .mobile-cart-trigger svg { width: 23px; height: 23px; }
  .mobile-cart-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    display: grid;
    min-width: 21px;
    height: 21px;
    place-items: center;
    padding-inline: 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: .62rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
  }

  .mobile-shell svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
  }

  .mobile-panel {
    gap: 14px;
    padding-top: 4px;
  }

  .mobile-titlebar { min-height: 58px; }
  .mobile-titlebar h1 {
    margin: 0;
    font-size: clamp(1.8rem, 8vw, 2.15rem);
    line-height: 1.05;
    letter-spacing: -.045em;
  }
  .mobile-titlebar > h1 { flex: 1; text-align: center; }
  .mobile-titlebar .icon-button { width: 46px; border-radius: 10px; }
  .mobile-titlebar .icon-button { border: 1px solid var(--line); background: #fff; }
  .mobile-titlebar .icon-button svg { width: 25px; height: 25px; }
  .mobile-title-spacer { width: 46px; }
  .mobile-panel[data-mobile-panel="cart"] .mobile-titlebar {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 156px;
  }
  .mobile-panel[data-mobile-panel="cart"] .mobile-titlebar > h1 {
    min-width: 0;
    text-align: center;
    white-space: nowrap;
  }
  .mobile-panel[data-mobile-panel="cart"] .mobile-title-spacer { width: 156px; }
  .mobile-eyebrow { margin: 0 0 4px; color: var(--muted); font-size: .7rem; font-weight: 680; }

  .mobile-search {
    position: relative;
    display: flex;
    min-height: 48px;
    align-items: center;
  }
  .mobile-search > svg {
    position: absolute;
    z-index: 1;
    left: 14px;
    width: 20px;
    height: 20px;
    color: #59616b;
  }
  .mobile-search input {
    min-height: 48px;
    padding: 0 48px 0 43px;
    border: 0;
    border-radius: 11px;
    background: #f2f3f4;
    color: var(--text);
    font-size: 1rem;
  }
  .mobile-search input:focus { box-shadow: 0 0 0 3px rgba(20,110,245,.14); }
  .mobile-scan-icon {
    position: absolute;
    right: 12px;
    display: grid;
    width: 26px;
    height: 44px;
    place-items: center;
    color: #454c55;
    pointer-events: none;
  }
  .mobile-scan-icon svg { width: 21px; height: 21px; }

  .category-row.mobile {
    flex-wrap: nowrap;
    gap: 4px;
    margin-inline: -4px;
    padding: 0 4px 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .category-row.mobile::-webkit-scrollbar { display: none; }
  .category-row.mobile button {
    min-height: 40px;
    padding-inline: 13px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #333940;
    font-size: .78rem;
    font-weight: 620;
    white-space: nowrap;
  }
  .category-row.mobile button[data-active="true"] { background: #111214; color: #fff; }

  .mobile-product-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .mobile-product-list .product-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    box-shadow: none;
  }
  .mobile-product-list .product-media {
    min-height: 0;
    aspect-ratio: 1.35 / 1;
    background: #f8f8f8;
  }
  .mobile-product-list .product-media img { padding: 10px; mix-blend-mode: multiply; }
  .mobile-product-list .product-copy {
    display: flex;
    min-height: 104px;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 9px 10px 10px;
  }
  .mobile-product-list .product-sku { display: none; }
  .mobile-product-list .product-brand {
    order: -2;
    color: #2e3339;
    font-size: .68rem;
    font-weight: 720;
  }
  .mobile-product-list .product-brand-english { display: none; }
  .mobile-product-list .product-card h3 {
    display: -webkit-box;
    min-height: 2.7em;
    order: -1;
    margin: 0;
    color: #454b53;
    font-size: .7rem;
    font-weight: 500;
    line-height: 1.32;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .mobile-product-list .product-footer {
    min-height: 48px;
    align-items: end;
    margin-top: auto;
  }
  .mobile-product-list .product-meta { gap: 3px; }
  .mobile-product-list .product-meta > strong { color: var(--text); font-size: .82rem; }
  .mobile-product-list .stock { font-size: .62rem; }
  .mobile-product-list .compact-add {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    background: var(--blue);
    color: #fff;
  }
  .mobile-load-more { width: 100%; min-height: 48px; }

  .customer-card.mobile {
    min-height: 64px;
    margin: 2px 0 0;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    box-shadow: none;
  }
  .customer-card.mobile .customer-avatar { display: none; }
  .customer-card.mobile h3 { font-size: .92rem; }
  .customer-card.mobile .inline-action { min-width: 52px; min-height: 44px; }

  .cart-list.compact { gap: 0; }
  .mobile-panel[data-mobile-panel="cart"] {
    min-height: calc(100dvh - 82px - env(safe-area-inset-bottom));
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  }
  .mobile-panel[data-mobile-panel="cart"] .cart-list.compact {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }
  .cart-list.compact .cart-item {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .cart-list.compact .cart-item-media,
  .cart-list.compact .placeholder-image.small { width: 64px; height: 64px; }
  .cart-list.compact .cart-item-copy h4 { font-size: .82rem; white-space: normal; }
  .cart-list.compact .cart-item-copy p { display: none; }
  .cart-list.compact .cart-item-copy strong { font-size: .82rem; }
  .cart-list.compact .cart-item-actions {
    grid-column: 2;
    grid-row: 2;
    justify-content: space-between;
    justify-items: stretch;
    grid-template-columns: auto auto;
  }
  .cart-list.compact .stepper { min-height: 44px; padding: 3px 6px; }
  .cart-list.compact .stepper button { min-width: 36px; min-height: 36px; }
  .cart-list.compact .ghost-button { min-height: 44px; }

  .totals.mobile { gap: 12px; margin: 10px 0 0; padding-top: 16px; }
  .totals.mobile dt,
  .totals.mobile dd { color: #444b53; font-size: .9rem; }
  .totals.mobile .discount-line dt,
  .totals.mobile .discount-line dd { color: var(--blue); }
  .totals.mobile .grand-total { margin-top: 4px; padding-top: 14px; }
  .totals.mobile .grand-total dt,
  .totals.mobile .grand-total dd { color: var(--text); font-size: 1.3rem; }

  .mobile-cart-actions {
    position: sticky;
    z-index: 12;
    bottom: calc(72px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: minmax(116px, .72fr) minmax(0, 1.28fr);
    gap: 10px;
    margin: auto -16px 0;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(18px);
  }
  .mobile-cart-actions .secondary-button,
  .mobile-cart-actions .pay-button { min-height: 54px; border-radius: 9px; }
  .mobile-cart-actions .pay-button { background: #111214; color: #fff; }

  .payment-titlebar { min-height: 58px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .mobile-payment-panel { gap: 16px; }
  .payment-hero { padding: 8px 0 10px; text-align: center; }
  .payment-hero h1 {
    margin: 0;
    font-size: clamp(2.5rem, 12vw, 3.25rem);
    line-height: 1;
    letter-spacing: -.05em;
    font-variant-numeric: tabular-nums;
  }
  .payment-hero p { margin: 10px 0 0; color: var(--muted); font-size: .88rem; }
  .payment-methods {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }
  .payment-methods button {
    display: grid;
    width: 100%;
    min-height: 68px;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    text-align: left;
  }
  .payment-methods button:last-child { border-bottom: 0; }
  .payment-methods button svg { width: 24px; height: 24px; }
  .method-chevron { color: #50565e; font-size: 1.5rem; }
  .payment-methods button:active { opacity: .72; }
  .payment-security { display: flex; align-items: flex-start; gap: 11px; padding: 2px 10px; }
  .payment-security > svg { width: 25px; height: 25px; flex: 0 0 25px; }
  .payment-security div { display: grid; gap: 3px; }
  .payment-security strong { font-size: .82rem; }
  .payment-security span { color: var(--muted); font-size: .7rem; }
  .payment-summary { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
  .payment-summary h2 { margin: 0 0 4px; font-size: .9rem; }
  .payment-summary > div { display: flex; justify-content: space-between; color: #5b626b; font-size: .8rem; }
  .payment-summary strong { color: var(--text); font-variant-numeric: tabular-nums; }
  .payment-summary-total { padding-top: 11px; border-top: 1px solid var(--line); font-weight: 750; }

  .mobile-home-card {
    border-radius: 14px;
    background: #111214;
    color: #fff;
  }
  .mobile-stats article,
  .quick-action-card,
  .order-card { background: #fff; }

  .mobile-success { border-color: #b9dfc9; background: #f4fbf7; }
  .mobile-success-actions .pay-button { background: #111214; }

  .mobile-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    transform: none;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255,255,255,.98);
    box-shadow: 0 -4px 20px rgba(24,32,44,.04);
    backdrop-filter: blur(20px);
  }
  .mobile-nav button {
    display: grid;
    min-width: 0;
    min-height: 60px;
    align-content: center;
    justify-items: center;
    gap: 3px;
    padding: 4px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #555c65;
    font-size: .66rem;
    font-weight: 570;
  }
  .mobile-nav button svg { width: 24px; height: 24px; }
  .mobile-nav button[data-active="true"] { background: transparent; color: var(--blue); font-weight: 700; }
  .mobile-nav button:active { background: #f2f3f5; }

  .overlay-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); border-radius: 18px; }
  .dialog-card { max-height: calc(100dvh - 24px); overflow-y: auto; }
  .toast { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (max-width: 374px) {
  .mobile-shell { padding-inline: 12px; }
  .mobile-header { margin-inline: -12px; padding-inline: 12px; }
  .mobile-product-list { gap: 7px; }
  .mobile-product-list .product-copy { min-height: 126px; padding-inline: 8px; }
  .mobile-cart-actions { margin-inline: -12px; padding-inline: 12px; }
}

@media (max-width: 767px) {
  .global-language-switch {
    top: calc(20px + env(safe-area-inset-top));
    right: 72px;
    z-index: 45;
    display: flex;
    height: 34px;
    background: rgba(244,245,246,.96);
    backdrop-filter: blur(18px);
  }
}

/* Mobile salesperson auth v2 */
body[data-sales-auth="true"] {
  overflow-y: auto;
  background: #f4f5f6;
}

body[data-sales-auth="true"] .global-language-switch {
  top: calc(18px + env(safe-area-inset-top));
  right: 18px;
  z-index: 60;
  display: flex;
  height: 36px;
  padding: 3px;
  border: 1px solid #e1e3e6;
  border-radius: 10px;
  background: rgba(244,245,246,.96);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.sales-auth-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(300px, 1fr) minmax(380px, 448px);
  align-items: center;
  gap: clamp(48px, 8vw, 112px);
  padding: clamp(56px, 7vw, 96px);
  background: #f4f5f6;
}

.sales-auth-brand {
  display: grid;
  max-width: 560px;
  gap: 0;
}

.sales-auth-wordmark {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 11px;
  margin-bottom: 48px;
}

.sales-auth-wordmark strong {
  color: #24272c;
  font-size: .78rem;
  font-weight: 760;
  letter-spacing: .15em;
}

.sales-auth-brand .eyebrow {
  margin: 0 0 10px;
  color: #707781;
  font-size: .7rem;
  letter-spacing: .09em;
}

.sales-auth-brand h1 {
  margin: 0;
  color: #111214;
  font-size: clamp(2.6rem, 5vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -.055em;
}

.sales-auth-brand p:last-child {
  max-width: 430px;
  margin: 18px 0 0;
  color: #626973;
  font-size: .98rem;
  line-height: 1.65;
}

.sales-auth-card {
  width: 100%;
  padding: 28px;
  border: 1px solid #e1e3e6;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(21,27,36,.09);
}

.sales-auth-tabs {
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  border-radius: 11px;
  background: #f0f1f3;
}

.sales-auth-tabs button {
  min-height: 46px;
  border-radius: 8px;
  color: #656c75;
  font-size: .86rem;
  font-weight: 680;
}

.sales-auth-tabs button[data-active="true"] {
  background: #fff;
  color: #15171a;
  box-shadow: 0 1px 4px rgba(20,28,40,.1);
}

.sales-auth-card form {
  display: grid;
  gap: 16px;
}

.sales-auth-card label {
  display: grid;
  gap: 7px;
  color: #3f464f;
  font-size: .78rem;
  font-weight: 680;
}

.auth-input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-shell > svg {
  position: absolute;
  z-index: 1;
  left: 14px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #68717c;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  pointer-events: none;
}

.sales-auth-card input {
  width: 100%;
  min-height: 54px;
  padding: 0 46px;
  border: 1px solid #dfe2e5;
  border-radius: 12px;
  background: #fafafb;
  color: #15171a;
  font-size: 1rem;
  box-shadow: none;
}

.sales-auth-card input:focus {
  border-color: #686e76;
  outline: 3px solid rgba(20,24,30,.1);
}

.auth-password-toggle {
  position: absolute;
  right: 5px;
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #555d67;
}

.auth-password-toggle:hover { background: #eef0f2; }
.auth-password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sales-auth-submit {
  width: 100%;
  min-height: 54px;
  margin-top: 2px;
  border-radius: 11px;
  background: #111214;
  color: #fff;
  box-shadow: none;
}

.sales-auth-submit:hover:not(:disabled) { background: #292c31; }
.sales-auth-submit:disabled { background: #d9dce0; color: #858b94; }
.sales-auth-card .field-help { color: #737a84; font-size: .72rem; line-height: 1.5; }
.sales-auth-card .form-error { padding: 10px 12px; border-radius: 9px; background: #fff0ef; color: #b52f2b; }

.sales-auth-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 20px 0 0;
  color: #737a84;
  font-size: .7rem;
  line-height: 1.45;
  text-align: center;
}

.sales-auth-footnote svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: #626a74;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

@media (max-width: 767px) {
  body[data-sales-auth="true"] { background: #fff; }

  body[data-sales-auth="true"] .global-language-switch {
    top: calc(14px + env(safe-area-inset-top));
    right: 16px;
  }

  .sales-auth-shell {
    width: min(100%, 430px);
    min-height: 100dvh;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 24px;
    margin: 0 auto;
    padding: calc(72px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
    background: #fff;
  }

  .sales-auth-wordmark { margin-bottom: 28px; }
  .sales-auth-wordmark strong { font-size: .72rem; }
  .sales-auth-brand .eyebrow { margin-bottom: 8px; }
  .sales-auth-brand h1 { font-size: clamp(2.05rem, 10vw, 2.55rem); }
  .sales-auth-brand p:last-child { margin-top: 12px; font-size: .86rem; line-height: 1.55; }

  .sales-auth-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sales-auth-tabs { margin-bottom: 22px; }
  .sales-auth-tabs button { min-height: 48px; }
  .sales-auth-card form { gap: 14px; }
  .sales-auth-footnote { margin-top: 18px; }
}

@media (max-width: 359px) {
  .sales-auth-shell { padding-inline: 14px; }
  .sales-auth-wordmark strong { letter-spacing: .1em; }
  .sales-auth-brand h1 { font-size: 2rem; }
}

/* Mobile home contrast repair */
@media (max-width: 767px) {
  .mobile-stats article {
    color: #1d2126;
    background: #fff;
  }

  .mobile-stats strong { color: #1d2126; }
  .mobile-stats span { color: #626a74; }

  .quick-action-card {
    color: #1d2126;
    background: #fff;
  }

  .action-copy strong { color: #1d2126; }
  .action-copy small { color: #626a74; }
  .action-arrow { color: #59616b; }

  .order-card {
    color: #1d2126;
    background: #fff;
  }

  .order-card strong { color: #1d2126; }
  .order-meta strong { color: #1d2126; }
  .order-card p { color: #626a74; }
  .section-head h3 { color: #1d2126; }
  .mobile-orders .inline-action { color: #146ef5; }
}

/* Customer picker v3 */
[data-customer-dialog] {
  width: min(94vw, 580px);
  max-height: min(88vh, 760px);
  overflow: hidden;
}

.customer-picker-card { min-height: 420px; }
.customer-picker-card > section { display: grid; gap: 14px; min-height: 0; }

.customer-browse-intro {
  display: grid;
  gap: 4px;
}

.customer-browse-intro strong {
  color: #1d2126;
  font-size: .95rem;
}

.customer-browse-intro p {
  margin: 0;
  color: #626a74;
  font-size: .76rem;
  line-height: 1.55;
}

.customer-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.customer-search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.customer-search-field svg {
  position: absolute;
  z-index: 1;
  left: 14px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #5f6873;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  pointer-events: none;
}

.customer-search-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px 0 43px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f8f9;
  color: var(--text);
  font-size: 1rem;
}

.customer-add-trigger {
  width: fit-content;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #146ef5;
  font-size: .82rem;
  font-weight: 650;
  white-space: nowrap;
}

.customer-add-trigger:hover,
.customer-add-trigger:focus-visible {
  color: #0b57d0;
  text-decoration: underline;
}

.walk-in-customer,
.customer-result {
  display: grid;
  width: 100%;
  min-height: 68px;
  grid-template-columns: 42px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #1d2126;
  text-align: left;
}

.walk-in-customer:hover,
.customer-result:hover { background: #f7f8fa; }
.walk-in-customer[data-selected="true"],
.customer-result[data-selected="true"] { border-color: rgba(20,110,245,.55); background: var(--blue-soft); }

.customer-result-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #eef0f3;
  color: #343a42;
  font-size: .72rem;
  font-weight: 750;
}

.walk-in-customer > span:nth-child(2),
.customer-result-copy { display: grid; min-width: 0; gap: 3px; }
.walk-in-customer strong,
.customer-result-copy strong { overflow: hidden; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.walk-in-customer small,
.customer-result-copy small { overflow: hidden; color: #626a74; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.customer-result-copy em { color: #68717b; font-size: .66rem; font-style: normal; }

.customer-result-check { visibility: hidden; color: var(--blue); font-size: 1.05rem; font-weight: 800; text-align: center; }
[data-selected="true"] > .customer-result-check { visibility: visible; }

.customer-results-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.customer-results-heading strong { font-size: .82rem; }
.customer-results-heading span { color: var(--muted); font-size: .72rem; }

.customer-results {
  display: grid;
  max-height: 300px;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.customer-results-state {
  display: grid;
  min-height: 118px;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: #626a74;
  font-size: .78rem;
  text-align: center;
}
.customer-results-state span { color: #737b85; }
.customer-results-error { color: var(--red); }
.customer-empty-create { margin-top: 6px; }

.customer-create-form { display: grid; gap: 13px; }
.customer-create-heading { display: grid; gap: 5px; margin-bottom: 2px; }
.customer-create-heading .inline-action { width: fit-content; min-height: 40px; padding-inline: 0; }
.customer-create-heading h3 { margin: 0; font-size: 1.1rem; }
.customer-create-heading p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.customer-create-form select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafb;
  color: var(--text);
}

@media (max-width: 767px) {
  [data-customer-dialog] {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }
  .customer-picker-card { min-height: min(620px, calc(100dvh - 32px)); padding: 18px; }
  .customer-add-trigger { justify-self: start; }
  .customer-results { max-height: min(320px, 37dvh); }
  .customer-create-form .dialog-actions { display: grid; grid-template-columns: 1fr 1.35fr; }
}
