/* Dingous Match — mobile priority layer. Desktop is intentionally untouched. */
@media (max-width: 767px) {
  /* The core product comes first on phones: show the match deck before explanatory/search sidebar. */
  body[data-dingous-match-shell="true"] .dm-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body[data-dingous-match-shell="true"] .dm-stage {
    grid-row: 1 !important;
    grid-column: 1 !important;
    order: 1 !important;
  }

  body[data-dingous-match-shell="true"] .dm-sidebar {
    grid-row: 2 !important;
    grid-column: 1 !important;
    order: 2 !important;
    margin-top: 4px !important;
  }

  body[data-dingous-match-shell="true"] .dm-profile-area,
  body[data-dingous-match-shell="true"] .dm-deck-column {
    width: 100% !important;
    max-width: none !important;
  }

  body[data-dingous-match-shell="true"] .dm-deck-column {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  body[data-dingous-match-shell="true"] .dm-deck {
    order: 1 !important;
  }

  body[data-dingous-match-shell="true"] .dm-actions {
    order: 2 !important;
  }

  body[data-dingous-match-shell="true"] .dm-counter {
    order: 3 !important;
    text-align: center !important;
  }

  body[data-dingous-match-shell="true"] .dm-empty,
  body[data-dingous-match-shell="true"] .dm-searching-panel {
    order: 4 !important;
  }

  /* Standard mobile overflow menu. */
  body[data-dingous-match-shell="true"] .dm-mobile-menu-host {
    position: relative !important;
  }

  body[data-dingous-match-shell="true"] .dm-mobile-menu-toggle {
    position: absolute !important;
    top: max(10px, env(safe-area-inset-top)) !important;
    right: 12px !important;
    z-index: 1505 !important;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    border-radius: 13px !important;
    background: rgba(16,26,44,.96) !important;
    color: #edf3ff !important;
    box-shadow: 0 10px 28px rgba(0,0,0,.28) !important;
    font-size: 25px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 2px !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }

  body[data-dingous-match-shell="true"] .dm-mobile-menu-toggle:active,
  body[data-dingous-match-shell="true"] .dm-mobile-menu-toggle[aria-expanded="true"] {
    background: rgba(124,58,237,.24) !important;
    border-color: rgba(167,139,250,.45) !important;
  }

  body[data-dingous-match-shell="true"] .dm-mobile-menu-source {
    display: none !important;
  }

  body[data-dingous-match-shell="true"] .dm-mobile-menu-host.dm-mobile-menu-open .dm-mobile-menu-source,
  body[data-dingous-match-shell="true"] .dm-mobile-menu-popover {
    position: absolute !important;
    top: calc(max(10px, env(safe-area-inset-top)) + 50px) !important;
    right: 12px !important;
    left: auto !important;
    z-index: 1504 !important;
    width: min(300px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 !important;
    padding: 8px !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 5px !important;
    overflow: visible !important;
    border: 1px solid #2b3b58 !important;
    border-radius: 17px !important;
    background: rgba(8,17,31,.985) !important;
    box-shadow: 0 22px 60px rgba(0,0,0,.5) !important;
    backdrop-filter: blur(18px) !important;
    scrollbar-width: auto !important;
  }

  body[data-dingous-match-shell="true"] .dm-mobile-menu-host.dm-mobile-menu-open .dm-mobile-menu-source,
  body[data-dingous-match-shell="true"] .dm-mobile-menu-popover.dm-mobile-menu-open {
    display: flex !important;
  }

  body[data-dingous-match-shell="true"] .dm-mobile-menu-source > a,
  body[data-dingous-match-shell="true"] .dm-mobile-menu-popover > a {
    width: 100% !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 11px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #dbe7fa !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 850 !important;
    white-space: normal !important;
    text-align: left !important;
  }

  body[data-dingous-match-shell="true"] .dm-mobile-menu-source > a:active,
  body[data-dingous-match-shell="true"] .dm-mobile-menu-popover > a:active {
    transform: translateY(1px);
  }

  body[data-dingous-match-shell="true"] .dm-menu-icon {
    width: 21px !important;
    height: 21px !important;
    flex: 0 0 21px !important;
    display: block !important;
  }

  body[data-dingous-match-shell="true"] a.dm-mobile-business-cta {
    border-color: rgba(167,139,250,.24) !important;
    background: linear-gradient(135deg,rgba(124,58,237,.20),rgba(236,72,153,.11)) !important;
    color: #ede9fe !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035) !important;
  }

  body[data-dingous-match-shell="true"] a.dm-mobile-business-cta .dm-business-icon {
    color: #c4b5fd !important;
    filter: drop-shadow(0 0 8px rgba(167,139,250,.22));
  }

  body[data-dingous-match-shell="true"] a.dm-mobile-google-login {
    border-color: rgba(255,255,255,.86) !important;
    background: #fff !important;
    color: #172033 !important;
    box-shadow: 0 8px 22px rgba(0,0,0,.24), inset 0 0 0 1px rgba(66,133,244,.06) !important;
    font-weight: 900 !important;
  }

  body[data-dingous-match-shell="true"] a.dm-mobile-google-login:active {
    background: #f3f6fb !important;
  }

  body[data-dingous-match-shell="true"] a.dm-mobile-google-login .dm-google-icon {
    width: 22px !important;
    height: 22px !important;
    flex-basis: 22px !important;
  }

  /* Leave room for the three-dot button without shrinking the brand. */
  body[data-dingous-match-shell="true"] .dm-topbar,
  body[data-dingous-match-shell="true"] .be-topbar,
  body[data-dingous-match-shell="true"] .dmc-top,
  body[data-dingous-match-shell="true"] .top,
  body[data-dingous-match-shell="true"] .plans-page > header {
    padding-right: 66px !important;
  }

  body[data-dingous-match-shell="true"] .dm-mobile-menu-original-link {
    display: none !important;
  }
}
