/* ЭИОС. Вся статика локальная: без внешних шрифтов, CDN и счётчиков. */
:root {
  --bg: #f3f6f7;
  --surface: #ffffff;
  --ink: #17262d;
  --muted: #56666e;
  --line: #dbe3e6;
  --brand: #0d5c63;
  --brand-ink: #ffffff;
  --brand-soft: #e3f0f1;
  --ok: #1d6b3a;
  --ok-soft: #e4f3e9;
  --warn: #8a5300;
  --warn-soft: #fdf1dc;
  --bad: #a3271f;
  --bad-soft: #fbe9e7;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
}
html.a11y {
  --bg: #ffffff; --surface: #ffffff; --ink: #000000; --muted: #000000; --line: #000000;
  --brand: #000000; --brand-soft: #ffffff; --ok: #000000; --ok-soft: #ffffff;
  --warn: #000000; --warn-soft: #ffffff; --bad: #000000; --bad-soft: #ffffff;
  font-size: 21px; letter-spacing: .02em;
}
html.a11y a { text-decoration: underline; }
html.a11y .card, html.a11y table, html.a11y .badge { border: 2px solid #000; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #f0a500; outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 1.2rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1rem; margin: 1.2em 0 .4em; }
p { margin: 0 0 .9em; max-width: 72ch; }
.lead { font-size: 1.08rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* Шапка */
.top { background: var(--brand); color: var(--brand-ink); }
html.a11y .top { border-bottom: 3px solid #000; background: #fff; color: #000; }
.top__in { max-width: 1180px; margin: 0 auto; padding: .7rem 16px; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: baseline; gap: .7rem; min-width: 0; }
.brand__mark { font-weight: 700; font-size: 1.25rem; letter-spacing: .04em; }
.brand__org { opacity: .85; font-size: .9rem; }
.top__tools { display: flex; align-items: center; gap: 1rem; font-size: .9rem; flex-wrap: wrap; }
.top__tools a { color: inherit; }
.top__tools form { margin: 0; }
.who { opacity: .9; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* Каркас */
.shell { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }
.shell--nav { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.side a { display: block; padding: .5rem .75rem; border-radius: 8px; color: var(--ink); text-decoration: none; }
.side a:hover { background: var(--brand-soft); }
.side a[aria-current="page"] { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
html.a11y .side a[aria-current="page"] { background: #000; color: #fff; }
.side__label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .9rem .75rem .3rem; }
@media (max-width: 820px) {
  .shell--nav { display: block; }
  .side { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
  .side a { white-space: nowrap; }
  .side__label { display: none; }
}
main { min-width: 0; }
footer.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
footer.foot div { max-width: 1180px; margin: 0 auto; padding: 16px; }

/* Карточки и сетки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); display: block; }
a.tile:hover { border-color: var(--brand); }
.tile b { display: block; font-size: 1.02rem; margin-bottom: .2rem; color: var(--brand); }
.tile span { color: var(--muted); font-size: .9rem; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 14px; }
.head h1 { margin: 0; }

/* Таблицы */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f8fafb; }
html.a11y thead th { background: #fff; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Определения */
dl.facts { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: .4rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
@media (max-width: 560px) { dl.facts { grid-template-columns: 1fr; } dl.facts dd { margin-bottom: .5rem; } }

/* Кнопки и метки */
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); border-radius: 8px; padding: .55rem 1rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.1); }
.btn--ghost { background: transparent; color: var(--brand); }
.btn--danger { background: var(--bad); border-color: var(--bad); }
.btn--small { padding: .3rem .7rem; font-size: .9rem; }
.top .btn { background: #fff; color: var(--brand); border-color: #fff; }
html.a11y .btn { background: #000; color: #fff; border-color: #000; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--plain { background: #eef1f3; color: var(--muted); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #e08a00; margin-right: .4rem; }

/* Формы */
form.stack > div { margin-bottom: 1rem; }
form.stack label { display: block; font-weight: 600; margin-bottom: .25rem; }
form.stack input[type=text], form.stack input[type=email], form.stack input[type=password], form.stack input[type=date],
form.stack input[type=number], form.stack input[type=url], form.stack select, form.stack textarea {
  width: 100%; max-width: 560px; padding: .55rem .7rem; border: 1px solid #b9c5ca; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
form.stack textarea { max-width: 720px; }
form.stack input[type=checkbox] { width: 1.1rem; height: 1.1rem; margin-right: .5rem; vertical-align: -2px; }
form.stack .helptext, form.stack .helptext ul { color: var(--muted); font-size: .875rem; margin: .25rem 0 0; }
form.stack .helptext ul { padding-left: 1.1rem; }
.errorlist { list-style: none; padding: 0; margin: .25rem 0; color: var(--bad); font-weight: 600; font-size: .9rem; }
.narrow { max-width: 520px; margin: 24px auto; }

/* Сообщения системы */
.flash { list-style: none; padding: 0; margin: 0 0 16px; }
.flash li { padding: .7rem 1rem; border-radius: 8px; background: var(--ok-soft); color: var(--ok); border: 1px solid currentColor; margin-bottom: 8px; }
.flash li.error { background: var(--bad-soft); color: var(--bad); }
.note { padding: .8rem 1rem; border-radius: 8px; background: var(--warn-soft); color: var(--warn); border: 1px solid currentColor; margin-bottom: 16px; }
.empty { color: var(--muted); padding: 1rem 0; }

/* Переписка */
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; max-width: 760px; }
.msg--mine { margin-left: auto; background: var(--brand-soft); border-color: #c5dfe1; }
.msg__meta { font-size: .82rem; color: var(--muted); margin-bottom: .3rem; }
.msg__body { white-space: pre-wrap; overflow-wrap: anywhere; }
.consent-text { white-space: pre-wrap; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: #fbfcfc; margin-bottom: 16px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.qr { margin: 1rem 0; }
.qr svg { display: block; max-width: 220px; height: auto; background: #fff; border-radius: 8px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
