/* Toast UI editor skin: consumes design tokens from base.css; the vendor engine CSS stays in the plugin */
/* Keep the editor mount div at the full width of its form field */
div[id$="_toast"] {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    width: 100%;
}

/* Clip transient toolbar overflow horizontally while leaving downward popups visible */
.toastui-editor-toolbar {
    overflow-x: clip;
    overflow-y: visible;
}

.toastui-editor-defaultUI-toolbar button.toastui-editor-toolbar-icons {
    height: 32px;
    margin-left: 1px;
    margin-right: 1px;
    width: 32px;
}

.toastui-editor-defaultUI-toolbar .toastui-editor-toolbar-divider {
    margin-left: 4px;
    margin-right: 4px;
}

button.toastui-editor-toolbar-icons {
    background-image: none;
    color: var(--sl-color-text-muted);
    font-size: 0;
    position: relative;
}

.toastui-editor-toolbar-icons::before {
    display: block;
    font-family: bootstrap-icons, "bootstrap-icons";
    font-size: 18px;
    font-style: normal;
    font-weight: 400;
    left: 0;
    line-height: 32px;
    position: absolute;
    speak: never;
    text-align: center;
    top: 0;
    width: 32px;
}

.toastui-editor-toolbar-icons.heading::before {
    content: "\f5f1";
}

.toastui-editor-toolbar-icons.bold::before {
    content: "\f5f0";
}

.toastui-editor-toolbar-icons.italic::before {
    content: "\f5f4";
}

.toastui-editor-toolbar-icons.strike::before {
    content: "\f5f5";
}

.toastui-editor-toolbar-icons.hrline::before {
    content: "\f63b";
}

.toastui-editor-toolbar-icons.quote::before {
    content: "\f6b0";
}

.toastui-editor-toolbar-icons.bullet-list::before {
    content: "\f478";
}

.toastui-editor-toolbar-icons.ordered-list::before {
    content: "\f475";
}

.toastui-editor-toolbar-icons.task-list::before {
    content: "\f26d";
}

.toastui-editor-toolbar-icons.indent::before {
    content: "\f7fe";
}

.toastui-editor-toolbar-icons.outdent::before {
    content: "\f823";
}

.toastui-editor-toolbar-icons.table::before {
    content: "\f5aa";
}

.toastui-editor-toolbar-icons.image::before {
    content: "\f42a";
}

.toastui-editor-toolbar-icons.link::before {
    content: "\f470";
}

.toastui-editor-toolbar-icons.code::before {
    content: "\f2c6";
}

.toastui-editor-toolbar-icons.codeblock::before {
    content: "\f2c7";
}

.toastui-editor-toolbar-icons.more::before {
    content: "\f5d4";
}

.toastui-editor-toolbar-icons.sl-editor-icon-quote::before {
    content: "\f190";
}

.toastui-editor-toolbar-icons.sl-editor-icon-hide::before {
    content: "\f340";
}

.toastui-editor-toolbar-icons.sl-editor-icon-tabs::before {
    content: "\f52b";
}

.toastui-editor-toolbar-icons.sl-editor-icon-html::before {
    content: "\f749";
}

.toastui-editor-toolbar-icons.sl-editor-icon-php::before {
    content: "\f757";
}

.toastui-editor-toolbar-icons.sl-editor-icon-files::before {
    content: "\f3d8";
}

.toastui-editor-toolbar-icons.sl-editor-icon-fullscreen::before {
    content: "\f3df";
}

.toastui-editor-toolbar-icons.sl-editor-icon-fullscreen.sl-toastui-fullscreen-active::before {
    content: "\f3de";
}

html.sl-toastui-page-locked,
body.sl-toastui-page-locked {
    overflow: hidden;
}

div[id$="_toast"].sl-toastui-editor-fullscreen {
    background: var(--sl-color-bg);
    bottom: 0;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 10000;
}

/* Fullscreen height is driven by the engine setHeight('100%') call from editor-tags.js; CSS only resets the chrome */
div[id$="_toast"].sl-toastui-editor-fullscreen .toastui-editor-defaultUI {
    border-radius: 0;
}

/* !important below overrides the inline display/width styles set by the engine and SLAED JS at runtime */

.toastui-editor-mode-switch {
    align-items: flex-start;
    display: flex !important;
    justify-content: flex-end;
    padding-left: 10px;
}

.toastui-editor-mode-switch .toastui-editor-md-tab-container {
    background: transparent;
    border: 0;
    float: none;
    flex: 0 0 auto;
    height: 28px;
    margin-right: auto;
    width: fit-content !important;
}

.toastui-editor-mode-switch .toastui-editor-md-tab-container .toastui-editor-tabs {
    height: 28px;
    margin-left: 0;
}

.toastui-editor-mode-switch .toastui-editor-md-tab-container .tab-item {
    border: 1px solid var(--sl-color-border);
    border-radius: 0 0 var(--sl-radius-control) var(--sl-radius-control);
    height: 24px;
    line-height: 24px;
    margin-right: -1px;
    margin-top: -1px;
    width: 70px;
}

.toastui-editor-mode-switch .toastui-editor-md-tab-container .tab-item.active {
    background: var(--sl-color-bg);
    border-top-color: var(--sl-color-bg);
    color: var(--sl-color-text);
}

.sl-toastui-upload {
    background: var(--sl-color-bg);
    border: 1px solid var(--sl-color-border-strong);
    border-radius: var(--sl-radius-card);
    box-shadow: var(--sl-shadow-panel);
    box-sizing: border-box;
    font-family: inherit;
    font-size: 12px;
    left: 50%;
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 0 var(--sl-space-lg) var(--sl-space-lg);
    position: absolute;
    top: 40px;
    transform: translateX(-50%);
    width: min(720px, calc(100% - 24px));
    z-index: 31;
}

.sl-toastui-window-head {
    align-items: center;
    background: var(--sl-color-bg-soft);
    border-bottom: 1px solid var(--sl-color-border);
    box-sizing: border-box;
    display: flex;
    font-family: inherit;
    gap: var(--sl-space-sm);
    height: 36px;
    padding: 0 var(--sl-space-md);
}

.sl-toastui-upload > .sl-toastui-window-head {
    border-radius: var(--sl-radius-card) var(--sl-radius-card) 0 0;
    margin: 0 calc(var(--sl-space-lg) * -1) var(--sl-space-lg);
}

.sl-toastui-window-head strong {
    color: var(--sl-color-text);
    flex: 1 1 auto;
    font-size: 13px;
    font-weight: 600;
}

.sl-toastui-window-actions {
    align-items: center;
    display: flex;
    gap: var(--sl-space-xs);
}

.sl-toastui-window-head button.sl-toastui-window-action {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--sl-radius-control);
    color: var(--sl-color-text);
    display: inline-flex;
    font-family: inherit;
    font-size: 14px;
    height: 28px;
    justify-content: center;
    min-width: 0;
    padding: 0;
    width: 28px;
}

.sl-toastui-window-head button.sl-toastui-window-action:hover {
    background: var(--sl-color-border);
}

.sl-toastui-window-drag {
    cursor: move;
}

.sl-toastui-head-icon {
    display: block;
    font-family: bootstrap-icons, "bootstrap-icons";
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    height: 16px;
    line-height: 16px;
    speak: never;
    width: 16px;
}

.sl-toastui-head-icon-move::before {
    content: "\f14e";
}

.sl-toastui-head-icon-expand::before {
    content: "\f14a";
}

.sl-toastui-head-icon-collapse::before {
    content: "\f149";
}

.sl-toastui-head-icon-close::before {
    content: "\f659";
}

.toastui-editor-popup-add-image.sl-toastui-window-popup,
.toastui-editor-popup-add-link.sl-toastui-window-popup {
    box-shadow: var(--sl-shadow-panel);
    box-sizing: border-box;
    font-size: 12px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding-top: 36px;
    width: min(720px, calc(100% - 10px));
}

.sl-toastui-popup-head {
    border: 1px solid var(--sl-color-border-strong);
    border-radius: var(--sl-radius-card) var(--sl-radius-card) 0 0;
    position: absolute;
    z-index: 10021;
}

/* Alerts inside the image popup share one horizontal inset with the file-manager panel */
.sl-toastui-image-popup .js-slaed-image-limits,
.sl-toastui-image-popup .js-slaed-image-msg {
    margin: var(--sl-space-lg) var(--sl-space-lg) 0;
}

.sl-toastui-image-popup .toastui-editor-button-container {
    margin-top: var(--sl-space-lg);
}

.sl-toastui-image-popup button,
.sl-toastui-image-popup input,
.sl-toastui-link-popup button,
.sl-toastui-link-popup input,
.sl-toastui-upload button,
.sl-toastui-upload input {
    font-family: inherit;
    font-size: 12px;
}

.sl-toastui-window-popup input[type="text"] {
    background: var(--sl-color-bg);
    border: 1px solid var(--sl-color-border);
    border-radius: var(--sl-field-radius);
    box-sizing: border-box;
    height: 32px;
    width: 100%;
}

.sl-toastui-file-row {
    column-gap: var(--sl-space-sm);
    grid-template-columns: minmax(0, 1fr) minmax(120px, 33%);
}

.sl-toastui-file-row > label {
    grid-column: 1 / -1;
}

.sl-toastui-file-row .toastui-editor-file-name,
.sl-toastui-file-row .toastui-editor-file-select-button {
    box-sizing: border-box;
    margin-left: 0;
    width: 100%;
}

.sl-toastui-file-row .toastui-editor-file-select-button {
    display: none;
}

.sl-toastui-file-row::after {
    content: attr(data-slaed-drop);
    grid-column: 1 / -1;
}

/* One drop hint style under both file fields; the file-manager panel is the reference */
.sl-toastui-file-row::after,
.sl-toastui-upload-picker > small {
    color: var(--sl-color-text-muted);
    display: block;
    font-size: 12px;
    margin-top: var(--sl-space-xs);
}

/* Insert-mode choice and the extras strip live OUTSIDE the vendor popup DOM (its virtual DOM rejects foreign nodes) and are positioned over it by the plugin JS */
.sl-toastui-image-mode {
    color: var(--sl-color-text);
    display: flex;
    flex-direction: column;
    font-size: 12px;
    gap: var(--sl-space-sm);
    position: absolute;
    z-index: 33;
}

.sl-toastui-popup-extras {
    position: absolute;
    z-index: 10022;
}

.sl-toastui-popup-extras .sl-alert {
    margin: var(--sl-space-md) var(--sl-space-lg) 0;
}

.sl-toastui-image-mode label {
    align-items: flex-start;
    cursor: pointer;
    display: flex;
    gap: var(--sl-space-sm);
}

.sl-toastui-image-mode input {
    margin: 2px 0 0;
}

.sl-toastui-image-mode span,
.sl-toastui-image-mode small {
    display: block;
}

.sl-toastui-image-mode strong {
    font-size: 12px;
    font-weight: 600;
}

.sl-toastui-image-mode small {
    color: var(--sl-color-text-muted);
    font-size: 12px;
    line-height: 1.35;
    margin-top: var(--sl-space-xs);
}

.sl-toastui-image-mode.sl-none,
.sl-toastui-popup-head.sl-none,
.sl-toastui-popup-extras.sl-none,
.sl-toastui-upload.sl-none {
    display: none;
}

.sl-toastui-upload.sl-toastui-window-expanded {
    bottom: 24px;
    display: flex;
    flex-direction: column;
    left: 24px;
    max-height: none;
    position: fixed;
    right: 24px;
    top: 24px;
    transform: none;
    height: auto !important;
    width: auto !important;
    z-index: 10050;
}

.sl-toastui-window-popup.sl-toastui-window-expanded {
    bottom: 24px !important;
    height: auto !important;
    left: 24px !important;
    max-height: none;
    position: fixed;
    top: 24px !important;
    width: calc(100% - 48px) !important;
    z-index: 10050;
}

.sl-toastui-popup-head.sl-toastui-window-expanded {
    left: 24px !important;
    position: fixed;
    top: 24px !important;
    width: calc(100% - 48px) !important;
    z-index: 10051;
}

.sl-toastui-popup-head.sl-toastui-window-fixed,
.sl-toastui-popup-extras.sl-toastui-window-fixed,
.sl-toastui-image-mode.sl-toastui-window-fixed {
    position: fixed;
}

.sl-toastui-upload-picker {
    margin-bottom: var(--sl-space-md);
}

.sl-toastui-file-input {
    display: none;
}

.sl-toastui-upload-picker > label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--sl-space-sm);
}

.sl-toastui-upload-file-row {
    align-items: center;
    display: grid;
    gap: var(--sl-space-md);
    grid-template-columns: minmax(0, 1fr) minmax(120px, 33%);
    outline: 2px solid transparent;
    outline-offset: 3px;
}

.sl-toastui-upload-file-row:focus-visible {
    outline-color: var(--sl-color-primary);
}

.sl-toastui-upload-file-row.sl-drag-over,
.sl-toastui-file-row.sl-drag-over {
    background: color-mix(in srgb, var(--sl-color-primary) 8%, transparent);
    outline-color: var(--sl-color-primary);
}

.sl-toastui-upload-file-row .toastui-editor-file-name,
.sl-toastui-upload-file-row .toastui-editor-file-select-button {
    box-sizing: border-box;
    height: 32px;
    margin: 0;
    min-width: 0;
    width: 100%;
}

/* One clickable file field for both windows; the file-manager panel is the reference */
.sl-toastui-file-row .toastui-editor-file-name,
.sl-toastui-upload-file-row .toastui-editor-file-name {
    background: var(--sl-field-bg);
    border: 1px solid var(--sl-field-border);
    border-radius: var(--sl-field-radius);
    color: var(--sl-color-text);
    cursor: pointer;
    grid-column: 1 / -1;
    height: 32px;
    line-height: 30px;
    overflow: hidden;
    padding: 0 var(--sl-space-md);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sl-toastui-upload-refresh {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--sl-space-md);
}

.sl-toastui-upload-refresh input {
    min-width: 120px;
}

.sl-toastui-upload input[type="button"],
.sl-toastui-window-popup .toastui-editor-close-button,
.sl-toastui-window-popup .toastui-editor-file-select-button {
    background: var(--sl-color-bg-soft);
    border: 1px solid var(--sl-color-border);
    border-radius: var(--sl-radius-control);
    color: var(--sl-color-text);
    height: 32px;
    line-height: 1.4;
    padding: 0 var(--sl-space-lg);
}

.sl-toastui-upload input[type="button"]:hover,
.sl-toastui-window-popup .toastui-editor-close-button:hover,
.sl-toastui-window-popup .toastui-editor-file-select-button:hover {
    background: var(--sl-color-border);
}

.sl-toastui-upload .sl-editor-upload-files .toastui-editor-close-button,
.sl-toastui-upload .sl-editor-upload-files .toastui-editor-ok-button {
    border-radius: var(--sl-radius-control);
    height: 32px;
    min-width: 90px;
    padding: 0 var(--sl-space-lg);
}

.sl-toastui-upload .sl-editor-upload-files .toastui-editor-close-button {
    background: var(--sl-color-bg-soft);
    border: 1px solid var(--sl-color-border);
    color: var(--sl-color-text);
}

.sl-toastui-upload .sl-editor-upload-files .toastui-editor-close-button:hover {
    border-color: var(--sl-color-border-strong);
}

.sl-toastui-upload .sl-editor-upload-files .toastui-editor-ok-button {
    background: var(--sl-color-primary);
    color: var(--sl-color-on-dark);
}

.sl-toastui-upload .sl-editor-upload-files .toastui-editor-ok-button:hover {
    background: var(--sl-color-primary-hover);
}

.sl-toastui-upload .sl-editor-upload-files {
    max-height: 280px;
    overflow: auto;
}

.sl-toastui-file-table {
    border-collapse: collapse;
    color: var(--sl-color-text);
    width: 100%;
}

.sl-toastui-file-table td {
    border-bottom: 1px solid var(--sl-color-border);
    padding: var(--sl-space-sm);
    vertical-align: middle;
}

.sl-toastui-file-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

.sl-toastui-upload.sl-toastui-window-expanded .sl-editor-upload-files {
    flex: 1 1 auto;
    max-height: none;
}

.sl-toastui-upload.sl-toastui-window-expanded.sl-none {
    display: none;
}

@media (max-width: 600px) {
    .sl-toastui-upload {
        left: var(--sl-space-lg);
        right: var(--sl-space-lg);
        transform: none;
        width: auto;
    }
}

.toastui-editor-toolbar-icons.sl-editor-icon-emoji::before {
    content: "\f327";
}

.sl-editor-emoji-panel {
    background: var(--sl-color-bg);
    border: 1px solid var(--sl-color-border-strong);
    border-radius: var(--sl-radius-card);
    box-shadow: var(--sl-shadow-panel);
    box-sizing: border-box;
    font-family: inherit;
    font-size: 12px;
    max-height: 420px;
    padding: 8px;
    position: absolute;
    width: min(430px, calc(100vw - 24px));
    z-index: 10020;
}

.sl-editor-emoji-panel.sl-toastui-window-popup {
    padding-top: 44px;
}

.sl-editor-emoji-panel.sl-none {
    display: none;
}

.sl-editor-emoji-panel button,
.sl-editor-emoji-panel input {
    font-family: inherit;
}

.sl-editor-emoji-search {
    background: var(--sl-field-bg);
    border: 1px solid var(--sl-field-border);
    border-radius: var(--sl-field-radius);
    box-shadow: var(--sl-shadow-input);
    box-sizing: border-box;
    color: var(--sl-color-text);
    font-size: 12px;
    height: 32px;
    padding: 0 var(--sl-space-md);
    width: 100%;
}

.sl-editor-emoji-tabs {
    display: flex;
    gap: 4px;
    margin: 6px 0;
    overflow: hidden;
}

/* Emoji tabs reuse the popup button pair: secondary look idle, primary (blue) when active */
.sl-editor-emoji-tab {
    background: var(--sl-color-bg-soft);
    border: 1px solid var(--sl-color-border);
    border-radius: var(--sl-radius-control);
    color: var(--sl-color-text);
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 12px;
    height: 32px;
    padding: 0 var(--sl-space-lg);
}

.sl-editor-emoji-tab:hover {
    border-color: var(--sl-color-border-strong);
}

.sl-editor-emoji-tab.active {
    background: var(--sl-color-primary);
    border-color: var(--sl-color-primary);
    color: var(--sl-color-on-dark);
}

.sl-editor-emoji-tab.active:hover {
    background: var(--sl-color-primary-hover);
}

.sl-editor-emoji-grid {
    display: grid;
    gap: 3px;
    grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
    max-height: 292px;
    overflow: auto;
}

.sl-editor-emoji-item {
    background: var(--sl-color-bg);
    border: 1px solid transparent;
    border-radius: var(--sl-radius-control);
    cursor: pointer;
    font-size: 20px;
    height: 32px;
    line-height: 30px;
    padding: 0;
    text-align: center;
    width: 32px;
}

.sl-editor-emoji-item:hover,
.sl-editor-emoji-item:focus {
    background: var(--sl-color-bg-soft);
    border-color: var(--sl-color-border-strong);
}

.sl-editor-emoji-empty {
    color: var(--sl-color-text-muted);
    grid-column: 1 / -1;
    padding: 12px 4px;
}

.sl-editor-emoji-panel.sl-toastui-window-expanded .sl-editor-emoji-grid {
    max-height: calc(100vh - 150px);
}

.sl-toastui-file-thumb {
    max-height: 50px;
    max-width: 80px;
}

/* ===== Vendor alignment: engine surfaces mapped to theme tokens (chrome) ===== */
/* The theme font everywhere: kills the vendor font stack so every window inherits one chain from the page */
.toastui-editor-defaultUI {
    border: 1px solid var(--sl-color-border);
    border-radius: var(--sl-radius-card);
    font-family: inherit;
}

.toastui-editor-md-container,
.toastui-editor-ww-container {
    background-color: var(--sl-color-bg);
}

.toastui-editor-main .toastui-editor-md-splitter {
    background-color: var(--sl-color-border);
}

.toastui-editor-toolbar {
    background-color: var(--sl-color-bg-soft);
    border-bottom: 1px solid var(--sl-color-border);
    border-radius: calc(var(--sl-radius-card) - 1px) calc(var(--sl-radius-card) - 1px) 0 0;
}

.toastui-editor-defaultUI-toolbar {
    background-color: transparent;
    border-bottom: 0;
    border-radius: 0;
}

.toastui-editor-defaultUI-toolbar button {
    border: 1px solid var(--sl-color-bg-soft);
    border-radius: var(--sl-radius-control);
}

.toastui-editor-defaultUI-toolbar button:not(:disabled):hover {
    background-color: var(--sl-color-bg);
    border: 1px solid var(--sl-color-border);
}

.toastui-editor-dropdown-toolbar {
    background-color: var(--sl-color-bg-soft);
    border: 1px solid var(--sl-color-border);
    border-radius: var(--sl-radius-control);
    box-shadow: var(--sl-shadow-panel);
}

.toastui-editor-defaultUI-toolbar .scroll-sync.active::before {
    color: var(--sl-color-primary);
}

.toastui-editor-defaultUI-toolbar .switch {
    background-color: var(--sl-color-border-strong);
}

.toastui-editor-defaultUI-toolbar .switch::before {
    background-color: var(--sl-color-text-muted);
}

.toastui-editor-defaultUI-toolbar input:checked + .switch {
    background-color: color-mix(in srgb, var(--sl-color-primary) 35%, var(--sl-color-bg));
}

.toastui-editor-defaultUI-toolbar input:checked + .switch::before {
    background-color: var(--sl-color-primary);
}

.toastui-editor-mode-switch {
    background-color: var(--sl-color-bg);
    border-top: 1px solid var(--sl-color-border);
    border-radius: 0 0 var(--sl-radius-card) var(--sl-radius-card);
}

.toastui-editor-mode-switch .tab-item {
    background: var(--sl-color-bg-soft);
    border: 1px solid var(--sl-color-border);
    color: var(--sl-color-text-muted);
}

.toastui-editor-mode-switch .tab-item.active {
    background-color: var(--sl-color-bg);
    border-top: 1px solid var(--sl-color-bg);
    color: var(--sl-color-text);
}

.toastui-editor-md-tab-container .tab-item {
    background: var(--sl-color-bg-soft);
    border: 1px solid var(--sl-color-border);
    color: var(--sl-color-text-muted);
}

.toastui-editor-md-tab-container .tab-item.active {
    background-color: var(--sl-color-bg);
    border-bottom-color: var(--sl-color-border);
    border-top-color: var(--sl-color-bg);
    color: var(--sl-color-text);
}

/* ===== Vendor alignment: dialogs and controls ===== */
.toastui-editor-popup {
    background: var(--sl-color-bg);
    border: 1px solid var(--sl-color-border-strong);
    border-radius: var(--sl-radius-card);
    box-shadow: var(--sl-shadow-panel);
}

.toastui-editor-popup-body label {
    color: var(--sl-color-text);
    font-weight: 400;
}

.toastui-editor-popup-body input[type="text"] {
    background: var(--sl-field-bg);
    border: 1px solid var(--sl-field-border);
    border-radius: var(--sl-field-radius);
    box-shadow: var(--sl-shadow-input);
    color: var(--sl-color-text);
    padding: 0 var(--sl-space-md);
}

.toastui-editor-popup-body input[type="text"]:focus {
    border-color: var(--sl-field-focus);
    box-shadow: 0 0 0 3px var(--sl-field-focus-ring);
    outline: 0;
}

.toastui-editor-popup-body input[type="text"].disabled {
    background-color: var(--sl-color-bg-soft);
    border-color: var(--sl-field-border);
    color: var(--sl-color-text-muted);
}

.toastui-editor-popup-body input.wrong,
.toastui-editor-popup-body span.wrong {
    border-color: var(--sl-color-danger);
}

.toastui-editor-defaultUI .toastui-editor-ok-button {
    background-color: var(--sl-color-primary);
    border-radius: var(--sl-radius-control);
    color: var(--sl-color-on-dark);
    outline-color: var(--sl-color-primary-hover);
    padding: 0 var(--sl-space-lg);
}

.toastui-editor-defaultUI .toastui-editor-ok-button:hover {
    background-color: var(--sl-color-primary-hover);
}

.toastui-editor-defaultUI .toastui-editor-close-button {
    background-color: var(--sl-color-bg-soft);
    border: 1px solid var(--sl-color-border);
    border-radius: var(--sl-radius-control);
    color: var(--sl-color-text);
    outline-color: var(--sl-color-border-strong);
    padding: 0 var(--sl-space-lg);
}

.toastui-editor-defaultUI .toastui-editor-close-button:hover {
    border-color: var(--sl-color-border-strong);
}

.toastui-editor-popup-add-image .toastui-editor-file-select-button {
    background-color: var(--sl-color-bg-soft);
    border: 1px solid var(--sl-color-border);
    border-radius: var(--sl-radius-control);
    color: var(--sl-color-text);
}

.toastui-editor-popup-add-image .toastui-editor-file-select-button:hover {
    border-color: var(--sl-color-border-strong);
}

/* !important pins the popup to the right edge against the inline left the engine re-applies on every tab switch; dragging sets data-slaed-moved and releases the pin */
.sl-toastui-image-popup:not(.sl-toastui-window-expanded):not([data-slaed-moved]) {
    left: auto !important;
    right: 5px;
}

.toastui-editor-popup-add-image .toastui-editor-tabs .tab-item {
    border-bottom: 1px solid var(--sl-color-border);
    color: var(--sl-color-text);
    font-size: 12px;
}

.toastui-editor-popup-add-image .toastui-editor-tabs .tab-item:hover {
    border-bottom-color: var(--sl-color-border-strong);
}

.toastui-editor-popup-add-image .toastui-editor-tabs .tab-item.active {
    border-bottom: 2px solid var(--sl-color-primary);
    color: var(--sl-color-primary);
}

.toastui-editor-popup-add-table .toastui-editor-table-cell {
    background: var(--sl-color-bg);
    border: 1px solid var(--sl-color-border);
}

.toastui-editor-popup-add-table .toastui-editor-table-cell.header {
    background: var(--sl-color-bg-soft);
}

.toastui-editor-popup-add-table .toastui-editor-table-selection-layer {
    background: color-mix(in srgb, var(--sl-color-primary) 10%, transparent);
    border: 1px solid var(--sl-color-primary);
}

.toastui-editor-popup-add-table .toastui-editor-table-description {
    color: var(--sl-color-text);
}

.toastui-editor-popup-add-heading ul li:hover {
    background-color: var(--sl-color-bg-soft);
}

.toastui-editor-context-menu {
    background-color: var(--sl-color-bg);
    border: 1px solid var(--sl-color-border);
    border-radius: var(--sl-radius-control);
    box-shadow: var(--sl-shadow-panel);
    color: var(--sl-color-text);
}

.toastui-editor-context-menu .menu-group {
    border-bottom: 1px solid var(--sl-color-border);
}

.toastui-editor-context-menu .menu-item:hover {
    background-color: var(--sl-color-bg-soft);
}

/* ===== Vendor alignment: states, focus, markdown syntax ===== */
.ProseMirror .placeholder,
.toastui-editor-contents-placeholder::before {
    color: var(--sl-field-placeholder);
}

.toastui-editor-defaultUI button:focus-visible,
.sl-toastui-window-head button.sl-toastui-window-action:focus-visible,
.sl-editor-emoji-tab:focus-visible,
.sl-editor-emoji-item:focus-visible {
    box-shadow: 0 0 0 3px var(--sl-field-focus-ring);
    outline: 0;
}

.sl-editor-emoji-search:focus {
    border-color: var(--sl-field-focus);
    box-shadow: 0 0 0 3px var(--sl-field-focus-ring);
    outline: 0;
}

.toastui-editor-contents .toastui-editor-md-preview-highlight::after {
    background-color: color-mix(in srgb, var(--sl-color-primary) 14%, transparent);
}

.toastui-editor-contents th.toastui-editor-md-preview-highlight,
.toastui-editor-contents td.toastui-editor-md-preview-highlight {
    background-color: color-mix(in srgb, var(--sl-color-primary) 14%, transparent);
}

.toastui-editor-md-delimiter,
.toastui-editor-md-thematic-break,
.toastui-editor-md-link,
.toastui-editor-md-table,
.toastui-editor-md-block-quote {
    color: color-mix(in srgb, var(--sl-color-text-muted) 60%, transparent);
}

.toastui-editor-md-meta,
.toastui-editor-md-html,
.toastui-editor-md-link.toastui-editor-md-link-url.toastui-editor-md-marked-text {
    color: var(--sl-color-text-muted);
}

.toastui-editor-ww-code-block-language {
    background-color: var(--sl-color-bg);
    border: 1px solid var(--sl-color-border-strong);
    border-radius: var(--sl-radius-control);
}

.toastui-editor-custom-block .toastui-editor-custom-block-editor {
    background: var(--sl-color-bg-soft);
    border: solid 1px var(--sl-color-border-strong);
    color: var(--sl-color-text);
}

.toastui-editor-custom-block.ProseMirror-selectednode .toastui-editor-custom-block-view {
    border: solid 1px var(--sl-color-border-strong);
    border-radius: var(--sl-radius-control);
}

.toastui-editor-tooltip {
    background-color: var(--sl-color-text);
    border-radius: var(--sl-radius-control);
    color: var(--sl-color-bg);
}

.toastui-editor-tooltip .arrow {
    background-color: var(--sl-color-text);
}

/* ===== Vendor alignment: WYSIWYG content, light color pass only ===== */
.toastui-editor-contents h1,
.toastui-editor-contents h2,
.toastui-editor-contents h3,
.toastui-editor-contents h4,
.toastui-editor-contents h5,
.toastui-editor-contents h6 {
    color: var(--sl-color-text-heading);
}

.toastui-editor-contents h1 {
    border-bottom-color: var(--sl-color-border-strong);
}

.toastui-editor-contents h2 {
    border-bottom-color: var(--sl-color-border);
}

.toastui-editor-contents p {
    color: var(--sl-color-text);
}

.toastui-editor-contents del {
    color: var(--sl-color-text-muted);
}

.toastui-editor-contents blockquote {
    border-left-color: var(--sl-color-border-strong);
}

.toastui-editor-contents blockquote,
.toastui-editor-contents blockquote p,
.toastui-editor-contents blockquote ul,
.toastui-editor-contents blockquote ol {
    color: var(--sl-color-text-muted);
}

.toastui-editor-contents pre {
    background-color: var(--sl-color-bg-soft);
}

.toastui-editor-contents code {
    background-color: var(--sl-color-bg-soft);
    border-radius: var(--sl-radius-control);
    color: var(--sl-color-primary);
}

.toastui-editor-contents table {
    border-color: var(--sl-color-border);
    color: var(--sl-color-text);
}

.toastui-editor-contents table th,
.toastui-editor-contents table td {
    border-color: var(--sl-color-border);
}

.toastui-editor-contents table th,
.toastui-editor-contents th p {
    background-color: var(--sl-color-bg-soft);
    color: var(--sl-color-text);
}

.toastui-editor-contents td.toastui-editor-cell-selected {
    background-color: color-mix(in srgb, var(--sl-color-primary) 14%, transparent);
}

.toastui-editor-contents th.toastui-editor-cell-selected {
    background-color: color-mix(in srgb, var(--sl-color-primary) 24%, transparent);
}

.toastui-editor-contents hr {
    border-top-color: var(--sl-color-border-strong);
}

.toastui-editor-contents a {
    color: var(--sl-color-primary);
}

.toastui-editor-contents a:hover {
    color: var(--sl-color-primary-hover);
}
