/* Site binding only: keep source colors, columns, typography, gaps and padding. */
.source-recommend a,.source-friends a,.source-top-tags a,.source-bottom-tags a{cursor:pointer}
/* The shared list has 18 entries; only the bottom grid needs another row. */
.source-friends{height:auto;min-height:150px;overflow:visible}
.source-friends>div{height:auto;min-height:70px;grid-template-rows:none;grid-auto-rows:31px}
@media(max-width:600px){.source-friends{min-height:267px}.source-friends>div{min-height:187px}}
/* Empty or administratively hidden native modules must release their space. */
.source-recommend[hidden],.source-friends[hidden],.source-top-tags[hidden],.source-bottom-tags[hidden],
.source-recommend[aria-hidden="true"],.source-friends[aria-hidden="true"],.source-top-tags[aria-hidden="true"],.source-bottom-tags[aria-hidden="true"],
.source-recommend[data-fleet-tag-hidden="true"],.source-friends[data-fleet-tag-hidden="true"],.source-top-tags[data-fleet-tag-hidden="true"],.source-bottom-tags[data-fleet-tag-hidden="true"]{display:none!important}
.source-recommend:not(:has(a)),.source-friends:not(:has(a)),.source-top-tags:not(:has(a)),.source-bottom-tags:not(:has(a)){display:none!important}
/* The backend marks individual tag anchors with the string value "1". */
.source-top-tags a[data-fleet-tag-hidden="1"],.source-bottom-tags a[data-fleet-tag-hidden="1"],
.source-top-tags a[data-fleet-tag-hidden="true"],.source-bottom-tags a[data-fleet-tag-hidden="true"]{display:none!important}
/* Only filtered groups use intrinsic height; unfiltered source geometry stays intact. */
.source-top-tags:has(a:is([hidden],[aria-hidden="true"],[data-fleet-tag-hidden="1"],[data-fleet-tag-hidden="true"],[style*="display:none"],[style*="display: none"])),
.source-bottom-tags:has(a:is([hidden],[aria-hidden="true"],[data-fleet-tag-hidden="1"],[data-fleet-tag-hidden="true"],[style*="display:none"],[style*="display: none"])){height:auto!important;min-height:0!important;grid-template-rows:none!important}
.source-top-tags[data-fleet-tag-hidden="1"],.source-bottom-tags[data-fleet-tag-hidden="1"],
.source-top-tags:not(:has(a:not([data-fleet-tag-hidden="1"]):not([data-fleet-tag-hidden="true"]):not([hidden]):not([aria-hidden="true"]):not([style*="display:none"]):not([style*="display: none"]))),
.source-bottom-tags:not(:has(a:not([data-fleet-tag-hidden="1"]):not([data-fleet-tag-hidden="true"]):not([hidden]):not([aria-hidden="true"]):not([style*="display:none"]):not([style*="display: none"]))){display:none!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important}

/* Trusted site-owned player; retain the template restrictions for other frames. */
.player-stage #playleft > iframe[src^="/static/player/dplayer.html"]{display:block!important;width:100%!important;height:100%!important;border:0}

/* Real category records can change in number; release the source's fixed 50-cell height. */
.source-header{height:auto;overflow:visible}
.source-nav{height:auto;grid-template-rows:none;grid-auto-rows:minmax(40px,auto);padding-bottom:10px}
/* Desktop page gutters and border are site-local; mobile retains its existing width. */
@media(min-width:601px){
 html{background:#e8edf2}
 body{width:calc(100% - 64px);max-width:1440px;margin:24px auto;border:1px solid #d8dfe6;box-shadow:0 6px 24px rgba(27,39,52,.08);border-radius:8px;overflow-x:hidden}
 .source-header{border-radius:7px 7px 0 0}
 .source-video-module,.home-video-grid,.type-video-grid{height:auto}
 .home-video-grid{grid-template-columns:repeat(5,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:206.25px;padding-bottom:12px}
 /* The current response contains 18 cards; six columns closes its last two gaps.
    If the configured 20-card request is later filled, use the original five columns. */
 .home-video-grid:has(>.video-card:nth-child(18)):not(:has(>.video-card:nth-child(19))){grid-template-columns:repeat(6,minmax(0,1fr))}
}
@media(max-width:600px){.source-nav{grid-auto-rows:46px}}

/* Native ad controls: keep the original visible layout and collapse hidden rows. */
.source-icon-ads>a[data-fleet-ad-hidden="1"],.source-banner-ads>a[data-fleet-ad-hidden="1"]{display:none!important}
.source-icon-ads:has(>a[data-fleet-ad-hidden="1"]),.source-banner-ads:has(>a[data-fleet-ad-hidden="1"]){height:auto!important;min-height:0!important;grid-template-rows:none!important}
.source-icon-ads:not(:has(>a:not([data-fleet-ad-hidden="1"]):not([hidden]))),
.source-banner-ads:not(:has(>a:not([data-fleet-ad-hidden="1"]):not([hidden]))){display:none!important;height:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important}
/* Mobile source CSS made every banner transparent while reserving its full height. */
@media(max-width:600px){.source-banner-ads .banner-ad img{opacity:1}}

/* Desktop card titles: two full 18px lines plus the original 7px top padding. */
@media(min-width:601px){
 .video-card strong{height:43px;line-height:18px;padding:7px 4px 0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
 .home-video-grid,.related-grid{grid-auto-rows:218px}
}
