/* Досье — светлая деловая тема: системные шрифты, серо-синяя гамма, цвет только у статусов. */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --head: #1f2a37;
  --line: #d9dde3;
  --line-soft: #e8ebef;
  --text: #1f2933;
  --text-2: #4b5563;
  --muted: #7b8494;
  --accent: #1d4f91;
  --accent-soft: #e8eef7;
  --green: #2e7d32;
  --green-soft: #e8f3e9;
  --amber: #a15c00;
  --amber-soft: #fbf1e1;
  --red: #b42318;
  --red-soft: #fbeae8;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background: var(--bg);
}
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
.mono { font-family: var(--mono); }

/* ── шапка ─────────────────────────────────────────── */
.top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 0 32px;
  height: 56px;
  background: var(--head);
  color: #e5e9ef;
}
.brand {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 18px;
  text-decoration: none;
  color: inherit;
}
.brand b { font-weight: 600; }
.brand i { font-style: normal; font-size: 13px; color: #9aa5b4; }
.chains { display: flex; gap: 4px; height: 100%; }
.chains button {
  position: relative;
  background: none; border: 0;
  padding: 0 14px;
  font-size: 14px;
  color: #9aa5b4;
}
.chains button[aria-current] { color: #fff; font-weight: 500; }
.chains button[aria-current]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0;
  height: 3px; background: #6f9fe0;
}
.chains button:disabled { cursor: default; opacity: .55; }
.chains sup { font-size: 10px; margin-left: 4px; }
.top .right { display: flex; align-items: center; gap: 20px; font-size: 13px; color: #9aa5b4; }
.top .linkbtn { color: #cfd6df; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:hover { text-decoration: none; }

/* ── раскладка ─────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 56px);
}
.side {
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 24px 0;
}
.side h6 {
  margin: 0 20px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.side nav { display: flex; flex-direction: column; }
.side nav button {
  display: grid; grid-template-columns: 26px 1fr; align-items: baseline;
  text-align: left;
  background: none; border: 0;
  padding: 9px 20px;
  font-size: 14px;
  color: var(--text-2);
  border-left: 3px solid transparent;
}
.side nav button span { font-size: 12px; color: var(--muted); }
.side nav button:hover:not(:disabled) { background: var(--bg); color: var(--text); }
.side nav button[aria-current] { color: var(--accent); font-weight: 500; border-left-color: var(--accent); background: var(--accent-soft); }
.side nav button:disabled { opacity: .5; cursor: default; }
.side .stats { margin: 28px 20px 0; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.side .stats div { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 3px 0; }
.side .stats b { font-weight: 600; color: var(--text); }

main { padding: 32px 40px 72px; max-width: 1200px; width: 100%; }
.view[hidden] { display: none; }

/* ── заголовок раздела ─────────────────────────────── */
.kicker { font-size: 13px; color: var(--muted); }
h1 {
  margin: 4px 0 8px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
}
h1 em { font-style: normal; }
.lead { max-width: 720px; margin: 0 0 24px; color: var(--text-2); font-size: 14px; }

/* ── поиск ─────────────────────────────────────────── */
.probe {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
}
.probe input {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  padding: 11px 14px;
  font: 15px/1.2 var(--mono);
  color: var(--text);
}
.probe input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.probe input::placeholder { color: var(--muted); font-family: var(--sans); }
.probe button {
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}
.probe button:hover { background: #163f75; }
.probe button:disabled { background: var(--line); border-color: var(--line); color: var(--muted); cursor: wait; }
.hint { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
.hint .err { color: var(--red); }

/* ── отчёт ─────────────────────────────────────────── */
.report { margin-top: 28px; }
.report-head {
  display: grid;
  grid-template-columns: 1fr 240px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.report-head .who { padding: 20px 24px; border-right: 1px solid var(--line); }
.who .label { font-size: 12px; color: var(--muted); }
.who .addr { margin: 4px 0 12px; font: 17px/1.3 var(--mono); word-break: break-all; }
.who .addr .copy { margin-left: 10px; font: 12px var(--sans); vertical-align: middle; }
.who .meta { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; color: var(--muted); }
.who .meta b { color: var(--text); font-weight: 500; }

.verdict { padding: 20px 24px; display: flex; flex-direction: column; justify-content: center; }
.verdict .score { font-size: 40px; font-weight: 600; line-height: 1; color: var(--text); }
.verdict .score small { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.verdict .lvl { margin-top: 8px; font-size: 13px; font-weight: 600; }
.bar { margin-top: 10px; height: 6px; border-radius: 3px; background: var(--line-soft); position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: currentColor; }
.lvl-low { color: var(--green); }
.lvl-medium { color: var(--amber); }
.lvl-high, .lvl-critical { color: var(--red); }

.figures {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}
.figures div { padding: 14px 24px; }
.figures div + div { border-left: 1px solid var(--line-soft); }
.figures dt { font-size: 12px; color: var(--muted); }
.figures dd { margin: 4px 0 0; font-size: 20px; font-weight: 600; }
.figures dd small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }

.section {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 24px 20px;
}
.section > h3 {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}
.section > h3 span { font-size: 13px; font-weight: 400; color: var(--muted); }

/* находки */
.findings { list-style: none; margin: 0; padding: 0; }
.findings li {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.sev {
  justify-self: start; align-self: start;
  padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
}
.sev-critical, .sev-high { color: var(--red); background: var(--red-soft); }
.sev-medium { color: var(--amber); background: var(--amber-soft); }
.sev-low { color: var(--text-2); background: var(--line-soft); }
.sev-info { color: var(--muted); background: var(--bg); }
.findings b { display: block; font-weight: 600; font-size: 14px; }
.findings p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; word-break: break-word; }
.findings .src { font-size: 12px; color: var(--muted); }
.clean { padding: 12px 14px; border-radius: var(--radius); background: var(--green-soft); color: var(--green); font-size: 14px; }

/* источники */
.sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sources div { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 14px; background: #fafbfc; }
.sources b { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 13px; }
.sources p { margin: 4px 0 0; font-size: 12px; color: var(--muted); word-break: break-word; }
.st { font-size: 12px; font-weight: 600; }
.st-ok { color: var(--green); }
.st-hit { color: var(--red); }
.st-skip { color: var(--muted); }
.st-error { color: var(--amber); }

/* таблицы */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 12px; font-weight: 600;
  color: var(--muted); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line);
}
td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .a { font-family: var(--mono); font-size: 13px; background: none; border: 0; padding: 0; text-align: left; color: var(--accent); }
td .a:hover { text-decoration: underline; }
.tag { display: inline-block; margin: 0 4px 0 0; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--line-soft); color: var(--text-2); }
.tag-ofac, .tag-frozen, .tag-own_bad, .tag-db_critical { color: var(--red); background: var(--red-soft); }
.tag-own_suspect, .tag-db_high { color: var(--amber); background: var(--amber-soft); }
.dir-in { color: var(--green); }
.dir-out { color: var(--text-2); }
.more { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* пометка */
.note-box { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { background: var(--card); border: 0; padding: 9px 14px; font-size: 13px; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--bg); }
.seg button[aria-pressed="true"][data-v="clean"] { color: #fff; background: var(--green); }
.seg button[aria-pressed="true"][data-v="suspect"] { color: #fff; background: var(--amber); }
.seg button[aria-pressed="true"][data-v="bad"] { color: #fff; background: var(--red); }
.seg button[aria-pressed="true"][data-v=""] { color: var(--text); background: var(--line-soft); }
textarea {
  width: 100%; min-height: 40px; resize: vertical;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); outline: 0;
  padding: 9px 12px; color: var(--text); font: 14px/1.4 var(--sans);
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  padding: 9px 16px; font-size: 13px; font-weight: 500;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.saved { font-size: 12px; color: var(--green); margin-top: 6px; min-height: 16px; }

.cachebar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 10px; padding: 9px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 13px; color: var(--muted);
}
.cachebar .fresh { color: var(--green); }

/* загрузка */
.scan { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; }
.scan ol { margin: 0; padding-left: 22px; font-size: 14px; line-height: 2; color: var(--muted); }
.scan li.done { color: var(--text-2); }
.scan li.done::after { content: " — готово"; color: var(--green); }
.scan li.on { color: var(--text); font-weight: 500; }
.scan li.on::after { content: " …"; color: var(--accent); }

/* архив */
.archive td:first-child { width: 48%; }
.empty { padding: 24px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

/* рекомендации */
.recs { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.rec { display: grid; grid-template-columns: 220px 1fr 180px; gap: 28px; padding: 18px 24px; }
.rec + .rec { border-top: 1px solid var(--line-soft); }
.rec h4 { margin: 0; font-size: 16px; font-weight: 600; }
.rec h4 + span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.rec p { margin: 0; color: var(--text-2); font-size: 14px; }
.rec p + p { margin-top: 6px; }
.rec .price { font-size: 13px; color: var(--text-2); }
.rec .price b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; font-weight: 600; }
.pill { display: inline-block; margin-top: 8px; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.pill-now { color: var(--green); background: var(--green-soft); }
.pill-key { color: var(--amber); background: var(--amber-soft); }
.pill-paid { color: var(--text-2); background: var(--line-soft); }

footer.colophon { margin-top: 48px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }

/* ── вход ──────────────────────────────────────────── */
.gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.gate .brand { color: var(--text); margin-bottom: 20px; font-size: 22px; }
.gate .brand i { color: var(--muted); }
.gate form {
  width: 100%; max-width: 420px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.gate h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.gate p { margin: 0 0 20px; font-size: 13px; color: var(--muted); }
.gate label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.gate .probe { grid-template-columns: 1fr; }
.gate .probe button { padding: 11px 22px; }
.gate .msg { margin-top: 10px; min-height: 18px; font-size: 13px; color: var(--red); }

@media (max-width: 960px) {
  .top { padding: 0 16px; gap: 16px; grid-template-columns: auto 1fr; }
  .top .right { display: none; }
  .layout { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 0; }
  .side h6, .side .stats { display: none; }
  .side nav { flex-direction: row; overflow-x: auto; }
  .side nav button { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; padding: 10px 14px; }
  .side nav button[aria-current] { border-bottom-color: var(--accent); }
  main { padding: 24px 16px 56px; }
  .report-head { grid-template-columns: 1fr; }
  .report-head .who { border-right: 0; border-bottom: 1px solid var(--line); }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figures div:nth-child(3) { border-left: 0; }
  .figures div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .sources { grid-template-columns: 1fr; }
  .findings li { grid-template-columns: 1fr; gap: 4px; }
  .rec { grid-template-columns: 1fr; gap: 8px; }
  .note-box { grid-template-columns: 1fr; }
  .section { padding: 16px; }
  .tbl-wrap { overflow-x: auto; }
}
