/* Hover-opened menu over the icon rail (shared by /app and the support console): the panel grows smoothly
   and its rows slide in, instead of jumping open. */
[data-sidebar-motion] { transition: width 0.5s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.45s ease, border-radius 0.45s ease; }
[data-sidebar-motion]:is([data-peek], [data-closing]) { overflow: hidden; }
/* Animate the visible edge only. Keep the full menu at its final width so the logo,
   navigation and connection controls never overlap or wrap during the transition. */
[data-sidebar-motion]:is([data-peek], [data-closing]) > * { min-inline-size: 16rem; }
[data-sidebar-motion]:is([data-peek], [data-closing]) > [data-sidebar-header] { min-inline-size: 14rem; }
/* Opening: the labels fade and slide in a beat after the panel starts to grow (owner 2026-11-23: „smoothabban, lassabban”). */
[data-sidebar-motion][data-peek] > * { animation: nav-peek-in 0.5s cubic-bezier(0.32, 0.72, 0, 1) 0.05s both; }
[data-sidebar-motion][data-peek] > nav { animation-delay: 0.09s; }
/* Closing: the open menu's rows stay while the width shrinks (their icons sit on the rail's column, so only the
   labels are clipped); the labels and the wide card fade out on the way. */
[data-sidebar-motion][data-closing] :is(a, button) :is(span, p),
[data-sidebar-motion][data-closing] [data-sidebar-label],
[data-sidebar-motion][data-closing] :is([data-ai-connect], [data-ai-connect-setup]),
[data-sidebar-motion][data-closing] [data-sidebar-header] a > *:not(img) { transition: opacity 0.18s ease; opacity: 0; }
[data-sidebar-motion][data-closing] nav { overflow-x: hidden; }
[data-sidebar-motion][data-closing] :is(a, button) { white-space: nowrap; }

/* The fixed dark workspace and the sidebar animate at different speeds.
   The app frame behind them can be visible between their edges mid-transition. */
@media (min-width: 1024px) {
  html.editor-active #tour-main:has([data-fullscreen-editor]) :is([data-app-frame], [data-app-header]) {
    background-color: #1b1b1d;
    border-color: #343438;
  }
  html.editor-active #tour-main:has([data-fullscreen-editor]) [data-app-header] .app-corner { visibility: hidden; }
}

/* The expanded AI tools section stays mounted as the rail shrinks.
   Replace its light utility only; cards with their own themed surface don't need this. */
html.editor-active #app-sidebar[data-sidebar-motion] section.bg-white\/60 {
  background-color: #232326;
  border-color: #343438;
}
html.editor-active #app-sidebar[data-sidebar-motion] section.bg-white\/60 > * + * { border-color: #343438; }
/* The rest of the connection rows already use the rail's dark rules in index.css. */
html.editor-active #app-sidebar[data-sidebar-motion] section.bg-white\/60 :is(h2, [data-ai-limits]) { color: #d4d4d8; }

@keyframes nav-peek-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  [data-sidebar-motion] { transition: none; }
  [data-sidebar-motion][data-peek] > * { animation: none; }
}
