:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18212b;
  background: #f4f6f8;

  --muted: #6d7984;
  --link: #175ca8;
  --bad: #b3261e;
  --bad-bg: #ffe1e1;
  --good: #14672c;
  --good-bg: #dff5e5;
  --warn: #8a5a00;
  --warn-bg: #fff0c9;
  --sidebar: #18212b;
  --sidebar-width: 232px;
}

* { box-sizing: border-box; }
body { margin: 0; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.names-list:focus-visible,
.mini-comments:focus-visible {
  outline: 2px solid #3d8bff;
  outline-offset: 2px;
}

/* ───── Каркас: левое меню + содержимое ───── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 14px;
  background: var(--sidebar);
  color: #c9d2da;
}
.brand { display: block; padding: 0 8px 22px; color: #fff; text-decoration: none; }
.brand-name { display: block; font-size: 18px; font-weight: 700; }
.brand-sub { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; color: #93a1ad; }

.menu { display: grid; gap: 4px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  color: #c9d2da;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.menu-item:hover { background: #243140; color: #fff; }
.menu-item.active { background: #2a3a4b; color: #fff; box-shadow: inset 3px 0 0 #5aa2ff; }
.menu-item svg { width: 18px; height: 18px; flex: none; }

.content { flex: 1; min-width: 0; }
.page-head { max-width: 1600px; margin: 0 auto; padding: 24px 20px 0; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; }
.page-head p { margin: 0; color: var(--muted); }
.wrap { max-width: 1600px; margin: 0 auto; padding: 20px; }

/* ───── Карточки, форма, кнопки ───── */
.card {
  background: #fff;
  border: 1px solid #dfe4e8;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px #00000008;
}
.search label { display: block; font-weight: 700; margin-bottom: 8px; }
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; }
.search small { display: block; margin-top: 8px; color: #697681; }

input, textarea { font: inherit; border: 1px solid #cbd3da; border-radius: 7px; padding: 10px; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
button { border: 0; border-radius: 7px; background: #18212b; color: #fff; padding: 10px 16px; font-weight: 700; cursor: pointer; }
button:hover { opacity: .9; }
button.secondary { background: #fff; color: #18212b; border: 1px solid #cbd3da; }

.alert { background: #fff0f0; border: 1px solid #e8b5b5; color: #9d2727; padding: 12px 15px; border-radius: 8px; margin-bottom: 18px; }

.result-head { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.result-head h2 { font-size: 15px; word-break: break-all; margin: 5px 0; }
.result-actions { display: flex; flex: none; align-items: center; gap: 16px; }
.result-actions form { margin: 0; }
.muted { color: var(--muted); }
.external, .hashlink { color: var(--link); text-decoration: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ───── Вердикт: кольцо, метка угрозы, имя файла ───── */
.verdict { display: flex; gap: 24px; align-items: center; margin: 18px 0; }
.ring { width: 136px; height: 136px; flex: none; }

.verdict-body { flex: 1; min-width: 0; }
.verdict-line { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.verdict-line.malicious { color: var(--bad); }
.verdict-line.suspicious { color: var(--warn); }
.verdict-line.clean { color: var(--good); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin-bottom: 4px; align-items: start; }
.kv .k { padding-top: 5px; font-size: 12px; color: var(--muted); }
.kv .v { min-width: 0; padding-top: 3px; overflow-wrap: anywhere; }

.chip { display: inline-block; margin: 0 6px 6px 0; padding: 3px 9px; border-radius: 20px; background: #edf0f2; font-size: 12px; line-height: 1.4; }
.chip b { margin-left: 5px; color: var(--muted); }
.chip.threat { background: var(--bad-bg); color: var(--bad); font-size: 13px; font-weight: 700; }
.chip.name { background: #eef2f6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }

.names { margin: 0 0 20px; padding: 14px; background: #f7f8f9; border-radius: 8px; }
.names h3 { margin: 0 0 6px; font-size: 15px; }
.names p { margin: 0 0 10px; font-size: 13px; }
.names-list { max-height: 190px; overflow-y: auto; padding-right: 4px; }

/* ───── Плитки статистики и факты ───── */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 18px 0; }
.stat { border: 1px solid #e0e5e9; border-radius: 8px; padding: 12px; }
.stat b { display: block; font-size: 25px; }
.stat span { font-size: 12px; color: var(--muted); }
.danger { border-color: #e6b4b4; }
.warn { border-color: #e8d29a; }

.facts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 20px; }
.facts div { padding: 10px; background: #f7f8f9; border-radius: 7px; }
.facts span, .facts b { display: block; }
.facts span { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ───── Таблицы ───── */
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #edf0f2; white-space: nowrap; vertical-align: top; }
th { color: #596671; font-size: 12px; }

.badge { display: inline-block; padding: 3px 7px; border-radius: 20px; background: #edf0f2; font-size: 11px; }
.badge.malicious { background: #ffe1e1; color: #a00000; }
.badge.suspicious { background: #fff0c9; color: #7b5700; }
.badge.ok { background: #dff5e5; color: #14672c; }
.badge.not_found { background: #eef1f4; }
.badge.rate_limited, .badge.auth_error, .badge.upstream_error, .badge.timeout, .badge.network_error, .badge.configuration_error { background: #ffe7d5; color: #8a4300; }

.score { display: inline-block; min-width: 54px; padding: 3px 8px; border-radius: 20px; text-align: center; font-size: 12px; font-weight: 700; }
.score.good { background: var(--good-bg); color: var(--good); }
.score.bad { background: var(--bad-bg); color: var(--bad); }

.cell-file { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.cell-comments { min-width: 240px; }
.mini-comments {
  max-height: 68px;
  max-width: 300px;
  overflow-y: auto;
  padding: 6px 8px;
  background: #f7f8f9;
  border-radius: 6px;
  white-space: normal;
  line-height: 1.4;
}
.mini-comments p { margin: 0 0 5px; overflow-wrap: anywhere; }
.mini-comments p:last-child { margin-bottom: 0; }
.more { margin-top: 3px; font-size: 11px; }

/* ───── Комментарии ───── */
.comment { border-top: 1px solid #edf0f2; padding: 10px 0; }
.comment:first-of-type { border-top: 0; }
.comment time { color: #7a858e; font-size: 11px; margin-left: 8px; }
.comment p { margin: 6px 0; white-space: pre-wrap; }
.comment-form { display: grid; gap: 8px; margin-bottom: 12px; }

.comment-item { padding: 16px 0; border-top: 1px solid #edf0f2; }
.comment-item:first-child { padding-top: 0; border-top: 0; }
.ci-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 4px; }
.ci-head .chip { margin: 0; }
.ci-file { font-weight: 700; overflow-wrap: anywhere; }
.ci-hash { display: block; font-size: 12px; overflow-wrap: anywhere; }
.ci-meta { margin: 8px 0 4px; font-size: 12px; color: var(--muted); }
.ci-meta time { margin-left: 8px; }
.ci-text { max-width: 90ch; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ───── Адаптив ───── */
@media (max-width: 850px) {
  .layout { flex-direction: column; }
  .sidebar { position: static; width: auto; height: auto; padding: 12px 14px; }
  .brand { padding-bottom: 10px; }
  .menu { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .facts, .stats { grid-template-columns: 1fr 1fr; }
  .search-row, .result-head { flex-direction: column; }
  .verdict { flex-direction: column; align-items: flex-start; }
  .kv { grid-template-columns: 1fr; }
  .kv .k { padding-top: 0; }
}
@media (max-width: 500px) {
  .facts, .stats { grid-template-columns: 1fr; }
  .wrap { padding: 12px; }
  .page-head { padding: 16px 12px 0; }
}

/* honeypot для ботов: скрыто от людей, без inline-стилей (совместимо с CSP) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
