/* Mobile-only Explore profile page. Desktop keeps the existing dialog layout. */
.public-profile-mobile-bar { display: none; }

@media (max-width: 650px) {
  .profile-dialog {
    box-sizing: border-box;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: #fffdf9;
  }

  .profile-dialog #profileDetail {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 18px calc(28px + env(safe-area-inset-bottom));
    box-sizing: border-box;
  }

  .profile-dialog > .close {
    position: absolute;
    z-index: 5;
    top: calc(8px + env(safe-area-inset-top));
    left: 10px;
    right: auto;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: transparent;
    font-size: 0;
  }

  .profile-dialog > .close::after {
    content: '←';
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--ink);
    font-family: Arial, sans-serif;
    font-size: 30px;
    line-height: 1;
  }

  .public-profile-mobile-bar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 64px;
    padding: calc(8px + env(safe-area-inset-top)) 0 8px;
    background: #fffdf9;
    box-shadow: 0 1px 0 #e6e9df;
  }

  .public-profile-mobile-bar b {
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .public-profile-mobile-bar .follow-button {
    min-width: 76px;
    padding: 8px 11px;
    font-size: 11px;
  }

  .profile-dialog .public-profile-head {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 22px 0 12px;
  }

  .profile-dialog .profile-avatar.large {
    width: 72px;
    height: 72px;
    margin: 0;
    font-size: 28px;
  }

  .profile-dialog .public-profile-head .eyebrow { margin-bottom: 3px; }
  .profile-dialog .public-profile-head h2 {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    margin: 0 0 4px;
    font-size: 25px;
    line-height: 1.06;
  }
  .profile-dialog .public-profile-head > div > p:last-child { font-size: 12px; }
  .profile-dialog .public-profile-desktop-follow { display: none; }

  .profile-dialog .verified-badge {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    font-size: 10px !important;
    vertical-align: middle;
    box-shadow: none;
  }

  .profile-dialog .profile-social-stats-full {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 8px 0 0;
    padding: 13px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
  }

  .profile-dialog .profile-social-stats-full span + span { border-left: 1px solid var(--line); }
  .profile-dialog .profile-social-stats-full b { font-size: 15px; }

  .profile-dialog .profile-chips { margin: 12px 0 2px; }
  .profile-dialog .profile-social-tabs { margin-top: 14px; }
  .profile-dialog .profile-recipe-head { margin: 17px 0 10px; }
  .profile-dialog .profile-recipe-head h3 { font-size: 20px; }

  .profile-dialog .profile-recipes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .profile-dialog .profile-recipe-card {
    display: block;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .profile-dialog .profile-recipe-media {
    display: block;
    aspect-ratio: 1 / .92;
    overflow: hidden;
    background: #edf2e8;
  }

  .profile-dialog .profile-recipe-media img,
  .profile-dialog .profile-recipe-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .profile-dialog .profile-recipe-copy { display: block; padding: 8px 9px 9px; }
  .profile-dialog .profile-recipe-copy b {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .profile-dialog .profile-recipe-copy small { font-size: 10px; }
}
