/* SmartersWeb Ecosystem UI Foundation — Phase 1 (2026-10-13)
   Shared, progressively enhanced accessibility/typography rules. This file
   deliberately avoids changing navigation JavaScript, layout grids or branding.
   Keep the same file deployed to the public, portal, admin and AI assets paths. */
:where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25) {
  --swx-reading-width: 72ch;
  --swx-control-height: 2.75rem;
  --swx-focus-color: #60a5fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
:where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
  :where(h1,h2,h3,h4,.page-title,.portal-page-title,.admin-page-title) {
  text-wrap: balance;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
:where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
  :where(p,li,dd,td,th,.card-description,.portal-page-subtitle,.admin-page-subtitle) {
  overflow-wrap: break-word;
}
:where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
  :where(a,button,input,select,textarea,summary,[role="button"],[tabindex]):focus-visible {
  outline: 3px solid var(--swx-focus-color);
  outline-offset: 3px;
}
:where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea) {
  max-width: 100%;
  min-width: 0;
}
:where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
  :where(button,.btn,.portal-btn,.admin-btn) {
  touch-action: manipulation;
}
:where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
  :where(img,svg,video,canvas,iframe) { max-width: 100%; }
:where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
  :where(.admin-table-container,.portal-table-container,.table-responsive,.table-scroll,.ops-table-wrap) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
:where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
  :where(.admin-table,.portal-table,table) {
  font-variant-numeric: tabular-nums;
}
:where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
  :where(h1,h2,h3,h4,[id]) { scroll-margin-top: 5.5rem; }
@media (max-width: 760px) {
  :where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
    :where(.admin-page-header,.portal-page-header,.portal-card-header,.admin-card-header) {
    min-width: 0;
    flex-wrap: wrap;
  }
  :where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
    :where(.admin-btn,.portal-btn,button.btn,.btn-primary,.btn-secondary) {
    min-height: var(--swx-control-height);
  }
  :where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
    :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea) {
    font-size: 16px; /* prevent unintentional mobile field zoom */
  }
  :where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
    :where(.portal-page-title,.admin-page-title,.page-title) {
    font-size: clamp(1.5rem, 4.5vw, 2.125rem);
  }
}
@media (prefers-reduced-motion: reduce) {
  :where(body.sw-public,body.sw-portal,body.admin-body,body.layout-v18-25)
    :where(*, *::before, *::after) {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
