:root {
  --navy-950: #071225;
  --navy-900: #0b1830;
  --navy-800: #102342;
  --navy-700: #173357;
  --blue-600: #176bdf;
  --blue-500: #2b7fff;
  --blue-100: #eaf3ff;
  --cyan-500: #16b6b0;
  --green-600: #079669;
  --green-100: #e9f9f3;
  --red-600: #dc3d4e;
  --red-100: #fff0f2;
  --amber-600: #c37a06;
  --ink: #15223a;
  --muted: #67758d;
  --soft: #93a0b4;
  --line: #e3e9f2;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --shadow-sm: 0 6px 18px rgba(24, 43, 77, .06);
  --shadow-md: 0 18px 48px rgba(20, 42, 80, .11);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: 274px;
  flex-direction: column;
  padding: 27px 20px 22px;
  overflow-y: auto;
  color: #fff;
  background:
    radial-gradient(circle at 0 0, rgba(43,127,255,.2), transparent 34%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  box-shadow: 10px 0 35px rgba(7,18,37,.12);
}

.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; padding: 0 8px; }
.brand-mark { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; color: #80b5ff; }
.brand-mark svg { width: 43px; height: 43px; }
.brand-mark svg path:first-child { fill: rgba(43,127,255,.12); stroke: #398bff; }
.brand-mark svg path:nth-child(2) { stroke: #8bbcff; }
.brand-mark svg circle { fill: #19c9bd; stroke: none; }
.brand strong { display: block; font-size: 20px; line-height: 1; letter-spacing: .11em; }
.brand small { display: block; margin-top: 5px; color: #91a3bf; font-size: 11px; letter-spacing: .03em; }

.primary-nav { display: grid; gap: 8px; margin-top: 48px; }
.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border: 0;
  border-radius: 12px;
  color: #95a8c4;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: .2s ease;
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item:hover { color: #d7e6fb; background: rgba(255,255,255,.055); transform: translateX(2px); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, rgba(43,127,255,.96), rgba(30,99,212,.93)); box-shadow: 0 10px 26px rgba(20,94,211,.28); }
.nav-item.active::before { content: ""; position: absolute; left: -20px; width: 3px; height: 25px; border-radius: 0 3px 3px 0; background: #51dacb; }

.sidebar-footer { display: grid; gap: 10px; margin-top: auto; padding-top: 30px; }
.service-card { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.035); }
.service-card strong, .service-card small { display: block; }
.service-card strong { font-size: 12px; color: #eaf2fd; }
.service-card small { margin-top: 3px; color: #8498b7; font-size: 10px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--soft); box-shadow: 0 0 0 5px rgba(147,160,180,.1); }
.status-dot.online { background: #28d79f; box-shadow: 0 0 0 5px rgba(40,215,159,.12); }
.status-dot.offline { background: #ff6475; box-shadow: 0 0 0 5px rgba(255,100,117,.12); }
.status-dot.checking { animation: pulse 1.3s infinite; }
.swagger-link { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; color: #91a3bf; font-size: 12px; text-decoration: none; border-radius: 10px; transition: .2s ease; }
.swagger-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.swagger-link svg { width: 16px; height: 16px; }

.main-content { min-height: 100vh; margin-left: 274px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 78px; align-items: center; gap: 15px; padding: 0 clamp(24px, 3vw, 46px); border-bottom: 1px solid rgba(218,226,238,.9); background: rgba(255,255,255,.88); backdrop-filter: blur(18px); }
.topbar-title { display: grid; gap: 2px; }
.topbar-title strong { font-size: 16px; }
.eyebrow, .section-kicker { color: var(--blue-600); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.topbar .eyebrow { color: var(--soft); }
.topbar-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.secure-chip { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #d6eee9; border-radius: 999px; color: #087e62; background: #f2fcf9; font-size: 11px; font-weight: 700; }
.secure-chip svg { width: 15px; height: 15px; }
.clock { min-width: 68px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.menu-button { display: none; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.menu-button svg { width: 21px; height: 21px; }

.workspace { width: min(1500px, 100%); margin: auto; padding: clamp(28px, 3.4vw, 54px) clamp(22px, 3.4vw, 52px) 60px; }
.page { display: none; animation: page-in .35s ease; }
.page.active { display: block; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.page-heading h1 { margin: 7px 0 8px; color: #101d33; font-size: clamp(28px, 3vw, 39px); line-height: 1.12; letter-spacing: -.035em; }
.page-heading p { max-width: 710px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.endpoint-pill { display: flex; align-items: center; gap: 10px; min-width: max-content; padding: 8px 12px 8px 8px; border: 1px solid #dfe6f0; border-radius: 10px; background: rgba(255,255,255,.75); box-shadow: var(--shadow-sm); }
.endpoint-pill span { padding: 5px 7px; border-radius: 6px; color: #087e62; background: #e5f8f2; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.endpoint-pill code { color: #526178; font-size: 11px; }

.panel { border: 1px solid rgba(220,227,238,.94); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.panel-header h2 { margin: 0 0 5px; font-size: 17px; letter-spacing: -.015em; }
.panel-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.step-badge { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--blue-600); background: var(--blue-100); font-size: 11px; font-weight: 800; }
.two-column-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, .75fr); gap: 24px; align-items: stretch; }
.upload-workbench { padding: clamp(22px, 2.6vw, 32px); }

.compare-upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr); align-items: center; }
.upload-zone { position: relative; min-height: 284px; overflow: hidden; border: 1.5px dashed #c9d4e3; border-radius: var(--radius-md); background: linear-gradient(145deg, #fbfcfe, #f5f8fc); outline: none; transition: .2s ease; }
.upload-zone:hover, .upload-zone:focus-visible, .upload-zone.dragging { border-color: var(--blue-500); background: #f5f9ff; box-shadow: 0 0 0 4px rgba(43,127,255,.08); }
.upload-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 22px; text-align: center; }
.upload-icon { display: grid; width: 48px; height: 48px; margin-bottom: 15px; place-items: center; border-radius: 14px; color: var(--blue-600); background: var(--blue-100); }
.upload-icon.accent { color: #078a82; background: #e5f8f6; }
.upload-icon svg { width: 22px; height: 22px; }
.upload-placeholder strong { margin-bottom: 7px; font-size: 14px; }
.upload-placeholder span:not(.upload-icon) { color: var(--muted); font-size: 12px; }
.upload-placeholder u { color: var(--blue-600); font-weight: 700; text-underline-offset: 2px; }
.upload-placeholder small { margin-top: 8px; color: var(--soft); font-size: 10px; }
.upload-preview { position: absolute; inset: 0; background: #dfe6ef; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.preview-overlay { position: absolute; inset: auto 0 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; padding: 30px 15px 14px; color: #fff; background: linear-gradient(transparent, rgba(5,16,32,.9)); }
.preview-overlay strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.preview-overlay span { color: #becadd; font-size: 9px; }
.remove-image { grid-area: 1 / 2 / 3; padding: 6px 9px; border: 1px solid rgba(255,255,255,.35); border-radius: 7px; color: #fff; background: rgba(7,18,37,.36); font-size: 9px; font-weight: 700; }
.comparison-link { position: relative; z-index: 2; display: grid; place-items: center; }
.comparison-link::before { content: ""; position: absolute; width: 100%; height: 1px; background: #d5deeb; }
.comparison-link span { position: relative; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #d9e2ee; border-radius: 50%; color: var(--blue-600); background: #fff; box-shadow: var(--shadow-sm); }
.comparison-link svg { width: 15px; height: 15px; }

.action-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 24px; }
.threshold-field { display: grid; gap: 7px; color: #34435a; font-size: 11px; font-weight: 700; }
.threshold-field > div { display: flex; align-items: center; gap: 10px; }
.threshold-field input { width: 105px; padding: 10px 11px; border: 1px solid #d8e0ec; border-radius: 9px; color: var(--ink); background: #fbfcfe; outline: none; font-size: 13px; font-weight: 700; transition: .2s; }
.threshold-field input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(43,127,255,.1); }
.threshold-field small { color: var(--soft); font-size: 9px; font-weight: 500; }
.primary-button, .secondary-button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 9px; padding: 11px 18px; border-radius: 10px; font-size: 12px; font-weight: 800; transition: .2s ease; }
.primary-button { border: 1px solid var(--blue-600); color: #fff; background: linear-gradient(135deg, var(--blue-500), #145eca); box-shadow: 0 9px 20px rgba(23,107,223,.22); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 13px 25px rgba(23,107,223,.28); }
.primary-button:disabled { cursor: wait; opacity: .64; transform: none; }
.primary-button svg { width: 17px; height: 17px; }
.secondary-button { border: 1px solid #d5deea; color: #46556c; background: #fff; }
.secondary-button:hover { background: #f6f8fb; }

.result-panel { min-height: 100%; padding: clamp(23px, 2.5vw, 31px); }
.result-panel.empty { display: grid; place-items: center; }
.empty-state { max-width: 260px; color: var(--muted); text-align: center; }
.empty-state > span, .search-empty-state > span { display: grid; width: 58px; height: 58px; margin: 0 auto 17px; place-items: center; border-radius: 17px; color: #7e90aa; background: #f0f4f9; }
.empty-state svg, .search-empty-state svg { width: 27px; height: 27px; }
.empty-state h3 { margin: 0 0 7px; color: #2a3950; font-size: 15px; }
.empty-state p { margin: 0; font-size: 11px; line-height: 1.6; }
.result-content { width: 100%; }
.result-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.result-status { padding: 6px 9px; border-radius: 7px; color: var(--green-600); background: var(--green-100); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.result-status.no-match { color: var(--red-600); background: var(--red-100); }
.request-duration { color: var(--soft); font-size: 10px; }
.score-visual { display: grid; grid-template-columns: 128px 1fr; gap: 25px; align-items: center; margin-bottom: 29px; }
.score-ring { --score: 0deg; display: grid; width: 128px; height: 128px; place-items: center; border-radius: 50%; background: conic-gradient(var(--green-600) var(--score), #e8edf4 0); position: relative; }
.score-ring::before { content: ""; position: absolute; width: 102px; height: 102px; border-radius: 50%; background: #fff; }
.score-ring.no-match { background: conic-gradient(var(--red-600) var(--score), #e8edf4 0); }
.score-ring > div { position: relative; z-index: 1; text-align: center; }
.score-ring strong { display: block; font-size: 24px; letter-spacing: -.04em; }
.score-ring span { color: var(--soft); font-size: 9px; }
.score-visual h2 { margin: 5px 0 5px; font-size: 23px; letter-spacing: -.03em; }
.score-visual p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.result-details { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.result-details > div { display: flex; min-width: 0; justify-content: space-between; gap: 15px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.result-details dt { color: var(--muted); font-size: 10px; }
.result-details dd { min-width: 0; margin: 0; overflow: hidden; color: #2b3a51; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.result-details.compact { margin-top: 18px; }
.json-details { margin-top: 15px; }
.json-details summary { color: var(--blue-600); font-size: 10px; font-weight: 700; cursor: pointer; }
.json-details pre { max-height: 260px; margin: 10px 0 0; padding: 13px; overflow: auto; border-radius: 9px; color: #d8e8ff; background: var(--navy-950); font: 9px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

.search-control { display: grid; grid-template-columns: 155px minmax(240px, 1fr) auto auto; gap: 25px; align-items: center; padding: 20px 23px; }
.compact-upload { min-height: 125px; }
.compact-upload .upload-icon { width: 39px; height: 39px; margin-bottom: 9px; border-radius: 11px; }
.compact-upload .upload-placeholder { padding: 10px; }
.compact-upload .upload-placeholder strong { margin-bottom: 3px; font-size: 11px; }
.compact-upload .upload-placeholder span:not(.upload-icon) { font-size: 9px; }
.search-copy h2 { margin: 6px 0 5px; font-size: 18px; }
.search-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.search-results { margin-top: 34px; }
.results-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 20px; }
.results-toolbar h2 { margin: 5px 0 4px; font-size: 22px; }
.results-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.result-metrics { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.result-metrics > span { min-width: 82px; padding: 9px 15px; border-right: 1px solid var(--line); }
.result-metrics > span:last-child { border: 0; }
.result-metrics small, .result-metrics strong { display: block; }
.result-metrics small { margin-bottom: 3px; color: var(--soft); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.result-metrics strong { font-size: 12px; }
.match-grid { display: grid; grid-template-columns: repeat(3, minmax(250px, 1fr)); gap: 18px; }
.match-card { overflow: hidden; border: 1px solid #dce4ef; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); transition: .23s ease; animation: card-in .35s ease both; }
.match-card:hover { transform: translateY(-3px); border-color: #bdcde2; box-shadow: var(--shadow-md); }
.match-card.top-match { border-color: rgba(43,127,255,.55); box-shadow: 0 13px 36px rgba(43,127,255,.13); }
.match-photo { position: relative; height: 190px; overflow: hidden; color: #fff; background: linear-gradient(135deg, #173b68, #0b1830); }
.match-photo img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { display: grid; width: 100%; height: 100%; place-items: center; font-size: 50px; font-weight: 800; letter-spacing: -.04em; background: radial-gradient(circle at 70% 20%, rgba(43,127,255,.5), transparent 36%), linear-gradient(135deg, #173b68, #09162c); }
.rank-badge { position: absolute; top: 13px; left: 13px; padding: 6px 9px; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; color: #fff; background: rgba(7,18,37,.66); backdrop-filter: blur(8px); font-size: 9px; font-weight: 900; }
.score-badge { position: absolute; right: 13px; bottom: 13px; padding: 7px 10px; border-radius: 8px; color: #fff; background: rgba(7,18,37,.76); backdrop-filter: blur(8px); font-size: 13px; font-weight: 900; }
.match-card-body { padding: 17px; }
.person-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.person-heading h3 { margin: 0 0 4px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.person-heading p { margin: 0; color: var(--muted); font-size: 9px; }
.verified-icon { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--green-600); background: var(--green-100); }
.verified-icon svg { width: 14px; height: 14px; }
.score-bar { height: 5px; margin: 15px 0; overflow: hidden; border-radius: 99px; background: #e9eef5; }
.score-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan-500), var(--blue-500)); }
.match-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.match-meta > div { min-width: 0; padding: 9px; border-radius: 9px; background: #f6f8fb; }
.match-meta small, .match-meta strong { display: block; }
.match-meta small { margin-bottom: 3px; color: var(--soft); font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.match-meta strong { overflow: hidden; color: #36465e; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.no-matches { padding: 50px 25px; border: 1px dashed #cfd8e5; border-radius: 18px; color: var(--muted); background: rgba(255,255,255,.58); text-align: center; }
.no-matches > span { display: grid; width: 52px; height: 52px; margin: 0 auto 14px; place-items: center; border-radius: 15px; color: var(--red-600); background: var(--red-100); }
.no-matches svg { width: 24px; height: 24px; }
.no-matches h3 { margin: 0 0 6px; color: #2b3a51; font-size: 15px; }
.no-matches p { margin: 0; font-size: 11px; }
.json-details.wide { padding: 0 4px; }
.search-empty-state { display: flex; align-items: center; justify-content: center; gap: 20px; min-height: 190px; margin-top: 25px; color: var(--muted); text-align: left; }
.search-empty-state > span { margin: 0; }
.search-empty-state h3 { margin: 0 0 5px; color: #2b3a51; font-size: 15px; }
.search-empty-state p { margin: 0; font-size: 11px; }

.liveness-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 24px; align-items: start; }
.liveness-camera-card { padding: clamp(22px, 2.6vw, 32px); }
.liveness-camera-state { padding: 6px 9px; border-radius: 999px; color: #67758d; background: #eef2f7; font-size: 9px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.liveness-camera-state.online { color: var(--green-600); background: var(--green-100); }
.liveness-video-shell { position: relative; isolation: isolate; aspect-ratio: 16 / 10; min-height: 340px; overflow: hidden; border-radius: 20px; background: radial-gradient(circle at 50% 45%, #173b68, #071225 72%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.liveness-video-shell video, .liveness-capture-preview { width: 100%; height: 100%; object-fit: cover; }
.liveness-video-shell video { transform: scaleX(-1); }
.liveness-capture-preview { position: absolute; inset: 0; z-index: 1; }
.liveness-capture-preview { transform: scaleX(-1); }
.face-guide { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; }
.face-guide::before { content: ""; width: min(42%, 250px); aspect-ratio: .76; border: 2px solid rgba(255,255,255,.75); border-radius: 48% 48% 44% 44%; box-shadow: 0 0 0 999px rgba(3,11,24,.25), 0 0 35px rgba(43,127,255,.22); }
.face-guide span { position: absolute; width: min(47%, 280px); aspect-ratio: 1; border: 1px dashed rgba(81,218,203,.5); border-radius: 50%; animation: liveness-guide 2.2s ease-in-out infinite; }
.liveness-camera-placeholder { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; color: #d8e5f8; background: radial-gradient(circle at 50% 45%, #173b68, #071225 72%); text-align: center; }
.liveness-camera-placeholder > span { display: grid; width: 58px; height: 58px; margin-bottom: 5px; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; color: #83b9ff; background: rgba(255,255,255,.06); }
.liveness-camera-placeholder svg { width: 27px; height: 27px; }
.liveness-camera-placeholder strong { font-size: 14px; }
.liveness-camera-placeholder small { color: #91a3bf; font-size: 10px; }
.liveness-prompt { position: absolute; right: 18px; bottom: 18px; left: 18px; z-index: 6; padding: 13px 16px; border: 1px solid rgba(255,255,255,.22); border-radius: 13px; color: #fff; background: rgba(7,18,37,.76); box-shadow: 0 12px 30px rgba(0,0,0,.18); backdrop-filter: blur(12px); text-align: center; }
.liveness-prompt small, .liveness-prompt strong { display: block; }
.liveness-prompt small { margin-bottom: 4px; color: #65e0d2; font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.liveness-prompt strong { font-size: clamp(13px, 2vw, 18px); }
.replay-protection-badge { position: absolute; top: 16px; left: 16px; z-index: 6; display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #dceaff; background: rgba(7,18,37,.64); backdrop-filter: blur(10px); font-size: 9px; font-weight: 800; }
.replay-protection-badge svg { width: 14px; height: 14px; color: #65e0d2; }
.liveness-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 22px; }
.liveness-buttons { display: flex; gap: 10px; }
.liveness-security-note { margin: 18px 0 0; padding: 12px 14px; border: 1px solid #e5e9f0; border-radius: 11px; color: var(--muted); background: #f8fafc; font-size: 9px; line-height: 1.55; }
.liveness-security-note strong { color: #3a4960; }
.liveness-side { display: grid; gap: 18px; }
.challenge-card, .liveness-assessment { padding: 25px; }
.challenge-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.challenge-list li { display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: center; padding: 11px; border: 1px solid #e4e9f1; border-radius: 11px; background: #f8fafc; transition: .2s ease; }
.challenge-list li > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; color: #66758c; background: #e9eef5; font-size: 10px; font-weight: 900; }
.challenge-list strong, .challenge-list small { display: block; }
.challenge-list strong { margin-bottom: 3px; font-size: 10px; }
.challenge-list small { color: var(--soft); font-size: 8px; }
.challenge-list li.holding, .challenge-list li.active { border-color: #a9caff; background: #f2f7ff; }
.challenge-list li.active { box-shadow: 0 0 0 3px rgba(43,127,255,.08); }
.challenge-list li.active > span { color: #fff; background: var(--blue-500); animation: pulse 1s infinite; }
.challenge-list li.complete { border-color: #bde6d8; background: #f1fbf7; }
.challenge-list li.complete > span { color: #fff; background: var(--green-600); }
.challenge-list li.failed { border-color: #f3c4ca; background: #fff5f6; }
.challenge-list li.failed > span { color: #fff; background: var(--red-600); }
.liveness-assessment { transition: .25s ease; }
.assessment-icon { display: grid; width: 48px; height: 48px; margin-bottom: 17px; place-items: center; border-radius: 15px; color: #6f8098; background: #eef2f7; }
.assessment-icon svg { width: 24px; height: 24px; }
.assessment-icon.running { color: var(--blue-600); background: var(--blue-100); animation: pulse 1.2s infinite; }
.assessment-icon.live { color: var(--green-600); background: var(--green-100); }
.assessment-icon.replay, .assessment-icon.unable { color: var(--red-600); background: var(--red-100); }
.liveness-assessment[data-status="live"] { border-color: #bde6d8; background: linear-gradient(145deg, #fff, #f1fbf7); }
.liveness-assessment[data-status="replay"], .liveness-assessment[data-status="unable"] { border-color: #f1c5ca; background: linear-gradient(145deg, #fff, #fff5f6); }
.liveness-assessment h2 { margin: 6px 0 7px; font-size: 20px; }
.liveness-assessment > p { margin: 0 0 18px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.liveness-diagnostics { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.liveness-diagnostics > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.liveness-diagnostics dt { color: var(--muted); font-size: 9px; }
.liveness-diagnostics dd { max-width: 58%; margin: 0; overflow: hidden; font-size: 9px; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.liveness-diagnostics dd[data-status="pass"] { color: var(--green-600); }
.liveness-diagnostics dd[data-status="fail"] { color: var(--red-600); }
.liveness-diagnostics dd[data-status="warn"] { color: var(--amber-600); }
.liveness-identity-results { margin-top: 36px; }
.liveness-light-pulse { position: fixed; inset: 0; z-index: 200; pointer-events: none; opacity: 0; transition: opacity .32s ease; }
.liveness-light-pulse.active { opacity: 1; }

@keyframes liveness-guide { 50% { opacity: .45; transform: scale(.96); } }

.enroll-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 24px; align-items: start; }
.enrollment-form { padding: clamp(23px, 2.8vw, 34px); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-field { display: grid; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
.form-field > span { color: #3b4a61; font-size: 10px; font-weight: 800; }
.form-field b { color: var(--red-600); }
.form-field input { width: 100%; padding: 12px 13px; border: 1px solid #d8e0eb; border-radius: 10px; color: var(--ink); background: #fbfcfe; outline: none; font-size: 12px; transition: .2s; }
.form-field input::placeholder { color: #a5afbe; }
.form-field input:focus { border-color: var(--blue-500); background: #fff; box-shadow: 0 0 0 3px rgba(43,127,255,.09); }
.form-divider { display: flex; align-items: center; gap: 12px; margin: 27px 0 17px; color: #506078; font-size: 10px; font-weight: 800; }
.form-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.wide-upload { min-height: 215px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.enrollment-aside { display: grid; gap: 18px; }
.guidance-card { padding: 28px; background: linear-gradient(145deg, #fff, #f8fbff); }
.guidance-icon { display: grid; width: 45px; height: 45px; margin-bottom: 18px; place-items: center; border-radius: 13px; color: var(--blue-600); background: var(--blue-100); }
.guidance-icon svg { width: 23px; height: 23px; }
.guidance-card h3 { margin: 0 0 15px; font-size: 15px; }
.guidance-card ul { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.guidance-card li { position: relative; padding-left: 18px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.guidance-card li::before { content: ""; position: absolute; top: 5px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan-500); box-shadow: 0 0 0 3px rgba(22,182,176,.1); }
.enrollment-result { padding: 28px; border-color: #bfe8d9; background: linear-gradient(145deg, #fff, #f1fbf7); }
.success-seal { display: grid; width: 43px; height: 43px; margin-bottom: 16px; place-items: center; border-radius: 50%; color: #fff; background: var(--green-600); box-shadow: 0 8px 20px rgba(7,150,105,.23); }
.success-seal svg { width: 22px; height: 22px; stroke-width: 2.4; }
.enrollment-result h2 { margin: 5px 0 7px; font-size: 20px; }
.enrollment-result > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: grid; width: min(390px, calc(100vw - 44px)); gap: 10px; }
.toast { display: grid; grid-template-columns: 35px minmax(0,1fr) auto; gap: 11px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.97); box-shadow: var(--shadow-md); animation: toast-in .25s ease; }
.toast-icon { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; color: var(--green-600); background: var(--green-100); }
.toast.error .toast-icon { color: var(--red-600); background: var(--red-100); }
.toast-icon svg { width: 18px; height: 18px; }
.toast strong { display: block; margin: 1px 0 4px; font-size: 11px; }
.toast p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.toast-close { padding: 2px; border: 0; color: var(--soft); background: transparent; font-size: 16px; }
.button-loading span { opacity: .65; }
.button-loading svg { animation: spin 1s linear infinite; }

.sidebar-backdrop { position: fixed; inset: 0; z-index: 25; display: none; background: rgba(7,18,37,.5); backdrop-filter: blur(3px); }

@keyframes page-in { from { opacity: 0; transform: translateY(7px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .match-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .search-control { grid-template-columns: 140px minmax(210px,1fr) auto; }
  .search-control .primary-button { grid-column: 2 / -1; justify-self: end; }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-105%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .main-content { margin-left: 0; }
  .menu-button { display: grid; }
  .two-column-layout, .enroll-layout, .liveness-layout { grid-template-columns: 1fr; }
  .result-panel { min-height: 410px; }
  .enrollment-aside { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .topbar { height: 68px; padding: 0 16px; }
  .topbar-actions .secure-chip, .clock { display: none; }
  .workspace { padding: 26px 15px 45px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .page-heading h1 { font-size: 29px; }
  .endpoint-pill { align-self: stretch; overflow: hidden; }
  .endpoint-pill code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .compare-upload-grid { grid-template-columns: 1fr; gap: 13px; }
  .comparison-link { height: 22px; transform: rotate(90deg); }
  .upload-zone { min-height: 235px; }
  .action-row { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .score-visual { grid-template-columns: 110px 1fr; gap: 18px; }
  .score-ring { width: 110px; height: 110px; }
  .score-ring::before { width: 88px; height: 88px; }
  .search-control { grid-template-columns: 1fr; }
  .compact-upload { min-height: 180px; }
  .search-control .primary-button { grid-column: auto; justify-self: stretch; }
  .liveness-video-shell { min-height: 0; aspect-ratio: 4 / 5; }
  .liveness-video-shell video, .liveness-capture-preview { object-fit: contain; background: #071225; }
  .face-guide::before { width: auto; height: 68%; max-height: 520px; aspect-ratio: .76; }
  .face-guide span { width: auto; height: 76%; max-height: 570px; aspect-ratio: 1; }
  .liveness-controls { align-items: stretch; flex-direction: column; }
  .liveness-buttons { flex-direction: column-reverse; }
  .liveness-buttons .secondary-button { width: 100%; }
  .liveness-prompt { right: 11px; bottom: 11px; left: 11px; }
  .results-toolbar { align-items: stretch; flex-direction: column; }
  .result-metrics { display: grid; grid-template-columns: repeat(2,1fr); }
  .result-metrics > span { border-bottom: 1px solid var(--line); }
  .match-grid { grid-template-columns: 1fr; }
  .enrollment-aside { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .form-actions { flex-direction: column-reverse; }
  .secondary-button { width: 100%; }
}

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