/*
 * Единый слой оформления портала (этап 2 замечаний заказчика).
 *
 * Подключается последним из глобальных стилей в layouts/app.blade.php и задаёт
 * общий вид для всех разделов: шрифт Inter, одна шкала скруглений, кнопки,
 * поля, выпадающие списки, календари, заголовки таблиц.
 *
 * Принцип: правила для «голых» тегов идут через :where() (нулевая специфичность),
 * чтобы модули со своими классами (.gf__btn, .np__input, .rb-input, .re__btn…)
 * оставались как есть; правила для устаревших классов (.btn, .form-control,
 * .form-control) перебивают style.min.css за счёт порядка подключения.
 */
:root {
    --p-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --p-ink: #101828;
    --p-ink-2: #4a5568;
    --p-ink-3: #6b7690;
    --p-line: #e1e6ee;
    --p-line-2: #c9d3e0;
    --p-surface: #ffffff;
    --p-surface-2: #f5f7fa;

    --p-primary: #2563eb;
    --p-primary-hover: #1d4ed8;
    --p-primary-active: #1e40af;
    --p-primary-soft: #eaf1fd;
    --p-success: #16a34a;
    --p-success-hover: #15803d;
    --p-danger: #dc2626;
    --p-danger-hover: #b91c1c;
    --p-warning: #d97706;
    --p-neutral: #e5eaf3;
    --p-neutral-hover: #d6deeb;

    --p-r-sm: 6px;
    --p-r: 8px;
    --p-r-lg: 12px;
    --p-r-xl: 16px;
    --p-r-pill: 999px;

    --p-focus: 0 0 0 3px rgba(37, 99, 235, .14);
    --p-shadow: 0 12px 28px -16px rgba(16, 24, 40, .28);
    --p-d: 150ms;
}

/* ---------- Шрифт ---------- */
html, body { font-family: var(--p-font); }
body { min-width: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
:where(button, input, select, textarea, optgroup) { font-family: inherit; }
/* Лишняя жирность: заголовки контента не тяжелее 700. */
:where(main) :where(h1, h2, h3, h4, h5, h6) { font-family: var(--p-font); font-weight: 700; letter-spacing: -.01em; }
:where(main) :where(h1) { font-size: clamp(24px, 1.2rem + 1.2vw, 32px); }

/* ---------- Кнопки ---------- */
/*
 * Inter — единственный шрифт интерфейса. style.min.css задаёт body Montserrat, отдельным
 * блокам Roboto Flex, а кнопки и поля по умолчанию берут системный шрифт — всё сводим к одному.
 * Моноширинным остаётся только код (code, pre, kbd, samp).
 */
body, button, input, select, optgroup, textarea,
.chat-button, .stack__technology-count {
    font-family: var(--p-font);
}
/* Редактор текста (CKEditor): панель и содержимое — тем же шрифтом. */
body { --ck-font-face: var(--p-font); }

/* Базовое правило style.min.css (.btn,button: 20px, min-width 238px, hover почти чёрный) заменяется этим. */
button, .btn, input[type="submit"], input[type="button"], input[type="reset"] {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--p-r);
    background-color: var(--p-primary);
    color: #fff;
    font-family: var(--p-font);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--p-d) ease, border-color var(--p-d) ease, color var(--p-d) ease, box-shadow var(--p-d) ease;
}
button:hover, .btn:hover, input[type="submit"]:hover, input[type="button"]:hover { background-color: var(--p-primary-hover); color: #fff; }
button:active, .btn:active { background-color: var(--p-primary-active); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--p-focus); }
button:disabled, .btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }

/* Варианты в духе Bootstrap: классы используются по всему порталу, а сам Bootstrap не подключён. */
.btn-primary { background-color: var(--p-primary); color: #fff; }
.btn-primary:hover { background-color: var(--p-primary-hover); }
.btn-secondary, .btn-light, .btn-default { background-color: var(--p-neutral); color: var(--p-ink); }
.btn-secondary:hover, .btn-light:hover, .btn-default:hover { background-color: var(--p-neutral-hover); color: var(--p-ink); }
.btn-success { background-color: var(--p-success); }
.btn-success:hover { background-color: var(--p-success-hover); }
.btn-danger { background-color: var(--p-danger); }
.btn-danger:hover { background-color: var(--p-danger-hover); }
.btn-warning { background-color: var(--p-warning); color: #fff; }
.btn-warning:hover { background-color: #b45309; }
.btn-info { background-color: #0891b2; }
.btn-info:hover { background-color: #0e7490; }
.btn-dark { background-color: #334155; }
.btn-dark:hover { background-color: #1e293b; }
.btn-outline-primary, .btn-outline-secondary, .btn-outline-danger, .btn-outline-success, .btn-outline-dark {
    background-color: transparent;
    border-color: currentColor;
}
.btn-outline-primary { color: var(--p-primary); }
.btn-outline-primary:hover { background-color: var(--p-primary-soft); color: var(--p-primary-hover); }
.btn-outline-secondary { color: var(--p-ink-2); border-color: var(--p-line-2); }
.btn-outline-secondary:hover { background-color: var(--p-surface-2); color: var(--p-ink); }
.btn-outline-danger { color: var(--p-danger); }
.btn-outline-danger:hover { background-color: #fee2e2; color: var(--p-danger-hover); }
.btn-outline-success { color: var(--p-success); }
.btn-outline-success:hover { background-color: #dcfce7; color: var(--p-success-hover); }
.btn-outline-dark { color: var(--p-ink); border-color: var(--p-line-2); }

/* Пагинация (layouts/pagination/softdeco): размер и цвета — как у остальных элементов управления. */
.pagination {
    margin: 24px 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    list-style: none;
}
.pagination .pagination__item {
    box-sizing: border-box;
    width: auto;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--p-ink-2);
    background: var(--p-surface);
    border: 1px solid var(--p-line);
    border-radius: var(--p-r);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    transition: background-color var(--p-d) ease, border-color var(--p-d) ease, color var(--p-d) ease;
}
.pagination a.pagination__item[href]:hover { color: var(--p-ink); background: var(--p-surface-2); border-color: var(--p-line-2); }
.pagination .pagination__item_active, .pagination .pagination__item_active:hover { color: #fff; background: var(--p-primary); border-color: var(--p-primary); }
.pagination span.pagination__item { border-color: transparent; background: transparent; color: var(--p-ink-3); }

/* Неактивная плашка-статус в ряду кнопок («На проверке», «Редактирование разрешено») — того же размера, что кнопка. */
.btn-note {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid var(--p-line-2);
    border-radius: var(--p-r);
    background: var(--p-surface-2);
    color: var(--p-ink-2);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}
.btn-note--warning { background: #fff7e6; border-color: #fcd9a0; color: #92400e; }
.btn-note--success { background: #ecfdf3; border-color: #b7e4c7; color: #166534; }

/*
 * style.min.css задаёт кнопкам внутри .buttons-wrapper свой размер (11px, отступы 9×20)
 * и «гасит» их при наведении — из-за этого кнопки в одном ряду выходили разного размера.
 */
.buttons-wrapper .btn, .buttons-wrapper button {
    min-height: 40px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}
.buttons-wrapper .btn:hover, .buttons-wrapper button:hover { opacity: 1; }
.buttons-wrapper { align-items: center; }
.buttons-wrapper .btn-sm { min-height: 32px; padding: 5px 12px; font-size: 13px; }

/*
 * Старый вторичный вариант .btn_white (88 мест по порталу) — белая кнопка с рамкой.
 * Без этого правила базовый синий фон выше перекрывал белый из style.min.css, а серый
 * текст от «.buttons-wrapper .btn_white» оставался: получалось серое на синем.
 */
.btn.btn_white, .buttons-wrapper .btn.btn_white, button.btn_white {
    background-color: var(--p-surface);
    color: var(--p-ink-2);
    border-color: var(--p-line-2);
}
.btn.btn_white:hover, .buttons-wrapper .btn.btn_white:hover, button.btn_white:hover {
    background-color: var(--p-surface-2);
    color: var(--p-ink);
    opacity: 1;
}
.btn-outline-dark:hover { background-color: var(--p-surface-2); color: var(--p-ink); }
.btn-link { background: transparent; color: var(--p-primary); padding-left: 4px; padding-right: 4px; }
.btn-link:hover { background: transparent; color: var(--p-primary-hover); text-decoration: underline; }
.btn-sm, .btn-group-sm > .btn { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: var(--p-r-sm); }
.btn-lg { min-height: 46px; padding: 11px 22px; font-size: 15px; border-radius: var(--p-r-lg); }
.btn-block { display: flex; width: 100%; }

/* Служебные кнопки: закрытие модалок и иконки без фона. */
:where(button).close, :where(button)[aria-label="Close"], :where(button).btn-close {
    min-height: 0;
    padding: 4px;
    background: transparent;
    color: var(--p-ink-3);
    border-radius: var(--p-r-sm);
}
:where(button).close:hover, :where(button).btn-close:hover { background: var(--p-surface-2); color: var(--p-ink); }

/* ---------- Поля ввода ----------
   .form__field в старой вёрстке — обёртка вокруг поля (div), а не само поле; .search-input тоже бывает обёрткой — оба здесь не упоминаются. */
:where(input:not([type]), input[type="text"], input[type="email"], input[type="number"], input[type="password"],
       input[type="search"], input[type="tel"], input[type="url"], input[type="date"], input[type="datetime-local"],
       input[type="time"], input[type="month"], select, textarea),
.form-control, .form-input, .form-select {
    box-sizing: border-box;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--p-line-2);
    border-radius: var(--p-r);
    background-color: var(--p-surface);
    color: var(--p-ink);
    font-family: var(--p-font);
    font-size: 14px;
    line-height: 1.4;
    box-shadow: none;
    transition: border-color var(--p-d) ease, box-shadow var(--p-d) ease;
}
:where(textarea), textarea.form-control { min-height: 96px; resize: vertical; }
/* Если у textarea задано rows — высоту определяет оно (комментарии в строках таблиц и чек-листах). */
textarea.form-control[rows], textarea.table-input[rows] { min-height: 0; }
/*
 * Старые формы (.form): style.min.css и mobile.css дают их полям отступы 14.5×21 / 12×15 и высоту 48px,
 * а остальные формы портала — 40px. Приводим к одному размеру.
 */
body .form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="range"]),
body .form textarea,
body .form select {
    padding: 8px 12px;
    font-weight: 400;
}
body .form select:not([multiple]):not([size]) { padding-right: 36px; }
:where(select), select.form-control, .form-select {
    padding-right: 36px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7690' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
:where(select[multiple], select[size]) { padding-right: 12px; background-image: none; }
:where(input, select, textarea):focus, .form-control:focus, .form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--p-primary);
    box-shadow: var(--p-focus);
}
:where(input, select, textarea)::placeholder { color: var(--p-ink-3); }
:where(input, select, textarea):disabled, .form-control:disabled, .form-control[readonly] { background-color: var(--p-surface-2); color: var(--p-ink-3); cursor: not-allowed; }
/* Поля внутри таблиц — компактнее. */
.table-input { min-height: 34px; padding: 5px 10px; font-size: 13px; border-radius: var(--p-r-sm); }
:where(input[type="checkbox"], input[type="radio"]) { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--p-primary); vertical-align: -2px; }
/* softdeco.css красит текст любого незаполненного обязательного поля в красный ещё до ввода — возвращаем обычный цвет. */
body input:invalid { color: var(--p-ink); }
:where(input[type="file"]) { padding: 7px 12px; }
:where(input[type="file"])::file-selector-button {
    margin: -7px 12px -7px -12px;
    padding: 8px 14px;
    border: 0;
    border-right: 1px solid var(--p-line-2);
    border-radius: var(--p-r) 0 0 var(--p-r);
    background: var(--p-surface-2);
    color: var(--p-ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
:where(label) { font-weight: 500; color: var(--p-ink-2); }

/* ---------- Выпадающие списки Select2 (тема по умолчанию) ---------- */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 40px;
    border: 1px solid var(--p-line-2);
    border-radius: var(--p-r);
    font-family: var(--p-font);
}
.select2-container--default .select2-selection--single { height: 40px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; padding-left: 12px; color: var(--p-ink); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; right: 6px; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple { border-color: var(--p-primary); box-shadow: var(--p-focus); }
.select2-container--default .select2-dropdown { border: 1px solid var(--p-line-2); border-radius: var(--p-r); box-shadow: var(--p-shadow); overflow: hidden; font-family: var(--p-font); }
.select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid var(--p-line-2); border-radius: var(--p-r-sm); padding: 6px 10px; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--p-primary-soft); color: var(--p-ink); }
.select2-container--default .select2-selection--multiple .select2-selection__choice { border-radius: var(--p-r-sm); border-color: var(--p-line-2); background: var(--p-surface-2); }

/* Поиск со значком-лупой слева (.filter__search, списки экспертизы): место под значок,
   значок по центру поля 40px. !important — правило «body .form input» выше сильнее по специфичности. */
body .form .filter__search:not(.filter__search--version) input { padding-left: 44px !important; }
body .filter__search::before { top: 50%; margin-top: -8px; }

/* ---------- Остатки старых размеров ----------
   Кнопки и поля, которым отдельные страницы задают свою высоту и кегль (42–53px, 13–16px).
   Приводим к общим: кнопка 14px/40px, поле 14px/40px, радиус 8px. */
body .btn-filter,
body .btn-widget,
body .btn-add-event,
body .archive-page .archive-filter-reset,
body .archive-page .archive-filter-apply,
body .question-detail .form__submit,
body main button.form__submit,
body .classifier-submit__btn {
    min-height: 40px !important;
    padding: 8px 16px !important;
    border-radius: var(--p-r) !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}
body .classifier-submit__btn { min-height: 44px !important; padding: 10px 24px !important; }
body .gov-filter-input,
body input.is-filter-input,
body select.is-filter-input:not([multiple]):not([size]),
body select.js-select,
body .archive-page .archive-filter-field input:not([type="checkbox"]):not([type="radio"]),
body .archive-page .archive-filter-field select {
    box-sizing: border-box;
    min-height: 40px;
    height: 40px;
    padding: 8px 12px;
    border-radius: var(--p-r);
    font-size: 14px;
}
body select.js-select { height: 40px !important; min-height: 40px !important; }
/* Поля без своего класса наследуют кегль контейнера (16px на части страниц) — общий кегль поля 14px.
   :where() оставляет специфичность минимальной: правила страниц с классами по-прежнему сильнее. */
body main :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="hidden"]), select, textarea) {
    font-size: 14px;
}

/* ---------- Поля даты ----------
   Родные поля браузера, один вид на всём портале (образец — срок на «Индексе развития»).
   Сторонние календари (jQuery UI, flatpickr) к ним не подключаются; значения приводит к формату
   поля assets/js/date-fields.js. !important — потому что старые формы задают полям свои размеры
   и inline-стили, а вид даты должен быть одинаковым везде. */
body input[type="date"],
body input[type="datetime-local"] {
    box-sizing: border-box !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 8px 12px !important;
    border: 1px solid var(--p-line-2);
    border-radius: var(--p-r) !important;
    background-color: var(--p-surface);
    color: var(--p-ink);
    font-family: var(--p-font) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    cursor: text;
}
body input[type="date"]::-webkit-calendar-picker-indicator,
body input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    margin-left: 4px;
    padding: 2px;
    border-radius: var(--p-r-sm);
    opacity: 0.6;
    cursor: pointer;
}
body input[type="date"]::-webkit-calendar-picker-indicator:hover,
body input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
body input[type="date"]:disabled,
body input[type="datetime-local"]:disabled,
body input[type="date"][readonly],
body input[type="datetime-local"][readonly] { background-color: var(--p-surface-2); color: var(--p-ink-3); }
/* Старая обёртка .form__field_date рисовала свой значок календаря слева — у родного поля он уже есть справа. */
body .form__field_date::before { display: none; }

/* ---------- Таблицы: светлые заголовки вместо тёмных градиентов ---------- */
:where(main) :where(table) :where(th) { background: var(--p-surface-2); color: var(--p-ink-2); font-weight: 600; }

/* ---------- Карточки сообщений ---------- */
:where(.alert) { border-radius: var(--p-r); }

/* ---------- Адаптив ---------- */
@media (max-width: 768px) {
    button, .btn, input[type="submit"], input[type="button"] { min-height: 40px; }
    .btn-block, .buttons-wrapper .btn { width: 100%; }
}

/* ---------- Узкие экраны: карточка содержимого и панели фильтров ---------- */
@media (max-width: 1200px) {
    /* Широкие таблицы не обрезаются и не торчат за рамку: карточка прокручивается по горизонтали. */
    body.hx-chrome .body-wrapper > main > .container,
    body.hx-chrome .body-wrapper > main > .container_medium,
    body.hx-chrome .body-wrapper > main > .container_large { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 860px) {
    :where(main) :where(table) { min-width: 0; }
    /* Панели фильтров переносятся по строкам вместо выхода за край. */
    :where(.np__filters, .gf__filters, .rb-toolbar, .filters, .filter-row) { flex-wrap: wrap; }
    :where(.np__filters) > * { min-width: 0 !important; flex: 1 1 100%; }
    :where(.np__filters-actions) { flex-wrap: wrap; margin-left: 0; }
}

/*
 * ---------- Адаптивность (замечание 7) ----------
 * Замеры на 375 / 768 / 1024px: страница целиком нигде не прокручивается вбок, но
 * содержимому не хватало ширины — у карточки и страницы широкие поля, а часть раскладок
 * не умела сжиматься. Ниже: поля уже, раскладки складываются в колонку.
 */
@media (max-width: 1200px) {
    /* Ноутбук и планшет: поля карточки и ячеек таблиц уже — восемь колонок помещаются без выхода за край. */
    body.hx-chrome .body-wrapper > main > .container,
    body.hx-chrome .body-wrapper > main > .container_medium,
    body.hx-chrome .body-wrapper > main > .container_large { padding-left: 20px; padding-right: 20px; }
    body.hx-chrome .body-wrapper > main .table:not(.table-bordered) th,
    body.hx-chrome .body-wrapper > main .table:not(.table-bordered) td { padding-left: 10px; padding-right: 10px; }
    body.hx-chrome .dt-module-nav__inner { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 860px) {
    /* Раскладки в две колонки: 1fr без minmax(0, …) растягивается по содержимому и вылезает за край. */
    .is-main-info-layout { grid-template-columns: minmax(0, 1fr) !important; }
    .is-main-info-layout > *, .gf__grid > *, .pf-columns > * { min-width: 0; max-width: 100%; }
    .gf__grid { grid-template-columns: minmax(0, 1fr); }
    .is-menu-navigation, .is-menu, .is-menu-content { width: 100% !important; max-width: 100%; min-width: 0; }
    .report-filters .filter-group { width: 100%; min-width: 0; }
    .report-filters .btn-report-builder { margin-left: 0 !important; }
    .ann-head .page-title { min-width: 0; }
    .status { white-space: normal; }
    /* Графики: mobile.css держал минимальную ширину 600px. */
    canvas.chart__block { min-width: 0 !important; margin-right: 0 !important; }
    /* Ряды, собранные inline-стилем «display: flex» без переноса, переносятся по строкам. */
    :where(main) [style*="display: flex"]:not([style*="flex-wrap"]):not([style*="flex-direction"]),
    :where(main) [style*="display:flex"]:not([style*="flex-wrap"]):not([style*="flex-direction"]) { flex-wrap: wrap; }
}

@media (max-width: 640px) {
    /* Телефон: поля страницы и карточки занимали 144px из 375 — контенту оставалось 231px. */
    body.has-menu .body-wrapper > main { padding-left: 12px !important; padding-right: 12px !important; }
    body.hx-chrome .body-wrapper > main > .container,
    body.hx-chrome .body-wrapper > main > .container_medium,
    body.hx-chrome .body-wrapper > main > .container_large { padding: 20px 16px 28px; }
    body.hx-chrome.has-menu .dt-module-nav { padding: 0 12px; }
    body.hx-chrome .dt-module-nav__inner { padding-left: 16px; padding-right: 16px; }
    /* Формы-таблицы «подпись | поле»: строка из двух ячеек складывается в столбик. */
    .is-info tr:has(> td:first-child:nth-last-child(2)):not(:has(th)),
    .is-info tr:has(> td:first-child:nth-last-child(2)):not(:has(th)) > td { display: block; width: 100% !important; box-sizing: border-box; }
    .is-info tr:has(> td:first-child:nth-last-child(2)):not(:has(th)) > td:first-child { padding-bottom: 4px; }
    .is-info tr:has(> td:first-child:nth-last-child(2)):not(:has(th)) > td:last-child { padding-top: 0; }
    .is-info__right-row { flex-wrap: wrap; }
    .is-info__right-value { min-width: 0; }
    /* Таблицы во вкладках карточки ИС прокручиваются внутри вкладки. */
    .is-menu-content, .is-tab-content { max-width: 100%; overflow-x: auto; }
    /* Ряд «тип документа + файл + кнопка» в объявлениях — в столбик. */
    .document-group { flex-wrap: wrap; }
    .document-group > * { min-width: 0; flex: 1 1 100%; }
    /* Длинная подпись кнопки переносится, а не выталкивает ряд. */
    button, .btn, input[type="submit"], input[type="button"] { white-space: normal; }
}

/* ---------- Кнопки внутри таблиц — компактные, чтобы не растягивать строки ---------- */
:where(td, th) .btn, :where(td, th) button, :where(td, th) input[type="submit"] { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: var(--p-r-sm); }
:where(td, th) .btn + .btn, :where(td, th) button + button { margin-left: 4px; }

/* ---------- Модульные системы кнопок → общий вид ----------
   Модульные CSS (reengineering, national-plan, gov-functions, digital-service, conclusion-sidebar,
   admin-panels и inline-стили страниц) подключаются после этого файла, поэтому селекторы здесь
   с префиксом `html body`. Выравниваются размер, скругление, шрифт и насыщенность; цвет —
   только у явно основных и явно второстепенных вариантов. */
html body .re__btn, html body .np__btn, html body .gf__btn, html body .ds-btn, html body .ikc-button,
html body .action-btn, html body .status-btn, html body .concl-nav__btn, html body .admin-modal-btn, html body .rb-btn--lg {
    min-height: 40px; height: auto; padding: 9px 16px;
    border-radius: var(--p-r); font-family: var(--p-font); font-size: 14px; font-weight: 600;
    text-transform: none; letter-spacing: 0; box-shadow: none; transform: none;
}
html body .rb-btn, html body .rb-btn--sm, html body .gf__btn--sm, html body .np__btn--sm, html body .re__btn--sm {
    min-height: 32px; height: auto; padding: 5px 12px; border-radius: var(--p-r-sm); font-family: var(--p-font); font-size: 13px; font-weight: 600; box-shadow: none; transform: none;
}
/* Основной вариант: один синий вместо #3b82f6 / #0178bc / градиентов #0f6cbd→#0ea5a8 и #6366f1→#8b5cf6 */
html body .gf__btn--primary, html body .rb-btn--primary, html body .ds-btn--primary, html body .ikc-button:not(.ikc-button-secondary):not(.ikc-button-danger),
html body .action-btn:not(.action-btn--secondary):not(.action-btn--danger), html body .re__btn--primary, html body .np__btn--primary {
    background: var(--p-primary); background-image: none; border-color: var(--p-primary); color: #fff;
}
html body .gf__btn--primary:hover, html body .rb-btn--primary:hover, html body .ds-btn--primary:hover, html body .ikc-button:not(.ikc-button-secondary):not(.ikc-button-danger):hover,
html body .action-btn:not(.action-btn--secondary):not(.action-btn--danger):hover, html body .re__btn--primary:hover, html body .np__btn--primary:hover {
    background: var(--p-primary-hover); background-image: none; border-color: var(--p-primary-hover); color: #fff;
}
/* Второстепенный вариант: белая кнопка с рамкой */
html body .concl-nav__btn, html body .re__btn--outline, html body .np__btn--outline, html body .gf__btn--outline, html body .rb-btn--ghost, html body .ikc-button-secondary, html body .status-btn {
    background: var(--p-surface); background-image: none; border: 1px solid var(--p-line-2); color: var(--p-ink);
}
html body .concl-nav__btn:hover, html body .re__btn--outline:hover, html body .np__btn--outline:hover, html body .gf__btn--outline:hover, html body .rb-btn--ghost:hover, html body .ikc-button-secondary:hover, html body .status-btn:hover {
    background: var(--p-surface-2); border-color: var(--p-ink-3); color: var(--p-ink);
}
/* Лишняя жирность: выделение в тексте — 600, а не 700/800 */
:where(main) :where(b, strong) { font-weight: 600; }
/* Карточки и модальные окна — одно скругление */
:where(main) :where(.card, .panel, .modal-content, .alert, .notice) { border-radius: var(--p-r-lg); }
