/* synthesis.css */

.service-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 1.5rem 6rem;
    min-height: 85vh;
}

.page-title {
    text-align: center;
}

/* --- КРУПНЫЕ КАРТОЧКИ УСЛОВИЙ --- */
.benefits-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem;
    margin-top: 2.5rem; /* Отступ от кнопки сверху */
    margin-bottom: 2rem;
}
.info-card {
    padding: 2.5rem 3rem; border-radius: 0.5rem 3rem 3rem 0.5rem;
    display: flex; flex-direction: column;
}
.info-card.dark-card {
    background: var(--brand-dark); color: var(--white);
}
.info-card.magenta-card {
    background: var(--white); color: var(--brand-dark);
    border: 2px solid var(--magenta); box-shadow: var(--shadow-md);
}

.card-head h2 {
    font-size: 1.4rem; margin-top: 0; margin-bottom: 1.5rem;
    display: flex; align-items: center; justify-content: space-between; font-weight: 800;
}
.price-table { width: 100%; border-collapse: collapse; font-size: 1.05rem; margin-top: auto; }
.price-table td { padding: 0.8rem 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.magenta-card .price-table td { border-bottom-color: var(--white); }
.price-table td:last-child { text-align: right; font-weight: 700; }

/* --- ЯВНОЕ ПРЕДУПРЕЖДЕНИЕ --- */
.bsai-warning {
    text-align: center; background: var(--white); color: var(--color-error);
    padding: 1.2rem; border-radius: 8px; margin-bottom: 3rem;
    border: 1px solid var(--magenta-light-border); font-size: 1.3rem; line-height: 1.5;
}

.order-box .bsai-warning {
    margin: 0 0 1rem;
}

@media (max-width: 640px) {
    body.modules-page.modules-synthesis .order-box .bsai-warning {
        grid-template-columns: minmax(0, 1fr);
        gap: .35rem;
    }
}

/* ИНФО-ОБЛАКА (TOOLTIPS) */
.info-trigger { position: relative; display: inline-flex; cursor: help; margin-left: 10px; }
.info-trigger { width: 22px; height: 22px; background: var(--magenta); color: var(--white); border-radius: 50%; font-size: 13px; font-weight: bold; align-items: center; justify-content: center; }
.info-cloud { visibility: hidden; opacity: 0; position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%); width: 280px; background: var(--white); color: var(--brand-dark); padding: 1.2rem; border-radius: 6px; box-shadow: var(--shadow-sm); border: 1px solid var(--white); z-index: 100; transition: 0.2s; font-size: 0.9rem; font-weight: 400; line-height: 1.5; text-transform: none; text-align: left; }
.info-trigger:hover .info-cloud { visibility: visible; opacity: 1; bottom: 130%; }

/* ГЛАВНЫЙ БОКС ЗАКАЗА */
.order-box { background: var(--white); padding: 3rem 3.5rem; border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--white); }
.mode-tabs { display: flex; gap: 1rem; margin-bottom: 2rem; justify-content: center; }
.tab-item { padding: 1rem 2.5rem; border: none; background: var(--white); color: var(--text-main); font-weight: 800; font-size: 0.9rem; cursor: pointer; border-radius: 3rem; transition: 0.3s; text-transform: uppercase; }
.tab-item.active { background: var(--brand-dark); color: var(--white); }

.mode-pane { display: none; animation: fadeIn 0.4s ease; }
.mode-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* НОВАЯ ШИРОКАЯ СЕТКА ВВОДА */
.manual-layout-wide { display: flex; flex-direction: column; gap: 1.5rem; }
.editor-section { width: 100%; }

.modern-input { width: 100%; padding: 1rem 0; border: 1px var(--brand-dark); border-bottom: 2px dashed var(--brand-dark); font-size: 1.2rem; outline: none; margin-bottom: 1.5rem; color: var(--brand-dark); font-weight: 600; background: transparent; }
.modern-input:focus { border-bottom-color: var(--magenta); }

.synthesis-name-field { display: grid; gap: 10px; min-width: 0; }
.synthesis-name-field label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; color: var(--brand-dark); font-size: 1.2rem; font-weight: 700; }
.synthesis-name-field label span { color: #9d245d; font-size: 1rem; font-weight: 600; }
.synthesis-name-field .modern-input { box-sizing: border-box; min-width: 0; min-height: 54px; margin: 0; padding: 14px 16px; border: 2px solid #c55b8c; border-radius: 8px; background: #fff8fb; }
.synthesis-name-field .modern-input::placeholder { color: #74616b; opacity: 1; }
.synthesis-name-field .modern-input:not(:placeholder-shown) { background: #fff; }
.synthesis-name-field .modern-input:focus { border-color: var(--magenta); outline: 3px solid rgba(232, 62, 140, 0.18); outline-offset: 2px; background: #fff; }

.synthesis-import-result { margin-top: 24px; padding: 16px; border: 1px solid #b9d8c6; border-radius: 8px; background: #f3faf6; color: var(--brand-dark); font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.synthesis-import-result.has-errors { border-color: #dcb979; background: #fff9ef; }
.synthesis-import-result ul { margin: 10px 0 0; padding-left: 22px; }

/* НАДЕЖНОЕ ПОЛЕ ВВОДА */
.modern-textarea {
    width: 100%; min-height: 220px; padding: 1.5rem;
    border: 2px solid var(--white); border-radius: 8px;
    font-size: 1.1rem; line-height: 1.6;
    background: var(--bg-light); color: #111; outline: none; resize: vertical;
}
.modern-textarea:focus { border-color: var(--brand-dark); background: var(--white); }

/* БЛОК ПРЕДПРОСМОТРА ОШИБОК */
.error-preview-box {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-top: 1.5rem;
    display: none; /* Покажется через JS */
}
/* Универсальный стиль блока сообщения (как для ошибок, так и для варнингов) */
.synthesis-status-msg {
    padding: 1.2rem 1.5rem;
    border-radius: 4px 8px 8px 4px;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

.synthesis-status-msg:last-child { margin-bottom: 0; }

/* Блок ОШИБКИ (Красный) */
.synthesis-status-msg.is-error {
    background: var(--bg-error);
    border-left: 4px solid var(--color-error);
}

/* Блок ПРЕДУПРЕЖДЕНИЯ (Янтарный/Оранжевый) */
.synthesis-status-msg.is-warning {
    background: #fff9f0; /* Светлый теплый фон */
    border-left: 4px solid #f59e0b; /* Цвет Amber 500 */
}

.msg-header {
    display: block;
    margin-bottom: 10px;
    font-weight: 800;
    font-size: 1.05rem;
}

.is-error .msg-header { color: var(--color-error); }
.is-warning .msg-header { color: #b45309; }

/* Настройка списков внутри варнингов */
.is-warning .error-list { color: #92400e; }
.is-warning .error-item::before { color: #f59e0b; }

.error-preview-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--brand-dark);
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.error-item::before {
    content: "•";
    color: var(--color-error);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

.synthesis-fix-bsai-btn {
    margin-left: 6px;
    padding: 7px 11px;
    border: 1px solid var(--color-error);
    border-radius: 6px;
    background: var(--white);
    color: var(--color-error);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.synthesis-fix-bsai-btn:hover,
.synthesis-fix-bsai-btn:focus-visible {
    background: var(--color-error);
    color: var(--white);
    outline: none;
}

.synthesis-fix-bsai-error { color: var(--color-error); font-size: 0.78rem; }

/* Стили для кнопки (показать) */
.show-error-btn {
    color: var(--magenta);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dashed;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.show-error-btn:hover {
    color: var(--brand-dark);
}

/* ПАРАМЕТРЫ СИНТЕЗА ПОД РЕДАКТОРОМ */
.options-section-row { display: flex; flex-direction: column; gap: 1.5rem; background: var(--bg-light); padding: 1.5rem 2rem; border-radius: 8px; border: 1px solid var(--white); margin-top: 1rem; }
.options-label { font-weight: 800; color: var(--brand-dark); font-size: 1rem; margin-right: 1.5rem; }
.radio-group-horizontal { display: flex; align-items: center; flex-wrap: wrap; }
.custom-radio { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--text-main); margin-right: 2rem; }

.vector-picker-horizontal { display: flex; align-items: center; padding-top: 1.5rem; border-top: 1px dashed #ddd; animation: fadeIn 0.3s ease; flex-wrap: wrap;}
.v-grid-horizontal { display: flex; gap: 1rem; flex-wrap: wrap; }
.vector-item { padding: 0.6rem 1.2rem; border: 1px solid var(--border-dark); border-radius: 6px; cursor: pointer; font-size: 0.9rem; background: var(--white); transition: 0.2s; }
.vector-item:hover { border-color: var(--magenta); }
.vector-item.selected { background: var(--brand-dark); color: var(--white); border-color: var(--brand-dark); }
.vector-item strong { margin-right: 5px; font-size: 0.95rem; }

/* ВАЛИДАЦИЯ И КНОПКА */
.validation-row { display: flex; justify-content: space-between; align-items: center; margin-top: 2.5rem; flex-wrap: wrap; gap: 1rem; }
.pill-group { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.action-group { display: flex; gap: 1.5rem; align-items: center; margin-left: auto; }

.v-pill { padding: 0.6rem 1.2rem; background: #f0f0f0; border-radius: 2rem; font-size: 0.85rem; font-weight: 800; color: var(--white); transition: 0.3s; border: 1px solid transparent; }
.v-pill.valid { background: var(--bg-success); color: var(--color-success); border-color: var(--color-success); }
.v-pill.invalid { background: var(--bg-error); color: var(--color-error); border-color: var(--color-error); }

.price-display { font-size: 1.6rem; font-weight: 900; color: var(--brand-dark); }

/* --- КНОПКИ И ПЛАШКА ВЫБРАННОГО ВЕКТОРА --- */
.action-btn.btn-outline { background: var(--white); border: 2px solid var(--brand-dark); color: var(--brand-dark); padding: 0.8rem 1.5rem; border-radius: 8px; font-weight: 800; cursor: pointer; transition: 0.2s; }
.action-btn.btn-outline:hover { background: var(--brand-dark); color: var(--white); }

.selected-vector-card { display: flex; align-items: center; justify-content: space-between; background: #fef5ff; border: 2px solid var(--magenta); padding: 1rem 1.5rem; border-radius: 8px; width: 100%; max-width: 400px; animation: fadeIn 0.3s ease; }
.svd-info strong { display: block; font-size: 1.1rem; color: var(--brand-dark); margin-bottom: 4px; }
.svd-info span { font-size: 0.85rem; color: var(--text-main); font-weight: 600; }
.action-btn.btn-text { background: transparent; border: none; color: var(--magenta); font-weight: 800; cursor: pointer; text-decoration: underline; }

/* --- МОДАЛЬНОЕ ОКНО (COMMAND PALETTE) --- */
.cf-modal-overlay { position: fixed; inset: 0; background: var(--shadow-lg); background-color: var(--overlay-bg); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.3s; }
.cf-modal-overlay.active { opacity: 1; visibility: visible; }
.cf-modal-content { background: var(--white); width: 100%; max-width: 600px; border-radius: 16px; box-shadow: var(--shadow-lg); transform: translateY(20px); transition: 0.3s; overflow: hidden; display: flex; flex-direction: column; max-height: 85vh; }
.cf-modal-overlay.active .cf-modal-content { transform: translateY(0); }

.cf-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 2rem; border-bottom: 1px solid var(--white); background: #f9fbfd; }
.cf-modal-header h3 { margin: 0; font-size: 1.3rem; }
.close-modal-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); transition: 0.2s; }
.close-modal-btn:hover { color: var(--color-error); transform: scale(1.1); }

.cf-modal-body { padding: 2rem; overflow-y: auto; }
body.modules-page.modules-synthesis #vector-modal .cf-modal-content { width: min(calc(100vw - 3rem), 60rem); max-width: 60rem; }
body.modules-page.modules-synthesis #vector-modal #cmd-vector-list { max-height: 52vh !important; border-radius: 0 !important; }
.cf-modal-body .modern-input { margin-bottom: 1.5rem; padding: 1rem 1.5rem; border: 2px solid var(--bg-light); border-radius: 8px; }
.cf-modal-body .modern-input:focus { border-color: var(--magenta); }

/* --- ФИЛЬТРЫ --- */
.filter-groups { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.f-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.f-label { font-size: 0.85rem; font-weight: 800; color: var(--white); text-transform: uppercase; width: 130px; }
.f-pill { padding: 0.4rem 1rem; background: var(--white); color: var(--text-main); font-size: 0.85rem; font-weight: 700; border-radius: 2rem; cursor: pointer; transition: 0.2s; border: 2px solid transparent; }
.f-pill:hover { background: var(--light-blue-bg); }
.f-pill.active { background: var(--platinum); color: var(--magenta); border-color: var(--magenta); }

/* --- СПИСОК ВЕКТОРОВ --- */

.empty-cmd { text-align: center; padding: 2rem; color: var(--text-muted); font-style: italic; }

/* --- IN-SILICO ВИЗУАЛИЗАТОР ПЛАЗМИДЫ (ИСПРАВЛЕННЫЙ) --- */
.plasmid-viewer-box {
    margin: 2rem auto; /* Центрируем блок */
    max-width: 600px; /* Ограничиваем максимальную ширину всей плашки */
    background: var(--white); border: 2px solid var(--white); border-radius: 12px;
    padding: 2rem; box-shadow: var(--shadow-sm);
    animation: fadeIn 0.4s ease;
}

.pv-body {
    display: flex; gap: 2rem; align-items: center; justify-content: flex-start;
}

/* ЖЕСТКО ФИКСИРУЕМ РАЗМЕР SVG */
.pv-svg-container {
    width: 150px !important;
    height: 150px !important;
    flex-shrink: 0; /* Запрещаем сжиматься или растягиваться */
}

/* --- МОБИЛЬНАЯ АДАПТИВНОСТЬ (Добавь в конец файла) --- */
@media (max-width: 768px) {
    .benefits-grid { grid-template-columns: 1fr; }
    .order-box { padding: 1.5rem; }
    .mode-tabs { flex-direction: column; gap: 0.5rem; }
    .tab-item { width: 100%; text-align: center; }

    .radio-group-horizontal { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .custom-radio { margin-right: 0; }

    .validation-row { flex-direction: column; align-items: stretch; gap: 1.5rem; }
    .action-group { flex-direction: column; width: 100%; }
    .add-gene-btn { width: 100%; }

    /* Перестраиваем плазмиду на мобилках друг под друга */
    .pv-body { flex-direction: column; align-items: center; text-align: center; }
    .pv-stats { align-items: center; }
    /* Более тонкие и аккуратные кнопки на мобилках */
    .cta-order-btn,
    .add-gene-btn {
        padding: 0.8rem 1.5rem !important; /* Уменьшили толщину с 1.2rem до 0.8rem */
        font-size: 1rem !important; /* Немного уменьшили шрифт */
        line-height: 1.4 !important;
        width: 100%; /* Оставляем на всю ширину */
        box-sizing: border-box;
    }
    #pv-open-map-btn {display: none !important;}
}
/* === МОДАЛКА ВЕКТОРОВ (КРАСИВЫЕ КАРТОЧКИ) === */
.cmd-list {
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Воздух между карточками */
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px; /* Отступ для скроллбара */
}

/* Кастомный скроллбар для списка */
.cmd-list::-webkit-scrollbar { width: 6px; }
.cmd-list::-webkit-scrollbar-track { background: var(--bg-light); border-radius: 10px; }
.cmd-list::-webkit-scrollbar-thumb { background: var(--white); border-radius: 10px; }
.cmd-list::-webkit-scrollbar-thumb:hover { background: var(--white); }

/* Сама карточка вектора */
.v-list-item {
    background: var(--white);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 150ms ease-out, border-color 150ms ease-out, box-shadow 150ms ease-out, color 150ms ease-out, transform 150ms ease-out;
}
.v-list-item:hover {
    border-color: var(--magenta);
    box-shadow: var(--shadow-magenta-glow);
    transform: translateY(-2px);
}

/* Внутренности карточки */
.v-list-info {
    flex: 1;
    padding-right: 15px;
}
.v-list-name {
    font-weight: 800;
    color: var(--brand-dark);
    font-size: 1.1rem;
    word-break: break-word; /* Защита от горизонтального скролла */
}
.v-list-meta {
    font-size: 0.85rem;
    color: var(--text-main);
    margin-top: 6px;
}
.v-list-tag {
    flex-shrink: 0;
    background: var(--magenta-light-bg);
    border: 1px solid var(--magenta-light-border);
    color: var(--magenta);
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    text-align: center;
    min-width: 70px;
}

/* --- Стили выбора вектора --- */
.tabs-container {
    display: flex;
    /* justify-content: flex-start гарантирует, что все таблетки прижаты влево */
    justify-content: flex-start;
    /* Фиксированное одинаковое расстояние между всеми элементами */
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--light-blue-bg);
    overflow-x: auto;
    scrollbar-width: none;
}

/* Находим кнопку "Другие" и убираем автоматический отступ, если он там был */
#toggle-tabs-dropdown {
    margin-left: 0 !important;
}
.tabs-container::-webkit-scrollbar {
    display: none; /* Скрывает скроллбар в Chrome/Safari */
}

.v-tab {
    flex: 0 0 auto;
    padding: 5px 12px; /* Уменьшили внутренние отступы */
    border-radius: 16px;
    border: 1px solid var(--border-light-blue);
    background: var(--bg-light);
    color: var(--text-main);
    font-size: 0.78rem; /* Уменьшили шрифт для эстетики */
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}

.v-tab.active {
    background: var(--magenta);
    color: var(--white);
    border-color: var(--magenta);
}
/* 3. ФИКСИРОВАННЫЙ СПИСОК ВЕКТОРОВ */
#cmd-vector-list {
    height: 380px; /* Жесткая высота под ~4 вектора */
    overflow-y: auto;
    padding: 10px 5px 10px 0;
    display: flex;
    flex-direction: column;
    /* Убираем прыжки при появлении скролла */
    scrollbar-gutter: stable;
}
/* Стильный скроллбар для списка, чтобы не был дефолтно-серым */
#cmd-vector-list::-webkit-scrollbar {
    width: 6px;
}
#cmd-vector-list::-webkit-scrollbar-thumb {
    background: var(--light-blue-bg);
    border-radius: 10px;
}
#cmd-vector-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-light-blue);
}
/* --- Стили модалки карты --- */
.map-footer-label {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 50%; /* Центровка под круговой плазмидой */
    text-align: center;
    pointer-events: none;
    z-index: 999;
}

.map-footer-title {
    font-weight: 700;
    color: var(--brand-dark);
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: 2px;
}

.map-footer-meta {
    font-size: 0.85rem;
    color: #64748b;
}

/* css/synthesis.css */

/* Обертка для позиционирования выпадающего списка */
.vector-tabs-wrapper {
    position: relative;
    width: 100%;
}

/* Контейнер выпадающего списка */
.tabs-dropdown {
    display: none; /* Скрыт по умолчанию */
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--light-blue-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 240px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
}

/* Класс-триггер для показа списка */
.tabs-dropdown.active {
    display: block;
}

/* Кнопки внутри выпадающего списка */
.dropdown-tab-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    color: var(--brand-dark);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-tab-btn:hover {
    background: var(--bg-light);
}

.dropdown-tab-btn.active {
    color: var(--magenta);
    font-weight: 700;
    background: var(--magenta-light-bg);
}

.dropdown-tab-btn span {
    opacity: 0.5;
    font-size: 0.8em;
}
.service-description {
    text-align: center;
    max-width: 880px;
    /* Отрицательный верхний отступ компенсирует нижний margin у .page-title, чтобы текст был ближе к заголовку */
    margin: -0.5rem auto 0.5rem auto;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

/* --- МОБИЛЬНАЯ ОПТИМИЗАЦИЯ (до 768px) --- */
@media (max-width: 768px) {
    /* Модалка на весь экран */
    .cf-modal-content {
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        border-radius: 0 !important;
    }
    .service-description {
        font-size: 0.95rem;
        padding: 0 1rem;
        margin-bottom: 1rem;
    }
    /* На мобильных SeqViz часто перестраивается, подпись лучше поднять выше */
    .map-footer-label {
        width: 100%; /* На мобилках карта часто занимает всю ширину */
        bottom: 80px; /* Выше, чтобы не перекрывать системные кнопки */
    }

    .v-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Увеличиваем область нажатия для ферментов */
    .fav-enzyme-pill {
        padding: 10px 18px !important;
        font-size: 1rem !important;
    }

    .cf-modal-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
}
/* Стили для кнопок-фильтров (таблеток) */
.f-pill:hover { background: var(--light-blue-bg) !important; }
.f-pill.active { background: var(--magenta) !important; color: var(--white) !important; }
/* === TOAST NOTIFICATIONS === */
.cf-toast {
    background: var(--white);
    border-left: 5px solid var(--magenta);
    box-shadow: var(--shadow-lg);
    padding: 15px 20px;
    border-radius: 8px;
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transform: translateX(120%);
    opacity: 0;
    transition: opacity 180ms ease-out, transform 180ms ease-out;
}

.cf-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.cf-toast-title {
    font-weight: 800;
    color: var(--brand-dark);
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cf-toast-body {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.4;
}

.cf-toast-close {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 1.1rem;
}
.cf-toast-close:hover { color: var(--text-main); }

.cf-toast.success { border-color: var(--color-success); }
.cf-toast.success .cf-toast-title { color: var(--color-success); }
/* =========================================
   ИНЛАЙН-КАТАЛОГ И ЮРИДИЧЕСКИЙ БЛОК ПЛАТФОРМЫ
   ========================================= */
.legal-notice-bar {
    max-width: 1240px;
    margin: 0 auto 2.5rem auto;
    background: var(--white);
    border: 1px solid var(--border-light-blue);
    border-left: 5px solid var(--magenta);
    padding: 1.2rem 2rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 15px;
}

.legal-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legal-info strong {
    font-size: 1.15rem;
    color: var(--brand-dark);
    font-weight: 800;
}

.legal-info span {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.btn-legal-download {
    background: var(--brand-dark);
    color: var(--white) !important;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
    display: inline-flex;
    align-items: center;
}

.btn-legal-download:hover {
    background: var(--magenta);
    transform: translateY(-2px);
    box-shadow: var(--shadow-magenta-glow);
}

/* Строка управления вкладками формы */
.mode-tabs-row {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2.5rem;
    min-height: 3rem;
    width: 100%;
}

.mode-tabs-row .mode-tabs {
    margin-bottom: 0 !important; /* Обнуляем старый отступ табов */
}

/* Эстетичная капсульная кнопка каталога слева */
.catalog-inline-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 !important;
    padding: 0.6rem 1.4rem !important;
    font-size: 0.8rem !important;
    border-radius: 3rem !important;
    border: 2px solid var(--brand-dark) !important;
    color: var(--brand-dark) !important;
    background: #fff !important;
    font-weight: 800 !important;
    cursor: pointer;
    transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out, transform 150ms ease-out;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.catalog-inline-btn:hover {
    background: var(--brand-dark) !important;
    color: #fff !important;
    box-shadow: var(--shadow-sm);
}

/* Мобильный адаптив для новых блоков */
@media (max-width: 768px) {
    .legal-notice-bar {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    .btn-legal-download {
        width: 100%;
        justify-content: center;
    }
    .mode-tabs-row {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    .catalog-inline-btn {
        position: static;
        transform: none;
        width: 100%;
    }
}
/* =========================================
   ЗАЩИТА ТАБЛИЦЫ КОРЗИНЫ ОТ ДЛИННЫХ НАЗВАНИЙ
   ========================================= */

/* 1. Жесткая сетка для таблицы */
#order-table {
    width: 100%;
    table-layout: fixed; /* Запрещаем браузеру растягивать колонки */
    min-width: 760px; /* На узких экранах все действия остаются доступны через скролл */
}

/* 2. Компактные служебные колонки, оставшееся место получает название */
#order-table th,
#order-table td { box-sizing: border-box; }
#order-table th:nth-child(1) { width: auto; }  /* Название */
#order-table th:nth-child(2) { width: 95px; }  /* Длина */
#order-table th:nth-child(3) { width: 145px; } /* Форма: только два коротких варианта */
#order-table th:nth-child(4) { width: 130px; } /* Статус и исправление BsaI */
#order-table th:nth-child(5) { width: 115px; } /* Цена */
#order-table th:nth-child(6) { width: 142px; } /* Просмотр, скачивание и удаление */

/* 3. Бейдж для названия (обрезает лишнее с многоточием) */
.name-badge {
    display: inline-block;
    max-width: 100%; /* Занимает всю ширину ячейки, но не больше */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--bg-light); /* Твой фирменный серый фон */
    color: var(--brand-dark);    /* Твой основной цвет текста */
    padding: 4px 10px;
    border-radius: 6px;          /* Как в векторе и кнопках */
    border: 1px solid var(--border-light-blue);
    font-weight: 700;            /* Как в твоих TildaSans/Futura */
    font-size: 0.95rem;
    vertical-align: middle;
}

/* 4. Прилипание колонки с кнопкой удаления */
#order-table td:last-child,
#order-table th:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    box-shadow: -4px 0 8px rgba(0,0,0,0.03); /* Мягкая тень, чтобы отделить от контента */
    text-align: right;
}

#order-table td:last-child { background: var(--white); }
#order-table th:last-child { background: var(--bg-light); }

.synthesis-cart-actions-cell {
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
}

.synthesis-cart-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    min-width: 0;
}

.synthesis-cart-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.synthesis-cart-action:hover,
.synthesis-cart-action:focus-visible {
    background: var(--bg-light);
    color: var(--brand-dark);
    transform: translateY(-1px);
    outline: none;
}

.synthesis-cart-action.delete-btn:hover,
.synthesis-cart-action.delete-btn:focus-visible {
    background: var(--bg-error);
    color: var(--color-error);
}

.synthesis-cart-repair {
    display: block;
    margin-top: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--magenta);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.synthesis-cart-repair:hover,
.synthesis-cart-repair:focus-visible { text-decoration: underline; outline: none; }

.synthesis-format-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

/* Complete editorial pass for synthesis information and ordering UI. */
.synthesis-page .order-box-heading,
.editorial-only-icon { display: none; }
/* Separate major sections and keep the three input choices on one row when they fit. */
body.modules-page.modules-system.modules-synthesis .service-page{display:grid;gap:clamp(1.25rem,2.2vw,2rem)}
body.modules-page.modules-system.modules-synthesis .service-page>*{border-radius:8px}
body.modules-page.modules-system.modules-synthesis .service-page>:first-child{border-radius:8px}
body.modules-page.modules-system.modules-synthesis .service-page>*+*{border-top:1px solid var(--modules-line-strong)}
body.modules-page.modules-system.modules-synthesis .legal-notice-bar{margin:0!important;border-top:1px solid var(--modules-line-strong)!important;border-radius:8px!important}
body.modules-page.modules-system.modules-synthesis .order-box{border-radius:8px}
@media (min-width:600px) and (max-width:1100px){
body.modules-page.modules-system.modules-synthesis .mode-tabs-row{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:.5rem!important;align-items:stretch}
body.modules-page.modules-system.modules-synthesis .mode-tabs-row .catalog-inline-btn{position:static!important;grid-column:auto;width:100%;min-width:0;min-height:48px;transform:none!important}
body.modules-page.modules-system.modules-synthesis .mode-tabs-row .mode-tabs{display:contents}
body.modules-page.modules-system.modules-synthesis .mode-tabs-row .tab-item{width:100%;min-width:0;white-space:normal}
}
