/* RichEditor: toolbar wraps, editor is resizable vertically */
.fi-fo-rich-editor {
    overflow: visible !important;
}
/* The input wrapper clips children — override for rich editor only */
.fi-fo-rich-editor.fi-input-wrp,
.fi-fo-field-wrp:has(.fi-fo-rich-editor) .fi-input-wrp {
    overflow: visible !important;
}
/* Toolbar must wrap and stay within bounds */
.fi-fo-rich-editor-toolbar {
    flex-wrap: wrap !important;
    overflow: visible !important;
    min-width: 0 !important;
    max-width: 100% !important;
}
.fi-fo-rich-editor-toolbar-group {
    flex-wrap: wrap !important;
}
/* Make the editor content area vertically resizable */
.fi-fo-rich-editor-content {
    min-height: 8rem !important;
    resize: vertical;
    overflow: auto;
}
.fi-fo-rich-editor-content .ProseMirror,
.fi-fo-rich-editor-content .tiptap {
    min-height: 7rem;
    height: 100%;
}

/* KaTeX math block styling inside Tiptap/RichEditor */
.tiptap .math-inline,
.ProseMirror .math-inline {
    display: inline;
    padding: 0 2px;
}
.tiptap .math-block,
.ProseMirror .math-block {
    display: block;
    text-align: center;
    margin: 0.75rem 0;
    padding: 0.5rem;
}
/* Rendered math content inside RichEditor */
.fi-fo-rich-editor .katex { font-size: 1.1em; }
.fi-fo-rich-editor .katex-display { margin: 0.5em 0; }
/* Render KaTeX in displayed (non-editing) HTML too */
.prose .katex { font-size: 1.1em; }
.prose .katex-display { margin: 0.5em 0; }

/* ── Number inputs: hide spin buttons globally ── */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}
