/* ForgeFit V4 — Profile / Settings Concept A: Clean Performance.
   Scoped to the profile route; existing program, workout, progress and settings routes unchanged. */
body.profile-concept-a{background:#060809;color:#f7f8fa}
body.profile-concept-a:not(.light-mode) .topbar{background:#080b0df6;border-bottom-color:#333a42}
body.profile-concept-a:not(.light-mode) .bottom-nav{background:#080a0cf6;border-top-color:#32383f}
body.profile-concept-a .bottom-nav [data-nav="profile"][aria-current="page"]{color:#ff812b;background:#ff711c20}
body.profile-concept-a #main{max-width:900px;padding:17px clamp(12px,3vw,22px) calc(115px + env(safe-area-inset-bottom))}
.ffpa{--ffpa-bg:#060809;--ffpa-card:#111519;--ffpa-card-raised:#171c21;--ffpa-border:#343b44;--ffpa-muted:#aeb8c2;--ffpa-orange:#ff711c;--ffpa-orange2:#ff8729;display:grid;gap:14px;color:#f7f8fa;min-width:0;padding-bottom:10px;font-size:.94rem}
.ffpa *{box-sizing:border-box}
.ffpa button,.ffpa input,.ffpa select,.ffpa textarea{font:inherit}
.ffpa button{touch-action:manipulation}
.ffpa button:focus-visible,.ffpa summary:focus-visible,.ffpa :is(input,select,textarea):focus-visible{outline:2px solid #ff9b56;outline-offset:2px}
.ffpa h1,.ffpa h2,.ffpa h3{margin:0}
.ffpa svg{width:22px;height:22px;flex-shrink:0}
.ffpa-heading{display:flex;justify-content:space-between;align-items:center;gap:14px;min-height:52px;margin-bottom:1px}
.ffpa-heading h1{font-size:clamp(1.45rem,5.8vw,2.1rem);line-height:1.12;font-weight:840;letter-spacing:-.04em}
.ffpa-gear{color:#e8edf2;width:46px;height:46px;min-height:46px;border-radius:14px;border:1px solid #434b53;display:grid;place-items:center;background:#13181d;transition:background .17s,border-color .17s}
.ffpa-gear svg{width:25px;height:25px}
.ffpa-gear.is-active{color:#ff892b;border-color:#ff711c;box-shadow:0 0 13px #ff711c3b;background:#28170f}
.ffpa-card,.ffpa-stat,.ffpa-program,.ffpa-quick,.ffpa-group-items,.ffpa-detail{border:1px solid var(--ffpa-border);background:linear-gradient(145deg,#171c20,#0f1317);box-shadow:0 6px 20px #0005}
.ffpa-hero{padding:16px;border-radius:19px}
.ffpa-user{display:flex;align-items:center;gap:16px;min-width:0}
.ffpa-avatar{width:97px;height:97px;flex:0 0 97px;display:grid;place-items:center;border:3px solid #ff711c;border-radius:50%;background:radial-gradient(circle at 28% 19%,#383e47,#171d22 55%,#0b0e13 95%);font-weight:810;font-size:2rem;color:#ff9b55;box-shadow:0 0 0 4px #ff711c13,0 7px 14px #0009;text-shadow:0 2px 9px #000}
.ffpa-identity{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:5px}
.ffpa-identity h2{font-size:clamp(1.24rem,4vw,1.66rem);font-weight:850;line-height:1.1;letter-spacing:-.032em;overflow-wrap:anywhere}
.ffpa-identity p{font-size:.81rem;color:#b8c1c9;line-height:1.32;margin:0}
.ffpa-goal{border-radius:999px;display:inline-flex;align-items:center;gap:7px;max-width:100%;background:linear-gradient(135deg,#ff6d18,#ff8b32);padding:5px 12px 5px 9px;color:#1b110a;font-weight:770;font-size:.77rem;line-height:1.2}
.ffpa-goal.is-empty{background:#252c32;color:#b9c5cf;border:1px solid #444f58}
.ffpa-goal svg{width:17px;height:17px}
.ffpa-edit{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:47px;border:1px solid #38424a;border-radius:11px;color:#f3f5f7;background:linear-gradient(160deg,#212930,#151b20);margin-top:15px;padding:9px 14px;font-size:.91rem;font-weight:660}
.ffpa-edit>svg{width:19px;height:19px}
.ffpa-chevron{margin-left:auto;color:#a9b3bf;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.ffpa-chevron svg{width:17px;height:17px}
.ffpa-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;margin-top:-1px;min-width:0}
.ffpa-stat{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;padding:13px 3px 11px;min-height:80px;border-radius:12px}
.ffpa-stat-val{font-size:clamp(.9rem,2.8vw,1.16rem);white-space:nowrap;font-weight:790;letter-spacing:-.025em;color:#f8f9fa;font-variant-numeric:tabular-nums}
.ffpa-stat-label{display:flex;align-items:center;gap:4px;font-size:.68rem;white-space:nowrap;color:#adb7c2}
.ffpa-stat-label svg{width:13px;height:13px}
.ffpa-program{border-radius:15px;display:flex;gap:12px;align-items:center;width:100%;min-height:85px;padding:13px;text-align:left;color:#f7f8fa}
.ffpa-program-ico{display:grid;place-items:center;flex:0 0 46px;height:46px;border-radius:12px;background:linear-gradient(155deg,#2c251e,#191815);color:#ff791f}
.ffpa-program-ico svg{width:29px;height:29px}
.ffpa-program-copy{display:flex;flex-direction:column;gap:3px;min-width:0}
.ffpa-program-copy small{color:#acb4c0;font-size:.72rem;line-height:1.25}
.ffpa-program-copy strong{font-size:1rem;font-weight:760;line-height:1.28;overflow-wrap:anywhere}
.ffpa-shortcuts{margin-top:13px}
.ffpa-shortcuts h3,.ffpa-group h3{font-size:.74rem;letter-spacing:.105em;font-weight:650;color:#b1bac3;margin:0 0 9px;padding:0 7px}
.ffpa-shortcuts-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.ffpa-quick{display:flex;align-items:center;gap:9px;padding:12px 10px;min-width:0;min-height:91px;border-radius:13px;color:#f2f4f6;text-align:left}
.ffpa-quick-icon{display:grid;place-items:center;flex:0 0 39px;height:40px;border-radius:12px;background:#24201c;color:#ff7925}
.ffpa-quick-icon svg{width:23px;height:23px}
.ffpa-quick-copy{min-width:0;display:flex;flex-direction:column;gap:5px}
.ffpa-quick-copy strong{font-size:.79rem;line-height:1.25;font-weight:740}
.ffpa-quick-copy small{font-size:.68rem;line-height:1.25;color:#acb6bf}
.ffpa-quick .ffpa-chevron svg{width:14px;height:14px}
.ffpa-settings{display:flex;flex-direction:column;gap:12px;min-width:0}
.ffpa-settings-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:3px 4px}
.ffpa-settings-head h2{font-size:1.1rem;font-weight:780;letter-spacing:-.03em}
.ffpa-settings-head span{font-size:.7rem;color:#aab5bf}
.ffpa-group{min-width:0}
.ffpa-group h3{font-size:.69rem;margin-bottom:7px}
.ffpa-group-items{border-radius:13px;overflow:hidden}
.ffpa-setting-row{width:100%;min-width:0;min-height:47px;display:flex;align-items:center;gap:11px;padding:8px 12px;border:0;border-bottom:1px solid #2a3138;background:transparent;color:#e7ebee;font-size:.82rem;text-align:left;line-height:1.25}
.ffpa-setting-row:last-child{border-bottom:0}
.ffpa-setting-row:hover,.ffpa-setting-row:focus-visible{background:#23201e}
.ffpa-setting-row.selected{background:#2b1d14;color:#ffad6a}
.ffpa-setting-icon{display:grid;place-items:center;color:#ff7b25;flex:0 0 23px}
.ffpa-setting-icon svg{width:18px;height:18px}
.ffpa-detail{padding:15px;border-radius:15px;min-width:0;color:#f7f8fa;scroll-margin-top:95px}
.ffpa-panel-title{font-size:1rem;font-weight:780;margin-bottom:12px;line-height:1.35}
.ffpa-detail>p{color:#bbc3cc;font-size:.85rem;line-height:1.5}
.ffpa-detail .card,.ffpa-detail details{background:#151a1f;border:1px solid #333d45;color:#eef2f4;border-radius:13px;box-shadow:none}
.ffpa-detail .card{padding:14px}
.ffpa-detail .page-head{display:none}
.ffpa-detail h2{font-size:1.02rem;color:#f5f6f7}
.ffpa-detail .form-control,.ffpa-detail :is(input,select,textarea){background:#20262c;color:#fff;border-color:#46515a}
.ffpa-detail select option{background:#1d2228;color:#fff}
.ffpa-detail .hint,.ffpa-detail label{color:#c2cbd2}
.ffpa-detail .btn{max-width:100%}
.ffpa-detail .stack{min-width:0}
.ffpa-detail details summary{color:#f2f3f4}
.ffpa-detail .option{color:#d6dde4}
.ffpa-close-panel{border:1px solid #414951;border-radius:11px;min-height:44px;background:#171b20;color:#e5e9ee;padding:10px 15px;text-align:left;font-weight:620}
.ffpa-legacy .card{margin-top:0}
.ffpa-legacy .form-field,.ffpa-legacy .field-row{min-width:0}
body.light-mode.profile-concept-a .ffpa{color:#f7f8fa}
body.light-mode.profile-concept-a .ffpa :is(button,.ffpa-card,.ffpa-stat,.ffpa-group-items){color:inherit}
@media(max-width:480px){
 body.profile-concept-a #main{padding:12px 12px calc(103px + env(safe-area-inset-bottom))}
 .ffpa{gap:12px}
 .ffpa-heading{min-height:46px}
 .ffpa-hero{padding:14px}
 .ffpa-avatar{width:78px;height:78px;flex-basis:78px;font-size:1.6rem}
 .ffpa-user{gap:12px}
 .ffpa-identity h2{font-size:1.36rem}
 .ffpa-identity p{font-size:.76rem}
 .ffpa-goal{font-size:.75rem}
 .ffpa-stat{padding:11px 2px;min-height:75px}
 .ffpa-stat-val{font-size:.94rem}
 .ffpa-stat-label{font-size:.65rem;gap:3px}
 .ffpa-stat-label svg{width:12px;height:12px}
 .ffpa-quick{min-height:85px;padding:9px 8px;gap:8px}
 .ffpa-quick-icon{flex-basis:34px;height:35px}
 .ffpa-quick-icon svg{width:21px;height:21px}
 .ffpa-quick-copy strong{font-size:.76rem}
 .ffpa-quick-copy small{font-size:.66rem}
 .ffpa-setting-row{min-height:45px}
}
@media(max-width:360px){
 .ffpa-avatar{width:70px;height:70px;flex-basis:70px}
 .ffpa-hero{padding:12px}
 .ffpa-stats{gap:1px}
 .ffpa-stat-val{font-size:.85rem}
 .ffpa-stat-label{font-size:.60rem}
 .ffpa-stat-label svg{width:11px;height:11px}
 .ffpa-goal{font-size:.69rem;padding:5px 8px}
 .ffpa-program-copy strong{font-size:.86rem}
 .ffpa-program{padding:10px}
 .ffpa-quick{gap:5px}
 .ffpa-quick-icon{flex:0 0 28px;height:31px}
 .ffpa-quick-icon svg{width:18px;height:18px}
 .ffpa-quick-copy strong{font-size:.72rem}
 .ffpa-quick-copy small{font-size:.63rem}
 .ffpa-quick .ffpa-chevron{display:none}
 .ffpa-detail{padding:10px}
}
@media(min-width:720px){
 .ffpa{max-width:740px;margin:auto}
 .ffpa-shortcuts-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 .ffpa-shortcuts{margin-top:3px}
 .ffpa-group-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .ffpa-setting-row{border-bottom:1px solid #2a3138!important}
}
@media(prefers-reduced-motion:reduce){.ffpa-gear{transition:none}}

/* Hide the old topbar avatar on Profile: the Concept A gear owns settings here. */
body.profile-concept-a .header-right .icon-btn{display:none}
body.profile-concept-a .topbar{padding-top:max(11px,env(safe-area-inset-top));}
body.profile-concept-a .ffpa-legacy .page-head{display:none}


/* V4 iOS-style settings stack: one full navigation screen at a time. */
body.profile-concept-a .ffpa-route{
 min-height:calc(100dvh - 175px - env(safe-area-inset-bottom));
 min-width:0;
 contain:layout;
}
.ffpa-subnav{
 display:grid;grid-template-columns:minmax(90px,1fr) minmax(0,2.25fr) minmax(90px,1fr);
 align-items:center;gap:6px;min-height:55px;
 position:sticky;top:calc(66px + env(safe-area-inset-top));
 z-index:10;margin:-2px -4px 6px;padding:4px;
 background:#060809f5;backdrop-filter:blur(16px);
 border-bottom:1px solid #242c34;
}
.ffpa-subnav h1{
 grid-column:2;grid-row:1;text-align:center;
 font-size:clamp(.95rem,4vw,1.2rem);font-weight:780;
 line-height:1.3;letter-spacing:-.03em;
 overflow-wrap:anywhere;
}
.ffpa-back{
 grid-column:1;grid-row:1;display:inline-flex;align-items:center;
 justify-content:flex-start;gap:3px;padding:7px 4px;
 min-height:44px;border:0;background:transparent;
 color:#ff872e;font-size:.92rem;font-weight:660;text-align:left;
 border-radius:9px;white-space:nowrap;
}
.ffpa-back svg{width:23px;height:23px}
.ffpa-back:active{background:#ff771719}
.ffpa-route-settings .ffpa-settings{gap:18px;padding:4px 0 12px}
.ffpa-settings-intro{color:#aeb7c2;font-size:.79rem;margin:0 4px}
.ffpa-route-settings .ffpa-group-items{display:block}
.ffpa-route-settings .ffpa-group h2{
 font-size:.72rem;letter-spacing:.12em;font-weight:670;
 color:#b1bac3;margin:0 0 10px;padding:0 8px;
}
.ffpa-route-settings .ffpa-setting-row{
 min-height:56px;font-size:.9rem;padding:10px 14px;line-height:1.3;
}
.ffpa-route-settings .ffpa-setting-icon svg{width:20px;height:20px}
.ffpa-route-settings .ffpa-setting-row .ffpa-chevron svg{width:17px;height:17px}
.ffpa-route-detail .ffpa-detail{
 padding:15px;border-radius:15px;min-width:0;
 overflow-wrap:anywhere;scroll-margin-top:calc(140px + env(safe-area-inset-top));
}
.ffpa-route-detail .ffpa-detail .card{margin-top:0}
.ffpa-route-detail .ffpa-detail > p{color:#bbc3cc}
@media(max-width:380px){
 .ffpa-subnav{grid-template-columns:minmax(72px,1fr) minmax(0,2.1fr) minmax(72px,1fr)}
 .ffpa-subnav h1{font-size:.96rem}
 .ffpa-back{font-size:.82rem}
 .ffpa-back svg{width:20px;height:20px}
}
/* Transitions animate only the profile screen, not the floating timer or bottom navigation. */
@supports (view-transition-name:ffpa-route){
 body.profile-concept-a .ffpa-route{view-transition-name:ffpa-route}
 html[data-ffpa-transition]::view-transition-old(root),
 html[data-ffpa-transition]::view-transition-new(root){animation:none}
 html[data-ffpa-transition="forward"]::view-transition-old(ffpa-route){
  animation:ffpa-exit-left .29s cubic-bezier(.3,0,.75,.65) both
 }
 html[data-ffpa-transition="forward"]::view-transition-new(ffpa-route){
  animation:ffpa-enter-right .29s cubic-bezier(.22,.66,.15,1) both
 }
 html[data-ffpa-transition="back"]::view-transition-old(ffpa-route){
  animation:ffpa-exit-right .27s cubic-bezier(.3,0,.75,.65) both
 }
 html[data-ffpa-transition="back"]::view-transition-new(ffpa-route){
  animation:ffpa-enter-left .27s cubic-bezier(.22,.66,.15,1) both
 }
}
@keyframes ffpa-exit-left{from{transform:translateX(0);opacity:1}to{transform:translateX(-28%);opacity:.78}}
@keyframes ffpa-enter-right{from{transform:translateX(100%);opacity:.9}to{transform:translateX(0);opacity:1}}
@keyframes ffpa-exit-right{from{transform:translateX(0);opacity:1}to{transform:translateX(35%);opacity:.78}}
@keyframes ffpa-enter-left{from{transform:translateX(-30%);opacity:.9}to{transform:translateX(0);opacity:1}}
/* Fallback for browsers without the View Transitions API. */
.ffpa-route.ffpa-fallback-forward{animation:ffpa-enter-right .29s cubic-bezier(.22,.66,.15,1) both}
.ffpa-route.ffpa-fallback-back{animation:ffpa-enter-left .27s cubic-bezier(.22,.66,.15,1) both}
@media(prefers-reduced-motion:reduce){
 body.profile-concept-a .ffpa-route{view-transition-name:none}
 html[data-ffpa-transition]::view-transition-old(ffpa-route),
 html[data-ffpa-transition]::view-transition-new(ffpa-route){animation:none!important}
 .ffpa-route.ffpa-fallback-forward,.ffpa-route.ffpa-fallback-back{animation:none!important}
}


/* Safari iPhone / iOS PWA performance fallback.
 * Avoid full-screen rasterized snapshots, large 30%+ page translations,
 * and live backdrop blur on a sticky header: these cause visible stutters
 * on real devices during rapid Back / Open navigation.
 */
html.ffpa-low-cost .ffpa-subnav{
 backdrop-filter:none;
 -webkit-backdrop-filter:none;
 background:#060809;
}
html.ffpa-low-cost .ffpa-route{
 contain:none;
}
html.ffpa-low-cost .ffpa-route.ffpa-fallback-forward{
 animation:ffpa-webkit-forward .15s cubic-bezier(.2,.7,.2,1) both;
}
html.ffpa-low-cost .ffpa-route.ffpa-fallback-back{
 animation:ffpa-webkit-back .15s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes ffpa-webkit-forward{
 from{opacity:.88;transform:translate3d(12px,0,0)}
 to{opacity:1;transform:translate3d(0,0,0)}
}
@keyframes ffpa-webkit-back{
 from{opacity:.88;transform:translate3d(-12px,0,0)}
 to{opacity:1;transform:translate3d(0,0,0)}
}
@media(prefers-reduced-motion:reduce){
 html.ffpa-low-cost .ffpa-route.ffpa-fallback-forward,
 html.ffpa-low-cost .ffpa-route.ffpa-fallback-back{animation:none!important}
}
