/**
 * HairColorGPT chat-ui CSS scaffold.
 * Wave step: HCGPT-CAS-001.
 */

/* Dynamic spacers for chat runtime; values are updated by JS at runtime. */
body.hcgpt-chat-page {
    --hcgpt-topbar-h: 0px;
    --hcgpt-inputbar-h: 72px;
    --hcgpt-suggestions-h: 0px;
    --hcgpt-bottom-gap: calc(var(--hcgpt-inputbar-h, 72px) + var(--hcgpt-suggestions-h, 0px) + env(safe-area-inset-bottom, 0px));
    --hcgpt-feedback-h: 0px;
    --hcgpt-accent: #1a73e8;
}

/* Message stream offsets: below topbar and above composer. */
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages {
    margin-top: calc(var(--hcgpt-topbar-h) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--hcgpt-bottom-gap, calc(var(--hcgpt-inputbar-h, 72px) + var(--hcgpt-suggestions-h, 0px) + env(safe-area-inset-bottom, 0px))) + var(--hcgpt-feedback-h, 0px) + 12px);
    scroll-padding-bottom: calc(var(--hcgpt-bottom-gap, calc(var(--hcgpt-inputbar-h, 72px) + var(--hcgpt-suggestions-h, 0px) + env(safe-area-inset-bottom, 0px))) + var(--hcgpt-feedback-h, 0px) + 12px);
}

/* Keep topbar stable inside transformed/overflow containers. */
body.hcgpt-chat-page #hcgpt-topbar,
body.hcgpt-chat-page .hcgpt-topbar,
body.hcgpt-chat-page .site-header {
    position: relative;
    z-index: 1000;
    backface-visibility: hidden;
    will-change: transform;
}

@supports (height: 100svh) {
    body.hcgpt-chat-page .hcgpt-scroll,
    body.hcgpt-chat-page .hcgpt-shell {
        height: 100svh;
    }
}

@supports (height: 100dvh) {
    body.hcgpt-chat-page .hcgpt-scroll,
    body.hcgpt-chat-page .hcgpt-shell {
        height: 100dvh;
    }
}

@media (max-width: 767.98px) {
    body.hcgpt-chat-page {
        --hcgpt-topbar-h: 0px;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages {
        padding-top: calc(var(--hcgpt-topbar-h) + env(safe-area-inset-top, 0px));
    }

    body.hcgpt-chat-page #hcgpt-topbar,
    body.hcgpt-chat-page .hcgpt-topbar,
    body.hcgpt-chat-page .site-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        will-change: transform;
        backface-visibility: hidden;
    }
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-input-wrapper {
    position: relative !important;
    overflow: visible !important;
}

@media (max-width: 767.98px) {
    body.hcgpt-chat-page {
        --hcgpt-inputbar-h: 72px;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages {
        padding-bottom: calc(var(--hcgpt-bottom-gap, calc(var(--hcgpt-inputbar-h, 72px) + env(safe-area-inset-bottom, 0px))) + var(--hcgpt-feedback-h, 0px)) !important;
    }

    @supports (height: 100dvh) {
        :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages {
            min-height: 40dvh;
        }
    }

    @supports (height: 100svh) {
        :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages {
            min-height: 40svh;
        }
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-feedback-actions {
        position: relative;
        z-index: 1;
    }
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-chat-container,
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-chatbox-input-container {
    margin-block: 0 !important;
    background: transparent !important;
    color: inherit;
    line-height: var(--hcgpt-line-height-150) !important;
    overflow: visible !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages {
    margin-block: 0 !important;
    background: transparent !important;
    color: inherit;
    line-height: var(--hcgpt-line-height-150) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-chat-container {
    font-family: var(--hcgpt-font-sans);
    font-weight: var(--hcgpt-font-weight-thin);
    font-style: normal;
}

/* Chat message scrollbar (Chrome, Safari, Edge) */
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages::-webkit-scrollbar-track {
    background: var(--hcgpt-scrollbar-track);
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages::-webkit-scrollbar-thumb {
    background-color: var(--hcgpt-scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages::-webkit-scrollbar-thumb:hover {
    background-color: var(--hcgpt-scrollbar-thumb-hover);
}

/* Unified app-shell chat layout and empty-state behavior. */
#hcgpt-unified-chat-wrapper #hcgpt-chat-container {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100%;
    min-width: 0;
    align-self: stretch;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
}

#hcgpt-unified-chat-wrapper #hcgpt-messages {
    flex: 1;
    min-height: 0 !important;
    margin-top: 0 !important;
    max-height: 100% !important;
    display: flex;
    flex-direction: column;
    gap: var(--hcgpt-turn-gap-y, 16px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: thin;
    scrollbar-color: var(--hcgpt-scrollbar-thumb) var(--hcgpt-scrollbar-track);
    scroll-behavior: auto;
    padding-top: 16px;
    padding-bottom: calc(var(--hcgpt-bottom-gap, calc(var(--hcgpt-inputbar-h, 72px) + var(--hcgpt-suggestions-h, 0px) + env(safe-area-inset-bottom, 0px))) + var(--hcgpt-feedback-h, 0px) + 16px);
    scroll-padding-bottom: calc(var(--hcgpt-bottom-gap, calc(var(--hcgpt-inputbar-h, 72px) + var(--hcgpt-suggestions-h, 0px) + env(safe-area-inset-bottom, 0px))) + var(--hcgpt-feedback-h, 0px) + 16px);
}

#hcgpt-unified-chat-wrapper .hcgpt-feedback-bar {
    position: static !important;
    margin: 0 0 calc(var(--hcgpt-bottom-gap, calc(var(--hcgpt-inputbar-h, 72px) + var(--hcgpt-suggestions-h, 0px) + env(safe-area-inset-bottom, 0px))) + 12px);
    padding: 0;
}

#hcgpt-unified-chat-wrapper .hcgpt-chatbox-input-container {
    position: fixed;
    bottom: 0;
    left: var(--hcgpt-app-main-left, 0px);
    right: var(--hcgpt-app-main-right, 0px);
    padding-block: 0;
    width: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Keep composer/message left-edge parity on tablet widths when sidebar is mini. */
@media (min-width: 768px) and (max-width: 1023.98px) {
    #hcgpt-unified-chat-wrapper .hcgpt-chatbox-input-container {
        left: var(--hcgpt-app-main-left, 0px) !important;
        right: var(--hcgpt-app-main-right, 0px) !important;
    }
}

#hcgpt-unified-chat-wrapper #hcgpt-input-box {
    width: 100%;
    padding-block: 0;
    padding-inline: 0;
    position: relative;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-suggestions-box.suggestion-float {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    z-index: 15;
    pointer-events: auto;
    background: transparent;
    animation: suggestionBoxFloatIn 0.32s cubic-bezier(.4, 0, .2, 1);
    box-sizing: border-box;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .suggestion-card {
    display: inline-block !important;
    max-width: 163px !important;
    padding: 7px 15px !important;
    background: #fdfdfd !important;
    border: 1px solid rgba(33, 2, 142, 0.2) !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 27px -22px rgba(128, 6, 251, 0.23) !important;
    line-height: var(--hcgpt-line-height-120) !important;
    color: #676767 !important;
    cursor: pointer !important;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease !important;
    white-space: normal !important;
    text-align: left !important;
    font-size: var(--hcgpt-font-size-13) !important;
    font-weight: var(--hcgpt-font-weight-thin) !important;
    text-transform: var(--hcgpt-text-transform-none) !important;
    overflow: hidden !important;
    vertical-align: top !important;
    font-family: var(--hcgpt-font-sans);
    font-style: normal;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .suggestion-card:hover {
    background: #f2f2f2a3 !important;
    box-shadow: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-refresh-suggestions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 0 6px;
    cursor: pointer;
    color: #444;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    min-height: unset !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-refresh-suggestions svg {
    stroke: currentColor;
    box-shadow: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-refresh-suggestions .hcgpt-btn-text {
    font-size: var(--hcgpt-font-size-10);
    font-weight: var(--hcgpt-font-weight-medium);
    text-transform: var(--hcgpt-text-transform-none);
    line-height: var(--hcgpt-line-height-100);
    white-space: nowrap;
    box-shadow: none !important;
}

@media (max-width: 767.98px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-suggestions-box.suggestion-float {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        padding: 10px 16px !important;
        gap: 10px !important;
        margin-bottom: -17px !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
        scroll-snap-type: x proximity !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-suggestions-box.suggestion-float::-webkit-scrollbar {
        display: none !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-suggestions-box .suggestion-card,
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .suggestion-card {
        min-width: 140px !important;
        max-width: 280px !important;
        min-height: 44px !important;
        padding: 8px 13px !important;
        font-size: var(--hcgpt-font-size-13) !important;
        line-height: var(--hcgpt-line-height-130) !important;
        flex-shrink: 0 !important;
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        scroll-snap-align: start !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-suggestions-box .suggestion-card {
        font-family: var(--hcgpt-font-sans);
        font-weight: var(--hcgpt-font-weight-thin);
        font-style: normal;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .suggestion-card {
        font-family: var(--hcgpt-font-sans);
        font-weight: var(--hcgpt-font-weight-thin);
        font-style: normal;
    }
}

@media (max-width: 480px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .suggestion-card {
        max-width: 300px !important;
        font-family: var(--hcgpt-font-sans);
        font-weight: var(--hcgpt-font-weight-thin);
        font-style: normal;
    }
}

@media screen and (min-width: 430px) and (max-width: 820px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-suggestions-box.suggestion-float {
        margin-bottom: 2px;
        bottom: calc(100% + -16px);
    }
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) :is(#hcgpt-suggestions-box .suggestion-card, .suggestion-card),
:where(body.hcgpt-chat-page.hcgpt-theme-dark) :is(#hcgpt-suggestions-box .suggestion-card, .suggestion-card),
:where(body.hcgpt-chat-page[data-hcgpt-theme="dark"]) :is(#hcgpt-suggestions-box .suggestion-card, .suggestion-card),
:where([data-hcgpt-theme="dark"]) #hcgpt-unified-chat-wrapper :is(#hcgpt-suggestions-box .suggestion-card, .suggestion-card) {
    background: var(--hcgpt-color-surface-2) !important;
    color: var(--hcgpt-color-text) !important;
    border-color: var(--hcgpt-color-border) !important;
}

:where(.hcgpt-scope[data-hcgpt-theme="dark"]) :is(#hcgpt-suggestions-box .suggestion-card:hover, .suggestion-card:hover),
:where(body.hcgpt-chat-page.hcgpt-theme-dark) :is(#hcgpt-suggestions-box .suggestion-card:hover, .suggestion-card:hover),
:where(body.hcgpt-chat-page[data-hcgpt-theme="dark"]) :is(#hcgpt-suggestions-box .suggestion-card:hover, .suggestion-card:hover),
:where([data-hcgpt-theme="dark"]) #hcgpt-unified-chat-wrapper :is(#hcgpt-suggestions-box .suggestion-card:hover, .suggestion-card:hover) {
    background: var(--hcgpt-color-surface-3) !important;
    border-color: var(--hcgpt-color-border) !important;
}

#hcgpt-unified-chat-wrapper.hcgpt-chat-is-empty .hcgpt-shell {
    justify-content: center;
    gap: var(--hcgpt-space-4);
    overflow: visible !important;
}

#hcgpt-unified-chat-wrapper.hcgpt-chat-is-empty #hcgpt-chat-container {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible;
    padding-top: 0;
    padding-bottom: 0;
}

#hcgpt-unified-chat-wrapper.hcgpt-chat-is-empty #hcgpt-messages {
    align-items: center;
    justify-content: center;
    margin-top: 0 !important;
    max-height: none !important;
    padding-top: 0;
    padding-bottom: 0;
    scroll-padding-bottom: 0;
}

#hcgpt-unified-chat-wrapper.hcgpt-chat-is-empty .hcgpt-feedback-bar {
    display: none;
}

#hcgpt-unified-chat-wrapper.hcgpt-chat-is-empty .hcgpt-chatbox-input-container {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-width: 100%;
    z-index: auto;
}

#hcgpt-unified-chat-wrapper.hcgpt-chat-is-empty #hcgpt-input-box {
    margin: 0 auto;
}

@media (max-width: 767.98px) {
    #hcgpt-unified-chat-wrapper .hcgpt-chatbox-input-container {
        left: 0 !important;
    }
}

@media (min-width: 601px) and (max-width: 767.98px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-chat-container {
        width: 100% !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages {
        padding-top: 12px !important;
        padding-bottom: calc(var(--hcgpt-bottom-gap, calc(var(--hcgpt-inputbar-h, 72px) + var(--hcgpt-suggestions-h, 0px) + env(safe-area-inset-bottom, 0px))) + var(--hcgpt-feedback-h, 0px) + 16px) !important;
        max-height: 60vh !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-input-box {
        border-radius: 16px 16px 0 0 !important;
        padding: 18px 0 12px !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-user-input {
        padding: 6px 58px 26px 13px !important;
        font-size: var(--hcgpt-font-size-16) !important;
        min-height: 60px !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-input-wrapper > .hcgpt-composer-actions {
        bottom: var(--hcgpt-composer-actions-inset-y, 4px) !important;
        left: 12px !important;
        z-index: 1200 !important;
    }
}

@media (min-width: 481px) and (max-width: 600px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-chat-container {
        width: 100% !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages {
        padding-top: 12px !important;
        padding-bottom: calc(var(--hcgpt-bottom-gap, calc(var(--hcgpt-inputbar-h, 72px) + var(--hcgpt-suggestions-h, 0px) + env(safe-area-inset-bottom, 0px))) + var(--hcgpt-feedback-h, 0px) + 12px) !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-input-box {
        padding: 0 !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-user-input {
        padding: 4px 60px 37px 50px !important;
        font-size: var(--hcgpt-font-size-16) !important;
        min-height: 83px !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-input-wrapper > .hcgpt-composer-actions {
        bottom: var(--hcgpt-composer-actions-inset-y, 4px) !important;
        left: 12px !important;
        z-index: 1200 !important;
    }
}

@media (max-width: 480px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-chat-container {
        width: 100% !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages {
        padding-top: 0 !important;
        padding-bottom: calc(var(--hcgpt-bottom-gap, calc(var(--hcgpt-inputbar-h, 72px) + var(--hcgpt-suggestions-h, 0px) + env(safe-area-inset-bottom, 0px))) + var(--hcgpt-feedback-h, 0px) + 8px) !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-input-box {
        padding: 14px 0 8px !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-user-input {
        padding: 4px 56px 30px 46px !important;
        min-height: 80px !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-input-wrapper > .hcgpt-composer-actions {
        bottom: var(--hcgpt-composer-actions-inset-y, 4px) !important;
        left: 12px !important;
    }
}

/* HCGPT-CAR-002 / HCGPT-CRS-002: composer + textarea + controls owner */
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-input-box {
    --hcgpt-composer-actions-inset-y: 4px;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-user-input {
    width: 100%;
    min-height: 84px;
    padding: 9px 0 29px 20px;
    font-size: var(--hcgpt-font-size-15);
    resize: none;
    box-sizing: border-box;
    position: relative;
    padding-left: 21px !important;
    padding-right: 64px !important;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: min(40vh, 360px);
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-user-input.with-image {
    min-height: 150px !important;
    padding-top: 130px !important;
    padding-bottom: 36px;
}

@media (max-width: 600px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-user-input {
        max-height: min(50vh, 300px);
    }
}

@media (min-width: 481px) and (max-width: 600px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-user-input.with-image {
        padding-left: 16px !important;
        padding-right: 64px !important;
        padding-top: 105px !important;
    }
}

@media (max-width: 767.98px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-user-input.with-image,
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-input-box #hcgpt-user-input.with-image {
        padding-top: 105px !important;
    }
}

@media (max-width: 480px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-user-input.with-image {
        padding-left: 12px !important;
        padding-right: 56px !important;
        padding-top: 95px !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-input-box #hcgpt-user-input.with-image {
        padding-top: 95px !important;
    }
}

@media screen and (min-width: 430px) and (max-width: 820px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-user-input {
        padding: 12px 47px 31px 12px !important;
        font-size: var(--hcgpt-font-size-14) !important;
        min-height: 83px !important;
    }
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-direction: row !important;
    direction: ltr !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions #hcgpt-upload-btn,
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions > #hcgpt-upload-btn {
    order: 1 !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions [data-hcgpt-dropdown="tools"],
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions > [data-hcgpt-dropdown="tools"] {
    order: 2 !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-tool-chip {
    order: 3;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-input-wrapper > .hcgpt-composer-actions {
    position: absolute !important;
    bottom: var(--hcgpt-composer-actions-inset-y, 4px) !important;
    left: 12px !important;
    z-index: 1200 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    height: 36px;
    border: 0;
    background: transparent;
    color: #1a1a1a;
    border-radius: 12px;
    padding: 0 .75rem;
    cursor: pointer;
    transition: background .18s ease;
    font-weight: var(--hcgpt-font-weight-regular);
    font-family: var(--hcgpt-font-sans);
    font-style: normal;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn--icon {
    width: 36px;
    justify-content: center;
    padding: 0;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn--pill {
    padding: 0 .9rem;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions.has-tool-active .hcgpt-btn--pill {
    justify-content: center;
    min-width: 36px;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn-label {
    font-weight: var(--hcgpt-font-weight-regular);
    letter-spacing: var(--hcgpt-letter-spacing-0);
    text-transform: var(--hcgpt-text-transform-none);
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions.has-tool-active .hcgpt-btn-label {
    display: none;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn:hover {
    background: #f4f4f6;
    box-shadow: none !important;
    color: #1a1a1a;
    text-decoration: none;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn svg {
    display: block;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-tool-chip {
    display: none;
    align-items: center;
    gap: .45rem;
    height: 32px;
    padding: 0 .55rem;
    border-radius: 10px;
    background: transparent;
    color: var(--hcgpt-accent);
    font-weight: var(--hcgpt-font-weight-regular);
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions.has-tool-active .hcgpt-tool-chip {
    display: inline-flex;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-tool-chip svg {
    color: var(--hcgpt-accent);
    display: block;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-tool-chip:hover {
    background: rgba(26, 115, 232, .1);
    border-color: rgba(26, 115, 232, .15);
    box-shadow: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-tool-chip-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--hcgpt-accent);
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-chip-close {
    all: unset;
    cursor: pointer;
    color: var(--hcgpt-accent);
    font-weight: var(--hcgpt-font-weight-bold);
    line-height: var(--hcgpt-line-height-100);
    padding: 0 .1rem;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-chip-close:hover {
    background: transparent !important;
    box-shadow: none !important;
    text-decoration: underline;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-chip-close[hidden] {
    display: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-tool-chip[hidden] {
    display: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn.plus-outline,
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn .outline {
    box-shadow: none;
    border: 0;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn * {
    text-transform: var(--hcgpt-text-transform-none) !important;
    font-family: var(--hcgpt-font-sans);
    font-weight: var(--hcgpt-font-weight-regular);
    font-style: normal;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn-stt,
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn-rec {
    background: transparent;
    width: 36px;
    height: 36px;
    transition: background .18s;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn-stt:hover,
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn-rec:hover {
    background: var(--hcgpt-grey-100);
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-suggestions-button {
    display: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions button.rotating svg {
    animation: rotate .5s ease-in-out;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-composer-actions .hcgpt-btn-rec.recording,
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-btn-rec.recording {
    animation: hcgptRecBlink 1s infinite;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) :is(.hcgpt-btn-stt.recording, .hcgpt-btn-rec.recording) {
    color: #e53935 !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) :is(.hcgpt-btn-stt.recording svg, .hcgpt-btn-rec.recording svg) {
    stroke: #e53935 !important;
}

@keyframes hcgptRecBlink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: .4;
    }

    100% {
        opacity: 1;
    }
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) :is(.hcgpt-right-controls, #hcgpt-right-controls) {
    flex-shrink: 0;
    contain: layout style;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-right-controls button {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #444;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-right-controls button:hover {
    color: #222;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-right-controls button,
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-right-controls button:hover {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-right-controls button svg {
    stroke: currentColor;
    transition: transform .15s ease, stroke .15s ease, fill .15s ease;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-right-controls .hcgpt-btn-stt:hover svg {
    transform: translateY(-1px);
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-upload-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-upload-btn:hover {
    transform: scale(1.1);
    box-shadow: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-upload-btn svg {
    stroke: currentColor;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) :is(button#hcgpt-websearch-btn, #hcgpt-input-box #hcgpt-websearch-btn, #hcgpt-grey-buttons-container #hcgpt-websearch-btn) {
    display: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) button[data-hcgpt-role~="primary-action"] {
    background: var(--hcgpt-color-surface);
    border: 1px solid var(--hcgpt-color-border);
    color: var(--hcgpt-color-text);
    transition: background 0.18s;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) button[data-hcgpt-role~="primary-action"]:hover {
    background: var(--hcgpt-color-surface-2);
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) button[data-hcgpt-role~="primary-action"][data-state="stop"] {
    background: var(--hcgpt-color-surface-2) !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) button[data-hcgpt-role~="primary-action"][data-state="stop"]:hover {
    background: var(--hcgpt-color-surface) !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) :is(.hcgpt-voice-disabled, button.hcgpt-voice-disabled) {
    pointer-events: none !important;
    opacity: 0.45 !important;
    filter: grayscale(100%);
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) :is(#hcgpt-input-box, .hcgpt-input-wrapper) #hcgpt-send-btn {
    position: absolute !important;
    top: auto !important;
    left: auto !important;
    right: var(--hcgpt-send-inset-x, 4px) !important;
    bottom: var(--hcgpt-send-inset-y, 4px) !important;
    inset: auto var(--hcgpt-send-inset-x, 4px) var(--hcgpt-send-inset-y, 4px) auto !important;
    transform: none !important;
    margin: 0 !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) :is(#hcgpt-input-box, .hcgpt-input-wrapper) :is(#hcgpt-right-controls, .hcgpt-right-controls) {
    position: absolute !important;
    top: auto !important;
    left: auto !important;
    right: calc(var(--hcgpt-send-inset-x, 4px) + var(--hcgpt-send-size, 36px) + var(--hcgpt-send-gap, 6px)) !important;
    bottom: var(--hcgpt-send-inset-y, 4px) !important;
    inset: auto calc(var(--hcgpt-send-inset-x, 4px) + var(--hcgpt-send-size, 36px) + var(--hcgpt-send-gap, 6px)) var(--hcgpt-send-inset-y, 4px) auto !important;
    transform: none !important;
    margin: 0 !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-input-box.hcgpt-primary-action-mic :is(#hcgpt-right-controls, .hcgpt-right-controls) {
    right: var(--hcgpt-send-inset-x, 4px) !important;
    inset: auto var(--hcgpt-send-inset-x, 4px) var(--hcgpt-send-inset-y, 4px) auto !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-input-box.hcgpt-primary-action-send :is(#hcgpt-stt-btn, .hcgpt-btn-stt) {
    display: none !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-grey-buttons-container {
    display: flex !important;
    align-items: center !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-input-wrapper :is(.hcgpt-composer-actions svg, .hcgpt-composer-actions label svg, .hcgpt-right-controls svg, #hcgpt-right-controls svg, #hcgpt-grey-buttons-container svg, #hcgpt-upload-btn svg, .hcgpt-btn-stt svg, .hcgpt-btn-rec svg) {
    display: block !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-input-wrapper :is(#hcgpt-upload-btn, .hcgpt-btn--icon, .hcgpt-btn-stt, .hcgpt-btn-rec, #hcgpt-grey-buttons-container > button, #hcgpt-grey-buttons-container > label) {
    line-height: var(--hcgpt-line-height-0) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-input-wrapper :is(#hcgpt-grey-buttons-container > label, #hcgpt-grey-buttons-container > button, .hcgpt-btn-rec, .hcgpt-btn-stt, .hcgpt-btn--icon, #hcgpt-upload-btn) {
    font-family: var(--hcgpt-font-sans);
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-input-wrapper .hcgpt-btn-stt {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-family: var(--hcgpt-font-sans);
}

@media screen and (-webkit-min-device-pixel-ratio: 0) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-input-box {
        --hcgpt-composer-actions-inset-y: 6px;
        --hcgpt-send-inset-y: 6px;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-upload-btn:hover {
        transform: scale(1.02) !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-upload-btn:hover svg,
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) :is(#hcgpt-right-controls .hcgpt-btn-stt:hover svg, .hcgpt-right-controls .hcgpt-btn-stt:hover svg) {
        transform: translateY(0) !important;
    }

    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) :is(.hcgpt-composer-actions .hcgpt-btn, #hcgpt-upload-btn, #hcgpt-send-btn, #hcgpt-stt-btn) {
        -webkit-appearance: none;
        appearance: none;
    }
}

@supports (-webkit-touch-callout: none) {
    @media (max-width: 767.98px) and (orientation: portrait) {
        :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-feedback-actions {
            position: relative;
            z-index: 10;
        }

        :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) #hcgpt-messages {
            padding-bottom: max(
                calc(var(--hcgpt-bottom-gap, calc(var(--hcgpt-inputbar-h, 72px) + env(safe-area-inset-bottom, 0px))) + var(--hcgpt-feedback-h, 0px) + 16px),
                132px
            ) !important;
        }
    }
}

/* HCGPT-CAR-004 / HCGPT-CRS-004: thinking + typewriter owner */
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .thinking {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .thinking-dot {
    font-size: var(--hcgpt-font-size-28);
    color: #aaa;
    animation: hcgpt-chat-ui-blink 1s infinite;
    padding-left: 8px;
}

@keyframes hcgpt-chat-ui-blink {
    0%,
    100% {
        opacity: 0.2;
    }

    50% {
        opacity: 1;
    }
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-thinking-dot {
    width: 24px !important;
    height: 24px !important;
    display: block;
    animation: hcgpt-chat-ui-pulse 1.2s ease-in-out infinite;
    opacity: 0.8;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
}

@keyframes hcgpt-chat-ui-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-message-star-icon.hcgpt-pulse {
    animation: hcgpt-chat-ui-pulse 1.2s ease-in-out infinite;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-message.hcgpt-thinking {
    background: transparent !important;
    border: none !important;
    padding: 6px 0 !important;
    align-self: flex-start;
    min-height: 28px;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-thinking-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-thinking-label {
    font-size: var(--hcgpt-font-size-13);
    line-height: var(--hcgpt-line-height-130);
    color: var(--hcgpt-color-text-muted);
    letter-spacing: var(--hcgpt-letter-spacing-001em);
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-thinking-label--shimmer {
    background-image: linear-gradient(
        110deg,
        color-mix(in srgb, var(--hcgpt-color-text-muted) 82%, transparent) 0%,
        var(--hcgpt-color-text) 45%,
        color-mix(in srgb, var(--hcgpt-color-text-muted) 82%, transparent) 80%
    );
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: hcgpt-chat-ui-thinking-shimmer 1.9s linear infinite;
}

@keyframes hcgpt-chat-ui-thinking-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-thinking-label--shimmer {
        animation: none;
        background-image: none;
        color: var(--hcgpt-color-text-muted);
    }
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-cursor {
    font-weight: var(--hcgpt-font-weight-bold);
    color: #333;
    animation: hcgpt-chat-ui-cursor-blink 1s step-end infinite;
}

@keyframes hcgpt-chat-ui-cursor-blink {
    from,
    to {
        color: transparent;
    }

    50% {
        color: #333;
    }
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: #333;
    animation: hcgpt-chat-ui-typewriter-blink 1s infinite;
    margin-left: 1px;
    vertical-align: text-bottom;
    border-radius: 1px;
}

@keyframes hcgpt-chat-ui-typewriter-blink {
    0%,
    45% {
        opacity: 1;
        background-color: #333;
    }

    50%,
    95% {
        opacity: 0;
    }

    100% {
        opacity: 1;
        background-color: #333;
    }
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-message.bot .hcgpt-typewriter-cursor,
:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-message.assistant .hcgpt-typewriter-cursor {
    background-color: #444;
}

@media (max-width: 767.98px) {
    :where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-typewriter-cursor {
        width: 1.5px;
        margin-left: 0.5px;
    }
}

:where(#hcgpt-unified-chat-wrapper, .hcgpt-scope) .hcgpt-message-content {
    transition: opacity 0.3s ease-in-out;
    flex-grow: 1;
    min-width: 0;
}
