/* =========================================================================
   ШАГ 2 — СТИЛИ
   Все классы используют префикс .s2-
   ========================================================================= */


/* ─── Основная сетка шага 2 ─────────────────────────────────────────────── */

.s2-layout {
    display: flex;
    width: 100%;
    height: calc(100vh - 56px);
    align-items: stretch;
}

.s2-panel {
    overflow: hidden;
}

@media (max-width: 900px) {
    .s2-layout {
        height: auto;
        min-height: calc(100vh - 56px);
        flex-direction: column;
    }
    .s2-panel {
        overflow: visible;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
}


/* ─── Панели (три колонки: отправитель, получатель, посылка) ─────────────── */

.s2-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #dee2e6;
}

.s2-panel:last-child {
    border-right: none;
}

.s2-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    flex-shrink: 0;
}

.s2-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #212529;
    letter-spacing: -.2px;
}

.s2-panel-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #ced4da transparent;
}

.s2-panel-body::-webkit-scrollbar {
    width: 4px;
}

.s2-panel-body::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 2px;
}

/* Кнопка «+ Новый» в шапке панели адреса */
.s2-new-btn {
    font-size: 12px;
    font-weight: 600;
    color: #0d6efd;
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: background .15s;
    line-height: 1.4;
}

.s2-new-btn:hover {
    background: #e8f0fe;
}

/* Кнопка «← Назад» в шапке панели посылки */
.s2-back-btn {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    background: none;
    border: 1px solid #ced4da;
    cursor: pointer;
    padding: 3px 10px;
    border-radius: 4px;
    transition: all .15s;
    line-height: 1.4;
}

.s2-back-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #f0f4ff;
}


/* ─── Базовые элементы формы ─────────────────────────────────────────────── */

.s2-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 3px;
}

/* Звёздочка обязательного поля */
.s2-req {
    color: #dc3545;
}

.s2-input {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
    color: #212529;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}

.s2-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, .12);
}

/* Двухколоночная сетка для пар полей */
.s2-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}


/* ─── Кастомный селект ───────────────────────────────────────────────────── */

.s2-select-wrap {
    position: relative;
}

.s2-select {
    width: 100%;
    appearance: none;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 5px 26px 5px 8px;
    font-size: 12px;
    color: #495057;
    background: #fff;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
}

.s2-select:focus {
    border-color: #0d6efd;
}

.s2-select-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6c757d;
    font-size: 12px;
}


/* ─── Выбор страны (trigger + dropdown) ─────────────────────────────────── */

/* Вспомогательные обёртки (используются в addressFormHTML) */
.s2-country-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.s2-flag {
    position: absolute;
    left: 8px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.s2-select--country {
    padding-left: 30px;
}

/* Контейнер с поиском страны */
.s2-country-search {
    position: relative;
}

.s2-country-input {
    padding-right: 28px;
}

/* Кнопка-триггер (флаг + название страны) */
.s2-country-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    color: #212529;
    transition: border-color .15s;
}

.s2-country-trigger:hover {
    border-color: #0d6efd;
}

.s2-country-flag {
    font-size: 14px;
    line-height: 1;
}

.s2-country-name {
    flex: 1;
    color: #212529;
}

/* Выпадающий список стран */
.s2-country-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.s2-country-search-wrap {
    padding: 6px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.s2-country-search-input {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
}

.s2-country-search-input:focus {
    border-color: #0d6efd;
}

.s2-country-list {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.s2-country-opt {
    padding: 6px 10px;
    font-size: 12px;
    color: #212529;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.s2-country-opt:hover {
    background: #f0f4ff;
}

.s2-country-opt-flag {
    font-size: 14px;
    flex-shrink: 0;
}

.s2-country-opt-code {
    font-size: 10px;
    font-weight: 700;
    color: #6c757d;
    background: #f1f3f5;
    border-radius: 3px;
    padding: 1px 4px;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
}


/* ─── Телефон (код страны + номер) ──────────────────────────────────────── */

.s2-phone-group {
    display: flex;
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
}

.s2-phone-prefix {
    position: relative;
    background: #f8f9fa;
    border-right: 1px solid #ced4da;
    display: flex;
    align-items: center;
}

.s2-phone-code {
    appearance: none;
    border: none;
    background: transparent;
    padding: 7px 20px 5px 7px;
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    outline: none;
}

.s2-phone-arrow {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6c757d;
    font-size: 11px;
}

.s2-input--phone {
    border: none;
    border-radius: 0;
    flex: 1;
    min-width: 0;
}

.s2-input--phone:focus {
    box-shadow: none;
}


/* ─── Вспомогательные элементы иконок ───────────────────────────────────── */

.s2-icon-wrap {
    position: relative;
}

.s2-pin-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}


/* ─── Поля с суффиксом (размеры: длина/ширина/высота, вес) ──────────────── */

.s2-suf-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.s2-input--dim {
    border: none;
    outline: none;
    padding: 5px 6px;
    font-size: 12px;
    flex: 1;
    min-width: 0;
    color: #212529;
}

.s2-suf {
    padding: 0 7px;
    font-size: 10px;
    font-weight: 600;
    color: #6c757d;
    background: #f8f9fa;
    border-left: 1px solid #ced4da;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Выпадающий список единицы веса (KG / LB) */
.s2-kg-sel {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-left: 1px solid #ced4da;
}

.s2-kg-drop {
    appearance: none;
    border: none;
    background: transparent;
    padding: 5px 20px 5px 7px;
    font-size: 10px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    outline: none;
}

.s2-kg-arrow {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 11px;
    color: #6c757d;
}


/* ─── Тип отправления (Конверт / Коробка) ───────────────────────────────── */

.s2-type-btns {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.s2-type-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 11px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    color: #495057;
    cursor: pointer;
    transition: all .15s;
}

.s2-type-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.s2-type-btn--active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff !important;
}

.s2-type-icon {
    width: 16px;
    height: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.s2-type-icon svg {
    width: 100%;
    height: 100%;
}


/* ─── Единица измерения (KG/CM ↔ LB/IN) ─────────────────────────────────── */

.s2-unit-toggle {
    display: inline-flex;
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
}

.s2-unit-btn {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    background: #fff;
    color: #495057;
    cursor: pointer;
    transition: all .15s;
}

.s2-unit-btn--active {
    background: #0d6efd;
    color: #fff;
}

.s2-unit-btn:not(.s2-unit-btn--active):hover {
    background: #f0f4ff;
}


/* ─── Блок посылки (рамка с заголовком) ─────────────────────────────────── */

.s2-box-block {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #fafbfc;
}

.s2-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.s2-box-title {
    font-size: 12px;
    font-weight: 600;
    color: #212529;
}


/* ─── Страховая стоимость ────────────────────────────────────────────────── */

.s2-valor-section {
    border-top: 1px solid #eee;
    padding-top: 7px;
}

.s2-valor-label {
    font-size: 11px;
    color: #6c757d;
}

.s2-envio-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.s2-envio-text {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #212529;
}


/* ─── Наложенный платёж / доп. услуги / запреты ─────────────────────────── */

.s2-contra-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.s2-contra-label {
    font-size: 11px;
    color: #495057;
    cursor: pointer;
    margin: 0;
}

.s2-more-services,
.s2-prohib {
    text-align: center;
    padding: 5px 0;
    border-top: 1px solid #eee;
    margin-top: 6px;
}


/* ─── Счётчик посылок ────────────────────────────────────────────────────── */

.s2-cantidad-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid #eee;
    margin-top: 6px;
}

.s2-cantidad-label {
    font-size: 12px;
    color: #495057;
}


/* ─── Действия с посылкой (сохранить, минимизировать) ───────────────────── */

.s2-pkg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 6px 0 4px;
    border-top: 1px solid #eee;
}

.s2-minimize-btn {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    color: #495057;
    cursor: pointer;
    transition: all .15s;
}

.s2-minimize-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.s2-save-pkg-btn {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    background: #0d6efd;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
}

.s2-save-pkg-btn:hover {
    background: #0b5ed7;
}

.s2-add-pkg {
    text-align: center;
    padding: 8px 0;
}


/* ─── Нижняя панель: кнопка «Оформить» (sticky к низу панели посылки) ────── */

.s2-bottom-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 2px solid #dee2e6;
    padding: 10px 16px;
    margin: 0 -16px -14px;
}

.s2-cotizar-btn {
    padding: 9px 22px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    background: #0d6efd;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    letter-spacing: .2px;
}

.s2-cotizar-btn:hover {
    background: #0b5ed7;
}

/* Кнопки выбора перевозчика (не используются в текущей версии) */
.s2-bottom-actions {
    display: flex;
    gap: 8px;
}

.s2-carrier-btn {
    flex: 1;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    background: #e8f0fe;
    color: #0d6efd;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .15s;
}

.s2-carrier-btn:hover {
    background: #d0e2fd;
}


/* ─── Сводка тарифа (выбранный тариф над формой) ────────────────────────── */

.s2-rate-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.s2-rate-sum-price {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
}

.s2-rate-sum-eta {
    font-size: 11px;
    color: #6c757d;
}


/* ─── Адрес — footer с кнопкой «Сохранить» ──────────────────────────────── */

.s2-addr-footer {
    display: flex;
    justify-content: flex-end;
}

.s2-save-btn {
    padding: 7px 22px;
    font-size: 13px;
    font-weight: 600;
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background .15s;
}

.s2-save-btn:hover {
    background: #0b5ed7;
}


/* ─── Ссылки ─────────────────────────────────────────────────────────────── */

.s2-link {
    font-size: 11px;
    color: #0d6efd;
    text-decoration: none;
}

.s2-link:hover {
    text-decoration: underline;
}


/* ─── Загрузка динамических полей адреса / состояния ошибки ─────────────── */

.s2-addr-dynamic {
    margin-bottom: 8px;
}

.s2-addr-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6c757d;
    padding: 12px 0;
}

.s2-addr-error {
    font-size: 12px;
    color: #dc3545;
    padding: 8px 0;
}


/* ─── Спиннер (загрузка полей адреса) ───────────────────────────────────── */

.s2-mini-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #dee2e6;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: s2spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes s2spin {
    to { transform: rotate(360deg); }
}


/* ─── Валидация — подсветка незаполненных полей ─────────────────────────── */

.s2-input--error,
.s2-select--error {
    border: 1px solid #dc3545 !important;
    outline: none;
}


/* ─── Модалка тарифов (overlay + box) ───────────────────────────────────── */

.s2-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.s2-modal-box {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.s2-modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.s2-modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #212529;
    flex: 1;
}

.s2-modal-header-btn {
    font-size: 11px;
    padding: 4px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    color: #495057;
    cursor: pointer;
}

.s2-modal-close {
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    padding: 2px 6px;
}


/* ─── Модалка — блок адресов (отправитель, получатель, посылка) ──────────── */

.s2-modal-addresses {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
    padding: 12px 16px;
}

.s2-modal-addr-col {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 12px;
    overflow: hidden;
}

/* Колонка «Посылка» с фоном */
.s2-modal-addr-col--pkg {
    background: #f8f9fa;
}

.s2-modal-addr-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.s2-modal-addr-body {
    padding: 10px 12px;
}

.s2-modal-addr-flag {
    font-size: 14px;
    line-height: 1;
}

.s2-modal-addr-title {
    font-size: 11px;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0;
}

.s2-modal-addr-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 1px;
}

.s2-modal-addr-company {
    color: #6c757d;
    margin-bottom: 1px;
}

.s2-modal-addr-line {
    color: #0d6efd;
}


/* ─── Модалка — поиск по тарифам ────────────────────────────────────────── */

.s2-modal-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.s2-modal-filter-btn {
    font-size: 12px;
    padding: 4px 12px;
    border: 1px solid #ced4da;
    border-radius: 20px;
    background: #fff;
    color: #495057;
    cursor: pointer;
}

.s2-modal-filter-btn--active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.s2-modal-search-wrap {
    margin-left: auto;
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 3px 8px;
    gap: 6px;
    background: #fff;
}

.s2-modal-search {
    border: none;
    outline: none;
    font-size: 12px;
    width: 140px;
    color: #212529;
}

.s2-modal-search-clear {
    border: none;
    background: none;
    cursor: pointer;
    color: #adb5bd;
    font-size: 12px;
    padding: 0;
}


/* ─── Модалка — список тарифов ───────────────────────────────────────────── */

.s2-modal-rates {
    overflow-y: auto;
    flex: 1;
    padding: 0 16px;
}

.s2-modal-rate-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f5;
}

.s2-modal-rate-row:last-child {
    border-bottom: none;
}

/* Логотип перевозчика */
.s2-modal-rate-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.s2-modal-rate-logo img {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
}

/* Заглушка если логотипа нет */
.s2-modal-rate-logo-placeholder {
    width: 40px;
    height: 40px;
    background: #e9ecef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #6c757d;
    font-size: 16px;
}

/* Название + срок доставки */
.s2-modal-rate-info {
    flex: 1;
    min-width: 0;
}

.s2-modal-rate-name {
    font-size: 13px;
    color: #212529;
    margin-bottom: 2px;
}

.s2-modal-service-type {
    font-size: 10px;
    background: #e9ecef;
    color: #495057;
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 4px;
}

.s2-modal-rate-delivery {
    font-size: 11px;
    color: #6c757d;
}

/* Бейджи (тип доставки, страховка, доп. сборы) */
.s2-modal-rate-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.s2-modal-charge {
    font-size: 10px;
    background: #fff3cd;
    color: #856404;
    border-radius: 3px;
    padding: 1px 5px;
}

.s2-modal-rate-weight {
    font-size: 11px;
    color: #495057;
    white-space: nowrap;
}

/* Цена */
.s2-modal-rate-price {
    text-align: right;
    flex-shrink: 0;
}

.s2-modal-rate-price-wrap {
    position: relative;
    text-align: right;
    cursor: default;
}

.s2-modal-rate-total {
    font-size: 15px;
    font-weight: 700;
    color: #0d6efd;
    white-space: nowrap;
}

.s2-modal-rate-tax {
    font-size: 10px;
    color: #6c757d;
}

/* Кнопки действий строки тарифа */
.s2-modal-rate-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.s2-modal-generate-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.s2-modal-generate-btn:hover {
    background: #0b5ed7;
}

.s2-modal-more-btn {
    padding: 6px 8px;
    font-size: 14px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    color: #495057;
}


/* ─── Модалка — tooltip с расшифровкой цены ─────────────────────────────── */

.s2-modal-price-tooltip {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    min-width: 200px;
    z-index: 9999;
    white-space: nowrap;
    pointer-events: none;
}

.s2-modal-price-tooltip.is-visible {
    display: block;
}


/* ─── Модалка — footer ───────────────────────────────────────────────────── */

.s2-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
    border-top: 2px solid #dee2e6;
    flex-shrink: 0;
}

.s2-modal-footer-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.s2-modal-footer-btns {
    display: flex;
    gap: 6px;
}

.s2-modal-footer-btn {
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.s2-modal-footer-links {
    font-size: 11px;
    color: #6c757d;
}

.s2-modal-footer-link {
    color: #0d6efd;
    text-decoration: none;
}

.s2-modal-footer-link:hover {
    text-decoration: underline;
}

.s2-modal-footer-close {
    margin-left: auto;
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 500;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    color: #495057;
}

.s2-modal-footer-close:hover {
    background: #f8f9fa;
}


/* ─── Баннер сценария адресов (fixed, не влияет на layout) ─────────────── */

.s2-addr-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% + 24px));
    z-index: 1000;

    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 20px;
    width: max-content;
    max-width: min(680px, calc(100vw - 32px));

    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .14), 0 2px 8px rgba(0, 0, 0, .08);
    font-size: 12px;
    line-height: 1.5;

    opacity: 0;
    transition: transform .3s cubic-bezier(.34, 1.26, .64, 1), opacity .25s ease;
    pointer-events: none;
}

.s2-addr-banner.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.s2-addr-banner--blue   { background: #1a56db; color: #fff; }
.s2-addr-banner--yellow { background: #fff8e1; color: #6d4c00; box-shadow: 0 8px 32px rgba(0,0,0,.10), 0 0 0 1px #ffe082; }
.s2-addr-banner--green  { background: #1e7e34; color: #fff; }

.s2-addr-banner__icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    opacity: .9;
}

.s2-addr-banner__icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.s2-addr-banner__body {
    flex: 1;
    min-width: 0;
}

.s2-addr-banner__title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 3px;
}

.s2-addr-banner__text {
    opacity: .88;
    font-size: 12px;
}


/* ─── Переключатель источника адреса ────────────────────────────────────── */

.s2-src-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.s2-src-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 12px;
    cursor: pointer;
    border: 2px solid #ddd;
    text-align: center;
    transition: border-color .15s;
    user-select: none;
}

.s2-src-card:hover {
    border-color: #a8c4fd;
}

.s2-src-card--active {
    border-color: #0d6efd;
}

.s2-src-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    transition: background .15s;
}

.s2-src-card--active .s2-src-icon-wrap {
    background: #e8f0fe;
}

.s2-src-icon-wrap svg {
    width: 18px;
    height: 18px;
    stroke: #6c757d;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.s2-src-card--active .s2-src-icon-wrap svg {
    stroke: #0d6efd;
}

.s2-src-title {
    font-size: 12px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 2px;
}

.s2-src-sub {
    font-size: 11px;
    color: #6c757d;
}
