:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: #111318;
  --panel-2: #171a20;
  --line: #2a2e38;
  --muted: #9aa3b2;
  --text: #f4f6fb;
  --soft: #d7dce7;
  --accent: #d71943;
  --accent-2: #ff456a;
  --ok: #37c27b;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 0 0, rgba(215, 25, 67, .14), transparent 34rem),
    linear-gradient(180deg, #06070a 0%, var(--bg) 38%, #0b0c10 100%);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(8, 9, 11, .82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}

h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.stats {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--soft);
  white-space: nowrap;
}

.stats span {
  color: var(--muted);
}

.source-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
}

.source-switch button {
  min-height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.source-switch button.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(215, 25, 67, .28);
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--soft);
  text-decoration: none;
  white-space: nowrap;
}

.contact:hover {
  border-color: rgba(255, 69, 106, .55);
  color: #fff;
}

.contact svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .dot {
  opacity: .5;
}

.shell {
  display: block;
  padding: 20px 28px 28px;
  max-width: 1160px;
  margin: 0 auto;
}

.workspace {
  min-width: 0;
  background: rgba(17, 19, 24, .86);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
}

.workspace {
  padding: 16px;
}

.searchbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.search-field svg,
.icon-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.search-field svg {
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-width: 0;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
}

.search-field input::placeholder {
  color: #727b8d;
}

.icon-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-2);
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  min-height: 44px;
  background: var(--accent);
  border-color: rgba(255, 255, 255, .12);
}

.ghost-button {
  padding: 0 14px;
}

.filters {
  display: grid;
  grid-template-columns: 130px 190px minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

[hidden] {
  display: none !important;
}

label span {
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  min-width: 0;
  height: 40px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  outline: 0;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 10px;
  color: var(--muted);
}

.result-head strong {
  color: var(--text);
  font-size: 20px;
}

.results {
  display: grid;
  gap: 8px;
}

.person {
  display: grid;
  gap: 7px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
}

.person:hover,
.person.is-active {
  border-color: rgba(255, 69, 106, .55);
  background: rgba(215, 25, 67, .08);
}

.person-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.person-main {
  display: grid;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.avatar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, .08);
}

.avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
}

.person-preview .photo {
  width: 140px;
  max-width: 40%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  object-fit: cover;
  float: left;
  margin: 0 12px 8px 0;
}

.person-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.name-button {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
}

.name-button:hover {
  color: #ffd7df;
}

.meta,
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: var(--soft);
  font-size: 12px;
}

.badge.removed {
  color: #ffd1d9;
  background: rgba(215, 25, 67, .2);
}

.badge.category {
  color: #ffe1e7;
  background: rgba(255, 69, 106, .18);
}

.title-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.threat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.threat::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.threat-high {
  color: #ff6b81;
  background: rgba(215, 25, 67, .16);
  border-color: rgba(255, 69, 106, .4);
}

.threat-elevated {
  color: #ffb259;
  background: rgba(255, 150, 40, .14);
  border-color: rgba(255, 150, 40, .35);
}

.threat-political {
  color: #6fd49a;
  background: rgba(55, 194, 123, .12);
  border-color: rgba(55, 194, 123, .3);
}

.threat-unknown {
  color: #9aa3b2;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .1);
}

.reason {
  color: var(--soft);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.reason span {
  color: var(--muted);
}

.threat-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-left-width: 3px;
  background: rgba(255, 255, 255, .035);
}

.threat-card.threat-high { border-left-color: #ff456a; }
.threat-card.threat-elevated { border-left-color: #ff9628; }
.threat-card.threat-political { border-left-color: #37c27b; }
.threat-card.threat-unknown { border-left-color: #5b6270; }

.threat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.threat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}

.threat-high .threat-dot { background: #ff456a; }
.threat-elevated .threat-dot { background: #ff9628; }
.threat-political .threat-dot { background: #37c27b; }

.threat-basis {
  margin: 0;
  color: var(--soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.threat-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.pager span {
  min-width: 50px;
  text-align: center;
  color: var(--muted);
}

.person-preview {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.field {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.field p {
  margin: 0;
  color: var(--soft);
  overflow-wrap: anywhere;
}

.empty-results {
  color: var(--muted);
  padding: 18px;
}

@media (max-width: 960px) {
  .shell {
    padding: 14px;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .category-filter,
  #reset {
    grid-column: 1 / -1;
  }

  .topbar {
    padding: 0 14px;
  }

  .stats,
  .contact {
    display: none;
  }
}

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

  .searchbar {
    grid-template-columns: minmax(0, 1fr) 44px;
  }
}

.badge.case-tag {
  color: #cfe0ff;
  background: rgba(70, 120, 255, .18);
}

.case-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(70, 120, 255, .3);
  border-radius: 8px;
  background: rgba(70, 120, 255, .06);
}

.case-head {
  color: #cfe0ff;
  font-weight: 700;
  font-size: 13px;
}

/* ---- Interpol badge + block ---- */
.badge.interpol-tag {
  color: #cfe0ff;
  background: rgba(10, 90, 200, .22);
  border: 1px solid rgba(80, 140, 255, .5);
  box-shadow: 0 0 8px rgba(40, 110, 255, .35);
}

.interpol-block {
  margin-top: 6px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 50, 110, .35), rgba(15, 25, 45, .35));
  border: 1px solid rgba(80, 140, 255, .35);
}

.interpol-head {
  color: #aecbff;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

.interpol-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.interpol-photo {
  width: 92px;
  height: 116px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(80, 140, 255, .4);
  flex: 0 0 auto;
}

.interpol-fields { flex: 1 1 auto; min-width: 0; }

.interpol-link {
  display: inline-block;
  margin-top: 6px;
  color: #7fb0ff;
  font-size: 13px;
  text-decoration: none;
}
.interpol-link:hover { text-decoration: underline; }

.badge.sanctions-tag {
  color: #ffd9a0;
  background: rgba(255, 170, 40, .18);
}

.sanctions-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 170, 40, .35);
  border-radius: 8px;
  background: rgba(255, 170, 40, .06);
}

.sanctions-head {
  color: #ffd9a0;
  font-weight: 700;
}

.sanctions-item {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 170, 40, .15);
}

.sanctions-item:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.badge.registry-tag {
  color: #d4c4ff;
  background: rgba(140, 90, 255, .2);
}

.badge.wiki-tag {
  color: #b8e6ff;
  background: rgba(80, 170, 255, .18);
}

.registry-block,
.wiki-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
}

.registry-block {
  border: 1px solid rgba(140, 90, 255, .35);
  background: rgba(140, 90, 255, .06);
}

.registry-head {
  color: #d4c4ff;
  font-weight: 700;
}

.registry-item {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(140, 90, 255, .15);
}

.registry-item:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.wiki-block {
  border: 1px solid rgba(80, 170, 255, .35);
  background: rgba(80, 170, 255, .06);
}

.wiki-head {
  color: #b8e6ff;
  font-weight: 700;
}

.wiki-link {
  color: #8fd4ff;
  font-size: 13px;
}

.wiki-link:hover { text-decoration: underline; }

.filters {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* ============================================================
   Rich, livelier theme + animated threat markers
   ============================================================ */

body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38rem 38rem at 12% 8%, rgba(215, 25, 67, .14), transparent 60%),
    radial-gradient(34rem 34rem at 88% 92%, rgba(70, 120, 255, .12), transparent 60%),
    radial-gradient(30rem 30rem at 70% 20%, rgba(191, 90, 242, .10), transparent 60%);
  filter: saturate(1.1);
  animation: glow-drift 20s ease-in-out infinite alternate;
}

@keyframes glow-drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); opacity: .75; }
  50%  { transform: translate3d(1%, 2%, 0) scale(1.08); opacity: 1; }
  100% { transform: translate3d(3%, -2%, 0) scale(1.04); opacity: .85; }
}

/* Brand mark + gradient wordmark */
.mark {
  animation: mark-float 6s ease-in-out infinite;
}

@keyframes mark-float {
  0%, 100% { transform: translateY(0); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
  50%      { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(215, 25, 67, .35); }
}

h1 {
  background: linear-gradient(92deg, #ffffff 0%, #ffc2cd 45%, #ff456a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: .2px;
}

.source-switch button.is-active {
  background: linear-gradient(135deg, #ff456a, #d71943);
  box-shadow: 0 6px 18px rgba(215, 25, 67, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.contact { transition: border-color .18s ease, color .18s ease, transform .18s ease; }
.contact:hover { transform: translateY(-1px); }

/* Workspace + cards feel premium */
.workspace {
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}

.search-field { transition: border-color .18s ease, box-shadow .18s ease; }
.search-field:focus-within {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(255, 69, 106, .18);
}

.icon-button {
  background: linear-gradient(135deg, #ff456a, #d71943);
  transition: transform .15s ease, filter .15s ease;
}
.icon-button:hover { transform: translateY(-1px); filter: brightness(1.08); }

.person {
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.person:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .4);
}

.avatar { transition: transform .16s ease; }
.person:hover .avatar { transform: scale(1.04); }

/* ---- Threat markers: only dangerous ones blink, outer glow only ---- */
/* Each level pulses its own colour around the badge (box-shadow), the badge
   fill/border stay steady. "Не определена" does not blink. */

.threat { position: relative; }

.threat-high     { animation: glow-high 1.7s ease-in-out infinite; }
.threat-elevated { animation: glow-elevated 2.0s ease-in-out infinite; }
.threat-political { animation: glow-political 2.4s ease-in-out infinite; }

@keyframes glow-high {
  0%, 100% { box-shadow: 0 0 2px 0 rgba(255, 45, 85, .25); }
  50%      { box-shadow: 0 0 12px 2px rgba(255, 45, 85, .65); }
}
@keyframes glow-elevated {
  0%, 100% { box-shadow: 0 0 2px 0 rgba(255, 150, 40, .22); }
  50%      { box-shadow: 0 0 11px 2px rgba(255, 150, 40, .55); }
}
@keyframes glow-political {
  0%, 100% { box-shadow: 0 0 2px 0 rgba(55, 194, 123, .2); }
  50%      { box-shadow: 0 0 10px 2px rgba(55, 194, 123, .5); }
}

/* Threat dot in the preview card mirrors the badge glow */
.threat-card.threat-high .threat-dot { animation: glow-high 1.7s ease-in-out infinite; }
.threat-card.threat-elevated .threat-dot { animation: glow-elevated 2.0s ease-in-out infinite; }
.threat-card.threat-political .threat-dot { animation: glow-political 2.4s ease-in-out infinite; }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  body::before,
  .mark,
  .threat-high,
  .threat-elevated,
  .threat-political,
  .threat-card .threat-dot {
    animation: none !important;
  }
}
