/* Mobile overrides for the existing EXPO registration and native dialogs.
   Load after site.css, registration.css and brand-solution.css.
   Keep the dialog element as the scroll container so the existing scroll reset,
   focus trap, Escape handling and return-focus logic continue to work. */

@media (max-width: 767px) {
  .ye-registration,
  .ye-bs-dialog,
  .content-dialog {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - env(safe-area-inset-top, 0px));
    max-height: calc(100dvh - env(safe-area-inset-top, 0px));
    margin: 0;
    border-radius: 0;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 76px;
    scroll-padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    overflow-wrap: anywhere;
  }

  /* The white EXPO form, navy accent and original button shapes are retained. */
  .ye-registration__inner {
    padding: 28px max(20px, env(safe-area-inset-right, 0px)) 24px
      max(20px, env(safe-area-inset-left, 0px));
  }

  .ye-registration__brand {
    padding-right: 42px;
    font-size: 22px;
    line-height: 1.4;
  }

  .ye-registration__brand span {
    display: inline-block;
    white-space: nowrap;
  }

  .ye-registration__close {
    top: 10px;
    right: max(10px, env(safe-area-inset-right, 0px));
    margin-right: max(10px, env(safe-area-inset-right, 0px));
    width: 44px;
    height: 44px;
  }

  .ye-registration__title {
    font-size: 21px;
    scroll-margin-top: 72px;
  }

  .ye-registration__description,
  .ye-registration__caption,
  .ye-registration__consent {
    font-size: 13px;
  }

  .ye-registration__field {
    min-width: 0;
  }

  .ye-registration__field input {
    min-width: 0;
    min-height: 48px;
    font-size: 16px;
    scroll-margin-block: 76px 28px;
  }

  .ye-registration__submit {
    min-height: 48px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .ye-registration__textbutton {
    min-height: 44px;
    padding: 8px 12px;
  }

  /* Keep policy disclosure controls inside the main scrolling surface. */
  .ye-registration__policies {
    max-height: none;
    overflow: visible;
    padding: 12px 14px;
  }

  .ye-registration__policies summary {
    min-height: 44px;
    padding-block: 10px;
    font-size: 13px;
  }

  .ye-registration__consent {
    min-height: 44px;
    gap: 10px;
    margin-block: 8px;
    padding-block: 10px;
  }

  .ye-registration__consent input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
  }

  .ye-registration__footnote {
    padding: 12px max(20px, env(safe-area-inset-right, 0px))
      calc(12px + env(safe-area-inset-bottom, 0px))
      max(20px, env(safe-area-inset-left, 0px));
    text-align: center;
  }

  .ye-registration__footnote::before {
    flex: 0 0 5px;
  }

  /* Partner cards and selection controls use the same order as desktop. */
  .ye-bs-brand-grid,
  .ye-bs-solution-grid,
  .ye-bs-brand-detail,
  .ye-bs-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ye-bs-brand-grid {
    gap: 20px;
    margin-top: 24px;
  }

  .ye-bs-heading {
    gap: 16px;
    padding-top: 24px;
  }

  .ye-bs-heading h2 {
    font-size: clamp(28px, 7.7vw, 40px);
  }

  .ye-bs-brand-link,
  .ye-bs-solution-card__link {
    padding: 20px;
    overflow-wrap: anywhere;
  }

  .ye-bs-mini-solutions {
    padding-inline: 20px;
  }

  .ye-bs-mini-solution > button {
    min-height: 44px;
    overflow-wrap: anywhere;
  }

  .ye-bs-pick {
    min-height: 44px;
    gap: 10px;
    font-size: 13px;
  }

  .ye-bs-pick input,
  .ye-bs-confirm input {
    width: 20px;
    height: 20px;
  }

  .ye-bs-button {
    min-width: 0;
    max-width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    gap: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .ye-bs-button > span,
  .ye-bs-card-more > span {
    flex-shrink: 0;
  }

  .ye-bs-textbutton {
    min-height: 44px;
    padding-block: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .ye-bs-bulk,
  .ye-bs-bulk--dialog {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    padding: 16px;
    min-width: 0;
  }

  .ye-bs-bulk__count {
    min-width: 0;
    white-space: normal;
  }

  .ye-bs-bulk > .ye-bs-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ye-bs-bulk > .ye-bs-textbutton {
    margin-left: 0;
    white-space: normal;
  }

  .ye-bs-dialog__top {
    height: auto;
    min-height: 60px;
    gap: 12px;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(4px, env(safe-area-inset-right, 0px));
  }

  .ye-bs-dialog__top > span {
    min-width: 0;
  }

  .ye-bs-dialog__close {
    width: 48px;
    height: 48px;
  }

  .ye-bs-dialog__body {
    padding: 24px max(20px, env(safe-area-inset-right, 0px)) 28px
      max(20px, env(safe-area-inset-left, 0px));
  }

  .ye-bs-dialog__title {
    font-size: clamp(23px, 5.9vw, 30px);
    scroll-margin-top: 76px;
  }

  .ye-bs-dialog__demo {
    padding: 12px max(20px, env(safe-area-inset-right, 0px))
      calc(12px + env(safe-area-inset-bottom, 0px))
      max(20px, env(safe-area-inset-left, 0px));
  }

  .ye-bs-brand-detail {
    gap: 22px;
  }

  .ye-bs-brand-detail .ye-bs-logo {
    height: 130px;
  }

  .ye-bs-subheading {
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 28px;
  }

  .ye-bs-solution-card__foot {
    padding-inline: 20px;
  }

  .ye-bs-brand-crumb {
    min-height: 44px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .ye-bs-brand-crumb > span:last-child {
    width: 100%;
    margin-left: 0;
  }

  .ye-bs-detail-layout {
    gap: 28px;
  }

  .ye-bs-detail-layout > *,
  .ye-bs-brand-detail > *,
  .ye-bs-profile dd {
    min-width: 0;
  }

  .ye-bs-download {
    max-width: none;
    padding: 18px;
  }

  .ye-bs-cover {
    max-width: 180px;
  }

  .ye-bs-profile {
    padding: 16px;
  }

  .ye-bs-profile dl > div {
    grid-template-columns: 104px minmax(0, 1fr);
    font-size: 12px;
  }

  .ye-bs-confirm {
    min-height: 44px;
    padding-block: 8px;
    font-size: 13px;
    gap: 10px;
  }

  .ye-bs-confirm input {
    margin-top: 2px;
  }

  .ye-bs-request-form > .ye-bs-button,
  .ye-bs-dialog__body > .ye-bs-button {
    width: 100%;
  }

  /* Article / LIVE sheets keep the existing reading order and gate actions. */
  .dialog-close {
    top: 12px;
    margin: 12px max(16px, env(safe-area-inset-right, 0px)) -56px 0;
    width: 44px;
    height: 44px;
  }

  .dialog-body {
    min-width: 0;
    padding: 28px max(20px, env(safe-area-inset-right, 0px))
      calc(32px + env(safe-area-inset-bottom, 0px))
      max(20px, env(safe-area-inset-left, 0px));
  }

  .dialog-eyebrow {
    min-height: 24px;
    padding-right: 52px;
  }

  .dialog-title {
    font-size: clamp(24px, 6.2vw, 34px);
    margin-top: 20px;
    scroll-margin-top: 76px;
  }

  .dialog-deck,
  .article-body {
    font-size: 16px;
    line-height: 1.95;
  }

  .article-body h3 {
    font-size: 22px;
  }

  .content-gate {
    padding: 24px 0;
  }

  .content-gate h3 {
    font-size: 20px;
  }

  .content-gate p br {
    display: none;
  }

  .content-gate .button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    white-space: normal;
    text-align: left;
  }

  .content-gate .button > span {
    flex-shrink: 0;
  }

  .speakers-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .speaker-detail {
    gap: 14px;
  }

  .speaker-detail > div {
    min-width: 0;
  }

  .video-placeholder {
    min-height: 224px;
    aspect-ratio: auto;
    padding: 24px 16px;
  }

  .video-play {
    flex-shrink: 0;
  }

  .modal-links {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding-top: 16px;
  }

  .modal-links button {
    min-height: 44px;
    padding-block: 10px;
    text-align: left;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 479px) {
  .ye-bs-profile dl > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding-block: 8px;
  }

  .ye-bs-profile dl > div + div {
    border-top: 1px solid var(--bs-line);
  }
}

@media (min-width: 768px) and (max-width: 959px) {
  .ye-bs-brand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .ye-bs-bulk {
    flex-wrap: wrap;
  }

  .ye-bs-bulk > .ye-bs-button {
    flex: 1 0 100%;
  }
}
