.mmap-page-header {
    border-bottom: 1px solid #dee2e6;
}

.app-content-header.mmap-page-header h1.mmap-page-title {
    font-size: calc(1.35rem * 0.8);
    font-weight: 600;
}

.mmap-article-constructor-head {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mmap-article-constructor-meta {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.3;
    opacity: 0.85;
}

.mmap-article-constructor-meta-label {
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.65rem;
    opacity: 0.7;
}

.mmap-article-constructor-meta-sep {
    margin: 0 0.2rem;
    opacity: 0.5;
}

.mmap-article-constructor-meta-value {
    font-variant-numeric: tabular-nums;
}

.mmap-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
}

.mmap-toolbar-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid #dee2e6;
}

.mmap-toolbar .mmap-status {
    flex: 0 0 auto;
}

.mmap-toolbar-icon-btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Высота «хрома» страницы (navbar + content-header + footer + отступы) — полоса прокрутки у нижнего края окна */
.mmap-content-section {
    --mmap-chrome-height: 13.5rem;
    padding-bottom: 0;
}

.mmap-content-inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mmap-viewport {
    flex: 1 1 auto;
    min-height: 280px;
    height: calc(100vh - var(--mmap-chrome-height));
    height: calc(100dvh - var(--mmap-chrome-height));
    max-height: calc(100dvh - var(--mmap-chrome-height));
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: relative;
}

.mmap-map-shell {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mmap-viewport--bundle-open .mmap-map-shell,
.mmap-viewport--images-open .mmap-map-shell {
    flex: 1 1 75%;
    max-width: 75%;
}

.mmap-viewport--bundle-open.mmap-viewport--images-open .mmap-map-shell {
    flex: 1 1 50%;
    max-width: 50%;
}

.mmap-map-shell .mmap-root {
    flex: 1 1 auto;
}

.mmap-root {
    --mmap-line: #b0b0b0;
    --mmap-grid: #e6e6e6;
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem 0.5rem 0.75rem;
    background-color: #f4f4f5;
    background-image:
        linear-gradient(var(--mmap-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--mmap-grid) 1px, transparent 1px);
    background-size: 20px 20px;
    border-radius: 6px;
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 1;
    transition: opacity 0.14s ease;
}

.mmap-root.mmap-root--switching {
    opacity: 0;
}

.mmap-root.is-panning {
    cursor: grabbing;
    user-select: none;
}

.mmap-scroll {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 0.5rem 0.75rem 1rem;
    width: max-content;
}

.mmap-category {
    flex: 0 0 auto;
    border: 2px dashed #c8c8c8;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.35);
    padding: 1rem 1.1rem;
}

.mmap-category-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
}

.mmap-parent-slot {
    display: flex;
    align-items: center;
    align-self: stretch;
    flex: 0 0 auto;
}

.mmap-parent {
    flex: 0 0 auto;
    max-width: 200px;
    padding: 0.55rem 1rem;
    border: 1px solid #9a9a9a;
    border-radius: 8px;
    background: #fff;
    font-family: "Caveat", cursive;
    font-size: 1.65rem;
    line-height: 1.2;
    color: #333;
    text-align: center;
}

.mmap-root[data-mmap-mode="bundles"] .mmap-parent[role="button"],
.mmap-root[data-mmap-mode="vendors"] .mmap-parent[role="button"] {
    cursor: pointer;
}

.mmap-root[data-mmap-mode="bundles"] .mmap-parent[role="button"]:hover,
.mmap-root[data-mmap-mode="vendors"] .mmap-parent[role="button"]:hover {
    background: #f0f7ff;
    border-color: #8eb4e0;
}

.mmap-bridge {
    display: flex;
    flex-direction: row;
    align-items: center;
    align-self: center;
    flex: 0 0 auto;
    padding: 0 4px 0 2px;
}

.mmap-line-h {
    width: 14px;
    height: 2px;
    background: var(--mmap-line);
}

.mmap-hub {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--mmap-line);
    background: #fff;
    color: #777;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    user-select: none;
}

.mmap-children {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding-left: 10px;
    border-left: 2px solid var(--mmap-line);
    margin-left: -11px;
    min-height: 1px;
}

.mmap-child-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
}

.mmap-child-h {
    width: 12px;
    height: 2px;
    background: var(--mmap-line);
    flex-shrink: 0;
}

.mmap-child {
    flex: 0 1 auto;
    padding: 0.35rem 0.75rem;
    border: 1px dashed #9a9a9a;
    border-radius: 8px;
    background: #fff;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
    font-size: 0.9rem;
    color: #222;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.mmap-program-row {
    cursor: pointer;
    border-radius: 8px;
    outline: none;
}

.mmap-program-row:focus-visible .mmap-child--program {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.35);
}

.mmap-program-row:hover .mmap-child--program {
    background: #f0f7ff;
    border-color: #8eb4e0;
    box-shadow: 0 1px 3px rgba(0, 40, 100, 0.08);
}

.mmap-program-row.is-drag-source {
    opacity: 0.72;
}

.mmap-bundle-drop-target.is-drag-hover {
    background: rgba(0, 123, 255, 0.07);
    border-radius: 8px;
    outline: 1px dashed rgba(0, 123, 255, 0.45);
    outline-offset: 2px;
}

.mmap-bundle-pending-row {
    align-items: center;
}

.mmap-bundle-pending-row .mmap-child--program {
    border-style: dashed;
    border-color: #4d94ff;
    background: #f5f9ff;
}

.mmap-bundle-pending-actions {
    flex: 0 0 auto;
    margin-left: 0.35rem;
}

.mmap-bundle-pending-remove {
    color: #6c757d;
    text-decoration: none;
}

.mmap-bundle-pending-remove:hover {
    color: #c82333;
}

/* —— панель «Добавление в Bundle» (25% ширины вьюпорта) —— */
.mmap-toolbar-panel--soft-actions {
    justify-content: flex-start;
}

/* Редактор статьи (Content) в модалке mind map */
.mmap-edit-pane-content-inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
    flex: 1 1 auto;
}

.mmap-edit-content-editor-wrap {
    min-height: 280px;
    flex: 1 1 auto;
    min-width: 0;
}

#mmap-content-article-editor {
    min-height: 260px;
    width: 100%;
    box-sizing: border-box;
}

.mmap-edit-pane-content .tox-tinymce {
    border-radius: 6px;
}

.mmap-bundle-panel {
    flex: 0 0 25%;
    max-width: 25%;
    min-width: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #dee2e6;
    box-shadow: -4px 0 18px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

.mmap-bundle-panel[hidden] {
    display: none !important;
}

.mmap-bundle-panel-inner {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-height: 0;
    height: 100%;
    padding: 0.65rem 0.75rem 0.75rem;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
}

.mmap-bundle-panel-head {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.mmap-bundle-panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.25;
}

.mmap-bundle-panel-close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #555;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mmap-bundle-panel-close:hover {
    background: #f0f0f0;
    color: #111;
}

.mmap-bundle-panel-search {
    position: relative;
}

.mmap-bundle-search-results {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    max-height: 11rem;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafafa;
    z-index: 4;
}

.mmap-bundle-search-results li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #eee;
}

.mmap-bundle-search-results li:last-child {
    border-bottom: none;
}

.mmap-bundle-search-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.6rem;
    border: none;
    background: #fff;
    font-size: 0.9rem;
    color: #1a5fbf;
    cursor: pointer;
}

.mmap-bundle-search-item:hover {
    background: #e8f0fe;
}

.mmap-bundle-search-empty {
    padding: 0.55rem 0.6rem;
    font-size: 0.85rem;
    color: #777;
}

.mmap-bundle-panel-hint {
    margin: 0;
}

.mmap-bundle-panel-stage {
    flex: 0 0 auto;
}

.mmap-bundle-panel-map.mmap-root {
    flex: 1 1 auto;
    min-height: 140px;
    max-height: none;
    padding: 0.5rem;
    border-radius: 8px;
}

/* Пустой список программ у bundle: оставляем заметную колонку под drop и pending-строки */
.mmap-bundle-panel-map .mmap-children {
    min-height: 2.75rem;
}

.mmap-bundle-panel-foot {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.25rem;
    border-top: 1px solid #eee;
}

.mmap-bundle-panel-loading {
    padding: 0.5rem 0;
}

.mmap-child-edition {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.15rem;
}

.mmap-add-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-top: 0.15rem;
}

.mmap-add-h {
    width: 12px;
    height: 2px;
    background: var(--mmap-line);
    flex-shrink: 0;
}

.mmap-add {
    border: none;
    background: transparent;
    padding: 0.25rem 0.35rem;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
    font-size: 0.85rem;
    color: #007bff;
    cursor: pointer;
    text-align: left;
}

.mmap-add:hover {
    text-decoration: underline;
    color: #0056b3;
}

.mmap-empty-hint {
    padding: 2rem;
    text-align: center;
    color: #888;
    font-size: 0.95rem;
}

.mmap-error {
    color: #c82333;
    padding: 1rem;
}

/* —— модальное окно добавления программы —— */
.mmap-add-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.45);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s;
}

.mmap-add-modal-overlay.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.mmap-add-modal-dialog {
    position: relative;
    box-sizing: border-box;
    width: 75vw;
    height: 75vh;
    max-width: 100%;
    max-height: 100%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem 1rem;
    overflow: hidden;
}

.mmap-add-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.55rem;
    z-index: 1;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #555;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mmap-add-modal-close:hover {
    background: #f0f0f0;
    color: #111;
}

.mmap-add-modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 2.5rem 0 0;
    padding-right: 0.5rem;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
}

.mmap-add-modal-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
    min-height: 0;
    margin-top: 0.65rem;
}

.mmap-add-modal-col {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-height: 0;
}

.mmap-add-modal-col--form {
    padding-right: 0.25rem;
    container-type: inline-size;
    container-name: mmap-add-form;
}

.mmap-add-form-row {
    display: grid;
    gap: 0.55rem;
    width: 100%;
}

.mmap-add-form-row .mmap-add-field {
    min-width: 0;
}

/* Издание + версии: один ряд при достаточной ширине колонки формы */
.mmap-add-form-row--versions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Лицензия + язык */
.mmap-add-form-row--license {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@container mmap-add-form (max-width: 22rem) {
    .mmap-add-form-row--versions {
        grid-template-columns: 1fr;
    }
}

@container mmap-add-form (max-width: 15rem) {
    .mmap-add-form-row--license {
        grid-template-columns: 1fr;
    }
}

/* Fallback без container queries */
@supports not (container-type: inline-size) {
    @media (max-width: 600px) {
        .mmap-add-form-row--versions {
            grid-template-columns: 1fr;
        }

        .mmap-add-form-row--license {
            grid-template-columns: 1fr;
        }
    }
}

.mmap-add-modal-col--vendors {
    padding-left: 0.25rem;
    border-left: 1px solid #e3e3e3;
}

.mmap-add-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mmap-add-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #444;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
}

.mmap-add-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.55rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
}

select.mmap-add-select {
    min-height: 2.15rem;
    background-color: #fff;
    cursor: pointer;
}

.mmap-add-input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.12rem rgba(220, 53, 69, 0.15);
}

.mmap-add-field-error {
    min-height: 1rem;
    font-size: 0.75rem;
    line-height: 1.1;
    color: #c82333;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
}

.mmap-add-selected-vendor {
    min-height: 0;
}

.mmap-add-selected-vendor.has-vendor {
    margin-bottom: 0.15rem;
}

.mmap-add-vendor-chip {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.5rem 0.35rem 0.65rem;
    border: 1px solid #9a9a9a;
    border-radius: 8px;
    background: #f8f9fa;
    font-size: 0.9rem;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
}

.mmap-add-vendor-chip-name {
    color: #222;
}

.mmap-add-vendor-chip-remove {
    border: none;
    background: transparent;
    color: #888;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
    border-radius: 4px;
}

.mmap-add-vendor-chip-remove:hover {
    color: #c82333;
    background: #fde8e8;
}

.mmap-add-modal-actions {
    margin-top: auto;
    padding-top: 0.75rem;
}

.mmap-add-vendor-list {
    flex: 1 1 auto;
    min-height: 120px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafafa;
    padding: 0.35rem;
}

.mmap-add-vendor-loader {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem;
    color: #4b5563;
    font-size: 0.9rem;
}

.mmap-add-vendor-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #d1d5db;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: mmap-vendor-spin 0.75s linear infinite;
}

@keyframes mmap-vendor-spin {
    to {
        transform: rotate(360deg);
    }
}

.mmap-add-vendor-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.55rem;
}

.mmap-add-vendor-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.45rem;
}

.mmap-add-vendor-section-letter {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
}

.mmap-add-vendor-section-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mmap-add-vendor-empty {
    padding: 0.75rem;
    font-size: 0.85rem;
    color: #777;
    text-align: center;
}

.mmap-add-vendor-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.55rem;
    margin-bottom: 0.2rem;
    border: none;
    border-radius: 6px;
    background: #fff;
    font-size: 1.01rem;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
    color: #1a5fbf;
    cursor: pointer;
}

.mmap-add-vendor-item:hover {
    background: #e8f0fe;
}

@media (max-width: 767px) {
    .mmap-add-vendor-sections {
        grid-template-columns: 1fr;
    }
}

.mmap-add-feedback {
    margin: 0.5rem 0 0;
    min-height: 1.25rem;
    font-size: 0.85rem;
    color: #c82333;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
}

/* Панель тулбара Vendors Catalog — одна кнопка слева */
.mmap-toolbar-panel--vendors {
    justify-content: flex-start;
}

/* Модалка «Новый вендор» (компактная, по центру) */
.mmap-vendor-add-overlay {
    position: fixed;
    inset: 0;
    z-index: 2002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.45);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s;
}

.mmap-vendor-add-overlay.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.mmap-vendor-add-dialog {
    box-sizing: border-box;
    width: 100%;
    max-width: 22rem;
    margin: 0;
    padding: 1.1rem 1.15rem 1rem;
    border-radius: 0.35rem;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
}

.mmap-vendor-add-title {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #212529;
}

.mmap-vendor-add-field {
    display: block;
}

.mmap-vendor-add-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #495057;
}

.mmap-vendor-add-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.55rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font-size: 0.95rem;
}

.mmap-vendor-add-input.is-invalid {
    border-color: #dc3545;
}

.mmap-vendor-add-field-error {
    display: block;
    margin-top: 0.25rem;
    min-height: 1rem;
    font-size: 0.82rem;
    color: #c82333;
}

.mmap-vendor-add-feedback {
    margin: 0.45rem 0 0;
    min-height: 1.1rem;
    font-size: 0.82rem;
    color: #c82333;
}

.mmap-vendor-add-actions {
    margin-top: 0.85rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.mmap-tag-modal-actions {
    justify-content: space-between;
}

/* Модалка «Новый bundle» (компактная, по центру) */
.mmap-bundle-add-overlay {
    position: fixed;
    inset: 0;
    z-index: 2002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.45);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s;
}

.mmap-bundle-add-overlay.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.mmap-bundle-add-dialog {
    box-sizing: border-box;
    width: 100%;
    max-width: 24rem;
    margin: 0;
    padding: 1.1rem 1.15rem 1rem;
    border-radius: 0.35rem;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
}

.mmap-bundle-add-title {
    margin: 0 0 0.85rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #212529;
}

.mmap-bundle-add-field {
    display: block;
}

.mmap-bundle-add-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #495057;
}

.mmap-bundle-add-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.4rem 0.55rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font-size: 0.95rem;
}

.mmap-bundle-add-input.is-invalid {
    border-color: #dc3545;
}

.mmap-bundle-add-field-error {
    display: block;
    margin-top: 0.25rem;
    min-height: 1rem;
    font-size: 0.82rem;
    color: #c82333;
}

.mmap-bundle-add-feedback {
    margin: 0.45rem 0 0;
    min-height: 1.1rem;
    font-size: 0.82rem;
    color: #c82333;
}

.mmap-bundle-add-actions {
    margin-top: 0.85rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* —— модальное окно редактирования программы (AdminLTE / Bootstrap 4) —— */
.mmap-edit-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.45);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s;
}

.mmap-edit-modal-overlay.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.mmap-edit-modal-dialog {
    position: relative;
    box-sizing: border-box;
    width: 75vw;
    height: 75vh;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 0.25rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}

.mmap-edit-modal-close {
    position: absolute;
    top: 0.35rem;
    right: 0.4rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 0.25rem;
    background: transparent;
    color: #6c757d;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mmap-edit-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #343a40;
}

.mmap-edit-modal-head {
    flex: 0 0 auto;
    padding-top: 0.85rem;
    padding-bottom: 0.65rem;
    padding-right: 2.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mmap-edit-modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: #212529;
    font-family: "Source Sans Pro", "Source Sans 3", sans-serif;
}

.mmap-edit-modal-subtitle {
    font-family: "Source Sans Pro", "Source Sans 3", sans-serif;
}

.mmap-edit-modal-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    overflow: hidden;
    position: relative;
}

.mmap-edit-modal-body--has-loader .mmap-edit-modal-body-inner {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.mmap-edit-modal-body-inner.mmap-edit-modal-body-inner--visible {
    opacity: 1;
}

/* Прелоадер (AdminLTE-style card + spinner) */
.mmap-edit-modal-loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(248, 249, 250, 0.92);
    backdrop-filter: blur(2px);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mmap-edit-modal-loading.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mmap-edit-modal-loading-card {
    max-width: 280px;
    width: 100%;
}

.mmap-edit-modal-loading-icon {
    line-height: 1;
}

/* Вкладки и панели — 50% ширины диалога, по центру (≈25% полей слева и справа) */
.mmap-edit-modal-body-inner > .mmap-edit-nav-tabs,
.mmap-edit-modal-body-inner > .mmap-edit-tab-content {
    width: 50%;
    max-width: 100%;
    box-sizing: border-box;
}

.mmap-edit-modal-body-inner > .mmap-edit-nav-tabs {
    flex-shrink: 0;
}

.mmap-edit-nav-tabs {
    flex: 0 0 auto;
    margin-bottom: 0;
    border-bottom: 1px solid #dee2e6;
}

.mmap-edit-nav-tabs .nav-item {
    margin-bottom: -1px;
}

.mmap-edit-nav-tabs .nav-link {
    border: 1px solid transparent;
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
    color: #495057;
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    font-family: "Source Sans Pro", "Source Sans 3", sans-serif;
}

.mmap-edit-nav-tabs .nav-link:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    color: #007bff;
}

.mmap-edit-nav-tabs .nav-link.active {
    color: #495057;
    background-color: #f8f9fa;
    border-color: #dee2e6 #dee2e6 #f8f9fa;
}

.mmap-edit-tab-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* TinyMCE: меню File / Edit и всплывающие панели поверх mmap-модалки (.mmap-edit-modal-overlay { z-index: 2001 }) */
body .tox-silver-sink,
body .tox-tinymce-aux,
body .tox-menu,
body .tox-dialog-wrap,
body .tox-collection,
body .tox-pop {
    z-index: 2100 !important;
}

/*
 * Режим Content + TinyMCE: класс вешается с JS (см. editProgramModal.js),
 * чтобы не клипать выпадающие меню File / Edit у overflow на диалоге.
 */
.mmap-edit-modal-overlay.mmap-edit-modal-overlay--content-editor .mmap-edit-modal-dialog,
.mmap-edit-modal-overlay.mmap-edit-modal-overlay--content-editor .mmap-edit-modal-body,
.mmap-edit-modal-overlay.mmap-edit-modal-overlay--content-editor .mmap-edit-modal-body-inner,
.mmap-edit-modal-overlay.mmap-edit-modal-overlay--content-editor .mmap-edit-tab-content {
    overflow: visible;
}

@media (max-width: 576px) {
    .mmap-edit-modal-body-inner > .mmap-edit-nav-tabs,
    .mmap-edit-modal-body-inner > .mmap-edit-tab-content {
        width: 100%;
    }
}

.mmap-edit-tab-content .tab-pane[hidden] {
    display: none !important;
}

/* —— Soft Catalog: настройки, секция «Статус страницы» —— */
.mmap-soft-settings-section {
    padding-bottom: 1.25rem;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.mmap-soft-settings-section-title {
    letter-spacing: 0.04em;
    font-size: 0.72rem;
}

.mmap-soft-settings-status-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 2rem;
    align-items: center;
    min-height: 5.5rem;
}

@media (max-width: 767.98px) {
    .mmap-soft-settings-status-layout {
        grid-template-columns: 1fr;
        row-gap: 1.25rem;
        min-height: 0;
    }
}

.mmap-soft-settings-status-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mmap-soft-settings-status-col--current {
    padding-right: 1rem;
}

.mmap-soft-settings-status-col--actions {
    border-left: 1px solid rgba(0, 0, 0, 0.12);
    padding-left: 2rem;
}

@media (max-width: 767.98px) {
    .mmap-soft-settings-status-col--current {
        padding-right: 0;
    }

    .mmap-soft-settings-status-col--actions {
        border-left: none;
        border-top: 1px solid rgba(0, 0, 0, 0.12);
        padding-left: 0;
        padding-top: 1.25rem;
    }
}

.mmap-soft-settings-status-label {
    font-weight: 600;
    width: 100%;
}

.mmap-soft-settings-status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 14rem;
    min-height: 4rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.3rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: "Source Sans Pro", "Source Sans 3", sans-serif;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
    background: #e9ecef;
    color: #495057;
}

.mmap-soft-settings-status-badge--template {
    background: #ffc107;
    color: #212529;
}

.mmap-soft-settings-status-badge--hide {
    background: #c82333;
    color: #fff;
}

.mmap-soft-settings-status-badge--online {
    background: #1e7e34;
    color: #fff;
}

/* Main tab: ID badges (readable on white card after AdminLTE 4 / BS5 migration) */
#mmap-main-soft-id-badge,
#mmap-main-content-id-badge {
    color: #212529;
    background-color: #f8f9fa;
    border-color: #dee2e6 !important;
}

#mmap-main-page-url-copy {
    flex-shrink: 0;
    line-height: 1;
}

.mmap-soft-settings-status-col--actions [data-role='page-status-hint'],
.mmap-soft-settings-status-col--actions [data-role='page-status-feedback'] {
    align-self: stretch;
    text-align: center;
}

.mmap-soft-settings-status-actions-row {
    justify-content: center;
    width: 100%;
}

.mmap-soft-settings-status-actions-row .form-check-label {
    cursor: pointer;
}

.mmap-bundle-topic-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2003;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.45);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s;
}

.mmap-bundle-topic-modal-overlay.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.mmap-bundle-topic-modal-dialog {
    position: relative;
    box-sizing: border-box;
    width: 75vw;
    height: 75vh;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 0.25rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
}

.mmap-bundle-topic-modal-close {
    position: absolute;
    top: 0.35rem;
    right: 0.4rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 0.25rem;
    background: transparent;
    color: #6c757d;
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mmap-bundle-topic-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #343a40;
}

.mmap-bundle-topic-modal-head {
    flex: 0 0 auto;
    padding-top: 0.85rem;
    padding-bottom: 0.65rem;
    padding-right: 2.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mmap-bundle-topic-modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: #212529;
    font-family: "Source Sans Pro", "Source Sans 3", sans-serif;
}

.mmap-bundle-topic-modal-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    padding-top: 1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    overflow: hidden;
}

.mmap-bundle-topic-modal-body > .mmap-edit-nav-tabs,
.mmap-bundle-topic-modal-body > .mmap-edit-tab-content {
    width: 50%;
    max-width: 100%;
    box-sizing: border-box;
}

.mmap-bundle-topic-soft-list-body {
    min-height: 12rem;
    max-height: 44vh;
    overflow-y: auto;
}

.mmap-bundle-topic-map-root {
    padding: 0.35rem;
}

.mmap-bundle-topic-list {
    border-left: 2px solid var(--mmap-line);
    padding-left: 10px;
    margin-left: 0;
}

.mmap-bundle-topic-row {
    cursor: grab;
}

.mmap-bundle-topic-row .mmap-child--program {
    flex: 1 1 auto;
}

.mmap-bundle-topic-actions {
    flex: 0 0 auto;
    margin-left: 0.35rem;
}

.mmap-bundle-topic-remove {
    color: #6c757d;
    text-decoration: none;
}

.mmap-bundle-topic-remove:hover {
    color: #c82333;
}

.mmap-bundle-topic-soft-list-foot {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
}

/* Article builder */
.article-builder-root {
    position: relative;
    --mmap-line: #a8a8a8;
    --mmap-grid: #e2e2e2;
    background-color: #f7f7f7;
    background-image:
        linear-gradient(var(--mmap-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--mmap-grid) 1px, transparent 1px);
    background-size: 24px 24px;
}

.article-builder-tool-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.article-builder-tool-btn.is-active {
    background: #eaf2ff;
    border-color: #7fa6d6;
    color: #1f5ea8;
}

.article-builder-root.article-builder-mode-eraser,
.article-builder-root.article-builder-mode-eraser * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cg transform='rotate(-28 14 14)'%3E%3Crect x='6' y='6' width='16' height='10' rx='2' ry='2' fill='%23f4b183' stroke='%23765a3d' stroke-width='1.4'/%3E%3Crect x='6' y='16' width='16' height='5' rx='1.2' ry='1.2' fill='%23f8f8f8' stroke='%23765a3d' stroke-width='1.2'/%3E%3C/g%3E%3C/svg%3E") 6 22, cell !important;
}

.article-builder-scroll-pad {
    flex: 0 0 45vw;
    min-width: 360px;
    height: 1px;
}

.article-builder-node-root {
    min-width: 0;
    width: max-content;
    padding: 1rem 1.15rem 1.1rem;
    border-style: dashed;
    border-color: #b3b3b3;
    border-width: 2px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.24);
}

.article-builder-branch {
    display: block;
}

.article-builder-branch-group {
    padding: 0.4rem 0.5rem 0.45rem;
    border: 1px dashed #b9b9b9;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.25);
}

.article-builder-branch-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.article-builder-node-slot {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.article-builder-bridge {
    align-self: center;
}

.article-builder-children {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.58rem;
    padding-left: 10px;
    border-left: 2px solid var(--mmap-line);
    margin-left: -11px;
    min-height: 1px;
}

.article-builder-child-row {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.article-builder-child-row > .article-builder-branch {
    flex: 1 1 auto;
}

.article-builder-child-row > .mmap-child-h {
    flex-shrink: 0;
}

.article-builder-node-wrap {
    display: flex;
    flex-direction: column;
}

.article-builder-children {
    margin-top: 0;
}

.article-builder-node {
    padding: 0.42rem 0.82rem;
    border: 1px dashed #9e9e9e;
    border-radius: 9px;
    background: #fff;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
    font-size: 1.03rem;
    color: #2f2f2f;
    line-height: 1.24;
}

.article-builder-node--element {
    display: inline-flex;
    width: fit-content;
    min-width: 0;
    max-width: none;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.article-builder-node--text {
    border: none;
    background: transparent;
    padding: 0 0 0 0.1rem;
    font-weight: 400;
    min-width: 160px;
}

/* Атрибуты &lt;img&gt;: визуально как текстовый топик — имя (курсив) + редактируемое значение в одной строке */
.article-builder-node--attr-topic {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    max-width: 100%;
    cursor: default;
}

.article-builder-attr-name {
    flex: 0 0 auto;
    font-style: italic;
    font-weight: 500;
    color: #4a5568;
    user-select: none;
}

.article-builder-text-content--attr-value {
    flex: 1 1 auto;
    min-width: 8rem;
    max-width: min(100%, 42rem);
    width: auto !important;
    display: inline-block;
    vertical-align: baseline;
    user-select: text;
    -webkit-user-select: text;
    -webkit-user-drag: none;
}

.article-builder-branch--attribute .article-builder-branch-inner {
    margin-top: 0;
}

.article-builder-node.is-selected {
    box-shadow: 0 0 0 2px rgba(30, 106, 191, 0.28), 0 0 0 5px rgba(30, 106, 191, 0.12);
    border-color: #1e6abf;
    background: #eef5ff;
}

.article-builder-node--element.is-selected {
    color: #134f94;
    font-weight: 700;
}

.article-builder-node.is-drop-hover {
    background: #f8f8f8;
    border-color: #8f8f8f;
}

.article-builder-node.is-drag-source {
    opacity: 0.58;
}

.article-builder-text-content {
    display: block;
    width: 600px;
    min-width: 600px;
    max-width: 600px;
    min-height: 1.2rem;
    outline: none;
    white-space: pre-wrap;
    line-height: 1.35;
    color: #3a3a3a;
}

.article-builder-tag-article {
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
    font-weight: 700;
}

.article-builder-tag-p {
    font-weight: 400;
}

.article-builder-child-row > .mmap-child-h {
    width: 14px;
    height: 1px;
    background: #9f9f9f;
}

.article-builder-bridge .mmap-line-h {
    width: 14px;
    height: 1px;
    background: #9f9f9f;
}

.article-builder-bridge .mmap-hub {
    width: 13px;
    height: 13px;
    min-width: 13px;
    border: 1px solid #9f9f9f;
    color: #888;
    font-size: 9px;
    line-height: 9px;
    background: #fff;
}

.article-builder-add-child-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #9f9f9f;
    background: #fff;
    color: #6f6f6f;
    font-size: 13px;
    line-height: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.article-builder-add-child-btn:hover {
    background: #f0f0f0;
    color: #4a4a4a;
}

.article-builder-list-add-row {
    margin-top: 0.1rem;
}

.article-builder-child-row.is-drop-target > .mmap-child-h {
    background: #2e9f4d;
    height: 2px;
}

.article-builder-child-row.is-drop-target .article-builder-tail-drop-target {
    border-color: #2e9f4d;
    background: rgba(46, 159, 77, 0.22);
}

.article-builder-tail-drop-row {
    min-height: 24px;
}

.article-builder-tail-drop-target {
    display: inline-block;
    width: 52px;
    height: 20px;
    border: 1px dashed transparent;
    border-radius: 6px;
}

.article-builder-root-tail-drop-row {
    min-height: 30px;
}

.article-builder-root-tail-drop-target {
    width: 150px;
    height: 24px;
    border-color: #84b792;
    background: rgba(46, 159, 77, 0.08);
    color: #2f7a45;
    font-size: 11px;
    line-height: 22px;
    text-align: center;
    font-weight: 600;
}

.article-builder-root-drop-row {
    min-height: 30px;
    margin-bottom: 0.35rem;
}

.article-builder-root-drop-target {
    display: inline-block;
    width: 180px;
    height: 24px;
    border: 1px dashed #84b792;
    border-radius: 6px;
    background: rgba(46, 159, 77, 0.08);
    color: #2f7a45;
    font-size: 11px;
    line-height: 22px;
    text-align: center;
    font-weight: 600;
}

.article-builder-child-row.is-drop-target {
    min-height: 24px;
    position: relative;
}

.article-builder-child-row.is-drop-target .article-builder-branch {
    outline: 2px dashed rgba(46, 159, 77, 0.55);
    outline-offset: 2px;
    border-radius: 8px;
}

.article-builder-child-row.is-drop-before::before,
.article-builder-child-row.is-drop-after::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 3px;
    background: rgba(46, 159, 77, 0.9);
    pointer-events: none;
}

.article-builder-child-row.is-drop-before::before {
    top: -4px;
}

.article-builder-child-row.is-drop-after::after {
    bottom: -4px;
}

.article-builder-blocks-grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.article-builder-block-section {
    border: 1px solid #dddddd;
    border-radius: 8px;
    background: #fcfcfc;
    padding: 0.4rem;
}

.article-builder-block-section-title {
    margin: 0 0 0.35rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #4a4a4a;
    text-transform: uppercase;
}

.article-builder-block-section-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.article-builder-panel-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}

/* Отдельная панель картинок (второй aside): тело на всю высоту под шапкой */
.article-builder-images-panel .article-builder-images-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.article-builder-panel-tab {
    border: 1px solid #c7c7c7;
    border-radius: 6px;
    background: #fff;
    color: #3e3e3e;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.32rem 0.35rem;
    cursor: pointer;
}

.article-builder-panel-tab.is-active {
    background: #eaf2ff;
    border-color: #7fa6d6;
    color: #1f5ea8;
}

.article-builder-panel-pane {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

/* Оставшаяся высота панели — под активную вкладку (нужно для Img: блок загрузки внизу) */
.mmap-bundle-panel-inner > .article-builder-panel-pane:not([hidden]) {
    flex: 1 1 auto;
    min-height: 0;
}

.article-builder-panel-text-input {
    min-height: 420px;
    resize: vertical;
}

/* Панель картинок: секции идут колонкой; при переполнении скроллится всё тело (кнопка загрузки внизу контента) */
.article-builder-panel-pane--img {
    overflow-y: auto;
    overflow-x: hidden;
    gap: 0.7rem;
    padding-bottom: 0.5rem;
}

.article-builder-img-block {
    flex-shrink: 0;
    margin: 0;
    padding: 0.55rem 0.65rem;
    background: #f5f7fb;
    border: 1px solid #c5d3e8;
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.article-builder-img-block-title {
    margin: 0 0 0.45rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #d5e0f0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2c5282;
}

.article-builder-img-block-title--upload {
    border-bottom-color: #b8cce8;
    color: #1f5ea8;
}

.article-builder-img-block--in-article {
    flex: 0 0 auto;
    max-height: 38vh;
    overflow-y: auto;
}

.article-builder-img-block--loaded {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
}

.article-builder-img-block--loaded .article-builder-img-loaded-stack {
    flex: 0 0 auto;
    min-height: 4.5rem;
}

.article-builder-img-block--upload {
    flex: 0 0 auto;
    background: linear-gradient(180deg, #eef4fc 0%, #e2ebf8 100%);
    border-color: #7fa6d6;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 2px 6px rgba(31, 94, 168, 0.08);
}

/* Список картинок: секции «превью 50% | инфо 50%», одна под другой */
.article-builder-img-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: stretch;
}

.article-builder-img-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #9eb4d4;
    border-radius: 8px;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.article-builder-img-card-preview {
    flex: 0 0 50%;
    max-width: 50%;
    min-width: 0;
    padding: 0.45rem;
    background: #eef1f6;
    border-right: 1px solid #c5d3e8;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.article-builder-img-card-preview img {
    display: block;
    width: 100%;
    max-height: 5.5rem;
    height: auto;
    object-fit: contain;
    object-position: center;
    background: #f8f9fc;
    border-radius: 4px;
}

.article-builder-img-card-meta {
    flex: 0 0 50%;
    max-width: 50%;
    min-width: 0;
    padding: 0.45rem 0.5rem 0.5rem 0.55rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.28rem;
    background: #fafbfd;
    box-sizing: border-box;
}

.article-builder-img-meta-row {
    display: grid;
    grid-template-columns: minmax(3.6rem, 38%) 1fr;
    gap: 0.25rem 0.35rem;
    align-items: baseline;
    font-size: 0.68rem;
    line-height: 1.25;
}

.article-builder-img-meta-label {
    font-weight: 700;
    color: #4a6588;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.article-builder-img-meta-value {
    color: #2a3340;
    word-break: break-word;
}

.article-builder-img-card--selectable {
    cursor: pointer;
}

.article-builder-img-card--selectable:hover {
    border-color: #7fa6d6;
    box-shadow: 0 0 0 1px rgba(127, 166, 214, 0.35);
}

.article-builder-img-card-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    z-index: 1;
    line-height: 1;
    padding: 0 0.28rem !important;
    font-size: 0.85rem;
    border-radius: 4px;
    opacity: 0.92;
}

.article-builder-img-card-remove:hover {
    opacity: 1;
}

.article-builder-img-loaded-stack {
    position: relative;
    min-height: 4.5rem;
}

.article-builder-img-loaded-stack[aria-busy="true"] .article-builder-img-grid {
    pointer-events: none;
    opacity: 0.45;
}

.article-builder-img-loaded-preloader {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px dashed #c7d4e8;
    border-radius: 6px;
    box-sizing: border-box;
}

.article-builder-img-loaded-preloader[hidden] {
    display: none !important;
}

.article-builder-img-preloader-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1f5ea8;
}

.article-builder-img-spinner {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #d0d9e8;
    border-top-color: #1f5ea8;
    border-radius: 50%;
    animation: article-builder-img-spin 0.65s linear infinite;
}

@keyframes article-builder-img-spin {
    to {
        transform: rotate(360deg);
    }
}

.article-builder-block-tile {
    border: 1px dashed #9f9f9f;
    border-radius: 6px;
    background: #fff;
    color: #3d3d3d;
    font-weight: 600;
    padding: 0.45rem 0.5rem;
    cursor: pointer;
    text-align: center;
}

.article-builder-block-tile:hover {
    background: #f2f2f2;
}

/* Article preview modal — reading typography */
.article-preview-modal-body {
    background: #faf9f7;
    padding: 1.25rem 1.5rem;
}

.article-preview-prose {
    font-family: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
    font-size: 1.05rem;
    line-height: 1.65;
    color: #1a1a1a;
    max-width: 42rem;
    margin: 0 auto;
}

.article-preview-prose > *:first-child {
    margin-top: 0;
}

.article-preview-prose > *:last-child {
    margin-bottom: 0;
}

.article-preview-prose h1,
.article-preview-prose h2,
.article-preview-prose h3,
.article-preview-prose h4 {
    font-weight: 600;
    line-height: 1.25;
    margin: 1.35em 0 0.5em;
    color: #111;
}

.article-preview-prose h1 {
    font-size: 1.85rem;
}

.article-preview-prose h2 {
    font-size: 1.5rem;
}

.article-preview-prose h3 {
    font-size: 1.25rem;
}

.article-preview-prose h4 {
    font-size: 1.1rem;
}

.article-preview-prose p {
    margin: 0 0 0.9em;
}

.article-preview-prose ul,
.article-preview-prose ol {
    margin: 0 0 0.9em;
    padding-left: 1.35em;
}

.article-preview-prose li {
    margin: 0.25em 0;
}

.article-preview-prose blockquote {
    margin: 1em 0;
    padding: 0.5em 0 0.5em 1em;
    border-left: 4px solid #c5d4e8;
    color: #3a3a3a;
    background: rgba(255, 255, 255, 0.7);
}

.article-preview-prose a {
    color: #1a5fb4;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-preview-prose a:hover {
    color: #0d3d82;
}

.article-preview-prose img,
.article-preview-prose video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em 0;
    border-radius: 4px;
}

.article-preview-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
}

.article-preview-prose th,
.article-preview-prose td {
    border: 1px solid #ccc;
    padding: 0.45em 0.6em;
    text-align: left;
}

.article-preview-prose th {
    background: #ececec;
    font-weight: 600;
}

.article-preview-prose code {
    font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
    font-size: 0.9em;
    background: #eee;
    padding: 0.12em 0.35em;
    border-radius: 3px;
}

.article-preview-prose pre {
    background: #2d2d2d;
    color: #f0f0f0;
    padding: 0.85em 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
    font-size: 0.88em;
    line-height: 1.5;
}

.article-preview-prose pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.article-preview-prose hr {
    border: none;
    border-top: 1px solid #d0d0d0;
    margin: 1.5em 0;
}

/* Content tags modal (Soft Catalog) */
.mmap-content-tags-dialog {
    gap: 0.35rem;
}

.mmap-content-tags-body-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mmap-content-tags-loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(248, 249, 250, 0.92);
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mmap-content-tags-loading.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mmap-content-tags-loading-card {
    max-width: 280px;
    width: 100%;
}

.mmap-content-tags-loading-icon {
    width: 2.5rem;
    height: 2.5rem;
}

.mmap-content-tags-modal-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
    min-height: 0;
    margin-top: 0.35rem;
    transition: opacity 0.25s ease;
}

.mmap-content-tags-modal-body--loading {
    opacity: 0.35;
    pointer-events: none;
}

.mmap-content-tags-col {
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.mmap-content-tags-col--attached {
    padding-right: 0.65rem;
    border-right: 1px solid var(--bs-border-color, #dee2e6);
}

.mmap-content-tags-col--available {
    padding-left: 0.15rem;
}

.mmap-content-tags-col-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
    color: #343a40;
}

.mmap-content-tags-cards {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: auto;
    padding-right: 0.15rem;
}

.mmap-content-tags-card {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.mmap-content-tags-card .card-header {
    min-height: auto;
    cursor: default;
    display: flow-root;
}

.mmap-content-tags-card.collapsed-card > .card-body {
    display: none !important;
}

.mmap-content-tags-card .card-tools {
    margin-right: 0;
}

.mmap-content-tags-card .card-tools .btn-tool {
    padding: 0.2rem 0.45rem;
    font-size: 0.95rem;
}

.mmap-content-tags-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.mmap-content-tags-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-content: flex-start;
    min-height: 2.75rem;
}

.mmap-content-tags-empty {
    font-size: 0.9rem;
    padding: 0.35rem 0.15rem;
}

/* Tag chips — rectangle pills, larger type, per-section colors */
.mmap-content-tags-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
    line-height: 1.25;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.mmap-content-tags-chip--global {
    color: #084298;
    background-color: #cfe2ff;
    border-color: #9ec5fe;
}

.mmap-content-tags-chip--global:hover {
    background-color: #b6d4fe;
    border-color: #6ea8fe;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.2);
}

.mmap-content-tags-chip--chapter {
    color: #0a3622;
    background-color: #d1e7dd;
    border-color: #a3cfbb;
}

.mmap-content-tags-chip--chapter:hover {
    background-color: #badbcc;
    border-color: #75b798;
    box-shadow: 0 2px 6px rgba(25, 135, 84, 0.2);
}

.mmap-content-tags-chip--cat {
    color: #145662;
    background-color: #d8edf1;
    border-color: #8ec4ce;
}

.mmap-content-tags-chip--cat:hover {
    background-color: #c5e3ea;
    border-color: #5ba3b0;
    box-shadow: 0 2px 6px rgba(33, 127, 143, 0.22);
}

.mmap-content-tags-chip--attached {
    cursor: default;
    padding-right: 0.35rem;
    gap: 0.35rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.mmap-content-tags-chip--attached.mmap-content-tags-chip--global {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.mmap-content-tags-chip--attached.mmap-content-tags-chip--chapter {
    background-color: #198754;
    border-color: #198754;
    color: #fff;
}

.mmap-content-tags-chip--attached.mmap-content-tags-chip--cat {
    background-color: #217f8f;
    border-color: #217f8f;
    color: #fff;
}

.mmap-content-tags-chip-label {
    padding: 0 0.15rem;
}

.mmap-content-tags-remove {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.15);
    color: inherit;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mmap-content-tags-remove:hover {
    background: rgba(0, 0, 0, 0.28);
}

