/* ais-41-2-fit: keep every page at the viewport width. No left/right page scroll.
   Overflow-x on html/body is a backstop only. Root causes are fixed below. */
html{max-width:100%;overflow-x:hidden;overflow-x:clip}
body{max-width:100%;overflow-x:hidden;overflow-x:clip}
img,video,canvas,svg{max-width:100%;height:auto}
.yt-frame,.yt-play,.yt-card,.yt-shelf,.yt-grid,.embed{max-width:100%;min-width:0;box-sizing:border-box}
/* Video facades and YouTube iframes only — do not restyle Kit or other form iframes. */
.yt-play,.yt-frame,iframe[src*="youtube"],iframe[src*="youtube-nocookie"]{width:100%;max-width:100%;aspect-ratio:16/9;height:auto;border:0}
/* Long prompts, code, and URLs must wrap or scroll inside their box, never the page. */
pre,code,samp,kbd,.prompt,pre.prompt{
  max-width:100%;
  min-width:0;
  box-sizing:border-box;
  overflow-x:auto;
  overflow-wrap:anywhere;
  word-break:break-word;
}
pre,pre.prompt,.prompt{white-space:pre-wrap}
/* Flex/grid children can shrink instead of forcing a wider row. */
.wrap,.narrow,main,main#main,.content,.yt-shelf,.yt-grid,.yt-card,.yt-tools,.yt-chips,.ls-track,.ls-upnext,.ls-tools,.ls-map,.ls-bar{max-width:100%;min-width:0;box-sizing:border-box}
/* Horizontal shelves/carousels stay inside their own scroller. */
[data-mswipe]{box-sizing:border-box}
.tablewrap,.tt-wrap,.bc-matrix{max-width:100%;min-width:0;overflow-x:auto;-webkit-overflow-scrolling:touch}
/* A 230px video-grid min-track must not overflow a narrower content box. */
.yt-grid{grid-template-columns:repeat(auto-fill,minmax(min(230px,100%),1fr))}
@media(max-width:480px){.yt-grid{grid-template-columns:1fr}}

/* ais-41-3-upgrade: future-chart stays inside the viewport */
.fc-preview,.fc-wrap,.fc-panel,.fc-rates,.fc-chart,.fc-controls,.fc-fields,.fc-legend,.fc-edu{max-width:100%;min-width:0;box-sizing:border-box}
#fc-canvas,canvas#fc-canvas{max-width:100%;height:auto;display:block}
