.qb-mathlive-overlay {
    position: fixed;
    inset: 0;
    /* Below MathLive's own virtual keyboard panel (z-index: 105) — that
       keyboard renders as a separate fixed-position element appended to
       <body>, outside this overlay's DOM subtree, so if our overlay sat
       above it, the keyboard would be visually darkened by our backdrop
       and unclickable (our full-viewport div would intercept the taps). */
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(15, 23, 42, 0.5);
    padding: 1rem;
}

.qb-mathlive-panel {
    width: 100%;
    max-width: 28rem;
    border-radius: 0.75rem;
    background-color: #fff;
    padding: 1.25rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.qb-mathlive-panel-title {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.qb-mathlive-field {
    display: block;
    width: 100%;
    min-height: 3rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.qb-mathlive-panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.qb-mathlive-btn {
    border-radius: 0.5rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
}

.qb-mathlive-btn-primary {
    background-color: #d97706;
    color: #fff;
}

.qb-mathlive-btn-primary:hover {
    background-color: #b45309;
}

.qb-mathlive-btn-secondary {
    background-color: #fff;
    color: #374151;
    border-color: #d1d5db;
}

.qb-mathlive-btn-secondary:hover {
    background-color: #f9fafb;
}

.qb-mathlive-btn-danger {
    background-color: #fff;
    color: #dc2626;
    border-color: #fecaca;
    margin-right: auto;
}

.qb-mathlive-btn-danger:hover {
    background-color: #fef2f2;
}

.qb-question-preview {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
}

.qb-question-preview-label {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.qb-question-preview-content {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #111827;
}

.qb-question-preview-content p {
    margin: 0 0 0.5rem;
}

.qb-question-preview-image {
    display: block;
    max-width: 100%;
    max-height: 16rem;
    margin-top: 0.75rem;
    border-radius: 0.375rem;
}

.qb-question-preview-empty {
    margin: 0;
    font-size: 0.8125rem;
    font-style: italic;
    color: #9ca3af;
}

/* MCQ option editor (CkEditorField ->compact()) — short single-line content,
   so it gets a much shorter editing area than the full question/CQ editors. */
.qb-ck-editor-host--compact .ck-editor__editable {
    min-height: 2.5rem;
}
