/* FoodScan browser client — visual system from the approved mockups.
 *
 * Light canvas, white cards with 16px radii, one green accent, four-item bottom
 * navigation. Everything is drawn with system fonts and inline SVG icons, so the
 * file stays dependency-free and is served as-is from the region node.
 */

:root {
  --primary: #1c7a4c;
  --primary-dark: #15603b;
  --primary-soft: #e7f2ea;
  --ink: #111512;
  --muted: #8a938f;
  --line: #e8ecea;
  --canvas: #f6f8f7;
  --surface: #ffffff;
  --danger: #c0392b;
  --warn: #a9711a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(17, 21, 18, .04);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body { overscroll-behavior-y: none; }

#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  background: var(--canvas);
}

/* ------------------------------------------------------------------ app bar */

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: env(safe-area-inset-top) 12px 0;
  background: var(--canvas);
}

.appbar .title {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appbar .title.left { text-align: left; }

.nav-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}
.nav-button:hover { background: #eceef0; }
.nav-button.spacer { pointer-events: none; }
.nav-button svg { width: 22px; height: 22px; }

.region-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.region-pill svg { width: 14px; height: 14px; }

#progress { height: 2px; background: transparent; transition: background .2s; }
#progress.busy {
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: sweep 1s linear infinite;
}
@keyframes sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* -------------------------------------------------------------------- layout */

main {
  flex: 1;
  padding: 4px 14px 24px;
  outline: none;
}

.screen { display: flex; flex-direction: column; gap: 14px; }
.screen.flush { gap: 12px; }

.section-title { font-size: 16px; font-weight: 700; margin: 2px 0 0; }
.section-note { color: var(--muted); font-size: 12.5px; margin: -8px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.error { color: var(--danger); }
.warn { color: var(--warn); }
.center { text-align: center; }
.spacer-8 { height: 8px; }

/* ------------------------------------------------------------------- tab bar */

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 0;
  background: none;
  padding: 4px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button[aria-selected="true"] { color: var(--primary); }
.tabbar button:disabled { opacity: .5; cursor: default; }

/* -------------------------------------------------------------------- typography */

h1 { font-size: 22px; line-height: 1.2; margin: 0; font-weight: 700; }
h2 { font-size: 16px; margin: 0; font-weight: 700; }
h3 { font-size: 15px; margin: 0; font-weight: 700; }
p { margin: 0; }
.lede { color: var(--muted); }
.tabular { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------- buttons */

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 13px 16px;
  min-height: 48px;
}
button:hover:not(:disabled) { background: var(--primary-dark); }
button:disabled { opacity: .45; cursor: default; }

button.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
button.ghost:hover:not(:disabled) { background: #f2f4f3; }
button.soft { background: var(--primary-soft); color: var(--primary-dark); }
button.soft:hover:not(:disabled) { background: #d9ebe1; }
button.danger { background: var(--danger); }
button.danger.ghost { background: var(--surface); color: var(--danger); border-color: var(--line); }
button.block { width: 100%; display: block; }
button.link {
  background: none;
  color: var(--primary);
  padding: 4px 0;
  min-height: 0;
  font-weight: 600;
}
button.link:hover:not(:disabled) { background: none; text-decoration: underline; }
button.icon-only {
  background: none;
  color: var(--muted);
  padding: 8px;
  min-height: 0;
  border-radius: 10px;
}
button.icon-only:hover:not(:disabled) { background: #eef1ef; }
button.icon-only.danger { color: var(--danger); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.tight { gap: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ----------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card.plain { border: 0; box-shadow: none; }
.card.tap { cursor: pointer; }
.card.tap:hover { border-color: #d5ddd9; }

/* ------------------------------------------------------------------- search bar */

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
}
.search svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  outline: none;
  padding: 0;
}

input[type="text"], input[type="tel"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 3px solid rgba(28, 122, 76, .30);
  outline-offset: 1px;
}
.field { display: block; }
.field > span.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.counter { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------------- chips */

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  color: #4a5450;
  border-radius: 999px;
  padding: 9px 15px;
  min-height: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.chip:hover:not(:disabled) { background: #f2f4f3; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip[aria-pressed="true"]:hover { background: var(--primary-dark); }

.tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.tag.grey { background: #eef0ef; color: var(--muted); }
.tag.warn { background: #fbf2e2; color: var(--warn); }
.tag.bad { background: #fbe9e7; color: var(--danger); }

/* --------------------------------------------------------------------- products */

.products { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  /* These cards are <button>s, which would otherwise inherit white text. */
  color: var(--ink);
}
.product:hover { border-color: #d5ddd9; }
.product .tile {
  height: 118px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #eef5f0, #dcebe2);
  color: var(--primary);
  font-size: 30px;
  font-weight: 700;
}
.product .tile svg { width: 34px; height: 34px; opacity: .55; }
.product .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.product .name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.product .sub { font-size: 11.5px; color: var(--muted); }

.scan-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-soft);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--primary-dark);
  font-size: 13.5px;
  font-weight: 600;
}
.scan-banner svg { width: 20px; height: 20px; flex: 0 0 auto; }
.scan-banner button { margin-left: auto; padding: 8px 14px; min-height: 38px; font-size: 13px; }

/* ----------------------------------------------------------------------- scan */

.scan-stage {
  position: relative;
  height: 44vh;
  min-height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 10%, #21362d 0%, #0c1512 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px 22px;
  gap: 12px;
  cursor: pointer;
  border: 0;
  width: 100%;
}
.scan-stage .frame {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 12%;
  height: 40%;
  border: 2.5px solid rgba(255, 255, 255, .85);
  border-radius: 16px;
}
.scan-stage .frame::before,
.scan-stage .frame::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  background: rgba(120, 255, 190, .85);
}
.scan-stage .frame::before { top: 12%; }
.scan-stage .frame::after { bottom: 12%; }
.scan-stage .hint { font-size: 13.5px; opacity: .9; }
.scan-stage svg { width: 40px; height: 40px; opacity: .8; }

/* ------------------------------------------------------------------ metrics */

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.metric b { display: block; font-size: 19px; font-weight: 700; }
.metric b .of { font-size: 13px; color: var(--muted); font-weight: 600; }
.metric span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.product-head { display: flex; gap: 12px; align-items: center; }
.product-head .tile {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #eef5f0, #dcebe2);
  color: var(--primary);
  font-size: 24px;
  font-weight: 700;
}

/* ------------------------------------------------------------------- reels */

.rail { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.reel {
  flex: 0 0 106px;
  height: 142px;
  border-radius: 14px;
  border: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #2b4a3c 0%, #0d1a15 100%);
  color: #fff;
  display: grid;
  place-items: center;
}
.reel video, .reel img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.reel .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.reel .play svg { width: 30px; height: 30px; }
.reel .duration {
  position: absolute;
  right: 7px;
  bottom: 7px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, .55);
  border-radius: 999px;
  padding: 2px 7px;
}
.reel .who {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 30px;
  font-size: 11px;
  text-align: left;
  opacity: .9;
}

/* ------------------------------------------------------------------- reviews */

.review { display: flex; flex-direction: column; gap: 8px; }
.review .head { display: flex; gap: 10px; align-items: center; }
.avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f0f2f1;
  color: #4a5450;
  font-size: 13px;
  font-weight: 700;
}
.review .who { font-weight: 700; font-size: 14px; }
.review .meta { color: var(--muted); font-size: 11.5px; }
.review .text { white-space: pre-wrap; font-size: 14px; }
.review .part { font-size: 12.5px; color: var(--muted); }
.review .part b { color: var(--ink); }
.review img.photo {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  background: #eef2f1;
}
.stars { color: #e2a33c; font-size: 13px; letter-spacing: 1px; white-space: nowrap; }

.votes { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.vote {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4a5450;
  padding: 7px 13px;
  min-height: 0;
  font-size: 13px;
  font-weight: 600;
}
.vote:hover:not(:disabled) { background: #f2f4f3; }
.vote svg { width: 16px; height: 16px; }
.vote[aria-pressed="true"] { background: var(--primary-soft); border-color: #c4e0d1; color: var(--primary-dark); }
.vote.up[aria-pressed="true"] { color: var(--primary-dark); }

/* -------------------------------------------------------------------- history */

.day-label { font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 2px 0; }
.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  min-height: 0;
  color: var(--ink);
}
.history-row:hover { border-color: #d5ddd9; }
.history-row .tile {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #eef5f0, #dcebe2);
  color: var(--primary);
  font-weight: 700;
}
.history-row .body { flex: 1; min-width: 0; }
.history-row .name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-row .sub { font-size: 11.5px; color: var(--muted); }
.history-row svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }

/* -------------------------------------------------------------------- profile */

.profile-head { display: flex; gap: 12px; align-items: center; }
.profile-head .avatar {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  font-size: 17px;
  background: #eceeed;
}
.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-soft);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--primary-dark);
}
.status-card svg { width: 20px; height: 20px; flex: 0 0 auto; }
.status-card .text { flex: 1; font-size: 13px; }
.status-card .text b { display: block; font-size: 13.5px; }
.switch {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: #cfd6d3;
  border: 0;
  padding: 0;
  min-height: 0;
  flex: 0 0 auto;
  transition: background .15s;
}
.switch[aria-checked="true"] { background: var(--primary); }
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.switch[aria-checked="true"]::after { transform: translateX(19px); }

.status-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.status-option:last-child { border-bottom: 0; }
.status-option svg { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.status-option.active svg { color: var(--primary); }
.status-option .body { flex: 1; }
.status-option .body b { display: block; font-size: 14px; }
.status-option .body span { font-size: 12px; color: var(--muted); }
.status-option .mark { color: var(--primary); }
.status-option .mark svg { width: 20px; height: 20px; }

.own-review { display: flex; gap: 10px; }
.own-review .tile {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #eef5f0, #dcebe2);
  color: var(--primary);
  font-weight: 700;
}
.own-review .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

/* ---------------------------------------------------------------------- login */

.login-art { display: grid; place-items: center; padding: 10px 0 4px; }
.login-art svg { width: 76px; height: 76px; color: var(--primary); }
.phone-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.phone-card .body { flex: 1; }
.phone-card .body span { display: block; font-size: 12px; color: var(--muted); }
.phone-card .body b { font-size: 15px; }

.code-field { position: relative; }
.code-field input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
  font-size: 18px;
}
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; pointer-events: none; }
.code-box {
  height: 54px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.code-box.filled { border-color: #c4d3cb; }
.code-box.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(28, 122, 76, .12); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  padding: 0;
  min-height: 52px;
  border-radius: 12px;
}
.keypad button:hover { background: #f2f4f3; }
.keypad button.flat { border-color: transparent; background: none; }

/* --------------------------------------------------------------------- editor */

.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.media-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  min-height: 0;
}
.media-tile:hover { background: #f2f4f3; }
.media-tile svg { width: 26px; height: 26px; color: var(--primary); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb-item {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2f1;
  border: 1px solid var(--line);
}
.thumb-item img, .thumb-item video { width: 100%; height: 100%; object-fit: cover; }
.thumb-item .badge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 10px;
  text-align: center;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  padding: 2px 0;
}
.thumb-item .remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  min-height: 0;
  border-radius: 50%;
  background: rgba(10, 15, 12, .65);
  color: #fff;
  padding: 0;
  display: grid;
  place-items: center;
}
.thumb-item .remove svg { width: 13px; height: 13px; }

.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #f4f6f5;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 12.5px;
  color: var(--muted);
}
.notice svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }

/* ------------------------------------------------------------------- overlays */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(12, 18, 15, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sheet .sheet-title { font-size: 17px; font-weight: 700; }
.sheet-list { display: flex; flex-direction: column; gap: 8px; }

.scanner { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; object-fit: cover; }
.scanner .scanner-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  color: #fff;
}
.scanner .scanner-bar .title { flex: 1; text-align: center; font-weight: 600; }
.scanner .round-button {
  width: 40px;
  height: 40px;
  min-height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
}
.scanner .round-button svg { width: 20px; height: 20px; }
.scanner .frame {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 32%;
  height: 26%;
  border: 3px solid rgba(255, 255, 255, .92);
  border-radius: 18px;
}
.scanner .scanner-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 16px calc(22px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  text-align: center;
}

/* Frozen frame shown the moment a code is read: proof of what was scanned. */
.scan-snapshot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-found {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(150px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(10, 18, 14, .86);
  color: #fff;
  border-radius: 12px;
  padding: 10px 15px;
  font-size: 14px;
  white-space: nowrap;
}
.scan-found .scan-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
}
.scan-found .scan-check svg { width: 14px; height: 14px; }

.shutter {
  width: 66px;
  height: 66px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  border: 4px solid rgba(255, 255, 255, .45);
}
.shutter:hover:not(:disabled) { background: #eef2f0; }

.reel-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.reel-viewer .top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 14px 8px;
}
.reel-viewer .top .who { font-weight: 600; }
.reel-viewer video { width: 100%; flex: 1; min-height: 0; object-fit: contain; background: #000; }
.reel-viewer .bottom {
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reel-viewer .caption { font-size: 15px; font-weight: 600; }
.reel-viewer .caption span { display: block; font-size: 13px; font-weight: 400; opacity: .75; }
.reel-viewer .votes .vote { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; }
.reel-viewer .votes .vote[aria-pressed="true"] { background: rgba(255, 255, 255, .28); color: #fff; }
.reel-viewer button.ghost { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }

#toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 90;
  max-width: min(92vw, 520px);
  background: #171c19;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  white-space: pre-line;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.fallback { padding: 24px; }

@media (prefers-reduced-motion: reduce) {
  #progress.busy { animation: none; background: var(--primary); }
}
/* Layout rules below use flex, which would otherwise win over the user-agent
   [hidden] rule and leave toggled blocks visible. */
[hidden] { display: none !important; }

/* Inline icons default to 20px; component rules below override where needed. */
svg { width: 20px; height: 20px; flex: none; }

/* Photo tile for products a reader added themselves. */
.tile.photo { padding: 0; overflow: hidden; background: #eef1ef; }
.tile.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- adding a product the catalog does not know --------------------------- */

.field-stack { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.field-stack > span { font-size: 13px; font-weight: 600; color: #4a5450; }
.field-stack input, .field-stack textarea { width: 100%; }

.photo-preview {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin-top: 4px;
}

.ok-mark {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px auto 10px;
}
.ok-mark svg { width: 26px; height: 26px; }
.ok-title { font-size: 19px; margin: 0 0 6px; text-align: center; }

.bonus-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
}
.bonus-note svg { width: 18px; height: 18px; flex: 0 0 auto; }

.tag.bonus { background: var(--primary); color: #fff; }
.chip.sub { background: var(--primary-soft); border-color: transparent; color: var(--primary-dark); }
.chip.sub[aria-pressed="true"] { background: var(--primary); color: #fff; }
