:root {
  --bg: #EBF6FD;
  --surface: #FFFFFF;
  --surface-2: #DCF0FA;
  --border: #A8D8EE;
  --text: #072330;
  --muted: #3D7A99;
  --accent: #00AEEF;
  --accent-2: #0090CC;
  --accent-3: #006FA0;
  --success: #0BAD75;
  --warning: #F0920A;
  --danger: #E83535;
  --dark-cta: #072330;
  --shadow-sm: 0 1px 4px rgba(0, 112, 160, 0.12);
  --shadow-md: 0 8px 24px rgba(0, 112, 160, 0.18);
  --shadow-lg: 0 20px 48px rgba(4, 30, 46, 0.12);
  --font-ui: "IBM Plex Sans Thai", system-ui, sans-serif;
  --font-display: "Space Grotesk", "IBM Plex Sans Thai", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body {
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(0, 174, 239, 0.18), transparent 38%),
    radial-gradient(circle at left 20%, rgba(0, 144, 204, 0.12), transparent 28%),
    linear-gradient(180deg, #EBF6FD 0%, #EBF6FD 100%);
  -webkit-font-smoothing: antialiased;
}
body.dark {
  --bg: #163331;
  --surface: #1D403D;
  --surface-2: #27534F;
  --border: #3E7B76;
  --text: #F4FFFE;
  --muted: #A8D3CF;
  background: #163331;
}
button, input { font: inherit; }
button { border: 0; cursor: pointer; }

.login-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(14px, 2.2vw, 24px);
  padding: 0;
  color: #191b25;
  background:
    radial-gradient(circle at 86% 0%, rgba(0, 77, 234, .11), transparent 36%),
    radial-gradient(circle at 4% 92%, rgba(0, 77, 234, .07), transparent 30%),
    linear-gradient(180deg, #faf8ff 0%, #f6f4ff 100%);
}
.login-top {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid #d9d9e6;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
}
.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  color: #070b18;
  letter-spacing: .08em;
}
.login-logo strong { font-size: clamp(18px, 2vw, 24px); }
.register-icon {
  width: 23px;
  height: 20px;
  position: relative;
  display: inline-block;
  border: 3px solid #004dea;
  border-radius: 3px;
}
.register-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: -9px;
  height: 5px;
  border-radius: 2px 2px 0 0;
  background: #004dea;
}
.register-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 3px;
  background: repeating-linear-gradient(90deg, #004dea 0 3px, transparent 3px 5px);
}
.login-status-icons {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  color: #505f76;
  font-size: 22px;
}
.login-shell {
  width: min(86vw, 1320px);
  min-height: min(68vh, 760px);
  align-self: center;
  justify-self: center;
  display: grid;
  grid-template-columns: minmax(340px, .92fr) minmax(360px, 1fr);
  overflow: hidden;
  border: 1px solid #d9d9e6;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(16, 25, 64, .08);
}
.login-brand-panel {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(36px, 5vw, 64px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08) 0 20%, transparent 20% 100%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.07) 0 3px, transparent 3px 13px),
    linear-gradient(145deg, #0041c8 0%, #004dea 58%, #0039b3 100%);
}
.login-brand-panel h1 {
  max-width: 560px;
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: 0;
}
.login-brand-panel p {
  max-width: 520px;
  margin-top: 18px;
  color: rgba(255,255,255,.86);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.5;
}
.login-feature-list { display: grid; gap: 20px; }
.login-feature {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}
.login-feature > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  color: #fff;
  font-size: 22px;
}
.login-feature strong { display: block; font-size: 18px; }
.login-feature small { color: rgba(255,255,255,.84); font-size: 15px; }
.login-card {
  width: min(520px, 100%);
  align-self: center;
  justify-self: center;
  padding: clamp(28px, 4.8vw, 56px);
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
h1, h2, p { margin: 0; }
.login-kicker {
  color: #004dea;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .26em;
}
.login-card h2 {
  margin-top: 10px;
  font-family: var(--font-display);
  color: #111522;
  font-size: clamp(32px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: 0;
}
.login-card p {
  color: #434656;
  margin: 12px 0 clamp(26px, 3vw, 42px);
  font-size: 18px;
}
.field { display: grid; gap: 10px; margin: 0 0 22px; }
.field span {
  color: #191b25;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
}
.input-shell {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 0 18px;
  border: 1.5px solid #d9d9e6;
  border-radius: 999px;
  color: #8da0ba;
  background: #f8faff;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.input-shell:focus-within {
  border-color: #004dea;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 77, 234, .10);
}
.input-shell > span {
  color: #8da0ba;
  font-size: 18px;
  letter-spacing: 0;
}
input {
  width: 100%;
  min-height: 54px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: none;
  color: #191b25;
  background: transparent;
}
input::placeholder { color: #8da0ba; }
input:focus { box-shadow: none; }
.error {
  display: none;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #ffdad6;
  border-radius: 10px;
  color: #ba1a1a;
  background: #fff4f3;
}
.btn {
  min-height: 52px;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 800;
}
.primary {
  width: 100%;
  color: #fff;
  background: #0041c8;
  box-shadow: 0 14px 22px rgba(0, 65, 200, .22);
}
.login-submit {
  min-height: 64px;
  margin-top: 8px;
  border-radius: 22px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: .28em;
}
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
  color: #191b25;
  font-size: 16px;
}
.login-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.login-options input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: #004dea;
}
.login-options button {
  color: #004dea;
  background: transparent;
  font-weight: 700;
}
.login-card-footer {
  margin-top: clamp(34px, 4vw, 56px);
  padding-top: 26px;
  border-top: 1px solid #ededfb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #65748c;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .12em;
}
.login-card-footer i {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 999px;
  background: #0bad75;
}
.login-footer {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vw, 48px);
  padding: 10px 18px 24px;
  color: #8da0ba;
  font-weight: 700;
}

@media (max-width: 980px) {
  .login-screen {
    gap: 16px;
  }
  .login-shell {
    width: min(92vw, 760px);
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .login-brand-panel {
    min-height: 230px;
    padding: 32px 36px;
  }
  .login-brand-panel h1 {
    font-size: clamp(36px, 7vw, 52px);
  }
  .login-feature-list {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .login-feature {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
  }
  .login-feature > span {
    width: 42px;
    height: 42px;
  }
  .login-card {
    width: min(560px, 100%);
  }
  .login-footer {
    display: none;
  }
}

@media (max-width: 560px) {
  .login-screen {
    min-height: 100svh;
    grid-template-rows: auto 1fr;
    gap: 0;
    background: #faf8ff;
  }
  .login-top {
    min-height: 56px;
    padding: 10px 16px;
  }
  .login-status-icons {
    gap: 14px;
    font-size: 18px;
  }
  .login-shell {
    width: 100%;
    align-self: stretch;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }
  .login-brand-panel {
    min-height: 142px;
    padding: 24px 22px;
    border-radius: 0 0 24px 24px;
  }
  .login-brand-panel h1 {
    max-width: 330px;
    font-size: clamp(34px, 10vw, 44px);
  }
  .login-brand-panel p {
    max-width: 330px;
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.42;
  }
  .login-feature-list {
    display: none;
  }
  .login-card {
    width: 100%;
    align-self: start;
    padding: 28px 20px max(24px, env(safe-area-inset-bottom, 0px));
  }
  .login-kicker {
    font-size: 12px;
  }
  .login-card h2 {
    font-size: 30px;
  }
  .login-card p {
    margin-bottom: 24px;
    font-size: 16px;
  }
  .field {
    margin-bottom: 16px;
  }
  .input-shell {
    min-height: 54px;
    border-radius: 18px;
  }
  .login-submit {
    min-height: 58px;
    border-radius: 18px;
  }
  .login-options {
    margin-top: 22px;
    font-size: 14px;
  }
  .login-card-footer {
    margin-top: 28px;
    padding-top: 20px;
    font-size: 10px;
  }
  .login-footer {
    display: none;
  }
}

@media (max-width: 380px) {
  .login-logo strong {
    font-size: 16px;
  }
  .login-brand-panel {
    min-height: 126px;
    padding: 20px 18px;
  }
  .login-brand-panel h1 {
    font-size: 32px;
  }
  .login-brand-panel p {
    font-size: 14px;
  }
  .login-card {
    padding-inline: 16px;
  }
  .login-options {
    gap: 8px;
    font-size: 13px;
    white-space: nowrap;
  }
  .login-card-footer {
    margin-top: 22px;
    padding-top: 16px;
    letter-spacing: .08em;
  }
}

.app {
  min-height: 100dvh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(0, 174, 239, .15);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px);
}
body.dark .topbar { background: rgba(29, 64, 61, .92); }
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 22px;
}
.top-title { min-width: 0; flex: 1; display: grid; }
.top-title strong {
  font-family: var(--font-display);
  font-size: 16px;
}
.top-title span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-toggles {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.top-toggle {
  min-width: 38px;
  height: 36px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}
.top-toggle.icon {
  min-width: 36px;
  width: 36px;
  padding: 0;
  font-size: 16px;
}
.sync-pill {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--success);
  background: rgba(11, 173, 117, .1);
  border: 1px solid rgba(11, 173, 117, .25);
  font-size: 12px;
  font-weight: 800;
}
.sync-pill.pending {
  color: #b36800;
  border-color: rgba(240, 146, 10, .28);
  background: rgba(240, 146, 10, .14);
}
.sync-pill.offline {
  color: var(--danger);
  border-color: rgba(232, 53, 53, .24);
  background: rgba(232, 53, 53, .1);
}
.sync-pill b {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
}
.menu-panel {
  position: fixed;
  top: 70px;
  left: 12px;
  z-index: 80;
  display: grid;
  gap: 8px;
  width: 180px;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.menu-panel button {
  min-height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 380px) {
  .topbar { gap: 6px; padding-inline: 10px; }
  .top-title strong { font-size: 14px; }
  .top-title span { display: none; }
  .top-toggle { min-width: 34px; height: 34px; padding-inline: 7px; }
  .top-toggle.icon { width: 34px; min-width: 34px; }
  .sync-pill { min-height: 34px; padding: 5px 8px; }
  .sync-pill span { max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.scan-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
  padding: 12px 18px 4px;
}
.search-wrap { position: relative; min-width: 0; }
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}
#product-search { padding-left: 44px; padding-right: 40px; }
.clear-btn {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-2);
}
.scan-btn {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  color: #fff;
  background: var(--dark-cta);
  box-shadow: var(--shadow-md);
  font-size: 22px;
  display: grid;
  place-items: center;
}
.qr-icon {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 4px;
  background:
    linear-gradient(#fff 0 0) 0 0 / 8px 8px no-repeat,
    linear-gradient(#fff 0 0) 16px 0 / 8px 8px no-repeat,
    linear-gradient(#fff 0 0) 0 16px / 8px 8px no-repeat,
    linear-gradient(#fff 0 0) 12px 12px / 4px 4px no-repeat,
    linear-gradient(#fff 0 0) 20px 12px / 4px 4px no-repeat,
    linear-gradient(#fff 0 0) 12px 20px / 4px 4px no-repeat,
    linear-gradient(#fff 0 0) 20px 20px / 4px 4px no-repeat;
}

.category-section {
  padding: 8px 18px 2px;
}
.category-section {
  display: grid;
  gap: 8px;
}
.category-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.category-rail::-webkit-scrollbar { display: none; }
.category-rail button {
  flex: 0 0 auto;
  min-height: 44px;
  max-width: 180px;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-rail button.active {
  color: #fff;
  background: var(--dark-cta);
  border-color: var(--dark-cta);
}
.stock-filter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stock-filter button {
  min-height: 44px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 800;
}
.stock-filter button.active {
  color: #083345;
  background: var(--accent-2);
  border-color: var(--accent);
}

.qty-section { padding: 8px 18px; }
.qty-section h2,
.catalog-head h2 {
  font-family: var(--font-display);
  font-size: 18px;
}
.qty-section span,
.catalog-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.qty-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-top: 10px;
  scrollbar-width: none;
}
.qty-rail::-webkit-scrollbar { display: none; }
.qty-rail button {
  flex: 0 0 64px;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-weight: 800;
}
.qty-rail button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent-2);
}

.catalog-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
}
.product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 18px 18px;
}
.product-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: center;
  min-height: 104px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.thumb {
  width: 72px;
  height: 72px;
  position: relative;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--accent-3);
  background: linear-gradient(135deg, #DCF0FA, #c5e6f7);
  font-weight: 800;
}
.thumb img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb span {
  position: relative;
  z-index: 0;
}
.thumb.missing-image {
  background: linear-gradient(135deg, #DCF0FA, #c5e6f7);
}
.product-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.product-price { color: var(--accent-3); font-weight: 900; margin-top: 5px; }
.stock-badge {
  display: inline-flex;
  margin-top: 5px;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: var(--success);
  background: rgba(11, 173, 117, .12);
}
.stock-badge.low { color: #b36800; background: rgba(240, 146, 10, .14); }
.stock-badge.out { color: var(--danger); background: rgba(232, 53, 53, .1); }
.add-btn {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px rgba(0, 144, 204, .28);
  font-size: 28px;
}
.empty { padding: 36px 18px; color: var(--muted); text-align: center; }

.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--dark-cta);
  box-shadow: 0 -8px 32px rgba(4, 30, 46, .22);
}
.cart-summary {
  flex: 1;
  min-width: 0;
  text-align: left;
  color: #fff;
  background: transparent;
}
.cart-summary span,
.cart-summary small {
  display: block;
  color: rgba(255, 255, 255, .64);
  font-size: 12px;
  font-weight: 700;
}
.cart-summary strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
}
.checkout-btn {
  min-width: 118px;
  min-height: 56px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 16px rgba(0, 144, 204, .4);
  font-size: 16px;
  font-weight: 800;
}

.cart-drawer {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  max-height: min(82dvh, 680px);
  overflow: auto;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.cart-list { display: grid; gap: 8px; margin: 10px 0; }
.cart-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}
.cart-item-top { display: flex; justify-content: space-between; gap: 10px; }
.qty-controls { display: grid; grid-template-columns: 44px 1fr 44px 58px; gap: 8px; }
.qty-controls button {
  min-height: 44px;
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  font-weight: 900;
}
.qty-controls .remove { color: var(--danger); }
.payment-box { display: grid; gap: 10px; }
.compact { margin-bottom: 0; }
.change-box {
  padding: 10px;
  border-radius: 12px;
  color: var(--success);
  background: rgba(11, 173, 117, .12);
  font-weight: 800;
  text-align: center;
}
.cash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cash-grid button {
  min-height: 44px;
  border-radius: 12px;
  color: var(--text);
  background: var(--surface-2);
  font-weight: 800;
}
.checkout-full { margin-top: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(102px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  transform: translateX(-50%) translateY(16px);
  max-width: min(92vw, 440px);
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--dark-cta);
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: end center;
  padding: 14px;
  background: rgba(7, 35, 48, .55);
}
.scanner-card {
  width: min(440px, 100%);
  padding: 14px;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
#scanner-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 12px;
  border-radius: 16px;
  background: var(--dark-cta);
  object-fit: cover;
}
#scanner-status {
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

@media (min-width: 760px) {
  .app { max-width: 720px; margin: 0 auto; }
  .cart-bar { left: 50%; width: min(720px, 100%); transform: translateX(-50%); }
}
