.hpa-scroll-track {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.hpa-container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Base Mobile Styles (< 768px) */
.hpa-tabs,
.hpa-aside-cards {
  display: none;
}

.hpa-accordion-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-in-out, opacity 0.35s ease-in-out;
  opacity: 0;
}

.hpa-item.active .hpa-accordion-collapse {
  opacity: 1;
  /* max-height handled dynamically via JavaScript for smooth animation */
}

/* Toggle Arrow Rotation */
.hpa-header-arrow svg {
  transition: transform 0.3s ease;
}

.hpa-item.active .hpa-header-arrow svg {
  transform: rotate(180deg);
}

/* Desktop Layout (768px+) */
@media (min-width: 768px) {
  /* Hide Mobile Accordion Structure */
  .hpa-item {
    display: none !important;
  }

  /* Show Desktop Tabs & Cards */
  .hpa-tabs,
  .hpa-aside-cards {
    display: block;
  }

  /* Aside Card Fade Animation */
  .hpa-aside-card {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
  }

  .hpa-aside-card.active {
    display: block;
    opacity: 1;
  }

  @supports (display: grid) {
    /* Overlay cards in same space for seamless cross-fading */
    .hpa-aside-cards {
      display: grid;
      grid-template-columns: 1fr;
    }

    .hpa-aside-card {
      grid-area: 1 / 1;
      display: block;
      visibility: hidden;
      opacity: 0;
      pointer-events: none;
    }

    .hpa-aside-card.active {
      visibility: visible;
      opacity: 1;
      pointer-events: auto;
    }
  }
}

.hpa-title-icon {
  margin-top: 3px;
  flex: 0 0 22px;
  max-width: 22px;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hpa-tab.active .hpa-title-icon, .hpa-item.active .hpa-title-icon {
  opacity: 1;
}
.hpa-tab h3, .hpa-item h3 {
  color: #EFECFF;
  font-size: 28px;
  line-height: 1.14;
  opacity: 0.4;
  transition: opacity 0.6s ease;
}
.hpa-tab.active h3, .hpa-item.active h3 {
  opacity: 1;
}
.hpa-container p, .hpa-container ol, .hpa-container ul {
  color: rgba(194, 191, 210, 0.74);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}
.hpa-container p:last-child, .hpa-container ol:last-child, .hpa-container ul:last-child {
  margin-bottom: 0;
}
@media (max-width: 767px) {
  .hpa-mobile-slider {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 520px; /* Provides consistent height baseline during transitions */
  }
  .hpa-item {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
  }
  .hpa-item.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .hpa-item .hpa-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }
  .hpa-header-icons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }
  .hpa-main-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 41px;
    border: 0.942px solid #3B3B45;
    box-sizing: border-box;
    background: #141024;
    /* Lock container aspect ratio and max width */
    width: 100%;
    max-width: 720px;
    aspect-ratio: 1 / 1; 
    margin: 0 auto;
  }
  .hpa-main-diagram img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    
    /* Prevents stretching while keeping uniform height/ratio */
    object-fit: contain; 
    object-position: center;
  }
  .hpa-main {
    padding-left: 32px;
  }
  /* Mobile Dots Indicator Container */
  .hpa-slide-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  /* Inactive Base Dot */
  .hpa-slide-indicator-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(239, 236, 255, 0.3);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
  }

  /* Active Dot State */
  .hpa-slide-indicator-dot.active {
    background-color: #EFECFF;
    transform: scale(1.1);
  }

  /* Outer Active Ring Indicator */
  .hpa-slide-indicator-dot.active::after {
    content: "";
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 1px solid #EFECFF;
    border-radius: 50%;
    animation: hpaDotPulse 0.4s ease-out forwards;
  }

  @keyframes hpaDotPulse {
    0% {
      opacity: 0;
      transform: scale(0.6);
    }
    100% {
      opacity: 1;
      transform: scale(1);
    }
  }
}
@media (min-width: 768px) {
  .hpa-mobile-slider {
    display: none !important;
  }
  .hpa-container-outer {
    margin: 0 auto 20px auto;
  }
  .hpa-container {
    display: flex;
    gap: 72px;
  }
  .hpa-tabs {
    flex: 0 0 calc(50% - 36px);
    max-width: calc(50% - 36px);
  }
  .hpa-tab {
    margin-bottom: 63px;
    cursor: pointer;
  }
  .hpa-tab-header {
    display: flex;
    gap: 10px;
  }
  /*
  .hpa-main-text {
    max-height: 0;
    opacity: 0;
    overflow: hidden; 
    visibility: hidden; 
    transition: max-height 0.6s ease, opacity 0.6s ease, visibility 0.6s ease;
    padding-left: 32px;
  }
  .hpa-tab.active .hpa-main-text {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    margin-top: 10px;
  }
  .hpa-aside-cards {
    flex: 0 0 calc(50% - 36px);
    max-width: calc(50% - 36px);
  }
  */
  /* Smooth Unified CSS Grid Transition for Tab Text */
  .hpa-main-text {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.5s ease-in-out, opacity 0.5s ease-in-out, padding-top 0.5s ease-in-out;
    padding-left: 32px;
    padding-top: 0;
  }
  .hpa-main-text > * {
    overflow: hidden;
  }
  .hpa-tab.active .hpa-main-text {
    grid-template-rows: 1fr;
    opacity: 1;
    padding-top: 10px;
  }
  /* Aside Card Grid Stacking & Cross-fade */
  .hpa-aside-cards {
    flex: 0 0 calc(50% - 36px);
    max-width: calc(50% - 36px);
    display: grid;
    grid-template-columns: 1fr;
  }
  .hpa-aside-card {
    grid-area: 1 / 1;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
  }
  .hpa-aside-card.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
  .hpa-aside-card-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    max-width: 750px;
    border-radius: 82px;
    border: 0.942px solid #3B3B45;
    background: #141024;
  }
  .hpa-item h3 {
    font-size: 33px;
    line-height: 1.15;
    letter-spacing: -1.583px;
  }
}