:root {
  --bg: #f3f5f6;
  --text: #1f2a36;
  --muted: #6d7883;
  --green: linear-gradient(145deg, #0c9a6c, #17bb86);
  --purple: linear-gradient(135deg, #a83bdb, #f04f9f);
  --card: #fff;
  --radius: 18px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); }
a { color: #1ca97b; text-decoration: none; }
.mobile-app { max-width: 430px; margin: 0 auto; min-height: 100vh; padding-bottom: 92px; background: var(--bg); }
.view { outline: none; }
.screen { padding: 0 16px 24px; }
.hero { background: var(--green); margin: 0 -16px 14px; padding: 18px 16px 14px; color: #fff; border-bottom-left-radius: 24px; border-bottom-right-radius: 24px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.hero h1 { margin: 0; font-size: 2rem; }
.hero p { margin: 2px 0 0; opacity: .9; }
.profile-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.2); color: #fff; font-size: 1.1rem; }
.search-wrap { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.17); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 10px 14px; }
.search-wrap input, .search-inline input, .input { border: 0; background: transparent; width: 100%; color: inherit; font-size: 1rem; min-height: 24px; }
.search-wrap input::placeholder { color: rgba(255,255,255,.8); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card { border-radius: 14px; padding: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.07); }
.stat-card p { margin: 0; font-weight: 700; font-size: .8rem; text-align: right; }
.stat-card strong { font-size: 2rem; display: block; margin-top: 6px; }
.stat-card span { color: var(--muted); }
.mint { background: #dff4e9; }
.sand { background: #f9f2cf; }
.premium-banner { background: var(--purple); color: #fff; border-radius: var(--radius); padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.premium-banner h2 { margin: 0 0 4px; font-size: 1.4rem; }
.premium-banner p { margin: 0; font-size: .9rem; }
.btn { border: 0; min-height: 44px; padding: 10px 16px; border-radius: 999px; background: #e8eef3; color: var(--text); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn:focus-visible, .action-btn:focus-visible, .bottom-nav a:focus-visible, .input:focus-visible, .icon-btn:focus-visible, .overlay-icon-btn:focus-visible, .scan-promo:focus-visible, .metric-row:focus-visible { outline: 3px solid #1ca97b; outline-offset: 2px; }
.btn-primary { background: #0da775; color: #fff; }
.btn-danger { background: #ef5555; color: #fff; }
.link-btn { background: none; border: none; color: #0da775; text-decoration: underline; cursor: pointer; padding: 0; font: inherit; font-weight: 600; }
.btn-light { background: #fff; color: #8e2dc2; }
.actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 10px; }
.action-btn { border: 0; border-radius: 16px; min-height: 72px; color: #fff; font-size: 1.3rem; font-weight: 700; }
.action-btn.green { background: linear-gradient(135deg, #18a877, #1ec994); }
.action-btn.orange { background: linear-gradient(135deg, #f18b2e, #ffa63b); }
.list-head { display: flex; justify-content: space-between; align-items: baseline; }
.scan-list { display: grid; gap: 10px; }
.scan-item { background: var(--card); border-radius: 16px; box-shadow: 0 4px 14px rgba(0,0,0,.07); padding: 10px; display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: center; }
.thumb { width: 58px; height: 58px; border-radius: 12px; background: linear-gradient(155deg, #d8d7ff, #f0f0f0); }
.item-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.item-top h3, .scan-item h3 { margin: 0; font-size: 1rem; }
.details-link { font-weight: 700; }
.muted { color: var(--muted); margin: 2px 0; }
.rating-pill { border-radius: 999px; padding: 4px 10px; color: #fff; font-size: .82rem; font-weight: 700; }
.excellent, .good { background: #2dbb63; }
.ok { background: #39a878; }
.fair, .warn { background: #f7a51f; }
.poor { background: #ea4f4f; }
.sub-header { padding: 14px 0 6px; }
.sub-header h1 { margin: 0; }
.scan-page-header { display: grid; gap: 6px; padding: 12px 2px 10px; }
.scan-page-eyebrow,
.scanner-card-kicker,
.secondary-option-kicker {
  margin: 0;
  color: #6d7e8b;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0,0,0,.07); padding: 14px; margin-bottom: 12px; }
.search-inline { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 999px; padding: 10px 14px; margin-bottom: 10px; }
.input { width: 100%; border: 1px solid #d6dde3; border-radius: 12px; padding: 12px; min-height: 44px; margin-bottom: 8px; }
.camera-preview { width: 100%; border-radius: 12px; min-height: 180px; object-fit: cover; background: #000; margin: 8px 0; }

.camera-shell { position: relative; margin: 8px 0; border-radius: 14px; overflow: hidden; background: #000; }
.scan-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scan-card-head h2 { margin: 0; }
.scanner-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}
.scanner-card-header,
.secondary-scan-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.scanner-utility-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.scanner-card-header h2,
.secondary-scan-header h2,
.secondary-option-card h3 {
  margin: 2px 0 0;
}
.btn-quiet {
  background: #f1f5f8;
  color: #244153;
}

.icon-btn { border: 0; background: #e8eef3; color: #1f2a36; width: 30px; height: 30px; border-radius: 50%; font-weight: 700; cursor: pointer; }

.scan-diagnostics { background: #f3f5f6; border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.scan-diagnostics summary { cursor: pointer; font-weight: 700; }
.scan-diagnostics ul { margin: 8px 0 0; padding-left: 16px; display: grid; gap: 4px; font-size: .88rem; }

.scan-overlay { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; pointer-events: none; box-shadow: inset 0 0 0 999px rgba(0,0,0,.22); transition: box-shadow .18s ease, background .18s ease; }
.viewfinder-box { width: min(75%, 280px); aspect-ratio: 1.55; border: 2px solid rgba(35, 255, 173, .95); border-radius: 14px; position: relative; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.viewfinder-hint { margin: 0; color: #d8ffe8; font-weight: 700; font-size: .86rem; text-shadow: 0 2px 8px rgba(0,0,0,.45); text-align: center; padding: 0 12px; }
.capture-feedback { margin: 0; min-height: 1.25rem; color: #fff; font-weight: 800; letter-spacing: .01em; text-shadow: 0 2px 12px rgba(0,0,0,.5); text-align: center; padding: 0 12px; }
.camera-shell[data-scan-state="captured"] .scan-overlay,
.camera-shell[data-scan-state="processing"] .scan-overlay { background: rgba(11, 83, 57, .16); box-shadow: inset 0 0 0 999px rgba(3, 22, 16, .38); }
.camera-shell[data-scan-state="captured"] .viewfinder-box,
.camera-shell[data-scan-state="processing"] .viewfinder-box,
.camera-shell[data-scan-state="success"] .viewfinder-box { border-color: #fff1a6; box-shadow: 0 0 0 3px rgba(255, 241, 166, .22); transform: scale(.985); }
.camera-shell[data-scan-state="error"] .viewfinder-box { border-color: rgba(255, 166, 166, .95); box-shadow: 0 0 0 3px rgba(255, 166, 166, .18); }

.overlay-icon-btn {
  position: absolute;
  top: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  background: rgba(10, 18, 20, .75);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}
.overlay-icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.sound-btn { left: 10px; }
.torch-btn { right: 10px; }

.scan-promo {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,.5);
  color: #e6f7ef;
  font-size: .72rem;
  line-height: 1.3;
  padding: 6px 10px;
  cursor: pointer;
  z-index: 2;
}
.nutrition-hero { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; }
.nutrition-image { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; background: #eef2f5; }
.nutrition-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.recommendations-list { display: grid; gap: 8px; }
.recommendation-card { border: 1px solid #dbe3ea; border-radius: 12px; background: #fff; width: 100%; display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px; text-align: left; cursor: pointer; }
.recommendation-card img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #eef2f5; }
.recommendation-card h4 { margin: 0 0 4px; font-size: .95rem; }

.viewfinder-box::after { content: ''; position: absolute; left: 6px; right: 6px; top: 35%; height: 2px; background: rgba(35, 255, 173, .95); animation: scanline 1.6s ease-in-out infinite; }
.scan-status.live { color: #0da775; font-weight: 700; }
@keyframes scanline { 0% { transform: translateY(-35px); } 50% { transform: translateY(65px); } 100% { transform: translateY(-35px); } }
.hidden { display: none !important; }


.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker {
  display: grid;
  gap: 10px;
}

.file-picker-help {
  margin: 0;
}

.photo-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d6dde3;
  background: #eef2f5;
}

.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bottom-nav { position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); width: min(94%, 420px); background: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.16); border-radius: 30px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; padding: 8px; z-index: 30; }
.bottom-nav a { min-height: 44px; font-size: .8rem; display: flex; flex-direction: column; gap: 2px; align-items: center; justify-content: center; color: #7b8794; }
.bottom-nav a.active { color: #10a474; font-weight: 700; }
.scan-fab { margin-top: -24px; background: #1bac7c; color: #fff !important; border-radius: 999px; width: 66px; height: 66px; justify-self: center; box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.scan-fab span { font-size: .85rem; }
.toast-stack { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); width: min(92%, 400px); z-index: 60; display: grid; gap: 8px; }
.toast { background: #1d2b39; color: #fff; padding: 12px 14px; border-radius: 12px; opacity: 0; transform: translateY(-5px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #1a9f72; }
.modal-overlay { position: fixed; inset: 0; background: rgba(8,15,22,.48); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: 100%; max-width: 360px; background: #fff; border-radius: 16px; padding: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.intro-card .title-row { display: flex; gap: 10px; align-items: center; }
.app-icon { width: 40px; height: 40px; border-radius: 10px; background: #15a679; color: #fff; display: grid; place-items: center; }
.feature-rows, .tier-card ul, .integrations-card ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.feature-rows li { display: flex; gap: 10px; align-items: flex-start; }
.feature-rows p { margin: 0; color: var(--muted); }
.integrations-card { margin-top: 12px; background: linear-gradient(140deg, #12996d, #14b27d); color: #fff; padding: 12px; border-radius: 14px; }
.tier-card { border-radius: 12px; padding: 10px; margin-top: 10px; }
.tier-card.free { background: #f4f5f7; }
.tier-card.premium { background: #f8eefb; color: #703f8f; }
.tier-card.rating { background: #ecf8ef; }
.error { color: #cf3131; }
@media (min-width: 768px) { .mobile-app { max-width: 560px; } }

.history-item { grid-template-columns: 58px 1fr auto auto; cursor: pointer; }
.thumb-wrap { width: 58px; height: 58px; border-radius: 12px; overflow: hidden; background: linear-gradient(155deg, #d8d7ff, #f0f0f0); position: relative; flex-shrink: 0; border: 1px solid #d8e0e7; }
.thumb-wrap::after { content: '📦'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.2rem; opacity: .5; }
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
.history-content { min-width: 0; }
.history-title { margin: 0; font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
.history-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .86rem; line-height: 1.35; margin-top: 4px; }
.history-meta-sep { flex: 0 0 auto; }
.history-upc { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.history-upc code { font-size: .8rem; background: #edf2f6; border: 1px solid #d6dde3; border-radius: 6px; padding: 1px 5px; color: #2b3743; }
.history-score-inline { white-space: nowrap; display: inline-flex; align-items: center; }
.history-score-badge { border: 1px solid; border-radius: 999px; padding: 4px 8px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.history-star { width: 30px; height: 30px; display: grid; place-items: center; }

.sheet-overlay { position: fixed; inset: 0; background: rgba(7, 16, 25, .52); z-index: 70; display: grid; align-items: end; padding: 0; }
.sheet { background: #fff; border-top-left-radius: 18px; border-top-right-radius: 18px; max-height: 88vh; overflow: auto; padding: 14px 14px 18px; box-shadow: 0 -8px 28px rgba(0,0,0,.2); }
.history-detail-sheet { display: grid; gap: 12px; }
.history-detail-hero { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent), #fff 75%); background: color-mix(in srgb, var(--accent), #fff 92%); }
.history-detail-hero img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; background: #eef2f5; }
.history-detail-hero h3 { margin: 0 0 6px; }
.history-detail-score { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 1rem; }

.metric-head { font-size: .82rem; letter-spacing: .08em; margin: 6px 0; }
.metric-head.positive { color: #177c52; }
.metric-head.negative { color: #b14242; }
.metric-list { display: grid; gap: 8px; }
.metric-row {
  border: 1px solid #d9e2ea;
  background: #fff;
  border-radius: 12px;
  min-height: 52px;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: 'icon main' 'gauge gauge';
  align-items: center;
  column-gap: 8px;
  row-gap: 8px;
  padding: 10px;
  text-align: left;
}
.metric-row .metric-icon { grid-area: icon; }
.metric-row .metric-main { grid-area: main; display: grid; gap: 2px; }
.metric-row .metric-main strong { font-size: .95rem; }
.metric-row .metric-gauge { grid-area: gauge; height: 10px; border-radius: 999px; position: relative; }
.metric-pointer { position: absolute; top: -3px; width: 3px; height: 16px; background: #1f2a36; border-radius: 2px; transform: translateX(-50%); }
.metric-row.disabled { opacity: .55; }
.metric-row:disabled { cursor: not-allowed; }

.account-card {
  display: grid;
  gap: 8px;
}

.account-detail-grid,
.account-session-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #f6f8fb;
}

.account-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .95rem;
}

.account-detail-row span {
  color: #5f6f82;
}

.account-session-box p {
  margin: 0;
  font-size: .92rem;
}

.account-footer {
  margin-top: 12px;
  text-align: center;
  font-size: .86rem;
}

.manual-panel {
  display: grid;
  gap: 8px;
}

.clamp-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.recent-summary::-webkit-details-marker {
  display: none;
}

.recent-scans-head .inline-actions {
  width: 100%;
}

.recent-scan-item p {
  margin: 0;
}
.recent-scans-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.recent-scans-head h2 {
  margin: 0;
}

.recent-scans-list {
  display: grid;
  gap: 8px;
}

.recent-scan-item {
  width: 100%;
  border: 1px solid #d9e2ea;
  border-radius: 12px;
  background: #fff;
  min-height: 64px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
}

button.recent-scan-item {
  cursor: pointer;
}

.recent-main {
  min-width: 0;
}

.recent-main h3 {
  margin: 0;
  font-size: .96rem;
}

.recent-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.recent-chip {
  border-radius: 999px;
  font-size: .72rem;
  padding: 3px 8px;
  border: 1px solid transparent;
}

.recent-chip.score {
  background: #eef2f6;
  color: #2f465d;
}

.recent-chip.positive {
  background: #e8f8ef;
  color: #177c52;
}

.recent-chip.negative {
  background: #ffeaea;
  color: #b14242;
}
.pantry-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:10px; }
.pantry-item { min-height: 140px; }
.badge-expiring { background:#ffe5e5; color:#b12222; padding:3px 8px; border-radius:999px; font-size:12px; }
.progress-step { display:flex; align-items:center; gap:8px; }
.progress-step.active span { animation:pulse 1s infinite; }
.progress-step.done { color:#0f8f4f; }
.progress-step.error { color:#b12222; }
@keyframes pulse { 0%{opacity:.4}50%{opacity:1}100%{opacity:.4} }
@media (prefers-reduced-motion: reduce) { .progress-step.active span { animation:none; } }


.score-badge[data-score-variant="compact"] { padding: 4px 9px; font-size: .78rem; }
.score-badge[data-score-variant="tenScale"] { background: #3c6fe8; }
.score-demo-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 10px; }
.history-group { display: grid; gap: 8px; }
.history-group-title { margin: 8px 2px 2px; font-size: .88rem; letter-spacing: .04em; text-transform: uppercase; color: #5a6774; }
.skeleton-card { pointer-events: none; border: 1px solid #e5ebf0; }
.skeleton-media { width: 64px; height: 64px; border-radius: 8px; background: linear-gradient(90deg,#eef2f6,#f7f9fb,#eef2f6); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-lines { display: grid; gap: 6px; width: 100%; }
.skeleton-lines span { display:block; height: 10px; border-radius: 6px; background: linear-gradient(90deg,#eef2f6,#f7f9fb,#eef2f6); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-lines span:first-child { width: 75%; }
.skeleton-lines span:last-child { width: 52%; }
@keyframes shimmer { 0% { background-position: 180% 0; } 100% { background-position: -20% 0; } }

.history-alt-preview .item-top { align-items: flex-start; }
#view-all-alts { min-height: 44px; }
.alt-preview-list { display: grid; gap: 8px; }
.alt-preview-item {
  width: 100%;
  border: 1px solid #dce4eb;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  min-height: 44px;
}
.alt-preview-item h4 { margin: 0; font-size: .94rem; }
.alt-preview-body { min-width: 0; }
.alt-preview-body .muted { margin: 2px 0; font-size: .82rem; }

.history-detail-sheet .detail-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 6px;
}
.history-detail-sheet .detail-tabs .btn {
  min-height: 44px;
  border-radius: 10px;
  padding: 8px 6px;
  font-size: .82rem;
}
.history-detail-sheet .detail-tabs .btn.active {
  background: #0da775;
  color: #fff;
}
.history-scale { margin: 0; padding: 10px; }
.scale-bar { height: 10px; border-radius: 999px; overflow: hidden; display: flex; background: #edf2f6; }
.scale-positive { background: linear-gradient(90deg,#2dbb63,#20a85a); }
.scale-negative { background: linear-gradient(90deg,#f7c64b,#ea4f4f); }
.scale-meta { margin-top: 8px; display: grid; gap: 3px; font-size: .84rem; }
.breakdown-list { display: grid; gap: 8px; }
.breakdown-item { border: 1px solid #dce4eb; border-radius: 12px; padding: 10px; background: #fff; }
.breakdown-item.positive { border-color: #cdeedb; }
.breakdown-item.negative { border-color: #f5d3d3; }
.breakdown-item h5 { margin: 0 0 6px; display: flex; justify-content: space-between; gap: 8px; }
.breakdown-item p { margin: 4px 0; font-size: .88rem; }
.nutrition-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

.history-item { position: relative; }
.history-select-check { position: absolute; top: 8px; right: 8px; z-index: 2; }
.history-select-check input { width: 18px; height: 18px; accent-color: #0da775; }
.history-meal-cta {
  position: sticky;
  bottom: 80px;
  z-index: 25;
  display: grid;
  padding: 8px 0;
}
.history-meal-cta .btn { min-height: 44px; width: 100%; }
.meal-card h3 { margin: 0 0 6px; }

.upgrade-screen {
  display: grid;
  gap: 14px;
  padding-bottom: 120px;
}

.upgrade-hero {
  background: linear-gradient(145deg, #08243a, #0f8d78);
  margin: 0 -16px;
  padding: 24px 16px;
  color: #fff;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  box-shadow: 0 10px 26px rgba(10, 55, 83, .28);
}

.upgrade-eyebrow {
  margin: 0 0 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .74rem;
  opacity: .9;
}

.upgrade-hero h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.upgrade-subheadline {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .92);
  font-size: .97rem;
  line-height: 1.45;
}

.upgrade-cta-row {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.upgrade-secondary-btn {
  background: #eef4f8;
  color: #264258;
}

.upgrade-trust {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .9);
  font-size: .86rem;
}

.upgrade-section {
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 36, 53, .08);
}

.upgrade-section h2 {
  margin: 0;
  font-size: 1.15rem;
}

.upgrade-why-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.upgrade-why-list li {
  background: #f3f9fd;
  border: 1px solid #dbeaf5;
  border-radius: 14px;
  padding: 12px;
}

.upgrade-why-list h3 {
  margin: 0;
  font-size: 1rem;
}

.upgrade-why-list p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.upgrade-pricing-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.upgrade-plan-card {
  border: 1px solid #d9e4ee;
  background: #f8fbfe;
  border-radius: 16px;
  padding: 12px;
}

.upgrade-plan-name {
  margin: 0;
  font-weight: 700;
}

.upgrade-plan-price {
  margin: 6px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.upgrade-plan-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #2c3b49;
}

.premium-monthly {
  background: #f4efff;
  border-color: #d8c9ff;
}

.premium-yearly {
  position: relative;
  background: linear-gradient(152deg, #ffffff, #edf9f6);
  border: 2px solid #0fa177;
  box-shadow: 0 12px 24px rgba(15, 150, 110, .2);
}

.upgrade-best-value {
  display: inline-block;
  margin: 0 0 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #0fa177;
  color: #fff;
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.comparison-section p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.upgrade-faq-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.upgrade-faq-list details {
  border: 1px solid #dde6ee;
  border-radius: 12px;
  background: #fafcfe;
  padding: 10px 12px;
}

.upgrade-faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.upgrade-faq-list p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.upgrade-sticky-cta {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 88px;
  width: min(92%, 390px);
  background: rgba(255, 255, 255, .96);
  border: 1px solid #dce5ed;
  border-radius: 16px;
  padding: 10px;
  display: grid;
  gap: 8px;
  box-shadow: 0 14px 26px rgba(14, 30, 45, .16);
  z-index: 20;
}

.premium-home-tray {
  background: linear-gradient(145deg, #4f1aa8, #8b2dc5 58%, #2f9f83);
  align-items: stretch;
}

.premium-home-tray .premium-label {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  opacity: .88;
}

.premium-home-tray h2 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.premium-home-actions {
  display: grid;
  align-content: center;
  gap: 6px;
  justify-items: end;
}

.premium-price-note {
  margin: 0;
  font-size: .74rem;
  opacity: .88;
}

.premium-tools-tray summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.premium-tools-tray summary::-webkit-details-marker {
  display: none;
}

.premium-tools-tray h3 { margin: 2px 0 0; }

.premium-surface-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.premium-surface-kicker {
  margin: 0 0 6px;
  color: #6b43aa;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.premium-surface-copy {
  max-width: 42ch;
}

.premium-tools-header {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.premium-tools-kicker {
  margin: 0;
}

.premium-tool-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.premium-tool-grid.compact {
  margin-bottom: 4px;
}

.premium-tool-card {
  width: 100%;
  border: 1px solid #dddff4;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fbfcff);
  padding: 12px;
  display: grid;
  gap: 4px;
  text-align: left;
  box-shadow: 0 8px 20px rgba(40, 57, 87, .06);
}

button.premium-tool-card {
  cursor: pointer;
}

.premium-tool-card strong {
  font-size: 1rem;
}

.premium-tool-card.is-locked {
  border-style: dashed;
  opacity: .82;
}

.premium-tool-pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #efe6ff;
  color: #6b43aa;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.premium-tool-cta {
  color: #4e2f8d;
  font-size: .84rem;
  font-weight: 700;
}

.premium-search-card .input {
  margin: 4px 0 0;
}

.premium-search-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
}

.premium-action-row .btn,
.premium-search-input-wrap .btn,
.pantry-review-actions .btn {
  min-height: 42px;
}

.premium-search-recent {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.premium-search-chip {
  border: 1px solid #d9e2ea;
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
  font-size: .82rem;
}

.premium-results-shell {
  min-height: 180px;
  border: 1px solid #e5ebf0;
  border-radius: 18px;
  background: linear-gradient(180deg, #fcfdff, #f7fafc);
  padding: 12px;
  display: grid;
  gap: 12px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.premium-results-shell.is-loading {
  border-color: #cfe0ff;
  box-shadow: inset 0 0 0 1px rgba(60, 111, 232, .08);
}

.premium-results-shell.is-success {
  border-color: #cdebd9;
}

.premium-results-shell.is-warning,
.premium-results-shell.is-locked {
  border-color: #f3dfb0;
}

.premium-results-shell.is-error {
  border-color: #f1c3c3;
}

.premium-results-shell.is-empty {
  border-color: #dbe5ec;
}

.premium-results-status {
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.secondary-scan-card {
  display: grid;
  gap: 12px;
}

.secondary-option-grid {
  display: grid;
  gap: 10px;
}

.secondary-option-card {
  border: 1px solid #e5ebf0;
  border-radius: 18px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
}
.manual-shortcut-card .btn,
.scanner-utility-row .btn {
  min-height: 40px;
}

.secondary-option-card summary span {
  text-align: right;
  max-width: 22ch;
}

.secondary-option-copy {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.scan-help-card summary {
  cursor: pointer;
  font-weight: 700;
}

.premium-tools-tray .premium-results-shell {
  margin-top: 10px;
}

.premium-results-status h4 {
  margin: 0 0 4px;
}

.premium-results-eyebrow {
  margin: 0 0 4px;
  color: #6d7e8b;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.premium-results-list {
  align-content: start;
}

.premium-empty-card,
.premium-analysis-card,
.premium-result-card {
  border: 1px solid #dde6ee;
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .05);
}

.premium-empty-title,
.premium-analysis-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.premium-trust-note {
  margin: 0;
  color: #5c6772;
  font-size: .82rem;
  line-height: 1.45;
}

.premium-result-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  align-items: center;
}

.premium-result-card.primary {
  border-color: #cfe0ff;
  box-shadow: 0 10px 24px rgba(60, 111, 232, .08);
}

.premium-search-result-card mark {
  background: #fff1a8;
  color: inherit;
  padding: 0 2px;
  border-radius: 4px;
}

.premium-result-kicker {
  margin: 0 0 6px;
  color: #6b43aa;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.premium-result-card h3 {
  margin: 0 0 4px;
}

.premium-match-chip {
  justify-self: start;
  margin-top: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .76rem;
  font-weight: 700;
  background: #eef3f8;
  color: #375166;
}

.premium-match-chip.high {
  background: #e5f7ed;
  color: #177d4d;
}

.premium-match-chip.likely {
  background: #eef4ff;
  color: #315ab8;
}

.premium-match-chip.possible,
.premium-match-chip.none {
  background: #fff3dc;
  color: #8b641a;
}

.premium-result-thumb-placeholder {
  opacity: .55;
}

.ingredient-sections,
.ingredient-callout-grid {
  display: grid;
  gap: 10px;
}

.ingredient-list-card {
  grid-column: 1 / -1;
}

.ingredient-callout {
  border: 1px solid #dde6ee;
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.ingredient-callout.warning {
  border-color: #f2d79b;
  background: #fffaf0;
}

.ingredient-callout.info {
  border-color: #d7e4ff;
  background: #f7faff;
}

.premium-lock-box .btn,
.premium-results-list .btn,
.offline-mode-card .btn {
  min-height: 42px;
}

@media (min-width: 720px) {
  .secondary-option-grid {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    align-items: start;
  }

  .premium-tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .premium-action-row {
    flex-wrap: nowrap;
  }

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

.offline-badge {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  background: #0f2738;
  color: #dff7ea;
  border: 1px solid #2d5d74;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .78rem;
  box-shadow: 0 8px 18px rgba(10,20,30,.2);
}

.offline-mode-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.offline-scope-card {
  border: 1px solid #dfe6ee;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #fbfdff, #f5f9fc);
  display: grid;
  gap: 8px;
}

.offline-scope-title {
  margin: 0;
  font-weight: 700;
  font-size: .95rem;
}

.offline-scope-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.offline-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
}

.offline-status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.offline-toggle-row input {
  width: 40px;
  height: 22px;
}

.offline-mode-card progress {
  width: 100%;
  height: 8px;
}

.premium-lock-box {
  border: 1px solid #e3d9ff;
  background: linear-gradient(140deg, #faf6ff, #f3f0ff);
  border-radius: 14px;
  padding: 12px;
}

.pantry-import-card h2 {
  margin-top: 0;
}

.pantry-review-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.pantry-review-head,
.pantry-review-item-head,
.pantry-review-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.pantry-review-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.pantry-review-item {
  border: 1px solid #dfe6ee;
  display: grid;
  gap: 10px;
}

.pantry-review-item.high {
  border-color: #cdebd9;
}

.pantry-review-item.medium {
  border-color: #f3dfb0;
}

.pantry-review-item.low,
.pantry-review-item.unknown {
  border-color: #f0c8c8;
}

.pantry-review-item h4 {
  margin: 0;
}

.pantry-review-fields {
  display: grid;
  gap: 8px;
}

@media (min-width: 720px) {
  .pantry-review-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pantry-item-open {
  width: 100%;
  text-align: left;
  background: #fff;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}

.score-chip {
  border: 1px solid #dbe6ef;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-chip span {
  font-weight: 700;
  font-size: 1.1rem;
}

.latest-scan-card {
  display: grid;
  gap: 12px;
}

.latest-scan-card.warning {
  border-left: 4px solid #f7a51f;
  padding-left: 10px;
}

.latest-scan-card.error {
  border-left: 4px solid #cf3131;
  padding-left: 10px;
}

.latest-scan-card.partial {
  border-left: 4px solid #3c6fe8;
  padding-left: 10px;
}

.latest-scan-head h3,
.latest-scan-kicker {
  margin: 0;
}

.latest-scan-kicker {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #0da775;
}

.latest-scan-body {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
}

.latest-scan-thumb {
  width: 72px;
  height: 72px;
}

.latest-scan-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.latest-scan-meta {
  min-width: 0;
}

.latest-scan-meta p {
  margin: 0 0 6px;
}

.latest-scan-actions {
  align-items: center;
  justify-content: space-between;
}

.ai-lookup-panel { display: grid; gap: 10px; margin-top: 14px; }


.score-systems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.score-systems.compact { grid-template-columns: 1fr; margin-top: 0; }
.score-system-card { border: 1px solid #dde6ea; border-radius: 16px; padding: 12px; background: linear-gradient(180deg, #fff, #f8fbfc); display: grid; gap: 6px; }
.score-system-card.official { border-color: color-mix(in srgb, #3c6fe8, #fff 72%); }
.score-system-card.pantry { border-color: color-mix(in srgb, var(--green), #fff 70%); }
.score-system-label { margin: 0; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: #30414f; font-weight: 800; }
.score-system-caption { margin: 0; font-size: .82rem; }
.score-system-value { font-weight: 700; font-size: .95rem; }
.score-systems-copy { grid-column: 1 / -1; margin: 0; }
.score-systems-details { grid-column: 1 / -1; border-top: 1px solid #e2e8ec; padding-top: 8px; }
.score-systems-details summary { cursor: pointer; font-weight: 700; color: #1f2a36; }
.score-systems-details p { margin: 8px 0 0; }
.latest-scan-head { align-items: start; }
.latest-scan-head .score-systems { min-width: 220px; }
.latest-scan-head .score-system-card { padding: 10px; }
.latest-scan-head .score-systems-copy, .latest-scan-head .score-systems-details { display: none; }
@media (max-width: 720px) { .score-systems { grid-template-columns: 1fr; } .latest-scan-head .score-systems { width: 100%; } }
