/* 27 Nov tidy-up (Gym, Passive Income tips, dialogs). Loaded last. */

/* ---------- Workout timer: frosted glass pill ---------- */
html body #lyFloatTimer#lyFloatTimer{background:rgba(22,24,32,.38)!important;border:1px solid rgba(255,255,255,.2)!important;box-shadow:0 10px 28px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.12)!important;
 backdrop-filter:blur(20px) saturate(1.5);-webkit-backdrop-filter:blur(20px) saturate(1.5)}
html body #lyFloatTimer#lyFloatTimer .t{background:none!important;color:#fff!important;-webkit-text-fill-color:#fff!important}
html body #lyFloatTimer#lyFloatTimer .p{background:rgba(255,255,255,.18)!important;border:1px solid rgba(255,255,255,.25)!important;box-shadow:none!important}
html body #lyFloatTimer#lyFloatTimer .p::before{background:#fff!important}

/* ---------- Floating + : smaller, tucks away while you scroll down so it never sits on a delete button ---------- */
html body #glFab#glFab{width:50px!important;height:50px!important;min-height:50px!important;transition:transform .25s cubic-bezier(.2,.8,.2,1),opacity .2s!important}
html body #glFab#glFab.gl-tucked{transform:translateY(calc(100% + 40px))!important;opacity:0;pointer-events:none}
html body #logModal #logExercises{padding-bottom:84px!important}

/* ---------- "Workout in progress" pop-up: frosted glass, no boxes inside ---------- */
html body #lyResumeDialog#lyResumeDialog .ly-resume-box{background:rgba(20,22,30,.42)!important;border:1px solid rgba(255,255,255,.18)!important;
 backdrop-filter:blur(28px) saturate(1.5);-webkit-backdrop-filter:blur(28px) saturate(1.5);box-shadow:0 30px 80px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,255,255,.12)!important}
html body #lyResumeDialog#lyResumeDialog::backdrop{background:rgba(5,7,13,.35)}
html body #lyResumeDialog#lyResumeDialog .ly-resume-eyebrow{padding:0;margin:0 0 8px;background:none;border:0;letter-spacing:0;text-transform:none;font-size:13px;font-weight:750;color:#c9cde0}
html body #lyResumeDialog#lyResumeDialog .ly-resume-card{background:none;border:0;box-shadow:none;padding:0;margin-top:20px}
html body #lyResumeDialog#lyResumeDialog .ly-resume-ic{background:rgba(255,255,255,.14);color:#fff;box-shadow:none;border:1px solid rgba(255,255,255,.2)}
html body #lyResumeDialog#lyResumeDialog .ly-resume-stats{gap:0;margin-top:18px;padding-top:14px;border-top:1px solid rgba(255,255,255,.12)}
html body #lyResumeDialog#lyResumeDialog .ly-resume-stat{background:none;border:0;border-radius:0;padding:0 14px;border-left:1px solid rgba(255,255,255,.12)}
html body #lyResumeDialog#lyResumeDialog .ly-resume-stat:first-child{padding-left:0;border-left:0}
html body #lyResumeDialog#lyResumeDialog .ly-resume-stat span{letter-spacing:0;text-transform:none;font-size:12.5px;color:#aab0c6}
html body #lyResumeDialog#lyResumeDialog .ly-resume-stat .ly-resume-clock{background:none;color:#fff;-webkit-text-fill-color:#fff}
html body #lyResumeDialog#lyResumeDialog .ly-resume-primary{background:#a5b4fc!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.45),0 8px 20px rgba(0,0,0,.3)!important}
html body #lyResumeDialog#lyResumeDialog :is(.ly-resume-later,.ly-resume-discard){background:none!important;border:0!important;box-shadow:none!important}
html body #lyResumeDialog#lyResumeDialog .ly-resume-later{color:#e6e8f2!important}
html body #lyResumeDialog#lyResumeDialog .ly-resume-discard{color:#fca5a5!important}

/* ---------- Workout history: the numbers always fit ---------- */
html body #gymPage table.ly-hs-stats{table-layout:fixed;width:100%}
html body #gymPage table.ly-hs-stats :is(th,td){overflow:visible!important;text-overflow:clip!important;white-space:nowrap!important;max-width:none!important;padding:8px 10px!important}
html body #gymPage table.ly-hs-stats th{letter-spacing:.02em!important;font-size:11px!important}
@media(max-width:480px){html body #gymPage table.ly-hs-stats td{font-size:14.5px!important}html body #gymPage table.ly-hs-stats :is(th,td){padding:7px 8px!important}}

/* ---------- Delete prompts: plain text choices ---------- */
html body #lyAppDialog#lyAppDialog:has(#lyAppDialogAccept.ly-dialog-danger) .ly-dialog-actions{gap:22px}
html body #lyAppDialog#lyAppDialog:has(#lyAppDialogAccept.ly-dialog-danger) .ly-dialog-actions button{background:none!important;border:0!important;box-shadow:none!important;padding:10px 4px!important;min-height:44px;font-size:16px!important;font-weight:850!important}
html body #lyAppDialog#lyAppDialog:has(#lyAppDialogAccept.ly-dialog-danger) #lyAppDialogCancel{color:#e6e8f2!important}
html body #lyAppDialog#lyAppDialog #lyAppDialogAccept.ly-dialog-danger{color:#f87171!important}
html body #lyAppDialog#lyAppDialog:has(#lyAppDialogAccept.ly-dialog-danger) .ly-dialog-actions button:focus-visible{outline:0!important;text-decoration:underline;text-underline-offset:6px}
html[data-theme="light"] body #lyAppDialog#lyAppDialog:has(#lyAppDialogAccept.ly-dialog-danger) #lyAppDialogCancel{color:#1c1f2a!important}
html[data-theme="light"] body #lyAppDialog#lyAppDialog #lyAppDialogAccept.ly-dialog-danger{color:#b91c1c!important}

/* ---------- Tips: month header reads like the shift months ---------- */
html body .ly-alt-month>summary.ly-tips-summary{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:5px 14px}
html body .ly-tips-summary>strong,html body .ly-tips-summary>.tiny{grid-column:1}
html body .ly-tips-summary .ly-group-totals{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
html body .ly-tips-summary .ly-gt{display:inline-flex;align-items:baseline;gap:6px;padding:5px 11px;border-radius:99px;font-variant-numeric:tabular-nums}
html body .ly-tips-summary .ly-gt small{font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;opacity:.85}
html body .ly-tips-summary .ly-gt b{font-size:14px;font-weight:850}
html body .ly-tips-summary .ly-gt-unpaid{background:rgba(249,115,22,.12);border:1px solid rgba(249,115,22,.4);color:#fdba74}
html body .ly-tips-summary .ly-gt-paid{background:rgba(74,222,128,.1);border:1px solid rgba(74,222,128,.35);color:#86efac}

/* ---------- Gym: neutral chevron tiles with a white arrow (routines and Strength Signal) ---------- */
html body #gymPage .compact-routine>.routine-summary::before{background:rgba(255,255,255,.06)!important;border:1px solid rgba(255,255,255,.16)!important}
html body #gymPage .compact-routine>.routine-summary::after{background:#fff!important}
html body #gymPage .ly-strength-disclosure>summary::before{background:rgba(255,255,255,.06)!important;border-color:rgba(255,255,255,.16)!important;box-shadow:none!important}
html body #gymPage .ly-strength-disclosure>summary::after{color:#fff!important;border-color:#fff!important}
html body #gymPage .ly-strength-disclosure>summary h2{font-weight:900!important}

/* ---------- Strength Signal: picker button, measure as one segmented control, no graph ---------- */
html body #gymPage .exercise-trend-controls{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important}
html body #gymPage .exercise-trend-controls label{grid-column:auto!important;margin-top:6px}
.tidy-hidden-select{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;overflow:hidden!important}
html body #gymPage .tidy-pick{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:0 16px!important;border-radius:14px!important;text-align:left;cursor:pointer;
 background:rgba(255,255,255,.05)!important;border:1px solid rgba(255,255,255,.14)!important;color:#fff!important;font-size:16px!important;font-weight:800!important;box-shadow:none!important}
html body #gymPage .tidy-pick .dot{flex:none;width:10px;height:10px;border-radius:50%;background:var(--c,#a5b4fc)}
html body #gymPage .tidy-pick .name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body #gymPage .tidy-pick small{flex:none;font-size:12.5px;font-weight:700;color:#aab0c6}
html body #gymPage .tidy-pick:hover{border-color:rgba(255,255,255,.3)!important}
html body #gymPage .tidy-seg,html body #gymPage .exercise-trend-periods{display:flex!important;flex-wrap:nowrap!important;gap:4px!important;padding:4px!important;border-radius:14px;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.1)}
html body #gymPage :is(.tidy-seg,.exercise-trend-periods) button{flex:1 1 0;min-width:0;min-height:38px;padding:0 6px!important;border-radius:10px!important;border:0!important;box-shadow:none!important;
 background:transparent!important;color:#b8bdd2!important;font-size:13.5px!important;font-weight:750!important;white-space:nowrap}
html body #gymPage :is(.tidy-seg button[aria-pressed="true"],.exercise-trend-periods button.active){background:#eceef6!important;color:#111218!important}
html body #gymPage #exerciseTrendTimeline>:not(p){display:none!important}
html body #gymPage .strength-signal-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
html body #gymPage .strength-signal-kpi{background:rgba(255,255,255,.04)!important;border:1px solid rgba(255,255,255,.1)!important}
html body #gymPage .strength-signal-kpi small{color:#aab0c6!important}
html body #gymPage .strength-signal-kpi strong{color:#fff!important;font-size:22px!important}
@media(min-width:900px){html body #gymPage .strength-signal-summary{grid-template-columns:repeat(4,minmax(0,1fr))!important}}

/* Exercise picker pop-up */
dialog.tidy-picker{width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 40px);padding:20px;border-radius:22px;color:#eef0f7;overflow:auto;overscroll-behavior:contain}
dialog.tidy-picker::backdrop{background:rgba(4,6,12,.4)}
dialog.tidy-picker header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
dialog.tidy-picker h2{margin:0;font-size:20px;font-weight:900}
dialog.tidy-picker .tidy-close{display:grid;place-items:center;width:40px;height:40px;min-height:40px;padding:0!important;border-radius:12px!important;background:rgba(255,255,255,.08)!important;border:1px solid rgba(255,255,255,.14)!important;color:#fff!important;font-size:22px;line-height:1;cursor:pointer}
dialog.tidy-picker .grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px}
dialog.tidy-picker .grid button{display:grid;gap:6px;align-content:start;min-height:84px;padding:14px!important;border-radius:16px!important;text-align:left;cursor:pointer;
 background:rgba(255,255,255,.05)!important;border:1px solid color-mix(in srgb,var(--c) 40%,rgba(255,255,255,.12))!important;color:#fff!important;font-size:14.5px!important;font-weight:800!important;box-shadow:none!important}
dialog.tidy-picker .grid button small{font-size:12px;font-weight:750;color:var(--c)}
dialog.tidy-picker .grid button[aria-current="true"]{background:color-mix(in srgb,var(--c) 18%,rgba(255,255,255,.04))!important;border-color:var(--c)!important}
dialog.tidy-picker .grid button:hover{border-color:var(--c)!important}
html.tidy-lock,html.tidy-lock body{overflow:hidden!important}

/* ---------- Workout screen: equal margins on phones (100vw can include space the page cannot use) ---------- */
html body #logModal{overflow-x:hidden!important}
@media(max-width:700px){
 html body #logModal>.dialog{width:100%!important;max-width:100%!important;margin-inline:auto!important;
  padding-left:max(14px,env(safe-area-inset-left))!important;padding-right:max(14px,env(safe-area-inset-right))!important;overflow-x:hidden}
}
html body #logModal #logExercises .exercise-log{margin-inline:0!important;max-width:100%;box-sizing:border-box}

/* ---------- Workout screen on PC and tablets: beside the side rail, never underneath it ---------- */
@media(min-width:701px){
 html body #logModal>.dialog{width:min(920px,100%)!important;max-width:100%!important;margin-inline:auto!important;overflow-x:hidden}
}
@media(min-width:761px){
 html body.ly-has-rail #logModal{left:72px}
}
/* Wide screens: the timer is a large card beside the workout, level with your eyes, with room kept for it. */
@media(min-width:1024px) and (min-height:520px){
 html body.ly-has-rail #logModal{padding-inline:230px!important}
 html body.ly-has-rail #lyFloatTimer#lyFloatTimer{top:50%!important;left:calc(50% + 54px + min(460px,50% - 266px))!important;
  flex-direction:column;gap:14px;width:196px;box-sizing:border-box;padding:20px 12px 18px!important;border-radius:28px!important;
  background:rgba(30,34,64,.9)!important;border:2px solid rgba(165,180,252,.75)!important;box-shadow:0 18px 50px rgba(0,0,0,.5),0 0 34px rgba(129,140,248,.35)!important;
  transform:translate(14px,-50%)!important;opacity:0;transition:transform .25s ease,opacity .2s ease}
 html body.ly-has-rail #lyFloatTimer#lyFloatTimer.show{transform:translate(0,-50%)!important;opacity:1}
 html body.ly-has-rail #lyFloatTimer#lyFloatTimer::before{content:'Workout time';font:800 13px/1 system-ui,sans-serif;color:#c7d2fe}
 html body.ly-has-rail #lyFloatTimer#lyFloatTimer .t{font-size:30px!important;font-weight:900!important;text-align:center;white-space:nowrap}
 html body.ly-has-rail #lyFloatTimer#lyFloatTimer .p{width:60px;height:60px;background:#a5b4fc!important;border:0!important}
 html body.ly-has-rail #lyFloatTimer#lyFloatTimer .p::before{width:24px;height:24px;background:#12142e!important}
}
/* Narrower windows and tablets: a bigger pill along the bottom, with space left under the buttons. */
@media(min-width:701px) and (max-width:1023px) and (min-height:520px){
 html body #lyFloatTimer#lyFloatTimer{top:auto!important;bottom:18px;gap:14px;padding:8px 9px 8px 24px!important;
  background:rgba(30,34,64,.92)!important;border:2px solid rgba(165,180,252,.75)!important;transform:translate(-50%,160%)!important}
 html body #lyFloatTimer#lyFloatTimer.show{transform:translate(-50%,0)!important}
 html body #lyFloatTimer#lyFloatTimer .t{font-size:24px!important;font-weight:900!important}
 html body #lyFloatTimer#lyFloatTimer .p{width:48px;height:48px;background:#a5b4fc!important;border:0!important}
 html body #lyFloatTimer#lyFloatTimer .p::before{width:20px;height:20px;background:#12142e!important}
 html body #logModal>.dialog{padding-bottom:96px!important}
 html body:has(#logModal:not(.hidden)) #lyRail #lyUserBar#lyUserBar{display:none!important}
}

/* ---------- Workout history: a clean + in the corner (turns into × when open) instead of the boxed arrow ---------- */
html body #historyList summary.ly-session-summary.ly-chev{padding-left:0!important}
html body #historyList summary.ly-session-summary.ly-chev::before{display:none!important}
html body #historyList summary.ly-session-summary.ly-chev::after{left:auto!important;right:2px!important;top:14px!important;width:22px!important;height:22px!important;margin:0!important;border:0!important;background:#d6d9e6!important;
 -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/20px no-repeat!important;
 mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center/20px no-repeat!important;
 transform:none!important;transition:transform .25s cubic-bezier(.2,.8,.2,1)!important}
html body #historyList details[open]>summary.ly-session-summary.ly-chev::after{transform:rotate(45deg)!important}
html body #historyList summary.ly-session-summary.ly-chev.ly-arrow-hot::after{background:#fff!important}

/* ---------- Gym page on phones: a grid instead of one long list ---------- */
@media(max-width:700px){
 html body #gymPage #defaultWorkoutBar:not(:empty){display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
 html body #gymPage #defaultWorkoutBar>*{width:auto!important;min-width:0!important;margin:0!important;white-space:normal!important}
 html body #gymPage #defaultWorkoutBar>#resumeDraftButton,html body #gymPage #defaultWorkoutBar>:only-child{grid-column:1/-1}
 html body #gymPage #routineGrid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
 html body #gymPage #routineGrid>*{min-width:0!important;margin:0!important}
 html body #gymPage #routineGrid>details[open]{grid-column:1/-1}
 html body #gymPage #routineGrid .compact-routine>.routine-summary{padding:54px 14px 14px!important}
 html body #gymPage #routineGrid .compact-routine>.routine-summary::before,html body #gymPage #routineGrid .compact-routine>.routine-summary::after{left:14px!important;top:14px!important;margin-top:0!important}
}

/* ---------- "Your profile" bar: picture and gear the same size, the same gap on every side ---------- */
html body #lyRail #lyUserBar#lyUserBar{display:flex!important;align-items:center!important;gap:6px!important;padding:6px!important;box-sizing:border-box}
html body #lyRail #lyUserBar#lyUserBar .ly-user-who{flex:1 1 auto!important;min-width:0!important;margin:0!important;padding:0 6px 0 0!important;display:flex!important;align-items:center!important;gap:10px!important;height:40px}
html body #lyRail #lyUserBar#lyUserBar .ly-user-who img{width:40px!important;height:40px!important;flex:none!important;margin:0!important}
html body #lyRail #lyUserBar#lyUserBar .ly-user-who strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body #lyRail #lyUserBar#lyUserBar .ly-rail-gear{flex:none!important;width:40px!important;height:40px!important;min-height:40px!important;margin:0!important;padding:0!important;display:grid!important;place-items:center!important;border-radius:12px!important;box-sizing:border-box!important}
html body #lyRail #lyUserBar#lyUserBar .ly-user-who .ly-user-av{width:40px!important;height:40px!important;min-width:40px!important;flex:none!important;margin:0!important;padding:0!important;display:grid!important;place-items:center!important;transform:none!important;position:static!important;box-sizing:border-box!important}
