/* Motion, loading and alignment details shared by every page.
   One rule of thumb: motion answers something the person did, and nothing moves
   the layout around them. */

/* Stability: the scrollbar's space is always reserved, so opening a dialog or a
   longer page never nudges content sideways. Numbers that tick keep their width. */
html{scrollbar-gutter:stable}
:is(#timer,#sessionRemaining,#liveSegmentCount,#recordsCount,.usage-card strong,.records-row time,.hm-booth-clock){font-variant-numeric:tabular-nums}
#account-status{min-height:1.6em}

/* Chinese typesetting: trim the doubled space around full-width punctuation and
   add the small gap between Han characters and Latin letters or digits. */
.brand44{text-spacing-trim:trim-start;text-autospace:normal}
.brand44 :is(p,li,dd,summary){hanging-punctuation:first allow-end}

/* Moving between pages: the header and the workspace sidebar stay put, only
   the content changes, so the three workspaces feel like one app. */
@view-transition{navigation:auto}
.site-header{view-transition-name:site-header}
.app-sidebar{view-transition-name:app-sidebar}
::view-transition-old(root){animation:pl-leave .16s cubic-bezier(.4,0,1,1) both}
::view-transition-new(root){animation:pl-enter .26s cubic-bezier(.2,.7,.2,1) both}
@keyframes pl-leave{to{opacity:0;transform:translateY(-3px)}}
@keyframes pl-enter{from{opacity:0;transform:translateY(6px)}}

/* Things that appear because you asked for them. */
dialog[open]{animation:pl-dialog .22s cubic-bezier(.2,.8,.2,1)}
dialog[open]::backdrop{animation:pl-fade .22s ease-out}
.toast:not([hidden]),.network-banner:not([hidden]){animation:pl-rise .24s cubic-bezier(.2,.8,.2,1)}
details[open]>:not(summary){animation:pl-fade .2s ease-out}
@keyframes pl-dialog{from{opacity:0;transform:translateY(10px) scale(.98)}}
@keyframes pl-rise{from{opacity:0;transform:translateY(10px)}}
@keyframes pl-fade{from{opacity:0}}

/* Copied: the icon becomes a tick for 2.5 seconds (polish.js). */
.brand44 .is-copied{color:var(--accent)}
.brand44 .is-copied img.icon,.brand44 .is-copied.emate-icon-control::before{animation:pl-pop .38s cubic-bezier(.3,1.6,.5,1)}
.brand44 [data-review-action=copy]{min-width:7.5em}
.brand44 [data-review-action=copy].is-copied::before{content:'';display:inline-block;width:14px;height:14px;margin-right:6px;background:currentColor;mask:url(/vendor/lucide/check.svg) center/contain no-repeat;animation:pl-pop .38s cubic-bezier(.3,1.6,.5,1)}
@keyframes pl-pop{0%{opacity:0;transform:scale(.4)}60%{opacity:1;transform:scale(1.15)}100%{transform:none}}

/* Working: the button's own icon turns into a spinner, so its size never changes. */
.brand44 :is(#start[data-pending=true],#text-submit[aria-busy=true],.auth-submit:disabled).emate-icon-control::before,
.brand44 .auth-submit:disabled::before{content:'';display:inline-block;width:15px;height:15px;margin-right:2px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;background:none;mask:none;animation:pl-spin .7s linear infinite}
@keyframes pl-spin{to{transform:rotate(1turn)}}

/* Placeholders shaped like what they stand in for. */
.pl-shimmer,.records-skeleton,.records-skeleton-bar,.usage-grid .skeleton{
 background:linear-gradient(100deg,var(--surface-2) 40%,color-mix(in srgb,var(--surface) 75%,var(--surface-2)) 50%,var(--surface-2) 60%) 0 0/300% 100%;
 animation:pl-shimmer 1.4s ease-in-out infinite}
@keyframes pl-shimmer{from{background-position:100% 0}to{background-position:0 0}}
.records-skeleton{display:block;min-height:96px;margin:0 0 8px;border-radius:12px}
.records-detail-skeleton{display:grid;gap:14px;padding:clamp(20px,3vw,32px)}
.records-skeleton-bar{display:block;height:12px;border-radius:6px}
.records-skeleton-bar.is-title{height:26px;width:56%;margin-bottom:2px}
.records-skeleton-bar.is-meta{width:28%;margin-bottom:14px}
.records-skeleton-bar.is-short{width:68%}
/* Text translation: faint lines take the translation's place while it is written. */
.brand44 #text-output[aria-busy=true]{color:transparent;
 background:linear-gradient(100deg,transparent 40%,color-mix(in srgb,var(--surface) 70%,transparent) 50%,transparent 60%) 0 0/300% 100%,
  repeating-linear-gradient(var(--surface) 0 22px,var(--surface-2) 22px 34px,var(--surface) 34px 50px) 0 6px/86% 152px no-repeat,var(--surface);
 background-origin:content-box;animation:pl-shimmer 1.4s ease-in-out infinite}
.brand44 #text-output[aria-busy=true]::placeholder{color:transparent}

/* Alignment: icons sit on the text's optical centre, never stretched or squeezed. */
.brand44 :is(button,.button,a) > img.icon{flex:none;align-self:center}
.brand44 :is(.side-links a,.side-links .workspace-mode){align-items:center}

@media(prefers-reduced-motion:reduce){
 ::view-transition-old(root),::view-transition-new(root){animation:none}
 .brand44 *,.brand44 *::before,.brand44 *::after,dialog[open],dialog[open]::backdrop{animation-duration:.01ms!important;animation-iteration-count:1!important}
 .pl-shimmer,.records-skeleton,.records-skeleton-bar,.usage-grid .skeleton,.brand44 #text-output[aria-busy=true]{animation:none}
}
/* Buttons whose label changes while working keep one width for every label. */
.brand44 #text-submit{min-width:9.5em}
.brand44 #start{min-width:9em}
