/*
 * Admin panel–only styling for the live math preview panel shown beneath each RichEditor.
 * Registered as a Filament asset — see App\Providers\AppServiceProvider::boot().
 */

/*
 * Filament's `.fi-fo-rich-editor-main` wrapper switches to `flex-row` on wide screens so
 * that its own built-in side panel (custom blocks / tables / etc, `.fi-fo-rich-editor-panels`)
 * can sit beside the editor content. Our injected preview panel is appended as another
 * sibling inside that same wrapper, so without this override it also gets squeezed into a
 * narrow side column instead of appearing as a full-width strip below the editor. Force
 * column layout — and natural (non-reversed) child order — only on editors that actually
 * have our preview panel attached.
 */
.fi-fo-rich-editor-main:has(> .fisat-math-live-preview) {
    flex-direction: column !important;
}

.fisat-math-live-preview {
    display: none;
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-self: stretch;
    margin-top: 0;
    border: 1px solid #e5e7eb;
    border-top: 2px dashed #c7d2fe;
    border-radius: 0 0 0.5rem 0.5rem;
    background: #fafafa;
    overflow: hidden;
}
.dark .fisat-math-live-preview {
    border-color: #374151;
    border-top-color: #4338ca;
    background: #111827;
}
.fisat-math-live-preview-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.75rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    user-select: none;
    background: #eef2ff;
}
.dark .fisat-math-live-preview-label {
    background: #1e1b4b;
    color: #818cf8;
}
.fisat-math-live-preview-body {
    padding: 0.625rem 1rem 0.75rem;
    font-size: 0.95rem;
    color: #1f2937;
    line-height: 1.75;
    overflow-x: auto;
    word-break: break-word;
}
.dark .fisat-math-live-preview-body {
    color: #e5e7eb;
}
.fisat-math-live-preview-body .katex-display {
    margin: 0.4em 0;
}
.fisat-math-live-preview-body p {
    margin: 0 0 0.4em;
}
.fisat-math-live-preview-body p:last-child {
    margin-bottom: 0;
}
