/* Discover full profile — Hinge-style vertical scroll. Outfit only. Tomato only on the like control and links. */

body.discover-profile-open,
body.discover-profile-open .app {
  overflow: visible;
  height: auto;
  min-height: 0;
}

body.discover-profile-open .nav {
  display: none;
}

.discover-profile-back {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
}

/* Sticky logo row. The back control is its first child, not position:fixed inside the scrolling profile. */
.aisle-app-header.discover-profile-has-back {
  box-sizing: border-box;
  justify-content: flex-start;
  position: sticky;
  top: calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 8px);
  height: 44px;
  min-height: 44px;
  margin-top: calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 8px);
  padding: 0;
  background: #F7F1E6;
  z-index: 50;
}

.aisle-app-header.discover-profile-has-back > img.aisle-lockup,
.aisle-app-header.discover-profile-has-back > .aisle-lockup {
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translate(-50%, -50%);
  margin: 0;
}

.discover-profile-bar {
  position: sticky;
  top: calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 8px);
  z-index: 50;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 44px;
  height: 44px;
  margin-top: calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 8px);
  padding: 0;
  background: #F7F1E6;
  /* A flat cream band painted by the bar itself, over the gap between the
     notch strip and the bar. The ::before fill in aisle.css does not cover it
     on iOS WebKit, so a scrolled profile photo showed above the bar
     (Richard, build 8). The bar's box stays 44px. */
  box-shadow: 0 -28px 0 0 #F7F1E6;
}

.aisle-app-header.discover-profile-has-back > .aisle-header-menu,
.discover-profile-bar > .aisle-header-menu {
  margin-left: auto;
}

.aisle-app-header.discover-profile-has-back ~ .discover-profile-screen > .discover-profile-bar {
  display: none;
}

body.discover-profile-open .discover-profile-screen {
  /* .screen's 140px padding loses to this. The pass/like row is 124px, its
     top 16px is the clear fade, the footer needs 16px of cream, and the
     header row starts 8px under the safe area. */
  padding-bottom: calc(124px + 16px + 16px + 8px);
}

.discover-profile-loading,
.discover-profile-error {
  min-height: 46vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  color: #1C1917;
}

.discover-profile-loading .list-spinner {
  border-color: rgba(28, 25, 23, 0.12);
  border-top-color: #1F7A4D;
}

.discover-profile-error p {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}

.discover-profile-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0 12px;
}

/* Map card and the expanded profile. The lock is the viewport snapshot.
   Above the photo: the 44px header, the screen's 20px pad, the stack's
   8px pad. Below it: the 24px fade (8px of it above the bar) and the bar
   itself, 16px pad, the 92px row, and 16px pad. The photo ends at the
   fade, so the Love chip is on the card before anything scrolls. */
.discover-profile-hero.profile-card {
  --profile-card-above: calc(env(safe-area-inset-top, 0px) + 8px + 44px + 20px + 8px);
  --profile-card-below: calc(8px + 16px + 92px + 16px + env(safe-area-inset-bottom, 0px));
  margin: 0;
  height: calc(var(--discover-hero-lock, 100svh) - var(--profile-card-above) - var(--profile-card-below));
  min-height: 0;
  max-height: calc(var(--discover-hero-lock, 100svh) - var(--profile-card-above) - var(--profile-card-below));
  overflow: hidden;
}

/* Who liked you, one mode or both: the photo fills whatever is left above
   the button row, leaving the Match As band even when the control is hidden.
   Header, the screen's 20px pad, the stack's 8px pad, then 12px of cream,
   the 32px control, 12px of cream, the 92px row, and the bar's 16px pad. */
.discover-profile-screen.discover-profile-liked-you {
  --match-as-gap: 12px;
  --match-as-control: 32px;
  --match-as-row: 92px;
  --match-as-bar-pad: 16px;
  --match-as-above: calc(env(safe-area-inset-top, 0px) + 8px + 44px + 20px + 8px);
  --match-as-below: calc(
    var(--match-as-bar-pad) + env(safe-area-inset-bottom, 0px)
    + var(--match-as-row)
    + var(--match-as-gap)
    + var(--match-as-control)
    + var(--match-as-gap)
  );
}

.discover-profile-screen.discover-profile-liked-you .discover-profile-hero.profile-card {
  height: calc(100svh - var(--match-as-above) - var(--match-as-below));
  max-height: calc(100svh - var(--match-as-above) - var(--match-as-below));
}

.discover-profile-hero.profile-card .profile-img,
.discover-profile-hero.profile-card .gm-hero-placeholder {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.discover-profile-hero.is-photo-placeholder .profile-img[data-photo-pending="1"],
.discover-photo-slot.is-photo-placeholder .profile-img[data-photo-pending="1"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  max-height: none;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.discover-profile-hero.aisle-hero-card .aisle-card-scrim {
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(rgba(28, 25, 23, 0) 0%, rgba(28, 25, 23, 0.62) 60%, rgba(28, 25, 23, 0.70) 100%);
  pointer-events: none;
  z-index: 3;
}

.discover-profile-hero .aisle-card-overlay {
  pointer-events: none;
  z-index: 4;
}

.discover-profile-hero.profile-card .aisle-card-name {
  text-shadow: 0 1px 2px rgba(28, 25, 23, 0.45);
}

.discover-profile-hero .aisle-card-store {
  display: block;
  margin-top: 2px;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 14px;
  color: #F7F1E6;
  text-shadow: 0 1px 2px rgba(28, 25, 23, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discover-profile-screen .discover-why .tag.aisle-chip,
.discover-profile-screen .discover-shared .discover-pill {
  background: #D7E6D4 !important;
  color: var(--aisle-produce-on-sage, #1A6B43) !important;
}

.discover-profile-screen .discover-why .tag.aisle-chip.aisle-chip-more,
.discover-profile-screen .discover-shared .discover-pill.aisle-chip-more {
  background: #F7F1E6 !important;
  color: #1F7A4D !important;
}

.discover-profile-hero.is-photo-placeholder .aisle-card-store {
  color: #1C1917;
  text-shadow: none;
}

.profile-card[role="button"] {
  cursor: pointer;
}

.discover-section {
  background: #fff;
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.04);
}

.discover-kicker {
  margin: 0 0 10px;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: var(--aisle-section-size, 12px);
  font-weight: var(--aisle-section-weight, 700);
  letter-spacing: var(--aisle-section-track, 0.06em);
  text-transform: uppercase;
  color: var(--rt-muted, #5F5A54);
}

.discover-profile-screen .discover-about-body,
.discover-profile-screen .discover-favorite-chip,
.discover-profile-screen .discover-pill,
.discover-profile-hero .aisle-card-bio {
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.discover-why-reason {
  margin: 8px 0 0;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-weight: var(--aisle-body-weight, 400);
  font-size: var(--aisle-body-size, 15px);
  line-height: var(--aisle-body-lh, 1.45);
  color: var(--aisle-ink, #1C1917);
}

.discover-why-overlap {
  margin: 6px 0 0;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-weight: var(--aisle-caption-weight, 500);
  font-size: var(--aisle-caption-size, 13px);
  line-height: 1.35;
  color: var(--rt-muted, #5F5A54);
}

.discover-why .aisle-chips {
  margin-top: 12px;
}

.discover-about-body {
  margin: 0;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: var(--aisle-body-size, 15px);
  font-weight: var(--aisle-body-weight, 400);
  line-height: var(--aisle-body-lh, 1.45);
  letter-spacing: normal;
  color: var(--aisle-ink, #1C1917);
}

.discover-favorite-chip {
  display: flex;
  width: fit-content;
  align-items: baseline;
  gap: 0.25em;
  margin-top: 12px;
  background: #F7F1E6;
  border-radius: 100px;
  padding: 6px 12px;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 14px;
  line-height: 1.2;
}

.discover-favorite-label {
  font-weight: 400;
  color: var(--rt-muted, #5F5A54);
}

.discover-favorite-value {
  font-weight: 600;
  color: #1C1917;
}

.discover-city-pill {
  display: inline-block;
  margin-top: 12px;
  background: #F7F1E6;
  color: #1C1917;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 12px;
  border-radius: 100px;
}

.discover-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.discover-pill {
  display: inline-flex;
  align-items: center;
  border: none;
  background: #F7F1E6;
  color: #1C1917;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: var(--aisle-body-size, 15px);
  font-weight: var(--aisle-body-weight, 400);
  line-height: var(--aisle-body-lh, 1.45);
  padding: 8px 14px;
  border-radius: 100px;
  cursor: default;
}

button.discover-pill {
  cursor: pointer;
}

.discover-photo-slot {
  margin: 0;
}

.discover-recipe-title {
  margin: 0 0 14px;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: var(--aisle-title-size, 28px);
  font-weight: var(--aisle-title-weight, 700);
  letter-spacing: var(--aisle-title-track, -0.4px);
  line-height: var(--aisle-title-lh, 1.15);
  color: var(--aisle-ink, #1C1917);
}

.discover-recipe-image {
  display: block;
  width: 100%;
  max-height: 220px;
  margin: 0 0 12px;
  object-fit: cover;
  border-radius: 16px;
}

.discover-recipe-photos {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.discover-recipe-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #D7E6D4;
}

.discover-recipe-photo-label {
  margin: 0 0 12px;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--rt-muted, #5F5A54);
}

.discover-recipe-dish {
  margin: 0 0 6px;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #1C1917;
}

a.discover-recipe-dish,
.discover-recipe-photo-link {
  display: block;
  text-decoration: none;
}

.discover-profile-screen .discover-section a.discover-recipe-dish,
.discover-profile-screen .discover-section a.discover-recipe-dish:visited,
.discover-profile-screen .discover-section a.discover-recipe-photo-link,
.discover-profile-screen .discover-section a.discover-recipe-photo-link:visited {
  color: #1C1917;
  text-decoration: none;
}

.discover-recipe-uses {
  margin: 0 0 8px;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--rt-muted, #5F5A54);
}

.discover-view-recipe {
  display: inline-block;
  margin: 0 0 12px;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--aisle-produce, #1F7A4D);
  text-decoration: none;
}

.discover-profile-screen .discover-section a {
  color: var(--tomato);
}

.discover-profile-screen .discover-section a.discover-view-recipe:link,
.discover-profile-screen .discover-section a.discover-view-recipe:visited {
  color: var(--aisle-produce, #1F7A4D);
  text-decoration: none;
}

.discover-profile-foot {
  margin: 4px 0 8px;
  text-align: center;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--rt-muted, #5F5A54);
}

.discover-profile-settled {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 80;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--rt-muted, #5F5A54);
}
.discover-profile-settled.liked {
  color: #1F7A4D;
}
.discover-profile-actions.swipe-area {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  height: 104px;
  margin: 0;
  z-index: 80;
  /* Solid cream behind the buttons. The top padding is the start of the
     24px fade, so it stays clear and the ::before paints that fade. */
  background: linear-gradient(to top, #F7F1E6 calc(100% - 16px), transparent calc(100% - 16px));
  pointer-events: none;
}

.discover-profile-actions.swipe-area::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 24px;
  top: calc(16px - 24px);
  background: linear-gradient(to top, #F7F1E6, rgba(247, 241, 230, 0));
  pointer-events: none;
}

/* Undo, Pass, and Like share one centered cluster. Sizes are the locked
   row: 44 / 68 / 92, with 14px between them. Who liked you keeps that
   one Like button. Both modes add a switch above the row. The card
   chip shows the mode when there is no switch. */
.discover-profile-actions.swipe-area:has(.discover-undo-slot) {
  height: auto;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0px));
}

.discover-profile-actions .swipe-btn,
.discover-profile-actions .discover-undo-btn {
  pointer-events: auto;
}

.discover-profile-actions:has(.discover-undo-slot) .discover-undo-slot,
.discover-profile-actions:has(.discover-undo-slot) .discover-undo-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.discover-profile-actions:has(.discover-undo-slot) .discover-undo-btn {
  background: var(--aisle-white, #FFFFFF);
  color: var(--aisle-ink, #1C1917);
  box-shadow: 0 3px 8px rgba(28, 25, 23, 0.2);
}

.discover-profile-actions:has(.discover-undo-slot) .discover-undo-btn[data-undo="empty"],
.discover-profile-actions:has(.discover-undo-slot) .discover-undo-btn[data-undo="matched"] {
  background: var(--aisle-white, #FFFFFF);
  color: var(--aisle-ink, #1C1917);
  box-shadow: 0 3px 8px rgba(28, 25, 23, 0.2);
  opacity: 0.4;
}

.discover-profile-actions:has(.discover-undo-slot) .swipe-btn.reject {
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  padding: 0;
  border: 1.5px solid #8A837A;
  border-radius: 50%;
  background: #fff !important;
  box-shadow: none !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0;
  position: relative;
}

.discover-profile-actions:has(.discover-undo-slot) .swipe-btn.reject::before {
  content: "";
  width: 22px;
  height: 22px;
  background: center / 22px 22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'%3E%3Cpath d='M1.25 1.25 L20.75 20.75 M20.75 1.25 L1.25 20.75' stroke='%231C1917' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.discover-profile-actions:has(.discover-undo-slot) .swipe-btn.reject:active {
  background: #1C1917 !important;
  border-color: #1C1917;
  transform: none;
}

.discover-profile-actions:has(.discover-undo-slot) .swipe-btn.reject:active::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'%3E%3Cpath d='M1.25 1.25 L20.75 20.75 M20.75 1.25 L1.25 20.75' stroke='%23FFFFFF' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.discover-profile-actions:has(.discover-undo-slot) .swipe-btn.accept:not(.match-as-love):not(.match-as-friends) {
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
}

.discover-profile-actions.swipe-area.has-match-as {
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 0;
  /* The control sits in this band, so the cream covers the switch and the
     row. The 24px fade starts at the control's top. */
  background: #F7F1E6;
}

.discover-profile-actions.swipe-area.has-match-as::before {
  top: -24px;
  bottom: auto;
  height: 24px;
}

.discover-profile-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.match-as-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  pointer-events: auto;
}

.match-as-switch-label {
  font-family: Outfit, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 32px;
  color: var(--aisle-ink, #1C1917);
}

.match-as-switch-track {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 2px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--aisle-sage, #D7E6D4);
}

.match-as-switch-option {
  height: 28px;
  margin: 0;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--aisle-ink, #1C1917);
  font-family: Outfit, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 28px;
  cursor: pointer;
  pointer-events: auto;
}

.match-as-switch-option.is-on {
  background: var(--aisle-ink, #1C1917);
  color: #FFFFFF;
}

/* The sheet bar sits on the bottom edge, so the deck's downward tip would
   leave the screen. Same bubble, caret, and type, flipped above the control. */
.discover-profile-actions .discover-undo-tip {
  top: auto;
  bottom: calc(100% + 10px);
  z-index: 2;
}

.discover-profile-actions .discover-undo-tip::before {
  top: auto;
  bottom: -6px;
  border-width: 6px 6px 0;
  border-color: var(--aisle-ink, #1C1917) transparent transparent;
}

.discover-profile-actions.swipe-area[data-like-hold] .swipe-btn.reject {
  pointer-events: none;
}

/* Undo while the sheet is open swaps in the restored profile from the left.
   The action cluster is not restyled. Reduced motion crossfades instead. */
.discover-profile-screen.discover-undo-sheet-in {
  animation: discover-undo-sheet-in 250ms ease-out;
}

@keyframes discover-undo-sheet-in {
  from { transform: translateX(-100%); }
  to { transform: none; }
}

@keyframes discover-undo-sheet-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .discover-profile-screen.discover-undo-sheet-in {
    animation-name: discover-undo-sheet-fade;
  }
}
