:root {
  --ink: #10291f;
  --ink-soft: #4d5d54;
  --forest: #174d35;
  --forest-dark: #0d3826;
  --coral: #ef5744;
  --coral-dark: #d94334;
  --leaf: #63a84f;
  --cream: #fbf8f0;
  --paper: #fffdf8;
  --sand: #e8dfcf;
  --line: rgba(16, 41, 31, 0.14);
  --shadow-sm: 0 6px 20px rgba(39, 48, 35, 0.08);
  --shadow-md: 0 18px 46px rgba(39, 48, 35, 0.13);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--cream); color: var(--ink); font-family: var(--sans); margin: 0; min-height: 100vh; }
body::selection { background: #dcebcf; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { max-width: 100%; }

.app-header { background: color-mix(in srgb, var(--cream) 92%, transparent); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(18px); }
.header-inner { align-items: center; display: flex; height: 76px; justify-content: space-between; margin: 0 auto; max-width: 1320px; padding: 0 28px; }
.brand { align-items: center; display: inline-flex; font-family: var(--serif); font-size: 34px; font-weight: 700; gap: 10px; letter-spacing: -0.04em; text-decoration: none; white-space: nowrap; }
.brand-wordmark { display: inline-block; line-height: 1.15; }
.brand-amp { color: var(--ink-soft); font-size: .82em; font-style: italic; font-weight: 400; }
.brand-veg { color: var(--forest); font-style: italic; }
.brand-v { display: inline-block; position: relative; }
.brand-leaf { color: var(--leaf); height: .52em; position: absolute; right: -.24em; top: -.16em; width: .45em; }
.brand:focus-visible { outline: 2px solid var(--forest); outline-offset: 7px; border-radius: 4px; }
.brand-mark { color: var(--forest); flex: 0 0 auto; height: 38px; width: 38px; }
.desktop-nav { align-items: stretch; display: flex; gap: 8px; height: 100%; }
.nav-link { align-items: center; border-bottom: 3px solid transparent; display: inline-flex; font-size: 15px; font-weight: 650; gap: 9px; padding: 3px 18px 0; text-decoration: none; transition: color .2s ease, border-color .2s ease; }
.nav-link:hover { border-bottom-color: var(--forest); color: var(--forest); }
.profile-link { align-items: center; background: var(--forest); border-radius: 999px; color: white; display: inline-flex; min-height: 42px; justify-content: center; text-decoration: none; min-width: 42px; max-width: 160px; padding: 8px 14px; font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.icon { display: inline-block; flex: 0 0 auto; height: 22px; vertical-align: middle; width: 22px; }

.page-shell { margin: 0 auto; max-width: 1220px; padding: 58px 28px 90px; }
.page-heading { font-family: var(--serif); font-size: clamp(42px, 5vw, 70px); letter-spacing: -.045em; line-height: .98; margin: 0; max-width: 800px; }
.page-intro { color: var(--ink-soft); font-size: 18px; line-height: 1.65; margin: 20px 0 0; max-width: 700px; }
.section-heading { font-family: var(--serif); font-size: clamp(28px, 3vw, 40px); letter-spacing: -.035em; line-height: 1.08; margin: 0; }
.section-header { align-items: center; display: flex; justify-content: space-between; margin-bottom: 24px; }
.text-link { align-items: center; color: var(--coral-dark); display: inline-flex; font-weight: 750; gap: 7px; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.home { overflow: hidden; }
.hero { border-bottom: 1px solid var(--line); min-height: 610px; position: relative; }
.hero-media { inset: 0 0 0 49%; overflow: hidden; position: absolute; }
.hero-media::after { background: linear-gradient(90deg, var(--cream) 0%, rgba(251,248,240,.64) 17%, transparent 50%); content: ""; inset: 0; pointer-events: none; position: absolute; }
.hero-image { height: 100%; object-fit: cover; object-position: 65% center; width: 100%; }
.hero-content { margin: 0 auto; max-width: 1320px; min-height: 610px; padding: 66px 28px 54px; position: relative; z-index: 2; }
.hero-copy { max-width: 750px; }
.hero h1 { font-family: var(--serif); font-size: clamp(54px, 5vw, 76px); font-weight: 700; letter-spacing: -.055em; line-height: .94; margin: 0; }
.hero-subtitle { color: #273a31; font-size: 19px; line-height: 1.55; margin: 24px 0 26px; max-width: 570px; }
.hero-search { display: flex; max-width: 590px; position: relative; gap: 8px; }
.hero-search-row { align-items: center; display: flex; gap: 10px; max-width: 650px; }
.hero-search-row .hero-search { flex: 1; min-width: 0; }
.hero-search .icon { color: #65726c; left: 19px; pointer-events: none; position: absolute; top: 17px; }
.hero-search input { background: rgba(255,253,248,.95); border: 1.5px solid #78aa66; border-radius: 16px; box-shadow: 0 0 0 4px rgba(99,168,79,.1), var(--shadow-sm); color: var(--ink); font-size: 17px; height: 58px; padding: 0 16px; min-width: 0; flex: 1; width: 100%; }
.scan-small { flex: 0 0 42px; border: 1px solid #c3d6c2; border-radius: 12px; background: #fffdf8; color: #174d35; font-size: 24px; cursor: pointer; }
.scanner-dialog { width: min(90vw, 540px); border: 0; border-radius: 24px; padding: 24px; }
.scanner-dialog video { width: 100%; max-height: 60vh; border-radius: 14px; }
dialog::backdrop { background: #10291fa8; }
.auth-panel { max-width: 540px; margin: 0 auto; }
.photo-draft-preview img { max-height: 260px; width: 100%; object-fit: contain; margin: 16px 0; }
.revision-data { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 420px; overflow-y: auto; }
.edit-icon-button { border: 1px solid #d7ded3; border-radius: 50%; padding: 7px 10px; text-decoration: none; flex-shrink: 0; }
.hero-search input:focus { border-color: var(--forest); outline: none; box-shadow: 0 0 0 4px rgba(23,77,53,.16), var(--shadow-sm); }
.search-submit { background: var(--forest); border: 0; border-radius: 12px; color: white; font-size: 15px; font-weight: 750; height: 44px; padding: 0 20px; position: absolute; right: 7px; top: 7px; }
.capture-actions { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-top: 16px; max-width: 590px; }
.capture-compact .capture-actions { display: block; margin-top: 0; }
.capture-compact .capture-button { min-height: 46px; padding: 0 12px; white-space: nowrap; }
.star-input { display: flex; gap: 7px; }
.photo-intake { margin-bottom: 36px; }
.photo-intake h2 { margin-top: 8px; }
.photo-capture-grid, .intake-result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.photo-capture-card { position: relative; padding: 24px; border: 1px solid #dce2d7; background: #f7f9f2; border-radius: 18px; }
.photo-capture-card h3 { margin: 0 0 8px; }
.photo-capture-card p { font-size: 14px; min-height: 42px; }
.step-number { float: right; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: white; background: var(--forest); }
.photo-capture-card .capture-button { position: relative; cursor: pointer; background: var(--forest); }
.photo-capture-card input[type=file] { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; padding: 0; }
.photo-capture-card .capture-button:focus-within { outline: 3px solid #397258; outline-offset: 3px; }
.intake-image { position: relative; height: 240px; margin: 12px 0; border: 1px solid #dde2d6; border-radius: 12px; background: repeating-conic-gradient(#f2f2eb 0% 25%,#fff 0% 50%) 50% / 20px 20px; overflow: hidden; }
.intake-image img { object-fit: contain; padding: 12px; }
.intake-start { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-top: 24px; }
.intake-start .field { flex: 1; min-width: 230px; }
.intake-result { border-top: 1px solid #dce2d7; margin-top: 24px; padding-top: 20px; }
.image-choice { display: flex; gap: 8px; margin: 12px 0; }
.image-choice button { border: 1px solid #cdd8c7; background: white; border-radius: 30px; padding: 9px 16px; cursor: pointer; }
.image-choice .active { color: white; background: var(--forest); }
.photo-differences { display: grid; gap: 12px; margin-bottom: 20px; }
.photo-differences > div { background: #fff5e4; padding: 14px; border-radius: 12px; overflow-wrap: anywhere; }
.photo-differences p { font-size: 14px; margin: 8px 0; }
.photo-differences small { display: block; font-size: 10px; letter-spacing: .08em; color: #675b48; }
.photo-intake-page .form-aside { position: static; }
#product-draft { scroll-margin-top: 90px; }
@media(max-width:700px){.photo-capture-grid,.intake-result-grid{grid-template-columns:1fr;gap:16px}.photo-capture-card{padding:18px}.intake-start{display:grid}.intake-start .field{min-width:0}.photo-intake .simple-list li{display:grid;gap:10px}}
.editable-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.edit-pencil { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 8px; border: 1px solid #d6ded3; border-radius: 50%; background: #f6f8f3; color: #295b45; cursor: pointer; }
.edit-pencil svg { width: 20px; height: 20px; }
.edit-pencil:hover { background: #e6efdf; }
.edit-pencil:focus-visible { outline: 3px solid #397258; outline-offset: 3px; }
.data-editor-dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100dvh - 40px); overflow: auto; padding: 28px; border: 1px solid #d6ded3; border-radius: 22px; background: #fffdf8; color: var(--ink); }
.data-editor-dialog::backdrop { background: #10251bcc; }
.data-editor-dialog h2 { font-family: var(--serif); font-size: 25px; margin: 0 0 12px; }
.data-editor-dialog > p { font-size: 14px; line-height: 1.5; }
.editor-fields { border: 0; padding: 0; margin: 0; display: grid; gap: 16px; min-width: 0; }
.editor-nutrition { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.editor-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 480px) { .data-editor-dialog { padding: 20px; } .editor-nutrition { grid-template-columns: 1fr; } }
.star-input label { position: relative; display: grid; place-items: center; width: 46px; height: 48px; border: 1px solid #dedbd2; border-radius: 13px; background: #f7f6f1; color: #a6aa9f; cursor: pointer; transition: background .16s, border-color .16s, transform .16s; }
.star-input label.selected { background: #fff4d8; border-color: #e9c36a; color: #af7416; }
.star-input label:hover { transform: translateY(-3px); }
.star-input .icon { width: 26px; height: 26px; stroke-width: 1.5; fill: #a6aa9f; stroke: currentColor; }
.star-input label.selected .icon { fill: #edb947; }
.star-input input { height: 1px; min-height: 0; padding: 0; opacity: 0; position: absolute; width: 1px; }
.star-input label:focus-within { outline: 3px solid #397258; outline-offset: 3px; }
.rating-caption { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13px; margin: 12px 0 0; }
.rating-caption strong { color: var(--forest); font-size: 15px; }
.tag-picker { border: 0; padding: 0; min-width: 0; }
.tag-picker legend { padding: 0; font-family: inherit; font-size: 15px; font-weight: 750; }
.retailer-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.retailer-option { position: relative; cursor: pointer; min-width: 0; }
.retailer-option > input { position: absolute; opacity: 0; width: 1px; min-height: 0; height: 1px; padding: 0; }
.retailer-option > span { display: flex; align-items: center; gap: 9px; height: 100%; min-height: 52px; border: 1px solid #d9ded4; border-radius: 13px; padding: 9px; font-size: 11px; color: #45604f; background: #fafbf7; }
.retailer-option input:checked + span { border-color: var(--forest); background: #eaf2e5; box-shadow: inset 0 0 0 1px var(--forest); }
.retailer-option input:focus-visible + span { outline: 3px solid #86ad91; outline-offset: 2px; }
.retailer-badge { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 750; }
.retailer-icon { display: block; width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.review-retailer { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.tag-picker p { font-size: 13px; color: var(--ink-soft); margin: 5px 0 10px; }
.tag-cloud { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-pill { position: relative; cursor: pointer; }
.tag-pill > input { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; min-height: 0; }
.tag-pill > span { display: inline-flex; gap: 7px; align-items: center; min-height: 42px; padding: 8px 13px; border: 1px solid #d7ded3; border-radius: 999px; background: #f6f8f2; color: #45604f; font-size: 13px; font-weight: 650; transition: background .15s, color .15s; }
.tag-indicator::before { content: '+'; font-size: 16px; }
.tag-pill input:checked + span { background: var(--forest); color: white; border-color: var(--forest); }
.tag-pill input:checked + span .tag-indicator::before { content: '✓'; }
.tag-pill:hover > span { border-color: var(--forest); }
.tag-pill input:focus-visible + span { outline: 3px solid #86ad91; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .6; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; clip: rect(0,0,0,0); }
.capture-button { align-items: center; border: 0; border-radius: 15px; color: white; display: inline-flex; font-size: 16px; font-weight: 750; gap: 10px; justify-content: center; min-height: 58px; padding: 0 20px; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.capture-button:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.capture-button.primary { background: var(--forest); }
.capture-button.primary:hover { background: var(--forest-dark); }
.capture-button.accent { background: var(--coral); }
.capture-button.accent:hover { background: var(--coral-dark); }
.capture-video { background: #111; border-radius: 18px; box-shadow: var(--shadow-md); margin-top: 16px; max-height: 260px; object-fit: cover; width: 100%; }
.capture-cancel { background: transparent; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); margin-top: 12px; min-height: 44px; padding: 0 15px; }

.popular-section { margin: 0 auto; max-width: 1320px; padding: 46px 28px 60px; }
.product-grid { display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset; display: grid; grid-template-rows: 235px auto; min-width: 0; overflow: hidden; position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.product-card-media { background: #e9e2d6; display: block; overflow: hidden; position: relative; }
.product-card-image { height: 100%; object-fit: cover; transition: transform .35s ease; width: 100%; }
.product-card:hover .product-card-image { transform: scale(1.025); }
.product-card-placeholder { background-image: linear-gradient(135deg, rgba(23,77,53,.03), rgba(239,87,68,.07)), url('/assets/hero-food-community.png'); background-position: 69% center; background-size: cover; height: 100%; }
.product-card-body { display: grid; gap: 14px; padding: 20px; }
.product-card-main { text-decoration: none; }
.product-card-title { display: block; font-family: var(--serif); font-size: 23px; letter-spacing: -.025em; line-height: 1.12; }
.product-card-meta { color: var(--ink-soft); display: block; font-size: 14px; margin-top: 7px; }
.status { align-items: center; color: #338542; display: inline-flex; font-size: 14px; font-weight: 750; gap: 6px; margin-top: 10px; }
.status.unclear { color: #826b32; }
.product-card-footer { align-items: center; border-top: 1px solid var(--line); display: flex; justify-content: space-between; padding-top: 14px; }
.like-button { align-items: center; background: transparent; border: 0; color: var(--ink); display: inline-flex; font-size: 14px; font-weight: 700; gap: 8px; min-height: 44px; padding: 0; }
.like-button[aria-pressed="true"] { color: var(--coral); }
.card-arrow { align-items: center; background: #f3eee4; border-radius: 50%; display: inline-flex; height: 38px; justify-content: center; width: 38px; }
.status-message { color: var(--ink-soft); font-size: 13px; margin: 0; }
.empty-state { align-items: center; background: var(--paper); border: 1px dashed #b8b4a8; border-radius: var(--radius-md); display: flex; flex-direction: column; grid-column: 1/-1; justify-content: center; min-height: 260px; padding: 38px; text-align: center; }
.empty-state h3 { font-family: var(--serif); font-size: 28px; margin: 12px 0 6px; }
.empty-state p { color: var(--ink-soft); margin: 0 0 20px; }

.community-band { background: var(--forest-dark); color: white; }
.community-band-inner { align-items: center; display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr) auto; margin: 0 auto; max-width: 1320px; min-height: 230px; padding: 46px 28px; }
.community-band h2 { font-family: var(--serif); font-size: clamp(38px, 5vw, 62px); letter-spacing: -.045em; line-height: 1; margin: 0 0 13px; }
.community-band p { color: rgba(255,255,255,.78); font-size: 17px; line-height: 1.5; margin: 0; max-width: 570px; }
.primary-cta { align-items: center; background: var(--coral); border: 0; border-radius: 15px; color: white; display: inline-flex; font-weight: 800; gap: 10px; justify-content: center; min-height: 58px; padding: 0 25px; text-decoration: none; transition: background .18s ease, transform .18s ease; }
.primary-cta:hover { background: var(--coral-dark); transform: translateY(-2px); }

.products-toolbar { align-items: end; display: grid; gap: 14px; grid-template-columns: minmax(0, 2fr) minmax(180px, .8fr) auto; margin: 38px 0 24px; }
.field { display: grid; gap: 8px; }
.field-label { color: var(--ink); font-size: 14px; font-weight: 750; }
input, select, textarea { background: var(--paper); border: 1px solid #cfcabc; border-radius: 12px; color: var(--ink); min-height: 48px; padding: 11px 13px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(23,77,53,.12); outline: none; }
textarea { min-height: 110px; resize: vertical; }
.button { align-items: center; background: var(--forest); border: 0; border-radius: 12px; color: white; display: inline-flex; font-size: 15px; font-weight: 750; gap: 8px; justify-content: center; min-height: 48px; padding: 0 20px; text-decoration: none; }
.button:hover { background: var(--forest-dark); }
.button.secondary { background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.button.accent { background: var(--coral); }
.button.danger { background: #9e2f2f; }
.product-list-head { align-items: center; display: flex; justify-content: space-between; margin-bottom: 24px; }
.external-results { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 30px; }
.search-source-label { background: #e8f2e3; border-radius: 999px; color: var(--forest); font-size: 13px; padding: 8px 12px; }
.external-product-card .product-card-image { object-fit: contain; padding: 20px; }
.external-product-card .product-card-media { background: var(--paper); }
.external-product-card .product-card-body { display: flex; flex-direction: column; gap: 12px; }
.external-product-card .status { align-self: flex-start; }
.external-product-card .button { margin-top: auto; }
.external-image-placeholder { align-items: center; color: var(--ink-soft); display: flex; height: 100%; justify-content: center; }
.external-source-link { font-size: 12px; text-align: center; }
@media (max-width: 900px) {
  .search-page .product-grid { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
}
@media (max-width: 640px) {
  .search-page .product-grid { grid-template-columns: minmax(0, 1fr); }
}

.content-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 28px; }
.content-panel h2, .content-section h2 { font-family: var(--serif); font-size: 29px; letter-spacing: -.03em; margin: 0 0 18px; }
.stack { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.barcode-lookup { align-items: stretch; display: flex; gap: 8px; }
.barcode-lookup input { min-width: 0; }
.barcode-lookup .button { flex: 0 0 auto; padding-inline: 16px; }
.source-attribution { background: var(--cream); border-radius: var(--radius-xs); color: var(--ink-soft); font-size: 14px; margin: 16px 0 0; padding: 12px 14px; }
.off-preview { align-items: center; background: #f2f6ed; border: 1px solid #dce7d6; border-radius: var(--radius-sm); display: grid; gap: 20px; grid-template-columns: auto 1fr; padding: 20px; }
.off-preview h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 12px; }
.off-preview p { margin: 12px 0 0; }
.off-preview-image { background: var(--paper); border-radius: var(--radius-xs); height: 160px; overflow: hidden; position: relative; width: 140px; }
.off-preview-image img { object-fit: contain; }
.fact-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.product-labels { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.product-labels img { width: 56px; height: 68px; object-fit: contain; flex-shrink: 0; }
.product-labels small { font-size: 12px; line-height: 1.5; color: var(--muted); }
.fact-badges span { background: var(--forest); border-radius: 999px; color: white; font-size: 14px; font-weight: 750; padding: 7px 11px; }
.fact-tag { background: white; border: 1px solid var(--line); border-radius: 999px; display: inline-block; font-size: 13px; margin: 4px 0 0 6px; padding: 4px 8px; }
.form-page { display: grid; gap: 34px; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); }
.form-aside { align-self: start; position: sticky; top: 110px; }
.form-note { background: #ecf3e8; border-radius: var(--radius-sm); color: #36533f; line-height: 1.55; padding: 18px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; gap: 13px; margin: 0; padding: 18px; }
legend { font-family: var(--serif); font-size: 20px; font-weight: 700; padding: 0 8px; }
.checkbox-row { align-items: center; display: flex; gap: 10px; }
.checkbox-row input { min-height: auto; width: auto; }
.auth-shell { align-items: center; display: grid; min-height: calc(100vh - 76px); padding: 48px 24px 90px; }
.auth-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); margin: 0 auto; max-width: 500px; padding: clamp(28px, 5vw, 50px); width: 100%; }
.auth-card h1 { font-family: var(--serif); font-size: 48px; letter-spacing: -.04em; margin: 0 0 10px; }
.auth-card > p { color: var(--ink-soft); margin: 0 0 28px; }
.auth-card .button { width: 100%; }
.auth-switch { display: block; margin-top: 22px; text-align: center; }
.alert { background: #fff0ed; border-radius: 10px; color: #982d22; padding: 12px 14px; }
.success { background: #eaf4e7; border-radius: 10px; color: #285c34; padding: 12px 14px; }

.product-hero { display: grid; gap: 52px; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.product-photo { background: #eee7dc; border-radius: var(--radius-lg); min-height: 520px; overflow: hidden; position: relative; }
.product-photo img { height: 100%; max-height: 620px; object-fit: contain; width: 100%; }
.product-photo-placeholder { background-image: url('/assets/hero-food-community.png'); background-position: 72% center; background-size: cover; height: 100%; min-height: 520px; }
.product-detail h1 { font-family: var(--serif); font-size: clamp(48px, 5vw, 70px); letter-spacing: -.05em; line-height: .96; margin: 8px 0 16px; }
.product-kicker { color: var(--ink-soft); font-weight: 650; }
.status-block { align-items: center; background: #edf4e9; border-radius: var(--radius-sm); display: flex; gap: 12px; margin: 22px 0; padding: 15px 17px; }
.status-copy { display: grid; gap: 3px; }
.status-copy strong { color: #2f7c3e; }
.status-copy small { color: var(--ink-soft); }
.action-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0; }
.action-row button { border-radius: 12px !important; min-height: 48px !important; }
.detail-grid { display: grid; gap: 26px; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); margin-top: 40px; }
.review-aside { align-self: start; position: static; min-width: 0; }
.product-detail .stack { min-width: 0; align-content: start; }
.product-detail .content-panel { padding: clamp(20px, 2.5vw, 30px); }
.product-detail .review-aside h2 { font-size: clamp(24px, 2.4vw, 30px); }
.facts-intro, .facts-footnote { color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.facts-footnote { font-size: 11px; margin-top: 20px; }
.score-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.score-card { --score-color: #626b66; --score-bg: #f1f3f1; position: relative; border: 1px solid #e0e4dc; border-radius: 18px; padding: 16px 12px; background: var(--score-bg); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.score-green { --score-color: #17623f; --score-bg: #edf6ed; }
.score-lime { --score-color: #506421; --score-bg: #f3f6e5; }
.score-yellow { --score-color: #856309; --score-bg: #fff9e2; }
.score-orange { --score-color: #a94c16; --score-bg: #fff1e5; }
.score-red { --score-color: #a73235; --score-bg: #ffedef; }
.score-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: var(--ink); font-size: 12px; font-weight: 750; }
.score-value { font-size: 38px; line-height: 1; color: var(--score-color); letter-spacing: -.03em; }
.score-description { font-size: 12px; line-height: 1.5; color: var(--score-color); min-height: 36px; }
.score-scale { display: flex; gap: 3px; margin-top: auto; padding-top: 4px; }
.score-scale span { flex: 1; border-radius: 5px; text-align: center; font-size: 10px; line-height: 21px; background: #e1ece3; color: #224f36; }
.score-scale span:nth-child(2) { background: #e2ecc5; color: #415824; }
.score-scale span:nth-child(3) { background: #f8e5a1; color: #6e5205; }
.score-scale span:nth-child(4), .scale-nova span:nth-child(3) { background: #f4c19d; color: #853d15; }
.score-scale span:nth-child(5), .scale-nova span:nth-child(4) { background: #edb2b6; color: #872b32; }
.score-scale .current { outline: 2px solid var(--score-color); outline-offset: 2px; font-weight: 850; transform: translateY(-2px); }
.score-help summary { list-style: none; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #c6cfc3; border-radius: 50%; cursor: pointer; font-family: Georgia, serif; font-style: italic; }
.score-help summary::-webkit-details-marker { display: none; }
.score-help summary:focus-visible { outline: 3px solid #397258; outline-offset: 2px; }
.score-tooltip { display: none; position: absolute; z-index: 10; top: 48px; left: 0; width: min(270px, 75vw); padding: 17px; background: #183a2c; color: white; border-radius: 14px; box-shadow: 0 14px 35px #102e2b30; font-size: 13px; line-height: 1.6; font-weight: 400; }
.score-card:last-child .score-tooltip { left: auto; right: 0; }
.score-tooltip p { margin: 8px 0; }
.score-tooltip small { color: #d4e4d6; }
.score-help[open] .score-tooltip, .score-help:focus-within .score-tooltip { display: block; }
@media (hover: hover) { .score-help:hover .score-tooltip { display: block; } }
.photo-trigger { border: 0; width: 100%; padding: 0; cursor: pointer; }
.photo-trigger img { object-fit: contain; padding: 24px; }
.photo-action { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: max-content; max-width: 90%; border: 1px solid #ffffff80; background: #fffdf4eb; color: var(--forest); border-radius: 999px; padding: 12px 18px; font-weight: 700; font-size: 13px; box-shadow: 0 5px 20px #183a2c16; }
.photo-trigger:focus-visible { outline: 3px solid var(--forest); outline-offset: 4px; }
.photo-dialog { width: min(600px, 94vw); max-height: 90dvh; overflow: auto; border: 1px solid var(--line); border-radius: 24px; padding: 24px; background: var(--paper); color: var(--ink); }
.photo-dialog::backdrop { background: #14281ecd; backdrop-filter: blur(5px); }
.photo-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.photo-dialog-head h2 { margin: 0; font-family: var(--serif); }
.photo-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #eef1e9; font-size: 26px; }
.photo-preview { position: relative; height: min(42vh, 380px); margin: 18px 0; background: #f2f1eb; border-radius: 16px; overflow: hidden; }
.photo-preview img { object-fit: contain; padding: 12px; }
.photo-upload { display: grid; gap: 8px; font-weight: 700; margin-bottom: 12px; }
.photo-dialog .button { margin-top: 16px; }
@media (max-width: 600px) { .score-grid { grid-template-columns: 1fr; } .score-card { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 16px; } .score-heading { grid-column: 1; } .score-value { grid-column: 2; grid-row: 1 / 3; align-self: center; } .score-description { min-height: 0; } .score-scale { grid-column: 1 / -1; } .score-tooltip { width: min(290px, 72vw); } .star-input label { width: 46px; } }
@media (prefers-reduced-motion: reduce) { .star-input label, .tag-pill > span { transition: none; } .star-input label:hover { transform: none; } }
.content-section { border-top: 1px solid var(--line); margin-top: 50px; padding-top: 40px; }
.nutrition-list { display: grid; gap: 0; grid-template-columns: 1fr 1fr; margin: 0; }
.nutrition-list div { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 12px 0; }
.nutrition-list div:nth-child(odd) { margin-right: 28px; }
.nutrition-list dt { color: var(--ink-soft); }
.nutrition-list dd { font-weight: 750; margin: 0; }
.review-list, .comment-list, .simple-list { display: grid; gap: 14px; list-style: none; margin: 22px 0 0; padding: 0; }
.review-item, .comment-item, .simple-list li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; }
.sort-nav { display: flex; flex-wrap: wrap; gap: 9px; }
.sort-nav a { background: #eee9df; border-radius: 999px; font-size: 13px; font-weight: 700; padding: 9px 13px; text-decoration: none; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 15px 0 0; padding: 0; }
.tag-list li { background: #e8f2e3; border-radius: 999px; color: #2f713a; font-size: 13px; font-weight: 700; padding: 7px 11px; }
.star-rating { align-items: baseline; display: flex; gap: 9px; }
.star-rating .star { color: #f3b32e; font-size: 27px; }
.star-rating strong { font-family: var(--serif); font-size: 31px; }
.star-rating span { color: var(--ink-soft); }
.inline-report { align-items: end; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.inline-report .field { min-width: 170px; }
.inline-report button { min-height: 44px; }

.settings-grid { display: grid; gap: 20px; margin-top: 36px; max-width: 720px; }
.settings-row { align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; gap: 20px; grid-template-columns: 1fr 240px; padding: 20px; }
.password-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 28px; max-width: 720px; padding: clamp(22px, 4vw, 34px); }
.password-panel h2 { font-family: var(--serif); font-size: 32px; margin: 0 0 6px; }
.password-panel > p { color: var(--ink-soft); margin: 0 0 24px; }
.password-panel .button { justify-self: start; }
.settings-copy strong { display: block; }
.settings-copy span { color: var(--ink-soft); display: block; font-size: 14px; margin-top: 4px; }
.moderation-item { display: grid; gap: 10px; }

.mobile-nav { display: none; }

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .header-inner { height: 68px; padding: 0 18px; }
  .brand { font-size: 30px; }
  .brand-mark { height: 34px; width: 34px; }
  .profile-link { min-height: 38px; max-width: 120px; }
  .hero { min-height: auto; }
  .hero-media { display: none; }
  .hero-content { min-height: auto; padding: 48px 20px 42px; }
  .hero-copy { max-width: 680px; }
  .hero h1 { font-size: clamp(48px, 12vw, 70px); }
  .product-grid { grid-auto-columns: minmax(280px, 82vw); grid-auto-flow: column; grid-template-columns: none; overflow-x: auto; padding: 4px 2px 22px; scroll-snap-type: x mandatory; }
  .product-card { scroll-snap-align: start; }
  .community-band-inner, .form-page, .product-hero, .detail-grid { grid-template-columns: 1fr; }
  .form-aside, .review-aside { position: static; }
  .product-photo, .product-photo-placeholder { min-height: 400px; }
  .mobile-nav { background: rgba(255,253,248,.96); border-top: 1px solid var(--line); bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); left: 0; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); position: fixed; right: 0; z-index: 40; backdrop-filter: blur(16px); }
  .mobile-nav a { align-items: center; color: var(--ink-soft); display: flex; flex-direction: column; font-size: 11px; font-weight: 700; gap: 3px; min-height: 48px; padding: 4px 8px; text-decoration: none; }
  .mobile-nav a:first-child { color: var(--forest); }
  body { padding-bottom: 69px; }
}

@media (max-width: 640px) {
  .page-shell { padding: 38px 18px 70px; }
  .page-heading { font-size: 43px; }
  .page-intro { font-size: 16px; }
  .header-inner { padding: 0 16px; }
  .brand { font-size: 20px; gap: 8px; }
  .hero-content { padding: 42px 18px 38px; }
  .hero h1 { font-size: 43px; line-height: .98; }
  .hero-subtitle { font-size: 17px; margin-top: 19px; }
  .hero-search input { font-size: 15px; padding-right: 54px; }
  .search-submit { border-radius: 50%; font-size: 0; padding: 0; width: 44px; }
  .search-submit::after { content: '→'; font-size: 20px; }
  .capture-actions { gap: 10px; }
  .capture-button { font-size: 15px; min-height: 56px; padding: 0 12px; }
  .popular-section { padding: 34px 18px 44px; }
  .section-heading { font-size: 31px; }
  .product-card { grid-template-rows: 225px auto; }
  .community-band-inner { min-height: 290px; padding: 38px 20px; }
  .community-band h2 { font-size: 44px; }
  .primary-cta { width: 100%; }
  .products-toolbar { grid-template-columns: 1fr; margin-top: 30px; }
  .product-list-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .form-grid.two, .nutrition-list { grid-template-columns: 1fr; }
  .barcode-lookup { align-items: stretch; flex-direction: column; }
  .off-preview { grid-template-columns: 1fr; }
  .off-preview-image { height: 180px; width: 100%; }
  .nutrition-list div:nth-child(odd) { margin-right: 0; }
  .content-panel { padding: 21px; }
  .form-aside { order: -1; }
  .product-photo, .product-photo-placeholder { min-height: 340px; }
  .product-detail h1 { font-size: 48px; }
  .settings-row { grid-template-columns: 1fr; }
  .auth-card h1 { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
