/* ============================================ */
/* ОБЩАЯ ОБЁРТКА РЕДАКТОРА */
/* ============================================ */
/* Placeholder в пустом редакторе */
.ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    color: #b2bec3;
    pointer-events: none;
    height: 0;
}

.tiptap-wrapper {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: visible;
    /* overflow: hidden; */
    box-sizing: border-box;
}

/* ============================================ */
/* ПАНЕЛЬ ИНСТРУМЕНТОВ */
/* ============================================ */

.tiptap-toolbar-wrap {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.tiptap-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 12px;
    background: transparent;
}

.tiptap-toolbar button {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #2d3436;
    transition: all 0.2s;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tiptap-toolbar button:hover {
    background: #e9ecef;
}

.tiptap-toolbar-select {
    padding: 6px 8px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #fff;
    color: #2d3436;
    font-size: 13px;
    cursor: pointer;
    height: 32px;
    box-sizing: border-box;
}

.tiptap-toolbar-select:hover {
    border-color: #0984e3;
}

/* .tiptap-toolbar button.is-active {
    background: #0984e3;
    color: #ffffff;
} */

/* ============================================ */
/* LAYOUT: РЕДАКТОР + САЙДБАР */
/* ============================================ */

.tiptap-body {
    display: flex;
    align-items: flex-start;
    width: 100%;
    min-height: 500px;
    overflow: visible;
    /* 👈 добавили, если ещё нет */
}

/* Редактор занимает всё оставшееся место */
.tiptap-editor-container {
    flex: 1 1 0%;
    /* 👈 было 1 1 auto — меняем на 1 1 0% */
    width: 0;
    /* 👈 важно! ширина считается от flex-basis, а не от контента */
    min-width: 0;
    max-width: 100%;
    min-height: 500px;
    padding: 20px 24px;
    box-sizing: border-box;
    background: #ffffff;
    color: #2d3436;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow: auto;
    /* 👈 auto вместо visible — скролл внутри, а не растягивание */
}

.tiptap-editor-container .ProseMirror {
    width: 100%;
    max-width: 100%;
    min-height: 460px;
    outline: none;
    box-sizing: border-box;
    color: #2d3436;
    overflow-wrap: break-word;
    /* 👈 длинные слова переносятся */
    word-wrap: break-word;
}

.tiptap-editor-container .ProseMirror p {
    margin: 0 0 1em 0;
    color: #2d3436;
}

.tiptap-editor-container .ProseMirror h1,
.tiptap-editor-container .ProseMirror h2,
.tiptap-editor-container .ProseMirror h3 {
    color: #2d3436;
    font-weight: 700;
    margin: 1em 0 0.5em;
}

.tiptap-editor-container .ProseMirror h1 {
    font-size: 2em;
}

.tiptap-editor-container .ProseMirror h2 {
    font-size: 1.5em;
}

.tiptap-editor-container .ProseMirror h3 {
    font-size: 1.25em;
}

.tiptap-editor-container .ProseMirror ul,
.tiptap-editor-container .ProseMirror ol {
    padding-left: 1.5em;
    margin: 0 0 1em 0;
    color: #2d3436;
}

.tiptap-editor-container .ProseMirror blockquote {
    border-left: 4px solid #ccc;
    padding-left: 1em;
    margin: 1em 0;
    color: #636e72;
}

.tiptap-editor-container .ProseMirror code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
    color: #e63946;
}

.tiptap-editor-container .ProseMirror pre {
    background: #2d3436;
    color: #ffffff;
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
}

.tiptap-editor-container .ProseMirror pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.tiptap-editor-container .ProseMirror hr {
    border: none;
    border-top: 2px solid #eee;
    margin: 2em 0;
}

/* ============================================ */
/* УБИРАЕМ ОБВОДКУ ПРИ ВЫДЕЛЕНИИ КОНТЕНТА */
/* ============================================ */

.tiptap-editor-container .ProseMirror *:focus,
.tiptap-editor-container .ProseMirror *:focus-visible {
    outline: none;
}

/* Обводку оставляем только для кастомных блоков */
.tiptap-editor-container .ProseMirror .tiptap-details:focus-within {
    outline: 2px solid #0984e3;
    outline-offset: 4px;
    border-radius: 12px;
}

.tiptap-editor-container .ProseMirror img.tiptap-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 1em 0;
}

.tiptap-editor-container .ProseMirror img.tiptap-image[src=""] {
    display: none;
}

.tiptap-editor-container .ProseMirror img.tiptap-image:not([src]),
.tiptap-editor-container .ProseMirror img.tiptap-image[src=""] {
    /* placeholder */
    display: block;
    width: 100%;
    height: 120px;
    background: #f0f0f0;
    border: 2px dashed #b2bec3;
}

/* ============================================ */
/* ПРЕСЕТЫ ФОРМЫ КАРТИНОК                        */
/* ============================================ */

/* Квадрат: картинка обрезается в квадрат */
.ProseMirror img.tiptap-image[data-shape="square"] {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0;
    width: 100%;
    max-width: 100%;
}

/* Круг: картинка обрезается в круг */
.ProseMirror img.tiptap-image[data-shape="circle"] {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    width: 100%;
    max-width: 100%;
}

/* Скруглённая: большая радиусина */
.ProseMirror img.tiptap-image[data-shape="rounded"] {
    border-radius: 24px;
}

/* ============================================ */
/* САЙДБАР */
/* ============================================ */

.editor-sidebar {
    position: sticky;
    top: var(--tiptap-toolbar-height, 60px);
    /* 👈 вместо 130px */
    align-self: flex-start;
    max-height: calc(100vh - var(--tiptap-toolbar-height, 60px));
    /* 👈 чтобы не вылезал */
    overflow-y: auto;
    flex: 0 0 300px;
    width: 300px;
    min-width: 200px;
    max-width: 500px;
    background: #f8f9fa;
    border-left: 1px solid #e0e0e0;
    padding: 16px;
    box-sizing: border-box;
    resize: horizontal;
    direction: rtl;
    z-index: 20;
}

.editor-sidebar>* {
    direction: ltr;
}

.editor-sidebar>* {
    direction: ltr;
}

/* Заглушка */
.sidebar-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #b2bec3;
}

.sidebar-placeholder p {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.sidebar-placeholder .hint {
    font-size: 12px;
    color: #dfe6e9;
}

/* Панель настроек */
.sidebar-panel h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #2d3436;
    font-weight: 600;
}

.sidebar-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.sidebar-row label {
    font-size: 13px;
    color: #636e72;
}

.sidebar-row input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

.sidebar-row select {
    width: 100%;
    height: 36px;
    padding: 0 30px 0 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    line-height: 36px;
    background: #ffffff;
    color: #2d3436;
    cursor: pointer;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%232d3436' d='M6 9L1 4h10z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.sidebar-row select:hover {
    border-color: #0984e3;
}

.sidebar-row select:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.15);
}

/* Опции — важно для Firefox и Chrome на Windows */
.sidebar-row select option {
    background: #ffffff;
    color: #2d3436;
    padding: 6px 8px;
}

/* ============================================ */
/* DJANGO ADMIN — РАСТЯГИВАЕМ НА ВСЮ ШИРИНУ */
/* ============================================ */

.flex-container .tiptap-wrapper {
    flex: 1 1 100%;
    max-width: 100%;
}

/* ============================================ */
/* МОДАЛКА ВЫБОРА ИЗ МЕДИАТЕКИ */
/* ============================================ */

.media-picker-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.media-picker-modal {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.media-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.media-picker-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3436;
}

.media-picker-close {
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    color: #636e72;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

.media-picker-close:hover {
    background: #e9ecef;
}

.media-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 20px;
}

.media-picker-status {
    text-align: center;
    padding: 40px 20px;
    color: #636e72;
    font-size: 14px;
    line-height: 1.6;
}

.media-picker-error {
    color: #c0392b;
}

.media-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.media-picker-item {
    border: 2px solid transparent;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, transform 0.1s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.media-picker-item:hover {
    border-color: #0984e3;
    transform: translateY(-1px);
}

.media-picker-item img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.media-picker-item-name {
    font-size: 11px;
    color: #636e72;
    word-break: break-all;
    margin-top: 5px;
    display: block;
    line-height: 1.3;
}

/* ==================== */
/* Колонки
======================= */

/* Контейнер колонок */
.ProseMirror [data-type="column-container"] {
    display: flex;
    /* 👈 flex, а не grid */
    gap: 16px;
    padding: 8px 0;
    width: 100%;
}

/* Одна колонка */
.ProseMirror [data-type="column"] {
    position: relative;
    /* для ручки ресайза */
    flex-basis: 0;
    /* 👈 НЕ расти по контенту */
    flex-grow: 1;
    min-width: 0;
    /* 👈 разрешить сжиматься меньше контента */
    border: 1px dashed #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    min-height: 60px;
    overflow: visible;
}

.ProseMirror [data-type="column"] img.tiptap-image {
    max-width: 100%;
    height: auto;
}

/* ============================================ */
/* ВЕРТИКАЛЬНОЕ ВЫРАВНИВАНИЕ КОЛОНОК             */
/* ============================================ */

.ProseMirror [data-type="column-container"][data-valign="stretch"] {
    align-items: stretch;
}

.ProseMirror [data-type="column-container"][data-valign="start"] {
    align-items: flex-start;
}

.ProseMirror [data-type="column-container"][data-valign="center"] {
    align-items: center;
}

.ProseMirror [data-type="column-container"][data-valign="end"] {
    align-items: flex-end;
}

/* ============================================ */
/* ЗАЩИТА ОТ ВЫЛЕТА КОНТЕНТА ИЗ КОЛОНОК          */
/* ============================================ */

/* Любой медиа-контент внутри колонки не вылезает за её границы */
.ProseMirror [data-type="column"] img,
.ProseMirror [data-type="column"] video,
.ProseMirror [data-type="column"] iframe,
.ProseMirror [data-type="column"] table,
.ProseMirror [data-type="column"] .tiptap-gallery,
.ProseMirror [data-type="column"] .tiptap-youtube {
    max-width: 100%;
}

/* iframe и video — не вылезают и не растягиваются */
.ProseMirror [data-type="column"] iframe,
.ProseMirror [data-type="column"] video {
    width: 100%;
    height: auto;
}

/* Таблицы — переносим длинные слова внутри ячеек */
.ProseMirror [data-type="column"] table td,
.ProseMirror [data-type="column"] table th {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* KaTeX-формулы блоком — не вылезают */
.ProseMirror [data-type="column"] .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
}

/* Лента постов внутри колонки — уменьшаем min-ширину карточек,
   чтобы сетка адаптировалась к узкой колонке */
.ProseMirror [data-type="column"] .posts-feed-preview--bento {
    grid-template-columns: repeat(2, 1fr);
}

.ProseMirror [data-type="column"] .posts-feed-preview--bento .posts-feed-preview__card.is-large {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 120px;
}

/* Галерея внутри колонки — уменьшаем min-ширину ячеек */
.ProseMirror [data-type="column"] .tiptap-gallery__grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
}

/* Ручка для ресайза */
.ProseMirror .grid-resize-handle {
    position: absolute;
    right: -10px;
    /* чуть шире */
    top: 0;
    bottom: 0;
    width: 20px;
    /* 👈 было 4px — теперь 20px */
    cursor: col-resize;
    background: transparent;
    z-index: 100;
    /* 👈 поверх контента */
    pointer-events: auto;
}

.ProseMirror .grid-resize-handle .circle-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0984e3;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: col-resize;
}

/* ==============
Сылка 
============== */

.tiptap-editor-container .ProseMirror a {
    pointer-events: none;
    /* 👈 отключает клики по ссылке в редакторе */
    cursor: text;
    /* 👈 курсор как текст, а не как ссылка */
}

.tiptap-editor-container .ProseMirror a {
    color: #0984e3;
    text-decoration: underline;
    cursor: pointer;
}

.tiptap-editor-container .ProseMirror a:hover {
    color: #074b8a;
}


/* ============================================ */
/* ТАБЛИЦЫ В РЕДАКТОРЕ */
/* ============================================ */

.tiptap-editor-container .ProseMirror table {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    margin: 1.5em 0;
    overflow: hidden;
    background: #ffffff;
}

.tiptap-editor-container .ProseMirror table td,
.tiptap-editor-container .ProseMirror table th {
    min-width: 1em;
    border: 1px solid #d0d7de;
    padding: 8px 12px;
    vertical-align: top;
    box-sizing: border-box;
    position: relative;
    background: #ffffff;
    color: #2d3436;
}

.tiptap-editor-container .ProseMirror table th {
    font-weight: 600;
    text-align: left;
    background: #f6f8fa;
    color: #2d3436;
}

.tiptap-editor-container .ProseMirror table .selectedCell:after {
    z-index: 2;
    position: absolute;
    content: "";
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: rgba(9, 132, 227, 0.15);
    pointer-events: none;
}

.tiptap-editor-container .ProseMirror table .column-resize-handle {
    position: absolute;
    right: -2px;
    top: 0;
    bottom: -2px;
    width: 4px;
    background-color: #0984e3;
    pointer-events: none;
}

.tiptap-editor-container .ProseMirror .tableWrapper {
    overflow-x: auto;
    margin: 1.5em 0;
}

.tiptap-editor-container .ProseMirror .resize-cursor {
    cursor: ew-resize;
    cursor: col-resize;
}

/* Убираем чёрный фон у selectedCell в тёмной теме браузера */
.tiptap-editor-container .ProseMirror table p {
    margin: 0;
    color: inherit;
}


/* Полноэкранный режим для обёртки редактора */
.tiptap-fullscreen-active {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: auto;
}

.tiptap-fullscreen-active .tiptap-body {
    flex: 10;
    min-height: auto;
}

/* Опционально: скрыть всё лишнее на странице, пока активен fullscreen */
body:has(.tiptap-fullscreen-active) {
    overflow: hidden;
}


/* =============================
Значок перетаскивания блоков
============================= */

.drag-handle-icon {
    cursor: grab;
    padding: 6px 8px;
    color: #999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    user-select: none;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.drag-handle-icon:hover {
    color: #333;
    border-color: #0984e3;
    background: #f5f9ff;
}

.drag-handle-icon:active {
    cursor: grabbing;
}


/* ============================================ */
/* БЛОК: ДОКУМЕНТ */
/* ============================================ */

.custom-document {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin: 1.5em 0;
    background: #f0f8ff;
    border: 2px dashed #0984e3;
    border-radius: 12px;
    position: relative;
}

.custom-document__icon {
    font-size: 32px;
    flex-shrink: 0;
}

.custom-document__info {
    flex: 1;
    min-width: 0;
}

.custom-document__title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 4px;
    word-break: break-all;
}

.custom-document__meta {
    font-size: 12px;
    color: #636e72;
}

.custom-document::before {
    content: '📄 ДОКУМЕНТ';
    position: absolute;
    top: -10px;
    left: 12px;
    background: #0984e3;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* ============================================ */
/* МОДАЛКА ВЫБОРА ДОКУМЕНТА */
/* ============================================ */

.document-picker-modal {
    max-width: 800px;
}

.document-picker-search {
    position: relative;
    padding: 12px 20px 8px;
    border-bottom: 1px solid #e0e0e0;
}

.document-picker-search input {
    width: 100%;
    height: 38px;
    padding: 0 36px 0 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    line-height: 38px;
}

.document-picker-search input:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.15);
}

.document-picker-search-clear {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: #e0e0e0;
    color: #636e72;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-picker-search-clear:hover {
    background: #ccc;
}

.document-picker-counter {
    padding: 6px 20px;
    font-size: 12px;
    color: #b2bec3;
    border-bottom: 1px solid #f0f0f0;
}

.document-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.document-picker-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    min-height: 120px;
    justify-content: center;
}

.document-picker-tile:hover {
    border-color: #0984e3;
    background: #f5f9ff;
}

.document-picker-tile__icon {
    font-size: 36px;
    line-height: 1;
}

.document-picker-tile__name {
    font-size: 12px;
    font-weight: 500;
    color: #2d3436;
    word-break: break-all;
    line-height: 1.3;
    max-height: 3.9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.document-picker-tile__size {
    font-size: 11px;
    color: #b2bec3;
}


/* ============================================ */
/* БЛОК: ПОДПИСАННЫЙ ДОКУМЕНТ */
/* ============================================ */

.custom-signed-document {
    margin: 1em 0;
}

.custom-signed-document__container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-left: 3px solid #0073aa;
    border-radius: 6px;
    flex-wrap: nowrap;
}

.custom-signed-document__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #fff;
    border-radius: 50%;
    font-size: 15px;
    flex-shrink: 0;
}

.custom-signed-document__link {
    flex: 1;
    min-width: 0;
    color: #0073aa;
    font-weight: 500;
    word-break: break-word;
}

.custom-signed-document__download {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

.custom-signed-document__hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #b2bec3;
}


/* Разделитель групп в тулбаре */
.tiptap-toolbar-divider {
    width: 1px;
    height: 20px;
    background: #d0d7de;
    margin: 0 4px;
    align-self: center;
    flex-shrink: 0;
}

/* Иконки в кнопках */
.tiptap-toolbar button svg {
    display: block;
}

/* Выравнивание иконок и текста */
.tiptap-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


/* ============================================ */
/* БЛОК: ЛЕНТА ПОСТОВ */
/* ============================================ */

.custom-posts-feed {
    display: block;
    padding: 16px 20px;
    margin: 1.5em 0;
    background: #fff8e6;
    border: 2px dashed #e17055;
    border-radius: 12px;
    position: relative;
}

.custom-posts-feed::before {
    content: '📰 ЛЕНТА ПОСТОВ';
    position: absolute;
    top: -10px;
    left: 12px;
    background: #e17055;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.custom-posts-feed__title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 10px;
}

.custom-posts-feed__body {
    display: flex;
    align-items: center;
    gap: 16px;
}

.custom-posts-feed__icon {
    font-size: 32px;
    flex-shrink: 0;
}

.custom-posts-feed__info {
    flex: 1;
    min-width: 0;
}

.custom-posts-feed__line {
    font-size: 13px;
    color: #636e72;
    margin-bottom: 2px;
}

.custom-posts-feed__line strong {
    color: #2d3436;
}


/* ============================================ */
/* БЛОК: ЛЕНТА ПОСТОВ (превью в редакторе) */
/* ============================================ */

.custom-posts-feed {
    padding: 16px 20px;
    margin: 1.5em 0;
    background: #fff8e6;
    border: 2px dashed #e17055;
    border-radius: 12px;
    position: relative;
}

.custom-posts-feed::before {
    content: '📰 ЛЕНТА ПОСТОВ';
    position: absolute;
    top: -10px;
    left: 12px;
    background: #e17055;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.custom-posts-feed__title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 10px;
}

.custom-posts-feed__meta {
    font-size: 11px;
    color: #b2bec3;
    margin-bottom: 12px;
}

.custom-posts-feed__placeholder {
    padding: 20px;
    text-align: center;
    color: #b2bec3;
    font-size: 13px;
}

/* ---- Превью-карточки ---- */

.posts-feed-preview {
    display: grid;
    gap: 8px;
}

.posts-feed-preview__card {
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    min-height: 100px;
}

.posts-feed-preview__overlay {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
    color: #fff;
}

.posts-feed-preview__name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

/* Bento */
.posts-feed-preview--bento {
    grid-template-columns: repeat(4, 1fr);
}

.posts-feed-preview--bento .posts-feed-preview__card {
    grid-column: span 1;
    grid-row: span 1;
}

.posts-feed-preview--bento .posts-feed-preview__card.is-large {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 220px;
}

.posts-feed-preview--bento .posts-feed-preview__card.is-large .posts-feed-preview__name {
    font-size: 18px;
}

/* Bento + list */
.posts-feed-preview--bento-list {
    grid-template-columns: 2fr 1fr;
}

.posts-feed-preview--bento-list .posts-feed-preview__card.is-large {
    min-height: 260px;
}

.posts-feed-preview__side {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.posts-feed-preview__list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}

.posts-feed-preview__thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.posts-feed-preview__text {
    flex: 1;
    min-width: 0;
}

.posts-feed-preview__excerpt {
    font-size: 11px;
    color: #b2bec3;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* List */
.posts-feed-preview--list {
    grid-template-columns: 1fr;
}

/* Grid */
.posts-feed-preview--grid {
    grid-template-columns: repeat(3, 1fr);
}

.posts-feed-preview--grid .posts-feed-preview__card {
    min-height: 150px;
    flex-direction: column;
    align-items: stretch;
}

.posts-feed-preview--grid .posts-feed-preview__img {
    height: 100px;
    background-size: cover;
    background-position: center;
}

.posts-feed-preview--grid .posts-feed-preview__name {
    padding: 8px;
    color: #2d3436;
    font-size: 12px;
}


/* ============================================ */
/* БЛОК: IFRAME */
/* ============================================ */

.custom-iframe {
    margin: 1.5em 0;
    position: relative;
}

.custom-iframe::before {
    content: '⬛ IFRAME';
    position: absolute;
    top: -10px;
    left: 12px;
    background: #2d3436;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    z-index: 2;
}

.custom-iframe__frame {
    background: #f0f0f0;
    border: 2px dashed #b2bec3;
    border-radius: 8px;
    overflow: hidden;
}

.custom-iframe__placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #b2bec3;
    font-size: 13px;
    background: #f8f9fa;
    border: 2px dashed #b2bec3;
    border-radius: 8px;
}


/* ============================================ */
/* БЛОК: HTML */
/* ============================================ */

.custom-html-block {
    margin: 1.5em 0;
    position: relative;
}

.custom-html-block::before {
    content: '</> HTML';
    position: absolute;
    top: -10px;
    left: 12px;
    background: #6c5ce7;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    z-index: 2;
}

.custom-html-block__preview {
    border: 2px dashed #6c5ce7;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.custom-html-block__placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #b2bec3;
    font-size: 13px;
    background: #f8f9fa;
    border: 2px dashed #6c5ce7;
    border-radius: 8px;
}


/* ==========================================
 Меню
========================================= */

.custom-menu {
    padding: 16px 20px;
    margin: 1.5em 0;
    background: #f0f5ff;
    border: 2px dashed #5f27cd;
    border-radius: 12px;
    position: relative;
}

.custom-menu::before {
    content: '📋 МЕНЮ';
    position: absolute;
    top: -10px;
    left: 12px;
    background: #5f27cd;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.custom-menu__body {
    display: flex;
    align-items: center;
    gap: 16px;
}

.custom-menu__icon {
    font-size: 32px;
}

.custom-menu__line {
    font-size: 13px;
    color: #636e72;
    margin-bottom: 2px;
}

.custom-menu__line strong {
    color: #2d3436;
}



.katex .katex-mathml {
    position: absolute !important;
    clip-path: inset(50%) !important;
    padding: 0 !important;
    border: 0 !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden !important;
    display: inline-block !important;
}


/* ============================================ */
/* КРОШКИ БЛОКОВ В САЙДБАРЕ                     */
/* ============================================ */

.sidebar-block-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0 0 14px 0;
    padding: 8px 10px;
    background: #eef2f7;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.3;
}

.sidebar-block-tab {
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #636e72;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: inherit;
}

.sidebar-block-tab:hover {
    background: #dde6f0;
    color: #2d3436;
}

.sidebar-block-tab.is-active {
    background: #0984e3;
    color: #fff;
    border-color: #0984e3;
    font-weight: 600;
}

.sidebar-block-tab.is-active:hover {
    background: #0770c4;
}

.sidebar-block-tab-sep {
    color: #b2bec3;
    font-size: 13px;
    user-select: none;
    flex-shrink: 0;
}


/* ============================================ */
/* АККОРДЕОН В САЙДБАРЕ                          */
/* ============================================ */

.acc-section {
    border-bottom: 1px solid #e9ecef;
}

.acc-section:last-child {
    border-bottom: none;
}

.acc-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #2d3436;
    text-align: left;
    transition: color 0.15s;
}

.acc-header:hover {
    color: #0984e3;
}

.acc-arrow {
    display: inline-block;
    font-size: 9px;
    color: #b2bec3;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.acc-section.is-open .acc-arrow {
    transform: rotate(90deg);
    color: #0984e3;
}

.acc-title {
    flex: 1;
}

.acc-body {
    padding: 0 0 8px 0;
}


/* ============================================ */
/* БЛОК: БАННЕРЫ (превью в редакторе)           */
/* ============================================ */

.custom-banner {
    padding: 12px;
    margin: 1.5em 0;
    background: #f8f9fa;
    border: 2px dashed #5f27cd;
    border-radius: 12px;
    position: relative;
}

.custom-banner::before {
    content: '🖼️ БАННЕРЫ';
    position: absolute;
    top: -10px;
    left: 12px;
    background: #5f27cd;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    z-index: 2;
}

.custom-banner.is-selected {
    outline: 2px solid #0984e3;
    outline-offset: 4px;
}

.custom-banner__empty {
    padding: 40px 20px;
    text-align: center;
    color: #b2bec3;
    font-size: 13px;
}

.custom-banner__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.custom-banner__item {
    position: relative;
    height: var(--banner-height, 200px);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.custom-banner__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.custom-banner__link-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #0984e3;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.custom-banner__meta {
    margin-top: 8px;
    font-size: 11px;
    color: #b2bec3;
    text-align: center;
}

/* ============================================ */
/* ФУТЕР МОДАЛКИ ВЫБОРА ИЗОБРАЖЕНИЙ             */
/* ============================================ */

.media-picker-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.media-picker-cancel {
    padding: 8px 18px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s;
}

.media-picker-cancel:hover {
    background: #f3f4f6;
    border-color: #b2bec3;
}

.media-picker-confirm {
    padding: 8px 18px;
    border: 1px solid #0984e3;
    border-radius: 6px;
    background: #0984e3;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.15s;
}

.media-picker-confirm:hover:not(:disabled) {
    background: #0770c4;
    border-color: #0770c4;
}

.media-picker-confirm:disabled {
    background: #b2bec3;
    border-color: #b2bec3;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Галочка на выбранной картинке */
.media-picker-item {
    position: relative;
}

.media-picker-item.is-selected {
    border-color: #0984e3;
    box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.25);
}

.media-picker-check {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0984e3;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}/* ============================================ */
/* СПОЙЛЕР (DETAILS) — СОВРЕМЕННЫЙ СТИЛЬ */
/* ============================================ */

.tiptap-details {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin: 1.5em 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
    background: var(--details-content-bg, #ffffff);
}

.tiptap-details:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ============================================ */
/* ЗАГОЛОВОК СПОЙЛЕРА */
/* ============================================ */

.tiptap-details summary,
.tiptap-details .tiptap-details-summary {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    list-style: none;
    background: var(--details-bg, #f0f0f0) !important;
    color: var(--details-text, #2d3436) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: filter 0.2s ease;
    user-select: none;
    border-radius: 12px;
}

.tiptap-details summary:hover,
.tiptap-details .tiptap-details-summary:hover {
    filter: brightness(0.96);
}

.tiptap-details summary::-webkit-details-marker {
    display: none;
}

/* Стрелочка */
.tiptap-details summary::before {
    content: '▶';
    font-size: 12px;
    display: inline-block;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    opacity: 0.7;
}

.tiptap-details[open]>summary::before,
.tiptap-details.is-open>summary::before {
    transform: rotate(90deg);
}

/* ============================================ */
/* СОДЕРЖИМОЕ СПОЙЛЕРА */
/* ============================================ */

.tiptap-details [data-type="detailsContent"],
.tiptap-details .tiptap-details-content {
    padding: 20px 24px;
    background: var(--details-content-bg, #ffffff) !important;
    color: var(--details-content-text, #2d3436) !important;
    line-height: 1.6;
}

/* Все параграфы внутри detailsContent наследуют цвет */
.tiptap-details [data-type="detailsContent"] p,
.tiptap-details .tiptap-details-content p {
    color: inherit;
}

/* Отступы для вложенного контента */
.tiptap-details .tiptap-details-content>*:first-child {
    margin-top: 0;
}

.tiptap-details .tiptap-details-content>*:last-child {
    margin-bottom: 0;
}

/* ============================================ */
/* ВЛОЖЕННЫЕ СПОЙЛЕРЫ */
/* ============================================ */

.tiptap-details .tiptap-details {
    margin: 1em 0;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    box-shadow: none;
}

.tiptap-details .tiptap-details summary {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 10px;
}

.tiptap-details .tiptap-details>div,
.tiptap-details .tiptap-details .tiptap-details-content {
    padding: 16px 20px;
}


/* ============================================ */
/* КНОПКА РАСКРЫТИЯ СПОЙЛЕРА В АДМИНКЕ */
/* ============================================ */

.tiptap-details>button {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    /* Скрываем встроенные иконки TipTap */
    font-size: 0;
    color: transparent;
    overflow: hidden;
}

.tiptap-details>button:hover {
    background: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tiptap-details>button:active {
    transform: scale(0.95);
}

/* Убираем встроенные иконки TipTap */
.tiptap-details>button svg,
.tiptap-details>button::after {
    display: none !important;
}

/* Своя иконка-стрелочка */
.tiptap-details>button::before {
    content: '▶';
    font-size: 12px;
    color: #2d3436;
    transition: transform 0.3s ease;
    display: block;
    line-height: 1;
}

.tiptap-details.is-open>button::before,
.tiptap-details[open]>button::before {
    transform: rotate(90deg);
}

/* Делаем блок relative, чтобы кнопка позиционировалась */
.tiptap-details {
    position: relative;
}/* ============================================ */
/* БЛОК: СПИСОК ФАЙЛОВ ИЗ ПАПКИ */
/* ============================================ */

.custom-file-folder {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin: 1.5em 0;
    background: #f8f9fa;
    border: 2px dashed #0984e3;
    border-radius: 12px;
    position: relative;
}

.custom-file-folder__icon {
    font-size: 32px;
    flex-shrink: 0;
}

.custom-file-folder__info {
    flex: 1;
    min-width: 0;
}

.custom-file-folder__title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 4px;
}

.custom-file-folder__slug {
    font-size: 13px;
    color: #636e72;
}

/* Метка */
.custom-file-folder::before {
    content: '📁 ФАЙЛЫ ИЗ ПАПКИ';
    position: absolute;
    top: -10px;
    left: 12px;
    background: #0984e3;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}/* ============================================ */
/* ОБЁРТКА БЛОКА В РЕДАКТОРЕ */
/* ============================================ */

.custom-gallery {
    display: block;
    padding: 12px;
    margin: 1.5em 0;
    background: #fafbfc;
    border: 2px dashed #6c5ce7;
    border-radius: 12px;
    position: relative;
}

.custom-gallery::before {
    content: '🖼️ ГАЛЕРЕЯ';
    position: absolute;
    top: -10px;
    left: 12px;
    background: #6c5ce7;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    z-index: 2;
}

.custom-gallery__placeholder {
    padding: 24px;
    text-align: center;
    color: #b2bec3;
    font-size: 13px;
}

/* ============================================ */
/* ГАЛЕРЕЯ (стили как на сайте) */
/* ============================================ */

.tiptap-editor-container .tiptap-gallery {
    margin: 0;
}

.tiptap-editor-container .tiptap-gallery__title {
    margin: 0 0 12px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #2d3436;
}

.tiptap-editor-container .tiptap-gallery__grid {
    display: grid;
    gap: 8px;
}

/* Отступы */
.tiptap-editor-container .tiptap-gallery--gap-small .tiptap-gallery__grid {
    gap: 4px;
}

.tiptap-editor-container .tiptap-gallery--gap-medium .tiptap-gallery__grid {
    gap: 8px;
}

.tiptap-editor-container .tiptap-gallery--gap-large .tiptap-gallery__grid {
    gap: 16px;
}

/* Стили картинок */
.tiptap-editor-container .tiptap-gallery__item {
    display: block;
    overflow: hidden;
    background: #f0f0f0;
    cursor: default;
}

.tiptap-editor-container .tiptap-gallery__item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tiptap-editor-container .tiptap-gallery__item:hover img {
    transform: scale(1.05);
}

/* Скругление */
.tiptap-editor-container .tiptap-gallery--rounded .tiptap-gallery__item {
    border-radius: 8px;
}

/* Тени */
.tiptap-editor-container .tiptap-gallery--shadow .tiptap-gallery__item {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ============================================ */
/* GRID */
/* ============================================ */

.tiptap-editor-container .tiptap-gallery--grid .tiptap-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
}

.tiptap-editor-container .tiptap-gallery--grid.tiptap-gallery--cols-2 .tiptap-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
}

.tiptap-editor-container .tiptap-gallery--grid.tiptap-gallery--cols-3 .tiptap-gallery__grid {
    grid-template-columns: repeat(3, 1fr);
}

.tiptap-editor-container .tiptap-gallery--grid.tiptap-gallery--cols-4 .tiptap-gallery__grid {
    grid-template-columns: repeat(4, 1fr);
}

.tiptap-editor-container .tiptap-gallery--grid .tiptap-gallery__item {
    aspect-ratio: 1 / 1;
}

/* ============================================ */
/* MASONRY */
/* ============================================ */

.tiptap-editor-container .tiptap-gallery--masonry .tiptap-gallery__grid {
    display: block;
    column-count: 3;
    column-gap: 8px;
}

.tiptap-editor-container .tiptap-gallery--masonry.tiptap-gallery--cols-2 .tiptap-gallery__grid {
    column-count: 2;
}

.tiptap-editor-container .tiptap-gallery--masonry.tiptap-gallery--cols-3 .tiptap-gallery__grid {
    column-count: 3;
}

.tiptap-editor-container .tiptap-gallery--masonry.tiptap-gallery--cols-4 .tiptap-gallery__grid {
    column-count: 4;
}

.tiptap-editor-container .tiptap-gallery--masonry .tiptap-gallery__item {
    display: block;
    break-inside: avoid;
    margin-bottom: 8px;
}

.tiptap-editor-container .tiptap-gallery--masonry .tiptap-gallery__item img {
    height: auto;
}

/* ============================================ */
/* JUSTIFIED */
/* ============================================ */

.tiptap-editor-container .tiptap-gallery--justified .tiptap-gallery__grid {
    display: flex;
    flex-wrap: wrap;
}

.tiptap-editor-container .tiptap-gallery--justified .tiptap-gallery__item {
    flex: 1 1 auto;
    min-width: 150px;
}

.tiptap-editor-container .tiptap-gallery--justified .tiptap-gallery__item img {
    height: 220px;
    object-fit: cover;
}/* ============================================ */
/* БЛОК ВКЛАДОК */
/* ============================================ */

.tabs-wrapper {
    margin: 1.5em 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

/* Заголовки вкладок */
.tabs-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #f6f8fa;
    border-bottom: 1px solid #e0e0e0;
}

.tabs-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #636e72;
    transition: color 0.15s, background 0.15s;
    border-bottom: 2px solid transparent;
}

.tabs-tab:hover {
    color: #0984e3;
    background: #eef2f7;
}

.tabs-tab.is-active {
    color: #0984e3;
    border-bottom-color: #0984e3;
    background: #fff;
}

/* Содержимое вкладок */
.tabs-body {
    position: relative;
}

/* Каждая вкладка — блок, но видна только активная */
.tabs-body .tab-panel {
    display: none;
    padding: 16px 20px;
    background: #fff;
}

/* Показываем только активную вкладку */
.tabs-body .tab-panel.is-active {
    display: block;
}

.tabs-body .tabs-content>.tab-panel {
    display: none;
}

.tabs-body .tabs-content>.tab-panel.is-active {
    display: block;
}

/* ============================================ */
/* ТЕМЫ */
/* ============================================ */

/* Тёмная */
.tabs-theme-dark {
    border-color: #2d3436;
}

.tabs-theme-dark .tabs-header {
    background: #2d3436;
    border-bottom-color: #1a1a1a;
}

.tabs-theme-dark .tabs-tab {
    color: #b2bec3;
}

.tabs-theme-dark .tabs-tab:hover {
    color: #fff;
    background: #3d4a4d;
}

.tabs-theme-dark .tabs-tab.is-active {
    color: #fff;
    background: #1a1a1a;
    border-bottom-color: #74b9ff;
}

.tabs-theme-dark .tabs-body .tab-panel {
    background: #1a1a1a;
    color: #dfe6e9;
}

/* Синяя */
.tabs-theme-blue {
    border-color: #0984e3;
}

.tabs-theme-blue .tabs-header {
    background: #e8f4fd;
    border-bottom-color: #cfe5ff;
}

.tabs-theme-blue .tabs-tab {
    color: #074b8a;
}

.tabs-theme-blue .tabs-tab:hover {
    background: #d4ebfc;
}

.tabs-theme-blue .tabs-tab.is-active {
    color: #0984e3;
    background: #fff;
    border-bottom-color: #0984e3;
}

/* ============================================ */
/* ФОРМЫ */
/* ============================================ */

/* Острые */
.tabs-shape-sharp .tabs-tab {
    border-radius: 0;
}

/* Скруглённые (по умолчанию) */
.tabs-shape-rounded .tabs-header {
    padding: 6px 8px 0;
    gap: 4px;
}

.tabs-shape-rounded .tabs-tab {
    border-radius: 6px 6px 0 0;
}

/* Pills (таблетки) */
.tabs-shape-pills .tabs-header {
    padding: 8px 12px;
    gap: 6px;
    border-bottom: none;
}

.tabs-shape-pills .tabs-tab {
    border-radius: 999px;
    border-bottom: none;
}

.tabs-shape-pills .tabs-tab.is-active {
    background: #0984e3;
    color: #fff;
}

.tabs-shape-pills.tabs-theme-dark .tabs-tab.is-active {
    background: #74b9ff;
    color: #1a1a1a;
}


/* ============================================ */
/* МОДАЛКА ИКОНОК ДЛЯ ВКЛАДОК                  */
/* ============================================ */

.icon-picker-backdrop-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.icon-picker-dialog-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.icon-picker-header-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.icon-picker-header-modal h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.icon-picker-close-modal {
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
}

.icon-picker-close-modal:hover {
    background: #e9ecef;
}

.icon-picker-search-modal {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.icon-picker-search-modal input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.icon-picker-search-modal input:focus {
    outline: none;
    border-color: #0984e3;
    box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.15);
}

.icon-picker-grid-modal {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.icon-picker-item-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 72px;
    font-family: inherit;
}

.icon-picker-item-modal:hover {
    border-color: #0984e3;
    background: #f0f8ff;
    transform: translateY(-1px);
}

.icon-picker-item-modal.is-selected {
    border-color: #0984e3;
    background: #e8f4fd;
}

.icon-picker-item-modal i {
    font-size: 22px;
    color: #2d3436;
}

.icon-picker-item-modal span {
    font-size: 10px;
    color: #999;
    text-align: center;
    word-break: break-all;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
}

.icon-picker-empty-modal {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #b2bec3;
    font-size: 14px;
}

.icon-picker-footer-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    font-size: 12px;
    color: #666;
}

.icon-picker-clear-modal {
    padding: 6px 14px;
    border: 1px solid #c0392b;
    border-radius: 6px;
    background: #fff;
    color: #c0392b;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}

.icon-picker-clear-modal:hover {
    background: #fdecea;
}