:root {
  color-scheme: light;
  --red: #b3202a;
  --red-dark: #8c1620;
  --green: #1f6b3a;
  --ink: #1d1d1f;
  --muted: #5f6368;
  --line: #e3ddd3;
  --paper: #fffdf8;
  --page: #f4efe6;
  --bad: #b3202a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 16px;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.card {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 6px solid var(--red);
  border-radius: 14px;
}
.card.wide { max-width: 720px; }

h1 { margin: 0 0 12px; font-size: 1.5rem; line-height: 1.2; }
p { margin: 0 0 12px; }
.lead { font-size: 1.1rem; }
.hint { color: var(--muted); font-size: 0.92rem; }
.error { color: var(--bad); font-weight: 600; min-height: 1.4em; }
a { color: var(--green); }

/* forms */
label { display: block; margin: 14px 0 6px; font-weight: 600; }
input:not([type="checkbox"]):not([type="file"]) {
  width: 100%;
  padding: 13px 12px;
  border: 1.5px solid #b9b2a6;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input:focus-visible, button:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid #2f6fdd;
  outline-offset: 2px;
}
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 6px 0 16px; }
label.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }

/* buttons */
.btn {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 14px 16px;
  border: 1.5px solid #b9b2a6;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:active { background: var(--red-dark); }
.btn.big { padding: 20px 16px; font-size: 1.25rem; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.quiet { border-color: transparent; background: none; color: var(--green); text-decoration: underline; }
.btn.small { display: inline-block; width: auto; margin: 0; padding: 9px 14px; font-size: 0.95rem; }
.btn:disabled, .btn.disabled { opacity: 0.5; pointer-events: none; }
button.link {
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--green);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}
button.link.danger { color: var(--bad); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* the guest's number */
.big-number {
  margin: 4px 0 16px;
  color: var(--red);
  font-size: clamp(6rem, 38vw, 10rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
#number-view { text-align: center; }

/* keypads */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.key {
  padding: 16px 0;
  border: 1.5px solid #b9b2a6;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.6rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}
.key:active { background: #efe9dd; }
.digits { display: flex; justify-content: center; gap: 10px; margin: 8px 0; }
.digits span {
  width: 64px;
  height: 78px;
  border: 2px solid #b9b2a6;
  border-radius: 12px;
  background: #fff;
  font-size: 3rem;
  font-weight: 800;
  line-height: 74px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* PIN screen */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: auto;
  padding: 16px;
  background: var(--page);
}
.pin-card { max-width: 360px; text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 16px 0 10px; }
.pin-dots span { width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 50%; }
.pin-dots span.on { background: var(--ink); }

/* staff + send */
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 1.15rem; }
.top a { font-size: 0.95rem; }
.guest-head { display: flex; align-items: center; gap: 12px; }
.badge {
  flex: none;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.guest-name { font-size: 1.2rem; font-weight: 700; overflow-wrap: anywhere; }
.sent { color: var(--green); font-size: 0.9rem; font-weight: 600; }
#shot { margin-top: 14px; text-align: center; }
#shot img { max-width: 100%; max-height: 46vh; border-radius: 10px; }
#status { margin: 8px 0 0; font-weight: 700; }
#status.ok { color: var(--green); }
#status.bad { color: var(--bad); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tab {
  padding: 9px 12px;
  border: 1.5px solid #b9b2a6;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.tab.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.guest-list { list-style: none; margin: 12px 0 0; padding: 0; }
.guest { padding: 14px 0; border-top: 1px solid var(--line); }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb img { display: block; width: 96px; height: 96px; border-radius: 8px; object-fit: cover; background: #e9e3d8; }
.thumb-actions { display: flex; justify-content: space-between; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.row-actions.footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

/* guest photo page */
.photo { margin: 0 0 18px; }
.photo img { display: block; width: 100%; border-radius: 10px; }

/* poster */
.poster { max-width: 640px; text-align: center; }
.poster h1 { font-size: 2.2rem; }
.poster-lead { font-size: 1.6rem; font-weight: 700; }
.poster canvas { width: min(100%, 460px); height: auto; image-rendering: pixelated; }
.poster-url { font-size: 1.2rem; overflow-wrap: anywhere; }

@media print {
  body { padding: 0; background: #fff; }
  .card { max-width: none; border: 0; }
  .no-print { display: none !important; }
}
