/* ═══════════════════════════════════════════════════════════════
   PCO Check-In — app styles
   Design language ported from the credentials portal:
   rounded pills, soft shadows, accent-tinted controls, blur overlays,
   a responsive nav that is a floating pill on phones and a sidebar on
   desktop, and automatic dark mode. Accent: iOS blue (#007aff).
   ═══════════════════════════════════════════════════════════════ */

/* ── Design tokens ──────────────────────────────────────────── */
:root {
  --a:   #007aff;          /* accent — iOS blue */
  --a2:  #5ac8fa;          /* accent 2 — light blue (gradients) */
  --ab:  rgb(from var(--a) r g b / 0.13);   /* accent tint */
  --c:   #2fb6a3;          /* teal  (info / kids) */
  --cb:  rgb(from var(--c) r g b / 0.15);
  --b:   #bf59b5;          /* magenta */
  --bb:  rgb(from var(--b) r g b / 0.15);
  --warn:#e6a019;          /* amber */
  --bad: #e0533d;          /* red */
  --good:#2fae5a;          /* green */

  --bg:   #f4f7fb;
  --card: #ffffff;
  --ink:  #16161d;
  --soft: #6a6a78;
  --line: #e6e8f0;
  --field:#ffffff;         /* input background */
  --shadow: 0 0 .5em #eef0f5, 0 6px 22px rgb(20 20 40 / .05);
  --r: 16px;               /* card radius */
  --z: 0.15;               /* tint alpha */
}
@media (prefers-color-scheme: dark) {
  :root {
    --ab:  rgb(from var(--a) r g b / 0.24);
    --bg:   #0b0b10;
    --card: #16161f;
    --ink:  #f1f1f6;
    --soft: #9a9aa8;
    --line: #262633;
    --field:#1d1d27;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 30px rgb(0 0 0 / .35);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
b, strong, h1, h2, h3, h4 { font-weight: 900; letter-spacing: -.02em; }
h1 { font-size: 1.7rem; }
a { color: inherit; text-decoration: none; }
input, select, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
::placeholder { color: var(--soft); opacity: .8; }

/* `body.nt` = no-touch device; gates hover affordances (set in api.js). */

/* ── Loader ─────────────────────────────────────────────────── */
.loader svg, #boot .loader svg { width: 3em; transform-origin: center; animation: rotate 2s linear infinite; }
.loader circle { fill: none; stroke: var(--a); stroke-width: 4; stroke-dasharray: 1,200; stroke-linecap: round; animation: dash 1.5s ease-in-out infinite; }
@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
  0%   { stroke-dasharray: 1,200;  stroke-dashoffset: 0; }
  50%  { stroke-dasharray: 90,200; stroke-dashoffset: -35px; }
  100% { stroke-dashoffset: -125px; }
}
#boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 999; transition: opacity .4s; }
#boot.out { opacity: 0; pointer-events: none; }

/* ── Header (#h) ────────────────────────────────────────────── */
#h {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: rgb(from var(--bg) r g b / .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  transition: left .3s, right .3s;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 900; letter-spacing: -.02em; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; }
.brand .logo-fallback {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ab); color: var(--a); font-weight: 900; font-size: .95rem;
}
.brand span { overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }

/* Search pill */
.srch { position: relative; flex: 1; max-width: 34em; margin-left: 4px; }
.srch .mag { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--soft); pointer-events: none; display: flex; }
.srch .mag svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
#search {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--field);
  border-radius: 9em;
  padding: 11px 14px 11px 40px;
  box-shadow: var(--shadow);
  transition: border-color .25s, box-shadow .25s;
}
#search:focus { outline: none; border-color: var(--a); box-shadow: 0 0 0 3px var(--ab); }

/* Account button */
.who {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 9em;
  display: grid; place-items: center;
  background: var(--ab); color: var(--a);
  font-weight: 900; font-size: .95rem;
  transition: transform .2s;
}
.who img { width: 100%; height: 100%; border-radius: 9em; object-fit: cover; }
.who svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
body.nt .who:hover { transform: scale(1.06); }

/* ── Main content (#c) ──────────────────────────────────────── */
#c {
  position: relative;
  padding: 84px 16px calc(96px + env(safe-area-inset-bottom));
  max-width: 940px; margin: 0 auto;
  transition: margin .3s, transform .3s, opacity .3s;
}

/* ── Nav (#n) — pill on phones, sidebar on desktop ──────────── */
#n {
  position: fixed; z-index: 12;
  left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; gap: 2px; padding: 7px;
  background: rgb(from var(--card) r g b / .72);
  border: 1px solid var(--line);
  border-radius: 9em;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 1px rgb(255 255 255 / .5), 0 6px 22px rgb(0 0 0 / .14);
}
#n a {
  display: grid; place-items: center; gap: 3px;
  padding: 9px 16px; border-radius: 9em;
  color: var(--ink); opacity: .42;
  transition: opacity .25s, color .25s, background .25s;
}
#n a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#n a span { display: none; }   /* phone pill: icons only */
#n a.on { opacity: 1; color: var(--a); }
body.nt #n a:hover { opacity: 1; }

/* ── Search results overlay (#results / #r) ─────────────────── */
#results { position: fixed; inset: 64px 0 0 0; z-index: 8; display: none; }
#results.on { display: block; }
#r {
  position: absolute; top: 6px; left: 16px;
  min-width: 280px; max-width: min(440px, calc(100vw - 32px));
  max-height: calc(100% - 90px); overflow: auto;
  padding: 8px;
  background: rgb(from var(--card) r g b / .9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 8px 28px rgb(from var(--a) r g b / .22);
  transform: translateY(-4px) scale(.97); opacity: 0;
  transition: opacity .2s, transform .2s;
}
#results.on #r { opacity: 1; transform: translateY(0) scale(1); }
.rr { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 11px; cursor: pointer; transition: background .12s; }
body.nt .rr:hover { background: var(--ab); }
.rr .meta { min-width: 0; flex: 1; }
.rr .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr .sb { font-size: .8rem; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Page header ────────────────────────────────────────────── */
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 12px; margin: 4px 0 18px; }
.page-head h1 { margin: 0; }
.section-title { font-weight: 900; font-size: 1.05rem; letter-spacing: -.02em; margin: 22px 4px 10px; }
.muted { color: var(--soft); }

/* ── Cards & grids ──────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 6px 16px;
  margin-bottom: 8px;
}
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .grid.cols-3 { grid-template-columns: 1fr 1fr; } .grid.cols-2 { grid-template-columns: 1fr; } }

/* ── Buttons (.btn) ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: 9em;
  background: var(--ab); color: var(--a);
  font-weight: 800; white-space: nowrap;
  transition: transform .2s, background .25s, box-shadow .25s, color .25s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.nt .btn:hover { transform: scale(1.03); }
.btn.pri { background: var(--a); color: #fff; box-shadow: 0 4px 14px rgb(from var(--a) r g b / .3); }
.btn.bad { background: rgb(from var(--bad) r g b / .14); color: var(--bad); }
body.nt .btn.bad:hover { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; color: var(--soft); border: 1px solid var(--line); }
body.nt .btn.ghost:hover { color: var(--ink); border-color: var(--a); }
.btn.sm { padding: 8px 13px; font-size: .85rem; }

/* ── Rows / list items ──────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.card > .row:first-of-type { border-top: 0; }
.row .meta { flex: 1; min-width: 0; }
.row .nm { font-weight: 700; }
.row .sb { font-size: .82rem; color: var(--soft); }
.med { color: var(--bad); display: inline-flex; vertical-align: -2px; }
.med svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }

/* Avatar */
.av {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 9em;
  display: grid; place-items: center; object-fit: cover;
  background: var(--ab); color: var(--a); font-weight: 900; font-size: .9rem;
}
.av.lg { width: 92px; height: 92px; font-size: 1.8rem; margin: 0 auto; }
.av-edit { position: relative; display: inline-block; cursor: pointer; }
.av-cam { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 9em; display: grid; place-items: center; background: var(--a); color: #fff; border: 3px solid var(--card); }
.av-cam svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Pills */
.pill { flex-shrink: 0; padding: 4px 11px; border-radius: 9em; font-size: .74rem; font-weight: 800; background: var(--ab); color: var(--a); }
.pill.kid   { background: var(--cb); color: var(--c); }
.pill.adult { background: rgb(from var(--b) r g b / .15); color: var(--b); }
.pill.in    { background: rgb(from var(--good) r g b / .15); color: var(--good); }

/* ── Forms ──────────────────────────────────────────────────── */
.field { margin: 0 0 14px; }
.field > label:not(.switch) { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; color: var(--soft); margin-bottom: 6px; }
input[type=text], input[type=number], input[type=email], input[type=tel],
input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%;
  min-width: 0;            /* let date inputs shrink inside grid/flex cells */
  background: var(--field);
  border: 2px solid var(--field);
  border-radius: .7em;
  padding: 11px 13px;
  box-shadow: var(--shadow);
  transition: border-color .25s, box-shadow .25s;
}

/* Reports filter: wraps to fewer columns as space tightens (stacks on phones). */
.rfilter { display: grid; gap: 12px; align-items: end; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a); box-shadow: 0 0 0 3px var(--ab); }
textarea { resize: vertical; min-height: 64px; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 1.15em, calc(100% - 13px) 1.15em; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* Searchable select */
.ssel { position: relative; }
.ssel-pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; max-height: 244px; overflow: auto; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgb(0 0 0 / .2); }
.ssel-opt { padding: 9px 11px; border-radius: 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ssel-opt.on { background: var(--ab); color: var(--a); }
.ssel-opt.sel { font-weight: 800; }
.ssel-no { padding: 10px 11px; color: var(--soft); }

/* Grade-range chips (room editor) */
.gradesel { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip { padding: 7px 12px; border-radius: 9em; border: 1px solid var(--line); background: var(--field); color: var(--ink); font-weight: 700; font-size: .85rem; transition: background .2s, border-color .2s, color .2s; }
.gchip.on { background: var(--a); color: #fff; border-color: var(--a); }
body.nt .gchip:hover { border-color: var(--a); }

/* Switch */
.switch { display: flex; align-items: center; gap: 10px; text-transform: none; font-size: .95rem; font-weight: 600; color: var(--ink); letter-spacing: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { position: relative; flex-shrink: 0; width: 46px; height: 28px; border-radius: 9em; background: var(--line); transition: background .25s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 9em; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .25s; }
.switch input:checked + .track { background: var(--a); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* Segmented control (.seg / .toggle) */
.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--ab); border-radius: 9em; }
.seg button { padding: 8px 16px; border-radius: 9em; font-weight: 800; font-size: .85rem; color: var(--soft); transition: all .25s; }
.seg button.on { background: var(--a); color: #fff; box-shadow: 0 1px 3px rgb(from var(--a) r g b / .3); }

/* ── Modal ──────────────────────────────────────────────────── */
#modal { position: fixed; inset: 0; z-index: 26; display: none; overflow: auto; opacity: 0; transition: opacity .3s; }
#modal.on { display: block; opacity: 1; }
#modal .mbg { position: fixed; inset: 0; background: rgb(0 0 0 / .35); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
#modal .mw { position: relative; width: 24em; max-width: calc(100% - 28px); margin: auto; padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); min-height: 100%; display: flex; }
.mcard { position: relative; width: 100%; align-self: center; background: var(--card); border-radius: var(--r); box-shadow: 0 .3em 1.4em rgb(0 0 0 / .3); padding: 22px; transform: translateY(1.5em); transition: transform .3s; }
#modal.on .mcard { transform: translateY(0); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-size: 1.35rem; }
.modal-head .x { width: 40px; height: 40px; border-radius: 9em; display: grid; place-items: center; background: var(--ab); color: var(--a); transition: transform .2s; }
.modal-head .x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; }
body.nt .modal-head .x:hover { transform: scale(1.06); }
.roleChild, .roleAdult { display: contents; }
.btn:disabled { opacity: .45; cursor: default; }
body.nt .btn:disabled:hover { transform: none; }

/* ── Person view (compact, read-only) ───────────────────────── */
.pv-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pv-head .nm { font-weight: 900; font-size: 1.2rem; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-head .sb { font-size: .85rem; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av.md { width: 54px; height: 54px; font-size: 1.15rem; }
.pv-status { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 12px; font-weight: 700; font-size: .9rem; margin-bottom: 14px; background: var(--line); color: var(--soft); }
.pv-status.in { background: rgb(from var(--good) r g b / .14); color: var(--good); }
.pv-status .dot { width: 8px; height: 8px; border-radius: 9em; background: currentColor; flex-shrink: 0; }
.pv-rows { display: flex; flex-direction: column; }
.pv-row { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.pv-row:first-child { border-top: 0; }
.pv-row .k { color: var(--soft); min-width: 96px; font-weight: 600; flex-shrink: 0; }
.pv-row .v { flex: 1; min-width: 0; word-break: break-word; }
.pv-row.alert { color: var(--bad); }
.pv-row.alert .k { color: var(--bad); }
.lnk { color: var(--a); font-weight: 700; }
body.nt .lnk:hover { text-decoration: underline; }

/* Household member rows */
.hh-members { display: flex; flex-direction: column; }
.hhrow { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 12px; cursor: pointer; transition: background .12s; }
body.nt .hhrow:hover { background: var(--ab); }
.hhrow.ed { cursor: default; }
body.nt .hhrow.ed:hover { background: none; }
.hhrow .meta { flex: 1; min-width: 0; }
.hhrow .nm { font-weight: 700; }
.hhrow .sb { font-size: .8rem; color: var(--soft); }
.hhx { flex-shrink: 0; width: 34px; height: 34px; border-radius: 9em; display: grid; place-items: center; background: rgb(from var(--bad) r g b / .12); color: var(--bad); transition: transform .2s, background .2s; }
.hhx svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; }
body.nt .hhx:hover { transform: scale(1.08); background: var(--bad); color: #fff; }

/* Inline new-person accordion */
.hh-new { display: flex; flex-direction: column; gap: 8px; }
.np { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.np-head { display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; }
.np-badge { flex-shrink: 0; padding: 3px 9px; border-radius: 9em; font-size: .72rem; font-weight: 800; }
.np-badge.kid { background: var(--cb); color: var(--c); }
.np-badge.adult { background: rgb(from var(--b) r g b / .15); color: var(--b); }
.np-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-caret { flex-shrink: 0; width: 9px; height: 9px; border-right: 2px solid var(--soft); border-bottom: 2px solid var(--soft); transform: rotate(-45deg); transition: transform .2s; }
.np.open .np-caret { transform: rotate(45deg); }
.np-x { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9em; display: grid; place-items: center; background: rgb(from var(--bad) r g b / .12); color: var(--bad); }
.np-x svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; }
body.nt .np-x:hover { background: var(--bad); color: #fff; }
.np-body { display: none; padding: 6px 12px 12px; border-top: 1px solid var(--line); }
.np.open .np-body { display: block; }

/* ── Toast ──────────────────────────────────────────────────── */
#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.t, #toast > div { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 9em; font-weight: 700; font-size: .9rem; box-shadow: 0 6px 22px rgb(0 0 0 / .25); animation: toastin .25s ease; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* ── Empty state ────────────────────────────────────────────── */
.empty { text-align: center; color: var(--soft); padding: 26px 16px; }

/* ── Dashboard: stat cards ──────────────────────────────────── */
.stat { position: relative; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 16px; overflow: hidden; }
.stat .n { font-size: 2.2rem; font-weight: 900; line-height: 1; color: var(--a); }
.stat .l { margin-top: 6px; font-size: .8rem; color: var(--soft); font-weight: 700; }
.stat .spark { position: absolute; right: 12px; top: 12px; width: 26px; height: 26px; opacity: .16; }
.stat .spark svg { width: 100%; height: 100%; fill: none; stroke: var(--a); stroke-width: 2; }
.stat.kids .n   { color: var(--c); } .stat.kids .spark svg   { stroke: var(--c); }
.stat.adults .n { color: var(--b); } .stat.adults .spark svg { stroke: var(--b); }

/* Clickable dash elements */
.clickable { cursor: pointer; }
.stat.clickable, .roombar.clickable { transition: transform .2s, box-shadow .2s; }
body.nt .stat.clickable:hover, body.nt .roombar.clickable:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgb(from var(--a) r g b / .18); }
.bday.clickable, .feed.clickable { border-radius: 10px; transition: background .15s; }
body.nt .bday.clickable:hover, body.nt .feed.clickable:hover { background: var(--ab); }

/* Room capacity bar */
.roombar .top { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 8px; }
.roombar .cap { font-size: .82rem; color: var(--soft); font-weight: 700; }
.roombar .bar { height: 8px; border-radius: 9em; background: var(--line); overflow: hidden; margin-bottom: 4px; }
.roombar .bar i { display: block; height: 100%; border-radius: 9em; background: var(--a); transition: width .4s; }
.roombar .bar i.full { background: var(--bad); }

/* Birthdays + activity feed */
.bday { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.bday:first-child { border-top: 0; }
.bday .cake { width: 40px; height: 40px; border-radius: 9em; display: grid; place-items: center; background: var(--bb); color: var(--b); }
.bday .cake svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.feed { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-top: 1px solid var(--line); }
.feed:first-child { border-top: 0; }
.feed .dot { flex-shrink: 0; width: 9px; height: 9px; margin-top: 6px; border-radius: 9em; background: var(--soft); }
.feed .dot.checkin { background: var(--good); } .feed .dot.checkout { background: var(--warn); } .feed .dot.message { background: var(--a); }
.feed .when { font-size: .76rem; color: var(--soft); margin-top: 2px; }

/* ── Reports: chart + grid ──────────────────────────────────── */
.chart-wrap { overflow-x: auto; padding: 16px; }
.attend-grid { border-collapse: collapse; font-size: .82rem; }
.attend-grid th, .attend-grid td { padding: 6px 8px; text-align: center; white-space: nowrap; }
.attend-grid th:first-child, .attend-grid td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.attend-grid thead th { color: var(--soft); font-weight: 700; }
.attend-grid th.dcol { cursor: pointer; border-radius: 8px; transition: background .15s, color .15s; }
body.nt .attend-grid th.dcol:hover { background: var(--ab); color: var(--a); }
.adot { display: inline-block; width: 14px; height: 14px; border-radius: 9em; background: var(--line); }
.adot.on { background: var(--good); }
.adot.clk { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.adot.clk:not(.on) { box-shadow: inset 0 0 0 1.5px var(--line); background: transparent; }
body.nt .adot.clk:hover { transform: scale(1.4); box-shadow: 0 0 0 3px var(--ab); }

/* ── Checked-In view ────────────────────────────────────────── */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9em; background: var(--card); border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: .88rem; box-shadow: var(--shadow); white-space: nowrap; transition: border-color .2s, background .2s, color .2s; }
.chip .ct { font-size: .76rem; font-weight: 800; background: var(--ab); color: var(--a); padding: 1px 8px; border-radius: 9em; }
.chip.on { background: var(--a); color: #fff; border-color: var(--a); }
.chip.on .ct { background: rgb(255 255 255 / .25); color: #fff; }
body.nt .chip:hover { border-color: var(--a); }

.cigrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
.cic { position: relative; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 12px 14px; text-align: center; cursor: pointer; outline: 2px solid transparent; outline-offset: -2px; transition: transform .2s, outline-color .2s; }
body.nt .cic:hover { transform: translateY(-2px); }
.cic.sel { outline-color: var(--a); }
.cic.campus { opacity: .6; }
.cic .av.lg { width: 72px; height: 72px; font-size: 1.4rem; margin: 0 auto 10px; }
.cic-nm { font-weight: 800; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cic-sb { font-size: .78rem; color: var(--soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cic-chk { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 9em; display: grid; place-items: center; background: var(--line); color: transparent; transition: background .2s, color .2s; }
.cic-chk svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 3; }
body.nt .cic:hover .cic-chk { color: var(--soft); }
.cic.sel .cic-chk { background: var(--a); color: #fff; }
.cic-med { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 9em; display: grid; place-items: center; background: rgb(from var(--bad) r g b / .14); color: var(--bad); }
.cic-med svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }

code { background: var(--ab); color: var(--a); padding: 1px 6px; border-radius: 6px; font-size: .85em; }

/* ═══════════════════════════════════════════════════════════════
   Responsive nav: collapse to a left sidebar on wider screens.
   ═══════════════════════════════════════════════════════════════ */
/* iPad width and up: dock the nav as a labelled left sidebar and shift
   content over so the bar never floats on top of the page. */
@media (min-width: 768px) {
  #n {
    left: 14px; top: 50%; bottom: auto; transform: translateY(-50%);
    flex-direction: column; gap: 4px; padding: 8px;
    border-radius: 20px; align-items: stretch;
  }
  #n a { grid-auto-flow: column; justify-content: flex-start; gap: 11px; padding: 12px 16px; }
  #n a svg { width: 20px; height: 20px; }
  #n a span { display: inline; font-size: .9rem; font-weight: 700; letter-spacing: .01em; }
  #h { left: 188px; }
  #c { margin-left: 188px; margin-right: auto; padding-left: 24px; padding-right: 24px; }
  #results { left: 188px; }
  #r { left: 8px; }
  #toast { left: calc(50% + 94px); }
}
