/* 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:8px 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:8px 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:8px 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:8px!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}

/* Shared desktop canvas inset: move content up without changing title or control gaps. */
@media(min-width:768px){body:has(>#sidebar):not(.analysis-page):not([data-rms-embedded])>main{padding-top:8px!important}}

/* Existing Rate Shopper heading and status share one compact desktop row. */
html[data-rms-route="/editor/rate-shopper"] .rms-page-head:has(>.rms-rate-status-host){display:flex!important;align-items:center;gap:12px;flex-wrap:wrap}
html[data-rms-route="/editor/rate-shopper"] .rms-page-head>.rms-rate-status-host{flex:0 1 auto;min-width:0;max-width:100%}

/* Desktop labels for the two native matrix editors. */
html:is([data-rms-route="/editor/calendar"],[data-rms-route="/editor/"])[data-rms-workspace=matrix][data-rms-embedded=native] .rms-page-head .title{
 font-size:23px!important
}
html:is([data-rms-route="/editor/calendar"],[data-rms-route="/editor/"])[data-rms-workspace=matrix][data-rms-embedded=native] .rms-page-head .subtitle{
 font-size:14px!important
}
html[data-rms-route="/editor/calendar"] [class*="st-key-pricecal179_actions_"] button{font-size:calc(.8rem + 1px)!important}
html[data-rms-route="/editor/calendar"] .pricecal-preview-grid{font-size:11.4px}
html[data-rms-route="/editor/calendar"] .pricecal-history-info{font-size:calc(.82rem + 1px)}
html[data-rms-route="/editor/"] [class*="st-key-rms_availability_toolbar_"] [data-testid="stWidgetLabel"] p{font-size:14px}

/* Match the native toolbar control sizing and keep the disclosure above grids. */
.rms-editor-appearance{position:relative;width:max-content;max-width:100%;z-index:5}
.rms-editor-appearance[open]{z-index:90}
.rms-editor-appearance>summary{
 display:flex;align-items:center;gap:7px;justify-content:center;min-height:var(--rms-control-height-compact,34px);
 padding:0 10px;border:1px solid var(--rms-control-border,#dfe3e8);border-radius:var(--rms-control-radius,10px);
 background:var(--rms-control-bg,#fff);color:var(--rms-control-text,#1d2939);
 box-shadow:var(--rms-control-shadow);font-size:.8625rem;white-space:nowrap;cursor:pointer;list-style:none
}
.rms-editor-appearance>summary::-webkit-details-marker{display:none}
.rms-editor-appearance>summary::after{
 content:"";width:7px;height:7px;border:solid currentColor;border-width:0 1.6px 1.6px 0;transform:rotate(45deg) translateY(-2px)
}
.rms-editor-appearance>label{
 position:absolute;right:0;top:calc(100% + 4px);display:flex;align-items:center;gap:8px;
 width:max-content;max-width:calc(100vw - 28px);padding:9px 12px;border:1px solid var(--rms-control-border,#dfe3e8);
 border-radius:var(--rms-control-radius,10px);background:var(--rms-control-bg,#fff);box-shadow:0 4px 14px #25385822;
 font-size:13px;line-height:1.25;cursor:pointer
}
.rms-editor-appearance input{accent-color:var(--rms-accent,#2f6df0)}
html[data-rms-route="/editor/"] .rms-editor-appearance>summary{min-height:var(--rms-control-height,34px)}
