/* Общие правила движения для приложений «Продажи» и «Мастерская» — одна кривая, три длительности, закрытие чуть быстрее открытия.
   Подключается на страницах приложений; новые окна и экраны получают правила классами, а не отдельным кодом. */
/* Кривые: --ease-ios — вход и смена экранов; --ease-out — проявление; --ease-spring — возврат на место после жеста (лёгкий перелёт);
   --ease-exit — уход с экрана. Длительности: мелкое .16, обычное .26, крупное .36. */
:root { --ease-ios: cubic-bezier(.32, .72, 0, 1); --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-spring: cubic-bezier(.34, 1.28, .64, 1); --ease-exit: cubic-bezier(.4, 0, .8, .4); --dur-s: .16s; --dur-m: .26s; --dur-l: .36s; }

/* Затемнение и лист снизу: in — вход, out — выход (узел снимается после анимации). */
.mo-veil { opacity: 0; transition: opacity var(--dur-l) var(--ease-out); }
.mo-veil.in { opacity: 1; }
.mo-veil.out { opacity: 0; transition-duration: var(--dur-m); pointer-events: none; }
.mo-sheet { transform: translateY(calc(100% + 40px)); transition: transform var(--dur-l) var(--ease-ios); will-change: transform; }
.mo-sheet.in { transform: translateY(0); }
.mo-sheet.out { transform: translateY(calc(100% + 40px)) !important; transition-duration: var(--dur-m); pointer-events: none; }

/* Экран: вглубь — въезжает справа, назад — слева, смена вкладки — проявляется. */
@keyframes mo-from-right { from { opacity: 0; transform: translateX(28px); } }
@keyframes mo-from-left { from { opacity: 0; transform: translateX(-28px); } }
@keyframes mo-fade { from { opacity: 0; } }
@keyframes mo-grow { from { opacity: 0; transform: translateY(-6px); } }
.mo-push { animation: mo-from-right var(--dur-m) var(--ease-ios); }
.mo-pop { animation: mo-from-left var(--dur-m) var(--ease-ios); }
.mo-swap { animation: mo-fade var(--dur-s) var(--ease-out); }

/* Раскрытие <details>: содержимое проявляется и опускается, а не выскакивает. */
details[open] > *:not(summary) { animation: mo-grow var(--dur-m) var(--ease-out); }

/* Уведомление снизу: поднимается и проявляется; в приложениях — над нижним меню. */
@keyframes mo-toast { from { opacity: 0; transform: translate(-50%, 8px); } }
body.app-master .toast, body.app-visits .toast, body.app-money .toast { animation: mo-toast var(--dur-m) var(--ease-out); bottom: calc(92px + env(safe-area-inset-bottom));
  /* Общий вид в приложениях: тёмная пилюля, системный шрифт — а не плашка сайта. */
  background: #111827; color: #fff; border-radius: 999px; padding: 10px 16px; font-size: 13.5px; font-weight: 500; line-height: 1.3; text-align: center; box-shadow: 0 8px 24px rgba(17, 24, 39, 0.24); }
body.app-master .toast.bad, body.app-visits .toast.bad, body.app-money .toast.bad { background: #B42318; }
/* Уведомление — поверх любых окон и листов (лист выезда 61, лист мастера 30). */
body.app-master .toast, body.app-visits .toast, body.app-money .toast { z-index: 100; }

/* Заставка при запуске приложения: щит, название, тонкий индикатор; гаснет, когда показаны данные (BSM.ready). */
.app-splash { position: fixed; inset: 0; z-index: 200; background: #F3F4F6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: #111827; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; transition: opacity var(--dur-m) var(--ease-out); }
.app-splash img { width: 88px; height: 88px; display: block; }
.app-splash .nm { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.app-splash b { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.app-splash small { font-size: 13px; color: #63676F; font-weight: 500; }
.app-splash i { width: 22px; height: 22px; margin-top: 18px; border-radius: 50%; border: 2.5px solid #E5E7EB; border-top-color: #111827; box-sizing: border-box; animation: mo-spin .9s linear infinite; }
.app-splash.out { opacity: 0; pointer-events: none; }
@keyframes mo-spin { to { transform: rotate(360deg); } }

/* «Уменьшить движение» в настройках телефона — всё мгновенно. */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-s: 0s; --dur-m: 0s; --dur-l: 0s; }
  .mo-push, .mo-pop, .mo-swap, details[open] > *:not(summary), body.app-master .toast, body.app-visits .toast, body.app-money .toast { animation: none; }
}
