/* ============================================================
   FaceDB admin — clean, airy SaaS admin (light, blue accent)
   ============================================================ */
:root {
  --accent:        #2A6FDB;
  --accent-press:  #1f57b0;
  --accent-soft:   #eaf1fc;
  --accent-soft-2: #f4f8fe;

  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --surface-2: #fbfcfd;
  --border:    #e5e8ed;
  --border-2:  #eef0f4;

  --ink:       #161b26;
  --ink-2:     #424b5b;
  --ink-3:     #6b7585;
  --ink-4:     #98a1b0;

  --green:     #1f8a5b;
  --green-soft:#e7f4ee;
  --red:       #d33a2c;
  --red-soft:  #fbeceb;
  --amber:     #c77514;
  --amber-soft:#fbf1e3;

  --radius:    10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 1px rgba(16,24,40,.04);
  --shadow-md: 0 4px 14px rgba(16,24,40,.07), 0 1px 3px rgba(16,24,40,.05);
  --shadow-lg: 0 18px 44px rgba(16,24,40,.14), 0 4px 12px rgba(16,24,40,.08);

  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
::selection { background: var(--accent-soft); }

/* ---------- App layout ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 20px 18px;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(150deg, var(--accent), #4f8bef);
  display: grid; place-items: center;
  box-shadow: 0 3px 8px rgba(42,111,219,.32);
  flex: none;
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-name { font-weight: 650; font-size: 15.5px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--ink-4); font-weight: 500; margin-top: 1px; }

.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.nav-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-4); padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 530; cursor: pointer;
  border: none; background: none; text-align: left; width: 100%;
  transition: background .12s, color .12s;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item > span:not(.nav-badge) { white-space: nowrap; }
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--ink-3); transition: color .12s; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active svg { color: var(--accent); }
.nav-item .nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 650;
  background: var(--accent); color: #fff; border-radius: 20px;
  min-width: 19px; height: 19px; padding: 0 6px;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-badge { background: var(--accent); }
.nav-item .nav-badge.muted { background: var(--border); color: var(--ink-3); }

/* ---------- API config block ---------- */
.api-config { padding: 14px; border-top: 1px solid var(--border); }
.api-config label { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); display: block; margin-bottom: 6px; }
.api-row { display: flex; gap: 6px; }
.api-config input {
  flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink);
  font-size: 12.5px; font-family: var(--mono);
}
.api-config input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.api-status { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.dot.checking { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* ---------- Main content ---------- */
.main { overflow-y: auto; min-height: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246,247,249,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 20px 34px 18px;
}
.topbar h1 { margin: 0; font-size: 21px; font-weight: 660; letter-spacing: -.02em; }
.topbar p { margin: 3px 0 0; color: var(--ink-3); font-size: 13px; }
.page { padding: 28px 34px 60px; max-width: 1180px; }

/* ---------- Generic UI ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 580; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, opacity .12s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-press); }
.btn-primary:disabled { background: var(--ink-4); cursor: not-allowed; opacity: .6; }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(.94); }
.btn-red { background: var(--surface); color: var(--red); border-color: #f0c8c4; }
.btn-red:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }

/* per-face delete button (gallery person detail) */
.face-del {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 6px; border: 1px solid #f0c8c4;
  background: var(--surface); color: var(--red); cursor: pointer;
  opacity: 0; transition: opacity .14s, background .14s;
}
.card:hover .face-del { opacity: 1; }
.face-del:hover { background: var(--red-soft); }
.face-del:disabled { cursor: not-allowed; opacity: .4; }
.face-del svg { width: 13px; height: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 30px; font-size: 11.5px; font-weight: 620; letter-spacing: .01em;
}
.badge svg { width: 12px; height: 12px; }
.badge-match { background: var(--green-soft); color: var(--green); }
.badge-nomatch { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--border); }
.badge-pass { background: var(--green-soft); color: var(--green); }
.badge-fail { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-neutral { background: var(--accent-soft); color: var(--accent); }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius-lg);
  background: var(--surface-2); padding: 38px 28px; text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft-2); }
.dropzone .dz-icon { width: 46px; height: 46px; margin: 0 auto 14px; color: var(--ink-4); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.dropzone .dz-icon svg { width: 23px; height: 23px; }
.dropzone h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.dropzone p { margin: 0; color: var(--ink-3); font-size: 13px; }
.dropzone .accent { color: var(--accent); font-weight: 600; }

/* ---------- States ---------- */
.empty { text-align: center; padding: 60px 24px; color: var(--ink-3); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 16px; color: var(--ink-4); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; }
.empty-icon svg { width: 27px; height: 27px; }
.empty h3 { margin: 0 0 5px; color: var(--ink-2); font-size: 16px; font-weight: 600; }
.empty p { margin: 0 auto; max-width: 380px; font-size: 13.5px; }

.spinner { width: 18px; height: 18px; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; gap: 11px; padding: 40px; justify-content: center; color: var(--ink-3); font-weight: 500; }

.alert { display: flex; gap: 11px; padding: 13px 15px; border-radius: var(--radius); font-size: 13px; line-height: 1.45; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-error { background: var(--red-soft); color: #9a2820; border: 1px solid #f0c8c4; }
.alert-error a { color: inherit; }
.alert-info { background: var(--accent-soft); color: #1c4a93; border: 1px solid #cfe0f8; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); padding: 9px 12px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- Face crop visuals ---------- */
.crop {
  background: repeating-linear-gradient(45deg, #eceef2, #eceef2 7px, #f4f6f9 7px, #f4f6f9 14px);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  position: relative; overflow: hidden; display: grid; place-items: center;
}
.crop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.crop .crop-label { position: absolute; bottom: 0; left: 0; right: 0; font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-4); background: rgba(255,255,255,.82); padding: 3px; text-align: center; }
.crop .ph-face { color: var(--ink-4); }
.crop .ph-face svg { width: 38%; height: 38%; }
.crop .crop-expand {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  width: 22px; height: 22px; display: grid; place-items: center;
  border: none; border-radius: 6px; background: rgba(16,24,40,.55); color: #fff;
  cursor: zoom-in; opacity: 0; transition: opacity .14s, background .14s;
}
.crop:hover .crop-expand { opacity: 1; }
.crop .crop-expand:hover { background: rgba(16,24,40,.8); }
.crop .crop-expand svg { width: 13px; height: 13px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: 4vh 4vw; background: rgba(8,12,20,.86); cursor: zoom-out;
  opacity: 0; transition: opacity .16s ease;
}
.lightbox.open { opacity: 1; }
.lightbox img {
  max-width: 92vw; max-height: 88vh; object-fit: contain;
  border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.55); background: #0d1017;
}
.lightbox-close {
  position: fixed; top: 18px; right: 20px; width: 38px; height: 38px;
  display: grid; place-items: center; border: none; border-radius: 9px;
  background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,.26); }
.lightbox-close svg { width: 18px; height: 18px; }
.lightbox-cap {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: #e7ebf2; font-size: 13px; background: rgba(8,12,20,.6);
  padding: 6px 12px; border-radius: 8px; max-width: 80vw; text-align: center;
}

/* ---------- Pager ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 20px; }
.pager-info { font-size: 12.5px; }
.pager-nav { display: flex; gap: 5px; }
.pager-btn {
  min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-2); border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 560; transition: background .12s, border-color .12s;
}
.pager-btn:hover:not(:disabled):not(.cur) { background: var(--surface-2); border-color: var(--ink-4); }
.pager-btn.cur { background: var(--accent); color: #fff; border-color: var(--accent); cursor: default; }
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 25px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 11.5px; color: var(--ink-3); font-weight: 540; margin-top: 2px; }
.kpi.green .v { color: var(--green); }
.kpi.red .v { color: var(--red); }
.kpi.amber .v { color: var(--amber); }
.kpi.accent .v { color: var(--accent); }

/* slider */
.range-wrap { display: flex; align-items: center; gap: 14px; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 5px; border-radius: 4px; background: var(--border); flex: 1; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2.5px solid #fff; box-shadow: var(--shadow-sm); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2.5px solid #fff; }

.meter { height: 7px; border-radius: 6px; background: var(--border-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.meter.green > span { background: var(--green); }
.meter.red > span { background: var(--red); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 30px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  font-size: 12.5px; font-weight: 540; cursor: pointer; transition: all .12s;
}
.chip:hover { border-color: var(--ink-4); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.divider { height: 1px; background: var(--border); margin: 22px 0; border: none; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 16px; font-weight: 640; letter-spacing: -.01em; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }

/* ---------- Modal overlay ---------- */
.overlay-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 24, 40, .55);
  display: grid; place-items: center; padding: 28px;
  animation: ov-fade .12s ease-out;
}
@keyframes ov-fade { from { opacity: 0; } to { opacity: 1; } }
.overlay-card {
  position: relative; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(880px, 100%); max-height: 88vh; overflow: auto;
  animation: ov-pop .14s cubic-bezier(.2,.7,.3,1);
}
@keyframes ov-pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.overlay-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-3); cursor: pointer;
}
.overlay-close:hover { background: var(--surface-2); color: var(--ink); }
.overlay-close svg { width: 16px; height: 16px; }

/* ---------- Structured metadata ---------- */
.meta { display: flex; flex-direction: column; gap: 16px; }
.meta-section { }
.meta-h {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 7px;
}
.meta-row {
  display: grid; grid-template-columns: 130px 1fr; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--border-2); align-items: baseline;
}
.meta-row:last-child { border-bottom: none; }
.meta-k { color: var(--ink-3); font-size: 12.5px; }
.meta-v { color: var(--ink); font-size: 13.5px; word-break: break-word; }
.meta-v a { text-decoration: none; }
.meta-v a:hover { text-decoration: underline; }

/* ============================================================
   Match detail modal + signature viz + video tab (Sitaidel FRS)
   ============================================================ */

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16,24,40,.46); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 28px;
  opacity: 0; transition: opacity .16s ease;
}
.modal-overlay.open { opacity: 1; }
.modal {
  position: relative; width: 560px; max-width: 100%; max-height: calc(100vh - 56px);
  overflow: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 22px 24px 24px; transform: translateY(8px) scale(.99); transition: transform .18s ease;
}
.modal-overlay.open .modal { transform: none; }
.modal-wide { width: 660px; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface);
  border-radius: 8px; color: var(--ink-3); cursor: pointer; transition: background .14s, color .14s;
}
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-close svg { width: 16px; height: 16px; }

/* ---------- Match detail ---------- */
.match-detail { display: block; }
.md-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-right: 34px; }
.md-name { font-size: 19px; font-weight: 680; letter-spacing: -.01em; line-height: 1.2; }
.md-score { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.md-score-v { font-size: 26px; font-weight: 720; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.md-crops { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 18px 0 6px; }
.md-crop { max-width: 190px; margin: 0 auto; width: 100%; }
.md-arrow { color: var(--ink-4); display: grid; place-items: center; }
.md-section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; font-size: 12px; font-weight: 640; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.md-section-title svg { width: 15px; height: 15px; color: var(--accent); }
.md-meta { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.md-meta td { font-size: 12.5px; }
.md-cands { display: flex; flex-direction: column; gap: 7px; }
.md-cand { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); }
.md-footer { display: flex; gap: 10px; margin-top: 22px; }
.md-footer .btn { flex: 1; justify-content: center; }

/* ---------- Signature visualization ---------- */
.sig { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.sig-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.sig-metric { text-align: center; padding: 9px 6px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; }
.sig-metric-v { font-size: 16px; font-weight: 680; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sig-metric-l { font-size: 10px; color: var(--ink-3); font-weight: 560; margin-top: 3px; line-height: 1.25; }
.sig-metric-h { font-size: 9px; color: var(--ink-4); margin-top: 2px; line-height: 1.2; }
.sig-metric.green { background: var(--green-soft); border-color: #c7e6d6; }
.sig-metric.green .sig-metric-v { color: var(--green); }
.sig-metric.red { background: var(--red-soft); border-color: #f0c8c4; }
.sig-metric.red .sig-metric-v { color: var(--red); }
.sig-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; margin-bottom: 8px; }
.sig-row-label { font-size: 11px; font-weight: 600; color: var(--ink-3); text-align: right; }
.sig-bars { display: flex; align-items: flex-end; gap: 1px; height: 38px; padding: 0 2px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 6px; overflow: hidden; }
.sig-bar { flex: 1; min-width: 0; border-radius: 1px 1px 0 0; align-self: flex-end; }
.sig-bars.probe .sig-bar { background: var(--accent); opacity: .85; }
.sig-bars.gallery .sig-bar { background: #6E56CF; opacity: .82; }
.sig-bars.contrib .sig-bar.agree { background: var(--green); opacity: .85; }
.sig-bars.contrib .sig-bar.conflict { background: var(--red); opacity: .8; }
.sig-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--ink-3); }
.sig-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sig-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.dot-agree { background: var(--green); }
.dot-conflict { background: var(--red); }

/* ---------- Match row (Identify) hover ---------- */
.match-row { transition: border-color .14s, box-shadow .14s, transform .05s; }
.match-row:hover { border-color: var(--accent) !important; box-shadow: var(--shadow-sm); }
.match-row:active { transform: translateY(.5px); }
.match-row-cta { display: inline-flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--accent); opacity: 0; transition: opacity .14s; }
.match-row:hover .match-row-cta { opacity: 1; }
.match-row-cta svg { width: 12px; height: 12px; }

/* ---------- Video tab ---------- */
.vgrid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.vpanel { padding: 0; overflow: hidden; }
.vstage { position: relative; background: #0d1017; aspect-ratio: 16/9; display: grid; place-items: center; }
.vstage video { width: 100%; height: 100%; object-fit: contain; display: block; background: #0d1017; }
.voverlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.vresults { padding: 0; display: flex; flex-direction: column; max-height: 640px; }
.vresults-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.vresults-head h2 { margin: 0; font-size: 14px; font-weight: 640; }
.vresults-list { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.vresult { display: grid; grid-template-columns: 52px 1fr 30px; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--border-2); border-radius: 9px; background: var(--surface); transition: border-color .14s, background .14s; }
.vresult:hover { border-color: var(--border); background: var(--surface-2); }
.vresult.sel { border-color: var(--accent); background: var(--accent-soft-2); box-shadow: 0 0 0 1px var(--accent) inset; }
.vresult-time { font-size: 11px; font-weight: 640; color: var(--accent); background: var(--accent-soft); border: none; border-radius: 6px; padding: 6px 4px; cursor: pointer; font-variant-numeric: tabular-nums; }
.vresult-time:hover { background: var(--accent); color: #fff; }
.vresult-body { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.vresult-arrow { color: var(--ink-4); flex: none; }
.vresult-expand { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; color: var(--ink-3); cursor: pointer; transition: background .14s, color .14s, border-color .14s; }
.vresult-expand:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.vresult-expand svg { width: 14px; height: 14px; }

@media (max-width: 1080px) {
  .vgrid { grid-template-columns: 1fr; }
  .vresults { max-height: none; }
}
