.rte-wrapper {
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    background: #fff;
}

.rte-toolbar {
    border-bottom: 1px solid #ddd;
    padding: 4px;
    background: #f7f7f7;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.rte-btn,
.rte-select,
.rte-color {
    border: none;
    background: transparent;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    font-family: inherit;
}

.rte-btn:hover {
    background: #eee;
}

.rte-select {
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}

.rte-color {
    padding: 0;
    width: 30px;
    height: 26px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* contenteditable полето */
.rte-editor {
    min-height: 150px;
    padding: 8px;
    outline: none;
    line-height: 1.4;
    background: #ffffff; /* бял фон по подразбиране */
}

.rte-editor:empty:before {
    content: attr(data-placeholder);
    color: #aaa;
}

/* скриваме оригиналното textarea */
textarea.rich_text {
    display: none;
}

/* снимките вътре в редактора */
.rte-editor img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    cursor: pointer;
}

/* визуално избрана снимка */
.rte-editor img.rte-img-selected {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}
/* Общ стил за мини-иконките за подравняване */
.rte-align-icon {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 14px;
    vertical-align: middle;
}

.rte-align-icon .line {
    height: 2px;
    background: #666;
    border-radius: 2px;
}

/* ЛЯВО подравняване */
.rte-align-left .line:nth-child(1) { width: 70%; align-self: flex-start; }
.rte-align-left .line:nth-child(2) { width: 55%; align-self: flex-start; }
.rte-align-left .line:nth-child(3) { width: 80%; align-self: flex-start; }

/* ЦЕНТЪР */
.rte-align-center .line:nth-child(1) { width: 70%; align-self: center; }
.rte-align-center .line:nth-child(2) { width: 55%; align-self: center; }
.rte-align-center .line:nth-child(3) { width: 80%; align-self: center; }

/* ДВУСТРАННО (JUSTIFY) */
.rte-align-justify .line {
    width: 100%;
    align-self: stretch;
}

/* ДЯСНО подравняване */
.rte-align-right .line:nth-child(1) { width: 70%; align-self: flex-end; }
.rte-align-right .line:nth-child(2) { width: 55%; align-self: flex-end; }
.rte-align-right .line:nth-child(3) { width: 80%; align-self: flex-end; }

.rte-link-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.rte-link-dialog {
    background: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    min-width: 280px;
    max-width: 90%;
    font-family: inherit;
    font-size: 13px;
}

.rte-link-dialog label {
    display: block;
    margin-top: 6px;
    margin-bottom: 2px;
    font-size: 12px;
}

.rte-link-dialog input[type="text"] {
    width: 100%;
    padding: 4px 6px;
    font-size: 13px;
    box-sizing: border-box;
}

.rte-link-dialog-buttons {
    text-align: right;
    margin-top: 10px;
}

.rte-link-dialog-buttons button {
    margin-left: 6px;
}

