#hs-popup-root,
#hs-popup-root * {
  box-sizing: border-box;
  font-family: var(--font-main);
}

#hs-popup-root {
  color: var(--text-inverse);
}

.hs-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: var(--story-overlay-bg);
  backdrop-filter: var(--glass-blur-lg);
  -webkit-backdrop-filter: var(--glass-blur-lg);
  align-items: center;
  justify-content: center;
}

.hs-popup.active {
  display: flex;
}

.hs-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hs-frame {
  position: relative;
  width: min(var(--story-frame-w), calc(100vw - 160px));
  height: min(var(--story-frame-h), calc(100vh - 80px));
  background: var(--story-bg);
  border-radius: var(--story-frame-radius);
  overflow: hidden;
  border: 1px solid var(--story-border);
  box-shadow: var(--shadow-strong);
  z-index: 2;
}

.hs-topfade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 150px;
  background:
    linear-gradient(
      180deg,
      rgba(0,0,0,0.58),
      rgba(0,0,0,0.20) 58%,
      transparent
    );
  z-index: 6;
  pointer-events: none;
}

.hs-progress {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.hs-bar {
  flex: 1;
  height: 3px;
  background: var(--story-progress-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.hs-fill {
  width: 0;
  height: 100%;
  background: var(--story-progress-fill);
  border-radius: var(--radius-pill);
  transition: width linear;
}

.hs-header {
  position: absolute;
  top: 24px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.hs-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hs-flag {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
}

.hs-flag::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--story-border);
  pointer-events: none;
  z-index: 2;
}

.hs-flag img {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border-radius: 50%;
  display: block;
  object-fit: cover;
  object-position: center center;
  transform: none !important;
  z-index: 1;
}

.hs-metaText {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hs-country {
  color: var(--story-title);
  font-size: var(--fs-story-meta-title);
  font-weight: 500;
  line-height: var(--lh-menu);
  letter-spacing: var(--letter-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hs-hint {
  margin-top: 2px;
  color: var(--story-muted);
  font-size: var(--fs-story-meta-subtitle);
  font-weight: 400;
  line-height: var(--lh-menu);
}

.hs-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--story-border);
  background: var(--glass-dark-bg);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background var(--motion-fast),
    border-color var(--motion-fast),
    transform var(--motion-fast),
    opacity var(--motion-fast);
}

.hs-close:hover {
  background: var(--glass-dark-bg-hover);
  border-color: var(--glass-dark-border-hover);
  transform: scale(1.04);
}

.hs-close img {
  width: 15px;
  height: 15px;
  display: block;
  filter: brightness(0) invert(1);
}

.hs-slider {
  position: absolute;
  inset: 0;
}

.hs-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .25s ease;
}

.hs-slide.active {
  opacity: 1;
}

.hs-video {
  position: absolute;
  inset: 0;
  background: var(--story-bg);
}

.hs-video iframe,
.hs-video img {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}

.hs-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(
      180deg,
      rgba(0,0,0,0.24),
      transparent 34%,
      rgba(0,0,0,0.52)
    );
  pointer-events: none;
}

.hs-caption {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 58px;
  z-index: 20;
}

.hs-title {
  color: var(--story-title);
  font-size: var(--fs-story-title);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: var(--letter-title-mobile);
}

.hs-desc {
  margin-top: 10px;
  color: var(--story-muted);
  font-size: var(--fs-story-desc);
  font-weight: 400;
  line-height: var(--lh-base);
}

.hs-nav {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translateY(-50%);
  border-radius: 50%;
  border: 1px solid var(--story-border);
  background: var(--glass-dark-bg);
  backdrop-filter: var(--glass-blur-md);
  -webkit-backdrop-filter: var(--glass-blur-md);
  color: var(--story-title);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 400;
  cursor: pointer;
  z-index: 3;
  user-select: none;
  transition:
    background var(--motion-fast),
    border-color var(--motion-fast),
    transform var(--motion-fast),
    opacity var(--motion-fast);
}

.hs-nav:hover {
  background: var(--glass-dark-bg-hover);
  border-color: var(--glass-dark-border-hover);
  transform: translateY(-50%) scale(1.04);
}

.hs-nav-left {
  left: calc(50% - (var(--story-frame-w) / 2) - 70px);
}

.hs-nav-right {
  right: calc(50% - (var(--story-frame-w) / 2) - 70px);
}

.hs-tap {
  position: absolute;
  inset: 0;
  bottom: 120px;
  z-index: 19;
  display: grid;
  grid-template-columns: 32% 36% 32%;
}

@media (max-width: 900px) {
  .hs-popup {
    background: var(--story-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .hs-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .hs-nav {
    display: none;
  }

  .hs-header {
    top: 24px;
    left: var(--site-gutter-tablet);
    right: var(--site-gutter-tablet);
  }

  .hs-caption {
    left: var(--site-gutter-tablet);
    right: var(--site-gutter-tablet);
    bottom: 56px;
  }
}

@media (max-width: 600px) {
  .hs-progress {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .hs-header {
    top: 24px;
    left: var(--site-gutter-mobile);
    right: var(--site-gutter-mobile);
  }

  .hs-flag {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .hs-flag img {
    inset: 3px;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    object-position: center center;
    transform: none !important;
  }

  .hs-country {
    font-size: var(--fs-story-meta-title-mobile);
  }

  .hs-hint {
    font-size: var(--fs-story-meta-subtitle-mobile);
  }

  .hs-caption {
    left: var(--site-gutter-mobile);
    right: var(--site-gutter-mobile);
    bottom: 44px;
  }

  .hs-title {
    font-size: var(--fs-story-title-mobile);
  }

  .hs-desc {
    font-size: var(--fs-story-desc-mobile);
  }

  .hs-close {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .hs-close img {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 390px) {
  .hs-header {
    left: var(--site-gutter-mobile-sm);
    right: var(--site-gutter-mobile-sm);
  }

  .hs-caption {
    left: var(--site-gutter-mobile-sm);
    right: var(--site-gutter-mobile-sm);
  }
}
