.afkg-ra-launcher {
    --afkg-ra-blue-950: #102a56;
    --afkg-ra-blue-800: #17458f;
    --afkg-ra-blue-650: #2563c5;
    --afkg-ra-blue-500: #3b82f6;
    --afkg-ra-blue-100: #dbeafe;
    --afkg-ra-blue-50: #eff6ff;
    --afkg-ra-ink: #15233c;
    --afkg-ra-muted: #60708a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0;
    padding: 16px 18px;
    border: 1px solid #c9dcfb;
    border-radius: 18px;
    background: linear-gradient(135deg, #f7fbff 0%, var(--afkg-ra-blue-50) 100%);
    box-shadow: 0 10px 30px rgba(25, 76, 155, 0.10);
    color: var(--afkg-ra-ink);
}

.afkg-ra-launcher-copy {
    min-width: 0;
}

.afkg-ra-launcher-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 3px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
}

.afkg-ra-launcher-text {
    margin: 0;
    color: var(--afkg-ra-muted);
    font-size: 14px;
    line-height: 1.45;
}

.afkg-ra-ai-note {
    margin: 5px 0 0;
    color: #73829a;
    font-size: 11px;
    line-height: 1.35;
}

.afkg-ra-test-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    background: #fff3cd;
    color: #725500;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.afkg-ra-open,
.afkg-ra-control {
    appearance: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.afkg-ra-open {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--afkg-ra-blue-800), var(--afkg-ra-blue-500));
    color: #fff;
    box-shadow: 0 7px 18px rgba(37, 99, 197, .25);
}

.afkg-voice-guide .afkg-ra-open.afkg-ra-inline {
    background: linear-gradient(135deg, #17458f, #3b82f6);
    color: #fff;
    box-shadow: 0 7px 18px rgba(37, 99, 197, .25);
}

.afkg-voice-guide .afkg-ra-open.afkg-ra-inline:hover,
.afkg-voice-guide .afkg-ra-open.afkg-ra-inline:focus-visible {
    background: linear-gradient(135deg, #102a56, #2563c5);
    color: #fff;
}

.afkg-ra-open:hover,
.afkg-ra-open:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 23px rgba(37, 99, 197, .32);
}

.afkg-ra-open:focus-visible,
.afkg-ra-control:focus-visible,
.afkg-ra-close:focus-visible {
    outline: 3px solid rgba(59, 130, 246, .35);
    outline-offset: 3px;
}

.afkg-ra-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 21, 44, .62);
    backdrop-filter: blur(5px);
}

.afkg-ra-overlay.is-open {
    display: flex;
}

.afkg-ra-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(680px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(4, 20, 50, .32);
    color: #15233c;
}

.afkg-ra-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #102a56, #2563c5);
    color: #fff;
}

.afkg-ra-heading {
    min-width: 0;
}

.afkg-ra-heading h2 {
    margin: 0;
    color: inherit;
    font-size: 21px;
    line-height: 1.25;
}

.afkg-ra-heading p {
    margin: 3px 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
}

.afkg-ra-close {
    display: grid;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}

.afkg-ra-stage {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: 20px;
    background: linear-gradient(180deg, #f9fcff 0, #eff6ff 100%);
}

.afkg-ra-voice-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 0 16px;
    text-align: center;
}

.afkg-ra-orb {
    position: relative;
    display: grid;
    width: 88px;
    height: 88px;
    margin-bottom: 12px;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #93c5fd 0, #3b82f6 43%, #17458f 100%);
    box-shadow: 0 14px 34px rgba(37, 99, 197, .32);
    color: #fff;
}

.afkg-ra-orb::before,
.afkg-ra-orb::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 2px solid rgba(59, 130, 246, .25);
    border-radius: inherit;
    opacity: 0;
}

.afkg-ra-dialog[data-state="listening"] .afkg-ra-orb::before,
.afkg-ra-dialog[data-state="speaking"] .afkg-ra-orb::before {
    animation: afkg-ra-pulse 1.4s infinite ease-out;
}

.afkg-ra-dialog[data-state="speaking"] .afkg-ra-orb::after {
    animation: afkg-ra-pulse 1.4s .45s infinite ease-out;
}

.afkg-ra-mic-icon {
    width: 34px;
    height: 34px;
    fill: currentColor;
}

@keyframes afkg-ra-pulse {
    0% { transform: scale(.88); opacity: .75; }
    100% { transform: scale(1.35); opacity: 0; }
}

.afkg-ra-status {
    margin: 0;
    font-weight: 800;
    color: #173f7d;
}

.afkg-ra-help {
    margin: 4px 0 0;
    color: #60708a;
    font-size: 13px;
}

.afkg-ra-messages {
    flex: 1 1 auto;
    min-height: 150px;
    max-height: 330px;
    overflow-y: auto;
    padding: 4px 2px 12px;
    scroll-behavior: smooth;
}

.afkg-ra-message {
    width: fit-content;
    max-width: 88%;
    margin: 9px 0;
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.48;
    white-space: pre-wrap;
}

.afkg-ra-message.user {
    margin-left: auto;
    border-bottom-right-radius: 5px;
    background: #2563c5;
    color: #fff;
}

.afkg-ra-message.assistant {
    margin-right: auto;
    border: 1px solid #c9dcfb;
    border-bottom-left-radius: 5px;
    background: #fff;
    color: #20304a;
}

.afkg-ra-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #dbe7f8;
}

.afkg-ra-control {
    min-height: 44px;
    padding: 10px 17px;
}

.afkg-ra-mute {
    background: #dbeafe;
    color: #17458f;
}

.afkg-ra-mute[aria-pressed="true"] {
    background: #d9dee8;
    color: #3f4a5f;
}

.afkg-ra-end {
    background: #b42336;
    color: #fff;
}

.afkg-ra-privacy {
    margin: 12px 0 0;
    color: #6b778c;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

.afkg-ra-disclaimer {
    margin: 5px auto 0;
    max-width: 560px;
    color: #7b8799;
    font-size: 10px;
    line-height: 1.35;
    text-align: center;
}

.afkg-ra-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.afkg-ra-modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .afkg-ra-launcher {
        align-items: stretch;
        flex-direction: column;
    }

    .afkg-ra-open {
        width: 100%;
    }

    .afkg-ra-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .afkg-ra-dialog {
        width: 100%;
        max-height: 94dvh;
        border-radius: 24px 24px 0 0;
    }

    .afkg-ra-stage {
        padding: 16px;
    }

    .afkg-ra-messages {
        max-height: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .afkg-ra-orb::before,
    .afkg-ra-orb::after {
        animation: none !important;
    }

    .afkg-ra-open,
    .afkg-ra-control {
        transition: none;
    }
}
