:root { color-scheme: light; font-family: system-ui, sans-serif; color: #102920; background: #edf4ee; line-height: 1.55; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.brand { background: #102920; color: white; padding: 1rem max(1.25rem, calc((100vw - 72rem) / 2)); font-weight: 750; display: flex; align-items: center; gap: 1rem; }
.brand span { color: #caecce; font-size: .875rem; font-weight: 550; border-left: 1px solid #668777; padding-left: 1rem; }
main { max-width: 74.5rem; margin: auto; padding: clamp(1.25rem, 4vw, 3rem) 1.25rem 3rem; }
h1 { line-height: 1.05; font-size: clamp(2.3rem, 6vw, 4rem); letter-spacing: -.045em; margin: 0; }
.intro { margin: .8rem 0 1.8rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.side { display: grid; gap: 1rem; }
.card { background: #fff; border: 1px solid #cddbce; border-radius: 1rem; padding: clamp(1rem, 2vw, 1.4rem); }
h2 { font-size: 1.2rem; margin: 0 0 .85rem; }
.viewer { display: grid; gap: 3px; background: #102920; color: #e1f3e5; border-radius: .65rem; overflow: hidden; text-align: center; }
.viewer p { padding: 2rem 1rem; }
#unit-viewer { position: relative; }
#unit-guide { position: absolute; inset: 14% 8%; border: 2px dashed #c5f7a8; border-radius: .5rem; pointer-events: none; }
#unit-camera { max-height: none; }
#name-candidates button { text-align: left; overflow-wrap: anywhere; }
video, canvas { display: block; width: 100%; max-height: 60vh; object-fit: contain; }
.controls { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
button, .upload { padding: .55rem .85rem; border: 1px solid transparent; border-radius: .5rem; background: #19563a; color: #fff; font: inherit; font-weight: 650; cursor: pointer; }
.secondary { color: #163e2c; background: #eaf4ed; border-color: #bdd4c2; }
button:disabled { opacity: .55; cursor: default; }
.upload { position: relative; overflow: hidden; }
.upload input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
button:focus-visible, .upload:focus-within { outline: 3px solid #287d4c; outline-offset: 3px; }
textarea, input[type=number] { width: 100%; padding: .55rem; border: 1px solid #a9c3ae; border-radius: .45rem; color: inherit; background: #fafdfa; font: inherit; margin-top: .4rem; }
textarea { resize: vertical; }
.modes { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: .85rem; }
.capture { min-width: 0; border: 1px solid #dce7df; border-radius: .55rem; padding: .65rem; }
.label-photo { width: 100%; display: block; padding: 0; overflow: hidden; background: #102920; cursor: zoom-in; }
.label-photo canvas { width: 100%; height: auto; max-height: none; }
.front-match-link { display: inline-block; margin-top: .4rem; color: #19563a; font-weight: 650; }
#photo-view { max-width: 47rem; }
#multi-surface { max-width: 40rem; cursor: crosshair; }
#multi-surface canvas { max-height: 76vh; width: auto; max-width: 100%; margin: auto; }
#multi-video { max-width: 40rem; background: #102920; border-radius: .55rem; }
.barcode-capture { grid-column: 1 / -1; }
.barcode-capture p { margin: 0 0 .5rem; }
.barcode-capture .label-photo { max-width: 28rem; }
h3 { margin: 0 0 .4rem; font-size: 1rem; }
#unit-form label { display: block; margin-top: .5rem; }
#unit-form input, #catalog-query { width: 100%; padding: .55rem; border: 1px solid #a9c3ae; border-radius: .45rem; color: inherit; background: #fafdfa; font: inherit; }
#catalog-status { margin: .85rem 0; }
#catalog-results button { text-align: left; overflow-wrap: anywhere; }
#label-match-panel { margin: .85rem 0; padding: .75rem; border: 1px solid #cddbce; border-radius: .55rem; }
#label-match-panel .note { margin: 0 0 .4rem; }
#label-matches { display: grid; gap: .35rem; }
#label-matches button { text-align: left; overflow-wrap: anywhere; }
#label-matches small { display: block; font-weight: 400; }
details { margin: .9rem 0; }
summary { cursor: pointer; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
#unit-log { margin: 0; padding: 0; }
#unit-log li { display: block; overflow-wrap: anywhere; }
#unit-log button { margin-top: .3rem; }
.total { margin: 0; }
.total strong { font-size: 2rem; margin-right: .25rem; }
ul { margin: .4rem 0 1rem; padding: 0; list-style: none; }
li { display: flex; justify-content: space-between; gap: .5rem; border-top: 1px solid #dce7df; padding: .35rem 0; }
.note, #status { font-size: .9rem; margin: .7rem 0 0; }
#difference:empty { display: none; }
@media (max-width: 720px) { .layout { grid-template-columns: 1fr; } }
@media (max-width: 440px) { .sides { grid-template-columns: 1fr; } }
