/* Ajustes exclusivos do perfil minimizado em telas pequenas. */
@media (max-width: 640px) {
  html body #modal-overlay:not(.hidden):has(>#modal-profile[data-profile-layout=v2][data-profile-view=quick]:not(.hidden)) {
    justify-content: center !important;
    padding: 0 12px max(12px, env(safe-area-inset-bottom)) !important;
  }

  html body #modal-overlay #modal-profile[data-profile-layout=v2][data-profile-view=quick] {
    width: calc(100vw - 24px) !important;
    max-width: 430px !important;
    max-height: 88dvh !important;
    margin: 0 !important;
    border-radius: 18px !important;
  }

  html body #modal-overlay #modal-profile[data-profile-layout=v2][data-profile-view=quick] #profile-card {
    border-radius: 18px !important;
    border-bottom: 1px solid var(--wcp-line) !important;
  }

  /* Usa as peças nativas da moldura: o border-image achatava os cantos
     quando o cartão estreito mudava de altura no celular. */
  html body #modal-overlay #modal-profile[data-profile-layout=v2][data-profile-view=quick] #profile-card[data-has-border=true] {
    overflow: clip !important;
    overflow-clip-margin: 14px !important;
  }

  html body #modal-overlay #modal-profile[data-profile-layout=v2][data-profile-view=quick] #profile-card[data-has-border=true] > .wc-profile-frame {
    display: block !important;
    inset: 0 !important;
    z-index: 50 !important;
    transform: none !important;
    transform-origin: center !important;
    overflow: visible !important;
  }

  html body #modal-overlay #modal-profile[data-profile-layout=v2][data-profile-view=quick] #profile-card[data-has-border=true] > .wc-profile-frame::before {
    content: none !important;
    display: none !important;
    border-image: none !important;
  }

  html body #modal-overlay #modal-profile[data-profile-layout=v2][data-profile-view=quick] #profile-card[data-has-border=true] > .wc-profile-frame > span {
    display: block !important;
    visibility: visible !important;
  }

  html body #modal-overlay #modal-profile[data-profile-layout=v2][data-profile-view=quick] #profile-card[data-has-border=true] > .wc-profile-frame > svg {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
    visibility: visible !important;
  }
}
