/* KYCoff design tokens.
   Layout: applicants get one calm centred column; reviewers get a navy sidebar queue + case file,
   echoing the brand board's UI header example. Brand colours: navy #071C35, teal #00BFA3, green #12C990.
   Text on teal uses navy (white on teal fails WCAG contrast). Fonts are system faces: no third-party font host. */
:root {
  --navy: #071c35;
  --teal: #00bfa3;
  --green: #12c990;
  --brand-gradient: linear-gradient(100deg, var(--green) 0%, var(--teal) 100%);
  --paper: #f3f7f8;
  --surface: #ffffff;
  --surface-2: #e9f0f2;
  --ink: #071c35;
  --ink-2: #48586b;
  --line: #d4dfe4;
  --link: #00735f;
  --btn-bg: #071c35;
  --btn-ink: #ffffff;
  --focus: #00a58c;
  --ok: #0c7a4f;     --ok-soft: #d9f3e7;
  --warn: #8a5300;   --warn-soft: #fbecd2;
  --bad: #b3261e;    --bad-soft: #f9dedb;
  --info: #0b5d73;   --info-soft: #d9f0f3;
  --sidebar: #071c35;
  --sidebar-ink: #e3ecf3;
  --sidebar-ink-2: #9fb3c6;
  --sidebar-line: #173252;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-data: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #051121; --surface: #0b1d33; --surface-2: #132a45; --ink: #e8f0f5; --ink-2: #a2b4c6;
    --line: #213a59; --link: #3fe0c3; --btn-bg: #00bfa3; --btn-ink: #071c35; --focus: #3fe0c3;
    --ok: #4fd9a0; --ok-soft: #0f3527; --warn: #f0b25a; --warn-soft: #3b2a10; --bad: #ff9b91; --bad-soft: #42201d;
    --info: #7fd6e8; --info-soft: #11334a; --sidebar: #030c18; --sidebar-line: #13263f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #051121; --surface: #0b1d33; --surface-2: #132a45; --ink: #e8f0f5; --ink-2: #a2b4c6;
  --line: #213a59; --link: #3fe0c3; --btn-bg: #00bfa3; --btn-ink: #071c35; --focus: #3fe0c3;
  --ok: #4fd9a0; --ok-soft: #0f3527; --warn: #f0b25a; --warn-soft: #3b2a10; --bad: #ff9b91; --bad-soft: #42201d;
  --info: #7fd6e8; --info-soft: #11334a; --sidebar: #030c18; --sidebar-line: #13263f; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 16px/1.55 var(--font-body); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 750; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-2); }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 2px; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.data { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
.span-all { grid-column: 1 / -1; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Logo: two files, one per theme */
.logo { display: block; height: 34px; width: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; } :root:not([data-theme="light"]) .logo-dark { display: block; } }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* Forms */
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 0.9rem; font-weight: 600; min-width: 0; }
label.field .hint, .hint { font-weight: 400; color: var(--ink-2); font-size: 0.82rem; }
input:not([type]), input[type=text], input[type=url], input[type=number], input[type=email], input[type=tel], input[type=date], input[type=datetime-local], input[type=password],
select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 8px; padding: 10px 12px; width: 100%; min-width: 0; min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible,
[tabindex]:focus-visible, .choice:focus-within {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, main[tabindex="-1"]:focus { outline: none; }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--bad); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; }
.check input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--teal); flex: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; padding: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.choice { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface);
  display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 0.94rem; min-height: 48px; }
.choice:has(input:checked) { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, var(--surface)); }
.choice input { accent-color: var(--teal); width: 18px; height: 18px; flex: none; }
.choice.big { align-items: flex-start; flex-direction: row; }
.choice.big strong { display: block; }

/* Buttons: pills, as on the brand board */
button, .btn {
  font: inherit; font-weight: 650; border-radius: 999px; padding: 11px 20px; cursor: pointer; min-height: 44px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
}
button:hover, .btn:hover { border-color: var(--ink-2); }
button.primary, .btn.primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.15); }
button.cta { padding: 12px 22px 12px 12px; }
.check-badge { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-gradient); display: inline-grid; place-items: center; flex: none; }
.check-badge::after { content: ""; width: 10px; height: 6px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
button.danger { color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--link); text-decoration: underline; font-weight: 600; }

/* Status */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.notice { border-radius: var(--radius); padding: 12px 14px; font-size: 0.92rem; background: var(--surface-2); border-left: 4px solid var(--line); }
.notice.ok { background: var(--ok-soft); border-left-color: var(--ok); }
.notice.warn { background: var(--warn-soft); border-left-color: var(--warn); }
.notice.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.notice.info { background: var(--info-soft); border-left-color: var(--info); }
.error-text { color: var(--bad); font-size: 0.9rem; font-weight: 600; }
.error-text:empty { display: none; }

.mrz { font-family: var(--font-data); font-size: clamp(0.6rem, 2.3vw, 0.86rem); letter-spacing: 0.06em; color: var(--ink);
  background: var(--surface-2); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; line-height: 1.6; }
table.kv { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.kv th, table.kv td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kv th { font-weight: 600; color: var(--ink-2); width: 34%; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.mrz { overflow-x: auto; }
.thumb { border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); display: block; max-width: 100%; object-fit: contain; }
details > summary { cursor: pointer; font-weight: 600; }

/* ---------------- Applicant flow ---------------- */
.applicant { max-width: 680px; margin: 0 auto; padding-block: 20px 64px; padding-inline: 16px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 20px; }
.progress > div { height: 100%; background: var(--brand-gradient); border-radius: 3px; transition: width 0.3s; }
.step-label { font-size: 0.8rem; color: var(--ink-2); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
@media (max-width: 480px) { .panel { padding: 18px; border-radius: 14px; } }
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap-reverse; }
.capture-slot { border: 1.5px dashed var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.capture-slot img { max-height: 240px; }
.code-box { font-family: var(--font-data); font-size: 2rem; letter-spacing: 0.3em; font-weight: 700; padding: 10px 18px; border-radius: 10px; background: var(--surface-2); }
.checklist-mini { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.checklist-mini li { display: flex; gap: 8px; align-items: baseline; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ink-2); transform: translateY(-1px); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.footer { margin-top: 24px; font-size: 0.82rem; color: var(--ink-2); display: flex; gap: 16px; flex-wrap: wrap; }

/* Camera sheet (always dark: it shows a live video) */
.camera { position: fixed; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.camera-stage { position: relative; flex: 1; overflow: hidden; display: grid; place-items: center; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.camera video.mirror { transform: scaleX(-1); }
.camera-frame { position: absolute; border: 3px solid rgba(255,255,255,0.92); border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,0.5); pointer-events: none; }
.camera-frame.card { width: min(86vw, 640px); aspect-ratio: 85.6 / 54; }
/* Open passport: the page above (top) and the photo page (bottom), each 125 x 88 mm, lying flat. */
.camera-frame.passport { height: min(72vh, 86vw * 1.408, 820px); aspect-ratio: 125 / 176; }
.camera-frame.passport::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed rgba(255,255,255,0.75); }
.camera-frame.passport::after { content: "Photo page here, lines of <<< at the bottom"; position: absolute; left: 8px; right: 8px; top: calc(50% + 8px);
  color: rgba(255,255,255,0.85); font-size: 0.8rem; text-align: center; text-shadow: 0 1px 3px #000; }
.camera-frame.page { width: min(70vw, 420px); aspect-ratio: 210 / 297; }
.camera-frame.face { width: min(62vw, 300px); aspect-ratio: 3 / 4; border-radius: 50%; }
.camera-frame.ok { border-color: #12c990; }
.camera-prompt { position: absolute; top: 18px; left: 16px; right: 16px; text-align: center; color: #fff;
  font-size: 1.15rem; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,0.7); }
.camera-sub { position: absolute; bottom: 14px; left: 16px; right: 16px; text-align: center; color: #e8edf2; font-size: 0.95rem; }
.camera-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; background: #000; }
.camera-bar button { background: #13263f; color: #fff; border-color: #2a4466; }
.shutter { width: 70px; height: 70px; border-radius: 50% !important; border: 4px solid #fff !important; background: #fff !important;
  box-shadow: inset 0 0 0 3px #000; padding: 0 !important; }
.progress-track { height: 6px; background: rgba(255,255,255,0.2); border-radius: 3px; overflow: hidden; width: 100%; }
.progress-track > div { height: 100%; background: linear-gradient(100deg, #12c990, #00bfa3); width: 0; transition: width 0.2s; }
@media (prefers-reduced-motion: reduce) { .progress-track > div, .progress > div { transition: none; } }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ---------------- Review desk ---------------- */
.review-app { min-height: 100vh; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
@media (max-width: 900px) { .review-app { grid-template-columns: minmax(0, 1fr); }
  /* Stacked layout: the header grows to fit (tabs, warnings) and only the list of cases scrolls, so nothing
     spills over the case or settings below. */
  .queue-head { position: static; } .queue-list { max-height: 45vh; } }
.queue { background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; min-width: 0; }
.queue-head { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--sidebar-line);
  position: sticky; top: env(safe-area-inset-top, 0px); background: var(--sidebar); z-index: 2; }
.queue .logo { height: 28px; }
.queue button.link { color: #3fe0c3; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { padding: 5px 12px; font-size: 0.82rem; min-height: 32px; background: transparent; color: var(--sidebar-ink); border-color: var(--sidebar-line); }
.tabs button[aria-pressed=true] { background: var(--brand-gradient); color: #071c35; border-color: transparent; }
.queue-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.queue-item { display: grid; grid-template-columns: 4px 1fr; border-bottom: 1px solid var(--sidebar-line); cursor: pointer; }
.queue-item:hover, .queue-item[aria-current=true] { background: #0f2a4a; }
.queue-item .stripe { background: var(--sidebar-line); }
.queue-item .stripe.high { background: #ff8a80; } .queue-item .stripe.medium { background: #f0b25a; } .queue-item .stripe.low { background: #12c990; }
.queue-item .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.queue-item .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 0.8rem; color: var(--sidebar-ink-2); }
.queue .pill { background: #13263f; color: var(--sidebar-ink); }
.queue .pill.bad { background: #4a1c1a; color: #ffb4ab; } .queue .pill.warn { background: #3e2c0e; color: #ffd08a; }
.queue .pill.ok { background: #0d3a2a; color: #7ff0bf; } .queue .pill.info { background: #0d3346; color: #9ee6f5; }
.queue .notice { background: #13263f; color: var(--sidebar-ink); border-left-color: #f0b25a; }
.case { padding: 24px; display: flex; flex-direction: column; gap: 20px; min-width: 0; max-width: 1200px; }
@media (max-width: 600px) { .case { padding: 16px; } }
.case-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; align-items: start; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; color: var(--ink-2); }
.gallery button.zoom { padding: 0; border: 0; border-radius: 8px; min-height: 0; background: none; display: block; width: 100%; }
.gallery img { width: 100%; height: 130px; object-fit: cover; cursor: zoom-in; }
.match-meter { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--ok) 0 45%, var(--warn) 45% 55%, var(--bad) 55% 100%); position: relative; opacity: 0.85; }
.match-meter span { position: absolute; top: -5px; width: 3px; height: 18px; background: var(--ink); border-radius: 2px; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.checklist li { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .item { display: flex; gap: 10px; align-items: flex-start; }
.checklist input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--teal); flex: none; }
.checklist .by { font-size: 0.78rem; color: var(--ink-2); }
.blockers { margin: 0; padding-left: 18px; font-size: 0.9rem; display: flex; flex-direction: column; gap: 4px; }
.audit { font-size: 0.82rem; width: 100%; border-collapse: collapse; }
.audit td, .audit th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.audit th { color: var(--ink-2); font-weight: 600; }
.audit td.hash { font-family: var(--font-data); color: var(--ink-2); }
.lightbox { position: fixed; inset: 0; background: rgba(3,12,24,0.9); display: grid; place-items: center; z-index: 60; padding: 16px; cursor: zoom-out; border: 0; border-radius: 0; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 8px; }
.empty { display: grid; place-items: center; min-height: 60vh; text-align: center; color: var(--ink-2); padding: 24px; }
.login { max-width: 400px; margin: 10vh auto; padding-inline: 16px; }
.login > .logo { align-self: flex-start; width: auto; height: 34px; }
.form-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 28px; margin-bottom: 8px; }
.prose p, .prose li { margin-bottom: 8px; }

/* Review desk sections */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #0c2340; padding: 4px; border-radius: 18px; }
.modes button { min-height: 34px; padding: 6px 10px; font-size: 0.85rem; border: 0; background: transparent; color: var(--sidebar-ink); }
.modes button[aria-selected=true] { background: var(--brand-gradient); color: #071c35; }
.modes button[data-mode=outbox][hidden] + button[data-mode=team] { grid-column: 1 / -1; }
.progress-mini { height: 6px; border-radius: 3px; background: #173252; overflow: hidden; width: 100%; }
.progress-mini > div { height: 100%; background: linear-gradient(100deg, #12c990, #00bfa3); }
.portal .panel h2 { font-size: 1.2rem; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.person { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }

/* firm branding (hosted mode) */
.firm-logo { max-width: 200px; max-height: 40px; object-fit: contain; display: block !important; }
.queue .firm-logo { background: #fff; border-radius: 8px; padding: 4px 8px; }
.powered-by { text-align: center; opacity: .7; margin: 24px 0 16px; }
.review-app:not([hidden]) ~ .powered-by { display: none; }

/* continue on your phone */
.phone-offer { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px;
  border: 1px dashed var(--line); background: var(--surface-2); }
.phone-offer.recommended { border: 2px solid var(--teal); background: color-mix(in srgb, var(--teal) 10%, var(--surface)); }
.phone-icon { width: 26px; height: 40px; border: 3px solid var(--ink-2); border-radius: 6px; position: relative; flex: none; }
.phone-icon::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 6px; height: 2px; margin-left: -3px; background: var(--ink-2); border-radius: 1px; }
.handoff-modal { position: fixed; inset: 0; z-index: 60; background: rgba(7, 28, 53, .6); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.handoff-modal > .panel { margin: auto 0; }  /* centred when it fits; scrolls from the top when taller than the window */
.handoff-modal[hidden] { display: none; }
.qr { background: #fff; border-radius: 12px; padding: 8px; width: min(280px, 100%); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center; }
.qr svg { width: 100%; height: 100%; display: block; }
#cam_device { max-width: 160px; min-height: 40px; background: #13263f; color: #fff; border: 1px solid #2a4466; border-radius: 999px; padding: 6px 10px; font-size: .85rem; }
.danger-zone > summary { color: var(--bad); }
button.link.danger-link { color: var(--bad); }
.restart-banner { position: sticky; top: 0; z-index: 100; background: var(--bad); color: #fff; padding: 12px 16px; font-size: .95rem; text-align: center; }

/* Face ID style ring around the face oval */
.cam-ring { position: absolute; width: calc(min(62vw, 300px) * 1.3); aspect-ratio: 100 / 133; pointer-events: none; overflow: visible; }
.cam-ring line { stroke: rgba(255,255,255,0.35); stroke-width: 1.6; stroke-linecap: round; transition: stroke 0.25s; }
.cam-ring line.lit { stroke: #12c990; stroke-width: 2.2; }
/* In-camera explanation card (tilt step, eye-closing step) */
.cam-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 420px); z-index: 3;
  background: rgba(7, 28, 53, 0.94); color: #fff; border: 1px solid #2a4466; border-radius: 18px; padding: 22px 20px 18px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 18px 50px rgba(0,0,0,0.55); text-align: left; }
.cam-card h2 { margin: 0; font-size: 1.2rem; color: #fff; }
.cam-card p, .cam-card li { margin: 0; color: #dfe7ef; font-size: 0.95rem; line-height: 1.45; }
.cam-card ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.cam-card button { background: #13263f; color: #fff; border-color: #2a4466; }
.cam-card button.primary { background: var(--brand-gradient); color: #04121f; border: 0; }
.cam-card-actions { justify-content: flex-end; gap: 10px; }
/* Animated example: a document tilting, its hologram changing colour */
.tilt-demo { height: 112px; display: grid; place-items: center; perspective: 420px; }
.tilt-doc { position: relative; width: 150px; height: 96px; border-radius: 9px; background: linear-gradient(160deg, #e9eef4, #c9d6e3);
  box-shadow: 0 6px 16px rgba(0,0,0,0.45); transform-origin: 50% 100%; animation: tiltDoc 2.6s ease-in-out infinite; overflow: hidden; }
.tilt-photo { position: absolute; left: 10px; top: 14px; width: 34px; height: 44px; border-radius: 4px; background: #8aa0b6; }
.tilt-lines { position: absolute; left: 52px; right: 12px; top: 18px; height: 34px;
  background: repeating-linear-gradient(#7d8fa3 0 3px, transparent 3px 9px); opacity: 0.7; }
.tilt-lines::after { content: ""; position: absolute; left: -42px; right: 0; top: 52px; height: 14px;
  background: repeating-linear-gradient(90deg, #52677c 0 5px, transparent 5px 7px); }
.tilt-holo { position: absolute; right: 12px; top: 10px; width: 42px; height: 42px; border-radius: 50%; mix-blend-mode: multiply; opacity: 0.85;
  background: linear-gradient(115deg, #ff5f6d, #ffc371, #47e891, #44c9ff, #b06ab3, #ff5f6d); background-size: 400% 400%;
  animation: holo 2.6s ease-in-out infinite; }
@keyframes tiltDoc { 0%, 100% { transform: rotateX(0deg); } 30% { transform: rotateX(34deg); } 60% { transform: rotateX(-14deg); } }
@keyframes holo { 0%, 100% { background-position: 0% 50%; } 30% { background-position: 100% 50%; } 60% { background-position: 40% 50%; } }
@media (prefers-reduced-motion: reduce) { .tilt-doc, .tilt-holo { animation: none; } }
/* Step chips shown in the camera ("Tilt towards you", "Tilt back") and a large countdown */
.cam-steps { position: absolute; top: 58px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0 12px; }
.cam-steps span { background: rgba(0,0,0,0.55); color: #e8edf2; border: 1px solid rgba(255,255,255,0.35); border-radius: 999px; padding: 5px 12px; font-size: 0.85rem; }
.cam-steps span.done { background: #0c7a4f; border-color: #12c990; color: #fff; }
.cam-steps span.now { border-color: #fff; color: #fff; font-weight: 700; }
.cam-count { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 5.5rem; font-weight: 800; color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.8); pointer-events: none; font-variant-numeric: tabular-nums; }
.cam-ring line.next { stroke: rgba(255,255,255,0.85); animation: nextBar 1s ease-in-out infinite; }
@keyframes nextBar { 50% { stroke: rgba(255,255,255,0.35); } }


/* Review desk: independent face comparison */
.face-pair { gap: 12px; align-items: flex-start; }
.face-pair figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.face-pair canvas, .feature-row canvas { border-radius: 8px; max-width: 100%; }
.face-pair canvas { width: 120px; height: 144px; }
.blend { position: relative; width: 120px; height: 144px; }
.blend canvas { position: absolute; inset: 0; }
.feature-row { gap: 8px; align-items: center; flex-wrap: nowrap; }
.feature-row canvas { width: 120px; height: auto; }
.video-digits { display: inline-block; margin-top: 8px; font-size: 2.6rem; letter-spacing: 0.35em; font-family: var(--font-data); }
.video-fig video { width: 260px; max-width: 100%; border-radius: 10px; background: #000; }

/* Firm-defined questions */
.field-label { font-weight: 600; font-size: 0.9rem; }
.q-item[hidden] { display: none; }
fieldset > .hint { display: block; margin: -2px 0 8px; }

/* Review desk: Settings */
.settings { max-width: 1320px; }
.seg-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; align-self: flex-start; flex-wrap: wrap; }
.seg-tabs button { border: 0; background: transparent; color: var(--ink-2); min-height: 36px; padding: 6px 14px; font-weight: 600; font-size: 0.9rem; }
.seg-tabs button[aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(7,28,53,0.15); }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
.preview { position: sticky; top: 16px; }
.preview-frame { padding: 18px; max-height: calc(100vh - 90px); overflow: auto; background: var(--paper); }
.preview-frame .grid-2 { grid-template-columns: 1fr; }
.q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.q-row { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: opacity .15s; }
.q-row.off .q-row-text, .q-row.off .q-type { opacity: 0.55; }
.q-row-main { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.q-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-row-text strong { font-weight: 600; overflow-wrap: anywhere; }
.q-cond { font-style: italic; }
.q-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.q-badges:empty { display: none; }
.q-type { width: 36px; height: 36px; flex: none; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; }
.q-row-tools { display: flex; gap: 4px; align-items: center; flex: none; }
button.icon { min-height: 32px; min-width: 32px; padding: 0 8px; font-size: 0.95rem; }
.q-editor { border-top: 1px solid var(--line); padding: 14px 14px 16px 64px; background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); border-radius: 0 0 12px 12px; }
@media (max-width: 700px) { .q-editor { padding-left: 14px; } .q-row-main { flex-wrap: wrap; } .q-row-tools { width: 100%; justify-content: flex-end; } }
.opt-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.opt-list input { flex: 1; min-width: 0; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + span { opacity: 0.6; }
.switch input:disabled { cursor: not-allowed; }
.save-bar { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: 0 -6px 18px rgba(7,28,53,0.08); }

/* Review desk: document authenticity groups */
.auth-groups { gap: 8px; }
.auth-group { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--surface); }
.auth-group[open] { padding-bottom: 12px; }
.auth-group > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; cursor: pointer; list-style: none; }
.auth-group > summary::-webkit-details-marker { display: none; }
.auth-group > summary::after { content: "▸"; margin-left: 4px; color: var(--ink-2); }
.auth-group[open] > summary::after { content: "▾"; }
.auth-confirm { margin-left: auto; }
.auth-group .gallery { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: 8px; }

/* Documentation pages (API guide) */
.doc-page { max-width: 860px; }
.doc-page article h1 { font-size: 1.7rem; margin: 0; }
.doc-page article h2 { font-size: 1.2rem; margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.doc-page article h3 { font-size: 1rem; margin: 8px 0 0; }
.doc-page article p, .doc-page article li { line-height: 1.55; }
.doc-page code { font-family: var(--font-data); font-size: 0.88em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.doc-page pre.mrz code, .doc-page pre { font-size: 0.84rem; }

/* ---------------- Phones and small tablets: app-like layout ---------------- */
.mobile-bar { display: none; }
@media (max-width: 900px) {
  /* review desk: the list or the open record, one at a time, with a back bar */
  .review-app.showing-detail .queue { display: none; }
  .review-app.showing-detail .mobile-bar { display: flex; position: sticky; top: 0; z-index: 5; align-items: center;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 12px 6px; background: var(--sidebar); border-bottom: 1px solid var(--sidebar-line); }
  .mobile-bar button { border: 0; background: transparent; color: #3fe0c3; font-weight: 700; font-size: 1rem; min-height: 44px; padding: 0 8px; }
  .queue-list { max-height: none; }
  .modes { display: flex; overflow-x: auto; scroll-snap-type: x proximity; border-radius: 14px; }
  .modes button { flex: 0 0 auto; scroll-snap-align: start; min-height: 44px; padding: 8px 14px; }
  .modes button[data-mode=outbox][hidden] + button[data-mode=team] { grid-column: auto; }
}
@media (max-width: 600px) {
  /* no zoom on iPhone when a text box is focused */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px; }
  /* every control big enough for a finger */
  button.link { min-height: 44px; padding: 10px 4px; }
  .tabs button, .seg-tabs button { min-height: 44px; }
  button.icon { min-width: 44px; min-height: 44px; }
  details > summary { padding: 10px 0; }
  .seg-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .seg-tabs button { flex: 0 0 auto; }
  /* wide tables become cards */
  table.cardable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.cardable, table.cardable tbody, table.cardable tr, table.cardable td { display: block; width: 100%; }
  table.cardable tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; background: var(--surface); }
  table.cardable td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; text-align: right; overflow-wrap: anywhere; }
  table.cardable td::before { content: attr(data-label); font-weight: 600; color: var(--ink-2); text-align: left; flex: none; max-width: 45%; }
  table.cardable td:empty { display: none; }
  /* applicant steps: Back / Continue always within reach */
  .applicant .actions { position: sticky; bottom: 0; z-index: 3; margin: 8px -26px -26px; padding: 12px 26px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; }
}
@media (max-width: 480px) {
  .applicant .actions { margin: 8px -18px -18px; padding-left: 18px; padding-right: 18px; border-radius: 0 0 14px 14px; }
}
/* main buttons in the dark sidebar: the brand gradient, not navy on navy */
.queue button.primary { background: var(--brand-gradient); color: #071c35; border-color: transparent; }
