/* Eventus WholeHealth design tokens, ported from the claude.ai/design
   "Eventus WholeHealth Design System" project (colors_and_type.css) for the
   VITAL portal. Self-hosted (see /fonts) to keep this file
   servable under a strict CSP (font-src 'self', style-src 'self'/nonce) with
   no third-party origins. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Mulish";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/fonts/mulish-latin.woff2") format("woff2");
}

:root {
  --eventus-purple: #877BE9;
  --eventus-light-blue: #91D9E8;
  --eventus-navy: #193241;
  --eventus-pewter: #507E8E;
  --eventus-yellow: #FCF1A6;
  --eventus-grey: #E1E2E0;
  --eventus-plum: #293A60;
  --eventus-ink: #0F1E29;
  --eventus-ink-2: #2E4555;
  --eventus-ink-3: #6B7F8A;
  --eventus-paper: #fff;
  --eventus-paper-2: #F7F8F7;
  --eventus-paper-3: #EFF0EE;
  --eventus-line: #D7DAD8;
  --eventus-purple-dark: #5D50C9;
  --eventus-light-blue-tint: #C2EAF1;
  --eventus-plum-tint: #3F5683;

  --bg: var(--eventus-paper);
  --bg-alt: var(--eventus-paper-2);
  --bg-sunken: var(--eventus-paper-3);
  --surface: var(--eventus-paper);
  --fg: var(--eventus-ink);
  --fg-2: var(--eventus-ink-2);
  --fg-3: var(--eventus-ink-3);
  --accent: var(--eventus-purple);
  --accent-hover: var(--eventus-purple-dark);
  --accent-on: #fff;
  --accent-soft: #EEEBFB;
  --hairline: var(--eventus-line);

  --font-display: "Manrope", "Helvetica Neue", sans-serif;
  --font-text: "Mulish", "Helvetica Neue", sans-serif;
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;
  --w-display: 800;

  --fs-h1: 40px;
  --fs-h2: 32px;
  --fs-h3: 24px;
  --fs-h4: 20px;
  --fs-body: 16px;
  --fs-body-sm: 14px;
  --fs-caption: 12px;
  --fs-micro: 10.5px;
  --lh-body: 1.55;
  --lh-heading: 1.15;
  --tracking-tight: -0.02em;
  --tracking-wider: 0.18em;
  --tracking-widest: 0.30em;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-1: 0 1px 2px rgba(25,50,65,.06), 0 1px 1px rgba(25,50,65,.04);
  --shadow-2: 0 4px 10px rgba(25,50,65,.08), 0 1px 2px rgba(25,50,65,.05);
  --shadow-3: 0 12px 28px rgba(25,50,65,.10), 0 4px 8px rgba(25,50,65,.06);
  --shadow-focus: 0 0 0 4px rgba(135,123,233,.30);
  --ease-out: cubic-bezier(.2,.7,.2,1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
}

/* Dark theme - toggled via [data-theme="dark"] on <html> (see partials/head.ejs
   for the pre-paint init script and public/js/themeToggle.js for the Settings
   switch). Palette from the claude.ai/design "VITAL Home Dark" spec (panel 1b
   "Redesigned", plus 2a inputs and 2b alerts/table/modal): blue-tinted
   surfaces, near-white text, and a lighter lavender accent with DARK text on
   it. The light theme's brand purple with white text, and its pastel
   badge/notice fills, don't reach AA on these surfaces, so the
   component rules below swap them for translucent tints with light text. */
[data-theme="dark"] {
  color-scheme: dark; /* native controls, <select> popups, scrollbars */
  --bg: #0C151D;
  --bg-alt: #1C2D3A;
  --bg-sunken: #0F1B25;
  --surface: #15232E;
  --fg: #F4F7F9;
  --fg-2: #D3DCE2;
  --fg-3: #A9B7C1;
  --accent: #B3AAFA;
  --accent-hover: #D6D1FF;
  --accent-on: #0F1E29;
  --accent-soft: rgba(167,158,245,.22);
  --hairline: #2F4352;
  --line-strong: #4A6272;
  --shadow-1: 0 1px 2px rgba(0,0,0,.35);
  --shadow-2: 0 6px 16px rgba(0,0,0,.35);
  --shadow-3: 0 18px 40px rgba(0,0,0,.45);
  --shadow-focus: 0 0 0 4px rgba(179,170,250,.28);
}
/* Status tints - one set shared by badges, notices, banners and Home's
   facility icons (those reuse .banner-color-*, see lib/ui/vendorColor.ts).
   Each is a ~14-22% fill of the hue, a light text color, and a border of that
   text color at 1/3 alpha. */
[data-theme="dark"] .badge-status-complete,
[data-theme="dark"] .notice-success { background: rgba(127,211,155,.14); color: #8FDCAA; border: 1px solid #8FDCAA55; }
[data-theme="dark"] .badge-status-otp-external,
[data-theme="dark"] .badge-internal { background: rgba(145,217,232,.14); color: #A4E4F1; border: 1px solid #A4E4F155; }
[data-theme="dark"] .badge-status-in-testing,
[data-theme="dark"] .badge-admin { background: rgba(252,241,166,.14); color: #FCF1A6; border: 1px solid #FCF1A655; }
[data-theme="dark"] .badge-status-invalid-credentials,
[data-theme="dark"] .badge-status-needs-fix,
[data-theme="dark"] .notice-error { background: rgba(255,150,150,.14); color: #FFB3B3; border: 1px solid #FFB3B355; }
[data-theme="dark"] .badge-external { background: rgba(167,158,245,.14); color: #D6D1FF; border: 1px solid #D6D1FF55; }
[data-theme="dark"] .badge-status-1pass-only { background: rgba(211,220,226,.10); color: #D3DCE2; border: 1px solid #D3DCE255; }
/* Notices read as body copy, not a label, so they get the softer text tint
   from the spec's alert rows rather than the badge's saturated one. */
[data-theme="dark"] .notice-success { color: #C9F0D6; }
[data-theme="dark"] .notice-error { color: #FFD0D0; }
/* :not(.color-swatch) - the admin banner picker's swatches carry the same
   class and must stay solid fills. */
[data-theme="dark"] .banner-color-purple:not(.color-swatch) { background: rgba(167,158,245,.22); color: #D6D1FF; }
[data-theme="dark"] .banner-color-blue:not(.color-swatch) { background: rgba(145,217,232,.20); color: #B7ECF7; }
[data-theme="dark"] .banner-color-green:not(.color-swatch) { background: rgba(127,211,155,.20); color: #A6E6BC; }
[data-theme="dark"] .banner-color-yellow:not(.color-swatch) { background: rgba(252,241,166,.18); color: #FCF1A6; }
[data-theme="dark"] .banner-color-red:not(.color-swatch) { background: rgba(255,150,150,.18); color: #FFC4C4; }
[data-theme="dark"] .status-light-complete { background: #8FDCAA; }
[data-theme="dark"] .status-light-error { background: #FFB3B3; }
[data-theme="dark"] .profile-menu-signout { color: #FFB3B3; }
/* --eventus-navy number on a dark tile was all but invisible */
[data-theme="dark"] .tile .num { color: var(--fg); }
[data-theme="dark"] .count { color: var(--fg-2); }
[data-theme="dark"] .btn-ghost { border-color: var(--line-strong); }
[data-theme="dark"] .card:hover { border-color: #3B5163; }
[data-theme="dark"] .color-radio input:checked + .color-swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--fg); }
/* Inputs (spec 2a): sunken fill, a stronger border than --hairline so the
   field edge is visible, near-white typed text, 6:1 placeholder. */
[data-theme="dark"] .input { background: var(--bg-sunken); border-color: var(--line-strong); color: var(--fg); }
[data-theme="dark"] .input::placeholder { color: #8FA1AD; opacity: 1; }
[data-theme="dark"] .input:focus { border-color: var(--accent); }
[data-theme="dark"] .input[aria-invalid="true"] { border-color: #FF9B9B; }
/* separate rule: a browser without :user-invalid would drop a whole list */
[data-theme="dark"] .input:user-invalid { border-color: #FF9B9B; }
[data-theme="dark"] .input:disabled { background: #121E28; border-style: dashed; border-color: #36495A; color: #7F909B; }
/* Tables (spec 2b): tinted header row, lighter header text, zebra rows. */
[data-theme="dark"] th,
[data-theme="dark"] .table-scroll thead th { background: var(--bg-alt); color: var(--fg-2); }
[data-theme="dark"] tbody tr:nth-child(even) td { background: #1A2A37; }
[data-theme="dark"] .panel { background: var(--surface); }
/* Raised surfaces (spec 2b modal): lighter than --surface, with an edge. */
[data-theme="dark"] .modal,
[data-theme="dark"] .report-issue-modal,
[data-theme="dark"] .profile-menu-panel { background: var(--bg-alt); border: 1px solid #3B5163; }
[data-theme="dark"] .modal-overlay,
[data-theme="dark"] .report-issue-overlay { background: rgba(0,0,0,.6); }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-weight: var(--w-regular);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--w-display);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-heading);
  margin: 0;
  color: var(--fg);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

.eyebrow {
  font-family: var(--font-text);
  font-weight: var(--w-bold);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--fg-2);
}

/* brand lockup: real logo asset (see /img/logo-primary.png) */
.brandmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brandmark img { height: 26px; width: auto; display: block; }
/* logo-primary.png is dark navy wordmark on a transparent background - all
   but invisible on the dark theme's near-black appbar. There's no separate
   reverse/white logo asset, so approximate one: invert flips navy to a
   light tint, then hue-rotate brings the accent dot back toward its
   original purple instead of the cyan invert(1) alone would produce. */
[data-theme="dark"] .brandmark img { filter: invert(1) hue-rotate(180deg); }
.brandmark .sub {
  display: block;
  font-family: var(--font-text);
  font-weight: var(--w-bold);
  font-size: 9.5px;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--fg-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-text);
  font-weight: var(--w-bold);
  font-size: 14px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn-primary { background: var(--accent); color: var(--accent-on); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-connect { background: var(--eventus-pewter); color: #fff; }
.btn-connect:hover { background: #3B6271; }
.btn-ghost { background: var(--surface); color: var(--fg); border-color: var(--hairline); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
form.inline-form { margin: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: var(--w-bold);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.badge-internal { background: var(--eventus-light-blue-tint); color: var(--eventus-navy); }
.badge-external { background: var(--accent-soft); color: var(--accent-hover); }
.badge-admin { background: var(--eventus-yellow); color: #6B5A00; }
.badge-status-complete { background: #E3F3E6; color: #2E7D45; }
.badge-status-in-testing { background: var(--eventus-yellow); color: #6B5A00; }
.badge-status-invalid-credentials { background: #FBEAEA; color: #A23A3A; }
.badge-status-otp-external { background: var(--eventus-light-blue-tint); color: var(--eventus-pewter); }
.badge-status-1pass-only { background: var(--eventus-grey); color: var(--eventus-ink-3); }
.badge-status-needs-fix { background: #FDEBD3; color: #8A4B00; }
/* Pilot-status dot (Home's badges, lib/ui/pilotStatus.ts) - background:
   currentColor means it always matches whichever .badge-status-* variant
   it's nested in, so every status gets a matching dot for free instead of
   a second color palette to keep in sync with the one above. .badge is
   already display:inline-flex; gap:6px, so this needs no margin of its own. */
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; opacity: .85; }

.status-light {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.status-light-complete { background: #2E7D45; }
.status-light-error { background: #A23A3A; }
.status-light-unknown { background: var(--eventus-ink-3); opacity: .5; }
/* Cancelled/skipped run: deliberately the muted neutral rather than the error
   red - nothing about the credentials failed, the run just never reported.
   Distinguished from -unknown by being fully opaque. */
.status-light-superseded { background: var(--eventus-ink-3); }
.status-light-in-progress { background: #D9A400; animation: status-light-pulse 1.4s ease-in-out infinite; }
@keyframes status-light-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 26px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
}
.appbar .right { display: flex; align-items: center; gap: 18px; }
.navlink {
  color: var(--accent);
  font-family: var(--font-text);
  font-weight: var(--w-bold);
  font-size: 13px;
  letter-spacing: .02em;
  text-decoration: none;
  border: 0;
}
.userchip { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fg-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-hover);
  display: grid; place-items: center;
  font-weight: var(--w-bold); font-size: 13px; font-family: var(--font-display);
}

.page { padding: 30px 26px 40px; }
.page-inner { max-width: 760px; margin: 0 auto; }
.section { margin-top: 30px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
/* unscoped sibling of .section-head .count - same badge, usable wherever a
   count needs to sit next to an eyebrow (e.g. .panel-head, adminConnections.ejs) */
.count {
  font-family: var(--font-text); font-weight: var(--w-bold); font-size: 11px;
  color: var(--fg-3); background: var(--bg-alt); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); padding: 1px 9px;
}
.section-head .bar { flex: 1; height: 1px; background: var(--hairline); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md);
  padding: 15px 17px;
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out), border-color var(--dur-base);
}
.card:hover { box-shadow: var(--shadow-2); border-color: transparent; transform: translateY(-1px); }
.card-left { display: flex; align-items: center; min-width: 0; gap: 13px; }
.card .ic { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; }
.ic-emr { background: var(--accent-soft); color: var(--accent-hover); }
.card .rname { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.card .rmeta { font-size: 12.5px; color: var(--fg-3); margin-top: 1px; }
.svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.empty {
  text-align: center; color: var(--fg-3); padding: 44px 20px;
  border: 1px dashed var(--hairline); border-radius: var(--radius-md); background: var(--bg-alt);
}
.empty .big { font-family: var(--font-display); font-weight: 800; font-size: 17px; color: var(--fg); margin-bottom: 4px; }

/* admin */
.admin-shell { display: grid; grid-template-columns: 210px 1fr; min-height: 470px; align-items: start; }
.admin-nav { border-right: 1px solid var(--hairline); padding: 18px 12px; background: var(--bg-alt); }
.admin-nav .eyebrow { padding: 0 12px 8px; display: block; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--fg-2); text-decoration: none; border: 0; font-size: 14px; font-weight: var(--w-semibold); margin-bottom: 2px;
}
.admin-nav a.active { background: var(--accent-soft); color: var(--accent-hover); }
.admin-nav a:hover:not(.active) { background: var(--bg-sunken); }
@media (max-width: 880px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav {
    display: flex; flex-direction: row; flex-wrap: nowrap; overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--hairline);
  }
  .admin-nav .eyebrow { display: none; }
  .admin-nav a { white-space: nowrap; margin-bottom: 0; }
}
.admin-main { padding: 24px 26px; }
/* Sub-nav within a merged admin page (partials/adminTabs.ejs) - e.g.
   /admin/people's Users/Custom groups tabs. Distinct from .admin-nav (the
   vertical sidebar between top-level admin pages): this is a horizontal
   row switching between two views WITHIN one page, so it reads as a
   sub-level, not a sibling, of that sidebar. */
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); margin: 4px 0 20px; }
.admin-tab {
  padding: 9px 14px; margin-bottom: -1px; color: var(--fg-2); text-decoration: none;
  font-size: 13.5px; font-weight: var(--w-semibold); border-bottom: 2px solid transparent;
}
.admin-tab.active { color: var(--accent-hover); border-bottom-color: var(--accent); }
.admin-tab:hover:not(.active) { color: var(--fg); }
.admin-main .lede { color: var(--fg-3); font-size: 14px; margin: 4px 0 20px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tiles-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) { .tiles, .tiles-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .tiles, .tiles-4 { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: 18px; }
.tile .num { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -.02em; color: var(--eventus-navy); }
.tile .lbl { font-size: 12.5px; color: var(--fg-3); margin-top: 2px; }

/* Every admin/home data table sits in one of these - capped height + its own
   scrollbar (rather than letting the table grow the surrounding page) once a
   list is longer than fits, with the header row pinned via `position:
   sticky` so column labels stay visible while scrolling through it. Below
   the cap (most tables, most of the time) this is a no-op: no scrollbar, no
   visible clipping. */
.table-scroll { overflow: auto; max-height: 560px; }
.table-scroll thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-family: var(--font-text); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fg-3); font-weight: var(--w-bold); padding: 9px 10px;
  border-bottom: 1px solid var(--hairline);
}
td { padding: 12px 10px; border-bottom: 1px solid var(--hairline); color: var(--fg-2); }
tr:last-child td { border-bottom: none; }

/* Sortable column headers (public/js/sortableTable.js) - .sortable-th is
   added at runtime to every <th> with text (an empty actions-only header
   is left alone, see isSortable() there). The ::after arrow reflects
   data-sort-dir, set by the same script on click. */
th.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable-th:hover { color: var(--fg-2); }
th.sortable-th::after { content: '\2195'; margin-left: 5px; opacity: .35; font-size: 11px; }
th.sortable-th[data-sort-dir="asc"]::after { content: '\2191'; opacity: 1; }
th.sortable-th[data-sort-dir="desc"]::after { content: '\2193'; opacity: 1; }
.rowlink { color: var(--accent); font-weight: var(--w-bold); text-decoration: none; border: 0; }

.panel { border: 1px solid var(--hairline); border-radius: var(--radius-md); overflow: hidden; }
.panel + .panel { margin-top: 16px; }
.panel-head {
  padding: 13px 16px; background: var(--bg-alt); border-bottom: 1px solid var(--hairline);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
}
.panel-head .eyebrow { color: var(--fg-2); }
/* Collapsible panels (public/js/panelCollapse.js, and <details class="panel">). */
.panel-head[data-collapse-ready], details.panel > summary.panel-head { cursor: pointer; user-select: none; }
.panel-head[data-collapse-ready]::before, details.panel > summary.panel-head::before {
  content: "\25BE"; color: var(--fg-3); margin-right: 8px; transition: transform .15s;
}
.panel.is-collapsed > .panel-head[data-collapse-ready]::before, details.panel:not([open]) > summary.panel-head::before { transform: rotate(-90deg); }
details.panel > summary.panel-head { list-style: none; justify-content: flex-start; }
details.panel > summary.panel-head::-webkit-details-marker { display: none; }
/* The ::before chevron is a flex item of the space-between head; keep it hugging the title. */
.panel-head[data-collapse-ready] > :first-child { margin-right: auto; }
.panel.is-collapsed > .panel-head { border-bottom-color: transparent; }
.panel.is-collapsed > :not(.panel-head) { display: none; }
.panel-body { padding: 16px; }
.grantgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
@media (max-width: 640px) { .grantgrid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 5px 0; color: var(--fg); }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

/* Radio "choice cards" - for option lists whose label needs a title +
   description (e.g. Settings' Home layout picker) rather than .check's
   single-line inline label, which crowds multi-line descriptions together
   with barely any visual separation between options. */
.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--hairline); border-radius: var(--radius-md); cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out);
}
.choice:hover { border-color: var(--accent); }
.choice input { width: 17px; height: 17px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.choice-body { display: flex; flex-direction: column; gap: 2px; }
.choice-title { font-weight: var(--w-bold); font-size: 14px; color: var(--fg); }
.choice-desc { font-size: 12.5px; color: var(--fg-3); }

/* Dark/light switch (Settings' Appearance panel) - hidden native checkbox +
   styled sibling track/thumb, same accessible-hidden-input pattern as
   .color-radio above (still focusable/keyboard-toggleable, only its
   appearance is replaced). */
.theme-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; position: relative; }
.theme-switch input { position: absolute; top: 0; left: 0; opacity: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; }
.theme-switch-track {
  width: 42px; height: 24px; flex: none; border-radius: var(--radius-pill);
  background: var(--bg-sunken); border: 1px solid var(--hairline); position: relative;
  transition: background var(--dur-base) var(--ease-out);
}
.theme-switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform var(--dur-base) var(--ease-out);
}
.theme-switch input:checked + .theme-switch-track { background: var(--accent); }
.theme-switch input:checked + .theme-switch-track::after { transform: translateX(18px); }
.theme-switch input:focus-visible + .theme-switch-track { box-shadow: var(--shadow-focus); }
.field { display: flex; gap: 8px; }
.input {
  flex: 1; width: 100%; font: inherit; font-family: var(--font-text); font-size: 14px; padding: 10px 13px;
  border: 1px solid var(--hairline); border-radius: var(--radius-pill); background: var(--surface);
}
.input:focus { outline: none; box-shadow: var(--shadow-focus); border-color: var(--accent); }
textarea.input { width: 100%; resize: vertical; min-height: 70px; border-radius: var(--radius-sm); }
.member { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; color: var(--fg-2); }
.member > span { min-width: 0; overflow-wrap: anywhere; }
.member:last-child { border-bottom: none; }
.feedback-item { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.feedback-item:last-child { border-bottom: none; }
.feedback-item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--fg-3); }
.feedback-item-meta strong { color: var(--fg); font-weight: var(--w-semibold); }
.feedback-item-notes { margin: 6px 0 0; font-size: 14px; color: var(--fg-2); overflow-wrap: anywhere; }
.x { color: var(--fg-3); text-decoration: none; font-size: 13px; border: 0; font-weight: var(--w-semibold); background: none; cursor: pointer; padding: 0; font-family: inherit; }
.notice { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.notice-error { background: #FBEAEA; color: #A23A3A; }
.notice-success { background: #E8F5EC; color: #2C7A45; }

/* profile menu - a <details>/<summary> dropdown, no JS needed to open/close */
.profile-menu { position: relative; }
.profile-menu > summary {
  list-style: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-hover);
  display: grid; place-items: center;
  font-weight: var(--w-bold); font-size: 13px; font-family: var(--font-display);
}
.profile-menu > summary::-webkit-details-marker { display: none; }
.profile-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 20;
  min-width: 240px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md);
  box-shadow: var(--shadow-2); padding: 8px;
}
.profile-menu-header { padding: 8px 10px 10px; }
.profile-menu-name { font-weight: var(--w-bold); font-size: 14px; color: var(--fg); margin-bottom: 3px; }
.profile-menu-email { font-size: 12.5px; color: var(--fg-3); margin: 0 0 8px; }
.profile-menu-divider { height: 1px; background: var(--hairline); margin: 4px 0; }
.profile-menu-item {
  display: block; width: 100%; text-align: left; font: inherit; font-family: var(--font-text); font-size: 13.5px;
  color: var(--fg-2); background: none; border: 0; border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer;
  text-decoration: none;
}
.profile-menu-item:hover { background: var(--bg-alt); }
.profile-menu-signout { color: #A23A3A; }
.profile-menu-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 4px; font-size: 12px; color: var(--fg-3);
}
.profile-menu-footer a { color: var(--accent); font-weight: var(--w-semibold); text-decoration: none; }

/* site-wide banners - stacked full-width strips below the appbar */
.banner-stack { display: flex; flex-direction: column; }
.banner-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; background: var(--accent-soft); color: var(--accent-hover);
  font-size: 13.5px; font-weight: var(--w-semibold); border-bottom: 1px solid var(--hairline);
}
.banner-dismiss {
  flex: none; background: none; border: 0; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px;
}
/* A live banner countdown (public/js/bannerCountdown.js rewrites its text
   every second). tabular-nums so the digits are all the same width - without
   it a proportional font makes the whole message shift left and right as the
   numbers tick, which is very noticeable on a banner that sits at the top of
   every page. Bold because it is the one part of the message that is changing. */
.banner-countdown { font-variant-numeric: tabular-nums; font-weight: var(--w-semibold); }

/* banner colors - purple is the default look (same as .banner-row's
   own background/color above); the rest reuse existing badge/status
   tokens rather than introducing new ones, so a colored banner stays
   visually consistent with the rest of the app. */
.banner-color-purple { background: var(--accent-soft); color: var(--accent-hover); }
.banner-color-blue { background: var(--eventus-light-blue-tint); color: var(--eventus-navy); }
.banner-color-green { background: #E3F3E6; color: #2E7D45; }
.banner-color-yellow { background: var(--eventus-yellow); color: #6B5A00; }
.banner-color-red { background: #FBEAEA; color: #A23A3A; }
.banner-color-gray { background: var(--bg-alt); color: var(--fg-2); }

/* small color-preview dot for the admin Banners list (adminBanners.ejs) */
.color-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--hairline); }
.color-swatch.banner-color-purple { background: var(--accent); border-color: transparent; }
.color-swatch.banner-color-blue { background: var(--eventus-light-blue); border-color: transparent; }
.color-swatch.banner-color-green { background: #2E7D45; border-color: transparent; }
.color-swatch.banner-color-yellow { background: var(--eventus-yellow); }
.color-swatch.banner-color-red { background: #A23A3A; border-color: transparent; }
.color-swatch.banner-color-gray { background: var(--eventus-ink-3); border-color: transparent; }

/* Banner color picker (adminBanners.ejs's "Create banner" form) - radio
   buttons rendered as filled color swatches instead of a <select>, so you
   can see the actual color rather than read its name. The native <input>
   stays in the DOM (visually hidden, not display:none) so it's still
   keyboard-navigable/focusable and submits like any other radio group -
   only its appearance is replaced by the adjacent .color-swatch span. */
.color-radio-group { display: flex; gap: 10px; }
.color-radio { position: relative; cursor: pointer; display: inline-flex; }
.color-radio input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0;
}
.color-radio .color-swatch {
  width: 28px; height: 28px; box-sizing: border-box; border-width: 2px;
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.color-radio input:checked + .color-swatch {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--eventus-ink);
}
.color-radio input:focus-visible + .color-swatch { box-shadow: var(--shadow-focus); }

/* landing */
.landing {
  /* Fills the window rather than a fixed 540px: the tinted panel is the
     whole sign-in page, and a fixed height left a band of plain body
     background under it on any reasonably tall screen. */
  min-height: 100vh; display: grid; place-items: center; padding: 40px 20px;
  position: relative; overflow: hidden; background: var(--bg-alt);
}
.landing .dot {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: var(--eventus-purple); opacity: .10; right: -160px; bottom: -200px;
}
.login-card {
  position: relative; width: 100%; max-width: 410px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius-lg); box-shadow: var(--shadow-3);
  padding: 38px 34px; text-align: center;
}
/* The sign-in card stacks the lockup: wordmark over the V.I.T.A.L
   product name, rather than the appbar's side-by-side arrangement. */
.login-card .brandmark { flex-direction: column; align-items: center; gap: 6px; margin-bottom: 24px; }
.login-card .brandmark img { height: 32px; }
.login-card .eyebrow { color: var(--accent); display: block; margin-bottom: 8px; }
.login-card h1 { font-size: 30px; margin: 0 0 6px; }
.login-card p.tag { color: var(--fg-3); font-size: 14px; margin: 0 0 28px; }
.login-card .btn { width: 100%; justify-content: center; margin-bottom: 10px; }
.login-card .hint { color: var(--fg-3); font-size: 12px; margin: 18px 0 0; }

/* stream viewer chrome (dark) - the header/footer bars are brand-colored
   (plum/plum-tint, same tokens as everywhere else) rather than plain grays,
   so the viewer still reads as THIS app's chrome around a black canvas, not
   a generic video player. */
.st-header {
  display: flex; align-items: center; gap: 10px; padding: 9px 15px; flex: none;
  background: var(--eventus-plum); border-bottom: 1px solid var(--eventus-plum-tint);
}
.st-header-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--eventus-purple); flex: none; }
.st-header-brand {
  font-family: var(--font-text); font-weight: var(--w-display); font-size: 9px;
  letter-spacing: var(--tracking-wider); text-transform: uppercase; color: #9BA8C4;
}
.st-header-divider { width: 1px; height: 14px; background: var(--eventus-plum-tint); flex: none; }
.st-header-loc { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff; }
.st-status {
  padding: 10px 15px; font-size: 13px; color: #D7DCEB; background: var(--eventus-plum); flex: none;
  border-top: 1px solid var(--eventus-plum-tint); display: flex; align-items: center; gap: 10px; font-family: var(--font-text);
}
.st-status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--eventus-purple); box-shadow: 0 0 0 3px rgba(135,123,233,.25);
}
.st-status .loc { color: #fff; font-weight: var(--w-bold); }
.st-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 15px;
  font-size: 13px; background: #3a3a1c; color: var(--eventus-yellow); border-bottom: 1px solid var(--eventus-plum-tint);
}
.st-banner button {
  cursor: pointer; background: none; border: 0; color: inherit; font-size: 15px; line-height: 1; padding: 0;
}
/* Wraps the canvas and takes up the flex space left over between the fixed
   header/status bars (body is a flex column - see stream.ejs). Its size IS
   the remote viewport: stream.ejs measures it and sizes both the remote page
   and the canvas's on-screen box from it (see "Stream geometry" there). The
   max-width/max-height on .st-view below are a backstop for the moment
   before that script runs. */
.st-view-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #000; }
.st-view { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; background: #000; cursor: default; touch-action: none; }
.pill {
  font-size: 11px; font-weight: var(--w-bold); letter-spacing: .06em; text-transform: uppercase;
  color: #c8d2d8; background: #16262f; border: 1px solid #22333d; border-radius: var(--radius-pill); padding: 3px 11px;
}

/* Home layouts (views/partials/home/*.ejs) - grouped/grid/table/sidebar are
   4 alternative presentations of the same emrFacilities list a user can pick
   in Settings (routes/settings.ts, db/migrations/0015_home_layout.sql).
   Reuses .card/.ic/.color-swatch/.badge tokens wherever the shape fits
   rather than inventing parallel ones - only genuinely new shapes (the
   search-icon wrapper, vendor pills, the A-Z rail, the sidebar shell) get
   new rules here. */
.page-inner-wide { max-width: 1040px; margin: 0 auto; }

.search-field { position: relative; margin-bottom: 12px; }
.search-field .input { padding-left: 38px; }
.search-field .search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke: var(--fg-3); stroke-width: 2; fill: none; pointer-events: none;
}

.pill-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.pill-filter {
  font: 600 12px var(--font-text); padding: 5px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--hairline); background: var(--surface); color: var(--fg-2); cursor: pointer;
}
.pill-filter.active { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }

/* grouped layout's per-vault sections - a <details> whose <summary> is just
   a .section-head (same eyebrow/count/hairline as every other heading in the
   app), plus a chevron and the cursor/marker handling a summary needs. */
.vault-group + .vault-group { margin-top: 26px; }
.vault-group > summary { list-style: none; cursor: pointer; }
.vault-group > summary::-webkit-details-marker { display: none; }
.vault-group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }
.vault-chevron { width: 15px; height: 15px; flex: none; stroke: var(--fg-3); transition: transform var(--dur-fast) var(--ease-out); }
.vault-group[open] > summary .vault-chevron { transform: rotate(90deg); }

/* unscoped sibling of .card .ic (same size/shape) for icon avatars that
   aren't inside a .card row - e.g. the grid/sidebar tile layouts below. */
.ic { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 14px; }

.home-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 13px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md);
}
.home-row-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.home-row-left .rname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3 { grid-template-columns: 1fr; } }
.facility-tile {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.facility-tile:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.facility-tile .btn { align-self: flex-start; }
.facility-tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }

/* Home "table" layout only, for the A-Z jump rail alongside .table-scroll
   (which handles the max-height/sticky-header behavior itself) - see
   partials/home/table.ejs. */
.table-shell { display: flex; align-items: stretch; }
.table-shell .table-scroll { flex: 1; }
.az-rail {
  width: 26px; flex: none; border-left: 1px solid var(--hairline); display: flex; flex-direction: column;
  align-items: center; padding: 8px 0; gap: 2px; max-height: 560px; overflow-y: auto;
}
.az-rail a { font: 700 9.5px var(--font-text); color: var(--fg-3); text-decoration: none; padding: 2px 0; }
.az-rail a:hover { color: var(--accent); }
tr[id^="row-"] { scroll-margin-top: 40px; }

.home-sidebar {
  display: grid; grid-template-columns: 190px 1fr; align-items: start;
  border: 1px solid var(--hairline); border-radius: var(--radius-md); overflow: hidden;
}
@media (max-width: 720px) { .home-sidebar { grid-template-columns: 1fr; } }
.home-sidebar-nav { background: var(--bg-alt); border-right: 1px solid var(--hairline); padding: 16px 10px; }
.home-cat-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: var(--radius-sm); border: 0; background: none; color: var(--fg-2);
  font: 600 13px var(--font-text); cursor: pointer; margin-bottom: 2px;
}
.home-cat-btn.active { background: var(--accent-soft); color: var(--accent-hover); }
.home-cat-btn:hover:not(.active) { background: var(--bg-sunken); }
.home-cat-btn .n { font-size: 11px; opacity: .7; }
.home-sidebar-main { padding: 20px 24px; }
.home-tab-panel[hidden] { display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.pin-toggle {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--fg-3); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.pin-toggle:hover { border-color: var(--accent); color: var(--accent); }
.pin-toggle.pinned { background: var(--accent-soft); border-color: transparent; color: var(--accent-hover); }

/* Patch-note Markdown editor (public/js/patchNoteEditor.js, adminPatchNotes.ejs
   - backed by vendored EasyMDE, which supplies its own toolbar/border/focus
   chrome via public/css/vendor/easymde.min.css, so .rte itself is just a
   layout wrapper) and the sanitized HTML it produces, rendered read-only
   on whatsNew.ejs - lib/security/sanitizeHtml.ts is what actually limits the
   tags to the ones styled here (p/br/b/i/u/ul/ol/li/a). */
.rte-editor { display: block; width: 100%; }

.rich-text { font-size: 14px; color: var(--fg-2); line-height: var(--lh-body); }
.rich-text p { margin: 0 0 10px; }
/* The Markdown preview panel (adminPatchNotes.ejs) reuses .rich-text's own
   typography so what an admin sees here matches whatsNew.ejs exactly - just
   with a top hairline separating it from the textarea above it. */
[data-rte-preview] { padding: 10px 13px; border-top: 1px solid var(--hairline); background: var(--bg-alt); }
[data-rte-preview]:empty::before { content: 'Nothing to preview yet.'; color: var(--fg-3); }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { margin: 0 0 10px; padding-left: 22px; }
.rich-text a { color: var(--accent); }

/* floating "Report an issue" button (public/js/reportIssue.js) */
.report-issue-btn {
  position: fixed; z-index: 9998; bottom: 24px; right: 24px; touch-action: none; box-shadow: var(--shadow-3);
  opacity: .85; transition: opacity var(--dur-base) var(--ease-out);
  width: 48px; height: 48px; padding: 0; justify-content: center;
}
.report-issue-btn:hover, .report-issue-btn:focus-visible, .report-issue-btn.dragging { opacity: 1; }
.report-issue-btn svg { width: 22px; height: 22px; flex: none; }
.report-issue-overlay {
  position: fixed; inset: 0; background: rgba(15,30,41,.45); z-index: 9999;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.report-issue-overlay.open { display: flex; }
.report-issue-modal {
  background: var(--surface); border-radius: var(--radius-lg); max-width: 440px; width: 100%;
  padding: 22px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-3);
}
.report-issue-modal h4 { margin: 0 0 4px; }
.report-issue-modal .rif { display: block; font-size: 13px; font-weight: var(--w-semibold); margin: 12px 0 5px; color: var(--fg-2); }
.report-issue-modal textarea.input { width: 100%; font: inherit; font-family: var(--font-text); resize: vertical; min-height: 70px; border-radius: var(--radius-sm); }
.report-issue-modal select.input,
.report-issue-modal input.input { width: 100%; border-radius: var(--radius-sm); }
.report-issue-screenshot { margin: 12px 0 0; }
/* .btn's own display:inline-flex (and this row's display:flex) are author
   rules, which always beat the UA stylesheet's [hidden]{display:none} even
   at equal specificity - so toggling .hidden on the screenshot button/preview
   (reportIssue.js) needs its own scoped override, same as .home-tab-panel[hidden]
   does for homeSidebarTabs.js. */
.report-issue-screenshot [hidden] { display: none; }
.report-issue-screenshot-preview { display: flex; align-items: center; gap: 10px; }
.report-issue-screenshot-preview img {
  max-width: 160px; max-height: 100px; border-radius: var(--radius-sm); border: 1px solid var(--hairline); display: block;
}
.report-issue-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.report-issue-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--eventus-navy); color: #fff; padding: 10px 18px; border-radius: var(--radius-pill);
  font-size: 13px; z-index: 10000; box-shadow: var(--shadow-3);
}

/* Floating "back to top" button (public/js/scrollTop.js). Sits 60px above
   .report-issue-btn's DEFAULT bottom:24px, one z-index below it so the
   report button wins if they ever do meet.
   Caveat worth knowing: that 60px only separates them while the report
   button is where it started. reportIssue.js makes it draggable and
   persists the position in localStorage (as inline left/top with
   right/bottom:auto), clamped only to the viewport - so someone who parks
   it in the lower-right can leave it sitting on top of this button, and at
   z-index 9998 vs 9997 it takes the clicks. Fixing that properly means
   teaching the drag clamp to avoid this slot, which belongs to that
   feature, not this one.
   The script toggles .is-visible once the document scrolls past its threshold.
   visibility (not display/[hidden]) is what hides it: it keeps the element
   out of the tab order the way display:none would, while still letting the
   opacity/transform reveal animate - a display change would not. */
.scroll-top-btn {
  position: fixed; z-index: 9997; bottom: 84px; right: 24px; box-shadow: var(--shadow-3);
  width: 48px; height: 48px; padding: 0; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              visibility var(--dur-base);
}
.scroll-top-btn.is-visible { opacity: .85; visibility: visible; transform: none; }
.scroll-top-btn.is-visible:hover, .scroll-top-btn.is-visible:focus-visible { opacity: 1; }
.scroll-top-btn svg { width: 22px; height: 22px; flex: none; }
/* Stay out of the way entirely while the bulk-selection bar is up, rather
   than trying to sit above it. An offset would have to guess the bar's
   height, and the bar's is genuinely variable (max-height:60vh with
   overflow-y:auto, so it grows with the controls and the viewport) - guess
   low and this button, at z-index 9997 against the bar's 400, parks itself
   on top of the bar's own controls and swallows their clicks. The <body>
   padding-bottom the bar reserves can under-reserve harmlessly (it just
   clips the last table row); this cannot.
   Hidden the same way the script hides it, so there's one mechanism and no
   display/[hidden] specificity fight. The bulk bar is a transient action
   surface anyway - finishing or clearing the selection brings the button
   straight back. */
body.has-bulk-bar .scroll-top-btn { opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  /* Matches the scrollTo behavior:'auto' the script uses under the same
     query - no slide-in, and no smooth scroll. */
  .scroll-top-btn { transition: none; transform: none; }
}

/* Generic modal (public/js/facilityModal.js) - not tied to any one feature,
   so future admin modals can reuse it instead of each rolling their own. */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,30,41,.45); z-index: 500;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); max-width: 640px; width: 100%;
  padding: 22px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-3);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* First-login "What's New" popup (partials/patchNotePopup.ejs) - the generic
   .modal-overlay above, rendered already-open server-side, with two
   adjustments. z-index sits above .report-issue-btn's 9998 (a floating
   button punching through a modal backdrop looks broken, and it's the only
   other fixed element on /home). max-height keeps a long patch note
   scrolling inside the modal rather than pushing its buttons off-screen -
   .modal's own overflow-y handles the scroll, this just bounds the body so
   the action row stays visible. */
.patch-note-popup { z-index: 9999; }
.patch-note-popup-body { max-height: 50vh; overflow-y: auto; margin-top: 14px; }
.patch-note-popup-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* --- Per-table search + collapse (public/js/tableTools.js) ---------------
   A collapse toggle, a count badge and a realtime search box per admin
   table, injected at runtime.

   Two arrangements, which is why the caret/label/search rules below are not
   nested under .table-tools:
   - .table-tools: a bar of its own above a plain table (Users, Banners,
     Logs), which have no panel chrome to hang controls off.
   - .panel-head-tools: the controls put straight into an existing
     .panel-head, beside the eyebrow already naming the section (the
     Connections status sections). Bolting a second bar with a duplicate
     label under a head that already says "Tested — Complete" and shows a
     count is the kind of doubled chrome that makes a dense page unreadable.

   Everything here is styled off the existing tokens rather than new ones -
   .count and .input are reused as-is. */
.table-tools {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 10px;
}
/* space-between would spread the toggle, eyebrow and count apart when a
   table is too small to get a search box; the search box's own margin-left:
   auto is what pushes it to the right edge in either case. */
.panel-head-tools { justify-content: flex-start; }
/* The collapse control. A real <button> (not a clickable heading) so it's in
   the tab order and announces its aria-expanded state; styled flat because
   it's a disclosure, not an action. */
.table-tools-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  font: inherit; font-family: var(--font-text); color: var(--fg-2);
}
.table-tools-toggle:hover { color: var(--fg); }
.table-tools-toggle:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }
.table-tools-label {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: var(--w-bold);
}
/* CSS caret rather than a glyph or an SVG: it has to rotate, and a border
   triangle rotates cleanly at any zoom without a font dependency. */
.table-tools-caret {
  width: 0; height: 0; flex: none;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transform: rotate(90deg);
  transition: transform var(--dur-base) var(--ease-out);
}
/* .is-collapsed is set on whichever element hosts the controls - the
   .table-tools bar or the .panel-head - so this stays unqualified rather
   than being written twice. */
.is-collapsed .table-tools-caret { transform: rotate(0deg); }
.table-tools-count { flex: none; }

/* The search box. Sized to the content rather than .input's flex:1, which
   would stretch it across the whole row. .search-icon is the same inline SVG
   the Home layouts use; the padding-left makes room for it. */
.table-search-field { position: relative; display: inline-flex; align-items: center; margin-left: auto; }
.table-search-field .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; stroke: var(--fg-3); stroke-width: 2; fill: none; pointer-events: none;
}
.table-search-field .table-search {
  flex: none; width: 260px; max-width: 100%;
  padding: 7px 13px 7px 34px; font-size: 13px;
}
@media (max-width: 640px) {
  .table-search-field { margin-left: 0; width: 100%; }
  .table-search-field .table-search { width: 100%; }
}
/* tableTools.js hides the search box with the `hidden` attribute when its
   table is collapsed, and the display rules above would otherwise win -
   an author `display` declaration always beats the UA's [hidden]{display:none}.
   Scoped to these two elements rather than added globally, which would change
   how every other [hidden] on the site behaves. */
.table-search-field[hidden] { display: none; }
.table-tools-empty[hidden] { display: none; }
.table-tools-empty { margin: 0; padding: 14px 10px; font-size: 13px; color: var(--fg-3); }

/* --- Sticky bulk action bar (public/js/bulkSelectionBar.js) ---------------
   The Connections page's bulk-update form, shown only while at least one
   facility is checked. Fixed to the bottom of the viewport so the controls
   are next to the selection they act on instead of at the top of the page,
   above the tables the checkboxes live in.

   No `display` declaration on .bulk-bar on purpose: the script toggles it
   with the `hidden` attribute, and an author display rule here would beat
   [hidden]{display:none} - the same trap the [hidden] overrides above exist
   to work around. The inner .bulk-bar-inner does the layout instead. */
.bulk-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 400;
  background: var(--surface); border-top: 1px solid var(--hairline);
  box-shadow: var(--shadow-3);
  padding: 12px 26px;
  max-height: 60vh; overflow-y: auto;
}
.bulk-bar-inner {
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  max-width: 1040px; margin: 0 auto;
}
.bulk-bar-count {
  font-family: var(--font-text); font-weight: var(--w-bold); font-size: 13px;
  color: var(--accent); white-space: nowrap; padding-bottom: 9px;
}
/* One labelled control. .input's flex:1 would make every select fight for the
   row, so each field sizes to its own content. */
.bulk-bar-field { display: flex; flex-direction: column; gap: 6px; }
.bulk-bar-field > .eyebrow { color: var(--fg-3); }
.bulk-bar-field .input { flex: none; width: auto; padding: 7px 13px; font-size: 13px; }
.bulk-bar-field input.input { width: 150px; }
.bulk-bar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; padding-bottom: 1px; }
.bulk-bar-note { flex-basis: 100%; margin: 4px 0 0; font-size: 12px; color: var(--fg-3); }
/* Room for the bar to sit over, added to <body> by the script only while the
   bar is up, so the last table's final row stays reachable. */
body.has-bulk-bar { padding-bottom: 190px; }
@media (max-width: 640px) {
  .bulk-bar { padding: 12px 16px; }
  .bulk-bar-actions { margin-left: 0; }
  body.has-bulk-bar { padding-bottom: 320px; }
}

/* Product tour (public/js/tour.js) - the spotlight walkthrough. All four
   layers are built by that file and positioned by setting .style.top/.left
   on them; everything that isn't a measured coordinate lives here so the
   tour is themed by the same tokens as the rest of the portal (it runs on
   the dark theme too, over dark surfaces, without a second palette).

   Stacking, from the back: .tour-blocker swallows clicks on the page under
   the tour, .tour-spotlight cuts the hole (a huge spread box-shadow, not a
   mask - it stays crisp at any size and animates cheaply), .tour-secondary
   outlines one item inside that hole, .tour-card is the copy. All of them
   sit above the floating Report an issue button (z-index 9995 in its own
   rule) so a step can point AT that button without it punching through. */
.tour-root { display: none; }
.tour-root.is-open { display: block; }
.tour-blocker {
  position: fixed; inset: 0; z-index: 9996;
  background: rgba(15, 30, 41, .55);
}
/* Once a spotlight is showing, the dimming comes from the spotlight's own
   ring shadow instead - a second full-screen tint on top of it would double
   the darkness everywhere except the hole. */
.tour-blocker.is-clear { background: transparent; }
.tour-spotlight {
  position: fixed; z-index: 9998; box-sizing: border-box;
  border-radius: var(--radius-md);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(15, 30, 41, .6);
  pointer-events: none;
  transition: top 220ms var(--ease-out), left 220ms var(--ease-out),
              width 220ms var(--ease-out), height 220ms var(--ease-out);
}
.tour-secondary {
  position: fixed; z-index: 9998; box-sizing: border-box;
  border-radius: var(--radius-sm);
  border: 2px solid var(--accent-hover);
  background: rgba(135, 123, 233, .12);
  box-shadow: 0 0 0 3px rgba(135, 123, 233, .28);
  pointer-events: none;
}
.tour-card {
  position: fixed; z-index: 9999; box-sizing: border-box; width: 320px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 16px; box-shadow: 0 12px 28px rgba(25, 50, 65, .18);
  padding: 20px;
}
/* The welcome and sign-off steps have no anchor - they sit in the middle
   over the fully-dimmed page. */
.tour-card.is-centered { top: 50%; left: 50%; transform: translate(-50%, -50%); width: 360px; }
.tour-eyebrow { color: var(--accent); display: block; }
.tour-title { font-size: 18px; margin: 8px 0; }
.tour-body { color: var(--fg-2); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-actions .tour-spacer { flex: 1; }
.tour-skip {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--fg-3); font-family: var(--font-text); font-weight: var(--w-semibold); font-size: 13px;
}
.tour-skip:hover { color: var(--fg-2); }
/* .btn sets display:inline-flex, which beats the browser's own
   [hidden]{display:none} - so hiding Back on the first step needs a rule
   that outranks .btn rather than the attribute alone. */
.tour-card .btn[hidden] { display: none; }

/* "Take the tour" pill, injected into an admin page's header by tour.js.
   Floated so it lands on the header's right without the ten admin views
   having to grow a flex wrapper around their eyebrow and <h3>. */
.tour-cta {
  float: right; margin: 0 0 8px 12px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--font-text); font-weight: var(--w-bold); font-size: 12px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-hover);
  cursor: pointer;
}
.tour-cta:hover { background: var(--accent); color: var(--accent-on); }

/* Settings' Product tour panel: the replay button plus one chip per admin
   walkthrough the signed-in admin can reach. */
.tour-jump-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tour-jump {
  font-family: var(--font-text); font-weight: var(--w-semibold); font-size: 12px;
  padding: 6px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--hairline); background: var(--surface); color: var(--fg-2);
  cursor: pointer;
}
.tour-jump:hover { border-color: var(--accent); color: var(--accent-hover); }

/* Facility grid editor (views/adminFacilityGrid.ejs, public/js/facilityGrid.js).
   Layout: the table scrolls INSIDE .grid-scroll (both axes, bounded height) so
   its sticky header and first column work against that box and the page itself
   never scrolls sideways. .grid-page's min-width:0 is what stops the table's
   max-content width from stretching .admin-shell's 1fr column (a grid item's
   default min-width is auto). Colors are theme tokens so the dark theme follows;
   the few mixes use color-mix() over tokens rather than new hard-coded colors. */
.admin-main.grid-page { min-width: 0; }
#facility-grid { min-width: 0; max-width: 100%; }
.grid-toolbar-panel { overflow: visible; }
.grid-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.grid-scroll {
  overflow: auto; max-width: 100%;
  /* 300px ~ appbar + page heading + toolbar; floor keeps it usable on short screens */
  max-height: max(320px, calc(100vh - 300px));
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
}
table.facility-grid { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
table.facility-grid th, table.facility-grid td { padding: 6px 8px; vertical-align: top; white-space: nowrap; }
table.facility-grid tr[hidden] { display: none; }

/* Row states. One variable per row, painted on every cell (sticky ones
   included) so a sticky cell is always opaque and always matches its row.
   Precedence, weakest to strongest: hover, selected, focused row. */
table.facility-grid tbody tr { --row-bg: var(--surface); }
table.facility-grid tbody td { background-color: var(--row-bg); border-bottom: 1px solid var(--hairline); }
table.facility-grid tbody tr:hover { --row-bg: var(--bg-alt); }
table.facility-grid tbody tr.grid-row-selected { --row-bg: color-mix(in srgb, var(--eventus-light-blue) 24%, var(--surface)); }
table.facility-grid tbody tr:focus-within { --row-bg: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
table.facility-grid tbody tr:focus-within .grid-sticky-col { box-shadow: inset 4px 0 0 var(--accent); }
table.facility-grid tbody tr.grid-row-selected:not(:focus-within) .grid-sticky-col { box-shadow: inset 4px 0 0 var(--eventus-light-blue); }

/* Sticky layering: header cells 2, first column cells 3, corner 4 - so the
   corner sits above both and nothing scrolling beneath shows through. */
table.facility-grid thead th { position: sticky; top: 0; z-index: 2; background-color: var(--bg-alt); border-bottom: 1px solid var(--hairline); }
table.facility-grid .grid-sticky-col { position: sticky; left: 0; z-index: 3; min-width: 220px; }
table.facility-grid thead th.grid-sticky-col { z-index: 4; }

table.facility-grid .grid-name { font-size: 13px; }
table.facility-grid .grid-input { width: 170px; min-width: 120px; padding: 5px 9px; font-size: 13px; border-radius: var(--radius-sm); flex: none; }
table.facility-grid textarea.grid-input { min-height: 44px; width: 220px; }

/* Dirty/derived cells stay visible on top of every row state: a tint LAYERED
   over the row color plus an accent edge and input border, not a replacement. */
table.facility-grid td.grid-dirty { background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); box-shadow: inset 3px 0 0 var(--accent); }
table.facility-grid .grid-dirty .grid-input { border-color: var(--accent); }
table.facility-grid .grid-derived .grid-input { border-style: dashed; border-color: var(--accent); }
table.facility-grid .grid-readonly { color: var(--fg-3); }
table.facility-grid .grid-readonly-head { color: var(--fg-3); }
table.facility-grid .grid-undo { border: none; background: none; color: var(--accent-hover); cursor: pointer; font-size: 15px; padding: 0 4px; }
table.facility-grid .grid-undo[hidden], table.facility-grid .grid-reset[hidden] { display: none; }
table.facility-grid .grid-reset { margin-left: 6px; padding: 2px 8px; font-size: 11px; }
table.facility-grid .grid-row-dirty .grid-sticky-col:not(:focus-within) { box-shadow: inset 4px 0 0 var(--fg-3); }

/* Column headers: draggable, with keyboard move buttons. */
table.facility-grid th.grid-col-head { cursor: grab; user-select: none; }
table.facility-grid th.grid-dragging { opacity: .5; }
table.facility-grid th.grid-drop-before { box-shadow: inset 3px 0 0 var(--accent); }
table.facility-grid th.grid-drop-after { box-shadow: inset -3px 0 0 var(--accent); }
.grid-col-label { margin-right: 6px; }
.grid-col-move {
  border: 1px solid transparent; background: none; color: var(--fg-3); cursor: pointer;
  font-size: 10px; line-height: 1; padding: 3px 4px; border-radius: var(--radius-sm);
}
.grid-col-move:hover:not(:disabled), .grid-col-move:focus-visible { color: var(--accent-hover); border-color: var(--accent); }
.grid-col-move:disabled { opacity: .3; cursor: default; }

/* Columns menu. */
.grid-colmenu-wrap { position: relative; }
.grid-colmenu {
  position: absolute; top: 100%; left: 0; z-index: 20; margin-top: 6px; min-width: 280px;
  max-height: 60vh; overflow: auto; padding: 10px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md); box-shadow: var(--shadow-3);
}
.grid-colmenu[hidden], .grid-hidden-dirty[hidden] { display: none; }
.grid-colmenu-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.grid-colmenu-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 13px; }
.grid-colmenu-label { display: flex; align-items: center; gap: 4px; flex: 1; cursor: pointer; }
.grid-colmenu-flag, .grid-colmenu-note, .grid-hidden-dirty { color: var(--accent-hover); }
.grid-colmenu-note { margin: 8px 0 0; font-size: 12px; }
.grid-hidden-dirty { font-weight: var(--w-bold); }

/* --- Facilities page (adminConnections.ejs) ------------------------------ */

/* Page-wide filter toolbar (public/js/connectionFilter.js). */
.conn-filter { margin-bottom: 16px; }
.conn-filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 10px; }
.conn-filter-search { flex: 1 1 280px; margin-bottom: 0; }
.conn-filter-select { display: flex; flex-direction: column; gap: 6px; }
.conn-filter-select > .eyebrow { color: var(--fg-3); }
.conn-filter-select .input { flex: none; width: auto; min-width: 170px; padding: 8px 13px; font-size: 13px; }
.conn-filter-chips { align-items: center; margin-bottom: 8px; }
.conn-filter-sep { width: 1px; height: 18px; background: var(--hairline); margin: 0 4px; }
.conn-filter-status { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--fg-3); min-height: 20px; }
.conn-filter-status [hidden], .conn-filter-chips [hidden], #conn-filter-empty[hidden] { display: none; }
/* Author display rules beat [hidden], so a panel the filter empties out and
   the Clear button both need their own override. */
.panel[hidden] { display: none; }
.conn-filter-status .x[hidden] { display: none; }
/* Marker shared with tableTools.js / selectAllGroup.js. */
.connection-row[data-filtered-out] { display: none; }
.conn-change-status { margin-left: 8px; white-space: nowrap; }

/* --- Shared facility picker (partials/facilityPicker.ejs, public/js/facilityPicker.js) ---
   Reuses .conn-filter-* / .pill-filter / .search-field for the toolbar. */
.fpicker [hidden] { display: none; }
.fpicker-toolbar { margin-bottom: 12px; }
.fpicker-ui { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: start; }
.fpicker-ui[hidden] { display: none; }
.fpicker-col { border: 1px solid var(--hairline); border-radius: var(--radius-md); background: var(--surface); min-width: 0; }
.fpicker-col-head { padding: 6px 12px; border-bottom: 1px solid var(--hairline); }
.fpicker-col-head .check { padding: 2px 0; }
.fpicker-col-head .eyebrow { color: var(--fg-2); }
.fpicker-list { list-style: none; margin: 0; padding: 4px; max-height: 360px; overflow: auto; }
.fpicker-item {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px;
  cursor: pointer; color: var(--fg); font-size: 13.5px; user-select: none;
}
.fpicker-item:hover { background: var(--hairline); }
.fpicker-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fpicker-item.is-selected { background: var(--hairline); box-shadow: inset 3px 0 0 var(--accent); }
.fpicker-box {
  flex: none; width: 14px; height: 14px; border: 1.5px solid var(--fg-3); border-radius: 3px;
}
.fpicker-item.is-selected .fpicker-box { background: var(--accent); border-color: var(--accent); }
.fpicker-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fpicker-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpicker-meta { font-size: 11.5px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpicker-tag { flex: none; }
.fpicker-empty { padding: 14px 8px; color: var(--fg-3); font-size: 13px; }
.fpicker-actions { display: flex; flex-direction: column; gap: 8px; align-self: center; }
.fpicker-summary-row { display: flex; align-items: center; gap: 14px; margin-top: 12px; min-height: 20px; }
.fpicker-summary { font-size: 12.5px; color: var(--fg-3); }
.fpicker-summary.has-changes { color: var(--fg); font-weight: var(--w-bold); }
@media (max-width: 760px) {
  .fpicker-ui { grid-template-columns: 1fr; }
  .fpicker-actions { flex-direction: row; justify-content: center; }
}

/* "Who has access" views (admin user page effective access, facility panel,
   group list counts). Tokens only, so the dark theme follows. */
.access-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.access-toolbar .search-field { margin: 0; flex: 1 1 220px; }
.access-row { align-items: flex-start; }
.access-row .access-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.access-why { font-size: 12.5px; color: var(--fg-3); }
.access-why a { color: var(--accent); }
.access-note { font-size: 12.5px; color: var(--fg-3); margin: 10px 0 0; }
.access-count { font-variant-numeric: tabular-nums; }
.access-empty[hidden] { display: none; }

/* Async user typeahead (public/js/userPicker.js). */
.upicker { position: relative; }
.upicker-results {
  list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; left: 0; right: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md);
  max-height: 280px; overflow: auto;
}
.upicker-results[hidden], [data-upicker-submit][hidden], [data-upicker-fallback][hidden] { display: none; }
.upicker-option { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--fg); }
.upicker-option small { display: block; font-size: 11.5px; color: var(--fg-3); }
.upicker-option.is-active, .upicker-option:hover { background: var(--hairline); }
.upicker-note { padding: 8px 10px; font-size: 12.5px; color: var(--fg-3); }
.upicker-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.upicker-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; font-size: 12.5px;
  border: 1px solid var(--hairline); border-radius: var(--radius-pill); background: var(--surface); color: var(--fg);
}
.upicker-chip .x { padding: 0 6px; }

/* Result banners: compact, with a dismiss button in the corner. */
.notice-dismissible { position: relative; padding: 8px 38px 8px 14px; margin-bottom: 10px; }
.notice-dismiss {
  position: absolute; top: 4px; right: 8px; background: none; border: 0; color: inherit;
  font-size: 20px; line-height: 1; cursor: pointer; opacity: .7; padding: 2px 6px;
}
.notice-dismiss:hover { opacity: 1; }
.notice-compact { padding: 8px 14px; margin-bottom: 10px; }
.notice-compact > summary { cursor: pointer; }

/* Bulk-update / bulk-approve confirmation panels: part of the flow, so they
   must not read as just another list panel. */
.panel.confirm-panel { border: 2px solid var(--accent); box-shadow: var(--shadow-3); }
.panel.confirm-panel > .panel-head { background: var(--accent-soft); }
[data-theme="dark"] .panel.confirm-panel > .panel-head { background: rgba(167,158,245,.16); }

/* Admin dashboard hub (views/adminDashboard.ejs). Reuses .tile / .panel /
   --surface / --hairline; the only new things are the clickable attention
   tile (an <a class="tile">), its tone stripe, and the link/section grids. */
.hub-h { margin: 26px 0 10px; }
.hub-h:first-of-type { margin-top: 18px; }
a.tile.hub-attn { display: block; text-decoration: none; color: inherit; border-left: 4px solid var(--hairline); }
a.tile.hub-attn:hover, a.tile.hub-attn:focus-visible { border-color: var(--accent); }
a.tile.hub-attn.tone-danger { border-left-color: #A23A3A; }
a.tile.hub-attn.tone-warn { border-left-color: #C98A1B; }
a.tile.hub-attn.tone-info { border-left-color: var(--accent); }
.tile.hub-attn .hint { font-size: 12px; color: var(--fg-3); margin-top: 6px; }
.hub-clear { color: var(--fg-3); font-size: 13.5px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md); }
.hub-sections { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 760px) { .hub-sections { grid-template-columns: 1fr; } }
.hub-section { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: 16px 18px; }
.hub-section h4 { margin: 0; font-size: 14px; }
.hub-section .sec-desc { color: var(--fg-3); font-size: 12.5px; margin: 2px 0 10px; }
.hub-section ul { list-style: none; margin: 0; padding: 0; }
.hub-section li { padding: 6px 0; border-top: 1px solid var(--hairline); font-size: 13px; }
.hub-section li a { font-weight: var(--w-semibold); }
.hub-section li .desc { display: block; color: var(--fg-3); font-size: 12px; }
.hub-recent { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md); }
.hub-recent li { display: flex; gap: 12px; justify-content: space-between; padding: 8px 14px; font-size: 13px; border-top: 1px solid var(--hairline); }
.hub-recent li:first-child { border-top: 0; }
.hub-recent .when { color: var(--fg-3); white-space: nowrap; font-size: 12px; }

/* Home: why an active facility's Open button is disabled, or a caution on an
   openable one (lib/facilities/launchBlock.ts). */
.launch-note { margin-top: 5px; font-size: 12px; color: var(--fg-3); max-width: 46ch; }
.launch-note-blocked { color: var(--fg-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: auto; }
.btn-primary:disabled:hover { background: var(--accent); }
.btn-ghost:disabled:hover { background: var(--surface); }
