/* EntryPoint Security Console. Tabler (vendored) supplies form controls and buttons;
   this file defines the console's layout and components on shared tokens. */

:root {
  --ep-ink: #172235;
  --ep-ink-soft: #3b4a60;
  --ep-muted: #5b6b80;
  --ep-faint: #8a97a8;
  --ep-sidebar: #142034;
  --ep-sidebar-2: #0e1828;
  --ep-brand: #0b72df;
  --ep-brand-strong: #0a5fbb;
  --ep-brand-soft: #eaf3ff;
  --ep-bg: #f3f6fa;
  --ep-panel: #ffffff;
  --ep-border: #dde4ee;
  --ep-border-strong: #c8d3e1;
  --ep-row-hover: #f6f9fd;
  --ep-good: #1a7f47;
  --ep-good-soft: #e6f5ec;
  --ep-warn: #9a5b00;
  --ep-warn-soft: #fff4e0;
  --ep-bad: #c42b2b;
  --ep-bad-soft: #fdecec;
  --ep-info: #0b63c1;
  --ep-info-soft: #e8f1fd;
  --ep-neutral-soft: #eef1f5;
  --ep-radius: 12px;
  --ep-radius-sm: 8px;
  --ep-shadow: 0 1px 2px rgba(20, 32, 52, 0.06), 0 6px 20px rgba(20, 32, 52, 0.05);
  --ep-shadow-lg: 0 20px 60px rgba(14, 24, 40, 0.24);
  --ep-font: "Aptos", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ep-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body, #entrypoint-root { min-height: 100%; }
body { margin: 0; background: var(--ep-bg); color: var(--ep-ink); font-family: var(--ep-font); font-size: 15px; line-height: 1.45; }
body.has-drawer { overflow: hidden; }
button, input, select, textarea { font: inherit; }
code { font-family: var(--ep-mono); font-size: 0.88em; color: var(--ep-ink-soft); background: none; padding: 0; }
h1, h2, h3 { color: var(--ep-ink); margin: 0; }
a { color: var(--ep-brand); }
:focus-visible { outline: 2px solid var(--ep-brand); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-muted { color: var(--ep-faint) !important; }
.nowrap { white-space: nowrap; }
.hint { color: var(--ep-muted); font-size: 0.86rem; margin: 0; }
.muted-line { color: var(--ep-muted); margin: 0 0 0.75rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.85rem; }

/* ----- Buttons ----- */
.btn { border-radius: var(--ep-radius-sm); font-weight: 600; gap: 0.4rem; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; white-space: nowrap; }
.btn-sm { min-height: 32px; font-size: 0.85rem; padding-inline: 0.7rem; }
.btn .ti { font-size: 1.05em; }
.btn-ghost { background: var(--ep-panel); border: 1px solid var(--ep-border-strong); color: var(--ep-ink); }
.btn-ghost:hover { background: var(--ep-row-hover); border-color: var(--ep-faint); color: var(--ep-ink); }
.btn-ghost-danger { background: var(--ep-panel); border: 1px solid #efc3c3; color: var(--ep-bad); }
.btn-ghost-danger:hover { background: var(--ep-bad-soft); border-color: var(--ep-bad); color: var(--ep-bad); }
.btn-light { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.12); color: var(--ep-ink); }
.btn-link { font-weight: 600; min-height: auto; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn.is-armed { background: #c27605 !important; border-color: #c27605 !important; color: #fff !important; }
.icon-btn { align-items: center; background: transparent; border: 0; border-radius: var(--ep-radius-sm); color: var(--ep-muted); cursor: pointer; display: inline-flex; height: 36px; justify-content: center; width: 36px; }
.icon-btn:hover { background: var(--ep-neutral-soft); color: var(--ep-ink); }
.icon-btn--danger:hover { background: var(--ep-bad-soft); color: var(--ep-bad); }
.icon-btn .ti { font-size: 1.2rem; }

/* ----- Shell ----- */
.app-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--ep-sidebar), var(--ep-sidebar-2)); color: #d6e2f2; display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; }
.sidebar__brand { align-items: center; display: flex; gap: 0.7rem; padding: 1.1rem 1.1rem 0.9rem; }
.brand-mark { align-items: center; background: var(--ep-brand); border-radius: 10px; color: #fff; display: inline-flex; flex: none; font-size: 0.85rem; font-weight: 800; height: 36px; justify-content: center; letter-spacing: 0.04em; width: 36px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { color: #fff; font-size: 1rem; }
.brand-text span { color: #9fb3cc; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__menu { color: #d6e2f2; display: none; margin-left: auto; }
.sidebar__menu:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.sidebar__nav { display: flex; flex: 1; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; padding: 0.5rem 0.75rem 1rem; }
.nav-section { color: #7f93ad; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; padding: 1rem 0.65rem 0.35rem; text-transform: uppercase; }
.nav-link { align-items: center; border-radius: var(--ep-radius-sm); color: #d6e2f2; display: flex; gap: 0.7rem; min-height: 40px; padding: 0.5rem 0.65rem; text-decoration: none; }
.nav-link .ti { font-size: 1.15rem; opacity: 0.85; }
.nav-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-link.is-active { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 600; }
.nav-link.is-active .ti { opacity: 1; }
.sidebar__account { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 0.6rem; position: relative; }
.account-button { align-items: center; background: transparent; border: 0; border-radius: var(--ep-radius-sm); color: #d6e2f2; cursor: pointer; display: flex; gap: 0.6rem; padding: 0.5rem; text-align: left; width: 100%; }
.account-button:hover { background: rgba(255, 255, 255, 0.08); }
.account-button__text { display: flex; flex: 1; flex-direction: column; line-height: 1.2; min-width: 0; }
.account-button__text strong { color: #fff; font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button__text span { color: #9fb3cc; font-size: 0.78rem; }
.avatar { align-items: center; background: #2a3d5c; border-radius: 50%; color: #fff; display: inline-flex; flex: none; font-size: 0.78rem; font-weight: 700; height: 32px; justify-content: center; width: 32px; }
.avatar--sm { background: var(--ep-brand-soft); color: var(--ep-brand-strong); height: 28px; width: 28px; font-size: 0.72rem; }
.account-menu { background: var(--ep-panel); border: 1px solid var(--ep-border); border-radius: var(--ep-radius); bottom: calc(100% - 0.3rem); box-shadow: var(--ep-shadow-lg); left: 0.6rem; padding: 0.35rem; position: absolute; right: 0.6rem; z-index: 20; }
.account-menu button { align-items: center; background: none; border: 0; border-radius: 6px; color: var(--ep-ink); cursor: pointer; display: flex; gap: 0.6rem; min-height: 40px; padding: 0.5rem 0.65rem; text-align: left; width: 100%; }
.account-menu button:hover, .account-menu button:focus-visible { background: var(--ep-row-hover); }
.main { min-width: 0; margin: 0 auto; max-width: 1320px; padding: 1.75rem 2rem 3rem; width: 100%; }

/* ----- Page structure ----- */
.ep-page-header { align-items: flex-start; display: flex; gap: 1rem; justify-content: space-between; margin-bottom: 1.25rem; }
.ep-page-header h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.01em; }
.ep-page-header p { color: var(--ep-muted); margin: 0.3rem 0 0; max-width: 62ch; }
.ep-page-header__actions { display: flex; flex: none; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.page-tabs { border-bottom: 1px solid var(--ep-border); display: flex; gap: 1.25rem; margin: -0.25rem 0 1rem; overflow-x: auto; }
.page-tabs a { border-bottom: 2px solid transparent; color: var(--ep-muted); font-weight: 600; padding: 0.55rem 0.1rem; text-decoration: none; white-space: nowrap; }
.page-tabs a[aria-selected="true"] { border-bottom-color: var(--ep-brand); color: var(--ep-ink); }
.page-tabs a:hover { color: var(--ep-ink); }
.card-surface { background: var(--ep-panel); border: 1px solid var(--ep-border); border-radius: var(--ep-radius); box-shadow: var(--ep-shadow); margin-bottom: 1rem; overflow: hidden; }
.card-surface--highlight { border-color: #f0c77a; box-shadow: 0 0 0 3px var(--ep-warn-soft), var(--ep-shadow); }
.card-surface__head { align-items: center; display: flex; justify-content: space-between; padding: 0.9rem 1.1rem 0.4rem; }
.card-surface__head h2, .disclosure--card summary h2 { font-size: 1rem; font-weight: 700; }
.card-foot { border-top: 1px solid var(--ep-border); padding: 0.75rem 1.1rem; }

/* ----- Banners ----- */
.banner { align-items: center; border: 1px solid; border-radius: var(--ep-radius-sm); display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; padding: 0.7rem 0.9rem; }
.banner > span { flex: 1 1 18rem; }
.banner .ti { font-size: 1.15rem; }
.banner--info { background: var(--ep-info-soft); border-color: #bcd6f5; color: #0b3f7a; }
.banner--warn { background: var(--ep-warn-soft); border-color: #f3d39a; color: #6b4000; }
.banner--bad { background: var(--ep-bad-soft); border-color: #f1bcbc; color: #8b1c1c; }
.banner--good { background: var(--ep-good-soft); border-color: #b5dfc5; color: #11532f; }

/* ----- Toolbar and filters ----- */
.toolbar { align-items: center; border-bottom: 1px solid var(--ep-border); display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0.85rem 1rem; }
.toolbar__count { color: var(--ep-muted); font-size: 0.86rem; margin-left: auto; white-space: nowrap; }
.search-box { align-items: center; display: flex; flex: 1 1 18rem; max-width: 30rem; position: relative; }
.search-box .ti { color: var(--ep-faint); left: 0.7rem; pointer-events: none; position: absolute; }
.search-box input { background: var(--ep-panel); border: 1px solid var(--ep-border-strong); border-radius: var(--ep-radius-sm); min-height: 38px; padding: 0.4rem 0.75rem 0.4rem 2.1rem; width: 100%; }
.search-box input:focus { border-color: var(--ep-brand); box-shadow: 0 0 0 3px var(--ep-brand-soft); outline: none; }
.filter-select select { min-height: 38px; min-width: 10rem; }
.toggle-chip { align-items: center; border: 1px solid var(--ep-border-strong); border-radius: 999px; cursor: pointer; display: inline-flex; gap: 0.45rem; min-height: 36px; padding: 0.3rem 0.8rem; user-select: none; }
.toggle-chip input { accent-color: var(--ep-brand); margin: 0; }
.toggle-chip:has(input:checked) { background: var(--ep-brand-soft); border-color: var(--ep-brand); color: var(--ep-brand-strong); font-weight: 600; }
.toggle-chip.is-disabled { color: var(--ep-faint); cursor: default; }
.bulk-bar { align-items: center; background: var(--ep-brand-soft); border-bottom: 1px solid #bcd6f5; display: flex; gap: 0.6rem; padding: 0.55rem 1rem; }
.bulk-bar span { font-weight: 600; margin-right: auto; }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; }
.data-table th { background: #f8fafc; border-bottom: 1px solid var(--ep-border); color: var(--ep-muted); font-size: 0.8rem; font-weight: 600; padding: 0.6rem 1rem; text-align: left; white-space: nowrap; }
.data-table td { border-bottom: 1px solid #edf1f6; padding: 0.7rem 1rem; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tr[data-row] { cursor: pointer; }
.data-table tr[data-row]:hover td { background: var(--ep-row-hover); }
.data-table tr[data-row]:focus-visible { outline: 2px solid var(--ep-brand); outline-offset: -2px; }
.data-table .col-actions { text-align: right; white-space: nowrap; width: 1%; }
.data-table .col-select, .data-table .col-status { width: 1%; white-space: nowrap; }
.cell-sub { color: var(--ep-muted); display: block; font-size: 0.82rem; margin-top: 0.1rem; }
.mobile-only { display: none; }
.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.who { align-items: center; display: inline-flex; gap: 0.6rem; }
.who > .ti { color: var(--ep-muted); font-size: 1.2rem; }
.pager { align-items: center; border-top: 1px solid var(--ep-border); color: var(--ep-muted); display: flex; font-size: 0.86rem; gap: 0.75rem; justify-content: space-between; padding: 0.65rem 1rem; }
.pager:empty { display: none; }
.pager__buttons { display: flex; gap: 0.4rem; margin-left: auto; }
.matrix td, .matrix th[scope="row"] { text-align: center; }
.matrix th[scope="row"] { background: none; color: var(--ep-ink); font-size: 0.9rem; font-weight: 500; text-align: left; white-space: normal; }
.matrix .ti-check { color: var(--ep-good); font-size: 1.15rem; }

/* ----- Pills, chips, badges ----- */
.pill { align-items: center; border-radius: 999px; display: inline-flex; font-size: 0.82rem; font-weight: 600; gap: 0.4rem; line-height: 1; padding: 0.3rem 0.6rem; white-space: nowrap; }
.pill__dot { border-radius: 50%; height: 7px; width: 7px; }
.pill--good { background: var(--ep-good-soft); color: var(--ep-good); } .pill--good .pill__dot { background: var(--ep-good); }
.pill--warn { background: var(--ep-warn-soft); color: var(--ep-warn); } .pill--warn .pill__dot { background: #d98a00; }
.pill--bad { background: var(--ep-bad-soft); color: var(--ep-bad); } .pill--bad .pill__dot { background: var(--ep-bad); }
.pill--info { background: var(--ep-info-soft); color: var(--ep-info); } .pill--info .pill__dot { background: var(--ep-info); }
.pill--neutral { background: var(--ep-neutral-soft); color: var(--ep-ink-soft); } .pill--neutral .pill__dot { background: var(--ep-faint); }
.chip-row { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.chip { background: var(--ep-neutral-soft); border-radius: 6px; color: var(--ep-ink-soft); display: inline-block; font-size: 0.8rem; font-weight: 500; padding: 0.15rem 0.5rem; white-space: nowrap; }
.chip--more { background: none; border: 1px solid var(--ep-border); }
.chip--good { background: var(--ep-good-soft); color: var(--ep-good); }
.source-badge { border: 1px solid #c9d8ec; border-radius: 6px; color: #3d5a80; display: inline-block; font-size: 0.76rem; font-weight: 600; padding: 0.1rem 0.45rem; white-space: nowrap; }

/* ----- Empty, loading, errors ----- */
.empty { align-items: center; color: var(--ep-muted); display: flex; flex-direction: column; gap: 0.4rem; padding: 2.75rem 1.5rem; text-align: center; }
.empty strong { color: var(--ep-ink); font-size: 1rem; }
.empty .btn { margin-top: 0.5rem; }
.loading { display: grid; gap: 0.7rem; padding: 1.25rem; }
.loading__line { animation: ep-pulse 1.2s ease-in-out infinite; background: linear-gradient(90deg, #eef2f7, #f7f9fc, #eef2f7); background-size: 200% 100%; border-radius: 6px; display: block; height: 14px; }
.loading__line:nth-child(3n) { width: 70%; }
.loading__line:nth-child(3n + 2) { width: 88%; }
@keyframes ep-pulse { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.form-error { background: var(--ep-bad-soft); border-radius: var(--ep-radius-sm); color: var(--ep-bad); font-weight: 600; margin: 0; padding: 0.55rem 0.75rem; }

/* ----- Drawer ----- */
.drawer { inset: 0; pointer-events: none; position: fixed; z-index: 40; }
.drawer__backdrop { background: rgba(14, 24, 40, 0.38); inset: 0; opacity: 0; position: absolute; transition: opacity 0.18s ease; }
.drawer__panel { background: var(--ep-bg); bottom: 0; box-shadow: var(--ep-shadow-lg); display: flex; flex-direction: column; max-width: 100%; outline: none; position: absolute; right: 0; top: 0; transform: translateX(100%); transition: transform 0.2s ease, visibility 0.2s; visibility: hidden; width: 580px; }
.drawer--wide .drawer__panel { width: 780px; }
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; visibility: visible; }
.drawer__header { align-items: flex-start; background: var(--ep-panel); border-bottom: 1px solid var(--ep-border); display: flex; gap: 0.5rem; padding: 1rem 1rem 0.9rem 1.25rem; }
.drawer__heading { flex: 1; min-width: 0; }
.drawer__heading h2 { font-size: 1.2rem; font-weight: 700; overflow-wrap: anywhere; }
.drawer__subtitle { align-items: center; color: var(--ep-muted); display: flex; flex-wrap: wrap; font-size: 0.88rem; gap: 0.5rem; margin-top: 0.3rem; }
.drawer__subtitle:empty { display: none; }
.drawer__back { margin-left: -0.4rem; }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1.1rem 1.25rem 1.5rem; }
.drawer__body > .tabs { background: var(--ep-panel); margin: -1.1rem -1.25rem 1.1rem; padding: 0 1.25rem; position: sticky; top: -1.1rem; z-index: 3; }
.tabs { border-bottom: 1px solid var(--ep-border); display: flex; gap: 1.3rem; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ep-muted); cursor: pointer; font-weight: 600; padding: 0.7rem 0.1rem; white-space: nowrap; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--ep-brand); color: var(--ep-ink); }
.tabs button:hover { color: var(--ep-ink); }
.tabs__count, .page-tabs .tabs__count { background: var(--ep-neutral-soft); border-radius: 999px; color: var(--ep-muted); font-size: 0.75rem; margin-left: 0.25rem; padding: 0.05rem 0.45rem; }
.tab-panel { display: grid; gap: 1rem; }
.tab-panel[hidden] { display: none; }

/* ----- Sections, facts, forms ----- */
.panel-section { background: var(--ep-panel); border: 1px solid var(--ep-border); border-radius: var(--ep-radius); padding: 1rem 1.1rem; }
.stack > .panel-section, .tab-panel > .panel-section { margin: 0; }
.panel-section__head { align-items: flex-start; display: flex; gap: 0.75rem; justify-content: space-between; margin-bottom: 0.75rem; }
.panel-section__head h3 { font-size: 0.98rem; font-weight: 700; }
.panel-section__head p { color: var(--ep-muted); font-size: 0.86rem; margin: 0.2rem 0 0; }
.panel-section__actions { display: flex; flex: none; gap: 0.4rem; }
.panel-section .table-wrap { border: 1px solid var(--ep-border); border-radius: var(--ep-radius-sm); }
.panel-section .empty { padding: 1.5rem 1rem; }
.facts { display: grid; gap: 0.8rem 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.facts dt { color: var(--ep-muted); font-size: 0.8rem; font-weight: 600; margin-bottom: 0.15rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts--single { grid-template-columns: 1fr; }
.stack { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.3rem; margin: 0; min-width: 0; }
.field > span, .field > legend { color: var(--ep-ink-soft); font-size: 0.86rem; font-weight: 600; margin: 0; padding: 0; }
.field > small, .check small { color: var(--ep-muted); font-size: 0.8rem; }
fieldset.field { border: 0; min-width: 0; padding: 0; }
.field[hidden] { display: none; }
.field--inline { align-items: center; display: inline-flex; gap: 0.4rem; }
.field--inline input { min-height: 38px; width: auto; }
.form-control, .form-select { border-color: var(--ep-border-strong); border-radius: var(--ep-radius-sm); min-height: 40px; }
.form-control:focus, .form-select:focus { border-color: var(--ep-brand); box-shadow: 0 0 0 3px var(--ep-brand-soft); }
.form-grid { display: grid; gap: 0.9rem 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid--nested { grid-column: 1 / -1; }
.inline-value { align-items: center; display: flex; gap: 0.5rem; min-height: 40px; }
.check { align-items: flex-start; cursor: pointer; display: grid; gap: 0.1rem 0.55rem; grid-template-columns: auto 1fr; margin: 0; }
.check input { margin-top: 0.2rem; }
.check small { grid-column: 2; }
.check-list { display: grid; gap: 0.5rem; }
.choices { display: grid; gap: 0.5rem; }
.choice { align-items: flex-start; border: 1px solid var(--ep-border-strong); border-radius: var(--ep-radius-sm); cursor: pointer; display: flex; gap: 0.7rem; padding: 0.75rem 0.85rem; }
.choice input { accent-color: var(--ep-brand); margin-top: 0.25rem; }
.choice span { display: grid; gap: 0.15rem; }
.choice small { color: var(--ep-muted); }
.choice:has(input:checked) { background: var(--ep-brand-soft); border-color: var(--ep-brand); }
.choice:has(input:disabled) { cursor: default; opacity: 0.6; }
.segmented { background: var(--ep-neutral-soft); border-radius: var(--ep-radius-sm); display: inline-flex; gap: 2px; margin-bottom: 0.6rem; padding: 3px; width: fit-content; }
.segmented label { cursor: pointer; margin: 0; }
.segmented input { opacity: 0; position: absolute; }
.segmented span { border-radius: 6px; color: var(--ep-muted); display: block; font-weight: 600; padding: 0.35rem 0.9rem; }
.segmented input:checked + span { background: var(--ep-panel); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); color: var(--ep-ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--ep-brand); }
.form-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.form-actions--start { justify-content: flex-start; }
.sticky-actions { background: linear-gradient(transparent, var(--ep-bg) 30%); bottom: -1.5rem; margin: 0 -1.25rem -1.5rem; padding: 1rem 1.25rem 1.25rem; position: sticky; z-index: 2; }
/* A section after a form with sticky actions clears their negative bottom margin. */
form:has(> .sticky-actions) + .panel-section { margin-top: 2.5rem; }
.me-auto { margin-right: auto; }
.quick-dates { align-items: center; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.quick-dates .hint { margin-left: 0.3rem; }
.disclosure > summary { color: var(--ep-ink-soft); cursor: pointer; font-weight: 600; padding: 0.3rem 0; }
.disclosure--card > summary { align-items: center; display: flex; gap: 0.6rem; list-style: none; padding: 0.9rem 1.1rem; }
.disclosure--card > summary::before { content: "›"; display: inline-block; font-size: 1.2rem; transition: transform 0.15s; }
.disclosure--card[open] > summary::before { transform: rotate(90deg); }
.disclosure .table-wrap { margin-top: 0.6rem; }

/* ----- Checklists and option lists ----- */
.checklist { border: 1px solid var(--ep-border-strong); border-radius: var(--ep-radius-sm); overflow: hidden; }
.checklist__tools { align-items: center; background: #f8fafc; border-bottom: 1px solid var(--ep-border); display: flex; gap: 0.6rem; padding: 0.5rem; }
.checklist__tools .search-box { max-width: none; }
.checklist__count { color: var(--ep-muted); font-size: 0.8rem; white-space: nowrap; }
.checklist__list { max-height: 18rem; overflow-y: auto; }
.checklist__row { align-items: flex-start; border-bottom: 1px solid #f0f3f7; cursor: pointer; display: flex; gap: 0.6rem; margin: 0; padding: 0.55rem 0.75rem; }
.checklist__row:last-child { border-bottom: 0; }
.checklist__row:hover { background: var(--ep-row-hover); }
.checklist__row input { margin-top: 0.2rem; }
.checklist__row small { color: var(--ep-muted); display: block; font-size: 0.8rem; }
.checklist__row[hidden] { display: none; }
.checklist__empty { color: var(--ep-muted); padding: 1rem; }
.option-list { border: 1px solid var(--ep-border-strong); border-radius: var(--ep-radius-sm); max-height: 20rem; overflow-y: auto; }
.option { align-items: center; border-bottom: 1px solid #f0f3f7; cursor: pointer; display: flex; gap: 0.7rem; margin: 0; padding: 0.6rem 0.8rem; }
.option span { display: grid; }
.option small { color: var(--ep-muted); }
.option:has(input:checked) { background: var(--ep-brand-soft); }
.option-list .hint { padding: 0.75rem; }
.plain-list { display: grid; gap: 0.35rem; list-style: none; margin: 0.75rem 0 0; max-height: 22rem; overflow-y: auto; padding: 0; }
.plain-list li { align-items: center; display: flex; gap: 0.75rem; justify-content: space-between; }
.plain-list li[hidden] { display: none; }
.demo-door__status { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.9rem; }
.demo-door__camera { max-width: 28rem; }
.demo-door__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.dialog-actions__note { align-items: center; display: inline-flex; margin-right: auto; }
.dialog-actions [data-card-off] { margin-right: auto; }
.local-desk-list li { align-items: center; display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; justify-content: flex-start; }
.local-desk-list li small { color: var(--ep-muted); flex-basis: 100%; }
.plain-list--rows li { border-bottom: 1px solid #f0f3f7; padding: 0.35rem 0; }
.summary-line { background: var(--ep-panel); border: 1px solid var(--ep-border); border-radius: var(--ep-radius); padding: 0.8rem 1rem; }

/* ----- Entry and person specifics ----- */
.action-card { align-items: center; background: var(--ep-panel); border: 1px solid var(--ep-border); border-radius: var(--ep-radius); display: flex; gap: 1rem; justify-content: space-between; padding: 0.9rem 1.1rem; }
.action-card div { display: grid; gap: 0.15rem; }
.action-card span { color: var(--ep-muted); font-size: 0.88rem; }
.card-list { display: grid; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.card-item { align-items: center; border: 1px solid var(--ep-border); border-radius: var(--ep-radius-sm); display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; padding: 0.7rem 0.85rem; }
.card-item__side { align-items: center; display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ----- Schedule grid ----- */
.sgrid { border: 1px solid var(--ep-border-strong); border-radius: var(--ep-radius-sm); overflow-x: auto; padding: 0.5rem; touch-action: none; user-select: none; }
.sgrid__hours, .sgrid__row { display: grid; grid-template-columns: 2.6rem repeat(96, minmax(4px, 1fr)); min-width: 560px; }
.sgrid__hours span { color: var(--ep-muted); font-size: 0.7rem; grid-column: span 4; white-space: nowrap; }
.sgrid__hours span:first-child { grid-column: span 1; }
.sgrid__day { color: var(--ep-ink-soft); font-size: 0.8rem; font-weight: 600; line-height: 26px; }
.sgrid__cell { background: #f1f4f8; border: 0; border-left: 1px solid #fff; cursor: pointer; height: 26px; margin: 1px 0; padding: 0; }
.sgrid__cell.is-hour { border-left-color: #d9e1ec; }
.sgrid__cell.is-on { background: var(--ep-brand); }
.sgrid__cell:disabled { cursor: default; }
.sgrid__cell:focus-visible { outline: 2px solid var(--ep-ink); outline-offset: 0; position: relative; z-index: 1; }

/* ----- Audit ----- */
.audit { display: grid; gap: 0; }
.audit__filter-card { padding: 1rem; }
.audit__filters { align-items: end; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.audit__filters > .search-box { flex-basis: 100%; max-width: none; }
.audit__presets { align-items: center; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.audit__more { flex-basis: 100%; }
.audit__submit { display: flex; gap: 0.5rem; margin-left: auto; }
.audit--compact .audit__filter-card { box-shadow: none; }
.raw { background: #0f1b2d; border-radius: var(--ep-radius-sm); color: #d9e6f7; font-family: var(--ep-mono); font-size: 0.8rem; max-height: 20rem; overflow: auto; padding: 0.8rem; }

/* ----- Operations ----- */
.op-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.op { align-items: center; border: 1px solid var(--ep-border); border-radius: var(--ep-radius-sm); display: flex; gap: 0.75rem; justify-content: space-between; padding: 0.75rem 0.9rem; }
.op div { display: grid; }
.op span { color: var(--ep-muted); font-size: 0.85rem; }

/* ----- Dialogs and toasts ----- */
.ep-dialog { background: var(--ep-panel); border: 0; border-radius: 14px; box-shadow: var(--ep-shadow-lg); color: var(--ep-ink); max-height: 88vh; max-width: min(460px, calc(100vw - 2rem)); padding: 0; width: 100%; }
.ep-dialog--wide { max-width: min(720px, calc(100vw - 2rem)); }
.ep-dialog::backdrop { background: rgba(14, 24, 40, 0.45); }
.ep-dialog__body { display: grid; gap: 0.9rem; padding: 1.3rem 1.4rem; }
.ep-dialog__head { align-items: center; display: flex; justify-content: space-between; }
.ep-dialog__title { font-size: 1.15rem; font-weight: 700; }
.ep-dialog__text p { color: var(--ep-ink-soft); margin: 0; }
.ep-dialog__actions, .dialog-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.ep-dialog .facts { grid-template-columns: 1fr 1fr; }
.toast-stack { bottom: 1.25rem; display: grid; gap: 0.5rem; left: 50%; max-width: calc(100vw - 2rem); position: fixed; transform: translateX(-50%); width: max-content; z-index: 60; }
.toast-card { align-items: center; animation: ep-toast 0.2s ease-out; background: #14233a; border-radius: 10px; box-shadow: var(--ep-shadow-lg); color: #fff; display: flex; gap: 0.6rem; max-width: 34rem; padding: 0.75rem 1rem; }
.toast-card .ti { color: #6fd39b; font-size: 1.2rem; }
.toast-card.is-error { background: #7d1d1d; }
.toast-card.is-error .ti { color: #ffc2c2; }
@keyframes ep-toast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ----- Sign in ----- */
.auth { align-items: center; background: linear-gradient(160deg, #0f1c30, #16345c 60%, #0b72df); display: flex; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.auth__card { background: var(--ep-panel); border-radius: 16px; box-shadow: var(--ep-shadow-lg); display: grid; gap: 1.1rem; max-width: 400px; padding: 2rem; width: 100%; }
.auth__brand { align-items: center; display: flex; gap: 0.7rem; }
.auth__brand div { display: grid; line-height: 1.2; }
.auth__brand span { color: var(--ep-muted); font-size: 0.85rem; }
.auth__card h1 { font-size: 1.35rem; }
.auth .banner { margin: 0; }

/* ----- Responsive ----- */
@media (max-width: 1100px) {
  .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: sticky; top: 0; z-index: 30; }
  .sidebar__brand { padding: 0.6rem 0.75rem; }
  .sidebar__menu { display: inline-flex; }
  .sidebar__nav, .sidebar__account { display: none; }
  .sidebar.is-open .sidebar__nav, .sidebar.is-open .sidebar__account { display: flex; }
  .sidebar.is-open .sidebar__account { display: block; }
  .sidebar.is-open .sidebar__nav { max-height: calc(100vh - 8rem); }
  .main { padding: 1.1rem 1rem 2.5rem; }
  .drawer__panel, .drawer--wide .drawer__panel { width: 100%; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .ep-page-header { flex-direction: column; }
  .ep-page-header__actions { justify-content: flex-start; width: 100%; }
  .ep-page-header__actions .btn { flex: 1 1 auto; }
  .col-optional { display: none; }
  .mobile-only { display: block; }
  .form-grid, .form-grid--3, .form-grid--4, .facts, .op-grid { grid-template-columns: 1fr; }
  .toolbar { padding: 0.75rem; }
  .search-box { flex-basis: 100%; max-width: none; }
  .filter-select { flex: 1 1 45%; }
  .filter-select select { min-width: 0; width: 100%; }
  .toolbar__count { margin-left: 0; }
  .data-table th, .data-table td { padding: 0.65rem 0.5rem; }
  .action-card { align-items: stretch; flex-direction: column; }
  .audit__submit { margin-left: 0; }
  .drawer__body { padding: 1rem; }
  .drawer__body > .tabs { margin: -1rem -1rem 1rem; padding: 0 1rem; top: -1rem; }
  .sticky-actions { margin: 0 -1rem -1.5rem; padding-inline: 1rem; }
  .ep-dialog .facts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Grid and flex children must be allowed to shrink so wide tables scroll inside their
   own container instead of widening the page or drawer. */
.tab-panel > *, .stack > *, .audit > *, .panel-section, .card-surface, .form-grid > * { min-width: 0; }
@media (max-width: 720px) {
  .data-table .col-select { display: none; }
  .audit__filters .field--inline { flex: 1 1 40%; }
  .audit__filters .field--inline input { min-width: 0; width: 100%; }
  .audit__presets { width: 100%; }
  .panel-section { padding: 0.85rem; }
  .panel-section__head { flex-wrap: wrap; }
}

.ep-dialog--xl { max-width: min(1080px, calc(100vw - 2rem)); }
.matrix th[scope="row"] { min-width: 13rem; }
@media (max-width: 720px) {
  [data-unlock] .btn-label { display: none; }
  [data-unlock] { padding-inline: 0.55rem; }
  .data-table .col-actions { padding-left: 0.25rem; }
}
.form-grid { align-items: start; }
@media (max-width: 720px) { .data-table .pill { white-space: normal; line-height: 1.2; } }

/* ----- Help ----- */
.nav-link--help { color: #b9c9de; margin-bottom: 0.25rem; }
.help-layout { align-items: start; display: grid; gap: 1rem; grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr); }
.help-index { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; margin: 0; }
.help-index__search { border-bottom: 1px solid var(--ep-border); padding: 0.75rem; }
.help-index__search .search-box { max-width: none; }
.help-index__list { overflow-y: auto; padding: 0.4rem 0.5rem 1rem; }
.help-group h3 { color: var(--ep-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; margin: 0.9rem 0.5rem 0.3rem; text-transform: uppercase; }
.subhead { color: var(--ep-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; margin: 1rem 0 0.4rem; text-transform: uppercase; }
.help-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.help-group a { align-items: center; border-radius: 6px; color: var(--ep-ink-soft); display: flex; gap: 0.4rem; font-size: 0.92rem; line-height: 1.3; padding: 0.45rem 0.5rem; text-decoration: none; }
.help-group a:hover { background: var(--ep-row-hover); color: var(--ep-ink); }
.help-group a[aria-current="true"] { background: var(--ep-brand-soft); color: var(--ep-brand-strong); font-weight: 600; }
.help-group a .ti { color: var(--ep-faint); flex: none; }
.help-empty { color: var(--ep-muted); padding: 1rem 0.5rem; margin: 0; }
.help-reader { margin: 0; padding: 1.6rem 1.8rem 1.8rem; min-height: 20rem; }
.help-article { display: grid; gap: 0.9rem; max-width: 46rem; }
.help-article h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; outline: none; }
.help-article h4 { font-size: 0.9rem; font-weight: 700; margin: 0.4rem 0 0; }
.help-summary { color: var(--ep-ink-soft); font-size: 1.02rem; margin: 0; }
.help-steps { counter-reset: help; display: grid; gap: 0.65rem; list-style: none; margin: 0.2rem 0 0; padding: 0; }
.help-steps li { counter-increment: help; line-height: 1.55; padding-left: 2.3rem; position: relative; }
.help-steps li::before { align-items: center; background: var(--ep-sidebar); border-radius: 50%; color: #fff; content: counter(help); display: flex; font-size: 0.78rem; font-weight: 700; height: 1.6rem; justify-content: center; left: 0; position: absolute; top: 0; width: 1.6rem; }
.help-list { display: grid; gap: 0.5rem; margin: 0.2rem 0 0; padding-left: 1.2rem; line-height: 1.55; }
.help-list li::marker { color: var(--ep-brand); }
.help-ui { color: var(--ep-ink); font-weight: 650; }
.help-key { background: var(--ep-panel); border: 1px solid var(--ep-border-strong); border-bottom-width: 2px; border-radius: 6px; color: var(--ep-ink); font-size: 0.88em; font-weight: 650; padding: 0 0.4rem; white-space: nowrap; }
.help-key--primary { background: var(--ep-brand); border-color: var(--ep-brand-strong); color: #fff; }
.help-note { align-items: flex-start; background: var(--ep-info-soft); border-radius: var(--ep-radius-sm); color: #0b3f7a; display: flex; gap: 0.5rem; margin: 0; padding: 0.6rem 0.8rem; font-size: 0.93rem; }
.help-note .ti { flex: none; margin-top: 0.15rem; }
.help-can, .help-cannot { display: grid; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.help-can li, .help-cannot li { align-items: center; display: flex; gap: 0.5rem; }
.help-can .ti { color: var(--ep-good); }
.help-cannot li { color: var(--ep-muted); }
.help-actions { align-items: center; border-top: 1px solid var(--ep-border); display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; margin-top: 0.4rem; padding-top: 0.9rem; }
.help-related { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; font-size: 0.9rem; }
.help-related > span { color: var(--ep-muted); }
.help-card { background: var(--ep-panel); border: 1px solid var(--ep-border); border-radius: var(--ep-radius); padding: 0; }
.help-card > summary { align-items: center; cursor: pointer; display: flex; font-weight: 650; gap: 0.5rem; list-style: none; padding: 0.85rem 1rem; }
.help-card > summary::-webkit-details-marker { display: none; }
.help-card > summary::after { color: var(--ep-faint); content: "+"; font-size: 1.2rem; margin-left: auto; }
.help-card[open] > summary::after { content: "–"; }
.help-card > .help-article { border-top: 1px solid var(--ep-border); padding: 0.9rem 1rem 1rem; }
@media (max-width: 960px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-index { position: static; max-height: 22rem; }
  .help-reader { padding: 1.2rem; }
}
.help-glyph { align-items: center; border: 1.6px solid currentColor; border-radius: 50%; display: inline-flex; flex: none; font-size: 0.72rem; font-weight: 800; height: 1.1rem; justify-content: center; line-height: 1; width: 1.1rem; }
.help-glyph--sm { color: var(--ep-faint); font-size: 0.62rem; height: 0.95rem; width: 0.95rem; }
.nav-link .help-glyph { opacity: 0.85; }

/* Schedule names that open a popover with the schedule's days and times */
.sched-link { background: none; border: 0; padding: 0; color: var(--ep-brand); font: inherit; text-align: left; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.sched-link:hover, .sched-link[aria-expanded="true"] { color: var(--ep-brand-strong); text-decoration-style: solid; }
.sched-link:focus-visible { outline: 2px solid var(--ep-brand); outline-offset: 2px; border-radius: 3px; }
.sched-sep { color: var(--ep-muted); }
.ep-popover { position: fixed; z-index: 1200; width: min(320px, calc(100vw - 16px)); max-height: min(420px, calc(100vh - 16px)); overflow: auto; background: var(--ep-panel); color: var(--ep-ink); border: 1px solid var(--ep-border); border-radius: var(--ep-radius-sm); box-shadow: var(--ep-shadow-lg); padding: 0.85rem 1rem; font-size: 0.9rem; }
.ep-popover__head { display: flex; flex-direction: column; gap: 0.1rem; margin-bottom: 0.6rem; }
.ep-popover__head span { color: var(--ep-muted); font-size: 0.78rem; }
.sched-week { width: 100%; border-collapse: collapse; }
.sched-week th { width: 3.2rem; text-align: left; font-weight: 600; color: var(--ep-ink-soft); padding: 0.28rem 0; vertical-align: top; }
.sched-week td { padding: 0.28rem 0; font-variant-numeric: tabular-nums; }
.sched-week tr + tr th, .sched-week tr + tr td { border-top: 1px solid var(--ep-border); }
.sched-week tr.is-closed td, .sched-week tr.is-closed th { color: var(--ep-faint); font-weight: 400; }
.ep-popover__extra { margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px solid var(--ep-border); }
.ep-popover__extra > span { display: block; color: var(--ep-muted); font-size: 0.78rem; font-weight: 600; margin-bottom: 0.2rem; }

/* Scale: pickers, grouped tables, and long lists */
.picked { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.chip--pick { align-items: center; display: inline-flex; gap: 0.25rem; padding-right: 0.2rem; }
.chip--pick button { background: none; border: 0; border-radius: 999px; color: var(--ep-muted); cursor: pointer; display: inline-flex; padding: 0.1rem; }
.chip--pick button:hover { background: var(--ep-border); color: var(--ep-ink); }
.option.is-disabled { cursor: default; opacity: 0.6; }
.choices--scroll { max-height: 16rem; overflow: auto; }
.data-table tr.row-group th { background: var(--ep-bg); color: var(--ep-ink-soft); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; padding: 0.45rem 1rem; text-align: left; text-transform: none; }
.data-table tr.row-group th span { color: var(--ep-muted); font-weight: 500; margin-left: 0.4rem; }
.toolbar--inline { align-items: center; border-bottom: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.75rem; padding: 0; }
.option-list > .hint { margin: 0; padding: 0.7rem 0.8rem; }
.toolbar--inline .search-box { flex: 1 1 14rem; min-width: 0; }
.list-more { display: block; margin: 0.6rem auto 0; }
.inline-more { display: inline; }
.inline-more summary { color: var(--ep-brand); cursor: pointer; display: inline; list-style: none; }
.inline-more summary::-webkit-details-marker { display: none; }
.inline-more[open] summary { display: none; }
.card-surface [data-long-list] > .toolbar--inline { padding: 0 1rem; }

/* Annotated help screenshots */
.help-shot { margin: 1rem 0 1.1rem; }
.help-shot__frame { background: var(--ep-panel); border: 1px solid var(--ep-border); border-radius: var(--ep-radius-sm); box-shadow: var(--ep-shadow); cursor: zoom-in; display: block; padding: 0; position: relative; width: 100%; }
div.help-shot__frame { cursor: default; }
.help-shot__frame:focus-visible { outline: 3px solid var(--ep-brand); outline-offset: 2px; }
.help-shot__frame img { border-radius: calc(var(--ep-radius-sm) - 1px); display: block; height: auto; width: 100%; }
.help-shot__box { border: 2px solid #e8590c; border-radius: 6px; box-shadow: 0 0 0 3px rgba(232, 89, 12, 0.18); pointer-events: none; position: absolute; }
.help-shot__num, .help-shot__legend li::before { align-items: center; background: #e8590c; border-radius: 999px; color: #fff; display: inline-flex; font-size: 0.72rem; font-weight: 700; height: 1.35rem; justify-content: center; min-width: 1.35rem; }
.help-shot__num { box-shadow: 0 0 0 2px #fff; pointer-events: none; position: absolute; transform: translate(-45%, -45%); }
.help-shot__legend { counter-reset: shot; display: grid; gap: 0.35rem; list-style: none; margin: 0.7rem 0 0; padding: 0; }
.help-shot__legend li { align-items: baseline; counter-increment: shot; display: flex; gap: 0.5rem; }
.help-shot__legend li::before { content: counter(shot); flex: none; }
.ep-dialog--xl .help-shot__frame { box-shadow: none; }

/* First sign-in walkthrough */
.ep-dialog--welcome { max-width: min(760px, calc(100vw - 2rem)); }
.welcome__slide { min-height: 22rem; }
.welcome .help-shot { margin: 0 0 1rem; }
.welcome .help-shot__frame { background: var(--ep-bg); cursor: default; height: min(44vh, 400px); margin: 0 auto; max-width: 100%; width: auto; }
.welcome .help-shot__frame img { height: 100%; object-fit: contain; }
.welcome .help-shot__box, .welcome .help-shot__num, .welcome .help-shot figcaption { display: none; }
.welcome__text p { font-size: 1rem; line-height: 1.55; margin: 0 0 0.6rem; }
.welcome__text kbd { background: var(--ep-neutral-soft); border: 1px solid var(--ep-border-strong); border-radius: 4px; font-size: 0.85em; padding: 0 0.35em; }
.welcome__footer { align-items: center; border-top: 1px solid var(--ep-border); display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; margin-top: 1rem; padding-top: 1rem; }
.welcome__dots { display: flex; gap: 0.4rem; }
.welcome__dots button { background: var(--ep-border-strong); border: 0; border-radius: 999px; cursor: pointer; height: 0.55rem; padding: 0; width: 0.55rem; }
.welcome__dots button.is-current { background: var(--ep-brand); width: 1.4rem; }
.welcome__buttons { display: flex; gap: 0.5rem; margin-left: auto; }
@media (max-width: 560px) {
  .welcome__slide { min-height: 0; }
  .welcome .help-shot__frame { height: auto; width: 100%; }
}

/* "Can they get in?" name check on an entry */
.who-check { display: grid; gap: 0.6rem; }
.who-check .search-box { max-width: 30rem; }
.who-check__list { display: grid; gap: 0.1rem; list-style: none; margin: 0; padding: 0; }
.who-check__list li { align-items: baseline; border-bottom: 1px solid var(--ep-border); display: grid; gap: 0.15rem 0.6rem; grid-template-columns: auto minmax(0, 1fr); padding: 0.45rem 0; }
.who-check__list li:last-child { border-bottom: 0; }
.who-check__list li .text-muted { font-size: 0.85rem; grid-column: 2; }

/* Step-by-step progress (Genetec import) */
.progress-steps { display: grid; gap: 0.45rem; list-style: none; margin: 0.75rem 0 1rem; padding: 0; }
.progress-steps li { align-items: center; color: var(--ep-faint); display: flex; gap: 0.55rem; }
.progress-steps li::before { background: var(--ep-border-strong); border-radius: 999px; content: ""; flex: none; height: 0.7rem; width: 0.7rem; }
.progress-steps li.is-done { color: var(--ep-ink-soft); }
.progress-steps li.is-done::before { background: var(--ep-good); }
.progress-steps li.is-current { color: var(--ep-ink); font-weight: 600; }
.progress-steps li.is-current::before { animation: step-pulse 1.2s ease-in-out infinite; background: var(--ep-brand); }
@keyframes step-pulse { 50% { box-shadow: 0 0 0 5px var(--ep-brand-soft); } }
@media (prefers-reduced-motion: reduce) { .progress-steps li.is-current::before { animation: none; } }

/* A new release is available */
.release-banner { align-items: center; background: var(--ep-ink); border-radius: var(--ep-radius); bottom: 1.25rem; box-shadow: var(--ep-shadow-lg); color: #fff; display: flex; gap: 0.75rem; left: 50%; max-width: calc(100vw - 2rem); padding: 0.6rem 0.7rem 0.6rem 1rem; position: fixed; transform: translateX(-50%); z-index: 70; }
.release-banner span { font-size: 0.92rem; }

/* Platform accounts */
.chip--info { background: var(--ep-info-soft); color: var(--ep-info); }
.sort-button { align-items: center; background: none; border: 0; color: inherit; cursor: pointer; display: inline-flex; font: inherit; gap: 0.2rem; letter-spacing: inherit; padding: 0; text-transform: inherit; }
.sort-button:hover { color: var(--ep-ink); }
.sort-button:focus-visible { outline: 2px solid var(--ep-brand); outline-offset: 2px; border-radius: 3px; }
.filter-select--search input { min-height: 38px; min-width: 14rem; }

/* Converting doors from Genetec */
.cutover-summary { align-items: center; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.6rem; }
.cutover-summary span:last-child { color: var(--ep-muted); font-size: 0.9rem; }
.progress-bar { background: var(--ep-neutral-soft); border-radius: 999px; height: 0.5rem; margin-bottom: 1rem; overflow: hidden; }
.progress-bar span { background: var(--ep-brand); display: block; height: 100%; transition: width 0.4s ease; }
[data-cutover] .form-control-sm, [data-cutover] .form-select-sm { min-width: 8rem; }

/* ----- Gateway 2 ----- */
.command-box { font-family: var(--ep-mono); font-size: 0.85rem; resize: vertical; }
.compare-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--ep-border); border-radius: var(--ep-radius-sm); }
.compare-list__row { padding: 0.75rem 1rem; display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 0.5rem 1rem; align-items: start; }
.compare-list__row + .compare-list__row { border-top: 1px solid var(--ep-border); }
.compare-list__name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.compare-list__views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.compare-list__view { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; min-width: 0; }
.compare-list__view small { color: var(--ep-muted); overflow-wrap: anywhere; }
.compare-list__label { font-size: 0.78rem; font-weight: 600; color: var(--ep-muted); text-transform: uppercase; letter-spacing: 0.02em; }
@media (max-width: 720px) {
  .compare-list__row, .compare-list__views { grid-template-columns: 1fr; }
  .data-table .col-actions .row-actions { flex-direction: column; align-items: stretch; }
  .data-table .col-actions .row-actions .btn { padding-inline: 0.55rem; }
}

/* ----- Maps ----- */
.view-toggle { display: flex; gap: 0.25rem; margin-left: auto; }
.map-view { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.75rem 1rem 1rem; }
.map-view__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.map-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.95rem; }
.map-crumb { background: none; border: 0; padding: 0.2rem 0.1rem; color: var(--ep-brand); font-weight: 600; }
button.map-crumb:hover { text-decoration: underline; }
.map-crumb.is-current, span.map-crumb { color: var(--ep-ink); cursor: default; }
button.map-crumb.is-current:hover { text-decoration: none; }
.map-crumb-sep { color: var(--ep-faint); }
.map-floors { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.map-view__canvas, .map-editor__canvas { height: clamp(380px, calc(100vh - 330px), 860px); border: 1px solid var(--ep-border); border-radius: var(--ep-radius-sm); background: #eef1f5; }
.map-view__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; align-items: center; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; font-size: 0.85rem; color: var(--ep-muted); }
.map-legend__dot { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--pin); }
.leaflet-container { font-family: var(--ep-font); background: #eef1f5; }
.leaflet-container:focus-visible { outline: 2px solid var(--ep-brand); outline-offset: 2px; }
.map-fit { background: #fff; border: 2px solid rgba(0, 0, 0, 0.2); border-radius: 4px; padding: 0.2rem 0.55rem; font-weight: 600; font-size: 0.8rem; color: var(--ep-ink); cursor: pointer; }
/* Leaflet's panes use z-index up to 1000: keep them inside the map so drawers, dialogs,
   toasts, and the Desk's call window stay on top. */
.leaflet-container { isolation: isolate; }
.map-pin { --pin: var(--ep-brand); }
.map-pin--good { --pin: var(--ep-good); }
.map-pin--warn { --pin: #c97a00; }
.map-pin--bad { --pin: var(--ep-bad); }
.map-pin--info { --pin: var(--ep-brand); }
.map-pin--neutral { --pin: var(--ep-muted); }
.map-pin--camera { --pin: #5b3fb8; }
.map-pin--camera .map-pin__dot { border-radius: 9px; }
.map-pin__dot { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--pin); color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(14, 24, 40, 0.45); font-size: 15px; }
.map-pin.is-selected .map-pin__dot { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--pin); }
.map-pin.is-dim { opacity: 0.35; }
.map-pin__label { position: absolute; left: 50%; top: 34px; transform: translateX(-50%); white-space: nowrap; background: rgba(20, 32, 52, 0.88); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 5px; pointer-events: none; display: none; }
.map-view--labels .map-pin__label, .map-editor .map-pin__label, .map-pin.is-selected .map-pin__label { display: block; }
.leaflet-marker-icon.map-pin:focus-visible .map-pin__dot { outline: 3px solid var(--ep-ink); outline-offset: 2px; }
.map-building { fill: var(--ep-brand); fill-opacity: 0.12; stroke: var(--ep-brand); stroke-width: 2; cursor: pointer; }
.map-building:hover { fill-opacity: 0.22; }
.map-building.is-empty { stroke-dasharray: 5 4; cursor: default; }
.map-building.is-selected { stroke-width: 3; fill-opacity: 0.25; }
.map-building.is-draft { stroke-dasharray: 6 4; fill-opacity: 0.08; }
.map-corner { fill: #fff; stroke: var(--ep-brand); stroke-width: 2; }
.leaflet-tooltip.map-building__label { background: rgba(20, 32, 52, 0.85); color: #fff; border: 0; box-shadow: none; font-weight: 600; font-size: 12px; padding: 2px 8px; }
.leaflet-tooltip.map-building__label::before { display: none; }
.map-editor { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 1rem; }
.map-editor__side { display: flex; flex-direction: column; gap: 0.5rem; max-height: calc(100vh - 220px); overflow: auto; }
.map-editor__heading { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ep-muted); margin: 0.5rem 0 0.2rem; }
.map-editor__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.map-editor__item { width: 100%; display: flex; align-items: center; gap: 0.5rem; text-align: left; border: 1px solid var(--ep-border); background: var(--ep-panel); border-radius: var(--ep-radius-sm); padding: 0.5rem 0.6rem; min-height: 44px; color: var(--ep-ink); }
.map-editor__item span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.map-editor__item small { color: var(--ep-good); font-weight: 600; }
.map-editor__item:hover { border-color: var(--ep-border-strong); background: var(--ep-row-hover); }
.map-editor__item.is-armed { border-color: var(--ep-brand); box-shadow: 0 0 0 2px var(--ep-brand-soft); background: var(--ep-brand-soft); }
.map-editor__canvas.is-armed, .map-editor__canvas.is-armed .leaflet-interactive { cursor: crosshair; }
.map-editor__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-top: 0.6rem; }
.map-editor__actions [data-editor-selection] { margin-right: auto; }
.spacer { flex: 1 1 auto; }
@media (max-width: 720px) {
  .view-toggle { margin-left: 0; }
  .map-editor { grid-template-columns: 1fr; }
  .map-editor__side { max-height: 12rem; }
  .map-view { padding: 0.6rem 0.6rem 0.75rem; }
  .map-view__canvas, .map-editor__canvas { height: clamp(320px, 60vh, 640px); }
}
/* Leaflet leaves hairline gaps between tiles at fractional zoom; overlap them by half a pixel
   (edge tiles are transparent-padded, so the overlap never shows). */
.plan-tiles img.leaflet-tile { width: 256.5px !important; height: 256.5px !important; }

/* Cameras: picture tiles, the live viewer, finding and linking cameras */
.camera-tile { aspect-ratio: 16 / 9; max-width: 100%; min-width: 0; background: #0e1828; border: 0; border-radius: var(--ep-radius); color: #fff; cursor: pointer; display: block; overflow: hidden; padding: 0; position: relative; width: 100%; }
.camera-tile img { display: block; height: 100%; inset: 0; object-fit: cover; position: absolute; width: 100%; } /* out of flow: a large picture must not widen the panel */
.camera-tile:focus-visible { outline: 3px solid var(--ep-brand); outline-offset: 2px; }
.camera-tile__wait { align-items: center; color: #c9d4e3; display: flex; flex-direction: column; font-size: 0.9rem; gap: 0.4rem; inset: 0; justify-content: center; padding: 1rem; position: absolute; text-align: center; }
.camera-tile__wait .ti { font-size: 1.8rem; opacity: 0.8; }
.camera-tile__label { background: linear-gradient(transparent, rgba(8, 14, 24, 0.78)); bottom: 0; display: flex; flex-direction: column; gap: 0.1rem; left: 0; padding: 1.6rem 0.9rem 0.6rem; position: absolute; right: 0; text-align: left; }
.camera-tile__name { font-weight: 700; }
.camera-tile__label [data-age] { color: #ffd58a; font-size: 0.8rem; }
.camera-tile__label [data-age]:empty { display: none; }
.camera-tile__live { align-items: center; background: rgba(8, 14, 24, 0.62); border-radius: 999px; display: inline-flex; font-size: 0.8rem; font-weight: 700; gap: 0.3rem; padding: 0.25rem 0.65rem; position: absolute; right: 0.7rem; top: 0.7rem; }
.camera-tile:hover .camera-tile__live { background: var(--ep-brand); }
.camera-tile.is-stale img { filter: grayscale(0.7) brightness(0.75); }
.entry-camera:empty, .camera-drawer__tile:empty { display: none; }
.entry-camera { display: grid; gap: 0.5rem; margin-bottom: 0.9rem; }
.camera-drawer__tile { margin-bottom: 1rem; }
.camera-others { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.ep-dialog--live { background: #0b1422; color: #fff; max-height: 94vh; max-width: min(1180px, calc(100vw - 1.5rem)); }
.live { display: grid; gap: 0; grid-template-rows: auto 1fr auto; max-height: 94vh; }
.live__head { align-items: center; display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; justify-content: space-between; padding: 0.8rem 1rem; }
.live__title { display: grid; gap: 0.1rem; min-width: 0; }
.live__title h2 { color: #fff; font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live__state { color: #aebcd0; font-size: 0.85rem; }
.live__actions { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.live__actions .btn-ghost { background: transparent; border-color: #3a4a62; color: #e7edf6; }
.live__actions .btn-ghost:hover { background: #1c2a40; color: #fff; }
.live__actions .icon-btn { color: #e7edf6; }
.live__stage { background: #000; min-height: 200px; position: relative; }
.live__stage video { display: block; height: 100%; max-height: calc(94vh - 9rem); object-fit: contain; width: 100%; }
.live__overlay { align-items: center; display: flex; inset: 0; justify-content: center; padding: 1.5rem; position: absolute; }
.live__overlay[hidden] { display: none; }
.live__problem { background: rgba(11, 20, 34, 0.9); border-radius: var(--ep-radius); display: grid; gap: 0.5rem; justify-items: start; max-width: 28rem; padding: 1.1rem 1.2rem; }
.live__problem span { color: #c9d4e3; }
.live__spinner { animation: live-spin 0.9s linear infinite; border: 3px solid rgba(255, 255, 255, 0.25); border-radius: 50%; border-top-color: #fff; display: inline-block; height: 2.2rem; width: 2.2rem; }
.searching .live__spinner { border-color: var(--ep-border); border-top-color: var(--ep-brand); height: 1.2rem; width: 1.2rem; }
@keyframes live-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .live__spinner { animation-duration: 2.5s; } }
.live__foot { align-items: center; border-top: 1px solid #1f2d44; display: flex; gap: 1rem; justify-content: space-between; padding: 0.8rem 1rem; }
.live__foot span { color: #c9d4e3; font-weight: 600; }

.find-bar { align-items: end; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between; }
.find-bar .field { flex: 1 1 14rem; margin: 0; }
.find-bar .muted-line { margin: 0; }
.searching { align-items: center; color: var(--ep-muted); display: flex; gap: 0.6rem; padding: 1rem 0; }
.found-list { display: grid; gap: 0; list-style: none; margin: 0; max-height: 50vh; overflow-y: auto; padding: 0; }
.found-list li { align-items: center; border-bottom: 1px solid var(--ep-border); display: flex; gap: 1rem; justify-content: space-between; padding: 0.65rem 0.2rem; }
.found-list li div { display: grid; gap: 0.1rem; min-width: 0; }
.found-list li div span { color: var(--ep-muted); font-size: 0.86rem; overflow-wrap: anywhere; }
.link-list { display: grid; gap: 0.3rem; list-style: none; margin: 0 0 0.8rem; padding: 0; }
.link-list li { align-items: baseline; display: flex; gap: 0.6rem; }
.link-list .btn-link { padding: 0; min-height: 0; }
.inline-form { align-items: end; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.inline-form .field { flex: 1 1 12rem; margin: 0; }
@media (max-width: 720px) {
  .live__stage video { max-height: 60vh; }
  .live__head { padding: 0.7rem; }
}
/* The Desk opens in its own page: answering intercoms stays one tap away from the console. */
.desk-launch { align-items: center; background: var(--ep-brand); border-radius: var(--ep-radius-sm); color: #fff; display: flex; font-weight: 700; gap: 0.6rem; margin-bottom: 0.5rem; min-height: 44px; padding: 0.55rem 0.75rem; text-decoration: none; }
.desk-launch:hover { background: var(--ep-brand-strong); color: #fff; }
.desk-launch .ti { font-size: 1.2rem; }
/* Intercom setup card: what to type into the call box's own web page */
.setup-card { display: grid; gap: 0.7rem; }
.setup-card dl { border: 1px solid var(--ep-border); border-radius: var(--ep-radius-sm); margin: 0; }
.setup-card__row { align-items: center; border-top: 1px solid var(--ep-border); display: grid; gap: 0.2rem 1rem; grid-template-columns: minmax(10rem, 14rem) 1fr; padding: 0.55rem 0.8rem; }
.setup-card__row:first-child { border-top: 0; }
.setup-card__row dt { color: var(--ep-muted); font-size: 0.86rem; font-weight: 600; }
.setup-card__row dd { align-items: center; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.setup-card__row code { color: var(--ep-ink); font-size: 0.95rem; overflow-wrap: anywhere; }
.steps { display: grid; gap: 0.35rem; margin: 0 0 0.9rem; padding-left: 1.2rem; }
@media (max-width: 720px) { .setup-card__row { grid-template-columns: 1fr; } }
.pair-code { font-size: 1.15rem; letter-spacing: 0.06em; }
.desk-pin-reveal code { color: var(--ep-ink); font-size: 2rem; letter-spacing: 0.3em; }
.desk-delay { max-width: 14rem; }
.fc-add { align-items: flex-start; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.fc-add .field { flex: 0 1 16rem; }
.fc-add .btn { margin-top: 1.6rem; }
#card-settings-form .card-item > .check { flex: 0 0 15rem; }
#card-settings-form .card-item .fc-name { flex: 1 1 12rem; margin: 0 auto 0 0; max-width: 22rem; }
