/* BCG PTO Event Check-in. Big, plain, fast: the door is a crowded gym, not a desk. */
:root {
  --bg: #f6f7f5; --card: #ffffff; --ink: #14201a; --muted: #5b6760; --line: #d9ded9;
  --brand: #0f5c3a; --brand-ink: #ffffff; --accent: #e8f3ec;
  --ok: #1d7a46; --warn: #a15c00; --warn-bg: #fff4e0; --bad: #b3261e; --bad-bg: #fde8e6;
  --in: #1d7a46; --out: #4b5563; --exp: #8a5a00;
  --radius: 14px; --tap: 52px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1411; --card: #17201b; --ink: #eef3ef; --muted: #a3b0a8; --line: #2c3a32;
    --brand: #3fae76; --brand-ink: #06140c; --accent: #1d2c24;
    --ok: #58c98b; --warn: #f0b04a; --warn-bg: #3a2a10; --bad: #ff8a80; --bad-bg: #3d1714;
    --in: #58c98b; --out: #a3aeb8; --exp: #f0b04a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 18px; line-height: 1.35; -webkit-text-size-adjust: 100%; }
#app { max-width: 760px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
#view { padding: 12px 16px; outline: none; }

#top { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--brand); color: var(--brand-ink); }
.top-title { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-right { display: flex; gap: 6px; flex-shrink: 0; }
#banner:not(:empty) { padding: 8px 16px; font-size: 15px; }
#banner.stale { background: var(--warn-bg); color: var(--warn); }
#banner.bad { background: var(--bad-bg); color: var(--bad); }

#tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; max-width: 160px; min-height: 60px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 600; }
.tab.here { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }

#toast { position: fixed; left: 0; right: 0; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 20; display: flex; justify-content: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 0 12px; padding: 12px 14px;
  border-radius: var(--radius); background: var(--ink); color: var(--bg); box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: 16px; }
.toast.bad { background: var(--bad); color: #fff; }
.toast-btn { background: var(--bg); color: var(--ink); border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 16px; }
.toast-x { background: none; border: 0; color: inherit; font-size: 22px; padding: 4px 8px; }

h1 { font-size: 24px; margin: 4px 0 10px; }
h2 { font-size: 20px; margin: 4px 0 10px; }
h3 { font-size: 17px; margin: 14px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
.card.attention, .attention { border-color: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.center { text-align: center; }
.err { color: var(--bad); font-weight: 600; min-height: 1em; margin: 6px 0; }
.warn { color: var(--warn); }
.warnbox { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }

label { display: block; margin: 10px 0; font-size: 15px; color: var(--muted); }
label input, label textarea, label select { margin-top: 4px; }
input, textarea, select { width: 100%; font: inherit; font-size: 18px; color: var(--ink); background: var(--bg); border: 2px solid var(--line);
  border-radius: 12px; padding: 12px; min-height: var(--tap); }
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: none; }
input[type=checkbox] { width: 28px; height: 28px; min-height: 0; margin: 0 10px 0 0; flex-shrink: 0; accent-color: var(--brand); }
button { font: inherit; font-size: 17px; min-height: var(--tap); border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink);
  padding: 10px 16px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .5; }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.danger { border-color: var(--bad); color: var(--bad); }
button.wide { display: block; width: 100%; margin: 10px 0 0; }
button.small { min-height: 44px; font-size: 15px; padding: 6px 12px; }
button.link { border: 0; background: none; color: var(--brand); text-decoration: underline; padding: 10px 0; min-height: 44px; }
button.back { border: 0; background: none; color: var(--brand); padding: 8px 0; }
.chip { display: inline-block; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 700; background: rgba(255,255,255,.18); color: inherit; margin-left: 6px; }
.chip.big { font-size: 15px; }
.chip.ok { background: rgba(255,255,255,.18); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad); color: #fff; }
.chip.update { min-height: 0; border: 0; background: #fff; color: var(--brand); }
.card .chip.st-in { background: var(--accent); color: var(--in); }
.card .chip.st-out { background: var(--line); color: var(--out); }
.card .chip.st-expected { background: var(--warn-bg); color: var(--exp); }

.searchbar { display: flex; gap: 8px; position: sticky; top: 56px; z-index: 3; background: var(--bg); padding: 4px 0 8px; }
.searchbar input { font-size: 22px; min-height: 60px; }
.searchbar .scan { min-width: 84px; }
.result { display: block; width: 100%; text-align: left; margin: 0 0 8px; padding: 12px 14px; }
.result-kids { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 19px; }
.kid.hit { text-decoration: underline; }
.kid.st-in::after { content: " · here"; color: var(--in); font-size: 14px; }
.kid.st-out::after { content: " · gone home"; color: var(--out); font-size: 14px; }
.tag { font-variant-numeric: tabular-nums; }

.family h1 { margin-bottom: 2px; }
.contact { margin: 0 0 10px; color: var(--muted); }
.kidcard { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.kidcard.hit .bigtag { outline: 4px solid var(--brand); }
/* The number volunteers grab the nametag by: as big as the screen allows (October lesson). */
.bigtag { flex-shrink: 0; min-width: 132px; text-align: center; font-size: 64px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums;
  padding: 10px 8px; border-radius: 12px; background: var(--accent); color: var(--ink); }
.kidcard.st-in .bigtag { background: var(--accent); color: var(--in); }
.kidcard.st-out .bigtag { background: var(--line); color: var(--out); }
.kidinfo { flex: 1; min-width: 0; }
.kidname { font-size: 21px; font-weight: 700; }
.health { background: var(--bad-bg); color: var(--bad); border-radius: 8px; padding: 6px 8px; margin-top: 6px; font-size: 15px; font-weight: 600; white-space: pre-wrap; }
.flag { color: var(--bad); font-size: 15px; font-weight: 600; margin-top: 4px; }
.kidactions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tick { display: flex; align-items: center; min-height: var(--tap); color: var(--ink); font-size: 19px; margin: 4px 0; }
.tick.late { color: var(--warn); }
.collector { display: block; width: 100%; text-align: left; margin: 8px 0 0; font-size: 19px; min-height: 60px; border-color: var(--brand); }
.otherbox { border-top: 1px solid var(--line); margin-top: 14px; }

.lock { padding-top: 8px; }
.lookup-row { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; }
.lookup-row .bigtag { font-size: 72px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.tile .n { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile.big { grid-column: 1 / -1; } .tile.big .n { font-size: 72px; color: var(--in); }
.listrow { padding: 8px 0; border-top: 1px solid var(--line); }
table.devices { width: 100%; border-collapse: collapse; font-size: 15px; }
table.devices th, table.devices td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line); }
details > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.event-row { display: block; width: 100%; text-align: left; margin: 8px 0; }
code { word-break: break-all; font-size: 14px; }
.plan ul { padding-left: 20px; }

.scanner { position: fixed; inset: 0; z-index: 30; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.scanner video { width: 100%; max-width: 520px; border-radius: 12px; }
.scanner button { max-width: 520px; }

@media (max-width: 420px) {
  .bigtag { min-width: 104px; font-size: 52px; }
  .tab { font-size: 12px; }
}
.tick .tag, .listrow .tag, .kid .tag { margin-right: .35em; }
body.locked #toast, body.locked #tabs { display: none; }
