@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/manrope-latin.woff2) format("woff2");
  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;
}

/* Цвета Yami Customs: чёрный, белый, неоновый салатовый #ADFF00, бирюзовый #01CDC1 */
:root {
  --lime: #adff00;
  --lime-ink: #111;
  --teal: #01cdc1;
  --bg: #f4f4f1;
  --card: #ffffff;
  --card-2: #f8f8f6;
  --text: #121212;
  --muted: #6c6c66;
  --line: #e4e4de;
  --line-2: #d4d4cc;
  --link: #00756e;
  --head: #0b0b0b;
  --head-text: #f2f2f2;
  --ok: #1e7c45;    --ok-bg: #e7f5ec;
  --warn: #9a5b00;  --warn-bg: #fdf2dc;
  --fail: #b42318;  --fail-bg: #fdeceb;
  --na: #8a8a84;    --na-bg: #efefeb;
  --focus: #00a99f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e0d; --card: #161816; --card-2: #1c1e1b; --text: #ececE8; --muted: #9a9a93;
    --line: #2a2d29; --line-2: #3a3e38; --link: #3fe0d5; --head: #000; --head-text: #f2f2f2;
    --ok: #6fd69a; --ok-bg: #163222; --warn: #f0b552; --warn-bg: #33270f; --fail: #ff8a7f; --fail-bg: #3a1916;
    --na: #8a8a84; --na-bg: #242622; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e0d; --card: #161816; --card-2: #1c1e1b; --text: #ececE8; --muted: #9a9a93;
  --line: #2a2d29; --line-2: #3a3e38; --link: #3fe0d5; --head: #000; --head-text: #f2f2f2;
  --ok: #6fd69a; --ok-bg: #163222; --warn: #f0b552; --warn-bg: #33270f; --fail: #ff8a7f; --fail-bg: #3a1916;
  --na: #8a8a84; --na-bg: #242622; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 19px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* Поверхности браузера тоже в системе (Impeccable craft floor) */
::selection { background: var(--lime); color: #000; }
html { scrollbar-color: var(--line-2) transparent; scrollbar-width: thin; accent-color: #6fa300; }
:root[data-theme="dark"] { accent-color: var(--lime); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { accent-color: var(--lime); } }
input, textarea { caret-color: var(--link); }
table, .id, .timer, .facts-line dd, .chip b { font-variant-numeric: tabular-nums; }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ic { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--fail); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.card > h3:first-child, .side .card h3 { margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.task { margin: 0 0 10px; max-width: 75ch; }
.nowrap { flex-wrap: nowrap; }
.brief-title { font-size: 22px; margin: 0; max-width: 46ch; text-wrap: balance; }
.brief-tools { margin-top: 10px; gap: 4px; }
.icon-only { padding: 6px; }
.empty-hint { color: var(--muted); font-size: 14px; cursor: default; }
.guidance { font-size: 14px; max-width: 80ch; }
.guidance h2 { font-size: 16px; margin: 0 0 6px; }
.guidance h3 { font-size: 14px; margin: 12px 0 4px; }
.guidance ul { margin: 4px 0; padding-left: 20px; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--card-2), var(--line), var(--card-2)); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; margin: 10px 0; }
.skeleton.w40 { width: 40%; } .skeleton.w60 { width: 60%; height: 22px; } .skeleton.w90 { width: 90%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* Кнопки */
button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--text); padding: 8px 14px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
button:hover, .button:hover { border-color: var(--text); }
button:active { transform: translateY(1px); }
button.primary, .button.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
button.primary:hover { filter: brightness(.95); border-color: var(--lime); }
button.big { padding: 12px 20px; font-size: 16px; border-radius: 12px; }
button.dark, .button.dark { background: var(--text); color: var(--card); border-color: var(--text); }
button.ghost, .button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover, .button.ghost:hover { background: var(--card-2); border-color: var(--line); }
button.danger { color: var(--fail); }
button.sm, .button.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: default; transform: none; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 8px 11px; max-width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; }
textarea.prose { font-family: inherit; font-size: 14px; line-height: 1.55; }
label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
label.check input { margin-top: 3px; }

/* Вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--head); }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; background: var(--card); border-radius: 18px; padding: 28px; }
.login-card h1 { font-size: 24px; margin: 0; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--lime); color: #000; font-weight: 800; font-size: 18px; flex: none; }

/* Шапка */
.top { position: sticky; top: 0; z-index: 10; background: var(--head); color: var(--head-text); }
.top-inner { max-width: 1440px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; white-space: nowrap; }
.brand .sub { color: #8d8d86; font-weight: 600; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: transparent; border: none; color: #b9b9b2; padding: 8px 12px; border-radius: 8px; position: relative; }
.tabs button:hover { color: #fff; background: #1d1d1b; }
.tabs button.active { color: #fff; }
.tabs button.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 1px; height: 2px; background: var(--lime); border-radius: 2px; }
.tabs .count { font-size: 11px; background: #2a2a27; color: #ddd; border-radius: 99px; padding: 1px 7px; margin-left: 4px; }
.tabs .count.attn { background: var(--lime); color: #000; }
.top .ghost { color: #b9b9b2; }
.top .ghost:hover { background: #1d1d1b; border-color: transparent; color: #fff; }

main { padding: 20px 16px 60px; max-width: 1440px; margin: 0 auto; }

/* Статьи: список ТЗ и рабочая область */
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidebar { position: sticky; top: 76px; padding: 14px; }
.brief-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.brief-list li { padding: 10px 12px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; display: grid; gap: 4px; }
.brief-list li:hover { background: var(--card-2); }
.brief-list li.active { background: var(--card-2); border-color: var(--text); }
.brief-list .num { font-size: 12px; font-weight: 800; color: var(--muted); }
.brief-list .title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.brief-list .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.brief-select { display: none; width: 100%; }
.content { display: grid; gap: 16px; min-width: 0; }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 10px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.chip b { font-weight: 800; }
/* длинный список ссылок или адрес не вылезает за экран: чип переносится */
.chip { max-width: 100%; }
.chip.long { white-space: normal; overflow-wrap: anywhere; display: inline-block; line-height: 1.4; border-radius: 14px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--na-bg); color: var(--na); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok, .badge.done, .badge.approved { background: var(--ok-bg); color: var(--ok); }
.badge.warn, .badge.queued, .badge.unverified { background: var(--warn-bg); color: var(--warn); }
.badge.running { background: var(--lime); color: #000; }
.badge.fail, .badge.failed, .badge.conflict { background: var(--fail-bg); color: var(--fail); }

details.plain > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 6px; }
details.plain > summary::-webkit-details-marker { display: none; }
details.plain { margin-top: 12px; }
details.plain > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(-45deg); transition: transform .18s ease-out; margin: 0 4px 0 2px; }
details.plain[open] > summary::before { transform: rotate(45deg); }
.brief-details { display: grid; gap: 14px; margin-top: 12px; }
.editorial { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.outline { margin: 0; padding: 0; list-style: none; font-size: 14px; columns: 2 320px; column-gap: 28px; }
.outline li { break-inside: avoid; }
.outline .h2 { font-weight: 700; margin-top: 8px; }
.outline .h3 { padding-left: 16px; color: var(--muted); }

.brief-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.icon-btn { padding: 6px 8px; }

/* Переключатель генераций */
.gen-switch { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.gen-pill { border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 12px; background: var(--card); cursor: pointer; display: grid; gap: 2px; text-align: left; font-weight: 500; white-space: nowrap; }
.gen-pill.active { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.gen-pill .t { font-weight: 800; font-size: 13px; }
.gen-pill .s { font-size: 12px; color: var(--muted); }

/* Прогресс генерации */
.stepper { list-style: none; margin: 14px 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.stepper li { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.stepper .bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; position: relative; }
.stepper li.done .bar { background: var(--text); }
.stepper li.done { color: var(--text); }
.stepper li.active { color: var(--text); font-weight: 700; }
.stepper li.active .bar { background: var(--line); }
.stepper li.active .bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--lime); border-radius: 99px; animation: slide 1.2s ease-in-out infinite; }
.stepper li.skipped { opacity: .45; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .stepper li.active .bar::after { animation: none; width: 100%; } }
.now { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.now .msg { font-weight: 600; }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); }

.log { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 320px; overflow: auto; margin-top: 10px; }
.log div { padding: 2px 0; }
.log .warn { color: var(--warn); }
.log .error { color: var(--fail); }
.log time { color: var(--muted); margin-right: 8px; }

/* Итог генерации */
.verdict { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.warn { background: var(--warn-bg); color: var(--warn); }
.verdict.fail { background: var(--fail-bg); color: var(--fail); }
.verdict .big { font-size: 18px; font-weight: 800; }
.verdict .icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: currentColor; flex: none; }
.verdict .icon svg { width: 18px; height: 18px; color: var(--card); }
.verdict .txt { flex: 1; min-width: 200px; color: var(--text); }
.verdict .txt .big { color: inherit; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.result { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.side { display: grid; gap: 16px; position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
.side .card { padding: 16px; }
.seo-row { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.seo-row:last-of-type { border-bottom: none; }
.seo-val { font-size: 14px; overflow-wrap: anywhere; }
.facts-line { margin: 0; display: grid; gap: 6px; font-size: 14px; }
.facts-line div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.facts-line div:last-child { border-bottom: none; padding-bottom: 0; }
.facts-line dt { color: var(--muted); }
.facts-line dd { margin: 0; font-weight: 700; text-align: right; }

.reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.reqs li { border-radius: 9px; }
.reqs details > summary { list-style: none; display: grid; grid-template-columns: 20px 1fr; gap: 8px; padding: 6px 6px; cursor: pointer; border-radius: 9px; font-size: 13.5px; line-height: 1.4; }
.reqs details > summary::-webkit-details-marker { display: none; }
.reqs details > summary:hover { background: var(--card-2); }
.reqs .mark, .issues .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; flex: none; }
.reqs .ok .mark { background: var(--ok-bg); color: var(--ok); }
.reqs .warn .mark { background: var(--warn-bg); color: var(--warn); }
.reqs .fail .mark { background: var(--fail-bg); color: var(--fail); }
.reqs .na .mark { background: var(--na-bg); color: var(--na); }
.reqs .na summary { color: var(--muted); }
.reqs .det { margin: 0 6px 8px 34px; font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.req-group { font-size: 14px; font-weight: 700; margin: 14px 0 4px 6px; }

.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.todo li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; }
.todo .n { width: 22px; height: 22px; border-radius: 50%; background: var(--warn-bg); color: var(--warn); display: grid; place-items: center; font-weight: 800; font-size: 12px; font-variant-numeric: tabular-nums; }
.todo .n.ok { background: var(--ok-bg); color: var(--ok); }

.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.subtabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 9px 12px; color: var(--muted); }
.subtabs button:hover { color: var(--text); border-color: transparent; border-bottom-color: var(--line-2); }
.subtabs button.active { border-bottom-color: var(--text); color: var(--text); }

.article { max-width: 760px; font-size: 16px; line-height: 1.65; }
.article h1 { font-size: 30px; font-weight: 800; margin-bottom: .6em; }
.article h2 { font-size: 23px; font-weight: 800; margin-top: 1.6em; }
.article h3 { font-size: 18px; font-weight: 700; margin-top: 1.3em; }
.article p { margin: .6em 0; }
.article table { border-collapse: collapse; width: 100%; font-size: 14px; display: block; overflow-x: auto; margin: 1em 0; }
.article th, .article td { border: 1px solid var(--line-2); padding: 8px 10px; vertical-align: top; text-align: left; min-width: 110px; }
.article th { background: var(--card-2); font-weight: 700; }
.article a.placeholder { background: var(--warn-bg); color: var(--warn); border-radius: 4px; padding: 0 3px; text-decoration: none; border-bottom: 1px dashed currentColor; }
pre.md { white-space: pre-wrap; word-break: break-word; background: var(--card-2); border: 1px solid var(--line); padding: 14px; border-radius: 10px; font-size: 13px; max-height: 75vh; overflow: auto; margin: 0; }

.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.issues li { padding: 10px 12px; border-radius: 10px; font-size: 14px; background: var(--card-2); display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; }
.issues li.error .mark { background: var(--fail-bg); color: var(--fail); }
.issues li.warn .mark { background: var(--warn-bg); color: var(--warn); }
.issues .ctx { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }

/* Таблицы данных */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
table.grid tr:last-child td { border-bottom: none; }
table.grid th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--card-2); position: sticky; top: 0; }
table.grid td.claim { min-width: 280px; overflow-wrap: anywhere; }
table.grid td.claim * { overflow-wrap: anywhere; }
table.grid td.src { max-width: 240px; overflow-wrap: anywhere; font-size: 12.5px; }
table.grid td.act { white-space: nowrap; text-align: right; }
table.grid td.id { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: none; border-radius: 0; background: transparent; padding: 7px 12px; font-weight: 600; color: var(--muted); }
.seg button.active { background: var(--text); color: var(--card); }
.seg button .c { font-size: 11px; opacity: .75; margin-left: 4px; }
.hint { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--muted); }
.hint b { color: var(--text); }

.settings { display: grid; gap: 16px; max-width: 920px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

dialog { border: none; border-radius: 18px; padding: 0; background: var(--card); color: var(--text); width: min(780px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.dialog { display: grid; gap: 14px; padding: 22px; max-height: calc(100vh - 40px); overflow: auto; }
.dialog .actions { justify-content: flex-end; }
.dialog-error { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); }
.dropzone.over { border-color: var(--teal); background: var(--card-2); }

.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--card); padding: 11px 18px; border-radius: 12px; z-index: 50; max-width: calc(100vw - 32px); font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.25); }

/* Адаптив */
@media (max-width: 1180px) {
  .result { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; order: -1; }
}
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .brief-list { display: none; }
  .brief-select { display: block; }
}
@media (max-width: 640px) {
  main { padding: 12px 12px 48px; }
  .top-inner { flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px; }
  .brand .sub { display: none; }
  .tabs { order: 3; flex-basis: 100%; gap: 0; flex-wrap: wrap; justify-content: space-between; }
  .tabs button { padding: 8px 7px; font-size: 14px; }
  .tabs button.active::after { left: 7px; right: 7px; }
  .card { padding: 14px; }
  .stepper { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .brief-head { flex-direction: column; }
  .brief-head .row { width: 100%; flex-wrap: wrap; }
  .brief-head .row button { flex: 1 1 100%; justify-content: center; }
  .brief-head .row .primary { order: -1; }
  .brief-title { font-size: 19px; }
  .article { font-size: 15px; }
  .article h1 { font-size: 24px; }
  .article h2 { font-size: 20px; }
  .actions button, .actions .button { flex: 1 1 auto; justify-content: center; }
  /* Таблицы данных на телефоне: каждая строка — карточка с подписями */
  .table-wrap { border: none; overflow: visible; }
  table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
  table.grid tr:first-child:has(th) { display: none; }
  table.grid tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--card); }
  table.grid td { border: none; padding: 3px 0; max-width: none; }
  table.grid td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
  table.grid td.claim { min-width: 0; font-size: 15px; }
  table.grid td.act { text-align: left; padding-top: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
