/* Prime Body motion layer (2026-11-07). Visual feedback only: no data or saving logic lives here.
   Loaded last so it can refine existing styles. Remove the <link> to roll back. */
:root{--pbm-accent:#6c8b5c;--pbm-accent-soft:#e6efdd;--pbm-ink:#293b30;--pbm-ease:cubic-bezier(.2,.9,.25,1.25);--pbm-out:cubic-bezier(.2,.8,.2,1)}

/* ---------- press feedback ---------- */
.focus-client .btn,.focus-client .client-nav button,.focus-client [data-training-session],.focus-client .pb-log-swap,.focus-client .pb-log-card-footer button,.focus-client [data-log-action=finish]{transition:transform .14s var(--pbm-out)}
.focus-client .btn:active,.focus-client .client-nav button:active,.focus-client [data-training-session]:active,.focus-client .pb-log-swap:active,.focus-client .pb-log-card-footer button:active,.focus-client [data-log-action=finish]:active{transform:scale(.96)}

/* ---------- bottom menu: quieter inactive tabs, lively active tab ---------- */
.focus-client .client-nav .calm-nav-art img{transition:transform .28s var(--pbm-ease),filter .2s,opacity .2s}
.focus-client .client-nav button:not([aria-current=page]) .calm-nav-art img{filter:grayscale(.7);opacity:.62;transform:scale(.86)}
.focus-client .client-nav button[aria-current=page] .calm-nav-art img{transform:scale(1.04)}
.focus-client .client-nav button[aria-current=page] .calm-nav-art{animation:pbm-nav-pop .42s var(--pbm-ease)}
@keyframes pbm-nav-pop{0%{transform:scale(.88)}60%{transform:scale(1.07)}100%{transform:scale(1)}}

/* ---------- tab change: content slides up softly ---------- */
.app-body.pbm-enter{animation:pbm-enter .32s var(--pbm-out) both}
@keyframes pbm-enter{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ---------- workout progress bar ---------- */
.pbm-progress{height:6px;border-radius:99px;background:#e9eee4;overflow:hidden;margin:2px 0 14px}
.pbm-progress i{display:block;height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,#88a77e,var(--pbm-accent));transition:width .5s var(--pbm-out)}
.pbm-progress.is-full i{background:linear-gradient(90deg,#7fb37a,#4f8a4a)}

/* ---------- set ticked ---------- */
body .pb-log-check input:checked{animation:pbm-check .38s var(--pbm-ease)}
@keyframes pbm-check{0%{transform:scale(.6)}55%{transform:scale(1.18)}100%{transform:scale(1)}}
body .pb-log-row.pbm-done-pop{animation:pbm-row-flash .7s ease-out}
@keyframes pbm-row-flash{0%{background:transparent}25%{background:#e8f2e1}100%{background:transparent}}
body .pb-log-row{border-radius:14px;transition:background .3s}

/* ---------- whole exercise done ---------- */
body .pb-log-card.pbm-card-done{animation:pbm-card-done .6s var(--pbm-ease)}
@keyframes pbm-card-done{0%{transform:scale(1)}35%{transform:scale(1.015);box-shadow:0 0 0 3px #cfe2c4}100%{transform:scale(1);box-shadow:0 0 0 0 transparent}}
.pbm-badge{position:absolute;left:50%;top:0;padding:2px 12px 3px;border-radius:0 0 11px 11px;background:var(--pbm-accent);color:#fff;font-size:11.5px;line-height:1.4;font-weight:600;white-space:nowrap;pointer-events:none;transform:translateX(-50%);animation:pbm-badge 1.9s var(--pbm-out) forwards}
@keyframes pbm-badge{0%{opacity:0;transform:translate(-50%,-100%)}14%{opacity:1;transform:translate(-50%,0)}82%{opacity:1;transform:translate(-50%,0)}100%{opacity:0;transform:translate(-50%,-100%)}}
body .pb-log-card{position:relative}

/* ---------- rest timer dock ---------- */
.pbm-rest{position:fixed;left:50%;bottom:calc(env(safe-area-inset-bottom,0px) + 96px);z-index:60;display:flex;align-items:center;gap:12px;padding:8px 10px 8px 8px;border-radius:99px;background:#24382c;color:#fff;box-shadow:0 12px 34px #1c322c47;transform:translate(-50%,24px);opacity:0;pointer-events:none;transition:transform .32s var(--pbm-ease),opacity .2s;font-family:inherit;max-width:calc(100% - 32px)}
.pbm-rest.is-on{transform:translate(-50%,0);opacity:1;pointer-events:auto}
.pbm-rest-ring{position:relative;width:46px;height:46px;flex:none}
.pbm-rest-ring svg{width:46px;height:46px;transform:rotate(-90deg)}
.pbm-rest-ring circle{fill:none;stroke-width:4}
.pbm-rest-ring .bg{stroke:#ffffff26}
.pbm-rest-ring .fg{stroke:#a8d39a;stroke-linecap:round;transition:stroke-dashoffset .3s linear}
.pbm-rest-ring b{position:absolute;inset:0;display:grid;place-items:center;font-size:12.5px;font-weight:700;font-variant-numeric:tabular-nums}
.pbm-rest-text{display:flex;flex-direction:column;min-width:0;line-height:1.3;cursor:pointer;background:none;border:0;color:inherit;font:inherit;text-align:left;padding:0}
.pbm-rest-text strong{font-size:14px}
.pbm-rest-text span{font-size:12px;opacity:.72;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px}
.pbm-rest-x{min-width:44px;height:40px;padding:0 10px;border-radius:99px;border:0;background:#ffffff1f;color:#fff;font:inherit;font-size:13.5px;font-weight:700;cursor:pointer;flex:none}
.pbm-rest-adj{min-width:44px;height:40px;padding:0 6px;border-radius:99px;border:0;background:#ffffff14;color:#fff;font:inherit;font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;cursor:pointer;flex:none}
.pbm-rest-adj[hidden]{display:none}
.pbm-rest{gap:6px;max-width:calc(100vw - 16px)}
.pbm-rest-text{margin:0 4px;flex:1 1 auto}
.pbm-rest-text span{max-width:96px}
.pbm-rest button:focus-visible{outline:2px solid #fff;outline-offset:2px;border-radius:12px}
.pbm-rest .pbm-rest-x:focus-visible,.pbm-rest .pbm-rest-adj:focus-visible{border-radius:99px}
.pbm-rest.is-done{background:#4f8a4a;animation:pbm-pulse 1s ease-in-out 3}
.pbm-rest.is-done .pbm-rest-ring .fg{stroke:#fff}
@keyframes pbm-pulse{0%,100%{box-shadow:0 12px 34px #1c322c47}50%{box-shadow:0 0 0 8px #4f8a4a40}}

/* ---------- saved notice becomes a small toast above the menu ---------- */
body #saved-notice.saved-notice{inset:auto 0 calc(env(safe-area-inset-bottom,0px) + 98px) 0;margin:0 auto;width:calc(100% - 32px);max-width:380px;padding:10px 44px 10px 12px;border-radius:20px;text-align:left;display:flex;align-items:center;gap:12px;animation:pbm-toast-in .34s var(--pbm-ease)}
body #saved-notice.saved-notice[hidden]{display:none}
body #saved-notice.saved-notice img{width:42px;height:46px;margin:0;flex:none}
body #saved-notice.saved-notice [role=status]{display:grid;grid-template-columns:auto 1fr;column-gap:8px;align-items:center}
body #saved-notice.saved-notice .saved-notice-check{margin:0;width:22px;height:22px;font-size:13px;grid-row:span 2;animation:pbm-check .45s var(--pbm-ease) .08s both}
body #saved-notice.saved-notice strong{font-size:15px;line-height:1.35;letter-spacing:0}
body #saved-notice.saved-notice p{margin:1px 0 0;font-size:11.5px;line-height:1.4}
body #saved-notice-close{top:50%;transform:translateY(-50%);right:4px}
@keyframes pbm-toast-in{from{opacity:0;transform:translateY(16px) scale(.96)}to{opacity:1;transform:none}}

/* ---------- workout finished ---------- */
.wf-summary.pbm-celebrate>*{animation:pbm-rise .5s var(--pbm-out) both}
.wf-summary.pbm-celebrate>:nth-child(2){animation-delay:.06s}
.wf-summary.pbm-celebrate>:nth-child(3){animation-delay:.12s}
.wf-summary.pbm-celebrate>:nth-child(4){animation-delay:.16s}
.wf-summary.pbm-celebrate>:nth-child(5){animation-delay:.22s}
.wf-summary.pbm-celebrate>:nth-child(n+6){animation-delay:.3s}
.wf-summary.pbm-celebrate .wf-mascot{animation:pbm-mascot .9s var(--pbm-ease) both}
.wf-summary.pbm-celebrate .wf-stats>div{animation:pbm-rise .45s var(--pbm-out) both}
.wf-summary.pbm-celebrate .wf-stats>div:nth-child(2){animation-delay:.24s}
.wf-summary.pbm-celebrate .wf-stats>div:nth-child(3){animation-delay:.32s}
@keyframes pbm-rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes pbm-mascot{0%{opacity:0;transform:translateY(20px) scale(.7)}55%{opacity:1;transform:translateY(-6px) scale(1.08) rotate(-4deg)}75%{transform:rotate(3deg)}100%{transform:none}}
.pbm-confetti{position:fixed;inset:0;pointer-events:none;z-index:2147483000;overflow:hidden}
.pbm-confetti i{position:absolute;left:50%;top:32%;width:8px;height:12px;border-radius:2px;opacity:0;animation:pbm-confetti 1.5s cubic-bezier(.15,.7,.3,1) forwards}
@keyframes pbm-confetti{0%{opacity:1;transform:translate(0,0) rotate(0)}100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(var(--r))}}

@media (prefers-reduced-motion:reduce){
  .app-body.pbm-enter,.focus-client .client-nav button[aria-current=page] .calm-nav-art,body .pb-log-check input:checked,body .pb-log-row.pbm-done-pop,body .pb-log-card.pbm-card-done,.pbm-badge,.pbm-rest.is-done,body #saved-notice.saved-notice,body #saved-notice.saved-notice .saved-notice-check,.wf-summary.pbm-celebrate>*,.wf-summary.pbm-celebrate .wf-mascot,.wf-summary.pbm-celebrate .wf-stats>div{animation:none}
  .pbm-rest,.pbm-progress i,.focus-client .client-nav .calm-nav-art img{transition:none}
  .pbm-confetti{display:none}
}
