/* Alpi launcher (owner decision 27.09.2026, app/test-output/alpi-guide/design.md §5): Alpi bottom right on every
   signed-in page, at boot (the guide engine and css/guide.css still load on the first click). Tokens only. It never
   covers a sticky form action bar (lifted above it), a dialog, the help panel or a toast (the toasts move above it),
   and focused controls scroll clear of it (scroll-padding-bottom, WCAG 2.4.11). */
:root { --alpi-size: 76px; --alpi-greeting-size: 96px; --alpi-gap: 20px; --alpi-bottom: var(--alpi-gap); --alpi-clear: calc(var(--alpi-bottom) + var(--alpi-size) + 16px); }
/* A sticky form action bar (e.g. «Abbrechen / Entwurf erstellen»): Alpi sits above it. */
:root:has(#app :is(form.card-pad > .form-actions:last-child, .card-pad > form:last-child > .form-actions:last-child, .form-actions-sticky)) { --alpi-bottom: calc(var(--control) + 10px + var(--card-pad) + 28px); }
.alpi-launcher { position: fixed; z-index: calc(var(--z-toast) - 3); right: var(--alpi-gap); bottom: var(--alpi-bottom); width: var(--alpi-size); height: var(--alpi-size); display: grid; place-items: center; padding: 0; border: 1px solid var(--petrol-6); border-radius: var(--radius-full); background: var(--petrol-2); color: var(--text-primary); box-shadow: var(--shadow-2); cursor: pointer; }
.alpi-art { display: block; object-fit: contain; object-position: center; user-select: none; pointer-events: none; }
.alpi-launcher > .alpi-art { display: block; width: 100%; height: 114%; margin-top: -13%; pointer-events: none; }
.auth-alpi.alpi-art { object-fit: contain; }
.empty-alpi.alpi-art { object-fit: contain; }
.alpi-launcher:hover { border-color: var(--petrol-7); background: var(--petrol-3); box-shadow: var(--shadow-3); }
.alpi-launcher:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.alpi-launcher[aria-expanded="true"] { border-color: var(--accent); background: var(--petrol-4); }
/* Greeting (the welcome speaks from Alpi as a bubble, css/guide.css .guide-welcome.is-bubble): Alpi grows and waves. */
.alpi-launcher.is-greeting { width: var(--alpi-greeting-size); height: var(--alpi-greeting-size); }
.alpi-launcher[hidden] { display: none; }
/* Never on the login or loading screen (no shell), never over a dialog, the palette or the help panel. */
body:not(:has(#app .topbar)) .alpi-launcher, body:has(dialog[open]) .alpi-launcher, body:has(.guide-panel:not([hidden])) .alpi-launcher { display: none; }
/* Focused controls, the ends of the scrolling lists and the toasts stay clear of Alpi. */
html:has(.alpi-launcher:not([hidden])) { scroll-padding-bottom: var(--alpi-clear); }
html:has(.alpi-launcher:not([hidden])):has(.editor-rail) { scroll-padding-bottom: calc(var(--alpi-clear) + 56px); }
body:has(.alpi-launcher:not([hidden])) :is(.list-sheet .table-wrap, .bank-pane, .ab-list .table-wrap) { scroll-padding-bottom: var(--alpi-clear); }
body:has(.alpi-launcher:not([hidden])) :is(.list-sheet .data-grid > .table-wrap, .ab-list .table-wrap)::after { content: ""; display: block; height: calc(var(--alpi-size) + var(--alpi-gap)); }
body:has(.alpi-launcher:not([hidden])) .bank-pane::after { content: ""; height: calc(var(--alpi-size) - 8px); }
body:has(.alpi-launcher:not([hidden])) .toast-region { bottom: var(--alpi-clear); }
@media (prefers-reduced-motion: no-preference) {
  .alpi-launcher { transition: translate 140ms ease-out, box-shadow 140ms ease-out, width 160ms ease-out, height 160ms ease-out; }
  .alpi-launcher:is(:hover, :focus-visible) { translate: 0 -2px; }
  .alpi-launcher.is-waving > .alpi-art { animation: alpi-wave 1100ms ease-in-out 400ms 1; }
  @keyframes alpi-wave { 0%, 100% { rotate: 0deg; } 25% { rotate: -7deg; } 50% { rotate: 5deg; } 75% { rotate: -3deg; } }
}
@media (forced-colors: active) { .alpi-launcher { border: 1px solid ButtonText; } }
@media print { .alpi-launcher { display: none !important; } }
