/* ===========================================================================
   SIS Assistant — voice + navigation layer (js/sis-voice-nav.js).
   Only adds to the assistant panel's voice screen; the panel itself is styled
   by sis-engagement.css. State lives in #sisAssistant[data-sis-voice]:
   idle · listening · thinking · speaking.
   =========================================================================== */

/* the orb is the push-to-talk button */
.sis-as__ring[data-sis-voice-mic] { cursor: pointer; outline: none; transition: transform .25s ease; }
.sis-as__ring[data-sis-voice-mic]:hover { transform: scale(1.03); }
.sis-as__ring[data-sis-voice-mic]:focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 0 0 7px rgba(233, 59, 110, .6); }
.sis-as--no-voice .sis-as__ring[data-sis-voice-mic] { cursor: default; transform: none; }

/* listening: the halo speeds up and a ring pulses out from the orb */
.sis-as[data-sis-voice="listening"] .sis-as__ring-halo { animation-duration: 1.1s; }
.sis-as[data-sis-voice="listening"] .sis-as__ring::after {
    content: ""; position: absolute; inset: -6px; border-radius: 50%; z-index: 1;
    border: 2px solid rgba(255, 110, 150, .85);
    animation: sis-voice-pulse 1.3s ease-out infinite;
}
@keyframes sis-voice-pulse {
    from { transform: scale(1);    opacity: .9; }
    to   { transform: scale(1.28); opacity: 0; }
}
/* thinking: the orb dims slightly while the answer is fetched */
.sis-as[data-sis-voice="thinking"] .sis-as__ring img { filter: saturate(.7) brightness(.85); transition: filter .3s ease; }
/* speaking: a slow glow */
.sis-as[data-sis-voice="speaking"] .sis-as__ring-halo { animation-duration: 1.8s; }

.sis-as__hint {
    margin: 18px 0 0;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .3px;
    color: rgba(255, 255, 255, .55);
}
.sis-as[data-sis-voice="listening"] .sis-as__hint { color: #ff8fb4; }

/* what was heard, and the reply */
.sis-as__vo { width: 100%; max-width: 320px; }
.sis-as__heard {
    margin: 14px 0 0;
    font-size: 13.5px;
    font-style: italic;
    line-height: 1.45;
    color: rgba(255, 255, 255, .62);
}
.sis-as__said {
    margin: 10px 0 0;
    max-height: 132px;
    overflow-y: auto;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .9);
    text-align: left;
    white-space: pre-wrap;
    overscroll-behavior: contain;
}

/* mute — sits in the header beside close (sis-engagement.css styles it) */
.sis-as__mute[hidden] { display: none; }
.sis-as__mute .sis-as__mute-off,
.sis-as__mute[aria-pressed="true"] .sis-as__mute-on { display: none; }
.sis-as__mute[aria-pressed="true"] .sis-as__mute-off { display: block; }

/* Hands-free "Hey SIS" switch — under the hint, desktop only */
.sis-as__wake {
    margin-top: 10px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, .6);
    font-family: 'Outfit', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease;
}
.sis-as__wake[hidden] { display: none; }
.sis-as__wake[aria-pressed="true"] { color: #8ff0c4; border-color: rgba(32, 201, 151, .45); }
.sis-as__wake:hover { color: #fff; }
.sis-as__wake:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* While it is listening for "Hey SIS" in the background, the voice launcher
   carries a soft green ring — the visitor can always see the mic is on. */
.sis-launch--wake .sis-launch__btn--voice { animation: sis-wake-ring 2.4s ease-in-out infinite; }
@keyframes sis-wake-ring {
    0%, 100% { box-shadow: 0 8px 26px rgba(233, 59, 110, .38), 0 0 0 2px rgba(32, 201, 151, .55); }
    50%      { box-shadow: 0 8px 26px rgba(233, 59, 110, .38), 0 0 0 6px rgba(32, 201, 151, .18); }
}

/* Greeting bubble on arrival — sits just above the launchers */
.sis-greet {
    position: fixed;
    right: 24px;
    bottom: 100px;
    z-index: 10045;
    display: flex;
    align-items: flex-start;
    max-width: 290px;
    border-radius: 18px 18px 6px 18px;
    background: #fff;
    box-shadow: 0 18px 44px -12px rgba(11, 13, 24, .38), 0 0 0 1px rgba(233, 59, 110, .14);
    opacity: 0;
    transform: translateY(12px) scale(.96);
    transform-origin: bottom right;
    transition: opacity .35s ease, transform .45s cubic-bezier(.16, 1, .3, 1);
}
.sis-greet.is-in { opacity: 1; transform: none; }
.sis-greet__body {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px 8px 14px 16px;
    border: 0;
    background: transparent;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #3b3f4c;
    cursor: pointer;
}
.sis-greet__body b { color: #111; font-weight: 700; }
.sis-greet__wave { font-size: 20px; line-height: 1; animation: sis-wave 1.6s ease-in-out 2; transform-origin: 70% 70%; }
@keyframes sis-wave { 0%, 60%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(16deg); } 30% { transform: rotate(-10deg); } }
.sis-greet__x {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin: 8px 8px 0 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .05);
    color: #666;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.sis-greet__x:hover { background: rgba(0, 0, 0, .1); color: #111; }

/* "Would you like me to scroll…?" — answer with a click as well as by voice */
.sis-greet { flex-wrap: wrap; }
.sis-greet__body { flex: 1 1 100%; padding-right: 42px; }
.sis-greet__x { position: absolute; top: 10px; right: 10px; margin: 0; }
.sis-greet__ask {
    flex: 1 0 100%;
    display: flex;
    gap: 8px;
    padding: 0 16px 14px 46px;
}
.sis-greet__yes,
.sis-greet__no {
    flex: 1 1 0;
    height: 34px;
    border-radius: 999px;
    font: 600 13px/1 'Outfit', sans-serif;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.sis-greet__yes {
    border: 0;
    color: #fff;
    background: linear-gradient(90deg, #ff2d8a, #f7a04b);
    box-shadow: 0 6px 16px rgba(255, 45, 138, .3);
}
.sis-greet__yes:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(255, 45, 138, .4); }
.sis-greet__no {
    border: 1px solid rgba(0, 0, 0, .12);
    color: #3b3f4c;
    background: #fff;
}
.sis-greet__no:hover { background: #f4f4f6; }
.sis-greet button:focus-visible { outline: 2px solid #e93b6e; outline-offset: 2px; }
@media (max-width: 767px) {
    .sis-greet { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
}

/* short screens: keep the reply inside the voice screen */
@media (max-height: 740px) {
    .sis-as__said { max-height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
    .sis-as[data-sis-voice="listening"] .sis-as__ring::after { animation: none; opacity: .8; }
    .sis-launch--wake .sis-launch__btn--voice { animation: none; box-shadow: 0 8px 26px rgba(233, 59, 110, .38), 0 0 0 3px rgba(32, 201, 151, .6); }
}

/* ---------------------------------------------------------------------------
   Phones: the orb is the voice UI (js/sis-voice-nav.js "compact" mode).
   Tapping the voice button grows the orb and listens; a small caption above
   it shows what was heard and the reply. No full panel over the page.
   --------------------------------------------------------------------------- */
.sis-launch--live .sis-launch__btn--voice {
    width: 64px;
    height: 64px;
    box-shadow: 0 12px 34px rgba(233, 59, 110, .5), 0 0 0 3px rgba(255, 255, 255, .12);
    transition: width .35s cubic-bezier(.16, 1, .3, 1), height .35s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease;
}
.sis-launch--live[data-sis-voice="listening"] .sis-launch__btn--voice { animation: sis-live-listen 1.6s ease-in-out infinite; }
.sis-launch--live[data-sis-voice="speaking"] .sis-launch__btn--voice { animation: sis-live-speak .9s ease-in-out infinite; }
.sis-launch--live .sis-launch__btn--chat,
.sis-launch--live .sis-launch__ping { display: none; }
@keyframes sis-live-listen {
    0%, 100% { box-shadow: 0 12px 34px rgba(233, 59, 110, .5), 0 0 0 3px rgba(255, 77, 148, .55); }
    50%      { box-shadow: 0 12px 34px rgba(233, 59, 110, .5), 0 0 0 12px rgba(255, 77, 148, .12); }
}
@keyframes sis-live-speak {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

.sis-live {
    position: fixed;
    right: 12px;
    bottom: calc(96px + env(safe-area-inset-bottom));
    z-index: 10045;
    width: max-content;
    max-width: min(300px, calc(100vw - 28px));
    padding: 12px 15px;
    border-radius: 16px 16px 6px 16px;
    background: rgba(14, 14, 22, .94);
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
    font-family: 'Outfit', sans-serif;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .3s ease, transform .35s cubic-bezier(.16, 1, .3, 1), visibility .3s;
    pointer-events: none;
}
.sis-live.is-in { opacity: 1; visibility: visible; transform: none; }
.sis-live p { margin: 0; }
.sis-live__state { font-size: 12px; font-weight: 600; letter-spacing: .3px; color: #ff8fb8; }
.sis-live__state:empty { display: none; }
.sis-live__heard { margin-top: 6px !important; font-size: 13px; font-style: italic; color: rgba(255, 255, 255, .6); }
.sis-live__said { margin-top: 6px !important; font-size: 14.5px; line-height: 1.45; color: #fff; max-height: 40vh; overflow: auto; }

/* greeting: turn the mic on (desktop, first visit) */
.sis-greet__mic {
    flex: 1 0 100%;
    margin: -4px 16px 14px 46px;
    padding: 9px 12px;
    border: 1px dashed rgba(233, 59, 110, .45);
    border-radius: 12px;
    background: rgba(233, 59, 110, .06);
    color: #b3264f;
    font: 600 12.5px/1.3 'Outfit', sans-serif;
    text-align: left;
    cursor: pointer;
}
.sis-greet__mic:disabled { cursor: default; border-style: solid; border-color: rgba(32, 201, 151, .5); background: rgba(32, 201, 151, .08); color: #138a64; }

@media (max-width: 767px) {
    .sis-greet__ask { padding-left: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .sis-launch--live .sis-launch__btn--voice { animation: none !important; }
}
