:root {
  color-scheme: light;
  --ink: #1b352c;
  --muted: #4e655b;
  --leaf: #224f3e;
  --page: #faf9f3;
  --white: #fffefa;
  --mint: #e8efe3;
  --line: #dbe2d7;
  --amber: #8d4e22;
  --serif: Georgia, 'Times New Roman', serif;
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--page);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
body.has-tray { padding-bottom: 6rem; }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #a55325; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; top: 8px; left: 8px; padding: .6rem; background: var(--white); }
.wrap { width: min(1120px, calc(100% - 56px)); margin-inline: auto; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 67px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .42rem; font: bold 1.65rem/1 var(--serif); text-decoration: none; letter-spacing: -.055em; white-space: nowrap; }
.brand img { margin-right: .15rem; border-radius: .45rem; }
.topbar nav { display: flex; align-items: center; gap: 1.35rem; }
.quiet { border: 0; background: transparent; color: var(--leaf); padding: .42rem .05rem; font-weight: 670; }
.quiet:hover, .footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.list-button, .secondary, .primary, .chip, .icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: .43rem; border: 1px solid transparent; border-radius: .65rem; font-weight: 700; text-decoration: none; line-height: 1.2; min-height: 42px; }
.list-button { background: var(--mint); color: var(--ink); padding: .55rem .65rem; }
.list-button svg { width: 1.15rem; height: 1.15rem; }
.list-button:hover, .chip:hover { background: #d8e6d6; }
.count { display: grid; place-items: center; font-size: .72rem; border-radius: 30px; min-width: 1.3rem; min-height: 1.3rem; padding: 0 .22rem; background: var(--white); }
.primary { background: var(--leaf); color: white; padding: .64rem 1rem; }
.primary:hover { background: #183b2e; }
.secondary { background: var(--white); color: var(--leaf); border-color: #b9cabd; padding: .62rem .82rem; }
.secondary:hover, .secondary[aria-pressed="true"] { background: var(--mint); border-color: #8ba993; }
.hero { background: #eff2e7; border-bottom: 1px solid #d9e4d7; }
.hero-inner { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(285px, .76fr); gap: 2rem; padding-block: 2.35rem 2.55rem; }
.eyebrow { display: flex; align-items: center; gap: .55rem; margin: 0 0 .7rem; font-weight: 790; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--leaf); }
.status-dot { width: .55rem; height: .55rem; background: #38734e; border-radius: 50%; box-shadow: 0 0 0 3px #dae6d6; margin: 0 .15rem; }
h1, h2, .dialog-inner > header h2 { font-family: var(--serif); }
h1 { margin: 0; font-size: clamp(3.05rem, 6vw, 5.55rem); letter-spacing: -.062em; line-height: .99; font-weight: 700; }
h1 em { color: #386748; }
.hero-copy { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.13rem); margin: 1.05rem 0 1.15rem; max-width: 41ch; }
.search { position: relative; display: flex; align-items: center; gap: .6rem; padding: .33rem; border: 1px solid #c3cfc1; border-radius: .82rem; background: var(--white); max-width: 540px; box-shadow: 0 4px 14px #1b352c0b; }
.search:focus-within { border-color: #4a795a; box-shadow: 0 0 0 2px #4a795a35; }
.search-icon { width: 1.4rem; height: 1.4rem; margin-left: .6rem; flex: none; color: #577562; }
.search input { flex: 1; min-width: 0; height: 42px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search input::placeholder { color: #536b5f; }
.search .primary { min-width: 86px; }
.browse { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .88rem; }
.chip { border-color: #c5d4c5; min-height: 35px; border-radius: 50px; font-size: .82rem; color: var(--leaf); background: #fafbf4; padding: .35rem .68rem; }
.chip[aria-pressed="true"] { background: var(--leaf); color: white; border-color: var(--leaf); }
.hero-art { justify-self: center; width: min(100%, 436px); }
.hero-art img { display: block; width: min(100%, 372px); height: auto; margin-inline: auto; }
.results { padding-block: 2.05rem 3.5rem; min-height: 400px; }
.offline-banner { margin: 0 0 1rem; padding: .55rem .72rem; border-radius: .45rem; background: #f4ead9; color: #714827; font-size: .83rem; font-weight: 650; }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; padding-bottom: 1.1rem; }
.small { margin-bottom: .3rem; }
.section-index { color: var(--amber); font-variant-numeric: tabular-nums; }
h2 { color: var(--ink); letter-spacing: -.04em; line-height: 1.08; margin: 0; font-size: clamp(2rem, 4.2vw, 2.75rem); }
.results-meta, .muted { color: var(--muted); }
.results-meta { margin: .36rem 0 0; font-size: .91rem; }
.explainer { flex-shrink: 0; font-size: .87rem; }
.info-icon { display: inline-grid; place-items: center; margin-right: .2rem; width: 1rem; height: 1rem; border: 1px solid currentColor; border-radius: 50%; font: bold .72rem/1 var(--serif); }
.group { margin-top: .85rem; }
.group + .group { margin-top: 1.85rem; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .2rem .85rem; margin-bottom: .7rem; }
.group-head h3 { margin: 0; font-size: 1rem; }
.group-head span { color: var(--muted); font-size: .82rem; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.card { display: flex; min-width: 0; flex-direction: column; padding: 1rem; gap: .75rem; background: var(--white); border: 1px solid var(--line); border-radius: .92rem; box-shadow: 0 2px 8px #182d2510; }
.card-head { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: .8rem; align-items: start; }
.media { width: 76px; height: 83px; padding: .34rem; background: #edf1e7; border-radius: .64rem; display: grid; place-items: center; overflow: hidden; position: relative; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; padding: .32rem; object-fit: contain; background: #edf1e7; }
.media svg { width: 37px; height: 37px; opacity: .72; }
.card .brand-line, .brand-line { color: var(--muted); margin: 0; font-size: .77rem; font-weight: 680; line-height: 1.2; }
.title-button { color: var(--ink); background: none; text-align: left; border: 0; padding: 0; display: block; font-weight: 760; font-size: 1.09rem; line-height: 1.19; overflow-wrap: anywhere; }
.title-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.card h4 { margin: .26rem 0 .31rem; }
.pack { margin: 0; color: var(--muted); font-size: .81rem; }
.score { display: inline-flex; align-items: center; gap: .55rem; width: fit-content; max-width: 100%; border-radius: .55rem; padding: .3rem .62rem; color: #204932; background: #dcead8; }
.score-label { font-size: .76rem; font-weight: 700; }
.score-value { font-size: 1.18rem; line-height: 1.25; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score-scale { font-size: .77rem; font-weight: 690; }
.score.unranked { color: #714827; background: #f4ead9; }
.score.unranked .score-value { font-size: .84rem; white-space: normal; }
.card-copy { font-size: .86rem; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.card-nutrition { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: .4rem; margin: 0; }
.card-nutrition > div { padding: .4rem .47rem; background: #f3f5ed; border-radius: .38rem; min-width: 0; }
.card-nutrition dt { color: var(--muted); font-size: .69rem; line-height: 1.2; }
.card-nutrition dd { margin: .06rem 0 0; font-size: .83rem; font-weight: 760; }
.card-source { color: var(--muted); font-size: .72rem; margin: 0; }
.card-controls { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-top: auto; padding-top: .1rem; }
.card-controls button { font-size: .81rem; min-height: 40px; }
.card-controls .quiet { padding-inline: .25rem; margin-left: auto; }
.empty { background: var(--white); padding: 1.25rem; border: 1px dashed #b7c7b7; border-radius: .9rem; }
.empty p { margin: 0; color: var(--muted); }
.empty p + p { margin-top: .45rem; }
.footer { border-top: 1px solid var(--line); background: #eef2e8; padding: 1.35rem 0; }
.footer-inner, .footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem 1.2rem; }
.footer-inner { justify-content: space-between; }
.footer p, .footer-links { font-size: .83rem; color: var(--muted); margin: .4rem 0 0; }
.footer .brand { font-size: 1.3rem; }
.tray { position: fixed; bottom: 0; inset-inline: 0; z-index: 2; border-top: 1px solid #90a994; color: white; background: #173c31; box-shadow: 0 -5px 25px #173c3129; padding: .65rem 0 calc(.65rem + env(safe-area-inset-bottom)); }
.tray-inner { display: flex; justify-content: space-between; align-items: center; gap: .55rem 1.25rem; flex-wrap: wrap; }
.tray strong { display: block; }
.tray p { color: #e0ebdc; margin: .13rem 0 0; font-size: .78rem; }
.tray-actions { display: flex; align-items: center; gap: .85rem; }
.tray .quiet { color: white; }
.tray .primary { color: var(--ink); background: #f3ebce; }
.tray .primary:hover { background: #eaddae; }
.toast { position: fixed; bottom: 1rem; z-index: 4; right: 1rem; max-width: min(340px, calc(100% - 2rem)); border-radius: .55rem; padding: .68rem .9rem; color: white; background: #183b2e; box-shadow: 0 4px 20px #14292030; font-size: .88rem; }
.has-tray .toast { bottom: 6.8rem; }
.toast:empty { display: none; }
dialog { max-width: min(760px, calc(100% - 2rem)); width: 100%; max-height: calc(100dvh - 2rem); overflow-y: auto; margin: auto; border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 1rem; padding: 0; box-shadow: 0 12px 70px #16352e40; }
dialog::backdrop { background: #142e26a6; }
dialog.wide { max-width: min(980px, calc(100% - 2rem)); }
.dialog-inner { padding: clamp(1rem, 3vw, 1.7rem); }
.dialog-inner > header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding-bottom: .9rem; }
.dialog-inner h2 { font-size: clamp(1.68rem, 4.8vw, 2.55rem); overflow-wrap: anywhere; }
.dialog-inner h3 { font-size: 1.02rem; margin: 1.1rem 0 .45rem; }
.dialog-inner p { margin: .45rem 0 .78rem; overflow-wrap: anywhere; }
.dialog-inner ul { padding-left: 1.2rem; }
.icon-btn { width: 42px; color: var(--ink); font-size: 1.4rem; border-color: var(--line); background: var(--mint); flex: none; }
.icon-btn:hover { background: #d7e6d6; }
.dialog-product { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.dialog-product .media { width: 96px; height: 100px; }
.dialog-product > div:nth-child(2) { flex: 1 1 165px; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin: .72rem 0 1rem; }
.source-note, .comparison-note { background: var(--mint); border-radius: .6rem; padding: .75rem .85rem; font-size: .88rem; }
.table-wrap { overflow: auto; border-radius: .65rem; border: 1px solid var(--line); }
.table-wrap:focus-visible { outline-offset: 2px; }
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
th, td { padding: .65rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: #ecf1e8; }
tbody th { font-weight: 650; }
tr:last-child > * { border-bottom: 0; }
table.comparison { min-width: 575px; table-layout: fixed; }
table.comparison thead th:first-child { width: 122px; }
table.comparison th, table.comparison td { overflow-wrap: anywhere; }
.comparison td .score { gap: 0; }
.comparison tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--white); box-shadow: 1px 0 var(--line); }
.comparison thead tr > :first-child { background: #ecf1e8; }
.table-hint { font-size: .82rem; }
.row-ingredients { font-size: .8rem; }
.saved-items { list-style: none; margin: 0; padding: 0 !important; }
.saved-items li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; border-top: 1px solid var(--line); padding: .7rem 0; }
.saved-items p { font-size: .82rem; margin: .2rem 0 0; }
@media (max-width: 930px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { gap: 1rem; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 28px); }
  .topbar-inner { min-height: 59px; }
  .brand { font-size: 1.48rem; }
  .brand img { width: 35px; height: 35px; }
  .method-nav { display: none; }
  .hero-inner { display: block; padding-block: 1.35rem 1.25rem; }
  .hero-art { display: none; }
  .hero-break { display: none; }
  h1 { font-size: clamp(2.8rem, 10vw, 4rem); max-width: 12ch; }
  .hero-copy { margin-block: .68rem .85rem; }
  .browse { gap: .35rem; }
  .chip { min-height: 40px; }
  .results { padding-block: 1.3rem 2.5rem; }
  .results-head { display: block; padding-bottom: .48rem; }
  .explainer { margin-top: .3rem; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: .65rem; }
  .card { padding: .8rem; gap: .6rem; }
  .card-controls button { min-height: 44px; }
  .tray p { display: none; }
  dialog, dialog.wide { max-width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
}
