/* Shared presentation contract. Matrix internals keep their specialist renderer. */
:root{--rms-form-width:1040px;--rms-form-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;--rms-form-title:22px;--rms-form-gap:20px;--rms-form-radius:14px}
html{scrollbar-gutter:stable}
@media(min-width:901px){
 body:has(>#sidebar):not(.analysis-page):not([data-rms-embedded])>main{
  width:calc(100% - var(--rms-sidebar-width,160px))!important;max-width:1480px;
  margin-left:calc(var(--rms-sidebar-width,160px) + max(0px,(100% - var(--rms-sidebar-width,160px) - 1480px)/2))!important;
  margin-right:auto!important;padding-inline:clamp(.75rem,1.25vw,1.5rem);
 }
 body[data-width=narrow]:has(>#sidebar):not([data-rms-embedded])>main{max-width:none;margin-left:var(--rms-sidebar-width,160px)!important}
}
/* Native forms share the same whole canvas, including advanced tuning below its iframe. */
html[data-rms-workspace=form] [data-testid=stMain] [data-testid=stMainBlockContainer]{
 width:100%!important;max-width:var(--rms-form-width)!important;margin:0 auto!important;
 padding:28px 24px 60px!important;box-sizing:border-box!important;
}
html[data-rms-workspace=form] [data-testid=stMainBlockContainer] :is(div,p,h1,h2,h3,h4,label,input,button,select,textarea){font-family:var(--rms-form-font)!important}
html[data-rms-workspace=form] [data-testid=stMainBlockContainer]{font-size:13px}
html[data-rms-workspace=form] .rms-page-head,html[data-rms-workspace=form] #analysis-main>header{display:block!important;margin:0 0 20px!important;padding:0!important;width:100%!important;max-width:none!important}
html[data-rms-workspace=form] .rms-page-head .title,html[data-rms-workspace=form] #analysis-main h1,html[data-rms-workspace=form] body>h1{font-family:var(--rms-form-font)!important;font-size:22px!important;font-weight:800!important;line-height:1.2!important;letter-spacing:-.02em;margin:0!important}
html[data-rms-workspace=form] :is(.rms-page-head .subtitle,.rms-room-config-subtitle,.rms-pricing-subtitle),html[data-rms-workspace=form] #analysis-main>header p{font-size:13px!important;font-weight:400!important;line-height:1.35!important;color:#667085!important;padding:0!important;margin:3px 0 20px!important;width:100%!important;max-width:none!important}
html[data-rms-workspace=form] .rms-page-head:has(.subtitle){margin-bottom:20px!important}
html[data-rms-workspace=form] .rms-page-head .subtitle{margin-bottom:0!important}
html[data-rms-workspace=form] [data-testid=stMainBlockContainer]:has(.rms-pricing-subtitle,.rms-room-config-subtitle) .rms-page-head{margin-bottom:0!important}
html[data-rms-workspace=form] [data-testid=stMainBlockContainer]:has(.rms-pricing-subtitle,.rms-room-config-subtitle) [data-testid=stMarkdownContainer]:has(>.rms-page-head){margin-bottom:0!important}
html[data-rms-workspace=form] :is(.rms-pricing-subtitle,.rms-room-config-subtitle){margin-top:0!important}
html[data-rms-workspace=form] :is(.st-key-room_config_month_card,.st-key-room_config_compact_upload,.st-key-room_config_compact_table,.st-key-room_config_help_card,.st-key-room_config_summary_row){width:100%!important;max-width:none!important;margin-inline:0!important;box-sizing:border-box!important}
html[data-rms-workspace=form] :is([class*=st-key-rms_basic_],[class*=st-key-room_config_]){min-width:0}
html[data-rms-workspace=form] [data-testid=stMainBlockContainer] [class*=st-key-rms_engine_tuning_component_]{margin-top:0!important}
html[data-rms-workspace=form] [data-testid=stExpander]{border-radius:14px}
html[data-rms-workspace=form] :is(h2,h3,.rms-section-head .title){font-size:14px!important;font-weight:700!important;line-height:1.35}
html[data-rms-workspace] [data-testid=stMainBlockContainer]>[data-testid=stVerticalBlock]>[data-testid=stElementContainer]:has(>[data-testid=stHtml]>#rms-shell-screen){position:absolute!important;width:0!important;height:0!important;overflow:hidden!important}
html[data-rms-workspace] [data-testid=stMainBlockContainer]>[data-testid=stVerticalBlock]>[class*=st-key-rms_shell_bridge]{position:absolute!important;width:0!important;height:0!important;overflow:hidden!important}
/* Embedded documents have no local sidebar; centre their content in their own viewport. */
html[data-rms-workspace=form] body[data-rms-embedded=report]{width:100%;max-width:1040px;margin:0 auto;padding:28px 24px 60px;font:13px var(--rms-form-font);box-sizing:border-box}
html[data-rms-workspace=form] body[data-rms-embedded=report]>h1{margin-bottom:20px!important}
html[data-rms-workspace=form] body[data-rms-embedded=report] :is(#controls,#report){border-radius:14px;padding:16px}
html[data-rms-workspace=form] body[data-rms-embedded=report] :is(button,input,select){font:inherit;min-height:34px;padding:7px 12px}
html[data-rms-workspace=form] #analysis-main{width:100%!important;max-width:1040px!important;margin:0 auto!important;padding:28px 24px 60px!important;box-sizing:border-box}
html[data-rms-workspace=form] #analysis-main :is(input,select,button){min-height:34px}
/* Its parent owns the 1040px canvas and padding; no nested second inset. */
html[data-rms-workspace=form-component]{scrollbar-gutter:auto}
html[data-rms-workspace=form-component] .page{width:100%;max-width:none!important;margin:0!important;padding:0!important;gap:20px}
html[data-rms-workspace=form-component] .title{font:800 22px/1.2 var(--rms-form-font);letter-spacing:-.02em;margin:0}
html[data-rms-workspace=form-component] .subtitle{font:400 13px/1.35 var(--rms-form-font);margin-top:3px;color:#667085}
/* Scoped portals are invisible during a transition and outside their owner route. */
[data-rms-portal-hidden]{display:none!important}
@media(max-width:700px){
 html[data-rms-workspace=form] [data-testid=stMain] [data-testid=stMainBlockContainer],html[data-rms-workspace=form] #analysis-main,html[data-rms-workspace=form] body[data-rms-embedded=report]{padding:18px 12px 36px!important}
}

/* Pure stylesheet blocks must not consume a Streamlit row gap. */
html[data-rms-workspace=form] [data-testid=stMainBlockContainer] [data-testid=stElementContainer]:has([data-testid=stMarkdownContainer]>style):not(:has([data-testid=stMarkdownContainer]>:not(style))){position:absolute!important;width:0!important;height:0!important;min-height:0!important;overflow:hidden!important}
/* Native Markdown's negative bottom margin must not overlap a section heading. */
html[data-rms-workspace=form] [data-testid=stMarkdownContainer]:has(>.rms-section-head,>.rms-pricing-section-title){margin-bottom:0!important}
html[data-rms-workspace=form] [data-testid=stMainBlockContainer] [class*=st-key-rms_basic_] [data-testid=stButton]>button{height:auto!important;min-height:34px;max-height:none!important}

/* Shared matrix heading only; cell typography and the selected width stay native. */
html[data-rms-workspace=matrix][data-rms-embedded=native] [data-testid=stMainBlockContainer]{padding-top:28px!important}
html[data-rms-workspace=matrix][data-rms-embedded=native] .rms-page-head{display:block!important;padding:0!important;margin:0 0 20px!important}
html[data-rms-workspace=matrix][data-rms-embedded=native] .rms-page-head .title{font:800 22px/1.2 var(--rms-form-font)!important;letter-spacing:-.02em}
html[data-rms-workspace=matrix][data-rms-embedded=native] [data-testid=stMainBlockContainer]>[data-testid=stVerticalBlock]>[data-testid=stElementContainer]:has([data-testid=stMarkdownContainer]>style):not(:has([data-testid=stMarkdownContainer]>:not(style))){position:absolute!important;width:0!important;height:0!important;min-height:0!important;overflow:hidden!important}

html[data-rms-workspace=matrix][data-rms-embedded=native] .rms-page-head .subtitle{font:400 13px/1.35 var(--rms-form-font)!important;color:#667085!important;margin:3px 0 0!important;padding:0!important}
