/* Radar — рабочий интерфейс. Локальные стили и шрифт, без внешних ресурсов.
   Система: один акцент (бирюзовый), светлая и тёмная темы по настройке системы.
   Скругления: панели 14px, кнопки и поля 10px, метки и чипы — «таблетка». */

/* Onest (OFL, fonts/OFL.txt) — переменная насыщенность 100–900, кириллица и латиница. */
@font-face {
  font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fonts/onest-cyrillic-wght-normal.fe2bd26ae82a.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fonts/onest-latin-wght-normal.3db826ed1c5d.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;
}

:root {
  color-scheme: light dark;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;      /* вложенные области, шапка таблицы */
  --hover: #f2f5f7;
  --ink: #15191f;
  --muted: #5a6472;          /* 6.2:1 на белом */
  --line: #e3e7ec;
  --line-strong: #cdd3db;
  --field-line: #868f9c;     /* рамка полей: 3.2:1 на белом (WCAG 1.4.11) */
  --accent: #0d7068;         /* 5.9:1 на белом */
  --accent-hover: #0a5c55;
  --accent-ink: #ffffff;
  --accent-soft: #e5f3f1;
  --accent-soft-2: #d2ebe7;
  --focus-ring: rgba(13, 112, 104, .28);
  --topbar: rgba(255, 255, 255, .78);
  --shadow-1: 0 1px 2px rgba(21, 25, 31, .04), 0 1px 3px rgba(21, 25, 31, .05);
  --shadow-2: 0 10px 30px -12px rgba(21, 25, 31, .18), 0 2px 6px rgba(21, 25, 31, .05);
  --inverse-bg: #15191f; --inverse-ink: #f4f6f8; --inverse-link: #7fd8cd;

  --hot-bg: #fdebdf;   --hot-ink: #8a3007;
  --warm-bg: #fbf1d6;  --warm-ink: #6b4a00;
  --pot-bg: #e6eefa;   --pot-ink: #24497a;
  --non-bg: #eef0f3;   --non-ink: #4a5361;
  --test-bg: #f8e3ef;  --test-ink: #7d1650;
  --warn-bg: #fff6e0;  --warn-ink: #6b4500; --warn-line: #efd598;
  --ok-bg: #e3f4e9;    --ok-ink: #1d5b33;   --ok-line: #bfe2cb;
  --err-ink: #a1260d;
  --mark: #fff3b8;

  --radius-panel: 14px;
  --radius-ctl: 10px;
  --radius-s: 8px;
  --font: "Onest", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --fs: 15px;
  --fs-small: 13.5px;
  --fs-title: 15.5px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --topbar-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #151a21;
    --surface-2: #1a2029;
    --hover: #1b222b;
    --ink: #e7eaee;
    --muted: #9aa4b1;
    --line: #252c36;
    --line-strong: #343d49;
    --field-line: #636e7d;
    --accent: #3cc8b7;
    --accent-hover: #5fd6c7;
    --accent-ink: #062a26;
    --accent-soft: rgba(60, 200, 183, .13);
    --accent-soft-2: rgba(60, 200, 183, .22);
    --focus-ring: rgba(60, 200, 183, .35);
    --topbar: rgba(21, 26, 33, .78);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 14px 34px -12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
    --inverse-bg: #e7eaee; --inverse-ink: #10141a; --inverse-link: #0d7068;

    --hot-bg: rgba(249, 115, 22, .16);  --hot-ink: #fdba8c;
    --warm-bg: rgba(234, 179, 8, .15);  --warm-ink: #fbdc83;
    --pot-bg: rgba(96, 150, 240, .17);  --pot-ink: #bcd3fa;
    --non-bg: rgba(148, 163, 184, .14); --non-ink: #c6ced9;
    --test-bg: rgba(236, 72, 153, .16); --test-ink: #f7a8d2;
    --warn-bg: rgba(234, 179, 8, .1);   --warn-ink: #f4d07a; --warn-line: rgba(234, 179, 8, .3);
    --ok-bg: rgba(34, 197, 94, .13);    --ok-ink: #8ee5ac;   --ok-line: rgba(34, 197, 94, .3);
    --err-ink: #ff9b85;
    --mark: rgba(250, 204, 21, .22);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); }  /* якоря не под шапкой */
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs)/1.55 var(--font);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
h1, h2, h3 { letter-spacing: -.015em; }

/* ---------- Верхняя панель ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--topbar); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .topbar { background: var(--surface); } }
.topbar__inner { max-width: 1320px; margin: 0 auto; padding: 10px 24px; min-height: var(--topbar-h); display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand::before { content: ""; width: 18px; height: 18px; border-radius: 6px; background: var(--accent);
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5.5px var(--accent); }
.nav { display: flex; gap: 2px; align-items: center; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.nav a { padding: 5px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; transition: color .15s, background-color .15s; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.nav a.nav__minor { font-size: 14px; }
.mode { margin-left: auto; position: relative; }
.mode summary { list-style: none; cursor: pointer; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); background: var(--surface); transition: border-color .15s, color .15s; }
.mode summary:hover { color: var(--ink); border-color: var(--line-strong); }
.mode summary::-webkit-details-marker { display: none; }
.mode summary::after { content: " ▾"; color: var(--muted); }
.mode[open] summary::after { content: " ▴"; }
.mode__body { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(380px, 90vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 14px 16px; box-shadow: var(--shadow-2); font-size: var(--fs-small); }
.mode__body ul { margin: 0; padding-left: 18px; }
.mode__body li + li { margin-top: 5px; }
.logout { display: flex; align-items: center; gap: 6px; margin: 0; }
.logout > a { color: var(--muted); text-decoration: none; padding: 4px 8px; border-radius: var(--radius-s); }
.logout > a:hover { color: var(--ink); background: var(--hover); }

.page { max-width: 1320px; margin: 0 auto; padding: 24px 24px 56px; }
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { font-size: 26px; margin: 0; font-weight: 680; letter-spacing: -.025em; }

/* ---------- Кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 15px;
  border-radius: var(--radius-ctl); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-1); transition: background-color .15s, border-color .15s, color .15s, transform .12s var(--ease); }
.btn:hover { border-color: var(--muted); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(13, 112, 104, .25); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--quiet { border-color: transparent; background: transparent; color: var(--accent); padding-left: 8px; padding-right: 8px; box-shadow: none; }
.btn--quiet:hover { background: var(--accent-soft); border-color: transparent; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.ext::after { content: ""; display: inline-block; width: .8em; height: .8em; margin-left: 2px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9 2h5v5h-1.6V4.7L7.2 9.9 6.1 8.8l5.2-5.2H9V2zM3 4h4v1.6H4.6v6.8h6.8V10H13v4H3V4z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9 2h5v5h-1.6V4.7L7.2 9.9 6.1 8.8l5.2-5.2H9V2zM3 4h4v1.6H4.6v6.8h6.8V10H13v4H3V4z'/%3E%3C/svg%3E") center/contain no-repeat; }
label.field { display: grid; gap: 6px; font-size: var(--fs-small); color: var(--muted); font-weight: 500; }
input[type=search], input[type=text], input[type=password], input[type=number], select, textarea {
  font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--field-line);
  border-radius: var(--radius-ctl); min-height: 40px; padding: 8px 12px; width: 100%;
  transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus-ring); }
textarea { min-height: 72px; resize: vertical; }
input[type=checkbox]:focus { box-shadow: none; }
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Метки ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 550; line-height: 1.55; white-space: nowrap; border: 1px solid transparent; }
.tag--hot { background: var(--hot-bg); color: var(--hot-ink); }
.tag--warm { background: var(--warm-bg); color: var(--warm-ink); }
.tag--pot { background: var(--pot-bg); color: var(--pot-ink); }
.tag--non { background: var(--non-bg); color: var(--non-ink); }
.tag--none { background: transparent; color: var(--muted); border-color: var(--line-strong); }
.tag--test { background: var(--test-bg); color: var(--test-ink); font-weight: 650; }
.tag--warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag--flag { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.tag--ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag--unknown { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); }
.tag--closed { background: var(--non-bg); color: var(--non-ink); }

/* ---------- Фильтры ---------- */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 14px; box-shadow: var(--shadow-1); }
.filters__search { display: flex; gap: 10px; align-items: end; }
.filters__search .field { flex: 1; }
.filters__search input[type=search] { min-height: 44px; padding-left: 40px; font-size: 15px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a2' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 13px 50%/18px no-repeat; }
.filters__search input[type=search]:focus { background-color: var(--surface); }
.filters__search .btn { min-height: 44px; padding-left: 20px; padding-right: 20px; }
.filters__panel { margin-top: 12px; }
.filters__panel > summary { display: none; }
.filters__main { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 12px; align-items: end; }
.filters__more { margin-top: 12px; }
.filters__more summary { cursor: pointer; color: var(--accent); font-size: var(--fs-small); font-weight: 600; width: max-content; }
.filters__more-body { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.filters__more-body .field { min-width: 180px; }
.hint-disabled { font-size: var(--fs-small); color: var(--muted); }

.results-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 2px 12px; }
.results-bar__count { font-weight: 650; letter-spacing: -.01em; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: var(--fs-small); font-weight: 500; text-decoration: none; transition: background-color .15s; }
.chip:hover { background: var(--accent-soft-2); }
.chip span[aria-hidden] { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--accent); }
.results-bar .sort { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: var(--fs-small); color: var(--muted); }
.results-bar .sort select { width: auto; min-height: 34px; padding: 4px 10px; }

.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; margin-bottom: 12px; font-size: var(--fs-small); }
.notice--warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.notice--warn a, details.notice.notice--warn > summary::after { color: inherit; }

/* ---------- Лента ---------- */
.feed { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); overflow: hidden; box-shadow: var(--shadow-1); }
.feed table { width: 100%; border-collapse: collapse; }
.feed th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.feed td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.feed tr:last-child td { border-bottom: 0; }
.feed tbody tr { transition: background-color .15s; }
.feed tbody tr:hover { background: var(--hover); }
.feed tbody tr:target { background: var(--accent-soft); }
.col-req { width: 43%; }
.col-dir { width: 17%; }
.col-bud { width: 12%; }
.col-age { width: 17%; }
.col-act { width: 11%; }
.req__title { font-size: var(--fs-title); font-weight: 620; line-height: 1.4; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; letter-spacing: -.008em; }
.req__title:hover { color: var(--accent); }
.req__frag { margin: 5px 0 0; color: var(--muted); font-size: var(--fs-small); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 72ch; }
.req__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dirs { display: grid; gap: 8px; }
.dir { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.dir__name { font-weight: 600; font-size: 14px; }
.budget { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.budget--none { color: var(--muted); font-weight: 400; }
.cell-sub { display: block; font-size: var(--fs-small); color: var(--muted); margin-top: 3px; }
.age { white-space: nowrap; }
abbr[title] { text-decoration: underline dotted var(--line-strong); text-underline-offset: 3px; cursor: help; }
.act { display: grid; gap: 8px; justify-items: start; }

.empty { text-align: center; padding: 56px 20px; }
.empty h2 { font-size: 19px; margin: 0 0 8px; }
.empty p { margin: 0 auto 16px; max-width: 60ch; color: var(--muted); }

/* ---------- Карточка ---------- */
.back { display: inline-flex; margin-bottom: 12px; }
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 18px 20px; box-shadow: var(--shadow-1); }
.panel h2 { font-size: 15.5px; margin: 0 0 12px; font-weight: 650; }
.card-title { font-size: 24px; line-height: 1.28; margin: 0 0 10px; font-weight: 680; letter-spacing: -.025em; max-width: 42ch; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: var(--fs-small); }
.card-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.request { max-width: 70ch; font-size: 16px; line-height: 1.65; }
.request p { margin: 0 0 .85em; }
.request p:last-child { margin-bottom: 0; }
.cut { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: 12px; padding: 9px 12px; margin-bottom: 14px; font-size: var(--fs-small); }
.cut--soft { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.why { display: grid; gap: 14px; }
.why__item { border-left: 2px solid var(--accent-soft-2); padding-left: 14px; }
.why__item h3 { font-size: 15px; margin: 0 0 4px; }
.words { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.word { background: var(--mark); border-radius: 5px; padding: 0 6px; font-size: var(--fs-small); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: var(--fs-small); padding-top: 1px; }
.facts dd { margin: 0; overflow-wrap: break-word; }
.facts dd .tag { white-space: normal; max-width: 100%; }
.actions { display: grid; gap: 10px; }
.actions__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.reject { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 12px; display: grid; gap: 10px; margin-top: 2px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-ctl); }
.seg input { position: absolute; opacity: 0; }
.seg label { padding: 6px 13px; cursor: pointer; border-radius: 8px; font-size: var(--fs-small); font-weight: 550; color: var(--muted); transition: background-color .15s, color .15s; }
.seg label:hover { color: var(--ink); }
.seg input:checked + label { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.steps { display: grid; gap: 12px; }
.step[hidden] { display: none; }
.form-note { font-size: var(--fs-small); color: var(--muted); }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.history li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; font-size: var(--fs-small); }
.history time { color: var(--muted); font-variant-numeric: tabular-nums; }
.history li > .muted:only-child { grid-column: 1 / -1; }
.tech summary { cursor: pointer; font-weight: 600; }
.tech table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); margin-top: 12px; }
.tech th, .tech td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tech th { color: var(--muted); font-weight: 500; width: 32%; }
.blind-bar { background: var(--inverse-bg); color: var(--inverse-ink); border-radius: 12px; padding: 11px 16px; margin-bottom: 14px; font-size: var(--fs-small); }
.blind-bar a { color: var(--inverse-link); }
.blind-bar a:focus-visible { outline-color: var(--inverse-link); }
.mockup-note { font-size: var(--fs-small); color: var(--muted); margin-top: 8px; }
.current-label { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; display: grid; gap: 3px; }
.current-label form { margin: 0; }
.inline-details { margin-top: 4px; }
.inline-details summary { cursor: pointer; color: var(--accent); }
.card-main > .panel + .panel, .side > .panel + .panel { margin-top: 16px; }
/* Длинные пометки в шапке карточки (условия источника, удаление) переносятся, а не обрезаются. */
.card-flags .tag { white-space: normal; max-width: 100%; }

/* ---------- Тестовый журнал ---------- */
.journal { display: grid; gap: 12px; max-width: 880px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 16px 18px; box-shadow: var(--shadow-1); }
.entry__head { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 6px; }
.entry__title { font-size: var(--fs-title); font-weight: 620; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.entry__title:hover { color: var(--accent); }
.entry__meta { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 10px 0 0; font-size: var(--fs-small); }
.entry__meta dt { color: var(--muted); }
.entry__meta dd { margin: 0; }
.entry__foot { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Сообщения и служебные блоки ---------- */
.messages { display: grid; gap: 8px; margin-bottom: 14px; }
.msg { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: var(--fs-small); }
.msg--success { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.msg--warning { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.m-meta { display: none; flex-wrap: wrap; gap: 2px 10px; color: var(--muted); margin-top: 6px; }
.m-meta span:not(:last-child)::after { content: "·"; margin-left: 10px; color: var(--line-strong); }  /* точка остаётся в конце строки при переносе */
details.notice { display: block; }
details.notice > summary { cursor: pointer; list-style: none; }
details.notice > summary::-webkit-details-marker { display: none; }
details.notice > summary::after { content: " Подробнее"; color: var(--accent); font-weight: 600; }
details.notice[open] > summary::after { content: " Скрыть"; }
.notice__body p { margin: 8px 0 0; }
.notice--static { display: block; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.errorlist { list-style: none; margin: 2px 0 0; padding: 0; color: var(--err-ink); font-size: var(--fs-small); }
.inline-form { display: grid; gap: 6px; margin: 0; }
select.compact { min-height: 34px; padding: 4px 10px; font-size: var(--fs-small); }

/* ---------- Вход ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth .panel { width: min(400px, 100%); padding: 28px 28px 24px; box-shadow: var(--shadow-2); }
.auth h1 { display: flex; align-items: center; gap: 10px; font-size: 22px; margin: 0 0 18px; font-weight: 680; letter-spacing: -.02em; }
.auth h1::before { content: ""; flex: none; width: 22px; height: 22px; border-radius: 7px; background: var(--accent);
  box-shadow: inset 0 0 0 5px var(--surface), inset 0 0 0 7px var(--accent); }
.auth .btn--primary { width: 100%; min-height: 42px; margin-top: 4px; }

/* ---------- Появление (только если система не просит уменьшить анимацию) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes radar-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  .page > * { animation: radar-rise .45s var(--ease) both; }
  .page > :nth-child(2) { animation-delay: .04s; }
  .page > :nth-child(3) { animation-delay: .08s; }
  .page > :nth-child(n+4) { animation-delay: .12s; }
  .mode__body { animation: radar-rise .2s var(--ease) both; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* ---------- Адаптивность ---------- */
@media (max-width: 1100px) {
  .filters__main { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 860px) {
  /* Одна колонка: сначала содержание запроса и действия, служебное — в конце. */
  .card-grid { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
  .card-main, .side { display: contents; }
  .card-main > .panel + .panel, .side > .panel + .panel { margin-top: 0; }
  .o-head { order: 0; } .o-crit { order: 1; } .o-actions { order: 2; } .o-facts { order: 3; } .o-text { order: 4; }
  .o-why { order: 5; } .o-quality { order: 6; } .o-work { order: 7; } .o-hist { order: 8; } .o-tech { order: 9; }
}
@media (max-width: 760px) {
  :root { --topbar-h: 52px; }
  /* На телефоне шапка в несколько рядов: не закрепляем, чтобы не отнимать экран.
     relative + z-index — чтобы выпадающее окно режима было поверх содержимого страницы. */
  html { scroll-padding-top: 0; }
  .topbar { position: relative; z-index: 30; }
  .topbar__inner { padding: 8px 14px; gap: 10px; position: relative; }
  .nav { order: 3; width: 100%; }
  .nav a { flex: 1; text-align: center; }
  .mode { margin-left: 0; position: static; }
  .mode__body { left: 14px; right: 14px; width: auto; top: calc(100% - 4px); }
  .logout { margin-left: auto; }
  .page { padding: 16px 14px 44px; }
  .filters { padding: 12px; }
  .filters__panel > summary { display: block; cursor: pointer; color: var(--accent); font-weight: 600; font-size: var(--fs-small); padding: 4px 0; }
  .filters__panel[open] > summary { margin-bottom: 8px; }
  .filters__main { grid-template-columns: 1fr 1fr; gap: 10px; }
  .page-head { margin-bottom: 10px; }
  .page-head h1 { font-size: 21px; }
  .results-bar { margin: 12px 0 10px; gap: 6px 10px; }
  .results-bar .sort { margin-left: 0; width: 100%; }
  .notice { padding: 9px 12px; }
  .feed td.col-bud, .feed td.col-age { display: none; }
  .m-meta { display: flex; }
  .feed td.col-dir { padding-top: 0; }
  .dirs { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .feed td.col-act { padding-top: 0; }
  .req__meta { margin-top: 8px; }
  .feed { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .feed table, .feed tbody, .feed tr, .feed td { display: block; width: 100%; }
  .feed thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .feed tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); margin-bottom: 10px; padding: 6px 0; box-shadow: var(--shadow-1); }
  .feed td { border-bottom: 0; padding: 6px 16px; }
  .feed td.col-act { display: flex; gap: 8px; align-items: center; }
  .act { grid-auto-flow: column; align-items: center; }
  .history li { grid-template-columns: 1fr; gap: 2px; }
  .card-title { font-size: 20px; }
}
