@media (max-width: 480px) {
  .welcome-actions { gap: var(--s3); }
  .mega { min-height: 28vh; font-size: 1.45rem; gap: var(--s2); border-radius: 20px; }
  .mega small { font-size: 0.85rem; }
}
@media (max-width: 340px) {
  .welcome-actions, .choice-grid-2 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   FTW Sign-In — design system
   One stylesheet for the kiosk, the staff dashboard and the emergency register.
   Brand colours are PLACEHOLDERS until FTW supplies official values:
   replace the six --ftw-* values below and everything else follows.
   ========================================================================== */

:root {
  --phone-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E");
  /* Brand (placeholder values — see docs/01, question 1) */
  --ftw-green: #22863a;
  --ftw-green-soft: #e7f4ea;
  --ftw-pink: #d6246e;
  --ftw-pink-soft: #fce8f0;
  --ftw-blue: #1f6fb2;
  --ftw-blue-soft: #e6f0f9;

  /* Neutrals */
  --ink: #142028;
  --ink-2: #3c4a55;
  --muted: #5d6b76;
  --line: #dde4ea;
  --line-strong: #c3ced7;
  --surface: #ffffff;
  --surface-2: #f5f8fa;
  --bg: #eef2f5;

  /* Meaning (kept distinct from brand colours on purpose) */
  --danger: #c62828;
  --danger-soft: #fdecec;
  --warning: #9a4a00;
  --warning-soft: #fff4e0;
  --success: #1b7f3b;
  --success-soft: #e6f5ea;
  --info: #1f6fb2;
  --info-soft: #e6f0f9;

  /* Type */
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;

  /* Shape and depth */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(20, 32, 40, 0.06);
  --shadow: 0 1px 3px rgba(20, 32, 40, 0.08), 0 4px 12px rgba(20, 32, 40, 0.05);
  --shadow-lg: 0 10px 30px rgba(20, 32, 40, 0.12);
  --focus: 0 0 0 3px #ffffff, 0 0 0 6px #1f6fb2;

  /* Space */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 var(--s3); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
p { margin: 0 0 var(--s3); }
a { color: var(--ftw-blue); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
small, .small { font-size: var(--text-sm); }
.muted { color: var(--muted); }
code, .mono { font-family: var(--font-mono); font-size: 0.95em; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
::selection { background: var(--ftw-blue-soft); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* The three brand colours as a thin ribbon: used as an accent, not as a logo. */
.brand-ribbon {
  height: 6px;
  background: linear-gradient(90deg, var(--ftw-green) 0 33.3%, var(--ftw-pink) 33.3% 66.6%, var(--ftw-blue) 66.6% 100%);
}

.logo { display: block; height: 44px; width: auto; }
.logo-link { display: inline-block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 8px; -webkit-tap-highlight-color: transparent; }
.em-home { color: inherit; text-decoration: none; }
.em-phone {
  display: inline-flex; align-items: center; gap: 8px; margin-top: -4px; padding: 6px 14px; min-height: 40px; white-space: nowrap;
  font-weight: 700; font-size: 1.05rem; color: var(--ftw-blue); background: var(--ftw-blue-soft); border-radius: 999px; text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.em-phone::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--phone-icon) center / contain no-repeat; mask: var(--phone-icon) center / contain no-repeat; }
.em-phone-row { flex-basis: 100%; margin-top: -6px; }
.em-contact { display: grid; gap: var(--s2); margin-bottom: var(--s3); }
.em-contact .btn-blue { font-size: 1.15rem; min-height: 54px; }
.share-text { font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.45; resize: vertical; margin-bottom: var(--s3); }
.email-picks { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.email-pick {
  font: inherit; font-size: var(--text-lg); font-weight: 600; color: var(--ftw-blue); background: var(--ftw-blue-soft);
  border: 1px solid #c6dbee; border-radius: 999px; padding: 10px 16px; min-height: 44px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.email-pick:active { transform: scale(0.97); }
.logo-link:focus-visible { outline: 3px solid var(--ftw-blue); outline-offset: 3px; }
.centre-page .logo-link, .auth-card .logo-link { display: block; width: max-content; margin: 0 auto; }

.test-banner {
  background: repeating-linear-gradient(-45deg, #fff4e0, #fff4e0 12px, #ffe7bf 12px, #ffe7bf 24px);
  color: var(--warning);
  text-align: center;
  font-weight: 700;
  font-size: var(--text-sm);
  padding: 4px var(--s3);
  border-bottom: 1px solid #f1d29c;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-border: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 10px 18px;
  font: inherit; font-weight: 650; line-height: 1.2; text-decoration: none; white-space: nowrap;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-border); border-radius: var(--radius);
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform 0.06s ease, filter 0.15s ease, background-color 0.15s ease;
}
.btn:hover { filter: brightness(0.97); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled], .btn.is-busy { opacity: 0.6; cursor: not-allowed; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn-green { --btn-bg: var(--ftw-green); --btn-fg: #fff; --btn-border: transparent; }
.btn-pink { --btn-bg: var(--ftw-pink); --btn-fg: #fff; --btn-border: transparent; }
.btn-blue, .btn-primary { --btn-bg: var(--ftw-blue); --btn-fg: #fff; --btn-border: transparent; }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: transparent; }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-border: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-outline-danger { --btn-fg: var(--danger); --btn-border: #e9b4b4; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: var(--text-sm); border-radius: var(--radius-sm); }
.btn-lg { min-height: 56px; padding: 14px 24px; font-size: var(--text-lg); border-radius: var(--radius-lg); }
.btn-block { display: flex; width: 100%; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--ftw-blue); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { margin-bottom: var(--s4); }
.field label, .label { display: block; font-weight: 650; margin-bottom: 6px; }
.field .optional { font-weight: 400; color: var(--muted); }
.hint { display: block; color: var(--muted); font-size: var(--text-sm); margin-top: 4px; }
.input, select.input, textarea.input {
  display: block; width: 100%; min-height: 44px; padding: 10px 12px;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ftw-blue); box-shadow: 0 0 0 3px var(--ftw-blue-soft); }
.input[aria-invalid="true"], .has-error .input { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-error { display: block; color: var(--danger); font-weight: 600; font-size: var(--text-sm); margin-top: 6px; }
.checkbox { display: flex; gap: var(--s2); align-items: flex-start; font-weight: 500; }
.checkbox input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ftw-blue); }
.form-row { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s5); }
fieldset { border: 0; padding: 0; margin: 0; }

/* --------------------------------------------------------------------------
   Cards, badges, alerts, tables
   -------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: var(--s5); }
.card + .card { margin-top: var(--s5); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-header { padding: var(--s4) var(--s5); margin: 0; border-bottom: 1px solid var(--line); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: var(--text-xs); font-weight: 700; line-height: 1.6; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge-team { background: var(--ftw-blue-soft); color: #16507f; border-color: #c6dbee; }
.badge-visitor { background: var(--ftw-pink-soft); color: #93184c; border-color: #f4c6d8; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: #bfe3c9; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: #f3d5a6; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: #f2c1c1; }
.badge-info { background: var(--info-soft); color: #16507f; border-color: #c6dbee; }

.alert {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4); border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); margin-bottom: var(--s4);
}
.alert-success { background: var(--success-soft); border-color: #bfe3c9; color: #134f26; }
.alert-error { background: var(--danger-soft); border-color: #f2c1c1; color: #7d1919; }
.alert-info { background: var(--info-soft); border-color: #c6dbee; color: #123f66; }
.alert-warning { background: var(--warning-soft); border-color: #f3d5a6; color: #6b3500; }
.alert strong { display: block; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th, .table td { padding: 10px var(--s4); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; background: var(--surface-2); white-space: nowrap; }
.table tbody tr:hover { background: #fafcfd; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .name { font-weight: 650; color: var(--ink); text-decoration: none; }
.table a.name:hover { text-decoration: underline; }
.table-empty { padding: var(--s6) var(--s4); text-align: center; color: var(--muted); }
.row-flag { box-shadow: inset 4px 0 0 var(--warning); }

.empty { text-align: center; color: var(--muted); padding: var(--s6) var(--s4); }
.empty strong { display: block; color: var(--ink); font-size: var(--text-lg); margin-bottom: var(--s1); }

.pagination { display: flex; gap: var(--s2); align-items: center; justify-content: space-between; padding: var(--s3) var(--s5); border-top: 1px solid var(--line); font-size: var(--text-sm); color: var(--muted); }

.dl { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: var(--s2) var(--s4); margin: 0; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   Admin shell
   -------------------------------------------------------------------------- */
.admin { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { padding: var(--s5) var(--s5) var(--s4); }
.sidebar-brand small { display: block; color: var(--muted); font-weight: 600; margin-top: var(--s2); }
.nav { list-style: none; margin: 0; padding: var(--s2) var(--s3); flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: var(--s3);
  padding: 10px var(--s3); margin-bottom: 2px; border-radius: var(--radius);
  color: var(--ink-2); font-weight: 600; text-decoration: none;
}
.nav a svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--ftw-blue-soft); color: #134a75; }
.nav a[aria-current="page"] svg { color: var(--ftw-blue); }
.nav .nav-emergency { color: var(--danger); }
.nav .nav-emergency svg { color: var(--danger); }
.nav-section { margin: var(--s4) var(--s3) var(--s2); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.sidebar-user { padding: var(--s4) var(--s5); border-top: 1px solid var(--line); font-size: var(--text-sm); }
.sidebar-user strong { display: block; }
.sidebar-user form { margin-top: var(--s2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4); background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .logo { height: 32px; }
.content { padding: var(--s6); max-width: 1280px; width: 100%; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-header h1 { margin: 0; }
.page-header p { margin: var(--s1) 0 0; color: var(--muted); }
.page-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--muted); }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.live-dot.is-stale::before { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4) var(--s5); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--line-strong); }
.stat.is-green::before { background: var(--ftw-green); }
.stat.is-pink::before { background: var(--ftw-pink); }
.stat.is-blue::before { background: var(--ftw-blue); }
.stat.is-warning::before { background: var(--warning); }
.stat-label { font-size: var(--text-sm); color: var(--muted); font-weight: 650; }
.stat-value { font-size: var(--text-3xl); font-weight: 800; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat a { color: inherit; text-decoration: none; }
.stat a::after { content: ""; position: absolute; inset: 0; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s5); align-items: start; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: var(--s3); align-items: center; padding: 10px var(--s5); border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.activity li:last-child { border-bottom: 0; }
.activity .dir { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 12px; }
.activity .dir.in { background: var(--success-soft); color: var(--success); }
.activity .dir.out { background: var(--surface-2); color: var(--muted); }
.activity .when { margin-left: auto; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.filters { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.filters .field { margin: 0; min-width: 140px; flex: 1 1 150px; }
.filters .field label { font-size: var(--text-sm); }
.filters .field-grow { flex: 2 1 220px; }

.notice-list { display: grid; gap: var(--s3); margin-bottom: var(--s5); }

dialog {
  border: 0; border-radius: var(--radius-lg); padding: 0; width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg); color: var(--ink);
}
dialog::backdrop { background: rgba(20, 32, 40, 0.45); }
.dialog-body { padding: var(--s5); }
.dialog-body h2 { margin-bottom: var(--s2); }
.confirm-dialog { width: min(460px, calc(100vw - 32px)); }
.confirm-message { font-size: var(--text-lg); font-weight: 600; line-height: 1.4; margin: 0; }
.confirm-dialog .form-actions { justify-content: flex-end; }
@media (max-width: 480px) { .confirm-dialog .form-actions > .btn { flex: 1 1 100%; } .confirm-dialog [data-confirm-ok] { order: -1; } }

.steps { margin: 0; padding-left: 1.4em; display: grid; gap: var(--s2); }
.secret {
  font-family: var(--font-mono); font-size: var(--text-2xl); font-weight: 700; letter-spacing: 0.08em;
  background: var(--surface-2); border: 2px dashed var(--line-strong); border-radius: var(--radius);
  padding: var(--s3) var(--s4); display: inline-block; margin: var(--s2) 0;
}

/* Auth / plain pages */
.plain { min-height: 100vh; display: grid; place-items: center; padding: var(--s5) var(--s4); background: radial-gradient(1200px 600px at 10% -10%, var(--ftw-blue-soft), transparent), radial-gradient(900px 500px at 110% 110%, var(--ftw-pink-soft), transparent), var(--bg); }
.auth-card { width: min(440px, 100%); background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.auth-card .inner { padding: var(--s6); }
.auth-card .logo { height: 48px; margin-bottom: var(--s5); }
.auth-card-wide { width: min(560px, 100%); }
.auth-card details { margin-top: var(--s4); }
.auth-card summary, .card summary { cursor: pointer; font-weight: 600; }
.code-input { font-family: var(--font-mono); font-size: var(--text-xl); letter-spacing: 0.25em; max-width: 14ch; }
.setup-steps { gap: var(--s5); margin: var(--s5) 0; }
.qr-box { display: flex; justify-content: center; margin: var(--s3) 0; }
.qr { background: #fff; border-radius: var(--radius); padding: 0; max-width: 100%; height: auto; }
.secret-sm { font-size: var(--text-lg); word-break: break-all; }
.backup-codes { list-style: none; padding: 0; margin: var(--s4) 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.backup-codes li { font-size: var(--text-lg); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: var(--s2) var(--s3); text-align: center; }
@media print { .plain { background: none; } .auth-card { box-shadow: none; } .auth-card form, .brand-ribbon { display: none; } }

@media (max-width: 960px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .topbar { display: flex; }
  .content { padding: var(--s4); }
  .grid-2 { grid-template-columns: 1fr; }
  .nav-backdrop { position: fixed; inset: 0; background: rgba(20, 32, 40, 0.35); z-index: 30; }
}

/* Responsive tables become cards on phones and tablets, so action buttons are never off-screen */
@media (max-width: 900px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border-bottom: 1px solid var(--line); padding: var(--s3) var(--s4); }
  .table-cards td { border: 0; padding: 2px 0; }
  .table-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 600; font-family: var(--font); }
  .table-cards td.num { text-align: left; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: var(--s2); }
  .stat-value { font-size: var(--text-2xl); }
}

/* ==========================================================================
   Kiosk
   ========================================================================== */
.kiosk-body {
  background: var(--surface);
  height: 100vh; height: 100dvh; overflow: hidden;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; overscroll-behavior: none;
}
.kiosk-body input, .kiosk-body textarea { user-select: text; -webkit-user-select: text; }
.kiosk { display: flex; flex-direction: column; height: 100%; }
.kiosk-top { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s6); gap: var(--s4); }
.kiosk-top .logo { height: 56px; }
.kiosk-clock { text-align: right; font-variant-numeric: tabular-nums; }
.kiosk-clock .time { font-size: 2rem; font-weight: 800; line-height: 1; }
.kiosk-clock .date { color: var(--muted); font-weight: 600; margin-top: 4px; }
.kiosk-stage { flex: 1; min-height: 0; position: relative; }
.kiosk-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) var(--s6); color: var(--muted); font-size: var(--text-sm); border-top: 1px solid var(--line); background: var(--surface-2); }
.kiosk-footer .btn { min-height: 40px; }
.conn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.conn::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--success); }
.conn.is-offline { color: var(--danger); }
.conn.is-offline::before { background: var(--danger); }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding: var(--s5) var(--s6) var(--s6); overflow-y: auto; animation: screen-in 0.22s ease-out; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } .btn { transition: none; } }
.screen-center { justify-content: center; align-items: center; text-align: center; }
.screen-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.screen-head h1 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); margin: 0; flex: 1; }
.screen-head .step { color: var(--muted); font-weight: 700; white-space: nowrap; }
.back-btn { min-height: 56px; padding: 12px 20px; font-size: var(--text-lg); border-radius: var(--radius-lg); }

.welcome-title { font-size: clamp(2.2rem, 5.2vw, 4rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 var(--s2); }
.welcome-sub { font-size: clamp(1.1rem, 2vw, 1.5rem); color: var(--muted); margin: 0 0 var(--s7); }
.welcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); width: min(900px, 100%); }
.mega {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3);
  min-height: 34vh; padding: var(--s6);
  font: inherit; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; letter-spacing: 0.02em; color: #fff;
  border: 0; border-radius: 28px; cursor: pointer; box-shadow: var(--shadow-lg);
  -webkit-tap-highlight-color: transparent; transition: transform 0.08s ease, filter 0.15s ease;
}
.mega svg { width: clamp(48px, 7vw, 84px); height: clamp(48px, 7vw, 84px); }
.mega small { font-size: clamp(0.95rem, 1.6vw, 1.2rem); font-weight: 600; letter-spacing: 0; opacity: 0.92; }
.mega:active { transform: scale(0.985); filter: brightness(0.95); }
.mega-in { background: linear-gradient(160deg, #2a9a47, var(--ftw-green)); }
.mega-out { background: linear-gradient(160deg, #2a80c6, var(--ftw-blue)); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s5); flex: 1; max-height: 420px; }
.choice {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3);
  padding: var(--s6) var(--s5); min-height: 200px;
  font: inherit; font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; color: var(--ink);
  background: var(--surface); border: 3px solid var(--line); border-radius: 24px; cursor: pointer;
  box-shadow: var(--shadow); -webkit-tap-highlight-color: transparent; transition: transform 0.08s ease, border-color 0.15s ease;
}
.choice small { font-size: var(--text-lg); font-weight: 500; color: var(--muted); }
/* Team member | Visitor side by side on every tablet and phone. */
.choice-grid-2 { grid-template-columns: 1fr 1fr; }
.choice-grid-2 .choice { text-align: center; }
@media (max-width: 600px) {
  .choice-grid-2 { gap: var(--s3); }
  .choice-grid-2 .choice { min-height: 180px; padding: var(--s4) var(--s3); gap: var(--s2); font-size: 1.4rem; }
  .choice-grid-2 .choice small { font-size: 0.95rem; }
  .choice-grid-2 .choice svg { width: 44px; height: 44px; }
}
.choice svg { width: 64px; height: 64px; }
.choice:active { transform: scale(0.985); }
.choice-team { border-color: #bcd5ec; }
.choice-team svg { color: var(--ftw-blue); }
.choice-visitor { border-color: #f0c2d5; }
.choice-visitor svg { color: var(--ftw-pink); }
.choice-yes { border-color: #bfe0c6; }
.choice-yes svg { color: var(--ftw-green); }
.choice-no svg { color: var(--ftw-pink); }

.search-box { position: relative; margin-bottom: var(--s4); }
.search-box svg { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; color: var(--muted); pointer-events: none; }
.search-input {
  width: 100%; min-height: 76px; padding: 16px 20px 16px 68px;
  font: inherit; font-size: 1.75rem; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 3px solid var(--line-strong); border-radius: 20px;
}
.search-input:focus { outline: none; border-color: var(--ftw-blue); box-shadow: 0 0 0 5px var(--ftw-blue-soft); }
.search-help { color: var(--muted); font-size: var(--text-lg); margin-bottom: var(--s4); }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3); align-content: start; }
.result {
  display: flex; align-items: center; gap: var(--s4); text-align: left;
  min-height: 84px; padding: var(--s4) var(--s5);
  font: inherit; font-size: 1.4rem; font-weight: 700; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px; cursor: pointer;
  box-shadow: var(--shadow-sm); -webkit-tap-highlight-color: transparent;
}
.result:active { transform: scale(0.99); border-color: var(--ftw-blue); }
.result .avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 1.1rem; font-weight: 800; background: var(--ftw-blue-soft); color: #16507f; }
.result .meta { display: block; font-size: var(--text-base); font-weight: 500; color: var(--muted); }
.result-new { border-style: dashed; color: var(--ftw-pink); }
.result-new .avatar { background: var(--ftw-pink-soft); color: var(--ftw-pink); }
.kiosk-note { margin-top: var(--s4); padding: var(--s4) var(--s5); border-radius: var(--radius-lg); background: var(--surface-2); font-size: var(--text-lg); color: var(--ink-2); }

.confirm-card { width: min(720px, 100%); margin: auto; text-align: center; padding: var(--s7) var(--s6); border-radius: 28px; background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow-lg); }
.confirm-card .big-name { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; margin: var(--s2) 0 var(--s5); letter-spacing: -0.01em; }
.confirm-card .lead { font-size: 1.4rem; color: var(--muted); margin: 0; }
.confirm-actions { display: grid; grid-template-columns: 1fr 2fr; gap: var(--s4); margin-top: var(--s5); }
.confirm-actions .btn { min-height: 84px; font-size: 1.5rem; border-radius: 20px; }

.keypad-display { display: flex; gap: var(--s3); justify-content: center; margin: var(--s4) 0 var(--s5); }
.keypad-display span { width: 64px; height: 76px; border-radius: 16px; border: 3px solid var(--line-strong); display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; background: var(--surface); }
.keypad-display span.filled { border-color: var(--ftw-blue); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); width: min(420px, 100%); margin: 0 auto; }
.keypad button { min-height: 72px; font: inherit; font-size: 1.8rem; font-weight: 700; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.keypad button:active { background: var(--surface-2); transform: scale(0.98); }
.keypad .key-wide { font-size: var(--text-lg); }

.reg-form { width: min(980px, 100%); margin: 0 auto; }
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4) var(--s5); }
.reg-grid .span-2 { grid-column: 1 / -1; }
.kiosk .field label { font-size: 1.2rem; }
.kiosk .input { min-height: 64px; font-size: 1.4rem; padding: 12px 18px; border-width: 2px; border-radius: 16px; }
.dob-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: var(--s3); }
.type-toggle { display: flex; gap: var(--s3); }
.type-toggle button { flex: 1; min-height: 64px; font: inherit; font-size: 1.2rem; font-weight: 700; border-radius: 16px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.type-toggle button[aria-pressed="true"] { border-color: var(--ftw-blue); background: var(--ftw-blue-soft); color: #134a75; }
.privacy-box { background: var(--surface-2); border-radius: var(--radius-lg); padding: var(--s4) var(--s5); font-size: var(--text-base); color: var(--ink-2); }
.privacy-box p { margin: 0 0 var(--s2); }
.privacy-full { white-space: pre-line; max-height: 50vh; overflow-y: auto; font-size: 1.05rem; }
.kiosk .field-error { font-size: 1rem; }

.success-screen { text-align: center; }
/* Stays a circle on short screens (it used to be squashed into an oval). */
.success-icon { width: clamp(96px, 20vh, 148px); aspect-ratio: 1; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; margin: 0 auto var(--s5); background: var(--success-soft); color: var(--success); animation: pop 0.35s ease-out; }
.success-icon svg { width: 57%; height: 57%; }
.success-icon.is-info { background: var(--info-soft); color: var(--info); }
.success-icon.is-bye { background: var(--ftw-blue-soft); color: var(--ftw-blue); }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: none; opacity: 1; } }
.success-title { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; margin: 0 0 var(--s3); }
.success-sub { font-size: 1.5rem; color: var(--muted); margin: 0 0 var(--s6); }
.countdown { width: min(420px, 80%); height: 8px; border-radius: 999px; background: var(--surface-2); margin: 0 auto var(--s5); overflow: hidden; }
.countdown span { display: block; height: 100%; width: 100%; background: var(--ftw-green); transform-origin: left; }

.onsite-count { font-weight: 700; color: var(--muted); font-size: var(--text-lg); }

.overlay { position: fixed; inset: 0; background: rgba(20, 32, 40, 0.55); display: grid; place-items: center; z-index: 50; padding: var(--s5); }
.overlay-card { background: var(--surface); border-radius: 28px; padding: var(--s7) var(--s6); width: min(560px, 100%); text-align: center; box-shadow: var(--shadow-lg); }
.overlay-card h2 { font-size: 2rem; }
.overlay-card .count { font-size: 4rem; font-weight: 800; color: var(--ftw-blue); line-height: 1; margin: var(--s4) 0; font-variant-numeric: tabular-nums; }
.offline-bar { background: var(--danger); color: #fff; text-align: center; font-weight: 700; padding: 10px var(--s4); font-size: var(--text-lg); }

.centre-page { max-width: 520px; margin: 8vh auto; padding: 0 var(--s4); text-align: center; }

@media (max-width: 820px) {
  .kiosk-top { padding: var(--s3) var(--s4); }
  .kiosk-top .logo { height: 40px; }
  .screen { padding: var(--s4); }
  /* Sign in | Sign out stay side by side, as on the iPad in landscape. */
  .welcome-actions { gap: var(--s4); }
  .mega { min-height: 32vh; padding: var(--s5) var(--s3); }
  .reg-grid { grid-template-columns: 1fr; }
  .confirm-actions { grid-template-columns: 1fr; }
  .confirm-actions .btn:first-child { order: 2; }
}

/* ==========================================================================
   Emergency register (mobile-first)
   ========================================================================== */
.em-body { background: #f4f5f6; }
.em-header { background: var(--danger); color: #fff; padding: 12px var(--s4); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
.em-header.is-drill { background: #7a3e00; }
.em-header.is-closed { background: var(--ink-2); }
.em-header.is-calm { background: var(--ink); }
.em-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.em-title h1 { font-size: 1.05rem; margin: 0; letter-spacing: 0.04em; text-transform: uppercase; }
.em-header .btn { --btn-bg: rgba(255, 255, 255, 0.14); --btn-fg: #fff; --btn-border: rgba(255, 255, 255, 0.55); min-height: 40px; }
.em-sub { font-size: var(--text-sm); opacity: 0.92; margin-top: 2px; }
.em-status-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--text-sm); margin-top: 6px; font-weight: 600; }
.em-wrap { max-width: 860px; margin: 0 auto; padding: var(--s3) var(--s3) 120px; }

.em-banner { border-radius: var(--radius); padding: 12px 14px; margin-bottom: var(--s3); font-weight: 650; display: flex; gap: var(--s3); align-items: flex-start; }
.em-banner svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.em-banner.offline { background: var(--danger); color: #fff; }
.em-banner.stale { background: var(--warning-soft); color: #6b3500; border: 2px solid #f0c27b; }
.em-banner.pending { background: var(--info-soft); color: #123f66; border: 1px solid #c6dbee; }

/* One equal column per count: four on the landing page, three during a roll call. */
.em-counts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s2); margin-bottom: var(--s3); }
.em-count { background: #fff; border-radius: var(--radius-lg); padding: 10px 12px; text-align: center; border: 2px solid var(--line); }
.em-count .n { font-size: 2.2rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.em-count .l { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
@media (max-width: 420px) { .em-count { padding: 10px 6px; } .em-count .l { letter-spacing: 0; } }
.em-count.missing { border-color: #f2b8b8; background: #fff7f7; }
.em-count.missing .n { color: var(--danger); }
.em-count.safe { border-color: #b9e0c4; }
.em-count.safe .n { color: var(--success); }
.em-count.all-safe { border-color: var(--success); background: var(--success-soft); }
.em-progress { height: 12px; border-radius: 999px; background: #e7eaed; overflow: hidden; margin-bottom: var(--s3); }
.em-progress span { display: block; height: 100%; width: 0; background: var(--success); transition: width 0.3s ease; }

.em-tools { position: sticky; top: var(--em-header-h, 92px); z-index: 10; background: #f4f5f6; padding: 6px 0 var(--s2); }
.em-search { width: 100%; min-height: 52px; font: inherit; font-size: 1.15rem; padding: 10px 14px; border: 2px solid var(--line-strong); border-radius: 14px; background: #fff; }
.em-search:focus { outline: none; border-color: var(--ftw-blue); box-shadow: 0 0 0 3px var(--ftw-blue-soft); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: var(--s2) 0 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line-strong); background: #fff; font: inherit; font-weight: 700; font-size: var(--text-sm); color: var(--ink-2); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.em-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.em-person { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); background: #fff; border-radius: var(--radius-lg); padding: 10px 10px 10px 14px; border: 2px solid #f2b8b8; box-shadow: inset 6px 0 0 var(--danger); min-height: 76px; }
.em-person .who { flex: 1; min-width: 0; }
.em-person .name { font-size: 1.2rem; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.em-person .detail { font-size: var(--text-sm); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.em-person .flag { color: var(--warning); font-weight: 700; }
.em-person.is-accounted { border-color: #b9e0c4; box-shadow: inset 6px 0 0 var(--success); background: #f6fcf8; }
.em-person.is-accounted .name::before { content: "✓ "; color: var(--success); }
.em-person.is-not-on-site { border-color: var(--line); box-shadow: inset 6px 0 0 var(--muted); background: #f7f8f9; }
.em-person.is-not-on-site .name { color: var(--ink-2); }
.em-person.is-pending { outline: 2px dashed var(--info); outline-offset: 2px; }
.em-action { flex: none; min-width: 116px; min-height: 60px; padding: 8px 12px; border-radius: 14px; border: 0; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; background: var(--success); color: #fff; line-height: 1.15; }
.em-action:active { transform: scale(0.97); }
.em-action.undo { background: #fff; color: var(--ink-2); border: 2px solid var(--line-strong); min-width: 0; font-size: var(--text-sm); }
.em-more { flex: none; min-width: 44px; min-height: 60px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-size: 1.4rem; font-weight: 800; color: var(--ink-2); cursor: pointer; }

.em-section { margin-top: var(--s5); }
.em-section h2 { font-size: var(--text-base); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin-bottom: var(--s2); }
.em-changes { background: var(--warning-soft); border: 2px solid #f0c27b; border-radius: var(--radius-lg); padding: var(--s3) var(--s4); margin-bottom: var(--s3); }
.em-changes h2 { color: #6b3500; margin-bottom: var(--s2); font-size: var(--text-sm); }
.em-changes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.em-changes li { display: flex; align-items: center; gap: var(--s3); justify-content: space-between; background: #fff; border-radius: var(--radius); padding: 8px 10px; font-weight: 600; }
.em-log { list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.em-log li { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; gap: var(--s3); }
.em-log li:last-child { border-bottom: 0; }
.em-log time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.em-bottom { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 10px var(--s3) calc(10px + env(safe-area-inset-bottom)); z-index: 15; display: flex; gap: var(--s2); justify-content: center; }
.em-bottom .btn { flex: 1; max-width: 280px; }
.em-start { display: grid; gap: var(--s3); margin: var(--s3) 0 var(--s5); }
.em-start .btn { min-height: 72px; font-size: 1.25rem; border-radius: 18px; }
.em-assembly { background: #fff; border-radius: var(--radius-lg); padding: 10px 14px; border: 1px solid var(--line); margin-bottom: var(--s3); font-weight: 600; }
.em-assembly span { color: var(--muted); font-weight: 600; display: block; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; }

.em-sheet { position: fixed; inset: auto 0 0 0; background: #fff; border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); padding: var(--s5) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); z-index: 60; max-height: 85vh; overflow-y: auto; }
.em-sheet h2 { margin-bottom: var(--s2); }
.em-sheet .btn { min-height: 56px; margin-top: var(--s2); }
.em-sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 32, 40, 0.45); z-index: 55; }

/* ==========================================================================
   Print (A4 register)
   ========================================================================== */
.print-page { background: #fff; padding: 24px; max-width: 900px; margin: 0 auto; }
.print-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; border-bottom: 3px solid var(--ink); padding-bottom: 12px; margin-bottom: 16px; }
.print-head h1 { margin: 0; font-size: 1.6rem; }
.print-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.print-table th, .print-table td { border: 1px solid #999; padding: 6px 8px; text-align: left; }
.print-table th { background: #eee; }
.print-table td.tick { width: 70px; }
.print-warning { border: 2px solid #000; padding: 8px 12px; margin: 12px 0; font-weight: 700; }
.print-actions { margin-bottom: 16px; display: flex; gap: 8px; }
@media print {
  .print-actions, .no-print { display: none !important; }
  body { background: #fff; }
  .print-page { padding: 0; }
  @page { size: A4; margin: 12mm; }
}
.centre-page .logo { margin: 0 auto var(--s5); height: 56px; }
.centre-page .card { text-align: left; margin: var(--s5) 0; }
.success-screen .form-actions { justify-content: center; }
.success-screen .form-actions .btn { min-width: 220px; }
.narrow-form { max-width: 480px; }
.auth-card .small { margin: var(--s4) 0 0; }
/* Kiosk fills the screen below the optional test banner */
.kiosk-body { display: flex; flex-direction: column; }
.kiosk-body > .kiosk { flex: 1; min-height: 0; height: auto; }
.kiosk .field .label { font-size: 1.2rem; }
.verify-card { width: min(1040px, 100%); display: grid; gap: var(--s5); align-items: center; padding: var(--s5) var(--s6); }
.verify-card .keypad-display { margin: var(--s4) 0; }
.verify-card .keypad button { min-height: 64px; }
@media (min-width: 900px) {
  .verify-card { grid-template-columns: 1.15fr 1fr; text-align: left; }
  .verify-card .keypad-display { justify-content: flex-start; }
}
.alert > svg { flex: none; margin-top: 2px; }

/* ---- Fixes from hands-on testing ---- */
/* Tablet set-up and offline pages: centred, full width up to 520px (they sat squashed in a corner). */
.kiosk-body > .centre-page { width: calc(100% - 32px); }
/* Long names wrap instead of overflowing their buttons and cards. */
.big-name, .result-text, .success-title, .confirm-card .lead { overflow-wrap: anywhere; }
.result-text { min-width: 0; }
/* Vehicle registrations display in capitals without rewriting what the keyboard sends. */
.input-upper { text-transform: uppercase; }
#signout-empty p { margin-top: var(--s4); }
.merge-choice { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: var(--s2); align-items: flex-start; }
.merge-choice:has(input:checked) { border-color: var(--ftw-blue); background: var(--ftw-blue-soft); }
fieldset.field legend { margin-bottom: 6px; }
.kiosk .btn[disabled] { opacity: 0.45; }

/* Emergency register: counts and unsent taps live in the sticky header so they're always visible
   and never push the list around. */
.em-head-counts { font-size: var(--text-sm); font-weight: 800; margin-top: 4px; letter-spacing: 0.01em; }
.em-pending { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: #fff; color: #123f66; font-size: var(--text-xs); font-weight: 800; }
.em-filterbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); background: var(--info-soft); color: #123f66; border: 1px solid #c6dbee; border-radius: var(--radius); padding: 6px 6px 6px 12px; margin-bottom: var(--s2); font-weight: 700; font-size: var(--text-sm); }
.em-conflict { margin-top: 6px; font-size: var(--text-sm); font-weight: 700; color: #6b3500; background: var(--warning-soft); border-radius: var(--radius-sm); padding: 4px 8px; }
.em-bottom .btn.is-blocked { opacity: 0.55; }
@media (max-width: 420px) {
  .em-header { padding: 8px 12px; }
  .em-title h1 { font-size: 0.92rem; }
  .em-sub { font-size: var(--text-xs); }
  .em-status-line { margin-top: 2px; font-size: var(--text-xs); }
  .em-tools { padding-top: 4px; }
  .em-search { min-height: 46px; font-size: 1.05rem; }
  .chip { min-height: 36px; padding: 6px 12px; }
  .em-person { min-height: 68px; padding: 8px 8px 8px 12px; }
  .em-person .name { font-size: 1.1rem; }
  .em-action { min-width: 104px; min-height: 56px; font-size: 0.95rem; }
}
.input-upper::placeholder { text-transform: none; }
