:root {
  --bg: #f6f7f9; --card: #fff; --text: #16181d; --muted: #5d6470; --line: #e3e6ea;
  --accent: #e2572b; --accent-text: #fff; --ok: #1f8a4c; --err: #c0362c; --bar: #eceef1;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111317; --card: #1a1d23; --text: #eceef1; --muted: #9aa1ad; --line: #2b2f37;
    --accent: #f06a3f; --ok: #43c07a; --err: #ef6a5f; --bar: #2b2f37; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -0.02em; }
h1 span { color: var(--accent); }
.sub { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.center { text-align: center; }
.qr { width: min(320px, 80vw); aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 8px; display: block; margin: 8px auto 12px; }
.code { font: 700 2rem/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.25em; }
.muted { color: var(--muted); font-size: 0.92rem; }
.err { color: var(--err); }
.ok { color: var(--ok); }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; min-height: 44px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button:disabled { opacity: 0.5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
ul.files { list-style: none; margin: 0; padding: 0; }
ul.files li { border-top: 1px solid var(--line); padding: 12px 0; }
ul.files li:first-child { border-top: 0; }
.fname { font-weight: 600; word-break: break-all; }
.bar { height: 6px; background: var(--bar); border-radius: 3px; overflow: hidden; margin: 6px 0; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.thumb { max-width: 100%; max-height: 240px; border-radius: 8px; display: block; margin: 8px 0; }
input[type=file] { font: inherit; width: 100%; padding: 12px; border: 2px dashed var(--line); border-radius: 12px; }
.hidden { display: none !important; }
#print-frame { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; }
#print-image { display: none; }
@media print {
  body.print-image > *:not(#print-image) { display: none !important; }
  body.print-image #print-image { display: block; }
  body.print-image #print-image img { max-width: 100%; max-height: 100vh; margin: 0 auto; display: block; }
}
.between { justify-content: space-between; }
.turnstile { display: flex; justify-content: center; margin: 8px 0; }
