/* TechBoard design system */
/* Palette: the district's navy, warm grays, flat surfaces. Status colors are separate. */
:root {
  --bg: #f4f4f2;
  --bg-grad: none;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --surface-3: #efeeeb;
  --border: #e2e0db;
  --border-strong: #ccc9c2;
  --text: #1b1a18;
  --text-2: #3a3833;
  --muted: #69665f;
  --faint: #9a968d;
  --primary: #1f4f8f;
  --primary-600: #183f73;
  --primary-50: #edf2f9;
  --primary-100: #dbe5f2;
  --nav: #14315a;
  --nav-2: #1c3e6e;
  --green: #1e7d45;
  --green-50: #e3f2e8;
  --amber: #b26a00;
  --amber-50: #fbf0dc;
  --red: #b42318;
  --red-50: #fbe7e5;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 12px 32px -10px rgba(20, 20, 18, .28), 0 2px 6px rgba(20, 20, 18, .08);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 10px;
  --topbar-h: 56px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121417;
  --bg-grad: none;
  --surface: #1a1d21;
  --surface-2: #16191c;
  --surface-3: #23272c;
  --border: #2c3036;
  --border-strong: #3a3f46;
  --text: #ecebe7;
  --text-2: #cfcdc7;
  --muted: #9b988f;
  --faint: #6f6c65;
  --primary: #7ea6dd;
  --primary-600: #9dbbe6;
  --primary-50: #1b2636;
  --primary-100: #22324a;
  --nav: #0e1b2e;
  --nav-2: #16263d;
  --green: #4bb47a;
  --green-50: #15291d;
  --amber: #e0a33b;
  --amber-50: #2e2312;
  --red: #ef6b5f;
  --red-50: #331917;
  --shadow-lg: 0 16px 40px -10px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 14.5px/1.5 "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
small, .muted { color: var(--muted); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 14px; height: 14px; }
.ic.lg { width: 22px; height: 22px; }
.ic.xl { width: 28px; height: 28px; }

/* ---------- top bar: solid district navy, plain text navigation ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--nav); color: #fff; }
.topbar-inner { max-width: 1440px; margin: 0 auto; height: var(--topbar-h); display: flex; align-items: stretch; gap: 32px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.topbar .brand-logo { filter: brightness(0) invert(1); height: 28px; }
.brand-sep { width: 1px; height: 22px; background: rgba(255,255,255,.28); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: 0; }
.brand-text small { display: none; }
.nav { display: flex; gap: 2px; }
.nav a { display: flex; align-items: center; padding: 0 12px; color: rgba(255,255,255,.72); font-weight: 500; font-size: 14px; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.nav a .ic { display: none; }
.nav a:hover { color: #fff; }
.nav a.on { color: #fff; font-weight: 600; border-bottom-color: #8fb4e8; }
.usermenu { margin-left: auto; position: relative; display: flex; align-items: center; }
.usermenu-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: #fff;
  padding: 4px 6px; border-radius: 6px; cursor: pointer; font-weight: 500; }
.usermenu-btn:hover { background: var(--nav-2); }
.usermenu-btn .avatar { box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; z-index: 60; }
.menu-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 4px; color: var(--text-2);
  background: none; border: 0; cursor: pointer; text-align: left; }
.menu a .ic, .menu button .ic { color: var(--faint); }
.menu a:hover, .menu button:hover { background: var(--surface-3); color: var(--text); }

.page { max-width: 1440px; margin: 0 auto; padding: 28px 24px 120px; }
.page.narrow { max-width: 760px; }
.page.mid { max-width: 1100px; }

/* ---------- avatars ---------- */
.avatar { --av: #2563eb; --size: 44px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; object-fit: cover;
  display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--size) * .38);
  background: linear-gradient(135deg, color-mix(in srgb, var(--av) 82%, #fff), var(--av)); letter-spacing: -.02em; user-select: none; }
.avatar.xs { --size: 22px; } .avatar.sm { --size: 30px; } .avatar.md { --size: 38px; } .avatar.lg { --size: 64px; } .avatar.xl { --size: 112px; }
.av-wrap { position: relative; flex: none; display: inline-flex; align-self: flex-start; }
.av-dot { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--surface); background: var(--faint); }
.av-dot.in { background: #22c55e; } .av-dot.away { background: #f59e0b; } .av-dot.out { background: #94a3b8; } .av-dot.unknown { background: transparent; border-color: transparent; }
.avatar-stack { display: flex; }
.avatar-stack > * { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack > *:first-child { margin-left: 0; }

/* ---------- buttons & form ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background .12s, border-color .12s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 5px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 16px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.icon { width: 36px; padding: 0; } .btn.sm.icon { width: 30px; }
.btn:focus-visible, .input:focus-visible, .seg button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field small { font-size: 12px; }
.input, select.input, textarea.input { height: 38px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface);
  outline: none; width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; min-height: 80px; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .12s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .12s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(14px); }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; background: var(--surface);
       max-width: 100%; overflow-x: auto; scrollbar-width: none; }  /* a long row scrolls sideways instead of being cut off */
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; }
.seg button { border: 0; border-left: 1px solid var(--border); background: transparent; padding: 0 12px; height: 32px; font-weight: 500; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--surface-3); }
.seg button.on { background: var(--primary-50); color: var(--primary); font-weight: 600; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.section-title h2 { font-size: 15px; font-weight: 650; }
.section-title .count { font-size: 13px; font-weight: 500; color: var(--muted); }
.section-title .line { display: none; }

/* status tags: squared, quiet fill, colored left edge */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 4px; font-size: 12.5px; font-weight: 600;
  background: color-mix(in srgb, var(--c, #6b6862) 10%, var(--surface)); color: color-mix(in srgb, var(--c, #6b6862) 75%, var(--text));
  box-shadow: inset 3px 0 0 var(--c, #6b6862); white-space: nowrap; max-width: 100%; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, #64748b); flex: none; }
.pill .ic { width: 13px; height: 13px; }
.pill span { overflow: hidden; text-overflow: ellipsis; }
/* placeholder (not checked in yet): outline only, so it never reads like a real status */
.pill.ghost { background: transparent; color: var(--muted); border: 1px dashed var(--border-strong); box-shadow: none; font-weight: 500; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.amber { background: var(--amber-50); color: var(--amber); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.blue { background: var(--primary-50); color: var(--primary); }
.badge .ic { width: 12px; height: 12px; }

/* ---------- board ---------- */
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.board-head .eyebrow { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; font-size: 13px; margin-bottom: 2px; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; font-size: 12px; }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* summary strip: one bordered row of counts instead of separate tiles */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { background: transparent; border: 0; border-left: 1px solid var(--border); padding: 10px 16px 11px; text-align: left; cursor: pointer;
  display: block; position: relative; color: var(--text); }
.stat:first-child { border-left: 0; }
.stat:hover { background: var(--surface-2); }
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); opacity: .85; }
.stat.on { background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.stat.on::before { height: 4px; opacity: 1; }
.stat-icon { display: none; }
.stat strong { display: block; font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.toolbar .search { flex: 1 1 260px; max-width: 420px; }
.toolbar .spacer { flex: 1; }

.banners { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid; font-weight: 550; }
.banner .ic { flex: none; }
.banner > div { min-width: 0; }
.banner > div > small { display: block; margin: 2px 0 0; white-space: normal; font-weight: 400; color: var(--text-2, inherit); overflow-wrap: anywhere; }
.banner.info { background: var(--primary-50); border-color: var(--primary-100); color: var(--text); }
.banner.info .ic { color: var(--primary); }
.banner.warn { background: var(--amber-50); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.banner.warn .ic { color: var(--amber); }
.banner.celebrate { background: linear-gradient(90deg, #fdf2f8, #eef2ff); border-color: #fbcfe8; }
:root[data-theme="dark"] .banner.celebrate { background: linear-gradient(90deg, #3a1530, #1a2350); border-color: #5b2148; }
.banner.celebrate .ic { color: #db2777; }
.banner small { margin-left: auto; white-space: nowrap; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.person { position: relative; display: flex; gap: 13px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; text-align: left; transition: transform .15s, box-shadow .15s, border-color .15s; box-shadow: var(--shadow-sm); width: 100%; min-width: 0; }
.person:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.person:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 2px; }
.person::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c, transparent); }
.person-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.person-name { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.person-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { display: flex; gap: 5px; font-size: 12.5px; color: var(--muted); white-space: nowrap; margin-top: -4px; min-width: 0; }
/* a long title gets the ellipsis; the shift times always stay visible */
.person-sub .t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.person-sub .sh { flex: none; }
.person-sub .t:not(:empty) + .sh::before { content: "· "; }
.person-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.person-meta .ic { width: 13px; height: 13px; }
.person-where { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-where.sched { color: var(--muted); }
.person-where .ic { flex: none; }
.person-note { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person.pending { background: var(--surface-2); box-shadow: none; }
.person.pending .avatar { filter: grayscale(.6); opacity: .6; }
.person.pending .person-name { color: var(--text-2); }
.person.out .avatar { filter: grayscale(.8); opacity: .65; }
.person.me { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 18px 14px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); cursor: pointer; min-width: 0; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .tile-av { --size: 84px; margin-bottom: 8px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.tile.pending .tile-av, .tile.out .tile-av { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--border-strong); }
.tile.pending .tile-av { filter: grayscale(.6); opacity: .6; }
.tile.pending .tile-name { color: var(--text-2); }
.tile.out .tile-av { filter: grayscale(.7); opacity: .75; }
.tile-name { font-weight: 750; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.tile-title { font-size: 12px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 18px; }
.tile-bar { width: 100%; margin-top: 8px; padding: 7px 8px; border-radius: 9px; background: var(--c); color: #fff; font-weight: 700; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
.tile-bar.pending { background: transparent; color: var(--muted); text-shadow: none; border: 1.5px dashed var(--border-strong); font-weight: 600; }
.tile-bar.blank { visibility: hidden; }
.tile-lines { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.5; min-height: 18px; }
.tile-lines .ic { width: 12px; height: 12px; color: var(--green); vertical-align: -1px; }
.tile-lines .late { color: var(--red); font-weight: 700; }
.tile-lines .late-soft { color: var(--amber); font-weight: 650; }
.tile-note { color: var(--text-2); font-style: italic; }
.tile-sched { opacity: .75; }

.loc-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.loc-group { padding: 16px; }
.loc-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.loc-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--c); flex: none; }
.loc-group-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-group-head small { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-group-head .count { margin-left: auto; font-weight: 800; font-size: 18px; color: var(--c); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-size: 13px; font-weight: 600; }
.chip:hover { border-color: var(--border-strong); background: var(--surface-3); }

.map-wrap { height: calc(100vh - 330px); min-height: 460px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.map-marker { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); box-shadow: 0 4px 12px rgba(0,0,0,.25); border: 2px solid var(--c); }
.map-marker .avatar { --size: 26px; font-size: 10px; }
.map-marker b { font-size: 12px; padding: 0 6px 0 4px; color: var(--text); }
.leaflet-popup-content-wrapper { border-radius: 14px !important; }
.leaflet-container { font: inherit !important; background: var(--surface-3); }
.map-pop h3 { margin-bottom: 2px; } .map-pop small { display: block; margin-bottom: 10px; }
.map-pop .row { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; font-weight: 600; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; color: var(--faint); margin-bottom: 8px; }

/* ---------- popover / sheet ---------- */
.pop-backdrop { position: fixed; inset: 0; z-index: 80; background: transparent; }
.popover { position: fixed; z-index: 81; width: 380px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s ease-out; max-height: calc(100vh - 24px); overflow-y: auto; }
.pop-hero { padding: 20px 20px 16px; display: flex; gap: 14px; align-items: center; background: linear-gradient(180deg, color-mix(in srgb, var(--c, var(--primary)) 12%, var(--surface)), var(--surface)); }
.pop-hero h2 { font-size: 18px; } .pop-hero p { margin: 1px 0 6px; color: var(--muted); font-size: 13px; }
.pop-close { position: absolute; top: 10px; right: 10px; }
.actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0 16px 16px; }
.action { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.action .ic { width: 20px; height: 20px; color: var(--primary); }
.action:hover { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary); }
.action.disabled { opacity: .4; pointer-events: none; }
.pop-section { padding: 14px 20px; border-top: 1px solid var(--border); }
.pop-section h4 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; }
.kv { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; min-width: 0; }
.kv .ic { color: var(--faint); }
.kv a, .kv span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv .copy { margin-left: auto; }
.week { display: flex; flex-direction: column; gap: 2px; }
.week div { display: flex; align-items: baseline; gap: 12px; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; min-width: 0; }
.week div b { flex: none; width: 64px; font-size: 12px; color: var(--muted); font-weight: 600; }
.week div span { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week div.today { border-color: var(--primary); background: var(--primary-50); }
.week div.today b { color: var(--primary); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: min(560px, calc(100vw - 32px)); max-width: 100%; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------- check-in ---------- */
.checkin-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.checkin-hero h1 { font-size: 28px; }
.checkin-hero p { margin: 2px 0 0; color: var(--muted); }
.now { padding: 0; margin-bottom: 6px; overflow: hidden; }
.now-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.now-row .grow { flex: 1; min-width: 0; }
.now-row small { color: var(--muted); }
.now-row .sub { font-size: 12.5px; color: var(--muted); }
.now-gps { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--muted); }
.now-gps .btn { margin-left: auto; }
.now-gps.found { color: var(--green); font-weight: 600; }
.now-gps.searching .ic { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.other-place { margin-top: 10px; }
#whereBlock.dim { opacity: .45; }
.pick-title small { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.status-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.status-chip .ic { color: var(--c); }
.status-chip:hover { border-color: var(--border-strong); }
.status-chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 16%, transparent); }
.chip-sep { flex-basis: 100%; font-size: 12px; color: var(--faint); margin-top: 4px; }
.other-place select { min-height: 46px; font-size: 15px; }
.other-place select.on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.detect { padding: 18px; display: flex; gap: 16px; align-items: center; margin-bottom: 16px; position: relative; overflow: hidden; }
.detect-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; position: relative; }
.detect.found .detect-icon { background: var(--green-50); color: var(--green); }
.detect.searching .detect-icon::after { content: ""; position: absolute; inset: -4px; border-radius: 20px; border: 2px solid var(--primary); animation: ring 1.4s ease-out infinite; }
.detect h3 { font-size: 16px; }
.detect p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.detect .btn { margin-left: auto; }
.pick-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 22px 0 10px; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.status-btn, .place-btn { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 13px; border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-weight: 600; text-align: left; transition: border-color .12s, background .12s, box-shadow .12s; min-width: 0; }
.status-btn .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--c); flex: none; }
.status-btn span:last-child, .place-btn .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-btn:hover, .place-btn:hover { border-color: var(--border-strong); }
.status-btn.on, .place-btn.on { border-color: var(--c, var(--primary)); background: color-mix(in srgb, var(--c, var(--primary)) 7%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--primary)) 16%, transparent); }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.place-btn .txt { display: flex; flex-direction: column; min-width: 0; }
.place-btn .txt small { font-size: 12px; font-weight: 500; }
.place-btn .txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 13px; margin-top: 8px; background: var(--surface); }
.place-list button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border); background: none; cursor: pointer; text-align: left; }
.place-list button:last-child { border-bottom: 0; }
.place-list button:hover, .place-list button.on { background: var(--primary-50); }
.place-list .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.place-list small { margin-left: auto; white-space: nowrap; }
.extras { display: grid; grid-template-columns: 1fr 160px; gap: 12px; margin-top: 18px; }
.submit-bar { position: sticky; bottom: 16px; margin-top: 22px; z-index: 5; }
.submit-bar .btn { box-shadow: 0 14px 30px -10px var(--primary); }
.success { text-align: center; padding: 40px 24px; }
.success-icon { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; background: var(--green-50); color: var(--green); animation: pop .3s cubic-bezier(.3,1.6,.6,1); }
.success-icon .ic { width: 42px; height: 42px; stroke-width: 2.5; }

/* ---------- profile ---------- */
.profile-grid { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.photo-card { text-align: center; padding: 28px 22px; }
.photo-card .avatar { margin: 0 auto 14px; box-shadow: 0 0 0 5px var(--surface), 0 0 0 6px var(--border); }
.photo-card h2 { margin-bottom: 2px; }
.photo-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.sched-row { display: grid; grid-template-columns: 56px 1.2fr 1.2fr 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.sched-row:last-child { border-bottom: 0; }
.sched-row b { font-size: 13px; color: var(--muted); }
.sched-row.today b { color: var(--primary); }
.stack { display: flex; flex-direction: column; gap: 20px; }

.cropper { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.crop-stage { position: relative; width: 300px; height: 300px; border-radius: 16px; overflow: hidden; background: #111; touch-action: none; flex: none; }
.crop-stage canvas { display: block; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-ring { position: absolute; inset: 0; pointer-events: none; border-radius: 16px;
  background: radial-gradient(circle at center, transparent 149px, rgba(0,0,0,.55) 150px); }
.crop-ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); }
.crop-side { display: flex; flex-direction: column; gap: 14px; min-width: 180px; flex: 1; }
.crop-previews { display: flex; align-items: flex-end; gap: 12px; }
.crop-previews canvas { width: 96px; height: 96px; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border); }
.crop-previews canvas.sm { width: 44px; height: 44px; }
.crop-side input[type=range] { width: 100%; accent-color: var(--primary); }

/* ---------- lists / tables ---------- */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { display: block; }
.list-item .grow small { display: block; }
.date-tile { width: 48px; flex: none; text-align: center; border-radius: 11px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.date-tile b { display: block; background: var(--c, var(--primary)); color: #fff; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; padding: 2px 0; }
.date-tile span { display: block; font-size: 18px; font-weight: 800; padding: 2px 0 3px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .who { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.table .who b { display: block; } .table .who small { display: block; font-size: 12px; }
.table .row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }

.heat { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; }
.heat div { border-radius: 10px; padding: 8px 4px; text-align: center; background: var(--surface-2); border: 1px solid var(--border); }
.heat div b { display: block; font-size: 10.5px; color: var(--faint); text-transform: uppercase; }
.heat div span { display: block; font-weight: 800; font-size: 16px; }
.heat div.weekend { opacity: .45; }
.heat div.today { border-color: var(--primary); }

.verdict-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.vchip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font-size: 13px; }
.vchip.on { border-color: var(--primary); background: var(--primary-50); }
.vchip b { font-size: 15px; }
#byPerson summary { cursor: pointer; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--border); border-radius: 13px; cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.choice input { margin-top: 3px; accent-color: var(--primary); }
.choice b { display: block; } .choice small { display: block; font-size: 12.5px; }
@media (max-width: 760px) { .choice-grid { grid-template-columns: 1fr; } }

/* ---------- logo ---------- */
.brand-logo { height: 30px; width: auto; display: block; }
.on-dark { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .brand-logo.auto { filter: brightness(0) invert(1); }
.logo-preview { width: 260px; height: 96px; border-radius: 14px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; padding: 14px; }
.logo-preview.dark { background: linear-gradient(140deg, #1e3a8a, #3b5bfd); border-color: transparent; }
.logo-preview img { max-width: 100%; max-height: 100%; }
.brand-sep { width: 1px; height: 26px; background: var(--border-strong); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 40px 56px; display: flex; flex-direction: column; gap: 24px;
  background: radial-gradient(900px 500px at 80% 0%, rgba(124,58,237,.55), transparent 60%), linear-gradient(150deg, #0b1f5c 0%, #1e3a8a 45%, #2f54eb 100%); }
.art-brand { display: flex; align-items: center; gap: 14px; font-size: 17px; }
.art-brand .brand-logo { height: 34px; }
.art-stage { position: relative; flex: 1; min-height: 380px; }
.art-map { position: absolute; inset: 10% -6% 0 -6%; width: 112%; height: 90%; }
.art-route { animation: dash 2.4s linear infinite; }
.art-pin .ring { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pinring 2.4s ease-out infinite; animation-delay: var(--d); }
.art-board { position: absolute; left: 6%; top: 8%; width: min(440px, 78%); padding: 16px; border-radius: 20px; color: var(--text);
  background: rgba(255,255,255,.94); box-shadow: 0 30px 60px -20px rgba(0,0,0,.55); animation: float 7s ease-in-out infinite; }
:root[data-theme="dark"] .art-board { background: rgba(18,26,46,.94); }
.art-board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.art-live { display: inline-flex; align-items: center; gap: 6px; color: #16a34a; font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.art-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
.art-count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.art-rows { display: flex; flex-direction: column; gap: 6px; transition: opacity .25s, transform .25s; }
.art-rows.flip { opacity: .2; transform: translateY(3px); }
.art-row { display: grid; grid-template-columns: 30px 64px 1fr auto; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--c); font-size: 13px; }
.art-row small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.art-row .pill { height: 24px; font-size: 12px; justify-self: start; }
.art-toggle { position: absolute; right: 6%; top: 4%; width: 132px; height: 52px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; text-align: center; font-weight: 800; font-size: 13px; letter-spacing: .08em; backdrop-filter: blur(6px); }
.art-toggle i { position: absolute; top: 4px; left: 4px; width: 62px; height: 42px; border-radius: 999px; background: #f87171; transition: transform .45s cubic-bezier(.5,1.6,.4,1), background .45s; z-index: 0; box-shadow: 0 6px 16px -4px rgba(0,0,0,.4); }
.art-toggle span { position: relative; z-index: 1; }
.art-toggle.in i { transform: translateX(62px); background: #22c55e; }
.art-chip { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 650; color: var(--text);
  background: rgba(255,255,255,.95); box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); animation: float 6s ease-in-out infinite; }
.art-chip .ic { color: #16a34a; }
.art-chip-1 { right: 4%; bottom: 26%; animation-delay: -2s; }
.art-chip-2 { left: 14%; bottom: 6%; animation-delay: -4s; }
.art-copy h1 { font-size: 40px; line-height: 1.08; letter-spacing: -.035em; margin: 0 0 8px; }
.art-copy p { margin: 0; font-size: 16px; opacity: .85; max-width: 460px; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-box { width: 100%; max-width: 380px; }
.login-logo { height: 46px; margin-bottom: 28px; }
.login-box h2 { font-size: 26px; margin-bottom: 4px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 54px; border-radius: 14px; border: 1px solid var(--border-strong);
  background: var(--surface); font-weight: 650; font-size: 15.5px; cursor: pointer; color: var(--text); margin-top: 26px; box-shadow: var(--shadow-sm); }
.gbtn:hover { background: var(--surface-2); box-shadow: var(--shadow); }
.remember { margin-top: 16px; font-size: 14px; color: var(--text-2); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes dash { to { stroke-dashoffset: -22; } }
@keyframes pinring { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }

/* ---------- misc ---------- */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--primary-50); font-weight: 550; }
.flash.error { background: var(--red-50); color: var(--red); }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 13px; background: #0f172a; color: #fff; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: toast .25s ease-out; max-width: calc(100vw - 32px); }
.toast.ok .ic { color: #4ade80; } .toast.error .ic { color: #f87171; }
.toast button { background: none; border: 0; color: #93c5fd; font-weight: 700; cursor: pointer; margin-left: 6px; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; }
.hint { font-size: 12.5px; color: var(--muted); }
.tabbar { display: none; }
code.tok { background: var(--surface-3); padding: 6px 10px; border-radius: 8px; font-size: 12.5px; word-break: break-all; display: block; }

@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes toast { from { opacity: 0; transform: translateY(12px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ring { from { opacity: .7; transform: scale(.9); } to { opacity: 0; transform: scale(1.25); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- TV / kiosk ---------- */
body.tv { background: #070b18; --bg: #070b18; }
body.tv .page { max-width: none; padding: 28px 36px; }
body.tv .people-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
/* TV tiles go horizontal (photo left) so 80+ people fit one screen at a readable size */
body.tv .tile-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
body.tv .tile { cursor: default; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; text-align: left; padding: 10px 12px; }
body.tv .tile:hover { transform: none; }
body.tv .tile .tile-av { --size: 58px; grid-row: 1 / span 3; margin: 0; }
body.tv .tile-name { font-size: 17px; }
body.tv .tile-title { display: none; }
body.tv .tile-bar { margin-top: 4px; padding: 4px 8px; font-size: 14px; }
body.tv .tile-lines { margin-top: 3px; min-height: 0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.tv .section-title { margin: 14px 0 8px; }
body.tv .board-head { margin-bottom: 12px; }
body.tv .banners { margin-bottom: 12px; gap: 6px; }
body.tv .banner { padding: 8px 14px; }
body.tv .stats { margin-bottom: 4px; }
body.tv .stat { padding: 10px 14px; }
body.tv .toolbar { display: none; }
body.tv .person { cursor: default; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  /* five counts: three across, then two across, no empty slot */
  .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stat { grid-column: span 2; }
  .stat:nth-child(n+4) { grid-column: span 3; border-top: 1px solid var(--border); }
  .stat:nth-child(4) { border-left: 0; }
  .profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --topbar-h: 58px; }
  .topbar-inner { padding: 0 16px; gap: 12px; }
  .nav, .usermenu-name, .brand-text small { display: none; }
  .brand-logo { height: 24px; }
  .page { padding: 18px 16px 120px; }
  h1 { font-size: 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; gap: 10px; } .stat-icon { width: 34px; height: 34px; } .stat strong { font-size: 20px; }
  .people-grid, .loc-groups { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .quick { grid-template-columns: 1fr; }
  .quick { gap: 6px; }
  .quick .place-btn { padding: 8px 12px; }
  .quick .place-btn .loc-icon { width: 28px !important; height: 28px !important; }
  .extras, .form-grid { grid-template-columns: 1fr; }
  .sched-row { grid-template-columns: 44px 1fr; }
  .sched-row > :nth-child(n+3) { grid-column: 2; }
  .heat { grid-template-columns: repeat(7, 1fr); }
  .popover { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; max-height: 88vh; animation: sheet .22s ease-out; padding-bottom: env(safe-area-inset-bottom); }
  .pop-backdrop { background: rgba(15, 23, 42, .4); }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { align-items: start; padding: 18vh 24px 40px; text-align: center; }
  .login-logo { margin: 0 auto 28px; height: 42px; }
  .remember { justify-content: center; }
  .login-help { font-size: 12px; }
  .map-wrap { height: 62vh; min-height: 360px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
  .tabbar a.on { color: var(--primary); }
  .tabbar-primary span { width: 46px; height: 46px; margin-top: -22px; border-radius: 16px; display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, #3b5bfd, #7c3aed); box-shadow: 0 8px 18px -6px #4f46e5; }
  .submit-bar { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@keyframes sheet { from { transform: translateY(100%); } }

/* phone switched to desktop layout: offer a big way back */
.back-to-mobile { display: none; }
.force-desktop .back-to-mobile { display: inline-flex; align-items: center; gap: 8px; position: fixed; left: 24px; bottom: 24px; z-index: 70;
  padding: 14px 22px; border-radius: 999px; border: 0; background: var(--primary); color: #fff; font-weight: 700; font-size: 22px; box-shadow: var(--shadow-lg); cursor: pointer; }
.force-desktop .back-to-mobile .ic { width: 22px; height: 22px; }
.mobile-only { display: none !important; }
@media (max-width: 760px) { .mobile-only { display: flex !important; } }
.force-desktop .mobile-only { display: flex !important; }

/* missed-days report */
.missed-row { align-items: flex-start; }
.missed-row .grow { flex: 0 0 220px; }
.missed-days { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.day-chip { font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 8px; background: var(--red-50); color: var(--red); white-space: nowrap; }
/* ---------- help panel (help.js) ---------- */
.help-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-right: 6px; border: 0; border-radius: 50%;
  background: transparent; color: inherit; opacity: .8; cursor: pointer; }
.help-btn:hover, .help-btn:focus-visible { background: color-mix(in srgb, currentColor 12%, transparent); opacity: 1; }
.help-btn .ic { width: 21px; height: 21px; }
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: min(420px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: help-in .18s ease-out; }
@keyframes help-in { from { transform: translateX(24px); opacity: 0; } }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px 20px; }
.help-head h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0; }
.help-head h2 .ic { color: var(--primary); }
.help-search { margin: 4px 16px 10px 20px; }
.help-body { flex: 1; overflow-y: auto; padding: 0 16px 24px 20px; overscroll-behavior: contain; }
.help-group { font-size: 12px; font-weight: 650; color: var(--muted); margin: 14px 0 6px; }
.help-topic { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: var(--surface); }
.help-topic > summary { cursor: pointer; padding: 11px 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 8px; }
.help-topic > summary::-webkit-details-marker { display: none; }
.help-topic > summary::after { content: "+"; color: var(--faint); font-weight: 400; }
.help-topic[open] > summary::after { content: "–"; }
.help-text { padding: 0 14px 12px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.help-text p { margin: 0 0 8px; } .help-text ul, .help-text ol { margin: 0 0 8px; padding-left: 20px; } .help-text li { margin: 3px 0; }
.help-text a { color: var(--primary); }
.help-text code { font-size: 12.5px; }
.help-none { padding: 20px 0; }
@media (max-width: 760px) { .help-panel { border-left: 0; } .help-btn { margin-right: 0; } }

/* ---------- tooltips (app.js: data-tip) ---------- */
.tip-btn { display: inline-flex; align-items: center; justify-content: center; vertical-align: -2px; margin-left: 4px; padding: 0; width: 18px; height: 18px;
  border: 0; border-radius: 50%; background: transparent; color: var(--faint); cursor: help; }
.tip-btn .ic { width: 15px; height: 15px; }
.tip-btn:hover, .tip-btn:focus-visible { color: var(--primary); }
.tip-bubble { position: fixed; z-index: 1000; max-width: min(300px, calc(100vw - 16px)); padding: 9px 12px; border-radius: var(--radius);
  background: var(--nav); color: #fff; font-size: 13px; font-weight: 400; line-height: 1.45; box-shadow: var(--shadow-lg); white-space: pre-line; pointer-events: none; }
.forms-advanced > summary { cursor: pointer; padding: 6px 0; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.5; }
button.day-chip { border: 1px solid transparent; cursor: pointer; }
.day-chip.timeoff { background: var(--primary-50); color: var(--primary); }
.day-chip.out { background: var(--surface-2); color: var(--text-2); border-color: var(--border-strong); }
.day-chip.off { opacity: .4; text-decoration: line-through; }
.day-chip small { font-weight: 500; opacity: .8; margin-left: 4px; }
.mf-check { margin-top: 4px; width: 18px; height: 18px; flex: none; }
@media (max-width: 760px) { .missed-row { flex-wrap: wrap; } .missed-row .grow { flex: 1 1 auto; } }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; text-align: left; }
.linkish:hover { color: var(--primary); text-decoration: underline; }

/* status names wrap instead of truncating on the check-in page */
.status-btn span:last-child { white-space: normal; line-height: 1.2; overflow: visible; }

/* keyboard users can always see where they are */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

/* respect "reduce motion" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- roster (front desk check-in grid) ---------- */
.roster-progress { padding: 12px 16px; min-width: 240px; box-shadow: var(--shadow-sm); }
.roster-progress b { font-size: 20px; }
.roster-progress .bar { height: 8px; border-radius: 99px; background: var(--surface-3); margin: 6px 0 4px; overflow: hidden; }
.roster-progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 99px; transition: width .4s; }
.roster-tools { flex-wrap: wrap; justify-content: flex-start; }
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 22px; background: var(--primary-50); border-bottom: 1px solid var(--primary-100); }
.table.roster td { padding: 8px 10px; }
.table.roster .roster-input { height: 36px; font-size: 13.5px; padding: 0 10px; }
.table.roster td small { display: block; font-size: 11.5px; margin-top: 3px; }
.table.roster tr.is-pending { background: color-mix(in srgb, var(--amber-50) 45%, transparent); }
.table.roster tr.saving { opacity: .55; }
/* the Check in / Mark out column stays in view when the table scrolls sideways on a narrow screen */
.table.roster td.roster-act, .table.roster th:last-child { position: sticky; right: 0; z-index: 1; background: var(--surface);
  box-shadow: -10px 0 10px -10px rgba(0, 0, 0, .25); }
.table.roster th:last-child { background: var(--surface-2); z-index: 2; }
.table.roster tr.is-pending td.roster-act { background: color-mix(in srgb, var(--amber-50) 45%, var(--surface)); }
.roster-now .pill { max-width: 210px; }
.roster-act { text-align: right; white-space: nowrap; }
.roster-act .saved { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-weight: 650; font-size: 13px; }
@media (max-width: 760px) {
  .table.roster thead { display: none; }
  .table.roster tr { display: grid; grid-template-columns: 30px 1fr; gap: 6px 10px; padding: 12px 6px; border-bottom: 1px solid var(--border); }
  .table.roster td { border: 0; padding: 0; }
  .table.roster td:nth-child(n+3) { grid-column: 2; }
  .roster-act { text-align: left; }
}

/* admin: status icon picker */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; max-height: 168px; overflow-y: auto; padding: 2px; }
.icon-picker button { height: 38px; border-radius: 9px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.icon-picker button:hover { border-color: var(--border-strong); }
.icon-picker button.on { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

#offToday { margin-bottom: 12px; font-weight: 500; }
#offToday a { font-weight: 650; }
.roster-act { white-space: nowrap; }

/* ---------- entrance tablet (kiosk) ---------- */
body.kiosk { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.kiosk-main { max-width: 1400px; margin: 0 auto; padding: 20px 24px 60px; }
.kiosk-head { display: flex; align-items: center; gap: 20px; padding: 6px 0 18px; }
.kiosk-head .brand-logo { height: 42px; }
.kiosk-site { flex: 1; min-width: 0; padding-left: 20px; border-left: 1px solid var(--border); }
.kiosk-site h1 { font-size: 26px; margin: 0; }
.kiosk-site p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.kiosk-clock { font-size: 40px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kiosk-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; padding: 10px 0; background: var(--bg); }
.kiosk-search { flex: 1 1 320px; }
.kiosk-search .input { height: 56px; font-size: 19px; border-radius: 16px; }
.kiosk-tools .seg button { min-height: 46px; padding: 0 16px; font-size: 15px; }
.kiosk-h { display: flex; align-items: center; gap: 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 22px 0 12px; }
.kiosk-h span { font-size: 13px; background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 2px 9px; letter-spacing: 0; }
.kiosk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kiosk-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px 14px; border-radius: 18px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; font: inherit; color: var(--text); text-align: center; box-shadow: var(--shadow-sm); }
.kiosk-tile:active { transform: scale(.97); }
.kiosk-tile .avatar { --size: 84px; }
.kiosk-tile.here { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); }
.kt-name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.kt-status .pill { font-size: 12px; max-width: 140px; }
.kiosk-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40; }
.kiosk-sheet { position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px);
  overflow-y: auto; background: var(--surface); border-radius: 24px; padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.kiosk-x { position: absolute; top: 16px; right: 16px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.ks-who { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; padding-right: 50px; }
.ks-who h2 { font-size: 26px; margin: 0 0 6px; }
.ks-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); }
.kiosk-big { display: flex; align-items: center; gap: 18px; width: 100%; padding: 20px 24px; border-radius: 18px; border: 0; cursor: pointer; font: inherit; text-align: left; color: #fff; }
.kiosk-big .ic { width: 34px; height: 34px; flex: none; }
.kiosk-big span { display: flex; flex-direction: column; font-size: 24px; font-weight: 750; }
.kiosk-big small { font-size: 15px; font-weight: 500; color: #fff; opacity: .92; }
.kiosk-big.in { background: var(--green); }
.kiosk-big.out { background: #475569; }
.kiosk-big:active { transform: scale(.985); }
.kiosk-sheet h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 22px 0 10px; }
.ks-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ks-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 54px; padding: 0 20px; border-radius: 16px; border: 1.5px solid var(--border); background: var(--surface);
  font: inherit; font-size: 17px; font-weight: 650; color: var(--text); cursor: pointer; }
.ks-chip .ic { color: var(--c); }
.ks-chip:active { background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.ks-back { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 15px; }
.ks-pill { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--surface); font: inherit; font-size: 15px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.ks-pill.on { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.ks-hint { margin: 20px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.kiosk-done { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(15, 23, 42, .55); }
.kd-card { background: var(--surface); border-radius: 28px; padding: 40px 48px; text-align: center; width: min(520px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.kd-icon { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--c); }
.kd-icon .ic { width: 50px; height: 50px; }
.kd-card h2 { font-size: 30px; margin: 0 0 8px; }
.kd-card p { color: var(--muted); font-size: 18px; margin: 0 0 22px; }
@media (max-width: 700px) { .kiosk-clock { font-size: 28px; } .kiosk-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } .kiosk-tile .avatar { --size: 64px; } }

.kiosk-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.kiosk-row:last-child { border-bottom: 0; }
.kiosk-row > div:first-child { display: flex; flex-direction: column; min-width: 180px; }

.master-switch { display: flex; align-items: center; gap: 16px; border-left: 5px solid var(--green); }
.master-switch h3 { margin: 0; }
.master-switch p { margin: 4px 0 0; }
.master-switch.paused { border-left-color: var(--amber); background: color-mix(in srgb, var(--amber) 7%, var(--surface)); }
.switch.big { font-weight: 700; font-size: 15px; white-space: nowrap; }
.tab-paused::after { content: "Paused"; margin-left: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--amber); }
.banner.ok { background: var(--green-50); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.banner.ok .ic { color: var(--green); }

/* ======================================================================
   Facelift (Oct 2026): flatter, squarer, district navy. These rules come
   last on purpose and tone down the earlier component styles.
   ====================================================================== */
.topbar .brand-sep { width: 1px; height: 22px; background: rgba(255,255,255,.28); }
.avatar { background: var(--av); letter-spacing: 0; font-weight: 600; }
.person { box-shadow: none; transition: border-color .12s, background .12s; }
.person:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }
.person::before { top: 0; bottom: 0; width: 3px; border-radius: var(--radius) 0 0 var(--radius); }
.person-name { font-weight: 650; }
.person-note { border-radius: 4px; }
.tile { box-shadow: none; transition: border-color .12s; }
.tile:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }
.tile .tile-av { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.loc-icon { border-radius: 6px; background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.banner { border-radius: var(--radius); font-weight: 500; }
.banner.celebrate { background: #fbf3f6; border-color: #efd3df; }
:root[data-theme="dark"] .banner.celebrate { background: #2a1a22; border-color: #4a2a38; }
.pop-hero { background: var(--surface-2); border-bottom: 1px solid var(--border); margin-bottom: 14px; box-shadow: inset 0 3px 0 var(--c, var(--primary)); }
.popover { border-radius: var(--radius); }
.action { border-radius: 6px; background: var(--surface); }
.leaflet-popup-content-wrapper { border-radius: 8px !important; }
.modal-backdrop { background: rgba(20, 20, 18, .45); backdrop-filter: none; }
.modal { border-radius: var(--radius-lg); }
.modal-head { padding: 14px 20px; }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 12px 20px; }
.status-btn, .place-btn { border-radius: 6px; border-width: 1px; }
.status-chip { border-radius: 6px; border-width: 1px; font-weight: 500; }
.status-chip.on, .status-btn.on, .place-btn.on { box-shadow: inset 0 0 0 1px var(--c, var(--primary)); }
.place-list { border-radius: 6px; }
.submit-bar .btn { box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); }
.date-tile { border-radius: 6px; }
.vchip, .choice { border-radius: 6px; border-width: 1px; }
.choice:has(input:checked) { box-shadow: inset 0 0 0 1px var(--primary); }
.logo-preview { border-radius: 6px; }
.logo-preview.dark { background: var(--nav); }
.flash { border-radius: 6px; }
.toast { border-radius: 6px; background: #1b1a18; font-weight: 500; }
.toast button { color: #a9c6ee; }
.crop-stage, .crop-ring { border-radius: 8px; }
.roster-progress .bar i { background: var(--green); }
.icon-picker button { border-radius: 5px; border-width: 1px; }
.master-switch { border-left-width: 4px; }
.gbtn { border-radius: 8px; height: 50px; }
.table th { font-weight: 600; text-transform: none; letter-spacing: 0; }

/* login art: district navy instead of the indigo/violet glow */
.login-art { background: linear-gradient(160deg, #0f2a4e 0%, #14315a 55%, #1f4f8f 100%); }
.art-board, .art-chip { border-radius: 10px; }
.art-row { border-radius: 6px; }

/* phone tab bar: flat, with the check-in button in navy */
@media (max-width: 760px) {
  .tabbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar a { font-weight: 500; }
  .tabbar-primary span { border-radius: 50%; background: var(--nav); box-shadow: 0 4px 12px -4px rgba(0,0,0,.35); }
  .popover { border-radius: 12px 12px 0 0; }
  /* five counts: three across, then two across, no empty slot */
  .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stat { grid-column: span 2; }
  .stat:nth-child(n+4) { grid-column: span 3; border-top: 1px solid var(--border); }
  .stat:nth-child(4) { border-left: 0; }
  .card-head { flex-wrap: wrap; }
  .card-head > .input-icon { flex: 1 1 100% !important; max-width: none !important; }  /* search gets its own line */
}

/* entrance tablet: same language, still big touch targets */
.kiosk-search .input { border-radius: 8px; }
.kiosk-tile { border-radius: 10px; border-width: 1px; box-shadow: none; }
.kiosk-sheet { border-radius: 14px; }
.kiosk-big { border-radius: 10px; }
.ks-chip { border-radius: 8px; border-width: 1px; }
.ks-pill { border-radius: 6px; border-width: 1px; }
.kd-card { border-radius: 14px; }
.kiosk-x { border-radius: 8px; }

/* ---------- admin: sidebar navigation instead of a tab strip ---------- */
.admin-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.admin-layout .tabs { position: sticky; top: calc(var(--topbar-h) + 16px); flex-direction: column; gap: 1px; border: 0; margin: 0; overflow: visible; }
.admin-layout .tabs button { justify-content: flex-start; width: 100%; padding: 8px 12px; border: 0; border-left: 3px solid transparent; margin: 0; border-radius: 0 4px 4px 0;
  color: var(--text-2); font-size: 14px; }
.admin-layout .tabs button .ic { display: none; }
.admin-layout .tabs button:hover { background: var(--surface-3); }
.admin-layout .tabs button.on { color: var(--primary); font-weight: 600; background: var(--primary-50); border-left-color: var(--primary); }
.admin-layout .tabs .tabs-group { font-size: 12px; color: var(--faint); font-weight: 600; padding: 14px 12px 4px; }
.admin-layout .tabs .tabs-group:first-child { padding-top: 0; }
.admin-panels > section { min-width: 0; }
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }  /* never wider than the screen */
  .admin-layout .tabs { position: static; flex-direction: row; overflow-x: auto; border-bottom: 1px solid var(--border); }
  .admin-layout .tabs button { width: auto; border-left: 0; border-bottom: 2px solid transparent; border-radius: 0; }
  .admin-layout .tabs button.on { background: none; border-bottom-color: var(--primary); }
  .admin-layout .tabs .tabs-group { display: none; }
}

.h-sub { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.bday { display: inline-flex; color: #c2185b; vertical-align: -1px; }
.checkin-hero { margin-bottom: 16px; } .checkin-hero h1 { font-size: 22px; }
/* section labels in sentence case, not tracked capitals */
.pick-title, .kiosk-h, .kiosk-sheet h3, .tabs-group, .chip-sep { text-transform: none !important; letter-spacing: 0 !important; }
.pick-title { font-size: 14px; font-weight: 650; color: var(--text); margin: 20px 0 8px; }
.kiosk-h { font-size: 16px; font-weight: 650; color: var(--text-2); }
.kiosk-sheet h3 { font-size: 15px; font-weight: 650; color: var(--text-2); }
.seg button { white-space: nowrap; }
.pop-section h4 { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 650; color: var(--text-2); }

/* ---------- logo: always its real colors (recoloring it white flattened the mountain detail) ---------- */
.brand-logo, .brand-logo.auto, .brand-logo.on-dark, .topbar .brand-logo, :root[data-theme="dark"] .brand-logo.auto { filter: none; }
/* on anything dark it sits on a small white plate, so it never blends in */
.brand-logo.on-dark, :root[data-theme="dark"] .brand-logo.auto { background: #fff; padding: 5px 8px; border-radius: 4px; box-sizing: content-box; }

/* top bar: white, so the logo shows as designed; the district navy is the accent stripe and active tab */
.topbar { background: var(--surface); color: var(--text); border-top: 4px solid var(--nav); border-bottom: 1px solid var(--border); }
.topbar .brand { color: var(--text); }
.topbar .brand-logo { height: 32px; }
.topbar .brand-sep { background: var(--border-strong); height: 24px; }
.topbar .brand-text strong { color: var(--nav); }
:root[data-theme="dark"] .topbar .brand-text strong { color: var(--text); }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--nav); border-bottom-color: var(--nav); }
:root[data-theme="dark"] .nav a.on { color: var(--text); border-bottom-color: var(--primary); }
.usermenu-btn { color: var(--text); }
.usermenu-btn:hover { background: var(--surface-3); }
.usermenu-btn .avatar { box-shadow: none; }
:root[data-theme="dark"] .topbar .brand-logo { height: 26px; }
@media (max-width: 760px) { .topbar .brand-logo { height: 26px; } }

/* ---------- month calendar (Time off page) ---------- */
.view-switch { margin: -4px 0 12px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cal-head h2 { font-size: 17px; min-width: 150px; text-align: center; }
/* the legend is also the filter: each key toggles that kind on the calendar and in the list */
.view-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.cal-keys-label { font-weight: 600; color: var(--muted); margin-right: 2px; }
.cal-key { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font: inherit; cursor: pointer; }
.cal-key i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); border: 1.5px solid var(--c); }
.cal-key:hover { border-color: var(--c); }
.cal-key.off { color: var(--faint); text-decoration: line-through; background: transparent; }
.cal-key.off i { background: transparent; }
.cal-key-all { border: 0; background: none; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-day { min-height: 118px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.wknd { background: var(--surface-2); }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-num, .cal-day.other .cal-items { opacity: .45; }
.cal-day.holiday { background: color-mix(in srgb, #b26a00 7%, var(--surface)); }
.cal-num { font-size: 13px; font-weight: 600; color: var(--text-2); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--nav); color: #fff; }
.cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; line-height: 1.25; padding: 2px 6px; border-radius: 3px;
  background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: color-mix(in srgb, var(--c) 80%, var(--text)); box-shadow: inset 3px 0 0 var(--c); }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.holiday { background: var(--c); color: #fff; box-shadow: none; font-weight: 600; }
.cal-chip .ic { width: 12px; height: 12px; flex: none; }
.cal-chip em { flex: none; margin-left: auto; font-style: normal; font-size: 10px; font-weight: 600; padding: 0 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
/* a break only some calendars get: lighter, so days everyone is off stand out */
.cal-chip.holiday.part { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.cal-chip.holiday.part em { background: color-mix(in srgb, var(--c) 22%, transparent); }
.cal-more { border: 0; background: none; padding: 0 6px; text-align: left; font-size: 12px; font-weight: 600; color: var(--primary); cursor: pointer; }
.cal-dots { display: none; }
.cal-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.cal-row:last-child { border-bottom: 0; }
.cal-row i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); flex: none; }
@media (max-width: 760px) {
  .cal-day { min-height: 54px; padding: 4px; cursor: pointer; }
  .cal-items { display: none; }
  .cal-dots { display: flex; flex-wrap: wrap; gap: 3px; }
  .cal-dots i { width: 7px; height: 7px; border-radius: 50%; }
  .cal-dow { padding: 6px 4px; text-align: center; }
  .cal-head h2 { min-width: 0; }
  .cal-legend { gap: 8px; font-size: 12px; }
}
.board-head .row { flex-wrap: wrap; }
@media (max-width: 760px) { .board-head > .row { width: 100%; } .board-head > .row .btn { flex: 1 1 auto; } }

/* ---------- wall TV: header at a fixed size, the grid fills the rest of the screen ---------- */
html:has(body.tv), body.tv { overflow: hidden; height: 100%; }
body.tv main.page { height: 100vh; max-width: none; padding: 1.6vh 1.6vw; display: flex; flex-direction: column; }
body.tv #board { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.tv #view { flex: 1; min-height: 0; margin-top: 1.2vh; }
body.tv .board-head h1 { font-size: clamp(28px, 3.4vh, 64px); }
body.tv .board-head .eyebrow { font-size: clamp(14px, 1.6vh, 30px); }
body.tv .brand-logo { height: clamp(32px, 4vh, 80px) !important; }
body.tv .stat strong { font-size: clamp(22px, 2.8vh, 56px); }
body.tv .stat small { font-size: clamp(12px, 1.3vh, 26px); }
body.tv .banner { font-size: clamp(14px, 1.5vh, 28px); }
.tv-pager { margin-left: 12px; color: var(--faint); }
.tv-grid { height: 100%; display: grid; gap: var(--gap); grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows), var(--rh)); align-content: start; }
.tv-tile { display: flex; align-items: center; gap: calc(var(--th) * .16); padding: 0 calc(var(--th) * .16); min-width: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--th) * .1); box-shadow: inset calc(var(--th) * .07) 0 0 var(--c); }
.tv-tile .tv-av { --size: calc(var(--th) * .74); flex: none; }
.tv-tile.pending .tv-av, .tv-tile.out .tv-av { filter: grayscale(.7); opacity: .6; }
.tv-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: calc(var(--th) * .04); }
.tv-name { font-size: calc(var(--th) * .23); font-weight: 650; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: baseline; gap: .4em; }
.tv-dept { margin-left: auto; font-size: .62em; font-weight: 500; color: var(--faint); flex: none; }
.tv-bar { align-self: flex-start; max-width: 100%; font-size: calc(var(--th) * .19); font-weight: 650; line-height: 1.35; padding: 0 .5em; border-radius: .25em;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 55%, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-bar.pending { background: transparent; color: var(--muted); padding-left: 0; font-weight: 500; }
.tv-line { font-size: calc(var(--th) * .16); color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-line .late { color: var(--red); font-weight: 650; }
.tv-tile .bday { color: #f472b6; }
.tv-tile .bday .ic { width: .8em; height: .8em; }

/* TV header: logo · time + date · weather ……… filter · page */
.tv-head { display: flex; align-items: center; gap: clamp(16px, 2vw, 48px); margin-bottom: 1.2vh; }
.tv-head .tv-logo { height: clamp(24px, 3vh, 60px) !important; padding: .35vh .6vh; }
.tv-time { display: flex; align-items: baseline; gap: .6em; font-size: clamp(22px, 3.2vh, 64px); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-time #dateLabel { font-size: .55em; font-weight: 500; color: var(--muted); }
.tv-weather { display: flex; align-items: center; gap: .45em; font-size: clamp(20px, 3vh, 60px); color: var(--text); white-space: nowrap;
  padding-left: clamp(16px, 2vw, 48px); border-left: 1px solid var(--border); }
.tv-weather .ic { width: 1.1em; height: 1.1em; color: #f2c14e; }
.tv-temp { font-weight: 700; }
.tv-wx { display: flex; flex-direction: column; line-height: 1.15; font-size: .5em; color: var(--muted); }
.tv-wx span { color: var(--text-2); font-weight: 600; }
.tv-wx small { font-size: .9em; }
.tv-right { margin-left: auto; display: flex; gap: 1em; align-items: baseline; font-size: clamp(14px, 1.8vh, 34px); color: var(--muted); white-space: nowrap; }
.tv-right .tv-pager { margin: 0; }
/* one banner line at a time on the TV, whatever is going on */
body.tv .banners { margin-bottom: 1vh; }
body.tv .banner { white-space: nowrap; overflow: hidden; min-width: 0; padding: .7vh 1vw; }
body.tv .banner > span:first-of-type { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.tv .banner .avatar-stack { display: none; }
.tv-count { margin-left: auto; padding-left: 1em; font-size: .8em; color: var(--muted); flex: none; }
/* tile status: In / Remote / Away / Out / Not in, colored like the counts, then the detail */
.tv-status { display: flex; align-items: baseline; gap: .45em; min-width: 0; font-size: calc(var(--th) * .19); line-height: 1.3; white-space: nowrap; }
.tv-status b { flex: none; padding: 0 .45em; border-radius: .25em; font-weight: 700; background: var(--c); color: #fff; }
.tv-tile.pending .tv-status b { background: transparent; color: var(--muted); border: 1px solid var(--border-strong); font-weight: 600; }
.tv-status span { overflow: hidden; text-overflow: ellipsis; color: var(--text-2); font-weight: 600; min-width: 0; }
.tv-tile.pending .tv-status span { color: var(--muted); font-weight: 500; }

/* board map */
.map-box { position: relative; margin-top: 16px; }
.map-empty { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 500; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-weight: 500; }
.map-empty .ic { color: var(--muted); }
.map-pop .row small { margin-left: auto; }

/* TV display rotation: other pages full screen over the board, a thin progress line at the bottom */
#tvScreens { position: fixed; inset: 0; z-index: 900; background: #000; }
#tvScreens iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.tv-progress { position: fixed; left: 0; right: 0; bottom: 0; height: 4px; z-index: 950; background: rgba(255,255,255,.08); }
.tv-progress i { display: block; height: 100%; width: 0; background: rgba(143,180,232,.75); }
.tv-progress span { position: absolute; right: 10px; bottom: 8px; font-size: clamp(11px, 1.2vh, 22px); color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 4px; }
.test-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

/* admin: TV display editor */
.display-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.display-items { display: flex; flex-direction: column; gap: 8px; }
.display-item { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.display-item > .badge { align-self: center; }
.display-item .secs { width: 96px; }

/* the board uses the full width of wide screens (other pages stay at a readable width) */
.page.board-page, .page.wide { max-width: none; padding-left: clamp(16px, 3vw, 48px); padding-right: clamp(16px, 3vw, 48px); }
.topbar-inner { max-width: none; padding: 0 clamp(16px, 3vw, 48px); }

/* wide pages keep their reading/form parts at a comfortable width */
.page.wide #listView, .page.wide .view-switch { max-width: 1100px; }
.page.wide .admin-panels > [data-panel="access"], .page.wide .admin-panels > [data-panel="reminders"],
.page.wide .admin-panels > [data-panel="announcements"], .page.wide .admin-panels > [data-panel="display"],
.page.wide .admin-panels > [data-panel="departments"] { max-width: 1100px; }

/* Admin → Holidays: the work calendars, as chips you click to edit */
.cal-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); padding-top: 12px; padding-bottom: 12px; }
.cal-strip-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.cal-strip .chip { padding: 4px 12px 4px 10px; }
.cal-strip .chip small { font-weight: 500; color: var(--muted); }
.cal-strip .chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }

/* Calendar → List: pick a list and dates, then print it */
.list-controls { margin-bottom: 16px; }
.list-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.list-form .field { margin: 0; }
.list-form input[type="date"] { width: 150px; }
.list-form #listPrint { margin-left: auto; }
.print-sheet { padding: 24px 28px; }
.print-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--text); margin-bottom: 8px; }
.print-head h2 { margin: 0; font-size: 22px; }
.print-head p { margin: 2px 0 0; color: var(--muted); }
.print-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.print-month h3 { margin: 18px 0 4px; font-size: 15px; }
.print-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.print-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 4px 10px 4px 0; border-bottom: 1px solid var(--border); }
.print-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.print-table th:first-child, .print-table td.pd { width: 150px; white-space: nowrap; color: var(--muted); }
.print-table th:nth-child(2) { width: 40%; }
.print-foot { margin: 20px 0 0; font-size: 11px; color: var(--faint); }
@media (max-width: 640px) {
  .print-sheet { padding: 16px; }
  .list-form #listPrint { margin-left: 0; }
  .print-table th:first-child, .print-table td.pd { width: auto; white-space: normal; }
}

@media print {
  /* only on the Calendar's List view: the paper gets the list and nothing else, in black on white */
  @page { margin: 14mm 12mm; }
  body.cal-list { background: #fff !important; }
  body.cal-list .topbar, body.cal-list .tabbar, body.cal-list .toasts, body.cal-list .board-head,
  body.cal-list .view-switch, body.cal-list .list-controls, body.cal-list .help-panel, body.cal-list .tip-bubble,
  body.cal-list .tip-btn { display: none !important; }
  body.cal-list main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  body.cal-list .print-sheet { border: 0 !important; box-shadow: none !important; padding: 0 !important; background: #fff !important; }
  body.cal-list .print-sheet, body.cal-list .print-sheet * { color: #000 !important; }
  body.cal-list .print-head { border-bottom-color: #000; }
  body.cal-list .print-table th, body.cal-list .print-table td { border-bottom-color: #bbb; }
  body.cal-list .print-table td.pd, body.cal-list .print-head p, body.cal-list .print-count, body.cal-list .print-foot { color: #444 !important; }
  body.cal-list .print-month h3 { break-after: avoid; }
  body.cal-list .print-table tr { break-inside: avoid; }
}
