:root { --navy: #09172b; --cream: #fff0bf; --gold: #f3c54e; --coral: #f4665f; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--navy); color: var(--cream); font: 16px/1.6 Arial, sans-serif; }
a { color: inherit; text-underline-offset: 4px; }
button, input { font: inherit; }
button, .download { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 12px 20px; background: var(--gold); color: var(--navy); border: 1px solid transparent; border-radius: 4px; font-weight: 700; cursor: pointer; text-decoration: none; }
button:hover, .download:hover { filter: brightness(.94); }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: transparent; color: inherit; border-color: currentColor; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 4px; }
.test-banner { background: var(--gold); color: var(--navy); padding: 10px 20px; text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.narrow { max-width: 740px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 25px; border-bottom: 1px solid #fff0bf30; }
header > a:last-child { font-size: 13px; }
.wordmark { font-size: 23px; font-weight: 900; text-decoration: none; letter-spacing: -.06em; }
.wordmark span { display: block; font-size: 9px; letter-spacing: .12em; }
main { padding-block: 45px 80px; }
.eyebrow, .step { font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.eyebrow { color: var(--gold); }
h1, h2, h3 { line-height: 1.1; }
h1 { font-family: 'Arial Black', Arial, sans-serif; font-size: clamp(36px, 6vw, 65px); letter-spacing: -.06em; margin: 15px 0 25px; }
h1 em { font-style: normal; color: var(--coral); }
h2 { font-size: 27px; letter-spacing: -.04em; }
.panel { background: #14243c; border: 1px solid #fff0bf30; border-radius: 8px; padding: 28px; margin-block: 24px; }
.panel > :first-child { margin-top: 0; }
label { display: block; margin-top: 20px; margin-bottom: 7px; font-weight: 700; font-size: 14px; }
input { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid #8892a3; background: #09172b; color: var(--cream); border-radius: 4px; }
input[type=number] { max-width: 150px; }
input[type=file] { padding: 6px; font-size: 13px; cursor: pointer; }
input[type=file]::file-selector-button {
  min-height: 48px;
  margin-right: 12px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--gold);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--cream); }
form button { margin-top: 22px; }
.total { display: flex; justify-content: space-between; border-top: 1px solid #fff0bf40; margin-top: 25px; padding-top: 20px; }
.total strong { font-size: 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 20px; }
.notice { padding: 14px 18px; border-left: 4px solid var(--gold); background: #23354d; overflow-wrap: anywhere; }
.hint { color: #bec7d2; font-size: 13px; }
.ticket-list { display: grid; gap: 24px; margin-block: 30px; }
.ticket { background: var(--cream); color: var(--navy); border-top: 8px solid var(--coral); padding: 25px; border-radius: 5px; text-align: center; break-inside: avoid; }
.ticket canvas { display: block; width: min(280px, 100%); height: auto; margin: 20px auto; image-rendering: pixelated; }
code { display: block; font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.ticket a, .ticket button { margin: 14px 5px 0; }
.ticket .notice { color: var(--cream); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 30px; }
.stats div { border-top: 3px solid var(--coral); padding: 15px 8px; background: #14243c; }
.stats strong { display: block; font-size: 34px; line-height: 1.2; }
.stats span { font-size: 12px; }
.scanner-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; }
.scanner-grid .panel { min-width: 0; }
video { display: block; width: 100%; max-height: 350px; background: #000; border-radius: 5px; }
.scan-result { padding: 25px; border: 2px solid #fff0bf50; border-radius: 6px; margin-block: 25px; overflow-wrap: anywhere; }
.scan-result h3 { margin-top: 0; font-size: 26px; }
.scan-result p { margin-bottom: 0; }
.accepted { background: #d9f7dd; border-color: #239a45; color: #124523; }
.used { background: #fff1bc; border-color: #e6b22d; color: #624409; }
.invalid { background: #ffe0dd; border-color: #df5144; color: #7b1f17; }
summary { cursor: pointer; font-size: 20px; font-weight: 700; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #fff0bf30; }
.admin-ticket { display: grid; gap: 8px; padding: 20px 0; border-bottom: 1px solid #fff0bf30; }
.admin-ticket button { justify-self: start; }
@media (max-width: 700px) {
  .scanner-grid { grid-template-columns: 1fr; gap: 0; }
  .panel { padding: 22px 18px; }
  header { align-items: flex-start; }
  header > a:last-child { max-width: 120px; text-align: right; }
  main { padding-top: 25px; }
  .ticket { padding: 20px 14px; }
  .actions button { flex: 1 1 180px; }
}
@media print {
  body { color: #000; background: #fff; }
  header, h1, main > .eyebrow, main > p, .no-print, #status, #checkout, #payment { display: none !important; }
  .test-banner { color: #000; background: #fff; border: 2px solid #000; }
  .shell { width: 100%; }
  main { padding: 0; }
  .ticket { color: #000; background: #fff; border: 2px dashed #555; margin: 10px 0; }
  .ticket canvas { width: 200px; }
  #confirmation > p:not(.step), #confirmation > h2 { display: none; }
}

/* Fixed viewport keeps the decision and controls beside the live camera. */
body.door-active { overflow: hidden; }
#door { position: fixed; inset: 0; z-index: 100; height: 100vh; height: 100dvh; background: var(--navy); padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.door-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex: 0 0 auto; }
.door-top strong { font-size: 14px; letter-spacing: .04em; }
#door button { min-height: 44px; padding: 8px 14px; flex-shrink: 0; }
#door-camera { position: relative; flex: 1 1 0; min-height: 80px; background: #000; border-radius: 8px; overflow: hidden; }
#door-camera > p { position: absolute; inset: 15px; margin: 0; text-align: center; }
#door-camera #camera-area { position: absolute; inset: 0; }
#door-camera video { height: 100%; max-height: none; object-fit: contain; }
#door-result { flex: 0 0 auto; }
#door .scan-result { margin: 0; padding: 16px; text-align: center; border-width: 3px; }
#door .scan-result h3 { font-size: clamp(26px, 7vw, 44px); margin: 0 0 8px; }
#door .scan-result p { font-size: 15px; line-height: 1.35; margin: 0; }
#door-note { margin: 0; font-size: 13px; line-height: 1.3; text-align: center; flex-shrink: 0; }
#door-sound { align-self: center; font-size: 13px; }
@media (orientation: landscape) and (max-height: 550px) {
  #door { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto auto; }
  .door-top { grid-column: 1 / -1; }
  #door-camera { grid-column: 1; grid-row: 2 / 5; }
  #door-result, #door-note, #door-next, #door-sound { grid-column: 2; }
  #door .scan-result { padding: 10px; }
  #door .scan-result h3 { font-size: 26px; }
}

/* Touch targets, long buyer names and mobile landscape/keyboard layouts. */
@media (max-width: 700px) {
  header { flex-wrap: wrap; gap: 12px; }
  header a, header nav a, main > a { min-height: 44px; display: inline-flex; align-items: center; }
  header .wordmark { display: block; }
  header nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .panel, .ticket, #order-summary, #confirmation-summary { overflow-wrap: anywhere; }
  .ticket .download, .ticket button { max-width: 100%; margin-inline: 0; }
  .stats { gap: 8px; }
}
@media (max-width: 360px) { h1 { font-size: 32px; } }

.table-scroll table { min-width: 640px; overflow-wrap: normal; }
.table-scroll th, .table-scroll td { white-space: nowrap; }
@media (pointer: coarse), (max-width: 1000px) {
  header a, header nav a, main > a { min-height: 44px; display: inline-flex; align-items: center; }
  header .wordmark { display: block; }
}

@media (max-width: 700px) {
  .table-scroll::before { content: 'Veeg opzij om alle kolommen te bekijken →'; display: block; margin-bottom: 10px; color: #bec7d2; font-size: 12px; }
}
