html { max-width: 100%; overflow-x: clip; text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body { max-width: 100%; overflow-x: clip; padding-bottom: env(safe-area-inset-bottom, 0); }
img, video, canvas, svg { max-width: 100%; }
button, [role="button"], input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 2px solid #6d9cff; outline-offset: 3px; }

@media (max-width: 768px) {
  input, select, textarea { font-size: 16px !important; }
  button, a, input, select { max-width: 100%; }
  table { max-width: none; }
  pre, code { overflow-wrap: anywhere; }
  .mc-brand-wordmark { font-size: 11px; }
  .material-symbols-outlined { flex: 0 0 auto; }
}

.mobile-nav-toggle { display: none; }

@media (max-width: 1023px) {
  header[data-mobile-header="true"] { overflow: visible; }

  header[data-mobile-header="true"] > :first-child {
    min-height: 64px !important;
    padding: 8px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
  }

  header[data-mobile-header="true"] .mc-brand-lockup {
    flex: 0 0 auto;
    order: 1;
  }

  header[data-mobile-header="true"] .mc-brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  header[data-mobile-header="true"] .mobile-nav-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border: 1px solid rgba(154, 181, 229, .24);
    border-radius: 7px;
    background: rgba(14, 26, 47, .82);
    color: #f7f9ff;
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    order: 2;
  }

  header[data-mobile-header="true"] .mobile-nav-toggle .material-symbols-outlined {
    display: inline-block !important;
    font-size: 22px;
  }

  header[data-mobile-header="true"] .mobile-nav-lines {
    width: 20px;
    height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  header[data-mobile-header="true"] .mobile-nav-lines span {
    width: 100%;
    height: 2px;
    display: block;
    border-radius: 2px;
    background: currentColor;
    transform-origin: center;
    transition: transform 180ms ease, opacity 140ms ease;
  }

  header[data-mobile-header="true"] .mobile-nav-toggle[data-open="true"] .mobile-nav-lines span:first-child {
    transform: translateY(7px) rotate(45deg);
  }

  header[data-mobile-header="true"] .mobile-nav-toggle[data-open="true"] .mobile-nav-lines span:nth-child(2) {
    opacity: 0;
  }

  header[data-mobile-header="true"] .mobile-nav-toggle[data-open="true"] .mobile-nav-lines span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  header[data-mobile-header="true"] nav {
    position: fixed !important;
    top: 74px;
    right: 12px;
    bottom: auto;
    left: auto;
    z-index: 100;
    width: min(78vw, 284px);
    height: auto !important;
    min-height: 0;
    max-height: calc(100dvh - 90px);
    padding: 8px !important;
    border: 1px solid rgba(154, 181, 229, .2);
    border-radius: 9px;
    background: rgba(5, 11, 24, .98);
    box-shadow: 0 22px 50px rgba(0, 0, 0, .42);
    backdrop-filter: blur(18px);
    overflow-y: auto;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 2px !important;
    white-space: normal !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(.98);
    transform-origin: top right;
    transition: transform 200ms ease, opacity 160ms ease;
  }

  html[dir="ltr"] header[data-mobile-header="true"] nav {
    right: auto;
    left: 12px;
    transform-origin: top left;
  }

  header[data-mobile-header="true"][data-mobile-menu-open="true"] nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

  header[data-mobile-header="true"] nav a {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px !important;
    border: 0 !important;
    border-radius: 6px;
    display: flex !important;
    align-items: center !important;
    color: #d8e2f5 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    text-align: right;
    white-space: normal !important;
    box-shadow: none !important;
  }

  header[data-mobile-header="true"] nav a.text-primary,
  header[data-mobile-header="true"] nav a[aria-current="page"] {
    background: rgba(62, 123, 255, .16);
    color: #8db0ff !important;
  }

  header[data-mobile-header="true"] .role-nav-group {
    width: 100%;
  }

  header[data-mobile-header="true"] .role-nav-group summary {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    justify-content: space-between;
    box-sizing: border-box;
    color: #d8e2f5;
    font-size: 13px;
  }

  header[data-mobile-header="true"] .role-nav-group-panel {
    position: static;
    width: auto;
    margin: 2px 6px 6px;
    padding: 5px;
    background: rgba(14, 26, 47, .76);
    box-shadow: none;
  }

  header[data-mobile-header="true"] .role-nav-group-panel a {
    padding-inline: 10px !important;
    font-size: 12px !important;
  }

  header[data-mobile-header="true"] [data-header-actions],
  header[data-mobile-header="true"] > :first-child > div:last-child {
    min-width: 0;
    margin-inline-start: auto;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex: 0 1 auto;
    order: 3;
  }

  header[data-mobile-header="true"] [data-header-actions] a,
  header[data-mobile-header="true"] [data-header-actions] button,
  header[data-mobile-header="true"] > :first-child > div:last-child a,
  header[data-mobile-header="true"] > :first-child > div:last-child button {
    width: auto !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 0 12px !important;
    border-radius: 7px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 380px) {
  header[data-mobile-header="true"] > :first-child { gap: 7px !important; }
  header[data-mobile-header="true"] .mobile-nav-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex-basis: 44px;
  }
  header[data-mobile-header="true"] [data-header-actions] a,
  header[data-mobile-header="true"] [data-header-actions] button,
  header[data-mobile-header="true"] > :first-child > div:last-child a,
  header[data-mobile-header="true"] > :first-child > div:last-child button {
    padding-inline: 9px !important;
    font-size: 10px !important;
  }
}

@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top, 0); }
  header:first-of-type { padding-top: env(safe-area-inset-top, 0); }
}

@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; }
}
