/* trace: C30 */
/* Light and dark from the phone's setting; 44 px targets; visible focus; no motion when reduced motion is on (S15). */
:root {
  --bg: #ffffff; --fg: #111418; --muted: #4a5360; --line: #d6dbe1; --brand: #1f3a5f; --brand-fg: #ffffff;
  --ok: #0a6b2d; --warn-bg: #fff4d6; --warn-fg: #5c4200; --danger: #b00020; --dot: #c9d1da; --focus: #0b57d0;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --fg: #eef1f4; --muted: #b3bcc7; --line: #39424d; --brand: #8fb4e8; --brand-fg: #0b1a2c;
    --ok: #6fdc8c; --warn-bg: #3a2f10; --warn-fg: #ffe2a3; --danger: #ff8a80; --dot: #3a4450; --focus: #8ab4f8; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 1.0625rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 36rem; margin: 0 auto; padding: 1rem 1rem 6rem; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: .5rem 0 1rem; }
h1:focus { outline: none; }
h2 { font-size: 1.2rem; margin: 2rem 0 .5rem; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem; z-index: 10; }

/* Bottom tabs, thumb-reachable */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--bg); border-top: 1px solid var(--line); z-index: 5;
  padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; text-align: center; padding: .9rem .25rem; min-height: 44px; text-decoration: none; color: var(--muted); font-size: .9rem; }
.tabs a[aria-current="page"] { color: var(--brand); font-weight: 700; box-shadow: inset 0 3px 0 var(--brand); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1.1rem; margin: .4rem .4rem .4rem 0;
  border: 2px solid var(--brand); border-radius: 10px; background: transparent; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-fg); }
.btn.big { display: flex; width: 100%; min-height: 96px; font-size: 1.8rem; letter-spacing: .06em; background: var(--brand); color: var(--brand-fg); margin: 1rem 0; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.ask .btn.danger { background: var(--danger); color: var(--bg); }
.field { margin: 1rem 0; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.hint { margin: 0 0 .35rem; color: var(--muted); font-size: .95rem; }
input[type="text"], input[type="number"], input[type="search"], textarea { width: 100%; min-height: 48px; padding: .6rem .7rem; font: inherit;
  color: var(--fg); background: var(--bg); border: 2px solid var(--line); border-radius: 8px; }
.check { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.check input { width: 24px; height: 24px; }
.error { color: var(--danger); font-weight: 600; min-height: 1.5em; }
.warning { background: var(--warn-bg); color: var(--warn-fg); padding: .75rem 1rem; border-radius: 8px; }
.message { min-height: 1.5em; margin: .75rem 0; font-weight: 600; }

/* Scan */
.camera { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: #000; outline: 6px solid transparent; outline-offset: -6px; }
.camera.refused { animation: refused 1.2s ease-out; }
@keyframes refused { from, 60% { outline-color: #c62828; } to { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .camera.refused { animation: none; outline-color: #c62828; } }

/* Card */
.dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; margin: 1rem 0 .5rem; max-width: 22rem; }
.dot { aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--dot); }
.dot.on { background: var(--brand); border-color: var(--brand); }
.count { font-size: 1.4rem; font-weight: 700; margin: .25rem 0; }
.ready { font-size: 1.3rem; font-weight: 700; color: var(--ok); }
.history { list-style: none; padding: 0; } .history li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }

/* QR — always black on white */
.qr { background: #fff; padding: .5rem; border-radius: 8px; max-width: 22rem; margin: 1rem auto; }
.qr.big { max-width: 26rem; } .qr svg { display: block; width: 100%; height: auto; }

/* Today and customers */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.stat { border: 2px solid var(--line); border-radius: 10px; padding: .75rem; text-align: center; }
.stat .n { display: block; font-size: 2rem; font-weight: 700; }
.alerts { border-left: 4px solid var(--danger); padding-left: .75rem; }
.customers { list-style: none; padding: 0; }
.customers a { display: block; padding: .8rem 0; min-height: 44px; border-bottom: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.customers .num { font-family: ui-monospace, monospace; font-weight: 600; }

/* Dialogs */
dialog.ask { border: 0; border-radius: 12px; padding: 1.25rem; width: min(30rem, calc(100% - 2rem)); background: var(--bg); color: var(--fg); }
dialog.ask::backdrop { background: rgb(0 0 0 / .5); }
.row { display: flex; flex-wrap: wrap; justify-content: flex-end; }

/* Printed cards: 8 per A4 page */
.print-sheet { display: none; }
@media print {
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; padding: 6mm; }
  .print-card { margin: 0; border: 1px dashed #999; padding: 4mm; text-align: center; break-inside: avoid; color: #000; background: #fff; }
  .print-card svg { width: 38mm; height: 38mm; }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
