.editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
    align-items: center;
    z-index: 50;
    flex-shrink: 0;
    position: sticky;
    top: 0;
}
.editor-btn, .editor-select {
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    color: #cbd5e1;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    border: 1px solid transparent;
    position: relative;
    user-select: none;
}
.editor-select {
    appearance: none;
    padding-right: 20px;
    text-align: left;
    min-width: 80px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 10px;
}
.editor-btn:hover, .editor-select:hover { background-color: #7c3aed; color: white; }
.editor-btn i { font-size: 15px; }
.editor-select option { background: #0f172a; color: white; }

/* Popups Positioning */
.emoji-picker, .table-picker-popup {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #1e293b;
    border: 1px solid #475569;
    padding: 8px;
    border-radius: 10px;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}
.emoji-picker.show, .table-picker-popup.show { display: block; }

.emoji-picker {
    width: 300px;
    max-height: 240px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
}
.emoji-picker:not(.show) { display: none; }
.emoji-picker.show { display: grid; }
.emoji-picker button { 
    background: transparent; border: none; font-size: 22px; 
    cursor: pointer; padding: 1px; border-radius: 4px; transition: background 0.2s; 
}
.emoji-picker button:hover { background: rgba(255,255,255,0.1); }

.table-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    margin-top: 5px;
}
.table-cell {
    width: 18px;
    height: 18px;
    border: 1px solid #475569;
    background: #334155;
    cursor: pointer;
}
.table-cell.active { background: #7c3aed; border-color: #a855f7; }
.content250 {min-height: 250px !important;}

/* SYNCHRONIZED RICH CONTENT STYLES */
.wysiwyg-editor, .rich-content {
    width: 100%;
    background: rgba(15, 23, 42, 0.4) !important;
    color: #e2e8f0;
    padding: 15px !important;
    outline: none;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-y: auto;
    min-height: 80px;
}

.wysiwyg-editor ul, .rich-content ul { list-style-type: disc !important; padding-left: 1.5rem !important; margin: 1em 0 !important; }
.wysiwyg-editor ol, .rich-content ol { list-style-type: decimal !important; padding-left: 1.5rem !important; margin: 1em 0 !important; }
.wysiwyg-editor li, .rich-content li { display: list-item !important; margin-bottom: 0.2em; }
.wysiwyg-editor blockquote, .rich-content blockquote { border-left: 4px solid #7c3aed; padding-left: 1rem; margin: 1rem 0; color: #94a3b8; font-style: italic; }
.wysiwyg-editor img, .rich-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }

/* СТИЛИ БЛОКА КОДА */
.code-block-wrapper {
    position: relative;
    background: #020617 !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 8px;
    margin: 16px 0;
    padding: 12px;
    padding-top: 38px !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}
.code-block-wrapper pre {
    margin: 0 !important;
    color: #38bdf8 !important;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    background: transparent !important;
}
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}
.code-copy-btn:hover {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

/* КРАСИВЫЕ КНОПКИ В ТЕКСТЕ */
.forum-custom-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 22px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    font-size: 14px !important;
    margin: 5px 2px !important;
    color: white !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
    vertical-align: middle !important;
    line-height: 1.2 !important;
}
.forum-custom-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3) !important;
    filter: brightness(1.1) !important;
}

/* Цветовые схемы кнопок */
.btn-purple { background: linear-gradient(135deg, #7c3aed, #a855f7) !important; }
.btn-accent { background: linear-gradient(135deg, #ec4899, #db2777) !important; }
.btn-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2) !important; }
.btn-emerald { background: linear-gradient(135deg, #10b981, #059669) !important; }
.btn-red { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }
.btn-amber { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
.btn-indigo { background: linear-gradient(135deg, #4f46e5, #3730a3) !important; }
.btn-rose { background: linear-gradient(135deg, #f43f5e, #be123c) !important; }
.btn-lime { background: linear-gradient(135deg, #84cc16, #4d7c0f) !important; }
.btn-sky { background: linear-gradient(135deg, #0ea5e9, #0369a1) !important; }
.btn-violet { background: linear-gradient(135deg, #8b5cf6, #5b21b6) !important; }
.btn-slate { background: linear-gradient(135deg, #475569, #1e293b) !important; }
.btn-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8) !important; }
.btn-orange { background: linear-gradient(135deg, #f97316, #ea580c) !important; }
.btn-teal { background: linear-gradient(135deg, #14b8a6, #0d9488) !important; }
.btn-pink { background: linear-gradient(135deg, #f472b6, #db2777) !important; }

.recent-colors-container {
    display: flex;
    gap: 6px;
    margin-left: 8px;
    align-items: center;
    padding: 2px 2px 2px 10px;
    border-left: 1px solid rgba(255,255,255,0.1);
    max-width: 200px;
    flex-wrap: wrap;
}
.recent-color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.2s;
}
.recent-color-swatch:hover { transform: scale(1.3); border-color: white; }

.source-code-area {
    display: none;
    width: 100%;
    min-height: 250px;
    background: #0f172a;
    color: #a5b4fc;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    padding: 16px;
    border: none;
    resize: none;
    outline: none;
    white-space: pre-wrap;
    word-break: break-all;
    flex-grow: 1;
}
.source-code-area.active { display: block; }