/* The certificate rows and the COA library's rules (P6, 13 Nov 2026: moved out of site.css, line for line and in their
   order, for its budget): the COA search, results and empty states, the certificate rows, the lab link, the batch history, the /coa product
   block, the certificate card (one card, /coa and the product page) and the batch tabs (owner's references, 13 Nov 2026).
   Loaded only by /coa (src/site/coa.js) and the product pages (src/site/product.js, whose batch history and lab links
   are coa.js's), right after site.css. Tokens live in site.css's :root and both dark blocks. Rules that a later
   site.css rule refines (.coa-chip, its tabular figures; .coa-product__media, its narrow-screen size) stay in site.css,
   so the order between them holds. */
.coa-empty__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 24px; width: 100%; margin: 10px 0 0; padding: 0; list-style: none; }   /* W-10 */
.coa-empty__list li { display: grid; font-size: .875rem; } .coa-empty__list span { color: var(--muted); overflow-wrap: anywhere; }
.coa-search { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: end; margin-bottom: 28px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.coa-search__field { display: grid; gap: 6px; }
.coa-search__field label { font: 600 .8125rem/1.4 var(--font-body); color: var(--muted); }
.coa-search__field input, .coa-search__field select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); font: 400 1rem/1.4 var(--font-body); }
.coa-search__field input:focus-visible, .coa-search__field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coa-search__actions { display: flex; align-items: center; gap: 16px; }
@media (min-width: 768px) { .coa-search { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; } }
.coa-count { font-size: .8125rem; color: var(--muted); margin: 0 0 10px; }
.coa-list { list-style: none; margin: 0; padding: 0; }
/* 0018 "View at lab": the lab's own page beside View COA, with its printed access code; neutral (never green). */
.lab-link { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lab-link__open { display: inline-flex; align-items: center; gap: 6px; }
.lab-link__open svg { width: 16px; height: 16px; flex: none; }
.lab-link__code { font-size: .8125rem; color: var(--muted); }
.lab-link__code code { padding: 2px 8px; border-radius: var(--radius-button); background: var(--band); color: var(--ink); font-size: .8125rem; user-select: all; }
.coa-product__media .vial-stage { --vial-zoom: 1.04; --vial-origin: 50% 52%; cursor: default; }
.coa-product__media .vial-stage[data-base="10ml"] { --vial-zoom: 1; --vial-origin: 50% 46%; }
/* C3 idea 13 (product page): the batch history, the /coa tabs and cards. */
.product-history { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.product-history > h2 { margin: 0 0 12px; font-size: 1.25rem; }
/* /coa's cards (owner, 13 Nov 2026): the baked upright still for each theme as plain images (src/site/coa.js vialHtml); one shows at a time. */
.coa-stage > img[data-theme-still="dark"] { display: none; }
:root[data-theme="dark"] .coa-stage > img[data-theme-still="light"] { display: none; }
:root[data-theme="dark"] .coa-stage > img[data-theme-still="dark"] { display: block; }
/* The /coa product block (owner's layout reference, 13 Nov 2026): each product is one rounded block; its head (the vial still,
   the name, one line, the kicker) over a rule, then the tabs and the card grid inside it. */
/* The owner, 14 Nov 2026 ("had vials side by side"): the product blocks sit side by side, two to a row where they fit
   (each at least 588 px, so two cards with one-line pills fit inside), one per row on phones; each block, its tabs and its cards are as built (owner's 13 Nov ref). */
[data-coa-state="results"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 588px), 1fr)); gap: 24px; align-items: start; }
[data-coa-state="results"] > .coa-count { grid-column: 1 / -1; margin-bottom: 0; }
[data-coa-state="results"] > .coa-product { margin-top: 0; }
[data-coa-state="results"] .cert-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr)); }   /* C3: two cards side by side inside a 2-up block; 268 px keeps the widest pill row (228 px) on one line */
@media (min-width: 700px) { [data-coa-state="results"] .coa-product__head, [data-coa-state="results"] .coa-product__body { padding-left: 16px; padding-right: 16px; } }   /* the block min below assumes 16 px sides; phones unchanged */
.coa-product { margin-top: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; }
.coa-product:first-child { margin-top: 0; }
.coa-product__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.coa-product__head:not(:has(.coa-product__media)) { grid-template-columns: minmax(0, 1fr); }
.coa-product__id { display: grid; gap: 6px; min-width: 0; }
.coa-product__name { margin: 0; font: 700 clamp(1.25rem, 1.1rem + .5vw, 1.5rem)/1.2 var(--font-display); overflow-wrap: anywhere; }
.coa-product__name a { color: inherit; text-decoration: none; }
.coa-product__name a:hover { color: var(--accent); }
.coa-product__line { margin: 0; font-size: .875rem; color: var(--muted); }
.coa-product__kicker { margin: 2px 0 0; font: 700 .6875rem/1.3 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.coa-product__body { padding: 8px 24px 24px; }
.coa-product__body > .cert-grid { margin-top: 18px; }
@media (max-width: 599px) { .coa-product__head { gap: 14px; padding: 16px; } .coa-product__body { padding: 4px 16px 18px; } }
/* THE certificate card (owner's references, 13 Nov 2026: the product page's "Every batch on record" card with the two green
   pills), one component on /coa and the product page (src/site/coa.js certCardHtml). No shadow; the border on hover. Green
   only on a pass (the figure, its check and the solid pills, white figures: the owner's ruling) and the View COA tint;
   View at lab in --info; the accent only for links and focus. */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.cert-card { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }   /* its hover border switches at once (C3, hard rule 1: no animated colour) */
@media (hover: hover) { .cert-card:hover { border-color: var(--line-strong); } }
.cert-card--current { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.cert-card__tag { position: absolute; top: -10px; left: 14px; display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: linear-gradient(135deg, var(--ok-fill-from), var(--ok-fill-to)); color: #fff; font: 700 .625rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.cert-card__title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 4px 0 0; font: 600 .9375rem/1.3 var(--font-body); color: var(--ink); overflow-wrap: anywhere; }
.cert-card__latest { flex: none; font: 700 .625rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ok); }
.cert-card__lot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; margin: -8px 0 -4px; font: 500 .6875rem/1.4 var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cert-card__lot code { font: 500 .75rem/1.4 var(--font-mono); letter-spacing: 0; text-transform: none; color: var(--muted); background: none; padding: 0; overflow-wrap: anywhere; }
.cert-card__version { display: block; letter-spacing: 0; text-transform: none; }
.cert-card__share { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.cert-card__head { display: grid; gap: 10px; justify-items: start; }
.cert-card__purity { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
.cert-card__circle { grid-row: span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--ok) 55%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); color: var(--ok); }
.cert-card__circle svg { width: 18px; height: 18px; }
.cert-card__figure { font: 700 2.125rem/1 var(--font-display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ok); }
.cert-card__purity--plain .cert-card__figure { color: var(--ink); }
.cert-card__pct { font-size: .5em; }
.cert-card__by { font: 400 .75rem/1.35 var(--font-body); color: var(--muted); }
.cert-card__purity--plain .cert-card__by { grid-column: 1 / -1; }
.cert-card__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cert-card__badge { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 11px; border-radius: 999px; background: var(--ok-fill-to) linear-gradient(135deg, var(--ok-fill-from) 0%, var(--ok-fill-to) 100%); color: #fff; font: 700 .8125rem/1.35 var(--font-body); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(18, 107, 63, .25); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cert-card__badge svg { width: 14px; height: 14px; flex: none; }
.cert-card__badge small { font: 600 .6875rem/1 var(--font-body); letter-spacing: .02em; opacity: .92; }
.cert-card__badge--plain { background: transparent; border: 1px solid var(--line-strong); color: var(--ink); box-shadow: none; }
.cert-card__onfile { margin: 0; font: 600 .9375rem/1.4 var(--font-body); color: var(--muted); }
.cert-card__rows { margin: 0; padding: 0; }
.cert-card__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); font-size: .8125rem; }
.cert-card__row dt { color: var(--muted); }
.cert-card__row dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cert-card__row code { font: 600 .8125rem/1.3 var(--font-mono); color: var(--ink); background: none; padding: 0; }
.cert-card__foot { margin: 0; font: 400 .75rem/1.4 var(--font-body); color: var(--faint); }
.cert-card__actions { display: grid; gap: 8px; margin-top: auto; padding-top: 4px; }
.cert-card__btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid; border-radius: var(--radius-button); font: 600 .875rem/1.2 var(--font-body); text-decoration: none; white-space: nowrap; }
.cert-card__btn svg { width: 16px; height: 16px; flex: none; }
.cert-card__btn--coa { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.cert-card__btn--lab { background: color-mix(in srgb, var(--info) 12%, transparent); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }
/* Hover: the 18% tint, with the text drawn 20% toward the ink so it keeps AA on the deeper tint (5.4:1 light, 6.6:1 dark). */
.cert-card__btn--coa:hover { background: color-mix(in srgb, var(--ok) 18%, transparent); color: color-mix(in srgb, var(--ok) 80%, var(--ink)); }
.cert-card__btn--lab:hover { background: color-mix(in srgb, var(--info) 18%, transparent); color: color-mix(in srgb, var(--info) 80%, var(--ink)); }
.cert-card__btn:focus-visible, .coa-tab:focus-visible, .coa-product__name a:focus-visible, .coa-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The batch tabs inside a product block (coa-tabs.js): underlined tabs over a rule; without the script both panels show,
   each under its heading. */
.coa-tabs__list { display: flex; gap: 20px; max-width: 100%; margin: 0 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.coa-tabs__list[hidden] { display: none; }
.coa-tab { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-bottom: -1px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 600 .875rem/1 var(--font-body); white-space: nowrap; cursor: pointer; }
.coa-tab:hover { color: var(--ink); }
.coa-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.coa-tab__count { font-variant-numeric: tabular-nums; }
.coa-panel + .coa-panel { margin-top: 28px; }
.coa-tabs.is-tabbed .coa-panel + .coa-panel { margin-top: 0; }
.coa-panel__title { display: flex; align-items: center; gap: 4px; margin: 0 0 12px; font: 600 .9375rem/1.3 var(--font-body); color: var(--ink); }
.coa-tabs.is-tabbed .coa-panel__title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.coa-panel__empty { margin: 0; padding: 16px 0; font-size: .875rem; color: var(--muted); }
/* Share (in place of Copy, 13 Nov 2026): an icon button beside the lot; 44 px under a coarse pointer; "Link copied" beside it. */
.coa-share { display: inline-grid; place-items: center; width: 32px; height: 32px; margin: -4px 0; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; vertical-align: middle; }
.coa-share[hidden] { display: none; }
.coa-share svg { width: 16px; height: 16px; }
.coa-share:hover { background: var(--surface-2); color: var(--ink); }
.coa-share:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.coa-share__status:not(:empty) { font: 600 .75rem/1.3 var(--font-body); color: var(--ok); }
@media (pointer: coarse) { .coa-share { width: 44px; height: 44px; margin: -10px -8px -10px 0; } }
/* The guide links under /coa's intro (four since the guides, 13 Nov 2026): a wrapping row; on phones one row of pills that
   scrolls sideways, so the batch field below stays where it was (C4: four stacked links pushed it about 110 px down). */
.coa-guide-link { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.coa-guide-link .text-link { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; }
@media (max-width: 599px) {
  .coa-guide-link { flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; }
  .coa-guide-link::-webkit-scrollbar { display: none; }
  .coa-guide-link .text-link { flex: none; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .8125rem; white-space: nowrap; text-decoration: none; }
}
/* A2 (C4 sweep, 15 Nov 2026): the scan card's space is held before scan-landing.js fills it (CLS 0.28 laptop, 0.63 phone), and cert-match's late vial goes last, pushing nothing on screen. */
.js [data-scan-landing]:has(+[data-coa-state=results] [data-coa-cert]){display:flow-root;min-height:672px}
[data-scan-landing] .sl-side>.cm{order:1;padding:14px 0 0;border-bottom:0;border-top:1px solid var(--line)}
@media (max-width:1099px){.js [data-scan-landing]:has(+[data-coa-state=results] [data-coa-cert]){min-height:742px}}
@media (max-width:899px){.js [data-scan-landing]:has(+[data-coa-state=results] [data-coa-cert]){min-height:860px}[data-scan-landing] .sl-body{row-gap:12px}[data-scan-landing] .sl-side{display:contents}[data-scan-landing] .sl-side>*{order:-1}[data-scan-landing] .sl-card{margin:12px 0}}
