/* Schwebender Assistent (assistent-orb.js, 02.10.2026). Karten-Innenleben
   kommt aus assistent-3d.css (Klassen a3d-*). Farben nur aus den Tokens. */
.ao { position: fixed; z-index: 60; right: 22px; bottom: 22px; display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  pointer-events: none; transition: bottom .28s cubic-bezier(.2, .7, .2, 1); }
.ao > * { pointer-events: auto; }
html.sperre .ao { display: none; }
.ao-knopf { position: relative; width: 62px; height: 62px; padding: 0; border-radius: 50%; border: 1px solid var(--line); cursor: pointer;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--panel) 70%, var(--bg)), var(--panel)); box-shadow: var(--shadow), 0 4px 16px #0003;
  transition: transform .18s, box-shadow .18s; }
.ao-knopf:hover { transform: translateY(-2px) scale(1.04); }
.ao-knopf:active { transform: scale(.96); }
.ao-knopf:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ao-kugel { display: block; width: 100%; height: 100%; border-radius: 50%; }
.ao-hof { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid transparent; pointer-events: none; }
.ao[data-zustand=hoert] .ao-knopf { border-color: var(--accent); }
.ao[data-zustand=hoert] .ao-hof { border-color: color-mix(in srgb, var(--accent) 45%, transparent); animation: ao-hoeren 1.6s ease-out infinite; }
.ao[data-zustand=denkt] .ao-hof { border-color: color-mix(in srgb, var(--lav) 55%, transparent); border-top-color: var(--lav); animation: ao-dreh 1s linear infinite; }

/* Karte am Knopf */
.ao-karte { width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 130px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow), 0 6px 24px #0003;
  animation: ao-rein .26s cubic-bezier(.2, .7, .2, 1) both; transform-origin: bottom right; }
.ao-karte[hidden] { display: none; }
.ao--links .ao-karte { position: absolute; right: 76px; top: 0; transform-origin: top right; }
.ao-karte__kopf { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ao-name { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 650; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); }
.ao-name::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--lav), var(--accent) 70%); }
.ao-still { font-size: 12px; color: var(--muted); }
.ao-zu { display: grid; place-items: center; width: 30px; height: 30px; margin-left: auto; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
.ao-zu:hover { background: var(--panel2); color: var(--text); }
.ao-zu .a3d-sym { width: 16px; height: 16px; }
.ao-mitschrift { margin: 2px 0 0; font-size: 17px; line-height: 1.5; color: var(--text); min-height: 52px; }
.ao-mitschrift::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -2px; background: var(--accent); animation: ao-cursor 1s steps(2) infinite; }
.ao-mitschrift--leer { color: var(--muted); }
.ao-pegel { display: flex; align-items: center; gap: 4px; height: 26px; margin: 10px 0 4px; }
.ao-pegel i { display: block; width: 5px; height: 100%; border-radius: 3px; background: var(--accent); transform: scaleY(.15); transform-origin: center; transition: transform .1s linear; }
.ao-pegel i:nth-child(2), .ao-pegel i:nth-child(4) { background: color-mix(in srgb, var(--accent) 60%, var(--lav)); }
.ao-fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 8px; }
.ao-leise { border: 0; background: none; padding: 4px 0; color: var(--text); font: inherit; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--accent); cursor: pointer; }
.ao-du { display: block; margin: 0 0 10px; font-size: 13px; color: var(--muted); font-style: normal; }
.ao-du::before { content: "„"; } .ao-du::after { content: "“"; }
.ao-denkt { display: flex; gap: 6px; align-items: center; margin: 4px 0; color: var(--muted); font-size: 13px; }
.ao-denkt span { margin-left: 6px; }
.ao-denkt i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: a3d-punkt 1.1s ease-in-out infinite; }
.ao-denkt i:nth-child(2) { animation-delay: .15s; } .ao-denkt i:nth-child(3) { animation-delay: .3s; background: var(--lav); }
.ao-satz { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--text); }
.ao-schreiben { display: grid; gap: 8px; }
.ao-feld { width: 100%; min-height: 64px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.ao-feld:focus { outline: 0; border-color: var(--accent); }
.ao-schreiben .a3d-knopf { justify-self: end; }
/* Kompakte Karte aus assistent-3d.js: ohne eigenen Rahmen, die Karte am Knopf ist der Rahmen. */
.ao-karte .a3d-karte--kompakt { border: 0; padding: 0; background: none; animation: none; }
.ao-karte .a3d-karte--kompakt::before { display: none; }
.ao-karte .a3d-karte__antwort { font-size: 15px; line-height: 1.6; }
.ao-karte .a3d-belege__liste { grid-template-columns: 1fr; }
.ao-karte .a3d-abgelegt__titel { font-size: 15.5px; }
.ao-karte .a3d-schritte { margin-top: 12px; }

/* Leitfaden daneben: eingeklappt als Pille links vom Knopf, offen darunter. */
html.ao-da .lf { max-height: min(600px, calc(100vh - 200px)); }
html.ao-da .lf.lf--klein { right: 98px; bottom: 28px; width: auto; max-width: 300px; border-radius: 999px; }
html.ao-da .lf.lf--klein .lf-kopf { padding: 6px 6px 6px 8px; gap: 4px; }
html.ao-da .lf.lf--klein .lf-ring { width: 28px; height: 28px; }
html.ao-da .lf.lf--klein .lf-titel { gap: 9px; }
html.ao-da .lf.lf--klein .lf-titel b { font-size: 13px; }
html.ao-da .lf.lf--klein .lf-titel small { font-size: 11px; }
html.ao-da .lf.lf--klein .lf-knopf { width: 28px; height: 28px; }
html.ao-da .lf.lf--klein .lf-stand, html.ao-da .lf.lf--klein .lf-balken { display: none; }
html.ao-da .lf-launcher { right: 98px; bottom: 30px; border-radius: 999px; }

@keyframes ao-hoeren { from { transform: scale(1); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@keyframes ao-dreh { to { transform: rotate(360deg); } }
@keyframes ao-rein { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes ao-cursor { to { visibility: hidden; } }
html[data-motion=off] .ao *, html[data-motion=off] .ao { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .ao *, .ao { animation: none !important; transition: none !important; } }

@media (max-width: 760px) {
  .ao { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .ao-knopf { width: 54px; height: 54px; }
  /* Auf dem Handy als Blatt ueber der Tab-Leiste, immer ganz sichtbar, egal wo der Knopf sitzt. */
  .ao-karte { position: fixed; left: 12px; right: 12px; width: auto; bottom: calc(146px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100vh - 176px - env(safe-area-inset-bottom, 0px)); transform-origin: bottom center; }
  html.ao-da .lf.lf--klein { right: 80px; left: auto; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 100px); }
  html.ao-da .lf-launcher { right: 80px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
