:root {
  color-scheme: light;
  font: 16px/1.55 system-ui, sans-serif;
  color: #1e2520;
  background: #f7f9f4;
  --green: #116435;
  --muted: #536459;
  --line: #d9e2d7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { border-bottom: 1px solid var(--line); background: #fff; }
.wrap { width: min(100% - 32px, 570px); margin-inline: auto; }
.masthead { display: flex; align-items: center; gap: 10px; min-height: 64px; font-weight: 750; }
.mark { display: grid; place-items: center; background: #e1efdf; color: var(--green); border-radius: 9px; width: 31px; height: 31px; }
.intro { margin: 36px 0 24px; }
.eyebrow { color: var(--green); font-size: .88rem; font-weight: 700; }
h1 { margin: 6px 0 12px; font-size: clamp(1.9rem, 7vw, 2.65rem); line-height: 1.2; letter-spacing: -.045em; }
.muted, footer { color: var(--muted); }
.panel, article { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: white; }
button, input, article a { font: inherit; border-radius: 10px; min-height: 46px; padding: 9px 13px; }
button, article a { color: var(--green); background: #e8f1e6; border: 1px solid transparent; font-weight: 700; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #126735; outline-offset: 3px; }
.primary { width: 100%; background: var(--green); color: white; }
.form-row { display: flex; gap: 8px; margin-top: 6px; }
.form-row button { flex-shrink: 0; }
input { min-width: 0; flex: 1; border: 1px solid #a6b5a9; }
label { font-size: .9rem; font-weight: 650; }
#preview { margin-top: 12px; position: relative; background: #17231b; overflow: hidden; border-radius: 12px; }
video { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.scanline { position: absolute; inset: 50% 10% auto; height: 2px; background: #82f49c; pointer-events: none; }
#camera-status:empty { margin: 0 0 16px; }
#lookup-status { margin: 14px 0; }
#results { display: grid; gap: 12px; }
article h2 { margin: 0 0 8px; font-size: 1.3rem; overflow-wrap: anywhere; }
article p { margin: 5px 0; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
article a { display: inline-grid; place-items: center; text-decoration: none; }
footer { margin: 26px 0; font-size: .82rem; }
.research { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.research h3 { margin: 0 0 6px; }
.research h4 { margin: 16px 0 4px; }
.research a { display: inline; margin-inline-start: 8px; min-height: 0; padding: 0; background: transparent; text-decoration: underline; }
.recommendation { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.recommendation + .recommendation { border-top: 1px solid var(--line); }
.recommendation h4 { margin: 0; overflow-wrap: anywhere; }
.product-image { width: 78px; height: 78px; flex: 0 0 78px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: white; }
.manual-entry { display: grid; gap: 8px; margin-top: 14px; }
.manual-entry input { width: 100%; }
.retry { margin-top: 10px; }
#history { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: white; }
summary { cursor: pointer; font-weight: 650; }
.history-row { display: flex; gap: 8px; margin-top: 8px; }
.history-open { flex: 1; min-width: 0; overflow-wrap: anywhere; text-align: left; }
.recommendation > div { min-width: 0; }
.recommendation a { display: inline-block; overflow-wrap: anywhere; margin: 4px 8px 4px 0; }
.recommendation button { min-height: 36px; font-size: .85rem; }
article > p { overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .panel, article { padding: 16px; }
  .product-image { width: 64px; height: 64px; flex-basis: 64px; }
  .form-row { gap: 6px; }
  .form-row button { padding-inline: 10px; }
}

#refocus { position: absolute; bottom: 10px; right: 10px; background: #fff; color: #174c31; }
