/* Accordion удержания: слева список, справа UI-превью */

.home-retain {
  --retain-accent: #fe5d00;
  width: 100%;
  margin: 0;
  padding: 40px var(--lp-gutter, 15px) 56px;
  scroll-margin-top: 100px;
  box-sizing: border-box;
  background: #fff;
}

.home-retain-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.home-retain-title {
  margin: 0 0 20px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #111827;
}

.home-retain-acc {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-retain-item {
  border: 0;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.home-retain-item.is-open {
  box-shadow: 0 8px 24px rgba(254, 93, 0, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
}

.home-retain-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.home-retain-item-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #111827;
}

.home-retain-chevron {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23fe5d00' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  transition: transform 0.28s ease;
}

.home-retain-item.is-open .home-retain-chevron {
  transform: rotate(180deg);
}

/* Плавное раскрытие: grid 0fr → 1fr */
.home-retain-panel {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0 18px;
  transition: grid-template-rows 0.32s ease, padding-bottom 0.32s ease;
}

.home-retain-item.is-open .home-retain-panel {
  grid-template-rows: 1fr;
  padding-bottom: 16px;
}

.home-retain-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.home-retain-desc {
  margin: 0;
  padding-top: 2px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--retain-accent);
  max-width: 36ch;
}

.home-retain-closer {
  margin: 28px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #111827;
  box-sizing: border-box;
}

.home-retain-closer-text {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 28ch;
  text-align: center;
  background: linear-gradient(105deg, #111827 0%, #111827 38%, #fe5d00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-retain-closer-coin {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 6px 12px rgba(254, 93, 0, 0.28));
  animation: home-retain-coin-float 3.2s ease-in-out infinite;
}

.home-retain-closer-coin.is-mirror {
  animation-name: home-retain-coin-float-mirror;
  animation-delay: -1.6s;
}

@keyframes home-retain-coin-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes home-retain-coin-float-mirror {
  0%, 100% { transform: scaleX(-1) translateY(0); }
  50% { transform: scaleX(-1) translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  .home-retain-closer-coin,
  .home-retain-closer-coin.is-mirror {
    animation: none;
  }

  .home-retain-closer-coin.is-mirror {
    transform: scaleX(-1);
  }
}

/* Stage / preview */
.home-retain-stage {
  position: relative;
  min-width: 0;
  min-height: 280px;
}

.home-retain-glow {
  position: absolute;
  z-index: 0;
  top: -12%;
  left: -8%;
  width: 58%;
  height: 52%;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(254, 93, 0, 0.28) 0%, rgba(254, 93, 0, 0) 70%);
  pointer-events: none;
  filter: blur(2px);
}

/* Одна поверхность превью — не «карточка в карточке» */
.home-retain-frame {
  position: relative;
  z-index: 1;
  min-height: 280px;
  padding: 20px 20px 18px;
  border-radius: 20px;
  border: 0;
  background: #fff;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.home-retain-view {
  display: none;
  width: 100%;
  animation: home-retain-in 0.28s ease;
}

.home-retain-view.is-active {
  display: block;
}

@keyframes home-retain-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Контент превью без второго каркаса */
.hr-report {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.hr-report-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--retain-accent);
}

.hr-report-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  align-items: flex-start;
}

.hr-report-photo {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #e5e7eb;
}

.hr-report-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #111827;
}

.hr-report-goal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.hr-report-bar {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
}

.hr-report-bar i {
  display: block;
  height: 100%;
  background: #111827;
  border-radius: 999px;
}

.hr-report-cta {
  display: inline-block;
  margin-top: 16px;
  padding: 11px 18px;
  border-radius: 9999px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

/* Goals: кабинетный goal-card без второго каркаса */
.home-retain .goal-card {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-retain .ms-val.muted {
  color: var(--retain-accent);
}

.home-retain .lt-ministack li.done .ms-name {
  color: #111827;
}

/* Achievements — floats pack */
.hr-ach {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.hr-ach-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.hr-ach-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.02em;
}

.hr-ach-rank {
  font-size: 13px;
  font-weight: 600;
  color: var(--retain-accent);
}

.hr-ach-grid {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hr-ach-grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.hr-float-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
}

.hr-medal-name {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: #111827;
  letter-spacing: -0.01em;
}

.hr-ach-grid li:not(.is-on) .hr-medal-name {
  color: var(--retain-accent);
}

.hr-ach-streak {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--retain-accent);
}

/* Marketplace — две карточки в ряд */
.home-retain-mp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.home-retain-mp-card.marketplace-product-card {
  max-width: none;
  margin: 0;
  min-width: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  padding: 0;
  box-shadow: none;
}

.home-retain-mp-card .marketplace-product-image {
  aspect-ratio: 1 / 1;
  max-width: none;
  width: 100%;
  margin: 0 0 10px;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.home-retain-mp-card .marketplace-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.home-retain-mp-card .marketplace-product-content {
  padding: 0 2px;
}

.home-retain-mp-card .marketplace-product-title {
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  -webkit-line-clamp: 2;
}

.home-retain-mp-card .marketplace-product-price {
  color: var(--retain-accent);
  font-size: 13px;
  font-weight: 700;
}

.home-retain-mp-card .marketplace-cart-button {
  display: none;
}

@media (min-width: 768px) {
  .home-retain {
    padding: 48px var(--lp-gutter, 140px) 72px;
  }

  .home-retain-title {
    font-size: 32px;
  }

  .home-retain-frame {
    min-height: 340px;
    padding: 24px 24px 22px;
  }

  .home-retain-stage {
    min-height: 340px;
  }
}

@media (min-width: 1150px) {
  .home-retain-inner {
    grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
    gap: 48px;
    align-items: center;
  }

  .home-retain-closer {
    margin-top: 36px;
    font-size: 22px;
    gap: 14px;
  }

  .home-retain-closer-coin {
    width: 52px;
    height: 52px;
  }

  .home-retain-title {
    margin-bottom: 24px;
    max-width: 18ch;
  }
}
