/* Studio iframe chrome — loaded by tool pages when embedded */
html.studio-embed nav.top-navbar,
html.studio-embed .top-navbar,
html.studio-embed #mf-nav-app,
html.studio-embed .navbar-container,
html.studio-embed .navbar-left,
html.studio-embed .navbar-right,
html.studio-embed .navbar-links,
html.studio-embed .header-actions,
html.studio-embed .user-avatar-container,
html.studio-embed .landing-section,
html.studio-embed .studio-promo-section,
html.studio-embed .doc-showcase-section,
html.studio-embed .faq-section,
html.studio-embed footer,
html.studio-embed .site-footer,
html.studio-embed .editable-figure-notice,
html.studio-embed .promo-badge,
html.studio-embed .nav-feature-link,
html.studio-embed .language-switcher,
html.studio-embed .mobile-menu-toggle {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

html.studio-embed,
html.studio-embed body {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

html.studio-embed .page-container,
html.studio-embed .page-container.doc-converter-layout {
    padding-top: 0 !important;
    min-height: 0 !important;
}

/* LaTeX Equation Editor — show only the core editor workspace in Studio iframe */
html.studio-embed .latex-landing,
html.studio-embed .site-footer,
html.studio-embed footer.site-footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Fill Studio iframe height so the LaTeX input stretches to the workspace bottom */
html.studio-embed:has(.main-container),
html.studio-embed:has(.main-container) body {
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    background: #f5f3ef;
}

html.studio-embed .main-container {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0.75rem 1rem 1rem !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

html.studio-embed .main-container .input-card {
    flex: 1 1 auto !important;
    height: 100% !important;
    min-height: 0 !important;
}

html.studio-embed .main-container .editor-box {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

html.studio-embed .main-container .editor-stack {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
}

html.studio-embed .main-container .highlight-layer,
html.studio-embed .main-container .latex-input {
    min-height: 0 !important;
}

html.studio-embed .editor-upload-hint {
    max-width: min(460px, calc(100% - 28px));
}

html.studio-embed[data-theme="dark"]:has(.main-container),
html.studio-embed[data-theme="dark"]:has(.main-container) body {
    background: #161412 !important;
}
