/* The ingredient checker's own parts, on top of /kit/kit.css (rules in tools/web-tools/DESIGN.md).
   Colours, radii and type sizes are the kit's. */

/* One column, a little narrower than the kit's page, so the tool and its result read as one thing. */
.checker-page { max-width: calc(880px + 2 * var(--gutter)); }
.checker-page .hero { padding-bottom: 20px; }
.checker-page .hero > nav { order: -2; }
.checker-also { justify-content: flex-start; margin-top: 16px; }
.checker-also .chip { background: var(--paper); box-shadow: var(--cast-low); color: var(--muted); }
.checker-also .chip:hover { background: var(--paper); color: var(--ink); }
.checker__hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.checker__offscreen { position: fixed; top: 0; left: -200vw; }

/* ── Product-search-first input area ─────────────────────────────── */
.checker__find { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 10px 0 18px; border: 1px solid transparent; border-radius: var(--capsule); background: var(--fill); transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.checker__find:focus-within { background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.checker__glass { flex-shrink: 0; fill: none; stroke: var(--faint); stroke-width: 2.2; stroke-linecap: round; }
.checker__product { flex: 1; min-width: 0; min-height: 54px; border: 0; background: transparent; font-size: 16.5px; -webkit-appearance: none; appearance: none; }
.checker__product:focus, .checker__input:focus { outline: 0; }
.checker__product::placeholder, .checker__input::placeholder { color: var(--faint); }
.checker__product::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.checker__x { width: 36px; height: 36px; flex-shrink: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.checker__x:hover { background: var(--outline); color: var(--ink); }
.checker__matches { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 8px); max-height: 280px; overflow-y: auto; border-radius: 20px; background: var(--paper); box-shadow: var(--cast), 0 0 0 1px var(--hairline); list-style: none; padding: 6px; }
.checker__match { display: block; width: 100%; border: 0; border-radius: 14px; background: none; padding: 10px 14px; text-align: left; font: inherit; font-size: 15.5px; line-height: 21px; color: var(--ink); cursor: pointer; }
li.checker__match { color: var(--muted); cursor: default; }
.checker__match--action { color: var(--accent); font-weight: 600; }
.checker__match:hover, .checker__match.is-on { background: var(--fill); }
li.checker__match:hover { background: none; }

/* Secondary pills directly below the search bar */
.checker__sub { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.checker.is-paste-open #checker-toggle-paste { background: var(--ink); color: var(--surface); }

/* Compact picked product row (keeps raw ingredient wall out of the way) */
.checker__picked { margin-top: 12px; padding: 10px 14px; border-radius: 18px; background: var(--accent-wash); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14.5px; color: var(--ink-soft); }
.checker__picked-name { flex: 1 1 200px; min-width: 0; font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.checker__picked-actions { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.checker__textbtn { border: 0; background: none; padding: 4px 2px; font-size: 14px; font-weight: 650; color: var(--accent); cursor: pointer; }
.checker__textbtn:hover { text-decoration: underline; }
.checker__textbtn--muted { color: var(--muted); }
.checker__textbtn--muted:hover { color: var(--ink); }

/* Progressive paste drawer */
.checker__paste { margin-top: 14px; }
.checker__box { position: relative; border: 1px solid transparent; border-radius: 22px; background: var(--fill); transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.checker__box:focus-within { background: var(--paper); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.checker__input { display: block; width: 100%; min-height: 124px; border: 0; border-radius: 22px; background: transparent; padding: 16px 18px; font-size: 16.5px; line-height: 1.5; resize: vertical; }
.checker__bar { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.checker #checker-clear { display: none; }
.checker.has-list #checker-clear { display: inline-flex; }

.checker__status { margin-top: 12px; font-size: 14.5px; color: var(--muted); }
.checker__status:empty { display: none; }
.checker .note { margin-top: 14px; }

/* ── The result: each part in its own card ───────────────────────── */
.checker-result { margin-top: 18px; display: grid; gap: 16px; }
.checker-result > .paper + .paper { margin-top: 0; }
.checker-offer { margin-top: clamp(32px, 4vw, 48px); }
.checker-offer .get-card { margin-top: 0; }
.checker-card { min-width: 0; }
.checker-card__title { margin-bottom: 8px; text-wrap: balance; }

/* The summary: the verdict with Share + Copy beside it, any note, then the nine tiles. */
.checker-summary__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 20px; }
.checker-summary .verdict { align-items: flex-start; flex: 1 1 300px; min-width: 0; }
.checker-summary .verdict__words { overflow-wrap: anywhere; }
.checker-summary .verdict.is-plain .verdict__dot { background: var(--muted); }
.checker-summary__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-shrink: 0; }
.checker__note { margin-top: 16px; border-radius: var(--radius-tile); background: var(--fill); padding: 12px 16px; font-size: 14.5px; line-height: 1.45; color: var(--ink-soft); overflow-wrap: anywhere; }
.checker__note + .checker__note { margin-top: 8px; }
.checker__next-tool { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline); font-size: 14.5px; color: var(--muted); }
.checker__next-tool a { font-weight: 650; text-decoration: none; }
.checker__next-tool a:hover { text-decoration: underline; }

.checker__checks { margin-top: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.checker__checks .check { min-height: 0; padding: 13px 15px; gap: 4px; }
.checker__checks .check.is-flag { background: #FFF2EC; }
.checker__checks dd { margin: 0; }
.checker__checks dt { overflow-wrap: anywhere; }
.checker__checks .check__value { font-size: 18px; }
.checker__checks .check__value.is-plain { color: var(--ink); }
.checker__sign { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--positive); color: var(--surface); }
.check__value.is-flag .checker__sign { background: var(--tone-coral-ink); }
.check__value.is-plain .checker__sign { background: var(--faint); }
.checker__sign svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.checker__checks .check__detail { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* Rows: a number for the place in the list, the name, then one line per reason. */
.checker-result .rows { list-style: none; }
.checker-result .row { align-items: flex-start; min-height: 0; padding: 14px 0; }
.checker-result a.row__name { color: var(--ink); text-decoration: underline; text-decoration-color: var(--outline); text-underline-offset: 3px; }
.checker-result a.row__name:hover { text-decoration-color: var(--ink); }
.checker__place { width: 28px; height: 28px; margin-top: -2px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--fill); font-size: 12.5px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.checker__why { display: block; margin-top: 2px; font-size: 14.5px; line-height: 1.45; }
.checker__kind { margin-right: 2px; font-size: 13px; font-weight: 650; color: var(--tone-coral-ink); white-space: nowrap; }
.checker__kind.is-quiet { color: var(--muted); }
.checker__source { color: var(--muted); font-weight: 600; }
.checker__source:hover { color: var(--ink); }

.checker__contents .row { padding: 11px 0; }
.checker__contents .row__under { font-size: 14px; }
.checker__tags { max-width: 46%; gap: 5px; }
.checker__tags .chip { min-height: 24px; padding: 2px 9px; font-size: 12.5px; }
.checker__tags .chip.is-pending { color: var(--faint); }
.checker__work { padding-top: 3px; font-size: 13px; font-weight: 600; color: var(--muted); }
.checker__all { margin-top: 10px; width: 100%; }

.checker-result .chips { list-style: none; margin-top: 6px; }
.checker__source-line { margin-top: 14px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.checker__source-line a { color: inherit; }

@media (max-width: 859px) {
  .checker-page .hero__art { display: none; }
}

@media (max-width: 560px) {
  .checker-page .hero { padding: 12px 0 18px; }
  .checker-page .hero__title { font-size: clamp(34px, 8.8vw, 88px); }
  .checker-page .hero__ask { margin-bottom: 8px; font-size: 18px; }
  .checker-page .hero__lede { margin-top: 12px; font-size: 16px; }
  .checker__input { min-height: 116px; }
  .checker__bar .button { flex: 1 1 auto; }
  .checker__checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checker__checks .check__value { font-size: 16.5px; }
  .checker__checks .check__detail { display: none; }
  .checker-summary__actions { width: 100%; }
  .checker-summary__actions .button { flex: 1 1 auto; }
  .checker__contents .row { flex-wrap: wrap; row-gap: 8px; }
  .checker__contents .row__words { flex-basis: calc(100% - 42px); }
  .checker__tags { max-width: none; width: 100%; justify-content: flex-start; padding-left: 42px; }
}
