/* CI Rich Text — container + toolbar styling (design-token aware).
   The Quill editor itself is themed by quill.snow.css; these rules blend it
   with the app's .tf-input / .input look in both light and dark modes. */

.ci-richtext {
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 8px;
    background: var(--color-surface, #fff);
    overflow: hidden;
}

.ci-richtext:focus-within {
    border-color: var(--color-brand, #e5461f);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand, #e5461f) 15%, transparent);
}

.ci-richtext-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    background: var(--color-surface-muted, #f9fafb);
}

.ci-richtext-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text, #374151);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.ci-richtext-btn:hover {
    background: color-mix(in srgb, var(--color-brand, #e5461f) 12%, transparent);
    color: var(--color-brand, #e5461f);
}

.ci-richtext-sep {
    width: 1px;
    align-self: stretch;
    margin: 3px 4px;
    background: var(--color-border, #e5e7eb);
}

.ci-richtext-editor {
    min-height: 90px;
    max-height: 360px;
    overflow-y: auto;
    padding: 10px 12px;
    font-size: 0.925rem;
    color: var(--color-text, #1f2937);
}

.ci-richtext-editor.ql-container {
    font-family: inherit;
    border: 0;
}

.ci-richtext-editor p,
.ci-richtext-editor li {
    margin: 0 0 4px;
}

.ci-richtext-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.ci-richtext-origin {
    display: none !important; /* replaced by the editor; still submitted */
}

/* Rendered saved rich text (server renderRichText() output) */
.richtext-view p { margin: 0 0 6px; }
.richtext-view img { max-width: 100%; height: auto; border-radius: 6px; }
.richtext-view ul, .richtext-view ol { margin: 4px 0 8px; padding-left: 22px; }
.richtext-view blockquote {
    margin: 6px 0;
    padding: 4px 12px;
    border-left: 3px solid var(--color-brand, #e5461f);
    color: var(--color-text-muted, #6b7280);
}
