/* Pantry — Design system. HIG-inspired tokens, light + dark, mobile-first. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #f7f7fb;
  --label: #1c1c1e;
  --label-2: #3c3c4399;
  --label-3: #3c3c4366;
  --separator: #e5e5ea;
  --tint: #007aff;
  --tint-hover: #0061cc;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --yellow: #ffcc00;
  --gray: #9aa4b2;

  --shadow-1: 0 1px 2px rgba(0,0,0,.04), 0 0 0 .5px rgba(0,0,0,.05);
  --shadow-2: 0 4px 16px rgba(0,0,0,.08), 0 0 0 .5px rgba(0,0,0,.05);
  --shadow-3: 0 24px 64px rgba(0,0,0,.18), 0 0 0 .5px rgba(0,0,0,.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --tabbar-height: 56px;

  --ease-out: cubic-bezier(.2,.7,.3,1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --label: #fff;
    --label-2: #ebebf599;
    --label-3: #ebebf566;
    --separator: #38383a;
    --tint: #0a84ff;
    --tint-hover: #339cff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --yellow: #ffd60a;
    --gray: #6e7480;
    --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 0 0 .5px rgba(255,255,255,.06);
    --shadow-2: 0 4px 16px rgba(0,0,0,.4), 0 0 0 .5px rgba(255,255,255,.06);
    --shadow-3: 0 24px 64px rgba(0,0,0,.6), 0 0 0 .5px rgba(255,255,255,.06);
  }
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img, svg, video { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--tint); text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--label-2); }
.row { display: flex; align-items: center; }
.row.gap > * + * { margin-left: 8px; }
.col { display: flex; flex-direction: column; }
.spacer { flex: 1; }

/* ── App shell ──────────────────────────────────────────────────────────── */
#app { min-height: 100dvh; min-height: 100vh; padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom)); }
#views { position: relative; min-height: 100dvh; }
.view { display: none; padding: 0; min-height: 100dvh; }
.view.active { display: block; }

/* View headers */
.view-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg), transparent 10%);
  backdrop-filter: saturate(1.4) blur(20px);
  -webkit-backdrop-filter: saturate(1.4) blur(20px);
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  border-bottom: 1px solid var(--separator);
}
.view-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.view-sub { color: var(--label-2); font-size: 14px; margin-top: 2px; }
.view-content { padding: 12px 16px 24px; }

/* ── Tab bar ────────────────────────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface), transparent 8%);
  backdrop-filter: saturate(1.4) blur(20px);
  -webkit-backdrop-filter: saturate(1.4) blur(20px);
  border-top: 1px solid var(--separator);
  padding-bottom: var(--safe-bottom);
}
.tab {
  position: relative;
  height: var(--tabbar-height);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--label-2);
  transition: color .15s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 24px; height: 24px; }
.tab span { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.tab.active { color: var(--tint); }
.tab:active svg { transform: scale(0.92); transition: transform .1s; }
.badge-dot {
  position: absolute; top: 6px; right: calc(50% - 18px);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
}

/* ── Auth screen ────────────────────────────────────────────────────────── */
.auth-screen {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 32px 24px 24px;
  box-shadow: var(--shadow-2);
  text-align: center;
}
.auth-icon { font-size: 56px; line-height: 1; margin-bottom: 16px; }
.auth-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 4px; letter-spacing: -0.01em; }
.auth-card p { font-size: 15px; margin-bottom: 24px; }
#auth-form { display: flex; flex-direction: column; gap: 12px; }

/* ── Forms / inputs ─────────────────────────────────────────────────────── */
input[type="text"], input[type="password"], input[type="number"],
input[type="search"], input[type="date"], input[type="email"],
select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  color: var(--label);
  outline: none;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--tint);
  background: var(--surface);
}
textarea { resize: vertical; min-height: 80px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--label-2); padding-left: 4px; }
.form-err { color: var(--red); font-size: 13px; padding: 4px; text-align: left; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; gap: 6px;
  border-radius: var(--radius-md);
  font-weight: 600; font-size: 15px;
  transition: opacity .15s, transform .1s, background .15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); opacity: .8; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-primary { background: var(--tint); color: #fff; }
.btn-primary:hover { background: var(--tint-hover); }
.btn-secondary { background: var(--surface-2); color: var(--label); border: 1px solid var(--separator); }
.btn-flat { background: transparent; color: var(--label); }
.btn-danger { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon svg { width: 20px; height: 20px; }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 16px);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--tint); color: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--tint), transparent 50%);
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 30;
}
.fab svg { width: 26px; height: 26px; }

/* ── Search bar ─────────────────────────────────────────────────────────── */
.search-bar {
  position: relative;
  margin-bottom: 12px;
}
.search-bar input { padding-left: 38px; background: var(--surface-2); border-color: transparent; }
.search-bar svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--label-3);
}

/* ── Filter chips ───────────────────────────────────────────────────────── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 14px;
  background: var(--surface-2);
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip.active { background: var(--tint); color: #fff; }

/* ── List rows ──────────────────────────────────────────────────────────── */
.list { background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-1); margin-bottom: 16px; }
.list-section-title { font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.05em; padding: 16px 4px 8px; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--separator);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .1s;
}
.list-row:last-child { border-bottom: 0; }
.list-row:active { background: var(--surface-2); }
.row-thumb {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  overflow: hidden;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--label-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.row-qty { font-size: 13px; font-weight: 600; color: var(--label-2); }

/* ── Expiry badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  font-size: 12px; font-weight: 700;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--label-2);
}
.badge.tone-red { background: color-mix(in srgb, var(--red), transparent 85%); color: var(--red); }
.badge.tone-orange { background: color-mix(in srgb, var(--orange), transparent 82%); color: var(--orange); }
.badge.tone-yellow { background: color-mix(in srgb, var(--yellow), transparent 80%); color: #b58f00; }
.badge.tone-green { background: color-mix(in srgb, var(--green), transparent 85%); color: var(--green); }
.badge.tone-gray { background: var(--surface-2); color: var(--label-2); }
@media (prefers-color-scheme: dark) {
  .badge.tone-yellow { color: var(--yellow); }
}

/* ── Skeletons ──────────────────────────────────────────────────────────── */
@keyframes shimmer { 0%{background-position:-400px 0} 100%{background-position:400px 0} }
.skel {
  background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2), var(--separator) 40%) 50%, var(--surface-2) 100%);
  background-size: 800px 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 6px;
}
.skel-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--separator);
}
.skel-thumb { width: 44px; height: 44px; border-radius: 10px; }
.skel-line { height: 12px; }
.skel-line.s { width: 50%; }
.skel-line.m { width: 70%; }
.skel-line.l { width: 90%; }
@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
}

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--label-2);
}
.empty-emoji { font-size: 56px; line-height: 1; margin-bottom: 14px; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--label); margin-bottom: 6px; }
.empty-msg { font-size: 14px; margin-bottom: 18px; }

/* ── Sheet + modal ──────────────────────────────────────────────────────── */
.sheet-backdrop, .modal-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .25s var(--ease-out);
}
.sheet-backdrop.open, .modal-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91;
  max-height: 88dvh;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  transform: translateY(100%);
  transition: transform .3s var(--ease-out);
  overflow: hidden auto;
  padding-bottom: var(--safe-bottom);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
}
.sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 36px; height: 4px;
  background: var(--separator);
  border-radius: 2px;
  margin: 8px auto 4px;
  flex-shrink: 0;
}
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 4px;
  flex-shrink: 0;
}
.sheet-title { font-size: 17px; font-weight: 700; }
.sheet-close { font-size: 17px; color: var(--tint); padding: 8px; min-height: 36px; }
.sheet-pad { padding: 12px 16px 24px; }
.sheet-content { padding: 0 16px 24px; overflow-y: auto; flex: 1; }

@media (min-width: 769px) {
  .sheet {
    left: 50%; right: auto; bottom: 50%;
    transform: translate(-50%, calc(50% + 24px));
    width: min(560px, calc(100vw - 32px));
    max-height: 80dvh;
    border-radius: var(--radius-xl);
  }
  .sheet.open { transform: translate(-50%, 50%); }
  .sheet-handle { display: none; }
}

.confirm-msg { font-size: 15px; margin-bottom: 16px; line-height: 1.4; }

/* ── Toasts ─────────────────────────────────────────────────────────────── */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 16px);
  z-index: 200;
  display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  background: color-mix(in srgb, var(--label), transparent 12%);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
  box-shadow: var(--shadow-2);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--green); color: #fff; }
.toast-error { background: var(--red); color: #fff; }
.toast-warning { background: var(--orange); color: #fff; }

/* ── Scanner UI ─────────────────────────────────────────────────────────── */
.scanner {
  position: relative;
  width: 100%;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}
.scanner video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.scanner-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex; flex-direction: column;
  z-index: 2;
}
.scanner-top {
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: auto;
}
.scanner-top .btn-icon { background: rgba(0,0,0,.5); color: #fff; backdrop-filter: blur(10px); }
.scanner-mid {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
}
.reticle {
  position: relative;
  width: min(75vw, 320px);
  height: min(50vw, 220px);
  max-height: 220px;
}
.reticle::before, .reticle::after,
.reticle > span:nth-child(1), .reticle > span:nth-child(2) {
  content: '';
  position: absolute; width: 32px; height: 32px;
  border: 3px solid #fff;
}
.reticle::before { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.reticle::after { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.reticle > span:nth-child(1) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.reticle > span:nth-child(2) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.scanner-bottom {
  padding: 16px;
  padding-bottom: calc(var(--tabbar-height) + var(--safe-bottom) + 24px);
  text-align: center;
  pointer-events: auto;
}
.scanner-hint {
  display: inline-block;
  background: rgba(0,0,0,.6);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  backdrop-filter: blur(10px);
  margin-bottom: 16px;
}
.scanner-actions { display: flex; gap: 12px; justify-content: center; }
.scanner-actions .btn { background: rgba(255,255,255,.95); color: #111; }
.scanner-actions .btn-primary { background: var(--tint); color: #fff; }

.capture-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 4px solid #fff;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.capture-btn::after {
  content: '';
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fff;
  transition: transform .1s;
}
.capture-btn:active::after { transform: scale(.92); }

/* ── Product card (after scan) ──────────────────────────────────────────── */
.product-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  margin-bottom: 16px;
}
.product-card-img {
  width: 100%; height: 180px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
}
.product-card-img img { width: 100%; height: 100%; object-fit: contain; }
.product-card-body { padding: 16px; }
.product-card-title { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.product-card-sub { font-size: 14px; color: var(--label-2); }

/* ── Location card ──────────────────────────────────────────────────────── */
.loc-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: transform .1s;
}
.loc-card:active { transform: scale(0.98); }
.loc-emoji {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.loc-name { font-size: 16px; font-weight: 600; }
.loc-sub { font-size: 13px; color: var(--label-2); }

/* ── Settings rows ──────────────────────────────────────────────────────── */
.settings-section { margin-bottom: 24px; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--separator);
}
.settings-row:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.settings-row:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); border-bottom: 0; }
.settings-row:only-child { border-radius: var(--radius-lg); }
.settings-label { font-size: 15px; font-weight: 500; }
.settings-value { color: var(--label-2); font-size: 14px; }

/* Toggle */
.toggle { position: relative; width: 50px; height: 30px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--separator);
  border-radius: 999px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute; left: 2px; top: 2px;
  width: 26px; height: 26px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s var(--ease-out);
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background: var(--green); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Detail sheet */
.detail-img {
  width: 96px; height: 96px;
  border-radius: 16px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  overflow: hidden;
  margin: 0 auto 12px;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-name { font-size: 22px; font-weight: 800; text-align: center; letter-spacing: -0.01em; }
.detail-brand { color: var(--label-2); text-align: center; margin-bottom: 16px; }

.qty-stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; }
.qty-stepper button {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface);
  font-size: 18px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-1);
}
.qty-stepper input {
  width: 60px; text-align: center;
  background: transparent; border: 0; padding: 0; font-weight: 600;
}

/* Banner */
.banner {
  background: color-mix(in srgb, var(--orange), transparent 85%);
  color: var(--orange);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.banner-info { background: color-mix(in srgb, var(--tint), transparent 88%); color: var(--tint); }

/* Responsive */
@media (min-width: 769px) {
  .view-content { max-width: 720px; margin: 0 auto; }
}
@media (min-width: 1024px) {
  .view-content { max-width: 880px; }
}

/* ── Live expiry-scan overlay ────────────────────────────────────────── */
.expiry-scan-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: #000;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.expiry-scan-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.expiry-scan-shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 280px 160px at 50% 50%, transparent 0, transparent 70%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.expiry-scan-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(env(safe-area-inset-top, 12px), 12px) 16px 12px;
  color: #fff;
}
.expiry-scan-title {
  font-weight: 600; font-size: 15px;
  background: rgba(0,0,0,.5);
  padding: 8px 14px; border-radius: 999px;
  backdrop-filter: blur(10px);
}
.expiry-scan-cancel {
  width: 40px; height: 40px;
  background: rgba(0,0,0,.5);
  color: #fff;
  border-radius: 999px;
  backdrop-filter: blur(10px);
  display: inline-flex; align-items: center; justify-content: center;
}
.expiry-scan-cancel svg { width: 22px; height: 22px; }
.expiry-scan-mid {
  flex: 1; position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.expiry-scan-frame {
  width: 280px; height: 160px;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.18);
  position: relative;
}
.expiry-scan-frame::before,
.expiry-scan-frame::after {
  content: ''; position: absolute;
  width: 24px; height: 24px;
  border: 3px solid var(--tint, #007aff);
}
.expiry-scan-frame::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.expiry-scan-frame::after  { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.expiry-scan-bottom {
  position: relative; z-index: 2;
  padding: 16px 24px max(env(safe-area-inset-bottom, 16px), 24px);
  color: #fff;
  text-align: center;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent);
}
.expiry-scan-status {
  font-size: 15px; font-weight: 500;
  margin-bottom: 8px;
  min-height: 22px;
}
.expiry-scan-dots {
  font-size: 18px; letter-spacing: 4px; opacity: 0.85;
  min-height: 22px;
}
