/* Shared structural repair; theme palettes, fonts and editorial identity remain owned by themes. */
.tube-layout-v1 .tdx-ad,.tube-layout-v1 .tdx-ad-card{min-width:0;max-width:100%;height:auto;min-height:0;overflow:visible}
.tube-layout-v1 .video-card.tdx-ad-card{display:flex;flex-direction:column;align-items:center;padding:8px 0;gap:6px;transform:none}
.tube-layout-v1 .tube-ad-wide{grid-column:1/-1}
.tube-layout-v1 .video-card.tdx-ad-card::before{content:none}
/* Multiformat native widgets can contain multiple rows; identity thumbnail
   ratios must not cap their body or cause flex shrink below creative height. */
.tube-layout-v1 .video-card.tdx-ad-card .tdx-ad-card__media{height:auto;aspect-ratio:auto;flex:0 0 auto}
.tube-layout-v1 .tdx-ad-body,.tube-layout-v1 .tdx-ad-card__media,.tube-layout-v1 .vd-ad-body{display:block;width:100%;max-width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:auto;overflow:visible;text-align:center}
.tube-layout-v1 .tdx-ad-body>ins,.tube-layout-v1 .tdx-ad-card__media>ins,.tube-layout-v1 .vd-ad-body>ins{display:block;width:100%;text-decoration:none}
/* Constrain provider layout wrappers, never stretch creative iframe heights. */
.tube-layout-v1 :is(.tdx-ad-body,.tdx-ad-card__media,.vd-ad-body)>ins>div,
.tube-layout-v1 :is(.tdx-ad-body,.tdx-ad-card__media,.vd-ad-body)>div{max-width:100%!important;min-width:0!important}
.tube-layout-v1 .msg-native-widget,.tube-layout-v1 .msg-native-widget-outer-container,
.tube-layout-v1 .msg-native-widget-item-container,.tube-layout-v1 .msg-native-widget-item{max-width:100%!important;min-width:0!important;box-sizing:border-box}
.tube-layout-v1 .tdx-ad-label,.tube-layout-v1 .video-card.tdx-ad-card .tdx-ad-label{position:static;display:block;margin:0 0 4px;padding:0;background:none;color:var(--muted,#888);font-size:10px;line-height:16px;text-align:center;text-transform:uppercase;letter-spacing:.08em;backdrop-filter:none}
/* Current native renderer uses msg-, not the historical exo- prefix.
   Correct its observed zero mobile media ratio without stretching fixed banner creatives. */
.tube-layout-v1 .msg-native-widget-item-image-wrapper{height:auto!important;min-height:0;aspect-ratio:16/9}
.tube-layout-v1 .msg-native-widget-item-image-ratio{padding-top:56.25%!important;height:0!important}
.tube-layout-v1 .msg-native-widget .video-thumb-wrapper{height:100%!important}
.tube-layout-v1 .msg-native-widget video{object-fit:contain}
.tube-layout-v1 [data-tube-ad-state="empty"]{display:none!important}
.tube-layout-v1 [data-tube-ad-suspended="consent"]{visibility:hidden;pointer-events:none}
.tube-layout-v1 .ad-slot.vd-ad-loaded{height:auto;min-height:0;aspect-ratio:auto;max-height:none}
.tube-layout-v1 .mobile-sticky[hidden],.tube-layout-v1 .tdx-ad--mobile_sticky.is-closed{display:none!important}
/* Localization belongs in normal document flow, not over the ad or consent surface. */
.tube-layout-v1 #tube-language-control{position:static!important;display:flex;flex-wrap:wrap;margin:20px auto;max-width:calc(100% - 32px);width:max-content;z-index:auto;box-shadow:none}
.tube-layout-v1 .tube-language-settings{min-width:0;margin:8px 0}
.tube-layout-v1 .tube-language-settings summary{min-height:44px;padding:10px 12px;cursor:pointer}
.tube-layout-v1 .tube-language-settings #tube-language-control{margin:8px 0;max-width:100%}
.tube-layout-v1 .tdx-ad-close,.tube-layout-v1 [data-close-sticky]{min-width:44px;min-height:44px}
.tube-layout-v1 .tdx-ad--mobile_sticky,.tube-layout-v1 .mobile-sticky{max-height:none;overflow:visible}
@media(max-width:900px){
 .tube-layout-v1 .site-header .header-inner{display:flex;position:relative;align-items:center;flex-wrap:nowrap;height:60px;min-height:60px;padding:0 16px;gap:8px}
 .tube-layout-v1 .header-inner>.site-logo{flex:1 1 auto;min-width:0;width:auto;font-size:18px;letter-spacing:normal}
 .tube-layout-v1 .header-inner>.nav-toggle,.tube-layout-v1 .header-inner>.nav-search-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;margin:0;order:4}
 .tube-layout-v1 .header-inner>.nav-toggle{order:5}
 .tube-layout-v1 .header-inner>.main-nav{display:none;position:absolute;top:100%;left:0;right:0;width:auto;margin:0;padding:8px 16px;max-height:calc(100dvh - 72px);overflow:auto;background:var(--bg-card,#17171c);z-index:3}
 .tube-layout-v1 .header-inner>.main-nav.open{display:block}
 .tube-layout-v1 .header-inner>.main-nav ul{display:flex;flex-direction:column;gap:2px}
 .tube-layout-v1 .header-inner>.main-nav a{display:flex;align-items:center;min-height:44px}
 .tube-layout-v1 .header-inner>.header-search{display:none;position:absolute;top:100%;left:0;right:0;margin:0;width:auto;padding:12px 16px;background:var(--bg-card,#17171c);z-index:4}
 .tube-layout-v1 .header-inner>.header-search.is-open{display:block}
 .tube-layout-v1 .header-search input[type=search]{min-height:44px;width:100%;min-width:0;opacity:1;pointer-events:auto}
 .tube-layout-v1 .header-search .tube-search-form{width:100%;max-width:none}
 .tube-layout-v1 .site-header .nav-shuffle,.tube-layout-v1 .site-header .nav-account{display:none}
}
@media(max-width:640px){
 .tube-layout-v1{padding-bottom:var(--tube-sticky-height,0px)!important}
 .tube-layout-v1 .video-grid{gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
 .tube-layout-v1 .video-card .info{padding:9px 10px}
 .tube-layout-v1 .video-card .info h3{font-size:13px;line-height:1.4}
 .tube-layout-v1 .tube-card-controls{grid-column:1/-1;min-width:0;display:flex;gap:4px;flex-wrap:wrap}
 .tube-layout-v1 .tube-card-controls button{flex:1;min-width:44px;min-height:44px;padding:4px;font-size:12px}
 .tube-layout-v1 .identity-deep-cuts .video-card:not(.tdx-ad-card),.tube-layout-v1 .category-results>.video-grid .video-card:not(.tdx-ad-card),.tube-layout-v1 .search-results>.video-grid .video-card:not(.tdx-ad-card),.tube-layout-v1 #tdx-related-grid .video-card:not(.tdx-ad-card){display:flex;flex-direction:column}
 .tube-layout-v1 .identity-deep-cuts .video-card::before,.tube-layout-v1 #tdx-related-grid .video-card::before{content:none}

 .tube-layout-v1 .wrap .wrap{max-width:100%}
 .tube-layout-v1 .tdx-ad--mobile_sticky{padding:4px 0;margin:0}
}
