/* ============================================================
   ShortList landing — the allergen tool, "Lab grid" look (design 2026-10-21 §5).
   Ported from concepts/landing-lab-grid/css/style.css (tool, label, list, .after, overlay).
   Family accents (--c1…--c6) mark categories only; verdict hues never appear here.
   Hint marks are yellow highlighter + ink, never red. Values from tokens.css.
   ============================================================ */

/* Reason: several parts set `display`, which would otherwise beat the `hidden` attribute */
.atool [hidden] { display: none !important; }

/* Reason: in-page links land below the sticky header (~47px) */
#allergen-tool { scroll-margin-top: 64px; }

.atool { border: 3px solid var(--ink); background: var(--white); }
.atool-head { background: var(--ink); color: var(--white); padding: 18px 18px 20px; }
.atool-head .offer { color: var(--yellow); }
.atool-head .display { color: var(--white); margin-bottom: 10px; }
.atool-sub { color: #ccc; font-size: 15px; line-height: 1.5; }
.atool-pick, .atool-result { padding: 18px; }
.atool-result { border-top: 1px solid var(--ink); }
.atool-micro { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 18px 0 8px; }

/* ---------- search + options ---------- */
.atool-search { display: flex; align-items: center; gap: 10px; border: 2px solid var(--ink); padding: 10px 12px; color: var(--ink); }
.atool-search:focus-within { box-shadow: 3px 3px 0 var(--ink); }
.atool-search input { border: 0; outline: 0; font: 500 15px 'Barlow', sans-serif; color: var(--ink); background: transparent; flex: 1; min-width: 0; }
.atool-search input:disabled { opacity: 0.6; }
.atool-options { list-style: none; border: 2px solid var(--ink); border-top: 0; max-height: 280px; overflow: auto; background: var(--white); }
.atool-option { padding: 9px 12px; cursor: pointer; border-top: 1px solid var(--line); }
.atool-option:first-child { border-top: 0; }
.atool-option[aria-selected="true"], .atool-option:hover { background: color-mix(in srgb, var(--yellow) 30%, white); }
.atool-option-name { font: 600 14px/1.3 'Barlow', sans-serif; }
.atool-option-meta { font: 500 9.5px 'IBM Plex Mono', monospace; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.atool-msg { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 10px; }

/* ---------- common picks + picked ---------- */
.atool-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.atool-chip { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--ink); background: var(--white); color: var(--ink); padding: 6px 9px; font: 600 13px 'Barlow', sans-serif; cursor: pointer; }
.atool-chip i { width: 12px; height: 12px; border: 1.5px solid var(--ink); display: inline-block; }
.atool-chip:hover i { background: var(--fc); border-color: var(--fc); }
.atool-picked { list-style: none; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.atool-picked:empty { display: none; }
.atool-picked li {
  position: relative; padding: 10px 34px 10px 34px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  box-shadow: inset 0 0 0 3px var(--fc); background: color-mix(in srgb, var(--fc) 7%, white);
  font: 600 13.5px/1.25 'Barlow', sans-serif; overflow-wrap: anywhere;
}
.atool-picked li::before { content: ""; position: absolute; left: 10px; top: 12px; width: 14px; height: 14px; background: var(--fc); }
.atool-picked li small { display: block; font-size: 9px; font-weight: 500; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.atool-picked button { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border: 0; background: none; font: 700 15px 'Barlow', sans-serif; cursor: pointer; color: var(--muted); }
.atool-picked button:hover { color: var(--ink); }
.atool-empty { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* ---------- new allergens + counts ---------- */
.atool-new { border: 2px solid var(--ink); border-left: 8px solid var(--yellow); padding: 12px 14px; margin-bottom: 16px; }
.atool-new-title { font: 700 15px/1.35 'Barlow', sans-serif; margin-bottom: 8px; }
.atool-new-list { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.atool-new-list li { border: 1px solid var(--ink); padding: 3px 6px; font: 600 12px/1.25 'Barlow', sans-serif; }
.atool-none { font-size: 14px; color: var(--muted); line-height: 1.5; margin-bottom: 16px; }
.atool-count { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: end; border-bottom: 4px solid var(--yellow); padding-bottom: 10px; }
.atool-total { font: 800 56px/0.9 'Gabarito', sans-serif; }
.atool-count span { font: 600 15px/1.35 'Barlow', sans-serif; padding-bottom: 6px; }
.atool-split { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.atool-split div { padding: 10px 0 8px; }
.atool-split div + div { border-left: 1px solid var(--line); padding-left: 12px; }
.atool-split b { display: block; font: 800 26px/1 'Gabarito', sans-serif; }
.atool-split span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.atool-cats-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.atool-cats-list li { border: 1px solid var(--ink); padding: 5px 8px; font: 600 12px 'Barlow', sans-serif; display: flex; gap: 6px; align-items: center; }
.atool-cats-list li.atool-cats-more { border-style: dashed; color: var(--muted); }

/* ---------- the example label + their full list ---------- */
.atool-ex { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--ink); }
.atool-ex-head { font: 800 24px/1.1 'Gabarito', sans-serif; }
.atool-ex .lead { margin: 6px 0 14px; }
.atool-label { border: 2px solid var(--ink); padding: 14px 14px 12px; background: #fffdf7; box-shadow: 6px 6px 0 var(--c3); }
.atool-label-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-end; border-bottom: 1px solid var(--ink); padding-bottom: 8px; margin-bottom: 10px; }
.atool-label-brand { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 2px; }
.atool-label-name { display: block; font: 800 20px/1.15 'Gabarito', sans-serif; }
.atool-label-size { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.atool-label-ings { font: 500 13.5px/1.75 'Barlow', sans-serif; text-transform: uppercase; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.atool-label-ings b { font-weight: 700; }
.atool-label-fine { margin-top: 12px; font-size: 9px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.03em; }
.atool-ex .atool-micro { margin-top: 24px; }
.atool-list { border: 2px solid var(--ink); max-height: 460px; overflow: auto; }
.atool-grp { border-top: 1px solid var(--line); padding: 10px 12px 12px 18px; box-shadow: inset 6px 0 0 var(--fc); }
.atool-grp:first-child { border-top: 0; }
.atool-grp h4 { font: 700 15px/1.2 'Barlow', sans-serif; margin-bottom: 6px; }
.atool-grp h4 small { display: block; font-size: 9px; font-weight: 500; text-transform: uppercase; color: var(--muted); margin-top: 2px; letter-spacing: 0.04em; }
.atool-kind { font-size: 8.5px; font-weight: 600; text-transform: uppercase; color: var(--muted); letter-spacing: 0.06em; margin: 8px 0 4px; }
.atool-names { display: flex; flex-wrap: wrap; gap: 4px; }
.atool-nm { border: 1px solid var(--ink); padding: 3px 6px; font: 600 12px/1.25 'Barlow', sans-serif; overflow-wrap: anywhere; }
.atool-nm-x { border-style: dashed; }
.atool-none-doc { font-size: 13px; color: var(--muted); }

/* ---------- under the tool: help, sign up, then the footnote form ---------- */
.atool-after { border-top: 1px solid var(--ink); }
.atool-after-row { display: grid; }
.atool-after-row > div { padding: 16px 18px 20px; display: grid; gap: 10px; justify-items: start; align-content: start; }
.atool-after-row p { font: 600 15px/1.4 'Barlow', sans-serif; }
.atool-after-signup { border-top: 1px solid var(--line); background: #fafafa; }
.btn-o { background: var(--white); box-shadow: 4px 4px 0 var(--c3); }
.btn-o:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--c3); }
.btn-o:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--c3); }
.atool-foot { border-top: 1px solid var(--line); padding: 12px 18px 16px; }
/* Reason (design §3): a footnote-style text link, never a button that competes with Sign up */
.atool-email-toggle { all: unset; cursor: pointer; font: 500 13px/1.4 'Barlow', sans-serif; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.atool-email-toggle:hover { color: var(--ink); }
.atool-email-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.atool-email { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; max-width: 520px; }
.atool-email input[type="text"], .atool-email input[type="email"] {
  display: block; width: 100%; font: 500 15px 'Barlow', sans-serif; color: var(--ink);
  background: var(--white); border: 2px solid var(--ink); padding: 10px 12px;
}
.atool-email input:focus-visible { outline: none; box-shadow: 3px 3px 0 var(--ink); }
.atool-email .btn { justify-self: start; }
.atool-fine { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
/* Reason: form errors are ink, not the verdict red */
.atool-error, .atool-loaderr { border: 2px solid var(--ink); border-left: 8px solid var(--ink); color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.45; padding: 10px 12px; }
.atool-loaderr { margin: 18px; }
.atool-sent { margin-top: 12px; border: 2px solid var(--ink); border-left: 8px solid var(--yellow); padding: 10px 12px; font: 700 15px/1.4 'Barlow', sans-serif; }

/* ---------- "Help me check this label" overlay ---------- */
.atool-ov { position: fixed; inset: 0; z-index: 50; background: rgba(17, 17, 17, 0); display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow: auto; transition: background 0.2s; }
.atool-ov.on { background: rgba(17, 17, 17, 0.82); }
.atool-ov-card { position: relative; background: var(--white); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--yellow); padding: 20px 18px; max-width: 640px; width: 100%; transform: translateY(16px); opacity: 0; transition: transform 0.22s cubic-bezier(0.3, 0.7, 0.2, 1), opacity 0.2s; }
.atool-ov.on .atool-ov-card { transform: none; opacity: 1; }
.atool-ov-close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border: 2px solid var(--ink); background: var(--white); color: var(--ink); font-size: 16px; cursor: pointer; }
.atool-ov-eyebrow { color: var(--c3); }
.atool-ov-title { font-size: 26px; margin-bottom: 8px; padding-right: 44px; }
.atool-ov-sum { font-size: 15px; line-height: 1.5; margin-bottom: 14px; }
.atool-hint { all: unset; cursor: help; background: color-mix(in srgb, var(--yellow) 45%, white); box-shadow: inset 0 -3px 0 var(--ink); padding: 1px 3px; transition: background 0.12s, color 0.12s; }
.atool-hint small { font-size: 8px; font-weight: 600; margin-left: 5px; color: var(--ink); vertical-align: 1px; }
.atool-hint:hover, .atool-hint:focus-visible, .atool-hint.on { background: var(--ink); color: var(--white); }
.atool-hint:hover small, .atool-hint:focus-visible small, .atool-hint.on small { color: var(--white); }
.atool-hint:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.atool-explain { margin-top: 14px; border: 2px solid var(--ink); border-left: 8px solid var(--ink); padding: 10px 12px; min-height: 64px; }
.atool-explain p { margin-top: 4px; font-size: 15px; line-height: 1.45; }
.atool-explain-k { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.atool-explain-empty { font-size: 14px; color: var(--muted); }
.atool-ov-signup { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ink); display: grid; gap: 10px; justify-items: start; }
.atool-ov-signup p { font: 600 15px 'Barlow', sans-serif; }
.atool-ov-note { margin-top: 14px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .atool-ov, .atool-ov-card, .atool-hint { transition: none; }
  .atool-ov-card { transform: none; }
}

@media (min-width: 720px) {
  .atool-head, .atool-pick, .atool-result { padding-left: 24px; padding-right: 24px; }
  .atool-after-row { grid-template-columns: 1fr 1fr; }
  .atool-after-signup { border-top: 0; border-left: 1px solid var(--ink); }
  .atool-after-row > div, .atool-foot { padding-left: 24px; padding-right: 24px; }
  .atool-email { grid-template-columns: 1fr 1fr; }
  .atool-email .atool-error, .atool-email .btn, .atool-email .atool-fine { grid-column: 1 / -1; }
}
