:root {
  --ink: #172b2f;
  --muted: #526368;
  --brand: #075d66;
  --brand-dark: #06474e;
  --line: #c9d1cf;
  --line-strong: #82918e;
  --neutral: #f3f5f4;
  --danger: #9b1c31;
  --danger-bg: #fff7f7;
  --warning: #7a4b00;
  --warning-bg: #fff9e8;
  --historical: #5b5064;
  --info: #315d72;
  --focus: #f2b544;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;
  --wide: 72rem; --reading: 45rem; --task: 42rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font: 1rem/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
}
h1, h2, h3 { line-height: 1.18; letter-spacing: -.015em; }
h1 { font-size: clamp(2.1rem, 5vw, 3rem); margin: 0 0 var(--s4); max-width: 18ch; }
h2 { font-size: clamp(1.55rem, 3vw, 2rem); margin: 0 0 var(--s4); }
h3 { font-size: 1.15rem; margin: var(--s5) 0 var(--s2); }
p { max-width: 72ch; }
a { color: var(--brand-dark); font-weight: 700; text-underline-offset: .15em; }
button, input, textarea { font: inherit; }
button { min-height: 44px; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
[id], h1, h2, h3, [tabindex="-1"] { scroll-margin-top: 5.5rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: var(--s2); left: var(--s2); z-index: 100; padding: var(--s3) var(--s4); background: #fff; border: 2px solid var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

/* Product masthead */
.site-header { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: var(--s6); padding: var(--s2) max(1.25rem, calc((100% - var(--wide))/2)); border-bottom: 1px solid var(--line); background: #fff; }
.brand { flex: none; color: var(--ink); text-decoration: none; }
.brand > span { display: flex; flex-direction: column; line-height: 1.12; }
.brand strong { font-size: 1.25rem; letter-spacing: -.025em; }
.brand small { margin-top: .15rem; color: var(--muted); font-size: .72rem; font-weight: 600; }
.site-header nav { margin-left: auto; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav { display: flex; align-items: center; gap: clamp(var(--s4), 2vw, var(--s5)); }
.site-header nav a, .more-menu summary { display: flex; align-items: center; min-height: 44px; padding: var(--s2) 0; white-space: nowrap; color: var(--ink); font-weight: 650; }
.site-header nav a[aria-current="page"] { text-decoration-thickness: 3px; }
.more-item { position: relative; }
.more-menu summary { cursor: pointer; list-style: none; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu summary::after { content: "+"; margin-left: var(--s2); }
.more-menu[open] summary::after { content: "−"; }
.secondary-nav { position: absolute; z-index: 20; top: 100%; right: 0; min-width: 14rem; padding: var(--s2) var(--s4) !important; background: #fff; border: 1px solid var(--line-strong); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.secondary-nav a { padding: var(--s2) 0 !important; }
.menu-button { display: none; padding: var(--s2) var(--s3); background: #fff; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 4px; font-weight: 700; }

main { padding: 0 1.25rem; }
.hero, .card, .results, .disclosure, .content-section, .about, .page { width: 100%; max-width: var(--wide); margin-inline: auto; }

/* Primary service transaction */
.hero { padding: var(--s7) 0 var(--s5); }
.hero > * { max-width: var(--task); }
.lede { margin: 0 0 var(--s5); color: var(--muted); font-size: 1.15rem; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); width: min(100%, 25rem); }
.primary, .secondary, .button, .manual-action, .text-button, .demo-card {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: .7rem 1rem; border: 2px solid transparent; border-radius: 5px;
  font-weight: 750; text-decoration: none;
}
.primary, .button--primary { color: #fff; background: var(--brand); }
.primary:hover, .button--primary:hover { background: var(--brand-dark); }
.scan-action { width: 100%; font-size: 1.08rem; }
.choice { align-self: center; color: var(--muted); font-size: .9rem; }
.manual-action, .text-button, .button--text { min-height: 44px; padding: .35rem 0; color: var(--brand-dark); background: transparent; text-decoration: underline; }
.secondary, .button--secondary { color: var(--ink); background: #fff; border-color: var(--line-strong); }
.data-facts { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.data-facts p { margin: var(--s1) 0; }
.update-note { font-weight: 600; }

/* Working states are grouped; ordinary content is not. */
.card, .results { max-width: var(--task); margin: var(--s5) auto var(--s6) max(0px, calc((100% - var(--wide))/2)); padding: var(--s5); border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.manual-card h2, .progress h2 { margin-bottom: var(--s2); }
label { display: block; margin-top: var(--s5); font-weight: 750; }
label + small, #barcode-help { display: block; color: var(--muted); margin: var(--s1) 0 var(--s2); }
input, textarea { width: 100%; padding: .65rem .75rem; border: 2px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink); }
input { min-height: 3.25rem; font-size: 1.1rem; }
textarea { resize: vertical; }
input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { min-height: 1.5rem; margin: var(--s2) 0; color: var(--danger); font-weight: 700; }
.field-error:not(:empty), .feedback-error { padding-left: var(--s3); border-left: 4px solid var(--danger); }
.check-action { margin-top: var(--s2); }
.actions, .result-actions, .verification-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }
button:disabled { opacity: .55; cursor: not-allowed; }

.progress ol { list-style: none; padding: 0; margin: 0; }
.progress li { position: relative; padding: var(--s2) 0 var(--s2) var(--s5); color: var(--muted); }
.progress li::before { content: "○"; position: absolute; left: 0; font-weight: 800; }
.progress li.done { color: #1b6141; }
.progress li.done::before { content: "✓"; }
.progress li.active { color: var(--ink); font-weight: 800; }
.progress li.active::before { content: "•"; }
.product { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: var(--s4); }
.product img, .image-placeholder { width: 88px; height: 88px; object-fit: contain; border: 1px solid var(--line); background: var(--neutral); }
.image-placeholder { display: grid; place-items: center; font-size: 1rem; color: var(--muted); }
.product h3 { margin-top: 0; }
.product p { margin: var(--s1) 0; }

/* Results: status through rules, language and hierarchy—not oversized icon cards. */
.results { padding: 0; border: 0; }
.product-identity { padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.product-identity h3 { display: inline; margin-left: var(--s2); }
.result { margin-top: var(--s5); border: 1px solid var(--line-strong); border-top: 8px solid var(--info); border-radius: 6px; background: #fff; }
.result--critical { border-top-color: var(--danger); }
.result--warning, .result--warning-critical { border-top-color: var(--warning); }
.result--historical { border-top-color: var(--historical); }
.result--neutral-result { border-top-color: var(--info); }
.result--failure { border-top-color: #6b3037; }
.result-banner { padding: var(--s5) var(--s5) 0; color: var(--ink); background: transparent; }
.result-banner > .icon { display: none; }
.result-label { margin: 0 0 var(--s2); color: var(--muted); font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.result--critical .result-label { color: var(--danger); }
.result-heading { max-width: 24ch; margin: 0; font-size: clamp(1.75rem, 4vw, 2.35rem); }
.result-summary, .result-details { padding: var(--s4) var(--s5) var(--s5); }
.result-summary > :first-child, .result-details > :first-child { margin-top: 0; }
.result-instruction { max-width: 60ch; font-size: 1.12rem; font-weight: 800; }
.button--critical { color: #fff; background: var(--danger); }
.button--neutral { color: #fff; background: var(--info); }
.button--warning { color: var(--warning); background: #fff; border-color: var(--warning); }
.details { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: var(--s2) var(--s4); }
.details dt { font-weight: 750; }
.details dd { margin: 0; }
.historical-records, .transparency { margin: var(--s5); }
.transparency { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.transparency > summary, .technical > summary { min-height: 48px; padding: var(--s3) 0; cursor: pointer; font-weight: 750; }
.package-verification, .code-help { margin: 0 var(--s5) var(--s5); padding: var(--s4); border: 1px solid #aa7b24; border-left: 5px solid var(--warning); background: var(--warning-bg); }
.package-outcome, .classification-guidance, .similar-historical { margin-top: var(--s4); padding: var(--s4); border-left: 5px solid var(--info); background: var(--neutral); }
.package-outcome--critical { border-color: var(--danger); background: var(--danger-bg); }
.package-outcome--warning { border-color: var(--warning); background: var(--warning-bg); }
.next-steps { padding-left: var(--s5); }
.code-locations { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--s2); padding: 0; list-style: none; }
.code-locations li { padding: var(--s2); border-bottom: 1px solid var(--line); }

/* Editorial page sections */
.beta-explanation, .disclosure, .content-section, .about { margin-top: var(--s7); margin-bottom: 0; }
.beta-explanation { max-width: var(--task); margin-left: max(0px, calc((100% - var(--wide))/2)); }
.disclosure { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.disclosure > summary { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: var(--s3) 0; cursor: pointer; font-size: 1.08rem; font-weight: 800; }
.disclosure > summary::after { content: "+"; margin-left: var(--s4); font-size: 1.4rem; font-weight: 400; }
.disclosure[open] > summary::after { content: "−"; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary span { display: flex; flex-direction: column; }
.disclosure > summary small { color: var(--muted); font-weight: 400; }
.disclosure > div { max-width: var(--reading); padding: var(--s2) 0 var(--s5); }
.content-section, .about { padding: var(--s7) 0 0; border-top: 1px solid var(--line); }
.content-section > p, .content-section > a, .about > p { max-width: var(--reading); }
.recall-grid { min-height: 8rem; max-width: var(--reading); }
.recall-card { padding: var(--s5) 0; border-bottom: 1px solid var(--line); }
.recall-card:first-child { border-top: 1px solid var(--line); }
.recall-card::before { content: "Current recall"; display: block; margin-bottom: var(--s1); color: var(--danger); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.recall-card h3 { margin: 0 0 var(--s1); font-size: 1.25rem; }
.recall-card p { margin: var(--s2) 0; }
.recall-meta, .category { color: var(--muted); font-size: .9rem; }
.recall-card .secondary { min-height: 44px; padding: 0; border: 0; color: var(--brand-dark); text-decoration: underline; }
.recall-card .secondary::after { content: " →"; }
.about-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--s6); max-width: var(--wide); }
.about article { padding-top: var(--s2); }
.about article h3 { margin-top: 0; }
.disclaimer { max-width: var(--reading); margin-top: var(--s6); padding-left: var(--s4); border-left: 5px solid var(--brand); font-weight: 700; }
.demo-banner { padding: var(--s3) var(--s4); border-left: 5px solid var(--warning); background: var(--warning-bg); }
.demo-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--s3); }
.demo-card { justify-content: flex-start; text-align: left; background: #fff; border-color: var(--line-strong); }
.demo-card span { display: block; color: var(--muted); font-size: .85rem; font-weight: 400; }
#session-history-list { padding-left: var(--s5); max-width: var(--reading); }
#session-history-list li { padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.filters button { padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; }
.filters button[aria-pressed="true"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.page { padding: var(--s7) 0; }
.page > p, .page > ul, .page > ol, .page > section { max-width: var(--reading); }

.feedback { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.feedback h3 { margin-top: 0; }
.feedback-choices { display: flex; flex-wrap: wrap; gap: var(--s2); }
.feedback-choice[aria-pressed="true"] { border-color: var(--brand-dark); box-shadow: inset 0 0 0 1px var(--brand-dark); }
.feedback fieldset { border: 0; padding: 0; margin: var(--s4) 0; }
.feedback legend { font-weight: 800; }
.feedback-reason { display: flex; align-items: flex-start; gap: var(--s2); margin: var(--s2) 0; font-weight: 500; }
.feedback-reason input { width: 1.25rem; min-height: 1.25rem; margin: .15rem 0 0; flex: none; }
.feedback-privacy, .feedback-local { color: var(--muted); font-size: .9rem; }
.feedback-live:empty { display: none; }

/* Elevated interfaces only */
dialog { width: min(94vw, 40rem); padding: var(--s5); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10,29,31,.72); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); }
.dialog-head h2 { margin: 0; }
.privacy-note { margin: 0 0 var(--s1); color: var(--muted); font-size: .9rem; }
.icon-button { min-width: 44px; padding: 0; border: 0; background: transparent; font-size: 1.75rem; }
.camera { position: relative; overflow: hidden; aspect-ratio: 4/3; background: #071b1d; border-radius: 6px; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 28% 5%; border: 4px solid #fff; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.camera-status { padding: var(--s3); border-left: 4px solid var(--info); background: var(--neutral); font-weight: 750; }
.scanner-help { color: var(--muted); font-size: .9rem; }
.install-prompt { position: fixed; z-index: 30; right: var(--s4); bottom: var(--s4); max-width: 22rem; padding: var(--s4); border: 2px solid var(--brand); border-radius: 6px; background: #fff; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.install-prompt h2 { font-size: 1.3rem; }

footer { margin-top: var(--s8); padding: var(--s7) 1.25rem; border-top: 1px solid var(--line); background: var(--neutral); color: var(--ink); }
.footer-inner { max-width: var(--wide); margin: auto; }
.footer-brand { display: flex; flex-direction: column; margin-bottom: var(--s5); }
.footer-brand strong { font-size: 1.25rem; }
.footer-brand span { color: var(--muted); }
footer nav { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); margin-bottom: var(--s6); }
.footer-disclaimer { max-width: var(--reading); }
footer #footer-updated, footer .copyright { color: var(--muted); font-size: .9rem; }
.copyright span:last-child { margin-left: var(--s4); }

@media (max-width: 960px) {
  .site-header { position: relative; padding-inline: 1.25rem; }
  .menu-button { display: block; }
  .site-header nav { display: none; position: absolute; z-index: 25; top: 100%; left: 0; right: 0; padding: var(--s2) 1.25rem var(--s4); background: #fff; border-bottom: 1px solid var(--line-strong); box-shadow: 0 8px 18px rgba(0,0,0,.12); }
  .site-header nav[data-open="true"] { display: block; }
  .primary-nav { flex-direction: column; align-items: stretch; gap: 0; }
  .site-header nav a { min-height: 48px; padding: var(--s2) 0; }
  .more-item { position: static; }
  .more-menu > summary { display: none; }
  .secondary-nav { position: static; min-width: 0; padding: 0 !important; border: 0; box-shadow: none; }
}

@media (max-width: 640px) {
  main { padding-inline: 1.25rem; }
  .hero { padding-top: var(--s6); }
  .card, .results { margin-block: var(--s5); padding: var(--s4); }
  .results { padding: 0; }
  .result-banner { padding: var(--s4) var(--s4) 0; }
  .result-summary, .result-details { padding: var(--s3) var(--s4) var(--s4); }
  .package-verification, .code-help { margin: 0 var(--s4) var(--s4); }
  .historical-records, .transparency { margin: var(--s4); }
  .details { grid-template-columns: 1fr; }
  .details dd { margin-bottom: var(--s2); }
  .about-grid, .demo-grid { grid-template-columns: 1fr; gap: var(--s4); }
  .content-section, .about { padding-top: var(--s6); }
  .product { grid-template-columns: 72px minmax(0,1fr); }
  .product img, .image-placeholder { width: 72px; height: 72px; }
  .actions > *, .result-actions > *, .verification-actions > * { flex: 1 1 100%; }
  .code-locations { grid-template-columns: 1fr; }
  .install-prompt { left: var(--s3); right: var(--s3); bottom: var(--s3); }
  footer { margin-top: var(--s7); }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .result, .package-verification, .recall-card, .disclosure { border-color: CanvasText; } .primary, .secondary, .button { border: 2px solid ButtonText; } }

/* RecallCheck consumer-task composition */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, .85fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: center;
  max-width: var(--wide);
  margin-top: 2rem;
  padding: clamp(2rem, 5vw, 4.5rem);
  border: 1px solid #b9d5d1;
  border-radius: 8px;
  background: #edf7f5;
}
.hero > *, .hero-copy { max-width: none; }
.hero-copy { max-width: 34rem; }
.hero h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); }
.hero .lede { color: var(--ink); font-size: 1.2rem; }
.hero-actions { width: min(100%, 27rem); gap: .55rem; }
.scan-action { min-height: 58px; border-radius: 7px; font-size: 1.12rem; }
.scan-button-icon { font-size: 1.35em; line-height: 1; transform: rotate(90deg); }
.hero .manual-action { align-self: center; }
.hero .manual-card { width: min(100%, 27rem); margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid #b9d5d1; }
.hero .manual-card h2 { margin-bottom: 0; font-size: 1.25rem; }
.hero .manual-card label { margin-top: var(--s3); }
.hero .data-facts { margin: var(--s5) 0 0; padding: 0; border: 0; font-size: .88rem; }
.hero .data-facts > * { display: inline; }
.barcode-signature { position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(4px, .7vw, 9px); min-height: 15rem; color: var(--brand); }
.barcode-signature span { display: block; width: 5px; height: 9rem; background: currentColor; }
.barcode-signature span:nth-child(2), .barcode-signature span:nth-child(8) { width: 12px; height: 12rem; }
.barcode-signature span:nth-child(3), .barcode-signature span:nth-child(7), .barcode-signature span:nth-child(11) { width: 3px; height: 7rem; }
.barcode-signature span:nth-child(4), .barcode-signature span:nth-child(9) { width: 8px; height: 10.5rem; }
.barcode-signature span:nth-child(5), .barcode-signature span:nth-child(10) { height: 6rem; }
.barcode-signature span:nth-child(6), .barcode-signature span:nth-child(12) { width: 14px; height: 11rem; }
.barcode-signature b { position: absolute; bottom: .25rem; letter-spacing: .28em; font-size: 1rem; }
.content-section { border-top: 0; }
.recent-section { margin-top: var(--s7); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s5); }
.section-heading h2 { margin-bottom: 0; }
.recall-grid { max-width: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); margin-top: var(--s5); }
.recall-card, .recall-card:first-child { padding: var(--s4) 0 var(--s4) var(--s4); border: 0; border-left: 5px solid var(--danger); }
.recall-card .recall-meta { margin: var(--s1) 0; }
.recall-card p:not(.recall-meta):not(.category) { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.how-section { margin-top: var(--s7); padding-bottom: var(--s7); background: #f6f3ed; box-shadow: 0 0 0 100vmax #f6f3ed; clip-path: inset(0 -100vmax); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--s6); margin: var(--s5) 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: var(--s3); }
.steps li > span { display: grid; place-items: center; flex: none; width: 2.2rem; height: 2.2rem; border: 2px solid var(--brand); color: var(--brand); font-weight: 850; }
.steps h3, .steps p { margin: 0; }
.steps p { margin-top: .2rem; }
.support-links { width: 100%; max-width: var(--wide); margin: var(--s7) auto 0; border-top: 1px solid var(--line); }
.support-links a { display: flex; justify-content: space-between; align-items: center; min-height: 58px; border-bottom: 1px solid var(--line); text-decoration: none; }
.demo { margin-top: var(--s7); }
.safety-limit { max-width: var(--reading); font-size: 1.05rem; font-weight: 750; }
.result--neutral-result { border-top-color: var(--brand); }
.result--neutral-result .result-label { color: var(--brand-dark); }
.result--warning .result-label, .result--warning-critical .result-label { color: var(--warning); }
.result--failure { border-top-color: var(--line-strong); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: var(--s4); margin: 0 -1.25rem; padding: 2rem 1.25rem 1.5rem; border-width: 0 0 1px; border-radius: 0; }
  .hero-copy { max-width: none; }
  .barcode-signature { display: none; }
  .scan-action { min-height: 58px; }
  .hero .data-facts { line-height: 1.45; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: var(--s2); }
  .recall-grid, .steps { grid-template-columns: 1fr; }
  .recall-grid { gap: var(--s3); }
  .steps { gap: var(--s5); }
}
