body button,
body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]),
body textarea,
body select {
    background-color: rgba(10, 20, 44, .5) !important;
    background-image: none !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body button:hover:not(:disabled),
body input[type="button"]:hover:not(:disabled),
body input[type="submit"]:hover:not(:disabled),
body input[type="reset"]:hover:not(:disabled) {
    background-color: rgba(24, 45, 86, .68) !important;
}

body button:focus-visible,
body input:focus-visible,
body textarea:focus-visible,
body select:focus-visible {
    outline: 2px solid rgba(151, 184, 255, .9);
    outline-offset: 2px;
}

.whisper-compose[aria-busy="true"] textarea,
.whisper-compose[aria-busy="true"] button {
    cursor: wait;
    opacity: 0.62;
}

.whisper-compose[aria-busy="true"] textarea {
    resize: none;
}

.whisper-chat > header {
    display: block;
}

.whisper-title-row {
    display: flex;
    gap: 12px;
    align-items: baseline;
}

.whisper-title-row h2 {
    margin: 0;
}

.whisper-chat > header p {
    margin: 8px 0 0;
}

.whisper-start-subtitle {
    color: #9eaac3;
    font-size: .78rem;
    line-height: 1.35;
}

.whisper-message.is-user {
    background: rgba(19, 35, 69, .58) !important;
    border-color: rgba(116, 153, 219, .2) !important;
    box-shadow: none !important;
}

.whisper-message.is-assistant {
    align-self: stretch;
    width: auto;
    max-width: none;
    margin-inline: 10px;
    padding-inline: 0;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.whisper-image-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.whisper-send-button {
    display: inline-grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    padding: 0;
}

.whisper-send-button,
.whisper-icon-button {
    background: rgba(19, 35, 69, .92) !important;
    color: #eef2ff;
    border: 1px solid rgba(116, 153, 219, .22) !important;
    box-shadow: none !important;
}

.whisper-send-button svg,
.whisper-icon-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.whisper-compose {
    flex-direction: column;
}

.whisper-compose-row {
    display: flex;
    width: 100%;
    gap: 10px;
    align-items: flex-end;
}

.whisper-compose-row > textarea {
    box-sizing: border-box;
    height: 48px;
    min-height: 48px !important;
    max-height: 144px !important;
    padding-block: 12px;
    resize: none !important;
    overflow-y: hidden;
    field-sizing: content;
    line-height: 22px;
}

.whisper-add-wrap {
    position: relative;
    flex: 0 0 48px;
}

.whisper-add-button {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    background: rgba(19, 35, 69, .92);
    color: #eef2ff;
    font: 300 1.75rem/1 sans-serif;
    cursor: pointer;
}

.whisper-add-menu {
    position: absolute;
    z-index: 10;
    left: 0;
    bottom: calc(100% + 10px);
    width: max-content;
    min-width: 190px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    background: rgba(7, 13, 30, .98);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .38);
}

.whisper-add-menu[hidden] {
    display: none;
}

.whisper-add-menu button {
    display: flex;
    width: 100%;
    gap: 10px;
    align-items: center;
    border: 0;
    border-radius: 9px;
    padding: 10px 12px;
    background: transparent;
    color: #eef2ff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.whisper-add-menu button:hover {
    background: rgba(255, 255, 255, .08);
}

.whisper-image-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    margin-bottom: 6px;
    padding: 3px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
}

.whisper-image-mode-title {
    grid-column: 1 / -1;
    padding: 5px 7px 3px;
    color: #aeb8ca;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.whisper-add-menu .whisper-image-mode button {
    display: block;
    padding: 8px 9px;
    color: #aeb8ca;
    font-size: .78rem;
    text-align: center;
}

.whisper-add-menu .whisper-image-mode button.is-active {
    background: rgba(88, 117, 190, .45);
    color: #fff;
}

.whisper-attachments {
    display: flex;
    width: 100%;
    gap: 7px;
    flex-wrap: wrap;
}

.whisper-attachments[hidden] {
    display: none;
}

.whisper-image-commands {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: min(100%, 540px);
    margin: 0 auto 8px;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    background: rgba(18, 24, 43, .42);
    backdrop-filter: blur(5px);
}

.whisper-image-commands[hidden] {
    display: none;
}

.whisper-image-commands button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 34px;
    padding: 6px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(226, 235, 255, .78);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, outline-color .15s ease, transform .15s ease;
}

.whisper-image-commands button.is-active {
    background: rgba(121, 153, 230, .72);
    color: #fff;
    outline: 2px solid rgba(220, 232, 255, .92);
    outline-offset: 2px;
    transform: scale(1.08);
}

.whisper-image-commands button:not(.is-active):hover {
    background: rgba(128, 151, 210, .2);
    color: #fff;
}

.whisper-image-commands svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.whisper-attachment-chip,
.whisper-message-attachment {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, .07);
    font-size: .82rem;
}

.whisper-attachment-chip button {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
    cursor: pointer;
}

.whisper-attachment-chip.whisper-image-preview {
    position: relative;
    width: 88px;
    height: 88px;
    padding: 0;
    overflow: visible;
    border-radius: 12px;
}

.whisper-image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.whisper-image-preview .whisper-attachment-remove {
    position: absolute;
    top: -7px;
    right: -7px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 50%;
    background: rgba(10, 16, 34, .82);
    color: #fff;
    font-size: 16px;
    line-height: 1;
}

.whisper-message-attachment {
    margin-top: 7px;
}

.whisper-upload-error {
    width: 100%;
    color: #ffb2b2;
    font-size: .82rem;
}

.whisper-document-dialog {
    position: fixed;
    z-index: 1500;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.whisper-document-dialog[hidden] {
    display: none;
}

.whisper-document-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(5px);
}

.whisper-document-dialog > section {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(240px, 1fr) auto auto;
    width: min(780px, 100%);
    height: min(680px, calc(100dvh - 40px));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 20px;
    padding: 20px;
    background: #0a132b;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .55);
}

.whisper-document-dialog header,
.whisper-document-dialog footer {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.whisper-document-dialog h3,
.whisper-document-dialog p {
    margin: 0;
}

.whisper-document-name,
.whisper-document-status {
    margin-top: 4px !important;
    color: #aeb8ca;
    font-size: .82rem;
}

.whisper-document-dialog header > button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

.whisper-document-dialog textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 0;
    margin: 16px 0 10px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 13px;
    padding: 14px;
    resize: none;
    background: rgba(3, 8, 22, .72);
    color: #eef2ff;
    font: inherit;
    line-height: 1.55;
}

.whisper-document-dialog footer {
    justify-content: flex-end;
    margin-top: 12px;
}

.whisper-document-dialog footer button {
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, .07);
    color: #eef2ff;
    font: inherit;
    cursor: pointer;
}

.whisper-document-dialog footer .whisper-icon-button {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    padding: 0;
    border-radius: 12px;
}

.whisper-camera-dialog {
    position: fixed;
    z-index: 1600;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.whisper-camera-dialog[hidden] {
    display: none;
}

.whisper-camera-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
}

.whisper-camera-dialog > section {
    position: relative;
    width: min(760px, 100%);
    overflow: hidden;
    border: 1px solid rgba(143, 177, 255, .2);
    border-radius: 20px;
    padding: 14px;
    background: rgba(5, 12, 29, .32);
}

.whisper-camera-dialog video {
    display: block;
    width: 100%;
    max-height: calc(100dvh - 160px);
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    background: #000;
    object-fit: cover;
}

.whisper-camera-status {
    min-height: 1.3em;
    margin: 8px 0 0;
    color: #c9d4e8;
    text-align: center;
    font-size: .82rem;
}

.whisper-camera-dialog footer {
    display: grid;
    grid-template-columns: 48px 64px 48px;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.whisper-camera-dialog .whisper-icon-button {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
}

.whisper-camera-dialog .whisper-camera-shutter {
    width: 64px;
    height: 64px;
    border: 2px solid rgba(255, 255, 255, .72) !important;
}

.whisper-camera-shutter span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
}

.whisper-chat button {
    background-color: rgba(19, 35, 69, .52) !important;
    background-image: none !important;
    backdrop-filter: blur(8px);
}

.whisper-chat textarea,
.whisper-chat input:not([type="file"]) {
    background-color: rgba(6, 13, 31, .52) !important;
    background-image: none !important;
    backdrop-filter: blur(8px);
}

.whisper-chat button:hover:not(:disabled),
.whisper-chat button[aria-pressed="true"] {
    background-color: rgba(28, 51, 96, .7) !important;
}

.whisper-chat button:focus-visible,
.whisper-chat textarea:focus-visible,
.whisper-chat input:focus-visible {
    outline: 2px solid rgba(151, 184, 255, .9);
    outline-offset: 2px;
}

.whisper-icon-button:hover:not(:disabled),
.whisper-send-button:hover:not(:disabled) {
    border-color: rgba(150, 181, 239, .48) !important;
    background: rgba(28, 51, 96, .96) !important;
}

.whisper-icon-button:focus-visible,
.whisper-send-button:focus-visible {
    outline: 2px solid rgba(151, 184, 255, .9);
    outline-offset: 2px;
}

@media (max-width: 620px) {
    .whisper-title-row {
        gap: 8px;
        align-items: center;
    }

    .whisper-start-subtitle {
        font-size: .72rem;
    }

    .whisper-message.is-assistant {
        margin-inline: 6px;
    }

    .whisper-image-results {
        grid-template-columns: 1fr;
    }

    .whisper-compose-row {
        gap: 8px;
    }

    .whisper-compose-row > textarea {
        height: 44px;
        min-height: 44px !important;
        max-height: 132px !important;
        padding-block: 10px;
    }

    .whisper-add-wrap,
    .whisper-add-button {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .whisper-document-dialog {
        padding: 10px;
    }

    .whisper-document-dialog > section {
        height: calc(100dvh - 20px);
        padding: 16px;
        border-radius: 16px;
    }

    .whisper-camera-dialog {
        padding: 10px;
    }

    .whisper-camera-dialog > section {
        padding: 10px;
        border-radius: 16px;
    }

    .whisper-camera-dialog video {
        max-height: calc(100dvh - 130px);
    }
}
