/**
 * Flora Voice-Orb (Hyperframe v5 — Stufe 2: Konversation)
 * ========================================================
 * Eigenständiger schwebender Voice-Trigger MIT Gespräch.
 * States: idle ↔ listen (bernstein) ↔ think ↔ speak (mint)
 * + Mini-Text-Chat-Panel als Rückfallebene.
 *
 * Anker im DOM: Element mit [data-sales-agent-trigger].
 * Orb wird per JS daneben gemounted (position: absolute).
 * Klick auf Orb → Begrüßung wird gesprochen (Marlene via Cartesia).
 *
 * Größenraster (siehe Memory flora-hyperframe-ui):
 *   --hg-orb-size = 180 (Hero/Demo) — 02.07. von 220 verkleinert (ragte
 *   sonst über die Produkt-Specs; Innenelemente bleiben fix, wirken bei
 *   180px noch ausgewogen).
 * Mobile fällt auf 140 zurück.
 *
 * CSS-Variablen sind auf .hg-orb-mount gescoped — Theme-isolation.
 */

.hg-orb-mount {
    /* Wrapper-Klasse — JS setzt position:relative inline.
       Hier nur CSS-Variablen scoped definieren. */
    --hg-orb-size: 180px;
    --hg-orb-z: 9999;

    /* Idle-Farbsystem (LIGHT-MODE — passt zu ivory/cremeweißen Backgrounds
       wie homegarden.bio und Twenty Twenty-Five) */
    --hg-orb-c-card-bg: rgba(250,248,243,0.65);
    --hg-orb-c-card-border: rgba(74,103,65,0.40);
    --hg-orb-c-card-shadow: 0 8px 24px rgba(74,103,65,0.18);
    --hg-orb-c-card-inner-bg: rgba(250,248,243,0.80);

    --hg-orb-c-frame-base: rgba(74,103,65,0.55);
    --hg-orb-c-frame-outer: rgba(74,103,65,0.22);
    --hg-orb-c-frame-tick: rgba(74,103,65,0.40);
    --hg-orb-c-frame-energy: transparent;
    --hg-orb-c-frame-filter: none;

    --hg-orb-c-avatar-ring: rgba(74,103,65,0.45);
    --hg-orb-c-avatar-inner: rgba(74,103,65,0.30);
    --hg-orb-c-avatar-shadow: none;

    --hg-orb-c-leaf-fill: rgba(74,103,65,0.20);
    --hg-orb-c-leaf-stroke: #4A6741;
    --hg-orb-c-leaf-vein: rgba(74,103,65,0.65);
    --hg-orb-c-leaf-dot: #4A6741;

    --hg-orb-c-name: #1C1F1A;
    --hg-orb-c-status: rgba(74,103,65,0.75);
    --hg-orb-c-text-shadow: none;

    --hg-orb-leaf-anim: hg-orb-leaf-idle 4s ease-in-out infinite;
    --hg-orb-ring-anim: hg-orb-idle-breathe 3.5s ease-in-out infinite;
}

/* ─── Speak-State (mint, kräftiger Glow) ───────────────────────── */
.hg-orb-container[data-state="speak"] {
    --hg-orb-c-card-bg: rgba(0,184,148,0.12);
    --hg-orb-c-card-border: rgba(0,184,148,0.55);
    --hg-orb-c-card-shadow: 0 0 32px rgba(0,184,148,0.30);
    --hg-orb-c-card-inner-bg: rgba(250,248,243,0.92);

    --hg-orb-c-frame-base: rgba(0,184,148,0.85);
    --hg-orb-c-frame-outer: rgba(0,184,148,0.35);
    --hg-orb-c-frame-tick: rgba(0,184,148,0.65);
    --hg-orb-c-frame-energy: #00b894;
    --hg-orb-c-frame-filter: drop-shadow(0 0 6px rgba(0,184,148,0.6)) drop-shadow(0 0 18px rgba(0,184,148,0.25));

    --hg-orb-c-avatar-ring: rgba(0,184,148,0.70);
    --hg-orb-c-avatar-inner: rgba(0,184,148,0.50);
    --hg-orb-c-avatar-shadow: 0 0 16px rgba(0,184,148,0.45);

    --hg-orb-c-leaf-fill: rgba(0,184,148,0.30);
    --hg-orb-c-leaf-stroke: #00805f;
    --hg-orb-c-leaf-vein: #00b894;
    --hg-orb-c-leaf-dot: #00805f;

    --hg-orb-c-status: #00805f;

    --hg-orb-leaf-anim: hg-orb-leaf-speak 0.9s ease-in-out infinite;
    --hg-orb-ring-anim: hg-orb-ring-breathe-mint 1.4s ease-in-out infinite;
}

/* ─── Listen-State (warmes Bernstein — "ich höre zu") ──────────── */
.hg-orb-container[data-state="listen"] {
    --hg-orb-c-card-bg: rgba(224,159,62,0.12);
    --hg-orb-c-card-border: rgba(224,159,62,0.60);
    --hg-orb-c-card-shadow: 0 0 32px rgba(224,159,62,0.35);
    --hg-orb-c-card-inner-bg: rgba(250,248,243,0.92);

    --hg-orb-c-frame-base: rgba(224,159,62,0.85);
    --hg-orb-c-frame-outer: rgba(224,159,62,0.35);
    --hg-orb-c-frame-tick: rgba(224,159,62,0.65);
    --hg-orb-c-frame-energy: #e09f3e;
    --hg-orb-c-frame-filter: drop-shadow(0 0 6px rgba(224,159,62,0.6)) drop-shadow(0 0 18px rgba(224,159,62,0.25));

    --hg-orb-c-avatar-ring: rgba(224,159,62,0.75);
    --hg-orb-c-avatar-inner: rgba(224,159,62,0.50);
    --hg-orb-c-avatar-shadow: 0 0 16px rgba(224,159,62,0.45);

    --hg-orb-c-leaf-fill: rgba(224,159,62,0.30);
    --hg-orb-c-leaf-stroke: #b87514;
    --hg-orb-c-leaf-vein: #e09f3e;
    --hg-orb-c-leaf-dot: #b87514;

    --hg-orb-c-status: #b87514;

    --hg-orb-leaf-anim: hg-orb-leaf-idle 2s ease-in-out infinite;
    --hg-orb-ring-anim: hg-orb-ring-pulse-amber 1.1s ease-in-out infinite;
}
.hg-orb-container[data-state="listen"] .hg-orb-wave-bar {
    opacity: 1;
    background: linear-gradient(180deg, #ffc870, #e09f3e);
}

/* ─── Think-State (dezent, Arc rotiert langsam) ────────────────── */
.hg-orb-container[data-state="think"] {
    --hg-orb-c-frame-energy: rgba(74,103,65,0.65);
    --hg-orb-c-status: rgba(74,103,65,0.95);
    --hg-orb-ring-anim: hg-orb-idle-breathe 1.2s ease-in-out infinite;
}
.hg-orb-container[data-state="think"] .f-arc {
    animation: hg-orb-arc-spin 1.6s linear infinite;
    transform-origin: 110px 110px;
}
@keyframes hg-orb-arc-spin {
    from { transform: rotate(-90deg); }
    to   { transform: rotate(270deg); }
}

/* ─── Container ───────────────────────────────────────────────── */
.hg-orb-container {
    position: absolute;
    width: var(--hg-orb-size);
    height: var(--hg-orb-size);
    /* Default: RECHTS vom Trigger, vertikal zentriert.
       Wenn rechts kein Platz (Mobile), greift Media-Query unten. */
    left: calc(100% + 16px);
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--hg-orb-z);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    /* sanfter Auftritt */
    animation: hg-orb-mount 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hg-orb-mount {
    0%   { opacity: 0; transform: scale(0.6); }
    100% { opacity: 1; transform: scale(1); }
}

/* Klick-Splash (translateY beibehalten, nur Scale) */
.hg-orb-container:active {
    transform: translateY(-50%) scale(0.97);
    transition: transform 0.12s ease-out;
}

/* ─── SVG-Frame ────────────────────────────────────────────────── */
.hg-orb-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    filter: var(--hg-orb-c-frame-filter);
    transition: filter 0.7s ease;
}
.hg-orb-frame .f-base  { fill: none; stroke: var(--hg-orb-c-frame-base);  stroke-width: 1.2px; transition: stroke 0.7s, stroke-width 0.7s; }
.hg-orb-frame .f-outer { fill: none; stroke: var(--hg-orb-c-frame-outer); stroke-width: 0.8px; transition: stroke 0.7s; }
.hg-orb-frame .f-tick  {            stroke: var(--hg-orb-c-frame-tick);  stroke-width: 0.8px; transition: stroke 0.7s; }
.hg-orb-frame .f-arc   { fill: none; stroke: var(--hg-orb-c-frame-energy); stroke-width: 2.5px; stroke-linecap: round; transition: stroke 0.4s; }

/* ─── Glass-Circle ─────────────────────────────────────────────── */
.hg-orb-glass {
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: var(--hg-orb-c-card-bg);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border: 1.5px solid var(--hg-orb-c-card-border);
    box-shadow: var(--hg-orb-c-card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Kompakter Abstand: zieht den oberen Stack (Avatar/Wellen) zusammen,
       damit der Text hoch in die MITTE des Kreises rueckt — dort ist der
       Kreis am breitesten, "TIPPEN & SPRECHEN" hat so am meisten Platz. */
    gap: 6px;
    overflow: hidden;
    transition: background 0.7s ease, border-color 0.7s ease, box-shadow 0.7s ease;
}

/* Scan-Ring (rotierender Sektor im speak-State) */
.hg-orb-scan {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.hg-orb-container[data-state="speak"] .hg-orb-scan {
    opacity: 1;
    background: conic-gradient(from 0deg, transparent 0%, rgba(0,255,200,0.45) 12%, transparent 24%);
    animation: hg-orb-spin 2.5s linear infinite;
}
@keyframes hg-orb-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ─── Avatar (Leaf) ────────────────────────────────────────────── */
.hg-orb-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    z-index: 1;
}
.hg-orb-avatar-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--hg-orb-c-avatar-ring);
    animation: var(--hg-orb-ring-anim);
    transition: border-color 0.7s;
}
.hg-orb-avatar-inner {
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--hg-orb-c-card-inner-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--hg-orb-c-avatar-inner);
    box-shadow: var(--hg-orb-c-avatar-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.7s, box-shadow 0.7s, background 0.7s;
}
.hg-orb-leaf {
    width: 18px;
    height: 18px;
    animation: var(--hg-orb-leaf-anim);
    transition: all 0.5s;
}
.hg-orb-leaf .leaf-path  { fill: var(--hg-orb-c-leaf-fill);   stroke: var(--hg-orb-c-leaf-stroke); stroke-width: 1; }
.hg-orb-leaf .leaf-veins { stroke: var(--hg-orb-c-leaf-vein); stroke-width: 0.7; opacity: 0.8; fill: none; }
.hg-orb-leaf .leaf-dot   { fill: var(--hg-orb-c-leaf-dot); }

/* ─── Waveform ─────────────────────────────────────────────────── */
.hg-orb-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 14px;
    z-index: 1;
}
.hg-orb-wave-bar {
    width: 2px;
    height: 3px;
    border-radius: 2px;
    opacity: 0.15;
    background: var(--hg-orb-c-leaf-stroke);
    transition: opacity 0.4s, background 0.7s;
}
.hg-orb-container[data-state="speak"] .hg-orb-wave-bar {
    opacity: 1;
    background: linear-gradient(180deg, #00ffc8, #00b894);
}

/* ─── Text ─────────────────────────────────────────────────────── */
.hg-orb-text {
    text-align: center;
    z-index: 1;
    /* Inline-Fonts mit Fallbacks — kein @import, kein externer Request */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
/* Schriftgroessen RELATIV zur Orb-Groesse (calc auf --hg-orb-size), damit
   Name + Status bei jeder Orb-Groesse in den Kreis passen. Vorher fix in px:
   nach dem Verkleinern (220->180) lief "TIPPEN & SPRECHEN" ueber den Rand.
   Faktoren so gewaehlt, dass es bei 220px den alten Werten (14/9px) entspricht. */
.hg-orb-name {
    font-size: calc(var(--hg-orb-size) * 0.064);   /* 220->14px, 180->11.5px */
    font-weight: 400;
    color: var(--hg-orb-c-name);
    letter-spacing: 0.12em;
    text-shadow: var(--hg-orb-c-text-shadow);
    margin-bottom: 2px;
}
.hg-orb-status {
    font-size: calc(var(--hg-orb-size) * 0.041);   /* 220->9px, 180->7.4px */
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--hg-orb-c-status);
    text-shadow: var(--hg-orb-c-text-shadow);
    transition: color 0.5s;
    white-space: nowrap;
}

/* ─── AI-Act-Kennzeichnung (Art. 50, Pflicht seit 02.08.2026) ────
   Dauerhaft sichtbar, auch VOR dem ersten Klick — bewusst nicht nur im
   gesprochenen Intro, damit die Offenlegung nicht am Ton haengt. */
.hg-orb-ai-tag {
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(28,31,26,0.75);
    color: #FAF8F3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}

/* ─── Keyframes (Avatar-Animationen pro State) ─────────────────── */
@keyframes hg-orb-leaf-idle  { 0%,100%{transform:rotate(-3deg)} 50%{transform:rotate(3deg)} }
@keyframes hg-orb-leaf-speak { 0%,100%{transform:scale(1) rotate(-6deg)} 50%{transform:scale(1.1) rotate(6deg)} }
@keyframes hg-orb-ring-breathe-mint { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.15);opacity:0.5} }
@keyframes hg-orb-ring-pulse-amber  { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.22);opacity:0.4} }

/* Dezente Idle-Atmung als Klick-Affordance (Light-Mode) */
@keyframes hg-orb-idle-breathe { 0%,100%{transform:scale(1);opacity:0.85} 50%{transform:scale(1.05);opacity:1} }

/* ─── Mobile-Anpassung (Orb oben drüber statt rechts daneben) ──── */
@media (max-width: 780px) {
    .hg-orb-mount {
        --hg-orb-size: 140px;
    }
    .hg-orb-container {
        left: auto;
        right: 0;
        top: auto;
        bottom: calc(100% + 8px);
        transform: none;
    }
    .hg-orb-container:active {
        transform: scale(0.97);
    }
}

/* ─── Inline-Modus (Orb im Textfluss, z.B. Gutenberg-Block) ────── */
.hg-orb-container.hg-orb--inline {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    display: block;
    margin: 8px auto 0;
}
.hg-orb-container.hg-orb--inline:active {
    transform: scale(0.97);
}

/* ─── "lieber schreiben?"-Pill unterm Orb ──────────────────────── */
.hg-orb-chat-toggle {
    position: absolute;
    left: 50%;
    top: calc(100% + 4px);
    transform: translateX(-50%);
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    color: rgba(74,103,65,0.75);
    background: rgba(250,248,243,0.85);
    border: 1px solid rgba(74,103,65,0.25);
    border-radius: 999px;
    padding: 3px 10px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.3s, border-color 0.3s;
}
.hg-orb-chat-toggle:hover {
    opacity: 1;
    border-color: rgba(74,103,65,0.55);
}

/* ─── Auswahl-Knöpfe (🎤 Antworten / ✍️ Schreiben) unter dem Orb ── */
.hg-orb-choice {
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    white-space: nowrap;
    z-index: calc(var(--hg-orb-z) + 1);
}
.hg-orb-choice--hidden { display: none; }

.hg-orb-choice-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    padding: 9px 16px;
    cursor: pointer;
    border: 1.5px solid transparent;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.hg-orb-choice-btn:active { transform: scale(0.96); }

.hg-orb-choice-voice {
    background: #4A6741;
    color: #FAF8F3;
    border-color: #4A6741;
    box-shadow: 0 6px 16px rgba(74,103,65,0.30);
}
.hg-orb-choice-voice:hover { background: #3a5233; }

.hg-orb-choice-write {
    background: rgba(250,248,243,0.94);
    color: #4A6741;
    border-color: rgba(74,103,65,0.40);
}
.hg-orb-choice-write:hover { border-color: #4A6741; }

/* Mobile: größere Touch-Ziele */
@media (max-width: 780px) {
    .hg-orb-choice-btn {
        font-size: 14px;
        padding: 11px 18px;
    }
}

/* ─── Mini-Text-Chat (Rückfallebene, bewusst klein) ────────────── */
.hg-orb-chat {
    position: absolute;
    z-index: calc(var(--hg-orb-z) + 1);
    left: calc(100% + 16px);
    top: calc(50% + calc(var(--hg-orb-size) / 2) + 12px);
    width: 300px;
    max-width: 88vw;
    height: 340px;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: rgba(250,248,243,0.95);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border: 1.5px solid rgba(74,103,65,0.35);
    box-shadow: 0 12px 32px rgba(74,103,65,0.22);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
}
.hg-orb-chat--hidden { display: none; }

.hg-orb-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(74,103,65,0.18);
}
.hg-orb-chat-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #1C1F1A;
    text-transform: uppercase;
}
.hg-orb-chat-close {
    border: none;
    background: none;
    font-size: 18px;
    line-height: 1;
    color: rgba(74,103,65,0.7);
    cursor: pointer;
    padding: 0 4px;
}

.hg-orb-chat-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.hg-orb-chat-msg {
    max-width: 85%;
    padding: 8px 11px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.hg-orb-chat-msg--agent {
    align-self: flex-start;
    background: rgba(74,103,65,0.10);
    color: #1C1F1A;
    border-bottom-left-radius: 4px;
}
.hg-orb-chat-msg--user {
    align-self: flex-end;
    background: #4A6741;
    color: #FAF8F3;
    border-bottom-right-radius: 4px;
}
.hg-orb-chat-typing { opacity: 0.6; }
.hg-orb-chat-notice {
    font-size: 11px;
    color: rgba(74,103,65,0.8);
    text-align: center;
    padding: 4px 8px;
}

.hg-orb-chat-inputrow {
    display: flex;
    gap: 6px;
    padding: 8px;
    border-top: 1px solid rgba(74,103,65,0.18);
}
.hg-orb-chat-input {
    flex: 1;
    border: 1px solid rgba(74,103,65,0.30);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    background: #fff;
    color: #1C1F1A;
    outline: none;
}
.hg-orb-chat-input:focus { border-color: #4A6741; }
.hg-orb-chat-footer {
    text-align: center;
    padding: 4px 8px 7px;
    font-size: 10px;
}
.hg-orb-chat-footer a {
    color: rgba(28,31,26,0.45);
    text-decoration: none;
}
.hg-orb-chat-footer a:hover { color: #4A6741; text-decoration: underline; }
.hg-orb-chat-send {
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    background: #4A6741;
    color: #FAF8F3;
    font-size: 13px;
    cursor: pointer;
    flex: 0 0 auto;
}
.hg-orb-chat-send:hover { background: #3a5233; }

/* Inline-Modus: Panel unterm Orb zentriert */
.hg-orb-container.hg-orb--inline ~ .hg-orb-chat,
.hg-orb-mount .hg-orb-container.hg-orb--inline + .hg-orb-chat {
    left: 50%;
    transform: translateX(-50%);
    top: auto;
}

/* Mobile: Panel als Bottom-Sheet über volle Breite */
@media (max-width: 780px) {
    .hg-orb-chat {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: auto;
        width: auto;
        height: 50vh;
        max-height: 420px;
        transform: none;
    }
}

/* ─── Mikrofon-Hilfe-Panel (gerätespezifische Freigabe-Anleitung) ─ */
.hg-orb-help {
    position: absolute;
    z-index: calc(var(--hg-orb-z) + 2);
    left: calc(100% + 16px);
    top: calc(50% + calc(var(--hg-orb-size) / 2) + 12px);
    width: 300px;
    max-width: 88vw;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: rgba(250,248,243,0.97);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border: 1.5px solid rgba(224,159,62,0.55);
    box-shadow: 0 12px 32px rgba(224,159,62,0.28);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
}
.hg-orb-help--hidden { display: none; }

.hg-orb-help-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(224,159,62,0.25);
}
.hg-orb-help-head-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #b87514;
    text-transform: uppercase;
}
.hg-orb-help-close {
    border: none;
    background: none;
    font-size: 18px;
    line-height: 1;
    color: rgba(184,117,20,0.8);
    cursor: pointer;
    padding: 0 4px;
}

.hg-orb-help-body { padding: 12px; }
.hg-orb-help-title {
    font-size: 13px;
    font-weight: 600;
    color: #1C1F1A;
    margin-bottom: 8px;
}
.hg-orb-help-steps {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hg-orb-help-steps li {
    font-size: 12.5px;
    line-height: 1.45;
    color: #2c322a;
}

.hg-orb-help-actions {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(224,159,62,0.20);
}
.hg-orb-help-retry,
.hg-orb-help-write {
    flex: 1;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 12.5px;
    cursor: pointer;
    border: 1px solid transparent;
}
.hg-orb-help-retry {
    background: #e09f3e;
    color: #fff;
    border-color: #e09f3e;
}
.hg-orb-help-retry:hover { background: #c98a2e; }
.hg-orb-help-write {
    background: transparent;
    color: #4A6741;
    border-color: rgba(74,103,65,0.4);
}
.hg-orb-help-write:hover { border-color: #4A6741; }

/* Inline-Modus: Hilfe-Panel unterm Orb zentriert */
.hg-orb-container.hg-orb--inline ~ .hg-orb-help {
    left: 50%;
    transform: translateX(-50%);
    top: auto;
}

/* Mobile: Hilfe-Panel als Bottom-Sheet (wie der Chat) */
@media (max-width: 780px) {
    .hg-orb-help {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: auto;
        width: auto;
        max-width: none;
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   AURA-MODUS — Licht-/Scan-Saum um ein echtes Produktfoto
   (data-orb-mode="aura"). Das Foto "erwacht": bei idle atmet die Aura,
   bei listen/think/speak leuchtet sie in derselben Palette wie der
   Kreis-Orb. Eigenständiges Farbsystem über --hg-aura-*, State kommt
   über [data-state] am .hg-aura-container (setState() setzt es).
   ═══════════════════════════════════════════════════════════════════ */

.hg-aura-mount {
    line-height: 0;   /* kein Baseline-Spalt unter dem <img> */
}
.hg-aura-mount > img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--hg-aura-radius, 16px);
    /* Morph: dezenter Fokus-Zoom, sobald das Gespräch startet */
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.7s ease;
    will-change: transform;
}
.hg-aura-mount.hg-aura-live > img {
    transform: scale(1.015);
}

.hg-aura-container {
    /* Idle-Farbsystem (Sage) — Defaults, per State überschrieben.
       --hg-aura-radius wird NICHT hier deklariert (sonst gewinnt der Default
       über den am Wrapper gesetzten Bild-Radius) — Fallback steckt im var(). */
    --hg-aura-ring:   rgba(74,103,65,0.55);
    --hg-aura-bloom:  rgba(74,103,65,0.28);
    --hg-aura-accent: #4A6741;

    position: absolute;
    inset: 0;
    border-radius: var(--hg-aura-radius, 16px);
    z-index: 9998;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    animation: hg-aura-in 0.6s ease both;
}
@keyframes hg-aura-in { from { opacity: 0; } to { opacity: 1; } }

.hg-aura-container:active { transform: scale(0.995); }

/* ─── State-Farben (self-contained, gleiche Palette wie der Orb) ─── */
.hg-aura-container[data-state="listen"] {
    --hg-aura-ring:   rgba(224,159,62,0.90);
    --hg-aura-bloom:  rgba(224,159,62,0.45);
    --hg-aura-accent: #e09f3e;
}
.hg-aura-container[data-state="speak"] {
    --hg-aura-ring:   rgba(0,184,148,0.90);
    --hg-aura-bloom:  rgba(0,184,148,0.45);
    --hg-aura-accent: #00b894;
}
.hg-aura-container[data-state="think"] {
    --hg-aura-ring:   rgba(74,103,65,0.85);
    --hg-aura-bloom:  rgba(74,103,65,0.40);
    --hg-aura-accent: #4A6741;
}

/* ─── Leucht-Rahmen (der eigentliche Aura-Saum) ─────────────────── */
.hg-aura-frame {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid var(--hg-aura-ring);
    box-shadow:
        0 0 0 1px var(--hg-aura-ring),
        0 0 26px 2px var(--hg-aura-bloom),
        inset 0 0 22px -4px var(--hg-aura-bloom);
    pointer-events: none;
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
    animation: hg-aura-breathe 3.6s ease-in-out infinite;   /* idle */
}
.hg-aura-container[data-state="listen"] .hg-aura-frame { animation: hg-aura-pulse 1.1s ease-in-out infinite; }
.hg-aura-container[data-state="speak"]  .hg-aura-frame { animation: hg-aura-glow  1.5s ease-in-out infinite; }
.hg-aura-container[data-state="think"]  .hg-aura-frame { animation: hg-aura-breathe 1.2s ease-in-out infinite; }

@keyframes hg-aura-breathe {
    0%,100% { box-shadow: 0 0 0 1px var(--hg-aura-ring), 0 0 18px 1px var(--hg-aura-bloom), inset 0 0 18px -6px var(--hg-aura-bloom); }
    50%     { box-shadow: 0 0 0 1px var(--hg-aura-ring), 0 0 30px 4px var(--hg-aura-bloom), inset 0 0 24px -4px var(--hg-aura-bloom); }
}
@keyframes hg-aura-pulse {
    0%,100% { box-shadow: 0 0 0 1px var(--hg-aura-ring), 0 0 22px 2px var(--hg-aura-bloom); }
    50%     { box-shadow: 0 0 0 2px var(--hg-aura-ring), 0 0 40px 8px var(--hg-aura-bloom); }
}
@keyframes hg-aura-glow {
    0%,100% { box-shadow: 0 0 0 1px var(--hg-aura-ring), 0 0 28px 4px var(--hg-aura-bloom); }
    50%     { box-shadow: 0 0 0 2px var(--hg-aura-ring), 0 0 46px 10px var(--hg-aura-bloom); }
}

/* ─── Scan-Band (Lichtwisch, nur listen/speak) ──────────────────── */
.hg-aura-scan {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.hg-aura-scan::before {
    content: "";
    position: absolute;
    top: -20%;
    left: -60%;
    width: 45%;
    height: 140%;
    background: linear-gradient(100deg, transparent, var(--hg-aura-bloom), transparent);
    filter: blur(6px);
    transform: translateX(0);
}
.hg-aura-container[data-state="speak"]  .hg-aura-scan,
.hg-aura-container[data-state="listen"] .hg-aura-scan { opacity: 1; }
.hg-aura-container[data-state="speak"]  .hg-aura-scan::before { animation: hg-aura-sweep 2.6s linear infinite; }
.hg-aura-container[data-state="listen"] .hg-aura-scan::before { animation: hg-aura-sweep 3.4s linear infinite; }
@keyframes hg-aura-sweep {
    0%   { transform: translateX(0); }
    100% { transform: translateX(400%); }
}

/* ─── Idle-Badge ("Sprich mit mir") — Affordance ────────────────── */
.hg-aura-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px 7px 11px;
    border-radius: 999px;
    background: rgba(250,248,243,0.92);
    border: 1px solid rgba(74,103,65,0.30);
    box-shadow: 0 6px 18px rgba(74,103,65,0.20);
    backdrop-filter: blur(8px) saturate(1.2);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #2c322a;
    line-height: 1;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.45s ease, transform 0.45s ease;
    animation: hg-aura-badge-float 3.2s ease-in-out infinite;
}
.hg-aura-badge-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--hg-aura-accent);
    animation: hg-aura-dot 1.8s ease-out infinite;
}
@keyframes hg-aura-dot {
    0%   { box-shadow: 0 0 0 0 var(--hg-aura-bloom); }
    70%  { box-shadow: 0 0 0 8px rgba(74,103,65,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,103,65,0); }
}
@keyframes hg-aura-badge-float {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-3px); }
}
/* Gesprächsstart: Badge weicht */
.hg-aura-live .hg-aura-badge {
    opacity: 0;
    transform: translateY(6px);
    animation: none;
}

/* ─── Status-Chip ("ich höre zu …", "spricht …") ────────────────── */
.hg-aura-status {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%) translateY(-4px);
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(28,31,26,0.78);
    color: #FAF8F3;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    line-height: normal;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.hg-aura-live .hg-aura-status {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── AI-Act-Kennzeichnung (Art. 50, Pflicht seit 02.08.2026) ────
   Eigene Ecke statt der Idle-Badge-Position — bleibt (anders als das
   "Sprich mit mir"-Badge) auch waehrend des Gespraechs sichtbar. */
.hg-aura-ai-tag {
    position: absolute;
    right: 12px;
    top: 12px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(28,31,26,0.6);
    color: #FAF8F3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    line-height: normal;
    z-index: 2;
}

/* Chat-/Hilfe-Panel unter dem (oft breiten) Foto zentrieren statt
   rechts daneben. Nur Desktop — Mobile bleibt Bottom-Sheet (s. Orb-MQ). */
@media (min-width: 781px) {
    .hg-aura-mount > .hg-orb-chat,
    .hg-aura-mount > .hg-orb-help {
        left: 50%;
        transform: translateX(-50%);
        top: calc(100% + 12px);
    }
}

/* ─── Reduced-Motion-Respect ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .hg-orb-container,
    .hg-orb-leaf,
    .hg-orb-avatar-ring,
    .hg-orb-scan,
    .hg-aura-container,
    .hg-aura-frame,
    .hg-aura-scan::before,
    .hg-aura-badge,
    .hg-aura-badge-dot,
    .hg-aura-mount > img {
        animation: none !important;
    }
}
