/* ==========================================================================
   Academia Canină — Dog Life Simulator (Mobile-First Flat Editorial + Parallax)
   ========================================================================== */

:root {
  /* Core Flat Editorial Palette (matching docs/images/prompts.json & mockup) */
  --dl-surface-backdrop: #efe8da;
  --dl-surface-cream: #faf6ee;
  --dl-surface-card: #ffffff;
  --dl-surface-subtle: #f2eadb;
  --dl-surface-peach: #fce1c6;
  --dl-surface-yellow-tint: #fef6dc;
  --dl-surface-coral-tint: #feece8;
  --dl-surface-teal-tint: #e3f4f3;

  /* Typography & Ink */
  --dl-ink-navy: #0b2149;
  --dl-ink-secondary: #354768;
  --dl-ink-muted: #5c6c87;
  --dl-ink-white: #ffffff;

  /* Editorial Accents */
  --dl-accent-mustard: #f6be3b;
  --dl-accent-mustard-hover: #eab026;
  --dl-accent-amber: #d98214;
  --dl-accent-coral: #f86c58;
  --dl-accent-coral-dark: #d94c38;
  --dl-accent-teal: #158e8c;
  --dl-accent-teal-dark: #0f6e6c;

  /* Social Share Pill Colors */
  --dl-share-fb: #3b5998;
  --dl-share-ig: #d62976;
  --dl-share-wa: #25d366;

  /* Borders & Shadows */
  --dl-border-soft: rgba(11, 33, 73, 0.1);
  --dl-border-strong: rgba(11, 33, 73, 0.2);
  --dl-backdrop-scrim: rgba(11, 33, 73, 0.58);
  --dl-shadow-phone: 0 22px 54px -16px rgba(11, 33, 73, 0.16);
  --dl-shadow-card: 0 8px 22px -8px rgba(11, 33, 73, 0.1);
  --dl-shadow-pill: 0 6px 16px -4px rgba(11, 33, 73, 0.18);

  /* Radii */
  --dl-radius-sm: 10px;
  --dl-radius-md: 16px;
  --dl-radius-lg: 22px;
  --dl-radius-xl: 28px;
  --dl-radius-pill: 999px;

  /* Fonts */
  --dl-font-serif: 'Fraunces', 'Georgia', 'Alegreya Sans', serif;
  --dl-font-display: 'Plus Jakarta Sans', 'Alegreya Sans', sans-serif;
  --dl-font-sans: 'Plus Jakarta Sans', 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Visual Redesign Tokens (23 Oct 2026) */
  --dl-surface-nav-btn: #f3ece0;
  --dl-delta-good-bg: #d7efe0;
  --dl-delta-good-ink: #1b7442;
  --dl-delta-bad-bg: #fadbd8;
  --dl-delta-bad-ink: #c53929;
  --dl-coach-border: #e6dac2;
  --dl-coach-badge-bg: #f6dcc2;
}

/* Base Reset & Distraction-Free Mobile-First Shell */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}

.dl-standalone-body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background-color: var(--dl-surface-backdrop);
  color: var(--dl-ink-navy);
  font-family: var(--dl-font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dl-skip-link:focus {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  width: auto;
  height: auto;
  padding: 0.65rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background-color: var(--dl-ink-navy);
  color: var(--dl-ink-white);
  border-radius: var(--dl-radius-sm);
  font-weight: 700;
  z-index: 9999;
  text-decoration: none;
}

/* Adaptive Storybook Container (Mobile 100% -> Tablet 540px -> Desktop 620px) */
.dl-app-shell {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
}

.dl-phone-frame {
  --dl-frame-pad-x: 1.1rem;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background-color: var(--dl-surface-cream);
  display: flex;
  flex-direction: column;
  position: relative;
  container-type: inline-size;
  container-name: story-frame;
}

@media (min-width: 480px) {
  .dl-app-shell {
    padding: 1.25rem 0.75rem 2.25rem;
  }

  .dl-phone-frame {
    min-height: auto;
    border-radius: var(--dl-radius-xl);
    box-shadow: var(--dl-shadow-phone);
    border: 1px solid var(--dl-border-soft);
  }
}

@media (min-width: 768px) {
  .dl-app-shell {
    padding: 1.75rem 1.25rem 2.75rem;
  }

  .dl-phone-frame {
    max-width: 540px;
    --dl-frame-pad-x: 1.6rem;
  }
}

@media (min-width: 1024px) {
  .dl-app-shell {
    padding: 2rem 1.5rem 3.25rem;
  }

  .dl-phone-frame {
    max-width: 620px;
    --dl-frame-pad-x: 2rem;
  }
}

/* Cinematic Scroll-Snap Deck & Slides */
.dl-cinema-deck {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.dl-phone-screen {
  width: 100%;
  min-height: 100dvh;
  padding: 0.9rem var(--dl-frame-pad-x, 1.1rem) 1.5rem;
  background-color: var(--dl-surface-cream);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.55rem;
  border-bottom: 1px dashed var(--dl-border-soft);
}

.dl-cinema-slide {
  backface-visibility: hidden;
  scroll-margin-top: 66px;
}

.dl-cinema-slide--situation {
  padding-bottom: 1rem;
}

.dl-cinema-slide--consequence,
.dl-cinema-slide--coaching {
  border-top: 1px dashed var(--dl-border-soft);
  padding-top: 0.7rem;
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
  min-height: calc(100dvh - 58px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.28rem;
}

.dl-cinema-slide--coaching {
  padding-top: 1.15rem;
}

.dl-phone-screen[hidden],
.dl-setup-view[hidden],
.dl-play-view[hidden],
.dl-result-view[hidden] {
  display: none !important;
}

/* Cinematic Stage Entry & Scroll-Driven Parallax Keyframes */
@keyframes dlStageCinemaIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dlCinemaSlideReveal {
  0% {
    opacity: 0.35;
    transform: translateY(34px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dlParallaxArt {
  from {
    transform: translateY(24px) scale(0.96);
  }
  to {
    transform: translateY(-20px) scale(1.02);
  }
}

@keyframes dlParallaxBadge {
  from {
    transform: translateY(42px);
  }
  to {
    transform: translateY(-32px);
  }
}

@keyframes dlParallaxTitle {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(0);
  }
}

.dl-cinema-enter {
  animation: dlStageCinemaIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Fallback CSS Custom Property Parallax (when view-timeline is unsupported) */
.dl-parallax-stage {
  position: relative;
  --parallax-shift: 0px;
}

.dl-parallax-layer--art {
  transform: translateY(var(--parallax-shift, 0px));
  will-change: transform;
}

/* Native CSS Scroll-Driven Animations (Chrome 115+, Edge 115+, Safari 26+) */
@supports ((animation-timeline: view()) and (animation-range: entry 0% exit 100%)) {
  .dl-cinema-slide {
    view-timeline: --dl-slide-tl block;
    animation: dlCinemaSlideReveal auto linear both;
    animation-timeline: --dl-slide-tl;
    animation-range: entry 0% cover 26%;
  }

  .dl-parallax-stage {
    view-timeline: --dl-stage-tl block;
  }

  .dl-parallax-stage .dl-parallax-layer--art {
    animation: dlParallaxArt auto linear both;
    animation-timeline: --dl-stage-tl;
    animation-range: entry 0% exit 100%;
  }

  .dl-parallax-stage .dl-parallax-layer--badge {
    animation: dlParallaxBadge auto linear both;
    animation-timeline: --dl-stage-tl;
    animation-range: entry 5% exit 95%;
  }

  .dl-cinema-slide .dl-parallax-layer--title {
    animation: dlParallaxTitle auto linear both;
    animation-timeline: --dl-slide-tl;
    animation-range: entry 0% exit 100%;
  }
}

/* Scroll-to-Advance Sentinel */
.dl-scroll-sentinel {
  width: 100%;
  height: 1px;
  min-height: 1px;
  padding: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.dl-scroll-sentinel--top {
  min-height: 28dvh;
  padding: 1.25rem 1.15rem 1rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed var(--dl-border-soft);
}

.dl-scroll-sentinel-card {
  width: 100%;
  padding: 1rem 1.15rem;
  border-radius: var(--dl-radius-lg);
  background-color: var(--dl-surface-yellow-tint);
  border: 2px dashed var(--dl-accent-mustard);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.dl-scroll-sentinel:hover .dl-scroll-sentinel-card {
  transform: translateY(-2px);
  background-color: var(--dl-surface-peach);
}

.dl-scroll-sentinel-kicker {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dl-accent-teal-dark);
}

.dl-scroll-sentinel-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--dl-ink-navy);
}

/* Top Bars & Focus States */
.dl-screen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

[tabindex='-1']:focus {
  outline: none;
}

.dl-pill-cta:focus-visible,
.dl-dog-col-card:focus-visible,
.dl-choice-btn:focus-visible,
.dl-share-pill:focus-visible,
.dl-btn:focus-visible {
  outline: 3px solid var(--dl-ink-navy);
  outline-offset: 2px;
}

/* Screen 1: Splash Intro */
.dl-splash-header {
  text-align: center;
  padding: 0.1rem 0.25rem 0.35rem;
}

.dl-splash-title {
  margin: 0 0 0.55rem;
  padding-bottom: 0.48rem;
  font-family: var(--dl-font-serif);
  font-size: 1.46rem;
  font-weight: 800;
  line-height: 1.22;
  color: var(--dl-ink-navy);
  position: relative;
}

.dl-splash-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 128px;
  height: 9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 12'%3E%3Cpath d='M4 8.5 C42 3.2 98 3.6 136 6.8' stroke='%23f4ba2a' stroke-width='5.2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}

.dl-splash-subtitle {
  margin: 0 auto 0.65rem;
  max-width: 34ch;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--dl-ink-secondary);
}

/* Seamless Flat Editorial Illustrations on #FAF6EE */
.dl-splash-art-wrap {
  position: relative;
  width: 100%;
  margin: 0.15rem 0 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dl-splash-art-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Mustard Pill Primary CTA Button */
.dl-screen-cta-wrap {
  margin-top: 0.45rem;
  width: 100%;
  position: relative;
}

.dl-ornament-paw-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dl-pill-cta {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 52px;
  padding: 0.82rem 1.35rem;
  border-radius: var(--dl-radius-pill);
  border: none;
  font-family: var(--dl-font-sans);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 8px 20px -4px rgba(217, 130, 20, 0.36);
  transition: background-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.dl-pill-cta--mustard {
  background: linear-gradient(180deg, #f6c43e 0%, #efb024 100%);
  background-color: var(--dl-accent-mustard);
  color: var(--dl-ink-navy);
}

.dl-pill-cta--mustard:hover {
  background: linear-gradient(180deg, #f2ba2c 0%, #e5a418 100%);
  background-color: var(--dl-accent-mustard-hover);
  transform: translateY(-1px);
}

/* Screen 2 & Screen 3 Titles */
.dl-screen-title {
  margin: 0 0 0.45rem;
  padding-bottom: 0.48rem;
  font-family: var(--dl-font-serif);
  font-size: 1.58rem;
  font-weight: 800;
  line-height: 1.18;
  color: var(--dl-ink-navy);
  text-align: center;
  position: relative;
}

.dl-screen-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 124px;
  height: 9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 12'%3E%3Cpath d='M4 8.5 C42 3.2 98 3.6 136 6.8' stroke='%23f4ba2a' stroke-width='5.2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}

.dl-screen-subtitle {
  margin: 0 auto 0.75rem;
  max-width: 34ch;
  font-size: 0.88rem;
  line-height: 1.42;
  color: var(--dl-ink-secondary);
  text-align: center;
}

/* Screen 2: Center-Stage Dog Carousel (#dlDogList) */
.dl-dog-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0.15rem 0 0.35rem;
  gap: 0.55rem;
}

.dl-dog-carousel-stage {
  position: relative;
  width: 100%;
  height: 276px;
  perspective: 960px;
  transform-style: preserve-3d;
  margin: 0.25rem 0;
}

.dl-dog-col-card {
  appearance: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  text-align: center;
  padding: 0.7rem 0.65rem 0.8rem;
  border-radius: var(--dl-radius-lg);
  background-color: var(--dl-surface-card);
  border: 2px solid var(--dl-border-soft);
  color: var(--dl-ink-navy);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  will-change: transform, opacity;
  transition:
    transform 0.54s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.44s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.32s ease,
    box-shadow 0.44s ease,
    background-color 0.32s ease;
}

.dl-dog-carousel-card--active {
  z-index: 3;
  pointer-events: auto;
  cursor: pointer;
  background-color: var(--dl-surface-card);
  border-color: var(--dl-accent-mustard);
  box-shadow: var(--dl-shadow-card);
  transform: translate3d(-50%, -50%, 36px) scale(1.06) rotateY(0deg);
  opacity: 1;
}

.dl-dog-carousel-card--prev,
.dl-dog-carousel-card--next {
  z-index: 1;
  pointer-events: none;
  cursor: default;
  background-color: var(--dl-surface-subtle);
  border-color: var(--dl-border-soft);
  opacity: 0.78;
}

.dl-dog-carousel-card--prev {
  transform: translate3d(-138%, -50%, -36px) scale(0.66) rotateY(16deg);
}

.dl-dog-carousel-card--next {
  transform: translate3d(38%, -50%, -36px) scale(0.66) rotateY(-16deg);
}

.dl-dog-carousel-art-wrap {
  width: 100%;
  border-radius: var(--dl-radius-md);
  overflow: hidden;
  background-color: var(--dl-surface-cream);
}

.dl-dog-carousel-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: 43.5% center;
  aspect-ratio: 1 / 1;
  transform: scale(1.22);
  transition: transform 0.54s cubic-bezier(0.22, 1, 0.36, 1);
}

.dl-dog-carousel-card--active .dl-dog-carousel-img {
  transform: scale(1.26);
}

.dl-dog-col-name {
  font-family: var(--dl-font-sans);
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--dl-ink-navy);
  line-height: 1.15;
}

.dl-dog-carousel-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.dl-carousel-arrow {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--dl-border-soft);
  background-color: var(--dl-surface-card);
  color: var(--dl-ink-navy);
  font-family: var(--dl-font-sans);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.dl-carousel-arrow:hover {
  background-color: var(--dl-surface-subtle);
  border-color: var(--dl-accent-mustard);
}

.dl-carousel-arrow:focus-visible {
  outline: 3px solid var(--dl-ink-navy);
  outline-offset: 2px;
}

.dl-carousel-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dl-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--dl-radius-pill);
  background-color: var(--dl-border-soft);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.dl-carousel-dot--active {
  width: 22px;
  background-color: var(--dl-accent-mustard);
}

/* Screens 4-8: Minimal Playing HUD Top Bar & Connected Teal Dots */
.dl-play-view {
  width: 100%;
  padding: 0 var(--dl-frame-pad-x, 1.1rem) 1.4rem;
  background-color: var(--dl-surface-cream);
}

#dlHudContainer {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 calc(-1 * var(--dl-frame-pad-x, 1.1rem)) 0.5rem;
  padding: 0.45rem var(--dl-frame-pad-x, 1.1rem) 0.5rem;
  background-color: var(--dl-surface-cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 24' preserveAspectRatio='none'%3E%3Cpath d='M0 18 Q95 6 200 15 T400 12' stroke='%23ebd39b' stroke-width='2.2' fill='none' opacity='0.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% 14px;
  border-bottom: 1px solid rgba(217, 155, 82, 0.28);
}

.dl-screen-topbar--hud {
  position: relative;
  margin-bottom: 0;
  padding: 0.1rem 0;
  justify-content: center;
}

.dl-consequence-callout {
  margin: 0 0 0.55rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--dl-radius-md);
  background-color: var(--dl-surface-peach);
  border: 1px solid var(--dl-accent-mustard);
  color: var(--dl-ink-navy);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.dl-consequence-callout p {
  margin: 0;
}

.dl-hud-center-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
}

.dl-hud-day-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--dl-ink-navy);
  letter-spacing: 0.01em;
}

.dl-day-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.dl-day-pip {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background-color: var(--dl-surface-cream);
  border: 2.2px solid var(--dl-accent-teal);
  position: relative;
  display: inline-block;
}

.dl-day-pip:not(:last-child) {
  margin-right: 10px;
}

.dl-day-pip:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  width: 12px;
  height: 2.4px;
  background-color: var(--dl-accent-teal);
  transform: translateY(-50%);
}

.dl-day-pip--done {
  background-color: var(--dl-accent-teal);
}

.dl-day-pip--active {
  background-color: var(--dl-accent-mustard);
  border: 2.5px solid var(--dl-ink-navy);
  transform: scale(1.25);
  z-index: 1;
}

/* Scenario Stage Card (Screens 4, 7, 8) */
.dl-stage-card {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.dl-scene-top-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.dl-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--dl-radius-pill);
  background-color: var(--dl-accent-coral);
  color: var(--dl-ink-white);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.dl-heading-block {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.25rem;
}

.dl-heading-paw {
  width: 22px;
  height: 22px;
  color: #b58656;
  opacity: 0.85;
  flex-shrink: 0;
  margin-top: 0.1rem;
  transform: rotate(15deg);
  pointer-events: none;
}

.dl-scene-title {
  margin: 0;
  padding-bottom: 0.38rem;
  font-family: var(--dl-font-serif);
  font-size: clamp(1.32rem, 5.4vw, 1.62rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: var(--dl-ink-navy);
  position: relative;
}

.dl-scene-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 126px;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 12'%3E%3Cpath d='M3 8.8 C44 3.2 98 3.6 137 6.8' stroke='%23f4ba2a' stroke-width='5.2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}

.dl-scene-body {
  margin: 0 0 0.3rem;
  font-size: 0.87rem;
  line-height: 1.38;
  color: var(--dl-ink-navy);
}

.dl-scene-context {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--dl-radius-md);
  background-color: var(--dl-surface-peach);
  color: var(--dl-ink-navy);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Seamless Illustration Frame with Soft Vignette & Speech Bubble */
.dl-scene-illustration-frame {
  position: relative;
  width: 100%;
  margin: 0.05rem 0 0.4rem;
  border-radius: 22px;
  overflow: hidden;
  background-color: var(--dl-surface-cream);
}

.dl-scene-illustration-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  box-shadow: inset 0 0 16px 8px var(--dl-surface-cream);
  pointer-events: none;
  z-index: 1;
}

.dl-scene-illustration-img {
  width: 100%;
  height: auto;
  aspect-ratio: 800 / 520;
  display: block;
  object-fit: contain;
  border-radius: 22px;
}

.dl-scene-illustration-frame--reaction .dl-scene-illustration-img {
  max-height: 192px;
  object-fit: cover;
  object-position: center;
}

.dl-speech-bubble {
  position: absolute;
  bottom: 0.5rem;
  right: 0.6rem;
  display: inline-block;
  padding: 0.3rem 0.78rem;
  border-radius: var(--dl-radius-pill);
  background-color: var(--dl-surface-card);
  border: 2px solid var(--dl-ink-navy);
  color: var(--dl-ink-navy);
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: var(--dl-shadow-card);
  z-index: 2;
}

/* Choice Cards with Circular A / B / C Badges */
.dl-choices-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dl-choice-btn {
  appearance: none;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-radius: var(--dl-radius-lg);
  background-color: var(--dl-surface-card);
  border: 1.5px solid var(--dl-border-soft);
  color: var(--dl-ink-navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--dl-shadow-card);
  transition: border-color 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.dl-choice-btn:hover {
  border-color: var(--dl-ink-navy);
  transform: translateY(-1px);
}

.dl-choice-btn--selected {
  border-color: var(--dl-accent-mustard);
  background-color: var(--dl-surface-peach);
}

.dl-choice-btn[aria-disabled='true'] {
  opacity: 0.55;
}

.dl-choice-key {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 800;
  flex-shrink: 0;
  background-color: var(--dl-accent-mustard);
  color: var(--dl-ink-navy);
}

.dl-choice-key--b {
  background-color: var(--dl-accent-coral);
  color: var(--dl-ink-white);
}

.dl-choice-key--c {
  background-color: var(--dl-accent-teal);
  color: var(--dl-ink-white);
}

.dl-choice-text-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dl-choice-label-text {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--dl-ink-navy);
}

.dl-choice-cost--paid {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--dl-accent-coral-dark);
}

/* Delta Badges & Trainer Speaker Pill */
.dl-score-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  font-size: clamp(0.68rem, 2.8vw, 0.78rem);
  font-weight: 800;
  line-height: 1.2;
  padding: 0.12rem 0.5rem;
  border-radius: var(--dl-radius-pill);
  white-space: nowrap;
}

.dl-score-delta--good {
  background-color: var(--dl-delta-good-bg);
  color: var(--dl-delta-good-ink);
}

.dl-score-delta--bad {
  background-color: var(--dl-delta-bad-bg);
  color: var(--dl-delta-bad-ink);
}

.dl-score-delta--neutral {
  background-color: var(--dl-surface-subtle);
  color: var(--dl-ink-muted);
}

.dl-trainer-speaker-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.24rem 0.72rem;
  border-radius: var(--dl-radius-pill);
  background-color: var(--dl-coach-badge-bg);
  color: var(--dl-ink-navy);
  font-size: 0.76rem;
  font-weight: 800;
}

/* Mobile-First 4-Medallion Score Strip & Refined Coach Box */
.dl-score-chips-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.25rem, 1.8vw, 0.5rem);
  width: 100%;
  margin: 0.08rem 0 0.25rem;
  align-items: start;
}

.dl-score-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.14rem;
  padding: 0.05rem 0;
  background-color: transparent;
  border: none;
  text-align: center;
  min-width: 0;
}

.dl-metric-art {
  display: block;
  width: 100%;
  max-width: 72px;
  aspect-ratio: 1 / 1;
  filter: drop-shadow(0 4px 9px rgba(11, 33, 73, 0.1));
}

.dl-metric-art-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.dl-score-chip-val {
  font-size: clamp(0.75rem, 3.5vw, 0.96rem);
  font-weight: 800;
  color: var(--dl-ink-navy);
  line-height: 1.15;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.dl-compact-coach-box {
  position: relative;
  padding: 0.62rem 0.85rem 0.68rem;
  border-radius: var(--dl-radius-lg);
  background: linear-gradient(180deg, #fffdf9 0%, #fbf5e8 100%);
  border: 1.5px solid var(--dl-coach-border);
  box-shadow: 0 8px 22px -10px rgba(11, 33, 73, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-bottom: 0.12rem;
}

.dl-compact-coach-box::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 18px;
  border: 1px dashed rgba(217, 155, 82, 0.34);
  pointer-events: none;
}

.dl-compact-coach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}

.dl-coach-sparkle {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.dl-compact-coach-text {
  margin: 0;
  padding-right: 1.25rem;
  font-size: 0.81rem;
  line-height: 1.36;
  color: var(--dl-ink-navy);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.dl-coach-paw {
  position: absolute;
  right: 0.55rem;
  bottom: 0.4rem;
  width: 20px;
  height: 20px;
  color: #ebb659;
  transform: rotate(14deg);
  pointer-events: none;
}

/* Screens 9, 10, 11: Result Flow */
.dl-result-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--dl-surface-cream);
}

.dl-result-screen {
  border-bottom: 1px dashed var(--dl-border-soft);
}

.dl-result-celebration {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 0.75rem;
}

.dl-result-art-frame {
  position: relative;
  width: 100%;
  margin-bottom: 0.65rem;
}

.dl-result-art-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.dl-result-ribbon {
  display: inline-block;
  margin-top: -0.5rem;
  padding: 0.28rem 1rem;
  border-radius: var(--dl-radius-pill);
  background-color: var(--dl-accent-mustard);
  color: var(--dl-ink-navy);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dl-result-survived-tag {
  margin: 0.45rem 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--dl-accent-teal-dark);
}

/* Social Share Pills Strip */
.dl-share-strip {
  text-align: center;
  margin-top: 0.35rem;
}

.dl-share-strip-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--dl-ink-muted);
}

.dl-share-pills-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.dl-share-pill {
  appearance: none;
  border: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--dl-radius-pill);
  font-family: var(--dl-font-sans);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--dl-ink-white);
  cursor: pointer;
}

.dl-share-pill--fb {
  background-color: var(--dl-share-fb);
}

.dl-share-pill--ig {
  background-color: var(--dl-share-ig);
}

.dl-share-pill--wa {
  background-color: var(--dl-share-wa);
  color: var(--dl-ink-navy);
}

.dl-share-status {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dl-accent-teal-dark);
}

/* Screen 10: Compatibility & Verdict */
.dl-card-section-title {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dl-ink-navy);
}

.dl-compatibility-card,
.dl-academy-verdict,
.dl-moments-block {
  padding: 0.9rem;
  border-radius: var(--dl-radius-lg);
  background-color: var(--dl-surface-card);
  border: 1px solid var(--dl-border-soft);
  margin-bottom: 0.85rem;
}

.dl-compat-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dl-compat-ring-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dl-compat-pct {
  position: absolute;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dl-ink-navy);
}

.dl-compat-headline {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--dl-ink-navy);
}

.dl-compat-sub {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--dl-ink-secondary);
}

.dl-budget-observation-card {
  padding: 0.8rem 0.9rem;
  border-radius: var(--dl-radius-lg);
  background-color: var(--dl-surface-yellow-tint);
  border: 1px solid var(--dl-accent-mustard);
  margin-bottom: 0.85rem;
}

.dl-budget-observation-head {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.dl-budget-observation-icon {
  font-size: 1.05rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.dl-budget-observation-titles {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.dl-budget-observation-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--dl-ink-navy);
}

.dl-budget-observation-breakdown {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--dl-accent-coral-dark);
}

.dl-budget-observation-text {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.42;
  color: var(--dl-ink-secondary);
}

.dl-verdict-quote {
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--dl-ink-secondary);
}

.dl-verdict-author {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--dl-accent-coral-dark);
  text-align: right;
}

.dl-key-lesson-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--dl-radius-md);
  background-color: var(--dl-surface-yellow-tint);
  border: 1px solid var(--dl-accent-mustard);
  font-size: 0.8rem;
  color: var(--dl-ink-navy);
}

.dl-key-lesson-callout p {
  margin: 0.15rem 0 0;
}

/* Screen 11: Numbered Next Steps */
.dl-next-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.5rem 0 0.85rem;
}

.dl-next-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--dl-radius-lg);
  background-color: var(--dl-surface-card);
  border: 1px solid var(--dl-border-soft);
}

.dl-next-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--dl-accent-mustard);
  color: var(--dl-ink-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 800;
  flex-shrink: 0;
}

.dl-next-step-body strong {
  display: block;
  font-size: 0.9rem;
  color: var(--dl-ink-navy);
  margin-bottom: 0.15rem;
}

.dl-next-step-body p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--dl-ink-secondary);
}

.dl-inline-link-btn {
  margin-top: 0.35rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--dl-accent-teal-dark);
  font-family: var(--dl-font-sans);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
}

/* Callbacks, Banners & Dialogs */
.dl-callbacks-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dl-callback-card {
  padding: 0.65rem 0.8rem;
  border-radius: var(--dl-radius-md);
  background-color: var(--dl-surface-subtle);
  font-size: 0.8rem;
  color: var(--dl-ink-navy);
}

.dl-callback-card p {
  margin: 0.2rem 0 0;
}

.dl-callback-day {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--dl-accent-teal-dark);
}

.dl-edu-lesson-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-weight: 800;
  color: var(--dl-ink-navy);
}

.dl-banner-area {
  padding: 0 var(--dl-frame-pad-x, 1.15rem);
}

.dl-banner {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--dl-radius-md);
  background-color: var(--dl-surface-card);
  border: 1.5px solid var(--dl-accent-mustard);
  font-size: 0.82rem;
}

.dl-banner-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}

.dl-btn {
  appearance: none;
  padding: 0.5rem 0.9rem;
  border-radius: var(--dl-radius-pill);
  border: 1px solid var(--dl-border-strong);
  font-family: var(--dl-font-sans);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  background-color: var(--dl-surface-card);
  color: var(--dl-ink-navy);
}

.dl-btn--primary {
  background-color: var(--dl-accent-mustard);
  border-color: var(--dl-accent-mustard);
}

.dl-dialog {
  max-width: 360px;
  width: calc(100% - 2rem);
  border-radius: var(--dl-radius-lg);
  border: 1px solid var(--dl-border-strong);
  background-color: var(--dl-surface-cream);
  color: var(--dl-ink-navy);
  padding: 1.25rem;
}

.dl-dialog::backdrop {
  background-color: var(--dl-backdrop-scrim);
}

.dl-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dl-copy-fallback-box {
  margin-top: 0.5rem;
  text-align: left;
}

.dl-copy-fallback-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.dl-copy-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: var(--dl-radius-sm);
  border: 1px solid var(--dl-border-strong);
  font-size: 0.78rem;
}

/* ==========================================================================
   Adaptive Storybook Scaling (Tablet ≥480px container & Desktop ≥560px container)
   Uses CSS Container Queries (`@container story-frame`) and `cqi` fluid scaling
   with `@media` fallbacks for older browsers.
   ========================================================================== */

/* Fallback media queries for browsers without container-query support */
@media (min-width: 768px) {
  .dl-phone-screen {
    padding-top: 1.25rem;
    padding-bottom: 1.85rem;
    gap: 0.7rem;
  }

  .dl-cinema-slide--consequence,
  .dl-cinema-slide--coaching {
    padding-top: 0.95rem;
    padding-bottom: 1.25rem;
    gap: 0.45rem;
  }

  .dl-splash-title,
  .dl-screen-title {
    font-size: 1.72rem;
  }

  .dl-splash-subtitle,
  .dl-screen-subtitle {
    max-width: 42ch;
    font-size: 0.98rem;
  }

  .dl-dog-carousel-stage {
    height: 324px;
  }

  .dl-dog-col-card {
    width: 46%;
    padding: 0.85rem 0.75rem 0.95rem;
  }

  .dl-dog-col-name {
    font-size: 1.44rem;
  }

  .dl-scene-title {
    font-size: 1.68rem;
  }

  .dl-scene-body {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .dl-scene-illustration-frame--reaction .dl-scene-illustration-img {
    max-height: 248px;
  }

  .dl-choice-btn {
    padding: 0.9rem 1.05rem;
  }

  .dl-choice-label-text {
    font-size: 0.95rem;
  }

  .dl-metric-art {
    max-width: 86px;
  }

  .dl-score-chip-val {
    font-size: 1.02rem;
  }

  .dl-score-delta {
    font-size: 0.8rem;
    padding: 0.14rem 0.58rem;
  }

  .dl-compact-coach-box {
    padding: 0.78rem 1.05rem 0.85rem;
  }

  .dl-compact-coach-text {
    font-size: 0.9rem;
    line-height: 1.44;
  }

  .dl-dialog {
    max-width: 420px;
  }
}

/* Container-aware rules when `container-type: inline-size` is supported */
@supports (container-type: inline-size) {
  @container story-frame (min-width: 480px) {
    .dl-phone-screen {
      padding-top: 1.25rem;
      padding-bottom: 1.85rem;
      gap: 0.7rem;
    }

    .dl-cinema-slide--consequence,
    .dl-cinema-slide--coaching {
      padding-top: 0.95rem;
      padding-bottom: 1.25rem;
      gap: 0.45rem;
    }

    .dl-splash-title,
    .dl-screen-title {
      font-size: clamp(1.46rem, 0.85rem + 1.8cqi, 1.86rem);
    }

    .dl-splash-subtitle,
    .dl-screen-subtitle {
      max-width: 42ch;
      font-size: clamp(0.9rem, 0.65rem + 0.65cqi, 1.02rem);
    }

    .dl-dog-carousel-stage {
      height: 324px;
    }

    .dl-dog-col-card {
      width: 46%;
      padding: 0.85rem 0.75rem 0.95rem;
    }

    .dl-dog-col-name {
      font-size: 1.44rem;
    }

    .dl-scene-title {
      font-size: clamp(1.38rem, 0.8rem + 1.75cqi, 1.8rem);
    }

    .dl-scene-body {
      font-size: clamp(0.9rem, 0.65rem + 0.6cqi, 1rem);
      line-height: 1.46;
    }

    .dl-scene-illustration-frame--reaction .dl-scene-illustration-img {
      max-height: 248px;
    }

    .dl-choice-btn {
      padding: 0.9rem 1.05rem;
    }

    .dl-choice-label-text {
      font-size: clamp(0.9rem, 0.65rem + 0.55cqi, 0.98rem);
    }

    .dl-metric-art {
      max-width: 86px;
    }

    .dl-score-chip-val {
      font-size: clamp(0.92rem, 0.65rem + 0.65cqi, 1.08rem);
    }

    .dl-score-delta {
      font-size: 0.8rem;
      padding: 0.14rem 0.58rem;
    }

    .dl-compact-coach-box {
      padding: 0.78rem 1.05rem 0.85rem;
    }

    .dl-compact-coach-text {
      font-size: clamp(0.85rem, 0.62rem + 0.52cqi, 0.94rem);
      line-height: 1.44;
    }
  }

  @container story-frame (min-width: 560px) {
    .dl-dog-carousel-stage {
      height: 356px;
    }

    .dl-dog-col-card {
      width: 44%;
    }

    .dl-scene-illustration-frame--reaction .dl-scene-illustration-img {
      max-height: 288px;
    }

    .dl-metric-art {
      max-width: 94px;
    }

    .dl-pill-cta {
      min-height: 56px;
      font-size: 1.04rem;
    }
  }
}

/* Mandatory Reduced-Motion Guard */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .dl-cinema-slide,
  .dl-cinema-enter,
  .dl-parallax-layer--art,
  .dl-parallax-layer--badge,
  .dl-parallax-layer--title,
  .dl-icon-nav-btn,
  .dl-pill-cta,
  .dl-dog-col-card,
  .dl-lifestyle-card,
  .dl-choice-btn,
  .dl-bar-fill {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
