/* QR scanner styles shared by tools/qr-code-scanner.html and the Scan mode of tools/qr-code-generator.html. Linked as ?v=1. */
.src-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stage { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #0e1014; border-radius: 10px; overflow: hidden; }
.stage video, .stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage img { object-fit: contain; }
.stage.mirror video, .stage.mirror .overlay { transform: scaleX(-1); }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.finder { position: absolute; left: 50%; top: 50%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; }
.finder i { position: absolute; width: 18%; height: 18%; border: 4px solid #fff; opacity: .85; }
.finder i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.finder i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.finder i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.finder i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.finder.found i { border-color: #2fbf71; }
.scanline { position: absolute; left: 6%; right: 6%; height: 2px; background: rgba(47, 191, 113, .9); box-shadow: 0 0 8px rgba(47, 191, 113, .9); animation: scan 2.2s ease-in-out infinite; }
@keyframes scan { 0%, 100% { top: 8%; } 50% { top: 90%; } }
@media (prefers-reduced-motion: reduce) { .scanline { animation: none; top: 50%; } }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: #c9ccd3; font-size: .95rem; }
.stage-msg .btn { margin-top: 12px; }
.drop { cursor: pointer; }
.drop.over { outline: 3px dashed var(--accent); outline-offset: -8px; }
.cam-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.cam-bar select { width: auto; max-width: 100%; flex: 1 1 180px; height: 36px; }
.cam-bar .zoom { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); flex: 1 1 160px; }
.cam-bar .zoom input { flex: 1; }
.opts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.engine { font-size: .8rem; color: var(--muted); margin-top: 10px; }

.result-empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.result-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.result-head h2 { margin: 0; font-size: 1.05rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; font-size: .92rem; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.kv dd.mono { font-family: var(--mono); font-size: 13.5px; }
.kv .icon-btn { height: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); font: 500 12px var(--sans); cursor: pointer; }
.kv .icon-btn:hover { color: var(--text); }
.warns { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.warns li { padding: 8px 10px; border-radius: 8px; font-size: .88rem; background: var(--err-soft); color: var(--err); }
.warns li.info { background: var(--accent-soft); color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.raw { margin-top: 14px; }
.raw summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.raw pre { margin: 8px 0 0; padding: 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; font: 13px/1.5 var(--mono); }
.hist { margin: 0; padding: 0; list-style: none; }
.hist li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.hist li:hover { background: var(--surface-2); }
.hist .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.hist time { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.hist-empty { color: var(--muted); font-size: .9rem; padding: 6px 0; }
