:root { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #181818; background: #f5f2ea; }
* { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; }
button { cursor: pointer; }
.app { max-width: 980px; margin: 0 auto; padding: 20px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
h1 { margin: 0; font-size: clamp(2rem, 8vw, 4.8rem); letter-spacing: -0.07em; line-height: .9; }
.tagline { max-width: 44rem; margin: .55rem 0 1.25rem; color: #54514b; }
.panel { background: #fffdf7; border: 1px solid #d8d3c8; border-radius: 18px; padding: 16px; margin: 14px 0; box-shadow: 0 8px 24px rgba(0,0,0,.04); }
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
button, .file-label, select { border: 1px solid #bdb7aa; border-radius: 999px; padding: 10px 14px; background: white; }
button.primary, .file-label.primary { background: #191919; color: white; border-color: #191919; }
button:disabled { opacity: .45; cursor: wait; }
.file-label input { display: none; }
#camera-wrap { position: relative; overflow: hidden; border-radius: 16px; background: #111; min-height: 220px; display: none; }
video, #source-image { width: 100%; max-height: 62vh; object-fit: contain; display: block; background: #111; }
#source-image { display: none; }
.status { min-height: 1.5em; color: #555; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.card { border: 1px solid #d9d4ca; background: white; border-radius: 14px; padding: 12px; }
.crop { width: 100%; height: 96px; object-fit: contain; background: #eeeae0; border-radius: 8px; }
.raw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; color: #4c4c4c; overflow-wrap: anywhere; }
.candidate { padding: 9px; border-radius: 9px; border: 1px solid #dedad0; margin: 7px 0; }
.candidate.best { border-color: #5c5a54; background: #f4f1e8; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 99px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; background: #ece8dd; }
.catalogue-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eee9df; }
.small { font-size: .85rem; color: #666; }
.notice { padding: 10px 12px; border-left: 3px solid #222; background: #eeeae0; border-radius: 4px; }
@media (max-width: 640px) { .app { padding: 14px; } .controls > * { flex: 1 1 auto; } }
