/* Shared mobile layout for the app and exercise library. */
.mobile-primary{display:none}
@media(max-width:700px){
 html{--mobile-bottom:calc(82px + max(12px,env(safe-area-inset-bottom)));scroll-padding-top:76px;scroll-padding-bottom:calc(var(--mobile-bottom) + 24px)}
 body{padding-bottom:calc(94px + env(safe-area-inset-bottom))!important;-webkit-text-size-adjust:100%}
 .mobile-primary{position:fixed;z-index:80;left:16px;right:16px;bottom:max(12px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;padding:7px;border:1px solid #ffffff1c;border-radius:25px;background:rgba(24,24,26,.94);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);box-shadow:0 8px 35px #0008}
 .mobile-primary a{display:flex;align-items:center;justify-content:center;min-height:48px;border-radius:18px;color:#999;text-decoration:none;font-size:14px;font-weight:550;touch-action:manipulation}
 .mobile-primary a.active,.mobile-primary a[aria-current=page]{background:#ffffff13;color:#fff}
 .topbar .navlinks,.topbar nav{display:none!important}.topbar .navrow{min-height:58px;justify-content:space-between}.topbar .brand-icon{width:28px;height:28px}.topbar .brand small{display:none}
 .module-current{display:none!important}body.module-train .mobile-primary{display:none}
 body.module-mode .topbar .navlinks{display:none!important}
 #goal-home{padding:24px 0 12px!important}.goal-heading{margin-bottom:22px}.goal-heading>p{font-size:13px!important;max-width:29em}#goal-home h1{font-size:28px;letter-spacing:-.7px}.goal-topline{margin-bottom:14px;min-height:30px}
 .goal-choices{gap:12px}.goal-choice{padding:12px 12px 17px;border-radius:24px}.goal-choice .goal-bear{max-width:130px;margin:22px 0 13px;border-radius:15px}.goal-choice:hover{transform:none}.goal-choice strong{font-size:18px}.goal-choice>span:last-child{font-size:12px}.goal-check{width:19px;height:19px;right:11px;top:10px}
 #goal-home .goal-button{min-height:48px;border-radius:16px!important}#goal-home .goal-button.text{min-height:44px}
 .goal-bottom{position:sticky;bottom:94px;z-index:10;padding:12px;margin:20px -2px 0;gap:10px;background:rgba(20,20,22,.96);backdrop-filter:blur(20px);border:1px solid #ffffff13;border-radius:22px}.goal-bottom>span:empty{display:none}.goal-bottom>span{font-size:11px;line-height:1.5}.goal-bottom>div{gap:8px}.goal-bottom>.goal-button{width:100%}
 .goal-conditions{display:grid;grid-template-columns:1fr;gap:20px}.goal-condition{min-width:0;font-size:13px}.goal-condition-value{font-size:15px}.goal-slider{padding-top:12px}.goal-slider-bar{height:12px;margin-top:10px}.goal-slider-range{height:48px}.goal-slider-range::-webkit-slider-thumb{width:32px;height:32px;margin-top:-10px}.goal-slider-range::-moz-range-thumb{width:32px;height:32px}.goal-slider-mark{font-size:11px!important;padding:8px 2px;min-height:36px}.goal-edit-card{padding:20px 16px}.goal-edit-card select,.goal-edit-card input:not([type=range]){font-size:16px!important;min-height:48px;border-radius:13px;background:#ffffff0b}
 .goal-exercise{padding:16px 0;gap:10px}.goal-exercise-main b{font-size:15px;line-height:1.5}.goal-exercise-main>span{font-size:11px;line-height:1.5}.goal-dose b{font-size:13px}.goal-demo{min-width:44px;width:44px;height:44px}.goal-prescription{margin-left:0;gap:8px;width:100%;flex:1 0 100%}.goal-prescription label{flex:1}.goal-prescription input,.goal-prescription select{width:100%}.goal-row-actions{width:100%;justify-content:flex-end;padding:0;gap:8px}.goal-row-actions button{width:44px;height:44px;border-radius:12px}.goal-exercise.editable .goal-exercise-main{min-width:0;width:calc(100% - 30px);flex:1}
 .goal-profile-card{grid-template-columns:70px minmax(0,1fr);gap:8px 16px}.goal-profile-card .goal-bear{width:70px}.goal-profile-card .goal-tags{margin:6px 0}.goal-profile-focus{grid-column:1/-1}.goal-target{gap:16px}.goal-target .goal-bear{width:86px}.goal-target>div:last-child{min-width:0}.goal-target h2{font-size:25px}
 .goal-profile-links{grid-template-columns:1fr;gap:8px;margin-top:18px}.goal-profile-links .goal-button{justify-content:space-between;padding:17px 18px}.goal-profile-links .goal-button:after{content:'›';color:#777;font-size:21px}
 .goal-today{min-height:240px;padding:24px}.goal-today h2{font-size:32px}.goal-upcoming{padding:20px 12px}.goal-week{gap:3px}.goal-week span{font-size:10px}.goal-week b{font-size:11px}.goal-week>div{padding:11px 0}.goal-home-heading{margin-bottom:22px}
 .app-section-back{min-height:44px;margin-bottom:12px}.focus-workout{padding:20px 16px!important;border-radius:24px!important}.focus-workout h3{font-size:27px}.focus-inputs input{font-size:22px;min-height:56px;border-radius:14px}.focus-actions{grid-template-columns:1fr!important}.focus-actions .btn{min-height:50px;border-radius:15px}.focus-guide-preview{grid-template-columns:1fr;padding:12px;border-radius:18px}.focus-guide-preview canvas{max-height:180px;object-fit:contain}.focus-guide-copy .focus-cues{display:none}.focus-guide-copy>span{font-size:12px}.focus-guide-copy .btn{width:100%;margin-top:9px;white-space:normal}.focus-rest-actions{grid-template-columns:1fr 1fr}.focus-rest-actions>:first-child{grid-column:1/-1}.focus-rest-actions .btn{min-height:48px}.workout-dock .btn{min-height:46px}.workout-dock{z-index:90}.complete-actions{display:grid;grid-template-columns:1fr 1fr}.complete-actions .btn{min-height:48px;padding:10px;font-size:13px}.workout-complete{padding:22px 16px;border-radius:24px}.complete-stats{gap:6px}.complete-stats div{padding:12px 8px;border-radius:14px}.complete-stats b{font-size:18px}
 .auth-layout{display:block;min-height:0}.auth-brand{display:none}.auth-main{padding:22px 18px}.social-panel{border-radius:24px}.social-form input{font-size:16px;border-radius:14px}.social-form .btn{border-radius:15px}.account-head,.account-tools{display:flex;flex-direction:column;padding:20px;gap:18px}.friend-code-box{min-width:0}.friends-area{padding:20px}
 .ubear-motion{width:100%;max-width:100%;max-height:90dvh;margin:auto 0 0;padding:20px 18px calc(22px + env(safe-area-inset-bottom));border-radius:28px 28px 0 0;border-bottom:0;overscroll-behavior:contain}.ubear-motion header{position:sticky;top:-20px;padding:12px 0;background:#191919;z-index:2}.ubear-motion button{min-height:44px}.ubear-motion-stage{min-height:180px;max-height:32dvh}.ubear-motion-steps{font-size:14px}
 .workspace{margin-bottom:20px}.workspace input,.workspace select{font-size:16px!important;min-height:46px}.workspace .exercise-list{max-height:230px}.workspace .exercise-row{min-height:64px}.workspace .detail{padding:22px 16px}.workspace .media-stage{min-height:230px}.workspace .bookmark{width:44px;height:44px}
}
@media(max-width:360px){.mobile-primary{left:10px;right:10px}.goal-choice .goal-bear{max-width:108px}.goal-choice{padding:10px 9px 15px}.goal-choice>span:last-child{font-size:11px}.goal-dose{max-width:70px}.goal-profile-card{grid-template-columns:60px minmax(0,1fr)}.goal-profile-card .goal-bear{width:60px}}

/* Keep phone controls reachable and reserve space for the home indicator. */
@media(max-width:700px){
 .goal-ui.module-mode main.wrap{width:auto;margin-left:max(16px,env(safe-area-inset-left));margin-right:max(16px,env(safe-area-inset-right))}
 .mobile-primary{left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right))}
 .mobile-primary a{font-size:15px;font-weight:600}
 .goal-bottom{bottom:var(--mobile-bottom)}
 .toast{bottom:calc(var(--mobile-bottom) + 12px);z-index:100;font-size:14px;line-height:1.5;text-align:center}
 .goal-topline,.goal-home-heading{flex-wrap:wrap;gap:10px}
 #goal-home .goal-heading>p{font-size:14px!important}
 #goal-home .goal-quiet,.goal-plan-foot,.goal-bottom>span{font-size:13px!important;line-height:1.65;color:#aaa}
 .goal-segments{display:flex;min-width:0}
 .goal-segments button{min-height:44px;flex:1;padding:10px 18px}
 .goal-edit-heading{flex-wrap:wrap}
 .goal-exercise:not(.editable){display:grid;grid-template-columns:20px minmax(0,1fr) 44px;gap:6px 10px}
 .goal-exercise:not(.editable) .goal-index{grid-column:1;grid-row:1}
 .goal-exercise:not(.editable) .goal-exercise-main{grid-column:2;grid-row:1}
 .goal-exercise:not(.editable) .goal-dose{grid-column:2;grid-row:2;text-align:left;display:flex;align-items:baseline;gap:8px;max-width:none}
 .goal-exercise:not(.editable) .goal-demo{grid-column:3;grid-row:1/3}
 .goal-exercise-main b{overflow-wrap:anywhere}
 .goal-exercise-main>span,.goal-dose span{font-size:12px;color:#aaa}
 .goal-prescription label{min-width:0;font-size:12px}
 .goal-prescription input,.goal-prescription select{min-height:48px}
 .goal-skip,.account-quick,.friend-remove,.account-foot button{min-height:44px}
 .focus-inputs>*{min-width:0}
 .focus-inputs label{font-size:13px}
 .focus-workout h3{overflow-wrap:anywhere;line-height:1.3}
 .focus-actions .force-end{min-height:44px;font-size:13px}
 .workout-dock{border-radius:20px 20px 0 0;padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
 .account-foot{flex-wrap:wrap;gap:12px;font-size:12px}
 .workspace .tabs button,.workspace .media-switch button,.workspace .dialog-top button{min-height:44px}
 .workspace .detail h2{overflow-wrap:anywhere;line-height:1.3}
 .workspace .profile dd{overflow-wrap:anywhere}
 .workspace .detail{scroll-margin-bottom:var(--mobile-bottom)}
 button,a,input,select{touch-action:manipulation}
}
@media(max-width:360px){
 .goal-today{padding:20px}
 .goal-today-actions{flex-direction:column}
 .goal-target{gap:12px;padding:16px}
 .goal-target .goal-bear{width:64px}
 .goal-target h2{font-size:22px}
 .goal-bottom>div{flex-wrap:wrap}
 .workspace .profile{grid-template-columns:1fr;gap:12px}
 .workspace .profile>div+div{border-left:0}
}
@media(max-width:700px) and (max-height:500px){
 .goal-bottom{position:static}
}
@media(prefers-reduced-transparency:reduce){
 .mobile-primary,.goal-bottom{background:#18181a;backdrop-filter:none;-webkit-backdrop-filter:none}
}

@media(max-width:700px){.goal-bottom{bottom:calc(88px + env(safe-area-inset-bottom))}.toast{bottom:calc(98px + env(safe-area-inset-bottom))!important}.mobile-primary a:focus-visible{outline:2px solid #fff;outline-offset:-3px}body:has(.ubear-motion[open]){overflow:hidden}}

/* Present all four directions as one compact choice area. */
@media(max-width:700px){
 #goal-home:has(.goal-choices){padding-top:14px!important}
 #goal-home:has(.goal-choices) .goal-topline{min-height:20px;margin-bottom:8px}
 #goal-home:has(.goal-choices) .goal-heading{margin-bottom:16px}
 #goal-home:has(.goal-choices) h1{font-size:26px}
 #goal-home:has(.goal-choices) .goal-heading>p{margin-top:6px!important;font-size:13px!important}
 .goal-choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .goal-choice{padding:10px 12px 14px;border-radius:22px}
 .goal-choice .goal-bear{width:clamp(76px,12dvh,112px);max-width:100%;margin:18px 0 9px;border-radius:14px}
 .goal-choice strong{font-size:17px}.goal-choice>span:last-child{margin-top:3px;font-size:11px}
 #goal-home:has(.goal-choices) .goal-bottom{position:static;padding:0;border:0;background:none;box-shadow:none;backdrop-filter:none;margin:16px 0 0}
 #goal-home:has(.goal-choices) .goal-bottom>span{display:none}
 .goal-binary{margin-top:10px}.goal-binary button{min-height:48px;font-size:14px}
}
