:root{color-scheme:light;--ink:#152c24;--muted:#416052;--line:#cadbd0;--paper:#fbfefa;--accent:#145940;--wash:#edf3ef;--focus:#277c5f}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{background:var(--wash);color:var(--ink);margin:0;font:16px/1.45 system-ui,-apple-system,"Segoe UI",sans-serif}
.shell{width:min(100% - 32px,548px);margin:clamp(21px,7vh,90px) auto 42px;background:var(--paper);border:1px solid #d7e4da;border-radius:26px;padding:clamp(20px,5vw,39px);box-shadow:0 12px 42px #18392c0e}
.brand{display:flex;align-items:center;gap:11px;font-weight:730;font-size:17px;line-height:1.2}
.brand img{object-fit:contain}
small{display:block;color:var(--muted);font-size:14px;font-weight:580;line-height:1.3}
.brand small{margin-top:2px}
h1{font-size:clamp(29px,7vw,44px);line-height:1.1;letter-spacing:-.035em;margin:27px 0 24px}
h1 span,h2 span{display:block;margin-top:7px;color:var(--muted);font-size:17px;letter-spacing:normal;font-weight:580}
button,input{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:transparent}
button:focus-visible,input:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
button:disabled{cursor:default;opacity:.53}
button:active:not(:disabled){transform:translateY(1px)}
.menu-actions,form{display:grid;gap:14px}
.tile,.capture,.secondary,.primary{border-radius:15px;min-height:53px;font-weight:720}
.tile,.capture,.secondary{border:1px solid var(--line);background:#fff}
.tile:hover,.capture:hover,.secondary:hover{border-color:var(--focus);background:#f4f9f5}
.tile{display:flex;gap:14px;align-items:center;text-align:left;padding:14px 16px;font-size:19px;line-height:1.22;min-height:83px;width:100%}
.tile small,.capture small,.primary small,.secondary small{margin-top:3px}
.glyph{flex:none;display:grid;place-items:center;height:43px;width:43px;border-radius:12px;background:#dcefe4;color:#174e39;font-size:30px;font-weight:650;line-height:1}
.glyph.mint{background:#e5efe7;font-size:25px}
.back{display:flex;align-items:baseline;gap:8px;padding:8px 0;min-height:44px;text-align:left;color:var(--accent);font-weight:700}
.back:hover{text-decoration:underline}
.back+h1{margin-top:7px}
.capture-grid,.field-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.capture{min-height:120px;display:flex;position:relative;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:10px 6px;line-height:1.22;overflow:hidden}
.capture img{width:100%;height:84px;object-fit:contain}
.capture img:not([hidden])+.glyph{display:none}
.capture output{font-size:13px;font-weight:650;max-width:100%;overflow-wrap:anywhere;color:var(--accent)}
.capture output:empty{display:none}
label{display:block;font-weight:690}
label small{margin:2px 0 6px}
input{display:block;width:100%;padding:10px 12px;min-height:48px;border:1px solid #abbaae;border-radius:11px;background:#fff}
input:read-only{background:#f2f7f3;border-color:var(--line)}
.primary,.secondary{width:100%;padding:10px 14px}
.primary{background:var(--accent);color:#fff}
.primary:hover:not(:disabled){background:#1a694f}
.primary small{color:#e2f2e9}
#print-received{margin-top:12px}
.product{display:flex;align-items:center;gap:14px;min-height:94px;background:#f1f7f2;border:1px solid var(--line);border-radius:15px;padding:13px;margin:14px 0}
.product img{width:75px;height:75px;flex:none;object-fit:contain;background:#fff;border-radius:8px}
.product strong,.product span,.product b{display:block;overflow-wrap:anywhere}
.product span{margin-top:3px;color:var(--muted);font-size:14px}
.product b{margin-top:5px;font-size:18px}
.status{padding:10px 12px;margin:0;border-radius:10px;background:#e8f3eb;font-size:14px}
#print-status{margin-top:14px}
.status.error{background:#faeee8;color:#742f1a}
dialog{width:min(100% - 26px,470px);max-height:calc(100% - 24px);border:1px solid var(--line);border-radius:20px;padding:16px;color:var(--ink);background:var(--paper)}
dialog::backdrop{background:#0d1d18a0}
.scanner-head{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:12px}
h2{font-size:23px;margin:0}
h2 span{font-size:14px;margin-top:2px}
.close{padding:0;width:44px;height:44px;font-size:31px;color:var(--accent);border-radius:8px}
.camera{position:relative;background:#16261f;border-radius:12px;overflow:hidden;aspect-ratio:16/9;margin-bottom:10px}
.camera.photo-mode{aspect-ratio:4/3;max-height:56dvh}
.camera.photo-mode .guide{display:none}
video{width:100%;height:100%;object-fit:contain}
.guide{position:absolute;inset:24% 10%;border:2px solid #e8fff1;border-radius:12px;pointer-events:none}
#barcode-form{margin-top:12px}
#scan-status:not([hidden])+#capture-photo{margin-top:12px}
@media (max-width:540px) and (orientation:portrait){.camera.photo-mode{aspect-ratio:3/4}}
