.scroll-stack {
  position: relative;
  width: 100%;
}

.scroll-stack--contained {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: none;
}

.scroll-stack--contained::-webkit-scrollbar {
  display: none;
}

.scroll-stack--window {
  width: 100%;
}

.scroll-stack__inner {
  position: relative;
  padding-inline: clamp(0.75rem, 4%, 2.5rem);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.scroll-stack__slot {
  position: sticky;
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.scroll-stack-card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 5 / 8;
  height: auto;
  min-height: unset;
  padding: 1.4rem 1.25rem;
  border-radius: 24px;
  background: #ffffff;
  color: #18181b;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 -8px 24px -12px rgba(0, 0, 0, 0.08),
    0 20px 40px -20px rgba(0, 0, 0, 0.14);
  transform-origin: 50% 0;
  will-change: transform, filter;
  transition: box-shadow 0.2s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.scroll-stack-card__shade {
  display: none !important;
}

.scroll-stack__end {
  width: 100%;
  pointer-events: none;
}

.invitations-scroll-stack-box {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  border-radius: 28px;
  background: #fbfbfd;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02);
  padding: 0.5rem 0;
  box-sizing: border-box;
  overflow: hidden;
}

body.view-invitations-active {
  overflow: hidden !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overscroll-behavior: none !important;
}

body.view-invitations-active .app-container {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  padding-top: calc(0.85rem + env(safe-area-inset-top, 0px)) !important;
  padding-bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px)) !important;
  padding-left: clamp(0.75rem, 3vw, 1.25rem) !important;
  padding-right: clamp(0.75rem, 3vw, 1.25rem) !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

body.view-invitations-active #view-invitations.active {
  height: 100% !important;
  max-height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
}

body.view-invitations-active .invitations-container {
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.view-invitations-active .settings-view-header {
  margin-bottom: 0.55rem !important;
  padding-bottom: 0.4rem !important;
  flex-shrink: 0 !important;
}

body.view-invitations-active .invitations-centered-title {
  margin: 0 0 0.25rem 0 !important;
  font-size: 1.22rem !important;
  flex-shrink: 0 !important;
}

body.view-invitations-active .section-headline-bar {
  margin-bottom: 0.45rem !important;
  flex-shrink: 0 !important;
}

body.view-invitations-active .invitations-scroll-stack-box {
  flex: 1 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
}

.scroll-stack-invitation-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  gap: 0.75rem;
  box-sizing: border-box;
}

.ss-inv-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ss-inv-loc-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  border-radius: 9999px;
  background: #000000;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ss-inv-time-badge {
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  letter-spacing: -0.01em;
}

.ss-inv-host-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ss-inv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
}

.ss-inv-host-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ss-inv-host-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(0, 0, 0, 0.42);
  text-transform: uppercase;
}

.ss-inv-host-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.ss-inv-host-unit {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.5);
}

.ss-inv-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.ss-inv-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}

.ss-inv-quote {
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.6);
  line-height: 1.4;
  margin: 0;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ss-inv-footer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.ss-inv-capacity-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.7);
}

.ss-inv-dot {
  display: none !important;
}

.ss-inv-dot.full {
  display: none !important;
}

.ss-inv-join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.62rem 1rem;
  border-radius: 9999px;
  background: #000000;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  box-sizing: border-box;
}

.ss-inv-join-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.ss-inv-join-btn:active {
  transform: scale(0.97);
}

.ss-inv-join-btn.joined {
  background: #ffffff;
  color: #000000;
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ss-inv-join-btn:disabled {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.35);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 600px) {
  .scroll-stack__inner {
    padding-inline: 0.5rem;
  }
  .scroll-stack__slot {
    max-width: min(290px, 80vw);
  }
  .scroll-stack-card {
    max-width: min(290px, 80vw);
    aspect-ratio: 5 / 8;
    padding: 1.25rem 1.15rem;
    border-radius: 22px;
  }
  .ss-inv-title {
    font-size: 1.05rem;
  }
  .ss-inv-quote {
    font-size: 0.78rem;
  }
}
