:root {
  --ink: #1c2b39;
  --ink-soft: #4a5a69;
  --paper: #f3f6f7;
  --surface: #ffffff;
  --line: #cfd8de;
  --action: #1f5bd8;
  --action-ink: #ffffff;
  --pass: #f5c842;
  --pass-ink: #1c2b39;
  --ok: #1d7a55;
  --error: #b3261e;
  --focus: #1f5bd8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6edf2;
    --ink-soft: #a9b6c1;
    --paper: #121a22;
    --surface: #1b2631;
    --line: #34434f;
    --action: #6f9bff;
    --action-ink: #0d1620;
    --pass: #f5c842;
    --pass-ink: #1c2b39;
    --ok: #5cc795;
    --error: #ff8a80;
    --focus: #9dbaff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
}
main { max-width: 34rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
h1 { font-size: 2.25rem; line-height: 1.15; margin: 0 0 .5rem; font-weight: 700; }
p.lede { color: var(--ink-soft); margin: 0 0 2rem; }

label { display: block; font-weight: 700; margin: 1.25rem 0 .35rem; }
label .opt { font-weight: 400; color: var(--ink-soft); }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: 10px;
  padding: .75rem .9rem;
}
select[size] { padding: .25rem; }
select[size] option { padding: .5rem .6rem; border-radius: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 30rem) { .row { grid-template-columns: 1fr; } }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

button {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 12px; padding: 1rem 1.5rem; min-height: 3.5rem;
  background: var(--action); color: var(--action-ink);
}
button.secondary { background: transparent; color: var(--ink); border: 2px solid var(--line); }
button:disabled { opacity: .6; cursor: wait; }
.wide { width: 100%; margin-top: 2rem; }

.note { font-size: .95rem; color: var(--ink-soft); margin-top: 1.25rem; }
.error { color: var(--error); font-weight: 700; min-height: 1.5rem; margin-top: 1rem; }
.hidden { display: none !important; }

/* The visitor pass: the one bold element */
.pass {
  position: relative;
  background: var(--pass); color: var(--pass-ink);
  border-radius: 18px; padding: 2.75rem 1.75rem 1.75rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.pass::before { /* lanyard slot */
  content: ""; position: absolute; top: 1rem; left: 50%;
  width: 4rem; height: .7rem; transform: translateX(-50%);
  border-radius: 999px; background: var(--paper);
}
.pass .kind { font-size: 1rem; font-weight: 700; letter-spacing: .02em; margin: 0; }
.pass .name { font-size: 2.5rem; line-height: 1.05; font-weight: 700; margin: .25rem 0 1rem; overflow-wrap: anywhere; }
.pass dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; margin: 0 0 1.5rem; }
.pass dt { font-weight: 400; }
.pass dd { margin: 0; font-weight: 700; }
.qr { background: #fff; padding: 12px; border-radius: 10px; width: max-content; margin: 0 auto; }
.qr img, .qr canvas { display: block; }
.pass .scan { text-align: center; margin: 1rem 0 0; font-weight: 700; }

.big-centre { text-align: center; padding-top: 4rem; }
.big-centre h1 { font-size: 2.75rem; }
.ok { color: var(--ok); }

/* Admin */
.admin main { max-width: 64rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin: 1.5rem 0; }
.toolbar label { margin: 0 0 .35rem; }
.toolbar select { width: auto; min-width: 12rem; }
.toolbar button { min-height: 3rem; padding: .6rem 1.1rem; }
.count { font-size: 3rem; font-weight: 700; line-height: 1; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 2px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td button { min-height: 2.5rem; padding: .4rem .8rem; font-size: .95rem; }
.empty { padding: 2rem; color: var(--ink-soft); }

@media print {
  :root { --paper: #fff; --surface: #fff; --ink: #000; --line: #999; }
  .toolbar, .no-print, td button, th.actions, td.actions { display: none !important; }
  .table-wrap { border: 0; }
  td.check::before { content: "☐"; font-size: 1.3rem; }
}
@media screen { .check { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.host-list { margin-top: .5rem; }
.logout { margin-left: auto; color: var(--ink-soft); }
