:root {
  color-scheme: dark;
  --bg: #090909;
  --surface: #121212;
  --surface-2: #191919;
  --line: rgba(255,255,255,.1);
  --text: #f8f5ef;
  --muted: #aaa49b;
  --accent: #ff9d32;
  --accent-light: #ffbf67;
  --success: #67c58f;
  --danger: #ff7b70;
  --warning: #ffd166;
  --radius: 26px;
  --shadow: 0 24px 70px rgba(0,0,0,.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; overflow-x: hidden; background: #090909; scrollbar-color: var(--accent) #0d0d0d; scrollbar-width: thin; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { width: 12px; height: 12px; }
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track, *::-webkit-scrollbar-track { background: #0d0d0d; }
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb, *::-webkit-scrollbar-thumb { border: 3px solid #0d0d0d; border-radius: 999px; background: linear-gradient(180deg,var(--accent-light),var(--accent)); }
body { min-width: 0; min-height: 100vh; min-height: 100dvh; margin: 0; overflow-x: hidden; overscroll-behavior-x: none; color: var(--text); background: radial-gradient(circle at 8% 4%,rgba(255,126,24,.18),transparent 36rem),radial-gradient(circle at 88% 92%,rgba(255,187,79,.08),transparent 34rem),var(--bg); }
body::before { position: fixed; inset: 0; z-index: -1; content: ""; opacity: .13; background-image: radial-gradient(circle,#fff 0 1px,transparent 1.2px); background-size: 38px 38px; mask-image: linear-gradient(to top,#000,transparent 78%); animation: drift 18s linear infinite; }
button, input, select { font: inherit; }
button, a, input, select, label { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 80; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: #111; translate: 0 -160%; }
.skip-link:focus { translate: 0; }
.offline-banner { position: relative; z-index: 15; padding: 10px 20px; background: #37280d; color: #ffe5a0; text-align: center; font-size: .82rem; font-weight: 700; }
.site-header { position: sticky; top: 0; z-index: 20; isolation: isolate; display: flex; min-height: 76px; overflow: hidden; align-items: center; justify-content: space-between; padding: max(14px,env(safe-area-inset-top)) max(22px,env(safe-area-inset-right)) 14px max(22px,env(safe-area-inset-left)); border-bottom: 0; background: linear-gradient(180deg,rgba(9,9,9,.96) 0%,rgba(9,9,9,.58) 48%,rgba(9,9,9,0) 100%); backdrop-filter: none; transition: background 280ms ease; }
.site-header.is-condensed { background: linear-gradient(180deg,rgba(9,9,9,.98) 0%,rgba(9,9,9,.68) 54%,rgba(9,9,9,0) 100%); }
.brand { display: inline-flex; min-width: 0; column-gap: 11px; align-items: center; font-weight: 780; letter-spacing: -.02em; text-decoration: none; transition: column-gap 300ms cubic-bezier(.2,.8,.2,1); }
.brand > span { position: relative; z-index: 1; display: inline-block; overflow: hidden; max-width: 92px; opacity: 1; white-space: nowrap; transform: translateX(0) scaleX(1); transform-origin: left center; transition: max-width 300ms cubic-bezier(.2,.8,.2,1),opacity 180ms ease,transform 300ms cubic-bezier(.2,.8,.2,1); }
.site-header.is-condensed .brand { column-gap: 0; }
.site-header.is-condensed .brand > span { max-width: 0; opacity: 0; transform: translateX(-30px) scaleX(.72); }
.brand-logo { position: relative; z-index: 2; width: 46px; height: 46px; flex: 0 0 auto; background: transparent; filter: none; }
.desktop-nav { position: absolute; left: 50%; display: flex; min-width: 0; gap: 4px; align-items: center; translate: -50% 0; }
.desktop-nav a { display: inline-flex; gap: 7px; align-items: center; padding: 9px 11px; border: 1px solid transparent; border-radius: 12px; color: var(--muted); font-size: .8rem; font-weight: 720; text-decoration: none; white-space: nowrap; }
.desktop-nav a:hover, .desktop-nav a[aria-current="page"] { border-color: var(--line); background: var(--surface-2); color: var(--text); }
.desktop-nav img { width: 19px; height: 19px; flex: 0 0 auto; object-fit: contain; opacity: .86; }
.desktop-nav a[aria-current="page"] img { opacity: 1; }
#menu-button { display: none; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.header-button, .icon-button { border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; }
.header-button { min-height: 44px; padding: 0 16px; border-radius: 14px; font-weight: 760; }
.icon-button { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 14px; font-size: 1.5rem; }
.header-button:hover, .icon-button:hover { border-color: rgba(255,157,50,.5); background: rgba(255,157,50,.08); }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; content: ""; }
.menu-icon::before { translate: 0 -6px; }
.menu-icon::after { translate: 0 4px; }
.nav-drawer { position: fixed; top: 0; right: 0; z-index: 50; width: min(360px,88vw); height: 100dvh; padding: max(22px,env(safe-area-inset-top)) 22px max(22px,env(safe-area-inset-bottom)); border-left: 1px solid var(--line); background: #111; box-shadow: -30px 0 80px rgba(0,0,0,.5); visibility: hidden; opacity: 0; pointer-events: none; transition: opacity 180ms ease,visibility 0s linear 180ms; }
.nav-drawer.open { visibility: visible; opacity: 1; pointer-events: auto; transition-delay: 0s; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 34px; }
.nav-links { display: grid; gap: 10px; }
.nav-links a { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid transparent; border-radius: 15px; color: var(--muted); text-decoration: none; }
.nav-icon { width: 23px; height: 23px; flex: 0 0 auto; object-fit: contain; opacity: .82; }
.nav-links a[aria-current="page"] .nav-icon { opacity: 1; }
.nav-links a:hover { border-color: var(--line); background: var(--surface-2); color: var(--text); }
.scrim { position: fixed; inset: 0; z-index: 40; border: 0; background: rgba(0,0,0,.56); backdrop-filter: blur(4px); }

.page-shell { width: min(1320px,calc(100% - 40px)); min-width: 0; margin: 0 auto; padding: clamp(42px,6vw,80px) 0 max(110px,env(safe-area-inset-bottom)); }
.hero { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(280px,.7fr); gap: clamp(32px,7vw,100px); align-items: end; margin-bottom: clamp(30px,5vw,56px); }
.eyebrow { margin: 0 0 10px; color: var(--accent-light); font-size: .73rem; font-weight: 820; letter-spacing: .17em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(3rem,7.3vw,6.4rem); line-height: .94; letter-spacing: -.065em; }
.hero > p { margin: 0 0 6px; color: var(--muted); font-size: clamp(1rem,1.7vw,1.22rem); line-height: 1.65; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17,17,17,.92); box-shadow: var(--shadow); }

.scanner-entry-layout { position: relative; display: grid; grid-template-columns: minmax(0,680px) minmax(280px,360px); gap: 20px; width: min(1060px,100%); margin-inline: auto; align-items: stretch; }
.scanner-page-heading { width: min(1060px,100%); margin: 0 auto 22px; }
.scanner-page-heading .eyebrow { margin-bottom: 8px; }
.scanner-page-title { width: 100%; margin: 0; font-size: clamp(2.35rem,4.5vw,4.3rem); line-height: .96; letter-spacing: -.055em; }
.scanner-entry-main { min-width: 0; }
.scanner-panel { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(360px,.8fr); min-width: 0; overflow: hidden; }
.scanner-panel:not(:has(.camera-stage.active)) { width: min(680px,100%); grid-template-columns: 1fr; margin-inline: auto; }
.scanner-panel:not(:has(.camera-stage.active)) .camera-stage { display: none; }
.scanner-panel:not(:has(.camera-stage.active)) .scanner-controls { border-left: 0; }
.scanner-panel:not(:has(.camera-stage.active)) .scanner-controls { min-height: 210px; justify-content: center; }
.scanner-panel:not(:has(.camera-stage.active)) .primary-actions { width: min(100%,360px); margin-inline: auto; }
.scanner-panel:not(:has(.camera-stage.active)) .primary-actions { grid-template-columns: 1fr; }
.scanner-panel:not(:has(.camera-stage.active)) .primary-button { min-height: 64px; }
.camera-stage { position: relative; min-width: 0; min-height: 540px; overflow: hidden; background: radial-gradient(circle at 50% 45%,#242424,#0b0b0b 70%); }
.camera-stage video { width: 100%; height: 100%; min-height: inherit; object-fit: cover; opacity: 0; transition: opacity 180ms ease; }
.camera-stage.active video { opacity: 1; }
.camera-empty { position: absolute; inset: 0; display: grid; max-width: 320px; margin: auto; place-content: center; justify-items: center; padding: 30px; color: var(--muted); text-align: center; }
.camera-empty img { width: 78px; height: 78px; margin-bottom: 18px; opacity: .74; filter: grayscale(.3); }
.camera-empty strong { margin-bottom: 8px; color: var(--text); font-size: 1.18rem; }
.camera-empty span { line-height: 1.5; }
.camera-stage.active .camera-empty { display: none; }
.scan-frame { position: absolute; top: 50%; left: 50%; width: min(72%,540px); height: min(34%,190px); translate: -50% -50%; border: 2px solid rgba(255,191,103,.75); border-radius: 20px; box-shadow: 0 0 0 999px rgba(0,0,0,.23),0 0 34px rgba(255,157,50,.18); pointer-events: none; }
.scan-frame::before, .scan-frame::after { position: absolute; width: 34px; height: 34px; border-color: var(--accent); content: ""; }
.scan-frame::before { top: -3px; left: -3px; border-top: 5px solid var(--accent); border-left: 5px solid var(--accent); border-radius: 17px 0 0; }
.scan-frame::after { right: -3px; bottom: -3px; border-right: 5px solid var(--accent); border-bottom: 5px solid var(--accent); border-radius: 0 0 17px; }
.scan-frame span { position: absolute; top: 12px; right: 8px; left: 8px; height: 2px; border-radius: 2px; background: linear-gradient(90deg,transparent,var(--accent-light),transparent); box-shadow: 0 0 12px var(--accent); animation: scan 2.2s ease-in-out infinite alternate; }
.camera-stage:not(.active) .scan-frame span { animation-play-state: paused; opacity: .32; }
.local-chip { position: absolute; top: 16px; left: 16px; display: inline-flex; gap: 8px; align-items: center; padding: 9px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(8,8,8,.72); font-size: .74rem; font-weight: 760; backdrop-filter: blur(12px); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px rgba(103,197,143,.65); }
.scanner-controls { display: flex; min-width: 0; flex-direction: column; padding: clamp(24px,4vw,42px); border-left: 1px solid var(--line); }
.scanner-controls h1 { margin: 0 0 28px; font-size: clamp(2rem,4vw,3.6rem); line-height: 1; letter-spacing: -.05em; }
.scanner-heading { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; }
.scanner-heading h2 { margin-bottom: 0; font-size: clamp(1.7rem,3vw,2.6rem); letter-spacing: -.045em; }
.format-note, .basis-chip { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .67rem; font-weight: 760; }
.scanner-status { min-height: 68px; margin: 24px 0; padding: 15px 16px; border: 1px solid var(--line); border-radius: 15px; background: #0d0d0d; color: var(--muted); line-height: 1.45; }
.scanner-status[data-state="active"] { border-color: rgba(103,197,143,.34); color: var(--success); }
.scanner-status[data-state="success"] { border-color: rgba(103,197,143,.34); color: var(--success); }
.scanner-status[data-state="warning"] { border-color: rgba(255,209,102,.34); color: var(--warning); }
.scanner-status[data-state="error"] { border-color: rgba(255,123,112,.34); color: var(--danger); }
.primary-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; padding: 0 20px; border-radius: 14px; font-weight: 820; text-decoration: none; cursor: pointer; }
.primary-button { border: 0; background: linear-gradient(135deg,var(--accent-light),var(--accent)); color: #17100a; }
.secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.danger-button { border: 1px solid rgba(255,123,112,.32); background: rgba(255,123,112,.08); color: var(--danger); }
.primary-button:hover { filter: brightness(1.07); }
.secondary-button:hover { border-color: rgba(255,157,50,.46); background: rgba(255,157,50,.07); }
.primary-actions > :only-child { grid-column: 1 / -1; }
.scanner-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.switch-row { display: flex; min-width: 0; gap: 12px; align-items: center; justify-content: space-between; padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
.switch-row strong, .switch-row small { display: block; }
.switch-row small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.switch-row input { width: 24px; height: 24px; flex: 0 0 auto; accent-color: var(--accent); }
.permission-note { margin-top: auto; padding-top: 24px; color: var(--muted); font-size: .79rem; line-height: 1.5; }
.permission-note strong { color: var(--text); }
.permission-note p { margin: 5px 0 0; }

.manual-section { display: flex; width: min(680px,100%); min-height: 200px; align-items: center; margin: 20px auto 0; padding: clamp(24px,4vw,38px); }
.mobile-handoff { position: absolute; inset: 0; grid-column: 2; display: flex; min-height: 0; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: 32px 28px; text-align: center; }
.mobile-handoff .eyebrow { margin-bottom: 10px; }
.mobile-handoff h2 { margin: 0 0 12px; font-size: clamp(1.65rem,2.4vw,2.25rem); line-height: 1.02; letter-spacing: -.04em; }
.mobile-handoff > p:not(.eyebrow) { max-width: 300px; margin: 0 0 24px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.mobile-handoff img { display: block; width: 170px; height: 170px; max-width: 100%; flex: 0 0 auto; margin-inline: auto; border-radius: 18px; background: var(--accent); object-fit: contain; }
.manual-form { display: grid; grid-template-columns: minmax(180px,1fr) auto; gap: 10px; align-items: end; }
.manual-form { width: 100%; }
.manual-form .primary-button { min-width: 132px; }
.manual-form .primary-button { align-self: start; margin-top: 24px; }
.manual-form .search-icon-button { width: 64px; min-width: 64px; padding: 0; }
.search-icon-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; }
.detected-format { display: block; min-height: 18px; margin: 7px 2px 0; color: var(--muted); font-size: .74rem; }
label > span { display: block; margin-bottom: 7px; font-size: .79rem; font-weight: 760; }
input, select { width: 100%; min-width: 0; min-height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; outline: 0; background: #0d0d0d; color: var(--text); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(255,157,50,.3); outline-offset: 2px; border-color: var(--accent); }

.result-section { min-width: 0; margin-top: clamp(52px,8vw,100px); scroll-margin-top: 92px; }
.result-skeleton { display: grid; grid-template-columns: 240px 1fr; gap: 40px; padding: 32px; }
.skeleton { display: block; border-radius: 15px; background: linear-gradient(100deg,#191919 25%,#242424 42%,#191919 60%); background-size: 300% 100%; animation: skeleton 1.25s infinite linear; }
.skeleton-image { aspect-ratio: 1; border-radius: 22px; }
.skeleton-line { width: 72%; height: 24px; margin: 22px 0; }
.skeleton-line.wide { width: 92%; height: 54px; }
.skeleton-line.short { width: 46%; }
.empty-result { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: clamp(25px,5vw,48px); }
.empty-result > img { width: 78px; height: 78px; }
.empty-result h2 { margin-bottom: 10px; }
.empty-result p:not(.eyebrow) { color: var(--muted); }
.product-hero { display: grid; grid-template-columns: minmax(280px,.7fr) minmax(0,1.3fr); min-width: 0; overflow: hidden; }
.product-hero.no-image { grid-template-columns: 1fr; }
.product-hero.no-image .product-intro { border-left: 0; }
.product-image-wrap { display: grid; min-height: 500px; place-items: center; padding: 34px; background: radial-gradient(circle at 50% 38%,#262626,#0e0e0e 72%); }
.product-image-wrap > img { width: min(100%,440px); height: 440px; max-width: 100%; border-radius: 18px; object-fit: contain; filter: drop-shadow(0 24px 28px rgba(0,0,0,.36)); }
.image-placeholder { display: grid; justify-items: center; color: var(--muted); text-align: center; }
.image-placeholder img { width: 88px; margin-bottom: 16px; opacity: .54; filter: grayscale(.6); }
.product-intro { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: clamp(30px,6vw,74px); border-left: 1px solid var(--line); }
.product-intro h2 { overflow-wrap: anywhere; margin-bottom: 10px; font-size: clamp(2.2rem,5vw,5rem); line-height: .98; letter-spacing: -.058em; }
.product-brand { margin-bottom: 12px; color: var(--accent-light); font-size: 1.15rem; font-weight: 760; }
.product-source-summary { width: fit-content; margin: 0 0 24px; padding: 7px 10px; border: 1px solid rgba(255,157,50,.24); border-radius: 999px; background: rgba(255,157,50,.07); color: #c7b8a6; font-size: .76rem; font-weight: 720; line-height: 1.35; }
.product-facts { display: flex; gap: 28px; flex-wrap: wrap; margin: 0 0 22px; }
.product-facts div { min-width: 140px; }
.product-facts dt { margin-bottom: 5px; color: var(--muted); font-size: .7rem; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
.product-facts dd { margin: 0; font-weight: 760; }
.retailer-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.retailer-badge { padding: 8px 11px; border: 1px solid rgba(255,157,50,.3); border-radius: 999px; background: rgba(255,157,50,.08); font-size: .76rem; font-weight: 760; }
.subtle-note { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.product-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.product-actions .primary-button[aria-pressed="true"] { background: rgba(103,197,143,.16); color: var(--success); outline: 1px solid rgba(103,197,143,.34); }
.offline-product-note { margin: 12px 0 0; padding: 13px 16px; border: 1px solid rgba(255,209,102,.3); border-radius: 14px; background: rgba(255,209,102,.07); color: var(--warning); }
.score-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 20px 0; }
.score-card { display: flex; min-height: 132px; align-items: center; justify-content: space-between; padding: 22px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); }
.score-label { color: var(--muted); font-size: .79rem; font-weight: 740; }
.score-value { display: grid; width: 62px; height: 62px; place-items: center; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); font-size: 1.7rem; }
.grade-a .score-value { background: #2d7c48; } .grade-b .score-value { background: #70a945; } .grade-c .score-value { background: #c2a933; color: #17130a; } .grade-d .score-value { background: #c9762f; } .grade-e .score-value { background: #a9413c; }
.allergen-warning { margin-bottom: 20px; padding: 20px 22px; border: 1px solid rgba(255,123,112,.38); border-radius: 18px; background: rgba(255,123,112,.08); }
.allergen-warning strong { color: var(--danger); }
.allergen-warning p { margin: 7px 0; font-weight: 760; }
.allergen-warning small { color: var(--muted); }
.product-grid, .history-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.content-card { min-width: 0; padding: clamp(24px,4vw,38px); }
.content-card h3, .sources h3 { margin-bottom: 18px; font-size: clamp(1.5rem,2.7vw,2.2rem); letter-spacing: -.035em; }
.card-heading { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; }
td { text-align: right; font-weight: 740; }
.long-copy { margin: 0; color: #d4cfc7; line-height: 1.75; overflow-wrap: anywhere; }
.details-section { margin: clamp(66px,9vw,118px) 0; }
.section-heading { max-width: 720px; margin-bottom: 28px; }
.section-heading h2 { margin-bottom: 10px; font-size: clamp(2.2rem,5vw,4.4rem); letter-spacing: -.055em; }
.section-heading > p:last-child { color: var(--muted); line-height: 1.55; }
.detail-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.detail-card { min-width: 0; min-height: 150px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(18,18,18,.9); }
.detail-label { display: block; margin-bottom: 22px; color: var(--muted); font-size: .7rem; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.detail-value { margin: 0; overflow-wrap: anywhere; line-height: 1.5; }
.history-grid { align-items: start; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; min-width: 0; }
.timeline-dot { position: relative; width: 11px; height: 11px; margin-top: 5px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); }
.timeline-dot::after { position: absolute; top: 12px; left: 3px; width: 1px; height: calc(100% + 58px); background: var(--line); content: ""; }
.timeline-item:last-child .timeline-dot::after { display: none; }
.timeline-copy { min-width: 0; padding-bottom: 26px; }
.timeline-copy strong, .timeline-copy time { display: block; }
.timeline-copy time { margin: 4px 0 7px; color: var(--accent-light); font-size: .72rem; }
.timeline-copy p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.observation-form { display: grid; gap: 14px; margin-top: 22px; }
.observation-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.manual-price-list, .sources ul { display: grid; gap: 9px; margin: 18px 0 0; padding: 0; list-style: none; }
.price-row { display: grid; gap: 3px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; }
.price-row span, .price-row small { color: var(--muted); }
.sources { display: grid; grid-template-columns: minmax(240px,.75fr) minmax(0,1.25fr); gap: clamp(30px,6vw,90px); margin-top: 20px; padding: clamp(24px,4vw,38px); }
.sources p:last-child { margin: 0; color: var(--muted); line-height: 1.55; }
.sources li { display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.source-link { color: var(--accent-light); font-weight: 760; text-underline-offset: 4px; }
.source-time { color: var(--muted); font-size: .75rem; }
.privacy-section { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: clamp(32px,8vw,110px); margin-top: clamp(90px,12vw,160px); padding: clamp(34px,5vw,58px) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.privacy-section h2 { margin: 0; font-size: clamp(2.2rem,4.7vw,4.2rem); letter-spacing: -.05em; }
.privacy-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.privacy-copy p { margin: 0; color: var(--muted); line-height: 1.65; }

.history-dialog { width: min(760px,calc(100% - 24px)); max-height: min(86dvh,900px); padding: clamp(22px,4vw,38px); overflow: auto; border: 1px solid var(--line); border-radius: 24px; background: #111; color: var(--text); box-shadow: 0 34px 100px #000; }
.history-dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(5px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-head h2 { margin-bottom: 8px; font-size: 2.2rem; }
.history-list { display: grid; gap: 8px; margin: 24px 0; padding: 0; list-style: none; }
.history-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.history-open, .history-delete { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.history-open { min-width: 0; padding: 14px; text-align: left; }
.history-open strong, .history-open span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-open span { margin-top: 5px; color: var(--muted); font-size: .75rem; }
.history-delete { padding: 0 13px; color: var(--danger); }
.dialog-empty { padding: 50px 10px; color: var(--muted); text-align: center; }
.site-footer { position: fixed; right: 0; bottom: 0; left: 0; z-index: 18; display: flex; width: 100%; max-width: none; align-items: center; justify-content: space-between; gap: 18px; margin: 0; padding: 16px max(20px,calc((100vw - 1320px)/2)) max(18px,env(safe-area-inset-bottom)); border: 0; background: rgba(9,9,9,.94); color: var(--muted); font-size: .82rem; backdrop-filter: blur(18px); }
.site-footer::before { position: absolute; top: 0; right: max(20px,calc((100vw - 1320px)/2)); left: max(20px,calc((100vw - 1320px)/2)); height: 1px; background: var(--line); content: ""; }
.footer-links { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 20px; margin-left: auto; }
.site-footer a { color: var(--muted); font-weight: 700; text-decoration: none; }
.github-link { display: inline-flex; gap: 7px; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; text-decoration: none; transition: color 160ms ease; }
.github-link:hover { color: var(--accent-light); }
.github-link svg { width: 20px; height: 20px; fill: currentColor; }
.offline-page { display: grid; width: min(680px,calc(100% - 32px)); min-height: 100dvh; margin: 0 auto; place-content: center; justify-items: start; }
.offline-page > img { width: 86px; margin-bottom: 28px; }
.offline-page h1 { margin-bottom: 18px; font-size: clamp(2.8rem,10vw,5.5rem); }
.offline-page > p:not(.eyebrow) { max-width: 560px; margin-bottom: 26px; color: var(--muted); line-height: 1.6; }

@keyframes drift { to { background-position: 0 -152px; } }
@keyframes scan { to { top: calc(100% - 14px); } }
@keyframes skeleton { to { background-position: -100% 0; } }

@media (max-width: 1050px) {
  .scanner-entry-layout { grid-template-columns: minmax(0,1fr) minmax(260px,320px); }
  .scanner-panel { grid-template-columns: 1fr; }
  .camera-stage { min-height: min(58dvh,540px); }
  .scanner-controls { border-top: 1px solid var(--line); border-left: 0; }
  .permission-note { margin-top: 22px; }
  .detail-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .desktop-nav { display: none; }
  #menu-button { display: grid; }
}
@media (max-width: 760px) {
  .scanner-entry-layout { display: block; }
  .mobile-handoff { display: none; }
  .hero, .product-hero, .product-grid, .history-grid, .sources, .privacy-section { grid-template-columns: 1fr; }
  .hero { gap: 22px; }
  .hero > p { max-width: 620px; }
  .product-image-wrap { min-height: 420px; }
  .product-intro { border-top: 1px solid var(--line); border-left: 0; }
  .product-hero.no-image .product-intro { border-top: 0; }
  .manual-form { grid-template-columns: 1fr 1fr; }
  .manual-form .primary-button { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .privacy-copy { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  html:has(body.scanner-active), body.scanner-active { width: 100%; height: 100%; height: 100dvh; overflow: hidden; overscroll-behavior: none; touch-action: none; }
  body.scanner-active { position: fixed; inset: 0; }
  body.scanner-active #manual { display: none; }
  body.scanner-active .page-shell { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar { width: 8px; height: 8px; }
  .site-header { min-height: 66px; padding-bottom: 10px; }
  .brand-logo { width: 42px; height: 42px; }
  .brand span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-button { padding: 0 12px; }
  .page-shell { width: calc(100% - 24px); padding-top: 14px; }
  .scanner-page-title { margin-bottom: 16px; font-size: clamp(2.25rem,12vw,3.5rem); }
  .hero { margin-bottom: 24px; }
  h1 { font-size: clamp(2.75rem,14vw,4.25rem); }
  .hero > p { font-size: .95rem; }
  .scanner-panel { border-radius: 20px; }
  .camera-stage { display: none; min-height: 0; height: min(44dvh,390px); }
  .camera-stage.active { display: block; }
  .camera-stage.active { height: max(220px,30dvh); }
  .scan-frame { width: 82%; height: 32%; border-radius: 15px; }
  .scanner-controls { padding: 24px 20px; border-top: 0; }
  .scanner-controls h1 { margin-bottom: 22px; font-size: clamp(2rem,10vw,3rem); }
  .scanner-panel:has(.camera-stage.active) .scanner-controls { padding: 16px 18px; }
  .scanner-panel:has(.camera-stage.active) .format-note,
  .scanner-panel:has(.camera-stage.active) .permission-note { display: none; }
  .scanner-panel:has(.camera-stage.active) .scanner-status { min-height: 0; margin: 0 0 12px; padding: 10px 12px; font-size: .8rem; }
  .scanner-panel:has(.camera-stage.active) .scanner-settings { margin-top: 12px; }
  .scanner-panel:has(.camera-stage.active) .switch-row { padding: 9px; }
  .scanner-panel:has(.camera-stage.active) .primary-button,
  .scanner-panel:has(.camera-stage.active) .secondary-button { min-height: 48px; }
  .scanner-heading { display: block; }
  .format-note { display: inline-block; margin-top: 13px; }
  .scanner-status { min-height: 0; margin: 0 0 18px; }
  .primary-actions, .scanner-settings { grid-template-columns: 1fr 1fr; }
  .scanner-panel:has(.camera-stage.active) .primary-actions { gap: 12px; }
  .scanner-panel:has(.camera-stage.active) .primary-actions > button { width: 100%; min-height: 54px; padding-inline: 12px; }
  .permission-note { padding-top: 18px; }
  .manual-section { gap: 10px; padding: 20px; border-radius: 20px; }
  .manual-form { grid-template-columns: 1fr; }
  .manual-form .primary-button { grid-column: auto; }
  .manual-form .search-icon-button { width: 100%; min-width: 0; }
  .manual-form .primary-button { margin-top: 0; }
  input, select { font-size: 16px; }
  .result-skeleton { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
  .skeleton-image { max-height: 320px; }
  .empty-result { grid-template-columns: 1fr; }
  .product-hero { border-radius: 20px; }
  .product-image-wrap { min-height: 390px; padding: 20px; }
  .product-image-wrap > img { width: 100%; height: 350px; max-height: none; }
  .product-intro { padding: 26px 20px; }
  .product-intro h2 { font-size: clamp(2.2rem,12vw,3.7rem); }
  .product-actions > * { width: 100%; }
  .score-grid { grid-template-columns: 1fr; gap: 9px; }
  .score-card { min-height: 92px; }
  .content-card { padding: 22px 18px; border-radius: 20px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-card { min-height: 124px; }
  .observation-row { grid-template-columns: 1fr; }
  .sources { padding: 22px 18px; border-radius: 20px; }
  .history-row { grid-template-columns: minmax(0,1fr) auto; }
  .site-footer { width: 100%; align-items: center; padding: 10px 12px max(10px,env(safe-area-inset-bottom)); font-size: .72rem; }
  .site-footer::before { right: 12px; left: 12px; }
  .site-footer > span { display: none; }
}
@media (max-width: 370px) {
  .header-button { display: none; }
  .primary-actions { grid-template-columns: 1fr; }
  .local-chip { top: 10px; left: 10px; }
}
@media (pointer: coarse) { input, select { font-size: 16px !important; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Canonical Mango footer: identical on every page and transparent over the page background. */
.site-footer { position: fixed; right: 0; bottom: 0; left: 0; z-index: 18; display: flex; width: 100%; max-width: none; align-items: center; justify-content: space-between; gap: 18px; margin: 0; padding: 16px max(20px,calc((100vw - 1320px)/2)) max(18px,env(safe-area-inset-bottom)); border: 0; background: transparent; color: var(--muted); font-size: .82rem; backdrop-filter: none; }
.site-footer::before { position: absolute; top: 0; right: max(20px,calc((100vw - 1320px)/2)); left: max(20px,calc((100vw - 1320px)/2)); height: 1px; background: var(--line); content: ""; }
.site-footer > span { display: block; }
.footer-links { display: inline-flex; width: auto; flex: 0 0 auto; align-items: center; justify-content: flex-start; gap: 20px; margin-left: auto; }
.github-link svg { width: 19px; height: 19px; }
@media (max-width: 620px) {
  .site-footer { width: 100%; align-items: center; flex-direction: row; gap: 10px; padding: 10px 12px max(10px,env(safe-area-inset-bottom)); font-size: .72rem; }
  .site-footer::before { right: 12px; left: 12px; }
  .site-footer > span { display: none; }
  .footer-links { width: 100%; justify-content: space-between; }
}

/* Mobile-only footer stability and tool identity. Desktop remains unchanged. */
.mobile-scan-identity { display: block; width: 76px; height: 76px; margin: 0 auto 18px; padding: 8px; border: 1px solid rgba(255,157,50,.2); border-radius: 20px; background: rgba(255,157,50,.08); object-fit: contain; }
.scanner-panel:has(.camera-stage.active) .mobile-scan-identity { display: none; }
.usb-scanner-help { width: min(100%,520px); margin: 18px auto 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); color: var(--muted); font-size: .76rem; line-height: 1.5; }
.usb-scanner-help summary { color: var(--text); font-weight: 780; cursor: pointer; }
.usb-scanner-help p { margin: 9px 0 0; color: var(--success); }
.usb-scanner-help ol { margin: 8px 0 0; padding-left: 19px; }
.usb-scanner-help li + li { margin-top: 3px; }
.scanner-panel:has(.camera-stage.active) .usb-scanner-help { display: none; }
@media (max-width: 620px) {
  .site-footer {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(38px + env(safe-area-inset-bottom));
    min-height: calc(38px + env(safe-area-inset-bottom));
    padding: 0 16px env(safe-area-inset-bottom);
    overflow: hidden;
    background: rgba(9,9,9,.98);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    transform: translateZ(0);
    contain: layout paint;
  }
  .site-footer::before { right: 16px; left: 16px; }
  .page-shell { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .scanner-panel:not(:has(.camera-stage.active)) .scanner-controls { min-height: 270px; }
  .scanner-controls > .mobile-scan-identity {
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    padding: 8px;
    border: 1px solid rgba(255,157,50,.2);
    border-radius: 20px;
    background: rgba(255,157,50,.08);
    object-fit: contain;
  }
  .scanner-panel:has(.camera-stage.active) .mobile-scan-identity { display: none; }
  .usb-scanner-help { display: none; }
}
