#editorjs .codex-editor,
#editorjs .ce-block {
    color: var(--sbd-text);
}
#editorjs {
    --selectionColor: var(--sbd-accent-soft);
}

#editorjs .ce-block--selected .ce-block__content,
#editorjs .cdx-settings-button--focused {
    background-color: var(--sbd-accent-soft) !important;
}
html .ce-popover,
html .ce-popover__container,
html .ce-inline-toolbar,
html .ce-conversion-toolbar,
html .ce-settings {
    --color-border: var(--sbd-border);
    --color-shadow: var(--sbd-accent-glow);
    --color-background: var(--sbd-bg-elevated);
    --color-text-primary: var(--sbd-text);
    --color-text-secondary: var(--sbd-text-muted);
    --color-border-icon: var(--sbd-border);
    --color-border-icon-disabled: var(--sbd-border);
    --color-background-item-hover: var(--sbd-accent-soft);
    --color-background-item-focus: var(--sbd-accent-soft);
    --color-shadow-item-focus: var(--sbd-accent-glow);
    --color-background-icon-active: var(--sbd-accent-soft);
    --color-text-icon-active: var(--sbd-accent);
    --color-active-icon: var(--sbd-accent);
}

html .ce-popover__container,
html .ce-inline-toolbar,
html .ce-conversion-toolbar,
html .ce-settings {
    border: 1px solid var(--sbd-border);
    background: var(--sbd-bg-elevated);
    color: var(--sbd-text);
    box-shadow: var(--sbd-shadow-md);
}

html .ce-popover-item__title,
html .ce-popover-item__secondary-title,
html .ce-inline-tool,
html .ce-conversion-tool__icon,
#editorjs .ce-toolbar__plus,
#editorjs .ce-toolbar__settings-btn {
    color: var(--sbd-text);
}

html .ce-popover-item:hover,
html .ce-popover-item--focused,
html .ce-inline-tool:hover,
html .ce-conversion-tool:hover,
#editorjs .ce-toolbar__plus:hover,
#editorjs .ce-toolbar__settings-btn:hover {
    background: var(--sbd-accent-soft);
}

html .ce-popover-item__icon,
html .ce-conversion-tool__icon {
    border: 1px solid var(--sbd-border);
    background: var(--sbd-bg-surface);
    color: var(--sbd-text);
}
html .ce-popover .cdx-search-field {
    border-color: var(--sbd-border);
    background: var(--sbd-bg-glass);
}

html .ce-popover .cdx-search-field__input {
    color: var(--sbd-text);
}

html .ce-popover .cdx-search-field__input::placeholder {
    color: var(--sbd-text-muted);
}
#editorjs .cdx-input,
#editorjs .image-tool__caption,
#editorjs .cdx-quote__text,
#editorjs .cdx-quote__caption {
    border-color: var(--sbd-border);
    background: var(--sbd-bg-glass);
    color: var(--sbd-text);
    box-shadow: none;
}

#editorjs .cdx-input::placeholder,
#editorjs [contenteditable].cdx-input[data-placeholder]::before {
    color: var(--sbd-text-muted);
}
#editorjs .cdx-button {
    border-color: var(--sbd-border);
    background: var(--sbd-bg-glass);
    color: var(--sbd-text);
}

#editorjs .cdx-button:hover {
    background: var(--sbd-bg-elevated);
}
#editorjs .ce-code__textarea {
    border-color: var(--sbd-border);
    background: var(--sbd-bg-surface);
    color: var(--sbd-text);
}
html .ce-inline-tool-input {
    background: var(--sbd-bg-glass);
    color: var(--sbd-text);
}

html .ce-inline-tool-input::placeholder {
    color: var(--sbd-text-muted);
}

#editorjs .tc-wrap {
    --color-background: var(--sbd-bg-glass);
    --color-text-secondary: var(--sbd-text-muted);
    --color-border: var(--sbd-border);
}

#editorjs .tc-table,
#editorjs .tc-row,
#editorjs .tc-cell {
    border-color: var(--sbd-border);
}

#editorjs .tc-cell {
    color: var(--sbd-text);
}

#editorjs .tc-row--selected,
#editorjs .tc-cell--selected {
    background-color: var(--sbd-accent-soft);
}

#editorjs .tc-toolbox__toggler {
    color: var(--sbd-text-muted);
}

#editorjs .tc-add-column,
#editorjs .tc-add-row {
    background: var(--sbd-bg-glass);
    color: var(--sbd-text-muted);
}

#editorjs .tc-add-column:hover,
#editorjs .tc-add-row:hover {
    background: var(--sbd-accent-soft);
}
html .tc-popover {
    --color-border: var(--sbd-border);
    --color-background: var(--sbd-bg-elevated);
    --color-background-hover: var(--sbd-accent-soft);
    --color-text-primary: var(--sbd-text);

    border: 1px solid var(--sbd-border);
    background: var(--sbd-bg-elevated);
    color: var(--sbd-text);
    box-shadow: var(--sbd-shadow-md);
}

html .tc-popover__item:hover,
html .tc-popover__item--confirm {
    background-color: var(--sbd-accent-soft);
}

html .tc-popover__item-label {
    color: var(--sbd-text);
}

html .tc-popover__item-icon {
    border: 1px solid var(--sbd-border);
    background: var(--sbd-bg-surface);
    color: var(--sbd-text);
}

#editorjs .sbd-rc-field {
    min-height: 1.6em;
    outline: none;
}

#editorjs .sbd-rc-field:empty::before {
    content: attr(data-placeholder);
    color: var(--sbd-text-muted);
    pointer-events: none;
}

#editorjs .sbd-rc-eyebrow {
    color: var(--sbd-accent);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
#editorjs .sbd-rc-note {
    color: var(--sbd-text-secondary);
    font-size: 0.85rem;
}
#editorjs .sbd-rc-panel,
#editorjs .sbd-rc-steps__item {
    padding: 0.85rem 1rem;
    border: 1px solid var(--sbd-border);
    border-radius: 0.6rem;
    background: var(--sbd-bg-elevated);
    color: var(--sbd-text);
}

#editorjs .sbd-rc-steps__item + .sbd-rc-steps__item {
    margin-top: 0.6rem;
}

#editorjs .sbd-rc-panel__title,
#editorjs .sbd-rc-steps__title {
    font-weight: 600;
}

#editorjs .sbd-rc-panel__text,
#editorjs .sbd-rc-steps__what {
    margin-top: 0.35rem;
}

#editorjs .sbd-rc-steps__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#editorjs .sbd-rc-steps__icon {
    max-width: 12rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--sbd-border);
    border-radius: 0.4rem;
    background-color: var(--sbd-bg-surface);
    color: var(--sbd-text);
    font-size: 0.875rem;
}

#editorjs .sbd-rc-steps__actions {
    display: flex;
    gap: 0.25rem;
}

#editorjs .sbd-rc-steps__btn {
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 1px solid var(--sbd-border);
    border-radius: 0.4rem;
    background: var(--sbd-bg-surface);
    color: var(--sbd-text);
    line-height: 1;
}

#editorjs .sbd-rc-steps__btn:hover:not(:disabled) {
    border-color: var(--sbd-accent);
    color: var(--sbd-accent);
}

#editorjs .sbd-rc-steps__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
#editorjs .sbd-rc-steps__why {
    margin-top: 0.5rem;
    padding: 0.5rem 0.7rem;
    border-left: 2px solid var(--sbd-accent);
    border-radius: 0 0.4rem 0.4rem 0;
    background: var(--sbd-accent-softer);
    font-size: 0.9rem;
}

#editorjs .sbd-rc-steps__add {
    margin-top: 0.6rem;
}

.sbd-image-tool__img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.6rem;
}

.sbd-image-tool__placeholder {
    display: block;
    width: 100%;
    padding: 1.5rem;
    border: 1px dashed var(--sbd-border-hover);
    border-radius: 0.6rem;
    background: var(--sbd-bg-elevated);
    color: var(--sbd-text-secondary);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.sbd-image-tool__placeholder:hover {
    border-color: var(--sbd-accent);
    color: var(--sbd-text);
}
#editorjs .sbd-image-tool__caption {
    margin-top: 0.5rem;
}
#editorjs .sbd-image-tool__change,
#editorjs .sbd-video-tool__change {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--sbd-accent);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

#editorjs .sbd-image-tool__change:hover,
#editorjs .sbd-video-tool__change:hover {
    text-decoration: underline;
}
#editorjs .sbd-video-tool__frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 0.6rem;
    overflow: hidden;
    background: var(--sbd-bg-elevated);
}

#editorjs .sbd-video-tool__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
#editorjs .sbd-video-tool__hint {
    margin: 0.35rem 0 0;
    color: var(--sbd-alert-warning-text);
    font-size: 0.8125rem;
}
