/* ─── Rich Text Editor Styles ─── */
.rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    align-items: center;
    font-family: inherit;
}
.rich-toolbar button, .rich-toolbar select {
    padding: 5px 8px;
    background: #FAFBFC;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-medium);
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    transition: all 0.15s;
    min-width: 28px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rich-toolbar button:hover, .rich-toolbar select:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.rich-toolbar button:active {
    transform: scale(0.95);
}
.rich-toolbar button.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
}
.rich-toolbar select {
    appearance: none;
    padding-right: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%2394a3b8' d='M0 2l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    cursor: pointer;
    font-size: 0.75rem;
    min-width: 70px;
    height: 28px;
}
.rich-sep {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 3px;
    flex-shrink: 0;
}
.rich-color-input {
    width: 0; height: 0;
    padding: 0; border: 0;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.rich-color-btn {
    position: relative;
    overflow: visible;
}
.rich-color-swatch {
    position: absolute;
    bottom: 2px;
    left: 6px;
    right: 6px;
    height: 3px;
    border-radius: 1px;
}
.rich-editor-area {
    min-height: 400px;
    padding: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    outline: none;
    color: var(--text-dark);
    background: #fff;
    border: none;
    border-top: 1px solid var(--border-light);
    font-family: 'Inter', -apple-system, sans-serif;
}
.rich-editor-area:focus { box-shadow: none; }
.rich-editor-area img { max-width: 100%; height: auto; }
.rich-editor-area table { border-collapse: collapse; width: 100%; }
.rich-editor-area td, .rich-editor-area th { border: 1px solid #ddd; padding: 8px; }
.rich-editor-area a { color: var(--primary); }

/* Status bar */
.rich-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px;
    background: #FAFBFC;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 0.72rem;
    color: var(--text-light);
}

/* Plain text editor area */
.plain-editor-area {
    min-height: 400px;
    width: 100%;
    border: none;
    resize: none;
    padding: 16px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.9rem;
    background: #fff;
    color: var(--text-dark);
    line-height: 1.7;
    outline: none;
}

/* Table picker popup */
.table-picker {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    display: none;
}
.table-picker .grid {
    display: grid;
    grid-template-columns: repeat(6, 20px);
    gap: 2px;
    margin-bottom: 8px;
}
.table-picker .cell {
    width: 20px;
    height: 20px;
    border: 1px solid #ddd;
    border-radius: 2px;
    cursor: pointer;
}
.table-picker .cell.active { background: var(--primary); border-color: var(--primary); }
.table-picker .label { font-size: 0.75rem; color: var(--text-light); }
