/* NexCore shared responsive & accessibility layer · Patch 3.55f */
:root{
  --nc-a11y-focus:#73e8ff;
  --nc-a11y-focus-outer:rgba(115,232,255,.24);
  --nc-a11y-surface:#071423;
  --nc-a11y-text:#f4f9ff;
  --nc-a11y-muted:#a8b8cb;
  --nc-a11y-safe-inline:max(16px,env(safe-area-inset-left));
}

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  scroll-padding-block-start:6rem;
}

body{
  overflow-x:clip;
  overflow-wrap:anywhere;
}

:where(main,section,article,aside,nav,header,footer,form,fieldset,div,li){min-width:0}
:where(img,video,canvas){max-width:100%;height:auto}
:where(button,input,select,textarea){font:inherit}
:where(button,[role="button"],summary,a,input,select,textarea){-webkit-tap-highlight-color:transparent}
:where(h1,h2,h3,h4,h5,h6,p,li,label,legend,button,a,strong,small,span){overflow-wrap:anywhere}
:where(code,pre,kbd,samp){overflow-wrap:normal;word-break:normal}
:where(pre){max-width:100%;overflow:auto;white-space:pre-wrap}
:where([hidden]){display:none!important}
:where([aria-busy="true"]){cursor:progress}
:where([aria-disabled="true"],:disabled){cursor:not-allowed}

/* Keyboard focus stays unmistakable without changing mouse interactions. */
:where(a,button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"])):focus-visible{
  outline:3px solid var(--nc-a11y-focus)!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 6px var(--nc-a11y-focus-outer)!important;
}

:where(input,select,textarea):focus-visible{
  border-color:var(--nc-a11y-focus)!important;
}

:where(a,button,summary,[role="button"]){touch-action:manipulation}
:where(summary){cursor:pointer}
:where(:target){scroll-margin-block-start:6rem}

.nc-skip-link{
  position:fixed;
  inset-block-start:max(10px,env(safe-area-inset-top));
  inset-inline-start:max(10px,env(safe-area-inset-left));
  z-index:2147483647;
  max-width:calc(100vw - 20px);
  padding:11px 16px;
  border:1px solid rgba(115,232,255,.72);
  border-radius:12px;
  background:#061321;
  color:#f7fbff;
  font-weight:900;
  text-decoration:none;
  box-shadow:0 18px 52px rgba(0,0,0,.48);
  transform:translateY(-150%);
  transition:transform .18s ease;
}
.nc-skip-link:focus{transform:translateY(0)}

.nc-visually-hidden,
.sr-only:not(:focus):not(:active){
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}

.nc-table-scroll{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overscroll-behavior-inline:contain;
  scrollbar-width:thin;
  border-radius:inherit;
}
.nc-table-scroll:focus-visible{outline-offset:2px!important}
.nc-table-scroll > table{min-width:max(100%,680px)}

/* Long values may wrap, while IDs/code remain selectable and scrollable. */
:where(.card,.panel-card,.hero-card,.service-card,.plan-card,.account-card,.form-card,.nc-card) :where(code,.mono,[data-copy-value]){
  max-width:100%;
}

:where(dialog,[role="dialog"],.modal,.dialog,.drawer,.language-panel){
  max-width:calc(100vw - 24px);
  max-height:calc(100dvh - 24px);
}

/* Shared legal footer: reliable wrapping instead of clipped links. */
.nc-legal-footer__inner,
.footer-inner,
.footer-links,
.nc-legal-footer__links{
  min-width:0;
}
.nc-legal-footer__links,
.footer-links{
  flex-wrap:wrap;
}
.nc-legal-footer a,
.footer-links a{
  min-height:38px;
  display:inline-flex;
  align-items:center;
}

/* Status page: six-column desktop cards must not clip the state badge. */
.service-card__head{
  min-width:0;
  flex-wrap:wrap;
}
.service-card__head > :first-child,
.service-card h3{min-width:0;flex:1 1 110px}
.service-card .status-pill{
  flex:0 1 auto;
  max-width:100%;
  white-space:normal;
  text-align:center;
  line-height:1.2;
}
.service-card footer{flex-wrap:wrap}

/* Shared grids never force horizontal page scrolling. */
:where(.hero-grid,.content-grid,.services-grid,.dashboard-grid,.plans-grid,.pricing-grid,.card-grid,.two-column,.form-grid,.settings-grid) > *{
  min-width:0;
}

/* Small status and action rows may wrap without losing controls. */
:where(.page-head,.section-head,.card-heading,.hero-actions,.page-actions,.toolbar,.action-row,.button-row,.form-actions,.nc-top-actions){
  min-width:0;
}
:where(.hero-actions,.page-actions,.toolbar,.action-row,.button-row,.form-actions){flex-wrap:wrap}

@media (pointer:coarse){
  :where(button,a.nav-pill,a.button,.btn,[role="button"],summary,input:not([type="checkbox"]):not([type="radio"]),select){
    min-height:44px;
  }
}

@media (max-width:900px){
  .nc-legal-footer__inner,
  .footer-inner{
    grid-template-columns:1fr!important;
    align-items:start!important;
  }
  .nc-legal-footer__links,
  .footer-links{
    justify-content:flex-start!important;
  }
  :where(.page-head,.card-heading,.section-head){
    flex-wrap:wrap;
  }
  :where(.page-head__actions,.card-heading__actions){
    width:100%;
    justify-content:flex-start;
  }
}

@media (max-width:640px){
  html{scroll-padding-block-start:4.5rem}
  :where(h1){font-size:clamp(2rem,10vw,3.25rem)}
  :where(h2){font-size:clamp(1.45rem,7vw,2.1rem)}
  :where(.shell,.container,.page-shell,.status-page,.wiki-page,.account-shell,.auth-shell,.panel-shell,.hoster-shell){
    max-width:100%;
  }
  :where(.hero-actions,.page-actions,.toolbar,.action-row,.button-row,.form-actions) > :where(a,button){
    max-width:100%;
  }
  .nc-table-scroll > table{min-width:600px}
}

@media (prefers-reduced-motion:reduce){
  html:focus-within{scroll-behavior:auto!important}
  *,*::before,*::after{
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    scroll-behavior:auto!important;
    transition-duration:.001ms!important;
  }
}

@media (prefers-contrast:more){
  :root{--nc-a11y-focus:#fff}
  :where(.card,.panel-card,.hero-card,.service-card,.plan-card,.account-card,.form-card){
    border-color:rgba(255,255,255,.34)!important;
  }
  :where(.muted,small,.help-text,.field-help){color:#c8d5e5!important}
}

@media (forced-colors:active){
  :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
    outline:3px solid Highlight!important;
    box-shadow:none!important;
  }
  :where(.status-pill,.pill,.badge,.tag){border:1px solid CanvasText!important}
}

@media print{
  .nc-skip-link,.language-panel,.modal,.toast,.notification-menu{display:none!important}
  body{overflow:visible!important;background:#fff!important;color:#000!important}
}
