/* Geans: стили страницы и отчёта. Этот же файл встраивается в сохранённый HTML-отчёт (app.js, «Сохранить отчёт»). */
:root {
  /* LP (2026-10-17): спокойная «научная» палитра — тёмно-синий (--ink) и графит + один акцент (сине-зелёный);
     контраст текста ≥ 4,5:1: --muted #4f5b6d на #fff ≈ 6,9:1, --accent #0f766e на #fff ≈ 5,5:1, белый на --accent ≈ 5,5:1 */
  --bg: #f5f7fa; --card: #ffffff; --text: #18202e; --muted: #4f5b6d; --line: #d8dee8; --ink: #173a6b;
  --accent: #0f766e; --accent-text: #ffffff; --warn-bg: #fff4d6; --warn-line: #e0b84a;
  --err-bg: #fde8e8; --err-line: #d9534f; --ok: #2e7d32; --th: #eef2f7; --tint: #e8f3f1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* --muted #a3afc0 на --card #182131 ≈ 7,6:1; --accent #4fd1c5 на #182131 ≈ 8,9:1 */
    --bg: #0f1520; --card: #182131; --text: #e6ebf2; --muted: #a3afc0; --line: #2d3a50; --ink: #9cc0ff;
    --accent: #4fd1c5; --accent-text: #06201e; --warn-bg: #3a3015; --warn-line: #a88a2e;
    --err-bg: #3b1d1d; --err-line: #e57373; --ok: #81c784; --th: #1f2a3d; --tint: #14302f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
main { max-width: 960px; margin: 0 auto; padding: 0 16px 32px; }
.top { display: flex; justify-content: space-between; align-items: center; max-width: 960px; margin: 0 auto; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; letter-spacing: 0.02em; color: var(--ink); }
.brand img { display: block; }
.lang-btn { border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 4px 10px; cursor: pointer; font: inherit; }
.lang-btn:first-child { border-radius: 6px 0 0 6px; }
.lang-btn:last-child { border-radius: 0 6px 6px 0; border-left: 0; }
.lang-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
/* S10 (2026-10-17): первый выпуск — только английский. Язык страницы анализа задаёт константа LANGS в app.js; это правило —
   страховка для страниц без JS: прячет переключатель RU/EN на служебных страницах и русский абзац в ответе формы.
   Вернуть русский: LANGS = ['ru', 'en'] в app.js и удалить это правило (docs/web-client.md, «Языки»). */
.lang, .lang-ru { display: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* --- главная (LP): шапка-герой с орнаментом спирали, выбор файла, «Как это работает» */
.hero { position: relative; padding: 8px 0 4px; }
.dna-art { display: block; width: 100%; height: 56px; margin: 4px 0 12px; }
.dna-art path { fill: none; stroke-linecap: round; }
.dna-s1 { stroke: var(--ink); stroke-width: 2.5; opacity: .85; }
.dna-s2 { stroke: var(--accent); stroke-width: 2.5; opacity: .85; }
.dna-r1 { stroke: var(--muted); stroke-width: 1.5; opacity: .35; }
.dna-r2 { stroke: var(--accent); stroke-width: 1.5; opacity: .5; }
.eyebrow { margin: 0; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { font-size: 32px; letter-spacing: -0.01em; color: var(--ink); max-width: 24em; margin: 6px 0 10px; }
.lead { font-size: 17px; max-width: 46em; margin: 0 0 8px; }
.hero .privacy { border-left: 3px solid var(--accent); background: var(--tint); color: var(--text); padding: 8px 12px;
  border-radius: 0 8px 8px 0; max-width: 46em; }
.pick { border-top: 3px solid var(--accent); }
.pick h2, .how h2 { font-size: 19px; margin: 0 0 12px; color: var(--ink); }
.how { margin: 24px 0 8px; }
.how-list { list-style: none; counter-reset: how; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.how-list li { counter-increment: how; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.how-list li::before { content: counter(how, decimal-leading-zero); display: block; color: var(--accent); font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin-bottom: 6px; }
.how-list h3 { font-size: 16px; margin: 0 0 4px; }
.how-list p { margin: 0; color: var(--muted); font-size: 14px; }
#progress:not([hidden]) ~ #how, #report:not([hidden]) ~ #how { display: none; }
.licence { color: var(--muted); font-size: 13px; }
.licence a { color: var(--accent); }
.report ~ .licence { max-width: 960px; margin: 8px 0 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin: 16px 0; }
h1 { font-size: 26px; line-height: 1.25; margin: 4px 0 8px; }
.privacy { color: var(--muted); }
.note { color: var(--muted); font-size: 14px; }
.consent { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; color: var(--text); cursor: pointer; }
.consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; }
.drop { display: block; border: 2px dashed var(--line); border-radius: 10px; padding: 24px 16px; text-align: center; cursor: pointer; }
.drop.over { border-color: var(--accent); }
.drop input { display: block; margin: 0 auto 12px; max-width: 100%; }
.drop-title { display: block; font-weight: 600; }
.drop-hint { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.drop-file { display: block; margin-top: 8px; font-weight: 600; word-break: break-all; }
button { font: inherit; }
.primary, .secondary { border-radius: 8px; padding: 10px 18px; cursor: pointer; border: 1px solid var(--accent); }
.primary { background: var(--accent); color: var(--accent-text); }
.secondary { background: transparent; color: var(--accent); }
.primary:disabled { opacity: 0.45; cursor: default; }
.loader { display: flex; justify-content: center; margin: 0 0 12px; }
.loader[hidden] { display: none; }
.helix { display: block; overflow: visible; }
/* Спираль: две цепи (h-a, h-b) ходят по кругу в противофазе; «глубина» — размер и прозрачность узла; перекладина из двух
   половинок — пара оснований (A–T: акцент + приглушённый; G–C: два других тона); все элементы ряда стартуют со сдвигом --d. */
.helix .h-a { fill: var(--accent); }
.helix .h-b { fill: var(--muted); }
.helix .h-at .h-rung-l { fill: var(--accent); opacity: .55; } .helix .h-at .h-rung-r { fill: var(--muted); opacity: .55; }
.helix .h-gc .h-rung-l { fill: var(--muted); opacity: .8; }  .helix .h-gc .h-rung-r { fill: var(--accent); opacity: .8; }
.helix .h-rung { transform-box: fill-box; }
.helix .h-rung-l { transform-origin: left center; } .helix .h-rung-r { transform-origin: right center; }
.helix .h-a, .helix .h-b, .helix .h-rung { animation-duration: 2.4s; animation-timing-function: ease-in-out;
  animation-iteration-count: infinite; animation-delay: var(--d, 0s); }
.helix .h-a { animation-name: helix-a; }
.helix .h-b { animation-name: helix-b; }
.helix .h-rung-l { animation-name: helix-rung-l; } .helix .h-rung-r { animation-name: helix-rung-r; }
.helix .h-row:nth-child(2) { --d: -0.2s; } .helix .h-row:nth-child(3) { --d: -0.4s; } .helix .h-row:nth-child(4) { --d: -0.6s; }
.helix .h-row:nth-child(5) { --d: -0.8s; } .helix .h-row:nth-child(6) { --d: -1s; } .helix .h-row:nth-child(7) { --d: -1.2s; }
.helix .h-row:nth-child(8) { --d: -1.4s; } .helix .h-row:nth-child(9) { --d: -1.6s; } .helix .h-row:nth-child(10) { --d: -1.8s; }
.helix .h-row:nth-child(11) { --d: -2s; } .helix .h-row:nth-child(12) { --d: -2.2s; }
/* один оборот: край (глубина 0) → перед (крупнее, ярче) → другой край → зад (мельче, бледнее) → край */
@keyframes helix-a { 0% { transform: translateX(22px) scale(1); opacity: .85; } 25% { transform: translateX(0) scale(1.3); opacity: 1; }
  50% { transform: translateX(-22px) scale(1); opacity: .85; } 75% { transform: translateX(0) scale(.7); opacity: .45; } 100% { transform: translateX(22px) scale(1); opacity: .85; } }
@keyframes helix-b { 0% { transform: translateX(-22px) scale(1); opacity: .85; } 25% { transform: translateX(0) scale(.7); opacity: .45; }
  50% { transform: translateX(22px) scale(1); opacity: .85; } 75% { transform: translateX(0) scale(1.3); opacity: 1; } 100% { transform: translateX(-22px) scale(1); opacity: .85; } }
/* половинки перекладины: от узла a (левая половина растёт, когда a справа) — проекция вращающейся пары оснований */
@keyframes helix-rung-l { 0% { transform: scaleX(1); } 25% { transform: scaleX(.05); } 50% { transform: scaleX(1); } 75% { transform: scaleX(.05); } 100% { transform: scaleX(1); } }
@keyframes helix-rung-r { 0% { transform: scaleX(1); } 25% { transform: scaleX(.05); } 50% { transform: scaleX(1); } 75% { transform: scaleX(.05); } 100% { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .helix .h-a, .helix .h-b, .helix .h-rung { animation-play-state: paused; } }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { padding: 4px 0 4px 28px; position: relative; color: var(--muted); }
.steps li::before { content: "○"; position: absolute; left: 4px; }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active::before { content: "◔"; }
.steps li.done { color: var(--text); }
.steps li.done::before { content: "✓"; color: var(--ok); }
.steps li.failed::before { content: "✕"; color: var(--err-line); }
.step-detail { color: var(--muted); font-size: 14px; min-height: 1.5em; margin: 8px 0 0; }
.error { background: var(--err-bg); border-color: var(--err-line); }
.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 12px 16px; margin: 16px 0 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.foot { max-width: 960px; margin: 0 auto; padding: 8px 16px 24px; color: var(--muted); font-size: 13px; }
.note a, .foot a { color: var(--accent); }

/* --- отчёт */
.report { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin: 8px 0 16px;
  overflow-wrap: anywhere; }
.report h1 { font-size: 24px; }
.report h2 { font-size: 20px; margin: 24px 0 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.report h3 { font-size: 17px; margin: 16px 0 6px; }
.report a { color: var(--accent); }
.report .link-host { color: var(--muted); font-size: 0.9em; }
.report code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
.table-wrap { overflow-x: auto; margin: 8px 0 16px; }
.report table { border-collapse: collapse; width: 100%; font-size: 14px; }
.report th, .report td { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; text-align: left; }
.report th { background: var(--th); }
/* отчёт v2: оглавление (md.js, toc) и карточки Summary — список под «## Summary» (id="summary"; RU — «Сводка») */
.report .toc { font-size: 14px; margin: 4px 0 16px; }
.report .toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
#summary + ul, #сводка + ul { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 8px; }
#summary + ul > li, #сводка + ul > li { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 8px 12px; background: var(--card); }
#summary + ul > li > strong:first-child, #сводка + ul > li > strong:first-child { display: block; margin-bottom: 2px; }
/* отчёт v2: «Details» — свёрнутые подробности (md.js пропускает <details>/<summary>); кнопка/ссылка выгрузки полной таблицы */
.report details { margin: 4px 0 12px; }
.report summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.report details[open] > summary { margin-bottom: 6px; }
.report td details { margin: 0; }
.report td summary { font-size: 13px; }
.report .tsv-download { display: inline-block; margin: 4px 0; padding: 6px 12px; font-size: 14px; text-decoration: none;
  border-radius: 8px; border: 1px solid var(--accent); color: var(--accent); background: transparent; cursor: pointer; }

@media (max-width: 600px) {
  .card, .report { padding: 12px 14px; }
  h1, .hero h1 { font-size: 24px; }
  .lead { font-size: 16px; }
  .dna-art { height: 44px; }
  .report table { font-size: 13px; }
}

/* --- печать (кнопка «Сохранить в PDF») */
@media print {
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #333; --line: #999; --th: #eee; --accent: #000; }
  body { font-size: 11pt; background: #fff; }
  .no-print, .top, .foot { display: none !important; }
  main { max-width: none; padding: 0; }
  .report { border: 0; padding: 0; margin: 0; }
  .table-wrap { overflow: visible; }
  .report table { font-size: 9pt; }
  .report tr, .report li { break-inside: avoid; }
  .report h2, .report h3 { break-after: avoid; }
  .report a { text-decoration: none; }
  /* «Details» при печати раскрыты (в сохранённом HTML скриптов нет — только CSS; на странице app.js ещё и ставит open),
     «Details» печатается подзаголовком; кнопка выгрузки таблицы не печатается */
  details { display: block; }
  details > * { display: block; }
  details > :is(strong, em, code, a, span) { display: inline; }       /* строчный блок в ячейке таблицы */
  details::details-content { content-visibility: visible; display: block; }
  summary { list-style: none; color: var(--text); font-weight: 600; font-size: 10pt; margin: 4px 0 2px; cursor: auto; }
  summary::-webkit-details-marker { display: none; }
  summary::marker { content: ""; }
  .report .tsv-download { display: none !important; }
  #summary + ul > li, #сводка + ul > li { border: 1px solid #999; border-left: 3px solid #000; break-inside: avoid; page-break-inside: avoid; }
}
