/* Visitora — app layer on the Ownware UI kit (assets/ui/ownware-ui.css).
   Accent + app-specific pieces only; every generic rule comes from the kit.
   No hex greys and no #fff outside the two places that are deliberately paper. */
:root{--accent:#0369a1;--accent-dark:#075985;--accent-soft:#e0f2fe;--on-accent:#ffffff;--accent-ink:var(--on-accent)}
html[data-theme="dark"]{--accent:#38bdf8;--accent-dark:#7dd3fc;--accent-soft:#0c2b3d;--on-accent:#05202e;--accent-ink:var(--on-accent)}

/* ── sidebar brand: stop it being squeezed to nothing ─────────────────────
   The kit's .side is `display:flex; flex-direction:column; height:100vh; overflow:auto`, and
   .brand is an ordinary flex item with the default flex-shrink:1. As soon as the nav is long
   enough to overflow — measured here: 910px of content in a 761px sidebar — the FIRST
   shrinkable item absorbs the difference, and the brand collapses to height 0 with
   overflow:hidden clipping what is left. The name simply vanishes.
   That is the real cause of the "brand renders as nothing" symptom; the `display:inline` fix
   several sibling apps carry addresses text-overflow, which is a different thing and does not
   stop the shrink. Both are applied: don't shrink, and truncate as text if the name is long. */
.side .brand{flex:0 0 auto;min-height:1.3em}
.side .brand > span:not(.dot){display:inline}

/* ── status pills the kit doesn't know (a visit's lifecycle) ──────────────── */
.pill.onsite{background:var(--okbg);color:var(--ok)}
.pill.out{background:var(--chip);color:var(--sub)}
.pill.overnight{background:var(--warnbg);color:var(--warn)}   /* signed in yesterday, still in */
.pill.accounted{background:var(--okbg);color:var(--ok)}
.pill.missing{background:var(--badbg);color:var(--bad)}
.pill.valid{background:var(--okbg);color:var(--ok)}
.pill.used{background:var(--chip);color:var(--sub)}
.pill.cancelled,.pill.expired{background:var(--warnbg);color:var(--warn)}
.pill.kiosk,.pill.desk,.pill.pre,.pill.off{background:var(--chip);color:var(--sub)}
.pill.on{background:var(--accent-soft);color:var(--accent)}

/* ── badge number: the one thing reception reads across a room ────────────── */
.badge-no{display:inline-flex;align-items:center;justify-content:center;min-width:2.4em;padding:2px 8px;
  border-radius:8px;background:var(--accent-soft);color:var(--accent);font-family:var(--mono);
  font-weight:800;font-size:1rem;letter-spacing:.02em}
.badge-no.none{background:var(--chip);color:var(--faint);font-weight:600}

/* ══ THE HERO — the evacuation list ═══════════════════════════════════════════
   Built for someone standing outside a building holding a tablet: big rows, big
   targets, and a tally you can read at arm's length. */
.evac-head{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:16px}
.evac-num{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;box-shadow:var(--shadow)}
.evac-num .n{font-family:var(--display);font-size:2.6rem;line-height:1;font-weight:800;letter-spacing:-.02em}
.evac-num .l{color:var(--sub);font-size:.82rem;text-transform:uppercase;letter-spacing:.08em;margin-top:6px}
.evac-num.ok .n{color:var(--ok)}
.evac-num.bad .n{color:var(--bad)}

/* One person, one row, one tap. 56px of target height is the smallest thing a
   cold hand hits reliably; that is the number this row is built around. */
.evac-row{display:flex;align-items:center;gap:14px;padding:12px 14px;border:1px solid var(--line);
  border-radius:var(--radius-sm);background:var(--card);margin-bottom:8px;min-height:56px}
.evac-row .who{flex:1 1 auto;min-width:0}
.evac-row .nm{font-weight:700;font-size:1.02rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.evac-row .mt{color:var(--sub);font-size:.86rem;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.evac-row .act{flex:0 0 auto}
.evac-row .act .btn{min-height:44px;min-width:130px}
.evac-row.is-accounted{background:var(--okbg);border-color:color-mix(in srgb,var(--ok) 35%,transparent)}
.evac-row.is-accounted .nm{text-decoration:line-through;text-decoration-thickness:2px;opacity:.72}
.evac-row.pending{opacity:.55}                                  /* queued offline, not yet saved */

/* The offline banner. Loud on purpose: a stale muster list that looks live is the
   failure this whole feature exists to prevent. */
.evac-offline{display:none;border:2px solid var(--warn);background:var(--warnbg);color:var(--warn);
  border-radius:var(--radius-sm);padding:12px 16px;margin-bottom:14px;font-weight:700}
body.is-offline .evac-offline{display:block}

/* ══ THE KIOSK — an iPad in Safari, full screen ══════════════════════════════
   No sidebar, no chrome, targets sized for a thumb at arm's length. It is its own
   document (App::view(..., null)), so these rules stand alone. */
body.kiosk-body{background:linear-gradient(160deg,var(--accent-soft),var(--bg) 55%);min-height:100vh;margin:0}
.kioskwrap{max-width:720px;margin:0 auto;padding:38px 22px 60px}
.kiosk-brand{display:flex;align-items:center;justify-content:center;gap:10px;font-family:var(--display);
  font-weight:800;font-size:1.35rem;margin-bottom:6px}
.kiosk-brand .dot{width:14px;height:14px;border-radius:5px;background:var(--accent);display:inline-block}
.kiosk-welcome{text-align:center;color:var(--sub);margin:0 0 26px}
.kioskcard{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:26px 24px;box-shadow:var(--shadow)}
.kioskcard h1{font-size:1.7rem;margin:0 0 6px}
/* Field sizing must out-specify the kit's own input reset, which scores (0,4,1) and carries
   font:inherit — a plain `.kioskcard input` loses and silently renders at body size. */
.kioskwrap .kioskcard input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]),
.kioskwrap .kioskcard select{font-size:1.15rem;padding:15px 16px;min-height:58px;border-radius:12px}
.kioskwrap .kioskcard label{font-size:1rem}
.kioskwrap .btn.lg{font-size:1.15rem;padding:17px 26px;min-height:60px;border-radius:12px}
.kiosk-choice{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:8px}
.kiosk-choice a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  min-height:150px;border:2px solid var(--line);border-radius:16px;background:var(--card);
  text-decoration:none;color:var(--ink);font-weight:700;font-size:1.2rem;box-shadow:var(--shadow)}
.kiosk-choice a:hover,.kiosk-choice a:focus-visible{border-color:var(--accent);color:var(--accent)}
.kiosk-choice .sub{font-weight:500;font-size:.9rem;color:var(--sub)}
.rulesbox{background:var(--field-bg);border:1px solid var(--line);border-radius:12px;padding:16px 18px;
  max-height:230px;overflow-y:auto;white-space:pre-wrap;line-height:1.6;font-size:.95rem;margin:6px 0 12px}
.bigbadge{font-family:var(--display);font-size:4.4rem;line-height:1;font-weight:800;color:var(--accent);
  letter-spacing:-.02em;margin:8px 0}
.kiosk-foot{text-align:center;color:var(--faint);font-size:.82rem;margin-top:26px}

/* ══ THE BADGE — printed on 86 x 54 mm card stock ════════════════════════════
   Pinned light because it is ink on card, not a screen. The @page size is what
   makes a browser print it at the right physical size rather than scaled to A4. */
.badgecard{width:86mm;height:54mm;box-sizing:border-box;padding:6mm 7mm;border:1px solid #d5dde5;
  border-radius:3mm;background:#fff;color:#0f172a;display:flex;flex-direction:column;justify-content:space-between;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
.badgecard .b-top{display:flex;justify-content:space-between;align-items:flex-start;gap:4mm}
.badgecard .b-org{font-weight:800;font-size:3.4mm;letter-spacing:.02em;text-transform:uppercase;color:#475569}
.badgecard .b-no{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:800;font-size:8mm;line-height:1;color:#0369a1}
.badgecard .b-name{font-weight:800;font-size:6mm;line-height:1.1;margin-top:2mm;word-break:break-word}
.badgecard .b-co{font-size:3.6mm;color:#475569;margin-top:1mm}
.badgecard .b-meta{font-size:3.2mm;color:#64748b;display:flex;justify-content:space-between;gap:3mm}
.badgecard .b-meta{align-items:flex-end}
.badgecard .b-qr{display:block;width:15mm;height:15mm;flex:none}   /* 1.1 pass B: the sign-out QR */
.badgecard .b-qr svg{width:100%;height:100%}
.badgesheet{padding:20px;display:flex;flex-direction:column;align-items:center;gap:14px}
@media print{
  @page{size:86mm 54mm;margin:0}
  body{background:#fff}
  .badgesheet{padding:0;gap:0}
  .no-print{display:none !important}
  .badgecard{border:none;border-radius:0;page-break-after:avoid}
}

/* ══ THE MUSTER SHEET — the paper fallback ═══════════════════════════════════
   In a real evacuation the phone may be dead too, not just the wifi. */
.muster{max-width:900px;margin:0 auto;padding:28px 24px;color:var(--ink)}
.muster h1{margin:0 0 2px}
.muster .gen{color:var(--sub);font-size:.9rem;margin:0 0 18px}
.muster table{width:100%;border-collapse:collapse;font-size:.95rem}
.muster th,.muster td{border:1px solid var(--line);padding:8px 10px;text-align:left;vertical-align:top}
.muster th{background:var(--chip);font-size:.78rem;text-transform:uppercase;letter-spacing:.06em}
.muster .tick{width:34px;height:22px;border:1.5px solid var(--ink);border-radius:3px;display:inline-block}
@media print{
  .muster{padding:0}
  .no-print{display:none !important}
  .muster table{font-size:11pt}
  .muster thead{display:table-header-group}    /* repeat the header on every printed page */
  .muster tr{page-break-inside:avoid}
}

/* ── the public pre-registration page ─────────────────────────────────────── */
body.pub-body{background:linear-gradient(160deg,var(--accent-soft),var(--bg) 55%);min-height:100vh;margin:0}
.pubwrap{max-width:560px;margin:0 auto;padding:44px 20px 60px}
.pubwrap .brand2{display:flex;align-items:center;justify-content:center;gap:9px;font-family:var(--display);
  font-weight:800;font-size:1.2rem;margin-bottom:18px}
.pubwrap .brand2 .dot{width:12px;height:12px;border-radius:4px;background:var(--accent)}
.pubwrap .card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:24px 22px;box-shadow:var(--shadow)}
.pubfoot{text-align:center;color:var(--faint);font-size:.82rem;margin-top:20px}

/* ── phone. The app layer loads after the kit, so anything with its own grid has
      to collapse here or it will not collapse at all. minmax(0,1fr) keeps a long
      name from forcing the column wider than the screen. ──────────────────── */
@media (max-width:900px){
  .evac-head{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
  .evac-num{padding:12px 13px}
  .evac-num .n{font-size:2rem}
}
@media (max-width:640px){
  .evac-head{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .evac-num{padding:10px 11px}
  .evac-num .n{font-size:1.55rem}
  .evac-num .l{font-size:.68rem;letter-spacing:.05em}
  /* The row stacks rather than shrinking the tap target: on a phone the button is
     the whole point, and a 44px target squeezed to 90px wide is a missed tap.
     But only the BUTTON goes full width — a badge number stretched across the screen
     stops looking like the number on a plastic card, and the meta line has to wrap
     rather than ellipsis away the sign-in time, which is the one fact a fire marshal
     reads after the name. */
  .evac-row{flex-wrap:wrap;gap:10px 12px}
  .evac-row .badge-no{align-self:flex-start}
  .evac-row .who{flex:1 1 auto;min-width:0}
  .evac-row .mt{white-space:normal;overflow:visible;text-overflow:clip}
  .evac-row .act{flex:1 1 100%}
  .evac-row .act .btn{width:100%;min-width:0}
  .kiosk-choice{grid-template-columns:minmax(0,1fr)}
  .kioskwrap{padding:24px 16px 44px}
  .kioskcard{padding:20px 16px;border-radius:14px}
  .kioskcard h1{font-size:1.45rem}
  .bigbadge{font-size:3.4rem}
  .badgesheet{padding:12px}
  .badgecard{width:100%;max-width:86mm;height:auto;min-height:54mm}
}
/* 1.1 — the roll call's groups (staff, contractors, visitors) and the staff screens */
.evac-group{font-size:1rem;margin:18px 0 8px}
.evac-group:first-child{margin-top:0}
.kiosk-staff{margin-top:14px;text-align:center}
.pinbox{font-size:2rem;letter-spacing:.4em;text-align:center;max-width:280px;margin:0 auto}
.me-state{font-size:1.4rem;font-weight:700;margin:10px 0}

