
/* Final visibility/moat patch: playlist-first layout, visible A-Z, bigger player, stronger vertical access */
body.mmp-finalfix .main,
body.mmp-finalfix.mmp-layout-resize .main,
body.mmp-finalfix.mmp-v2-ready .main,
body.mmp-finalfix.mmp-moat-ready .main{
  grid-template-columns: minmax(540px, 1.05fr) minmax(700px, 1.15fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
}
body.mmp-finalfix #desktopSplitter,
body.mmp-finalfix .main > #desktopSplitter{
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
body.mmp-finalfix .main > section[aria-label="Library"]{
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
}
body.mmp-finalfix .main > section[aria-label="Player"]{
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
}
body.mmp-finalfix section[aria-label="Library"].panel,
body.mmp-finalfix section[aria-label="Library"] .panel-body{
  display:flex !important;
  flex-direction:column !important;
  min-height:0 !important;
}
body.mmp-finalfix section[aria-label="Library"] .panel-header{
  padding-bottom: 8px !important;
}
body.mmp-finalfix section[aria-label="Library"] .panel-body{
  overflow:hidden !important;
}
body.mmp-finalfix section[aria-label="Library"] .panel-body > .section:first-of-type{
  flex: 0 0 auto !important;
  max-height: 156px !important;
  overflow: auto !important;
  padding-bottom: 10px !important;
  border-bottom: 1px solid rgba(148,163,184,.10) !important;
  margin-bottom: 10px !important;
  scrollbar-gutter: stable both-edges;
}
body.mmp-finalfix.mmp-finalfix-show-filters section[aria-label="Library"] .panel-body > .section:first-of-type{
  max-height: min(30vh, 320px) !important;
}
body.mmp-finalfix .mmp-final-tools{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin: 0 0 10px;
}
body.mmp-finalfix .mmp-final-tools .btn{
  min-height: 36px;
  padding: 8px 12px;
}
body.mmp-finalfix .mmp-final-tools .mmp-final-spacer{
  flex:1 1 auto;
}
body.mmp-finalfix .mmp-az-strip{
  display:grid !important;
  grid-template-columns: repeat(14, minmax(0,1fr)) !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  overflow: visible !important;
  max-width: none !important;
  padding-bottom: 0 !important;
}
body.mmp-finalfix .mmp-az-strip .btn{
  width:100% !important;
  min-width:0 !important;
  justify-content:center !important;
}
body.mmp-finalfix #libraryMeta{
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
body.mmp-finalfix #libraryMeta .mmp-meta-text{
  min-width: 220px;
  flex: 1 1 auto;
}
body.mmp-finalfix #libraryMeta .mmp-meta-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
body.mmp-finalfix #playlist{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scroll-behavior: smooth;
  scrollbar-gutter: stable both-edges;
  padding-right: 8px !important;
}
body.mmp-finalfix #playlist .item{
  min-height: 66px;
}
body.mmp-finalfix .mmp-final-rail{
  position: sticky;
  right: 0;
  bottom: 10px;
  margin-left: auto;
  width: fit-content;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  padding-top: 10px;
  z-index: 6;
  background: linear-gradient(180deg, rgba(2,6,23,0), rgba(2,6,23,.80) 45%, rgba(2,6,23,.98));
}
body.mmp-finalfix .mmp-final-rail .btn{
  min-height: 38px;
  padding: 8px 12px;
}
body.mmp-finalfix .video-stage{
  min-height: clamp(430px, 60vh, 860px) !important;
}
body.mmp-finalfix .controls{
  gap: 12px !important;
  padding-top: 14px !important;
}
body.mmp-finalfix .controls .btn{
  min-height: 46px !important;
  padding: 10px 15px !important;
  border-radius: 14px !important;
}
body.mmp-finalfix .controls .btn.icon{
  width: 46px !important;
  min-width: 46px !important;
  padding: 0 !important;
}
body.mmp-finalfix body.native-controls #videoStage,
body.mmp-finalfix #videoStage{
  border-radius: 18px;
}
@media (max-width: 1240px){
  body.mmp-finalfix .mmp-az-strip{
    grid-template-columns: repeat(9, minmax(0,1fr)) !important;
  }
}
@media (max-width: 980px){
  body.mmp-finalfix .main{
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
  }
  body.mmp-finalfix section[aria-label="Library"] .panel-body > .section:first-of-type{
    max-height: 240px !important;
  }
  body.mmp-finalfix #playlist{
    min-height: 52vh !important;
  }
  body.mmp-finalfix .video-stage{
    min-height: clamp(300px, 42vh, 560px) !important;
  }
  body.mmp-finalfix .mmp-az-strip{
    grid-template-columns: repeat(7, minmax(0,1fr)) !important;
  }
}
@media (max-width: 640px){
  body.mmp-finalfix .mmp-final-tools{
    display:grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  body.mmp-finalfix .mmp-final-tools .mmp-final-spacer{
    display:none;
  }
  body.mmp-finalfix .mmp-final-tools .btn,
  body.mmp-finalfix .mmp-final-rail .btn{
    width:100%;
    justify-content:center;
  }
  body.mmp-finalfix .mmp-az-strip{
    grid-template-columns: repeat(5, minmax(0,1fr)) !important;
  }
  body.mmp-finalfix .video-stage{
    min-height: clamp(260px, 48vw, 420px) !important;
  }
}

body.mmp-finalfix section[aria-label="Library"] .panel-body{
  height: 100% !important;
}
body.mmp-finalfix .video-stage,
body.mmp-finalfix #videoStage,
body.mmp-finalfix .player-wrap{
  width: 100% !important;
}
body.mmp-finalfix .mmp-final-tools,
body.mmp-finalfix #libraryMeta,
body.mmp-finalfix .mmp-final-rail{
  position: relative;
}
body.mmp-finalfix .mmp-final-rail{
  background: linear-gradient(180deg, rgba(2,6,23,0), rgba(2,6,23,.72) 35%, rgba(2,6,23,.96));
}
@media (min-width: 981px){
  body.mmp-finalfix .main,
  body.mmp-finalfix.mmp-layout-resize .main,
  body.mmp-finalfix.mmp-v2-ready .main,
  body.mmp-finalfix.mmp-moat-ready .main{
    grid-template-columns: minmax(560px, 1.08fr) minmax(760px, 1.16fr) !important;
  }
}
