/* =========================================================
   TXT-ERS V2 ACTIVITY HOST

   The host is a body-level native dialog. It has no effect while closed,
   and no production route can open it until that route is explicitly
   allowlisted in js/activity-host-v2.js.
   ========================================================= */

body.activity-host-v2-open {
  overflow: hidden;
  overscroll-behavior: none;
}

/* The launcher card turns once before the viewport host takes over. */
.activity-card.is-activity-launching {
  z-index: 31;
  pointer-events: none;
}

.activity-card.is-activity-launching
  .activity-card-frame {
  animation:
    activityHostV2CardHandoff
    380ms
    cubic-bezier(0.2, 0.72, 0.2, 1)
    both;
}

.activity-card.is-activity-launching
  .activity-card-back {
  display: grid;
  min-height: 100%;
  height: 100%;
  place-items: center;
}

.activity-card.is-activity-launching
  .activity-card-back
  > * {
  opacity: 0;
}

.activity-card.is-activity-launching
  .activity-card-back::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #4e367e;
  content: "Opening full activity";
  font-size: 0.82rem;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-align: center;
}

@keyframes activityHostV2CardHandoff {
  0% {
    transform: rotateY(0deg) translateZ(0);
  }

  100% {
    transform: rotateY(180deg) translateZ(0);
  }
}

.activity-host-v2 {
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f7f5ed;
  box-shadow: none;
  color: #173f3b;
}

.activity-host-v2::backdrop {
  background: rgba(17, 42, 39, 0.48);
  backdrop-filter: blur(7px);
}

.activity-host-v2-shell {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f7f5ed;
}

.activity-host-v2-header {
  position: absolute;
  z-index: 50;
  inset: 0 0 auto;
  height: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.activity-host-v2-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.activity-host-v2-eyebrow {
  margin: 0 0 3px;
  color: #5d716e;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.activity-host-v2-heading h2 {
  margin: 0;
  overflow: hidden;
  color: #173f3b;
  font-size: clamp(1.08rem, 2vw, 1.42rem);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-host-v2-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: grid;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 28px rgba(4, 22, 29, 0.2);
  color: #173f3b;
  cursor: pointer;
  font: inherit;
  font-size: 0;
  font-weight: 800;
  pointer-events: auto;
  backdrop-filter: blur(14px);
}

.activity-host-v2-close::before {
  content: "\00d7";
  font-size: 1.85rem;
  font-weight: 420;
  line-height: 1;
  transform: translateY(-1px);
}

.activity-host-v2-close span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.activity-host-v2-close:hover {
  background: #edf4ef;
}

.activity-host-v2-close:focus-visible,
.activity-host-v2-stage:focus-visible {
  outline: 3px solid rgba(52, 127, 119, 0.46);
  outline-offset: 3px;
}

.activity-host-v2-stage {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}

.activity-host-v2-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .activity-host-v2-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .activity-host-v2,
  .activity-host-v2::backdrop,
  .activity-host-v2 * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .activity-card.is-activity-launching
    .activity-card-frame {
    animation: none !important;
  }
}
