/* CHATGPT_UI ZIP05 — forms, validation, feedback and interaction states. */
html[data-ui-version="v2"] :where(.ds-field,.legacy-functional-surface label){min-inline-size:0}
html[data-ui-version="v2"] :where(.ds-field__label,.legacy-functional-surface label,.legacy-functional-surface legend){font-weight:var(--ds-weight-semibold);line-height:var(--ds-leading-snug)}
html[data-ui-version="v2"] :where(.ds-field__help,.ds-field__hint,.legacy-functional-surface small){overflow-wrap:anywhere}
html[data-ui-version="v2"] :where(.ds-input,.ds-select,.ds-textarea,.legacy-functional-surface input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),.legacy-functional-surface select,.legacy-functional-surface textarea){accent-color:var(--ds-color-brand);caret-color:var(--ds-color-brand)}
html[data-ui-version="v2"] :where(.ds-input,.ds-select,.ds-textarea,.legacy-functional-surface input,.legacy-functional-surface select,.legacy-functional-surface textarea)[aria-invalid="true"]{border-color:var(--ds-color-danger);box-shadow:0 0 0 .125rem var(--ds-color-danger-soft)}
html[data-ui-version="v2"] :where(.ds-input,.ds-select,.ds-textarea,.legacy-functional-surface input,.legacy-functional-surface select,.legacy-functional-surface textarea):read-only{background:var(--ds-color-surface-muted);color:var(--ds-color-text-muted)}
html[data-ui-version="v2"] :where(.ds-input,.legacy-functional-surface input):-webkit-autofill{box-shadow:0 0 0 1000px var(--ds-color-surface) inset;-webkit-text-fill-color:var(--ds-color-text)}
html[data-ui-version="v2"] :where(input[type="checkbox"],input[type="radio"]){accent-color:var(--ds-color-brand)}
html[data-ui-version="v2"] :where(.ds-choice,.legacy-functional-surface .check-inline,.legacy-functional-surface .fc-check){min-block-size:var(--ds-touch-target);align-items:center}
html[data-ui-version="v2"] :where(.ds-choice,.legacy-functional-surface .check-inline,.legacy-functional-surface .fc-check) input[type="checkbox"],html[data-ui-version="v2"] :where(.ds-choice) input[type="radio"]{inline-size:1.25rem;block-size:1.25rem;flex:0 0 auto}
html[data-ui-version="v2"] :where(button,.ds-button,.legacy-functional-surface .btn)[disabled],html[data-ui-version="v2"] :where(button,.ds-button,.legacy-functional-surface .btn)[aria-disabled="true"]{cursor:not-allowed;opacity:.58}
html[data-ui-version="v2"] :where(.ds-alert,.legacy-functional-surface .alert){min-inline-size:0;border-inline-start-width:.25rem;overflow-wrap:anywhere}
html[data-ui-version="v2"] :where(.ds-alert--danger,.legacy-functional-surface .alert.error,.legacy-functional-surface .alert.danger){border-inline-start-color:var(--ds-color-danger)}
html[data-ui-version="v2"] :where(.ds-alert--success,.legacy-functional-surface .alert.success,.legacy-functional-surface .alert.ok){border-inline-start-color:var(--ds-color-success)}
html[data-ui-version="v2"] :where(.ds-alert--warning,.legacy-functional-surface .alert.warn){border-inline-start-color:var(--ds-color-warning)}
html[data-ui-version="v2"] :where(.ds-alert--info,.legacy-functional-surface .alert.info){border-inline-start-color:var(--ds-color-info)}
html[data-ui-version="v2"] .ds-toast-region{max-inline-size:min(26rem,calc(100vw - 2 * var(--ds-space-4)));pointer-events:none}
html[data-ui-version="v2"] .ds-toast{pointer-events:auto}
html[data-ui-version="v2"] :where([role="dialog"],[role="alertdialog"],dialog,.modal,.a4-modal){max-inline-size:min(44rem,calc(100vw - 2 * var(--ds-space-4)));max-block-size:calc(100dvh - 2 * var(--ds-space-4));overflow:auto;overscroll-behavior:contain}
html[data-ui-version="v2"] :where([role="dialog"],[role="alertdialog"],dialog,.modal,.a4-modal) :where(.modal-actions,.modal-footer,.ds-dialog__actions){position:sticky;inset-block-end:0;background:var(--ds-color-surface);padding-block:var(--ds-space-3)}
@media (pointer:coarse),(max-width:47.99rem){
  html[data-ui-version="v2"] :where(.ds-input,.ds-select,.ds-textarea,.legacy-functional-surface input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),.legacy-functional-surface select,.legacy-functional-surface textarea){font-size:1rem}
  html[data-ui-version="v2"] :where(.ds-button,.legacy-functional-surface .btn,.legacy-functional-surface button){min-block-size:var(--ds-touch-target-coarse)}
}
@media (max-width:36rem){
  html[data-ui-version="v2"] :where(.form-grid,.ds-form-grid,.a4-form-grid){grid-template-columns:minmax(0,1fr)}
  html[data-ui-version="v2"] :where(.form-actions,.page-actions,.mobile-action-stack,.ds-dialog__actions){flex-wrap:wrap}
  html[data-ui-version="v2"] :where(.form-actions,.mobile-action-stack)>:where(button,.btn,.ds-button,a[role="button"]){flex:1 1 100%;inline-size:100%}
  html[data-ui-version="v2"] :where([role="dialog"],[role="alertdialog"],dialog,.modal,.a4-modal){max-inline-size:100%;max-block-size:min(94dvh,calc(100dvh - env(safe-area-inset-top,0px)));border-end-start-radius:0;border-end-end-radius:0}
}
