/* Layout: lab bench. A soft teal-green-blue band states the limits up top; below it,
   the document going in (left) and the compliance report coming out (right). Stacks on phones. */
:root {
  --paper: #eef3f0; --sheet: #ffffff; --ink: #0e1c17; --muted: #4a6157; --rule: #cbdad2; --tint: #f2f6f4;
  --band: #123a2e; --band-leaf: #215a48;
  --band-ink: #ffffff; --band-soft: rgba(255,255,255,.84); --band-hi: #ff9a7a; --band-line: rgba(255,255,255,.06);
  --accent: #1e6b52; --accent-ink: #ffffff; --accent-soft: #dcefe6;
  --pass: #1f7a46; --pass-soft: #e0f2e7; --warn: #a15c00; --warn-soft: #fcefd6; --fail: #b4261b; --fail-soft: #fbe3e0; --info: #3f5664; --info-soft: #e5edf2;
  --on-sem: #ffffff;
  --f-display: "IBM Plex Sans Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 8px;
  --cat-potency: #7b3fb8; --cat-residual_solvents: #1d67b0; --cat-pesticides: #a04c0c; --cat-fungicides: #9a3a2a; --cat-fertilizers: #4e7d1a; --cat-mycotoxins: #7f6200;
  --cat-microbials: #b02a64; --cat-heavy_metals: #4d5b6c; --cat-moisture: #00788a; --cat-foreign_matter: #7a4f2f; --cat-terpenes: #2b7f38; --cat-other: #55626b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0a1511; --sheet: #10201a; --ink: #e2ece7; --muted: #93ab9f; --rule: #22382f; --tint: #142820;
  --band: #0e2e24; --band-leaf: #1a4a3b;
  --band-ink: #f2f8fb; --band-soft: rgba(255,255,255,.84); --band-hi: #ff9a7a; --band-line: rgba(255,255,255,.045);
  --accent: #7fd6b0; --accent-ink: #0a1511; --accent-soft: #163a2d;
  --pass: #5fcf8e; --pass-soft: #12301f; --warn: #f0ae45; --warn-soft: #36280d; --fail: #ff7a6e; --fail-soft: #3d1714; --info: #a6b9c5; --info-soft: #1b2932;
  --on-sem: #0b1318;
  --cat-potency: #c8a2f2; --cat-residual_solvents: #8fc0f2; --cat-pesticides: #f2a86b; --cat-fungicides: #f09a8a; --cat-fertilizers: #a9d36b; --cat-mycotoxins: #e6c75a;
  --cat-microbials: #f28ab7; --cat-heavy_metals: #b3c0cf; --cat-moisture: #6fd0dc; --cat-foreign_matter: #d9ab86; --cat-terpenes: #86d494; --cat-other: #aab6bf;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #0a1511; --sheet: #10201a; --ink: #e2ece7; --muted: #93ab9f; --rule: #22382f; --tint: #142820;
  --band: #0e2e24; --band-leaf: #1a4a3b;
  --band-ink: #f2f8fb; --band-soft: rgba(255,255,255,.84); --band-hi: #ff9a7a; --band-line: rgba(255,255,255,.045);
  --accent: #7fd6b0; --accent-ink: #0a1511; --accent-soft: #163a2d;
  --pass: #5fcf8e; --pass-soft: #12301f; --warn: #f0ae45; --warn-soft: #36280d; --fail: #ff7a6e; --fail-soft: #3d1714; --info: #a6b9c5; --info-soft: #1b2932;
  --on-sem: #0b1318;
  --cat-potency: #c8a2f2; --cat-residual_solvents: #8fc0f2; --cat-pesticides: #f2a86b; --cat-fungicides: #f09a8a; --cat-fertilizers: #a9d36b; --cat-mycotoxins: #e6c75a;
  --cat-microbials: #f28ab7; --cat-heavy_metals: #b3c0cf; --cat-moisture: #6fd0dc; --cat-foreign_matter: #d9ab86; --cat-terpenes: #86d494; --cat-other: #aab6bf;
  color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; }
a { color: var(--accent); font-weight: 500; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* ---------- header band ---------- */
.band {
  color: var(--band-ink);
  /* flat color with a fine film grain, no gradient */
  background-color: var(--band);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  overflow: hidden;
}
.band-in { max-width: 1240px; margin: 0 auto; padding-block: 30px 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 420px); gap: 20px 32px; align-items: end; }
.band-copy { min-width: 0; }
.band .limits { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); }   /* two cards, the same size for every rulebook */
.limits-for { margin: 10px 0 0; font-size: 13px; color: var(--band-soft); max-width: 452px; line-height: 1.4; }   /* which product type the cards show */
.band .eyebrow { color: var(--band-hi); }
.band h1 { font-size: clamp(34px, 5.2vw, 56px); font-weight: 700; line-height: 1; letter-spacing: -0.005em; margin-top: 8px; }
.band p { margin: 12px 0 0; color: var(--band-soft); max-width: 60ch; font-size: 16px; }
.band p b { color: var(--band-ink); font-weight: 600; }
.limits { display: flex; gap: 12px; flex-wrap: wrap; }
.limit { border: 1px solid rgba(255,154,122,.45); border-radius: 10px; padding: 12px 16px 10px; min-width: 150px; background: rgba(255,255,255,.06); }
.limit b { display: block; font-family: var(--f-display); font-size: 34px; font-weight: 700; line-height: 1; color: var(--band-hi); font-variant-numeric: tabular-nums; }
.limit span { display: block; font-size: 13px; color: var(--band-soft); margin-top: 4px; }
.limit small { display: block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--band-soft); opacity: .8; margin-top: 6px; }

/* ---------- main grid ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding-block: 28px 40px; display: grid; gap: 28px; }
.grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
@media (max-width: 920px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 22px; display: grid; gap: 18px; min-width: 0; box-shadow: 0 1px 2px rgba(13,28,37,.04); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.panel-head h2 { font-size: 22px; font-weight: 700; }
.lbl { font-size: 13.5px; font-weight: 700; display: block; margin-bottom: 7px; }
.lbl span { font-weight: 400; color: var(--muted); }

/* samples */
.samples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sample { text-align: left; background: var(--tint); border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; min-width: 0; border-left-width: 4px; }
.sample b { font-weight: 700; font-size: 14.5px; }
.sample span { font-size: 12.5px; color: var(--muted); }
.sample[data-tone="pass"] { border-left-color: var(--pass); }
.sample[data-tone="warn"] { border-left-color: var(--warn); }
.sample[data-tone="fail"] { border-left-color: var(--fail); }
.sample:hover { border-color: var(--accent); }
.sample[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
@media (max-width: 440px) { .samples { grid-template-columns: minmax(0, 1fr); } }

textarea#coa { width: 100%; min-height: 340px; resize: vertical; font-family: var(--f-mono); font-size: 12.5px; line-height: 1.55; background: var(--tint); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; tab-size: 4; white-space: pre; overflow: auto; }
textarea#coa:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.drop { border: 2px dashed var(--rule); border-radius: var(--r); padding: 12px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.drop-note { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.chip button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: 14px; line-height: 1; }

.fetch { margin: 0; }
.fetchrow { display: flex; gap: 8px; }
.fetchrow input { flex: 1; min-width: 0; background: var(--tint); border: 1px solid var(--rule); border-radius: var(--r); padding: 8px 10px; font-family: var(--f-mono); font-size: 12.5px; }
.fetchnote { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

/* local model */
details.localai { border: 1px solid var(--rule); border-radius: var(--r); background: var(--tint); }
details.localai summary { cursor: pointer; padding: 11px 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; list-style: none; }
details.localai summary::-webkit-details-marker { display: none; }
details.localai summary::before { content: "▸"; color: var(--accent); font-size: 12px; transition: transform .15s; }
details.localai[open] summary::before { transform: rotate(90deg); }
.ltitle { font-weight: 700; font-size: 14px; flex: 1; }
.lstate { font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--info-soft); color: var(--info); }
.lstate[data-on="1"] { background: var(--pass); color: var(--on-sem); }
.localbody { padding: 0 14px 14px; display: grid; gap: 12px; }
.localbody .fetchnote { margin: 0; }
.localrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 440px) { .localrow { grid-template-columns: minmax(0, 1fr); } }
.localrow input, .localrow select { width: 100%; min-width: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 7px 9px; font-family: var(--f-mono); font-size: 12.5px; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.notes code { font-family: var(--f-mono); font-size: 12px; background: var(--tint); border: 1px solid var(--rule); border-radius: 4px; padding: 0 4px; overflow-wrap: anywhere; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { border: 1.5px solid var(--rule); background: var(--sheet); border-radius: var(--r); padding: 10px 16px; font-weight: 700; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); padding-inline: 20px; }
.btn.primary:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .55; cursor: default; }
.status { font-size: 13.5px; color: var(--muted); min-height: 1.5em; }
.status.err { color: var(--fail); font-weight: 600; }
.how { font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 14px; margin: 0; }
.how b { color: var(--ink); font-weight: 700; }

/* ---------- verdict ---------- */
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 20px; align-items: center; padding: 20px; border-radius: var(--r); border: 1px solid var(--rule); border-top-width: 6px; background: var(--tint); }
.verdict[data-v="hold"] { background: var(--fail-soft); border-color: var(--fail); }
.verdict[data-v="review"] { background: var(--warn-soft); border-color: var(--warn); }
.verdict[data-v="clear"] { background: var(--pass-soft); border-color: var(--pass); }
.stamp { font-family: var(--f-display); font-weight: 700; font-size: 26px; letter-spacing: 0.12em; text-transform: uppercase; padding: 8px 16px 7px; border-radius: 6px; color: var(--on-sem); white-space: nowrap; transform: rotate(-2deg); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.verdict[data-v="hold"] .stamp { background: var(--fail); }
.verdict[data-v="review"] .stamp { background: var(--warn); }
.verdict[data-v="clear"] .stamp { background: var(--pass); }
.vtext h3 { font-size: 24px; font-weight: 700; line-height: 1.15; }
.vtext p { margin: 4px 0 0; font-size: 14.5px; font-weight: 500; }
.counts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pill { font-family: var(--f-mono); font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.pill.fail { background: var(--fail); color: var(--on-sem); }
.pill.warn { background: var(--warn); color: var(--on-sem); }
.pill.pass { background: var(--pass); color: var(--on-sem); }
.pill.info { background: var(--info-soft); color: var(--info); }
@media (max-width: 480px) { .verdict { grid-template-columns: minmax(0, 1fr); } .stamp { justify-self: start; } }

.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 18px; margin: 0; }
.meta div { min-width: 0; }
.meta dt { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.meta dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }

/* product details */
fieldset.details { border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px 16px; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 16px; background: var(--tint); }
fieldset.details legend { font-family: var(--f-display); font-weight: 700; font-size: 16px; padding: 0 6px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field .row { display: flex; gap: 6px; }
.field input, .field select { width: 100%; min-width: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 7px 9px; font-variant-numeric: tabular-nums; font-weight: 600; }
.field select { width: auto; flex: none; }
.details .note { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); margin: 0; }

/* meters */
.meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 560px) { .meters { grid-template-columns: minmax(0, 1fr); } }
.meter { border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; }
.meter[data-s="pass"] { border-color: color-mix(in srgb, var(--pass) 45%, var(--rule)); }
.meter[data-s="fail"] { border-color: var(--fail); background: var(--fail-soft); }
.meter .k { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.meter .val { font-family: var(--f-display); font-size: 38px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.meter[data-s="pass"] .val { color: var(--pass); }
.meter[data-s="fail"] .val { color: var(--fail); }
.meter[data-s="na"] .val { color: var(--muted); }
.meter .val small { font-size: 16px; font-weight: 600; color: var(--muted); }
.meter .lim { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bar { position: relative; height: 12px; border-radius: 6px; background: var(--tint); border: 1px solid var(--rule); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--pass); transition: width .4s ease; }
.bar.over i { background: var(--fail); }
.bar.na i { width: 0 !important; }
.bar b { position: absolute; top: -1px; bottom: -1px; width: 2px; background: var(--ink); }
.meter .how2 { font-family: var(--f-mono); font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }

/* checks */
.checks { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.check { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 14px; padding: 14px 16px 14px 0; border-top: 1px solid var(--rule); position: relative; }
.check:first-child { border-top: 0; }
.check::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--info); }
.check[data-s="fail"] { background: color-mix(in srgb, var(--fail-soft) 70%, var(--sheet)); }
.check[data-s="warn"] { background: color-mix(in srgb, var(--warn-soft) 60%, var(--sheet)); }
.check[data-s="fail"]::before { background: var(--fail); }
.check[data-s="warn"]::before { background: var(--warn); }
.check[data-s="pass"]::before { background: var(--pass); }
.check .tag { grid-row: span 2; align-self: start; justify-self: start; margin-left: 20px; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.check[data-s="fail"] .tag { background: var(--fail); color: var(--on-sem); }
.check[data-s="warn"] .tag { background: var(--warn); color: var(--on-sem); }
.check[data-s="pass"] .tag { background: var(--pass-soft); color: var(--pass); }
.check[data-s="info"] .tag { background: var(--info-soft); color: var(--info); }
.check h4 { margin: 0; font-size: 15.5px; font-weight: 700; font-family: var(--f-body); line-height: 1.35; }
.check p { margin: 0; font-size: 13.5px; color: var(--muted); max-width: 70ch; }
.check p strong { color: var(--ink); }
.check cite { font-style: normal; font-family: var(--f-mono); font-size: 11.5px; }
@media (max-width: 480px) { .check { grid-template-columns: minmax(0, 1fr); padding-left: 20px; } .check .tag { grid-row: auto; margin-left: 0; } }

/* data tables */
details.data { border: 1px solid var(--rule); border-radius: var(--r); }
details.data summary { cursor: pointer; padding: 12px 16px; font-family: var(--f-display); font-weight: 700; font-size: 16px; }
details.data .inner { padding: 0 16px 16px; display: grid; gap: 16px; }
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
td.num { font-family: var(--f-mono); }
tr.bad td { color: var(--fail); font-weight: 700; }
.ptitle { font-weight: 700; font-size: 14px; margin: 4px 0 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ptitle .sub { font-weight: 400; font-size: 12px; color: var(--muted); }
.mini { font-family: var(--f-mono); font-size: 10.5px; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; font-weight: 600; }
.mini.pass { background: var(--pass-soft); color: var(--pass); } .mini.fail { background: var(--fail); color: var(--on-sem); } .mini.nt, .mini.reported { background: var(--info-soft); color: var(--info); }
.thcmark { color: var(--accent); font-family: var(--f-mono); }

.foot-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Ask about this result ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* read by screen readers, not shown */
.ask { border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; background: var(--sheet); }
.ask-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.ask-head h3 { font-size: 17px; font-weight: 700; margin: 0; }
.askrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.askrow input { flex: 1 1 200px; min-width: 0; background: var(--tint); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r); padding: 9px 12px; min-height: 40px; font: inherit; }
.askrow input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.askrow input:disabled { opacity: .6; }
.ask-out { font-size: 14px; display: grid; gap: 6px; }
.ask-note { margin: 0; color: var(--muted); font-size: 13px; }
.ask-q { margin: 0; font-weight: 700; }
.ask-a { margin: 0; white-space: pre-wrap; }
.suggest { border: 1px solid var(--rule); background: var(--tint); color: var(--ink); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; min-height: 28px; margin: 2px 2px 0 0; }
.suggest:hover { border-color: var(--accent); }
.suggest:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* notes */
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px 32px; border-top: 2px solid var(--ink); padding-top: 22px; }
.notes h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--accent); }
.notes p, .notes li { font-size: 13.5px; color: var(--muted); margin: 0 0 6px; }
.notes p b { color: var(--ink); }
.notes ul { margin: 0; padding-left: 18px; }

.foot { border-top: 1px solid var(--rule); padding-top: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; font-size: 13px; color: var(--muted); }
.foot b { color: var(--ink); font-weight: 700; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- header art: trichomes under the microscope ---------- */
.band-art { align-self: center; display: flex; justify-content: center; min-width: 0; }
.crew { width: 100%; max-width: 330px; height: auto; display: block; }
.crew .lensbg { fill: #0d2c22; }
.crew .rim { fill: none; stroke: #f6f1e8; stroke-width: 7; }
.crew .ticks line { stroke: #f6f1e8; stroke-width: 1.4; }
.crew .scale line { stroke: #ff9a7a; stroke-width: 3; stroke-linecap: round; }
.crew .scale text { fill: #ff9a7a; font: 600 10px var(--f-mono); text-anchor: middle; }
.crew .surface { fill: #2f6a52; }
.crew .epi { fill: #3c7d61; stroke: #2a5e48; stroke-width: 1; }
.crew .stalk { fill: #b7e6d0; }
.crew .stalkhi { fill: none; stroke: #ffffff; stroke-width: 2; stroke-linecap: round; opacity: .35; }
.crew .bg .stalk { fill: #3f7d63; } .crew .bg .stalkhi { opacity: .12; }
.crew .bg .membrane { opacity: .55; } .crew .bg .gloss { opacity: .45; }
.crew .disc { fill: #6fbf9c; opacity: .35; }
.crew .gloss { fill: #ffffff; opacity: .75; }
/* eyes: white rim, dark pupil, a highlight; the pupil follows the pointer */
.crew .sclera { fill: #ffffff; }
.crew .dot { fill: #1d1533; transform-box: fill-box; transform-origin: 50% 50%; transition: transform .2s ease; }
.crew .glint { fill: #ffffff; }
.crew .happy { fill: none; stroke: #1d1533; stroke-width: 2.6; stroke-linecap: round; opacity: 0; }
.crew .open, .crew .happy { transition: opacity .15s ease; }
.crew .head, .crew .eye { transform-box: fill-box; transform-origin: 50% 50%; }
.crew .fg .head { transform-origin: 50% 100%; }
/* blink */
.crew .tri.blink .eye { animation: crew-blink .18s ease-in-out; }
@keyframes crew-blink { 50% { transform: scaleY(.1); } }
/* a little wobble when you hover one */
.crew .fg:hover .head { animation: crew-bob .5s ease; }
@keyframes crew-bob { 30% { transform: translateY(-5px) rotate(-3deg); } 65% { transform: translateY(1px) rotate(2deg); } }
/* moods follow the verdict, told with the eyes only */
.band-art[data-mood="clear"] .open { opacity: 0; }
.band-art[data-mood="clear"] .happy { opacity: 1; }
/* review and hold: header-art.js lowers a lid line and clips the eye under it (skeptical squint, or sad) */
.crew .lid { fill: none; stroke: #1d1533; stroke-linecap: round; opacity: 0; }
.band-art[data-mood="review"] .lid { opacity: 1; }
.band-art[data-mood="hold"] .lid { opacity: 1; }
/* hold: sad eyes and a tear */
.crew .tear { fill: #9ad8ff; stroke: #ffffff; stroke-width: .6; opacity: 0; transition: opacity .3s ease; }
.band-art[data-mood="hold"] .tear { opacity: .95; }
/* clear: an excited face. happy eyes, rosy cheeks, and sparkles that twinkle */
.crew .blush { fill: #ff8fa3; opacity: 0; transition: opacity .3s ease; }
.band-art[data-mood="clear"] .blush { opacity: .5; }
.crew .spark { fill: #fff6c9; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; transition: opacity .3s ease; }
.band-art[data-mood="clear"] .spark { opacity: .95; animation: crew-twinkle 1.6s ease-in-out infinite; }
@keyframes crew-twinkle { 50% { transform: scale(.55) rotate(20deg); opacity: .55; } }
.band-art.react .fg .head { animation: crew-hop .45s cubic-bezier(.3,1.6,.5,1); }
.band-art.react .milky .head { animation-delay: .06s; } .band-art.react .amber .head { animation-delay: .12s; }
@keyframes crew-hop { 40% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .crew .head, .crew .eye, .crew .spark { animation: none !important; } }
@media (max-width: 760px) {
  .band-in { grid-template-columns: minmax(0, 1fr); }
  .band-art { order: -1; justify-content: flex-end; margin: -10px 0 -6px; }
  .crew { max-width: 170px; }
}

/* ---------- category colors: one hue per kind of test ---------- */
[data-cat] { --c: var(--cat-other); }
[data-cat="potency"] { --c: var(--cat-potency); } [data-cat="residual_solvents"] { --c: var(--cat-residual_solvents); }
[data-cat="pesticides"] { --c: var(--cat-pesticides); } [data-cat="fungicides"] { --c: var(--cat-fungicides); }
[data-cat="fertilizers"] { --c: var(--cat-fertilizers); } [data-cat="mycotoxins"] { --c: var(--cat-mycotoxins); }
[data-cat="microbials"] { --c: var(--cat-microbials); } [data-cat="heavy_metals"] { --c: var(--cat-heavy_metals); }
[data-cat="moisture"] { --c: var(--cat-moisture); } [data-cat="foreign_matter"] { --c: var(--cat-foreign_matter); }
[data-cat="terpenes"] { --c: var(--cat-terpenes); }
.catblock { border-left: 4px solid var(--c); padding-left: 12px; }
.catblock .ptitle { font-family: var(--f-display); font-size: 19px; font-weight: 700; color: var(--c); margin: 2px 0 6px; letter-spacing: .005em; }
.catblock .ptitle .term { text-decoration-color: color-mix(in srgb, var(--c) 60%, transparent); }
.catblock .ptitle .sub { font-family: var(--f-body); color: var(--muted); }

/* ---------- the mini trichome: a small copy of the tall one once the header has scrolled away ---------- */
.band-art.crew-mini { display: block; flex: none; order: 0; margin: 0 0 0 auto; width: 40px; height: 40px; pointer-events: none;
  opacity: 0; transform: translateY(-6px) scale(.7); transition: opacity .25s ease, transform .3s cubic-bezier(.3,1.5,.5,1); }
.band-art.crew-mini.show { opacity: 1; transform: none; }
.crew-mini .crew { width: 100%; max-width: none; height: 100%; overflow: visible; }
.crew-mini .mini-bg { fill: var(--band); stroke: #f6f1e8; stroke-width: 3; }
.crew-mini ~ .secnav-rule { margin-left: 0; }
/* on pages without a sticky nav it sits in the bottom corner, clear of the content's edge */
.band-art.crew-mini.corner { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 30; width: 52px; height: 52px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
@media (prefers-reduced-motion: reduce) { .band-art.crew-mini { transition: opacity .2s linear; transform: none; } }
