:root { color-scheme: dark; font-family: system-ui, sans-serif; background: #111820; color: #edf2f7; }
* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
main { display: flex; flex-direction: column; gap: 8px; max-width: 620px; height: 100%; min-height: 0; margin: auto; }
main > :not(#screen) { flex-shrink: 0; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { font-size: 1.3rem; margin: 0; }
#status { font-size: .85rem; color: #a9cbeb; }
form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
input { min-width: 120px; flex: 1; padding: 10px; border: 1px solid #50657b; border-radius: 7px; background: #1c2836; color: inherit; }
button { padding: 11px 15px; border: 1px solid #50657b; border-radius: 7px; color: inherit; background: #23364b; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
#screen { display: flex; flex: 1; justify-content: center; min-height: 0; min-width: 0; background: #080c11; border-radius: 10px; overflow: hidden; }
canvas { display: block; width: 100%; height: 100%; min-height: 0; min-width: 0; object-fit: contain; touch-action: none; user-select: none; -webkit-user-select: none; }
nav { display: flex; gap: 8px; justify-content: center; }
.hint { color: #b0bdcb; font-size: .82rem; line-height: 1.5; margin: 0; }
#demo { color: #ffd38a; margin: 0; }
#scan { background: #286449; }
#scanner { width: min(94vw, 480px); max-height: 90dvh; padding: 16px; border: 1px solid #50657b; border-radius: 12px; background: #111820; color: #edf2f7; overflow: auto; }
#scanner::backdrop { background: #000b; }
#scanner h2 { margin: 0 0 12px; font-size: 1.1rem; }
#camera { display: block; width: 100%; height: min(45dvh, 360px); object-fit: contain; background: #080c11; }
#qr-file { display: block; width: 100%; min-width: 0; margin: 8px 0; }
@media (max-height: 500px) {
  main { gap: 6px; }
  h1 { font-size: 1rem; }
  input { padding: 6px; }
  button { padding: 7px 12px; }
  .hint { font-size: .75rem; line-height: 1.3; }
}
