:root {
  color-scheme: dark;
  --bg: #0f1217;
  --panel: #171b22;
  --panel-2: #222833;
  --line: #2b323e;
  --text: #e0e6ef;
  --muted: #a2adbd;
  --accent: #3c5777;
  --warn: #e2c179;
  --bad: #f19990;
  --focus: #9cb8df;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { min-height: 38px; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 8px; padding: 0 14px; cursor: pointer; font-weight: 550; transition: background .15s; }
button:hover:not(:disabled) { background: var(--panel-2); border-color: #667c99; }
button:disabled { cursor: not-allowed; opacity: .45; }
input, select { height: 40px; min-width: 0; max-width: 100%; border: 1px solid #343e4c; background: var(--panel); color: var(--text); border-radius: 8px; padding: 0 12px; }
input::placeholder { color: #8390a3; }
:focus-visible { outline: 3px solid #94accf; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; font-weight: 650; letter-spacing: -1px; }
h2 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); line-height: 1.6; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 550; }
.eyebrow { display: block; font-size: 10px; font-weight: 650; letter-spacing: 1.8px; color: var(--muted); }
.skip-link { position: fixed; top: -100px; left: 20px; padding: 12px; background: var(--panel); z-index: 10; color: var(--accent); }
.skip-link:focus { top: 10px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; background: #171b22; border-right: 1px solid var(--line); padding: 30px 20px 20px; display: flex; flex-direction: column; }
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: 1.6px; color: #91a0b6; margin: 48px 12px 12px; }
.section-nav { display: flex; flex-direction: column; gap: 8px; }
.section-nav a { display: flex; gap: 12px; align-items: center; color: var(--muted); padding: 12px 14px; text-decoration: none; border-radius: 9px; font-weight: 550; }
.section-nav svg { width: 20px; height: 20px; flex-shrink: 0; }
.section-nav a:hover { background: #202631; }
.section-nav a[aria-current="page"] { color: #d2e3f8; background: #233247; }
.workspace-title { color: var(--text); text-decoration: none; font-size: 16px; font-weight: 550; padding: 4px 12px; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; border-top: 1px solid var(--line); padding: 20px 6px 0; min-width: 0; }
.sidebar-footer > div { min-width: 0; }
.sidebar-footer strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.sidebar-footer div > span { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.topbar { margin-left: 232px; display: flex; align-items: center; gap: 20px; min-height: 84px; padding: 18px 32px; border-bottom: 1px solid var(--line); background: #171b22; }
.topbar-label { font-weight: 650; font-size: 14px; }
#subtitle { margin-top: 2px; font-size: 11px; color: var(--muted); }
.connection { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; margin-left: auto; min-width: 0; }
#status-text { overflow-wrap: anywhere; max-width: 340px; }
.dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 4px #482d30; }
.dot.ok { background: #91c3a3; box-shadow: 0 0 0 4px #24382e; }
.quiet { background: transparent; font-size: 12px; }
.layout { margin-left: 232px; padding: 28px 32px 48px; max-width: 1920px; }
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.page-actions button { font-size: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.section-heading h2 { font-size: 30px; letter-spacing: -1px; }
.section-heading .muted { font-size: 13px; margin-top: 7px; }
.section-tag { font-size: 9px; color: var(--muted); letter-spacing: 1.3px; border: 1px solid var(--line); border-radius: 20px; padding: 8px 12px; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 25px; }
.stats > div { min-width: 0; border: 1px solid var(--line); background: #171b22; padding: 17px 18px; border-radius: 11px; }
.stats span { display: block; color: var(--muted); font-size: 11px; }
.stats strong { display: block; margin-top: 10px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 22px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; overflow: hidden; }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-head select { font-size: 12px; height: 34px; }
.panel-head h2 { margin-right: auto; }
.panel-head button { min-height: 32px; font-size: 11px; padding: 0 10px; }
.button-row { display: inline-flex; align-items: center; gap: 8px; }
#page-label { color: var(--muted); font-size: 10px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 650px; font-size: 12px; }
th, td { padding: 13px 14px; border-bottom: 1px solid #2a313c; text-align: left; vertical-align: top; }
th { background: #1a2029; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .3px; position: sticky; top: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #202833; }
tbody tr.selected { background: #233144; box-shadow: inset 3px 0 #879dba; }
.status { display: inline-flex; align-items: center; min-height: 23px; border: 1px solid var(--line); border-radius: 20px; padding: 3px 9px; font-size: 10px; color: var(--muted); background: #1a2029; }
.status.raw, .status.accepted, .status.suggested_match { color: #a3d1b0; background: #22342b; border-color: #3a5142; }
.status.duplicate, .status.ambiguous { color: var(--warn); background: #362f21; border-color: #53472d; }
.status.error, .status.rejected { color: var(--bad); background: #3c2929; border-color: #5b3d3d; }
video, #snapshot-image { display: block; width: 100%; aspect-ratio: 16 / 9; background: #090c10; object-fit: contain; }
.details { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 9px 12px; padding: 18px; margin: 0; border-top: 1px solid var(--line); font-size: 12px; }
.details dt { color: var(--muted); font-size: 11px; }
.details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.archive-note { margin: 14px 18px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.archive-note:empty { display: none; }
.face-health { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#face-warning:not(:empty) { padding: 13px 16px; margin: 0 0 20px; border: 1px solid #50462f; background: #302a1f; color: #d6bf85; border-radius: 9px; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.face-filters { padding: 20px; background: #171b22; border: 1px solid var(--line); border-radius: 12px; }
.face-filters label { min-width: 120px; flex: 1 1 130px; }
.face-filters input, .face-filters select { width: 100%; }
.face-filters button { font-size: 12px; height: 40px; }
#face-apply { background: var(--accent); color: var(--text); border-color: var(--accent); }
.face-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 22px; margin-top: 20px; }
.face-grid > .face-card { margin-top: 0; }
.face-card .panel-head { font-size: 11px; }
.face-capture { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #090c10; }
.face-identity { display: flex; gap: 14px; padding: 20px; align-items: start; }
.face-reference { width: 64px; height: 80px; border-radius: 8px; object-fit: cover; }
.face-identity h3 { font-size: 16px; margin: 0 0 6px; overflow-wrap: anywhere; }
.face-identity .muted { font-size: 12px; }
.empty-state { text-align: center; padding: 45px 20px; color: var(--muted); border: 1px dashed #3c4858; border-radius: 12px; background: #141a22; }
.empty-symbol { display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #263143; color: #a8b9d0; font-size: 30px; margin-bottom: 15px; }
.empty-state h3 { color: var(--text); font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { font-size: 12px; line-height: 1.8; }
.image-unavailable { padding: 32px 18px; color: var(--muted); }
.face-pagination { justify-content: center; gap: 20px; margin-top: 16px; border-bottom: 0; font-size: 12px; }
.directory-panel { padding: 20px; margin-top: 20px; }
.directory-panel summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.directory-panel button { margin-top: 12px; }
/* The public entry page exposes no organization or application identity. */
.login-page { min-height: 100svh; display: grid; place-items: center; padding: 32px 20px; background: #0d0f13; }
.login-card { width: min(100%, 390px); padding: 36px; background: #15181e; border: 1px solid #2a303a; border-radius: 12px; box-shadow: 0 20px 70px #00000026; }
.login-card .eyebrow { font-size: 9px; color: #9aa5b6; margin-bottom: 18px; letter-spacing: 2px; }
.login-card h1 { font-size: 29px; font-weight: 550; letter-spacing: -.8px; margin-bottom: 10px; }
.login-card > .muted { font-size: 12px; }
.login-card form { display: grid; margin-top: 32px; }
.login-card label { color: #b5bfce; font-size: 12px; font-weight: 400; }
.login-card input { height: 46px; width: 100%; margin-top: 2px; background: #101319; border-color: #303846; }
.login-card label[for="password"] { margin-top: 22px; margin-bottom: 7px; }
.password-field { display: flex; align-items: center; position: relative; }
.password-field input { padding-right: 68px; margin: 0; }
.password-field button { position: absolute; right: 8px; font-size: 11px; border: 0; background: transparent; color: var(--muted); padding: 0 8px; min-height: 32px; }
.login-card .checkbox-label { display: flex; align-items: center; gap: 10px; margin: 24px 0; color: var(--muted); font-size: 11px; }
.checkbox-label input { width: 16px; height: 16px; margin: 0; accent-color: #aebdd2; }
.primary { background: #d2dbe9; border-color: #d2dbe9; color: #17202f; font-weight: 600; }
.primary:hover:not(:disabled) { background: #eef2f8; border-color: #eef2f8; }
.login-card .primary { height: 46px; }
.error-message { color: var(--bad); font-size: 12px; line-height: 1.6; margin-top: 18px; }
.error-message:empty { display: none; }
@media (max-width: 1200px) { .split { grid-template-columns: 1fr; } .viewer { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } .viewer .panel { margin: 0; } .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .face-health { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 850px) {
  .sidebar { width: 190px; padding: 24px 14px; }
  .topbar, .layout { margin-left: 190px; padding-left: 22px; padding-right: 22px; }
  .section-tag { display: none; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .connection { font-size: 10px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .face-health { grid-template-columns: 1fr; }
  .viewer { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar { position: static; width: 100%; padding: 20px 20px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-footer, .nav-label { display: none; }
  .section-nav { flex-direction: row; margin-top: 20px; }
  .section-nav a { flex: 1; justify-content: center; padding: 10px; }
  .topbar, .layout { margin-left: 0; padding-left: 20px; padding-right: 20px; }
  .topbar { min-height: 62px; padding-top: 14px; padding-bottom: 14px; }
  .topbar > div:first-child { display: none; }
  .connection { margin-left: 0; flex: 1; }
  .layout { padding-top: 20px; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .section-heading h1, .section-heading h2 { font-size: 27px; }
  .section-heading .muted { font-size: 12px; }
  .stats { gap: 10px; }
  .stats > div { padding: 15px; }
  .stats > div:last-child { grid-column: 1 / -1; }
  .face-health { grid-template-columns: 1fr; }
  .face-filters { display: grid; grid-template-columns: 1fr 1fr; padding: 16px; gap: 12px; }
  .face-filters label { min-width: 0; }
  .face-filters label:last-of-type { grid-column: 1 / -1; }
  .face-filters input, .face-filters select { font-size: 12px; padding: 0 8px; }
  .panel-head { padding: 14px; gap: 10px; }
  .panel-head label { width: 100%; }
  .panel-head label input { width: 100%; }
  .button-row { flex-wrap: wrap; }
  .login-card { padding: 28px; }
  .login-card form { margin-top: 26px; }
}
