
/* NEXT v86.4: final pass-control separation
   This file is intentionally loaded last.
   It physically matches the v86.4 DOM where Menu/Overview live in the sticky top header,
   while Föregående/Nästa live in .pass-bottom-controls outside the header.
*/

/* Default/desktop: controls sit as a clean row under the top pass status, not inside it. */
.pass-bottom-controls{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:10px;
  margin:10px 0 14px;
  position:relative;
  z-index:50;
}
.pass-bottom-controls .ghost-btn,
.pass-bottom-controls .main-btn{
  min-width:170px;
  min-height:48px;
  justify-content:center;
}

/* Pass header now only owns menu + overview + progress. */
body.exercise-active .sticky-nav .nav-actions{
  display:block!important;
}
body.exercise-active .sticky-nav .nav-left{
  width:100%!important;
  max-width:none!important;
}
body.exercise-active .sticky-nav .nav-right:not(.pass-bottom-controls){
  display:none!important;
}

@media(max-width:1059px){
  /* Keep the top header compact and reserve it only for Menu/Overview. */
  body.exercise-active .sticky-nav{
    position:sticky!important;
    top:0!important;
    z-index:320!important;
    margin:0 0 6px!important;
    padding:6px 8px 5px!important;
    border-radius:0!important;
    background:rgba(3,7,17,.98)!important;
    border-bottom:1px solid rgba(170,205,255,.14)!important;
  }
  body.exercise-active .sticky-nav .nav-row{
    display:grid!important;
    gap:4px!important;
  }
  body.exercise-active .sticky-nav .nav-actions{
    display:block!important;
    position:static!important;
  }
  body.exercise-active .sticky-nav .nav-left{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    position:static!important;
  }
  body.exercise-active .sticky-nav .menu-wrap{
    position:static!important;
    width:100%!important;
    min-width:0!important;
  }
  body.exercise-active .sticky-nav .menu-toggle,
  body.exercise-active .sticky-nav .nav-left .ghost-btn{
    width:100%!important;
    min-width:0!important;
    height:40px!important;
    min-height:40px!important;
    padding:8px 10px!important;
    border-radius:15px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:14px!important;
    line-height:1!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    box-shadow:0 10px 28px rgba(0,0,0,.20)!important;
  }
  body.exercise-active .sticky-nav .menu-toggle{
    background:linear-gradient(180deg,rgba(255,255,255,.085),rgba(255,255,255,.04))!important;
    border:1px solid rgba(170,205,255,.18)!important;
    color:#f8fbff!important;
  }
  body.exercise-active .sticky-nav .nav-left .ghost-btn{
    background:rgba(255,255,255,.045)!important;
    border:1px solid rgba(255,255,255,.12)!important;
    color:#eaf5ff!important;
  }

  body.exercise-active #exerciseMeta{
    font-size:11.5px!important;
    line-height:1.1!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body.exercise-active .progress-shell{
    height:5px!important;
    margin-top:2px!important;
  }

  /* The only prev/next container in mobile pass mode. */
  body.exercise-active .pass-bottom-controls{
    position:fixed!important;
    left:8px!important;
    right:8px!important;
    bottom:calc(8px + env(safe-area-inset-bottom))!important;
    z-index:340!important;
    display:grid!important;
    grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr)!important;
    gap:8px!important;
    margin:0!important;
    padding:0!important;
    width:auto!important;
    max-width:none!important;
    pointer-events:auto!important;
  }
  body.exercise-active .pass-bottom-controls .ghost-btn,
  body.exercise-active .pass-bottom-controls .main-btn{
    width:100%!important;
    min-width:0!important;
    height:56px!important;
    min-height:56px!important;
    padding:0 10px!important;
    border-radius:18px!important;
    font-size:15px!important;
    line-height:1!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    box-shadow:0 18px 44px rgba(0,0,0,.46)!important;
  }

  /* Reserve space for the fixed bottom controls so they don't cover the card. */
  body.exercise-active .stage-layout{
    padding-bottom:76px!important;
  }

  /* Settings menu opens below the sticky menu row, never over prev/next. */
  body.exercise-active .top-tools{
    position:fixed!important;
    left:8px!important;
    right:8px!important;
    top:54px!important;
    width:auto!important;
    max-height:calc(100dvh - 132px)!important;
    overflow:auto!important;
    z-index:360!important;
    display:none!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    padding:8px!important;
    border-radius:16px!important;
    background:rgba(6,12,22,.98)!important;
    border:1px solid rgba(170,205,255,.18)!important;
    box-shadow:0 22px 70px rgba(0,0,0,.56)!important;
  }
  body.exercise-active .top-tools.open{display:grid!important;}
}

@media(max-width:420px){
  body.exercise-active .pass-bottom-controls .ghost-btn,
  body.exercise-active .pass-bottom-controls .main-btn{
    height:54px!important;
    min-height:54px!important;
    font-size:14px!important;
    border-radius:17px!important;
  }
}

/* Small-height/landscape: still separated, but slimmer. */
@media(max-width:1059px) and (orientation:landscape){
  body.exercise-active .sticky-nav{
    padding:4px 8px!important;
    margin-bottom:4px!important;
  }
  body.exercise-active .sticky-nav .menu-toggle,
  body.exercise-active .sticky-nav .nav-left .ghost-btn{
    height:34px!important;
    min-height:34px!important;
    border-radius:13px!important;
    font-size:12px!important;
  }
  body.exercise-active .pass-bottom-controls{
    bottom:calc(5px + env(safe-area-inset-bottom))!important;
    gap:7px!important;
  }
  body.exercise-active .pass-bottom-controls .ghost-btn,
  body.exercise-active .pass-bottom-controls .main-btn{
    height:42px!important;
    min-height:42px!important;
    border-radius:14px!important;
    font-size:13px!important;
  }
  body.exercise-active .stage-layout{
    padding-bottom:52px!important;
  }
  body.exercise-active .top-tools{
    top:44px!important;
    max-height:calc(100dvh - 104px)!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
}
