/* NOVA Universe · Core UI Foundation · V75.52.466
   Phase 3B: systemweite, konservative CSS-Optimierung.
   Ziel: Robustheit, Responsive-Verhalten, Accessibility und konsistente
   Layout-Grundlagen verbessern, ohne Moduldesigns zu überschreiben. */

:root{
  --nova-safe-inline:clamp(10px,2vw,24px);
  --nova-touch-min:42px;
  --nova-focus-ring:0 0 0 3px rgba(20,102,232,.24);
  --nova-radius-sm:10px;
  --nova-radius-md:14px;
  --nova-radius-lg:20px;
}

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  overflow-wrap:anywhere;
}
body{min-width:0;max-width:100%;}

/* Medien und Einbettungen dürfen Modulgrenzen nicht sprengen. */
img,svg,video,canvas,iframe{max-width:100%;}
img,video{height:auto;}

/* Flex-/Grid-Kinder: wichtig gegen horizontales Überlaufen in Modulen. */
:where(main,section,article,aside,nav,header,footer,div,form,fieldset){min-width:0;}
:where(.modal-content,.modal-body,.module-content,.nova-module,.nova-panel,.nova-card,.section-card){max-width:100%;}

/* Formulare systemweit robust halten, ohne visuelles Redesign. */
:where(input,select,textarea,button){max-width:100%;}
:where(textarea){resize:vertical;}
:where(button,[role="button"],a){-webkit-tap-highlight-color:transparent;}
:where(button,[role="button"]){touch-action:manipulation;}

/* Tastaturfokus sichtbar, Mausdarstellung unverändert. */
:where(a,button,input,select,textarea,[tabindex]):focus-visible{
  outline:2px solid #1466e8;
  outline-offset:2px;
  box-shadow:var(--nova-focus-ring);
}

/* Dialoge/Modale: Scrollen im Fenster statt unbeabsichtigt im Hintergrund. */
:where(.modal-panel,[role="dialog"],.nova-modal,.module-modal){overscroll-behavior:contain;}
:where(.modal-panel,.nova-modal,.module-modal) :where(input,select,textarea){min-width:0;}

/* Tabellen bleiben innerhalb ihres jeweiligen Modulcontainers nutzbar. */
:where(.table-wrap,.table-wrapper,.nova-table-wrap,.nova-table-scroll,.compare-table,.results-table){
  max-width:100%;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
}

/* Verborgene Inhalte sollen unabhängig von historischen Modulregeln verborgen bleiben. */
[hidden]{display:none!important;}

/* Mobile Grundschutz – keine inhaltlichen Änderungen. */
@media(max-width:760px){
  html,body{max-width:100vw;overflow-x:hidden;}
  :where(.modal-panel,[role="dialog"],.nova-modal,.module-modal){max-width:calc(100vw - 8px);}
  :where(input,select,textarea){font-size:max(16px,1em);}
  :where(.nova-actions,.modal-actions,.button-row,.action-row){max-width:100%;}
}

/* Sehr schmale Geräte. */
@media(max-width:420px){
  :where(.modal-panel,[role="dialog"],.nova-modal,.module-modal){max-width:calc(100vw - 4px);}
}

/* Barrierefreiheit: Nutzerpräferenz respektieren, Animationen nicht generell entfernen. */
@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important;}
  *,*::before,*::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
    scroll-behavior:auto!important;
  }
}

/* Druck/PDF: unnötige Interaktionsflächen nicht erzwingen. */
@media print{
  html,body{overflow:visible!important;max-width:none!important;}
  :where(.modal-panel,[role="dialog"],.nova-modal,.module-modal){max-width:none!important;overflow:visible!important;}
}
