.editor-container {
    z-index: 5;
    position: absolute;
    container-type: inline-size;
    container-name: editor;
    padding: 20px;
    width: var(--editor-container-width);
    height: var(--editor-container-height);
    /* border: var(--border); */
    border-radius: 14px;
    background: var(--body-bg);
    box-shadow: var(--box-shadow);
    overflow-x: hidden;
    overflow-y: auto;
    transition: max-width 0.5s ease-in-out;
}

.editor-header {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    text-align: left;
    min-height: 36px;
    margin-bottom: 6px;
    width: 100%;
    cursor: move;
}

.editor-header-btns {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.editor-compact-menu {
    display: none;
}

.editor-compact-menu .dropdown-menu {
    padding: 8px;
}

.editor-compact-menu .dropdown-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 8px;
}

.editor-compact-menu .dropdown-menu .editor-narrow-action {
    display: none;
}

@media (max-width: 560px) {
    .editor-container {
        padding: 12px;
    }
}

@container editor (max-width: 560px) {
    .editor-header-btns {
        gap: 3px;
    }

    .editor-header-btns > button,
    .editor-header-btns > .dropdown > button {
        width: 40px;
        height: 40px;
        padding: 8px;
    }

    .editor-header-btns > #editorCopyBtn,
    .editor-header-btns > #editorSaveBtn,
    .editor-header-btns > #editorCleanBtn {
        display: none !important;
    }

    .editor-compact-menu {
        display: inline-flex;
    }
}

@container editor (max-width: 340px) {
    .editor-header-btns > #editorUndoBtn,
    .editor-header-btns > #editorRedoBtn {
        display: none !important;
    }

    .editor-compact-menu .dropdown-menu .editor-narrow-action {
        display: flex;
    }
}

.editor {
    height: var(--editor-height) !important;
    color: white !important;
    border-radius: 0px 0px 10px 10px; /* Top-left, top-right, bottom-right, bottom-left */
    border: var(--border) !important;
    box-shadow: var(--box-shadow) !important;
}

.ql-toolbar {
    background: rgba(0, 0, 0, 0.4) !important;
    color: white !important;
    border-radius: 10px 10px 0px 0px; /* Top-left, top-right, bottom-right, bottom-left */
    border: var(--border) !important;
    margin-top: 6px;
}

/* Optional: Customize code block appearance */
.ql-snow .ql-code-block-container {
    padding: 4px !important;
    font-family: monospace;
    margin-bottom: 20px !important;
    border-radius: 4px !important;
    /* border: var(--border) !important; */
    background: var(--select-bg) !important;
    box-shadow: var(--box-shadow) !important;
}

.ql-snow .ql-code-block {
    font-family: monospace;
}

/* Private Note mode visual indicator (local-only editor, not broadcasted) */
.editor-container.editor-private-mode {
    box-shadow:
        inset 3px 0 0 0 #ffb300,
        var(--box-shadow);
}
.editor-container.editor-private-mode::before {
    content: 'PRIVATE NOTE — not shared';
    position: absolute;
    top: 12px;
    left: 20px;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: bold;
    color: #ffb300;
    pointer-events: none;
    z-index: 6;
    line-height: 36px;
}
.editor-container.editor-private-mode .editor-header {
    padding-left: 180px;
}
@container editor (max-width: 500px) {
    .editor-container.editor-private-mode::before {
        line-height: normal;
    }

    .editor-container.editor-private-mode .editor-header {
        min-height: 68px;
        padding-top: 28px;
        padding-left: 0;
    }
}
.editor-container.editor-private-mode #editorPrivateBtn {
    color: #ffb300 !important;
}
/* In private mode hide media/embed toolbar buttons to keep notes light (text-only) */
.editor-container.editor-private-mode .ql-toolbar .ql-image,
.editor-container.editor-private-mode .ql-toolbar .ql-video,
.editor-container.editor-private-mode .ql-toolbar .ql-formula,
.editor-container.editor-private-mode .ql-toolbar .ql-code-block {
    display: none !important;
}

.ql-toolbar button:hover {
    background: var(--body-bg) !important;
}

.ql-picker-options {
    color: white;
    border: none !important;
    border-radius: 14px;
    background: var(--body-bg);
    box-shadow: var(--box-shadow) !important;
}

select.ql-ui {
    padding: 5px 10px !important;
    color: #fff !important;
    height: 30px;
    border: var(--border);
    border-radius: var(--select-border-radius);
    background-color: var(--select-bg) !important;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

select.ql-ui:focus,
select.ql-ui:focus-visible {
    outline: none;
    border-color: var(--select-focus-color);
    box-shadow: 0 0 0 2px var(--select-focus-color);
}
