/* =========================================================
   NEXT Athlete OS · System Layer
   Purpose:
   - One visible source of truth for shared UI.
   - Legacy app.css remains for feature-specific internals only.
   - Shell/topbar/cards/chips/buttons/modals are governed here.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root{
  --next-bg:#020814;
  --next-bg-2:#061426;
  --next-bg-3:#020711;
  --next-surface:rgba(8,22,40,.86);
  --next-surface-2:rgba(4,13,26,.82);
  --next-surface-hard:rgba(4,10,22,.94);
  --next-card-border:rgba(105,220,255,.24);
  --next-card-border-strong:rgba(112,235,255,.50);
  --next-accent:#6eeaff;
  --next-accent-2:#58b9ff;
  --next-accent-soft:rgba(104,234,255,.18);
  --next-text:#f8fbff;
  --next-muted:rgba(220,232,246,.72);
  --next-muted-2:rgba(220,232,246,.56);
  --next-danger:#ff6868;
  --next-radius-nav:28px;
  --next-radius-card:28px;
  --next-radius-card-sm:20px;
  --next-radius-chip:999px;
  --next-page-max:1180px;
  --next-content-max:1040px;
  --next-page-pad-x:clamp(14px,3vw,30px);
  --next-page-pad-y:clamp(12px,2.6vw,24px);
  --next-section-gap:clamp(12px,2.2vw,22px);
  --next-card-pad:clamp(16px,2.4vw,26px);
  --next-chip-h:34px;
  --next-btn-h:52px;
  --next-shadow-card:0 18px 54px rgba(0,0,0,.28);
  --next-glow:0 0 36px rgba(0,210,255,.11);
}
body[data-next-theme="ice-hockey"]{
  --next-bg:#020814; --next-bg-2:#051a30; --next-surface:rgba(7,24,43,.88);
  --next-accent:#8af5ff; --next-accent-2:#65c9ff; --next-card-border:rgba(139,245,255,.26);
  --next-accent-soft:rgba(139,245,255,.19);
}
body[data-next-theme="downhill-night"]{
  --next-bg:#020912; --next-bg-2:#071920; --next-surface:rgba(7,24,32,.88);
  --next-accent:#71f0c4; --next-accent-2:#55b8ff; --next-card-border:rgba(113,240,196,.25);
  --next-accent-soft:rgba(113,240,196,.16);
}
body[data-next-theme="energy-purple"]{
  --next-bg:#070716; --next-bg-2:#111432; --next-surface:rgba(17,18,47,.88);
  --next-accent:#b98cff; --next-accent-2:#52dfff; --next-card-border:rgba(185,140,255,.26);
  --next-accent-soft:rgba(185,140,255,.18);
}
body[data-next-theme="clean-dark"]{
  --next-bg:#02060d; --next-bg-2:#07101d; --next-surface:rgba(8,18,32,.92);
  --next-surface-2:rgba(3,9,18,.88); --next-accent:#74e7ff; --next-accent-2:#7fb6ff;
  --next-card-border:rgba(130,210,255,.19); --next-accent-soft:rgba(116,231,255,.11);
  --next-glow:0 0 22px rgba(0,170,255,.07);
}

/* ---------- App reset / screen ownership ---------- */
html,body,.wrap,.screen{max-width:100%!important;overflow-x:clip!important;}
@supports not (overflow:clip){html,body,.wrap,.screen{overflow-x:hidden!important;}}

body:not(.exercise-active){
  background:
    radial-gradient(800px 520px at 86% 6%,var(--next-accent-soft),transparent 62%),
    linear-gradient(180deg,var(--next-bg),var(--next-bg-2) 58%,var(--next-bg-3))!important;
  color:var(--next-text)!important;
}

/* Screen visibility is one source of truth. */
body:not(.exercise-active) .screen:not(.active){display:none!important;visibility:hidden!important;pointer-events:none!important;}
body:not(.exercise-active) .screen.active{display:block!important;visibility:visible!important;pointer-events:auto!important;}
body[data-screen]:not([data-screen="startScreen"]):not(.exercise-active) #startScreen{display:none!important;}
body[data-screen="startScreen"]:not(.exercise-active) #startScreen.active{display:block!important;}
body:not([data-screen="startScreen"]):not(.exercise-active) > .dashboard-viewport-bg-img{display:none!important;opacity:0!important;}
body[data-screen="startScreen"]:not(.exercise-active) > .dashboard-viewport-bg-img{
  display:block!important;
  position:fixed!important;
  inset:0!important;
  z-index:0!important;
  width:100vw!important;
  height:100dvh!important;
  object-fit:cover!important;
  object-position:center right!important;
  opacity:.34!important;
  filter:saturate(1.12) brightness(1.06) contrast(1.05)!important;
  pointer-events:none!important;
}
.screen:not(#startScreen) > .dashboard-global-bg-img:not(.profile-screen-bg):not(.calendar-screen-bg):not(.program-screen-bg){display:none!important;opacity:0!important;}

body:not(.exercise-active) .wrap{
  width:min(100%,var(--next-page-max))!important;
  margin-inline:auto!important;
  padding:calc(env(safe-area-inset-top,0px) + var(--next-page-pad-y)) var(--next-page-pad-x) calc(104px + env(safe-area-inset-bottom,0px))!important;
}

/* ---------- Shared topbar: only .app-topbar owns geometry ---------- */
body:not(.exercise-active) .app-topbar{
  position:relative!important;
  inset:auto!important;
  top:auto!important;
  left:auto!important;
  right:auto!important;
  display:grid!important;
  grid-template-columns:64px minmax(0,1fr) 64px!important;
  align-items:center!important;
  justify-items:center!important;
  gap:12px!important;
  width:min(100%,var(--next-content-max))!important;
  max-width:min(100%,var(--next-content-max))!important;
  min-height:78px!important;
  margin:0 auto var(--next-section-gap)!important;
  padding:10px 16px!important;
  border-radius:var(--next-radius-nav)!important;
  border:1px solid var(--next-card-border)!important;
  background:linear-gradient(180deg,rgba(7,17,31,.94),var(--next-surface-hard))!important;
  box-shadow:var(--next-shadow-card),var(--next-glow),inset 0 1px 0 rgba(255,255,255,.04)!important;
  -webkit-backdrop-filter:blur(18px) saturate(126%)!important;
  backdrop-filter:blur(18px) saturate(126%)!important;
  z-index:90!important;
  overflow:visible!important;
  box-sizing:border-box!important;
}
body:not(.exercise-active) .app-location,
body:not(.exercise-active) .app-primary-action{display:none!important;}

body:not(.exercise-active) .app-nav-toggle{
  grid-column:1!important;
  justify-self:start!important;
  display:grid!important;
  place-items:center!important;
  width:52px!important;
  height:52px!important;
  min-width:52px!important;
  min-height:52px!important;
  padding:0!important;
  border:0!important;
  border-radius:999px!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--next-accent)!important;
  font-size:0!important;
}
body:not(.exercise-active) .app-nav-toggle .nav-label{display:none!important;}
body:not(.exercise-active) .app-nav-toggle .nav-burger{
  width:30px!important;
  height:22px!important;
  display:grid!important;
  align-content:center!important;
  justify-items:start!important;
  gap:5px!important;
  transform:none!important;
}
body:not(.exercise-active) .app-nav-toggle .nav-burger>span{
  display:block!important;
  height:3px!important;
  border-radius:999px!important;
  background:linear-gradient(90deg,#bff6ff 0%,var(--next-accent) 55%,#4dcfff 100%)!important;
  box-shadow:0 0 12px rgba(76,213,255,.18)!important;
}
body:not(.exercise-active) .app-nav-toggle .nav-burger>span:nth-child(1),
body:not(.exercise-active) .app-nav-toggle .nav-burger>span:nth-child(3){width:30px!important;}
body:not(.exercise-active) .app-nav-toggle .nav-burger>span:nth-child(2){width:21px!important;}

body:not(.exercise-active) .app-brand{
  grid-column:2!important;
  display:grid!important;
  place-items:center!important;
  min-width:0!important;
  width:100%!important;
  pointer-events:none!important;
}
body:not(.exercise-active) .app-brand .brand-fallback{display:none!important;}
body:not(.exercise-active) .app-brand-logo{
  display:block!important;
  width:clamp(176px,23vw,244px)!important;
  max-width:100%!important;
  height:auto!important;
  max-height:58px!important;
  object-fit:contain!important;
  transform:none!important;
  filter:drop-shadow(0 0 18px rgba(72,215,255,.13))!important;
}

body:not(.exercise-active) .app-profile-toggle{
  grid-column:3!important;
  justify-self:end!important;
  display:grid!important;
  place-items:center!important;
  width:56px!important;
  height:56px!important;
  min-width:56px!important;
  min-height:56px!important;
  padding:0!important;
  border-radius:999px!important;
  border:1px solid rgba(116,224,255,.34)!important;
  color:var(--next-accent)!important;
  background:rgba(6,20,38,.36)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 0 20px rgba(0,185,255,.08)!important;
}
body:not(.exercise-active) .app-profile-toggle svg{
  width:58%!important;
  height:58%!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.75!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
body:not(.exercise-active) .app-tabs{
  display:none!important;
  position:absolute!important;
  top:calc(100% + 10px)!important;
  left:0!important;
  right:0!important;
  width:auto!important;
  max-width:none!important;
  padding:10px!important;
  border-radius:22px!important;
  border:1px solid var(--next-card-border)!important;
  background:rgba(4,10,20,.96)!important;
  box-shadow:var(--next-shadow-card)!important;
  gap:8px!important;
  z-index:100!important;
}
body:not(.exercise-active) .app-topbar.nav-open .app-tabs{display:grid!important;}
body:not(.exercise-active) .app-tab{
  min-height:56px!important;
  border-radius:16px!important;
  border:1px solid rgba(116,231,255,.18)!important;
  background:rgba(6,18,34,.58)!important;
  color:var(--next-text)!important;
  display:grid!important;
  grid-template-columns:auto 1fr!important;
  align-items:center!important;
  gap:10px!important;
  padding:10px 12px!important;
  text-align:left!important;
  font-weight:900!important;
}

/* ---------- Page shell moved to canonical .next-shell ownership ---------- */

/* ---------- Component styling moved to canonical owners ----------
   Cards, chips and buttons are now styled by .next-card, .next-chip
   and .next-button in the component block below. Legacy selectors are kept
   as feature hooks in markup only, not as system owners here.
*/
/* ---------- Modals / sheets ---------- */
body:not(.exercise-active) :is(.program59-modal,.modal,.program59-modal-backdrop .program59-modal){
  border-color:var(--next-card-border)!important;
  border-radius:var(--next-radius-card)!important;
  background:linear-gradient(180deg,var(--next-surface),rgba(3,9,18,.96))!important;
}

/* ---------- Profile theme controls ---------- */
body:not(.exercise-active) .profile-settings-list button small{
  color:var(--next-muted)!important;
  margin-left:auto!important;
  font-weight:800!important;
  white-space:nowrap!important;
}
body:not(.exercise-active) .profile-select-grid.theme{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
body:not(.exercise-active) .profile-select-grid.theme .profile-select-option{
  align-items:flex-start!important;
  justify-content:flex-start!important;
  min-height:72px!important;
  border-radius:18px!important;
  flex-direction:column!important;
  gap:5px!important;
}

/* ---------- Responsive geometry ---------- */
@media(max-width:760px){
  body:not(.exercise-active) .wrap{
    padding-top:calc(env(safe-area-inset-top,0px) + 10px)!important;
  }
  body:not(.exercise-active) .app-topbar{
    grid-template-columns:54px minmax(0,1fr) 54px!important;
    min-height:70px!important;
    width:100%!important;
    max-width:100%!important;
    margin:0 auto 14px!important;
    padding:8px 12px!important;
    border-radius:24px!important;
  }
  body:not(.exercise-active) .app-nav-toggle{
    width:48px!important;
    height:48px!important;
    min-width:48px!important;
    min-height:48px!important;
  }
  body:not(.exercise-active) .app-nav-toggle .nav-burger{
    width:28px!important;
    height:20px!important;
    gap:5px!important;
  }
  body:not(.exercise-active) .app-nav-toggle .nav-burger>span:nth-child(1),
  body:not(.exercise-active) .app-nav-toggle .nav-burger>span:nth-child(3){width:28px!important;}
  body:not(.exercise-active) .app-nav-toggle .nav-burger>span:nth-child(2){width:20px!important;}
  body:not(.exercise-active) .app-brand-logo{width:176px!important;max-height:44px!important;}
  body:not(.exercise-active) .app-profile-toggle{
    width:50px!important;
    height:50px!important;
    min-width:50px!important;
    min-height:50px!important;
  }
}
@media(max-width:380px){
  body:not(.exercise-active) .app-topbar{
    grid-template-columns:48px minmax(0,1fr) 48px!important;
    padding-inline:10px!important;
  }
  body:not(.exercise-active) .app-brand-logo{width:156px!important;}
  body:not(.exercise-active) .app-profile-toggle,
  body:not(.exercise-active) .app-nav-toggle{
    width:46px!important;
    height:46px!important;
    min-width:46px!important;
    min-height:46px!important;
  }
}


/* =========================================================
   Continued ownership cleanup
   - App.css topbar selectors have been removed; this file is the
     only topbar owner.
   - Screen background images are real page backgrounds, not layout
     images.
   - Page shell remains owned by next-system.css.
   ========================================================= */

/* Background media ownership */
body:not(.exercise-active) .screen{
  position:relative !important;
  isolation:isolate !important;
  min-height:100svh !important;
}

body:not(.exercise-active) :is(#profileScreen > .profile-screen-bg,#calendarScreen > .calendar-screen-bg,#programScreen > .program-screen-bg){
  display:none !important;
  position:fixed !important;
  inset:0 !important;
  z-index:0 !important;
  width:100vw !important;
  height:100dvh !important;
  min-height:100vh !important;
  object-fit:cover !important;
  pointer-events:none !important;
  user-select:none !important;
}

body[data-screen="profileScreen"]:not(.exercise-active) #profileScreen > .profile-screen-bg,
body[data-screen="calendarScreen"]:not(.exercise-active) #calendarScreen > .calendar-screen-bg,
body[data-screen="programScreen"]:not(.exercise-active) #programScreen > .program-screen-bg{
  display:block !important;
}

body[data-screen="profileScreen"]:not(.exercise-active) #profileScreen > .profile-screen-bg{
  opacity:.26 !important;
  object-position:center center !important;
  filter:saturate(1.05) brightness(.78) contrast(1.08) !important;
}

body[data-screen="calendarScreen"]:not(.exercise-active) #calendarScreen > .calendar-screen-bg{
  opacity:.46 !important;
  object-position:68% center !important;
  filter:saturate(1.02) brightness(.72) contrast(1.08) !important;
}

body[data-screen="programScreen"]:not(.exercise-active) #programScreen > .program-screen-bg{
  opacity:.22 !important;
  object-position:center right !important;
  filter:saturate(1.08) brightness(.80) contrast(1.05) !important;
}

/* Active page content layering moved to .next-shell ownership. */

/* One final topbar contract: no screen- or RC-class may alter geometry. */
body:not(.exercise-active) .app-topbar{
  position:relative !important;
  display:grid !important;
  grid-template-columns:64px minmax(0,1fr) 64px !important;
  align-items:center !important;
  justify-items:center !important;
  width:min(100%,var(--next-content-max)) !important;
  min-height:78px !important;
  margin:0 auto var(--next-section-gap) !important;
  padding:10px 16px !important;
  transform:none !important;
}
@media(max-width:760px){
  body:not(.exercise-active) .app-topbar{
    grid-template-columns:54px minmax(0,1fr) 54px !important;
    min-height:70px !important;
    margin:0 auto 14px !important;
    padding:8px 12px !important;
  }
}

/* Legacy iPhone scrim from app.css must not sit as an independent shell layer. */
body:not(.exercise-active)::before,
body:not(.exercise-active)::after{
  pointer-events:none !important;
}


/* =========================================================
   Component ownership cleanup
   Purpose: cards/chips/buttons now have canonical next-* classes
   in markup. Legacy classes may remain as feature hooks, but visual
   component styling must resolve through these owners.
   ========================================================= */

/* ---------- Canonical page shell now owned by standard .next-shell only ---------- */

/* ---------- Canonical card owner ---------- */
body:not(.exercise-active) .next-card{
  border:1px solid var(--next-card-border) !important;
  border-radius:var(--next-radius-card) !important;
  background:
    radial-gradient(680px 260px at 88% 8%,var(--next-accent-soft),transparent 58%),
    linear-gradient(180deg,var(--next-surface),var(--next-surface-2)) !important;
  box-shadow:var(--next-shadow-card),var(--next-glow),inset 0 1px 0 rgba(255,255,255,.04) !important;
  color:var(--next-text) !important;
}
body:not(.exercise-active) .next-card.next-card-compact{border-radius:var(--next-radius-card-sm) !important;}

/* ---------- Canonical chip owner ---------- */
body:not(.exercise-active) .next-chip{
  min-height:var(--next-chip-h) !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:8px !important;
  border-radius:var(--next-radius-chip) !important;
  border:1px solid rgba(116,231,255,.24) !important;
  background:rgba(6,18,34,.58) !important;
  color:var(--next-text) !important;
  font-weight:850 !important;
  line-height:1.05 !important;
}
body:not(.exercise-active) .next-chip-equipment{border-color:rgba(120,224,255,.26) !important;}

/* ---------- Canonical button owner ---------- */
body:not(.exercise-active) .next-button{
  min-height:var(--next-btn-h) !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  border-radius:18px !important;
  border:1px solid rgba(116,231,255,.26) !important;
  background:linear-gradient(180deg,rgba(255,255,255,.060),rgba(255,255,255,.028)) !important;
  color:var(--next-text) !important;
  font-weight:900 !important;
  text-decoration:none !important;
}
body:not(.exercise-active) .next-button-primary,
body:not(.exercise-active) .next-button.primary{
  border-color:var(--next-accent) !important;
  background:linear-gradient(180deg,var(--next-accent-2),#48a9ff) !important;
  color:#03101e !important;
  box-shadow:0 16px 40px rgba(110,234,255,.18) !important;
}
body:not(.exercise-active) .next-button-secondary{
  background:rgba(6,18,34,.58) !important;
  color:var(--next-text) !important;
}
body:not(.exercise-active) .next-button-danger{
  border-color:rgba(255,104,104,.35) !important;
  color:#ffd6d6 !important;
}

/* ---------- Canonical section/title owner ---------- */
body:not(.exercise-active) .next-section-title{
  color:var(--next-accent) !important;
  text-transform:uppercase !important;
  letter-spacing:.22em !important;
  font-size:clamp(12px,2.7vw,15px) !important;
  font-weight:950 !important;
}

@media(max-width:760px){
  body:not(.exercise-active) .next-button{min-height:48px !important;}
  body:not(.exercise-active) .next-chip{min-height:32px !important;}
}


/* =========================================================
   Program/Profile internals migration
   Program and Profile now carry canonical next-* classes in markup.
   Legacy program57/profile-next/profile-rebuild classes remain as JS/layout
   hooks only; visible component styling should resolve through this section.
   ========================================================= */

body:not(.exercise-active) .next-page-stack{
  width:min(100%,var(--next-content-max)) !important;
  margin-inline:auto !important;
  display:grid !important;
  gap:var(--next-section-gap) !important;
}
body:not(.exercise-active) .next-page-head{
  display:grid !important;
  gap:6px !important;
  color:var(--next-text) !important;
}
body:not(.exercise-active) .next-page-head h1{
  margin:0 !important;
  font-size:clamp(44px,10vw,76px) !important;
  line-height:.88 !important;
  letter-spacing:-.06em !important;
  font-weight:950 !important;
}
body:not(.exercise-active) .next-page-head p{
  margin:0 !important;
  color:var(--next-muted) !important;
  font-size:clamp(16px,3.9vw,22px) !important;
  line-height:1.35 !important;
  max-width:48ch !important;
}
body:not(.exercise-active) .next-card-content{
  min-width:0 !important;
  display:grid !important;
  gap:clamp(8px,1.8vw,13px) !important;
}
body:not(.exercise-active) .next-card-head{
  display:flex !important;
  justify-content:space-between !important;
  align-items:center !important;
  gap:12px !important;
}
body:not(.exercise-active) .next-card-head button,
body:not(.exercise-active) .profile-summary-head button{
  border:0 !important;
  background:transparent !important;
  color:var(--next-accent) !important;
  font-weight:950 !important;
  padding:6px 0 !important;
}
body:not(.exercise-active) .next-card-title,
body:not(.exercise-active) .next-card h2,
body:not(.exercise-active) .next-card h3{
  color:var(--next-text) !important;
  font-weight:950 !important;
  letter-spacing:-.045em !important;
  line-height:.98 !important;
}
body:not(.exercise-active) .next-card-subtitle{
  margin:0 !important;
  color:var(--next-accent) !important;
  font-weight:900 !important;
}
body:not(.exercise-active) .next-card-description{
  margin:0 !important;
  color:var(--next-muted) !important;
  line-height:1.35 !important;
  font-weight:650 !important;
}
body:not(.exercise-active) .next-chip-row{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:8px !important;
  align-items:center !important;
}
body:not(.exercise-active) .next-action-row{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:10px !important;
  align-items:center !important;
}
body:not(.exercise-active) .next-action-column{grid-template-columns:1fr !important;}
body:not(.exercise-active) .next-action-grid{grid-template-columns:1fr 1fr !important;}
body:not(.exercise-active) .next-list-rows{
  display:grid !important;
  border:1px solid rgba(105,220,255,.13) !important;
  border-radius:20px !important;
  overflow:hidden !important;
  background:rgba(3,12,24,.34) !important;
}
body:not(.exercise-active) .next-list-row,
body:not(.exercise-active) .next-list-rows > button{
  width:100% !important;
  min-height:56px !important;
  display:grid !important;
  grid-template-columns:auto minmax(0,1fr) auto !important;
  align-items:center !important;
  justify-content:stretch !important;
  text-align:left !important;
  border:0 !important;
  border-radius:0 !important;
  border-top:1px solid rgba(105,220,255,.09) !important;
  background:rgba(6,18,34,.30) !important;
  padding:12px 14px !important;
  color:var(--next-text) !important;
}
body:not(.exercise-active) .next-list-rows > button:first-child{border-top:0 !important;}
body:not(.exercise-active) .next-list-row svg,
body:not(.exercise-active) .next-list-rows > button svg{
  width:22px !important;
  height:22px !important;
  color:var(--next-accent) !important;
}
body:not(.exercise-active) .next-list-row span,
body:not(.exercise-active) .next-list-rows > button span{
  min-width:0 !important;
}
body:not(.exercise-active) .next-list-row small,
body:not(.exercise-active) .next-list-rows > button small{
  color:var(--next-muted) !important;
  font-weight:800 !important;
  white-space:nowrap !important;
}

/* Program canonical layout */
body:not(.exercise-active) .next-profile-strip{
  display:flex !important;
  align-items:center !important;
  flex-wrap:wrap !important;
  gap:8px !important;
  padding:12px 14px !important;
}
body:not(.exercise-active) .next-profile-strip strong{margin-right:6px !important;}
body:not(.exercise-active) .next-program-card{overflow:hidden !important;}
body:not(.exercise-active) .next-program-card .program57-card-content{padding:var(--next-card-pad) !important;}
body:not(.exercise-active) .next-program-card-featured .next-card-title{font-size:clamp(34px,8vw,56px) !important;}
body:not(.exercise-active) .next-program-card-list{
  display:grid !important;
  grid-template-columns:auto minmax(0,1fr) minmax(150px,220px) !important;
  gap:14px !important;
  align-items:center !important;
  padding:14px !important;
}
body:not(.exercise-active) .next-program-card-list .program57-list-icon{
  width:48px !important;
  height:48px !important;
  display:grid !important;
  place-items:center !important;
  border-radius:16px !important;
  border:1px solid rgba(116,231,255,.22) !important;
  color:var(--next-accent) !important;
  background:rgba(6,18,34,.50) !important;
}
body:not(.exercise-active) .next-card-kicker{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  flex-wrap:wrap !important;
}
body:not(.exercise-active) .program57-selected,
body:not(.exercise-active) .program57-best,
body:not(.exercise-active) .program58-started,
body:not(.exercise-active) .program58-done{
  display:inline-flex !important;
  min-height:28px !important;
  align-items:center !important;
  padding:5px 10px !important;
  border-radius:999px !important;
  border:1px solid rgba(116,231,255,.30) !important;
  color:var(--next-accent) !important;
  background:rgba(6,18,34,.58) !important;
  text-transform:uppercase !important;
  letter-spacing:.12em !important;
  font-size:11px !important;
  font-weight:950 !important;
}
body:not(.exercise-active) .program58-progress-mini i{
  display:block !important;
  width:100% !important;
  height:7px !important;
  border-radius:999px !important;
  overflow:hidden !important;
  background:rgba(116,231,255,.12) !important;
}
body:not(.exercise-active) .program58-progress-mini b{
  display:block !important;
  height:100% !important;
  border-radius:999px !important;
  background:linear-gradient(90deg,var(--next-accent),var(--next-accent-2)) !important;
}

/* Profile canonical layout */
body:not(.exercise-active) .next-profile-card{padding:var(--next-card-pad) !important;}
body:not(.exercise-active) .profile-active-card.next-profile-card{padding-bottom:0 !important;}
body:not(.exercise-active) .profile-active-grid{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  gap:16px !important;
  align-items:center !important;
}
body:not(.exercise-active) .profile-active-main h2{
  margin:0 !important;
  font-size:clamp(48px,11vw,74px) !important;
  line-height:.9 !important;
  letter-spacing:-.055em !important;
}
body:not(.exercise-active) .profile-active-main p{color:var(--next-muted) !important;}
body:not(.exercise-active) .profile-avatar-wrap{
  display:grid !important;
  place-items:center !important;
}
body:not(.exercise-active) .profile-avatar{
  width:clamp(86px,20vw,132px) !important;
  height:clamp(86px,20vw,132px) !important;
  display:grid !important;
  place-items:center !important;
  border-radius:999px !important;
  border:1px solid var(--next-card-border-strong) !important;
  color:var(--next-accent) !important;
  background:radial-gradient(circle at 50% 34%,var(--next-accent-soft),rgba(5,18,34,.52) 70%) !important;
}
body:not(.exercise-active) .profile-action-grid{
  border-top:1px solid rgba(105,220,255,.12) !important;
  margin:16px calc(-1 * var(--next-card-pad)) 0 !important;
  padding:14px var(--next-card-pad) !important;
}
body:not(.exercise-active) .next-summary-card .profile-rebuild-body{
  display:grid !important;
  gap:14px !important;
}
body:not(.exercise-active) .profile-rebuild-kicker{
  color:var(--next-muted-2) !important;
  font-weight:900 !important;
}
body:not(.exercise-active) .profile-rebuild-goal{
  color:var(--next-text) !important;
  font-size:clamp(28px,7vw,44px) !important;
  line-height:1 !important;
}

@media(max-width:760px){
  body:not(.exercise-active) .next-program-card-list{
    grid-template-columns:minmax(0,1fr) !important;
    gap:10px !important;
  }
  body:not(.exercise-active) .next-program-card-list .program57-list-icon{display:none !important;}
  body:not(.exercise-active) .next-action-row,
  body:not(.exercise-active) .next-action-grid{
    grid-template-columns:1fr !important;
  }
  body:not(.exercise-active) .profile-active-grid{
    grid-template-columns:minmax(0,1fr) auto !important;
  }
}


/* =========================================================
   Page Header Ownership
   One visual source of truth for page headers across Dashboard,
   Program, Profile, Calendar, Overview, Library and Test views.
   Legacy header classes may remain as semantic/layout hooks only.
   ========================================================= */
body:not(.exercise-active) .next-page-header,
body:not(.exercise-active) .overview-head.next-page-header,
body:not(.exercise-active) .program-library-head.next-page-header,
body:not(.exercise-active) .profile-next-head.next-page-header,
body:not(.exercise-active) .calendar-hero.next-page-header,
body:not(.exercise-active) .showcase-copy.next-page-header{
  display:grid !important;
  gap:clamp(6px,1.5vw,10px) !important;
  width:100% !important;
  max-width:var(--next-content-max) !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  color:var(--next-text) !important;
  isolation:auto !important;
}
body:not(.exercise-active) .next-page-header-card,
body:not(.exercise-active) .calendar-hero.next-page-header-card,
body:not(.exercise-active) .overview-head.next-page-header-card{
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:end !important;
  column-gap:clamp(14px,3vw,28px) !important;
}
body:not(.exercise-active) .next-page-header h1,
body:not(.exercise-active) .next-page-header .next-page-title,
body:not(.exercise-active) .next-page-header .title,
body:not(.exercise-active) .program-library-head.next-page-header h1,
body:not(.exercise-active) .profile-next-head.next-page-header h1,
body:not(.exercise-active) .calendar-hero.next-page-header h1,
body:not(.exercise-active) .showcase-copy.next-page-header h1{
  margin:0 !important;
  color:var(--next-text) !important;
  font-size:clamp(44px,10vw,76px) !important;
  line-height:.88 !important;
  letter-spacing:-.06em !important;
  font-weight:950 !important;
  text-wrap:balance !important;
}
body:not(.exercise-active) .next-page-header p,
body:not(.exercise-active) .next-page-header .next-page-subtitle,
body:not(.exercise-active) .next-page-header .muted,
body:not(.exercise-active) .program-library-head.next-page-header p,
body:not(.exercise-active) .profile-next-head.next-page-header p,
body:not(.exercise-active) .calendar-hero.next-page-header p,
body:not(.exercise-active) .showcase-copy.next-page-header p{
  margin:0 !important;
  color:var(--next-muted) !important;
  font-size:clamp(16px,3.9vw,22px) !important;
  line-height:1.35 !important;
  max-width:52ch !important;
  font-weight:680 !important;
}
body:not(.exercise-active) .next-page-kicker,
body:not(.exercise-active) .next-page-header .meta,
body:not(.exercise-active) .next-page-header .showcase-eyebrow{
  margin:0 !important;
  color:var(--next-accent) !important;
  text-transform:uppercase !important;
  letter-spacing:.22em !important;
  font-size:clamp(11px,2.4vw,14px) !important;
  font-weight:950 !important;
}
body:not(.exercise-active) .next-page-header .page-actions,
body:not(.exercise-active) .next-page-header .nav-left{
  align-self:end !important;
  justify-self:end !important;
  display:flex !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}
body:not(.exercise-active) .calendar-hero.next-page-header .calendar-hero-status{
  justify-self:end !important;
  align-self:end !important;
  max-width:min(420px,46vw) !important;
}
body:not(.exercise-active) .showcase-copy.next-page-header::before,
body:not(.exercise-active) .showcase-copy.next-page-header::after{
  display:none !important;
  content:none !important;
}
body:not(.exercise-active) .showcase-copy.next-page-header .showcase-signals{
  margin-top:clamp(8px,2vw,14px) !important;
}
@media(max-width:760px){
  body:not(.exercise-active) .next-page-header-card,
  body:not(.exercise-active) .calendar-hero.next-page-header-card,
  body:not(.exercise-active) .overview-head.next-page-header-card{
    grid-template-columns:1fr !important;
    align-items:start !important;
  }
  body:not(.exercise-active) .calendar-hero.next-page-header .calendar-hero-status,
  body:not(.exercise-active) .next-page-header .page-actions,
  body:not(.exercise-active) .next-page-header .nav-left{
    justify-self:stretch !important;
    max-width:none !important;
  }
}


/* =========================================================
   Page Shell / Spacing Ownership
   One visible source of truth for page containers and vertical rhythm.
   Legacy shell classes remain in markup only as feature hooks.
   ========================================================= */
:root{
  --next-shell-gap:var(--next-section-gap);
  --next-shell-bottom:clamp(38px,5vw,72px);
  --next-page-header-gap:clamp(12px,2.4vw,22px);
}

body:not(.exercise-active) .next-screen{
  position:relative !important;
  isolation:isolate !important;
  min-height:100svh !important;
}

body:not(.exercise-active) .next-shell{
  width:min(100%,var(--next-content-max)) !important;
  margin-inline:auto !important;
  display:grid !important;
  gap:var(--next-shell-gap) !important;
  padding:0 0 var(--next-shell-bottom) !important;
  position:relative !important;
  z-index:1 !important;
  align-content:start !important;
}

body:not(.exercise-active) .screen.active.next-shell{
  display:grid !important;
}

body:not(.exercise-active) .next-page-stack{
  display:grid !important;
  gap:var(--next-shell-gap) !important;
  align-content:start !important;
}

body:not(.exercise-active) .next-page-body{
  display:grid !important;
  gap:var(--next-shell-gap) !important;
}

body:not(.exercise-active) .next-page-header{
  margin-bottom:0 !important;
}

body:not(.exercise-active) .next-page-header + :is(.next-card,.next-card-grid,.program-catalog,.calendar-dashboard,.developed-cards-grid,.overview-flow-grid){
  margin-top:0 !important;
}

/* Calendar/Program/Profile are shell-compatible through the `.next-shell` class only. */

/* Overview, QA and Test now use the same shell rhythm as Program/Profile/Calendar. */
body:not(.exercise-active) :is(#overviewScreen.next-shell,#qaScreen.next-shell,#testScreen.next-shell){
  width:min(100%,var(--next-content-max)) !important;
}

/* Dashboard is allowed richer internals, but its outer shell spacing is still centralized. */
body[data-screen="startScreen"]:not(.exercise-active) #startScreen.next-shell{
  width:min(100%,var(--next-content-max)) !important;
}

@media(max-width:760px){
  :root{--next-shell-gap:14px;--next-shell-bottom:64px;}
  body:not(.exercise-active) .next-shell{gap:var(--next-shell-gap) !important;}
}


/* =========================================================
   Deep Main UI Ownership
   Main Dashboard / Program / Profile / Calendar / Overview now use the
   central system layer instead of old per-RC page blocks in app.css.
   app.css is reduced to base + active pass/exercise legacy only.
   ========================================================= */
:root{
  --next-grid-gap:clamp(10px,2vw,16px);
  --next-card-grid-gap:clamp(12px,2.4vw,18px);
  --next-section-title-size:clamp(12px,2.6vw,15px);
  --next-row-radius:18px;
}

/* ---------- canonical layout primitives ---------- */
body:not(.exercise-active) .next-card-grid{display:grid!important;gap:var(--next-card-grid-gap)!important;}
body:not(.exercise-active) .next-card-grid-featured{grid-template-columns:1fr!important;}
body:not(.exercise-active) .next-chip-row{display:flex!important;flex-wrap:wrap!important;gap:8px!important;align-items:center!important;}
body:not(.exercise-active) .next-action-row{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;align-items:center!important;}
body:not(.exercise-active) .next-action-column{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;}
body:not(.exercise-active) .next-card-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;}
body:not(.exercise-active) .next-card-kicker{color:var(--next-accent)!important;text-transform:uppercase!important;letter-spacing:.16em!important;font-size:11px!important;font-weight:950!important;}
body:not(.exercise-active) .next-card-description{color:var(--next-muted)!important;line-height:1.35!important;font-weight:680!important;}
body:not(.exercise-active) .next-list-rows{display:grid!important;border:1px solid rgba(105,220,255,.12)!important;border-radius:20px!important;overflow:hidden!important;background:rgba(2,10,20,.28)!important;}
body:not(.exercise-active) .next-list-row{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;align-items:center!important;justify-content:stretch!important;text-align:left!important;border-radius:0!important;border:0!important;border-top:1px solid rgba(105,220,255,.10)!important;background:rgba(5,17,31,.42)!important;min-height:58px!important;padding:13px 14px!important;color:var(--next-text)!important;}
body:not(.exercise-active) .next-list-row:first-child{border-top:0!important;}
body:not(.exercise-active) .next-list-row svg{width:23px!important;height:23px!important;stroke:var(--next-accent)!important;fill:none!important;}
body:not(.exercise-active) .next-list-row b{color:var(--next-muted)!important;font-size:24px!important;line-height:1!important;}

/* ---------- dashboard ownership ---------- */
body[data-screen="startScreen"]:not(.exercise-active) #startScreen.next-dashboard-shell{gap:clamp(18px,3vw,32px)!important;}
body:not(.exercise-active) #startScreen .dashboard-shortcuts-panel{display:none!important;}
body:not(.exercise-active) #startScreen .home-hero{position:relative!important;border:0!important;background:transparent!important;box-shadow:none!important;padding:clamp(10px,2vw,18px) 0!important;overflow:visible!important;}
body:not(.exercise-active) #startScreen .home-hero>.dashboard-bg-img{display:none!important;}
body:not(.exercise-active) #startScreen .showcase-grid{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(280px,0.9fr)!important;gap:clamp(18px,4vw,42px)!important;align-items:center!important;}
body:not(.exercise-active) #startScreen .showcase-copy{display:grid!important;gap:clamp(8px,1.8vw,14px)!important;}
body:not(.exercise-active) #startScreen .showcase-copy h1{margin:0!important;font-size:clamp(46px,7.5vw,92px)!important;line-height:.86!important;letter-spacing:-.07em!important;font-weight:950!important;}
body:not(.exercise-active) #startScreen .showcase-copy h1 span{color:var(--next-accent)!important;text-shadow:0 0 22px rgba(110,234,255,.16)!important;}
body:not(.exercise-active) #startScreen .showcase-intro{margin:0!important;color:var(--next-muted)!important;font-size:clamp(16px,2.4vw,22px)!important;line-height:1.25!important;font-weight:750!important;}
body:not(.exercise-active) #startScreen .showcase-signals{display:flex!important;gap:8px!important;flex-wrap:wrap!important;margin-top:6px!important;}
body:not(.exercise-active) #startScreen .signal-chip{min-height:30px!important;padding:7px 10px!important;}
body:not(.exercise-active) #startScreen .hero-dashboard-panel{border:0!important;background:transparent!important;box-shadow:none!important;}
body:not(.exercise-active) #startScreen .hero-dashboard-panel .panel-pad{padding:0!important;}
body:not(.exercise-active) #progressDashboard{display:grid!important;gap:12px!important;}
body:not(.exercise-active) .next-dashboard-today-card{position:relative!important;display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;gap:14px!important;align-items:start!important;padding:clamp(18px,3vw,28px)!important;min-height:220px!important;overflow:hidden!important;}
body:not(.exercise-active) .next-dashboard-pass-icon{width:50px!important;height:50px!important;border-radius:18px!important;display:grid!important;place-items:center!important;border:1px solid var(--next-card-border)!important;background:rgba(5,18,34,.50)!important;color:var(--next-accent)!important;}
body:not(.exercise-active) .next-dashboard-pass-icon svg{width:26px!important;height:26px!important;stroke:currentColor!important;fill:none!important;}
body:not(.exercise-active) .next-dashboard-kicker{color:var(--next-accent)!important;text-transform:uppercase!important;letter-spacing:.16em!important;font-size:11px!important;font-weight:950!important;}
body:not(.exercise-active) .next-dashboard-today-copy{display:grid!important;gap:8px!important;min-width:0!important;}
body:not(.exercise-active) .next-dashboard-today-copy h2{margin:0!important;font-size:clamp(30px,4.5vw,48px)!important;line-height:.95!important;letter-spacing:-.045em!important;}
body:not(.exercise-active) .next-dashboard-today-meta{color:var(--next-muted)!important;font-weight:900!important;}
body:not(.exercise-active) .next-dashboard-today-copy p{margin:0!important;color:var(--next-muted)!important;line-height:1.35!important;font-weight:650!important;}
body:not(.exercise-active) .next-dashboard-today-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;margin-top:8px!important;}
body:not(.exercise-active) .next-dashboard-time-chip{position:absolute!important;right:18px!important;top:18px!important;display:inline-flex!important;align-items:center!important;gap:6px!important;min-height:30px!important;padding:6px 10px!important;border-radius:999px!important;border:1px solid rgba(116,231,255,.24)!important;background:rgba(4,14,28,.62)!important;color:var(--next-muted)!important;font-weight:850!important;font-size:12px!important;}
body:not(.exercise-active) .quickstats-panel{border:0!important;background:transparent!important;box-shadow:none!important;}
body:not(.exercise-active) .quickstats-panel .panel-pad{padding:0!important;}
body:not(.exercise-active) .quick-stats-grid{display:grid!important;gap:12px!important;}
body:not(.exercise-active) .next-dashboard-progress-card{padding:clamp(18px,3vw,28px)!important;display:grid!important;grid-template-columns:minmax(0,1.1fr) minmax(220px,.9fr)!important;gap:clamp(16px,3vw,28px)!important;align-items:center!important;overflow:hidden!important;}
body:not(.exercise-active) .next-dashboard-progress-main{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;gap:16px!important;align-items:center!important;}
body:not(.exercise-active) .next-dashboard-progress-copy h2{margin:0!important;font-size:clamp(36px,6vw,64px)!important;line-height:.92!important;letter-spacing:-.055em!important;}
body:not(.exercise-active) .next-dashboard-progress-copy p{margin:4px 0 0!important;color:var(--next-muted)!important;font-weight:700!important;}
body:not(.exercise-active) .next-dashboard-kpi-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;}
body:not(.exercise-active) .next-dashboard-kpi-cell{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;gap:10px!important;align-items:center!important;border:1px solid rgba(105,220,255,.16)!important;border-radius:18px!important;background:rgba(2,10,22,.38)!important;padding:10px!important;color:var(--next-text)!important;}
body:not(.exercise-active) .next-dashboard-kpi-label{color:var(--next-accent)!important;text-transform:uppercase!important;letter-spacing:.14em!important;font-size:10px!important;font-weight:950!important;}
body:not(.exercise-active) .next-dashboard-kpi-value{font-size:clamp(18px,3vw,28px)!important;font-weight:950!important;line-height:1!important;}
body:not(.exercise-active) .next-dashboard-ring{display:grid!important;place-items:center!important;border-radius:999px!important;background:conic-gradient(var(--next-accent) calc(var(--p,0)*1%),rgba(40,78,112,.32) 0)!important;position:relative!important;}
body:not(.exercise-active) .next-dashboard-ring::before{content:""!important;position:absolute!important;inset:9px!important;border-radius:999px!important;background:rgba(2,9,18,.94)!important;}
body:not(.exercise-active) .next-dashboard-ring span{position:relative!important;z-index:1!important;font-weight:950!important;}
body:not(.exercise-active) .next-dashboard-ring-xl{width:138px!important;height:138px!important;font-size:34px!important;}
body:not(.exercise-active) .next-dashboard-ring-sm{width:60px!important;height:60px!important;font-size:16px!important;}
body:not(.exercise-active) .next-dashboard-day-row{display:flex!important;gap:6px!important;flex-wrap:wrap!important;margin-top:10px!important;}
body:not(.exercise-active) .next-dashboard-day-pill{min-height:25px!important;padding:4px 10px!important;border-radius:999px!important;border:1px solid rgba(116,231,255,.20)!important;background:rgba(4,15,30,.58)!important;color:var(--next-text)!important;font-weight:850!important;}

/* ---------- program ownership ---------- */
body:not(.exercise-active) .program57-library{display:grid!important;gap:var(--next-shell-gap)!important;}
body:not(.exercise-active) .next-profile-strip{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important;padding:12px 14px!important;}
body:not(.exercise-active) .next-profile-strip strong{font-size:20px!important;font-weight:950!important;margin-right:auto!important;}
body:not(.exercise-active) .program57-profile-icon{width:42px!important;height:42px!important;border-radius:16px!important;display:grid!important;place-items:center!important;border:1px solid var(--next-card-border)!important;background:rgba(4,15,30,.46)!important;color:var(--next-accent)!important;}
body:not(.exercise-active) .program57-profile-icon svg{width:22px!important;height:22px!important;stroke:currentColor!important;fill:none!important;}
body:not(.exercise-active) .next-program-card{position:relative!important;overflow:hidden!important;padding:0!important;}
body:not(.exercise-active) .next-program-card.featured{min-height:260px!important;}
body:not(.exercise-active) .program57-card-img{position:absolute!important;inset:0 0 0 auto!important;width:58%!important;height:100%!important;object-fit:cover!important;object-position:center!important;opacity:.32!important;mask-image:linear-gradient(90deg,transparent 0%,#000 34%,#000 100%)!important;-webkit-mask-image:linear-gradient(90deg,transparent 0%,#000 34%,#000 100%)!important;}
body:not(.exercise-active) .program57-card-content{position:relative!important;z-index:1!important;display:grid!important;gap:10px!important;padding:var(--next-card-pad)!important;max-width:70%!important;}
body:not(.exercise-active) .program57-card h2{margin:8px 0 0!important;font-size:clamp(30px,6vw,50px)!important;line-height:.96!important;letter-spacing:-.05em!important;}
body:not(.exercise-active) .program57-target,.program57-list-main p{color:var(--next-accent)!important;font-weight:850!important;margin:0!important;}
body:not(.exercise-active) .program57-desc{margin:0!important;max-width:36ch!important;color:var(--next-muted)!important;line-height:1.35!important;font-weight:680!important;}
body:not(.exercise-active) .program57-card-top{display:flex!important;gap:8px!important;flex-wrap:wrap!important;align-items:center!important;}
body:not(.exercise-active) .program57-best,.program57-selected,.program58-started,.program58-done{display:inline-flex!important;align-items:center!important;min-height:28px!important;padding:5px 10px!important;border-radius:999px!important;border:1px solid rgba(116,231,255,.30)!important;color:var(--next-accent)!important;background:rgba(6,18,34,.58)!important;text-transform:uppercase!important;letter-spacing:.12em!important;font-size:11px!important;font-weight:950!important;}
body:not(.exercise-active) .next-program-card-list{display:grid!important;grid-template-columns:auto minmax(0,1fr) minmax(140px,auto)!important;gap:14px!important;align-items:center!important;padding:16px!important;}
body:not(.exercise-active) .program57-list-icon{width:50px!important;height:50px!important;display:grid!important;place-items:center!important;border-radius:18px!important;border:1px solid var(--next-card-border)!important;background:rgba(4,15,30,.46)!important;color:var(--next-accent)!important;}
body:not(.exercise-active) .program57-list-main h3{margin:0!important;font-size:clamp(24px,4vw,34px)!important;line-height:1!important;letter-spacing:-.035em!important;}
body:not(.exercise-active) .program58-progress-mini{display:grid!important;gap:6px!important;color:var(--next-muted)!important;font-weight:850!important;}
body:not(.exercise-active) .program58-progress-mini i{display:block!important;height:7px!important;border-radius:999px!important;overflow:hidden!important;background:rgba(116,231,255,.12)!important;}
body:not(.exercise-active) .program58-progress-mini b{display:block!important;height:100%!important;border-radius:999px!important;background:linear-gradient(90deg,var(--next-accent),var(--next-accent-2))!important;}
body:not(.exercise-active) .program57-preview{grid-column:1/-1!important;}
body:not(.exercise-active) .program61-preview-box{display:grid!important;gap:12px!important;padding:var(--next-card-pad)!important;margin-top:12px!important;}
body:not(.exercise-active) .program61-preview-head{display:flex!important;justify-content:space-between!important;gap:12px!important;align-items:start!important;}
body:not(.exercise-active) .program61-preview-head strong{font-size:clamp(20px,4vw,28px)!important;line-height:1!important;}
body:not(.exercise-active) .program61-preview-head p{margin:4px 0 0!important;color:var(--next-muted)!important;}
body:not(.exercise-active) .program61-preview-head>span{display:inline-flex!important;min-height:28px!important;border-radius:999px!important;border:1px solid rgba(116,231,255,.24)!important;padding:5px 9px!important;color:var(--next-accent)!important;text-transform:uppercase!important;letter-spacing:.12em!important;font-size:10px!important;font-weight:950!important;}
body:not(.exercise-active) .program61-preview-note{border:1px solid rgba(116,231,255,.12)!important;border-radius:16px!important;background:rgba(4,15,30,.42)!important;color:var(--next-muted)!important;padding:10px 12px!important;line-height:1.35!important;}
body:not(.exercise-active) .program61-preview-summary{display:grid!important;grid-template-columns:1fr 1.2fr!important;gap:12px!important;}
body:not(.exercise-active) .program61-preview-summary b,.program61-list-title{display:block!important;color:var(--next-accent)!important;text-transform:uppercase!important;letter-spacing:.16em!important;font-size:11px!important;font-weight:950!important;margin-bottom:7px!important;}
body:not(.exercise-active) .program61-equipment-list,.program61-ex-equipment{display:flex!important;flex-wrap:wrap!important;gap:6px!important;}
body:not(.exercise-active) .program61-equipment-chip,.program61-muted-chip{display:inline-flex!important;align-items:center!important;gap:6px!important;min-height:28px!important;border-radius:999px!important;border:1px solid rgba(116,231,255,.22)!important;background:rgba(6,18,34,.58)!important;color:var(--next-text)!important;padding:6px 9px!important;font-weight:850!important;}
body:not(.exercise-active) .program62-exercise-list{display:grid!important;gap:9px!important;}
body:not(.exercise-active) .program62-ex-group{border:1px solid rgba(116,231,255,.16)!important;border-radius:16px!important;overflow:hidden!important;background:rgba(3,12,24,.34)!important;}
body:not(.exercise-active) .program62-ex-head{list-style:none!important;cursor:pointer!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto 18px!important;align-items:center!important;gap:10px!important;padding:11px 12px!important;background:linear-gradient(90deg,rgba(4,80,116,.36),rgba(4,28,53,.20))!important;}
body:not(.exercise-active) .program62-ex-head::-webkit-details-marker{display:none!important;}
body:not(.exercise-active) .program62-ex-head::after{content:"›"!important;color:var(--next-accent)!important;font-size:24px!important;line-height:1!important;transition:transform .16s ease!important;}
body:not(.exercise-active) .program62-ex-group[open] .program62-ex-head::after{transform:rotate(90deg)!important;}
body:not(.exercise-active) .program62-ex-head span{color:var(--next-text)!important;text-transform:uppercase!important;letter-spacing:.14em!important;font-size:12px!important;font-weight:950!important;}
body:not(.exercise-active) .program62-ex-head em{font-style:normal!important;color:var(--next-muted)!important;font-size:12px!important;font-weight:800!important;}
body:not(.exercise-active) .program62-ex-group ul{list-style:none!important;padding:0!important;margin:0!important;border-top:1px solid rgba(116,231,255,.12)!important;}
body:not(.exercise-active) .program62-ex-group li{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:10px!important;align-items:center!important;padding:9px 12px!important;border-top:1px solid rgba(116,231,255,.09)!important;}
body:not(.exercise-active) .program62-ex-group li:first-child{border-top:0!important;}

/* ---------- profile ownership ---------- */
body:not(.exercise-active) .next-profile-page{display:grid!important;gap:var(--next-shell-gap)!important;}
body:not(.exercise-active) .next-profile-card{padding:var(--next-card-pad)!important;}
body:not(.exercise-active) .profile-active-card.next-profile-card{padding-bottom:0!important;overflow:hidden!important;}
body:not(.exercise-active) .profile-card-label{color:var(--next-accent)!important;text-transform:uppercase!important;letter-spacing:.22em!important;font-size:var(--next-section-title-size)!important;font-weight:950!important;}
body:not(.exercise-active) .profile-active-grid{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:16px!important;align-items:center!important;}
body:not(.exercise-active) .profile-active-main h2{margin:0!important;font-size:clamp(48px,11vw,74px)!important;line-height:.9!important;letter-spacing:-.055em!important;}
body:not(.exercise-active) .profile-active-main p{margin:10px 0 0!important;color:var(--next-muted)!important;font-size:clamp(16px,3.8vw,20px)!important;line-height:1.35!important;}
body:not(.exercise-active) .profile-avatar-wrap{position:relative!important;display:grid!important;place-items:center!important;}
body:not(.exercise-active) .profile-avatar{width:clamp(86px,20vw,132px)!important;height:clamp(86px,20vw,132px)!important;display:grid!important;place-items:center!important;border-radius:999px!important;border:1px solid var(--next-card-border-strong)!important;color:var(--next-accent)!important;background:radial-gradient(circle at 50% 34%,var(--next-accent-soft),rgba(5,18,34,.52) 70%)!important;}
body:not(.exercise-active) .profile-avatar svg{width:50%!important;height:50%!important;stroke:currentColor!important;fill:none!important;}
body:not(.exercise-active) .profile-avatar-edit{position:absolute!important;right:0!important;bottom:0!important;width:44px!important;height:44px!important;border-radius:999px!important;border:1px solid var(--next-card-border)!important;background:rgba(5,18,34,.88)!important;color:var(--next-accent)!important;display:grid!important;place-items:center!important;}
body:not(.exercise-active) .profile-action-grid{border-top:1px solid rgba(105,220,255,.12)!important;margin:16px calc(-1 * var(--next-card-pad)) 0!important;padding:14px var(--next-card-pad)!important;}
body:not(.exercise-active) .profile-action-grid.three{grid-template-columns:1fr 1fr!important;}
body:not(.exercise-active) .profile-action-grid.three .primary{grid-column:1/-1!important;}
body:not(.exercise-active) .profile-program-card{display:grid!important;gap:14px!important;}
body:not(.exercise-active) .profile-program-left h3{margin:0!important;font-size:clamp(30px,7vw,48px)!important;letter-spacing:-.05em!important;line-height:1!important;}
body:not(.exercise-active) .profile-program-left p{margin:4px 0 0!important;color:var(--next-muted)!important;font-size:clamp(17px,4vw,22px)!important;}
body:not(.exercise-active) .profile-program-progress{display:grid!important;gap:8px!important;}
body:not(.exercise-active) .profile-program-top{display:flex!important;justify-content:space-between!important;gap:12px!important;align-items:end!important;color:var(--next-muted)!important;font-weight:900!important;}
body:not(.exercise-active) .profile-program-top strong{font-size:clamp(32px,8vw,54px)!important;color:var(--next-accent)!important;}
body:not(.exercise-active) .profile-progress-track{height:10px!important;border-radius:999px!important;background:rgba(116,231,255,.12)!important;overflow:hidden!important;}
body:not(.exercise-active) .profile-progress-track span{display:block!important;height:100%!important;border-radius:999px!important;background:linear-gradient(90deg,var(--next-accent),var(--next-accent-2))!important;}
body:not(.exercise-active) .profile-rebuild-body{display:grid!important;gap:14px!important;}
body:not(.exercise-active) .profile-rebuild-kicker{display:block!important;color:var(--next-muted-2)!important;font-weight:900!important;margin-bottom:4px!important;}
body:not(.exercise-active) .profile-rebuild-goal{display:block!important;color:var(--next-text)!important;font-size:clamp(28px,7vw,44px)!important;line-height:1!important;}
body:not(.exercise-active) .profile-summary-head button{border:0!important;background:transparent!important;color:var(--next-accent)!important;font-weight:950!important;font-size:18px!important;}
body:not(.exercise-active) .profile-toggle{width:58px!important;height:34px!important;border-radius:999px!important;background:var(--next-accent-2)!important;display:grid!important;align-items:center!important;padding:3px!important;}
body:not(.exercise-active) .profile-toggle i{display:block!important;width:28px!important;height:28px!important;border-radius:999px!important;background:#fff!important;justify-self:end!important;}

/* ---------- calendar ownership ---------- */
body:not(.exercise-active) .calendar-dashboard{display:grid!important;gap:var(--next-shell-gap)!important;}
body:not(.exercise-active) .next-phase-week-selector{display:grid!important;gap:6px!important;border:1px solid rgba(116,231,255,.20)!important;border-radius:18px!important;background:rgba(2,10,22,.36)!important;padding:8px!important;min-width:min(420px,100%)!important;}
body:not(.exercise-active) .next-pw-row{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:center!important;gap:8px!important;}
body:not(.exercise-active) .next-pw-current{display:grid!important;gap:1px!important;min-width:64px!important;color:var(--next-accent)!important;text-transform:uppercase!important;letter-spacing:.12em!important;font-size:9px!important;font-weight:950!important;}
body:not(.exercise-active) .next-pw-current strong{color:var(--next-text)!important;font-size:10px!important;letter-spacing:0!important;text-transform:none!important;}
body:not(.exercise-active) .next-pw-options{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important;}
body:not(.exercise-active) .next-pw-btn{min-height:28px!important;border-radius:9px!important;border:1px solid rgba(116,231,255,.20)!important;background:rgba(6,18,34,.58)!important;color:var(--next-text)!important;font-size:10px!important;font-weight:900!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;}
body:not(.exercise-active) .next-pw-btn.is-selected{border-color:var(--next-accent)!important;box-shadow:inset 0 0 0 1px rgba(110,234,255,.18)!important;}
body:not(.exercise-active) .next-pw-btn.is-done{color:#bfffd8!important;border-color:rgba(151,255,197,.35)!important;}
body:not(.exercise-active) .next-calendar-grid{display:grid!important;gap:var(--next-card-grid-gap)!important;}
body:not(.exercise-active) .next-calendar-plan-card{padding:var(--next-card-pad)!important;}
body:not(.exercise-active) .next-calendar-plan-head h2{margin:0!important;font-size:clamp(28px,6vw,46px)!important;line-height:1!important;letter-spacing:-.045em!important;}
body:not(.exercise-active) .next-calendar-plan-head span{color:var(--next-accent)!important;font-weight:850!important;}
body:not(.exercise-active) .next-calendar-list{display:grid!important;gap:8px!important;margin-top:12px!important;}
body:not(.exercise-active) .next-calendar-row{border:1px solid rgba(116,231,255,.16)!important;border-radius:18px!important;background:rgba(3,12,24,.34)!important;overflow:hidden!important;}
body:not(.exercise-active) .next-calendar-row-head{display:grid!important;grid-template-columns:auto auto minmax(0,1fr) auto auto!important;gap:10px!important;align-items:center!important;min-height:58px!important;padding:10px 12px!important;}
body:not(.exercise-active) .next-calendar-day{display:inline-flex!important;min-height:34px!important;align-items:center!important;border-radius:11px!important;border:1px solid rgba(116,231,255,.22)!important;background:rgba(4,15,30,.58)!important;color:var(--next-accent)!important;padding:7px 9px!important;font-size:12px!important;font-weight:950!important;white-space:nowrap!important;}
body:not(.exercise-active) .calendar-list-icon{width:36px!important;height:36px!important;border-radius:13px!important;display:grid!important;place-items:center!important;border:1px solid rgba(116,231,255,.20)!important;color:var(--next-accent)!important;}
body:not(.exercise-active) .calendar-list-icon svg{width:20px!important;height:20px!important;stroke:currentColor!important;fill:none!important;}
body:not(.exercise-active) .next-calendar-copy{display:grid!important;gap:2px!important;min-width:0!important;}
body:not(.exercise-active) .next-calendar-copy b{font-size:16px!important;line-height:1.1!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
body:not(.exercise-active) .next-calendar-copy small{color:var(--next-muted)!important;font-size:12px!important;font-weight:750!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
body:not(.exercise-active) .calendar-list-status{display:inline-flex!important;align-items:center!important;min-height:24px!important;border-radius:999px!important;padding:4px 8px!important;background:rgba(116,231,255,.12)!important;color:var(--next-accent)!important;text-transform:uppercase!important;letter-spacing:.08em!important;font-size:9px!important;font-weight:950!important;}
body:not(.exercise-active) .calendar-list-status.done{color:#bfffd8!important;background:rgba(17,72,48,.34)!important;}
body:not(.exercise-active) .calendar-list-status.rest,.calendar-list-status.optional{color:#d8c5ff!important;background:rgba(76,50,140,.28)!important;}
body:not(.exercise-active) .next-calendar-chevron{color:var(--next-muted)!important;font-size:22px!important;}
body:not(.exercise-active) .next-calendar-hero{display:grid!important;gap:12px!important;border-top:1px solid rgba(116,231,255,.10)!important;padding:12px!important;background:rgba(2,10,22,.26)!important;}

/* ---------- overview / generic main cards ---------- */
body:not(.exercise-active) .overview-head.next-page-header-card{padding:var(--next-card-pad)!important;}
body:not(.exercise-active) .overview-return-row{display:flex!important;gap:10px!important;flex-wrap:wrap!important;align-items:center!important;margin-bottom:8px!important;}
body:not(.exercise-active) .overview-equipment{display:flex!important;flex-wrap:wrap!important;gap:8px!important;margin-top:10px!important;}
body:not(.exercise-active) .developed-cards-grid,.overview-flow-grid,.overview-list{display:grid!important;gap:var(--next-card-grid-gap)!important;}
body:not(.exercise-active) .developed-card,.flow-card,.overview-insight-card{padding:var(--next-card-pad)!important;}
body:not(.exercise-active) .overview-list article{border:1px solid rgba(116,231,255,.16)!important;border-radius:18px!important;background:rgba(3,12,24,.34)!important;}

/* ---------- tablet / mobile consolidation ---------- */
@media(max-width:760px){
  body:not(.exercise-active) #startScreen .showcase-grid{grid-template-columns:1fr!important;gap:14px!important;}
  body:not(.exercise-active) #startScreen .showcase-copy h1{font-size:clamp(48px,13vw,74px)!important;}
  body:not(.exercise-active) .next-dashboard-today-card{grid-template-columns:1fr!important;min-height:auto!important;padding:16px!important;}
  body:not(.exercise-active) .next-dashboard-pass-icon{width:48px!important;height:48px!important;}
  body:not(.exercise-active) .next-dashboard-time-chip{position:static!important;justify-self:start!important;}
  body:not(.exercise-active) .next-dashboard-today-actions{grid-template-columns:1fr 1fr!important;}
  body:not(.exercise-active) .next-dashboard-progress-card{grid-template-columns:1fr!important;padding:16px!important;}
  body:not(.exercise-active) .next-dashboard-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body:not(.exercise-active) .next-dashboard-ring-xl{width:120px!important;height:120px!important;}
  body:not(.exercise-active) .next-program-card.featured{min-height:0!important;}
  body:not(.exercise-active) .program57-card-img{width:100%!important;opacity:.22!important;mask-image:none!important;-webkit-mask-image:none!important;}
  body:not(.exercise-active) .program57-card-content{max-width:100%!important;padding:16px!important;}
  body:not(.exercise-active) .next-program-card-list{grid-template-columns:minmax(0,1fr)!important;padding:14px!important;}
  body:not(.exercise-active) .program57-list-icon{display:none!important;}
  body:not(.exercise-active) .program57-list-actions{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .program61-preview-summary{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .program62-ex-group li{grid-template-columns:1fr!important;align-items:start!important;}
  body:not(.exercise-active) .profile-active-grid{grid-template-columns:minmax(0,1fr) auto!important;}
  body:not(.exercise-active) .profile-action-grid.three{grid-template-columns:1fr 1fr!important;}
  body:not(.exercise-active) .profile-action-grid.three .primary{grid-column:1/-1!important;}
  body:not(.exercise-active) .next-calendar-row-head{grid-template-columns:auto auto minmax(0,1fr) auto!important;}
  body:not(.exercise-active) .next-calendar-chevron{display:none!important;}
  body:not(.exercise-active) .calendar-list-status{font-size:8px!important;}
}
@media(max-width:420px){
  body:not(.exercise-active) .next-dashboard-today-actions{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .next-dashboard-kpi-grid{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .profile-avatar{width:76px!important;height:76px!important;}
  body:not(.exercise-active) .profile-avatar-edit{width:38px!important;height:38px!important;}
  body:not(.exercise-active) .next-calendar-row-head{grid-template-columns:auto minmax(0,1fr) auto!important;}
  body:not(.exercise-active) .calendar-list-icon{display:none!important;}
  body:not(.exercise-active) .calendar-list-status{display:none!important;}
}

/* standard.1 · harden canonical primitives after removing legacy padding/width owners */
body:not(.exercise-active) .wrap{
  padding:var(--next-page-pad-y) var(--next-page-pad-x) 104px !important;
  padding-top:calc(env(safe-area-inset-top,0px) + var(--next-page-pad-y)) !important;
  padding-bottom:calc(104px + env(safe-area-inset-bottom,0px)) !important;
}
body:not(.exercise-active) .next-chip{
  padding:6px 10px !important;
  font-size:clamp(12.5px,3.2vw,14px) !important;
  max-width:100% !important;
}
body:not(.exercise-active) .next-button{
  width:100% !important;
  box-sizing:border-box !important;
  white-space:nowrap !important;
  text-align:center !important;
  padding:11px 14px !important;
}
body:not(.exercise-active) .next-action-row>.next-button,
body:not(.exercise-active) .next-action-row>.program57-btn,
body:not(.exercise-active) .next-action-row>.profile-action{
  min-width:0 !important;
}
body:not(.exercise-active) .program57-btn{
  width:100% !important;
  min-width:0 !important;
}
body:not(.exercise-active) .app-profile-toggle svg,
body:not(.exercise-active) .app-profile-toggle svg *{
  fill:none !important;
  stroke:currentColor !important;
}
@media(max-width:760px){
  body:not(.exercise-active) .wrap{padding-left:14px !important;padding-right:14px !important;}
  body:not(.exercise-active) .program57-card h2{font-size:clamp(30px,8.5vw,42px)!important;}
  body:not(.exercise-active) .next-chip{font-size:13px!important;}
}


/* =========================================================
   Full system ownership: exercise/library/tests migration
   Remaining visual rules from app.css moved here so next-system.css
   is the only loaded visual owner. app.css is now reset/tokens only.
   ========================================================= */
/* ---------- standard retained legacy: active pass / exercise player only ---------- */
/* ---------- Exercise/pass ---------- */
body.exercise-active .wrap{width:100%;padding:0 0 calc(120px + var(--safe-bottom))}
.sticky-nav{
  position:sticky;
  top:0;
  z-index:130;
  padding:8px 10px 10px;
  background:linear-gradient(180deg,rgba(5,10,19,.98),rgba(6,12,22,.95));
  border-bottom:1px solid var(--line);
  backdrop-filter:blur(18px);
}
.nav-row{display:grid;gap:8px}
.nav-actions{display:grid;gap:8px}
.nav-left{display:grid;grid-template-columns:auto auto;gap:8px;align-items:center}
.menu-wrap{position:relative}
.menu-toggle,.exit-pass-btn{width:auto;min-height:42px;border-radius:14px;padding:9px 14px;font-size:15px}
.top-tools{display:none;position:fixed;left:10px;right:10px;top:86px;z-index:200;padding:10px;border-radius:20px;border:1px solid var(--line);background:rgba(5,10,19,.98);box-shadow:var(--shadow)}
.top-tools.open{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.tool-btn{font-size:12px;min-height:42px;justify-content:space-between}
.progress-meta{display:grid;gap:6px}
#exerciseMeta{font-size:14px;letter-spacing:.10em;text-transform:uppercase;color:#dff8ff;font-weight:1000}
.progress-shell{height:9px;border-radius:999px;background:rgba(160,190,230,.14);overflow:hidden}
.progress-bar{height:100%;width:0;background:linear-gradient(90deg,var(--cyan),var(--blue))}
.stage-layout{display:grid;grid-template-columns:1fr;gap:10px}
.video-card{border-radius:0 0 24px 24px;overflow:hidden;border-left:0;border-right:0}
.video-wrap{aspect-ratio:16/9;background:#050a12;position:relative;display:grid;place-items:center}
.video-wrap iframe,.video-wrap video{width:100%;height:100%;border:0;display:block}
.no-video{min-height:220px;display:grid;place-items:center;text-align:center;padding:24px;color:var(--muted)}
.no-video h2{margin:8px 0;color:var(--text)}
.proxy-status,.open-link{display:none!important}
.info-card{margin:0 10px;padding:16px;display:grid;gap:12px}
.exercise-kicker{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none}
.exercise-kicker::-webkit-scrollbar{display:none}
.exercise-kicker .tag{flex:0 0 auto;text-transform:uppercase;letter-spacing:.12em;font-size:12px;color:var(--cyan)}
.exercise-name{font-size:clamp(36px,10vw,58px);line-height:.92;letter-spacing:-.06em;margin:0;text-wrap:balance}
.exercise-reps{min-height:112px;border-radius:22px;background:rgba(255,255,255,.045);border:1px solid var(--line);display:grid;place-items:center;padding:14px}
.rx-line{font-size:clamp(48px,14vw,72px);line-height:.95;font-weight:1000;letter-spacing:-.06em}
.set-note,.coach-cues,.next-preview,.timer-card,.superset-status{padding:14px;border-radius:20px;background:rgba(8,15,27,.72);border:1px solid var(--line)}
.coach-cues small,.next-preview small{display:block;color:var(--cyan);letter-spacing:.14em;text-transform:uppercase;font-weight:950;font-size:12px;margin-bottom:8px}
.coach-cues ul{margin:0;padding-left:20px;color:#dce8f5}
.next-preview b,.next-line{color:#dff8ff;font-weight:950}
.timer-card{display:none}
.timer-card.show{display:grid;gap:10px}
.timer-display{font-size:44px;font-weight:1000;font-variant-numeric:tabular-nums}
.timer-status{color:var(--cyan);font-weight:900}
.timer-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.playlist-card{display:none!important}
.pass-bottom-controls{
  position:sticky;
  bottom:0;
  z-index:110;
  display:grid;
  grid-template-columns:auto 1fr;
  gap:10px;
  padding:10px 10px calc(10px + var(--safe-bottom));
  background:linear-gradient(180deg,rgba(5,10,19,0),rgba(5,10,19,.94) 25%,rgba(5,10,19,.98));
}
#prevBtn{min-width:106px;max-width:128px;min-height:54px;border-radius:18px;font-size:0;opacity:.80}
#prevBtn::before{content:"← Tillbaka";font-size:15px}
#nextBtn{min-height:58px;border-radius:20px;font-size:19px}

/* Rest */
.rest-stage{position:absolute;inset:0;display:grid;align-content:center;justify-items:start;padding:26px;background-size:cover;background-position:center;color:#fff}
.rest-stage::before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(3,8,16,.68),rgba(3,8,16,.18));z-index:0}
.rest-stage>*{position:relative;z-index:1}
.rest-kicker{color:var(--cyan);letter-spacing:.14em;text-transform:uppercase;font-weight:950}
.rest-title{font-size:44px;font-weight:1000}
.rest-display{font-size:clamp(80px,22vw,160px);font-weight:1000;letter-spacing:-.08em}
.rest-next{font-size:18px;color:#e4f0fb}

/* ---------- Library ---------- */
.library-filters{display:grid;grid-template-columns:1fr;gap:12px;margin:12px 0}
.library-filters input,.library-filters select,.test-card input{
  min-height:56px;
  border-radius:18px;
  border:1px solid var(--line);
  background:#071020;
  color:var(--text);
  padding:0 14px;
  width:100%;
}
.library-detail{display:grid!important;grid-template-columns:1fr!important;gap:14px;padding:14px;margin-bottom:14px}
.library-video{aspect-ratio:16/9;min-height:0;height:auto;border-radius:20px;overflow:hidden;background:#050a12}
.library-video iframe,.library-video video,.library-video img{width:100%;height:100%;border:0;display:block;object-fit:cover}
.library-copy{display:grid;gap:12px}
.library-copy h2{font-size:clamp(36px,10vw,58px);line-height:.94;letter-spacing:-.06em;margin:0}
.library-copy p{font-size:16px;margin:0}
.library-facts,.library-dose{display:grid;gap:10px}
.dose-card{padding:14px;border-radius:18px;background:rgba(8,15,27,.72)}
.dose-card .sub{display:flex;flex-wrap:wrap;gap:8px}
.dose-card ul{margin:0;padding-left:20px;color:var(--muted)}
.qa-grid{display:grid;grid-template-columns:1fr;gap:12px}
.qa-row{padding:16px;display:grid;gap:12px}
.qa-top{display:grid;gap:10px}
.qa-top b{font-size:28px;line-height:1;letter-spacing:-.04em}
.qa-status{width:max-content;border-radius:999px;padding:8px 12px;border:1px solid var(--line);background:rgba(13,31,55,.76);font-weight:900}
.qa-meta-pills{display:flex;flex-wrap:wrap;gap:8px}
.qa-open{min-height:50px;border-radius:18px;border:1px solid var(--line);background:rgba(255,255,255,.04);color:var(--text);font-weight:900}

/* ---------- Tests ---------- */
.test-card{padding:16px;display:grid;gap:12px}
.test-card label{color:var(--cyan);font-weight:950;font-size:18px}
.test-stats{display:grid;grid-template-columns:1fr;gap:10px}
.test-stat{padding:14px;border-radius:18px;border:1px solid var(--line);background:rgba(8,15,27,.72)}
.test-stat small{display:block;color:var(--muted);text-transform:uppercase;letter-spacing:.12em;font-weight:900}
.test-stat b{display:block;font-size:28px;margin-top:6px}
.test-delta,.test-history{color:var(--muted);font-size:14px}

/* ---------- Responsive desktop-ish ---------- */
@media (min-width:760px){
  .wrap{padding-top:18px}
  .panel-pad{padding:22px}
  .home-hero{padding:22px}
  .showcase-grid{display:grid;grid-template-columns:minmax(0,.95fr) minmax(360px,1.05fr);gap:18px}
  
  .showcase-copy{display:grid!important;align-content:center}
  .showcase-eyebrow{display:block!important}
  .showcase-copy h1{font-size:clamp(56px,6vw,92px);line-height:.9;letter-spacing:-.07em;margin:0}
  .showcase-intro{display:block!important;max-width:44ch}
  .showcase-benefits,.showcase-signals{display:flex!important;gap:10px;flex-wrap:wrap}
  .benefit{padding:14px;border:1px solid var(--line);border-radius:18px;background:rgba(8,15,27,.72)}
  .benefit b,.benefit span{display:block}
  .benefit span{color:var(--muted)}
  .dash-action-row{grid-template-columns:1.2fr .8fr}
  .profile-config-grid{grid-template-columns:repeat(12,minmax(0,1fr))}
  .profile-config-grid>.profile-panel{grid-column:span 4}
  .profile-config-grid>.selector-panel:nth-of-type(2){grid-column:1/-1}
  .profile-config-grid>.selector-panel:nth-of-type(3),
  .profile-config-grid>.selector-panel:nth-of-type(4){grid-column:span 6}
  .profile-overview-panel,.week-overview-panel,.passday-panel,.data-panel{grid-column:1/-1}
  #stageButtons{grid-template-columns:repeat(3,1fr)!important}
  .developed-cards-grid{grid-template-columns:repeat(4,1fr)}
  .week-plan-grid{grid-template-columns:repeat(3,1fr)}
  .selected-day-grid{grid-template-columns:repeat(2,1fr)}
  .overview-head{grid-template-columns:1fr auto}
  #overviewInsights{grid-template-columns:repeat(4,1fr)}
  #overviewFlow{grid-template-columns:repeat(4,1fr)!important}
  .stage-layout{grid-template-columns:minmax(0,1.1fr) minmax(360px,.9fr)}
  body.exercise-active .wrap{width:min(1220px,calc(100vw - 32px));padding-top:0}
  .video-card{border-radius:24px;border-left:1px solid var(--line);border-right:1px solid var(--line)}
  .info-card{margin:0}
  .playlist-card{display:block!important}
  .mini-list{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;max-height:40vh;overflow:auto}
  .mini-item{display:grid;grid-template-columns:34px 1fr;gap:8px;align-items:center;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.035);padding:8px}
  .mini-item.active{border-color:var(--line2);background:rgba(70,142,255,.16)}
  .mini-title{font-weight:850;font-size:13px}.mini-reps{font-size:12px;color:var(--muted)}
  .qa-grid{grid-template-columns:repeat(2,1fr)}
  .library-detail{grid-template-columns:1fr 1fr!important}
  .test-stats{grid-template-columns:repeat(3,1fr)}
}


/* Standardized system layer */

/* Global: fewer nested visual borders on mobile */
@media (max-width: 760px){
  .panel,
  .hero,
  .daily-primary,
  .daily-secondary,
  .profile-config-grid > .panel,
  .selected-day-focus,
  .library-detail,
  .qa-row,
  .test-card,
  .info-card{
    box-shadow:0 12px 30px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.03) !important;
  }

  .panel-pad{
    padding:14px !important;
  }
}

/* Dashboard: avoid large nested card feeling and make CTA safe around Safari toolbar */
@media (max-width: 760px){
  .home-hero{
    border-radius:22px !important;
  }
  .daily-primary{
    padding:14px !important;
    border-radius:20px !important;
  }
  .dash-title{
    font-size:clamp(34px,10.2vw,50px) !important;
  }
  .dash-focus-card{
    padding:12px !important;
    border-radius:16px !important;
  }
  .dash-focus-text{
    font-size:16px !important;
  }
  .dash-action-row{
    gap:8px !important;
  }
  .next-pass-btn{
    min-height:58px !important;
    border-radius:18px !important;
    font-size:20px !important;
  }
  .overview-pass-btn{
    min-height:48px !important;
    border-radius:16px !important;
  }
  .daily-secondary{
    padding:14px !important;
    border-radius:20px !important;
  }
  .dash-grid{
    grid-auto-columns:minmax(104px,1fr) !important;
  }
  .dash-day{
    min-width:104px !important;
    min-height:84px !important;
    padding:10px !important;
  }
}

/* Profile: remove "big marketing block" feeling; make it compact control-first */
@media (max-width:760px){
  #profileScreen .overview-head{
    padding:14px !important;
    border-radius:20px !important;
    margin-bottom:10px !important;
  }
  #profileScreen .overview-head .meta{
    font-size:11px !important;
    letter-spacing:.12em !important;
  }
  #profileScreen .title{
    font-size:clamp(32px,8.8vw,48px) !important;
    max-width:none !important;
    margin:4px 0 8px !important;
  }
  #profileScreen .muted{
    max-width:28ch !important;
    font-size:15px !important;
    line-height:1.25 !important;
  }
  #profileScreen .profile-config-grid{
    gap:8px !important;
  }
  #profileScreen .profile-panel,
  #profileScreen .selector-panel,
  #profileScreen .profile-overview-panel,
  #profileScreen .week-overview-panel,
  #profileScreen .passday-panel,
  #profileScreen .data-panel{
    border-radius:20px !important;
  }
  #profileScreen .stage-choice{
    min-height:188px !important;
    border-radius:22px !important;
    padding:18px !important;
  }
  #profileScreen .stage-choice b{
    font-size:clamp(32px,9.5vw,50px) !important;
  }
  #profileScreen .stage-choice span{
    font-size:15px !important;
  }
  .week-day-card{
    min-height:278px !important;
    border-radius:22px !important;
  }
  .week-day-content h3{
    font-size:clamp(34px,10vw,48px) !important;
  }
  .selected-day-focus h3{
    font-size:clamp(32px,9vw,46px) !important;
  }
}

/* Selected pass: fewer boxes inside boxes */
@media(max-width:760px){
  .selected-day-grid{
    display:none !important;
  }
  .selected-day-equipment span:nth-child(n/**/+5){
    display:none !important;
  }
  .selected-day-stats{
    font-size:22px !important;
  }
}

/* Library: video and card sizing more controlled */
#qaScreen .library-video{
  aspect-ratio:16 / 9 !important;
  width:100% !important;
  max-height:42svh !important;
}
#qaScreen .library-video iframe,
#qaScreen .library-video video{
  width:100% !important;
  height:100% !important;
}
@media(max-width:760px){
  .library-detail{
    padding:12px !important;
    border-radius:22px !important;
  }
  .library-copy h2{
    font-size:clamp(30px,9vw,44px) !important;
    line-height:.98 !important;
  }
  .library-copy p{
    font-size:15px !important;
  }
  .qa-top b{
    font-size:clamp(24px,7vw,34px) !important;
  }
}

/* Pass mode: previous should be tiny/secondary; hidden when disabled */
body.exercise-active .pass-bottom-controls{
  grid-template-columns:1fr !important;
}
body.exercise-active .pass-bottom-controls.has-prev{
  grid-template-columns:minmax(82px,.32fr) 1fr !important;
}
body.exercise-active #prevBtn:disabled{
  display:none !important;
}
body.exercise-active #prevBtn{
  min-width:0 !important;
  max-width:none !important;
  min-height:48px !important;
  padding-inline:10px !important;
  opacity:.72 !important;
  font-size:0 !important;
}
body.exercise-active #prevBtn::before{
  content:"←";
  font-size:20px;
}
body.exercise-active .pass-bottom-controls.has-prev #prevBtn::before{
  content:"←";
}
body.exercise-active #nextBtn{
  min-height:58px !important;
  font-size:18px !important;
}
@media(min-width:760px){
  body.exercise-active #prevBtn::before{
    content:"← Tillbaka";
    font-size:15px;
  }
}

/* Pass mode: if reps-based exercise, timer should not dominate below */
body.exercise-active .timer-card:not(.show){
  display:none !important;
}
body.exercise-active .timer-card{
  margin-top:2px !important;
}

/* App menu: ensure dropdown stays clean and never sits as visible pills */





/* Standardized system layer */

/* Rename-friendly compact controls */
#profileScreen #phaseButtons,
#profileScreen #weekButtons{
  display:grid !important;
  gap:8px !important;
}

#profileScreen #phaseButtons{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}

#profileScreen #weekButtons{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
}

#profileScreen #phaseButtons .seg-btn,
#profileScreen #weekButtons .seg-btn{
  min-height:52px !important;
  padding:10px 8px !important;
  border-radius:16px !important;
  font-size:clamp(15px,4vw,19px) !important;
  white-space:nowrap !important;
}

/* Similar compact button groups that should not become huge vertical stacks */
#profileScreen .profile-row{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
}

#profileScreen .profile-row .profile-btn{
  min-height:52px !important;
  padding:10px 8px !important;
  border-radius:16px !important;
  font-size:clamp(15px,4vw,19px) !important;
}

#profileScreen .profile-row .profile-btn.add-profile{
  grid-column:auto !important;
}

/* Make these selector panels smaller now that controls are grids */
#profileScreen .selector-panel .panel-pad,
#profileScreen .profile-panel .panel-pad{
  padding:14px !important;
}

#profileScreen .selector-panel,
#profileScreen .profile-panel{
  border-radius:18px !important;
}

/* When the phone is very narrow, keep phase as 3 columns but week as 2x2 if needed */
@media(max-width:390px){
  #profileScreen #weekButtons{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  #profileScreen .profile-row{
    grid-template-columns:1fr 1fr !important;
  }
  #profileScreen .profile-row .profile-btn.add-profile{
    grid-column:1 / -1 !important;
  }
}

/* Reduce vertical rhythm around these panels */
#profileScreen .profile-config-grid{
  gap:9px !important;
}
#profileScreen .section-title{
  margin-bottom:10px !important;
}



/* Standardized system layer */

/* Dashboard week rhythm: 3 equal cards, no right clipping */
#progressDashboard .dash-grid{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  grid-auto-flow:row !important;
  grid-auto-columns:unset !important;
  overflow:visible !important;
  gap:8px !important;
  width:100% !important;
}
#progressDashboard .dash-day{
  min-width:0 !important;
  width:100% !important;
  min-height:92px !important;
}
#progressDashboard .dash-day-top{
  display:grid !important;
  grid-template-columns:1fr auto !important;
  gap:6px !important;
}
#progressDashboard .dash-day-top b{
  font-size:clamp(28px,8vw,42px) !important;
  line-height:.95 !important;
}
#progressDashboard .dash-day-state{
  font-size:13px !important;
  line-height:1.05 !important;
  max-width:3.5em;
}
#progressDashboard .dash-week-summary{
  display:grid !important;
  grid-template-columns:1fr auto !important;
  gap:8px !important;
  align-items:center !important;
}
#progressDashboard .dash-week-count{
  white-space:nowrap !important;
  font-size:clamp(16px,5vw,24px) !important;
  padding:8px 12px !important;
}
@media(max-width:370px){
  #progressDashboard .dash-grid{
    grid-template-columns:repeat(3,minmax(92px,1fr)) !important;
    overflow-x:auto !important;
  }
}

/* Quick stats: no giant icons, compact stat cards */
.quick-stats-grid{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:12px !important;
}
.progress-stat,
.stat-card.progress-stat{
  min-height:0 !important;
  padding:16px !important;
  border-radius:20px !important;
  display:grid !important;
  gap:8px !important;
  align-content:start !important;
}
.progress-stat .stat-icon,
.stat-icon{
  display:none !important;
}
.progress-stat .big{
  font-size:clamp(32px,9vw,52px) !important;
  line-height:.92 !important;
  letter-spacing:-.05em !important;
}
.progress-stat .sub{
  font-size:15px !important;
}
.progress-stat .mini-progress{
  height:10px !important;
  border-radius:999px !important;
  overflow:hidden !important;
  background:rgba(160,190,230,.14) !important;
}
.progress-stat .mini-progress span{
  display:block;
  height:100%;
  background:linear-gradient(90deg,var(--cyan),var(--blue));
}
.progress-stat .cta{
  color:var(--cyan);
  font-weight:900;
}

/* Desktop can use grid, mobile remains single-column readable */
@media(min-width:760px){
  .quick-stats-grid{
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  }
}

/* Pass mode: hide normal app shell topbar when workout is active */


/* Pass mode: bottom controls are actual bottom controls, never above the video */
body.exercise-active .wrap{
  padding-bottom:calc(92px + var(--safe-bottom)) !important;
}
body.exercise-active .pass-bottom-controls{
  position:fixed !important;
  left:max(10px, calc((100vw - 1220px) / 2)) !important;
  right:max(10px, calc((100vw - 1220px) / 2)) !important;
  bottom:0 !important;
  z-index:500 !important;
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:8px !important;
  padding:10px 10px calc(10px + var(--safe-bottom)) !important;
  background:linear-gradient(180deg,rgba(5,10,19,0),rgba(5,10,19,.94) 28%,rgba(5,10,19,.99)) !important;
  pointer-events:auto !important;
}
body.exercise-active .pass-bottom-controls.has-prev{
  grid-template-columns:minmax(52px,64px) 1fr !important;
}
body.exercise-active #prevBtn:disabled{
  display:none !important;
}
body.exercise-active #prevBtn{
  width:100% !important;
  min-width:0 !important;
  max-width:64px !important;
  min-height:56px !important;
  border-radius:18px !important;
  padding:0 !important;
  opacity:.72 !important;
}
body.exercise-active #prevBtn::before{
  content:"←" !important;
  font-size:22px !important;
}
body.exercise-active #nextBtn{
  width:100% !important;
  min-height:60px !important;
  border-radius:20px !important;
  font-size:clamp(17px,4.8vw,22px) !important;
}

/* Since controls are fixed, video should be first after pass topbar */
body.exercise-active .stage-layout{
  margin-top:0 !important;
}
body.exercise-active .sticky-nav{
  margin-bottom:0 !important;
}
body.exercise-active .video-card{
  margin-top:0 !important;
}

/* Pass video: keep 16:9 and avoid oversized vertical flow */
body.exercise-active .video-wrap{
  aspect-ratio:16 / 9 !important;
  max-height:42svh !important;
}
body.exercise-active .video-wrap iframe,
body.exercise-active .video-wrap video{
  width:100% !important;
  height:100% !important;
}

/* Pass info: slightly tighter after moving controls out of flow */
body.exercise-active .info-card{
  margin-top:10px !important;
  padding-bottom:16px !important;
}
body.exercise-active .exercise-reps{
  min-height:96px !important;
}

/* Top pass bar compact after removing app topbar */
body.exercise-active .sticky-nav{
  top:0 !important;
  padding-top:calc(8px + env(safe-area-inset-top,0px)) !important;
}
body.exercise-active #exerciseMeta{
  font-size:clamp(12px,3.4vw,16px) !important;
}



/* Standardized system layer */
.dashboard-shortcuts-panel{margin-bottom:14px;}
.dashboard-shortcuts-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
.shortcut-btn{min-height:112px;border-radius:28px;border:1px solid var(--line);background:linear-gradient(180deg,rgba(14,23,40,.92),rgba(8,14,27,.96));box-shadow:var(--shadow);color:var(--text);font-weight:900;font-size:clamp(22px,6.2vw,28px);letter-spacing:-.03em;padding:20px 16px;text-align:center;}
.shortcut-btn.active{outline:2px solid rgba(108,225,255,.75); box-shadow:0 16px 36px rgba(0,0,0,.34), inset 0 -4px 0 rgba(108,225,255,.75);}
.shortcut-btn:active{transform:translateY(1px);}
@media(min-width:760px){.dashboard-shortcuts-grid{grid-template-columns:repeat(4,minmax(0,1fr));}}

/* pass mode: remove non-essential duplication to prioritise film + övning + coach-cues */
#nextTopPreview,.next-top-preview,.next-preview,#exerciseSummary{display:none !important;}
body.exercise-active .info-card{display:grid !important;gap:12px !important;align-content:start !important;padding:16px !important;}
body.exercise-active .exercise-kicker{margin-bottom:0 !important;}
body.exercise-active .exercise-name{margin:0 !important;font-size:clamp(30px,8.6vw,54px) !important;line-height:.94 !important;}
body.exercise-active .exercise-reps{margin-top:0 !important;min-height:72px !important;}
body.exercise-active .coach-cues{padding:14px !important;}
body.exercise-active .set-note, body.exercise-active .next-preview{display:none !important;}
body.exercise-active .stage-layout{gap:12px !important;}
body.exercise-active .sticky-nav{padding-bottom:8px !important;}
body.exercise-active .nav-row{gap:8px !important;}
body.exercise-active .progress-meta{gap:8px !important;}
body.exercise-active #exitPassBtn{min-height:48px !important;padding:12px 16px !important;border-radius:16px !important;}
body.exercise-active .menu-toggle{min-height:48px !important;padding:12px 16px !important;border-radius:16px !important;}


/* Standardized system layer */

/* Active pass: one compact header row */
body.exercise-active .sticky-nav{
  padding:calc(6px + env(safe-area-inset-top,0px)) 10px 8px !important;
  border-bottom:1px solid rgba(128,181,255,.14) !important;
}

body.exercise-active .nav-row{
  display:grid !important;
  grid-template-columns:auto 1fr !important;
  gap:8px !important;
  align-items:center !important;
}

body.exercise-active .nav-actions{
  display:block !important;
}

body.exercise-active .nav-left{
  display:block !important;
}

body.exercise-active .menu-wrap{
  display:block !important;
}

body.exercise-active #menuToggleBtn,
body.exercise-active .menu-toggle{
  width:48px !important;
  min-width:48px !important;
  height:44px !important;
  min-height:44px !important;
  padding:0 !important;
  border-radius:15px !important;
  font-size:0 !important;
}

body.exercise-active #menuToggleBtn::before{
  content:"☰";
  font-size:22px;
  line-height:1;
}

/* Exit stays available inside menu, not as a big top button */
body.exercise-active #exitPassBtn{
  display:none !important;
}

/* Settings menu in pass becomes the place for secondary actions */
body.exercise-active .top-tools{
  top:calc(58px + env(safe-area-inset-top,0px)) !important;
}

/* Progress is compact but visible */
body.exercise-active .progress-meta{
  min-width:0 !important;
  gap:6px !important;
}

body.exercise-active #exerciseMeta{
  font-size:clamp(11px,3vw,14px) !important;
  letter-spacing:.08em !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

body.exercise-active .progress-shell{
  height:7px !important;
}

/* Film should dominate */
body.exercise-active .stage-layout{
  gap:8px !important;
}

body.exercise-active .video-card{
  border-radius:0 0 18px 18px !important;
}

body.exercise-active .video-wrap{
  aspect-ratio:16 / 9 !important;
  max-height:48svh !important;
}

body.exercise-active .video-wrap iframe,
body.exercise-active .video-wrap video{
  width:100% !important;
  height:100% !important;
}

/* Exercise card: no extra pass-name feeling, fewer chips */
body.exercise-active .info-card{
  margin:8px 10px 0 !important;
  padding:14px !important;
  border-radius:20px !important;
  gap:8px !important;
}

body.exercise-active .exercise-kicker{
  display:flex !important;
  gap:8px !important;
  min-height:0 !important;
  margin:0 !important;
}

/* Keep only first meaningful category chip; hide group/set duplication */
body.exercise-active #exerciseGroup,
body.exercise-active #exerciseSet{
  display:none !important;
}

body.exercise-active #exerciseSection{
  min-height:30px !important;
  padding:6px 10px !important;
  font-size:11px !important;
  letter-spacing:.12em !important;
}

body.exercise-active .exercise-name{
  font-size:clamp(32px,9vw,52px) !important;
  line-height:.92 !important;
  margin:0 !important;
  letter-spacing:-.06em !important;
}

body.exercise-active .exercise-reps{
  min-height:78px !important;
  border-radius:18px !important;
  padding:10px !important;
}

body.exercise-active .rx-line{
  font-size:clamp(42px,12vw,64px) !important;
  line-height:.92 !important;
}

/* Coach cues get priority after prescription */
body.exercise-active .coach-cues{
  display:grid !important;
  padding:12px 14px !important;
  border-radius:18px !important;
}

body.exercise-active .coach-cues small{
  margin-bottom:6px !important;
  font-size:11px !important;
}

body.exercise-active .coach-cues ul{
  padding-left:18px !important;
  line-height:1.35 !important;
}

/* Remove non-essential active-pass modules */
body.exercise-active .set-note,
body.exercise-active .next-preview,
body.exercise-active #nextPreview,
body.exercise-active #exerciseSummary,
body.exercise-active .superset-status:empty,
body.exercise-active .playlist-card{
  display:none !important;
}

/* Timer only when actually active/visible */
body.exercise-active .timer-card:not(.show){
  display:none !important;
}

body.exercise-active .timer-card.show{
  padding:12px !important;
  border-radius:18px !important;
}

body.exercise-active .timer-display{
  font-size:34px !important;
}

body.exercise-active .timer-controls{
  gap:8px !important;
}

/* Bottom controls: primary next/rest, tiny back */
body.exercise-active .pass-bottom-controls{
  position:fixed !important;
  left:10px !important;
  right:10px !important;
  bottom:0 !important;
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:8px !important;
  padding:8px 8px calc(8px + env(safe-area-inset-bottom,0px)) !important;
}

body.exercise-active .pass-bottom-controls.has-prev{
  grid-template-columns:48px 1fr !important;
}

body.exercise-active #prevBtn{
  min-width:48px !important;
  width:48px !important;
  max-width:48px !important;
  height:54px !important;
  min-height:54px !important;
  border-radius:16px !important;
}

body.exercise-active #prevBtn::before{
  content:"←" !important;
  font-size:22px !important;
}

body.exercise-active #nextBtn{
  min-height:56px !important;
  border-radius:18px !important;
  font-size:clamp(17px,4.8vw,21px) !important;
}

/* Ensure bottom controls don't hide coach cues too aggressively */
body.exercise-active .wrap{
  padding-bottom:calc(84px + env(safe-area-inset-bottom,0px)) !important;
}

/* Very small screens: squeeze further */
@media(max-width:390px){
  body.exercise-active .info-card{
    margin-left:8px !important;
    margin-right:8px !important;
    padding:12px !important;
  }
  body.exercise-active .exercise-name{
    font-size:clamp(30px,8.4vw,44px) !important;
  }
  body.exercise-active .exercise-reps{
    min-height:68px !important;
  }
}

/* standard note: main app pages are governed by assets/css/next-system.css. */


/* =========================================================
   Centralized stabilization hardening
   These rules intentionally live at the end of next-system.css so all
   main, exercise, library and test views resolve through one stylesheet.
   ========================================================= */
:root{
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-top:env(safe-area-inset-top,0px);
  --bg:#020814;
  --card:var(--next-surface);
  --card2:var(--next-surface-2);
  --text:var(--next-text);
  --muted:var(--next-muted);
  --cyan:var(--next-accent);
  --blue:var(--next-accent-2);
  --blue2:#6ec7ff;
  --line:var(--next-card-border);
  --line2:var(--next-card-border-strong);
  --shadow:var(--next-shadow-card);
}
*{box-sizing:border-box}
html,body{min-height:100%;margin:0;background:var(--next-bg);color:var(--next-text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
img,svg,video,iframe{max-width:100%}

/* All visual page system ownership stays here. */
body:not(.exercise-active) .panel,
body:not(.exercise-active) .day-card,
body:not(.exercise-active) .developed-card,
body:not(.exercise-active) .profile-panel,
body:not(.exercise-active) .selector-panel,
body:not(.exercise-active) .week-overview-panel,
body:not(.exercise-active) .passday-panel,
body:not(.exercise-active) .data-panel,
body:not(.exercise-active) .qa-row,
body:not(.exercise-active) .test-card,
body:not(.exercise-active) .library-detail{
  border:1px solid var(--next-card-border)!important;
  border-radius:var(--next-radius-card)!important;
  background:radial-gradient(680px 260px at 88% 8%,var(--next-accent-soft),transparent 58%),linear-gradient(180deg,var(--next-surface),var(--next-surface-2))!important;
  box-shadow:var(--next-shadow-card),var(--next-glow),inset 0 1px 0 rgba(255,255,255,.04)!important;
  color:var(--next-text)!important;
}
body:not(.exercise-active) .panel-pad{padding:var(--next-card-pad)!important;}
body:not(.exercise-active) .grid,
body:not(.exercise-active) .start-grid,
body:not(.exercise-active) .qa-grid,
body:not(.exercise-active) .test-stats,
body:not(.exercise-active) .developed-cards-grid,
body:not(.exercise-active) .overview-flow-grid,
body:not(.exercise-active) .selected-day-grid{
  display:grid!important;
  gap:var(--next-card-grid-gap,var(--next-section-gap))!important;
}
body:not(.exercise-active) :is(.section-title,.calendar-card-title,.overview-list-head,.library-copy h2,.qa-top b){color:var(--next-text)!important;}
body:not(.exercise-active) :is(.muted,.hint,.small-note,.sub,.panel p,.calendar-copy small,.library-copy p,.test-history,.test-delta){color:var(--next-muted)!important;line-height:1.38!important;}

/* Unified chip fallback for remaining old chip hooks. */
body:not(.exercise-active) :is(.tag,.week-day-chips span,.selected-day-tags span,.selected-day-equipment span,.qa-meta-pills span,.library-facts span,.overview-equipment span,.overview-equipment b,.dash-focus-chips span,.week-day-stats span,.selected-day-stats,.meta){
  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  min-height:var(--next-chip-h)!important;
  padding:7px 11px!important;
  border-radius:999px!important;
  border:1px solid rgba(116,231,255,.24)!important;
  background:rgba(6,18,34,.58)!important;
  color:var(--next-text)!important;
  font-weight:850!important;
  line-height:1.05!important;
}

/* Unified button fallback for remaining old button hooks. */
body:not(.exercise-active) :is(.main-btn,.ghost-btn,.seg-btn,.profile-btn,.day-start,.day-overview,.menu-toggle,.tool-btn,.utility-pill,.next-pass-btn,.qa-open,.shortcut-btn){
  min-height:var(--next-btn-h)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  border-radius:18px!important;
  border:1px solid rgba(116,231,255,.26)!important;
  background:linear-gradient(180deg,rgba(255,255,255,.060),rgba(255,255,255,.028))!important;
  color:var(--next-text)!important;
  font-weight:900!important;
  text-decoration:none!important;
}
body:not(.exercise-active) :is(.main-btn,.day-start,.next-pass-btn,.shortcut-btn.active,.profile-btn.active,.seg-btn.active){
  border-color:var(--next-accent)!important;
  background:linear-gradient(180deg,var(--next-accent-2),#48a9ff)!important;
  color:#03101e!important;
  box-shadow:0 16px 40px rgba(110,234,255,.18)!important;
}

/* Exercise/pass system now uses same tokens but remains a deliberately separate state. */
body.exercise-active{
  background:linear-gradient(180deg,var(--next-bg),var(--next-bg-2) 58%,var(--next-bg-3))!important;
  color:var(--next-text)!important;
}
body.exercise-active :is(.video-card,.info-card,.playlist-card,.set-note,.coach-cues,.next-preview,.timer-card,.superset-status,.mini-item,.exercise-reps){
  border:1px solid var(--next-card-border)!important;
  border-radius:var(--next-radius-card-sm)!important;
  background:linear-gradient(180deg,rgba(8,22,40,.86),rgba(4,13,26,.82))!important;
  color:var(--next-text)!important;
  box-shadow:0 14px 38px rgba(0,0,0,.24),inset 0 1px 0 rgba(255,255,255,.035)!important;
}
body.exercise-active :is(.menu-toggle,.tool-btn,#prevBtn,#nextBtn,.timer-controls button,.exit-pass-btn){
  min-height:48px!important;
  border-radius:18px!important;
  border:1px solid rgba(116,231,255,.26)!important;
  background:rgba(6,18,34,.72)!important;
  color:var(--next-text)!important;
  font-weight:900!important;
}
body.exercise-active #nextBtn,
body.exercise-active .timer-controls button:first-child{
  background:linear-gradient(180deg,var(--next-accent-2),#48a9ff)!important;
  color:#03101e!important;
  border-color:var(--next-accent)!important;
}
body.exercise-active :is(.exercise-kicker .tag,.coach-cues small,.next-preview small,.timer-status,.rest-kicker){color:var(--next-accent)!important;}
body.exercise-active .sticky-nav{border-color:var(--next-card-border)!important;background:linear-gradient(180deg,rgba(5,10,19,.98),rgba(6,12,22,.95))!important;}

@media(min-width:760px){
  body:not(.exercise-active) .qa-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body:not(.exercise-active) .test-stats{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body:not(.exercise-active) .library-detail{grid-template-columns:1fr 1fr!important;}
}


/* =========================================================
   Centralized regression stabilization
   Purpose:
   - Finish the ownership consolidation after standard/76.
   - Icons, media, card internals and page modules are governed centrally.
   - No page-specific quick patches; this is a shared contract layer.
   ========================================================= */

/* ---------- Universal geometry guardrails ---------- */
*,*::before,*::after{box-sizing:border-box;}
body:not(.exercise-active) :where(.next-shell,.next-page-stack,.next-card,.next-card-content,.next-chip-row,.next-action-row,.next-calendar-row,.next-program-card,.next-profile-card,.next-dashboard-progress-card,.next-dashboard-today-card){min-width:0!important;}
body:not(.exercise-active) :where(.next-card,.panel,.program57-card,.profile-next-card,.calendar-card,.developed-card,.flow-card,.overview-insight-card){overflow:hidden!important;}

/* ---------- Central icon contract ----------
   Every inline app SVG is stroke-based, sized by role, never by its raw SVG box.
   This prevents black giant icons from blowing up buttons/cards after legacy CSS removal.
*/
body:not(.exercise-active) :where(svg){
  max-width:100%!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.85!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  overflow:visible!important;
}
body:not(.exercise-active) :where(svg *){
  vector-effect:non-scaling-stroke!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
body:not(.exercise-active) :where(.next-button,.program57-btn,.profile-action,.main-btn,.ghost-btn,.tool-btn,.menu-toggle,.shortcut-btn,.calendar-link-btn,.day-start,.day-overview) > svg,
body:not(.exercise-active) :where(.next-button,.program57-btn,.profile-action,.main-btn,.ghost-btn,.tool-btn,.menu-toggle,.shortcut-btn,.calendar-link-btn,.day-start,.day-overview) svg{
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  max-width:18px!important;
  flex:0 0 18px!important;
  color:currentColor!important;
}
body:not(.exercise-active) :where(.next-chip,.profile-next-chip,.program57-chip,.program61-equipment-chip,.signal-chip,.tag) > svg,
body:not(.exercise-active) :where(.next-chip,.profile-next-chip,.program57-chip,.program61-equipment-chip,.signal-chip,.tag) svg{
  width:15px!important;
  height:15px!important;
  min-width:15px!important;
  max-width:15px!important;
  flex:0 0 15px!important;
}
body:not(.exercise-active) :where(.next-dashboard-pass-icon,.program57-profile-icon,.program57-list-icon,.calendar-list-icon,.profile-avatar,.profile-avatar-edit,.profile-select-option,.profile-avatar-choice) svg{
  width:22px!important;
  height:22px!important;
  min-width:22px!important;
  max-width:22px!important;
  flex:0 0 22px!important;
}
body:not(.exercise-active) .profile-avatar > svg{width:52%!important;height:52%!important;max-width:72px!important;max-height:72px!important;}
body:not(.exercise-active) .profile-avatar-edit > svg{width:21px!important;height:21px!important;max-width:21px!important;max-height:21px!important;}
body:not(.exercise-active) .app-profile-toggle svg{width:58%!important;height:58%!important;max-width:34px!important;max-height:34px!important;}
body:not(.exercise-active) .next-dashboard-pass-icon svg{width:25px!important;height:25px!important;max-width:25px!important;max-height:25px!important;}
body:not(.exercise-active) .calendar-list-icon svg{width:20px!important;height:20px!important;max-width:20px!important;max-height:20px!important;}
body:not(.exercise-active) .program57-list-icon svg,
body:not(.exercise-active) .program57-profile-icon svg{width:22px!important;height:22px!important;max-width:22px!important;max-height:22px!important;}

/* ---------- Central button/chip text contract ---------- */
body:not(.exercise-active) .next-button{
  min-width:0!important;
  max-width:100%!important;
  white-space:normal!important;
  line-height:1.08!important;
  gap:8px!important;
}
body:not(.exercise-active) .next-button span{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body:not(.exercise-active) .next-chip{min-width:0!important;max-width:100%!important;white-space:nowrap!important;}
body:not(.exercise-active) .next-chip span{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body:not(.exercise-active) .next-chip-row{align-items:center!important;}
body:not(.exercise-active) .next-action-row{align-items:stretch!important;}

/* ---------- Dashboard ownership hardening ---------- */
body:not(.exercise-active) #startScreen .hero{display:block!important;}
body:not(.exercise-active) #startScreen .showcase-grid{width:100%!important;}
body:not(.exercise-active) #startScreen .showcase-copy{min-width:0!important;}
body:not(.exercise-active) #progressDashboard,
body:not(.exercise-active) #quickStatsGrid{width:100%!important;min-width:0!important;}
body:not(.exercise-active) .next-dashboard-today-card{width:100%!important;}
body:not(.exercise-active) .next-dashboard-today-copy{min-width:0!important;}
body:not(.exercise-active) .next-dashboard-today-copy h2,
body:not(.exercise-active) .next-dashboard-today-copy p,
body:not(.exercise-active) .next-dashboard-today-meta{min-width:0!important;overflow-wrap:anywhere!important;}
body:not(.exercise-active) .next-dashboard-progress-card{width:100%!important;align-items:stretch!important;}
body:not(.exercise-active) .next-dashboard-progress-main{width:100%!important;min-width:0!important;}
body:not(.exercise-active) .next-dashboard-kpi-grid{width:100%!important;min-width:0!important;}
body:not(.exercise-active) .next-dashboard-kpi-cell{min-width:0!important;}
body:not(.exercise-active) .next-dashboard-kpi-cell > div:last-child{min-width:0!important;}
body:not(.exercise-active) .next-dashboard-kpi-value{overflow:hidden!important;text-overflow:ellipsis!important;}

@media(max-width:760px){
  body:not(.exercise-active) #startScreen .showcase-grid{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .next-dashboard-progress-card{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .next-dashboard-progress-main{grid-template-columns:120px minmax(0,1fr)!important;align-items:center!important;}
  body:not(.exercise-active) .next-dashboard-ring-xl{width:120px!important;height:120px!important;}
  body:not(.exercise-active) .next-dashboard-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:420px){
  body:not(.exercise-active) .next-dashboard-progress-main{grid-template-columns:1fr!important;justify-items:start!important;}
  body:not(.exercise-active) .next-dashboard-kpi-grid{grid-template-columns:1fr 1fr!important;}
  body:not(.exercise-active) .next-dashboard-kpi-cell{grid-template-columns:auto minmax(0,1fr)!important;}
  body:not(.exercise-active) .next-dashboard-ring-sm{width:52px!important;height:52px!important;font-size:14px!important;}
}

/* ---------- Program ownership hardening ---------- */
body:not(.exercise-active) .program57-card,
body:not(.exercise-active) .program57-list-card{width:100%!important;min-width:0!important;}
body:not(.exercise-active) .program57-card-content,
body:not(.exercise-active) .program57-list-main{min-width:0!important;}
body:not(.exercise-active) .program57-card-content{max-width:100%!important;}
body:not(.exercise-active) .program57-card-img{pointer-events:none!important;}
body:not(.exercise-active) .program57-actions,
body:not(.exercise-active) .program57-list-actions,
body:not(.exercise-active) .program59-modal-actions{width:100%!important;}
body:not(.exercise-active) .program57-actions .next-button,
body:not(.exercise-active) .program57-list-actions .next-button{min-height:48px!important;}
body:not(.exercise-active) .program57-preview{grid-column:1/-1!important;min-width:0!important;width:100%!important;}
body:not(.exercise-active) .program61-preview-box{width:100%!important;}
body:not(.exercise-active) .program61-preview-summary{grid-template-columns:1fr 1fr!important;align-items:start!important;}
body:not(.exercise-active) .program61-equipment-list{display:flex!important;flex-wrap:wrap!important;gap:8px!important;align-items:center!important;}
body:not(.exercise-active) .program61-exercise-list{display:grid!important;gap:9px!important;}
@media(max-width:760px){
  body:not(.exercise-active) .next-program-card-list{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .program57-list-icon{display:none!important;}
  body:not(.exercise-active) .program57-list-actions{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .program61-preview-summary{grid-template-columns:1fr!important;}
}

/* ---------- Profile ownership hardening ---------- */
body:not(.exercise-active) .profile-active-grid{width:100%!important;min-width:0!important;}
body:not(.exercise-active) .profile-active-main{min-width:0!important;}
body:not(.exercise-active) .profile-active-main h2{overflow-wrap:anywhere!important;}
body:not(.exercise-active) .profile-action-grid{display:grid!important;gap:10px!important;align-items:stretch!important;}
body:not(.exercise-active) .profile-action-grid.three{grid-template-columns:1fr 1fr!important;}
body:not(.exercise-active) .profile-action-grid.three .primary{grid-column:1/-1!important;}
body:not(.exercise-active) .profile-action{min-height:52px!important;padding:12px 14px!important;}
body:not(.exercise-active) .profile-summary-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;}
body:not(.exercise-active) .profile-rebuild-chip-grid{display:flex!important;flex-wrap:wrap!important;gap:8px!important;}
body:not(.exercise-active) .profile-select-grid{display:grid!important;gap:10px!important;}
body:not(.exercise-active) .profile-select-option,
body:not(.exercise-active) .profile-avatar-choice{min-width:0!important;}
body:not(.exercise-active) .profile-select-option svg,
body:not(.exercise-active) .profile-avatar-choice svg{width:20px!important;height:20px!important;}

/* ---------- Calendar ownership hardening ---------- */
body:not(.exercise-active) #calendarScreen > .calendar-screen-bg{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;object-fit:cover!important;z-index:0!important;opacity:.22!important;pointer-events:none!important;}
body:not(.exercise-active) .next-calendar-plan-card{width:100%!important;}
body:not(.exercise-active) .next-calendar-row-head{min-width:0!important;}
body:not(.exercise-active) .next-calendar-copy{min-width:0!important;}
body:not(.exercise-active) .next-calendar-hero{min-width:0!important;display:grid!important;gap:10px!important;}
body:not(.exercise-active) .next-calendar-hero :where(h1,h2,h3,p,div,span){max-width:100%!important;overflow-wrap:anywhere!important;}
@media(max-width:420px){
  body:not(.exercise-active) .next-calendar-row-head{grid-template-columns:auto minmax(0,1fr) auto!important;}
  body:not(.exercise-active) .next-calendar-day{font-size:11px!important;padding-inline:8px!important;}
}

/* ---------- Overview / active pass preview ownership hardening ---------- */
body:not(.exercise-active) .overview-flow-grid,
body:not(.exercise-active) .developed-cards-grid,
body:not(.exercise-active) .overview-list{width:100%!important;min-width:0!important;}
body:not(.exercise-active) .flow-card,
body:not(.exercise-active) .developed-card,
body:not(.exercise-active) .overview-insight-card,
body:not(.exercise-active) .overview-list article{min-width:0!important;}
body:not(.exercise-active) :where(.flow-card,.developed-card,.overview-insight-card,.overview-list article) svg{width:22px!important;height:22px!important;max-width:22px!important;max-height:22px!important;}
body:not(.exercise-active) .overview-list :where(h2,h3,p,span,div){max-width:100%!important;overflow-wrap:anywhere!important;}

/* ---------- Active exercise player stabilization ---------- */
body.exercise-active :where(svg){max-width:100%;fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;}
body.exercise-active :where(.next-button,.tag,.menu-toggle,.tool-btn,.main-btn,.ghost-btn) svg{width:18px;height:18px;flex:0 0 18px;}
body.exercise-active .stage-layout{min-width:0;}
body.exercise-active .info-card,
body.exercise-active .video-card,
body.exercise-active .playlist-card{min-width:0;}


/* =========================================================
   Structural centralization
   Rebuilds dashboard/overview/edit profile surfaces with canonical
   system classes instead of legacy visual contracts.
   ========================================================= */
body:not(.exercise-active) .next-dashboard-shell{
  position:relative!important;
  isolation:isolate!important;
}
body:not(.exercise-active)[data-screen="startScreen"] .next-dashboard-shell::before,
body:not(.exercise-active)[data-screen="calendarScreen"] .next-calendar-shell::before,
body:not(.exercise-active)[data-screen="profileScreen"] .next-profile-shell::before{
  content:""!important;
  position:fixed!important;
  inset:0!important;
  z-index:-1!important;
  pointer-events:none!important;
  background-size:cover!important;
  background-position:center!important;
  opacity:.34!important;
  filter:saturate(1.1) brightness(.9) contrast(1.08)!important;
}
body:not(.exercise-active)[data-screen="startScreen"] .next-dashboard-shell::before{background-image:url('../img/hero/hero-dashboard.webp')!important;}
body:not(.exercise-active)[data-screen="calendarScreen"] .next-calendar-shell::before{background-image:url('../img/hero/futuristic_energy_in_motion_design.png')!important;opacity:.24!important;}
body:not(.exercise-active)[data-screen="profileScreen"] .next-profile-shell::before{background-image:url('../img/hero/visual-anchor.webp')!important;opacity:.16!important;}
body:not(.exercise-active) #startScreen > .dashboard-global-bg-img,
body:not(.exercise-active) #calendarScreen > .calendar-screen-bg,
body:not(.exercise-active) #profileScreen > .profile-screen-bg,
body:not(.exercise-active) > .dashboard-viewport-bg-img{display:none!important;opacity:0!important;}

.next-dashboard-root{display:grid!important;gap:var(--next-section-gap)!important;}
.next-dashboard-grid{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr)!important;gap:var(--next-section-gap)!important;align-items:stretch!important;}
.next-dashboard-header .next-page-title span{color:var(--next-accent)!important;}
.next-dashboard-pass-card,.next-dashboard-progress-card{display:grid!important;gap:14px!important;align-content:start!important;}
.next-dashboard-pass-card{grid-template-columns:auto minmax(0,1fr)!important;}
.next-card-icon{width:44px!important;height:44px!important;border:1px solid var(--next-card-border)!important;border-radius:999px!important;display:grid!important;place-items:center!important;color:var(--next-accent)!important;background:rgba(6,20,38,.52)!important;}
.next-card-icon svg{width:24px!important;height:24px!important;}
.next-progress-summary{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;gap:16px!important;align-items:center!important;}
.next-progress-ring{--p:0;width:118px!important;height:118px!important;border-radius:999px!important;display:grid!important;place-items:center!important;background:conic-gradient(var(--next-accent) calc(var(--p)*1%), rgba(9,33,58,.72) 0)!important;position:relative!important;flex:0 0 auto!important;}
.next-progress-ring::before{content:""!important;position:absolute!important;inset:14px!important;border-radius:inherit!important;background:rgba(2,8,18,.94)!important;box-shadow:inset 0 0 24px rgba(0,0,0,.35)!important;}
.next-progress-ring span{position:relative!important;z-index:1!important;font-size:28px!important;font-weight:950!important;color:var(--next-text)!important;}
.next-kpi-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:10px!important;}
.next-kpi{min-width:0!important;border:1px solid rgba(116,231,255,.18)!important;border-radius:18px!important;padding:12px!important;background:rgba(3,13,27,.46)!important;color:var(--next-text)!important;text-align:left!important;display:grid!important;gap:4px!important;}
.next-kpi b{font-size:clamp(20px,4.8vw,30px)!important;line-height:1!important;}
.next-kpi span{font-size:12px!important;color:var(--next-muted)!important;font-weight:850!important;text-transform:uppercase!important;letter-spacing:.08em!important;}
.next-kpi-button{cursor:pointer!important;}
.next-option-grid{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(126px,1fr))!important;gap:10px!important;}
.next-option-button{min-width:0!important;min-height:48px!important;border:1px solid rgba(116,231,255,.20)!important;border-radius:18px!important;background:rgba(6,18,34,.58)!important;color:var(--next-text)!important;display:flex!important;align-items:center!important;gap:8px!important;padding:10px 12px!important;font-weight:850!important;text-align:left!important;overflow:hidden!important;}
.next-option-button.selected,.next-option-button.active{border-color:var(--next-card-border-strong)!important;color:var(--next-accent)!important;background:linear-gradient(180deg,rgba(104,234,255,.18),rgba(6,18,34,.60))!important;box-shadow:0 0 20px rgba(0,210,255,.10)!important;}
.next-option-button svg{width:20px!important;height:20px!important;flex:0 0 20px!important;}
.next-input{width:100%!important;min-height:48px!important;border-radius:16px!important;border:1px solid rgba(116,231,255,.22)!important;background:rgba(4,12,25,.64)!important;color:var(--next-text)!important;padding:12px 14px!important;font:inherit!important;font-weight:850!important;}
.next-muted{color:var(--next-muted)!important;}

/* Calendar action/button contract */
.next-phase-week-selector{display:grid!important;gap:8px!important;min-width:min(100%,310px)!important;}
.next-pw-row{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;gap:8px!important;align-items:center!important;}
.next-pw-current{display:grid!important;gap:1px!important;min-width:60px!important;color:var(--next-muted)!important;font-size:10px!important;text-transform:uppercase!important;letter-spacing:.08em!important;font-weight:900!important;}
.next-pw-options{display:flex!important;flex-wrap:wrap!important;gap:6px!important;justify-content:flex-end!important;}
.next-pw-btn{min-height:30px!important;min-width:38px!important;border-radius:999px!important;border:1px solid rgba(116,231,255,.22)!important;background:rgba(6,18,34,.58)!important;color:var(--next-text)!important;font-weight:900!important;font-size:12px!important;padding:5px 10px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;}
.next-pw-btn.is-selected{background:linear-gradient(180deg,rgba(104,234,255,.22),rgba(6,18,34,.72))!important;border-color:var(--next-card-border-strong)!important;color:var(--next-accent)!important;}
.next-expand-actions .next-button{min-height:44px!important;}

/* Overview rebuilt surface */
.next-overview-root{display:grid!important;gap:var(--next-section-gap)!important;}
.next-overview-hero{display:grid!important;gap:14px!important;}
.next-overview-return-row{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important;}
.next-equipment-panel{padding:14px!important;border-radius:20px!important;background:rgba(3,13,27,.36)!important;}
.next-overview-layout{display:grid!important;gap:12px!important;}
.next-overview-block-list{display:grid!important;gap:10px!important;}
.next-overview-block{padding:0!important;overflow:hidden!important;}
.next-overview-block>summary{list-style:none!important;cursor:pointer!important;display:grid!important;grid-template-columns:auto auto minmax(0,1fr) auto!important;gap:10px!important;align-items:center!important;padding:14px!important;}
.next-overview-block>summary::-webkit-details-marker{display:none!important;}
.next-overview-index{width:34px!important;height:34px!important;border-radius:12px!important;border:1px solid var(--next-card-border)!important;display:grid!important;place-items:center!important;font-weight:950!important;color:var(--next-accent)!important;background:rgba(6,20,38,.52)!important;}
.next-overview-block-icon{width:34px!important;height:34px!important;border-radius:12px!important;border:1px solid rgba(116,231,255,.18)!important;display:grid!important;place-items:center!important;color:var(--next-accent)!important;}
.next-overview-block-icon svg,.next-overview-block-icon i{width:20px!important;height:20px!important;font-size:18px!important;}
.next-overview-block summary b{display:block!important;font-size:18px!important;color:var(--next-text)!important;line-height:1.05!important;}
.next-overview-block summary small{display:block!important;color:var(--next-muted)!important;font-weight:750!important;margin-top:3px!important;}
.next-overview-block summary i{font-style:normal!important;color:var(--next-accent)!important;font-size:24px!important;transition:transform .16s ease!important;}
.next-overview-block[open] summary i{transform:rotate(90deg)!important;}
.next-overview-block-body{border-top:1px solid rgba(116,231,255,.12)!important;padding:12px!important;display:grid!important;gap:10px!important;}
.next-overview-group{border:1px solid rgba(116,231,255,.12)!important;border-radius:16px!important;overflow:hidden!important;background:rgba(4,14,28,.40)!important;}
.next-overview-group-head{display:flex!important;justify-content:space-between!important;gap:10px!important;padding:10px 12px!important;background:rgba(7,28,50,.52)!important;}
.next-overview-group-head b{color:var(--next-accent)!important;text-transform:uppercase!important;letter-spacing:.12em!important;font-size:12px!important;}
.next-overview-group-head span{color:var(--next-muted)!important;font-size:12px!important;font-weight:800!important;}
.next-overview-group ul{list-style:none!important;margin:0!important;padding:0!important;display:grid!important;}
.next-overview-group li{display:grid!important;grid-template-columns:42px minmax(0,1fr) auto!important;gap:8px!important;align-items:center!important;padding:10px 12px!important;border-top:1px solid rgba(116,231,255,.08)!important;}
.next-ex-code{min-height:28px!important;border-radius:10px!important;border:1px solid rgba(116,231,255,.20)!important;display:grid!important;place-items:center!important;color:var(--next-accent)!important;font-weight:950!important;}
.next-overview-group li b{overflow:hidden!important;text-overflow:ellipsis!important;}
.next-overview-group li small{color:var(--next-muted)!important;font-weight:850!important;}
.next-checklist-card h3{margin:4px 0 10px!important;font-size:24px!important;}
.next-check-grid{display:grid!important;gap:8px!important;}
.next-check-item{border:1px solid rgba(116,231,255,.12)!important;border-radius:16px!important;padding:10px 12px!important;background:rgba(4,14,28,.40)!important;display:grid!important;gap:4px!important;}
.next-check-item span{color:var(--next-muted)!important;}

/* Profile edit canonical form */
.next-profile-edit-page{display:grid!important;gap:var(--next-section-gap)!important;}
.next-edit-card{display:grid!important;gap:12px!important;}
.next-form-grid{display:grid!important;gap:12px!important;}
.next-field{display:grid!important;gap:8px!important;}
.next-field>span{display:flex!important;align-items:center!important;gap:8px!important;color:var(--next-muted)!important;font-weight:900!important;}
.next-field svg{width:18px!important;height:18px!important;}
.next-program-compact{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:12px!important;align-items:center!important;}
.next-program-compact>div:first-child{display:flex!important;align-items:center!important;gap:12px!important;min-width:0!important;}
.next-sticky-actions{position:sticky!important;bottom:calc(12px + env(safe-area-inset-bottom,0px))!important;z-index:60!important;background:linear-gradient(180deg,rgba(2,8,18,.15),rgba(2,8,18,.82))!important;padding-top:8px!important;}

@media(max-width:760px){
  .next-dashboard-grid{grid-template-columns:1fr!important;}
  .next-dashboard-pass-card{grid-template-columns:1fr!important;}
  .next-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .next-progress-summary{grid-template-columns:1fr!important;text-align:left!important;}
  .next-progress-ring{width:104px!important;height:104px!important;}
  .next-pw-row{grid-template-columns:1fr!important;}
  .next-pw-options{justify-content:flex-start!important;}
  .next-overview-group li{grid-template-columns:34px minmax(0,1fr)!important;}
  .next-overview-group li small{grid-column:2!important;}
  .next-program-compact{grid-template-columns:1fr!important;}
  .next-sticky-actions{grid-template-columns:1fr 1fr!important;}
}

/* =========================================================
   Remaining surface standardization
   Purpose: not a quickfix. Centralizes the last messy surfaces:
   - icon registry/render contract
   - calendar expanded session detail
   - pass overview hero + equipment
   - edit profile form rhythm
   - dashboard/progress containment
   ========================================================= */

/* ---------- Canonical icon contract ---------- */
body:not(.exercise-active) :is(.next-button,.next-chip,.next-option-button,.next-list-row,.next-calendar-row-head,.next-overview-block, .next-field) svg{
  width:18px!important;
  height:18px!important;
  min-width:18px!important;
  max-width:18px!important;
  max-height:18px!important;
  flex:0 0 18px!important;
  display:block!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.75!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
body:not(.exercise-active) .next-card-icon svg,
body:not(.exercise-active) .calendar-list-icon svg,
body:not(.exercise-active) .next-overview-block-icon svg{
  width:22px!important;
  height:22px!important;
  max-width:22px!important;
  max-height:22px!important;
  fill:none!important;
  stroke:currentColor!important;
}
body:not(.exercise-active) .profile-avatar svg{
  width:52%!important;
  height:52%!important;
  max-width:72px!important;
  max-height:72px!important;
}
body:not(.exercise-active) .profile-avatar-edit svg{width:20px!important;height:20px!important;max-width:20px!important;max-height:20px!important;}

/* ---------- Action row contract ---------- */
body:not(.exercise-active) .next-action-row{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr))!important;
  gap:10px!important;
  align-items:stretch!important;
}
body:not(.exercise-active) .next-action-row .next-button{width:100%!important;min-width:0!important;}
body:not(.exercise-active) .next-button{
  min-width:0!important;
  white-space:normal!important;
  text-align:center!important;
  line-height:1.12!important;
  padding:12px 14px!important;
}
body:not(.exercise-active) .next-button span{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;}

/* ---------- Dashboard containment ---------- */
body:not(.exercise-active) .next-dashboard-grid{align-items:stretch!important;}
body:not(.exercise-active) .next-dashboard-pass-card,
body:not(.exercise-active) .next-dashboard-progress-card{
  min-width:0!important;
  overflow:hidden!important;
}
body:not(.exercise-active) .next-progress-summary{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  gap:18px!important;
  align-items:center!important;
}
body:not(.exercise-active) .next-progress-summary h2{margin:0!important;font-size:clamp(28px,4vw,44px)!important;line-height:1!important;}
body:not(.exercise-active) .next-kpi-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:10px!important;
}
body:not(.exercise-active) .next-kpi{
  min-width:0!important;
  border:1px solid rgba(116,231,255,.18)!important;
  border-radius:16px!important;
  background:rgba(4,14,28,.42)!important;
  padding:12px!important;
  display:grid!important;
  gap:3px!important;
  align-content:center!important;
}
body:not(.exercise-active) .next-kpi b{font-size:clamp(22px,3vw,32px)!important;line-height:1!important;}
body:not(.exercise-active) .next-kpi span{text-transform:uppercase!important;letter-spacing:.08em!important;color:var(--next-muted)!important;font-size:11px!important;font-weight:900!important;}

/* ---------- Calendar expanded detail: one clean component ---------- */
body:not(.exercise-active) .next-calendar-hero{padding:0!important;background:transparent!important;border-top:1px solid rgba(116,231,255,.12)!important;}
body:not(.exercise-active) .next-calendar-expand{
  position:relative!important;
  isolation:isolate!important;
  min-height:auto!important;
  display:grid!important;
  gap:12px!important;
  padding:16px!important;
  overflow:hidden!important;
  border-radius:0 0 18px 18px!important;
  background:linear-gradient(180deg,rgba(3,12,24,.66),rgba(3,11,21,.42))!important;
}
body:not(.exercise-active) .next-calendar-expand::before{
  content:''!important;
  position:absolute!important;
  inset:0!important;
  z-index:-1!important;
  background-image:var(--entry-img)!important;
  background-size:cover!important;
  background-position:center!important;
  opacity:.12!important;
  filter:saturate(1.05) brightness(.55)!important;
}
body:not(.exercise-active) .next-expand-copy{
  display:grid!important;
  gap:10px!important;
  min-width:0!important;
  max-width:760px!important;
}
body:not(.exercise-active) .next-expand-kicker{
  color:var(--next-accent)!important;
  text-transform:uppercase!important;
  letter-spacing:.18em!important;
  font-size:12px!important;
  font-weight:950!important;
}
body:not(.exercise-active) .next-expand-copy h3{
  margin:0!important;
  font-size:clamp(26px,5vw,42px)!important;
  line-height:.98!important;
  letter-spacing:-.04em!important;
}
body:not(.exercise-active) .next-expand-copy p{
  margin:0!important;
  max-width:58ch!important;
  color:var(--next-text)!important;
  line-height:1.38!important;
}
body:not(.exercise-active) .next-expand-chips{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
}
body:not(.exercise-active) .next-expand-chips span{
  display:inline-flex!important;
  align-items:center!important;
  min-height:30px!important;
  padding:6px 10px!important;
  border-radius:999px!important;
  border:1px solid rgba(116,231,255,.22)!important;
  background:rgba(6,18,34,.58)!important;
  color:var(--next-text)!important;
  font-weight:850!important;
  font-size:12px!important;
}
body:not(.exercise-active) .next-expand-actions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
  max-width:620px!important;
}
body:not(.exercise-active) .next-expand-day{display:none!important;}

/* ---------- Calendar compact row guardrails ---------- */
body:not(.exercise-active) .next-calendar-row{overflow:hidden!important;}
body:not(.exercise-active) .next-calendar-row-head{min-width:0!important;}
body:not(.exercise-active) .next-calendar-copy{min-width:0!important;}
body:not(.exercise-active) .next-calendar-copy b,
body:not(.exercise-active) .next-calendar-copy small{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}

/* ---------- Pass overview: central hero/detail contract ---------- */
body:not(.exercise-active) .next-overview-root{display:grid!important;gap:var(--next-section-gap)!important;}
body:not(.exercise-active) .next-overview-hero{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:14px!important;
  padding:var(--next-card-pad)!important;
  overflow:hidden!important;
}
body:not(.exercise-active) .next-overview-hero .next-page-title{
  max-width:100%!important;
  margin:0!important;
  font-size:clamp(46px,8vw,74px)!important;
  line-height:.88!important;
  overflow-wrap:normal!important;
}
body:not(.exercise-active) .next-overview-hero .next-page-subtitle{
  max-width:62ch!important;
  margin:0!important;
  color:var(--next-muted)!important;
  font-size:clamp(17px,2.6vw,23px)!important;
  line-height:1.3!important;
}
body:not(.exercise-active) .next-overview-return-row{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  flex-wrap:wrap!important;
}
body:not(.exercise-active) .next-overview-return-row .next-button{width:auto!important;min-width:180px!important;}
body:not(.exercise-active) .next-equipment-panel{
  width:100%!important;
  padding:14px!important;
  border-radius:20px!important;
  background:rgba(4,14,28,.40)!important;
  box-shadow:none!important;
}
body:not(.exercise-active) .next-overview-layout{
  display:grid!important;
  gap:12px!important;
  width:100%!important;
  min-width:0!important;
}
body:not(.exercise-active) .next-overview-block-list{display:grid!important;gap:10px!important;}
body:not(.exercise-active) .next-overview-block>summary{min-width:0!important;}
body:not(.exercise-active) .next-overview-block summary b,
body:not(.exercise-active) .next-overview-block summary small{overflow:hidden!important;text-overflow:ellipsis!important;}
body:not(.exercise-active) .next-checklist-card{padding:var(--next-card-pad)!important;overflow:hidden!important;}
body:not(.exercise-active) .next-check-grid{display:grid!important;gap:10px!important;}
body:not(.exercise-active) .next-check-item{border:1px solid rgba(116,231,255,.14)!important;border-radius:16px!important;background:rgba(3,12,24,.34)!important;padding:12px!important;display:grid!important;gap:4px!important;}
body:not(.exercise-active) .next-check-item b{font-size:16px!important;}
body:not(.exercise-active) .next-check-item span{color:var(--next-muted)!important;line-height:1.35!important;}

/* ---------- Edit profile: central form surface ---------- */
body:not(.exercise-active) .next-profile-edit-page{display:grid!important;gap:var(--next-section-gap)!important;}
body:not(.exercise-active) .next-profile-edit-header{
  display:grid!important;
  gap:10px!important;
  max-width:100%!important;
}
body:not(.exercise-active) .next-inline-back{width:max-content!important;min-width:180px!important;}
body:not(.exercise-active) .next-edit-card{
  display:grid!important;
  gap:14px!important;
  padding:var(--next-card-pad)!important;
  overflow:hidden!important;
}
body:not(.exercise-active) .next-form-grid{display:grid!important;gap:14px!important;}
body:not(.exercise-active) .next-field{
  display:grid!important;
  gap:8px!important;
  min-width:0!important;
}
body:not(.exercise-active) .next-field>span{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  color:var(--next-muted)!important;
  font-weight:900!important;
}
body:not(.exercise-active) .next-input{
  width:100%!important;
  min-height:50px!important;
  border-radius:16px!important;
  border:1px solid rgba(116,231,255,.22)!important;
  background:rgba(3,12,24,.56)!important;
  color:var(--next-text)!important;
  padding:12px 14px!important;
  font:inherit!important;
  font-weight:850!important;
}
body:not(.exercise-active) .next-option-grid{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr))!important;
  gap:10px!important;
  min-width:0!important;
}
body:not(.exercise-active) .next-option-button{
  min-height:52px!important;
  border-radius:16px!important;
  border:1px solid rgba(116,231,255,.20)!important;
  background:rgba(4,14,28,.48)!important;
  color:var(--next-text)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  padding:12px 14px!important;
  font-weight:900!important;
  min-width:0!important;
}
body:not(.exercise-active) .next-option-button.selected{
  border-color:var(--next-card-border-strong)!important;
  color:var(--next-accent)!important;
  background:linear-gradient(180deg,rgba(104,234,255,.16),rgba(5,16,32,.52))!important;
}
body:not(.exercise-active) .next-option-button span{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;}
body:not(.exercise-active) .next-sticky-actions{
  position:sticky!important;
  bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;
  z-index:20!important;
  padding:10px!important;
  border-radius:22px!important;
  border:1px solid rgba(116,231,255,.18)!important;
  background:rgba(3,10,22,.88)!important;
  -webkit-backdrop-filter:blur(16px) saturate(125%)!important;
  backdrop-filter:blur(16px) saturate(125%)!important;
}

@media(max-width:760px){
  body:not(.exercise-active) .next-dashboard-grid,
  body:not(.exercise-active) .next-progress-summary,
  body:not(.exercise-active) .next-expand-actions,
  body:not(.exercise-active) .next-kpi-grid{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .next-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body:not(.exercise-active) .next-calendar-row-head{grid-template-columns:auto minmax(0,1fr) auto!important;}
  body:not(.exercise-active) .calendar-list-icon{display:none!important;}
  body:not(.exercise-active) .calendar-list-status{display:none!important;}
  body:not(.exercise-active) .next-calendar-copy b,
  body:not(.exercise-active) .next-calendar-copy small{white-space:normal!important;}
  body:not(.exercise-active) .next-overview-hero .next-page-title{font-size:clamp(44px,13vw,62px)!important;}
  body:not(.exercise-active) .next-overview-return-row .next-button,
  body:not(.exercise-active) .next-inline-back{width:100%!important;min-width:0!important;}
  body:not(.exercise-active) .next-action-row{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .next-option-grid{grid-template-columns:1fr!important;}
}


/* =========================================================
   Dashboard layout + overview/profile edit refinement
   Central system ownership only:
   - Dashboard hero/pass two-column top row
   - Progress/KPI meter grid restored
   - Overview width/centering normalized
   - Edit Profile program tail removed in markup; form rhythm guarded here
   ========================================================= */

body:not(.exercise-active) .next-dashboard-root{
  width:min(100%,var(--next-content-max,1040px))!important;
  margin-inline:auto!important;
  display:grid!important;
  gap:clamp(18px,3vw,30px)!important;
}
body:not(.exercise-active) .next-dashboard-hero-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(320px,.82fr)!important;
  gap:clamp(18px,4vw,36px)!important;
  align-items:end!important;
}
body:not(.exercise-active) .next-dashboard-hero-grid .next-dashboard-header{
  align-self:end!important;
  min-width:0!important;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
body:not(.exercise-active) .next-dashboard-header .next-page-title{
  max-width:9.8ch!important;
  margin-block:0!important;
  font-size:clamp(58px,7.3vw,96px)!important;
  line-height:.86!important;
}
body:not(.exercise-active) .next-dashboard-header .next-page-subtitle{
  max-width:34ch!important;
  margin-top:10px!important;
  font-size:clamp(16px,1.8vw,22px)!important;
  font-weight:850!important;
}
body:not(.exercise-active) .next-dashboard-pass-card{
  align-self:end!important;
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  gap:14px!important;
  min-height:0!important;
  padding:clamp(18px,2.8vw,26px)!important;
}
body:not(.exercise-active) .next-dashboard-pass-card h2{
  margin:4px 0 6px!important;
  font-size:clamp(24px,3.2vw,36px)!important;
  line-height:1!important;
  letter-spacing:-.04em!important;
}
body:not(.exercise-active) .next-dashboard-pass-card .next-card-content{
  display:grid!important;
  gap:10px!important;
  min-width:0!important;
}
body:not(.exercise-active) .next-dashboard-pass-card p{
  margin:0!important;
  max-width:38ch!important;
}
body:not(.exercise-active) .next-dashboard-pass-card .next-action-row{
  grid-template-columns:1fr 1fr!important;
  margin-top:4px!important;
}
body:not(.exercise-active) .next-dashboard-progress-card{
  display:grid!important;
  gap:18px!important;
  padding:clamp(20px,3vw,28px)!important;
  min-height:0!important;
}
body:not(.exercise-active) .next-progress-summary{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  align-items:center!important;
  gap:clamp(18px,3vw,28px)!important;
}
body:not(.exercise-active) .next-progress-copy{
  display:grid!important;
  gap:8px!important;
}
body:not(.exercise-active) .next-progress-copy h2{
  margin:0!important;
  font-size:clamp(32px,4.4vw,56px)!important;
  line-height:.98!important;
  letter-spacing:-.045em!important;
}
body:not(.exercise-active) .next-progress-ring{
  --ring:132px;
  width:var(--ring)!important;
  height:var(--ring)!important;
  min-width:var(--ring)!important;
  border-radius:999px!important;
  display:grid!important;
  place-items:center!important;
  background:
    radial-gradient(circle at 50% 50%,rgba(2,8,18,.96) 0 51%,transparent 52%),
    conic-gradient(var(--next-accent) calc(var(--p)*1%),rgba(5,30,58,.74) 0)!important;
  box-shadow:inset 0 0 0 12px rgba(0,22,46,.46),0 0 30px rgba(0,210,255,.10)!important;
}
body:not(.exercise-active) .next-progress-ring span{
  color:#fff!important;
  font-size:clamp(24px,3.2vw,34px)!important;
  font-weight:950!important;
}
body:not(.exercise-active) .next-kpi-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:10px!important;
}
body:not(.exercise-active) .next-kpi{
  min-height:78px!important;
  border:1px solid rgba(116,231,255,.18)!important;
  border-radius:18px!important;
  background:rgba(3,12,24,.38)!important;
  padding:12px!important;
  display:grid!important;
  align-items:center!important;
  gap:8px!important;
  color:var(--next-text)!important;
}
body:not(.exercise-active) .next-kpi-meter{
  grid-template-columns:auto minmax(0,1fr)!important;
}
body:not(.exercise-active) .next-mini-ring{
  --ring:54px;
  width:var(--ring)!important;
  height:var(--ring)!important;
  min-width:var(--ring)!important;
  border-radius:999px!important;
  display:grid!important;
  place-items:center!important;
  background:
    radial-gradient(circle at 50% 50%,rgba(2,8,18,.98) 0 54%,transparent 55%),
    conic-gradient(var(--next-accent) calc(var(--p)*1%),rgba(5,30,58,.75) 0)!important;
  box-shadow:inset 0 0 0 7px rgba(0,22,46,.52)!important;
}
body:not(.exercise-active) .next-mini-ring span{
  font-size:13px!important;
  font-weight:950!important;
  color:#fff!important;
}
body:not(.exercise-active) .next-kpi b{
  display:block!important;
  margin:0!important;
  color:#fff!important;
  font-size:clamp(22px,2.6vw,32px)!important;
  line-height:1!important;
  letter-spacing:-.035em!important;
}
body:not(.exercise-active) .next-kpi span{
  display:block!important;
  color:var(--next-muted)!important;
  text-transform:uppercase!important;
  letter-spacing:.08em!important;
  font-size:11px!important;
  font-weight:950!important;
}
body:not(.exercise-active) .next-kpi-button{
  grid-template-columns:auto minmax(0,1fr)!important;
  text-align:left!important;
  cursor:pointer!important;
}
body:not(.exercise-active) .next-kpi-icon{
  width:54px!important;
  height:54px!important;
  border-radius:999px!important;
  display:grid!important;
  place-items:center!important;
  border:1px solid rgba(116,231,255,.22)!important;
  color:var(--next-accent)!important;
  background:rgba(8,28,48,.55)!important;
}
body:not(.exercise-active) .next-kpi-icon svg{
  width:22px!important;
  height:22px!important;
}

/* Calendar-launched overview should align with the same content rail as dashboard/profile/program. */
body:not(.exercise-active) #overviewScreen .next-overview-root,
body:not(.exercise-active) #overviewScreen .next-overview-hero,
body:not(.exercise-active) #overviewScreen .next-overview-layout{
  width:min(100%,var(--next-content-max,1040px))!important;
  max-width:var(--next-content-max,1040px)!important;
  margin-inline:auto!important;
}
body:not(.exercise-active) #overviewScreen .next-overview-hero{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:14px!important;
}
body:not(.exercise-active) #overviewScreen .next-overview-hero .next-equipment-panel{
  max-width:100%!important;
}
body:not(.exercise-active) #overviewScreen .next-overview-layout{
  display:grid!important;
  gap:14px!important;
}
body:not(.exercise-active) #overviewScreen .next-checklist-card{
  overflow:hidden!important;
}

/* Edit profile: no program tail; keep form sections as equal-width cards. */
body:not(.exercise-active) .next-profile-edit-page{
  width:min(100%,var(--next-content-max,1040px))!important;
  margin-inline:auto!important;
}
body:not(.exercise-active) .next-profile-edit-page .next-edit-card{
  width:100%!important;
}
body:not(.exercise-active) .next-profile-edit-page .next-sticky-actions{
  width:100%!important;
}

/* Slightly tighter action button icons after SVG registry pass. */
body:not(.exercise-active) .next-button svg{
  margin-inline-end:2px!important;
}

@media(max-width:760px){
  body:not(.exercise-active) .next-dashboard-hero-grid{
    grid-template-columns:1fr!important;
    align-items:start!important;
  }
  body:not(.exercise-active) .next-dashboard-header .next-page-title{
    max-width:10ch!important;
    font-size:clamp(52px,15vw,72px)!important;
  }
  body:not(.exercise-active) .next-dashboard-pass-card{
    grid-template-columns:1fr!important;
  }
  body:not(.exercise-active) .next-dashboard-pass-card .next-action-row{
    grid-template-columns:1fr 1fr!important;
  }
  body:not(.exercise-active) .next-progress-summary{
    grid-template-columns:auto minmax(0,1fr)!important;
    gap:14px!important;
  }
  body:not(.exercise-active) .next-progress-ring{
    --ring:112px;
  }
  body:not(.exercise-active) .next-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body:not(.exercise-active) .next-kpi{
    min-height:74px!important;
  }
}
@media(max-width:430px){
  body:not(.exercise-active) .next-progress-summary{
    grid-template-columns:1fr!important;
  }
  body:not(.exercise-active) .next-dashboard-pass-card .next-action-row{
    grid-template-columns:1fr!important;
  }
  body:not(.exercise-active) .next-mini-ring{
    --ring:48px;
  }
}


/* =========================================================
   Overview header alignment + per-screen background ownership
   Fixes:
   - Overview heading should align like other page headers, not feel inset.
   - Calendar background uses the proper calendar artwork, without a wrong overlay.
   - Program and Overview now receive explicit screen-appropriate background imagery.
   - Background ownership remains centralized in next-system.css.
   ========================================================= */

/* Extend shell background ownership to overview and program screens. */
body:not(.exercise-active)[data-screen="programScreen"] .next-program-shell,
body:not(.exercise-active)[data-screen="overviewScreen"] .next-overview-shell{
  position:relative!important;
  isolation:isolate!important;
}
body:not(.exercise-active)[data-screen="programScreen"] .next-program-shell::before,
body:not(.exercise-active)[data-screen="overviewScreen"] .next-overview-shell::before{
  content:""!important;
  position:fixed!important;
  inset:0!important;
  z-index:-1!important;
  pointer-events:none!important;
  background-size:cover!important;
  background-position:center!important;
  background-repeat:no-repeat!important;
  filter:saturate(1.08) brightness(.86) contrast(1.05)!important;
}
body:not(.exercise-active)[data-screen="calendarScreen"] .next-calendar-shell::before{
  background-image:url('../img/calendar/calendar-bg-coach-tactics.png')!important;
  background-position:center right!important;
  opacity:.22!important;
  filter:saturate(1.04) brightness(.66) contrast(1.06)!important;
}
body:not(.exercise-active)[data-screen="programScreen"] .next-program-shell::before{
  background-image:url('../img/hero/hero-library.webp')!important;
  opacity:.18!important;
  background-position:center right!important;
}
body:not(.exercise-active)[data-screen="overviewScreen"] .next-overview-shell::before{
  background-image:url('../img/start/focused_player_in_icy_blue_arena.png')!important;
  opacity:.14!important;
  background-position:center right!important;
}

/* Overview hero should align like the other free page headers. */
body:not(.exercise-active) .next-overview-hero{
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  gap:16px!important;
}
body:not(.exercise-active) .next-overview-return-row{
  margin-bottom:0!important;
}
body:not(.exercise-active) .next-overview-hero .next-page-title{
  max-width:11ch!important;
}
body:not(.exercise-active) .next-overview-hero .next-page-subtitle{
  max-width:42ch!important;
}
body:not(.exercise-active) .next-overview-hero .next-equipment-panel{
  margin-top:4px!important;
}
body:not(.exercise-active) .next-overview-hero .next-action-row{
  width:min(100%,1040px)!important;
}

/* Make sure legacy hidden img rules don't visually fight the shell-owned backgrounds. */
body:not(.exercise-active) #calendarScreen > .calendar-screen-bg,
body:not(.exercise-active) #profileScreen > .profile-screen-bg,
body:not(.exercise-active) > .dashboard-viewport-bg-img{
  display:none!important;
  opacity:0!important;
}

/* =========================================================
   Exercise library video-status rebuild
   Central library surface; derived from existing DATA, no player refactor.
   ========================================================= */
body:not(.exercise-active) .next-library-root,
body:not(.exercise-active) .next-library-page{
  width:min(100%,var(--next-content-max,1040px))!important;
  margin-inline:auto!important;
}
body:not(.exercise-active) .next-library-page{
  display:grid!important;
  gap:clamp(16px,3vw,26px)!important;
}
body:not(.exercise-active) .next-library-header{
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
body:not(.exercise-active) .next-library-stats{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:10px!important;
  padding:16px!important;
}
body:not(.exercise-active) .next-library-stats>div{
  min-height:74px!important;
  border:1px solid rgba(116,231,255,.14)!important;
  border-radius:18px!important;
  background:rgba(3,12,24,.38)!important;
  display:grid!important;
  align-content:center!important;
  gap:4px!important;
  padding:12px!important;
}
body:not(.exercise-active) .next-library-stats b{
  font-size:clamp(24px,3.2vw,38px)!important;
  line-height:1!important;
  color:#fff!important;
}
body:not(.exercise-active) .next-library-stats span{
  color:var(--next-muted)!important;
  font-size:11px!important;
  font-weight:950!important;
  text-transform:uppercase!important;
  letter-spacing:.09em!important;
}
body:not(.exercise-active) .next-library-controls{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(150px,.35fr) minmax(150px,.35fr)!important;
  gap:10px!important;
  padding:14px!important;
}
body:not(.exercise-active) .next-library-grid{
  display:grid!important;
  gap:12px!important;
}
body:not(.exercise-active) .next-library-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:14px!important;
  padding:16px!important;
  cursor:pointer!important;
}
body:not(.exercise-active) .next-library-row.is-active{
  border-color:rgba(116,231,255,.46)!important;
  box-shadow:0 0 0 1px rgba(116,231,255,.18),var(--next-shadow-card)!important;
}
body:not(.exercise-active) .next-library-row-main{
  display:grid!important;
  gap:8px!important;
  min-width:0!important;
}
body:not(.exercise-active) .next-library-row-top,
body:not(.exercise-active) .next-library-title-row{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:12px!important;
}
body:not(.exercise-active) .next-library-row b{
  color:var(--next-text)!important;
  font-size:clamp(18px,2.2vw,24px)!important;
  line-height:1.05!important;
}
body:not(.exercise-active) .next-library-row p{
  margin:0!important;
  color:var(--next-muted)!important;
  line-height:1.35!important;
}
body:not(.exercise-active) .next-video-status{
  border-radius:999px!important;
  border:1px solid rgba(116,231,255,.20)!important;
  padding:7px 10px!important;
  font-size:11px!important;
  font-weight:950!important;
  text-transform:uppercase!important;
  letter-spacing:.08em!important;
  white-space:nowrap!important;
}
body:not(.exercise-active) .next-video-status-server{color:#a7ffce!important;background:rgba(0,180,110,.12)!important;border-color:rgba(80,255,180,.30)!important;}
body:not(.exercise-active) .next-video-status-youtube{color:#ffb2b2!important;background:rgba(255,50,50,.12)!important;border-color:rgba(255,120,120,.26)!important;}
body:not(.exercise-active) .next-video-status-ota{color:#ffe6a3!important;background:rgba(255,190,70,.12)!important;border-color:rgba(255,220,120,.28)!important;}
body:not(.exercise-active) .next-video-status-timer{color:#b9d9ff!important;background:rgba(80,150,255,.12)!important;border-color:rgba(120,180,255,.26)!important;}
body:not(.exercise-active) .next-video-status-missing,
body:not(.exercise-active) .next-video-status-unknown{color:#ffd2d2!important;background:rgba(255,80,80,.10)!important;border-color:rgba(255,120,120,.22)!important;}
body:not(.exercise-active) .next-library-detail{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  gap:18px!important;
  padding:18px!important;
}
body:not(.exercise-active) .next-library-video{
  min-height:240px!important;
  aspect-ratio:16/9!important;
  border-radius:22px!important;
  overflow:hidden!important;
  background:radial-gradient(circle at 50% 20%,rgba(116,231,255,.14),rgba(2,8,18,.96) 60%)!important;
  border:1px solid rgba(116,231,255,.18)!important;
}
body:not(.exercise-active) .next-library-video iframe,
body:not(.exercise-active) .next-library-video video{
  width:100%!important;
  height:100%!important;
  border:0!important;
  display:block!important;
  object-fit:cover!important;
}
body:not(.exercise-active) .next-library-video-missing{
  min-height:100%!important;
  display:grid!important;
  place-items:center!important;
  align-content:center!important;
  gap:10px!important;
  padding:22px!important;
  text-align:center!important;
  color:var(--next-text)!important;
}
body:not(.exercise-active) .next-library-video-missing span{font-size:44px!important;}
body:not(.exercise-active) .next-library-video-missing p{max-width:34ch!important;margin:0!important;color:var(--next-muted)!important;}
body:not(.exercise-active) .next-library-copy{
  display:grid!important;
  gap:14px!important;
  min-width:0!important;
}
body:not(.exercise-active) .next-library-copy h2{
  margin:0!important;
  color:#fff!important;
  font-size:clamp(34px,5vw,58px)!important;
  line-height:.94!important;
  letter-spacing:-.055em!important;
}
body:not(.exercise-active) .next-library-copy p{
  margin:0!important;
  color:var(--next-muted)!important;
  line-height:1.38!important;
}
body:not(.exercise-active) .next-library-facts{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}
body:not(.exercise-active) .next-library-facts span,
body:not(.exercise-active) .next-library-dose-grid article{
  display:grid!important;
  gap:5px!important;
  border:1px solid rgba(116,231,255,.14)!important;
  border-radius:16px!important;
  padding:12px!important;
  background:rgba(3,12,24,.38)!important;
  color:var(--next-muted)!important;
}
body:not(.exercise-active) .next-library-facts b,
body:not(.exercise-active) .next-library-dose-grid b{
  color:var(--next-text)!important;
}
body:not(.exercise-active) .next-library-dose-grid{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:10px!important;
}
body:not(.exercise-active) .next-library-dose-grid ul{margin:0!important;padding-left:18px!important;}
body:not(.exercise-active) .next-library-empty{padding:18px!important;color:var(--next-muted)!important;}
body:not(.exercise-active) .next-chip-server{color:#a7ffce!important;border-color:rgba(80,255,180,.30)!important;background:rgba(0,180,110,.12)!important;}
@media(max-width:820px){
  body:not(.exercise-active) .next-library-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body:not(.exercise-active) .next-library-controls{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .next-library-detail{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .next-library-facts,
  body:not(.exercise-active) .next-library-dose-grid{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .next-library-row{grid-template-columns:1fr!important;}
}


/* exercise library menu + server-first video skeleton */
body:not(.exercise-active) .app-tab[data-target="qaScreen"] .tab-icon{color:var(--next-accent)!important;}
.next-server-video{width:100%!important;height:100%!important;min-height:220px!important;object-fit:cover!important;background:#050a12!important;border:0!important;display:block!important;}
.next-library-video .next-server-video{aspect-ratio:16/9!important;height:auto!important;border-radius:20px!important;overflow:hidden!important;}

/* server backup import + projector-safe video fallback */
body:not(.exercise-active) .next-library-backup-panel{
  display:grid!important;
  gap:12px!important;
  margin:14px 0 4px!important;
  padding:14px!important;
  border:1px solid rgba(255,255,255,.14)!important;
  border-radius:18px!important;
  background:linear-gradient(135deg,rgba(255,255,255,.08),rgba(255,255,255,.035))!important;
}
body:not(.exercise-active) .next-library-backup-panel.has-backup{
  border-color:rgba(90,255,178,.28)!important;
  background:linear-gradient(135deg,rgba(30,210,130,.14),rgba(255,255,255,.04))!important;
}
body:not(.exercise-active) .backup-kicker{
  color:#a7ffce!important;
  font-size:12px!important;
  font-weight:950!important;
  letter-spacing:.08em!important;
  text-transform:uppercase!important;
}
body:not(.exercise-active) .backup-title-block h3{
  margin:3px 0!important;
  font-size:20px!important;
}
body:not(.exercise-active) .backup-title-block small,
body:not(.exercise-active) .backup-note{
  color:var(--next-muted)!important;
}
body:not(.exercise-active) .backup-title-block code{
  color:#fff!important;
  background:rgba(0,0,0,.25)!important;
  padding:2px 6px!important;
  border-radius:8px!important;
}
body:not(.exercise-active) .backup-status-line,
body:not(.exercise-active) .backup-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  align-items:center!important;
}
body:not(.exercise-active) .backup-status-line span{
  padding:7px 10px!important;
  border:1px solid rgba(255,255,255,.12)!important;
  border-radius:999px!important;
  background:rgba(0,0,0,.16)!important;
  color:rgba(255,255,255,.86)!important;
  font-size:12px!important;
}
body:not(.exercise-active) .next-library-backup-preview{
  border-color:rgba(90,255,178,.24)!important;
}
.next-server-video.next-local-backup-video{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  border-radius:20px!important;
  background:#020617!important;
}
.server-backup-badge{
  position:absolute!important;
  left:14px!important;
  bottom:14px!important;
  z-index:4!important;
  padding:8px 11px!important;
  border-radius:999px!important;
  border:1px solid rgba(90,255,178,.28)!important;
  background:rgba(2,6,23,.74)!important;
  color:#d9ffe9!important;
  font-size:12px!important;
  font-weight:900!important;
  backdrop-filter:blur(10px)!important;
}
body.exercise-active #videoWrap .exercise-visual-fallback{
  min-height:100%!important;
  grid-template-columns:minmax(110px,0.68fr) minmax(0,1fr)!important;
  gap:18px!important;
  align-items:center!important;
  text-align:left!important;
  padding:22px!important;
  overflow:hidden!important;
  background:radial-gradient(circle at 18% 25%,rgba(255,112,67,.22),transparent 32%),radial-gradient(circle at 78% 18%,rgba(59,130,246,.20),transparent 30%),linear-gradient(135deg,rgba(15,23,42,.96),rgba(2,6,23,.92))!important;
}
body.exercise-active #videoWrap .exercise-visual-art{
  position:relative!important;
  width:100%!important;
  aspect-ratio:1!important;
  display:grid!important;
  place-items:center!important;
}
body.exercise-active #videoWrap .exercise-visual-art span,
body.exercise-active #videoWrap .exercise-visual-art i,
body.exercise-active #videoWrap .exercise-visual-art b{
  position:absolute!important;
  display:block!important;
  border-radius:999px!important;
  border:2px solid rgba(255,255,255,.28)!important;
  box-shadow:0 0 36px rgba(59,130,246,.18)!important;
}
body.exercise-active #videoWrap .exercise-visual-art span{inset:10%!important;animation:nextPulseRing 2.4s ease-in-out infinite!important;}
body.exercise-active #videoWrap .exercise-visual-art i{inset:25%!important;border-color:rgba(255,112,67,.46)!important;animation:nextPulseRing 1.6s ease-in-out infinite reverse!important;}
body.exercise-active #videoWrap .exercise-visual-art b{width:30%!important;height:30%!important;background:linear-gradient(135deg,#ff7043,#60a5fa)!important;border:0!important;animation:nextBounceDot 1.05s ease-in-out infinite!important;}
body.exercise-active #videoWrap .fallback-kicker{
  display:inline-flex!important;
  width:auto!important;
  margin-bottom:8px!important;
  padding:6px 9px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.10)!important;
  color:#a7ffce!important;
  font-size:12px!important;
  font-weight:950!important;
  letter-spacing:.06em!important;
  text-transform:uppercase!important;
}
body.exercise-active #videoWrap .exercise-visual-copy h2{font-size:clamp(24px,4vw,44px)!important;line-height:1.02!important;margin:0 0 8px!important;color:#fff!important;}
body.exercise-active #videoWrap .exercise-visual-copy p{margin:0 0 10px!important;color:rgba(255,255,255,.78)!important;max-width:54ch!important;}
body.exercise-active #videoWrap .fallback-reps{font-weight:950!important;color:#fff!important;}
body.exercise-active #videoWrap .exercise-visual-copy ul{display:grid!important;gap:6px!important;margin:10px 0 0!important;padding-left:19px!important;color:rgba(255,255,255,.88)!important;}
body.projector-no-youtube #projectorNoYoutubeBtn{border-color:rgba(90,255,178,.38)!important;}
@keyframes nextPulseRing{0%,100%{transform:scale(.94);opacity:.62}50%{transform:scale(1.04);opacity:1}}
@keyframes nextBounceDot{0%,100%{transform:translateY(18%)}50%{transform:translateY(-18%)}}
@media(max-width:720px){
  body.exercise-active #videoWrap .exercise-visual-fallback{grid-template-columns:1fr!important;text-align:center!important;place-items:center!important;}
  body.exercise-active #videoWrap .exercise-visual-art{max-width:180px!important;}
  body.exercise-active #videoWrap .exercise-visual-copy ul{text-align:left!important;}
}

/* real server video backup upload feedback */
body:not(.exercise-active) .next-video-status-local_backup{color:#d8ccff!important;background:rgba(130,100,255,.13)!important;border-color:rgba(170,145,255,.30)!important;}
body:not(.exercise-active) .next-library-backup-panel.has-local-backup{
  border-color:rgba(170,145,255,.26)!important;
  background:linear-gradient(135deg,rgba(120,90,255,.13),rgba(255,255,255,.04))!important;
}
body:not(.exercise-active) .backup-upload-status{
  display:grid!important;
  gap:8px!important;
  padding:10px!important;
  border:1px solid rgba(255,255,255,.12)!important;
  border-radius:14px!important;
  background:rgba(0,0,0,.16)!important;
  color:rgba(255,255,255,.80)!important;
}
body:not(.exercise-active) .backup-upload-status-text{
  font-size:12px!important;
  line-height:1.35!important;
  font-weight:850!important;
}
body:not(.exercise-active) .backup-progress-track{
  width:100%!important;
  height:8px!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.10)!important;
  overflow:hidden!important;
}
body:not(.exercise-active) .backup-progress-bar{
  width:0%;
  height:100%!important;
  border-radius:999px!important;
  background:linear-gradient(90deg,#74e7ff,#a7ffce)!important;
  transition:width .18s ease!important;
}
body:not(.exercise-active) .backup-upload-status.is-success{
  border-color:rgba(90,255,178,.36)!important;
  background:rgba(30,210,130,.12)!important;
  color:#d9ffe9!important;
}
body:not(.exercise-active) .backup-upload-status.is-error{
  border-color:rgba(255,120,120,.36)!important;
  background:rgba(255,80,80,.12)!important;
  color:#ffe2e2!important;
}
body:not(.exercise-active) .backup-upload-status.is-cancelled{
  border-color:rgba(255,255,255,.18)!important;
  background:rgba(255,255,255,.06)!important;
  color:rgba(255,255,255,.70)!important;
}
body:not(.exercise-active) .backup-upload-status.is-uploading .backup-progress-bar{
  min-width:3%!important;
}

/* master exercise catalog / alias cleanup */
body:not(.exercise-active) .next-library-alias-box{
  display:grid!important;
  gap:6px!important;
  border:1px dashed rgba(116,231,255,.22)!important;
  border-radius:16px!important;
  padding:12px!important;
  background:rgba(116,231,255,.06)!important;
}
body:not(.exercise-active) .next-library-alias-box b{color:var(--next-text)!important;}
body:not(.exercise-active) .next-library-alias-box p{font-size:13px!important;line-height:1.35!important;color:var(--next-muted)!important;}
body:not(.exercise-active) .next-library-pass-uses span{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:6px!important;
  align-items:center!important;
  padding:7px 0!important;
  border-bottom:1px solid rgba(255,255,255,.07)!important;
}
body:not(.exercise-active) .next-library-pass-uses span:last-child{border-bottom:0!important;}
body:not(.exercise-active) .next-library-pass-uses em{font-style:normal!important;color:var(--next-muted)!important;font-size:12px!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
body:not(.exercise-active) .next-library-pass-uses strong{color:var(--next-text)!important;font-size:12px!important;white-space:nowrap!important;}
body:not(.exercise-active) .next-library-pass-uses small{color:var(--next-muted)!important;margin-top:4px!important;}
@media(max-width:560px){
  body:not(.exercise-active) .next-library-pass-uses span{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .next-library-pass-uses strong{white-space:normal!important;}
}

/* Exercise library inline detail + full illustration coverage */
body:not(.exercise-active) .next-library-grid{
  gap:14px!important;
}
body:not(.exercise-active) .next-library-row{
  grid-template-columns:auto minmax(0,1fr) auto!important;
  align-items:center!important;
  cursor:pointer!important;
}
body:not(.exercise-active) .next-library-row.is-active{
  border-color:rgba(66,153,225,.55)!important;
  box-shadow:0 0 0 1px rgba(66,153,225,.22),0 18px 36px rgba(15,23,42,.16)!important;
}
body:not(.exercise-active) .next-library-thumb{
  width:108px!important;
  min-width:108px!important;
  border-radius:18px!important;
  overflow:hidden!important;
  background:rgba(255,255,255,.76)!important;
  box-shadow:inset 0 0 0 1px rgba(148,163,184,.22)!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-illustration{
  margin:0!important;
  padding:0!important;
  box-shadow:none!important;
  border:0!important;
  background:transparent!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-illustration-stage{
  aspect-ratio:4/3!important;
  min-height:0!important;
  border-radius:18px!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-illustration-meta{display:none!important;}
body:not(.exercise-active) .next-library-detail-inline{
  display:grid!important;
  grid-template-columns:minmax(320px,.95fr) minmax(0,1.05fr)!important;
  gap:18px!important;
  padding:18px!important;
  margin-top:-4px!important;
  border-color:rgba(66,153,225,.32)!important;
  background:linear-gradient(180deg,rgba(248,251,255,.96),rgba(240,246,255,.92))!important;
}
body:not(.exercise-active) .next-library-detail-inline .next-library-video{
  min-height:300px!important;
}
body:not(.exercise-active) .next-library-video iframe.next-library-ota-frame{
  background:#fff!important;
}
.next-exercise-illustration{
  width:100%!important;
  border-radius:22px!important;
  overflow:hidden!important;
  border:1px solid rgba(148,163,184,.24)!important;
  background:rgba(255,255,255,.88)!important;
  box-shadow:0 16px 36px rgba(15,23,42,.12)!important;
}
.next-exercise-illustration-stage{
  position:relative!important;
  width:100%!important;
  aspect-ratio:4/3!important;
  min-height:220px!important;
  overflow:hidden!important;
  background:#f6f9fd!important;
}
.next-exercise-visual-figure,
.next-exercise-visual-figure{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
}
.next-exercise-illustration-layered{
  width:100%!important;
  height:100%!important;
  background-image:var(--exercise-bg)!important;
  background-size:cover!important;
  background-position:center!important;
}
.next-exercise-illustration-layered .next-exercise-visual-figure{
  object-fit:contain!important;
  padding:3%!important;
}
.next-exercise-illustration-meta{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  padding:10px 12px!important;
  background:rgba(255,255,255,.92)!important;
}
.next-exercise-illustration-meta b{
  display:block!important;
  font-size:13px!important;
  color:var(--next-text)!important;
}
.next-exercise-illustration-meta span{
  display:block!important;
  font-size:12px!important;
  color:var(--next-muted)!important;
}
.next-theme-pill-row{
  display:flex!important;
  gap:6px!important;
  flex-wrap:wrap!important;
  justify-content:flex-end!important;
}
.next-theme-pill{
  border:1px solid rgba(66,153,225,.28)!important;
  background:rgba(255,255,255,.78)!important;
  color:var(--next-text)!important;
  border-radius:999px!important;
  padding:7px 10px!important;
  font-weight:800!important;
  font-size:12px!important;
  cursor:pointer!important;
}
.next-theme-pill.is-active{
  background:linear-gradient(135deg,#2f80ed,#16a3c7)!important;
  color:white!important;
  border-color:transparent!important;
}
body:not(.exercise-active) .next-library-illustration-wrap{
  margin:12px 0!important;
}
.exercise-visual-fallback.has-exercise-illustration{
  display:grid!important;
  grid-template-columns:minmax(0,1.2fr) minmax(260px,.8fr)!important;
  gap:18px!important;
  align-items:center!important;
  padding:18px!important;
}
.exercise-visual-fallback.has-exercise-illustration .exercise-visual-media{
  min-width:0!important;
}
.exercise-visual-fallback.has-exercise-illustration .next-exercise-illustration{
  box-shadow:0 18px 42px rgba(0,0,0,.18)!important;
}
.exercise-visual-fallback.has-exercise-illustration .next-exercise-illustration-meta{display:none!important;}
.exercise-visual-fallback.has-exercise-illustration .exercise-visual-copy{
  text-align:left!important;
}
@media (max-width:760px){
  body:not(.exercise-active) .next-library-row{
    grid-template-columns:88px minmax(0,1fr)!important;
  }
  body:not(.exercise-active) .next-library-row>.next-button{
    grid-column:1 / -1!important;
    width:100%!important;
  }
  body:not(.exercise-active) .next-library-thumb{
    width:88px!important;
    min-width:88px!important;
  }
  body:not(.exercise-active) .next-library-detail-inline{
    grid-template-columns:1fr!important;
    padding:14px!important;
  }
  body:not(.exercise-active) .next-library-detail-inline .next-library-video{
    min-height:220px!important;
  }
  .next-exercise-illustration-meta{
    align-items:flex-start!important;
    flex-direction:column!important;
  }
  .next-theme-pill-row{justify-content:flex-start!important;}
  .exercise-visual-fallback.has-exercise-illustration{
    grid-template-columns:1fr!important;
  }
}


/* full illustration coverage */
body:not(.exercise-active) .next-library-row .next-chip-server{white-space:nowrap;}
.next-exercise-illustration[data-exercise-illustration] .next-exercise-illustration-stage{background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(230,242,255,.78));}
.next-exercise-illustration-layered{min-height:clamp(150px,24vw,280px);}
.next-library-thumb .next-exercise-illustration-layered{min-height:92px;}

/* v97 layered exercise visual standard */
.next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-illustration-stage{
  aspect-ratio:16/9!important;
  min-height:clamp(180px,28vw,360px)!important;
  background:#fbfdff!important;
}
.next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-visual-figure{
  object-fit:contain!important;
  background:#fbfdff!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-illustration-stage{
  aspect-ratio:4/3!important;
  min-height:92px!important;
}



/* =========================================================
   Exercise library + theme architecture cleanup
   Centralized cleanup after standard. Reuses existing next-card,
   next-button, next-chip, illustration renderer and stable theme assets.
   ========================================================= */
:root{
  --next-library-detail-gap:clamp(12px,2.3vw,18px);
  --next-library-card-pad:clamp(12px,2.4vw,18px);
  --next-visual-radius:20px;
}
body:not(.exercise-active) .next-page-header .next-page-title,
body:not(.exercise-active) .next-library-title-row h2{
  font-size:clamp(28px,7.2vw,52px)!important;
  line-height:.98!important;
  letter-spacing:-.045em!important;
  overflow-wrap:anywhere!important;
}
body:not(.exercise-active) .next-page-header .next-page-subtitle,
body:not(.exercise-active) .next-library-copy p{
  font-size:clamp(14px,3.4vw,17px)!important;
  line-height:1.35!important;
}
body:not(.exercise-active) .next-library-grid{gap:12px!important;}
body:not(.exercise-active) .next-library-row{
  display:grid!important;
  grid-template-columns:70px minmax(0,1fr) auto!important;
  gap:10px!important;
  align-items:center!important;
  min-height:unset!important;
  padding:10px 12px!important;
  overflow:hidden!important;
}
body:not(.exercise-active) .next-library-row-main{min-width:0!important;display:grid!important;gap:4px!important;}
body:not(.exercise-active) .next-library-row-top{display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important;}
body:not(.exercise-active) .next-library-row-top b{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
body:not(.exercise-active) .next-library-row p{font-size:13px!important;line-height:1.25!important;max-height:2.5em!important;overflow:hidden!important;}
body:not(.exercise-active) .next-library-thumb{
  width:60px!important;min-width:60px!important;height:48px!important;border-radius:12px!important;
  background:rgba(255,255,255,.68)!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-illustration-stage{aspect-ratio:5/4!important;min-height:0!important;height:48px!important;border-radius:12px!important;}
body:not(.exercise-active) .next-library-row>.next-button{min-height:34px!important;padding:7px 10px!important;font-size:12px!important;border-radius:999px!important;}
body:not(.exercise-active) .next-library-detail,
body:not(.exercise-active) .next-library-detail-inline{
  display:grid!important;
  grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr)!important;
  gap:var(--next-library-detail-gap)!important;
  padding:var(--next-library-card-pad)!important;
  margin-top:2px!important;
  overflow:hidden!important;
  align-items:start!important;
}
body:not(.exercise-active) .next-library-video{
  min-height:0!important;
  aspect-ratio:16/9!important;
  border-radius:var(--next-visual-radius)!important;
  background:rgba(7,18,34,.72)!important;
  border:1px solid rgba(116,231,255,.18)!important;
}
body:not(.exercise-active) .next-library-video iframe,
body:not(.exercise-active) .next-library-video video{object-fit:cover!important;background:#050a12!important;}
body:not(.exercise-active) .next-library-video-missing{padding:14px!important;gap:8px!important;min-height:100%!important;}
body:not(.exercise-active) .next-library-video-missing span{font-size:34px!important;}
body:not(.exercise-active) .next-library-video-missing .next-button{width:auto!important;min-height:34px!important;padding:7px 10px!important;font-size:12px!important;}
body:not(.exercise-active) .next-library-copy{gap:10px!important;}
body:not(.exercise-active) .next-library-title-row{display:flex!important;align-items:start!important;gap:10px!important;justify-content:space-between!important;min-width:0!important;}
body:not(.exercise-active) .next-chip-row{gap:6px!important;}
body:not(.exercise-active) .next-chip,
body:not(.exercise-active) .next-video-status{
  min-height:30px!important;
  padding:6px 9px!important;
  font-size:11px!important;
  line-height:1!important;
  border-radius:999px!important;
}
body:not(.exercise-active) .next-library-illustration-wrap{margin:0!important;}
.next-exercise-illustration{
  position:relative!important;
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  border-radius:20px!important;
  overflow:hidden!important;
  background:rgba(255,255,255,.92)!important;
  border:1px solid rgba(190,213,239,.9)!important;
  box-shadow:0 12px 28px rgba(15,23,42,.10)!important;
  z-index:0!important;
}
.next-exercise-illustration-stage{
  position:relative!important;
  display:block!important;
  width:100%!important;
  aspect-ratio:16/9!important;
  min-height:0!important;
  height:auto!important;
  overflow:hidden!important;
  border-radius:18px 18px 0 0!important;
  background:#f7fbff!important;
  isolation:isolate!important;
}
.next-exercise-illustration-stage::before,.next-exercise-illustration-stage::after{content:none!important;display:none!important;}
.next-exercise-visual-figure, .next-exercise-visual-figure,.next-exercise-visual-figure{
  display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;object-position:center!important;margin:0!important;padding:0!important;background:transparent!important;filter:none!important;
}
.next-exercise-visual-stage{position:relative!important;width:100%!important;height:100%!important;aspect-ratio:16/9!important;background-image:var(--next-exercise-bg)!important;background-size:cover!important;background-position:center!important;overflow:hidden!important;}
.next-exercise-visual-stage .next-exercise-visual-figure{position:absolute!important;inset:0!important;object-fit:contain!important;padding:3%!important;}
.next-exercise-illustration-meta{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;padding:9px 11px!important;background:rgba(255,255,255,.94)!important;color:#607185!important;}
.next-exercise-illustration-meta b{display:block!important;font-size:11px!important;line-height:1.1!important;color:#8fa4bb!important;}
.next-exercise-illustration-meta span{display:block!important;font-size:11px!important;color:#9eb0c6!important;}
.next-theme-pill-row{display:flex!important;gap:6px!important;flex-wrap:wrap!important;justify-content:flex-end!important;}
.next-theme-pill{min-height:30px!important;border-radius:999px!important;padding:6px 10px!important;font-size:11px!important;font-weight:900!important;}
body:not(.exercise-active) .next-library-backup-panel{margin:0!important;padding:12px!important;gap:8px!important;border-radius:16px!important;}
body:not(.exercise-active) .backup-actions{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;}
body:not(.exercise-active) .backup-actions .next-button{width:100%!important;min-height:40px!important;}
body:not(.exercise-active) .next-library-facts{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
body:not(.exercise-active) .next-library-facts span,
body:not(.exercise-active) .next-library-dose-grid article{padding:10px!important;border-radius:14px!important;}
body:not(.exercise-active) .next-library-dose-grid{grid-template-columns:1fr!important;gap:8px!important;}
@media(max-width:760px){
  body:not(.exercise-active) .next-library-row{grid-template-columns:54px minmax(0,1fr) auto!important;padding:9px 10px!important;}
  body:not(.exercise-active) .next-library-thumb{width:48px!important;min-width:48px!important;height:44px!important;}
  body:not(.exercise-active) .next-library-thumb .next-exercise-illustration-stage{height:44px!important;border-radius:10px!important;}
  body:not(.exercise-active) .next-library-row>.next-button{grid-column:auto!important;width:auto!important;min-width:54px!important;}
  body:not(.exercise-active) .next-library-row .next-chip-row{display:none!important;}
  body:not(.exercise-active) .next-library-detail,
  body:not(.exercise-active) .next-library-detail-inline{grid-template-columns:1fr!important;padding:12px!important;gap:12px!important;}
  body:not(.exercise-active) .next-library-copy{gap:9px!important;}
  body:not(.exercise-active) .next-library-title-row h2{font-size:clamp(26px,8vw,36px)!important;}
  .next-exercise-illustration-meta{align-items:flex-start!important;flex-direction:column!important;}
  .next-theme-pill-row{justify-content:flex-start!important;}
  body:not(.exercise-active) .next-library-facts{grid-template-columns:1fr!important;}
}

/* =========================================================
   Exercise library expanded component + asset cleanup
   This block targets the actual renderer markup from library-renderer.js.
   It intentionally reuses existing next-card/next-button/next-chip and
   NEXTExerciseIllustrationService classes; no parallel visual system.
   ========================================================= */
body:not(.exercise-active) .next-library-page{
  gap:14px!important;
}
body:not(.exercise-active) .next-library-header .next-page-title{
  font-size:clamp(30px,7vw,50px)!important;
  line-height:1!important;
  letter-spacing:-.045em!important;
}
body:not(.exercise-active) .next-library-stats{
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:8px!important;
  padding:12px!important;
}
body:not(.exercise-active) .next-library-stats>div{
  min-height:54px!important;
  padding:9px 10px!important;
  border-radius:14px!important;
}
body:not(.exercise-active) .next-library-stats b{
  font-size:clamp(20px,2.4vw,30px)!important;
}
body:not(.exercise-active) .next-library-stats span{
  font-size:10px!important;
}
body:not(.exercise-active) .next-library-controls{
  padding:10px!important;
  gap:8px!important;
}
body:not(.exercise-active) .next-library-grid{
  gap:10px!important;
}
body:not(.exercise-active) .next-library-row{
  display:grid!important;
  grid-template-columns:56px minmax(0,1fr) auto!important;
  gap:9px!important;
  align-items:center!important;
  min-height:0!important;
  padding:9px 10px!important;
  overflow:hidden!important;
  border-radius:18px!important;
}
body:not(.exercise-active) .next-library-row .next-chip-row{
  gap:5px!important;
}
body:not(.exercise-active) .next-library-row-main{
  min-width:0!important;
  gap:3px!important;
}
body:not(.exercise-active) .next-library-row-top{
  min-width:0!important;
  align-items:center!important;
}
body:not(.exercise-active) .next-library-row-top b{
  min-width:0!important;
  font-size:clamp(15px,2.5vw,18px)!important;
  line-height:1.05!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body:not(.exercise-active) .next-library-row p{
  font-size:12px!important;
  line-height:1.2!important;
  max-height:2.4em!important;
  overflow:hidden!important;
}
body:not(.exercise-active) .next-library-thumb,
body:not(.exercise-active) .next-library-thumb-placeholder{
  width:50px!important;
  min-width:50px!important;
  height:42px!important;
  border-radius:11px!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  background:rgba(255,255,255,.82)!important;
  color:#475569!important;
  font-size:10px!important;
  font-weight:1000!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-illustration{
  border:0!important;
  box-shadow:none!important;
  border-radius:0!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-illustration-stage{
  height:42px!important;
  aspect-ratio:5/4!important;
  min-height:0!important;
  border-radius:0!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-illustration-meta{
  display:none!important;
}
body:not(.exercise-active) .next-library-row-action{
  min-height:32px!important;
  min-width:52px!important;
  padding:6px 9px!important;
  font-size:12px!important;
  border-radius:999px!important;
}
body:not(.exercise-active) .next-library-detail-inline{
  display:grid!important;
  grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr)!important;
  gap:12px!important;
  padding:12px!important;
  margin:0!important;
  overflow:hidden!important;
  border-radius:22px!important;
  align-items:start!important;
}
body:not(.exercise-active) .next-library-media-panel,
body:not(.exercise-active) .next-library-copy-panel{
  min-width:0!important;
  display:grid!important;
  gap:10px!important;
}
body:not(.exercise-active) .next-library-visual-panel,
body:not(.exercise-active) .next-library-video-panel{
  min-width:0!important;
  margin:0!important;
}
body:not(.exercise-active) .next-library-video{
  width:100%!important;
  min-height:0!important;
  aspect-ratio:16/9!important;
  border-radius:18px!important;
  overflow:hidden!important;
  background:#071120!important;
  border:1px solid rgba(116,231,255,.16)!important;
}
body:not(.exercise-active) .next-library-video iframe,
body:not(.exercise-active) .next-library-video video,
body:not(.exercise-active) .next-library-video .next-library-ota-frame{
  width:100%!important;
  height:100%!important;
  border:0!important;
  display:block!important;
  object-fit:cover!important;
  background:#050a12!important;
}
body:not(.exercise-active) .next-library-video-missing{
  min-height:100%!important;
  padding:12px!important;
  gap:7px!important;
  display:grid!important;
  place-items:center!important;
  align-content:center!important;
  text-align:center!important;
}
body:not(.exercise-active) .next-library-video-missing span{
  font-size:28px!important;
}
body:not(.exercise-active) .next-library-video-missing b{
  font-size:14px!important;
}
body:not(.exercise-active) .next-library-video-missing p{
  font-size:12px!important;
  line-height:1.25!important;
}
body:not(.exercise-active) .next-library-copy-panel .next-library-title-row{
  align-items:flex-start!important;
  gap:8px!important;
}
body:not(.exercise-active) .next-library-copy-panel .next-library-title-row h2{
  font-size:clamp(24px,4.2vw,38px)!important;
  line-height:1!important;
  letter-spacing:-.04em!important;
  margin:0!important;
}
body:not(.exercise-active) .next-library-detail-intro{
  font-size:13px!important;
  line-height:1.3!important;
}
body:not(.exercise-active) .next-library-detail-chips{
  gap:6px!important;
}
body:not(.exercise-active) .next-chip,
body:not(.exercise-active) .next-video-status{
  min-height:28px!important;
  padding:6px 9px!important;
  font-size:10.5px!important;
  line-height:1!important;
}
body:not(.exercise-active) .next-exercise-illustration{
  border-radius:18px!important;
  overflow:hidden!important;
  margin:0!important;
  background:#f8fbff!important;
  border:1px solid rgba(190,213,239,.86)!important;
  box-shadow:0 8px 18px rgba(15,23,42,.10)!important;
}
body:not(.exercise-active) .next-exercise-illustration-stage{
  aspect-ratio:4/3!important;
  min-height:0!important;
  height:auto!important;
  background:#f8fbff!important;
  border-radius:16px 16px 0 0!important;
}
body:not(.exercise-active) .next-exercise-illustration-detail .next-exercise-illustration-stage{
  aspect-ratio:4/3!important;
}
body:not(.exercise-active) .next-exercise-visual-figure,
body:not(.exercise-active) body:not(.exercise-active) .next-exercise-visual-figure{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:center!important;
  display:block!important;
  background:transparent!important;
}
body:not(.exercise-active) .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-illustration-stage,
body:not(.exercise-active) .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-illustration-stage{
  aspect-ratio:4/3!important;
  background:#f8fbff!important;
}
body:not(.exercise-active) .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-visual-figure,
body:not(.exercise-active) .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-visual-figure{
  object-fit:cover!important;
}
body:not(.exercise-active) .next-exercise-visual-stage{
  width:100%!important;
  height:100%!important;
  background-image:var(--next-exercise-bg)!important;
  background-size:cover!important;
  background-position:center!important;
  position:relative!important;
}
body:not(.exercise-active) .next-exercise-visual-stage .next-exercise-visual-figure{
  position:absolute!important;
  inset:0!important;
  object-fit:contain!important;
  padding:5%!important;
}
body:not(.exercise-active) .next-exercise-illustration-meta{
  padding:8px 10px!important;
  gap:8px!important;
  background:rgba(255,255,255,.94)!important;
  color:#64748b!important;
}
body:not(.exercise-active) .next-exercise-illustration-meta b,
body:not(.exercise-active) .next-exercise-illustration-meta span{
  font-size:10.5px!important;
  line-height:1.15!important;
}
body:not(.exercise-active) .next-theme-pill-row{
  gap:5px!important;
}
body:not(.exercise-active) .next-theme-pill{
  min-height:27px!important;
  padding:5px 8px!important;
  font-size:10px!important;
}
body:not(.exercise-active) .next-library-backup-panel{
  margin:0!important;
  padding:10px!important;
  border-radius:15px!important;
  gap:8px!important;
}
body:not(.exercise-active) .backup-title-block h3{
  font-size:16px!important;
  margin:2px 0!important;
}
body:not(.exercise-active) .backup-title-block small,
body:not(.exercise-active) .backup-note,
body:not(.exercise-active) .backup-status-line{
  font-size:12px!important;
  line-height:1.25!important;
}
body:not(.exercise-active) .backup-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:7px!important;
}
body:not(.exercise-active) .backup-actions .next-button{
  width:auto!important;
  min-height:34px!important;
  padding:7px 10px!important;
  font-size:12px!important;
}
body:not(.exercise-active) .next-library-facts,
body:not(.exercise-active) .next-library-dose-grid{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:8px!important;
}
body:not(.exercise-active) .next-library-facts span,
body:not(.exercise-active) .next-library-dose-grid article,
body:not(.exercise-active) .next-library-alias-box{
  padding:9px 10px!important;
  border-radius:14px!important;
}
body:not(.exercise-active) .next-library-pass-uses span{
  gap:4px!important;
}
@media(max-width:820px){
  body:not(.exercise-active) .next-library-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body:not(.exercise-active) .next-library-controls{grid-template-columns:1fr!important;}
  body:not(.exercise-active) .next-library-detail-inline{grid-template-columns:1fr!important;}
}
@media(max-width:520px){
  body:not(.exercise-active) .next-library-page{gap:10px!important;}
  body:not(.exercise-active) .next-library-header .next-page-title{font-size:32px!important;}
  body:not(.exercise-active) .next-library-stats{display:none!important;}
  body:not(.exercise-active) .next-library-row{grid-template-columns:46px minmax(0,1fr) auto!important;padding:8px!important;gap:8px!important;}
  body:not(.exercise-active) .next-library-thumb,
  body:not(.exercise-active) .next-library-thumb-placeholder{width:42px!important;min-width:42px!important;height:38px!important;}
  body:not(.exercise-active) .next-library-thumb .next-exercise-illustration-stage{height:38px!important;}
  body:not(.exercise-active) .next-library-row .next-chip-row{display:none!important;}
  body:not(.exercise-active) .next-library-row-top b{font-size:14px!important;}
  body:not(.exercise-active) .next-library-row p{font-size:11.5px!important;max-height:1.25em!important;}
  body:not(.exercise-active) .next-library-detail-inline{padding:10px!important;border-radius:18px!important;gap:10px!important;}
  body:not(.exercise-active) .next-library-copy-panel .next-library-title-row h2{font-size:26px!important;}
  body:not(.exercise-active) .next-exercise-illustration-meta{flex-direction:column!important;align-items:flex-start!important;}
  body:not(.exercise-active) .next-theme-pill-row{justify-content:flex-start!important;}
}

/* =========================================================
   Exercise library real-DOM compact ownership patch
   Reuses standard expanded component; only adds a source modifier on existing video shell.
   Targets actual .next-library-detail-inline DOM after browser inspection.
   ========================================================= */
body:not(.exercise-active) .next-library-page{
  gap:10px!important;
}
body:not(.exercise-active) .next-library-grid{
  gap:8px!important;
}
body:not(.exercise-active) .next-library-row{
  grid-template-columns:48px minmax(0,1fr) auto!important;
  gap:8px!important;
  padding:8px 10px!important;
  min-height:58px!important;
  border-radius:18px!important;
}
body:not(.exercise-active) .next-library-row-main{
  gap:2px!important;
}
body:not(.exercise-active) .next-library-row-top{
  gap:6px!important;
}
body:not(.exercise-active) .next-library-row-top b{
  font-size:15px!important;
  line-height:1.05!important;
}
body:not(.exercise-active) .next-library-row p{
  font-size:11.5px!important;
  line-height:1.15!important;
  max-height:1.25em!important;
}
body:not(.exercise-active) .next-library-thumb,
body:not(.exercise-active) .next-library-thumb-placeholder{
  width:44px!important;
  min-width:44px!important;
  height:38px!important;
  border-radius:10px!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-illustration-stage{
  height:38px!important;
  min-height:0!important;
  aspect-ratio:5/4!important;
}
body:not(.exercise-active) .next-library-row-action{
  min-width:50px!important;
  min-height:30px!important;
  padding:6px 9px!important;
}
body:not(.exercise-active) .next-library-detail-inline{
  grid-template-columns:minmax(0,.98fr) minmax(0,1.02fr)!important;
  gap:10px!important;
  padding:10px!important;
  margin:0!important;
  border-radius:20px!important;
  overflow:hidden!important;
  align-items:start!important;
}
body:not(.exercise-active) .next-library-media-panel,
body:not(.exercise-active) .next-library-copy-panel{
  gap:8px!important;
}
body:not(.exercise-active) .next-exercise-illustration{
  border-radius:16px!important;
  box-shadow:0 6px 16px rgba(15,23,42,.10)!important;
}
body:not(.exercise-active) .next-exercise-illustration-stage,
body:not(.exercise-active) .next-exercise-illustration-detail .next-exercise-illustration-stage,
body:not(.exercise-active) .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-illustration-stage,
body:not(.exercise-active) .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-illustration-stage{
  aspect-ratio:16/9!important;
  min-height:0!important;
  height:auto!important;
  border-radius:14px 14px 0 0!important;
  background:#fbfdff!important;
}
body:not(.exercise-active) .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-visual-figure,
body:not(.exercise-active) .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-visual-figure{
  object-fit:contain!important;
  background:#fbfdff!important;
}
body:not(.exercise-active) .next-exercise-illustration-meta{
  padding:6px 8px!important;
  gap:6px!important;
}
body:not(.exercise-active) .next-exercise-illustration-meta b,
body:not(.exercise-active) .next-exercise-illustration-meta span{
  font-size:10px!important;
  line-height:1.12!important;
}
body:not(.exercise-active) .next-library-video{
  aspect-ratio:16/9!important;
  min-height:0!important;
  max-height:190px!important;
  border-radius:16px!important;
}
body:not(.exercise-active) .next-library-video-missing{
  padding:10px!important;
  gap:5px!important;
}
body:not(.exercise-active) .next-library-video-missing span{
  font-size:22px!important;
}
body:not(.exercise-active) .next-library-video-missing b{
  font-size:13px!important;
}
body:not(.exercise-active) .next-library-video-missing p{
  font-size:11.5px!important;
  line-height:1.2!important;
  margin:0!important;
}
body:not(.exercise-active) .next-library-video-missing .next-button{
  min-height:30px!important;
  padding:6px 9px!important;
  font-size:11px!important;
}
body:not(.exercise-active) .next-library-copy-panel .next-library-title-row h2{
  font-size:clamp(22px,3.6vw,34px)!important;
  line-height:1!important;
  letter-spacing:-.035em!important;
}
body:not(.exercise-active) .next-library-detail-intro{
  font-size:12.5px!important;
  line-height:1.22!important;
  margin:0!important;
}
body:not(.exercise-active) .next-chip,
body:not(.exercise-active) .next-video-status{
  min-height:25px!important;
  padding:5px 8px!important;
  font-size:10px!important;
}
body:not(.exercise-active) .next-library-backup-panel{
  display:grid!important;
  gap:6px!important;
  padding:8px!important;
  border-radius:14px!important;
}
body:not(.exercise-active) .backup-title-block{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  min-width:0!important;
}
body:not(.exercise-active) .backup-title-block h3{
  display:none!important;
}
body:not(.exercise-active) .backup-title-block small,
body:not(.exercise-active) .backup-status-line{
  font-size:11px!important;
  line-height:1.18!important;
}
body:not(.exercise-active) .backup-upload-status.is-idle{
  display:none!important;
}
body:not(.exercise-active) .backup-actions{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:6px!important;
}
body:not(.exercise-active) .backup-actions .next-button{
  width:auto!important;
  min-height:31px!important;
  padding:6px 9px!important;
  font-size:11px!important;
}
body:not(.exercise-active) .next-library-facts{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px!important;
}
body:not(.exercise-active) .next-library-facts span,
body:not(.exercise-active) .next-library-dose-grid article,
body:not(.exercise-active) .next-library-alias-box{
  padding:7px 8px!important;
  border-radius:12px!important;
}
body:not(.exercise-active) .next-library-facts b,
body:not(.exercise-active) .next-library-dose-grid b,
body:not(.exercise-active) .next-library-alias-box b{
  font-size:10px!important;
  line-height:1.1!important;
}
body:not(.exercise-active) .next-library-facts span,
body:not(.exercise-active) .next-library-dose-grid article,
body:not(.exercise-active) .next-library-pass-uses span,
body:not(.exercise-active) .next-library-cues li{
  font-size:11px!important;
  line-height:1.18!important;
}
body:not(.exercise-active) .next-library-pass-uses span{
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:4px!important;
  padding:4px 0!important;
}
body:not(.exercise-active) .next-library-pass-uses em{
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
body:not(.exercise-active) .next-library-pass-uses strong{
  white-space:nowrap!important;
}
body:not(.exercise-active) .next-library-dose-grid{
  grid-template-columns:1fr!important;
  gap:6px!important;
}
body:not(.exercise-active) .next-library-cues ul{
  margin:4px 0 0!important;
  padding-left:16px!important;
}
body:not(.exercise-active) .next-library-cues li{
  margin:2px 0!important;
}
@media(max-width:820px){
  body:not(.exercise-active) .next-library-detail-inline{
    grid-template-columns:1fr!important;
  }
}
@media(max-width:520px){
  body:not(.exercise-active) .next-library-header .next-page-title{
    font-size:30px!important;
  }
  body:not(.exercise-active) .next-library-controls{
    padding:10px!important;
  }
  body:not(.exercise-active) .next-library-detail-inline{
    padding:9px!important;
    gap:8px!important;
  }
  body:not(.exercise-active) .next-library-media-panel,
  body:not(.exercise-active) .next-library-copy-panel{
    gap:7px!important;
  }
  body:not(.exercise-active) .next-library-video{
    max-height:170px!important;
  }
  body:not(.exercise-active) .next-library-copy-panel .next-library-title-row h2{
    font-size:24px!important;
  }
}

/* compact empty/OTA video state without shrinking real iframe/video embeds */
body:not(.exercise-active) .next-library-detail-inline .next-library-video{
  min-height:0!important;
}
body:not(.exercise-active) .next-library-video-source-missing,
body:not(.exercise-active) .next-library-video-source-timer,
body:not(.exercise-active) .next-library-video-source-ota:not(:has(iframe)){
  aspect-ratio:auto!important;
  height:auto!important;
  min-height:128px!important;
  max-height:none!important;
}
body:not(.exercise-active) .next-library-video-source-missing .next-library-video-missing,
body:not(.exercise-active) .next-library-video-source-timer .next-library-video-missing,
body:not(.exercise-active) .next-library-video-source-ota:not(:has(iframe)) .next-library-video-missing{
  min-height:128px!important;
}
@media(max-width:520px){
  body:not(.exercise-active) .next-library-video-source-missing,
  body:not(.exercise-active) .next-library-video-source-timer,
  body:not(.exercise-active) .next-library-video-source-ota:not(:has(iframe)),
  body:not(.exercise-active) .next-library-video-source-missing .next-library-video-missing,
  body:not(.exercise-active) .next-library-video-source-timer .next-library-video-missing,
  body:not(.exercise-active) .next-library-video-source-ota:not(:has(iframe)) .next-library-video-missing{
    min-height:118px!important;
  }
}

/* keep iPad/tablet portrait in the two-column expanded layout */
@media(min-width:760px){
  body:not(.exercise-active) .next-library-detail-inline{
    grid-template-columns:minmax(0,.98fr) minmax(0,1.02fr)!important;
  }
}

/* restore dark readable surface for the real expanded card */
body:not(.exercise-active) .next-library-detail-inline{
  background:radial-gradient(circle at 18% 0%,rgba(116,231,255,.13),transparent 32%),linear-gradient(180deg,rgba(8,18,33,.96),rgba(4,10,21,.98))!important;
  border-color:rgba(116,231,255,.24)!important;
  color:#f8fafc!important;
}
body:not(.exercise-active) .next-library-copy-panel,
body:not(.exercise-active) .next-library-copy-panel h2,
body:not(.exercise-active) .next-library-detail-inline .next-library-title-row h2{
  color:#f8fafc!important;
}
body:not(.exercise-active) .next-library-detail-intro,
body:not(.exercise-active) .next-library-copy-panel p,
body:not(.exercise-active) .backup-title-block small,
body:not(.exercise-active) .next-library-pass-uses em,
body:not(.exercise-active) .next-library-pass-uses small,
body:not(.exercise-active) .next-library-facts span,
body:not(.exercise-active) .next-library-dose-grid article{
  color:rgba(226,232,240,.82)!important;
}
body:not(.exercise-active) .next-library-facts span,
body:not(.exercise-active) .next-library-dose-grid article,
body:not(.exercise-active) .next-library-alias-box{
  background:rgba(148,163,184,.12)!important;
  border:1px solid rgba(148,163,184,.18)!important;
}
body:not(.exercise-active) .next-library-facts b,
body:not(.exercise-active) .next-library-dose-grid b,
body:not(.exercise-active) .next-library-pass-uses strong{
  color:#f8fafc!important;
}
body:not(.exercise-active) .next-library-backup-panel{
  background:linear-gradient(135deg,rgba(255,255,255,.08),rgba(255,255,255,.035))!important;
  border:1px solid rgba(255,255,255,.14)!important;
}
body:not(.exercise-active) .next-library-backup-panel.missing-backup .backup-kicker{
  color:#a7ffce!important;
}
body:not(.exercise-active) .backup-status-line span{
  border-radius:14px!important;
  background:rgba(15,23,42,.42)!important;
  color:rgba(248,250,252,.88)!important;
}
body:not(.exercise-active) .backup-title-block code{
  color:#f8fafc!important;
  background:rgba(15,23,42,.54)!important;
}

/* =========================================================
   Pass page standardization
   Keeps the sensitive active-player lifecycle intact while aligning the pass
   overview and active-pass DOM with shared NEXT class contracts.
   ========================================================= */
body:not(.exercise-active) .next-pass-overview-page{
  width:min(100%,var(--next-content-max,1040px))!important;
  margin-inline:auto!important;
  display:grid!important;
  gap:var(--next-section-gap)!important;
  min-width:0!important;
}
body:not(.exercise-active) .next-pass-overview-hero,
body:not(.exercise-active) .next-pass-overview-layout{
  width:100%!important;
  max-width:var(--next-content-max,1040px)!important;
  min-width:0!important;
  margin-inline:auto!important;
}
body:not(.exercise-active) .next-pass-overview-meta,
body:not(.exercise-active) .next-pass-overview-actions{
  width:100%!important;
  min-width:0!important;
}
body:not(.exercise-active) .next-pass-overview-block{
  min-width:0!important;
}
body:not(.exercise-active) .next-overview-exercise-row{
  min-width:0!important;
}
body:not(.exercise-active) .next-overview-exercise-row b,
body:not(.exercise-active) .next-overview-exercise-row small{
  min-width:0!important;
  overflow-wrap:anywhere!important;
}
body:not(.exercise-active) .next-overview-exercise-row-uncoded .next-ex-code{
  opacity:.55!important;
}
body.exercise-active .next-pass-screen,
body.exercise-active .next-pass-layout,
body.exercise-active .next-pass-media-card,
body.exercise-active .next-pass-info-card,
body.exercise-active .next-pass-playlist-card{
  min-width:0!important;
}
body.exercise-active .next-pass-topbar{
  contain:layout paint!important;
}
body.exercise-active .next-pass-video-wrap{
  display:grid!important;
  place-items:center!important;
}
body.exercise-active .next-pass-info-card{
  align-content:start!important;
}
body.exercise-active .next-pass-controls{
  z-index:70!important;
}
body.exercise-active .next-pass-mini-list{
  min-width:0!important;
}
@media(max-width:760px){
  body:not(.exercise-active) .next-pass-overview-actions{
    grid-template-columns:1fr!important;
  }
  body:not(.exercise-active) .next-overview-group li.next-overview-exercise-row{
    grid-template-columns:34px minmax(0,1fr)!important;
  }
  body:not(.exercise-active) .next-overview-exercise-row small{
    grid-column:2!important;
    white-space:normal!important;
  }
}

/* standard pass mode screen ownership: when the player is active, no other page may remain in the document flow. */
body.exercise-active .screen:not(#exerciseScreen){
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
body.exercise-active #exerciseScreen.active{
  display:block!important;
  visibility:visible!important;
  pointer-events:auto!important;
}
body.exercise-active > .dashboard-viewport-bg-img{
  display:none!important;
  opacity:0!important;
}
/* standard correction: do not contain the pass topbar; fixed bottom controls must anchor to viewport, not the sticky header. */
body.exercise-active .next-pass-topbar{
  contain:initial!important;
}
/* standard correction: backdrop-filter on the sticky header creates a containing block for fixed descendants in Chromium. */
body.exercise-active .next-pass-topbar{
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

/* =========================================================
   Pass player standardization shell
   app.js keeps the sensitive lifecycle; this layer gives the existing player
   a stable DOM-state and shared view-helper contract for QA/styling.
   ========================================================= */
body.exercise-active .next-pass-screen[data-pass-mode],
body.exercise-active .next-pass-video-wrap[data-pass-mode]{
  --next-pass-player-line:rgba(116,231,255,.24);
  --next-pass-player-surface:rgba(5,16,31,.78);
}
body.exercise-active .next-pass-video-wrap.is-pass-mode-start,
body.exercise-active .next-pass-video-wrap.is-pass-mode-rest,
body.exercise-active .next-pass-video-wrap.is-pass-mode-exercise{
  min-width:0!important;
}
body.exercise-active .next-pass-stage{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  border-radius:inherit!important;
  overflow:hidden!important;
  position:relative!important;
  isolation:isolate!important;
}
body.exercise-active .next-pass-stage-bg,
body.exercise-active .next-pass-stage-overlay{
  position:absolute!important;
  inset:0!important;
}
body.exercise-active .next-pass-stage-bg{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
}
body.exercise-active .next-pass-stage-card{
  position:relative!important;
  z-index:2!important;
}
body.exercise-active .next-pass-stage-kicker{
  text-transform:uppercase!important;
  letter-spacing:.16em!important;
  font-weight:950!important;
}
body.exercise-active .next-pass-stage-title{
  font-weight:950!important;
  letter-spacing:-.055em!important;
}
body.exercise-active .next-pass-fallback{
  width:100%!important;
  height:100%!important;
  min-height:clamp(220px,42vw,420px)!important;
  display:grid!important;
  place-items:center!important;
  padding:clamp(14px,3vw,26px)!important;
  border-radius:inherit!important;
  background:radial-gradient(circle at 50% 0%,rgba(116,231,255,.14),transparent 44%),linear-gradient(180deg,rgba(4,13,27,.92),rgba(2,8,18,.96))!important;
  color:var(--next-text,#f8fbff)!important;
  text-align:center!important;
}
body.exercise-active .next-pass-fallback-inner{
  display:grid!important;
  gap:10px!important;
  justify-items:center!important;
  max-width:520px!important;
}
body.exercise-active .next-pass-fallback-icon{
  font-size:clamp(36px,8vw,62px)!important;
  line-height:1!important;
}
body.exercise-active .next-pass-fallback h2{
  margin:0!important;
  font-size:clamp(24px,5vw,42px)!important;
  line-height:.96!important;
}
body.exercise-active .next-pass-fallback p{
  margin:0!important;
  color:rgba(226,232,240,.82)!important;
  font-weight:750!important;
  line-height:1.35!important;
}
body.exercise-active .next-pass-fallback-actions{
  display:flex!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  justify-content:center!important;
  margin-top:4px!important;
}
body.exercise-active .next-pass-video-wrap[data-video-source="youtube"] iframe,
body.exercise-active .next-pass-video-wrap[data-video-source="ota"] iframe,
body.exercise-active .next-pass-video-wrap[data-video-source="server"] video,
body.exercise-active .next-pass-video-wrap[data-video-source="server-backup"] video,
body.exercise-active .next-pass-video-wrap[data-video-source="local-backup"] video{
  background:#020814!important;
}
body.exercise-active .next-pass-screen[data-video-source="projector-blocked"] .next-pass-info-card,
body.exercise-active .next-pass-screen[data-video-source="ota-fallback"] .next-pass-info-card{
  border-color:rgba(255,214,102,.28)!important;
}
@media(max-width:760px){
  body.exercise-active .next-pass-fallback{
    min-height:220px!important;
    padding:14px!important;
  }
  body.exercise-active .next-pass-fallback-inner{
    gap:7px!important;
  }
  body.exercise-active .next-pass-fallback p{
    font-size:13px!important;
  }
}
/* Pass player: keep preload and iOS fallback layers invisible unless explicitly needed. */
body.exercise-active .next-pass-media-card,
body.exercise-active .video-preload-shell{
  position:relative!important;
}
body.exercise-active .preload-video-wrap{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  overflow:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
  inset:auto!important;
  right:0!important;
  bottom:0!important;
}
body.exercise-active .preload-video-wrap iframe{
  width:1px!important;
  height:1px!important;
  opacity:0!important;
  pointer-events:none!important;
}
body.exercise-active .video-tap-fallback.hide{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
body.exercise-active .video-tap-fallback:not(.hide){
  position:absolute!important;
  left:50%!important;
  bottom:14px!important;
  transform:translateX(-50%)!important;
  z-index:5!important;
}

/* =========================================================
   Pass chrome reposition
   Keep app.js player lifecycle intact. Reposition only existing controls/progress:
   - topbar: back, next, menu on the right
   - progress: below media + exercise text cards
   ========================================================= */
body.exercise-active .wrap{
  padding-bottom:calc(22px + var(--safe-bottom))!important;
}
body.exercise-active .next-pass-topbar{
  padding:calc(6px + env(safe-area-inset-top,0px)) 10px 8px!important;
  background:linear-gradient(180deg,rgba(5,10,19,.98),rgba(5,10,19,.88))!important;
  border-bottom:1px solid rgba(128,181,255,.14)!important;
}
body.exercise-active .next-pass-action-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:8px!important;
}
body.exercise-active .next-pass-top-spacer{
  display:block!important;
  min-width:0!important;
}
body.exercise-active .next-pass-top-spacer .nav-left{
  display:block!important;
}
body.exercise-active .next-pass-topbar .pass-top-controls{
  position:static!important;
  left:auto!important;
  right:auto!important;
  bottom:auto!important;
  z-index:auto!important;
  display:grid!important;
  grid-template-columns:auto auto auto!important;
  justify-self:end!important;
  align-items:center!important;
  width:auto!important;
  max-width:100%!important;
  gap:8px!important;
  padding:0!important;
  background:transparent!important;
  box-shadow:none!important;
  pointer-events:auto!important;
}
body.exercise-active .next-pass-topbar .pass-top-controls.no-prev{
  grid-template-columns:auto auto!important;
}
body.exercise-active .next-pass-topbar .pass-top-controls #prevBtn,
body.exercise-active .next-pass-topbar .pass-top-controls #nextBtn,
body.exercise-active .next-pass-topbar .pass-top-controls #menuToggleBtn{
  min-height:44px!important;
  height:44px!important;
  border-radius:15px!important;
  box-shadow:none!important;
}
body.exercise-active .next-pass-topbar .pass-top-controls #prevBtn{
  width:48px!important;
  min-width:48px!important;
  max-width:48px!important;
  padding:0!important;
  opacity:.86!important;
  font-size:0!important;
}
body.exercise-active .next-pass-topbar .pass-top-controls #prevBtn::before{
  content:"←"!important;
  font-size:21px!important;
  line-height:1!important;
}
body.exercise-active .next-pass-topbar .pass-top-controls #prevBtn:disabled{
  display:none!important;
}
body.exercise-active .next-pass-topbar .pass-top-controls #nextBtn{
  width:auto!important;
  max-width:none!important;
  min-width:clamp(126px,34vw,190px)!important;
  padding:0 14px!important;
  font-size:clamp(14px,3.8vw,17px)!important;
  white-space:nowrap!important;
}
body.exercise-active .next-pass-topbar .pass-top-controls .menu-wrap,
body.exercise-active .next-pass-topbar .pass-top-controls .next-pass-menu-wrap{
  display:block!important;
  position:relative!important;
}
body.exercise-active .next-pass-topbar .pass-top-controls #menuToggleBtn,
body.exercise-active .next-pass-topbar .pass-top-controls .menu-toggle{
  width:48px!important;
  min-width:48px!important;
  max-width:48px!important;
  padding:0!important;
  font-size:0!important;
}
body.exercise-active .next-pass-topbar .pass-top-controls #menuToggleBtn::before{
  content:"☰"!important;
  font-size:22px!important;
  line-height:1!important;
}
body.exercise-active .top-tools{
  top:calc(58px + env(safe-area-inset-top,0px))!important;
  left:auto!important;
  right:10px!important;
  width:min(430px,calc(100vw - 20px))!important;
  grid-template-columns:1fr 1fr!important;
}
body.exercise-active .stage-layout{
  gap:10px!important;
}
body.exercise-active .next-pass-progress-below{
  display:grid!important;
  gap:7px!important;
  margin:10px 10px 0!important;
  padding:10px 12px 12px!important;
  border:1px solid rgba(116,231,255,.18)!important;
  border-radius:18px!important;
  background:linear-gradient(180deg,rgba(6,18,34,.72),rgba(3,10,21,.78))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035)!important;
}
body.exercise-active .next-pass-progress-below #exerciseMeta{
  font-size:clamp(10px,2.8vw,13px)!important;
  letter-spacing:.08em!important;
  color:rgba(223,248,255,.88)!important;
}
body.exercise-active .next-pass-progress-below .progress-shell{
  height:8px!important;
}
body.exercise-active .next-pass-playlist-card{
  margin-top:10px!important;
}
@media(min-width:760px){
  body.exercise-active .next-pass-progress-below{
    margin-left:0!important;
    margin-right:0!important;
  }
  body.exercise-active .next-pass-topbar .pass-top-controls #nextBtn{
    min-width:174px!important;
  }
}
@media(max-width:390px){
  body.exercise-active .next-pass-topbar{
    padding-left:8px!important;
    padding-right:8px!important;
  }
  body.exercise-active .next-pass-topbar .pass-top-controls{
    gap:6px!important;
  }
  body.exercise-active .next-pass-topbar .pass-top-controls #nextBtn{
    min-width:118px!important;
    padding-inline:10px!important;
  }
  body.exercise-active .next-pass-progress-below{
    margin-left:8px!important;
    margin-right:8px!important;
  }
}

/* =========================================================
   Pass video micro-controls
   Add small player controls directly under active films, without changing
   app.js video source priority or pass player lifecycle.
   ========================================================= */
body.exercise-active .next-pass-video-controls{
  display:none!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  align-items:center!important;
  gap:8px!important;
  margin:0!important;
  padding:8px 9px 9px!important;
  border-top:1px solid rgba(116,231,255,.14)!important;
  background:linear-gradient(180deg,rgba(3,13,28,.96),rgba(2,8,19,.98))!important;
}
body.exercise-active .next-pass-video-controls.is-visible{
  display:grid!important;
}
body.exercise-active .next-pass-video-control{
  min-height:42px!important;
  height:42px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:7px!important;
  padding:0 10px!important;
  border-radius:15px!important;
  border:1px solid rgba(116,231,255,.38)!important;
  background:linear-gradient(180deg,rgba(8,34,67,.98),rgba(2,17,39,.98))!important;
  color:#dff8ff!important;
  font-weight:950!important;
  letter-spacing:.01em!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 10px 22px rgba(0,0,0,.22)!important;
  touch-action:manipulation!important;
}
body.exercise-active .next-pass-video-control .pass-video-control-icon{
  width:24px!important;
  height:24px!important;
  display:inline-grid!important;
  place-items:center!important;
  border-radius:999px!important;
  color:var(--next-accent)!important;
  background:rgba(116,231,255,.10)!important;
  box-shadow:inset 0 0 0 1px rgba(116,231,255,.18)!important;
  font-size:15px!important;
  line-height:1!important;
}
body.exercise-active .next-pass-video-control .pass-video-control-label{
  font-size:clamp(12px,3.2vw,14px)!important;
  line-height:1!important;
  white-space:nowrap!important;
}
body.exercise-active .next-pass-video-control:active{
  transform:translateY(1px)!important;
}
body.exercise-active .next-pass-video-control.is-active{
  border-color:rgba(116,231,255,.68)!important;
  background:linear-gradient(180deg,rgba(13,59,106,.98),rgba(5,31,68,.98))!important;
}
body.exercise-active .next-pass-video-control:disabled,
body.exercise-active .next-pass-video-control[aria-disabled="true"]{
  opacity:.38!important;
  pointer-events:none!important;
  filter:saturate(.72)!important;
}
@media(max-width:420px){
  body.exercise-active .next-pass-video-controls{
    gap:6px!important;
    padding:7px 7px 8px!important;
  }
  body.exercise-active .next-pass-video-control{
    min-height:40px!important;
    height:40px!important;
    padding-inline:7px!important;
    border-radius:14px!important;
  }
  body.exercise-active .next-pass-video-control .pass-video-control-icon{
    width:22px!important;
    height:22px!important;
    font-size:14px!important;
  }
}

/* =========================================================
   Pass player clean media-card contract
   Media card is media-only. Exercise name, dose, cues and superset context
   stay in the right-side info card. Fixes image-state overflow/overlap while
   reusing the current player DOM and video lifecycle.
   ========================================================= */
body.exercise-active .next-pass-media-card{
  overflow:hidden!important;
  isolation:isolate!important;
}
body.exercise-active .next-pass-video-wrap{
  overflow:hidden!important;
  min-height:0!important;
  border-radius:inherit!important;
}
body.exercise-active #videoWrap .next-pass-media-only{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  display:block!important;
  padding:0!important;
  margin:0!important;
  overflow:hidden!important;
  border-radius:inherit!important;
  background:linear-gradient(180deg,rgba(3,12,26,.96),rgba(1,6,16,.98))!important;
  text-align:initial!important;
  color:inherit!important;
}
body.exercise-active #videoWrap .next-pass-media-stage,
body.exercise-active #videoWrap .next-pass-media-only .exercise-visual-media{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  display:block!important;
  overflow:hidden!important;
  border-radius:inherit!important;
  position:relative!important;
}
body.exercise-active #videoWrap .next-pass-media-only.has-exercise-illustration{
  grid-template-columns:1fr!important;
  gap:0!important;
  align-items:stretch!important;
  place-items:stretch!important;
}
body.exercise-active #videoWrap .next-pass-media-only .exercise-visual-copy,
body.exercise-active #videoWrap .next-pass-media-only .fallback-kicker,
body.exercise-active #videoWrap .next-pass-media-only h2,
body.exercise-active #videoWrap .next-pass-media-only p,
body.exercise-active #videoWrap .next-pass-media-only ul{
  display:none!important;
}
body.exercise-active #videoWrap .next-pass-media-stage .next-exercise-illustration{
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  display:block!important;
  overflow:hidden!important;
  border:0!important;
  border-radius:inherit!important;
  margin:0!important;
  background:#fbfdff!important;
  box-shadow:none!important;
}
body.exercise-active #videoWrap .next-pass-media-stage .next-exercise-illustration-stage,
body.exercise-active #videoWrap .next-pass-media-stage .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-illustration-stage,
body.exercise-active #videoWrap .next-pass-media-stage .next-exercise-illustration[data-quality="convention-or-default"] .next-exercise-illustration-stage{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  aspect-ratio:auto!important;
  display:block!important;
  overflow:hidden!important;
  border-radius:inherit!important;
  background:#fbfdff!important;
}
body.exercise-active #videoWrap .next-pass-media-stage .next-exercise-visual-figure,
body.exercise-active #videoWrap .next-pass-media-stage body.exercise-active #videoWrap .next-pass-media-stage .next-exercise-visual-figure{
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  display:block!important;
  object-fit:contain!important;
  object-position:center center!important;
  margin:0!important;
  padding:0!important;
  background:#fbfdff!important;
}
body.exercise-active #videoWrap .next-pass-media-stage .next-exercise-illustration-meta{
  display:none!important;
}
body.exercise-active .next-pass-screen[data-video-source="projector-blocked"] .next-pass-video-controls,
body.exercise-active .next-pass-screen[data-video-source="missing"] .next-pass-video-controls,
body.exercise-active .next-pass-screen[data-video-source="timer"] .next-pass-video-controls,
body.exercise-active .next-pass-screen[data-video-source="ota-fallback"] .next-pass-video-controls{
  display:none!important;
}
@media(min-width:760px){
  body.exercise-active .next-pass-layout{
    align-items:stretch!important;
  }
  body.exercise-active .next-pass-media-card,
  body.exercise-active .next-pass-info-card{
    min-height:0!important;
  }
}

/* =========================================================
   Pass player desktop scale + mobile video-start cleanup
   Keep the current player lifecycle. Fix only layout scaling and the
   obsolete iOS/manual-start overlay now that inline video controls exist.
   ========================================================= */
body.exercise-active .video-tap-fallback,
body.exercise-active .video-tap-fallback:not(.hide){
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
  color:#eafaff!important;
}
body.exercise-active .next-pass-video-control,
body.exercise-active .next-pass-video-control:visited,
body.exercise-active .next-pass-video-control .pass-video-control-label{
  color:#eafaff!important;
}
body.exercise-active .next-pass-video-control .pass-video-control-icon{
  color:#a978ff!important;
}
@media(min-width:900px){
  body.exercise-active .next-pass-layout{
    align-items:start!important;
  }
  body.exercise-active .next-pass-media-card{
    align-self:start!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    display:grid!important;
    grid-template-rows:auto auto!important;
  }
  body.exercise-active .next-pass-info-card{
    align-self:start!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
  }
  body.exercise-active .next-pass-video-wrap[data-video-source="youtube"],
  body.exercise-active .next-pass-video-wrap[data-video-source="ota"],
  body.exercise-active .next-pass-video-wrap[data-video-source="server"],
  body.exercise-active .next-pass-video-wrap[data-video-source="server-backup"],
  body.exercise-active .next-pass-video-wrap[data-video-source="local-backup"]{
    aspect-ratio:16 / 9!important;
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
  }
  body.exercise-active .next-pass-video-wrap[data-video-source="youtube"] iframe,
  body.exercise-active .next-pass-video-wrap[data-video-source="ota"] iframe,
  body.exercise-active .next-pass-video-wrap[data-video-source="server"] video,
  body.exercise-active .next-pass-video-wrap[data-video-source="server-backup"] video,
  body.exercise-active .next-pass-video-wrap[data-video-source="local-backup"] video{
    width:100%!important;
    height:100%!important;
  }
  body.exercise-active .next-pass-playlist-card{
    overflow:hidden!important;
  }
  body.exercise-active .next-pass-mini-list{
    max-height:clamp(128px,20svh,210px)!important;
  }
}

/* =========================================================
   Pass list standardization + iPhone-safe active-row progress fill
   The pass list now reuses NEXT tokens, renders active item first, and uses
   one centralized mini-item contract from pass-player-renderer.js.
   ========================================================= */
body.exercise-active .next-pass-playlist-card{
  display:block!important;
  overflow:hidden!important;
  padding:10px!important;
  border-color:var(--next-card-border)!important;
  background:linear-gradient(180deg,rgba(7,20,38,.88),rgba(3,10,21,.88))!important;
}
body.exercise-active .next-pass-mini-list{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:10px!important;
  max-height:clamp(150px,24svh,260px)!important;
  overflow:auto!important;
  scrollbar-width:thin!important;
  scroll-behavior:smooth!important;
}
body.exercise-active .next-pass-mini-item{
  position:relative!important;
  isolation:isolate!important;
  overflow:hidden!important;
  min-height:58px!important;
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr)!important;
  align-items:center!important;
  gap:10px!important;
  padding:10px 12px!important;
  border:1px solid rgba(116,231,255,.20)!important;
  border-radius:18px!important;
  background:linear-gradient(180deg,rgba(7,20,38,.84),rgba(3,11,23,.82))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035)!important;
  cursor:pointer!important;
  transform:translateZ(0)!important;
}
body.exercise-active .next-pass-mini-item > *:not(.next-pass-mini-fill){
  position:relative!important;
  z-index:2!important;
}
body.exercise-active .next-pass-mini-fill{
  position:absolute!important;
  inset:0 auto 0 0!important;
  width:0%!important;
  z-index:1!important;
  pointer-events:none!important;
  border-radius:inherit!important;
  background:linear-gradient(90deg,rgba(110,234,255,.30),rgba(88,185,255,.20) 72%,rgba(185,140,255,.10))!important;
  box-shadow:inset 0 0 0 1px rgba(116,231,255,.10)!important;
  transform-origin:left center!important;
}
body.exercise-active .next-pass-mini-item.is-done:not(.is-active) .next-pass-mini-fill,
body.exercise-active .next-pass-mini-item.done:not(.active) .next-pass-mini-fill{
  width:100%!important;
  opacity:.42!important;
}
body.exercise-active .next-pass-mini-item.is-done:not(.is-active),
body.exercise-active .next-pass-mini-item.done:not(.active){
  opacity:.64!important;
}
body.exercise-active .next-pass-mini-item.is-active,
body.exercise-active .next-pass-mini-item.active{
  min-height:70px!important;
  border-color:var(--next-card-border-strong)!important;
  background:
    radial-gradient(420px 140px at 8% 0%,rgba(110,234,255,.18),transparent 62%),
    linear-gradient(180deg,rgba(10,36,68,.96),rgba(4,18,38,.92))!important;
  box-shadow:0 0 0 1px rgba(116,231,255,.14),0 16px 34px rgba(0,0,0,.25),inset 4px 0 0 var(--next-accent)!important;
}
body.exercise-active .next-pass-mini-item.is-active::after,
body.exercise-active .next-pass-mini-item.active::after{
  content:"AKTIV"!important;
  position:absolute!important;
  top:8px!important;
  right:10px!important;
  z-index:3!important;
  padding:4px 8px!important;
  border-radius:999px!important;
  border:1px solid rgba(116,231,255,.28)!important;
  background:rgba(2,8,18,.62)!important;
  color:var(--next-accent)!important;
  font-size:10px!important;
  font-weight:1000!important;
  letter-spacing:.12em!important;
}
body.exercise-active .next-pass-mini-item.active:not(.filling) .next-pass-mini-fill,
body.exercise-active .next-pass-mini-item[data-active="true"]:not(.filling) .next-pass-mini-fill{
  animation:none!important;
  width:0%!important;
}
body.exercise-active .next-pass-mini-item.filling .next-pass-mini-fill{
  animation:none!important;
  transition:none!important;
  will-change:width!important;
}
body.exercise-active .next-pass-mini-index{
  width:38px!important;
  height:38px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:14px!important;
  border:1px solid rgba(116,231,255,.23)!important;
  background:rgba(2,10,22,.56)!important;
  color:#eafaff!important;
  font-size:18px!important;
  font-weight:1000!important;
  line-height:1!important;
}
body.exercise-active .next-pass-mini-copy{
  min-width:0!important;
  display:grid!important;
  gap:3px!important;
  padding-right:42px!important;
}
body.exercise-active .next-pass-mini-title{
  color:var(--next-text)!important;
  font-size:clamp(14px,1.4vw,17px)!important;
  font-weight:1000!important;
  line-height:1.05!important;
  letter-spacing:-.015em!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
}
body.exercise-active .next-pass-mini-subtitle{
  color:var(--next-muted)!important;
  font-size:clamp(12px,1.15vw,14px)!important;
  line-height:1.18!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
body.exercise-active .next-pass-mini-item-rest .next-pass-mini-index{
  color:#d8c2ff!important;
  border-color:rgba(185,140,255,.32)!important;
}
@keyframes nextPassMiniFill{
  from{width:0%;}
  to{width:100%;}
}
@media(min-width:900px){
  body.exercise-active .next-pass-mini-list{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    max-height:clamp(132px,18svh,210px)!important;
  }
  body.exercise-active .next-pass-mini-item.is-active,
  body.exercise-active .next-pass-mini-item.active{
    grid-column:1 / -1!important;
  }
}
@media(max-width:760px){
  body.exercise-active .next-pass-playlist-card{
    margin-inline:8px!important;
  }
  body.exercise-active .next-pass-mini-list{
    max-height:clamp(140px,30svh,240px)!important;
  }
  body.exercise-active .next-pass-mini-item{
    min-height:54px!important;
    grid-template-columns:38px minmax(0,1fr)!important;
    padding:9px 10px!important;
  }
  body.exercise-active .next-pass-mini-item.is-active,
  body.exercise-active .next-pass-mini-item.active{
    min-height:64px!important;
  }
  body.exercise-active .next-pass-mini-copy{
    padding-right:38px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  body.exercise-active .next-pass-mini-list{scroll-behavior:auto!important;}
  body.exercise-active .next-pass-mini-item.filling .next-pass-mini-fill{animation:none!important;transition:none!important;}
}

/* =========================================================
   Pass settings menu modernization + verified TV/Live modes
   Keeps the existing pass player lifecycle. Rebuilds the settings menu as
   grouped toggle rows and restores visible TV/Live effects inside the current
   centralized next-system.css layer.
   ========================================================= */
body.exercise-active .next-pass-settings-menu,
body.exercise-active .top-tools.next-pass-settings-menu{
  display:none!important;
  grid-template-columns:1fr!important;
  gap:12px!important;
  padding:14px!important;
  border-radius:28px!important;
  border:1px solid rgba(116,231,255,.24)!important;
  background:radial-gradient(420px 220px at 80% 0%,rgba(116,231,255,.13),transparent 58%),linear-gradient(180deg,rgba(4,13,26,.96),rgba(2,8,18,.98))!important;
  box-shadow:0 24px 70px rgba(0,0,0,.48),0 0 0 1px rgba(167,139,250,.10),inset 0 1px 0 rgba(255,255,255,.05)!important;
  backdrop-filter:blur(18px)!important;
}
body.exercise-active .next-pass-settings-menu.open,
body.exercise-active .top-tools.next-pass-settings-menu.open{
  display:grid!important;
}
body.exercise-active .next-settings-group{
  display:grid!important;
  gap:8px!important;
  padding:10px!important;
  border:1px solid rgba(116,231,255,.13)!important;
  border-radius:22px!important;
  background:rgba(2,10,22,.42)!important;
}
body.exercise-active .next-settings-group-title{
  padding:0 4px 2px!important;
  color:#b98cff!important;
  text-transform:uppercase!important;
  letter-spacing:.16em!important;
  font-size:11px!important;
  font-weight:1000!important;
}
body.exercise-active .next-settings-toggle,
body.exercise-active .next-settings-action,
body.exercise-active .next-settings-danger{
  width:100%!important;
  min-height:64px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:12px!important;
  padding:10px 10px 10px 14px!important;
  border-radius:20px!important;
  border:1px solid rgba(116,231,255,.22)!important;
  background:linear-gradient(180deg,rgba(8,24,44,.80),rgba(3,12,25,.84))!important;
  color:var(--next-text)!important;
  text-align:left!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035)!important;
}
body.exercise-active .next-settings-toggle.on{
  border-color:rgba(116,231,255,.42)!important;
  background:radial-gradient(220px 80px at 96% 50%,rgba(116,231,255,.17),transparent 64%),linear-gradient(180deg,rgba(9,31,58,.92),rgba(4,17,34,.90))!important;
}
body.exercise-active .next-settings-toggle-copy,
body.exercise-active .next-settings-action-copy{
  min-width:0!important;
  display:grid!important;
  gap:4px!important;
}
body.exercise-active .next-settings-toggle-title{
  display:block!important;
  color:#f7fbff!important;
  font-size:clamp(15px,3.4vw,18px)!important;
  font-weight:1000!important;
  line-height:1.05!important;
  letter-spacing:-.015em!important;
}
body.exercise-active .next-settings-toggle-copy small,
body.exercise-active .next-settings-action-copy small{
  display:block!important;
  max-width:34ch!important;
  color:rgba(218,233,247,.70)!important;
  font-size:12px!important;
  font-weight:760!important;
  line-height:1.22!important;
}
body.exercise-active .next-toggle-pill{
  width:96px!important;
  height:38px!important;
  padding:3px!important;
  border-radius:999px!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  align-items:center!important;
  border:1px solid rgba(116,231,255,.28)!important;
  background:rgba(1,8,18,.92)!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.025)!important;
}
body.exercise-active .next-toggle-segment{
  height:30px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:999px!important;
  color:rgba(218,233,247,.62)!important;
  font-size:12px!important;
  font-weight:1000!important;
  line-height:1!important;
}
body.exercise-active .next-settings-toggle.off .next-toggle-off,
body.exercise-active .next-settings-toggle.on .next-toggle-on{
  color:#03101e!important;
  background:linear-gradient(180deg,var(--next-accent),var(--next-accent-2))!important;
  box-shadow:0 6px 18px rgba(116,231,255,.20)!important;
}
body.exercise-active .next-settings-action-icon{
  width:40px!important;
  height:40px!important;
  border-radius:15px!important;
  display:grid!important;
  place-items:center!important;
  border:1px solid rgba(116,231,255,.26)!important;
  color:var(--next-accent)!important;
  background:rgba(116,231,255,.08)!important;
  font-size:20px!important;
  font-weight:1000!important;
}
body.exercise-active .next-settings-group-danger{
  border-color:rgba(255,121,121,.18)!important;
}
body.exercise-active .next-settings-danger,
body.exercise-active .danger-tool.next-settings-danger{
  border-color:rgba(255,121,121,.30)!important;
  background:linear-gradient(180deg,rgba(72,18,28,.68),rgba(32,8,16,.86))!important;
  color:#ffe4e4!important;
  justify-content:center!important;
  text-align:center!important;
  font-weight:1000!important;
}
body.exercise-active .next-settings-danger::before{
  content:"⏹"!important;
  margin-right:8px!important;
  color:#ffb8b8!important;
}
@media(min-width:820px){
  body.exercise-active .next-pass-settings-menu,
  body.exercise-active .top-tools.next-pass-settings-menu{
    width:min(720px,calc(100vw - 28px))!important;
    right:14px!important;
  }
  body.exercise-active .next-pass-settings-menu.open,
  body.exercise-active .top-tools.next-pass-settings-menu.open{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:start!important;
  }
  body.exercise-active .next-settings-group[data-settings-group="media"]{
    grid-column:1 / -1!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body.exercise-active .next-settings-group[data-settings-group="media"] .next-settings-group-title{
    grid-column:1 / -1!important;
  }
  body.exercise-active .next-settings-group-danger{
    grid-column:1 / -1!important;
  }
}
@media(max-width:520px){
  body.exercise-active .next-pass-settings-menu,
  body.exercise-active .top-tools.next-pass-settings-menu{
    left:8px!important;
    right:8px!important;
    width:auto!important;
    max-height:calc(100dvh - 78px - env(safe-area-inset-top,0px))!important;
    overflow:auto!important;
    border-radius:24px!important;
  }
  body.exercise-active .next-settings-toggle,
  body.exercise-active .next-settings-action,
  body.exercise-active .next-settings-danger{
    min-height:60px!important;
  }
  body.exercise-active .next-settings-toggle-copy small,
  body.exercise-active .next-settings-action-copy small{
    display:none!important;
  }
  body.exercise-active .next-toggle-pill{
    width:88px!important;
    height:36px!important;
  }
  body.exercise-active .next-toggle-segment{height:28px!important;}
}

/* TV mode: media-first projector state. JS still owns the actual state and
   playlist visibility; CSS makes the mode visually meaningful again. */
body.exercise-active.tv-mode .next-pass-playlist-card,
body.exercise-active.tv-mode .playlist-card{
  display:none!important;
}
body.exercise-active.tv-mode .next-pass-progress-below{
  margin-top:8px!important;
}
body.exercise-active.tv-mode .next-pass-info-card{
  background:linear-gradient(180deg,rgba(8,22,40,.72),rgba(3,12,25,.74))!important;
}
@media(min-width:900px){
  body.exercise-active.tv-mode .next-pass-layout{
    grid-template-columns:minmax(0,1.42fr) minmax(320px,.58fr)!important;
    gap:14px!important;
  }
  body.exercise-active.tv-mode .next-pass-video-controls{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body.exercise-active.tv-mode .next-pass-info-card{
    align-content:start!important;
  }
  body.exercise-active.tv-mode .next-pass-info-card .coach-cues,
  body.exercise-active.tv-mode .next-pass-info-card .superset-status{
    padding:12px!important;
  }
}
@media(max-width:760px){
  body.exercise-active.tv-mode .next-pass-playlist-card{display:none!important;}
}

/* Live mode: keep all core controls available but reduce chrome density so the
   training content gets more screen. */
body.exercise-active.live-mode .next-pass-topbar{
  padding-top:max(4px,env(safe-area-inset-top,0px))!important;
  padding-bottom:6px!important;
  background:linear-gradient(180deg,rgba(5,10,19,.92),rgba(6,12,22,.86))!important;
}
body.exercise-active.live-mode .next-pass-action-row{
  min-height:48px!important;
}
body.exercise-active.live-mode .next-pass-progress-below{
  padding:8px 10px!important;
  margin-top:8px!important;
}
body.exercise-active.live-mode .next-pass-media-card,
body.exercise-active.live-mode .next-pass-info-card,
body.exercise-active.live-mode .next-pass-playlist-card{
  box-shadow:0 10px 28px rgba(0,0,0,.20),inset 0 1px 0 rgba(255,255,255,.030)!important;
}
body.exercise-active.live-mode .next-pass-kicker{
  opacity:.92!important;
}
@media(min-width:900px){
  body.exercise-active.live-mode .next-pass-mini-list{
    max-height:clamp(108px,15svh,176px)!important;
  }
}
/* Keep destructive settings action readable inside the grouped menu. */
body.exercise-active .next-settings-danger,
body.exercise-active .danger-tool.next-settings-danger{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
  grid-template-columns:none!important;
  min-height:58px!important;
}
body.exercise-active .next-settings-danger::before,
body.exercise-active .danger-tool.next-settings-danger::before{
  content:none!important;
  display:none!important;
}

/* =========================================================
   v97 layered exercise visual standard
   One component everywhere: theme background image + transparent figure image.
   No SVG fallback catalogue, no sport-specific fallback variants and no JS manifest.
   ========================================================= */
.next-exercise-visual{
  width:100%!important;
  border-radius:22px!important;
  overflow:hidden!important;
  border:1px solid rgba(116,231,255,.18)!important;
  background:rgba(7,17,32,.88)!important;
  box-shadow:0 18px 42px rgba(0,0,0,.18)!important;
}
.next-exercise-visual-stage{
  position:relative!important;
  width:100%!important;
  aspect-ratio:4/3!important;
  min-height:0!important;
  overflow:hidden!important;
  border-radius:inherit!important;
  background:linear-gradient(135deg,rgba(8,19,36,.92),rgba(5,12,24,.96))!important;
}
.next-exercise-visual-bg,
.next-exercise-visual-figure{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  display:block!important;
}
.next-exercise-visual-bg{
  object-fit:cover!important;
  z-index:0!important;
  opacity:1!important;
}
.next-exercise-visual-figure{
  object-fit:contain!important;
  object-position:center bottom!important;
  z-index:1!important;
  padding:3.5%!important;
  filter:drop-shadow(0 18px 24px rgba(0,14,32,.34))!important;
  background:transparent!important;
}
.next-exercise-visual-figure[data-figure-fallback="true"]{
  padding:9%!important;
  opacity:.9!important;
}
.next-exercise-visual-meta{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  padding:9px 11px!important;
  background:rgba(7,17,32,.92)!important;
  color:rgba(221,244,255,.86)!important;
}
.next-exercise-visual-meta b,
.next-exercise-visual-meta span{
  color:inherit!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-visual{
  margin:0!important;
  padding:0!important;
  box-shadow:none!important;
  border:0!important;
  border-radius:inherit!important;
  background:transparent!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-visual-stage{
  aspect-ratio:5/4!important;
  height:48px!important;
  border-radius:12px!important;
}
body:not(.exercise-active) .next-library-thumb .next-exercise-visual-meta{display:none!important;}
body:not(.exercise-active) .next-library-visual-panel .next-exercise-visual-stage{
  aspect-ratio:4/3!important;
}
body.exercise-active #videoWrap .next-pass-media-stage .next-exercise-visual{
  width:100%!important;
  height:100%!important;
  display:block!important;
  margin:0!important;
  border:0!important;
  border-radius:inherit!important;
  box-shadow:none!important;
  background:transparent!important;
}
body.exercise-active #videoWrap .next-pass-media-stage .next-exercise-visual-stage{
  width:100%!important;
  height:100%!important;
  aspect-ratio:auto!important;
  border-radius:inherit!important;
}
body.exercise-active #videoWrap .next-pass-media-stage .next-exercise-visual-meta{display:none!important;}
@media(max-width:560px){
  body:not(.exercise-active) .next-library-thumb .next-exercise-visual-stage{height:44px!important;}
  .next-exercise-visual-figure{padding:4.5%!important;}
}

/* v97 RC2 · Image Admin foundation */
.next-image-admin-shell{position:relative;z-index:1;}
.next-image-admin-root{width:100%;}
.next-image-admin-page{max-width:1440px;margin:0 auto;padding:clamp(14px,2vw,28px);}
.next-image-admin-header{position:relative;overflow:hidden;}
.next-image-admin-statusline{display:inline-flex;align-items:center;gap:8px;border:1px solid rgba(99,210,255,.35);border-radius:999px;padding:8px 12px;background:rgba(5,18,35,.72);color:#d8f6ff;font-weight:800;letter-spacing:.02em;}
.next-image-admin-statusline.is-ok{border-color:rgba(73,226,176,.65);box-shadow:0 0 0 1px rgba(73,226,176,.12) inset;}
.next-image-admin-statusline.is-muted{opacity:.82;}
.next-image-admin-toolbar{display:grid;grid-template-columns: minmax(220px,1.2fr) minmax(180px,.8fr) minmax(160px,.7fr) auto;gap:12px;align-items:end;padding:16px;}
.next-image-admin-field{display:grid;gap:6px;}
.next-image-admin-field label{font-size:.78rem;text-transform:uppercase;letter-spacing:.14em;color:#a77bff;font-weight:900;}
.next-image-admin-layout{display:grid;grid-template-columns:minmax(280px,380px) minmax(0,1fr);gap:16px;align-items:start;}
.next-image-admin-list-card,.next-image-admin-detail-card{padding:14px;min-height:260px;}
.next-image-admin-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;color:#f7fbff;}
.next-image-admin-card-head b{font-weight:1000;letter-spacing:.02em;}
.next-image-admin-card-head span{color:#b8c8dc;font-weight:800;}
.next-image-admin-list{display:grid;gap:8px;max-height:min(64vh,760px);overflow:auto;padding-right:4px;}
.next-image-admin-row{position:relative;width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;text-align:left;border:1px solid rgba(100,202,255,.26);border-radius:18px;background:linear-gradient(180deg,rgba(5,19,38,.92),rgba(3,13,28,.92));color:#fff;padding:13px 14px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(155,118,255,.08);}
.next-image-admin-row:hover,.next-image-admin-row.is-active{border-color:rgba(94,205,255,.72);background:linear-gradient(180deg,rgba(13,44,80,.96),rgba(4,18,38,.96));}
.next-image-admin-row-main{display:grid;gap:4px;min-width:0;}
.next-image-admin-row-main b{font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.next-image-admin-row-main small{color:#b8c8dc;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.next-image-status{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;border-radius:999px;padding:6px 9px;font-size:.72rem;font-weight:1000;letter-spacing:.04em;border:1px solid rgba(100,202,255,.32);background:rgba(6,22,43,.76);color:#dff8ff;}
.next-image-status.is-approved{border-color:rgba(71,230,177,.62);color:#bfffe9;background:rgba(24,87,70,.35);}
.next-image-status.is-draft{border-color:rgba(255,210,97,.68);color:#ffe7a5;background:rgba(96,72,20,.35);}
.next-image-status.is-missing{border-color:rgba(126,148,180,.38);color:#c9d7e8;}
.next-image-admin-empty{display:grid;place-items:center;align-content:center;min-height:220px;text-align:center;color:#d8e9fb;padding:24px;}
.next-image-admin-empty b{font-size:1.3rem;color:#fff;}
.next-image-admin-empty p{max-width:520px;color:#b8c8dc;}
.next-image-admin-empty.compact{min-height:90px;}
.next-image-admin-detail-grid{display:grid;grid-template-columns:minmax(260px,.88fr) minmax(320px,1.12fr);gap:16px;align-items:start;}
.next-image-admin-preview,.next-image-admin-prompt-panel{border:1px solid rgba(99,210,255,.22);border-radius:24px;background:rgba(3,14,30,.56);padding:14px;}
.next-image-admin-preview-visual{margin:0;}
.next-image-admin-preview-visual .next-exercise-visual-stage{min-height:clamp(240px,32vw,420px);}
.next-image-admin-chip-row{margin-top:12px;}
.next-image-admin-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px;}
.next-image-admin-action-status{min-height:1.3em;color:#bfefff;font-weight:800;margin:.8rem 0 0;}
.next-image-admin-prompt{min-height:360px;width:100%;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.86rem;line-height:1.5;resize:vertical;}
.next-image-admin-template-note{margin-top:12px;border:1px solid rgba(155,118,255,.22);border-radius:18px;padding:12px;background:rgba(9,24,48,.72);}
.next-image-admin-template-note b{color:#fff;}
.next-image-admin-template-note p{margin:.35rem 0 0;color:#c6d7ea;}
.next-image-admin-facts{margin-top:12px;}
.next-button-small{padding:8px 12px!important;border-radius:14px!important;font-size:.85rem!important;}
@media (max-width: 980px){
  .next-image-admin-toolbar{grid-template-columns:1fr 1fr;}
  .next-image-admin-layout{grid-template-columns:1fr;}
  .next-image-admin-list{max-height:38vh;}
  .next-image-admin-detail-grid{grid-template-columns:1fr;}
}
@media (max-width: 620px){
  .next-image-admin-page{padding:10px;}
  .next-image-admin-toolbar{grid-template-columns:1fr;}
  .next-image-admin-list-card,.next-image-admin-detail-card{padding:10px;border-radius:22px;}
  .next-image-admin-row{grid-template-columns:1fr;align-items:start;}
  .next-image-admin-prompt{min-height:280px;}
  .next-image-admin-preview-visual .next-exercise-visual-stage{min-height:260px;}
}

/* v97 RC3 · ChatGPT one-image handoff workflow */
.next-image-admin-reference-card{border:1px solid rgba(99,210,255,.22);border-radius:20px;background:linear-gradient(180deg,rgba(6,20,42,.88),rgba(3,12,28,.86));padding:12px;margin-bottom:12px;}
.next-image-admin-reference-frame{position:relative;aspect-ratio:16/9;border-radius:18px;overflow:hidden;border:1px solid rgba(99,210,255,.18);background:linear-gradient(135deg,rgba(255,255,255,.08) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.08) 50%,rgba(255,255,255,.08) 75%,transparent 75%);background-size:28px 28px;display:grid;place-items:center;}
.next-image-admin-reference-frame img{width:100%;height:100%;object-fit:contain;display:block;}
.next-image-admin-reference-card p{margin:.7rem 0 0;color:#c6d7ea;font-weight:700;line-height:1.35;}
.next-image-admin-copy-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0;}
.next-image-admin-text-label{display:block;margin:12px 0 6px;color:#a77bff;font-weight:1000;letter-spacing:.12em;text-transform:uppercase;font-size:.76rem;}
.next-image-admin-motion{min-height:140px;width:100%;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.86rem;line-height:1.45;resize:vertical;}
.next-image-admin-handoff-paths{display:grid;gap:8px;margin-top:12px;border:1px solid rgba(155,118,255,.2);border-radius:18px;background:rgba(6,20,42,.76);padding:10px;}
.next-image-admin-handoff-paths span{display:grid;gap:3px;color:#d8e9fb;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.78rem;word-break:break-all;}
.next-image-admin-handoff-paths b{font-family:inherit;color:#65d9ff;font-size:.7rem;text-transform:uppercase;letter-spacing:.12em;}
@media (max-width: 760px){
  .next-image-admin-copy-grid{grid-template-columns:1fr;}
  .next-image-admin-reference-frame{min-height:180px;}
}

/* v97 RC12 · Pose sprite library + Bildadmin sequence builder prototype */
.next-pose-builder{margin-top:16px;padding:14px;border-radius:24px;background:linear-gradient(180deg,rgba(4,17,36,.88),rgba(2,9,22,.92));border:1px solid rgba(99,210,255,.22);}
.next-pose-builder-preview{margin:0 0 12px;}
.next-pose-preview-stage{min-height:clamp(220px,28vw,390px);}
.next-pose-preview-row{position:relative;z-index:2;width:100%;height:100%;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(100px,1fr);align-items:end;justify-items:center;gap:clamp(6px,1vw,14px);padding:clamp(10px,2vw,22px);}
.next-pose-preview-row.is-empty{place-items:center;align-items:center;color:#d8e9fb;font-weight:900;text-align:center;}
.next-pose-preview-row img{max-width:100%;max-height:88%;object-fit:contain;filter:drop-shadow(0 14px 22px rgba(0,0,0,.35));}
.next-pose-builder-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:10px 0 12px;}
.next-pose-builder-controls label{display:flex;align-items:center;gap:8px;color:#a77bff;font-weight:1000;text-transform:uppercase;letter-spacing:.12em;font-size:.76rem;}
.next-pose-builder-controls .next-input{min-width:190px;}
.next-pose-sequence-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin:12px 0 16px;}
.next-pose-sequence-card,.next-pose-bank-card{border:1px solid rgba(99,210,255,.22);border-radius:18px;background:linear-gradient(180deg,rgba(6,22,46,.88),rgba(3,12,28,.88));color:#f7fbff;padding:10px;text-align:left;display:grid;gap:7px;min-width:0;}
.next-pose-sequence-card.is-missing{border-color:rgba(255,188,98,.45);}
.next-pose-thumb,.next-pose-bank-thumb{position:relative;aspect-ratio:16/10;border-radius:14px;overflow:hidden;background:radial-gradient(circle at 50% 80%,rgba(92,220,255,.14),rgba(4,14,28,.88));display:grid;place-items:center;border:1px solid rgba(255,255,255,.08);}
.next-pose-thumb img,.next-pose-bank-thumb img{width:100%;height:100%;object-fit:contain;display:block;filter:drop-shadow(0 10px 16px rgba(0,0,0,.32));}
.next-pose-sequence-card b,.next-pose-bank-card b{font-size:.82rem;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.next-pose-sequence-card small,.next-pose-bank-card small{color:#b8c8dc;font-weight:800;font-size:.72rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.next-pose-card-actions{display:flex;gap:5px;flex-wrap:wrap;}
.next-button-mini{min-height:28px;padding:4px 8px;border-radius:10px;font-size:.72rem;}
.next-pose-bank-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:9px;max-height:min(56vh,620px);overflow:auto;padding:2px 4px 2px 0;}
.next-pose-bank-card{cursor:pointer;transition:transform .16s ease,border-color .16s ease,background .16s ease;}
.next-pose-bank-card:hover{transform:translateY(-1px);border-color:rgba(99,210,255,.68);background:linear-gradient(180deg,rgba(16,48,86,.96),rgba(5,18,38,.94));}
@media (max-width:720px){
  .next-pose-preview-row{grid-auto-columns:minmax(70px,1fr);gap:5px;padding:8px;}
  .next-pose-builder-controls{align-items:stretch;}
  .next-pose-builder-controls .next-button,.next-pose-builder-controls label{width:100%;justify-content:center;}
  .next-pose-sequence-list{grid-template-columns:repeat(2,minmax(0,1fr));}
  .next-pose-bank-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:46vh;}
}

/* RC13 · Pose slot scaling + floor baseline controls */
.next-pose-preview-stage{
  position:relative;
  min-height:clamp(230px,30vw,410px);
  overflow:hidden;
  --pose-floor-y:84%;
  --pose-slot-count:5;
}
.next-pose-preview-floor{
  position:absolute;
  left:clamp(16px,3vw,46px);
  right:clamp(16px,3vw,46px);
  top:var(--pose-floor-y);
  border-top:2px dashed rgba(122,219,255,.52);
  z-index:3;
  pointer-events:none;
  opacity:.82;
}
.next-pose-slot-guides{position:absolute;inset:0;z-index:2;pointer-events:none;}
.next-pose-slot-guide{
  position:absolute;
  top:9%;
  bottom:9%;
  width:1px;
  left:calc((var(--pose-slot) - .5) * (100% / var(--pose-slot-count,5)));
  background:linear-gradient(180deg,transparent,rgba(255,255,255,.15),transparent);
}
.next-pose-preview-row{
  position:absolute;
  inset:0;
  z-index:4;
  display:block;
  padding:0;
  pointer-events:none;
}
.next-pose-preview-row.is-empty{display:grid;place-items:center;color:#d8e9fb;font-weight:900;text-align:center;padding:20px;}
.next-pose-preview-img{
  position:absolute;
  left:calc((var(--pose-slot) - .5) * (100% / var(--pose-slot-count,5)));
  top:var(--pose-floor-y);
  width:auto;
  height:var(--pose-h,70%);
  max-width:calc(100% / var(--pose-slot-count,5) * 1.35);
  max-height:88%;
  object-fit:contain;
  transform:translate(calc(-50% + var(--pose-x,0px)), calc(-100% + var(--pose-y,0px)));
  transform-origin:50% 100%;
  z-index:var(--pose-z,1);
  filter:drop-shadow(0 14px 22px rgba(0,0,0,.38));
  pointer-events:none;
}
.next-pose-layout-controls{border:1px solid rgba(99,210,255,.14);border-radius:18px;padding:10px;background:rgba(3,12,28,.45);}
.next-pose-layout-controls label{min-width:min(260px,100%);}
.next-pose-layout-controls input[type="range"]{accent-color:#62cfff;min-width:130px;}
.next-pose-layout-controls span{min-width:54px;text-align:right;color:#dff8ff;font-weight:1000;}
.next-pose-transform-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
.next-pose-transform-grid label{font-size:.66rem;color:#a77bff;font-weight:1000;text-transform:uppercase;letter-spacing:.08em;display:grid;gap:3px;}
.next-pose-transform-grid .next-input{min-width:0;padding:6px 7px;border-radius:10px;font-size:.76rem;}
@media (max-width:700px){
  .next-pose-preview-stage{min-height:240px;}
  .next-pose-preview-img{max-width:calc(100% / var(--pose-slot-count,5) * 1.55);}
  .next-pose-transform-grid{grid-template-columns:1fr;}
}

/* RC14 · Pose cleanup workflow + app-owned arrows */
.next-pose-arrow-layer{
  position:absolute;
  inset:0;
  z-index:5;
  pointer-events:none;
}
.next-pose-arrow{
  position:absolute;
  left:var(--arrow-x,50%);
  top:var(--arrow-y,76%);
  width:var(--arrow-length,18%);
  height:0;
  transform:translate(-50%,-50%) rotate(var(--arrow-rotation,0deg));
  transform-origin:50% 50%;
  filter:drop-shadow(0 6px 10px rgba(0,80,150,.30));
  opacity:.96;
}
.next-pose-arrow i{
  display:block;
  position:relative;
  height:8px;
  border-radius:999px;
  background:linear-gradient(90deg,rgba(82,199,255,.08),rgba(50,154,255,.96));
  box-shadow:0 0 16px rgba(90,210,255,.34);
}
.next-pose-arrow i::after{
  content:"";
  position:absolute;
  right:-2px;
  top:50%;
  transform:translateY(-50%);
  border-left:18px solid rgba(50,154,255,.96);
  border-top:12px solid transparent;
  border-bottom:12px solid transparent;
}
.next-pose-arrow-bounce i{background:linear-gradient(90deg,rgba(82,199,255,.05),rgba(83,211,255,.92));}
.next-pose-arrow-bounce i::before{
  content:"";
  position:absolute;
  left:10%;
  right:10%;
  top:-13px;
  border-top:3px dashed rgba(98,220,255,.8);
  opacity:.8;
}
.next-card-subsection{
  border:1px solid rgba(99,210,255,.14);
  border-radius:20px;
  padding:12px;
  margin:10px 0 14px;
  background:rgba(3,12,28,.42);
}
.next-pose-arrow-list{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(168px,1fr));
  gap:10px;
  margin-top:10px;
}
.next-pose-arrow-card{
  display:grid;
  gap:7px;
  padding:10px;
  border-radius:16px;
  border:1px solid rgba(99,210,255,.18);
  background:linear-gradient(180deg,rgba(6,22,46,.88),rgba(3,12,28,.88));
}
.next-pose-arrow-card b{font-size:.82rem;color:#f8fbff;}
.next-pose-arrow-card label{display:grid;gap:3px;font-size:.66rem;color:#a77bff;font-weight:1000;text-transform:uppercase;letter-spacing:.08em;}
.next-pose-arrow-card .next-input{min-width:0;padding:6px 7px;border-radius:10px;font-size:.76rem;}
.next-pose-bank-card small,
.next-pose-sequence-card small{white-space:normal;}
.next-pose-bank-card[data-cleanup="needs-cleanup"]{border-color:rgba(255,188,98,.34);}
.next-pose-cleanup-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:max-content;
  padding:3px 7px;
  border-radius:999px;
  background:rgba(255,188,98,.14);
  color:#ffe0aa;
  border:1px solid rgba(255,188,98,.32);
  font-size:.62rem;
  font-weight:1000;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.next-pose-cleanup-badge.is-ok{background:rgba(84,245,180,.13);color:#b8ffe4;border-color:rgba(84,245,180,.28);}

/* RC15 · Pose curation controls: stronger arrows + precision transform UI */
.next-pose-transform-panel{
  display:grid;
  gap:8px;
  padding:8px;
  border:1px solid rgba(99,210,255,.16);
  border-radius:14px;
  background:rgba(2,10,25,.38);
}
.next-pose-nudge-pad,
.next-pose-arrow-nudge-pad{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:5px;
  align-items:center;
}
.next-pose-transform-grid label,
.next-pose-arrow-card label{
  grid-template-columns:58px minmax(80px,1fr) 58px;
  align-items:center;
  color:#9fe9ff;
}
.next-pose-transform-grid input[type="range"],
.next-pose-arrow-card input[type="range"]{
  width:100%;
  accent-color:#5fd9ff;
}
.next-pose-transform-grid output,
.next-pose-arrow-card output{
  color:#f8fbff;
  font-weight:1000;
  text-align:right;
  font-size:.72rem;
}
.next-pose-card-actions{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.next-pose-arrow-layer{
  z-index:18;
  mix-blend-mode:normal;
}
.next-pose-arrow{
  min-width:64px;
  filter:drop-shadow(0 3px 2px rgba(0,16,36,.72)) drop-shadow(0 0 12px rgba(51,181,255,.86));
  opacity:1;
}
.next-pose-arrow i{
  height:12px;
  background:linear-gradient(90deg,rgba(164,236,255,.18),#57d9ff 34%,#228cff 100%);
  border:2px solid rgba(235,253,255,.95);
  box-shadow:0 0 0 2px rgba(13,69,145,.45),0 0 26px rgba(72,207,255,.85);
}
.next-pose-arrow i::after{
  right:-24px;
  border-left-width:28px;
  border-top-width:18px;
  border-bottom-width:18px;
  border-left-color:#228cff;
  filter:drop-shadow(0 0 4px rgba(240,253,255,.9));
}
.next-pose-arrow b{
  position:absolute;
  left:50%;
  top:50%;
  width:18px;
  height:18px;
  transform:translate(-50%,-50%);
  border-radius:999px;
  border:2px solid rgba(235,253,255,.98);
  background:#122d59;
  box-shadow:0 0 0 2px rgba(33,155,255,.52),0 0 18px rgba(94,221,255,.8);
}
.next-pose-arrow-bounce i{
  background:linear-gradient(90deg,rgba(164,236,255,.10),#69e8ff 55%,#22a2ff 100%);
}
.next-pose-arrow-bounce i::before{
  top:-19px;
  border-top:5px dashed rgba(116,238,255,.98);
}
.next-pose-arrow-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.next-pose-arrow-presets{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:5px;
}
.next-pose-arrow-card{
  border-color:rgba(91,217,255,.30);
  background:linear-gradient(180deg,rgba(7,31,66,.94),rgba(3,12,28,.92));
}
.next-pose-builder-preview[data-has-arrows="true"] .next-pose-preview-floor{
  opacity:.48;
}
@media (max-width:700px){
  .next-pose-transform-grid label,
  .next-pose-arrow-card label{grid-template-columns:50px minmax(80px,1fr) 52px;}
  .next-pose-arrow-presets{grid-template-columns:1fr;}
}

/* RC15 safe-slot refinement: keep first/last full-body poses inside the 16:9 stage */
.next-pose-slot-guide{
  left:calc(6% + (var(--pose-slot) - .5) * (88% / var(--pose-slot-count,5)));
}
.next-pose-preview-img{
  left:calc(6% + (var(--pose-slot) - .5) * (88% / var(--pose-slot-count,5)));
  max-width:calc(88% / var(--pose-slot-count,5) * 1.08);
}
@media (max-width:700px){
  .next-pose-preview-img{max-width:calc(88% / var(--pose-slot-count,5) * 1.22);}
}

/* RC16 · Pass runtime pose-motion fallback behind setting */
body.exercise-active #videoWrap .next-pass-media-stage .next-pose-motion-visual,
body.exercise-active #videoWrap .next-pass-media-stage .next-pose-motion-visual .next-exercise-visual-stage{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  aspect-ratio:16/9!important;
  border-radius:24px!important;
  overflow:hidden!important;
}
body.exercise-active #videoWrap .next-pose-motion-visual .next-pose-preview-floor,
body.exercise-active #videoWrap .next-pose-motion-visual .next-pose-slot-guides{
  opacity:.22;
}
body.exercise-active #videoWrap .next-pose-motion-visual .next-pose-preview-img{
  pointer-events:none;
}
body.exercise-active #videoWrap .has-pose-motion .next-pose-motion-visual{
  background:#06152a;
}
body.exercise-active.motion-fallback-enabled #videoWrap .has-pose-motion::after{
  content:"Motion fallback";
  position:absolute;
  left:16px;
  top:14px;
  z-index:30;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(2,12,26,.72);
  border:1px solid rgba(103,222,255,.38);
  color:#dff8ff;
  font-size:.72rem;
  font-weight:1000;
  letter-spacing:.08em;
  text-transform:uppercase;
  backdrop-filter:blur(8px);
}
.next-pass-settings-menu #motionFallbackBtn[data-state="on"] .next-toggle-pill{
  box-shadow:0 0 0 1px rgba(90,223,255,.38),0 0 24px rgba(76,209,255,.18);
}

/* RC17 · Pose runtime polish: CSS-only stepped motion, timing and mobile readability */
body.exercise-active #videoWrap .next-pose-motion-visual{
  --motion-loop:1300ms;
  contain:layout paint;
}
body.exercise-active #videoWrap .next-pose-motion-visual .next-pose-runtime-img{
  opacity:.48;
  will-change:transform,opacity,filter;
  animation:nextPoseRuntimeStep var(--motion-loop,1300ms) cubic-bezier(.22,.85,.28,1) infinite;
  animation-delay:var(--pose-delay,0ms);
}
body.exercise-active #videoWrap .next-pose-motion-playhead{
  position:absolute;
  left:6%;
  bottom:calc(100% - var(--pose-floor-y,84%) + 8px);
  width:clamp(30px,7vw,82px);
  height:3px;
  z-index:17;
  border-radius:999px;
  background:linear-gradient(90deg,rgba(103,226,255,0),rgba(103,226,255,.95),rgba(103,226,255,0));
  box-shadow:0 0 18px rgba(82,211,255,.62);
  opacity:.72;
  animation:nextPosePlayhead var(--motion-loop,1300ms) linear infinite;
  pointer-events:none;
}
@keyframes nextPoseRuntimeStep{
  0%,100%{
    opacity:.42;
    filter:drop-shadow(0 10px 16px rgba(0,0,0,.24)) saturate(.9);
    transform:translate(calc(-50% + var(--pose-x,0px)), calc(-100% + var(--pose-y,0px))) scale(.955);
  }
  18%,36%{
    opacity:1;
    filter:drop-shadow(0 20px 28px rgba(0,0,0,.46)) drop-shadow(0 0 18px rgba(95,218,255,.28)) saturate(1.08);
    transform:translate(calc(-50% + var(--pose-x,0px)), calc(-100% + var(--pose-y,0px) - 4px)) scale(1.045);
  }
  50%{
    opacity:.58;
  }
}
@keyframes nextPosePlayhead{
  from{left:6%;}
  to{left:94%;}
}
@media (max-width:700px){
  body.exercise-active #videoWrap .next-pose-motion-visual,
  body.exercise-active #videoWrap .next-pose-motion-visual .next-exercise-visual-stage{
    border-radius:18px!important;
  }
  body.exercise-active #videoWrap .next-pose-motion-visual .next-pose-preview-floor,
  body.exercise-active #videoWrap .next-pose-motion-visual .next-pose-slot-guides{
    opacity:.12;
  }
  body.exercise-active #videoWrap .next-pose-motion-playhead{
    opacity:.45;
    width:42px;
  }
  body.exercise-active.motion-fallback-enabled #videoWrap .has-pose-motion::after{
    left:10px;
    top:10px;
    padding:5px 8px;
    font-size:.64rem;
  }
}
@media (prefers-reduced-motion:reduce){
  body.exercise-active #videoWrap .next-pose-motion-visual .next-pose-runtime-img,
  body.exercise-active #videoWrap .next-pose-motion-playhead{
    animation:none!important;
  }
  body.exercise-active #videoWrap .next-pose-motion-visual .next-pose-runtime-img{
    opacity:.86;
  }
}

/* RC18 · iPhone-safe JS pose runtime + athlete scale normalization */
body.exercise-active #videoWrap .next-pose-motion-visual.is-js-driven .next-pose-runtime-img{
  animation:none!important;
  opacity:.42;
  transition:opacity .16s ease,transform .16s ease,filter .16s ease;
  transform:translate(calc(-50% + var(--pose-x,0px)), calc(-100% + var(--pose-y,0px))) scale(.96);
}
body.exercise-active #videoWrap .next-pose-motion-visual.is-js-driven .next-pose-runtime-img.is-runtime-active{
  opacity:1;
  filter:drop-shadow(0 20px 28px rgba(0,0,0,.46)) drop-shadow(0 0 18px rgba(95,218,255,.28)) saturate(1.08);
  transform:translate(calc(-50% + var(--pose-x,0px)), calc(-100% + var(--pose-y,0px) - 4px)) scale(1.035);
}
body.exercise-active #videoWrap .next-pose-motion-visual.is-js-driven .next-pose-motion-playhead{
  animation:none!important;
  left:var(--pose-playhead-x,6%);
  transition:left .06s linear;
}
body.exercise-active #videoWrap .next-pose-motion-visual[data-scale-mode="sequence-upright"] .next-pose-preview-img[data-pose-kind="upright"]{
  max-height:82%;
}
body.exercise-active #videoWrap .next-pose-motion-visual .next-pose-preview-img[data-pose-kind="floor"]{
  max-height:56%;
}
@media (max-width:700px){
  body.exercise-active #videoWrap .next-pose-motion-visual.is-js-driven .next-pose-runtime-img.is-runtime-active{
    transform:translate(calc(-50% + var(--pose-x,0px)), calc(-100% + var(--pose-y,0px) - 3px)) scale(1.025);
  }
}


/* RC23 · Program switch prompt made visible inline instead of hidden modal state */
body:not(.exercise-active) .program59-inline-panel{
  grid-column:1/-1!important;
  width:100%!important;
  margin-top:10px!important;
  display:grid!important;
  gap:10px!important;
  border-color:rgba(165,122,255,.38)!important;
  background:linear-gradient(180deg,rgba(15,35,68,.96),rgba(8,16,34,.96))!important;
}
body:not(.exercise-active) .program59-inline-panel strong{color:#f2f8ff!important;font-size:1rem!important;}
body:not(.exercise-active) .program59-inline-panel p{margin:0!important;color:var(--next-muted)!important;line-height:1.45!important;}
body:not(.exercise-active) .program59-inline-panel .program59-modal-actions{display:flex!important;flex-wrap:wrap!important;gap:8px!important;}
body:not(.exercise-active) .program59-inline-panel .program59-modal-actions .next-button{flex:1 1 150px!important;}

/* RC24 · Exercise test pass launcher (ordinary library surface, no MotionQA route) */
.next-library-testpass{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px;
}
.next-library-testpass-copy{
  display:grid;
  gap:4px;
  min-width:0;
}
.next-library-testpass-copy b{
  color:var(--next-text,#fff);
  font-size:1.02rem;
}
.next-library-testpass-copy span{
  color:var(--next-muted,rgba(255,255,255,.72));
  line-height:1.35;
}
.next-library-testpass-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
@media (max-width:720px){
  .next-library-testpass{align-items:stretch;flex-direction:column;}
  .next-library-testpass-actions{justify-content:stretch;}
  .next-library-testpass-actions .next-button{flex:1 1 140px;}
}
