/* PilotKYC partner dashboard. Mobile-first, light + dark, no external resources.
   Brand tokens follow the public landing page. */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --border: #e1e6f0;
  --text: #0e1530;
  --muted: #55607a;
  --accent: #2a55e5;
  --accent-strong: #1d41c2;
  --accent-soft: #eaeffd;
  --on-accent: #ffffff;
  --teal: #0a7a70;
  --teal-soft: #e0f4f1;
  --ok: #12805c;
  --ok-soft: #e3f5ee;
  --ok-bd: #a8dcc5;
  --err: #b42318;
  --err-soft: #fdecec;
  --err-bd: #f3b4b4;
  --warn: #8a5200;
  --warn-soft: #fff6e0;
  --warn-bd: #f0cf8a;
  --info: #1d41c2;
  --info-soft: #eaeffd;
  --info-bd: #b9c8f7;
  --code-bg: #0b1020;
  --code-text: #dbe4ff;
  --shadow: 0 1px 2px rgba(14, 21, 48, .05), 0 6px 20px rgba(14, 21, 48, .05);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --focus: #1d41c2;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1f;
    --surface: #121a35;
    --surface-2: #0f1630;
    --border: #243055;
    --text: #e8edff;
    --muted: #9aa6c7;
    --accent: #7c9dff;
    --accent-strong: #a3baff;
    --accent-soft: #19254d;
    --on-accent: #0a0f1f;
    --teal: #39d0c0;
    --teal-soft: #0f2b2b;
    --ok: #4cd6a1;
    --ok-soft: #10302a;
    --ok-bd: #1f6a53;
    --err: #ff9b92;
    --err-soft: #2d1417;
    --err-bd: #7a2a30;
    --warn: #f6d27a;
    --warn-soft: #2b2208;
    --warn-bd: #6e531a;
    --info: #bcd0ff;
    --info-soft: #14214a;
    --info-bd: #2c458f;
    --shadow: none;
    --focus: #a3baff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1f;
  --surface: #121a35;
  --surface-2: #0f1630;
  --border: #243055;
  --text: #e8edff;
  --muted: #9aa6c7;
  --accent: #7c9dff;
  --accent-strong: #a3baff;
  --accent-soft: #19254d;
  --on-accent: #0a0f1f;
  --teal: #39d0c0;
  --teal-soft: #0f2b2b;
  --ok: #4cd6a1;
  --ok-soft: #10302a;
  --ok-bd: #1f6a53;
  --err: #ff9b92;
  --err-soft: #2d1417;
  --err-bd: #7a2a30;
  --warn: #f6d27a;
  --warn-soft: #2b2208;
  --warn-bd: #6e531a;
  --info: #bcd0ff;
  --info-soft: #14214a;
  --info-bd: #2c458f;
  --shadow: none;
  --focus: #a3baff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  overflow-x: hidden;
}
h1, h2, p, ul, ol, dl, dd { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; }
h2 { font-size: 17px; line-height: 1.3; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
code, .mono { font-family: var(--mono); font-size: .92em; }
.mono { overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only, .sprite {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus, main:focus { outline: none; }
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 200; padding: 10px 14px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 8px; }
.noscript { padding: 24px; text-align: center; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 40px; height: 40px; stroke-width: 1.6; }
.logo { width: 32px; height: 32px; flex: none; }

/* ---------- spinner / loading ---------- */
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 44px; height: 44px; border-width: 4px; }
.inline-spin { display: inline-block; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot, .loading { display: grid; place-items: center; padding: 64px 16px; }
.boot { min-height: 100vh; min-height: 100dvh; padding: 0; }
.center-block { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 8px; text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 18px; border-radius: 12px;
  border: 1px solid transparent; font: inherit; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-decoration: none; text-align: center; -webkit-tap-highlight-color: transparent;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--muted); color: var(--text); }
.btn-danger { background: var(--err); color: var(--surface); }
.btn-danger-ghost { background: transparent; color: var(--err); border-color: var(--err-bd); }
.btn-danger-ghost:hover { background: var(--err-soft); color: var(--err); }
.btn-small { min-height: 40px; padding: 6px 14px; font-size: 14px; }
.btn:disabled, .btn.is-busy { opacity: .6; cursor: not-allowed; }
.btn.is-busy { cursor: progress; pointer-events: none; }
.btn-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; flex: none;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.btn-icon:hover { border-color: var(--muted); }
@media (pointer: coarse) { .btn-small { min-height: 44px; } }
.btn-primary.btn-danger { color: #fff; }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.actions-row { flex-direction: row; flex-wrap: wrap; align-items: center; }
@media (min-width: 560px) { .actions:not(.actions-row) { flex-direction: row; flex-wrap: wrap; align-items: center; } }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, legend { font-weight: 600; font-size: 15px; }
.input {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
select.input { appearance: auto; }
.input:hover { border-color: var(--muted); }
.input[aria-invalid="true"] { border-color: var(--err); }
.input[readonly] { background: var(--surface-2); }
.input-sm { min-height: 40px; width: auto; max-width: 100%; padding: 6px 10px; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); }
.field-error, .form-error { font-size: 14px; color: var(--err); font-weight: 500; }
.form-error { padding: 10px 12px; border-radius: 10px; background: var(--err-soft); border: 1px solid var(--err-bd); }
.field-inline { flex-direction: row; align-items: center; gap: 10px; }
.field-inline label { white-space: nowrap; }
.field-inline .input { width: auto; min-width: 120px; }
.radio-group { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
.radio-group legend { padding: 0; margin-bottom: 6px; }
.radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); }
.radio:hover { border-color: var(--muted); }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.radio-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.radio-text small { color: var(--muted); font-size: 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick .btn { min-width: 64px; }

.meter-box { display: flex; flex-direction: column; gap: 6px; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.meter span { height: 6px; border-radius: 3px; background: var(--border); }
.meter[data-level="1"] span:nth-child(-n+1) { background: var(--err); }
.meter[data-level="2"] span:nth-child(-n+2) { background: #d9930d; }
.meter[data-level="3"] span:nth-child(-n+3) { background: var(--ok); }
.meter[data-level="4"] span:nth-child(-n+4) { background: var(--ok); }
.meter-label { font-size: 13px; color: var(--muted); min-height: 19px; }

/* ---------- messages ---------- */
.msg { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--info-bd); background: var(--info-soft); color: var(--info); font-size: 15px; }
.msg .icon { margin-top: 1px; }
.msg-body { min-width: 0; overflow-wrap: anywhere; }
.msg-ok { background: var(--ok-soft); border-color: var(--ok-bd); color: var(--ok); }
.msg-warn { background: var(--warn-soft); border-color: var(--warn-bd); color: var(--warn); }
.msg-error { background: var(--err-soft); border-color: var(--err-bd); color: var(--err); }
.msg-link { color: inherit; font-weight: 600; }
.msg-actions { margin-top: 8px; }
.banner-block { display: block; }
.banners { padding: 12px 16px 0; max-width: 1180px; width: 100%; margin: 0 auto; }
@media (min-width: 900px) { .banners { padding: 20px 32px 0; } }
.topup-status:empty, .secret-host:empty { display: none; }

/* ---------- public layout ---------- */
.pub { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 1100px; width: 100%; margin: 0 auto; }
.pub-main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 16px 16px 32px; }
.pub-foot { text-align: center; font-size: 13px; color: var(--muted); padding: 16px; }
.pub-foot a { color: var(--muted); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; margin-top: 2vh; }
@media (min-width: 480px) { .auth-card { padding: 32px 28px; } }
.auth-card .lead { color: var(--muted); font-size: 15px; }
.auth-alt { font-size: 15px; text-align: center; }
.big-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; align-self: center; }
.big-icon-ok { background: var(--ok-soft); color: var(--ok); border: 2px solid var(--ok-bd); }
.boot-error, .load-error { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 64px 16px; max-width: 480px; margin: 0 auto; }
.boot-error { min-height: 100vh; min-height: 100dvh; justify-content: center; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; min-height: 44px; }
.brand:hover { color: var(--text); }
.controls { display: flex; align-items: center; gap: 8px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.topbar .controls { margin-left: auto; }
.topbar-brand .brand { min-height: 44px; }
.main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(86vw, 300px);
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border);
  padding: 12px; gap: 8px; overflow-y: auto;
  transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s;
}
.drawer-open .sidebar { transform: none; visibility: visible; transition: transform .2s ease; }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(10, 15, 31, .55); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 4px 4px; border-top: 1px solid var(--border); }
.user-tenant { font-weight: 600; overflow-wrap: anywhere; }
.user-email { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; margin-bottom: 6px; }

@media (min-width: 900px) {
  .app { grid-template-columns: 252px minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; width: auto; transform: none; visibility: visible; transition: none; z-index: 10; }
  .scrim, .menu-btn, .topbar-brand, .side-close { display: none !important; }
  .topbar { padding: 12px 32px; background: transparent; border-bottom: 0; position: static; }
  .main { padding: 8px 32px 56px; gap: 20px; }
  h1 { font-size: 28px; }
}

/* ---------- page pieces ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; justify-content: space-between; }
.page-head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lead { color: var(--muted); }
.page-head-actions { display: flex; gap: 8px; align-items: center; }
.detail-id { margin-top: -8px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 600px) { .card { padding: 20px 22px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-flush { gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-primary { border-color: var(--accent); background: var(--accent-soft); }
.stat-label { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.stat-unit { font-size: 14px; font-weight: 600; color: var(--muted); }
.stat-sub { font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 12px; }
.tile { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.tile-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-err { background: var(--err); }
.dot-warn { background: #d9930d; }
.steps { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 28px 12px; color: var(--muted); }
.empty-title { font-weight: 600; color: var(--text); }

.kv { display: flex; flex-direction: column; }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv-row:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: 14px; flex: none; }
.kv dd { text-align: right; min-width: 0; overflow-wrap: anywhere; }

.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-bd); }
.badge-err { background: var(--err-soft); color: var(--err); border-color: var(--err-bd); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-bd); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: var(--info-bd); }
.badge-muted { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge-live { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); }
.badge-test { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.inline-list { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; justify-content: inherit; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.chip-more { color: var(--muted); }
.reasons { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.scores { display: flex; flex-direction: column; gap: 14px; }
.score-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 4px; }
progress { width: 100%; height: 8px; border: 0; border-radius: 4px; overflow: hidden; background: var(--border); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--border); }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
.code { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--code-bg); color: var(--code-text); font-family: var(--mono); font-size: 13px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- tables: stack into cards on narrow screens ---------- */
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .col-actions { text-align: right; }
.cell { display: inline-block; min-width: 0; max-width: 100%; }
.cell .ref, .ref { display: inline-flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-dim { opacity: .65; }
.amt-neg { color: var(--err); }
.amt-pos { color: var(--ok); }
.paged-more { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 12px; }
@media (max-width: 719px) {
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }
  .tbl tr { border: 1px solid var(--border); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: var(--surface); }
  .tbl td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border: 0; text-align: right; }
  .tbl td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; flex: none; }
  .tbl td .cell { text-align: right; overflow-wrap: anywhere; }
  .tbl .ref { align-items: flex-end; }
  .chips { justify-content: flex-end; }
  .tbl .num, .tbl .col-actions { text-align: right; }
}

/* ---------- one-time secret ---------- */
.secret { background: var(--warn-soft); border: 1px solid var(--warn-bd); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.secret-warn { display: flex; gap: 10px; color: var(--warn); font-size: 15px; }
.secret-row { display: flex; flex-wrap: wrap; gap: 8px; }
.secret-row .input { flex: 1 1 220px; min-width: 0; font-size: 14px; }
.secret-actions { display: flex; }

/* ---------- dialog ---------- */
.dlg { border: 1px solid var(--border); border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); width: calc(100vw - 32px); max-width: 440px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.dlg::backdrop { background: rgba(10, 15, 31, .6); }
.dlg-form { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.dlg-body { display: flex; flex-direction: column; gap: 12px; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* ---------- toasts / connection banner ---------- */
.toasts { position: fixed; z-index: 120; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; padding-bottom: env(safe-area-inset-bottom); }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 460px; width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left-width: 4px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.toast-ok { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--err); }
.toast-warn { border-left-color: #d9930d; }
.toast-info { border-left-color: var(--accent); }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; }
.toast-x:hover { color: var(--text); }
.toast-x .icon { width: 16px; height: 16px; }
@media (min-width: 700px) { .toasts { left: auto; right: 20px; bottom: 20px; align-items: flex-end; } }
.conn { position: fixed; z-index: 130; top: 10px; left: 50%; transform: translateX(-50%); width: calc(100vw - 24px); max-width: 560px; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-bd); box-shadow: 0 8px 30px rgba(0, 0, 0, .2); font-size: 14px; }
.conn-text { flex: 1; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .sidebar { transition: none; }
}

/* Long ids (chk_…, top_…) in tables: one line, cut with an ellipsis; the full id is in the title and on the detail page. */
.id-trunc { display: inline-block; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* =====================================================================
   Stage 2: branding, links, reviews, webhook log, security review
   ===================================================================== */
.check { display: flex; gap: 12px; align-items: flex-start; padding: 8px 2px; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
textarea.input { resize: vertical; min-height: 96px; line-height: 1.4; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.field-compact { min-width: 0; }
.field-compact .input { min-width: 0; }

/* ---- branding ---- */
.br-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.br-layout > * { min-width: 0; }
@media (min-width: 1040px) {
  .br-layout { grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
  .br-layout > .card, .br-layout > .br-actions { grid-column: 1; }
  .br-layout > .br-preview { grid-column: 2; grid-row: 1 / span 9; position: sticky; top: 16px; }
}
.br-presets { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .br-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.br-import-row { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; }
.br-import-input-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.br-import-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.br-import-input { width: 100%; padding-left: 38px; height: 44px; }
.br-import-btn { flex: none; height: 44px; white-space: nowrap; }
.br-import-note { margin-top: 8px; font-size: 13px; color: var(--muted); }
.br-import-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); font-size: 12px; margin-top: 6px; }
.br-domain-box { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.br-domain-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.br-domain-name { font-weight: 600; font-size: 15px; word-break: break-all; }
.br-domain-dns { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 8px; padding: 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.br-domain-dns-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.br-domain-dns-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.br-domain-dns-val { font-family: var(--font-mono, monospace); word-break: break-all; font-weight: 600; }
@media (max-width: 639px) {
  .br-domain-dns { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .br-import-row { flex-direction: column; }
  .br-import-btn { width: 100%; }
}
.swatches { display: inline-flex; gap: 4px; margin-top: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); display: inline-block; background: var(--surface-2); }
.swatch-empty { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--border) 4px, var(--border) 5px); }
.color-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 560px) and (max-width: 1039px) { .color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.color-ctl { display: flex; gap: 8px; align-items: center; }
.color-ctl .input { flex: 1 1 auto; min-width: 0; text-transform: lowercase; }
.color-picker { width: 48px; height: 44px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; flex: none; }
.contrast-hint { min-height: 0; }
.contrast-hint:empty { display: none; }
.contrast-hint.is-bad { color: var(--err); }
.br-range-row { display: flex; align-items: center; gap: 12px; }
.br-range { flex: 1 1 auto; min-width: 0; accent-color: var(--accent); height: 44px; }
.br-range-out { min-width: 4.5ch; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.logo-host { display: flex; flex-direction: column; gap: 8px; }
.logo-box { display: inline-flex; align-self: flex-start; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 16px 16px; max-width: 100%; }
.logo-img { display: block; max-width: 100%; height: auto; max-height: 96px; width: auto; }
.br-actions { position: sticky; bottom: 0; z-index: 5; }
.br-pv-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 479px) { .br-pv-controls { grid-template-columns: minmax(0, 1fr); } }
.br-frame-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.br-frame { display: block; width: 100%; height: 560px; border: 0; background: transparent; }
@media (max-width: 1039px) { .br-frame { height: 520px; } }

/* ---- action menus and rows ---- */
.row-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; max-width: 100%; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; display: flex; flex-direction: column; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 36px rgba(0, 0, 0, .28); }
.menu-item { min-height: 44px; padding: 8px 12px; text-align: left; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.is-danger { color: var(--err); }
@media (max-width: 719px) { .menu-list { right: auto; left: 0; } .tbl .row-actions { justify-content: flex-end; } }
.cell-name { overflow-wrap: anywhere; }
.link-url { max-width: 26ch; }
.qr-box { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.qr { width: min(100%, 260px); height: auto; display: block; }

/* ---- reviews, history, webhook test ---- */
.history { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.history-item { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.history-item:last-child { border-bottom: 0; padding-bottom: 0; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-text:empty { display: none; }
.test-result:empty { display: none; }
.tbl .small { font-size: 13px; }

/* ---- Connect Hub (Didit-style Onboarding) ---- */
.conn-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.conn-tab-btn { min-height: 40px; padding: 8px 18px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.conn-tab-btn:hover { color: var(--text); }
.conn-tab-btn.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.conn-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.conn-code-card { margin: 16px 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.conn-code-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.conn-code-badge { display: flex; align-items: center; gap: 8px; }
.code-pre { margin: 0; padding: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 13px; line-height: 1.5; overflow-x: auto; -webkit-overflow-scrolling: touch; color: var(--text); }
.conn-checklist { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.conn-check-item { display: flex; align-items: center; gap: 10px; }
.conn-check-label { flex: 1 1 auto; font-size: 14px; font-weight: 500; }
.conn-wh-row { padding-top: 14px; border-bottom: 0; }
.conn-prod-list { list-style: none; padding: 0; margin: 12px 0 0 0; display: flex; flex-direction: column; gap: 10px; }
.conn-prod-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.conn-prod-item:last-child { border-bottom: 0; }
.sdk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.sdk-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.sdk-card:hover { border-color: var(--accent); background: var(--surface-2); }
.sdk-card.is-selected { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 1px var(--accent); }
.sdk-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.sdk-card-sub { font-size: 12px; margin: 0; }
.sdk-code-box { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); margin-top: 16px; }
.sdk-code-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.nocode-box { display: flex; gap: 24px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.nocode-info { flex: 1 1 300px; }
.nocode-scan-hint { font-size: 14px; margin-bottom: 12px; }

/* Media & Evidence Photos in Verification Detail */
.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.media-card-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2, rgba(255,255,255,0.03)); display: flex; flex-direction: column; }
.media-thumb-box { width: 100%; aspect-ratio: 16/10; overflow: hidden; background: #000; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; }
.media-img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.15s ease; }
.media-thumb-box:hover .media-img { transform: scale(1.02); }
.media-caption { padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; background: var(--surface); border-top: 1px solid var(--border); font-size: 13px; }
.media-thumb-empty { height: 140px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; text-align: center; padding: 16px; }
.break-all { word-break: break-all; }

/* Lightbox overlay */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5); }
.lightbox-head { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.lightbox-img { max-width: 85vw; max-height: 80vh; object-fit: contain; background: #000; }

/* ---- Onboarding Wizard ---- */
.ob-container { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; padding-bottom: 40px; }
.ob-progress { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.ob-progress-step { font-size: 14px; font-weight: 600; color: var(--muted); padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); transition: all 0.2s; }
.ob-progress-step.is-active { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.ob-progress-arrow { color: var(--muted); font-size: 14px; }
.ob-step-wrap { max-width: 640px; margin: 0 auto; width: 100%; }
.ob-url-wrap { position: relative; flex: 1 1 300px; display: flex; align-items: center; }
.ob-url-icon { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.ob-url-input { width: 100%; padding-left: 38px; }
.ob-input-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ob-btn-main { min-width: 180px; }
.ob-skip-row { display: flex; justify-content: flex-end; margin-top: 14px; }
.ob-btn-skip { font-size: 13px; color: var(--muted); }
.ob-step2-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 420px); gap: 24px; align-items: start; }
@media (max-width: 768px) { .ob-step2-grid { grid-template-columns: minmax(0, 1fr); } }
.ob-info-summary { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; }
.ob-info-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ob-preview-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ob-preview-frame-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); height: 500px; }
.ob-preview-frame { width: 100%; height: 100%; border: 0; }
.ob-result-layout { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.ob-qr-box { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--border); width: 180px; height: 180px; flex-shrink: 0; }
.ob-result-details { flex: 1 1 280px; display: flex; flex-direction: column; gap: 8px; }
.ob-copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ob-copy-row .input { flex: 1 1 200px; }
.ob-final-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ---- 6-Step API Key Wizard (Didit-style) ---- */
.dlg-wizard { max-width: 680px; width: 95vw; max-height: 90vh; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4); overflow: hidden; display: flex; flex-direction: column; }
.dlg-wizard::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
.wz-header { padding: 20px 24px 14px 24px; border-bottom: 1px solid var(--border); background: var(--surface); position: relative; }
.wz-top-row { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.wz-icon-box { width: 36px; height: 36px; border-radius: 10px; background: rgba(59, 130, 246, 0.12); color: #3b82f6; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wz-icon-box svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.wz-title-wrap { flex: 1 1 auto; }
.wz-title { font-size: 18px; font-weight: 700; margin: 0 0 4px 0; color: var(--text); }
.wz-subtitle { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.4; }
.wz-close-btn { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.wz-close-btn:hover { color: var(--text); background: var(--surface-2); }
.wz-stepper { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding-top: 4px; -webkit-overflow-scrolling: touch; }
.wz-step-item { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; cursor: pointer; }
.wz-step-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.wz-step-item.is-active { color: #3b82f6; font-weight: 600; }
.wz-step-item.is-active .wz-step-dot { border-color: #3b82f6; background: #3b82f6; color: #fff; }
.wz-step-item.is-done { color: var(--text); }
.wz-step-item.is-done .wz-step-dot { border-color: #10b981; background: #10b981; color: #fff; }
.wz-body { padding: 24px; overflow-y: auto; flex: 1 1 auto; display: flex; flex-direction: column; gap: 20px; }
.wz-footer { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wz-footer-left { display: flex; gap: 10px; }
.wz-footer-right { display: flex; gap: 10px; }
.wz-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 600px) { .wz-grid-2 { grid-template-columns: 1fr; } }
.wz-card-choice { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); cursor: pointer; display: flex; align-items: flex-start; gap: 12px; transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
.wz-card-choice:hover { border-color: rgba(59, 130, 246, 0.5); }
.wz-card-choice.is-selected { border-color: #3b82f6; background: rgba(59, 130, 246, 0.05); box-shadow: 0 0 0 1px #3b82f6; }
.wz-card-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); margin-top: 2px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.wz-card-choice.is-selected .wz-card-radio { border-color: #3b82f6; }
.wz-card-choice.is-selected .wz-card-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #3b82f6; }
.wz-card-content { flex: 1 1 auto; }
.wz-card-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; color: var(--text); }
.wz-card-desc { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.35; }
.wz-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wz-pill { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.wz-pill:hover { border-color: var(--text); color: var(--text); }
.wz-pill.is-active { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.wz-resource-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); font-size: 13px; }
.wz-resource-table th { background: var(--surface); padding: 10px 14px; text-align: left; font-weight: 600; border-bottom: 1px solid var(--border); color: var(--muted); }
.wz-resource-table th.col-cb { width: 70px; text-align: center; }
.wz-resource-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.wz-resource-table tr:last-child td { border-bottom: 0; }
.wz-resource-table .group-row td { background: rgba(255, 255, 255, 0.02); font-weight: 700; font-size: 11px; letter-spacing: 0.5px; color: var(--muted); text-transform: uppercase; padding: 8px 14px; }
.wz-res-name { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.wz-res-desc { font-size: 12px; color: var(--muted); line-height: 1.3; }
.wz-cb-center { text-align: center; }
.wz-cb-center input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: #3b82f6; }
.wz-summary-box { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 16px; }
.wz-sum-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 13px; }
.wz-sum-row:last-child { border-bottom: 0; }
.wz-sum-label { color: var(--muted); }
.wz-sum-val { font-weight: 500; color: var(--text); text-align: right; }
.wz-can-list { list-style: none; padding: 0; margin: 10px 0 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.wz-can-item { display: flex; align-items: flex-start; gap: 8px; }
.wz-can-item.can { color: #10b981; }
.wz-can-item.cannot { color: var(--muted); text-decoration: line-through; }
.wz-mt { margin-top: 10px; }
.wz-mt-sm { margin-top: 8px; }
.wz-col-stack { display: flex; flex-direction: column; gap: 10px; }
.wz-col-stack-sm { display: flex; flex-direction: column; gap: 8px; }
.wz-can-title { color: #10b981; }
.wz-cannot-title { color: var(--muted); }

/* ---- Connect Hub: MCP View ---- */
.conn-mt-xs { margin-top: 6px; }
.conn-mcp-grid { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.conn-mcp-col { min-width: 0; }
.conn-mcp-col-main { flex: 2 1 320px; }
.conn-mcp-col-side { flex: 1 1 260px; }
.conn-mcp-desc { line-height: 1.6; margin-bottom: 16px; }
.conn-mcp-clients { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.conn-mcp-badge { color: #fff; padding: 6px 12px; border-radius: 6px; font-weight: 600; }
.conn-mcp-badge-antigravity { background: linear-gradient(135deg, #7c3aed, #2563eb); }
.conn-mcp-badge-claude { background: #4f46e5; }
.conn-mcp-badge-chatgpt { background: #10a37f; }
.conn-mcp-badge-cursor { background: #0284c7; }
.conn-mcp-badge-cc { background: #d97706; }
.conn-mcp-badge-vscode { background: #2563eb; }
.conn-mcp-badge-any { background: #64748b; }
.conn-mcp-card-accent { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 20px; }
.conn-mcp-accent-title { display: block; font-size: 15px; margin-bottom: 6px; }
.conn-mcp-accent-desc { font-size: 13px; margin: 0; }
.conn-mcp-claude-btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 12px 20px; font-weight: 600; margin-top: 12px; }
.conn-mcp-url-label { font-size: 13px; font-weight: 600; color: var(--muted); display: block; }
.conn-mcp-url-row { display: flex; gap: 8px; margin: 12px 0 20px 0; flex-wrap: wrap; }
.conn-mcp-url-input { flex: 1 1 280px; min-width: 0; }
.conn-mcp-subtabs { margin-bottom: 12px; }
.conn-mcp-code { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.conn-mcp-guarantees { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.conn-mcp-guarantee-item { display: flex; gap: 10px; font-size: 13px; line-height: 1.5; align-items: flex-start; }
.conn-mcp-guarantee-title { display: block; margin-bottom: 2px; }

/* ---- Telegram Archive (Webhooks View) ---- */
.bad { color: var(--err); font-weight: 500; }
.tg-connected-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.tg-meta-line { margin: 0; }
.tg-actions-row { margin-top: 16px; }
.tg-code-box { background: var(--surface-2); border: 2px dashed var(--border); border-radius: 8px; padding: 20px; text-align: center; margin: 16px 0; }
.tg-code-caption { margin-bottom: 8px; }
.tg-code-digits { font-size: 32px; font-weight: 700; letter-spacing: 6px; color: var(--accent); margin: 8px 0; }
.tg-code-sub { margin-top: 8px; }
.tg-group-tip { margin: 16px 0; }
.tg-connect-btn { padding: 10px 20px; font-size: 15px; }
.tg-hints { margin-top: 12px; }
.tg-connect-wrap { margin-top: 16px; }
.ov-connect-cta { margin-bottom: 12px; }

/* =====================================================================
   Stage 14: Didit Business Console (Verification Dossier & List Filters)
   ===================================================================== */

:root[data-theme="dark"] .dossier-shell,
:root:not([data-theme="light"]) .dossier-shell {
  --dossier-obsidian: #0a0f1f;
  --dossier-slate: #11172a;
}

/* ---- 1. Wide Console Viewport for Dossier ---- */
.main:has(.dossier-shell) {
  max-width: 1480px;
  padding: 12px 24px 64px;
}
.dossier-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

/* ---- 2. Topbar & Breadcrumb Switcher ---- */
.dossier-topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.dossier-crumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  min-width: 0;
}
.dossier-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.dossier-back:hover {
  background: var(--surface);
  color: var(--text);
}
.dossier-crumb-sep {
  color: var(--muted);
  opacity: 0.6;
  user-select: none;
}
.dossier-crumb-current {
  color: var(--text);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 28ch;
}
.dossier-topbar-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
.dossier-pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.3;
}
.dossier-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.dossier-pager-btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border);
}
.dossier-pager-btn:disabled,
.dossier-pager-btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.dossier-pager-label {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---- 3. Hero Applicant Header ---- */
.dossier-hero {
  background: radial-gradient(circle at 80% 0%, var(--accent-soft), transparent 55%), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
:root[data-theme="dark"] .dossier-hero {
  background:
    radial-gradient(circle at 80% 0%, var(--accent-soft), transparent 55%),
    radial-gradient(rgba(154, 166, 199, 0.08) 1px, transparent 1px) 0 0 / 16px 16px,
    #11172a;
}
.dossier-hero-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1 1 320px;
}
.dossier-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dossier-flag {
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.dossier-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text);
}
.dossier-meta-row {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.dossier-id-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-family: var(--mono);
  color: var(--text);
}
.dossier-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  transition: color 0.15s, background 0.15s;
}
.dossier-copy-btn:hover {
  color: var(--text);
  background: var(--border);
}
.dossier-meta-sep {
  color: var(--border);
  user-select: none;
}
.dossier-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}
.dossier-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dossier-btn-decline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--err-bd);
  background: var(--err-soft);
  color: var(--err);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, border-color 0.15s;
}
.dossier-btn-decline:hover:not(:disabled) {
  filter: brightness(1.08);
}
.dossier-btn-approve {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--ok-bd);
  background: var(--ok);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}
:root[data-theme="dark"] .dossier-btn-approve {
  color: #071510;
}
.dossier-btn-approve:hover:not(:disabled) {
  filter: brightness(1.08);
}
.dossier-btn-decline:disabled,
.dossier-btn-approve:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dossier-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 5px;
  font-size: 11px;
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ---- 4. 3-Column Sticky Dossier Grid ---- */
.dossier-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}
.dossier-nav,
.dossier-main,
.dossier-aside {
  min-width: 0;
}
@media (min-width: 1180px) {
  .dossier-grid {
    grid-template-columns: 220px minmax(0, 1fr) 260px;
    gap: 20px;
    align-items: start;
  }
  .dossier-nav,
  .dossier-aside {
    position: sticky;
    top: 72px;
  }
  .dossier-nav {
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}
@media (min-width: 860px) and (max-width: 1179px) {
  .dossier-grid {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .dossier-nav {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .dossier-aside {
    grid-column: 1 / -1;
  }
}
@media (max-width: 859px) {
  .dossier-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .dossier-nav {
    position: static;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dossier-nav-card {
    flex-direction: row !important;
    align-items: center;
    overflow-x: auto;
    padding: 8px 10px !important;
    gap: 8px !important;
  }
  .dossier-nav-group {
    flex-direction: row !important;
    align-items: center;
    gap: 4px !important;
  }
  .dossier-nav-title,
  .dossier-nav-group-label,
  .dossier-nav-legend,
  .dossier-nav-chrono {
    display: none !important;
  }
  .dossier-nav-link {
    white-space: nowrap;
  }
}

/* ---- 5. Left Section Navigation Rail ---- */
.dossier-nav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
:root[data-theme="dark"] .dossier-nav-card {
  background: #11172a;
}
.dossier-nav-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 8px;
}
.dossier-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dossier-nav-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 4px 10px 2px;
  opacity: 0.8;
}
.dossier-nav-link {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  gap: 8px;
}
.dossier-nav-link:hover {
  background: rgba(124, 157, 255, 0.09);
  color: var(--text);
}
.dossier-nav-link.is-active {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}
.dossier-nav-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dossier-nav-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.dossier-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dossier-nav-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.dossier-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dossier-nav-chrono {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.dossier-chrono-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

/* ---- 6. Sections & Cards ---- */
.dossier-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.dossier-section {
  scroll-margin-top: 84px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.dossier-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.dossier-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dossier-sec-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dossier-sec-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}
.dossier-sec-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.dossier-sec-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.dossier-sec-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dossier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
:root[data-theme="dark"] .dossier-card {
  background: #11172a;
}
.dossier-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.dossier-card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.dossier-spend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

/* ---- 7. Identity & Media Spotlight ---- */
.dossier-spotlight {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 679px) {
  .dossier-spotlight {
    grid-template-columns: minmax(0, 1fr);
  }
}
.dossier-spotlight-media {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.dossier-spotlight-stage {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: #070b16;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.dossier-spotlight-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}
.dossier-spotlight-stage:hover .dossier-spotlight-img {
  transform: scale(1.08);
}
.dossier-spotlight-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dossier-thumb-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}
.dossier-thumb-btn:hover {
  border-color: var(--muted);
  color: var(--text);
}
.dossier-thumb-btn.is-active {
  border-color: var(--accent);
  color: var(--text);
}
.dossier-thumb-img {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  background: #070b16;
  display: block;
}
.dossier-spotlight-hint {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dossier-viewer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.dossier-viewer-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dossier-spotlight-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.dossier-spotlight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.dossier-session-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
}
.dossier-identity-rows {
  display: flex;
  flex-direction: column;
}
.dossier-identity-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 24px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.dossier-identity-row:last-child {
  border-bottom: 0;
}
@media (max-width: 520px) {
  .dossier-identity-row {
    grid-template-columns: 120px minmax(0, 1fr) 24px;
    gap: 8px;
  }
}
.dossier-id-label {
  color: var(--muted);
  font-weight: 500;
}
.dossier-id-val {
  color: var(--text);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.dossier-id-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ok);
  font-size: 14px;
}

/* ---- 8. 4 KPI Mini-Cards & Risk Breakdown ---- */
.dossier-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 719px) {
  .dossier-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.dossier-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
:root[data-theme="dark"] .dossier-kpi-card {
  background: #11172a;
}
.dossier-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}
.dossier-kpi-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.dossier-kpi-sub {
  font-size: 12px;
  color: var(--muted);
}
.dossier-overview-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 759px) {
  .dossier-overview-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
.dossier-risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 479px) {
  .dossier-risk-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.dossier-risk-box {
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dossier-risk-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.dossier-risk-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dossier-risk-val.is-low { color: var(--ok); }
.dossier-risk-val.is-med { color: var(--warn); }
.dossier-risk-val.is-high { color: var(--err); }
.dossier-risk-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}
.dossier-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.dossier-spend-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
:root[data-theme="dark"] .dossier-spend-card {
  background: #11172a;
}
.dossier-spend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
}
.dossier-spend-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* ---- 9. Profile & Face Comparison ---- */
.dossier-profile-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 759px) {
  .dossier-profile-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
.dossier-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}
@media (max-width: 559px) {
  .dossier-profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.dossier-field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.dossier-field-label {
  color: var(--muted);
  font-weight: 500;
  flex: none;
}
.dossier-field-val {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}
.dossier-face-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dossier-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.dossier-tab {
  flex: 1 1 auto;
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}
.dossier-tab:hover {
  color: var(--text);
}
.dossier-tab.is-active {
  background: var(--accent-soft);
  color: var(--text);
}
.dossier-face-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}
.dossier-face-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #070b16;
  cursor: zoom-in;
}
.dossier-face-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---- 10. Events Timeline, Documents Grid & World Map ---- */
.dossier-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dossier-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.dossier-pill:hover {
  border-color: var(--muted);
  color: var(--text);
}
.dossier-pill.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}
.dossier-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dossier-tl-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.dossier-tl-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.dossier-tl-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 13px;
  color: var(--accent);
}
.dossier-tl-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dossier-tl-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dossier-tl-code {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.dossier-tl-meta {
  font-size: 12.5px;
  color: var(--muted);
}
.dossier-tl-time {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: auto;
}
.dossier-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.dossier-doc-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
}
.dossier-doc-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #070b16;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}
.dossier-doc-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.dossier-doc-preview:hover img {
  transform: scale(1.04);
}
.dossier-doc-meta {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.dossier-loc-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}
.dossier-world-map {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #080d1a;
  border: 1px solid var(--border);
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dossier-world-map svg {
  width: 100%;
  height: auto;
  max-height: 220px;
  display: block;
}
.dossier-map-pin {
  fill: #f97316;
  stroke: #fff;
  stroke-width: 1.5px;
}
.dossier-map-pin-ring {
  fill: rgba(249, 115, 22, 0.25);
  stroke: rgba(249, 115, 22, 0.6);
  stroke-width: 1px;
}
.dossier-map-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(10, 15, 31, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e8edff;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.dossier-loc-list {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dossier-loc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.dossier-loc-row:last-child {
  border-bottom: 0;
}

/* ---- 11. Right Sticky Aside ---- */
.dossier-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dossier-aside-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
:root[data-theme="dark"] .dossier-aside-card {
  background: #11172a;
}
.dossier-aside-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.dossier-aside-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0;
}
.dossier-aside-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dossier-aside-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
}
.dossier-aside-label {
  color: var(--muted);
  flex: none;
}
.dossier-aside-val {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}
.dossier-aside-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.dossier-aside-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---- 12. Pro Lightbox ---- */
.lightbox-pro {
  background: #0b1020;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(94vw, 1120px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.lightbox-stage {
  flex: 1 1 auto;
  min-height: 360px;
  max-height: calc(92vh - 68px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050811;
  padding: 20px;
}
.lightbox-img {
  transition: transform 0.2s ease;
  transform-origin: center center;
}
.lightbox-img.zoom-10 { transform: scale(1); }
.lightbox-img.zoom-15 { transform: scale(1.5); }
.lightbox-img.zoom-20 { transform: scale(2); }
.lightbox-img.rot-90 { transform: rotate(90deg); }
.lightbox-img.rot-180 { transform: rotate(180deg); }
.lightbox-img.rot-270 { transform: rotate(270deg); }
.lightbox-img.zoom-15.rot-90 { transform: scale(1.5) rotate(90deg); }
.lightbox-img.zoom-15.rot-180 { transform: scale(1.5) rotate(180deg); }
.lightbox-img.zoom-15.rot-270 { transform: scale(1.5) rotate(270deg); }
.lightbox-img.zoom-20.rot-90 { transform: scale(2) rotate(90deg); }
.lightbox-img.zoom-20.rot-180 { transform: scale(2) rotate(180deg); }
.lightbox-img.zoom-20.rot-270 { transform: scale(2) rotate(270deg); }

/* ---- 13. Verifications List Filters ---- */
.ver-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
:root[data-theme="dark"] .ver-toolbar {
  background: #11172a;
}
.ver-search-input {
  flex: 1 1 240px;
  min-width: 200px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}
.ver-search-input:focus {
  border-color: var(--accent);
}
.ver-status-pills,
.ver-filter-pills,
.dossier-filter-tabs,
.dossier-mini-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ver-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ver-search-wrap {
  flex: 1 1 260px;
  min-width: 220px;
}
.ver-filter-pill,
.dossier-filter-tab,
.dossier-mini-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.dossier-mini-tab {
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11.5px;
}
.ver-filter-pill:hover,
.dossier-filter-tab:hover,
.dossier-mini-tab:hover {
  border-color: var(--muted);
  color: var(--text);
}
.ver-filter-pill.is-active,
.dossier-filter-tab.is-active,
.dossier-mini-tab.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}
.dossier-id-rows {
  display: flex;
  flex-direction: column;
}
.dossier-id-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.dossier-id-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.dossier-check-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid rgba(22, 163, 74, 0.35);
  flex: none;
}
.dossier-face-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dossier-tl-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 13px;
}
.dossier-tl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dossier-tl-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.dossier-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.dossier-doc-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #070b16;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.dossier-doc-thumb .media-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dossier-doc-thumb.is-portrait-crop .media-img {
  object-fit: cover;
  object-position: left center;
}
.dossier-doc-compare-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
}
.dossier-world-map {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  min-height: 248px;
  background: radial-gradient(circle at 50% 50%, #111c38 0%, #070e1d 100%);
  border: 1px solid var(--border);
  user-select: none;
}
.dossier-map-canvas {
  width: 100%;
  height: 248px;
  display: block;
  cursor: grab;
}
.dossier-map-canvas:active {
  cursor: grabbing;
}
.dossier-map-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.dossier-map-top-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}
.dossier-map-mode-group,
.dossier-map-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(10, 15, 31, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.dossier-map-ctrl-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.dossier-map-ctrl-btn:hover {
  color: #f8fafc;
}
.dossier-map-ctrl-btn.is-active {
  background: rgba(59, 107, 255, 0.28);
  color: #ffffff;
}
.dossier-map-icon-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: #e2e8f0;
  width: 26px;
  height: 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.dossier-map-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.dossier-map-bottom-bar {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 2;
}
.dossier-map-caption {
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(10, 15, 31, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.dossier-map-osm-link {
  padding: 4px 10px;
  border-radius: 7px;
  background: rgba(10, 15, 31, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
  backdrop-filter: blur(6px);
  pointer-events: auto;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.dossier-map-osm-link:hover {
  color: #ffffff;
  border-color: rgba(147, 197, 253, 0.5);
}
.dossier-loc-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.dossier-loc-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.dossier-loc-title {
  font-size: 15px;
  display: block;
  margin-bottom: 2px;
}
.dossier-loc-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.dossier-loc-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dossier-loc-meta-wide {
  grid-column: 1 / -1;
  padding-top: 4px;
}


