/* OneScene UX6: restore Today balance and eliminate phantom catalogue scrolling.
   This stylesheet is intentionally scoped; the global topbar, scene runtime, and
   mobile gameplay are unchanged. */

/* The shell already owns the vertical scroll for /app/programs and /app/stories.
   Its old min-height: viewport-minus-topbar + bottom padding made short pages
   overflow by a few pixels, producing a grey scrollbar even when they fit. */
@media (min-width:1100px) and (min-height:820px) {
  body .pv3-root[data-r18-page-scroll="enabled"]
  > .r18-page-scroll-owner
  > .r18-page-scroll-content:has(> .pv3-programs-journey-page) {
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    margin-bottom:0!important;
    padding-bottom:6px!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body .pv3-root[data-r18-page-scroll="enabled"]
  > .r18-page-scroll-owner:has(> .r18-page-scroll-content > .pv3-programs-journey-page) {
    scrollbar-gutter:auto!important;
    overflow-y:auto!important; /* Real overflow remains scrollable. */
  }
  body .pv3-root[data-r18-page-scroll="enabled"]
  > .r18-page-scroll-owner
  > .r18-page-scroll-content > .pv3-programs-journey-page {
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    margin-bottom:0!important;
  }
}

/* Today: preserve the useful height of the active training/story row.
   Recover the space from the recommended-scenario rail, not from continuation
   cards; keep a small cushion above the bottom edge of the viewport. */
@media (min-width:1100px) and (min-height:820px) {
  body .pv3-root[data-r18-viewport-dashboard="today"]
  > .ss-today-shell-main > .ss-today-content {
    padding-bottom:16px!important;
  }
  .ss-today-page[data-today-freeze="v2422"] .ss-today-stage {
    grid-template-rows:minmax(0,1.05fr) minmax(0,.69fr) minmax(218px,.95fr)!important;
    gap:10px!important;
    min-height:0!important;
  }
  .ss-today-page[data-today-freeze="v2422"] .ss-today-recommendations {
    grid-template-rows:36px minmax(0,1fr)!important;
    gap:5px!important;
    min-height:0!important;
  }
  .ss-today-page[data-today-freeze="v2422"] .ss-today-practice-head {
    height:36px!important;
    min-height:36px!important;
  }
  .ss-today-page[data-today-freeze="v2422"] .ss-today-scenario-grid {
    height:100%!important;
    min-height:0!important;
  }
  .ss-today-page[data-today-freeze="v2422"] .ss-today-active-pool,
  .ss-today-page[data-today-freeze="v2422"] .ss-today-active-card-wrap,
  .ss-today-page[data-today-freeze="v2422"] .ss-today-active-card-wrap > .ss-today-balanced-link {
    height:100%!important;
    min-height:0!important;
  }
  .ss-today-page[data-today-freeze="v2422"] .ss-today-active-pool .ss-today-route-card,
  .ss-today-page[data-today-freeze="v2422"] .ss-today-active-pool .ss-today-training-card {
    height:100%!important;
    min-height:0!important;
  }
}

/* The Today lead's scenario actor was once 148% high and anchored above the
   frame, which chops portraits unpredictably. Match the image to its source
   crop without changing the actual actor or first-scene location. */
@media (min-width:980px) {
  .ss-today-page[data-today-ui="canonical-v2418"]
  .ss-today-hero-visual > .pv3-visual-card-foreground {
    top:0!important;
    bottom:auto!important;
    right:2%!important;
    left:auto!important;
    width:48%!important;
    max-width:48%!important;
    height:124%!important;
    max-height:none!important;
    object-fit:contain!important;
    object-position:center top!important;
    transform:none!important;
  }
  .ss-today-page[data-today-ui="canonical-v2418"]
  .ss-today-hero-visual > .pv3-visual-card-foreground[data-r18-actor-frame="full"] {height:174%!important;}
  .ss-today-page[data-today-ui="canonical-v2418"]
  .ss-today-hero-visual > .pv3-visual-card-foreground[data-r18-actor-frame="knee"] {height:148%!important;}
  .ss-today-page[data-today-ui="canonical-v2418"]
  .ss-today-hero-visual > .pv3-visual-card-foreground[data-r18-actor-frame="waist"] {height:132%!important;}
  .ss-today-page[data-today-ui="canonical-v2418"]
  .ss-today-hero-visual > .pv3-visual-card-foreground[data-r18-actor-frame="chest"] {height:112%!important;}
  .ss-today-page[data-today-ui="canonical-v2418"]
  .ss-today-hero:has(.ss-today-hero-visual) .ss-today-hero-copy h2 {
    overflow-wrap:break-word!important;
    font-size:clamp(26px,2.1vw,35px)!important;
    line-height:1.05!important;
  }
}

/* At shorter viewports do not hide content just to remove a scrollbar. */
