/* S1744: compact three-card signed-in Home layout. Data and gesture logic stay canonical. */
.public-home-slider.is-home-cardex-carousel.is-home-compact-stack {
  width: min(calc(100% - clamp(24px, 4vw, 72px)), 1120px);
  height: auto !important;
  aspect-ratio: auto !important;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  touch-action: pan-y;
}

.home-cardex-compact-stack {
  position: relative;
  display: grid;
  gap: clamp(10px, 1.7vw, 16px);
  width: 100%;
}

.home-cardex-compact-panel {
  position: relative;
  width: 100%;
  height: clamp(210px, 29vw, 310px);
  overflow: hidden;
  border: 1px solid rgba(7, 143, 192, .2);
  border-radius: clamp(12px, 2vw, 18px);
  background: #eef8fc;
  box-shadow: 0 8px 24px rgba(0, 61, 91, .08);
  isolation: isolate;
}

.home-cardex-compact-panel.is-ranking {
  height: clamp(250px, 34vw, 360px);
  touch-action: pan-y;
}

.home-cardex-static-card,
.home-cardex-ranking-panel > .public-home-slides,
.home-cardex-ranking-panel > .public-home-slides > .public-home-slide {
  position: absolute;
  inset: 0;
}

.home-cardex-static-card {
  display: block;
  width: 100%;
  height: 100%;
}

/* Donut card: chart on the left, greeting and existing copy on the right. */
.is-home-compact-stack .home-cardex-donut-stage {
  display: grid !important;
  grid-template-columns: minmax(0, 56%) minmax(0, 44%) !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  grid-template-areas:
    "chart copy"
    "chart title" !important;
  align-items: center;
  gap: 2px 8px !important;
  padding: clamp(10px, 2vw, 18px) !important;
  direction: ltr;
}

.is-home-compact-stack .home-cardex-donut-layout {
  grid-area: chart;
  min-width: 0;
  height: 100%;
  transform: none !important;
  direction: ltr;
}

.is-home-compact-stack .home-cardex-donut-chart,
.is-home-compact-stack .home-cardex-donut-slide.is-system .home-cardex-donut-chart {
  width: min(100%, 270px) !important;
  max-height: 100%;
}

.is-home-compact-stack .home-cardex-personal-copy,
.is-home-compact-stack .home-cardex-personal-copy.is-admin {
  grid-area: copy;
  align-self: center !important;
  justify-items: end;
  min-width: 0;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  gap: clamp(1px, .45vw, 4px);
  text-align: right;
  direction: rtl;
}

.is-home-compact-stack .home-cardex-personal-copy h2 {
  max-width: 100%;
  font-size: clamp(1.05rem, 2.4vw, 1.65rem) !important;
  line-height: 1.25 !important;
  text-align: right;
  text-wrap: balance;
}

.is-home-compact-stack .home-cardex-rank-copy {
  font-size: clamp(.55rem, 1.1vw, .78rem) !important;
  line-height: 1.5;
  text-align: right;
}

.is-home-compact-stack .home-cardex-personal-copy p {
  font-size: clamp(.48rem, .9vw, .67rem) !important;
  line-height: 1.45 !important;
  text-align: right;
}

.is-home-compact-stack .home-cardex-personal-copy button {
  min-height: 30px;
  margin-top: 2px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: clamp(.52rem, .9vw, .68rem);
}

.is-home-compact-stack .home-cardex-donut-title {
  grid-area: title;
  align-self: end;
  max-width: 100%;
  margin: 0;
  font-size: clamp(.48rem, .92vw, .67rem) !important;
  line-height: 1.5 !important;
  text-align: right;
  direction: rtl;
}

.is-home-compact-stack .home-cardex-donut-stage::before {
  animation-duration: 15s !important;
}

/* Shadow wallet card: only the final raster wallet is visible while loading. */
.is-home-compact-stack .home-shadow-wallet-slide,
.is-home-compact-stack .home-shadow-wallet-slide.is-active {
  position: absolute;
  inset: 0;
  cursor: pointer;
  overflow: hidden;
  background: var(--primary, #078fc0);
  color: #fff;
}

.is-home-compact-stack .home-shadow-wallet-slide::before,
.is-home-compact-stack .home-shadow-wallet-slide::after,
.is-home-compact-stack .home-shadow-wallet-stage::before,
.is-home-compact-stack .home-shadow-wallet-stage::after {
  content: none !important;
  display: none !important;
}

.is-home-compact-stack .home-shadow-wallet-stage {
  display: grid;
  grid-template-columns: minmax(0, 48%) minmax(0, 52%);
  grid-template-rows: 1fr;
  align-items: center;
  gap: 10px;
  padding: clamp(10px, 2vw, 20px) clamp(16px, 3vw, 34px);
  direction: ltr;
}

.is-home-compact-stack .home-shadow-wallet-image,
.is-home-compact-stack .home-shadow-wallet-slide.is-active .home-shadow-wallet-image {
  width: min(100%, 230px);
  height: 100%;
  max-height: 100%;
  opacity: 1;
  transform: none;
  object-fit: contain;
  animation: home-compact-wallet-float 4.2s ease-in-out infinite !important;
}

.is-home-compact-stack .home-shadow-wallet-copy,
.is-home-compact-stack .home-shadow-wallet-slide.is-active .home-shadow-wallet-copy {
  justify-items: end;
  align-content: center;
  opacity: 1;
  transform: none;
  text-align: right;
  direction: rtl;
  animation: none !important;
}

.is-home-compact-stack .home-shadow-wallet-copy span { font-size: clamp(.67rem, 1.4vw, .94rem); }
.is-home-compact-stack .home-shadow-wallet-copy strong { font-size: clamp(.88rem, 2.1vw, 1.35rem); }
.is-home-compact-stack .home-shadow-wallet-copy small { font-size: clamp(.5rem, 1vw, .7rem); }

@keyframes home-compact-wallet-float {
  0%, 100% { transform: translate3d(-2px, 0, 0) rotate(-.35deg); }
  50% { transform: translate3d(3px, -4px, 0) rotate(.35deg); }
}

/* The third card remains the canonical swipe/autoplay ranking carousel. */
.home-cardex-ranking-panel > .public-home-slides {
  overflow: hidden;
  border-radius: inherit;
}

.is-home-compact-stack .signed-in-rank-stage {
  grid-template-columns: minmax(0, 45%) minmax(0, 55%);
  grid-template-rows: 1fr;
  gap: clamp(7px, 2vw, 18px);
  padding: clamp(12px, 2.5vw, 24px) clamp(18px, 4vw, 48px) clamp(34px, 4.5vw, 48px);
}

.is-home-compact-stack .signed-in-rank-stage::before {
  inset: clamp(8px, 1.5vw, 15px);
  border-radius: 10px;
}

.is-home-compact-stack .signed-in-rank-visual {
  width: 100%;
  height: 100%;
  max-height: 290px;
  aspect-ratio: 1;
}

.is-home-compact-stack .signed-in-rank-profile {
  top: 2%;
  width: 75%;
}

.is-home-compact-stack .signed-in-rank-trophy {
  right: -1%;
  bottom: 2%;
  width: 43%;
  max-height: 48%;
}

.is-home-compact-stack .signed-in-rank-copy {
  justify-items: start;
  gap: clamp(2px, .7vw, 7px);
  text-align: right;
}

.is-home-compact-stack .signed-in-rank-kicker { font-size: clamp(.56rem, 1vw, .78rem); }
.is-home-compact-stack .signed-in-rank-name { font-size: clamp(1.05rem, 2.8vw, 2rem); line-height: 1.32; }
.is-home-compact-stack .signed-in-rank-position { font-size: clamp(.62rem, 1.2vw, .9rem); line-height: 1.55; }
.is-home-compact-stack .signed-in-rank-total { padding: 3px 7px; font-size: clamp(.52rem, .92vw, .7rem); }
.is-home-compact-stack .signed-in-rank-compare { min-height: 32px; padding: 5px 10px; font-size: clamp(.52rem, .9vw, .68rem); }

.home-cardex-ranking-panel > .public-home-slider-controls {
  position: absolute;
  z-index: 8;
  inset-inline: 0;
  bottom: 10px;
}

/* Ten role peers stay two rows of five in the compact ranking card. */
.is-home-compact-stack .signed-in-top-ten-stage {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 3px;
  padding: 8px 18px 32px;
}

.is-home-compact-stack .signed-in-top-ten-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2px 5px;
}

.is-home-compact-stack .signed-in-top-ten-person {
  grid-template-rows: auto minmax(34px, auto);
  gap: 1px;
}

.is-home-compact-stack .signed-in-top-ten-avatar {
  width: min(100%, 54px);
  border-width: 2px;
}

.is-home-compact-stack .signed-in-top-ten-trophy {
  left: -11%;
  bottom: -8%;
  width: 39%;
  height: 39%;
}

.is-home-compact-stack .signed-in-top-ten-meta {
  min-height: 34px;
  grid-template-rows: minmax(14px, auto) 9px 9px 9px;
}

.is-home-compact-stack .signed-in-top-ten-name { font-size: clamp(.4rem, .8vw, .55rem); line-height: 1.25; }
.is-home-compact-stack .signed-in-top-ten-account,
.is-home-compact-stack .signed-in-top-ten-city,
.is-home-compact-stack .signed-in-top-ten-rank-text { font-size: clamp(.36rem, .68vw, .48rem); line-height: 1.15; }
.is-home-compact-stack .signed-in-top-ten-heading p { font-size: clamp(.45rem, .8vw, .6rem); }
.is-home-compact-stack .signed-in-top-ten-heading h2 { font-size: clamp(.72rem, 1.4vw, 1rem); }
.is-home-compact-stack .signed-in-current-rank-card { min-height: 36px; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 5px; padding: 2px 6px; }
.is-home-compact-stack .signed-in-current-rank-avatar { width: 32px; }
.is-home-compact-stack .signed-in-current-rank-copy strong { font-size: .5rem; }
.is-home-compact-stack .signed-in-current-rank-copy span { font-size: .4rem; }
.is-home-compact-stack .signed-in-current-rank-value { min-width: 40px; }
.is-home-compact-stack .signed-in-current-rank-value strong { font-size: .92rem; }
.is-home-compact-stack .signed-in-current-rank-value span,
.is-home-compact-stack .signed-in-current-rank-value.is-unranked { font-size: .38rem; }
.is-home-compact-stack .signed-in-top-ten-actions { gap: 4px; }
.is-home-compact-stack .signed-in-top-ten-actions a,
.is-home-compact-stack .signed-in-top-ten-actions button { min-height: 24px; padding: 0 7px; font-size: .44rem; }

@media (max-width: 620px) {
  .public-home-slider.is-home-cardex-carousel.is-home-compact-stack {
    width: calc(100% - 24px);
  }

  .home-cardex-compact-stack { gap: 9px; }
  .home-cardex-compact-panel { height: clamp(154px, 46vw, 196px); border-radius: 11px; }
  .home-cardex-compact-panel.is-ranking { height: clamp(235px, 70vw, 292px); }

  .is-home-compact-stack .home-cardex-donut-stage {
    grid-template-columns: minmax(0, 57%) minmax(0, 43%) !important;
    padding: 8px !important;
    gap: 1px 5px !important;
  }

  .is-home-compact-stack .home-cardex-donut-chart,
  .is-home-compact-stack .home-cardex-donut-slide.is-system .home-cardex-donut-chart {
    width: min(100%, 176px) !important;
  }

  .is-home-compact-stack .home-cardex-donut-segment-label { font-size: 8px; }
  .is-home-compact-stack .home-cardex-personal-copy h2 { font-size: clamp(.94rem, 4.7vw, 1.2rem) !important; }
  .is-home-compact-stack .home-cardex-rank-copy { font-size: clamp(.42rem, 2vw, .55rem) !important; }
  .is-home-compact-stack .home-cardex-personal-copy p { font-size: clamp(.39rem, 1.75vw, .49rem) !important; }
  .is-home-compact-stack .home-cardex-personal-copy button { min-height: 25px; padding: 0 7px; font-size: .43rem; }
  .is-home-compact-stack .home-cardex-donut-title { font-size: clamp(.38rem, 1.7vw, .48rem) !important; }

  .is-home-compact-stack .home-shadow-wallet-stage {
    grid-template-columns: 48% 52%;
    padding: 8px 12px;
    gap: 5px;
  }
  .is-home-compact-stack .home-shadow-wallet-image { width: min(100%, 150px); }
  .is-home-compact-stack .home-shadow-wallet-copy span { font-size: clamp(.54rem, 2.3vw, .68rem); }
  .is-home-compact-stack .home-shadow-wallet-copy strong { font-size: clamp(.7rem, 3.3vw, .94rem); }
  .is-home-compact-stack .home-shadow-wallet-copy small { font-size: clamp(.4rem, 1.8vw, .52rem); }

  .is-home-compact-stack .signed-in-rank-stage {
    grid-template-columns: minmax(0, 45%) minmax(0, 55%);
    grid-template-rows: 1fr;
    gap: 5px;
    padding: 10px 14px 32px;
  }
  .is-home-compact-stack .signed-in-rank-visual { width: 100%; height: 100%; }
  .is-home-compact-stack .signed-in-rank-profile { width: 77%; }
  .is-home-compact-stack .signed-in-rank-trophy { right: -2%; bottom: 3%; width: 42%; }
  .is-home-compact-stack .signed-in-rank-copy { align-self: center; justify-items: start; gap: 2px; text-align: right; }
  .is-home-compact-stack .signed-in-rank-kicker { font-size: .48rem; }
  .is-home-compact-stack .signed-in-rank-name { font-size: clamp(.9rem, 4.5vw, 1.16rem); text-align: right; }
  .is-home-compact-stack .signed-in-rank-position { font-size: .51rem; text-align: right; }
  .is-home-compact-stack .signed-in-rank-total { border-right: 2px solid var(--rank-accent); border-bottom: 0; font-size: .43rem; }
  .is-home-compact-stack .signed-in-rank-compare { width: auto; min-height: 27px; padding: 3px 7px; font-size: .43rem; }

  .is-home-compact-stack .signed-in-top-ten-stage { padding: 6px 9px 29px; gap: 2px; }
  .is-home-compact-stack .signed-in-top-ten-grid { column-gap: 3px; }
  .is-home-compact-stack .signed-in-top-ten-avatar { width: min(100%, 42px); }
  .is-home-compact-stack .signed-in-top-ten-name { font-size: .36rem; }
  .is-home-compact-stack .signed-in-top-ten-account,
  .is-home-compact-stack .signed-in-top-ten-city,
  .is-home-compact-stack .signed-in-top-ten-rank-text { font-size: .32rem; }
  .is-home-compact-stack .signed-in-top-ten-heading p { font-size: .39rem; }
  .is-home-compact-stack .signed-in-top-ten-heading h2 { font-size: .64rem; }
  .is-home-compact-stack .signed-in-current-rank-card { min-height: 32px; grid-template-columns: 29px minmax(0, 1fr) auto; }
  .is-home-compact-stack .signed-in-current-rank-avatar { width: 27px; }
  .is-home-compact-stack .signed-in-current-rank-copy strong { font-size: .42rem; }
  .is-home-compact-stack .signed-in-current-rank-copy span { font-size: .34rem; }
  .is-home-compact-stack .signed-in-current-rank-value strong { font-size: .76rem; }
  .is-home-compact-stack .signed-in-top-ten-actions a,
  .is-home-compact-stack .signed-in-top-ten-actions button { min-height: 21px; padding: 0 5px; font-size: .36rem; }
}

@media (prefers-reduced-motion: reduce) {
  .is-home-compact-stack .home-shadow-wallet-image { animation: none !important; }
}
