@media screen and (max-width: 640px) {
  .wrapper {
    margin-top: 0;
  }
  .mypage-layout {
    flex-direction: column;
  }
  .mypage-nav {
    width: 100%;
    flex: 0 0 auto;
  }
  .mypage-shell {
    padding: 16px 0 40px;
  }
  .mypage-container {
    width: 94vw;
  }
  .mypage-card {
    padding: 18px;
  }
  .mypage-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .mypage-btn {
    width: 100%;
  }
  .mypage-field {
    flex-direction: column;
    align-items: stretch;
  }
  .mypage-copy {
    width: 100%;
  }
  .plan-upgrade__summary {
    grid-template-columns: 1fr;
  }
  .contract-actions--split {
    flex-direction: column;
    align-items: stretch;
  }
  .contract-actions--split .contract-link {
    text-align: center;
  }
}


@media screen and (max-width: 640px) {  .mypage-container {
    width: 94vw;
    margin-top: 58px;
  }

  .mypage-menu {
    display: flex;
    flex-direction: column;
    min-height: 100%;
  }

  .mypage-nav-mobile-logout {
    display: block;
    margin-top: auto;
    padding-top: 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #f0f0f0;
  }

  .mypage-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 78vw;
    max-width: 320px;
    border-radius: 0 12px 12px 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1300;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mypage-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1250;
  }

  .mypage-nav-open .mypage-sidebar {
    transform: translateX(0);
  }

  .mypage-nav-open .mypage-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .mypage-shell {
    padding: 0 0 40px;
  }
}
