/* R.S Films Group — text/layout containment only. Theme remains unchanged. */
html,body,#root{width:100%;max-width:100vw;min-width:0!important;overflow-x:clip!important}
*,*::before,*::after{box-sizing:border-box}
.app-shell,.admin-shell,.content,.admin-content,.dashboard,.admin-dashboard{min-width:0!important}
.content,.admin-content{max-width:100%!important;overflow-x:hidden!important}
.app-shell.artist-portal{width:100%!important;max-width:100vw!important;overflow-x:clip!important}
.artist-portal .sidebar{left:0!important;right:auto!important}
.artist-portal .content{min-width:0!important;max-width:calc(100vw - 248px)!important}
.dashboard,.admin-dashboard{width:100%!important;max-width:100%!important;margin-left:auto!important;margin-right:auto!important}
.dashboard>*,.admin-dashboard>*,.upload-layout,.meta-form,.panel,.e-card,.rsx-analytics-workspace,.rsx-support-page{min-width:0!important;max-width:100%!important}
.upload-layout{grid-template-columns:minmax(210px,260px) minmax(0,1fr)!important;align-items:start!important}
.upload-layout>.steps,.upload-layout>.meta-form{min-width:0!important;width:100%!important}
.meta-form{overflow:hidden!important}
.form-head{min-width:0!important;padding-right:24px!important}
.form-head h2,.form-head p,.welcome h1,.welcome span,.admin-title h1,.admin-title span,.panel h1,.panel h2,.panel h3{max-width:100%!important;white-space:normal!important;overflow-wrap:break-word!important;word-break:normal!important}
.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;min-width:0!important}
.field,.field input,.field select,.field textarea,.upload-box{min-width:0!important;width:100%!important;max-width:100%!important}
.e-section-head,.panel-head,.rsx-performance-head,.rsx-support-toolbar{min-width:0!important;max-width:100%!important;gap:16px!important}
.e-section-head>*,.panel-head>*,.rsx-performance-head>*,.rsx-support-toolbar>*{min-width:0!important}
.e-filterbar,.rsx-analytics-controls{min-width:0!important;max-width:100%!important;flex-wrap:wrap!important}
.e-table,.deep-table,.rsf-agreements-table{max-width:100%!important;overflow-x:auto!important}
.e-table table,.deep-table table{width:100%!important}
.rsx-support-list,.rsx-support-thread,.rsx-support-compose{min-width:0!important;max-width:100%!important}
.rsx-support-toolbar h2,.rsx-support-toolbar p,.ticket-row span,.ticket-row strong{white-space:normal!important;overflow-wrap:anywhere!important}
@media(max-width:1180px){.upload-layout{grid-template-columns:220px minmax(0,1fr)!important}.dashboard,.admin-dashboard{padding-left:24px!important;padding-right:24px!important}}
@media(max-width:1000px) and (min-width:901px){.artist-portal .content{max-width:calc(100vw - 230px)!important}.artist-portal .upload-layout{grid-template-columns:1fr!important}.artist-portal .upload-layout>.steps{position:static!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important}.artist-portal .upload-layout>.meta-form{grid-column:1!important}}
@media(max-width:900px){.artist-portal .sidebar{display:none!important}.artist-portal .content{width:100%!important;max-width:100vw!important;margin-left:0!important}.artist-portal .content>header{width:100%!important;max-width:100vw!important;margin-left:0!important}}
@media(max-width:900px){.upload-layout{grid-template-columns:1fr!important}.form-grid{grid-template-columns:1fr!important}.dashboard,.admin-dashboard{padding-left:16px!important;padding-right:16px!important}.e-section-head,.panel-head,.rsx-performance-head,.rsx-support-toolbar{align-items:flex-start!important;flex-direction:column!important}.e-section-head>button,.panel-head>button,.rsx-support-toolbar>button{align-self:flex-start!important}}
@media(max-width:520px){.dashboard,.admin-dashboard{padding-left:12px!important;padding-right:12px!important}.form-head{padding-left:18px!important;padding-right:18px!important}.meta-form{border-radius:12px!important}}

/* Exact header fixes from the deployed-page screenshots. */
.artist-portal .meta-form fieldset>.form-head,
.artist-portal .meta-form .form-head{
  display:block!important;
  width:100%!important;
  margin:0!important;
  padding:24px 28px 20px!important;
  border-bottom:1px solid #e6ebee!important;
  background:#fff!important;
}
.artist-portal .meta-form .form-head h2{
  margin:0 0 5px!important;
  padding:0!important;
  font-size:20px!important;
  line-height:1.35!important;
}
.artist-portal .meta-form .form-head p{
  margin:0!important;
  padding:0!important;
  line-height:1.55!important;
}
.artist-portal .rsx-performance,
.artist-portal .dsp-performance{
  overflow:hidden!important;
}
.artist-portal .rsx-performance-head,
.artist-portal .dsp-performance>header{
  display:block!important;
  width:100%!important;
  margin:0!important;
  padding:22px 24px 16px!important;
}
.artist-portal .rsx-performance-head>small,
.artist-portal .dsp-performance>header>p:first-child{
  display:block!important;
  margin:0 0 6px!important;
  line-height:1.4!important;
}
.artist-portal .rsx-performance-head h2,
.artist-portal .rsx-performance-head h3,
.artist-portal .dsp-performance>header h2,
.artist-portal .dsp-performance>header h3{
  margin:0 0 4px!important;
  line-height:1.35!important;
}
.artist-portal .rsx-performance-head p,
.artist-portal .dsp-performance>header p{
  margin-top:0!important;
  margin-bottom:0!important;
}
.artist-portal .rsx-analytics-controls,
.artist-portal .dsp-filters{
  margin:0!important;
  padding:16px 24px!important;
}
body[data-rsf-page="Support"] .rsx-support-toolbar,
.artist-portal .rsx-support-toolbar{
  min-height:0!important;
  margin:0!important;
  padding:26px 28px!important;
  align-items:center!important;
}
body[data-rsf-page="Support"] .rsx-support-toolbar h2,
.artist-portal .rsx-support-toolbar h2{
  margin:4px 0 0!important;
  line-height:1.35!important;
}
body[data-rsf-page="Support"] .rsx-support-toolbar p,
.artist-portal .rsx-support-toolbar p{
  margin:0!important;
}
body[data-rsf-page="Support"] .rsx-support-list,
body[data-rsf-page="Support"] .rsx-support-thread{
  padding:24px 28px!important;
}
body[data-rsf-page="Support"] .artist-live-toolbar.rsx-support-toolbar{
  position:relative!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  grid-template-rows:auto auto!important;
  column-gap:22px!important;
  row-gap:2px!important;
  min-height:96px!important;
  padding:22px 24px!important;
  overflow:visible!important;
}
body[data-rsf-page="Support"] .artist-live-toolbar.rsx-support-toolbar:before{
  position:static!important;
  grid-column:1!important;
  grid-row:1!important;
  align-self:end!important;
  display:block!important;
  margin:0 0 2px!important;
  padding:0!important;
  line-height:1.35!important;
  transform:none!important;
}
body[data-rsf-page="Support"] .artist-live-toolbar.rsx-support-toolbar h2{
  grid-column:1!important;
  grid-row:2!important;
  align-self:start!important;
  margin:0!important;
  padding:0!important;
}
body[data-rsf-page="Support"] .artist-live-toolbar.rsx-support-toolbar .primary{
  grid-column:2!important;
  grid-row:1/3!important;
  align-self:center!important;
  justify-self:end!important;
  margin:0!important;
}
@media(max-width:600px){
  .artist-portal .meta-form fieldset>.form-head,.artist-portal .meta-form .form-head{padding:20px 18px 16px!important}
  .artist-portal .rsx-performance-head,.artist-portal .dsp-performance>header{padding:20px 18px 14px!important}
  .artist-portal .rsx-analytics-controls,.artist-portal .dsp-filters{padding:14px 18px!important}
  body[data-rsf-page="Support"] .rsx-support-toolbar,.artist-portal .rsx-support-toolbar{padding:22px 18px!important;align-items:flex-start!important}
  body[data-rsf-page="Support"] .artist-live-toolbar.rsx-support-toolbar{grid-template-columns:1fr!important;grid-template-rows:auto auto auto!important;row-gap:5px!important}
  body[data-rsf-page="Support"] .artist-live-toolbar.rsx-support-toolbar:before{grid-column:1!important;grid-row:1!important}
  body[data-rsf-page="Support"] .artist-live-toolbar.rsx-support-toolbar h2{grid-column:1!important;grid-row:2!important}
  body[data-rsf-page="Support"] .artist-live-toolbar.rsx-support-toolbar .primary{grid-column:1!important;grid-row:3!important;justify-self:start!important;margin-top:8px!important}
}

/* V16: mobile-only Release pipeline containment. */
@media(max-width:600px){
  .artist-portal .rsx-catalog-health{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    padding:20px 16px!important;
    overflow:hidden!important;
  }
  .artist-portal .rsx-catalog-health>h3{
    width:100%!important;
    margin:7px 0 16px!important;
    text-align:left!important;
    font-size:20px!important;
  }
  .artist-portal .rsx-pipeline{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    min-width:0!important;
    gap:8px!important;
  }
  .artist-portal .rsx-pipeline>button{
    display:grid!important;
    grid-template-columns:42px minmax(0,1fr) 18px!important;
    width:100%!important;
    min-width:0!important;
    min-height:62px!important;
    padding:10px 12px!important;
    gap:10px!important;
    overflow:hidden!important;
  }
  .artist-portal .rsx-pipeline>button>strong,
  .artist-portal .rsx-pipeline>button>span,
  .artist-portal .rsx-pipeline>button small{
    min-width:0!important;
    max-width:100%!important;
    white-space:normal!important;
    overflow-wrap:break-word!important;
  }
  .artist-portal .rsx-pipeline>button>span{font-size:12px!important;line-height:1.3!important}
  .artist-portal .rsx-pipeline>button small{font-size:10px!important;line-height:1.35!important}
  .artist-portal .rsx-health-note{
    display:block!important;
    width:100%!important;
    margin:14px 0 0!important;
    padding:14px!important;
  }
}

/* V15 mobile shell correction. Keeps the existing desktop theme unchanged. */
@media(max-width:900px){
  html,body,#root,.app-shell,.admin-shell{width:100%!important;max-width:100vw!important;min-width:0!important;overflow-x:hidden!important}

  .artist-portal .sidebar,
  .admin-shell .admin-sidebar{
    display:flex!important;
    flex-direction:column!important;
    position:fixed!important;
    inset:0 auto 0 0!important;
    width:min(280px,86vw)!important;
    max-width:86vw!important;
    height:100dvh!important;
    transform:translateX(-105%)!important;
    transition:transform .24s ease!important;
    overflow-y:auto!important;
    z-index:120!important;
  }
  .artist-portal .sidebar.open,
  .admin-shell .admin-sidebar.open{transform:translateX(0)!important}

  .artist-portal .content,
  .admin-shell .admin-content{
    width:100%!important;
    max-width:100vw!important;
    min-width:0!important;
    margin-left:0!important;
    overflow-x:hidden!important;
  }
  .artist-portal .content>header,
  .admin-shell .admin-content>header{
    width:100%!important;
    max-width:100vw!important;
    min-height:64px!important;
    margin:0!important;
    padding:0 14px!important;
  }
  .artist-portal .menu-button,
  .admin-shell .menu-button{display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important}
  .artist-portal .mobile-close,
  .admin-shell .mobile-close{display:flex!important;align-items:center!important;justify-content:center!important}
  .artist-portal .backdrop,
  .admin-shell .backdrop{position:fixed!important;inset:0!important;display:block!important;background:rgba(3,17,25,.52)!important;z-index:110!important}

  .artist-portal .content>header .search,
  .admin-shell .admin-search{display:none!important}
  .artist-portal .head-actions{margin-left:auto!important;min-width:0!important}
  .artist-portal .profile-button .profile{display:none!important}

  .artist-portal .dashboard,
  .admin-shell .admin-dashboard{width:100%!important;max-width:100%!important;padding:18px 14px 36px!important;margin:0!important}
  .artist-portal .welcome,
  .admin-shell .admin-title{align-items:flex-start!important;gap:12px!important;flex-wrap:wrap!important}
  .artist-portal .welcome h1,
  .admin-shell .admin-title h1{font-size:26px!important;line-height:1.15!important}

  .artist-portal .upload-layout{display:block!important;width:100%!important}
  .artist-portal .upload-layout>.steps{
    position:static!important;
    display:flex!important;
    width:100%!important;
    max-width:100%!important;
    margin:0 0 14px!important;
    padding:8px!important;
    gap:7px!important;
    overflow-x:auto!important;
    overscroll-behavior-inline:contain!important;
  }
  .artist-portal .upload-layout>.steps button{flex:0 0 150px!important;min-width:150px!important;padding:11px!important}
  .artist-portal .upload-layout>.meta-form{width:100%!important;max-width:100%!important;margin:0!important}
  .artist-portal .form-grid{grid-template-columns:minmax(0,1fr)!important}
  .artist-portal .form-body{padding-left:16px!important;padding-right:16px!important}
  .artist-portal .form-actions{gap:10px!important;padding:14px 16px!important;flex-wrap:wrap!important}
  .artist-portal .form-actions button{max-width:100%!important}

  .artist-portal .e-table,
  .artist-portal .deep-table,
  .artist-portal .rsf-agreements-table,
  .admin-shell .admin-release-table{width:100%!important;max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
  .artist-portal table,
  .admin-shell table{min-width:680px}
  .artist-portal input,.artist-portal select,.artist-portal textarea,
  .admin-shell input,.admin-shell select,.admin-shell textarea{max-width:100%!important;font-size:16px!important}
}

@media(max-width:600px){
  .artist-portal .dashboard,.admin-shell .admin-dashboard{padding:14px 10px 30px!important}
  .artist-portal .welcome>.primary,.admin-shell .admin-title-actions{width:100%!important}
  .artist-portal .welcome>.primary button,.admin-shell .admin-title-actions button{max-width:100%!important}
  body[data-rsf-page="Support"] .artist-live-toolbar.rsx-support-toolbar{padding:18px 16px!important}
  body[data-rsf-page="Support"] .artist-live-toolbar.rsx-support-toolbar .primary{width:auto!important;max-width:100%!important}
}
