:root {
  color-scheme: light;
  --green-900: #064e3b;
  --green-800: #066044;
  --green-700: #087f5b;
  --green-600: #0b966b;
  --green-100: #dff7ec;
  --green-50: #f0fbf6;
  --ink: #172033;
  --muted: #64748b;
  --line: #d8e2df;
  --surface: #ffffff;
  --background: #f3f7f5;
  --warning: #9a4d08;
  --warning-bg: #fff7e8;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --blue: #175cd3;
  --shadow: 0 14px 36px rgba(15, 55, 43, 0.09);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 300px;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

body.cart-open,
body.scanner-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(23, 92, 211, 0.32);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.offline-banner {
  position: relative;
  z-index: 80;
  padding: 9px 16px;
  background: #7a2e0e;
  color: #fff;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 750;
}

.app-header {
  position: sticky;
  z-index: 70;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 10px max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(6, 78, 59, 0.18);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  border-radius: 12px;
}

.brand span {
  display: grid;
  line-height: 1.05;
}

.brand strong {
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 4px;
  color: var(--green-700);
  font-weight: 700;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.client-header-nav {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.client-header-nav::-webkit-scrollbar {
  display: none;
}

.connection-badge,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-100);
  color: var(--green-900);
  font-size: 0.78rem;
  font-weight: 800;
}

.connection-badge.offline {
  background: var(--danger-bg);
  color: var(--danger);
}

.page-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 32px) 80px;
}

.page-shell.compact-catalog-shell {
  width: 100%;
  padding: 8px clamp(8px, 1.2vw, 16px) 64px;
}

.state-card,
.auth-shell {
  min-height: min(70vh, 680px);
  display: grid;
  place-items: center;
}

.state-card {
  grid-template-columns: auto minmax(0, 420px);
  justify-content: center;
  gap: 18px;
  color: var(--muted);
}

.state-card h1,
.state-card p {
  margin: 0;
}

.state-card h1 {
  color: var(--ink);
  font-size: 1.3rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid var(--green-100);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.auth-card,
.panel,
.landing-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(100%, 470px);
  padding: clamp(24px, 5vw, 42px);
}

.auth-card h1,
.auth-card > p {
  margin-top: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green-700);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stack-form {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

label {
  color: #344054;
  font-size: 0.9rem;
  font-weight: 750;
}

input {
  min-width: 0;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

select {
  min-height: 40px;
  padding: 7px 34px 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

input::placeholder {
  color: #8994a5;
}

.button,
.icon-button,
.nav-button {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
}

.button.primary {
  background: var(--green-700);
  color: #fff;
}

.button.primary:hover {
  background: var(--green-800);
}

.button.secondary,
.button.ghost {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--ink);
}

.button.scanner-button {
  background: #e8f2ff;
  color: #174ea6;
}

.button.danger-link {
  background: transparent;
  color: var(--danger);
}

.button-large {
  min-height: 52px;
  padding-inline: 22px;
}

.button.compact {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 0.86rem;
}

.button:disabled,
.icon-button:disabled,
.nav-button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.form-message,
.inline-status {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warning-bg);
  color: var(--warning);
  font-weight: 700;
}

.inline-status.error,
.form-message.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.inline-status.success {
  background: var(--green-50);
  color: var(--green-800);
}

.auth-help,
.muted,
.catalog-notice {
  color: var(--muted);
}

.auth-help {
  margin: 24px 0 0;
  font-size: 0.9rem;
}

.section-heading,
.summary-total,
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.presence-mode-button {
  justify-content: center;
  gap: 8px;
  min-width: 150px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #84aef2;
  background: #e8f2ff;
  color: #174ea6;
  white-space: nowrap;
}

.presence-mode-button:hover {
  background: #dcecff;
}

.presence-mode-button[aria-pressed="true"] {
  border-color: var(--green-700);
  background: var(--green-700);
  color: #fff;
}

.presence-mode-button[aria-pressed="true"]:hover {
  background: var(--green-800);
}

.presence-mode-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.presence-mode-button strong {
  font-size: 0.86rem;
}

.presence-mode-button[aria-pressed="true"] .presence-mode-dot {
  background: #8ff0bd;
  box-shadow: 0 0 0 3px rgba(143, 240, 189, 0.2);
}

.section-heading h2,
.section-heading p,
.dialog-heading h2,
.dialog-heading p {
  margin-top: 0;
  margin-bottom: 0;
}

.branch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.branch-row p {
  margin: 0;
}

.branch-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}

.nav-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 10px;
  background: transparent;
  color: #475467;
}

.nav-button.active {
  background: var(--green-100);
  color: var(--green-900);
}

.content-grid {
  display: block;
}

.panel {
  padding: clamp(16px, 2.5vw, 26px);
}

.catalog-panel.panel {
  padding: 6px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  scroll-margin-top: 92px;
}

.catalog-panel .section-heading {
  padding-inline: 2px;
}

.header-dropdown-panel {
  position: absolute;
  z-index: 90;
  top: calc(100% + 8px);
  right: max(12px, env(safe-area-inset-right));
  width: min(500px, calc(100vw - 24px));
  max-height: min(72vh, 720px);
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 24px 60px rgba(15, 55, 43, 0.2);
}

.header-panel-backdrop {
  position: absolute;
  z-index: 80;
  top: 100%;
  right: 0;
  left: 0;
  height: 100vh;
  background: rgba(15, 55, 43, 0.08);
  touch-action: manipulation;
}

.header-dropdown-panel.orders-panel {
  width: min(680px, calc(100vw - 24px));
}

.cart-panel.header-dropdown-panel {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface);
  box-shadow: none;
}

.cart-panel-header {
  min-height: 76px;
  padding:
    max(14px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    14px
    max(18px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.cart-scroll-body {
  min-height: 0;
  padding: 14px max(14px, env(safe-area-inset-right)) 20px max(14px, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.cart-scroll-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.cart-scroll-actions .danger-link {
  justify-self: start;
}

.panel-heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.search-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  gap: 8px;
  margin-top: 18px;
}

.catalog-panel .search-bar {
  margin-top: 10px;
}

.search-bar input {
  padding-right: 42px;
}

.search-bar .icon-button {
  position: absolute;
  top: 7px;
  right: 188px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: transparent;
  color: #475467;
  font-size: 1.6rem;
  line-height: 1;
}

.icon-button:hover {
  background: #edf2f1;
}

.catalog-notice {
  margin: 12px 0 18px;
  font-size: 0.86rem;
}

.catalog-panel .catalog-notice {
  margin: 8px 2px 12px;
}

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

.product-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.product-card.unavailable {
  background: #f8fafc;
}

.product-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 12px;
  background: #f4f7f6;
}

.product-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green-50), #eef4ff);
  color: var(--green-700);
  font-size: 2rem;
  font-weight: 900;
}

.product-card h3,
.product-card p {
  margin: 0;
}

.product-card h3 {
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.product-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.availability {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-800);
  font-size: 0.74rem;
  font-weight: 800;
}

.availability.unavailable {
  background: var(--danger-bg);
  color: var(--danger);
}

.availability.unknown {
  background: #eef2f6;
  color: #475467;
}

.price-row {
  display: grid;
  gap: 3px;
}

.price-row strong {
  color: var(--green-900);
  font-size: 1.2rem;
}

.price-row span {
  color: var(--muted);
  font-size: 0.78rem;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: auto;
}

.product-actions .button {
  width: 100%;
}

.load-more {
  width: 100%;
  margin-top: 16px;
}

.empty-state {
  display: grid;
  gap: 5px;
  padding: 30px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.cart-items {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.cart-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.cart-item.needs-review {
  border-color: #f2b8b5;
  background: var(--danger-bg);
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cart-item h3,
.cart-item p {
  margin: 0;
}

.cart-item h3 {
  font-size: 0.94rem;
}

.cart-item-mode {
  margin-top: 3px !important;
  color: var(--muted);
  font-size: 0.77rem;
}

.review-badge {
  display: inline-flex;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ffd8d5;
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 850;
}

.cart-item-price {
  flex: 0 0 auto;
  color: var(--green-900);
}

.quantity-row {
  display: grid;
  grid-template-columns: 42px minmax(64px, 1fr) 42px auto;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.quantity-row input {
  width: 100%;
  min-height: 40px;
  padding: 6px;
  text-align: center;
}

.quantity-button {
  min-height: 40px;
  padding: 4px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.remove-button {
  min-height: 40px;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.cart-summary {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.cart-panel .cart-summary {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, auto);
  align-items: center;
  gap: 16px;
  padding:
    14px
    max(18px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  margin: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -12px 30px rgba(15, 55, 43, 0.1);
}

.cart-panel .cart-summary .button {
  min-width: 220px;
}

.summary-total strong {
  color: var(--green-900);
  font-size: 1.45rem;
}

.pending-note {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--warning-bg);
  color: #77400d;
  font-size: 0.83rem;
}

.orders-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.order-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.order-card-header,
.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-card h3,
.order-card p {
  margin: 0;
}

.order-card h3 {
  font-size: 0.96rem;
}

.order-date {
  color: var(--muted);
  font-size: 0.78rem;
}

.order-items-summary {
  margin: 10px 0 !important;
  color: #475467;
  font-size: 0.88rem;
}

.status-pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-size: 0.74rem;
  font-weight: 850;
}

.status-pill.submitted { background: #fff3d9; color: #854d0e; }
.status-pill.accepted { background: #e8f2ff; color: #174ea6; }
.status-pill.preparing { background: #f1eaff; color: #6938a8; }
.status-pill.ready { background: var(--green-100); color: var(--green-900); }
.status-pill.delivered { background: #d1fadf; color: #05603a; }
.status-pill.cancelled { background: var(--danger-bg); color: var(--danger); }
.status-pill.purchase { background: var(--green-100); color: var(--green-900); }

.activity-group {
  display: grid;
  gap: 10px;
}

.activity-group + .activity-group {
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.activity-group-heading {
  margin: 0;
  color: #344054;
  font-size: 0.9rem;
}

.link-notice {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #eef4ff;
  color: #344054;
  font-size: 0.84rem;
}

.scanner-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #030712;
  color: #fff;
  box-shadow: none;
}

.scanner-dialog::backdrop {
  background: #030712;
}

.scanner-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background: #030712;
}

.scanner-topbar {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding:
    max(12px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    10px
    max(14px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(3, 7, 18, 0.92), rgba(3, 7, 18, 0));
}

.scanner-heading {
  min-width: 0;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

.scanner-heading p,
.scanner-heading h2 {
  margin: 0;
}

.scanner-heading p {
  color: #d1fae5;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scanner-heading h2 {
  overflow: hidden;
  font-size: clamp(1rem, 4.8vw, 1.35rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scanner-round-button,
.scanner-cart-button {
  position: relative;
  display: inline-grid;
  min-width: 48px;
  min-height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(3, 7, 18, 0.72);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.scanner-round-button {
  font-size: 2rem;
  line-height: 1;
}

.scanner-cart-button svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.scanner-cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #10b981;
  color: #052e22;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.camera-frame {
  position: absolute;
  inset: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: #030712;
}

.camera-frame video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.scan-guide {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(82%, 620px);
  height: min(30%, 260px);
  border: 3px solid #7ff0bf;
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.24), 0 0 24px rgba(127, 240, 191, 0.34);
  transform: translate(-50%, -50%);
}

.scanner-product-feedback {
  position: absolute;
  z-index: 3;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(142px, calc(env(safe-area-inset-bottom) + 132px));
  left: max(16px, env(safe-area-inset-left));
  display: grid;
  max-width: 560px;
  margin-inline: auto;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 18px;
  background: rgba(4, 120, 87, 0.94);
  color: #fff;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.scanner-product-feedback.error {
  background: rgba(153, 27, 27, 0.95);
}

.scanner-product-feedback.notice {
  background: rgba(23, 78, 166, 0.95);
}

.scanner-feedback-state {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scanner-feedback-name {
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: clamp(1rem, 4.8vw, 1.3rem);
}

.scanner-feedback-price {
  margin-top: 4px;
  font-size: clamp(1.8rem, 9vw, 2.65rem);
  line-height: 1.05;
}

.scanner-feedback-detail {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 700;
}

.scanner-feedback-add {
  width: 100%;
  min-height: 50px;
  margin-top: 12px;
  border: 2px solid #fff;
  background: #fff;
  color: #065f46;
  font-size: 1rem;
  font-weight: 950;
  touch-action: manipulation;
}

.scanner-feedback-add:hover {
  background: #ecfdf5;
}

.scanner-feedback-add:focus-visible {
  outline-color: #fff;
  box-shadow: 0 0 0 4px rgba(5, 46, 34, 0.7);
}

.scanner-controls {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  padding:
    28px
    max(14px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  background: linear-gradient(0deg, rgba(3, 7, 18, 0.95), rgba(3, 7, 18, 0));
}

.scanner-status {
  min-height: 22px;
  margin: 0 0 8px;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
  font-weight: 700;
}

.manual-code-form {
  display: block;
  max-width: 620px;
  margin-inline: auto;
  padding: 0;
  border: 0;
}

.manual-code-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.manual-code-form input {
  min-width: 0;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.94);
  color: #101828;
}

@media (max-height: 560px) and (orientation: landscape) {
  .scanner-topbar {
    min-height: 60px;
    padding-top: max(6px, env(safe-area-inset-top));
  }

  .scanner-heading p {
    display: none;
  }

  .scanner-product-feedback {
    right: max(100px, calc(env(safe-area-inset-right) + 90px));
    bottom: max(86px, calc(env(safe-area-inset-bottom) + 78px));
    left: max(100px, calc(env(safe-area-inset-left) + 90px));
    padding-block: 10px;
  }

  .scanner-feedback-price {
    font-size: 1.65rem;
  }

  .scanner-feedback-add {
    min-height: 44px;
    margin-top: 7px;
    padding-block: 7px;
  }

  .scanner-controls {
    padding-top: 14px;
  }

  .scanner-status {
    display: none;
  }
}

.toast {
  position: fixed;
  z-index: 260;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border-radius: 12px;
  background: #172033;
  color: #fff;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.25);
  font-weight: 750;
}

.toast.error {
  background: #8f1d18;
}

.landing-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: radial-gradient(circle at top, #e0f7ed, var(--background) 55%);
}

.landing-shell {
  width: min(100%, 720px);
  padding: 24px;
}

.landing-card {
  padding: clamp(28px, 7vw, 56px);
  text-align: center;
}

.landing-logo {
  border-radius: 22px;
}

.landing-card h1 {
  margin: 5px 0 12px;
  font-size: clamp(2rem, 8vw, 3.4rem);
}

.landing-copy {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
}

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

@media (max-width: 640px) {
  .app-header {
    min-height: 64px;
    gap: 8px;
    padding-block: 8px;
  }

  .brand {
    order: 1;
  }

  .header-actions {
    order: 2;
    min-width: 0;
    flex: 1 1 auto;
    gap: 4px;
  }

  .client-header-nav {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr) minmax(0, 1.55fr);
    order: 3;
    width: 100%;
    flex-basis: 100%;
    gap: 4px;
    overflow: visible;
  }

  .client-header-nav .nav-button {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 7px 5px;
    line-height: 1.1;
    white-space: normal;
  }

  .header-dropdown-panel,
  .header-dropdown-panel.orders-panel {
    right: max(8px, env(safe-area-inset-right));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    max-height: min(68vh, calc(100dvh - 138px));
  }

  .connection-badge {
    display: none;
  }

  .page-shell {
    padding-top: 16px;
  }

  .page-shell.compact-catalog-shell {
    padding: 6px 6px 56px;
  }

  .catalog-panel.panel {
    scroll-margin-top: 142px;
  }

  .presence-mode-button {
    min-width: 120px;
    flex: 1 1 120px;
  }

  .panel {
    border-radius: 16px;
  }

  .cart-panel.header-dropdown-panel {
    border-radius: 0;
  }

  .cart-panel-header {
    min-height: 68px;
    padding:
      max(10px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      10px
      max(12px, env(safe-area-inset-left));
  }

  .cart-scroll-body {
    padding: 10px max(8px, env(safe-area-inset-right)) 16px max(8px, env(safe-area-inset-left));
  }

  .cart-panel .cart-summary {
    grid-template-columns: 1fr;
    gap: 8px;
    padding:
      10px
      max(10px, env(safe-area-inset-right))
      max(10px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .cart-panel .cart-summary .button {
    width: 100%;
    min-width: 0;
  }

  .search-bar {
    grid-template-columns: 1fr 1fr;
  }

  .search-bar input {
    grid-column: 1 / -1;
  }

  .search-bar .icon-button {
    top: 7px;
    right: 6px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-card {
    padding: 10px;
  }

  .quantity-row {
    grid-template-columns: 40px minmax(52px, 1fr) 40px;
  }

  .remove-button {
    grid-column: 1 / -1;
  }

  .landing-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .header-actions .button {
    padding-inline: 9px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}

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