
/* ============================================================
 * Question authoring toolbar — secondary tools
 * ============================================================ */

.delta-rich-editor__toolbar-more {
    position: relative;
    flex: 0 0 auto;
}

.delta-rich-editor__toolbar-more > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid rgba(127, 127, 127, 0.28);
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    user-select: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.delta-rich-editor__toolbar-more > summary::-webkit-details-marker {
    display: none;
}

.delta-rich-editor__toolbar-more > summary::after {
    content: "▾";
    margin-left: 7px;
    font-size: 10px;
    opacity: 0.65;
}

.delta-rich-editor__toolbar-more[open] > summary {
    background: rgba(127, 127, 127, 0.10);
}

.delta-rich-editor__toolbar-more-content {
    position: absolute;
    z-index: 50;
    top: calc(100% + 8px);
    right: 0;

    display: flex;
    flex-direction: column;
    gap: 10px;

    width: max-content;
    min-width: 280px;
    max-width: min(520px, calc(100vw - 48px));

    padding: 12px;

    border: 1px solid rgba(127, 127, 127, 0.24);
    border-radius: 10px;

    background: var(
        --delta-surface,
        #ffffff
    );

    box-shadow:
        0 12px 32px
        rgba(0, 0, 0, 0.14);
}

/* The editor surface clips overflow. Render the “Mais” tools in the
   browser top layer and keep the whole panel inside the visible viewport. */
.delta-rich-editor__toolbar-more-content[popover]:not(:popover-open) {
    display: none;
}

.delta-rich-editor__toolbar-more-content[popover]:popover-open {
    position: fixed;
    inset: auto;
    z-index: 12000;
    display: flex;
    box-sizing: border-box;
    margin: 0;
    right: auto;
    bottom: auto;
    min-width: min(280px, calc(100vw - 24px));
    max-width: min(520px, calc(100vw - 24px));
    max-height: min(65dvh, 480px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.delta-rich-editor__toolbar-more-content
.delta-rich-editor__toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.delta-rich-editor__toolbar-more-content select {
    min-height: 34px;
}

@media (max-width: 720px) {
    .delta-rich-editor__toolbar-more-content {
        position: fixed;
        top: auto;
        right: 16px;
        bottom: 16px;
        left: 16px;

        width: auto;
        min-width: 0;
        max-width: none;
    }

    .delta-rich-editor__toolbar-more-content[popover]:popover-open {
        width: calc(100vw - 24px);
        min-width: 0;
        max-width: none;
        max-height: min(65dvh, 480px);
    }
}

/* Fallback for browsers without the Popover API. */
.delta-rich-editor__toolbar-more--fallback-open .delta-rich-editor__toolbar-more-content {
    position: fixed;
    right: auto;
    bottom: auto;
    z-index: 12000;
    max-height: min(65vh, 480px);
    overflow: auto;
}


/* ============================================================
 * DELTA-KATEX-INLINE-POLISH-V3
 *
 * Keep inline mathematical expressions in the same typographic
 * flow as the surrounding prose.
 * ============================================================ */

.delta-math-expression--inline {
    display: inline-block;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
    line-height: inherit;
}

.delta-math-expression--inline .katex {
    font-size: 1em;
    line-height: 1;
}

.delta-math-expression--inline .katex-display {
    display: inline;
    margin: 0;
}

.delta-math-expression--block {
    display: block;
    width: 100%;
}

