/* style.css - Material Design 3 inspired */

:root {
    /* ===== Основные цвета (Material Design 3) ===== */
    --md-sys-color-primary: #6750A4;
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-primary-container: #EADDFF;
    --md-sys-color-on-primary-container: #21005D;
    --md-sys-color-secondary: #625B71;
    --md-sys-color-on-secondary: #FFFFFF;
    --md-sys-color-secondary-container: #E8DEF8;
    --md-sys-color-on-secondary-container: #1D192B;
    --md-sys-color-link: var(--md-sys-color-primary);
    --md-sys-color-link-visited: #551a8b;
    --md-sys-color-tertiary: #7D5260;
    --md-sys-color-on-tertiary: #FFFFFF;
    --md-sys-color-tertiary-container: #FFD8E4;
    --md-sys-color-on-tertiary-container: #31111D;
    --md-sys-color-error: #B3261E;
    --md-sys-color-on-error: #FFFFFF;
    --md-sys-color-error-container: #F9DEDC;
    --md-sys-color-on-error-container: #410E0B;
    --md-sys-color-background: #FFFBFE;
    --md-sys-color-on-background: #1C1B1F;
    --md-sys-color-surface: #FFFBFE;
    --md-sys-color-on-surface: #1C1B1F;
    --md-sys-color-surface-variant: #E7E0EC;
    --md-sys-color-on-surface-variant: #49454F;
    --md-sys-color-outline: #8d8d8d;
	
	--md-sys-color-autofill-bg: #e8f0fe;      /* фон автозаполнения в светлой теме */
    --md-sys-color-autofill-text: #1c1b1f;    /* текст автозаполнения в светлой теме */

    /* ===== Тени (Elevation) ===== */
    --md-elevation-1: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
    --md-elevation-2: 0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15);
    --md-elevation-3: 0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3);

    /* ===== Типографика и размеры ===== */
    --md-font-family: 'Roboto', sans-serif;
    --md-body-large: 16px;
    --md-body-medium: 14px;
    --md-title-large: 22px;
    --md-title-medium: 16px;
    --md-label-large: 14px;
    --md-shape-small: 8px;
    --md-shape-medium: 12px;
    --md-shape-large: 16px;
    --md-spacing: 8px;
    --md-control-height: 48px;
}

/* ============================================================
   Тёмная тема (класс dark на body)
   ============================================================ */
body.dark {
    --md-sys-color-primary: #7eb8ff;
    --md-sys-color-on-primary: #0a0a16;
    --md-sys-color-primary-container: #2d2d44;
    --md-sys-color-on-primary-container: #d4d1c2;
    --md-sys-color-secondary: #575555;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #2d2d44;
    --md-sys-color-on-secondary-container: #e0e0e0;
    --md-sys-color-link: #098bcc;
    --md-sys-color-link-visited: #94549b;
    --md-sys-color-tertiary: #7dcca4;
    --md-sys-color-on-tertiary: #1a3a1a;
    --md-sys-color-tertiary-container: #1a3a1a;
    --md-sys-color-on-tertiary-container: #7dcca4;
    --md-sys-color-error: #ff6b6b;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-error-container: #3a1a1a;
    --md-sys-color-on-error-container: #ffb3b3;
    --md-sys-color-background: #0a0a16;
    --md-sys-color-on-background: #d4d1c2;
    --md-sys-color-surface: #0f0f24;
    --md-sys-color-on-surface: #d4d1c2;
    --md-sys-color-surface-variant: #202033;
    --md-sys-color-on-surface-variant: #adaa9c;
    --md-sys-color-outline: #616161;
    --md-elevation-1: 0 1px 3px rgba(0,0,0,0.3);
    --md-elevation-2: 0 2px 8px rgba(0,0,0,0.4);
    --md-elevation-3: 0 4px 16px rgba(0,0,0,0.5);
	
	--md-sys-color-autofill-bg: #3f3f56;      /* тёмный фон автозаполнения */
    --md-sys-color-autofill-text: #d4d1c2;    /* светлый текст автозаполнения */
}

    /* ===== Тени (Elevation) ===== */
    --md-elevation-1: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
    --md-elevation-2: 0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15);
    --md-elevation-3: 0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3);

    /* ===== Типографика и размеры ===== */
    --md-font-family: 'Roboto', sans-serif;
    --md-body-large: 16px;
    --md-body-medium: 14px;
    --md-title-large: 22px;
    --md-title-medium: 16px;
    --md-label-large: 14px;
    --md-shape-small: 8px;
    --md-shape-medium: 12px;
    --md-shape-large: 16px;
    --md-spacing: 8px;
    --md-control-height: 48px;   /* Стандартная высота контролов на десктопе */
}


/* ============ Базовые стили ============ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--md-font-family);
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    font-size: var(--md-body-medium);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
}

/* Базовые стили для всех ссылок */
a {
    color: var(--md-sys-color-link);
    text-decoration: underline;
}

a:hover {
    color: var(--md-sys-color-link);
    text-decoration: underline;
}

a:visited {
    color: var(--md-sys-color-link-visited);
}

.main-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
}

/* ============ Заголовок ============ */
.page-header {
    margin-bottom: 16px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

/* Логотип слева, заголовок справа */
.logo-and-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Ограничиваем ширину логотипа, чтобы он не занимал много места */
.logo {
    height: auto;
    max-width: 60px;          /* можно подобрать нужное значение */
    flex-shrink: 0;
}

/* Заголовок занимает оставшееся пространство */
.site-title-group {
    flex: 1 1 auto;
    min-width: 0;
}

/* Заголовок максимум в 2 строки */
.site-title {
    font-size: 16px;           /* при необходимости уменьшить до 14px */
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

.site-subtitle {
    font-size: var(--md-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.main-page-link {
    font-size: var(--md-body-medium);
    color: var(--md-sys-color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.main-page-link:hover {
    text-decoration: underline;
}

.controls {
    display: flex;
    gap: 8px;
}

.lang-select,
.theme-select {
    height: var(--md-control-height);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-small);
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    padding: 0 12px;
    font-size: var(--md-body-medium);
    cursor: pointer;
}

.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-small);
    cursor: pointer;
    padding: 8px;
}

.burger-line {
    height: 2px;
    background: var(--md-sys-color-on-surface);
}

/* Разделитель */
.divider {
    margin: 12px 0;
    border: none;
    border-top: 1px solid var(--md-sys-color-outline);
}

/* ============ Хлебные крошки (под разделителем) ============ */
.breadcrumbs {
    font-size: var(--md-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.nav-separator {
    margin: 0 4px;
}

/* ============ Табы (Простой / Расширенный) ============ */
.search-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 400px;
    margin: 0 auto 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-medium);
    overflow: hidden;
    background: var(--md-sys-color-surface-variant);
}

.tab-button {
    padding: 12px;
    text-align: center;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    border: none;
    outline: none;
    font-size: var(--md-body-medium);
    transition: background-color 0.2s, color 0.2s;
}

.tab-button.active {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.tab-button:not(.active):hover {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

/*  правило для автозаполнения -webkit-autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--md-sys-color-autofill-bg) inset !important;
    -webkit-text-fill-color: var(--md-sys-color-autofill-text) !important;
    caret-color: var(--md-sys-color-autofill-text) !important;
    border: 1px solid var(--md-sys-color-outline) !important;
    border-radius: var(--md-shape-small) !important;
    transition: background-color 5000s ease-in-out 0s;
}


/* ============ Поля поиска (обычные строки с label, select условия, input) ============ */
.search-field {
    display: grid;
    grid-template-columns: 120px 150px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.field-label {
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.field-cond select,
.field-value input,
.field-value select,
.search-input,
.search-select {
    width: 100%;
    padding: 0 16px;
    height: var(--md-control-height);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-small);
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-size: var(--md-body-large);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field-value input:focus,
.field-value select:focus,
.search-input:focus,
.search-select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);
	background-color: var(--md-sys-color-surface);
}

/* Диапазон годов */
.year-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Поля ввода годов */
.year-range .search-year-input {
    flex: 1;
    height: var(--md-control-height) !important;
    min-height: var(--md-control-height) !important;
}

/* Поля ввода годов (диапазон) */
.search-year-input {
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-small);
}

/* Чекбокс для электронной копии */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    height: var(--md-control-height);
    min-height: var(--md-control-height);
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 4px;
    background-color: var(--md-sys-color-surface);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* ============ Группы полей (объединённые в одну строку) ============ */
.search-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: nowrap;
    align-items: flex-start;
}

.field-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.field-group > label {
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-body-medium);
    margin-bottom: 4px;
}

/* Контейнер для элементов внутри группы */
.field-group .field-controls {
    height: var(--md-control-height);
    min-height: var(--md-control-height);
    display: flex;
    gap: 8px;
    align-items: center;
}

.field-group .field-controls select {
    width: auto;
    flex-shrink: 0;
}

.field-group .field-controls input,
.field-group .field-controls select.search-select {
    flex: 1;
}

/* Чтобы все внутренние input/select также занимали всю высоту контейнера */
.field-group .field-controls input,
.field-group .field-controls select {
    height: 100%;
}

/* ============ Кнопки ============ */
.btn {
    height: var(--md-control-height);
    padding: 0 24px;
    border: none;
    border-radius: var(--md-shape-medium);
    font-size: var(--md-body-medium);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn:hover {
    box-shadow: var(--md-elevation-1);
    background-color: var(--md-sys-color-link);
}

.btn:active {
    box-shadow: none;
}

.btn-primary {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn-secondary {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border: 1px solid var(--md-sys-color-outline);
}

.btn-secondary:hover {
    background-color: var(--md-sys-color-secondary);
    color: var(--md-sys-color-on-secondary);
}

/* Кнопка «Знайти» в нижней панели прижимается вправо */
.btn-search-action {
    margin-left: auto;
}

/* ============ Нижняя панель (селект количества + кнопки) ============ */
.bottom-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.step-select {
    height: var(--md-control-height);
    padding: 0 12px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-small);
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
}

.action-buttons {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* ============ Статистика ============ */
.footer-stats {
    margin-top: 16px;
    font-size: var(--md-body-medium);
    color: var(--md-sys-color-on-surface-variant);
}

/* ============ Блок классификаторов ============ */
.classifiers-block {
    margin-top: 24px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-medium);
    overflow: hidden;
    background-color: var(--md-sys-color-surface);
}

.classifiers-summary {
    padding: 16px;
    font-weight: 500;
    cursor: pointer;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
}

.classifiers-content {
    padding: 16px;
    border-top: 1px solid var(--md-sys-color-outline);
}

.classifier-link {
    display: inline-block;
    padding: 8px 0;
    margin-right: 16px;
    color: var(--md-sys-color-link);
    text-decoration: none;
}

.classifier-link:hover {
    text-decoration: underline;
}

/* ============ Список результатов (карточки) ============ */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-medium);
    padding: 12px;
    transition: box-shadow 0.2s;
}

.result-item:hover {
    box-shadow: var(--md-elevation-1);
}

.result-number {
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    min-width: 24px;
    text-align: right;
}

.result-card {
    min-width: 0;
}

.doc-type {
    font-weight: 500;
    color: var(--md-sys-color-primary);
}

.doc-title {
    display: block;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--md-sys-color-on-surface);
}

/* ============ Карточка-ссылка ============ */
.result-card-link {
    display: block;
    text-decoration: none;          /* убираем подчёркивание */
    color: inherit;                 /* наследуем цвет текста */
    border-radius: var(--md-shape-medium);
    transition: box-shadow 0.2s;
}

.result-card-link:hover .result-item {
    box-shadow: var(--md-elevation-1);  /* тень при наведении */
}


.result-card-link:hover .result-item {
    background-color: var(--md-sys-color-surface-variant);
    box-shadow: var(--md-elevation-1);
}




/* ============ Блок условий поиска ============ */
.conditions-block {
    margin-bottom: 16px;
    padding: 12px 16px;
    background-color: transparent;                     /* прозрачный фон */
    border: 1px solid var(--md-sys-color-outline);    /* рамка как у карточек */
    border-radius: var(--md-shape-medium);
}

.conditions-title {
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    margin-right: 8px;
}

.conditions-text {
    font-size: var(--md-body-medium);
    line-height: 1.5;
}

/* ============ Пагинация ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: var(--md-shape-small);
    background-color: transparent;
    color: var(--md-sys-color-link);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.page-btn:hover {
    background-color: var(--md-sys-color-secondary-container);
}

.page-btn.current {
    background-color: var(--md-sys-color-link);
    color: var(--md-sys-color-on-primary);
}

.page-btn.disabled {
    color: var(--md-sys-color-on-surface-variant);
    pointer-events: none;
    opacity: 0.5;
}

.page-ellipsis {
    padding: 0 4px;
    color: var(--md-sys-color-on-surface-variant);
}

/* ============ Отладочная информация ============ */
.debug-info {
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 8px;
    padding: 4px 0;                     /* уменьшаем боковые отступы, так как фона нет */
    background-color: transparent;      /* прозрачный фон */
    border-radius: 0;
}

/* ============ Название документа в результатах (усиленная специфичность) ============ */
.result-item .result-card .doc-title {
    display: block;
    font-size: 1.25rem !important;
    font-weight: 500 !important;
    color: var(--md-sys-color-on-surface) !important;
    margin-bottom: 4px;
}

/* ============ Карточка документа (DocCard) ============ */
.card-container {
    margin-top: 16px;
    padding: 16px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-medium);
}

.card-title {
    font-size: var(--md-title-medium);
    font-weight: 500;
    margin-bottom: 8px;
}

.card-field {
    margin-bottom: 8px;
}

.card-field ul {
    margin-left: 0;
    padding-left: 32px;          /* увеличенный отступ слева для пунктов */
  /*   list-style-position: outside; маркеры остаются снаружи */
}

.card-field ul li {
    margin-bottom: 4px;
}


.electronic-field {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--md-sys-color-outline);
}

.card-label {
    font-weight: 500;
    color: var(--md-sys-color-primary);
}

.card-annotation {
    margin-top: 4px;
    padding: 8px 0;           /* убрали боковой padding и фон */
    background: none;
    border-radius: 0;
}

.btn-back {
    display: inline-block;
    margin-bottom: 16px;
    padding: 8px 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-shape-small);
    text-decoration: none;
    color: var(--md-sys-color-link);
    background-color: transparent;
    transition: background-color 0.2s;
}

.btn-back:hover {
    background-color: var(--md-sys-color-secondary-container);
}

.el-version-link {
    color: var(--md-sys-color-link);
    text-decoration: underline;
}

.el-version-link:hover {
    text-decoration: underline;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table th,
.items-table td {
    padding: 8px;
    border: 1px solid var(--md-sys-color-outline);
    text-align: left;
}

.items-table th {
    background-color: var(--md-sys-color-surface-variant);
    font-weight: 500;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
}

.mt-20 {
    margin-top: 20px;
}

.error-text {
    color: var(--md-sys-color-error);
    font-weight: 500;
}

/* Адаптивные правки для страницы документа */
@media (max-width: 768px) {
    .card-container {
        padding: 12px;
    }

    .card-field {
        margin-bottom: 12px;
    }

    .btn-back {
        width: 100%;
        text-align: center;
    }
}

/* ============ Тематический поиск в классификаторах ============ */
.theme-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-search-input {
    flex: 1;
}

.theme-search-btn {
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;  /* на ПК прижимаем кнопку вправо */
}

/* Отступ для заголовка "Класификатори", чтобы отделить от кнопки */
.classifiers-margin-top {
    margin-top: 20px;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .theme-search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .theme-search-input {
        width: 100%;
    }

    .theme-search-btn {
        width: 100%;
        margin-left: 0;
    }

    .classifiers-margin-top {
        margin-top: 16px;
    }
}




/* ============================================================
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (до 768px)
   ============================================================ */
@media (max-width: 768px) {
    .main-container {
        padding: 12px 3%;
    }

    .header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .logo-and-title {
        justify-content: space-between;
    }

    .header-actions {
        justify-content: space-between;
        width: 100%;
        gap: 8px;
    }

    .main-page-link {
        display: none;
    }

    .main-page-link.show {
        display: inline;
    }

    .burger-menu {
        display: flex;
        order: 1;
    }

    .controls {
        order: 2;
        margin-left: auto;
    }

    .breadcrumbs {
        margin-top: 4px;
    }

    .search-tabs {
        max-width: 100%;
        margin: 0 0 16px;
    }

    .search-field {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .field-value,
    .field-cond {
        width: 100%;
    }

    .search-row {
        flex-direction: column;
    }

    /* Сохраняем горизонтальную раскладку для групп с классом row-mobile на мобильных */
    .search-row.row-mobile {
        flex-direction: row;
    }

    .search-row.row-mobile .field-group {
        flex: 1;
        min-width: 0;
    }

    .field-group {
        flex: 1;
        width: 100%;
    }

    .search-input,
    .search-select,
    .search-year-input,
    .year-range .search-year-input,
    .checkbox-label {
        height: 44px;
        min-height: 44px;
    }

    .field-group .field-controls {
        height: 44px;
        min-height: 44px;
    }

    .btn {
        width: 100%;
    }

    .bottom-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .action-buttons {
        margin-left: 0;
        width: 100%;
    }

    .action-buttons .btn {
        flex: 1;
    }

    .bottom-panel.simple-mode {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .bottom-panel.simple-mode .step-select {
        width: 20%;
        flex: 0 0 20%;
        margin: 0;
    }

    .bottom-panel.simple-mode .btn-search-action {
        width: auto;
        flex: 1 1 auto;
        margin-left: 0;
    }

    .bottom-panel.extended-mode {
        position: sticky;
        bottom: 0;
        background: var(--md-sys-color-background);
        padding: 8px 0;
        margin: 0;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
        z-index: 100;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    .bottom-panel.extended-mode .step-select {
        width: 20%;
        flex: 0 0 20%;
        margin: 0;
    }

    .bottom-panel.extended-mode .action-buttons {
        flex: 1 1 auto;
        margin-left: 0;
        width: auto;
        display: flex;
        gap: 8px;
    }

    .bottom-panel.extended-mode .action-buttons .btn {
        flex: 1 1 auto;
        width: auto;
    }

    /* Адаптация карточек результатов */
    .result-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .result-number {
        text-align: left;
    }

    .pagination {
        justify-content: center;
    }
}