/* GPL-3.0 EssayPilot presentation; numeric sidebar driver is vendored Telegram Web A. */
@media screen {
  .ep-motion-enabled :is(.migration-app, .ep-arsenal-picker) :is(button, a.ep-home-action__link, a.ep-global-site-entry) {
    transition-property: background-color, border-color, color, scale;
    transition-duration: 140ms, 140ms, 140ms, 180ms;
    transition-timing-function: ease, ease, ease, cubic-bezier(.22,.75,.25,1);
  }
  .ep-motion-enabled :is(.migration-app, .ep-arsenal-picker) :is(button, a.ep-home-action__link, a.ep-global-site-entry):not(:disabled):not([aria-disabled="true"]):active {
    scale: .985;
  }
  .ep-motion-enabled #sidebar {
    display: flex;
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    transition: transform 280ms cubic-bezier(.22,.75,.25,1), opacity 180ms ease, visibility 0s;
  }
  .ep-motion-enabled .migration-main { transition: margin-left 280ms cubic-bezier(.22,.75,.25,1); }
  .ep-motion-enabled :is(.ep-home-atmosphere, .migration-main::after) { transition: left 280ms cubic-bezier(.22,.75,.25,1); }
  [data-ep-motion-ghost] {
    z-index: 1100 !important;
    pointer-events: none !important;
    user-select: none !important;
    overflow: hidden;
    contain: layout paint;
  }
  [data-ep-motion-ghost] * { pointer-events: none !important; }
  @media (min-width: 1001px) {
    body.ep-motion-enabled.ep-sidebar-collapsed #sidebar {
      display: flex;
      transform: translateX(-100%);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: transform 280ms cubic-bezier(.22,.75,.25,1), opacity 180ms ease, visibility 0s 280ms;
    }
  }
  @media (max-width: 1000px) {
    body.ep-motion-enabled #sidebar:not(.is-open) {
      transform: translateX(-100%);
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: transform 280ms cubic-bezier(.22,.75,.25,1), opacity 180ms ease, visibility 0s 280ms;
    }
    .ep-motion-enabled .migration-main { transition: none; }
  }
  /* The RAF driver already has easing. Never double-ease its inline frames.
     Keep the CSS rules above as a fallback when RAF is not available. */
  body.ep-motion-enabled #sidebar[data-ep-motion-sidebar] {
    display: flex;
    transition: none;
    will-change: transform, opacity;
  }
  body.ep-motion-enabled:has(#sidebar[data-ep-motion-sidebar]) .migration-main { transition: none; }
  @media (min-width: 1001px) {
    body.ep-motion-enabled:has(#sidebar[data-ep-motion-sidebar]) :is(.ep-home-atmosphere, .migration-main::after) {
      left: var(--ep-sidebar-offset, 260px) !important;
      transition: none;
    }
  }
  /* Priority jump: hold the halo while smooth scrolling settles, then settle into the focus ring from
     reading-system.css, which the focused target keeps after the class is removed at 1.8s.
     Without motion support or with reduced motion, the static outlines apply unchanged. */
  @media (prefers-reduced-motion: no-preference) {
    .ep-motion-enabled .ep-report-panel .is-priority-target,
    .ep-motion-enabled .ep-report-panel.is-priority-target { animation: ep-priority-arrive 1800ms ease-out forwards; }
  }
  @keyframes ep-priority-arrive {
    0%, 35% { outline: 3px solid #89a9d3; outline-offset: 4px; box-shadow: 0 0 0 9px #89a9d32e; }
    100% { outline: 2px solid #8096b8; outline-offset: 2px; box-shadow: 0 0 0 9px #89a9d300; }
  }
  .ep-motion-paused .ep-home-plane { animation-play-state: paused !important; }
  .ep-motion-paused .ep-report-panel .is-priority-target { animation-play-state: paused !important; }
  .ep-motion-paused :is(#sidebar, .migration-main, .ep-home-atmosphere, .migration-main::after) { transition: none !important; }
  @media (prefers-reduced-motion: reduce) {
    .ep-motion-enabled :is(.migration-app, .ep-arsenal-picker) :is(button, a.ep-home-action__link, a.ep-global-site-entry),
    .ep-motion-enabled :is(#sidebar, .migration-main, .ep-home-atmosphere, .migration-main::after) { transition: none !important; }
    .ep-motion-enabled :is(.migration-app, .ep-arsenal-picker) :is(button, a.ep-home-action__link, a.ep-global-site-entry):active { scale: 1; }
  }
}
@media print { [data-ep-motion-ghost] { display: none !important; } }
