/* Детектор слабых сигналов — оформление витрины.
   Тёмная деловая тема: глубокий синий и графит, акценты бирюза и золото.
   Шрифт Manrope лежит локально (OFL), фолбэк — системный: сеть не нужна. */

@font-face {
  font-family: "Manrope Variable";
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/static/vendor/fonts/manrope-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope Variable";
  font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/static/vendor/fonts/manrope-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --bg: #070d1a;
  --bg-2: #0a1324;
  --card: #0f1a2c;
  --card-2: #13213a;
  --panel: rgba(11, 20, 38, .78);
  --line: rgba(148, 178, 220, .16);
  --line-2: rgba(148, 178, 220, .28);
  --ink: #e8eef8;
  --ink-2: #c3cfe0;
  --muted: #9aabc4;
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, .14);
  --gold: #e8b54a;
  --gold-soft: rgba(232, 181, 74, .14);
  /* Цвета меток графика проверены валидатором палитры на поверхности #0f1a2c:
     полоса светлоты, различимость при дальтонизме, контраст ≥ 3:1. */
  --mark-all: #199e90;
  --mark-hard: #b8801f;
  --warn-ink: #ffd2c2;
  --warn-line: #d9785c;
  --warn-bg: rgba(217, 120, 92, .12);
  --ok: #5fd39a;
  --low: #f0a58a;
  --radius: 14px;
  --font: "Manrope Variable", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink); background:
    radial-gradient(1200px 600px at 75% -10%, rgba(45, 212, 191, .10), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(64, 110, 200, .14), transparent 60%),
    var(--bg);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--teal); }
button { font-family: inherit; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--card);
  color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- верхняя полоса ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 3vw, 36px); position: relative; z-index: 5;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 13, 26, .9), rgba(7, 13, 26, .55));
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 36px; height: 36px; flex: none; }
.brand-name { font-weight: 750; letter-spacing: -.01em; font-size: 17px; }
.brand-sub { color: var(--muted); font-size: 12.5px; }
.health {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  background: rgba(15, 26, 44, .6); max-width: 60%;
}
.health .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.health.ok .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(95, 211, 154, .15); }
.health.warn .dot { background: var(--gold); }
.health.bad .dot { background: var(--warn-line); }

/* ---------- главный экран ---------- */
.hero {
  position: relative; min-height: min(80vh, 760px);
  display: grid; grid-template-columns: minmax(360px, 480px) 1fr;
  border-bottom: 1px solid var(--line);
}
.stage {
  position: absolute; inset: 0; overflow: hidden;
}
.stage canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.panel {
  position: relative; z-index: 3; margin: clamp(16px, 3vw, 40px);
  align-self: center;
  padding: 26px 26px 22px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: 11.5px; font-weight: 700;
  color: var(--teal);
}
h1 {
  font-size: clamp(24px, 2.4vw, 31px); line-height: 1.15; margin: 8px 0 10px;
  letter-spacing: -.025em; font-weight: 800;
  background: linear-gradient(95deg, #fff 30%, #bfe9e3 70%, #f1d49a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { color: var(--ink-2); margin: 0 0 18px; font-size: 15px; }

form { display: flex; gap: 8px; margin-bottom: 14px; }
input[type=text] {
  flex: 1; min-width: 0; padding: 13px 15px; font: inherit; font-size: 16px;
  border: 1px solid var(--line-2); border-radius: 11px; background: rgba(7, 13, 26, .7);
  color: var(--ink);
}
input[type=text]::placeholder { color: #7f91ab; }
input[type=text]:focus { outline: 2px solid var(--teal); border-color: transparent; }
#go {
  padding: 13px 22px; font-size: 16px; border: 0; border-radius: 11px; cursor: pointer;
  font-weight: 750; color: #04201c;
  background: linear-gradient(135deg, #3ee6cf, #22b8a6);
  box-shadow: 0 8px 24px rgba(45, 212, 191, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
#go:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(45, 212, 191, .35); }
#go:disabled { opacity: .55; cursor: default; transform: none; }

.hints { margin-bottom: 14px; }
.hints-cap { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.free-note { margin-top: 8px; }
#hints { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.area-btn {
  text-align: left; cursor: pointer; border-radius: 11px; padding: 9px 11px;
  border: 1px solid var(--line); background: rgba(19, 33, 58, .55); color: var(--ink);
  transition: border-color .15s, background .15s, transform .15s;
}
.area-btn:hover { border-color: rgba(45, 212, 191, .5); background: rgba(45, 212, 191, .08); }
.area-btn.on { border-color: var(--teal); background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, .35); }
.area-btn b { display: block; font-size: 14px; font-weight: 700; }
.area-btn small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.3; margin-top: 2px; }
.area-btn:disabled { opacity: .6; cursor: default; }

.timemachine {
  border: 1px dashed var(--line-2); border-radius: 11px; padding: 10px 12px;
  font-size: 13.5px; color: var(--ink-2);
}
.timemachine label { cursor: pointer; }
.timemachine input[type=date] {
  border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 8px; margin: 6px 0 0 0;
  font: inherit; font-size: 13.5px; background: rgba(7, 13, 26, .7); color: var(--ink);
  color-scheme: dark;
}
.timemachine input[type=date]:disabled { opacity: .5; }
.tm-hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 6px; }

/* надписи узлов, подсказка, легенда, переключатель */
.stage-labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.nlabel {
  position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12px;
  color: var(--ink); display: flex; align-items: center; gap: 6px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .9); will-change: transform, opacity;
}
.nlabel .n {
  font-weight: 800; font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px;
  display: inline-grid; place-items: center; background: rgba(7, 13, 26, .75);
  border: 1px solid var(--line-2); color: var(--ink);
}
.nlabel .t { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.nlabel.sel .n { border-color: var(--gold); color: var(--gold); }
.axlabel { position: absolute; left: 0; top: 0; font-size: 11px; color: var(--muted);
  white-space: nowrap; text-shadow: 0 1px 4px #000; }

.tip {
  position: absolute; z-index: 6; pointer-events: none; min-width: 220px; max-width: 300px;
  background: rgba(10, 19, 36, .95); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 11px 13px; font-size: 13px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}
.tip .tt { font-weight: 750; font-size: 14.5px; line-height: 1.3; }
.tip .to { color: var(--muted); font-size: 12px; font-style: italic; margin-bottom: 6px; }
.tip .tr { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.tip .tr b { color: var(--ink); font-weight: 700; }
.tip .th { color: var(--muted); font-size: 11.5px; margin-top: 6px; }

/* Полоса хода анализа. Поверх сцены — стеклянная плашка сверху по центру
   свободной части; в выдаче — такая же полоса над счётчиками (её видно и без
   WebGL). Этапы и доля приходят с сервера (api/progress.py). */
.prog { border: 1px solid var(--line-2); border-radius: 14px; padding: 11px 14px 10px;
  background: rgba(10, 19, 36, .9); backdrop-filter: blur(8px); color: var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.prog-ov { position: absolute; z-index: 5; left: calc(50% + 150px); transform: translateX(-50%);
  top: 18px; width: min(440px, calc(100% - 900px)); min-width: 320px; }
.prog-inline { margin: 0 0 18px; }
.prog-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.prog-stage { font-size: 14px; font-weight: 700; }
.prog-pct { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--teal); }
.prog-track { position: relative; height: 8px; border-radius: 4px; margin: 8px 0 7px;
  background: rgba(148, 178, 220, .14); overflow: hidden; }
.prog-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, var(--teal), var(--gold)); transition: width .35s ease-out; }
.prog-fill::after { content: ""; position: absolute; inset: 0; border-radius: 4px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  background-size: 40% 100%; background-repeat: no-repeat; animation: shine 1.4s linear infinite; }
@keyframes shine { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.prog-sub { font-size: 12px; color: var(--muted); min-height: 16px; }
.prog.done .prog-fill::after { animation: none; }
.prog.done .prog-pct { color: var(--ok); }
.prog.err { border-color: var(--warn-line); background: rgba(40, 14, 14, .94); }
.prog.err .prog-fill { background: var(--warn-line); }
.prog.err .prog-fill::after { animation: none; }
.prog.err .prog-stage { color: #ffc0ad; }
.prog.err .prog-sub { color: var(--warn-ink); font-size: 12.5px; }

.stage-empty { position: absolute; z-index: 4; right: 24px; top: 58%; max-width: 380px; font-size: 13.5px;
  color: var(--ink-2); background: rgba(10, 19, 36, .85); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 14px; text-align: center; }
@media (max-width: 860px) { .stage-empty { left: 12px; right: 12px; bottom: auto; top: 50%; max-width: none; } }
.stage-controls {
  position: absolute; z-index: 4; right: 24px; top: 18px; display: flex;
  background: rgba(10, 19, 36, .85); border: 1px solid var(--line); border-radius: 12px; padding: 4px;
}
.seg { border: 0; background: transparent; color: var(--ink-2); padding: 7px 12px; border-radius: 9px;
  cursor: pointer; font-size: 13px; font-weight: 650; }
.seg.on { background: var(--teal-soft); color: var(--teal); }
.legend {
  position: absolute; z-index: 4; right: 24px; top: 70px; font-size: 11.5px; color: var(--ink-2);
  background: rgba(10, 19, 36, .6); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px; max-width: 330px; line-height: 1.55;
}
.legend i { display: inline-block; vertical-align: middle; margin-right: 8px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.lg-dot.dim { background: #7f93b3; box-shadow: none; }
.lg-ring { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--muted); }
.lg-pulse { width: 14px; height: 2px; background: linear-gradient(90deg, transparent, var(--teal)); }
.lg-grad { width: 22px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--teal), var(--gold)); }
.lg-sq { width: 10px; height: 10px; border-radius: 2px; }
.lg-sq.teal { background: var(--mark-all); }
.lg-sq.gold { background: var(--mark-hard); }
.lg-note { color: var(--muted); font-size: 11.5px; line-height: 1.4; margin-top: 3px; }

/* без WebGL: сцены нет, интерфейс — обычный двумерный */
.no-webgl .hero { display: block; min-height: 0; }
.no-webgl .stage { display: none; }
.no-webgl .panel { max-width: 760px; margin: 24px auto; }

/* ---------- результаты ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 36px clamp(16px, 3vw, 32px) 60px; outline: none; }
.res-head h2 { margin: 6px 0 16px; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; line-height: 1.2; }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.kpi {
  background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.kpi .h { color: var(--muted); font-size: 11.5px; margin-top: 6px; line-height: 1.35; }
.kpi.accent .v { color: var(--teal); }
.help { border-bottom: 1px dotted var(--muted); cursor: help; }
.meta-line { color: var(--muted); font-size: 13.5px; margin: -6px 0 16px; }
.err { color: #ffb4b4; }

/* Предупреждение о необоснованном запросе (Т-00-04) и пометки над ответом
   (D-062) — намеренно заметные: проверяющий должен видеть, на чём стоит ответ. */
.ungrounded { border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn-ink);
  border-radius: 12px; padding: 12px 15px; margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; }
/* Откуда взялась область. Спокойный тон намеренно: это раскрытие, а не тревога (Т-07-01). */
.how { border: 1px solid var(--line); background: rgba(19, 33, 58, .6); color: var(--ink-2);
  border-radius: 12px; padding: 11px 15px; margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; }
.how b { color: var(--ink); }
.empty { color: var(--ink-2); padding: 24px; border: 1px dashed var(--line-2); border-radius: 12px; }

.list { display: grid; gap: 10px; margin-top: 16px; }
.sig {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 170px 150px; gap: 16px; align-items: center;
  background: linear-gradient(180deg, rgba(19, 33, 58, .85), rgba(15, 26, 44, .85));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s;
  opacity: 0; transform: translateY(10px); animation: rise .5s ease forwards;
}
.sig:hover, .sig.hl { border-color: rgba(45, 212, 191, .55); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
@keyframes rise { to { opacity: 1; transform: none; } }
.rank {
  font-size: 22px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums;
  text-align: center; letter-spacing: -.02em;
}
.sig:nth-child(-n+3) .rank { color: var(--gold); }
.sig h3 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.sig h3 button { all: unset; cursor: pointer; }
.sig h3 button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
.orig { color: var(--muted); font-size: 13.5px; font-style: italic; margin: 1px 0 6px; }
.tnote { color: var(--gold); font-size: 12.5px; margin: 0 0 6px; cursor: help; }
.why1 { color: var(--ink-2); font-size: 13.5px; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block; background: rgba(148, 178, 220, .08); border: 1px solid var(--line);
  border-radius: 7px; padding: 2px 8px; font-size: 12.5px; color: var(--ink-2);
}
.tag.score { background: var(--teal-soft); border-color: rgba(45, 212, 191, .35); color: var(--teal); font-weight: 700; }
.tag[title] { cursor: help; }
.spark { display: flex; flex-direction: column; gap: 3px; }
.spark svg { width: 100%; height: 40px; overflow: visible; }
.spark .cap { font-size: 11.5px; color: var(--muted); }
.power .bar { height: 6px; border-radius: 3px; background: rgba(148, 178, 220, .12); overflow: hidden; }
.power .bar i { display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--teal), var(--gold)); width: 0; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.power .pv { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.power .pk { font-size: 11.5px; color: var(--muted); }

.spark path.line { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.anim .spark path.line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s ease forwards .2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

details.rej { margin-top: 26px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(15, 26, 44, .6); padding: 12px 16px; }
details.rej summary { cursor: pointer; color: var(--ink-2); font-size: 15px; }
.tblwrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
td, th { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
td.reason { color: #f3c98b; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.howto { margin-top: 40px; padding: 22px 24px; border-radius: var(--radius); border: 1px solid var(--line);
  background: rgba(15, 26, 44, .55); }
.howto h2 { margin: 0 0 10px; font-size: 20px; }
.howto ol { margin: 0; padding-left: 20px; color: var(--ink-2); display: grid; gap: 6px; }
.howto b { color: var(--ink); }
.howto-note { color: var(--muted); font-size: 13.5px; margin: 12px 0 0; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 18px clamp(16px, 3vw, 36px) 28px; color: var(--muted); font-size: 12.5px;
  border-top: 1px solid var(--line); }

/* ---------- карточка технологии ---------- */
dialog#dlg {
  width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--line-2); border-radius: 18px; color: var(--ink);
  background: linear-gradient(180deg, #111f36, #0c1628);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6);
}
dialog#dlg[open] { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
dialog::backdrop { background: rgba(3, 7, 15, .7); backdrop-filter: blur(3px); }
.dlg-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: rgba(12, 22, 40, .95); border-bottom: 1px solid var(--line); }
.dlg-pos { color: var(--muted); font-size: 13px; flex: 1; }
.icon-btn { border: 1px solid var(--line); background: transparent; color: var(--ink); width: 36px; height: 36px;
  border-radius: 10px; cursor: pointer; font-size: 16px; }
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.dlg-body { padding: 22px 26px 28px; }
.dlg-body h2 { font-size: clamp(24px, 3.2vw, 34px); line-height: 1.15; margin: 4px 0 4px; letter-spacing: -.02em; }
.dlg-body .orig { font-size: 16px; }
.dlg-body h4 { margin: 22px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--teal); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 6px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(7, 13, 26, .35); }
.stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--muted); line-height: 1.3; }
.companies { font-size: 14px; color: var(--ink-2); margin: 10px 0; }
.companies b { color: var(--ink); }
ul.why { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
ul.why li { position: relative; padding-left: 22px; color: var(--ink-2); }
ul.why li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 8px rgba(45, 212, 191, .6); }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: rgba(148, 178, 220, .14); stroke-width: 1; }
.chart rect.b-all { fill: var(--mark-all); }
.chart rect.b-hard { fill: var(--mark-hard); }
.chart g.col { cursor: default; }
.chart g.col .hit { fill: transparent; }
.chart g.col:hover .hit { fill: rgba(148, 178, 220, .08); }
.anim .chart g.col rect.b { transform-box: fill-box; transform-origin: bottom; animation: grow .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleY(0); } }
.chart-read { font-size: 13px; color: var(--ink-2); min-height: 20px; margin-top: 6px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart-cap { font-size: 12px; color: var(--muted); margin-top: 6px; }
details.tbl summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 8px; }

.srcs { display: grid; gap: 8px; font-size: 14px; }
.src { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: rgba(7, 13, 26, .3); }
.src a { color: var(--ink); text-decoration: none; font-weight: 600; }
.src a:hover { color: var(--teal); text-decoration: underline; }
.src .kind { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
/* Уровень доверенности источника: справка эксперту, а не оценка. */
.trust { font-size: 12px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.trust-высокая { color: var(--ok); }
.trust-низкая { color: var(--low); }
.note-box { border: 1px solid rgba(232, 181, 74, .4); background: var(--gold-soft); border-radius: 12px;
  padding: 10px 12px; font-size: 13.5px; color: #f6deaa; margin-top: 10px; }
.note-box b { color: #fff0cc; }

/* Страница инсайта — по кнопке: перевод предложения стоит 383 мс. */
.insight-btn { margin: 18px 0 0; padding: 10px 16px; font-size: 14px; font-weight: 700;
  border: 1px solid rgba(45, 212, 191, .45); background: var(--teal-soft); color: var(--teal);
  border-radius: 10px; cursor: pointer; }
.insight-btn:hover { background: rgba(45, 212, 191, .22); }
.insight { margin-top: 10px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.insight h4 { margin: 16px 0 4px; }
.insight .orig-quote { color: var(--muted); font-size: 13px; margin-top: 4px; }
.insight .missing { color: var(--muted); font-style: italic; }
.insight ul.why { margin-top: 4px; }

/* ---------- адаптивность ---------- */
@media (max-width: 1100px) {
  .sig { grid-template-columns: 44px minmax(0, 1fr) 150px; }
  .sig .power { display: none; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .hero { display: flex; flex-direction: column; min-height: 0; }
  .stage { position: relative; inset: auto; height: min(62vh, 440px); order: 1; }
  .panel { order: 2; margin: 10px 12px 0; }
  .legend { left: 12px; right: 12px; top: auto; bottom: 10px; max-width: none; font-size: 11.5px; line-height: 1.5; padding: 7px 10px; }
  .stage-controls { left: 12px; right: auto; top: 10px; }
  .prog-ov { left: 12px; right: 12px; top: 58px; transform: none; width: auto; min-width: 0; }
  .nlabel .t { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .health { display: none; }
  .panel { padding: 18px 16px; margin: 10px 10px 0; border-radius: 14px; }
  form { flex-direction: column; }
  #go { width: 100%; }
  #hints { grid-template-columns: 1fr 1fr; }
  .area-btn small { display: none; }
  .wrap { padding: 26px 16px 48px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .v { font-size: 22px; }
  .sig { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 12px; align-items: start; }
  .sig .spark { grid-column: 2; }
  .rank { font-size: 18px; }
  .sig h3 { font-size: 16.5px; }
  .stats { grid-template-columns: 1fr 1fr; }
  dialog#dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .dlg-body { padding: 16px 16px 28px; }
  .legend .lg-constellation div:nth-child(n+3) { display: none; }
}

/* Меньше движения — по настройке системы: без полёта, пульсаций и вращения. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important;
    transition-duration: .001ms !important; }
  .sig { opacity: 1; transform: none; }
}
