.voice-assistant-fab,
.voice-assistant-panel,
.voice-assistant-panel * {
    box-sizing: border-box;
}

.voice-assistant-fab {
    position: fixed;
    right: 22px;
    bottom: 96px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    max-width: calc(100vw - 36px);
    padding: 0 17px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(120deg, #4f46e5, #168ce0);
    box-shadow: 0 12px 32px rgba(36, 70, 155, .32);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s ease, transform .2s ease;
}

.voice-assistant-fab:hover { filter: brightness(1.06); transform: translateY(-1px); }
.voice-assistant-fab.is-open { opacity: 0; pointer-events: none; }
.voice-assistant-fab.is-listening { width: 48px; height: 48px; min-height: 48px; justify-content: center; gap: 0; padding: 0; border-radius: 15px; box-shadow: 0 0 0 3px rgba(52, 211, 153, .2), 0 10px 26px rgba(36, 70, 155, .3); animation: vidhi-indicator-pulse 2.4s ease-in-out infinite; }
.voice-assistant-fab.is-listening span { display: none; }
.voice-assistant-fab.is-listening::before { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border: 2px solid #2d64c5; border-radius: 50%; background: #6ee7b7; box-shadow: 0 0 0 3px rgba(110, 231, 183, .18); content: ""; }
.voice-assistant-fab:focus-visible,
.voice-assistant-panel button:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }

.voice-assistant-panel {
    position: fixed;
    right: 22px;
    bottom: 170px;
    z-index: 1201;
    display: block;
    width: 48px;
    height: 48px;
    overflow: visible;
    padding: 0;
    color: #eff4ff;
    background: transparent;
    font-family: Outfit, Inter, system-ui, sans-serif;
}

.voice-assistant-panel[hidden] { display: none; }

.voice-assistant-stage {
    position: relative;
    display: grid;
    width: 48px;
    height: 48px;
    min-height: 48px;
    padding: 3px;
    overflow: visible;
    border: 1px solid rgba(166, 187, 255, .23);
    border-radius: 15px;
    background: linear-gradient(155deg, rgba(23, 35, 71, .97), rgba(12, 21, 48, .98));
    box-shadow: 0 12px 34px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 255, 255, .07);
}

.voice-assistant-header { position: absolute; inset: 0; z-index: 8; display: block; pointer-events: none; }
.voice-assistant-brand { display: none; }
.voice-assistant-brand-icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(121, 145, 255, .28); border-radius: 15px; color: #cdd6ff; background: rgba(90, 105, 230, .19); font-size: 17px; }
.voice-assistant-kicker { display: block; color: #aebaff; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.voice-assistant-header h2 { margin: 3px 0 0; color: #fff; font-size: 19px; line-height: 1.2; }
.voice-assistant-close { position: absolute; top: -7px; left: -7px; display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid rgba(194, 207, 255, .35); border-radius: 50%; color: #dce5ff; background: #26365e; font-size: 9px; cursor: pointer; opacity: 0; visibility: hidden; transform: scale(.85); transition: opacity .15s ease, transform .15s ease, visibility .15s ease; pointer-events: auto; }
.voice-assistant-close:hover { background: rgba(255, 255, 255, .12); }
.voice-assistant-handsfree { position: absolute; top: -7px; right: -7px; display: grid; width: 22px; height: 22px; min-height: 22px; place-items: center; margin: 0; padding: 0; border: 1px solid rgba(194, 207, 255, .35); border-radius: 50%; color: #b7c2dc; background: #26365e; font-size: 9px; cursor: pointer; opacity: 0; visibility: hidden; transform: scale(.85); transition: opacity .15s ease, transform .15s ease, visibility .15s ease; pointer-events: auto; }
.voice-assistant-handsfree span { display: none; }
.voice-assistant-handsfree[aria-pressed="true"] { border-color: rgba(110,231,183,.4); color: #a7f3d0; background: rgba(16,185,129,.13); }
.voice-assistant-handsfree:hover { filter: brightness(1.1); }
.voice-assistant-stage:hover .voice-assistant-close,
.voice-assistant-stage:hover .voice-assistant-handsfree,
.voice-assistant-stage:focus-within .voice-assistant-close,
.voice-assistant-stage:focus-within .voice-assistant-handsfree { opacity: 1; visibility: visible; transform: scale(1); }

.voice-assistant-presence {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 0;
    place-items: center;
    padding: 0;
}

.voice-assistant-orb-wrap { position: relative; display: grid; width: 40px; height: 40px; place-items: center; margin: 0; }
.voice-assistant-orb-ring,
.voice-assistant-orb {
    position: absolute;
    border-radius: 50%;
}
.voice-assistant-orb-ring { inset: 0; border: 1px solid rgba(144, 164, 255, .25); transform: scale(.84); }
.voice-assistant-orb-ring:nth-child(2) { inset: 3px; border-color: rgba(137, 157, 255, .35); transform: scale(.86); }
.voice-assistant-orb-ring:nth-child(3) { inset: 6px; border-color: rgba(158, 176, 255, .45); transform: scale(.9); }
.voice-assistant-orb { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid rgba(221, 229, 255, .56); color: white; background: radial-gradient(circle at 36% 27%, #aab7ff 0, #6863f4 39%, #347fdc 74%, #32b4d3 100%); box-shadow: 0 0 14px rgba(98, 106, 255, .4), inset 0 2px 6px rgba(255, 255, 255, .35); font-size: 10px; }
.voice-assistant-wave { display: none; }
.voice-assistant-wave span { display: block; width: 4px; height: 7px; border-radius: 999px; background: #9eaaff; opacity: .65; }
.voice-assistant-status,
.voice-assistant-hint,
.voice-assistant-footnote { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.voice-assistant-stage::after { position: absolute; right: 3px; bottom: 3px; z-index: 4; width: 9px; height: 9px; border: 2px solid #19264a; border-radius: 50%; background: #8290ac; content: ""; }
.voice-assistant-panel[data-phase="listening"] .voice-assistant-stage::after { background: #6ee7b7; box-shadow: 0 0 0 3px rgba(110, 231, 183, .2); }
.voice-assistant-panel[data-phase="speaking"] .voice-assistant-stage::after { background: #93c5fd; box-shadow: 0 0 0 3px rgba(147, 197, 253, .2); }
.voice-assistant-panel[data-phase="thinking"] .voice-assistant-stage::after { background: #fcd34d; box-shadow: 0 0 0 3px rgba(252, 211, 77, .18); }
.voice-assistant-panel[data-phase="error"] .voice-assistant-stage::after { background: #fb7185; box-shadow: 0 0 0 3px rgba(251, 113, 133, .18); }

.voice-assistant-panel[data-phase="listening"] .voice-assistant-orb-ring { animation: vidhi-listen-ring 2.4s ease-out infinite; }
.voice-assistant-panel[data-phase="listening"] .voice-assistant-orb-ring:nth-child(2) { animation-delay: .55s; }
.voice-assistant-panel[data-phase="listening"] .voice-assistant-orb-ring:nth-child(3) { animation-delay: 1.1s; }
.voice-assistant-panel[data-phase="listening"] .voice-assistant-wave span { animation: vidhi-wave .8s ease-in-out infinite alternate; opacity: 1; }
.voice-assistant-panel[data-phase="listening"] .voice-assistant-wave span:nth-child(2),
.voice-assistant-panel[data-phase="speaking"] .voice-assistant-wave span:nth-child(2) { animation-delay: .12s; }
.voice-assistant-panel[data-phase="listening"] .voice-assistant-wave span:nth-child(3),
.voice-assistant-panel[data-phase="speaking"] .voice-assistant-wave span:nth-child(3) { animation-delay: .24s; }
.voice-assistant-panel[data-phase="listening"] .voice-assistant-wave span:nth-child(4),
.voice-assistant-panel[data-phase="speaking"] .voice-assistant-wave span:nth-child(4) { animation-delay: .36s; }
.voice-assistant-panel[data-phase="listening"] .voice-assistant-wave span:nth-child(5),
.voice-assistant-panel[data-phase="speaking"] .voice-assistant-wave span:nth-child(5) { animation-delay: .48s; }
.voice-assistant-panel[data-phase="speaking"] .voice-assistant-orb { animation: vidhi-speak 1.2s ease-in-out infinite; }
.voice-assistant-panel[data-phase="speaking"] .voice-assistant-wave span { animation: vidhi-wave .55s ease-in-out infinite alternate; opacity: 1; }
.voice-assistant-panel[data-phase="thinking"] .voice-assistant-orb { animation: vidhi-think 1.8s linear infinite; }
.voice-assistant-panel[data-phase="error"] .voice-assistant-orb { box-shadow: 0 0 40px rgba(245, 102, 125, .22), inset 0 2px 18px rgba(255, 255, 255, .24); }

.voice-assistant-controls { position: absolute; inset: 0; z-index: 6; display: block; padding: 0; border: 0; pointer-events: none; }
.voice-assistant-listen { position: absolute; inset: 0; display: grid; width: 100%; height: 100%; place-items: center; border: 0; border-radius: 15px; color: transparent; background: transparent; box-shadow: none; font-size: 0; cursor: pointer; pointer-events: auto; }
.voice-assistant-listen:hover { transform: none; }
.voice-assistant-end { display: none; }
.voice-assistant-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); border: 0; }

/* The voice control stays a 48px indicator while minimized. Opening it reveals
   the spoken and recognized turns as a transcript beside the same control. */
.voice-assistant-collapse { display: none; }
.voice-assistant-feed { display: none; }
.voice-assistant-panel[data-expanded="true"] {
    width: min(390px, calc(100vw - 24px));
    height: min(560px, calc(100dvh - 190px));
    min-height: 300px;
    overflow: hidden;
    color: #1a2945;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 15px;
    overflow: hidden;
    border: 1px solid #dce5f4;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(22, 40, 76, .24);
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-header {
    position: relative;
    inset: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    pointer-events: auto;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-brand {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-brand-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 11px;
    color: #4f46e5;
    background: #eef0ff;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-kicker { color: #5869d7; font-size: 9px; letter-spacing: .08em; }
.voice-assistant-panel[data-expanded="true"] .voice-assistant-header h2 { margin: 2px 0 0; color: #17243d; font-size: 16px; }
.voice-assistant-panel[data-expanded="true"] .voice-assistant-close,
.voice-assistant-panel[data-expanded="true"] .voice-assistant-collapse {
    position: relative;
    inset: auto;
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid #dce5f4;
    border-radius: 10px;
    color: #53647f;
    background: #fff;
    font-size: 12px;
    opacity: 1;
    visibility: visible;
    transform: none;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-close { order: 3; color: #bd4258; }
.voice-assistant-panel[data-expanded="true"] .voice-assistant-collapse { order: 2; }
.voice-assistant-panel[data-expanded="true"] .voice-assistant-handsfree {
    position: relative;
    inset: auto;
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid #dce5f4;
    border-radius: 10px;
    color: #53647f;
    background: #fff;
    font-size: 12px;
    opacity: 1;
    visibility: visible;
    transform: none;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-presence {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
    width: 100%;
    height: auto;
    min-height: 54px;
    padding: 0 0 10px;
    border-bottom: 1px solid #edf1f8;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-orb-wrap { grid-column: 1; grid-row: 1 / span 2; width: 42px; height: 42px; }
.voice-assistant-panel[data-expanded="true"] .voice-assistant-orb { width: 30px; height: 30px; font-size: 12px; }
.voice-assistant-panel[data-expanded="true"] .voice-assistant-status,
.voice-assistant-panel[data-expanded="true"] .voice-assistant-hint {
    position: static;
    display: block;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-status { grid-column: 2; grid-row: 1; margin: 0; color: #263650; font-size: 13px; font-weight: 800; }
.voice-assistant-panel[data-expanded="true"] .voice-assistant-hint { grid-column: 2; grid-row: 2; margin: 0; color: #71809a; font-size: 11px; line-height: 1.4; }
.voice-assistant-panel[data-expanded="true"] .voice-assistant-feed {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 9px;
    width: 100%;
    min-height: 80px;
    overflow-y: auto;
    padding: 2px 3px 4px 0;
    overscroll-behavior: contain;
}
.voice-assistant-message {
    max-width: 91%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #e3eaf5;
    border-radius: 13px 13px 13px 4px;
    color: #33435e;
    background: #f5f8fc;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.voice-assistant-message.is-user {
    align-self: flex-end;
    border-color: #d7d9ff;
    border-radius: 13px 13px 4px 13px;
    color: #2e3970;
    background: #f1f1ff;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-controls {
    position: relative;
    inset: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 0;
    pointer-events: auto;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-listen {
    position: relative;
    inset: auto;
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(120deg, #4f46e5, #168ce0);
    font-size: 15px;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-end {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #dce5f4;
    border-radius: 11px;
    color: #56657d;
    background: #fff;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}
.voice-assistant-panel[data-expanded="true"] .voice-assistant-footnote { display: none; }

@keyframes vidhi-listen-ring { 0% { opacity: .8; transform: scale(.84); } 100% { opacity: 0; transform: scale(1.08); } }
@keyframes vidhi-wave { from { height: 6px; } to { height: 24px; } }
@keyframes vidhi-speak { 50% { transform: scale(1.045); filter: brightness(1.12); } }
@keyframes vidhi-think { to { transform: rotate(360deg); filter: hue-rotate(24deg); } }
@keyframes vidhi-indicator-pulse { 50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, .12), 0 12px 32px rgba(36, 70, 155, .32); } }

@media (max-width: 600px) {
    .voice-assistant-fab { right: 12px; bottom: 88px; }
    .voice-assistant-fab.is-listening { width: 48px; height: 48px; min-height: 48px; }
    .voice-assistant-panel { right: 12px; bottom: 158px; width: 48px; height: 48px; }
    .voice-assistant-panel[data-expanded="true"] { width: calc(100vw - 24px); height: min(560px, calc(100dvh - 178px)); min-height: 280px; }
    .voice-assistant-stage { width: 48px; height: 48px; min-height: 48px; border-radius: 15px; }
    .voice-assistant-orb-wrap { width: 40px; height: 40px; }
    .voice-assistant-orb { width: 26px; height: 26px; }
    .voice-assistant-listen { border-radius: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .voice-assistant-panel *, .voice-assistant-fab { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
