.voice-input-host {
    position: relative;
}

.voice-input-field-shell {
    width: 100%;
}

.voice-input-field-shell > input,
.voice-input-field-shell > textarea {
    display: block;
    width: 100%;
}

.voice-input-host:not([data-voice-placement="utility"]) textarea,
.voice-input-host:not([data-voice-placement="utility"]) > input[type="text"] {
    padding-right: 4.6rem !important;
}

.voice-input-host:not([data-voice-placement="utility"]) #placeholderOverlay,
.voice-input-host:not([data-voice-placement="utility"]) .final-placeholder-overlay,
.voice-input-host:not([data-voice-placement="utility"]) .results-conversation-placeholder-overlay {
    padding-right: 4.8rem;
}

.voice-input-button {
    align-items: center;
    background: #f2efe5;
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    bottom: 0.65rem;
    box-shadow: 2px 2px 0 #1a1a1a;
    color: #1a1a1a;
    cursor: pointer;
    display: inline-flex;
    height: 44px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 0.7rem;
    transition:
        background-color 150ms ease,
        box-shadow 150ms ease,
        color 150ms ease,
        opacity 150ms ease,
        transform 150ms ease;
    width: 44px;
    z-index: 24;
}

.voice-input-button:hover:not(:disabled) {
    background: #fffaf0;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 #1a1a1a;
}

.voice-input-button:focus-visible {
    outline: 3px solid #f25c05;
    outline-offset: 3px;
}

.voice-input-button:disabled {
    cursor: not-allowed;
    opacity: 0.34;
}

.voice-input-button svg {
    display: block;
    height: 20px;
    pointer-events: none;
    width: 20px;
}

.voice-input-button .voice-stop-icon {
    background: currentColor;
    border-radius: 2px;
    height: 13px;
    width: 13px;
}

/* Ticket utilities deliberately keep voice beside Calendar instead of inside
   the writing area. Fields without an action line retain the inline control. */
.voice-input-slot {
    align-items: center;
    display: inline-flex;
    min-height: 44px;
    min-width: 44px;
    position: relative;
}

.voice-input-slot .voice-input-button {
    background: transparent;
    border: 0;
    border-radius: 50%;
    bottom: auto;
    box-shadow: none;
    color: #1f4e5b;
    height: 44px;
    position: static;
    right: auto;
    width: 44px;
}

.voice-input-slot .voice-input-button:hover:not(:disabled) {
    background: rgba(31, 78, 91, 0.1);
    box-shadow: none;
    transform: none;
}

.voice-input-slot .voice-input-button:focus-visible {
    outline-offset: 1px;
}

.voice-input-slot .voice-input-status {
    bottom: calc(100% + 0.35rem);
    max-width: min(15rem, 72vw);
    right: 0;
}

.voice-input-slot .voice-input-button svg {
    height: 18px;
    width: 18px;
}

.voice-input-slot .voice-input-button .voice-stop-icon {
    height: 11px;
    width: 11px;
}

.voice-input-slot .voice-input-spinner {
    height: 16px;
    width: 16px;
}

/* The real-results follow-up microphone lives inside the writing surface. It
   reserves the lower-right corner only while the request is compact; the
   controller removes that reservation when longer text needs the space. */
.voice-input-host[data-voice-input-id="followupComposerInput"] .results-conversation-input,
.voice-input-host[data-voice-input-id="followupComposerInput"] .results-conversation-placeholder-overlay {
    padding-right: 4rem;
}

.voice-input-host[data-voice-input-id="followupComposerInput"].followup-voice-hidden .results-conversation-input,
.voice-input-host[data-voice-input-id="followupComposerInput"].followup-voice-hidden .results-conversation-placeholder-overlay {
    padding-right: 0.9rem;
}

.results-followup-voice {
    bottom: 0.55rem;
    min-height: 40px;
    min-width: 40px;
    position: absolute;
    right: 0.55rem;
    transition: opacity 140ms ease, visibility 140ms ease;
    z-index: 24;
}

.results-followup-voice .voice-input-button {
    height: 40px;
    width: 40px;
}

.results-followup-voice.is-text-obscured {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.results-followup-voice .voice-input-status {
    bottom: calc(100% + 0.35rem);
    right: 0;
}

.ticket-utility-divider {
    align-self: stretch;
    border-left: 1px dashed rgba(31, 78, 91, 0.35);
    height: 26px;
}

#homepageStory .final-ticket-utilities {
    align-items: center;
    display: flex;
    gap: 0.35rem;
}

.voice-input-host[data-voice-state="requesting"] .voice-input-button,
.voice-input-host[data-voice-state="transcribing"] .voice-input-button {
    background: #1f4e5b;
    color: #f2efe5;
}

.voice-input-host[data-voice-state="recording"] .voice-input-button {
    animation: apricot-voice-pulse 1.35s ease-in-out infinite;
    background: #f25c05;
    color: #fffaf0;
}

.voice-input-spinner {
    animation: apricot-voice-spin 0.8s linear infinite;
    border: 2px solid rgba(242, 239, 229, 0.38);
    border-radius: 50%;
    border-top-color: currentColor;
    height: 18px;
    width: 18px;
}

.voice-input-status {
    background: rgba(242, 239, 229, 0.94);
    bottom: 1.15rem;
    color: #596065;
    font-family: "Courier Prime", "Anonymous Pro", monospace;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    line-height: 1.15;
    max-width: min(15rem, calc(100% - 5.5rem));
    opacity: 0;
    padding: 0.15rem 0.35rem;
    pointer-events: none;
    position: absolute;
    right: 4.15rem;
    text-align: right;
    text-transform: uppercase;
    transform: translateY(3px);
    transition: opacity 140ms ease, transform 140ms ease;
    z-index: 23;
}

.voice-input-status:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

.voice-input-host[data-voice-state="recording"] .voice-input-status {
    color: #bf4800;
}

.voice-input-host[data-voice-state="error"] .voice-input-status {
    color: #9e2b21;
}

.final-request-wrap.voice-input-host .voice-input-button {
    bottom: 0.8rem;
}

.final-request-wrap.voice-input-host .voice-input-status {
    bottom: 1.3rem;
}

.voice-input-host[data-voice-input-id="clarifyInput"] .voice-input-button,
.voice-input-host[data-voice-input-id="homeAccountName"] .voice-input-button {
    bottom: auto;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
}

.voice-input-host[data-voice-input-id="clarifyInput"] .voice-input-button:hover:not(:disabled),
.voice-input-host[data-voice-input-id="homeAccountName"] .voice-input-button:hover:not(:disabled) {
    transform: translate(-1px, calc(-50% - 1px));
}

.voice-input-host[data-voice-input-id="homeAccountPreferences"] .voice-input-button {
    bottom: auto;
    top: 0.65rem;
}

.voice-input-host[data-voice-input-id="clarifyInput"] .voice-input-status,
.voice-input-host[data-voice-input-id="homeAccountName"] .voice-input-status,
.voice-input-host[data-voice-input-id="homeAccountPreferences"] .voice-input-status {
    bottom: auto;
    display: block;
    max-width: none;
    padding: 0;
    position: static;
    right: auto;
    text-align: left;
}

.voice-input-host[data-voice-input-id="clarifyInput"] .voice-input-status:not(:empty),
.voice-input-host[data-voice-input-id="homeAccountName"] .voice-input-status:not(:empty),
.voice-input-host[data-voice-input-id="homeAccountPreferences"] .voice-input-status:not(:empty) {
    margin-top: 0.35rem;
}

@keyframes apricot-voice-pulse {
    0%, 100% {
        box-shadow: 2px 2px 0 #1a1a1a, 0 0 0 0 rgba(242, 92, 5, 0.24);
    }
    50% {
        box-shadow: 2px 2px 0 #1a1a1a, 0 0 0 8px rgba(242, 92, 5, 0);
    }
}

@keyframes apricot-voice-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .voice-input-button {
        bottom: 0.5rem;
        right: 0.5rem;
    }

    .voice-input-status {
        bottom: 1rem;
        font-size: 0.62rem;
        max-width: calc(100% - 5rem);
        right: 3.85rem;
    }

    .final-request-wrap.voice-input-host .voice-input-button {
        bottom: 0.55rem;
    }

    .final-request-wrap.voice-input-host .voice-input-status {
        bottom: 1.05rem;
    }

    .voice-input-host[data-voice-input-id="clarifyInput"] .voice-input-button,
    .voice-input-host[data-voice-input-id="homeAccountName"] .voice-input-button {
        bottom: auto;
        right: 0.35rem;
    }

    .voice-input-host[data-voice-input-id="homeAccountPreferences"] .voice-input-button {
        bottom: auto;
        right: 0.5rem;
    }

    .voice-input-slot .voice-input-status {
        bottom: calc(100% + 0.2rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .voice-input-button,
    .voice-input-status,
    .results-followup-voice {
        transition: none;
    }

    .voice-input-host[data-voice-state="recording"] .voice-input-button,
    .voice-input-spinner {
        animation: none;
    }
}
