/**
 * Mr. White Chatbot — Frontend Widget Styles
 *
 * Design-Sprache: Kleo-Inspired (pill-shape Bubble, online-dot, mobile bottom-bar,
 * runde Avatare, rounded panel, rounded message-bubbles) — mit Mr. White Brand-Farben.
 */

#mwcb-widget {
    --mwcb-teal:    #1B3740;
    --mwcb-teal-2:  #0f2329;
    --mwcb-cyan:    #5DBCC8;
    --mwcb-bg:      #FFFFFF;
    --mwcb-bg-alt:  #FAFAFA;
    --mwcb-line:    #EEEEEE;
    --mwcb-line-2:  #DDDDDD;
    --mwcb-text:    #1A2530;
    --mwcb-text-2:  #4a5560;
    --mwcb-text-3:  #999999;
    --mwcb-online:  #4ADE80;
    --mwcb-shadow:  0 8px 30px rgba(27, 55, 64, 0.35);
    --mwcb-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --mwcb-offset: 20px;
    --mwcb-safe-b: env(safe-area-inset-bottom, 0px);
    --mwcb-safe-t: env(safe-area-inset-top, 0px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--mwcb-text);
    line-height: 1.5;
}

#mwcb-widget,
#mwcb-widget * {
    box-sizing: border-box;
}

/* Defensive: hidden-Attribut soll IMMER wirken, auch wenn Theme display
   auf flex/block/etc. forciert. Ohne das knallen Consent-Layer und
   Welcome-Message gleichzeitig im DOM. */
body #mwcb-widget [hidden] {
    display: none !important;
}

/* Defensive Header: Theme-CSS forciert oft graue Farben auf <p>-Tags
   (z.B. body p { color: #6b7280 }) — das macht "Mika" unlesbar. */
body #mwcb-widget .mwcb-panel__title {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    text-shadow: none !important;
    font-family: inherit !important;
}

body #mwcb-widget .mwcb-panel__sub {
    color: var(--mwcb-cyan) !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    opacity: 0.95 !important;
    text-shadow: none !important;
    font-family: inherit !important;
    font-weight: 400 !important;
}

body #mwcb-widget .mwcb-avatar {
    color: var(--mwcb-teal) !important;
    background: var(--mwcb-cyan) !important;
}

body #mwcb-widget .mwcb-avatar span {
    color: var(--mwcb-teal) !important;
    font-weight: 800 !important;
    font-family: inherit !important;
    line-height: 1 !important;
}

/* WP-Emoji Bilder auf Textgröße zwingen */
#mwcb-widget img.wpemoji,
#mwcb-widget img.emoji,
#mwcb-widget .mwcb-msg-bubble img {
    width: 1em !important;
    height: 1em !important;
    display: inline-block !important;
    vertical-align: -0.15em !important;
    margin: 0 0.05em !important;
    border: 0 !important;
    box-shadow: none !important;
    background: none !important;
    padding: 0 !important;
}

/* ─── DESKTOP BUBBLE (Pill) ───────────────────────────────── */

.mwcb-bubble {
    position: fixed;
    right: 24px;
    bottom: calc(var(--mwcb-offset) + var(--mwcb-safe-b));
    z-index: 2147483640;
    background: var(--mwcb-teal);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 14px 22px 14px 20px;
    font: 600 15px/1 inherit;
    box-shadow: var(--mwcb-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s, bottom 0.25s, background 0.2s;
    font-family: inherit;
}

.mwcb-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(27, 55, 64, 0.45);
    background: var(--mwcb-teal-2);
}

.mwcb-bubble__dot {
    width: 8px;
    height: 8px;
    background: var(--mwcb-online);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3);
    flex-shrink: 0;
    animation: mwcb-pulse 2.4s infinite;
}

@keyframes mwcb-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.7; transform: scale(0.85); }
}

.mwcb-bubble__label {
    line-height: 1;
    letter-spacing: 0.01em;
}

#mwcb-widget[data-state="open"] .mwcb-bubble,
#mwcb-widget[data-state="open"] .mwcb-mobar {
    display: none !important;
}

/* ─── MOBILE BOTTOM-BAR ─────────────────────────────────────
   Hochpriorisiertes CSS damit Theme-Resets nicht reingrätschen.
   Spezifität: body #mwcb-widget .mwcb-mobar  +  selektive !important.
*/

body #mwcb-widget .mwcb-mobar {
    display: none; /* nur < 640px sichtbar (Override siehe Mediaquery unten) */
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483640 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    /* Padding-Bottom enthält iOS-Home-Bar safe-area, damit der Content der Bar
       sauber über der Home-Bar bleibt — die Bar selber klebt am Bildschirmrand. */
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 18px !important;
    background: linear-gradient(135deg, var(--mwcb-teal) 0%, var(--mwcb-teal-2) 100%) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.45) !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer !important;
    text-align: left !important;
    text-transform: none !important;
    text-decoration: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: bottom 0.25s !important;
    outline: none !important;
}

body #mwcb-widget .mwcb-mobar__avatar {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    padding: 0 !important;
    margin: 0 !important;
}

body #mwcb-widget .mwcb-mobar__avatar span {
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body #mwcb-widget .mwcb-mobar__txt {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    text-align: left !important;
    color: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

body #mwcb-widget .mwcb-mobar__t1 {
    font-family: inherit !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    letter-spacing: 0.01em !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #fff !important;
    text-transform: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-shadow: none !important;
}

body #mwcb-widget .mwcb-mobar__t2 {
    font-family: inherit !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    color: rgba(255, 255, 255, 0.78) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

body #mwcb-widget .mwcb-mobar__chev {
    font-family: inherit !important;
    font-size: 22px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    color: #fff !important;
    opacity: 0.9 !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 0 0 4px !important;
}

body #mwcb-widget .mwcb-mobar__pulse {
    position: absolute !important;
    left: 47px !important;     /* On-Avatar oben rechts: padding-left 18 + avatar-width 36 - dot-half 7 = 47 */
    top: 8px !important;
    width: 10px !important;
    height: 10px !important;
    background: var(--mwcb-online) !important;
    border: 2px solid var(--mwcb-teal) !important;
    border-radius: 50% !important;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25) !important;
    animation: mwcb-pulse 2s infinite !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

/* ─── PANEL ───────────────────────────────────────────────── */

.mwcb-panel {
    position: fixed;
    right: 24px;
    bottom: calc(var(--mwcb-offset) + var(--mwcb-safe-b));
    z-index: 2147483641;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: min(640px, calc(100vh - 80px));
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--mwcb-shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#mwcb-widget[data-state="open"] .mwcb-panel {
    display: flex;
    animation: mwcb-panel-in 0.25s ease;
}

@keyframes mwcb-panel-in {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}

/* Header */
.mwcb-panel__header {
    background: var(--mwcb-teal);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.mwcb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--mwcb-cyan);
    color: var(--mwcb-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1;
}

.mwcb-panel__title-block {
    flex: 1;
    min-width: 0;
}

.mwcb-panel__title {
    font-weight: 700;
    font-size: 14px;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mwcb-panel__sub {
    font-size: 11px;
    color: var(--mwcb-cyan);
    margin: 2px 0 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.95;
}

.mwcb-panel__actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mwcb-icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 0;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}

.mwcb-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.mwcb-icon-btn--close {
    font-size: 22px;
    font-weight: 300;
}

/* Consent-Layer */
.mwcb-consent {
    flex: 1;
    background: var(--mwcb-bg-alt);
    padding: 30px 24px;
    overflow-y: auto;
    display: flex;
    align-items: center;
}

.mwcb-consent__inner {
    max-width: 320px;
    margin: 0 auto;
}

.mwcb-eyebrow-mini {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mwcb-text-3);
    margin-bottom: 6px;
}

.mwcb-consent h3 {
    margin: 4px 0 12px 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--mwcb-text);
}

.mwcb-consent__text {
    color: var(--mwcb-text-2);
    font-size: 13px;
    margin: 0 0 20px 0;
    line-height: 1.55;
}

.mwcb-consent__text a {
    color: var(--mwcb-teal);
    text-decoration: underline;
}

.mwcb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mwcb-teal);
    color: #fff;
    border: 0;
    padding: 12px 22px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    line-height: 1;
}

.mwcb-btn:hover {
    background: var(--mwcb-teal-2);
    transform: translateY(-1px);
}

/* ─── Messages ────────────────────────────────────────────── */

.mwcb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    background: var(--mwcb-bg-alt);
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.mwcb-msg-row {
    display: flex;
    width: 100%;
}
.mwcb-msg-row--user { justify-content: flex-end; }
.mwcb-msg-row--bot  { justify-content: flex-start; }

.mwcb-msg-bubble {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: mwcb-msg-in 0.2s ease;
}

@keyframes mwcb-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.mwcb-msg-row--bot .mwcb-msg-bubble {
    background: #fff;
    color: var(--mwcb-text);
    border: 1px solid var(--mwcb-line);
    border-bottom-left-radius: 6px;
}

.mwcb-msg-row--user .mwcb-msg-bubble {
    background: var(--mwcb-teal);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.mwcb-msg-bubble a {
    color: inherit;
    text-decoration: underline;
}
.mwcb-msg-bubble strong { font-weight: 700; }

/* Quellen unter Bot-Antworten */
.mwcb-msg-sources {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dotted var(--mwcb-line);
    font-size: 11px;
    color: var(--mwcb-text-3);
}
.mwcb-msg-sources strong {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 10px;
    margin-bottom: 6px;
    color: var(--mwcb-text-2);
}
.mwcb-msg-sources a {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 4px;
    color: var(--mwcb-teal);
    text-decoration: none;
    border-bottom: 1px solid var(--mwcb-cyan);
    padding-bottom: 1px;
}

/* Typing-Indicator */
.mwcb-typing {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--mwcb-line);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    padding: 12px 16px;
    display: flex;
    gap: 4px;
    animation: mwcb-msg-in 0.2s ease;
}

.mwcb-typing__dot {
    width: 6px;
    height: 6px;
    background: var(--mwcb-cyan);
    border-radius: 50%;
    animation: mwcb-dot 1.2s infinite;
}
.mwcb-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.mwcb-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes mwcb-dot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30%           { opacity: 1; transform: scale(1); }
}

.mwcb-msg-error {
    background: #fff;
    border: 1px solid #c63838;
    color: #c63838;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    align-self: flex-start;
    max-width: 88%;
}

/* Inquiry-Confirmation-Card (wird gezeigt wenn Mika Briefing aufgenommen hat) */
.mwcb-inquiry-card {
    align-self: stretch;
    background: var(--mwcb-teal);
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
    animation: mwcb-msg-in 0.25s ease;
    box-shadow: 0 4px 16px rgba(27, 55, 64, 0.2);
}

.mwcb-inquiry-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--mwcb-cyan);
    color: var(--mwcb-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mwcb-inquiry-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mwcb-inquiry-card__body strong {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.mwcb-inquiry-card__body span {
    font-size: 12px;
    line-height: 1.4;
    color: var(--mwcb-cyan);
    opacity: 0.95;
}

/* ─── Input-Footer ────────────────────────────────────────── */

.mwcb-input-row {
    border-top: 1px solid var(--mwcb-line);
    padding: 10px 10px 10px 14px;
    background: #fff;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.mwcb-input {
    flex: 1;
    border: 1px solid var(--mwcb-line-2);
    border-radius: 22px;
    padding: 11px 16px;
    font-size: 15px;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    line-height: 1.35;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
    background: #fff;
    color: var(--mwcb-text);
}

.mwcb-input:focus {
    border-color: var(--mwcb-teal);
}

.mwcb-input::placeholder {
    color: var(--mwcb-text-3);
}

.mwcb-mic-btn {
    background: transparent;
    color: var(--mwcb-text-2);
    border: 1px solid var(--mwcb-line-2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    padding: 0;
}
.mwcb-mic-btn:hover {
    background: var(--mwcb-bg-alt);
    color: var(--mwcb-teal);
    border-color: var(--mwcb-teal);
}
.mwcb-mic-btn[hidden] { display: none !important; }
.mwcb-mic-btn.recording {
    background: var(--mwcb-teal);
    color: #fff;
    border-color: var(--mwcb-teal);
    animation: mwcb-mic-pulse 1.4s ease-in-out infinite;
}

@keyframes mwcb-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(27, 55, 64, 0.5); }
    50%      { box-shadow: 0 0 0 8px rgba(27, 55, 64, 0); }
}

.mwcb-send-btn {
    background: var(--mwcb-teal);
    color: #fff;
    border: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
    padding: 0;
}
.mwcb-send-btn:hover:not(:disabled) {
    background: var(--mwcb-cyan);
    color: var(--mwcb-teal);
}
.mwcb-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.mwcb-disclaimer {
    text-align: center;
    padding: 8px 12px 10px;
    background: #fff;
    flex-shrink: 0;
    line-height: 1.4;
}
.mwcb-disclaimer__brand {
    display: block;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--mwcb-teal);
    font-weight: 600;
    margin-bottom: 3px;
}
.mwcb-disclaimer__meta {
    display: block;
    font-size: 10px;
    color: var(--mwcb-text-3);
    letter-spacing: 0.02em;
}
.mwcb-disclaimer a {
    color: var(--mwcb-text-3);
    text-decoration: underline;
}
.mwcb-disclaimer a:hover {
    color: var(--mwcb-teal);
}

/* History-Divider zeigt an wo die wiederhergestellte Vorgeschichte endet */
.mwcb-history-divider {
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--mwcb-text-3);
    padding: 14px 8px 6px;
    margin: 8px 0 4px;
    border-top: 1px dashed rgba(27, 55, 64, 0.12);
    opacity: 0.7;
}

/* ─── VOICE-MODE OVERLAY ───────────────────────────────────── */

.mwcb-icon-btn--voice {
    color: rgba(255, 255, 255, 0.85);
}
.mwcb-icon-btn--voice:hover {
    color: var(--mwcb-cyan);
    background: rgba(93, 188, 200, 0.15);
}
.mwcb-icon-btn--voice.active {
    background: var(--mwcb-cyan);
    color: var(--mwcb-teal);
}

.mwcb-voice-overlay {
    position: absolute;
    inset: 60px 0 0 0;     /* unter dem Header */
    z-index: 10;
    background: linear-gradient(180deg, var(--mwcb-teal) 0%, #0F1F24 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
}
.mwcb-voice-overlay[hidden] { display: none; }

.mwcb-voice-overlay__inner {
    text-align: center;
    max-width: 320px;
    width: 100%;
}

.mwcb-voice-status {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--mwcb-cyan);
    margin: 0 0 32px 0;
    font-weight: 600;
    min-height: 14px;
}

/* Voice-Orb: drei pulsierende Ringe um einen Cyan-Kern */
.mwcb-voice-orb {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mwcb-voice-orb__core {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--mwcb-cyan), #2a8a98);
    box-shadow:
        0 0 30px rgba(93, 188, 200, 0.6),
        0 0 60px rgba(93, 188, 200, 0.3);
    z-index: 4;
    transition: transform 0.2s ease;
}
.mwcb-voice-orb__ring {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(93, 188, 200, 0.4);
    width: 100px;
    height: 100px;
    z-index: 3;
    animation: mwcb-voice-pulse 2.5s ease-out infinite;
}
.mwcb-voice-orb__ring--2 {
    width: 130px;
    height: 130px;
    z-index: 2;
    animation-delay: 0.4s;
    border-color: rgba(93, 188, 200, 0.25);
}
.mwcb-voice-orb__ring--3 {
    width: 160px;
    height: 160px;
    z-index: 1;
    animation-delay: 0.8s;
    border-color: rgba(93, 188, 200, 0.15);
}

@keyframes mwcb-voice-pulse {
    0%   { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* States: listening (User spricht — Orb ruhig) vs speaking (Mika spricht — Orb wackelt mit) */
.mwcb-voice-overlay.is-listening .mwcb-voice-orb__core {
    transform: scale(1);
    background: radial-gradient(circle at 30% 30%, var(--mwcb-cyan), #2a8a98);
}
.mwcb-voice-overlay.is-speaking .mwcb-voice-orb__core {
    animation: mwcb-voice-speak 0.5s ease-in-out infinite alternate;
    background: radial-gradient(circle at 30% 30%, #fff, var(--mwcb-cyan));
}
@keyframes mwcb-voice-speak {
    0%   { transform: scale(1);    box-shadow: 0 0 30px rgba(93, 188, 200, 0.6), 0 0 60px rgba(93, 188, 200, 0.3); }
    100% { transform: scale(1.12); box-shadow: 0 0 50px rgba(255, 255, 255, 0.8), 0 0 90px rgba(93, 188, 200, 0.5); }
}

/* Während Verbindungsaufbau: nur dezent pulsen, keine Sprach-Animation */
.mwcb-voice-overlay.is-connecting .mwcb-voice-orb__core {
    opacity: 0.5;
    transform: scale(0.85);
}

.mwcb-voice-meta {
    margin-bottom: 14px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.85);
}
.mwcb-voice-timer { color: #fff; font-weight: 700; }
.mwcb-voice-budget { color: rgba(255, 255, 255, 0.5); margin-left: 4px; }

.mwcb-voice-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin: 0 0 32px 0;
    min-height: 38px;
}

.mwcb-voice-end {
    background: #DC2626;
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s ease, transform 0.1s ease;
    font-family: inherit;
}
.mwcb-voice-end:hover { background: #B91C1C; }
.mwcb-voice-end:active { transform: scale(0.97); }
.mwcb-voice-end svg { flex-shrink: 0; }

/* Modus-Toggle: Auto vs Push-to-Talk */
.mwcb-voice-mode {
    display: inline-flex;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 3px;
    margin-bottom: 16px;
    gap: 0;
}
.mwcb-voice-mode-btn {
    background: transparent;
    border: 0;
    padding: 7px 18px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    border-radius: 999px;
    transition: background 0.18s, color 0.18s;
    font-family: inherit;
    letter-spacing: 0.01em;
}
.mwcb-voice-mode-btn:hover { color: #fff; }
.mwcb-voice-mode-btn.is-active {
    background: var(--mwcb-cyan);
    color: var(--mwcb-teal);
}

/* Push-to-Talk-Button */
.mwcb-voice-ptt {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.06);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    padding: 14px 28px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 14px;
    transition: background 0.15s, border-color 0.15s, transform 0.08s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
.mwcb-voice-ptt[hidden] { display: none; }
.mwcb-voice-ptt:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }
.mwcb-voice-ptt.is-pressed,
.mwcb-voice-ptt:active {
    background: var(--mwcb-cyan);
    color: var(--mwcb-teal);
    border-color: var(--mwcb-cyan);
    transform: scale(0.96);
}

/* Audio-Tag versteckt, spielt aber automatisch */
#mwcb-voice-audio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Mobile: Overlay nimmt das ganze Panel ein */
@media (max-width: 640px) {
    body #mwcb-widget .mwcb-voice-overlay {
        inset: 60px 0 0 0;
        padding: 32px 24px;
    }
    body #mwcb-widget .mwcb-voice-orb { width: 200px; height: 200px; }
    body #mwcb-widget .mwcb-voice-orb__core { width: 80px; height: 80px; }
    body #mwcb-widget .mwcb-voice-orb__ring { width: 120px; height: 120px; }
    body #mwcb-widget .mwcb-voice-orb__ring--2 { width: 160px; height: 160px; }
    body #mwcb-widget .mwcb-voice-orb__ring--3 { width: 200px; height: 200px; }
}

.mwcb-reset-link {
    background: transparent;
    border: 0;
    color: var(--mwcb-text-3);
    font-size: 10px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-family: inherit;
}
.mwcb-reset-link:hover {
    color: var(--mwcb-teal);
}

/* ─── BREAKPOINTS ─────────────────────────────────────────── */

@media (min-width: 641px) {
    body #mwcb-widget .mwcb-bubble  { display: flex !important; }
    body #mwcb-widget .mwcb-mobar   { display: none !important; }
}

@media (max-width: 640px) {
    /* Body bekommt unten Platz, damit Footer-Inhalte nicht hinter der Mika-Bar
       verschwinden. ~78px = Bar-Höhe (60) + Safe-Area-Puffer (~18). */
    body { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important; }

    body #mwcb-widget .mwcb-bubble  { display: none !important; }
    body #mwcb-widget .mwcb-mobar   { display: flex !important; }

    body #mwcb-widget .mwcb-panel {
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        top: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        border-radius: 0 !important;
        padding-top: var(--mwcb-safe-t) !important;
        padding-bottom: 0 !important; /* Safe-Area wird über Input-Row gehandelt */
        background: #fff !important;
    }
    body #mwcb-widget .mwcb-panel__header { padding: 14px 14px !important; gap: 10px !important; }
    body #mwcb-widget .mwcb-messages      { padding: 14px 12px !important; }
    body #mwcb-widget .mwcb-input-row     {
        padding: 10px 10px max(10px, env(safe-area-inset-bottom, 10px)) 14px !important;
    }
    body #mwcb-widget .mwcb-input         { font-size: 16px !important; }
}

/* Print */
@media print {
    #mwcb-widget { display: none !important; }
}
