/* ═══════════════════════════════════════════════════════════════════
   modals.css — overlay/dialog styles: auth, profile, photo prompt,
   photo viewer, maps, bell, spotify, impersonation action sheets.
   Loaded last so modal rules sit on top of the cascade.
   ═══════════════════════════════════════════════════════════════════ */

/* Responsive rules relocated from the core stylesheet so modal-owned
   selectors stay in this file. */
@media (max-width: 560px) {
  .maps-modal__panel { border-radius: 0; max-height: 100vh; }
}

/* --- MAPS MODAL --- */
.maps-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-end; justify-content: center; }
.maps-modal.open { display: flex; }
.maps-modal__backdrop { position: absolute; inset: 0; background: rgba(28,28,26,0.7); cursor: pointer; }
.maps-modal__panel { position: relative; z-index: 1; background: var(--cream); border-radius: var(--radius-lg) var(--radius-lg) 0 0; width: 100%; max-width: 640px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slideUp 0.3s ease; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.maps-modal__header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); background: var(--cream); }
.maps-modal__title { font-family: var(--ff-serif); font-size: 1.15rem; font-weight: 700; color: var(--charcoal); }
.maps-modal__close { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; color: var(--muted); cursor: pointer; transition: all 0.15s; }
.maps-modal__close:hover { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.maps-modal__body { overflow-y: auto; flex: 1; }
.maps-modal__iframe-wrap { width: 100%; aspect-ratio: 16/9; background: var(--cream-dark); }
.maps-modal__iframe-wrap iframe { width: 100%; height: 100%; border: none; }
.maps-modal__actions { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.maps-modal__actions .btn { flex: 1; justify-content: center; }

/* ── SPOTIFY NAV PANEL ── */
.nav__music-panel {
  position: fixed;
  top: 60px;
  right: 24px;
  z-index: 120;
  width: 300px;
  background: #1c1c1a;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  overflow: hidden;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1), opacity 0.25s ease;
}
.nav__music-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.nav__music-panel__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.nav__music-panel__icon { font-size: 1.1rem; color: #ec6f53; flex-shrink: 0; }
.nav__music-panel__info { flex: 1; min-width: 0; }
.nav__music-panel__title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav__music-panel__artist {
  display: block;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
}
.nav__music-panel__embed { border-top: 1px solid rgba(255,255,255,0.07); }
.nav__music-panel__embed iframe { display: block; width: 100%; border: none; }

/* ── RING THE BELL MODAL ── */
.bell-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.bell-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.bell-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.bell-modal__panel {
  position: relative;
  z-index: 1;
  background: #1c1c1a;
  border-radius: 20px;
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}
.bell-modal.open .bell-modal__panel {
  transform: translateY(0) scale(1);
}
.bell-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}
.bell-modal__title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.bell-modal__close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: none;
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  margin-top: 2px;
}
.bell-modal__close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.bell-modal__desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  margin: 0 0 24px;
}

/* Crew avatars */
.bell-crew {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}
.bell-crew__member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.bell-crew__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2e2e2b;
  border: 2px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  overflow: hidden;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.bell-crew__avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.bell-crew__member.selected .bell-crew__avatar {
  border-color: #ec6f53;
  color: #ec6f53;
  box-shadow: 0 0 0 3px rgba(224,122,84,0.3);
}
.bell-crew__name {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: none;
  color: rgba(255,255,255,0.3);
  transition: color 0.15s;
}
.bell-crew__member.selected .bell-crew__name {
  color: #ec6f53;
}
/* Toast */
.bell-toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.bell-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Request buttons */
.bell-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.bell-btn {
  background: #2e2e2b;
  border: 2px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.bell-btn:hover {
  border-color: #e35336;
  background: rgba(227,83,54,0.15);
  transform: translateY(-2px);
}
.bell-btn.sent {
  border-color: #6b7c4e;
  background: rgba(107,124,78,0.2);
  pointer-events: none;
}
.bell-btn__emoji { font-size: 1.9rem; line-height: 1; }
.bell-btn__label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
}
.bell-btn__sub {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: none;
  color: rgba(255,255,255,0.3);
}
.bell-btn.sent::after {
  content: '✓ On the way!';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #8fa666;
  background: rgba(28,28,26,0.9);
  border-radius: 12px;
}

@media (max-width: 560px) {
  .nav__music-panel { width: calc(100vw - 32px); right: 16px; top: 56px; }
  .bell-modal__panel { padding: 24px 20px 20px; }
}

/* Challenge photo viewer modal */
.challenge-photo-viewer {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.challenge-photo-viewer.open { opacity: 1; pointer-events: auto; }
.challenge-photo-viewer__backdrop {
  position: absolute; inset: 0;
  background: rgba(28,28,26,0.7);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.challenge-photo-viewer__panel {
  position: relative; z-index: 1;
  background: var(--cream, #fff);
  border-radius: 16px;
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}
.challenge-photo-viewer.open .challenge-photo-viewer__panel { transform: translateY(0) scale(1); }
.challenge-photo-viewer__img-wrap {
  background: #1c1c1a;
  max-height: 70vh;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.challenge-photo-viewer__img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  width: auto; height: auto;
  object-fit: contain;
}
.challenge-photo-viewer__body { padding: 18px 22px 20px; }
.challenge-photo-viewer__title-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.challenge-photo-viewer__emoji { font-size: 1.4rem; line-height: 1; }
.challenge-photo-viewer__title { font-family: var(--ff-serif); font-size: 1.15rem; font-weight: 700; color: var(--charcoal); margin: 0; }
.challenge-photo-viewer__date { font-size: 0.82rem; color: var(--muted); margin: 0; }
.challenge-photo-viewer__actions { display: flex; gap: 10px; margin-top: 14px; justify-content: flex-end; }
.challenge-photo-viewer__btn {
  font-family: inherit; font-size: 0.85rem; font-weight: 700;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.challenge-photo-viewer__btn--replace {
  background: var(--terracotta-pale); color: var(--terracotta); border: none;
}
.challenge-photo-viewer__btn--replace:hover { background: var(--terracotta); color: #fff; }
.challenge-photo-viewer__btn--close {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
}
.challenge-photo-viewer__btn--close:hover { border-color: var(--charcoal); color: var(--charcoal); }
.challenge-photo-viewer__dismiss {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; line-height: 1;
  transition: background 0.15s;
}
.challenge-photo-viewer__dismiss:hover { background: rgba(0,0,0,0.75); }
@media (max-width: 540px) {
  .challenge-photo-viewer { padding: 0; }
  .challenge-photo-viewer__panel { max-height: 100vh; border-radius: 0; max-width: 100%; height: 100%; }
  .challenge-photo-viewer__img-wrap { flex: 1; max-height: none; }
  .challenge-photo-viewer__img { max-height: 100%; max-width: 100%; }
  .challenge-photo-viewer__body { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}

/* ─── Header carousel viewer (lightbox) ────────────────────────────────── */
.carousel-viewer {
  position: fixed; inset: 0; z-index: 310;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.carousel-viewer.open { opacity: 1; pointer-events: auto; }
.carousel-viewer__backdrop {
  position: absolute; inset: 0;
  background: rgba(14, 14, 12, 0.92);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.carousel-viewer__stage {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 64px 72px 72px;
  box-sizing: border-box;
  pointer-events: none; /* only the img + caption catch pointer events */
}
.carousel-viewer__img {
  display: block;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  user-select: none; -webkit-user-drag: none;
  transform: scale(0.97);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}
.carousel-viewer.open .carousel-viewer__img { transform: scale(1); }
.carousel-viewer__caption {
  margin-top: 14px;
  color: #fff;
  font-family: var(--ff-serif);
  font-size: 1rem; font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  min-height: 1.2em;
  pointer-events: auto;
}
.carousel-viewer__dismiss {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; line-height: 1;
  transition: background 0.15s;
}
.carousel-viewer__dismiss:hover { background: rgba(255, 255, 255, 0.28); }
.carousel-viewer__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; line-height: 1; padding-bottom: 4px;
  transition: background 0.15s, opacity 0.15s;
}
.carousel-viewer__nav:hover { background: rgba(255, 255, 255, 0.28); }
.carousel-viewer__nav:disabled { opacity: 0.25; cursor: default; }
.carousel-viewer__nav--prev { left: 16px; }
.carousel-viewer__nav--next { right: 16px; }
.carousel-viewer__dots {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 3;
  display: flex; gap: 7px;
}
.carousel-viewer__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.carousel-viewer__dot.active { background: #fff; transform: scale(1.3); }

@media (max-width: 540px) {
  .carousel-viewer__stage { padding: 56px 12px 80px; }
  .carousel-viewer__nav { width: 40px; height: 40px; font-size: 1.6rem; }
  .carousel-viewer__nav--prev { left: 8px; }
  .carousel-viewer__nav--next { right: 8px; }
  .carousel-viewer__dismiss { top: 12px; right: 12px; width: 36px; height: 36px; font-size: 1.25rem; }
  .carousel-viewer__img { border-radius: 8px; }
  .carousel-viewer__caption { font-size: 0.9rem; }
}

/* Make the header carousel feel tappable */
.trip-header__photos { cursor: zoom-in; }
.trip-header__photos .hpc__reel-btn,
.trip-header__photos .hpc__dot { cursor: pointer; }

/* ─── Trip reel viewer ─────────────────────────────────────────────────── */
.reel-viewer {
  position: fixed; inset: 0; z-index: 320;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.reel-viewer.open { opacity: 1; pointer-events: auto; }
.reel-viewer__backdrop {
  position: absolute; inset: 0;
  background: rgba(14, 14, 12, 0.82);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.reel-viewer__panel {
  position: relative; z-index: 1;
  background: var(--cream, #fff);
  border-radius: 18px;
  width: 100%; max-width: 460px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}
.reel-viewer.open .reel-viewer__panel { transform: translateY(0) scale(1); }
.reel-viewer__dismiss {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; line-height: 1;
  transition: background 0.15s;
}
.reel-viewer__dismiss:hover { background: rgba(0, 0, 0, 0.75); }
.reel-viewer__video-wrap {
  background: #000;
  aspect-ratio: 9 / 16;
  max-height: 60vh;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.reel-viewer__video {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.reel-viewer__body { padding: 18px 22px 22px; }
.reel-viewer__title {
  font-family: var(--ff-serif);
  font-size: 1.15rem; font-weight: 700;
  color: var(--charcoal);
  margin: 0 0 4px;
}
.reel-viewer__subtitle {
  font-size: 0.85rem; color: var(--muted);
  margin: 0 0 16px;
}
.reel-viewer__actions {
  display: flex; gap: 10px;
}
.reel-viewer__btn {
  flex: 1 1 0;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  font-family: inherit; font-size: 0.88rem; font-weight: 700;
  padding: 10px 16px; border-radius: 999px;
  border: none; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.reel-viewer__btn:active { transform: translateY(1px); }
.reel-viewer__btn--primary {
  background: var(--terracotta); color: #fff;
}
.reel-viewer__btn--primary:hover { background: var(--charcoal); }
.reel-viewer__btn--secondary {
  background: transparent; color: var(--charcoal);
  border: 1px solid var(--border);
}
.reel-viewer__btn--secondary:hover { border-color: var(--charcoal); }
.reel-viewer__btn svg { flex: 0 0 16px; }
.reel-viewer__toast {
  min-height: 1.1em;
  margin-top: 10px;
  font-size: 0.8rem; color: var(--muted);
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.reel-viewer__toast.visible { opacity: 1; }

@media (max-width: 540px) {
  .reel-viewer { padding: 0; }
  .reel-viewer__panel { max-height: 100vh; border-radius: 0; max-width: 100%; height: 100%; }
  .reel-viewer__video-wrap { flex: 1; max-height: none; aspect-ratio: auto; }
  .reel-viewer__body { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
}

/* ── CHALLENGE PHOTO PROMPT ── */
.photo-prompt {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.photo-prompt.open { opacity: 1; pointer-events: auto; }
.photo-prompt__backdrop {
  position: absolute; inset: 0;
  background: rgba(28,28,26,0.55);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.photo-prompt__panel {
  position: relative; z-index: 1;
  background: var(--cream, #f5ede0);
  border-radius: 20px;
  padding: 28px 24px 22px;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.photo-prompt.open .photo-prompt__panel {
  transform: translateY(0) scale(1);
}
.photo-prompt__emoji {
  font-size: 3rem; line-height: 1;
  margin: 4px 0 10px;
  animation: ppPop 0.45s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes ppPop {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
.photo-prompt__eyebrow {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta, #e35336);
  margin: 0 0 6px;
}
.photo-prompt__title {
  font-family: var(--ff-serif, 'Playfair Display', serif);
  font-size: 1.5rem; font-weight: 700; line-height: 1.2;
  color: var(--charcoal, #1c1c1a);
  margin: 0 0 8px;
}
.photo-prompt__desc {
  font-size: 0.9rem; line-height: 1.5;
  color: var(--muted, #6b6b66);
  margin: 0 0 20px;
}
.photo-prompt__actions {
  display: flex; flex-direction: column; gap: 10px;
}
.photo-prompt__btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: inherit; font-size: 0.95rem; font-weight: 700;
  padding: 14px 18px; border-radius: 999px;
  cursor: pointer; border: none;
  transition: transform 0.15s ease, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.photo-prompt__btn--primary {
  background: var(--terracotta, #e35336);
  color: #fff;
  box-shadow: 0 6px 18px rgba(227,83,54,0.35);
}
.photo-prompt__btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(227,83,54,0.42); }
.photo-prompt__btn--primary:active { transform: translateY(0); }
.photo-prompt__btn--ghost {
  background: transparent;
  color: var(--muted, #6b6b66);
  padding: 8px 18px;
  font-size: 0.82rem; font-weight: 600;
}
.photo-prompt__btn--ghost:hover { color: var(--charcoal, #1c1c1a); }
@media (max-width: 420px) {
  .photo-prompt__panel { padding: 24px 18px 18px; }
  .photo-prompt__title { font-size: 1.3rem; }
}

/* Prevent iOS Safari auto-zoom on focus — all modal inputs must be ≥16px */
.maps-modal__panel input,
.maps-modal__panel textarea,
.maps-modal__panel select { font-size: 16px !important; }

/* ── PROFILE MODAL ── */
.profile-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.profile-modal.open { opacity: 1; pointer-events: auto; }
.profile-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(28,28,26,0.55);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.profile-modal__panel {
  position: relative; z-index: 1;
  background: var(--cream, #fff);
  border-radius: 16px;
  width: 100%; max-width: 640px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.28);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
}
.profile-modal.open .profile-modal__panel { transform: translateY(0) scale(1); }
.profile-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.profile-modal__title { font-family: var(--ff-serif); font-size: 1.2rem; font-weight: 700; color: var(--charcoal); margin: 0; }
.profile-modal__close {
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.05); color: var(--muted);
  font-size: 0.85rem; cursor: pointer; transition: background 0.15s;
}
.profile-modal__close:hover { background: rgba(0,0,0,0.1); color: var(--charcoal); }
.profile-modal__body { overflow-y: auto; padding: 24px 22px; display: flex; flex-direction: column; gap: 28px; }
.profile-modal__foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
.profile-modal__done {
  background: var(--charcoal); color: #fff;
  border: none; border-radius: 999px;
  padding: 10px 22px; font-family: inherit; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.profile-modal__done:hover { background: var(--terracotta); }

/* Avatar + identity row */
.profile-avatar-section { display: flex; gap: 20px; align-items: center; }
.profile-avatar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.profile-avatar {
  position: relative;
  width: 96px; height: 96px; flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--avatar-bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}
.profile-avatar:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); transform: scale(1.02); }
.profile-avatar__initial { font-family: var(--ff-serif); font-size: 2.2rem; font-weight: 700; color: #fff; }
.profile-avatar__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-reset {
  background: none; border: none; padding: 0;
  font-family: inherit; font-size: 0.75rem; font-weight: 600;
  color: var(--muted); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--border);
  text-underline-offset: 3px;
}
.profile-avatar-reset:hover { color: var(--terracotta); }
.profile-identity { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.profile-field { display: flex; flex-direction: column; gap: 2px; }
.profile-field__label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: none; color: var(--muted); }
.profile-field__value { font-size: 0.95rem; color: var(--charcoal); overflow-wrap: break-word; }

/* Section */
.profile-section { border-top: 1px solid var(--border); padding-top: 20px; }
.profile-section__title { font-family: var(--ff-serif); font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; color: var(--charcoal); }
.profile-section__desc { font-size: 0.82rem; color: var(--muted); margin: 0 0 14px; }

/* Bio */
.profile-bio { display: flex; flex-direction: column; gap: 10px; }
.profile-bio__input {
  width: 100%; min-height: 90px; resize: vertical;
  font-family: inherit; font-size: 0.95rem; line-height: 1.5;
  color: var(--charcoal);
  background: var(--cream); border: 1.5px dashed var(--border);
  border-radius: 10px; padding: 12px 14px;
  transition: border-color 0.15s;
}
.profile-bio__input:focus { outline: none; border-color: var(--terracotta); border-style: solid; }
.profile-bio__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-bio__count { font-size: 0.75rem; color: var(--muted); }
.profile-bio__save {
  background: var(--terracotta-pale); color: var(--terracotta);
  border: none; border-radius: 999px;
  padding: 7px 16px; font-family: inherit; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.profile-bio__save:disabled { opacity: 0.4; cursor: not-allowed; }
.profile-bio__save:not(:disabled):hover { background: var(--terracotta); color: #fff; }

/* Trip stamps */
.profile-trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.profile-trips:empty::after {
  content: 'No trips yet.';
  font-size: 0.85rem; color: var(--muted);
}
.profile-trip {
  background: var(--cream); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}
.profile-trip__cover {
  aspect-ratio: 4 / 3; background: var(--cream-dark) center/cover no-repeat;
}
.profile-trip__body { padding: 10px 12px; }
.profile-trip__name { font-weight: 700; font-size: 0.9rem; color: var(--charcoal); line-height: 1.25; }
.profile-trip__date { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

/* Badges */
.profile-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-badges:empty::after {
  content: 'No badges earned yet.';
  font-size: 0.85rem; color: var(--muted);
}
.profile-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--terracotta-pale); color: var(--terracotta);
  border: 1px solid rgba(227,83,54,0.25); border-radius: 999px;
  padding: 6px 14px 6px 10px; font-size: 0.82rem; font-weight: 700;
}
.profile-badge__emoji { font-size: 1rem; }

@media (max-width: 540px) {
  .profile-modal { padding: 0; }
  .profile-modal__panel { max-height: 100vh; border-radius: 0; max-width: 100%; height: 100%; }
  .profile-avatar-section { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ── AUTH SIGN-IN (split layout, image + white panel) ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  background: var(--cream, #fff);
}
.auth-overlay.hidden { display: none; }

.auth-image {
  background-image: url('https://images.unsplash.com/photo-1572181021711-64df791c556a?q=80&w=2000&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  position: relative;
}
.auth-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28,28,26,0) 55%, rgba(28,28,26,0.35) 100%);
}

.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 5vw, 64px);
  overflow-y: auto;
}
.auth-panel {
  width: 100%;
  max-width: 380px;
}
.auth-panel__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta, #e35336);
  margin: 0 0 20px;
}
.auth-panel__logo {
  display: block;
  height: 40px;
  width: 146px;
  max-width: 100%;
  object-fit: contain;
  margin: 0 0 24px;
}
.auth-panel__logo-link {
  display: inline-block;
  margin: 0 0 24px;
  text-decoration: none;
}
.auth-panel__logo-link .auth-panel__logo {
  margin: 0;
}
.auth-panel__title {
  font-family: var(--ff-serif, 'Playfair Display', serif);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--charcoal, #1c1c1a);
  line-height: 1.05;
  margin: 0 0 12px;
}
.auth-panel__title em { font-style: italic; color: var(--terracotta, #e35336); }
.auth-panel__desc {
  font-size: 0.95rem;
  color: var(--muted, #6b6b66);
  margin: 0 0 28px;
  line-height: 1.55;
}
.auth-panel__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-panel__input {
  width: 100%;
  padding: 14px 18px;
  background: #fff;
  border: 1.5px solid var(--border, #e4e2de);
  border-radius: 10px;
  color: var(--charcoal, #1c1c1a);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.auth-panel__input::placeholder { color: var(--muted, #9a9a90); }
.auth-panel__input:focus {
  border-color: var(--terracotta, #e35336);
  box-shadow: 0 0 0 3px rgba(227,83,54,0.12);
}
.auth-panel__btn {
  width: 100%;
  padding: 14px 18px;
  background: var(--terracotta, #e35336);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 6px 18px rgba(227,83,54,0.25);
}
.auth-panel__btn:hover { background: var(--terracotta-light, #ec6f53); box-shadow: 0 10px 24px rgba(227,83,54,0.32); }
.auth-panel__btn:active { transform: translateY(1px); }
.auth-panel__btn:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.auth-panel__error {
  font-size: 0.82rem;
  color: #b64a2b;
  margin: 8px 0 0;
  min-height: 1.2em;
}
.auth-panel__note {
  font-size: 0.72rem;
  color: var(--muted, #6b6b66);
  margin: 20px 0 0;
  letter-spacing: 0.03em;
}
.auth-panel__link {
  display: inline-block;
  margin: 18px 0 0;
  background: none;
  border: none;
  color: var(--muted, #6b6b66);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: var(--border, #e4e2de);
  text-underline-offset: 3px;
}
.auth-panel__link:hover { color: var(--terracotta, #e35336); }
.auth-reset-note { color: var(--muted, #6b6b66); font-size: 0.9rem; margin-top: 12px; }
.auth-success-note { color: var(--olive, #6b7c4e); font-size: 0.9rem; margin-top: 12px; display: none; }

@media (max-width: 820px) {
  /* dvh tracks the dynamic viewport so the keyboard popping up
     shrinks the height instead of leaving the form scrolling
     under the on-screen keyboard. */
  .auth-overlay {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    padding-top: 0;
    min-height: 100dvh;
  }
  .auth-image { display: none; }
  /* Hug the top: when the form content is taller than the available
     space, centred flex alignment would let the logo bleed up under
     the image. Horizontal padding scales with viewport so there's
     consistent gutter space. */
  .auth-form-wrap {
    padding: clamp(36px, 10vw, 56px) clamp(24px, 6vw, 40px) clamp(32px, 8vw, 48px);
    align-items: flex-start;
  }
  .auth-panel { text-align: center; }
  .auth-panel__logo { margin: 0 auto clamp(28px, 7vw, 40px); }
  .auth-panel__logo-link { margin: 0 0 clamp(28px, 7vw, 40px); }
  .auth-panel__title {
    font-size: clamp(1.75rem, 7vw, 2.2rem);
    margin: 0 0 clamp(24px, 6vw, 32px);
  }
  .auth-panel__desc { margin: 0 0 clamp(20px, 5vw, 28px); }
  /* Inputs read best left-aligned even when the surrounding panel
     centres its headline content. */
  .auth-panel__form { text-align: left; gap: 14px; }
  .auth-panel__error { text-align: center; }
  .auth-panel__btn { margin-top: clamp(8px, 2vw, 14px); }
  .auth-panel__link { margin-top: clamp(22px, 5vw, 28px); }
  .auth-reset-note,
  .auth-success-note { text-align: center; }
}

