:root {
  --bg: #0a0a0a;
  --panel: #111111;
  --panel-2: #161616;
  --line: #262626;
  --line-strong: #333333;
  --accent: #00e599;
  --accent-dim: rgba(0, 229, 153, 0.12);
  --accent-ink: #05150f;
  --green: var(--accent);
  --green-dim: var(--accent-dim);
  --red: #ff5c5c;
  --amber: #f5b942;
  --text: #ededed;
  --dim: #a1a1aa;
  --muted: #737373;
  --heading: #ffffff;
  --sidebar-bg: #0d0d0d;
  --input-bg: #0d0d0d;
  --nav-active-bg: #1a1a1a;
  --avatar-bg: #1a1a1a;
  --shadow: none;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--bg); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--bg); }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.secret-control { display: flex; gap: 8px; align-items: center; }
.secret-control input { min-width: 0; flex: 1; }
.secret-control button { flex-shrink: 0; }
.field-error { color: var(--red); }
.field-error:empty { display: none; }
.onboarding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-block: 20px; }
.table-scroll { overflow: auto; max-width: 100%; }
.credential-card { margin-block: 20px; border-color: var(--accent); }
textarea { resize: none; }
@media (max-width: 760px) { .onboarding-grid { grid-template-columns: 1fr; } .secret-control { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }

html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--heading);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin: 0 0 8px;
}

.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.muted { color: var(--dim); line-height: 1.55; }

.shell {
  display: grid;
  grid-template-columns: minmax(0, 232px) minmax(0, 1fr);
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.brand-link {
  text-decoration: none;
  display: inline-block;
}

.brand {
  font-size: 18px;
  margin: 0;
  color: var(--heading);
  font-weight: 650;
}

.brand span { color: var(--accent); }

.nav a {
  display: block;
  color: var(--dim);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.nav a.active, .nav a:hover {
  color: var(--heading);
  background: var(--nav-active-bg);
  text-decoration: none;
}

.nav a.active {
  box-shadow: inset 2px 0 0 var(--accent);
}

.user-dock {
  margin-top: auto;
  display: grid;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.user-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  min-width: 0;
  max-width: 100%;
}

.user-card > div:last-child {
  min-width: 0;
  overflow: hidden;
}

.user-card:hover, .user-card.active {
  border-color: var(--line-strong);
  text-decoration: none;
}

.user-card strong {
  display: block;
  font-size: 13px;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card .muted {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--avatar-bg);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-dock button {
  width: 100%;
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--heading);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.credit-pill:hover { text-decoration: none; border-color: var(--accent); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 8px;
}

.content {
  padding: 22px 28px 48px;
  position: relative;
  min-width: 0;
  overflow-x: hidden;
}

.content.content-dossier,
.content.content-scan {
  padding: 16px 20px 12px;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.content.content-dossier .topbar,
.content.content-scan .topbar {
  flex: 0 0 auto;
  margin-bottom: 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.clock {
  font-family: "IBM Plex Mono", monospace;
  color: var(--dim);
  font-size: 12px;
}

.grid { display: grid; gap: 14px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--heading);
}

.stat {
  font-size: 28px;
  margin: 8px 0 0;
  color: var(--heading);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

form, .stack { display: grid; gap: 10px; }
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--input-bg);
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

button, .btn {
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}

button:hover, .btn:hover { filter: brightness(1.06); text-decoration: none; }

button.secondary, .btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

button.gold, button.danger-scan {
  background: var(--heading);
  color: var(--bg);
}

button:disabled { opacity: 0.45; cursor: not-allowed; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  color: var(--heading);
  font-weight: 650;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  background: var(--panel-2);
}

.badge.ok { color: #059669; border-color: rgba(5, 150, 105, 0.28); background: rgba(5, 150, 105, 0.08); }
.badge.bad { color: var(--red); border-color: rgba(220, 38, 38, 0.28); background: rgba(220, 38, 38, 0.08); }
.badge.warn { color: #b45309; border-color: rgba(180, 83, 9, 0.28); background: rgba(180, 83, 9, 0.08); }
.badge.pep { color: #6d28d9; border-color: rgba(109, 40, 217, 0.25); background: rgba(109, 40, 217, 0.08); }
.badge.soft {
  color: var(--muted);
  border-color: var(--line);
  background: var(--panel-2);
  font-weight: 500;
}

.flash {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 185, 66, 0.08);
}

.flash.error { background: rgba(255, 92, 92, 0.1); border-color: rgba(255, 92, 92, 0.4); color: var(--red); }
.flash.ok { background: rgba(46, 204, 113, 0.1); border-color: rgba(46, 204, 113, 0.35); color: #1f8f4e; }

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.2em;
}

.route-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 60vh;
  color: var(--dim);
}

.route-loading .spinner {
  width: 28px;
  height: 28px;
  border-width: 3px;
}

.badge--pending {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge--pending .spinner {
  width: 0.8em;
  height: 0.8em;
  border-width: 2px;
}

.limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px 18px;
}
.limit-field {
  display: grid;
  gap: 6px;
  align-content: start;
}
.limit-field .limit-label {
  font-weight: 600;
  font-size: 0.92rem;
}
.limit-field .field-help,
.limit-field .field-default {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
}
.limit-bool {
  grid-template-columns: 1fr auto;
  align-items: center;
}
.limit-bool .field-help,
.limit-bool .field-default {
  grid-column: 1 / -1;
}

.ops-grid { display: grid; gap: 16px; }

.search-only {
  width: min(480px, 100%);
  margin: 8vh auto 0;
}

.dossier-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 42%);
  gap: 14px;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.geo-ping {
  position: relative;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  pointer-events: none;
}

.geo-ping span {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #ff2d2d;
  box-shadow: 0 0 14px #ff2d2d;
  opacity: 0.35;
}

.geo-ping i {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 45, 45, 0.15);
  border-radius: 50%;
}

.geo-ping-on span {
  animation: geoBlink 0.9s ease-in-out infinite;
  opacity: 1;
}

.geo-ping-on i {
  animation: geoRipple 1.1s ease-out infinite;
  border-color: rgba(255, 45, 45, 0.9);
}

@keyframes geoBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(0.7); }
}

@keyframes geoRipple {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}

.term {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #0d0d0d;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.term-head {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.term-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #d4d4d8;
}

.term-body div { word-break: break-word; }
.term-cursor {
  color: var(--green);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.dossier-map {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.scan-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0d0d0d;
  overflow: hidden;
}

.scan-stage.locked { height: 100%; min-height: 0; }

.intel-feed {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

#globe-stage, .globe-fallback {
  width: 100%;
  height: 100%;
  min-height: 0;
}

#globe-stage canvas {
  display: block;
}

.globe-overlay {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
  pointer-events: none;
}

.globe-overlay h3 {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.scan-percent {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-align: center;
}

.scan-percent[hidden] {
  display: none;
}

.scan-percent strong {
  display: block;
  font-size: 42px;
  color: #fff;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.scan-percent span {
  color: var(--dim);
  font-size: 13px;
}

.hit-banner { margin: 0 0 14px; }

.hit-banner strong {
  display: block;
  font-size: 20px;
  color: #fff;
}

.people-list { display: grid; gap: 10px; }

.person-card {
  display: grid;
  gap: 0;
  position: relative;
  overflow: hidden;
  min-width: 0;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.person-card:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.person-card.is-active {
  border-color: rgba(0, 229, 153, 0.35);
}

.person-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.people-list .person-head {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
}

.person-copy { min-width: 0; }

.person-photo-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--avatar-bg);
  flex-shrink: 0;
}

.person-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.person-avatar {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--dim);
  background: var(--avatar-bg);
}

.person-card h3,
.person-detail h3 {
  margin: 4px 0;
  font-size: 16px;
  word-break: break-word;
}

.person-meta {
  margin: 0;
  font-size: 12px;
}

.person-blurb {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.person-open {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.person-summary {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.person-card h4,
.person-detail h4 {
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.person-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
}

.person-card.bad::after { background: var(--red); }
.person-card.warn::after { background: var(--amber); }
.person-card.ok::after { background: var(--accent); }

.person-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.person-drawer-root.is-open {
  pointer-events: auto;
}

.person-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.person-drawer-root.is-open .person-drawer-backdrop {
  opacity: 1;
}

.person-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(70vw, 980px);
  max-width: 100vw;
  height: 100%;
  background: var(--panel);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow: auto;
  padding: 20px 24px 48px;
  display: flex;
  flex-direction: column;
}

.person-drawer-root.is-open .person-drawer {
  transform: none;
}

.person-drawer-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 16px;
  position: sticky;
  top: -20px;
  padding: 4px 0 12px;
  background: var(--panel);
  z-index: 2;
  border-bottom: 1px solid var(--line);
}

.person-drawer-bar strong {
  display: block;
  color: var(--heading);
  font-size: 18px;
}

.drawer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 14px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 42px;
  background: var(--panel);
  z-index: 1;
}

.drawer-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.drawer-tab:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.drawer-tab.is-active {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent);
}

.drawer-sections {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.drawer-section {
  display: block;
  scroll-margin-top: 96px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.drawer-section-title {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--heading);
}

.drawer-tab-panel {
  display: block;
}

@keyframes drawerFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.drawer-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.drawer-meta-grid .eyebrow {
  margin-bottom: 4px;
}

.drawer-meta-grid strong {
  display: block;
  color: var(--heading);
  font-size: 14px;
  font-weight: 600;
}

.person-detail .person-photo-wrap {
  width: 64px;
  height: 64px;
}

.person-detail .person-head {
  grid-template-columns: 64px minmax(0, 1fr);
}

.person-detail h4 {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.person-detail h4:first-child {
  margin-top: 0;
}

@media (max-width: 900px) {
  .person-drawer {
    width: min(100vw, 100%);
  }
}

.extra-photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.extra-photos img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.globe-panel {
  position: relative;
  border: 1px solid var(--line);
  background: #0d0d0d;
  min-height: 520px;
  overflow: hidden;
  border-radius: var(--radius);
}

.facts { margin: 0; padding-left: 18px; color: var(--text); }
.facts li { margin-bottom: 6px; }
.sources a { display: block; word-break: break-all; margin-bottom: 4px; }

.loading { display: flex; align-items: center; gap: 10px; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.globe-fallback {
  background: radial-gradient(circle at 50% 45%, #1a1a1a 0%, #0d0d0d 70%);
}

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .user-dock { margin-top: 0; width: 100%; }
  .content.content-dossier,
  .content.content-scan { height: auto; overflow: visible; }
  .dossier-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .dossier-map { height: 52vh; min-height: 280px; }
  .intel-feed { height: auto; overflow: visible; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .classic-table-wrap { overflow-x: auto; }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.content.content-classic {
  overflow: auto;
}

.classic-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
}

.classic-search-form {
  margin-top: 16px;
}

.search-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
  align-items: stretch;
}

.search-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.search-panel h3 {
  margin: 0;
  font-size: 1.15rem;
}

.search-panel > form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.search-panel .danger-scan,
.search-panel #batch-start-btn {
  margin-top: auto;
}

@media (max-width: 960px) {
  .search-panels {
    grid-template-columns: 1fr;
  }
}

.classic-results-page {
  display: grid;
  gap: 14px;
  padding-bottom: 32px;
  width: 100%;
}

.classic-feed {
  display: grid;
  gap: 14px;
  width: 100%;
}

.classic-summary .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.classic-progress h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, var(--accent));
  transition: width 0.18s linear;
}

.classic-table-wrap {
  padding: 0;
  overflow: auto;
  width: 100%;
}

.classic-results {
  margin: 0;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.classic-results th,
.classic-results td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.classic-results th:nth-child(1),
.classic-results td:nth-child(1) {
  width: 32%;
}

.classic-results th:nth-child(2),
.classic-results td:nth-child(2) {
  width: 18%;
}

.classic-results th:nth-child(3),
.classic-results td:nth-child(3) {
  width: auto;
}

.classic-results th:nth-child(4),
.classic-results td:nth-child(4) {
  width: 48px;
  padding-left: 8px;
  padding-right: 14px;
}

.classic-results--profiles th:nth-child(1),
.classic-results--profiles td:nth-child(1) {
  width: 30%;
}

.classic-results--profiles th:nth-child(2),
.classic-results--profiles td:nth-child(2) {
  width: 20%;
}

.classic-results--profiles th:nth-child(3),
.classic-results--profiles td:nth-child(3) {
  width: 18%;
}

.classic-results--profiles th:nth-child(4),
.classic-results--profiles td:nth-child(4) {
  width: auto;
  padding: 14px 16px;
}

.classic-results--profiles th:nth-child(5),
.classic-results--profiles td:nth-child(5) {
  width: 48px;
  padding-left: 8px;
  padding-right: 14px;
}

.th-with-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid currentColor;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  cursor: help;
}

.info-tip:hover,
.info-tip:focus-visible {
  color: var(--accent);
  outline: none;
}

.info-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-line;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}

.info-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.classic-match {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.classic-match-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.classic-match-reason {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.badge.match-badge { font-weight: 600; white-space: nowrap; }
.badge.match-very-high { color: #fff; border-color: #047857; background: #047857; }
.badge.match-high { color: #047857; border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.12); }
.badge.match-medium { color: #b45309; border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.14); }
.badge.match-low { color: #b91c1c; border-color: rgba(148, 163, 184, 0.5); background: rgba(148, 163, 184, 0.14); }

.drawer-match {
  margin-top: 12px;
}

.drawer-match h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.match-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 16px 24px;
  padding: 14px 18px;
}

.match-filter-group {
  display: grid;
  gap: 8px;
  align-content: start;
}

.match-filter-group + .match-filter-group,
.match-filter-info {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.match-filter-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--heading, var(--text));
}

.match-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
}

.match-check.is-checked {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: var(--accent-dim);
}

.match-check input {
  margin: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.match-sort {
  min-width: 260px;
}

.match-filter-info {
  flex: 1 1 260px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.match-filter-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.match-filter-info p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .match-filter-group + .match-filter-group,
  .match-filter-info {
    border-left: 0;
    padding-left: 0;
  }
  .match-sort {
    min-width: 0;
    width: 100%;
  }
}

.classic-person {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.classic-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.classic-avatar .person-avatar {
  font-size: 13px;
}

.classic-person-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.classic-person-text strong {
  color: var(--heading);
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.classic-role,
.classic-org,
.classic-meta {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.classic-role {
  color: var(--text);
  font-weight: 500;
}

.classic-org,
.classic-meta {
  color: var(--muted);
}

.classic-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.classic-results td.classic-blurb {
  white-space: normal;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
}

.classic-blurb-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.classic-open-cell {
  text-align: right;
}

.classic-open-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  background: var(--panel-2);
}

.classic-results .person-row:hover .classic-open-arrow,
.classic-results .person-row.is-active .classic-open-arrow {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-dim);
}

.classic-results .person-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.classic-results .person-row:hover,
.classic-results .person-row.is-active {
  background: rgba(255, 255, 255, 0.03);
}

.classic-results .person-row.is-active td {
  border-bottom-color: rgba(0, 229, 153, 0.35);
}

/* Legacy batch widths; current column sizing lives in screening.css. */
.batch-results th:nth-child(1),
.batch-results td:nth-child(1) {
  width: 48px;
}

.batch-results th:nth-child(2),
.batch-results td:nth-child(2) {
  width: auto;
}

.batch-results th:nth-child(3),
.batch-results td:nth-child(3) {
  width: 120px;
}

.batch-results th:nth-child(4),
.batch-results td:nth-child(4) {
  width: 130px;
  padding: 14px 16px;
}

.batch-results th:nth-child(5),
.batch-results td:nth-child(5) {
  width: 210px;
}

.batch-results th:nth-child(6),
.batch-results td:nth-child(6) {
  width: 100px;
}

.batch-results th:nth-child(7),
.batch-results td:nth-child(7) {
  width: 160px;
}

.batch-results th:nth-child(8),
.batch-results td:nth-child(8) {
  width: 18%;
}

.batch-dob {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.batch-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.batch-result-link {
  font-weight: 600;
  text-decoration: none;
}

.batch-result-link:hover {
  text-decoration: underline;
}

.batch-row--viewed td:first-child {
  opacity: 0.82;
}

.batch-viewed-badge {
  font-size: 11px;
}

.batch-back-link {
  display: inline-block;
  margin-bottom: 12px;
  font-weight: 600;
  text-decoration: none;
}

.batch-back-link:hover {
  text-decoration: underline;
}

/* ——— Single search panel ——— */
.search-panel__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.search-panel__head h3 { font-size: 1.3rem; }

.search-panel__head p { margin: 4px 0 0; font-size: 13px; }

.search-panel__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--accent);
}

.search-mode {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.search-mode legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.search-mode__toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.search-mode__option { display: block; cursor: pointer; }

.search-mode__option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.search-mode__option span {
  display: block;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  color: var(--dim);
}

.search-mode__option input:checked + span {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--accent);
}

.search-mode__option input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-mode__hint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 12.5px;
  color: var(--dim);
}

.search-mode__hint p { margin: 0; line-height: 1.5; }

.search-mode__hint-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
}

.search-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}

.search-form-grid .optional { font-weight: 400; color: var(--muted); }

.search-panel .search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
}

.search-submit__note {
  margin: -2px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 560px) {
  .search-form-grid { grid-template-columns: 1fr; }
}

/* ——— Bulk search panel ——— */
.search-panel__icon--sheet {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.12);
}

.batch-field { display: grid; gap: 8px; }

.batch-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.batch-dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 22px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.batch-dropzone:hover,
.batch-dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.batch-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.batch-dropzone:focus-within { box-shadow: 0 0 0 3px var(--accent-dim); }

.batch-dropzone__icon { color: var(--accent); }

.batch-dropzone strong { color: var(--heading); font-size: 14px; }

.batch-dropzone .muted { font-size: 12.5px; word-break: break-all; }

.batch-dropzone__btn {
  margin-top: 6px;
  padding: 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.batch-info { align-items: flex-start; }

.batch-info > div { min-width: 0; display: grid; gap: 10px; }

.batch-info ul { margin: 0; padding-left: 18px; line-height: 1.6; }

.batch-columns {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.batch-columns th,
.batch-columns td {
  padding: 5px 8px 5px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.batch-columns th { color: var(--muted); font-weight: 500; }

.batch-columns tr:last-child td { border-bottom: 0; }

.batch-columns code { font-size: 11.5px; }
