.html-editor-widget {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 0.5rem;
    background: #fff;
    overflow: hidden;
}

.html-editor-widget:focus-within {
    border-color: rgb(var(--na-primary-rgb, 0, 170, 255));
    box-shadow: 0 0 0 0.2rem rgba(var(--na-primary-rgb, 0, 170, 255), 0.18);
}

.html-editor-widget.is-invalid,
.html-editor-widget__content.is-invalid {
    border-color: #dc3545;
}

.html-editor-widget.is-valid,
.html-editor-widget__content.is-valid {
    border-color: #198754;
}

.html-editor-widget--readonly {
    background: #f8f9fa;
}

.html-editor-widget__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
    background: #f8fafc;
}

.html-editor-widget__toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 6px;
    margin-right: 6px;
    border-right: 1px solid rgba(15, 23, 42, 0.1);
}

.html-editor-widget__toolbar-group:last-child {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
}

.html-editor-widget__toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.4rem;
    background: transparent;
    color: #475569;
    cursor: pointer;
}

.html-editor-widget__toolbar-btn:hover:not(:disabled) {
    background: rgba(15, 23, 42, 0.06);
    color: #172033;
}

.html-editor-widget__toolbar-btn.is-active {
    background: rgba(var(--na-primary-rgb, 0, 170, 255), 0.14);
    border-color: rgba(var(--na-primary-rgb, 0, 170, 255), 0.3);
    color: rgb(var(--na-primary-rgb, 0, 170, 255));
}

.html-editor-widget__toolbar-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.html-editor-widget__content {
    padding: 10px 12px;
    overflow-y: auto;
}

.html-editor-widget__content .ProseMirror {
    outline: none;
    min-height: inherit;
}

.html-editor-widget__content .ProseMirror p {
    margin: 0;
}

.html-editor-widget__content .ProseMirror p:last-child {
    margin-bottom: 0;
}

.html-editor-widget__content .ProseMirror h2,
.html-editor-widget__content .ProseMirror h3 {
    margin: 0.6em 0 0.4em;
    line-height: 1.25;
}

.html-editor-widget__content .ProseMirror ul,
.html-editor-widget__content .ProseMirror ol {
    margin: 0 0 0.6em;
    padding-left: 1.4em;
}

.html-editor-widget__content .ProseMirror blockquote {
    margin: 0 0 0.6em;
    padding-left: 0.9em;
    border-left: 3px solid rgba(15, 23, 42, 0.15);
    color: #475569;
}

.html-editor-widget__content .ProseMirror code {
    padding: 0.1em 0.3em;
    border-radius: 0.3rem;
    background: rgba(15, 23, 42, 0.06);
    font-size: 0.9em;
}

.html-editor-widget__content .ProseMirror pre {
    margin: 0 0 0.6em;
    padding: 0.6em 0.8em;
    border-radius: 0.5rem;
    background: #172033;
    color: #e2e8f0;
    overflow-x: auto;
}

.html-editor-widget__content .ProseMirror pre code {
    padding: 0;
    background: none;
    color: inherit;
}

.html-editor-widget__content .ProseMirror a {
    color: rgb(var(--na-primary-rgb, 0, 170, 255));
    text-decoration: underline;
}

.html-editor-widget__content .ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    height: 0;
    color: #94a3b8;
    pointer-events: none;
}
