/* Shared public/member photo cards. Loaded after the existing theme styles. */
@media (max-width: 760px) {
  html body .member-grid:not(.guest-member-grid),
  html body .member-grid.guest-member-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px 10px;
    min-width: 0;
  }

  html body .member-grid > :is(.loading-row, .guest-loading, .empty) {
    grid-column: 1 / -1;
    min-width: 0;
  }

  html body .member-grid .member-card.ls-photo-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    margin: 0;
    padding: 4px 4px 0;
    border-color: var(--line);
    border-radius: min(var(--theme-card-radius, 10px), 12px);
    background-color: var(--paper);
  }

  html body .member-grid .ls-photo-card .ls-photo-frame {
    flex: none;
    min-width: 0;
    border-radius: 7px;
  }

  html body .member-grid .ls-photo-card .ls-profile-visual {
    width: 100%;
    height: auto;
    min-width: 0;
    max-height: 170px;
    aspect-ratio: 3 / 2;
    border-radius: 6px;
  }

  /* Keep the complete authorized image and every existing privacy placeholder. */
  html body .member-grid .ls-photo-card .ls-profile-visual > img,
  html body .member-grid .ls-photo-card .ls-profile-visual > a > img,
  html body .member-grid .ls-photo-card .ls-profile-image {
    object-fit: contain;
    object-position: center;
  }

  html body .member-grid .ls-photo-card .ls-photo-empty {
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px;
    text-align: center;
  }

  html body .member-grid .ls-photo-card .ls-photo-empty > :is(.icon, svg) {
    position: relative;
    top: auto;
    left: auto;
    flex: none;
    width: 24px;
    height: 24px;
    margin: 0;
  }

  html body .member-grid .ls-photo-card .ls-photo-empty > strong {
    max-width: 100%;
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html body .member-grid .ls-photo-card .ls-photo-empty > span {
    margin: 1px 0 0;
    font-size: 10px;
    line-height: 1.4;
  }

  html body .member-grid .ls-photo-card .ls-profile-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    padding: 8px 8px 0;
  }

  html body .member-grid .ls-photo-card .ls-photo-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 3px 5px;
    min-width: 0;
  }

  html body .member-grid .ls-photo-card .member-name {
    min-width: 0;
    max-width: none;
    margin: 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html body .member-grid .ls-photo-card .ls-photo-age {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    white-space: nowrap;
  }

  html body .member-grid .ls-photo-card .ls-photo-title > .gender-symbol {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
  }

  html body .member-grid .ls-photo-card .ls-photo-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 4px;
    min-width: 0;
    margin: 5px 0 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
  }

  html body .member-grid .ls-photo-card .ls-photo-meta span {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html body .member-grid .ls-photo-card .ls-photo-meta .icon {
    flex: none;
    width: 12px;
    height: 12px;
    color: var(--muted);
  }

  html body .member-grid .ls-photo-card .ls-photo-meta i {
    margin: 0;
    color: var(--muted);
  }

  html body .member-grid .ls-photo-card .ls-photo-tags {
    gap: 4px;
    min-height: 0;
    margin: 0 0 7px;
  }

  html body .member-grid .ls-photo-card .tag {
    max-width: 100%;
    padding: 2px 5px;
    border-radius: 4px;
    color: var(--wine-dark);
    background: var(--rose);
    font-size: 10.5px;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Preserve the existing two-line introduction preview and detail action. */
  html body .member-grid .ls-photo-card .card-intro {
    min-height: 0;
    max-height: 3.1em;
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
  }

  html body .member-grid .ls-photo-card .ls-photo-details {
    flex-wrap: wrap;
    gap: 3px 8px;
    min-width: 0;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  html body .member-grid .ls-photo-card .ls-photo-details span + span::before {
    margin-right: 8px;
    color: var(--muted);
  }

  html body .member-grid .ls-photo-card .lm-card-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    min-width: 0;
    min-height: 0;
    margin: auto 0 0;
    padding: 8px 0 9px;
    border-top: 1px solid var(--line);
    background: transparent;
  }

  html body .member-grid .ls-photo-card .lm-source {
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    color: var(--muted);
  }

  html body .member-grid .ls-photo-card .lm-source > .icon {
    flex: none;
    width: 12px;
    height: 12px;
    margin-top: 2px;
  }

  html body .member-grid .ls-photo-card .lm-source > span {
    min-width: 0;
    overflow: visible;
  }

  html body .member-grid .ls-photo-card .lm-source small {
    margin-bottom: 1px;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.5;
  }

  html body .member-grid .ls-photo-card .lm-source strong {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.5;
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
  }

  html body .member-grid .ls-photo-card .detail-btn {
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--wine-dark);
    background: var(--rose);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: normal;
  }

  html body .member-grid .ls-photo-card .detail-btn .icon {
    flex: none;
    width: 13px;
    height: 13px;
  }

  html body .member-grid .ls-photo-frame > .favorite-btn {
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 7px;
    border-color: var(--line);
    color: var(--wine-dark);
    background: var(--paper);
  }

  html body .member-grid .ls-photo-frame > .favorite-btn .icon {
    width: 16px;
    height: 16px;
  }

  html body .member-grid .ls-photo-frame > .favorite-btn.selected {
    color: var(--theme-on-button, #fff);
    border-color: var(--theme-button-primary, var(--wine));
    background: var(--theme-button-primary, var(--wine));
  }

  html body .member-grid .ls-photo-frame > .favorite-btn.selected .icon {
    fill: var(--theme-on-button, #fff);
  }

  html body .member-grid .ls-photo-card .mp-card-favorite {
    top: 6px;
    right: 6px;
    max-width: calc(100% - 12px);
    min-height: 30px;
    padding: 4px 7px;
    border: 1px solid var(--line);
    color: var(--wine-dark);
    background: var(--paper);
    font-size: 11.5px;
    line-height: 1.5;
  }
}
