/* Home actors: placement, floating media and opacity layers have separate owners. */
.lower-dashboard .dashboard-actors {
  --dashboard-actor-height: 428px;
  --dashboard-float-distance: -8px;
  position: absolute;
  z-index: 1;
  bottom: 32px;
  left: clamp(32px, 3vw, 56px);
  display: grid;
  width: min(420px, calc(33% - 50px));
  /* Enlarge only the avatar. The original grid tracks still size the companion and box. */
  height: min(calc(var(--dashboard-actor-height) * 1.3), calc(100% - 180px));
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  pointer-events: none;
}
.lower-dashboard .dashboard-actors > .lower-dashboard__character,
.lower-dashboard .dashboard-actors > .lower-dashboard__companion {
  position: relative;
  inset: auto;
  width: 100%;
  min-width: 0;
}
.lower-dashboard .dashboard-actors > .lower-dashboard__companion {
  height: min(220px, calc(var(--dashboard-actor-height) * 0.63));
  z-index: 2;
}
.lower-dashboard .dashboard-actors > .lower-dashboard__character {
  height: 100%;
  z-index: 1;
}
.lower-dashboard .dashboard-actors > .lower-dashboard__character > .dashboard-media {
  width: 130%;
  height: 100%;
  left: 0;
}
[data-dashboard-animation] { isolation: isolate; container-type: size; }
[data-dashboard-animation] > img,
[data-dashboard-animation] > .dashboard-animation__frames img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
}
[data-dashboard-media="animated"][data-dashboard-animation] > img,
[data-dashboard-media="animated"][data-dashboard-animation] > .dashboard-animation__frames img {
  transition: opacity 0.55s ease-in-out;
}
.dashboard-animation__frames,
.dashboard-animation__frames > img {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
.dashboard-animation__frames { width: 100%; height: 100%; }
.dashboard-animation__frames > img { opacity: 0; }
[data-dashboard-animation].dashboard-animation--alternate > img { opacity: 0; }
/* The widest pose determines a common painted height. Container units track resizing. */
[data-dashboard-animation].dashboard-animation--normalized {
  --dashboard-paint-height: min(calc(100cqh / var(--dashboard-paint-extent)), calc(100cqw / var(--dashboard-paint-ratio)));
}
[data-dashboard-animation].dashboard-animation--normalized > img,
[data-dashboard-animation].dashboard-animation--normalized > .dashboard-animation__frames img {
  position: absolute;
  inset: auto;
  left: calc(50% - var(--dashboard-paint-height) * var(--frame-center));
  bottom: calc(0px - var(--dashboard-paint-height) * var(--frame-bottom));
  width: calc(var(--dashboard-paint-height) * var(--frame-width));
  height: calc(var(--dashboard-paint-height) * var(--frame-height));
}
[data-dashboard-media="animated"][data-dashboard-animation] {
  animation: dashboard-actor-float 5.2s ease-in-out -1.1s infinite;
}
[data-dashboard-media="animated"][data-dashboard-animation="diagnosis"] {
  animation-duration: 5.8s;
  animation-delay: -2.7s;
}
@keyframes dashboard-actor-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(var(--dashboard-float-distance, -8px)); }
}
@media (min-width: 1280px) {
  /* Keep room above the enlarged head even on short desktop viewports. */
  .lower-dashboard[data-dashboard-animation-home] { min-height: 760px; }
  [data-dashboard-animation-home] .lower-dashboard__content { left: calc(31% + clamp(20px, 1.3vw, 30px)); }
  .lower-dashboard .dashboard-actors > .lower-dashboard__companion { left: 0; }
}
@media (min-width: 768px) and (max-width: 1279px) {
  .lower-dashboard .dashboard-actors {
    --dashboard-actor-height: 330px;
    left: 24px;
    width: 314px;
    height: 582px;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  }
  /* Reserve the existing left column for the larger pair rather than squeezing its frames. */
  [data-dashboard-animation-home] > .lower-dashboard__inner { min-height: 790px; padding-bottom: 180px; }
  [data-dashboard-animation-home] .lower-dashboard__content { width: calc(100% - 350px); padding-top: 64px; }
  .lower-dashboard .dashboard-actors > .lower-dashboard__companion { left: 0; }
  .lower-dashboard .dashboard-actors > .lower-dashboard__character > .dashboard-media { left: -8%; }
  .lower-dashboard[data-dashboard-animation-home] > .lower-dashboard__inner > .lower-reward-box { top: auto; bottom: 32px; }
}
@media (max-width: 767px) {
  /* Audience homes already switch here; align the lower home without changing sample pages. */
  .lower-dashboard[data-dashboard-animation-home]:not(.audience-dashboard) {
    background-image: var(--lower-dashboard-bg-sp, var(--lower-dashboard-bg));
    background-position: center top;
  }
  [data-dashboard-animation-home] > .lower-dashboard__inner {
    display: grid;
    grid-template-columns: minmax(0, 45fr) minmax(0, 27fr) minmax(0, 28fr);
    grid-template-rows: calc((380px + clamp(500px, 125vw, 600px)) / 2) auto;
    align-items: end;
    column-gap: 6px;
    padding-top: 0;
  }
  [data-dashboard-animation-home] .dashboard-actors {
    --dashboard-actor-height: clamp(200px, 52vw, 245px);
    --dashboard-float-distance: -4px;
    display: contents;
  }
  [data-dashboard-animation-home] .dashboard-actors > .lower-dashboard__character { grid-area: 1 / 1; height: calc(var(--dashboard-actor-height) * 1.875); }
  [data-dashboard-animation-home] .dashboard-actors > .lower-dashboard__character > .dashboard-media {
    left: -8px;
    width: calc(175% - clamp(0px, calc(360px - 100vw), 40px) * 0.409 - clamp(0px, calc(34vw - 108.8px), 24px) / 2);
  }
  [data-dashboard-animation-home] .dashboard-actors > .lower-dashboard__companion { grid-area: 1 / 2; }
  [data-dashboard-animation-home] .lower-dashboard__content {
    position: relative;
    inset: auto;
    grid-area: 2 / 1 / auto / -1;
    width: 100%;
    margin: 30px 0 0;
    padding: 0;
  }
  .lower-dashboard[data-dashboard-animation-home] > .lower-dashboard__inner > .lower-reward-box {
    position: relative;
    inset: auto;
    grid-area: 1 / 3;
    width: 100%;
    height: auto;
    min-width: 0;
    padding: 0;
    pointer-events: auto;
  }
  [data-dashboard-animation-home] .lower-reward-box img {
    width: 100%;
    height: auto;
    margin: 0;
  }
  [data-dashboard-animation-home] .lower-reward-box__label {
    position: absolute;
    top: calc(100% + 3px);
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 3px 2px;
    font-size: clamp(8px, 2.2vw, 11px);
    line-height: 1.1;
  }
  [data-dashboard-animation-home] .lower-reward-box::before,
  [data-dashboard-animation-home] .lower-reward-box__prompt {
    right: 0;
    bottom: calc(100% + 6px);
    width: min(145px, 26vw);
    height: 64px;
    padding: 4px 4px 14px;
    font-size: clamp(9px, 2.3vw, 11px);
    line-height: 1.3;
  }
}
/* Stack only the check-card metrics before the main mobile layout begins. */
@media (max-width: 960px) {
  .lower-dashboard[data-dashboard-animation-home] .lower-status-card--check .lower-check-score {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-inline: 12px;
    padding-bottom: 8px;
  }
  .lower-dashboard[data-dashboard-animation-home] .lower-status-card--check .lower-check-score p {
    min-width: 0;
    white-space: nowrap;
    text-align: center;
  }
  .lower-dashboard[data-dashboard-animation-home] .lower-status-card--check .lower-check-score p:first-child::after {
    top: auto;
    right: 0;
    bottom: -6px;
    left: 0;
    width: auto;
    height: 1px;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-dashboard-media="animated"][data-dashboard-animation] { animation: none; }
  [data-dashboard-media="animated"][data-dashboard-animation] > img,
  [data-dashboard-media="animated"][data-dashboard-animation] > .dashboard-animation__frames img { transition: none; }
}
/* Phase two: independent special layer, leaving all established placement/size rules intact. */
.dashboard-animation__special {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: translate(var(--special-dx, 0px), var(--special-dy, 0px));
}
.dashboard-animation__special > img {
  width: 0;
  height: 0;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}
.dashboard-animation__special.is-prepared > img {
  position: absolute;
  left: calc(50% - var(--dashboard-paint-height) * var(--special-center));
  bottom: calc(0px - var(--dashboard-paint-height) * var(--special-bottom));
  width: calc(var(--dashboard-paint-height) * var(--special-width));
  height: calc(var(--dashboard-paint-height) * var(--special-height));
  max-width: none;
}
[data-dashboard-animation="diagnosis"].dashboard-animation--special > img,
[data-dashboard-animation="diagnosis"].dashboard-animation--special > .dashboard-animation__frames img {
  transition-duration: 0.2s;
}
.dashboard-animation__special.is-playing {
  animation: dashboard-special-float var(--special-duration, 1850ms) ease-in-out both;
}
.dashboard-animation__special--hop.is-playing { animation-name: dashboard-special-hop; }
.dashboard-animation__special--flap.is-playing { animation-name: dashboard-special-flap; }
.dashboard-animation__special--bounce.is-playing { animation-name: dashboard-special-bounce; }
@keyframes dashboard-special-float {
  0%, 100% { transform: translate(var(--special-dx), var(--special-dy)); }
  35%, 65% { transform: translate(var(--special-dx), calc(var(--special-dy) - var(--special-lift))); }
}
@keyframes dashboard-special-hop {
  0%, 100% { transform: translate(var(--special-dx), var(--special-dy)); }
  40%, 55% { transform: translate(var(--special-dx), calc(var(--special-dy) - var(--special-lift))); }
}
@keyframes dashboard-special-flap {
  0%, 100% { transform: translate(var(--special-dx), var(--special-dy)); }
  25%, 65% { transform: translate(var(--special-dx), calc(var(--special-dy) - var(--special-lift) * 0.6)); }
  45%, 85% { transform: translate(var(--special-dx), calc(var(--special-dy) - var(--special-lift))); }
}
@keyframes dashboard-special-bounce {
  0%, 50%, 100% { transform: translate(var(--special-dx), var(--special-dy)); }
  25% { transform: translate(var(--special-dx), calc(var(--special-dy) - var(--special-lift))); }
  75% { transform: translate(var(--special-dx), calc(var(--special-dy) - var(--special-lift) * 0.6)); }
}
[data-dashboard-media="static"] .dashboard-animation__special > img { opacity: 0 !important; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .dashboard-animation__special { animation: none !important; }
  .dashboard-animation__special > img { opacity: 0 !important; transition: none; }
}
