/* Phase 05: shared content geometry; shell/navigation/player remain owned by Phases 02–04. */
:root {
  --mx-content-max:1440px;
  --mx-page-gutter:clamp(12px, 2vw, 32px);
  --mx-space-1:4px; --mx-space-2:8px; --mx-space-3:12px;
  --mx-space-4:16px; --mx-space-5:24px; --mx-space-6:32px;
  --mx-grid-gap:clamp(8px, 1.5vw, 16px);
  --mx-control-min:44px;
}
@media(max-width:479px){:root{--mx-page-gutter:12px}}
@media(min-width:480px) and (max-width:767px){:root{--mx-page-gutter:16px}}
@media(min-width:768px) and (max-width:1023px){:root{--mx-page-gutter:20px}}
/* Scope to normal app content. No changes to fixed headers/nav, auth, launch or playback. */
html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page {
  box-sizing:border-box!important;
  width:100%!important; min-width:0!important; max-width:var(--mx-content-max)!important;
  margin-inline:auto!important;
}
/* Base boundary applies to known section wrappers, not arbitrary carousel items. */
html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page > :is(.mxso-page,.mxss-screen,.flutter-watch-screen,.flutter-more-screen,.flutter-media-screen,.screen-panel,.watch-page,.airplay-monitor,.magic-monitor-report-screen,.jobs-page,.mx-wizard,.mx-support,.flutter-history-screen,.mxv3-library,.mx-vendor-store,.mx-fl-wrap,.app-screen-copy,.mxj-detail) {
  box-sizing:border-box!important; min-width:0!important; max-width:100%!important;
  width:100%; margin-inline:auto!important;
}
html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(.grid,.mx-fl-tv-category-grid,.mx-fl-tv-channel-list,.flutter-market-grid,.market-niche-grid,.market-v2-latest-grid,.jobs-grid,.mm-report-grid,.mx-form-grid,.mx-downloads-grid,.award-grid,.mxso-grid,.flutter-more-featured,.flutter-watch-list,.detail-layout,.media-detail,.split,.split-sections,.mx-grid,.djd-grid,.mx-wiz-choice-grid,.mx-wiz-tile-grid,.home-action-grid,.home-step-grid,.home-search-grid) {
  min-width:0!important; max-width:100%!important; box-sizing:border-box!important;
}
html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(.grid,.mx-fl-tv-category-grid,.mx-fl-tv-channel-list,.flutter-market-grid,.market-niche-grid,.market-v2-latest-grid,.jobs-grid,.mm-report-grid,.mx-form-grid,.mx-downloads-grid,.award-grid,.mxso-grid,.flutter-more-featured,.flutter-watch-list,.detail-layout,.media-detail,.split,.split-sections,.mx-grid,.djd-grid,.mx-wiz-choice-grid,.mx-wiz-tile-grid,.home-action-grid,.home-step-grid,.home-search-grid) > * {min-width:0!important;box-sizing:border-box!important;}
/* Let regular media shrink; don't alter aspect ratios, cropping choices or player internals. */
html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(img,video,canvas,iframe) {max-width:100%!important;}
html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(h1,h2,h3,h4,p,label,.media-detail-copy,.mx-fl-tv-channel-info,.flutter-watch-copy) {min-width:0;overflow-wrap:anywhere;}
html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(form,.form,.mx-listing-form,.filters,.mx-form-grid,.xtra-search-wrap) {min-width:0!important;max-width:100%!important;}
html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(input:not([type=checkbox],[type=radio],[type=range],[type=color]),select,textarea) {box-sizing:border-box!important;min-width:0!important;max-width:100%!important;}
html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(.rail,.horizontal-grid,.market-recommended-row,.watch-filter-tabs,.listen-tabs) {min-width:0!important;max-width:100%!important;overflow-x:auto!important;}
/* Explicitly opt-in for actual tabular reports; never clip the whole page to mask overflow. */
html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(.table-responsive,.table-scroll,.mx-table-scroll) {max-width:100%;overflow-x:auto;}
@media(max-width:767px){
  html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page > :is(.mxso-page,.mxss-screen,.flutter-watch-screen,.flutter-more-screen,.flutter-media-screen,.magic-monitor-report-screen,.jobs-page,.mx-wizard,.mx-support,.flutter-history-screen) {padding-inline:var(--mx-page-gutter)!important;}
  html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(.detail-layout,.media-detail):not(.mx-djpool-detail) {grid-template-columns:minmax(0,1fr)!important;}
  html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(.mx-form-grid,.split,.split-sections) {grid-template-columns:minmax(0,1fr)!important;}
  html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(.filters,.media-detail-actions) {flex-wrap:wrap;}
  html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page :is(.form,.mx-listing-form) :is(input:not([type=checkbox],[type=radio],[type=range],[type=color],[type=hidden]),textarea,select) {font-size:max(16px,1em)!important;min-height:var(--mx-control-min);}
}
/* Keep desktop/tablet native service layouts while sharing their page boundary. */
@media(min-width:768px){
  html body:not(.auth-route,.mx-auth-mockup,.video-playback-active,.mxso-launching):not(:has(.mx-flutter-login)) > #app.app-shell > #page.page > :is(.mxso-page,.mxss-screen,.flutter-watch-screen,.flutter-more-screen,.flutter-media-screen,.magic-monitor-report-screen,.jobs-page,.mx-wizard,.mx-support,.flutter-history-screen) {padding-inline:var(--mx-page-gutter)!important;}
}
