/* Jz Scales portal: one motion system (motion5.js). Stage 4 --ease; 120ms feedback, 180ms standard, 260ms larger.
   Only transform and opacity move. One reduced-motion rule turns non-essential motion off. */
:root{--t1:120ms;--t2:180ms;--t3:260ms;--ease:cubic-bezier(.16,1,.3,1)}

/* the page entrance: only when the page changes (body.pg-enter), never on in-page redraws */
main{animation:none!important}
@media(prefers-reduced-motion:no-preference){body.pg-enter main{animation:mo-in var(--t2) var(--ease) both!important}}
@keyframes mo-in{from{opacity:.001}}

/* the thin progress line, only for slower page changes */
#navline{position:fixed;left:0;right:0;top:0;height:2px;z-index:70;pointer-events:none;opacity:0;transform:scaleX(0);transform-origin:left;background:linear-gradient(90deg,var(--accent),color-mix(in srgb,var(--accent) 40%,#fff));transition:opacity var(--t1)}
#navline.on{opacity:1;animation:mo-line 1.6s cubic-bezier(.2,.8,.2,1) forwards}
@keyframes mo-line{from{transform:scaleX(0)}to{transform:scaleX(.85)}}
@media(prefers-reduced-motion:reduce){#navline.on{animation:none;transform:scaleX(1)}}

/* page-shaped skeletons (the admin sk parts) */
.mo-sk{padding-top:4px}.mo-title{height:30px;width:42%;max-width:280px}.mo-hero{height:92px}.mo-band{height:150px}.mo-strip{height:72px}.mo-card{height:120px}.mo-block{height:220px}.mo-row{height:58px}
.mo-g3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.mo-g2{display:grid;grid-template-columns:1.45fr 1fr;gap:14px}
@media(max-width:640px){.mo-g3{grid-template-columns:1fr 1fr}.mo-g3>:last-child{grid-column:1/-1}.mo-g2{grid-template-columns:1fr}.mo-block{height:180px}}

/* pressed states: the same everywhere */
@media(prefers-reduced-motion:no-preference){
  .btn,.cc-more,.morerow,.bnav a,.side a,.rs-sb,.rs-jb,.ld-b,.seg button,.cc-range button,.rs-range button,.acct-m [role=menuitem],.hero-lead,.big,.tile{transition:transform var(--t1) var(--ease),background-color var(--t2),border-color var(--t2),color var(--t2)}
  .btn:active:not(:disabled),.cc-more:active,.morerow:active,.rs-sb:active:not(:disabled),.rs-jb:active,.ld-b:active,.hero-lead:active,.big:active{transform:scale(.98)}
  .bnav a:active,.side a:active,.seg button:active,.cc-range button:active{transform:scale(.95)}
}
.bnav a.on{transition:color var(--t1)}

/* lead cards: only new ones fade in */
.ld-card{animation:none!important}
@media(prefers-reduced-motion:no-preference){.ld-card.ld-new{animation:ldIn var(--t3) var(--ease) both!important}}

/* modals: fade out on close; the blur only where the device copes */
@media(prefers-reduced-motion:no-preference){.modal.out{animation:mo-out var(--t2) ease both!important}.modal.out .box{animation:mo-boxout var(--t2) ease both!important}}
@keyframes mo-out{to{opacity:0}}@keyframes mo-boxout{to{opacity:0;transform:translateY(6px) scale(.99)}}
@media(hover:none),(pointer:coarse){.modal{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:rgba(5,5,7,.8)!important}}

/* phones: short actions as bottom sheets, long forms full-screen, kept above the keyboard */
@media(max-width:640px){
  .modal.sheet{align-items:flex-end!important;padding:0!important}
  .modal.sheet .box{width:100%!important;max-width:none!important;margin:0!important;border-radius:20px 20px 0 0!important;max-height:calc(92dvh - var(--kb,0px));overflow:auto;overscroll-behavior:contain;padding:22px 18px calc(18px + env(safe-area-inset-bottom) + var(--kb,0px))!important;position:relative}
  .modal.sheet .box::before{content:"";position:sticky;top:-14px;display:block;width:40px;height:4px;margin:-10px auto 12px;border-radius:99px;background:#3A3E46}
  .modal.sheet.full .box{border-radius:0!important;height:100dvh;max-height:none;padding-top:calc(18px + env(safe-area-inset-top))!important}
  .modal.sheet.full .box::before{display:none}
  .modal.sheet .box .row:last-child,.modal.sheet .box form>.row:last-child{position:sticky;bottom:calc(-18px - env(safe-area-inset-bottom) - var(--kb,0px));background:linear-gradient(transparent,#121316 24%);padding:14px 0 calc(4px + env(safe-area-inset-bottom));margin-bottom:0}
  @media(prefers-reduced-motion:no-preference){.modal.sheet .box{animation:mo-up var(--t3) var(--ease) both!important}.modal.sheet.out .box{animation:mo-down var(--t2) ease both!important}}
  /* toasts sit above the bottom menu, never over it */
  body.is-client .toast{bottom:calc(84px + env(safe-area-inset-bottom))}
}
@keyframes mo-up{from{transform:translateY(100%)}}@keyframes mo-down{to{transform:translateY(100%)}}

/* toasts fade out */
@media(prefers-reduced-motion:no-preference){.toast.out{animation:mo-tout var(--t2) ease both!important}}
@keyframes mo-tout{to{opacity:0;transform:translate(-50%,8px)}}

/* one rule for reduced motion: nothing non-essential moves */
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}

/* Billing: the band's place is held while its figures load; the cards below stay hidden so nothing jumps */
.b4-ph{height:150px;border-radius:16px;margin-bottom:16px}
.b4-wait .b4-ph~*{visibility:hidden}
