/* Inline analytics belong to the existing Properties and Agents tabs.
   No new global navigation items; existing immersive tools untouched. */
#propertiesView.is-active,#agentsView.is-active{
 display:flex!important;flex-direction:column!important;min-height:0;
}
.v2-inline-table-tabs{
 flex:0 0 auto;display:flex;align-items:center;gap:8px;
 background:#fff;padding:9px 13px;border-bottom:1px solid #d5e2eb;
 overflow:auto hidden;-webkit-overflow-scrolling:touch;
 position:relative;z-index:10;
}
.v2-inline-table-tabs button{
 border:1px solid #cfdee8;border-radius:9px;padding:9px 13px;
 background:#f6fafd;color:#264d65;cursor:pointer;
 font:650 12px AiDubai,Dubai,Arial,sans-serif;white-space:nowrap;
 min-height:40px;
}
.v2-inline-table-tabs button[aria-pressed="true"]{
 background:#203b50;color:#fff;border-color:#203b50;
}
.v2-inline-market-frame{
 display:none;box-sizing:border-box;flex:1 1 auto;min-width:0;min-height:0;
 width:100%;height:100%;border:0;background:#f4f7fa;
}
#propertiesView[data-inline-mode="table"]>iframe.v2-inline-market-frame,
#agentsView[data-inline-mode="table"]>iframe.v2-inline-market-frame{display:block!important}
#propertiesView[data-inline-mode="table"]>iframe.service-frame,
#propertiesView[data-inline-mode="table"]>.service-mini-actions{display:none!important}
#agentsView[data-inline-mode="table"]>.v2-professionals-toolbar,
#agentsView[data-inline-mode="table"]>.v2-professionals-main{display:none!important}
#propertiesView[data-inline-mode="list"]>iframe.v2-inline-market-frame,
#agentsView[data-inline-mode="list"]>iframe.v2-inline-market-frame{display:none!important}
#propertiesView[data-inline-mode="list"]>iframe.service-frame{flex:1 1 auto;min-height:0}
@media(max-width:650px){
 .v2-inline-table-tabs{gap:6px;padding:7px;max-width:100%}
 .v2-inline-table-tabs button{flex:1 1 0;padding:7px 9px;font-size:11px;white-space:normal}
}
/* Move legacy property action icons below the nested tab strip: never cover Table button. */
#propertiesView[data-inline-mode="list"]>.service-mini-actions{top:63px!important}
@media(max-width:650px){#propertiesView[data-inline-mode="list"]>.service-mini-actions{top:59px!important}}

/* Dedicated Map sub-tabs: initialize only when user opens Map, no extra engines in background. */
.v2-inline-map-panel{display:none!important;box-sizing:border-box;flex-direction:column;flex:1 1 auto;
 min-width:0;min-height:0;overflow:hidden;background:#eef4f8}
#propertiesView[data-inline-mode="map"]>div.v2-inline-map-panel,
#agentsView[data-inline-mode="map"]>div.v2-inline-map-panel{display:flex!important}
#propertiesView[data-inline-mode="map"]>.service-mini-actions,
#propertiesView[data-inline-mode="map"]>iframe.service-frame,
#propertiesView[data-inline-mode="map"]>iframe.v2-inline-market-frame,
#agentsView[data-inline-mode="map"]>.v2-professionals-toolbar,
#agentsView[data-inline-mode="map"]>.v2-professionals-main,
#agentsView[data-inline-mode="map"]>iframe.v2-inline-market-frame{display:none!important}
.v2-inline-map-panel[hidden]{display:none!important}
.v2-inline-map-toolbar{flex:0 0 auto;display:flex;flex-wrap:wrap;align-items:end;gap:7px;
 padding:7px 9px;border-bottom:1px solid #d4e2ed;background:#fff;position:relative;z-index:2}
.v2-inline-map-toolbar label{display:flex;flex:0 1 200px;min-width:105px;max-width:260px;
 flex-direction:column;gap:3px;color:#5a7588;font:600 10px AiDubai,Dubai,Arial,sans-serif}
.v2-inline-map-toolbar label.v2-inline-map-find{flex:1 1 160px}
.v2-inline-map-toolbar select,.v2-inline-map-toolbar input,
.v2-inline-map-toolbar>button{min-height:36px;box-sizing:border-box;border:1px solid #c9dbe7;
 border-radius:9px;background:#fff;color:#23445c;padding:7px 9px;
 font:600 12px AiDubai,Dubai,Arial,sans-serif;min-width:0;width:100%}
.v2-inline-map-toolbar>button{width:auto;flex:0 0 auto;cursor:pointer;background:#203b50;color:#fff;border-color:#203b50}
.v2-inline-map-toolbar>button:hover{background:#335975}
.v2-inline-map-toolbar :disabled{opacity:.48;cursor:default}
.v2-inline-map-canvas{flex:1 1 auto;min-height:250px;height:100%;width:100%;background:#dce5e9;
 touch-action:pan-x pan-y;position:relative;z-index:1}
.v2-inline-map-status{flex:0 0 auto;margin:0;padding:9px 12px;background:#fff;border-top:1px solid #d4e2ed;
 color:#315b74;font:500 11px/1.5 AiDubai,Dubai,Arial,sans-serif;min-height:33px;overflow-wrap:anywhere}
.v2-inline-map-canvas .leaflet-popup-content{font:13px/1.5 AiDubai,Dubai,Arial,sans-serif;min-width:150px}
.v2-inline-map-canvas .v2-inline-map-source{font-size:11px;color:#66869a}
.v2-inline-map-canvas .v2-inline-map-source a{font-weight:700;color:#116d94}
.v2-inline-map-toolbar select:focus-visible,.v2-inline-map-toolbar button:focus-visible,
.v2-inline-map-toolbar input:focus-visible{outline:2px solid #4798c6;outline-offset:2px}
@media(max-width:650px){
 .v2-inline-map-toolbar{padding:6px;gap:5px}
 .v2-inline-map-toolbar label{flex:1 1 calc(50% - 6px);max-width:none;font-size:9px}
 .v2-inline-map-toolbar label.v2-inline-map-find{flex:1 1 100%}
 .v2-inline-map-toolbar select,.v2-inline-map-toolbar input,.v2-inline-map-toolbar>button{
  min-height:35px;font-size:11px;padding:6px 7px}
 .v2-inline-map-toolbar>button{flex:1 1 calc(50% - 6px)}
 .v2-inline-map-status{font-size:10px;padding:6px 8px}
 .v2-inline-map-canvas{min-height:200px}
}

/* Fix 2026-11-15: the 500px minimum .stage plus 100dvh min-height on
   .app-shell created a SECOND page scrollbar around the embedded report.
   Keep just the report iframe scrollable and use exactly the visible viewport. */
body.v2-inline-report-active{
 height:100dvh!important;max-height:100dvh!important;
 min-height:0!important;overflow:hidden!important;overscroll-behavior:none!important;
}
body.v2-inline-report-active .app-shell{
 display:flex!important;flex-direction:column!important;
 width:100%!important;height:100dvh!important;max-height:100dvh!important;
 min-height:0!important;overflow:hidden!important;
}
body.v2-inline-report-active .app-header,
body.v2-inline-report-active .market-ticker,
body.v2-inline-report-active .workspace-nav{
 flex:0 0 auto!important;
}
body.v2-inline-report-active .stage{
 display:block!important;position:relative!important;
 flex:1 1 0%!important;height:0!important;min-height:0!important;
 max-height:none!important;overflow:hidden!important;
}
body.v2-inline-report-active #propertiesView.is-active,
body.v2-inline-report-active #agentsView.is-active{
 min-width:0!important;min-height:0!important;height:100%!important;
 overflow:hidden!important;overscroll-behavior:contain!important;
}
body.v2-inline-report-active #propertiesView[data-inline-mode="table"]>iframe.v2-inline-market-frame,
body.v2-inline-report-active #agentsView[data-inline-mode="table"]>iframe.v2-inline-market-frame{
 display:block!important;flex:1 1 0%!important;
 width:100%!important;height:0!important;max-height:100%!important;
 min-width:0!important;min-height:0!important;overflow:auto!important;
 border:0!important;scrollbar-gutter:stable;
}
/* The analytics iframe already has a title. Hide the redundant giant Agents
   hero only in TABLE or MAP mode; leave normal Agents/Agencies design intact. */
#agentsView.v2-unified-layout[data-inline-mode="table"]>.v2-unified-hero,
#agentsView.v2-unified-layout[data-inline-mode="map"]>.v2-unified-hero{
 display:none!important;
}
body.v2-inline-report-active #agentsView[data-inline-mode="table"]>.v2-inline-table-tabs,
body.v2-inline-report-active #propertiesView[data-inline-mode="table"]>.v2-inline-table-tabs{
 flex:0 0 auto!important;position:relative!important;z-index:10!important;
}
@media(max-width:650px){
 body.v2-inline-report-active .app-shell{height:100dvh!important;}
 body.v2-inline-report-active .stage{min-height:0!important;}
 body.v2-inline-report-active #agentsView[data-inline-mode="table"]>iframe.v2-inline-market-frame,
 body.v2-inline-report-active #propertiesView[data-inline-mode="table"]>iframe.v2-inline-market-frame{
  min-height:0!important;scrollbar-gutter:auto;
 }
}


/* AI HOMES directory scroll recovery (2026-11-16).
 * In Agents list and Agencies, the document owns scrolling, not an inner
 * 40px-tall card viewport. Scoped only to these two directory views;
 * Properties iframe, report mode and immersive Map/AR/Meter/Drone unchanged. */
body.v2-directory-page-scroll:not(.fullscreen-fallback):not(.v2-radar-immersive):not(.v2-meter-classic){
 height:auto!important;min-height:100dvh!important;max-height:none!important;
 overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:auto!important;
}
body.v2-directory-page-scroll:not(.fullscreen-fallback) .app-shell{
 height:auto!important;min-height:100dvh!important;max-height:none!important;overflow:visible!important;
}
body.v2-directory-page-scroll:not(.fullscreen-fallback) .stage{
 position:relative!important;height:auto!important;min-height:calc(100dvh - 158px)!important;
 max-height:none!important;overflow:visible!important;
}
body.v2-directory-page-scroll:not(.fullscreen-fallback) #agentsView.is-active,
body.v2-directory-page-scroll:not(.fullscreen-fallback) #agenciesView.is-active{
 display:flex!important;flex-direction:column!important;position:relative!important;inset:auto!important;
 width:100%!important;height:auto!important;min-height:calc(100dvh - 158px)!important;
 max-height:none!important;overflow:visible!important;
}
body.v2-directory-page-scroll:not(.fullscreen-fallback) #agentsView.is-active .v2-professionals-main,
body.v2-directory-page-scroll:not(.fullscreen-fallback) #agenciesView.is-active .v2-professionals-main{
 flex:0 0 auto!important;height:auto!important;min-height:0!important;max-height:none!important;
 overflow:visible!important;overscroll-behavior:auto!important;
}
body.v2-directory-page-scroll:not(.fullscreen-fallback) .v2-professionals-grid{
 height:auto!important;max-height:none!important;overflow:visible!important;
}
body.v2-directory-page-scroll:not(.fullscreen-fallback) :is(#agentsView,#agenciesView).v2-unified-layout>.v2-unified-hero{
 min-height:100px!important;padding:16px 20px!important;margin:10px 16px!important;
}
body.v2-directory-page-scroll:not(.fullscreen-fallback) :is(#agentsView,#agenciesView).v2-unified-layout .v2-unified-title{
 font-size:clamp(25px,2.7vw,34px)!important;
}
@media(max-width:650px){
 body.v2-directory-page-scroll:not(.fullscreen-fallback) .stage,
 body.v2-directory-page-scroll:not(.fullscreen-fallback) :is(#agentsView,#agenciesView).is-active{
  min-height:calc(100dvh - 138px)!important;
 }
 body.v2-directory-page-scroll:not(.fullscreen-fallback) :is(#agentsView,#agenciesView).v2-unified-layout>.v2-unified-hero{
  min-height:86px!important;margin:8px 9px!important;padding:12px 14px!important;
 }
}
