/* Jz Scales portal: press, hold, release and state changes (touch5.js). Same colours and shapes as before; only how they respond.
   Press: 70ms in. Held (after 380ms): a little deeper. Release after acting: a short damped settle (300ms) with a 1% overshoot
   on buttons only. Cancelled (scrolled or dragged away): fades back in 180ms with no settle. Only transform, opacity and
   colour change. */
:root{--t5-in:70ms;--t5-out:220ms;--t5-ease:cubic-bezier(.2,.9,.3,1);--t5-sheet:cubic-bezier(.32,.72,0,1)}
@media(prefers-reduced-motion:no-preference){
  /* resting: every pressable control returns smoothly */
  .btn,.cc-more,.morerow,.bnav a,.side a,.seg a,.seg button,.cc-range button,.rs-range button,.rs-sb,.rs-jb,.rs-qm,.rs-stp,.ld-b,.ld-tabs button,.acct-btn,.acct-m [role=menuitem],.h5-todo a,.kbtn,.ch-card,.rs-add,.rs-open1,.rs-miss,.rs-lk,.hero-lead,.big,.h5-x>summary,.rs-how>summary,.rs-tbl>summary{
    transition:transform var(--t5-out) var(--t5-ease),background-color var(--t5-out) ease,box-shadow var(--t5-out) ease,filter var(--t5-out) ease,color var(--t2,180ms) ease!important;-webkit-tap-highlight-color:transparent}
  .is-pressed{transition-duration:var(--t5-in)!important;transition-timing-function:ease-out!important}
  .is-cancel{transition-duration:180ms!important}

  /* primary buttons: sink, darken a touch, an inner shadow as if pushed in; held goes a little further */
  .btn:not(.ghost).is-pressed{transform:scale(.965) translateY(.5px);filter:brightness(.9);box-shadow:inset 0 2px 7px rgba(0,0,0,.38)!important}
  .btn:not(.ghost).is-held{transform:scale(.955) translateY(1px);filter:brightness(.85)}
  /* secondary and quiet buttons: the surface lifts in tone, a small sink */
  .btn.ghost.is-pressed,.cc-more.is-pressed,.rs-add.is-pressed,.rs-open1.is-pressed,.rs-miss.is-pressed,.kbtn.is-pressed,.rs-stp.is-pressed{transform:scale(.965);background-color:#1F2228!important}
  .btn.ghost.is-held,.cc-more.is-held,.rs-add.is-held,.kbtn.is-held{transform:scale(.955);background-color:#23262C!important}
  /* icon buttons: a soft circle of tone behind the icon */
  .acct-btn.is-pressed,.rs-qm.is-pressed,.tipi.is-pressed{transform:scale(.9);background-color:#22252B!important}
  /* rows, lists, cards and expander headings: they never shrink (long lists don't wobble); the row tints */
  .morerow.is-pressed,.rs-sb.is-pressed,.rs-jb.is-pressed,.h5-todo a.is-pressed,.ch-card.is-pressed,.acct-m [role=menuitem].is-pressed,.ld-b.is-pressed,.h5-x>summary.is-pressed,.rs-how>summary.is-pressed,.rs-tbl>summary.is-pressed{background-color:rgba(255,255,255,.055)!important}
  .morerow.is-held,.h5-todo a.is-held,.ch-card.is-held,.h5-x>summary.is-held{background-color:rgba(255,255,255,.075)!important}
  .h5-todo a.is-pressed .h5-ic,.morerow.is-pressed svg{transform:scale(.92);transition:transform var(--t5-in) ease-out}
  .h5-todo a .h5-ic,.morerow svg{transition:transform var(--t5-out) var(--t5-ease)}
  .hero-lead.is-pressed,.big.is-pressed{transform:scale(.985)}
  .rs-lk.is-pressed{opacity:.7}
  /* menu items and segments: the icon or label dips, the indicator does the moving */
  .bnav a.is-pressed svg,.side a.is-pressed svg{transform:scale(.86);transition:transform var(--t5-in) ease-out}
  .bnav a svg,.side a svg{transition:transform var(--t5-out) var(--t5-ease)}
  .bnav a.is-released svg{animation:t5-icon .32s var(--t5-ease)}
  .seg a.is-pressed,.seg button.is-pressed,.cc-range button.is-pressed,.rs-range button.is-pressed,.ld-tabs button.is-pressed{transform:scale(.95)}
  /* destructive: the press reads red, so it's clear what's about to happen */
  [data-act=logout].is-pressed,.btn.danger.is-pressed,.btn.red.is-pressed{background-color:rgba(238,42,27,.16)!important;color:#FF8A7A!important}

  /* release after acting: a short damped settle, buttons only (rows just fade their tint) */
  .btn.is-released,.cc-more.is-released,.rs-add.is-released,.rs-open1.is-released,.rs-miss.is-released,.kbtn.is-released,.acct-btn.is-released,.rs-qm.is-released{animation:t5-settle .3s var(--t5-ease)}
  .seg button.is-released,.cc-range button.is-released,.rs-range button.is-released,.ld-tabs button.is-released{animation:t5-settle-s .26s var(--t5-ease)}
}
@keyframes t5-settle{0%{transform:scale(.965)}55%{transform:scale(1.012)}100%{transform:none}}
@keyframes t5-settle-s{0%{transform:scale(.95)}60%{transform:scale(1.008)}100%{transform:none}}
@keyframes t5-icon{0%{transform:scale(.86)}55%{transform:scale(1.06)}100%{transform:none}}
/* the old instant :active shrink is replaced by the press above (touch screens get it immediately, not on lift) */
.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,.bnav a:active,.side a:active,.seg button:active,.cc-range button:active{transform:none}
/* an open menu's button stays lit */
.acct-btn[aria-expanded=true]{background-color:#22252B}
.acct-m{transform-origin:top right}.t5-ghost{pointer-events:none}

/* busy: a small spinner after 200ms, the label stays readable */
button.is-busy{position:relative;cursor:progress}
button.is-busy::after{content:"";display:inline-block;width:12px;height:12px;margin-left:8px;vertical-align:-1px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;opacity:.8;animation:t5spin .7s linear infinite}
@keyframes t5spin{to{transform:rotate(360deg)}}
button:disabled:not(.is-busy){opacity:.55;cursor:not-allowed}

/* one gliding indicator behind the chosen item */
.t5-has-ind:not(.bnav){position:relative}.t5-has-ind{isolation:isolate}
.t5-ind{position:absolute;left:0;top:0;z-index:-1;pointer-events:none;border-radius:8px;background:#1E2026;transition:transform 320ms cubic-bezier(.2,.9,.25,1),width 320ms cubic-bezier(.2,.9,.25,1),height 320ms cubic-bezier(.2,.9,.25,1)}
.t5-has-ind>.on,.t5-has-ind>[aria-pressed=true]{background:transparent!important}
.bnav .t5-ind{border-radius:14px;background:rgba(255,255,255,.06)}
.ld-tabs .t5-ind{border-radius:99px}

/* period switches: the figures dim while the new ones load (only if it takes over 120ms) */
.t5-dim>*:not(:has(.rs-range,.cc-range)){opacity:.5;transition:opacity .18s ease}

/* expanders: the chevron turns back as soon as closing starts */
.h5-x.t5-closing .h5-chev{transform:rotate(45deg) translateY(-2px)}

/* the card you just saved gives one soft highlight */
@media(prefers-reduced-motion:no-preference){.t5-flash{animation:t5-flash 1.2s ease-out}}
@keyframes t5-flash{0%{box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 70%,transparent),0 0 0 6px color-mix(in srgb,var(--accent) 16%,transparent)}100%{box-shadow:0 0 0 1px transparent,0 0 0 6px transparent}}

/* phone sheets: rise on the native sheet curve with the background fading in step; the top is the handle */
@media(max-width:640px){
  .modal.sheet .box{touch-action:pan-y;will-change:transform}
  @media(prefers-reduced-motion:no-preference){
    .modal.sheet:not(.out){animation:t5-fade .34s ease both!important}
    .modal.sheet:not(.out) .box{animation:mo-up .38s var(--t5-sheet) both!important}
    .modal.sheet.out{animation:mo-out .22s ease both!important}
    .modal.sheet.out .box{animation:mo-down .22s cubic-bezier(.4,0,1,1) both!important}
    .modal.sheet.t5-gone,.modal.sheet.t5-gone .box{animation:none!important}
  }
}
@keyframes t5-fade{from{opacity:0}}
.t5-hint{margin:0 0 12px;padding:9px 12px;border-radius:10px;background:rgba(255,194,61,.1);border:1px solid rgba(255,194,61,.3);color:#F2C46B;font-size:13.5px;font-weight:600}
@media(prefers-reduced-motion:no-preference){.t5-hint.show{animation:t5nudge .32s ease}}
@keyframes t5nudge{0%,100%{transform:none}30%{transform:translateX(-5px)}60%{transform:translateX(4px)}}

/* focus: one ring everywhere for the keyboard, never for taps */
:where(.btn,.cc-more,.morerow,.bnav a,.side a,.seg a,.seg button,.cc-range button,.rs-range button,.ld-tabs button,summary,.acct-btn,.acct-m [role=menuitem],.h5-todo a,.rs-lk):focus-visible{outline:2px solid var(--accent);outline-offset:2px}
