:root {
  --bg: #f8fafc;
  --text: #0f172a;
  --hint: #64748b;
  --card: #ffffff;
  --button: #1f7a4d;
  --button-text: #ffffff;
  --line: #e2e8f0;
  --good: #067647;
  --warn: #b54708;
  --bad: #b42318;
  --nav: calc(72px + env(safe-area-inset-bottom));
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  color-scheme: light;
  font-family: "Noto Sans Armenian", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

:root[data-theme="dark"] {
  --bg: #101412;
  --text: #f3f6f4;
  --hint: #a9b7af;
  --card: #1b2420;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent !important;
}
*:focus, *:focus-visible {
  outline: none !important;
}
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: none;
  background: var(--bg);
}
body {
  font-size: 16px;
  line-height: 1.45;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, .page-title, .header-title, .eyebrow, .topbar, .admin-head {
  outline: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none;
}
h1, h2, h3, h4, p, a, button, label, span, li, header, nav, article, section, .eyebrow, .topbar, .admin-head {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
button, input, a { font: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: 1.05rem; margin-top: 8px; }
h3 { font-size: 1rem; }
a { color: inherit; }

.app-shell, .admin-root {
  height: 100%;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.screen {
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: calc(14px + env(safe-area-inset-top)) 16px var(--nav);
}
.history-screen {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.history-screen .history-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-bottom: 100px;
}
.screen > * { min-width: 0; max-width: 100%; }
.product-screen { gap: 12px; }
.topbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.header-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.header-actions .chip-btn {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.header-actions .chip-btn.icon-only { padding: 0 10px; }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand > div { min-width: 0; }
.brand h1 { overflow-wrap: anywhere; }
.eyebrow {
  color: var(--hint);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 58%, transparent 0 7px, var(--button) 8px 10px, transparent 11px),
    linear-gradient(160deg, #1f8a5b, #14372c);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
  flex: none;
}

.camera-card {
  position: relative;
  flex: 1;
  min-height: 240px;
  border-radius: 28px;
  overflow: hidden;
  background: #10241c;
  box-shadow: var(--shadow);
}
.camera-card.flash { box-shadow: inset 0 0 0 4px #10B981; }
.live-badge,
.scan-live {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 5;
  text-align: center;
  color: white;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  padding: 6px 10px;
  animation: pulse 1.2s ease-in-out infinite;
}
.camera-card .scan-live,
.camera-card .laser,
.camera-card .corners { display: none; }
body.scanner-active .camera-card .scan-live,
body.scanner-active .camera-card .laser,
body.scanner-active .camera-card .corners { display: block; }
body.scanner-active .camera-card .camera-idle { display: none; }
.laser {
  position: absolute;
  left: 14%;
  right: 14%;
  height: 3px;
  z-index: 4;
  background: #10B981;
  box-shadow: 0 0 18px #10B981;
  animation: scanLaser 1.6s ease-in-out infinite;
}
.corners {
  position: absolute;
  inset: 18% 12%;
  z-index: 4;
  pointer-events: none;
  border: 3px solid #10B981;
  border-radius: 12px;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.8);
}
body.scanner-active .corners { animation: pulse 1.1s ease-in-out infinite; }
.scan-toggle .label-live { display: none; }
body.scanner-active .scan-toggle .label-idle { display: none; }
body.scanner-active .scan-toggle .label-live { display: inline; }
body.scanner-active #start-scan {
  background: linear-gradient(180deg, #f59e0b, #b91c1c);
  color: #fff;
  animation: scanPulse 0.9s ease-in-out infinite;
}
@keyframes scanLaser { 0%, 100% { top: 18%; } 50% { top: 78%; } }
@keyframes scanPulse { 50% { transform: scale(0.98); filter: brightness(1.15); } }
@keyframes pulse { 50% { opacity: 0.55; } }
#scan-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #10241c;
}
.camera-status {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 5;
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.camera-status:empty { display: none; }
.busy[hidden] { display: none !important; }
.camera-idle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px 24px 72px;
  text-align: center;
  color: #e7f3ec;
  pointer-events: none;
}
.viewfinder {
  position: absolute;
  inset: 18% 12%;
  border-radius: 18px;
  pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.85);
}
.camera-card:has(.camera-idle) .viewfinder { opacity: 0.35; }
body.scanner-active .camera-card .viewfinder { opacity: 1; }
.camera-shot {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}
.camera-file {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  height: 52px;
  opacity: 0;
  cursor: pointer;
}

.actions, .field, .examples { display: flex; flex-direction: column; gap: 8px; }
.field label, .examples p, .hint { color: var(--hint); font-size: 0.92rem; }
.field-row, .chips { display: flex; gap: 8px; align-items: center; }
.field-row input { width: auto !important; flex: 1; min-width: 0; }
.form-input,
input[type="text"],
input[type="number"],
input[type="url"],
input[type="search"],
input:not([type]),
textarea {
  background: #FFFFFF !important;
  border: 1.5px solid #CBD5E1 !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  font-size: 15px !important;
  color: #0F172A !important;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
  width: 100%;
}
.form-input:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input:not([type]):focus,
textarea:focus {
  border-color: #10B981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
  outline: none !important;
}
:root[data-theme="dark"] .form-input,
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] input[type="url"],
:root[data-theme="dark"] input[type="search"],
:root[data-theme="dark"] input:not([type]),
:root[data-theme="dark"] textarea {
  background: #1b2420 !important;
  color: #f3f6f4 !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
}
.health-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.health-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid #CBD5E1;
  border-radius: 16px;
  padding: 14px;
}
.health-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.health-tag-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1.5px solid #E2E8F0;
  background: #FFFFFF;
  color: #1E293B;
  color-scheme: light;
  text-align: left;
}
.health-tag-title {
  font-size: 13.5px;
  font-weight: 500;
  color: #1E293B;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  white-space: normal;
  word-break: break-word;
  padding-right: 8px;
}
.health-tag-check {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-weight: 800;
}
.health-tag-card.on {
  border-color: #1f7a4d;
  background: #1f7a4d;
  color: #FFFFFF;
}
.health-tag-card.on .health-tag-title { color: #FFFFFF; }
.health-tag-card.on .health-tag-check {
  background: #FFFFFF;
  color: #1f7a4d;
  border-color: #FFFFFF;
}
:root[data-theme="dark"] .health-tag-card {
  background: var(--card);
  border-color: var(--line);
  color: #E0E0E0;
}
:root[data-theme="dark"] .health-tag-title,
:root[data-theme="dark"] .health-tag-card { color: #E0E0E0; }
:root[data-theme="dark"] .health-tag-card.on,
:root[data-theme="dark"] .health-tag-card.on .health-tag-title {
  background: #1f7a4d;
  color: #FFFFFF;
}
.health-check {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1.5px solid #CBD5E1;
  color: transparent;
  font-weight: 800;
}
.health-chip.on {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.08);
}
.health-chip.on .health-check { background: #10B981; color: white; border-color: #10B981; }
.btn, .chip {
  border: 0;
  border-radius: 16px;
  min-height: 52px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--button); color: var(--button-text); font-weight: 700; }
.partner-cta { width: 100%; margin-top: 16px; padding: 16px; border-radius: 16px; font-weight: 800; }
.btn.ghost, .chip {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.small { min-height: 52px; padding: 0 16px; font-weight: 700; }
.btn.text { background: transparent; color: var(--hint); min-height: 44px; }
.btn:disabled, .chip:disabled { opacity: 0.55; }
.chips { overflow-x: auto; max-width: 100%; }
.shot-strip { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; }
.shot-strip figure { position: relative; margin: 0; min-width: 92px; }
.shot-strip img { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; }
.shot-strip figcaption { font-size: 0.75rem; color: var(--hint); }
.shot-strip button { position: absolute; top: 4px; right: 4px; border: 0; border-radius: 99px; width: 24px; height: 24px; background: #fff; }
.chip { min-height: 40px; border-radius: 999px; white-space: nowrap; font-size: 0.92rem; }

.text-danger {
  margin: 0;
  color: var(--bad);
  font-weight: 700;
}

.welcome-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px 16px calc(var(--nav) + 12px);
  background: rgba(15, 23, 42, 0.55);
}
.welcome-card {
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 18px;
  border-radius: 24px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}
.welcome-card h2 { margin: 0; }
.welcome-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.welcome-list li { line-height: 1.45; }
.welcome-card .btn { width: 100%; }
.plan-offer.static { cursor: default; }

.banner, .error {
  border-radius: 16px;
  padding: 12px 14px;
  background: #e7f6ee;
  color: #085c38;
}
.banner.warn, .error { background: #fff4e8; color: #8a3b08; }
.error { background: #fdecec; color: var(--bad); }
:root[data-theme="dark"] .banner { background: #17382a; color: #b7ebcf; }
:root[data-theme="dark"] .banner.warn { background: #3a2a16; color: #ffd7a8; }
:root[data-theme="dark"] .error { background: #3a1c1c; color: #ffb4ab; }

.score-card {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--card);
  border-radius: 24px;
  padding: 16px;
  box-shadow: var(--shadow);
}
@media (max-width: 520px) {
  .score-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
.score-label { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.ring {
  --tone: var(--good);
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--tone) calc(var(--score) * 1%), var(--line) 0);
  flex: none;
}
.ring.danger {
  background: rgba(239, 68, 68, 0.08);
  border: 10px solid #EF4444;
  color: #DC2626;
}
.ring.danger span { color: #DC2626; }
.brand-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #065F46;
  font-weight: 700;
  text-decoration: none;
  border: 0;
}
.ring.bad { --tone: var(--bad); }
.ring span {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  font-size: 2rem;
  font-weight: 700;
}
.badge {
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  background: var(--card);
}
.badge.ok { color: var(--good); }
.badge.no { color: var(--bad); }

.ingredient-list { display: flex; flex-direction: column; gap: 10px; }
.ingredient {
  background: var(--card);
  border-radius: 20px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.ingredient header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ingredient header h3 { min-width: 0; overflow-wrap: anywhere; }
.ingredient header span, .meta-row { color: var(--hint); font-size: 0.85rem; }
.impact-pill { white-space: nowrap; flex-shrink: 0; border-radius: 999px; background: var(--bg); padding: 4px 8px; font-weight: 700; }
.ingredient p { margin-top: 6px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.meta-row .hot { color: var(--bad); font-weight: 700; }

.nutrition {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.nutrition div {
  background: var(--card);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  min-height: 72px;
}
.nutrition span { color: var(--hint); font-size: 0.78rem; }
.micro-list, .claim-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.micro-badge {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--good);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
}
.claim-chip {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--line);
}
.label-facts { display: grid; gap: 0; margin-top: 8px; }
.label-facts div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-align: left;
}
.label-facts span {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
  letter-spacing: 0.04em;
}
.label-facts strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
  width: 100%;
  text-align: left;
}

.profile-card {
  background: var(--card);
  border-radius: 28px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
  text-align: center;
}
.bonus-value {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 8px 0;
  color: var(--button);
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}
.profile-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.profile-identity h2 { margin: 0; }
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  object-fit: cover;
  display: grid;
  place-items: center;
  flex: none;
  background: #14372c;
  color: white;
  font-size: 1.6rem;
  font-weight: 700;
}
.plan-offer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 16px;
  padding: 12px;
  margin-top: 8px;
}
.plan-offer span { color: var(--hint); font-size: 0.85rem; }
.plan-note {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  color: var(--hint);
  font-size: 0.85rem;
  line-height: 1.45;
}
.plan-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 18px;
  padding: 14px;
  margin-top: 10px;
}
.plan-card h3 { margin: 0; }
.plan-card ul { margin: 4px 0 8px; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.plan-card li { line-height: 1.4; }
.plan-card .btn { width: 100%; }
.plan-price { margin: 0; font-size: 1.15rem; font-weight: 800; }
.plan-price span, .plan-dram { color: var(--hint); font-weight: 600; font-size: 0.9rem; }
.plan-chip {
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--good);
  font-size: 0.75rem;
  font-weight: 800;
}
.plan-chip.hot { background: #fef3c7; color: #92400e; }
.plan-card.featured {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(135deg, #10b981, #f5c16c) border-box;
}
.plan-link { color: var(--good); font-weight: 700; font-size: 0.9rem; }
.ingredient.alert { box-shadow: inset 0 0 0 2px #b42318; }
.admin-badge, .plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin: 2px 0 0;
}
.bonus-line { margin: 0; }
.quota-label { font-weight: 700; margin-bottom: 8px; }
.quota-track {
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.quota-track span {
  display: block;
  height: 100%;
  background: #10b981;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat-grid .profile-card { padding: 14px 8px; text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 800; margin: 0; }
.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.history-item {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 16px;
  padding: 10px;
}
.history-item strong, .history-item em { display: block; }
.history-item em { color: var(--hint); font-style: normal; font-size: 0.82rem; }
.history-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.history-card > span:last-child { min-width: 0; flex: 1; }
.history-card strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-card em {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--hint);
  font-style: normal;
  font-size: 0.82rem;
}
.score-circle {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.score-circle.good { background: #ecfdf5; color: #067647; }
.score-circle.warn { background: #fffbeb; color: #b45309; }
.score-circle.bad { background: #fef2f2; color: #b42318; }
.allergen-alert {
  margin: 12px 0;
  padding: 12px;
  border-radius: 16px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 800;
  line-height: 1.4;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  min-height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: var(--hint);
  font-weight: 700;
}
.tab { font-size: 0.82rem; }
.tab.active { background: var(--card); color: var(--text); }
.rail { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; }
.rail-card { min-width: 168px; flex: none; }
.hero-card {
  position: relative;
  overflow: hidden;
  color: white;
  border-radius: 24px;
  padding: 22px 18px;
  background: linear-gradient(135deg, #065F46 0%, #059669 50%, #10B981 100%);
  box-shadow: 0 16px 40px rgba(6, 95, 70, 0.28);
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -40px;
  top: -50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(2px);
  animation: heroGlow 4s ease-in-out infinite;
}
.hero-card h1, .hero-card p { position: relative; z-index: 1; color: white; }
.hero-card p { margin: 8px 0 14px; }
.hero-scan, .hero-search { position: relative; z-index: 1; }
.hero-scan { background: white !important; color: #065F46 !important; margin-bottom: 10px; }
.pill-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.filter-pill {
  flex: none;
  border: 1px solid #CBD5E1;
  background: white;
  color: #0F172A;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.filter-pill:active { transform: scale(0.97); }
.filter-pill.on { background: #059669; color: white; border-color: #059669; }
.explore-card {
  width: 230px;
  min-width: 230px;
  max-width: 230px;
  flex: none;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  padding: 14px;
  background: var(--card);
  border: 1px solid rgba(16, 185, 129, 0.18);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  text-decoration: none !important;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeInUp 0.45s ease both;
}
.explore-card:active { transform: translateY(2px); }
.explore-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.explore-cat {
  font-size: 12px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  color: #065F46;
  border-radius: 999px;
  padding: 4px 8px;
  text-decoration: none !important;
}
.explore-score {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fef2f2;
  color: #b42318;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
}
.explore-score.score-green { background: rgba(16, 185, 129, 0.14); color: #059669; }
.explore-score.score-yellow { background: #fffbeb; color: #b45309; }
.explore-score.score-red { background: #fef2f2; color: #b42318; }
.search-results {
  overflow-y: auto;
  padding-bottom: 50vh;
  min-height: 0;
  flex: 1;
}
.explore-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin: 10px 0 6px 0;
  text-decoration: none !important;
}
.explore-foot { color: #64748b; font-size: 12px; text-decoration: none !important; }
.empty-card {
  width: 100%;
  border: 1.5px dashed #CBD5E1;
  border-radius: 16px;
  padding: 18px;
  background: rgba(16, 185, 129, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes heroGlow {
  50% { transform: translateY(8px); }
}
.tab-icon {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 4px;
  position: relative;
}
.tab-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 6px;
  height: 2px;
  background: currentColor;
}
.tab-icon.person { border-radius: 50%; }
.tab-icon.person::after {
  left: 3px;
  right: 3px;
  top: 10px;
  height: 6px;
  border-radius: 6px 6px 0 0;
  background: transparent;
  border: 2px solid currentColor;
  border-bottom: 0;
}

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 30; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  color: var(--text);
  border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  margin: 0 auto 6px;
}
.busy {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
}
.scan-loader {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}
:root[data-theme="dark"] .scan-loader { background: rgba(16, 20, 18, 0.72); color: #f3f6f4; }
.scan-loader.card {
  position: static;
  width: min(320px, calc(100% - 32px));
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.scan-loader p { margin: 0; font-weight: 700; }
.spin {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(31, 122, 77, 0.2);
  border-top-color: #1f7a4d;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.summary-card, .ingredient { overflow-wrap: anywhere; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.chip strong { color: var(--button); }
.chip.on { background: #e7f6ee; color: #085c38; border-color: transparent; }
.row-between { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.toggle { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.toggle input { width: 22px; height: 22px; }
.offer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg);
  border-radius: 18px;
  padding: 12px;
  text-decoration: none;
}
.offer header { display: flex; justify-content: space-between; gap: 8px; }
.alt-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  text-decoration: none;
}
.alt-thumb {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 1.3rem;
}
.alt-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.alt-name { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.alt-name strong { overflow-wrap: anywhere; }
.alt-score {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.14);
  color: var(--good);
  font-weight: 800;
  font-size: 0.8rem;
}
.alt-body em { color: var(--hint); font-style: normal; font-size: 0.8rem; overflow-wrap: anywhere; }
.alt-reason {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--hint);
  font-size: 0.82rem;
  line-height: 1.35;
}
.alt-copy {
  align-self: flex-start;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(16, 185, 129, 0.14);
  color: var(--good);
  font-weight: 700;
  font-size: 0.8rem;
}
.alt-buy {
  align-self: flex-start;
  margin-top: 2px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
}
.score-pill {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #e7f6ee;
  color: var(--good);
  flex: none;
}
.score-pill.warn { background: #fff4e8; color: var(--warn); }
.score-pill.bad { background: #fdecec; color: var(--bad); }
.tag {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  background: #e7f6ee;
  color: #085c38;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
}
.sheet { max-width: 100%; max-height: 88dvh; overflow: auto; }
.alt-skeleton {
  height: 76px;
  border-radius: 16px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 37%, #e2e8f0 63%);
  background-size: 400% 100%;
  animation: altShimmer 1.2s ease infinite;
}
@keyframes altShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sheet-head, .sheet-close { position: sticky; z-index: 10; background: var(--card); }
.sheet-head { top: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 8px; }
.sheet-close { bottom: 0; }
.shop-links { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-links a { font-size: 0.85rem; font-weight: 700; }
.verified-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: linear-gradient(90deg, #f8e7b0, #fff4cc);
  color: #6a4b00;
  border: 1px solid #e2c56a;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
}
.sponsor-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f8e7b0, #e7f6ee);
  color: #6a4b00;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
}
.admin-fab {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 20;
  background: #14372c;
  color: white;
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

#blazor-error-ui {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav) + 8px);
  z-index: 50;
  background: #3a1c1c;
  color: white;
  padding: 12px 14px;
  border-radius: 16px;
}
#blazor-error-ui a { color: white; margin-left: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
