/* CHATGPT_UI ZIP01 — critical layout stability and reflow hardening.
   Scoped to canonical V2 and the legacy functional surface. No route, form or API contract changes. */
html[data-ui-version="v2"] :where(.ds-shell-main,.ds-shell-content,.ds-public-container,.ds-auth-main,.ds-auth-panel,.legacy-functional-surface,.page-shell,.page-hero,.section-card,.card,.panel){min-inline-size:0;max-inline-size:100%}
html[data-ui-version="v2"] :where(.ds-shell-content,.legacy-functional-surface,.page-shell) :where(.grid,.form-grid,.dashboard-grid,.metric-grid,.two-col,.cols-2,.stack-row,.wrap-row)>*{min-inline-size:0}
html[data-ui-version="v2"] :where(h1,h2,h3,h4,p,li,dd,dt,.muted,.section-sub,.section-subtitle,.metric-label,.metric-note,.ds-page-header__description,.ds-card__description){overflow-wrap:anywhere}
html[data-ui-version="v2"] :where(img,svg,canvas,video){max-inline-size:100%;block-size:auto}
html[data-ui-version="v2"] :where(.table-wrap,.responsive-table,.mobile-card-table,.ds-table-wrap,.data-table-wrap,.fc-table-wrap,[data-responsive-table]){max-inline-size:100%;overflow:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
html[data-ui-version="v2"] :where(.table-wrap,.responsive-table,.mobile-card-table,.ds-table-wrap,.data-table-wrap,.fc-table-wrap,[data-responsive-table])>table{margin-block-end:0}
html[data-ui-version="v2"] :where(.legacy-functional-surface table,.ds-table){max-inline-size:none}
html[data-ui-version="v2"] :where(.legacy-functional-surface input,.legacy-functional-surface select,.legacy-functional-surface textarea,.legacy-functional-surface button,.legacy-functional-surface .btn){max-inline-size:100%}
html[data-ui-version="v2"] :where([id]){scroll-margin-block-start:calc(var(--ds-topbar-height,3.75rem) + var(--ds-space-4,1rem))}
@media (max-width:44rem){
  html[data-ui-version="v2"] :where(.legacy-functional-surface,.ds-shell-content,.ds-public-container,.ds-auth-main){min-inline-size:0}
  html[data-ui-version="v2"] :where(.legacy-functional-surface .actions,.legacy-functional-surface .page-actions,.legacy-functional-surface .hero-actions,.legacy-functional-surface .form-actions,.legacy-functional-surface .mobile-action-stack){flex-wrap:wrap}
  html[data-ui-version="v2"] :where(.legacy-functional-surface .section-head,.legacy-functional-surface .card-header,.legacy-functional-surface .summary-card-header){align-items:flex-start;flex-wrap:wrap}
}
