/* FONEONA Seller motion: state feedback, never decorative movement. */
:root{
  --motion-instant:100ms;
  --motion-fast:160ms;
  --motion-base:220ms;
  --motion-medium:360ms;
  --motion-slow:520ms;
  --motion-scene:720ms;
  --ease-standard:cubic-bezier(.22,.8,.24,1);
  --ease-enter:cubic-bezier(.16,1,.3,1);
  --ease-exit:cubic-bezier(.7,0,.84,0);
  --ease-linear:linear;
  /* Compatibility aliases: all application motion resolves to the same scale. */
  --motion-standard:var(--motion-base);
  --motion-panel:var(--motion-medium);
  --motion-ease:var(--ease-standard);
  --motion-ease-soft:var(--ease-standard);
  --motion-ease-press:var(--ease-exit);
}

html[data-motion-preference="reduced"]{scroll-behavior:auto}
body.workspace-open .sidebar,
body.workspace-open .main{transition-duration:260ms!important;transition-timing-function:var(--ease-standard)!important}
body.workspace-open .sidebar .nav-item{transition:background-color 180ms var(--ease-standard),border-color 180ms var(--ease-standard),color 180ms var(--ease-standard)!important}
body.workspace-open .sidebar .nav-item::before{transition:background-color var(--motion-fast) var(--ease-standard)!important}
body.workspace-open .sidebar .nav-text{transition:opacity var(--motion-instant) var(--ease-exit)!important}
body.workspace-open.sidebar-collapsed .sidebar .nav-text{opacity:0!important}

body.workspace-open :where(button,a,[role="button"]){transition:color var(--motion-fast) var(--ease-standard),background-color var(--motion-fast) var(--ease-standard),border-color var(--motion-fast) var(--ease-standard),box-shadow var(--motion-base) var(--ease-standard),opacity var(--motion-fast) var(--ease-standard),transform var(--motion-instant) var(--ease-standard)!important}
body.workspace-open :where(button,a,[role="button"]):active:not(:disabled){transform:scale(.985)!important}
body.workspace-open :where(input,select,textarea){transition:border-color var(--motion-fast) var(--ease-standard),box-shadow var(--motion-fast) var(--ease-standard),background-color var(--motion-fast) var(--ease-standard)!important}
body.workspace-open :where(.primary-button,.secondary-button,.filter-button,.row-action,.table-layout-trigger,.board-builder-trigger):hover:not(:disabled){transform:translateY(-1px)!important}
body.workspace-open :where(.primary-button,.secondary-button,.filter-button,.row-action,.table-layout-trigger,.board-builder-trigger):disabled{cursor:not-allowed!important;transform:none!important}

/* A route never covers the shell: only the arriving work surface gets context. */
body.workspace-open .view.motion-route-enter{animation:motion-route-enter var(--motion-medium) var(--ease-enter) both}
@keyframes motion-route-enter{from{opacity:.92;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}

/* The system bar changes only after actual scroll, without changing its height. */
body.workspace-open .global-system-bar{transition:background-color 180ms var(--ease-standard),box-shadow 180ms var(--ease-standard),backdrop-filter 180ms var(--ease-standard)!important}
body.workspace-open .global-system-bar.motion-scrolled{background:rgba(255,255,255,.88)!important;box-shadow:0 8px 24px rgba(23,29,46,.08)!important;backdrop-filter:blur(12px)}
.global-popover{transform-origin:top right;animation:motion-popover-enter var(--motion-base) var(--ease-enter) both}
@keyframes motion-popover-enter{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.notifications-panel.open{animation:motion-popover-enter var(--motion-base) var(--ease-enter)!important}

/* Overlays explain a transition without simulating work. */
.modal.open .modal-backdrop,.auth-modal.open .auth-backdrop{animation:motion-backdrop-enter 180ms var(--ease-standard) both}
.modal.open .modal-card,.auth-modal.open .auth-card{animation:motion-modal-enter 280ms var(--ease-enter) both}
.board-builder-dialog{animation-duration:var(--motion-medium)!important;animation-timing-function:var(--ease-enter)!important}
@keyframes motion-backdrop-enter{from{opacity:0}to{opacity:1}}
@keyframes motion-modal-enter{from{opacity:0;transform:translateY(4px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
.toast.show{animation:motion-toast-enter 180ms var(--ease-enter) both}
@keyframes motion-toast-enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}

/* KPI numbers never count from zero. The container enters once, values remain factual. */
:where(.motion-kpi-enter){animation:motion-kpi-enter 320ms var(--ease-enter) both;animation-delay:var(--motion-stagger,0ms)}
@keyframes motion-kpi-enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}

/* Chart drawing is limited by JS to two visible SVGs and only their existing paths. */
svg.motion-chart-enter{animation:motion-chart-fade var(--motion-slow) var(--ease-standard) both}
@keyframes motion-chart-fade{from{opacity:.58}to{opacity:1}}
.motion-table-enter{animation:motion-table-enter var(--motion-medium) var(--ease-enter) both}
@keyframes motion-table-enter{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}

/* Existing data stays readable while an actual source refreshes. */
:is(.promo-board-v3,.market-board-v4,.finance-truth-panel)[aria-busy="true"]{position:relative;opacity:.55;transition:opacity var(--motion-fast) var(--ease-standard)}
:is(.promo-board-v3,.market-board-v4,.finance-truth-panel)[aria-busy="true"]::after{content:"Обновляем источник…";position:absolute;right:14px;top:14px;padding:5px 8px;border-radius:999px;background:#fff;color:#6256a8;box-shadow:0 3px 10px rgba(33,27,69,.08);font:700 10px/1 Onest,system-ui,sans-serif;opacity:1}
:is(.promo-board-v3,.market-board-v4,.finance-truth-panel):not([aria-busy="true"]){transition:opacity var(--motion-fast) var(--ease-standard)}

/* One-time maturity feedback; statuses never blink continuously. */
.motion-maturity-pulse{animation:motion-maturity-pulse var(--motion-medium) var(--ease-standard) 1}
@keyframes motion-maturity-pulse{0%{box-shadow:0 0 0 0 rgba(224,151,62,.34)}100%{box-shadow:0 0 0 8px rgba(224,151,62,0)}}
.motion-error-once{animation:motion-error-once var(--motion-base) var(--ease-standard) 1}
@keyframes motion-error-once{0%,100%{transform:translateX(0)}35%{transform:translateX(-3px)}70%{transform:translateX(3px)}}

@media(max-width:760px){
  body.workspace-open .view.motion-route-enter{animation-duration:var(--motion-fast);animation-name:motion-mobile-view-enter}
  @keyframes motion-mobile-view-enter{from{opacity:.94}to{opacity:1}}
  .modal.open .modal-card,.auth-modal.open .auth-card{animation-duration:var(--motion-base)}
  body.workspace-open :where(button,a,[role="button"]):active:not(:disabled){transform:scale(.985)!important}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
html[data-motion-preference="reduced"] *,html[data-motion-preference="reduced"] *::before,html[data-motion-preference="reduced"] *::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
