/* Инфо-Импульс — стили сайта. Цвета заданы токенами; тёмная тема — по настройке системы. */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --ink: #141c2b;
  --ink-2: #566074;
  --line: #e1e5ec;
  --brand: #1b64be;
  --brand-hover: #1757ac;
  --brand-ink: #ffffff;
  --brand-soft: #e3eefc;
  --accent: #f47230;
  --hero-bg: #0e1b2e;
  --hero-ink: #eef3fa;
  --hero-ink-2: #aab7ca;
  --good: #006c10;
  --bad: #c62f30;
  --warn-bg: #fff6e0;
  --warn-line: #f2c14e;
  --err-bg: #fdecec;
  --err-line: #e7a1a1;
  --ok-bg: #e8f6eb;
  --ok-line: #9fd3a9;

  /* Графики: опорная палитра (проверена на различимость при нарушениях цветового зрения). */
  --c-surface: #ffffff;
  --c-ink: #191919;
  --c-ink-2: #666666;
  --c-grid: #e7e7e7;
  --c-axis: #c2c2c2;
  --c-s1: #257de0; --c-s2: #f47230; --c-s3: #00b894; --c-s4: #f2a600;
  --c-s5: #ee7fac; --c-s6: #008a17; --c-s7: #6a4ce2; --c-s8: #ec4647;
  --c-seq: #cce3fd, #9dc8f7, #6aabf1, #338ced, #2370cd, #1757ac, #0e3d7e;
  --c-ord: #84b9f3, #519ced, #2370cd, #0e3d7e;
  --c-pos: #2370cd;
  --c-neg: #dc3c3d;
  --c-mid: #efefef;
  --c-muted: #c9ced6;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0f17;
    --surface: #151b26;
    --surface-2: #1c2431;
    --ink: #e8ecf2;
    --ink-2: #9aa4b5;
    --line: #283244;
    --brand: #519ced;
    --brand-hover: #6aabf1;
    --brand-ink: #0b0f17;
    --brand-soft: #182a44;
    --hero-bg: #0d1626;
    --good: #53c556;
    --bad: #eb6263;
    --warn-bg: #2b2412;
    --warn-line: #7a5f1c;
    --err-bg: #2d1718;
    --err-line: #7d3133;
    --ok-bg: #132717;
    --ok-line: #2f6b3a;

    --c-surface: #151b26;
    --c-ink: #efefef;
    --c-ink-2: #9c9c9c;
    --c-grid: #283244;
    --c-axis: #3a4557;
    --c-s1: #338ced; --c-s2: #e76624; --c-s3: #00a888; --c-s4: #d28e05;
    --c-s5: #e24d8b; --c-s6: #0aac23; --c-s7: #9887ef; --c-s8: #eb6263;
    --c-seq: #0e3d7e, #0f4a96, #1757ac, #2370cd, #338ced, #6aabf1, #b6d5f8;
    --c-ord: #1757ac, #2370cd, #519ced, #9dc8f7;
    --c-pos: #338ced;
    --c-neg: #eb6263;
    --c-mid: #383838;
    --c-muted: #4a5567;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font);
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 4.6vw, 48px); }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Шапка */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 19px; white-space: nowrap; }
.logo svg { width: 34px; height: 34px; flex: none; }
.logo:hover { color: var(--ink); }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }
.nav .btn { margin-left: 8px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink); font: inherit; cursor: pointer; }
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--surface); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background .15s; }
.btn-primary, .nav a.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover, .nav a.btn-primary:hover { background: var(--brand-hover); color: var(--brand-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn-ghost-light { color: var(--hero-ink); border-color: rgba(255,255,255,.3); background: transparent; }
.btn-ghost-light:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Секции */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.lead { font-size: 19px; color: var(--ink-2); }

.hero { background: var(--hero-bg); color: var(--hero-ink); padding: 88px 0 120px; position: relative; overflow: hidden; }
.hero .container { position: relative; z-index: 1; }
.hero h1 { max-width: 820px; }
.hero .lead { color: var(--hero-ink-2); max-width: 680px; margin-bottom: 32px; }
.hero .eyebrow { color: #84b9f3; }
.hero-pulse { position: absolute; inset: auto 0 0 0; height: 100px; opacity: .35; pointer-events: none; }
.page-hero { padding: 56px 0 40px; background: var(--surface); border-bottom: 1px solid var(--line); }
.page-hero .lead { max-width: 760px; margin: 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin-bottom: 8px; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card-link { text-decoration: none; color: inherit; display: block; transition: border-color .15s; }
.card-link:hover { border-color: var(--brand); color: inherit; }
.icon-badge { width: 44px; height: 44px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 16px; }
.icon-badge svg { width: 24px; height: 24px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); vertical-align: middle; }

.stat { font-size: 36px; font-weight: 700; line-height: 1.1; margin-bottom: 4px; }
.facts .card { box-shadow: none; }

.checklist { list-style: none; padding: 0; margin: 0 0 1em; }
.checklist li { padding-left: 28px; position: relative; margin-bottom: 8px; }
.checklist li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 7px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }

.steps { counter-reset: step; display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps > li { list-style: none; counter-increment: step; }
.steps > li::before { content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; margin-bottom: 12px; }
.steps { padding: 0; margin: 0; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

.cta-band { background: var(--brand); color: var(--brand-ink); border-radius: 16px; padding: 40px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.cta-band h2 { margin: 0 0 4px; }
.cta-band p { margin: 0; opacity: .9; }
.cta-band .btn { background: var(--surface); color: var(--ink); }
.cta-band .btn:hover { background: var(--surface-2); color: var(--ink); }

.service { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; padding: 32px 0; border-top: 1px solid var(--line); }
.service:first-of-type { border-top: 0; }
@media (max-width: 800px) { .service { grid-template-columns: 1fr; gap: 12px; } }

details.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
details.faq summary { font-weight: 600; cursor: pointer; }
details.faq p { margin: 12px 0 0; color: var(--ink-2); }

.note { border-radius: var(--radius); padding: 16px 20px; border: 1px solid var(--line); background: var(--surface); }
.note-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.note-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.note-err { background: var(--err-bg); border-color: var(--err-line); }
.note-brand { background: var(--brand-soft); border-color: transparent; }
.note h3, .note h4 { margin-bottom: 6px; }
.note ul { margin: 6px 0 0; padding-left: 20px; }
.note p:last-child { margin-bottom: 0; }

/* Таблицы */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* Формы */
label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 6px; }
input[type=text], input[type=email], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
textarea { min-height: 120px; resize: vertical; }
.field { margin-bottom: 16px; }

/* Подвал */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 40px 0 24px; margin-top: 0; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--ink); text-decoration: none; }
.footer-grid a:hover { color: var(--brand); }
.footer-bottom { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* Дашборды */
.dash { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.dash > * { grid-column: span 12; }
.dash .span-4 { grid-column: span 4; }
.dash .span-5 { grid-column: span 5; }
.dash .span-6 { grid-column: span 6; }
.dash .span-7 { grid-column: span 7; }
.dash .span-8 { grid-column: span 8; }
@media (max-width: 1000px) { .dash .span-4, .dash .span-5, .dash .span-6, .dash .span-7, .dash .span-8 { grid-column: span 12; } }
.dash-intro { margin-bottom: 16px; }
.dash-intro h2 { margin-bottom: 4px; }

.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.tile-label { color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
.tile-value { font-size: 28px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-delta { font-size: 14px; margin-top: 4px; color: var(--ink-2); }
.tile-delta .up { color: var(--good); font-weight: 600; }
.tile-delta .down { color: var(--bad); font-weight: 600; }
.tile svg.spark { display: block; width: 100%; height: 32px; margin-top: 8px; }

.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 12px; min-width: 0; }
.chart-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.chart-head h3 { font-size: 16px; margin: 0; }
.chart-head p { font-size: 13px; color: var(--ink-2); margin: 2px 0 0; }
.chart-toggle { flex: none; font: 13px var(--font); color: var(--ink-2); background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.chart-toggle:hover { color: var(--ink); background: var(--surface-2); }
.chart-body { width: 100%; }
.chart-table { max-height: 360px; overflow: auto; }
.chart-table table { font-size: 13px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 24px; scrollbar-width: thin; }
.tabs button { flex: none; font: 600 15px var(--font); color: var(--ink-2); background: none; border: 0; border-bottom: 2px solid transparent; padding: 12px 14px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tabs button:hover { color: var(--ink); }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 200px; }
.filters select { padding: 8px 10px; }

/* Загрузка */
.dropzone { border: 2px dashed var(--line); border-radius: 16px; background: var(--surface); padding: 40px 24px; text-align: center; transition: border-color .15s, background .15s; }
.dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone h3 { margin-bottom: 4px; }
.dropzone .btn-row { justify-content: center; margin-top: 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 32px 0 16px; }
.result-head h2 { margin: 0; }
.req { color: var(--bad); font-weight: 700; }
.download-list { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 800px) { .download-list { grid-template-columns: 1fr; } }
.download-list a { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); }
.download-list a:hover { border-color: var(--brand); color: var(--ink); }
.download-list strong { display: block; }
.file-ext { flex: none; width: 48px; height: 48px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font: 700 12px var(--font); display: grid; place-items: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .chart-toggle, .tabs, .dropzone { display: none !important; } }
.service > * { min-width: 0; }
