/* Theme the self-hosted Quill "snow" editor to match the app design tokens. */
.ql-toolbar.ql-snow,
.ql-container.ql-snow {
    border-color: var(--border);
}

.ql-toolbar.ql-snow {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    background-color: var(--card);
}

.ql-container.ql-snow {
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    background-color: var(--card);
    color: var(--card-foreground);
    font-size: 0.875rem;
}

.ql-editor {
    min-height: 9rem;
}

/* Placeholder text uses the muted token instead of Quill's default italic grey. */
.ql-editor.ql-blank::before {
    color: var(--muted-foreground);
    font-style: normal;
    left: 0.75rem;
    right: 0.75rem;
}

/* Toolbar icons / labels follow the foreground colour so they remain visible in dark mode. */
.ql-snow .ql-stroke {
    stroke: var(--card-foreground);
}

.ql-snow .ql-fill {
    fill: var(--card-foreground);
}

.ql-snow .ql-picker {
    color: var(--card-foreground);
}

/* Read-only rendered rich text (RichTextView) shares Quill's content typography. */
.rich-text-view {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--card-foreground);
    word-break: break-word;
}

.rich-text-view ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.rich-text-view ol {
    list-style: decimal;
    padding-left: 1.5rem;
}

.rich-text-view a {
    color: var(--primary, #2563eb);
    text-decoration: underline;
}

.rich-text-view h1,
.rich-text-view h2,
.rich-text-view h3 {
    font-weight: 600;
    margin: 0.5rem 0;
}
