/* ============================================================
   ВАЛОР — сайт платформы доказательной оценки
   Дизайн-система: тёмно-синий бренд + латунный акцент.
   Темы light/dark через CSS-переменные.
   ============================================================ */

/* ---------- Переменные: светлая тема (по умолчанию) ---------- */
:root {
  --bg: #eef3fa;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --surface-3: #e2eaf5;
  --line: #ccd7e6;
  --line-strong: #9fb2ca;

  --text: #0e1c36;
  --text-2: #29405f;
  --text-3: #4a5f7d;

  --brand: #13284d;
  --brand-ink: #ffffff;
  --brand-soft: #e6edf8;
  --accent: #2c5fcc;
  --accent-soft: #e5ecfb;

  --brass: #7b4b1e;
  --brass-strong: #9a6428;
  --brass-soft: #f4ebe0;

  --ok: #1e7a4c;  --ok-soft: #e0f1e7;
  --warn: #9d5d0c; --warn-soft: #fbedd8;
  --crit: #b3302e; --crit-soft: #f8e0df;
  --info: #2c5fcc; --info-soft: #e5ecfb;

  --inv-bg: #13284d;
  --inv-surface: #1a3360;
  --inv-line: #2a4878;
  --inv-text: #f4f7fc;
  --inv-text-2: #c9d6ea;
  --inv-brass: #d4af37;

  --shadow-1: 0 1px 2px rgba(19, 35, 63, .06);
  --shadow-2: 0 24px 56px -24px rgba(19, 40, 77, .38), 0 2px 8px rgba(19, 35, 63, .07);

  --font-display: Georgia, "Times New Roman", serif;
  --font-ui: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
  --radius-lg: 16px;
  color-scheme: light;
}

/* ---------- Переменные: тёмная тема ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060d1b;
    --surface: #101e38;
    --surface-2: #0b1730;
    --surface-3: #17304f;
    --line: #2a446c;
    --line-strong: #3d5c8c;

    --text: #f4f7fc;
    --text-2: #c9d6ea;
    --text-3: #a9bdda;

    --brand: #c3d3ef;
    --brand-ink: #081631;
    --brand-soft: #16294b;
    --accent: #7ea8f7;
    --accent-soft: #17294c;

    --brass: #d4af37;
    --brass-strong: #e2c456;
    --brass-soft: #2b2412;

    --ok: #56c690;  --ok-soft: #10301f;
    --warn: #e8aa4a; --warn-soft: #33260f;
    --crit: #f27a70; --crit-soft: #3a1a1c;
    --info: #7ea8f7; --info-soft: #17294c;

    --inv-bg: #040a17;
    --inv-surface: #0d1b34;
    --inv-line: #2a446c;
    --inv-text: #f4f7fc;
    --inv-text-2: #c9d6ea;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 24px 56px -24px rgba(0, 0, 0, .8), 0 2px 8px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060d1b;
  --surface: #101e38;
  --surface-2: #0b1730;
  --surface-3: #17304f;
  --line: #2a446c;
  --line-strong: #3d5c8c;

  --text: #f4f7fc;
  --text-2: #c9d6ea;
  --text-3: #a9bdda;

  --brand: #c3d3ef;
  --brand-ink: #081631;
  --brand-soft: #16294b;
  --accent: #7ea8f7;
  --accent-soft: #17294c;

  --brass: #d4af37;
  --brass-strong: #e2c456;
  --brass-soft: #2b2412;

  --ok: #56c690;  --ok-soft: #10301f;
  --warn: #e8aa4a; --warn-soft: #33260f;
  --crit: #f27a70; --crit-soft: #3a1a1c;
  --info: #7ea8f7; --info-soft: #17294c;

  --inv-bg: #040a17;
  --inv-surface: #0d1b34;
  --inv-line: #2a446c;
  --inv-text: #f4f7fc;
  --inv-text-2: #c9d6ea;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 24px 56px -24px rgba(0, 0, 0, .8), 0 2px 8px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 17px/1.62 var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: lining-nums;
  transition: background-color .2s ease, color .2s ease;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.14; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: clamp(2.3rem, 1.3rem + 3.6vw, 4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem); font-family: var(--font-ui); font-weight: 650; }
h4 { font-size: 1.02rem; font-family: var(--font-ui); font-weight: 650; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: .38em; }
strong { font-weight: 650; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.lede { font-size: clamp(1.08rem, 1rem + .4vw, 1.28rem); color: var(--text-2); max-width: 66ch; }
.small { font-size: .93rem; color: var(--text-3); }
.note { font-size: .88rem; color: var(--text-3); }
.kicker {
  display: inline-block; font-family: var(--font-ui); font-size: .8rem; font-weight: 650;
  letter-spacing: .14em; text-transform: uppercase; color: var(--brass); margin-bottom: 14px;
}
.mono { font-family: var(--font-mono); font-size: .92em; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: #13284d; color: #f4f7fc;
  border-bottom: 1px solid #1c3358;
  transition: border-color .2s ease, box-shadow .2s ease;
}
:root[data-theme="dark"] .top { background: #0a1730; }
.top.is-scrolled { border-bottom-color: #d4af37; box-shadow: 0 6px 24px -12px rgba(0,0,0,.5); }
.top__in { display: flex; align-items: center; gap: 20px; min-height: 68px; flex-wrap: wrap; }

.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo__mark {
  width: 34px; height: 34px; border-radius: 9px; background: #1b3666;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
  font-size: 19px; color: #fff; border: 1px solid #2c4a7d; position: relative; flex: none;
}
.logo__mark::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 5px; border-bottom: 2px dashed #d4af37; }
.logo__word { font-family: var(--font-display); font-size: 1.24rem; font-weight: 700; letter-spacing: .12em; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: #c9d6ea; font-size: .9rem; font-weight: 500; padding: 8px 8px; border-radius: 8px;
  white-space: nowrap; transition: background-color .15s ease, color .15s ease;
}
.nav a:hover { background: #1c3561; color: #fff; text-decoration: none; }
.nav a[aria-current="page"] { color: #d4af37; }

.top__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 9px; border: 1px solid #2c4a7d; background: transparent;
  color: #e7eefa; display: grid; place-items: center; cursor: pointer; transition: background-color .15s ease;
}
.icon-btn:hover { background: #1c3561; }
.menu-btn { display: none; }

.top__cta {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 9px;
  background: #d4af37; color: #13233f; font-weight: 650; font-size: .92rem; white-space: nowrap;
}
.top__cta:hover { background: #e6c963; text-decoration: none; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 10px; border: 1px solid transparent;
  font: 600 1rem/1 var(--font-ui); cursor: pointer; transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--accent); color: #fff; }
.btn--brass { background: #d4af37; color: #13233f; }
.btn--brass:hover { background: #e6c963; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .93rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- Секции ---------- */
.sec { padding: clamp(56px, 8vw, 104px) 0; }
.sec--band { background: var(--surface-2); border-block: 1px solid var(--line); }
.sec--inv { background: var(--inv-bg); color: var(--inv-text); }
.sec--inv h2, .sec--inv h3 { color: var(--inv-text); }
.sec--inv .lede { color: var(--inv-text-2); }
.sec--inv .note, .sec--inv .small { color: var(--inv-text-2); }
.sec__head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.sec__head h2::before {
  content: ""; display: block; width: 48px; height: 3px; margin-bottom: 18px;
  background: var(--brass-strong); border-radius: 2px;
}
.sec--inv .sec__head h2::before { background: var(--inv-brass); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 7vw, 88px); background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { margin-bottom: 18px; }
.hero__status { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }

/* Карточка-«леджер» в hero */
.ledger { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.ledger__head { padding: 14px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .85rem; font-weight: 650; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.ledger__row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.ledger__row:last-child { border-bottom: 0; }
.ledger__row b { font-family: var(--font-mono); font-size: .98rem; }
.ledger__row--total { background: var(--brand-soft); font-weight: 650; }
.ledger__row--total b { color: var(--brand); }
:root[data-theme="dark"] .ledger__row--total b { color: var(--brand); }
.ledger__foot { padding: 12px 20px; background: var(--surface-2); border-top: 1px solid var(--line); font-size: .85rem; color: var(--text-3); }
.dashed { border-bottom: 2px dashed var(--brass-strong); cursor: help; }

/* ---------- Сетки и карточки ---------- */
.grid { display: grid; gap: 18px; }
.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)); }
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1080px) { .grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-1); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card h3 { margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.card__num { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-family: var(--font-display); margin-bottom: 14px; }
.card__code { display: inline-block; font-family: var(--font-mono); font-size: .82rem; font-weight: 700; color: var(--brass); background: var(--brass-soft); padding: 3px 9px; border-radius: 6px; margin-bottom: 12px; }

.sec--inv .card { background: var(--inv-surface); border-color: var(--inv-line); }
.sec--inv .card:hover { border-color: #3d5c8c; }
.sec--inv .card__num { background: #22406f; color: #f4f7fc; }

/* ---------- Статистика ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: left; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); color: var(--brand); line-height: 1.1; }
:root[data-theme="dark"] .stat b { color: var(--brand); }
.stat span { display: block; margin-top: 6px; font-size: .9rem; color: var(--text-3); }
.sec--inv .stat { background: var(--inv-surface); border-color: var(--inv-line); }
.sec--inv .stat b { color: var(--inv-brass); }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 680px; }
.tbl th, .tbl td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--surface-2); font-weight: 650; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); position: sticky; top: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td:first-child { font-family: var(--font-mono); font-size: .88rem; white-space: nowrap; }
.sec--inv .tbl { background: var(--inv-surface); color: var(--inv-text); }
.sec--inv .tbl th { background: #16305a; color: var(--inv-text-2); }
.sec--inv .tbl td { border-color: var(--inv-line); }

/* ---------- Таблица «проблема → решение» ---------- */
.shift { width: 100%; border-collapse: collapse; }
.shift th { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; padding: 12px 18px; text-align: left; }
.shift th:first-child { color: var(--crit); }
.shift th:last-child { color: var(--ok); }
.shift td { padding: 14px 18px; border-top: 1px solid var(--line); vertical-align: top; width: 50%; }
.shift td:first-child { color: var(--text-2); }
.shift td:last-child { font-weight: 500; }
.shift tr:hover td { background: var(--surface-2); }

/* ---------- Бейджи / теги ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .82rem; font-weight: 650; white-space: nowrap; }
.tag--ok   { background: var(--ok-soft);   color: var(--ok); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--crit { background: var(--crit-soft); color: var(--crit); }
.tag--info { background: var(--info-soft); color: var(--info); }
.tag--brass{ background: var(--brass-soft); color: var(--brass); }

/* ---------- Callout ---------- */
.callout { border-left: 5px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 22px; margin: 24px 0; }
.callout--warn { border-color: var(--warn); background: var(--warn-soft); }
.callout--crit { border-color: var(--crit); background: var(--crit-soft); }
.callout--ok { border-color: var(--ok); background: var(--ok-soft); }
.callout--brass { border-color: var(--brass-strong); background: var(--brass-soft); }
.callout h4 { margin: 0 0 6px; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Два столбца ---------- */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 44px); align-items: start; }
.split--wide-left { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); }

/* ---------- Шаги ---------- */
.steps { counter-reset: step; display: grid; gap: 14px; }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 18px 64px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.step h4 { margin: 0 0 4px; }
.step p { margin: 0; color: var(--text-2); font-size: .96rem; }

/* ---------- Дорожная карта ---------- */
.road-scale { position: relative; margin: 34px 0 44px; padding-top: 30px; }
.road-scale__axis { position: relative; height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 45%, var(--brass-strong) 100%); opacity: .85; }
.road-scale__marks { display: flex; justify-content: space-between; margin-top: 10px; font-size: .85rem; color: var(--text-3); font-family: var(--font-mono); }
.road-scale__now { position: absolute; top: 12px; left: 14%; transform: translateX(-50%); text-align: center; font-size: .78rem; color: var(--crit); font-weight: 650; }
.road-scale__now::after { content: ""; display: block; width: 2px; height: 34px; background: var(--crit); margin: 4px auto 0; }

.wave { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.wave__head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.wave__n { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--brass); }
.wave__when { margin-left: auto; font-weight: 650; color: var(--brand); }
.wave__body { padding: 18px 22px; }
.wave__body ul { columns: 2; column-gap: 32px; margin-bottom: 0; }
@media (max-width: 720px) { .wave__body ul { columns: 1; } }

/* ---------- FAQ ---------- */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 17px 20px; font-weight: 650; list-style: none; position: relative; padding-right: 46px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--brass); }
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .faq__a { padding: 16px 20px; color: var(--text-2); }
.faq .faq__a p:last-child { margin-bottom: 0; }

/* ---------- CTA-блок ---------- */
.cta { background: var(--inv-bg); color: var(--inv-text); border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 52px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.cta h2 { color: var(--inv-text); margin-bottom: 10px; }
.cta h2::before { content: ""; display: block; width: 48px; height: 3px; margin-bottom: 16px; background: var(--inv-brass); border-radius: 2px; }
.cta p { color: var(--inv-text-2); margin: 0; max-width: 62ch; }
.cta .btn-row { margin: 0; }
@media (max-width: 860px) { .cta { grid-template-columns: 1fr; } }

/* ---------- Контакты ---------- */
.contacts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.contacts a { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--text); font-weight: 600; font-size: .95rem; }
.contacts a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.sec--inv .contacts a { color: var(--inv-text); border-color: var(--inv-line); }

/* ---------- Список-«галочки» ---------- */
.ticks { list-style: none; padding: 0; }
.ticks li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 16px; height: 9px;
  border-left: 2.5px solid var(--ok); border-bottom: 2.5px solid var(--ok); transform: rotate(-45deg);
}
.sec--inv .ticks li::before { border-color: var(--inv-brass); }

/* ---------- Страницы ---------- */
.page { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 104px); }
.page__head { margin-bottom: clamp(30px, 5vw, 52px); }
.page__crumb { font-size: .88rem; color: var(--text-3); margin-bottom: 16px; }
.page__crumb a { color: var(--text-3); }
.page h1 { max-width: 22ch; }

/* ---------- Подвал ---------- */
.foot { background: #0e2043; color: #c9d6ea; padding: 52px 0 40px; border-top: 3px solid #d4af37; }
.foot a { color: #c9d6ea; }
.foot a:hover { color: #fff; }
.foot__in { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; }
.foot .logo { color: #fff; margin-bottom: 14px; }
.foot__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; align-content: start; font-size: .94rem; }
.foot__legal { margin-top: 30px; padding-top: 22px; border-top: 1px solid #1c3358; font-size: .85rem; color: #8fa3c2; }
@media (max-width: 760px) { .foot__in { grid-template-columns: 1fr; } }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split--wide-left { grid-template-columns: 1fr; }
  .menu-btn { display: grid; }
  .nav {
    display: none; order: 10; width: 100%; flex-direction: column; align-items: stretch;
    background: #13284d; border-top: 1px solid #1c3358; padding: 10px 0 14px; margin-left: 0;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 6px; border-radius: 0; border-bottom: 1px solid #1a3057; }
  .top__in { min-height: 60px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn { width: 100%; }
  .btn-row .btn { width: auto; flex: 1 1 240px; }
  .shift td { width: auto; display: block; }
  .shift tr { display: block; border-top: 1px solid var(--line); padding: 8px 0; }
  .shift td { border: 0; padding: 6px 14px; }
  .shift th { display: none; }
  .shift td:first-child::before { content: "Проблема: "; color: var(--crit); font-weight: 650; }
  .shift td:last-child::before { content: "ВАЛОР: "; color: var(--ok); font-weight: 650; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .top__cta { display: none; }
}

/* ---------- Уменьшенная анимация ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- Печать ---------- */
@media print {
  .top, .foot, .btn, .cta, .contacts { display: none !important; }
  body { background: #fff; color: #000; }
}


/* ===== v4: бронза на светлом, золото на тёмном; визуальная доработка ===== */
:root { --metal: linear-gradient(135deg,#b07a3c 0%,#7b4b1e 100%); --gold: linear-gradient(135deg,#f3dc85 0%,#d4af37 48%,#b08d22 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --metal: var(--gold); } }
:root[data-theme="dark"] { --metal: var(--gold); }
::selection { background: color-mix(in srgb, var(--brass-strong) 35%, transparent); }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.statusbar { background: var(--brass-soft); border-bottom: 1px solid var(--line); font-size: .86rem; color: var(--text-2); padding: 8px 0; }
.statusbar strong { color: var(--brass); }
.logo__mark { background: linear-gradient(145deg,#1d3a6c,#13284d); box-shadow: inset 0 0 0 1px rgba(212,175,55,.55); }
.top__cta, .btn--brass { background: var(--gold); color: #1b1405; box-shadow: 0 6px 18px -8px rgba(212,175,55,.7); }
.top__cta:hover, .btn--brass:hover { filter: brightness(1.08); }
.hero { background: radial-gradient(900px 420px at 88% -8%, color-mix(in srgb, var(--brass-strong) 16%, transparent), transparent 62%), radial-gradient(760px 380px at -4% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 62%), linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
.hero h1 { font-size: clamp(2.1rem, 1.4rem + 3.1vw, 3.7rem); letter-spacing: -.012em; }
.lede { max-width: 66ch; }
.kicker { display: inline-flex; align-items: center; gap: 10px; }
.kicker::before { content: ""; width: 28px; height: 3px; border-radius: 2px; background: var(--metal); }
.sec__head h2::before { background: var(--metal); }
.sec--inv .sec__head h2::before, .cta h2::before { background: var(--gold); }
.btn { transition: transform .15s ease, box-shadow .15s ease, background .15s ease, filter .15s ease; }
.btn--primary { box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn:hover { transform: translateY(-1px); }
.card { position: relative; }
.card:hover { border-color: color-mix(in srgb, var(--brass-strong) 55%, var(--line)); }
.stat b { background: var(--metal); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--brass); }
.sec--inv .stat b { background: var(--gold); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.step::before { background: var(--metal); color: #fff; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--brass-soft) 70%, transparent); }
.ledger { border-color: color-mix(in srgb, var(--brass-strong) 45%, var(--line)); box-shadow: var(--shadow-2), 0 0 0 4px color-mix(in srgb, var(--brass-strong) 8%, transparent); }
.ledger__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ledger__badge { font-size: .7rem; letter-spacing: .06em; padding: 3px 8px; border-radius: 99px; background: var(--brass-soft); color: var(--brass); font-weight: 700; }
button.ledger__row { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background .15s ease; }
button.ledger__row:hover { background: var(--brass-soft); }
button.ledger__row[aria-pressed="true"] { background: var(--brass-soft); box-shadow: inset 3px 0 0 var(--brass-strong); }
button.ledger__row--total { background: var(--brand-soft); }
.ledger__row b { font-variant-numeric: tabular-nums; }
.ledger__proof { padding: 14px 20px; min-height: 5.6em; font-size: .9rem; color: var(--text-2); background: var(--surface-2); }
.foot__contact { margin-top: 10px; color: #8fa3c2; }
.foot__docs { display: block; margin-top: 8px; }
.foot__docs a { color: #c9d6ea; text-decoration: underline; text-underline-offset: 3px; }
.form { margin-top: 28px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); color: var(--text); }
.sec--inv .form { background: var(--inv-surface); border-color: var(--inv-line); color: var(--inv-text); }
.form h3 { margin-bottom: 14px; }
.form__grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form__wide { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; font-weight: 600; }
.form input, .form select, .form textarea { font: inherit; font-weight: 400; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.form__check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; margin: 16px 0; font-weight: 400 !important; }
.form__check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.form__status { margin: 10px 0 0; font-size: .9rem; color: var(--brass); }
@media (max-width: 640px) { .form__grid { grid-template-columns: 1fr; } }
.legal { max-width: 78ch; }
.legal h2 { font-size: 1.35rem; margin: 2em 0 .6em; }
.legal ol, .legal ul { padding-left: 1.3em; } .legal li { margin: .35em 0; }
.legal .meta { color: var(--text-3); font-size: .92rem; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }
@media print { .js .reveal { opacity: 1 !important; transform: none !important; } .statusbar { display: none; } }


/* ===== v5: «Направления» — карточки групп и окно «Подробнее». Палитра и стиль прежние: только существующие переменные и компоненты ===== */
.gcard { display: flex; flex-direction: column; }
.gcard > p { color: var(--text-2); }
.gcard__dirs { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px; padding: 0; list-style: none; }
.gcard__dirs li { margin: 0; }
.gcard__dirs .tag, .gmodal__toc .tag { white-space: normal; }
.gcard__meta { margin: auto 0 0; }
.gcard .btn-row { margin-top: 16px; }
dialog.gmodal { width: min(1080px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); color: var(--text); box-shadow: var(--shadow-2); overflow: hidden; }
dialog.gmodal[open] { display: flex; flex-direction: column; }
dialog.gmodal::backdrop { background: rgba(6, 13, 27, .62); }
.gmodal__head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 14px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.gmodal__head .card__code { margin: 0; }
.gmodal__head h2 { margin: 0; font-size: clamp(1.25rem, 1.05rem + 1vw, 1.85rem); }
.gmodal__x { margin: 0 0 0 auto; }
.gmodal__x .btn { width: auto; }
.gmodal__body { overflow-y: auto; padding: 24px; overscroll-behavior: contain; }
.gmodal__body > h3 { margin: 36px 0 14px; }
.gmodal__toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 20px 0 0; }
.gmodal__toc a:hover { text-decoration: none; filter: brightness(1.05); }
.gmodal__foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.gmodal__foot .btn { width: auto; }
.gdir { margin-bottom: 14px; scroll-margin-top: 14px; }
.gdir:hover { transform: none; }
.gdir__top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.gdir__top .card__code { margin: 0; }
.gdir__label { margin: 14px 0 6px; font-size: .78rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); }
.gdir ul { margin-bottom: 0; }
.gdir li, .gdir p { font-size: .96rem; }
html.has-modal { overflow: hidden; }
html:not(.js) dialog.gmodal { display: block; position: static; width: auto; max-width: var(--wrap); max-height: none; margin: 32px auto; }
html:not(.js) .gmodal__x, html:not(.js) .gmodal__foot form { display: none; }
@media (max-width: 720px) {
  dialog.gmodal { width: 100vw; height: 100vh; height: 100dvh; max-height: 100vh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .gmodal__head { padding: 12px 16px; }
  .gmodal__body { padding: 16px; }
  .gmodal__foot { padding: 10px 16px; }
}
@media print { dialog.gmodal { display: block; position: static; max-height: none; box-shadow: none; } }
.gdir h4.gdir__name { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); margin: 6px 0 8px; }
.gmodal .callout .btn-row { margin-top: 16px; }
.gcard > .card__code { align-self: flex-start; }
dialog.gmodal:focus, dialog.gmodal:focus-visible { outline: none; }
.gmodal__head h2 { flex: 1 1 260px; }
.form label { min-width: 0; }
.form input:not([type="checkbox"]), .form select, .form textarea { width: 100%; max-width: 100%; min-width: 0; }
@media (max-width: 720px) {
  .road-scale__marks { flex-wrap: wrap; justify-content: flex-start; gap: 4px 14px; font-size: .74rem; }
  .road-scale__marks span { white-space: nowrap; }
  .road-scale__now::after { height: 12px; }
}
