/* NOKOR REUNG v275: movie-only viewport containment; loaded after mobile-shell.css. */
html[data-player-page="1"] .video-wrap video{object-fit:contain!important}
html[data-player-page="1"] #qualityMenu.quality-menu{
 display:flex;flex-direction:column;box-sizing:border-box;
 max-height:var(--nr-player-menu-height,min(380px,calc(100% - 70px)))!important;
 width:min(246px,calc(100% - 20px))!important;overflow:visible!important;bottom:var(--nr-player-menu-bottom,66px)!important;
}
html[data-player-page="1"] #qualityMenu .quality-menu-title{flex:0 0 auto;cursor:pointer}
html[data-player-page="1"] #qualityOptions{
 flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;
 overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;
}
html[data-player-page="1"] #qualityOptions>.quality-option{flex:0 0 auto}
html[data-player-page="1"] #qualityMenu .quality-auto{border-radius:9px!important;margin-top:4px!important}
html[data-player-page="1"].nr-player-compact .movie-topbar{
 position:relative!important;top:auto!important;margin:8px auto 10px!important;
 display:flex!important;width:calc(100% - 24px)!important;max-width:none!important;
 height:58px!important;min-height:58px!important;padding:0 10px!important;
 gap:12px!important;border-radius:18px!important;transform:none!important;
 opacity:1!important;z-index:1!important;pointer-events:auto!important;
}
html[data-player-page="1"].nr-player-compact .movie-topbar nav,
html[data-player-page="1"].nr-player-compact .movie-topbar .brand-copy,
html[data-player-page="1"].nr-player-compact .movie-topbar .header-account{display:none!important}
html[data-player-page="1"].nr-player-compact .movie-topbar .header-search{margin-left:auto!important;width:40px!important;height:40px!important;flex:0 0 40px}
html[data-player-page="1"].nr-player-compact .movie-topbar .brand-mark{width:36px!important;height:36px!important}
html[data-player-page="1"].nr-player-compact .movie-page{width:100%;max-width:100%;min-width:0;padding-left:12px!important;padding-right:12px!important}
html[data-player-page="1"].nr-player-compact .detail-layout{display:block!important;min-width:0}
html[data-player-page="1"].nr-player-compact .player-card{margin:0!important;width:100%;min-width:0;max-width:100%}
html[data-player-page="1"].nr-player-compact #qualityMenu.quality-menu{width:min(220px,calc(100% - 20px))!important;right:8px!important;bottom:var(--nr-player-menu-bottom,66px)!important}
html[data-player-page="1"].nr-player-compact #qualityMenu .quality-menu-title{height:28px!important;min-height:28px!important;margin-bottom:4px!important;font-size:12px!important}
html[data-player-page="1"].nr-player-compact #qualityMenu .quality-option{min-height:38px!important;padding:0 10px!important}
html[data-player-page="1"].nr-player-compact #qualityMenu .quality-option strong{font-size:12px!important}
html[data-player-page="1"].nr-player-viewing .movie-bottom{display:none!important;visibility:hidden!important;pointer-events:none!important}
.nr-player-exit{display:none}
html[data-player-page="1"].nr-player-theater{overflow:hidden!important;overscroll-behavior:none}
html[data-player-page="1"].nr-player-theater body{overflow:hidden!important;overscroll-behavior:none}
html[data-player-page="1"].nr-player-theater .movie-topbar,
html[data-player-page="1"].nr-player-theater .movie-bottom{display:none!important;visibility:hidden!important;pointer-events:none!important}
html[data-player-page="1"].nr-player-theater .player-card{
 position:fixed!important;z-index:300!important;
 top:var(--nr-player-viewport-top,0px)!important;
 left:var(--nr-player-viewport-left,0px)!important;
 width:var(--nr-player-viewport-width,100vw)!important;
 height:var(--nr-player-viewport-height,100dvh)!important;
 max-width:none!important;min-height:0!important;margin:0!important;
 border:0!important;border-radius:0!important;background:#000!important;
}
html[data-player-page="1"].nr-player-theater .player-head{display:none!important}
html[data-player-page="1"].nr-player-theater #videoWrap{
 position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
 min-height:0!important;aspect-ratio:auto!important;border:0!important;border-radius:0!important;
 overflow:hidden!important;background:#000!important;
}
html[data-player-page="1"].nr-player-theater .player-controls{
 left:max(12px,env(safe-area-inset-left,0px))!important;
 right:max(12px,env(safe-area-inset-right,0px))!important;
 bottom:max(6px,var(--cg-tg-safe-bottom,0px),env(safe-area-inset-bottom,0px))!important;
}
html[data-player-page="1"].nr-player-theater .nr-player-exit{
 display:flex;align-items:center;justify-content:center;gap:6px;position:absolute;
 left:max(12px,env(safe-area-inset-left,0px));top:max(10px,var(--cg-tg-safe-top,0px),env(safe-area-inset-top,0px));
 z-index:45;height:36px;padding:0 11px;border:1px solid #ffffff35;border-radius:12px;
 background:#0b0d12d9;color:#fff;font-size:12px;pointer-events:auto;touch-action:manipulation;
}
html[data-player-page="1"].nr-player-theater .nr-player-exit svg{width:17px;height:17px}
html[data-player-page="1"].nr-player-theater #qualityMenu{right:max(10px,env(safe-area-inset-right,0px))!important}
html[data-player-page="1"].nr-player-native-fullscreen .movie-topbar,
html[data-player-page="1"].nr-player-native-fullscreen .movie-bottom{display:none!important}

/* v293: YouTube-style fullscreen. Fit the full frame by default; user may Zoom to Fill. */
html[data-player-page="1"].nr-player-theater .video-wrap video,
html[data-player-page="1"].nr-player-native-fullscreen .video-wrap video,
html[data-player-page="1"][data-player-fullscreen="telegram"] .video-wrap video,
html[data-player-page="1"][data-player-fullscreen="browser"] .video-wrap video{
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  object-position:center center!important;
}
html[data-player-page="1"].nr-player-zoom-fill.nr-player-theater .video-wrap video,
html[data-player-page="1"].nr-player-zoom-fill.nr-player-native-fullscreen .video-wrap video,
html[data-player-page="1"].nr-player-zoom-fill[data-player-fullscreen="telegram"] .video-wrap video,
html[data-player-page="1"].nr-player-zoom-fill[data-player-fullscreen="browser"] .video-wrap video{
  object-fit:cover!important;
}
html[data-player-page="1"].nr-player-theater #videoWrap{touch-action:none!important}
html[data-player-page="1"] .player-zoom-btn{display:none!important}
html[data-player-page="1"].nr-player-theater .player-zoom-btn,
html[data-player-page="1"][data-player-fullscreen="telegram"] .player-zoom-btn,
html[data-player-page="1"][data-player-fullscreen="browser"] .player-zoom-btn{
  display:grid!important;
}
html[data-player-page="1"] .player-zoom-btn.active{
  background:#ffffff18!important;
  color:#ffd24c!important;
}
html[data-player-page="1"][data-player-fullscreen="telegram"] .nr-player-exit,
html[data-player-page="1"].tg-fullscreen.nr-player-theater .nr-player-exit{
  display:none!important;
}
@media(max-width:430px){
  html[data-player-page="1"] .skip-btn,
  html[data-player-page="1"].nr-player-theater .player-zoom-btn{
    display:grid!important;
    width:34px!important;
    min-width:34px!important;
    height:34px!important;
    min-height:34px!important;
  }
  html[data-player-page="1"] .skip-btn small{font-size:7px!important}
}

@media(max-width:340px){
  html[data-player-page="1"].nr-player-theater .controls-row{gap:1px!important}
  html[data-player-page="1"].nr-player-theater .controls-left,
  html[data-player-page="1"].nr-player-theater .controls-right{gap:0!important}
  html[data-player-page="1"].nr-player-theater .control-btn,
  html[data-player-page="1"].nr-player-theater .quality-settings-btn,
  html[data-player-page="1"].nr-player-theater .player-zoom-btn{
    width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important
  }
  html[data-player-page="1"].nr-player-theater .speed-chip{
    min-width:30px!important;height:32px!important;padding:0 4px!important
  }
  html[data-player-page="1"].nr-player-theater .time-label,
  html[data-player-page="1"].nr-player-theater .time-label b{font-size:7px!important}
}

/* v287: NOKOR REUNG quality menu — compact dark player UI on desktop/mobile. */
html[data-player-page="1"] #qualityMenu.quality-menu{
  width:min(196px,calc(100% - 18px))!important;
  padding:7px!important;
  border:1px solid #2d3743!important;
  border-radius:13px!important;
  background:rgba(13,18,24,.98)!important;
  color:#eef2f6!important;
  box-shadow:0 18px 48px #000b!important;
  overflow:visible!important;
}
html[data-player-page="1"] #qualityMenu.quality-menu:after{
  right:17px!important;bottom:-7px!important;width:13px!important;height:13px!important;
  background:#0d1218!important;border-right:1px solid #2d3743!important;border-bottom:1px solid #2d3743!important;
}
html[data-player-page="1"] #qualityMenu .quality-menu-title{
  height:31px!important;min-height:31px!important;margin:0 2px 5px!important;padding:0 5px!important;
  gap:8px!important;color:#e7ebf0!important;font-size:11px!important;font-weight:800!important;
  border-bottom:1px solid #242d37!important;
}
html[data-player-page="1"] #qualityMenu .quality-menu-title svg{width:14px!important;height:14px!important;color:#8f9baa!important}
html[data-player-page="1"] #qualityOptions{gap:4px!important;scrollbar-color:#3b4652 transparent}
html[data-player-page="1"] #qualityMenu .quality-option{
  min-height:36px!important;padding:0 9px!important;border:1px solid transparent!important;border-radius:9px!important;
  background:#111821!important;color:#cbd3dd!important;font-size:11px!important;font-weight:800!important;box-shadow:none!important;
}
html[data-player-page="1"] #qualityMenu .quality-option:hover:not(:disabled){background:#17212b!important;border-color:#2d3945!important}
html[data-player-page="1"] #qualityMenu .quality-option.active,
html[data-player-page="1"] #qualityMenu .quality-option.active:hover,
html[data-player-page="1"] #qualityMenu .quality-option:focus-visible{
  background:linear-gradient(135deg,#ffc94a,#ffae1f)!important;color:#171100!important;
  border-color:#ffd76b!important;box-shadow:0 7px 18px #ffb21f24,inset 0 1px 0 #fff7b055!important;
}
html[data-player-page="1"] #qualityMenu .quality-option-left{gap:8px!important}
html[data-player-page="1"] #qualityMenu .quality-option-left strong{font-size:11px!important;color:inherit!important;line-height:1!important}
html[data-player-page="1"] #qualityMenu .radio-dot{width:12px!important;height:12px!important;min-width:12px!important;background:#46515e!important;box-shadow:inset 0 0 0 1px #65717f!important}
html[data-player-page="1"] #qualityMenu .quality-option.active .radio-dot{background:#171100!important;box-shadow:inset 0 0 0 4px #fff!important}
html[data-player-page="1"] #qualityMenu .quality-option>b{
  min-width:27px!important;padding:4px 6px!important;border:1px solid #3c4855!important;border-radius:6px!important;
  background:#1d2732!important;color:#aeb9c5!important;font-size:8px!important;line-height:1!important;
}
html[data-player-page="1"] #qualityMenu .quality-option.active>b{background:#ffffff26!important;border-color:#ffffff45!important;color:#171100!important}
html[data-player-page="1"] #qualityMenu .quality-auto{margin-top:3px!important;padding-top:0!important;border-top:0!important;border-radius:9px!important}
html[data-player-page="1"] #qualityMenu .quality-empty{padding:8px 7px!important;color:#8693a2!important;font-size:8px!important;line-height:1.4!important}
html[data-player-page="1"].nr-player-compact #qualityMenu.quality-menu{width:min(186px,calc(100% - 16px))!important;right:7px!important}
html[data-player-page="1"].nr-player-compact #qualityMenu .quality-menu-title{height:29px!important;min-height:29px!important;font-size:10px!important}
html[data-player-page="1"].nr-player-compact #qualityMenu .quality-option{min-height:34px!important;padding:0 8px!important}
html[data-player-page="1"].nr-player-compact #qualityMenu .quality-option strong{font-size:10px!important}

/* v356 — Movie header size parity with the approved compact glass top bar.
   Keep the player-compact relative positioning, theater/fullscreen visibility,
   search handler and native video controls unchanged. */
@media(max-width:900px){
  html[data-player-page="1"] .movie-topbar,
  html[data-player-page="1"].nr-player-compact .movie-topbar,
  html:not([data-mini="1"])[data-player-page="1"].nr-player-compact .movie-topbar,
  html[data-mini="1"][data-player-page="1"].nr-player-compact .movie-topbar{
    width:min(540px,calc(100vw - 30px))!important;
    max-width:calc(100vw - 30px)!important;
    height:54px!important;
    min-height:54px!important;
    padding-inline:8px!important;
    border-radius:20px!important;
  }
  html[data-player-page="1"] .movie-topbar .brand-mark,
  html[data-player-page="1"].nr-player-compact .movie-topbar .brand-mark,
  html:not([data-mini="1"])[data-player-page="1"].nr-player-compact .movie-topbar .brand-mark,
  html[data-mini="1"][data-player-page="1"].nr-player-compact .movie-topbar .brand-mark{
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    flex:0 0 34px!important;
  }
}

/* v604 — Speed uses the same dark palette, sizing and row design as Quality.
   Scoped to the player page only; all playback speeds and event handling unchanged. */
html[data-player-page="1"] #speedMenu.speed-menu{
  display:flex!important;flex-direction:column!important;box-sizing:border-box!important;
  width:min(196px,calc(100% - 18px))!important;right:58px!important;
  bottom:var(--nr-player-menu-bottom,63px)!important;
  max-height:var(--nr-player-menu-height,min(380px,calc(100% - 70px)))!important;
  padding:7px!important;border:1px solid #2d3743!important;border-radius:13px!important;
  background:rgba(13,18,24,.98)!important;color:#eef2f6!important;
  box-shadow:0 18px 48px #000b!important;overflow:visible!important;
}
html[data-player-page="1"] #speedMenu.speed-menu:after{
  content:"";position:absolute;right:17px;bottom:-7px;width:13px;height:13px;
  background:#0d1218;border-right:1px solid #2d3743;border-bottom:1px solid #2d3743;
  transform:rotate(45deg);pointer-events:none;
}
html[data-player-page="1"] #speedMenu .speed-menu-title{
  flex:0 0 auto!important;box-sizing:border-box!important;
  height:31px!important;min-height:31px!important;margin:0 2px 5px!important;padding:0 5px!important;
  gap:8px!important;color:#e7ebf0!important;font-size:11px!important;font-weight:800!important;
  border-bottom:1px solid #242d37!important;
}
html[data-player-page="1"] #speedMenu .speed-menu-title svg{
  width:14px!important;height:14px!important;color:#8f9baa!important;
}
html[data-player-page="1"] #speedMenu .speed-options{
  display:flex;flex-direction:column;flex:1 1 auto;gap:4px;min-height:0;
  overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:#3b4652 transparent;
}
html[data-player-page="1"] #speedMenu .speed-option{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  flex:0 0 auto;width:100%!important;min-height:36px!important;padding:0 9px!important;
  border:1px solid transparent!important;border-radius:9px!important;
  background:#111821!important;color:#cbd3dd!important;
  font:800 11px/1.35 Inter,"Noto Sans Khmer",sans-serif!important;
  box-shadow:none!important;text-align:left!important;
}
html[data-player-page="1"] #speedMenu .speed-option:hover:not(:disabled){
  background:#17212b!important;border-color:#2d3945!important;
}
html[data-player-page="1"] #speedMenu .speed-option.active,
html[data-player-page="1"] #speedMenu .speed-option.active:hover,
html[data-player-page="1"] #speedMenu .speed-option:focus-visible{
  background:linear-gradient(135deg,#ffc94a,#ffae1f)!important;
  color:#171100!important;border-color:#ffd76b!important;
  box-shadow:0 7px 18px #ffb21f24,inset 0 1px 0 #fff7b055!important;
}
html[data-player-page="1"] #speedMenu .speed-option-left{
  display:inline-flex!important;align-items:center!important;gap:8px!important;
}
html[data-player-page="1"] #speedMenu .speed-option-left strong{
  font:800 11px/1 Inter,"Noto Sans Khmer",sans-serif!important;color:inherit!important;
}
html[data-player-page="1"] #speedMenu .speed-option .radio-dot{
  width:12px!important;height:12px!important;min-width:12px!important;
  border:0!important;border-radius:50%!important;
  background:#46515e!important;box-shadow:inset 0 0 0 1px #65717f!important;
}
html[data-player-page="1"] #speedMenu .speed-option.active .radio-dot{
  background:#171100!important;box-shadow:inset 0 0 0 4px #fff!important;
}
html[data-player-page="1"] #speedMenu .speed-option .radio-dot::after{display:none!important}
html[data-player-page="1"] #speedMenu .speed-option>b{
  min-width:27px!important;padding:4px 6px!important;box-sizing:border-box!important;
  border:1px solid #3c4855!important;border-radius:6px!important;
  background:#1d2732!important;color:#aeb9c5!important;
  font:800 8px/1 Inter,sans-serif!important;text-align:center!important;
}
html[data-player-page="1"] #speedMenu .speed-option.active>b{
  background:#ffffff26!important;border-color:#ffffff45!important;color:#171100!important;
}
@media(max-width:850px){
  html[data-player-page="1"] #speedMenu.speed-menu{
    width:min(196px,calc(100% - 16px))!important;right:7px!important;
    bottom:var(--nr-player-menu-bottom,50px)!important;
    max-height:var(--nr-player-menu-height,calc(100% - 58px))!important;
  }
}
html[data-player-page="1"].nr-player-compact #speedMenu.speed-menu{
  width:min(186px,calc(100% - 16px))!important;right:7px!important;
  bottom:var(--nr-player-menu-bottom,66px)!important;
}
html[data-player-page="1"].nr-player-compact #speedMenu .speed-menu-title{
  height:29px!important;min-height:29px!important;font-size:10px!important;
}
html[data-player-page="1"].nr-player-compact #speedMenu .speed-option{
  min-height:34px!important;padding:0 8px!important;
}
html[data-player-page="1"].nr-player-compact #speedMenu .speed-option-left strong{font-size:10px!important}
