.formTextContainer {
    margin: 20px 20px 0px 20px;
    text-align: left;
}

.chatbotPage > .formTextContainer,
.chatbotPage > .pageScroll,
.chatbotPage > .chatPromptBar {
    animation: fadeIn var(--fade-in-duration) ease-in-out forwards;
}

.content_container {
    min-height: 100%;
}

.chatLayout {
    font-size: var(--font-size-text);
    margin: 0px 20px 0px 20px; 
    display: flex;
    flex-direction: column;
}

.chatContainer {
    margin: 40px 0px 20px 0px;
    /* margin: 0px; */
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 10px;
}

#history {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 12px;
    padding: 8px 4px;
}

.chatPromptBar {
    margin: 0 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatForm {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chatActions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}

.chatActionsBookCall {
    margin-left: 5px;
    margin-right: auto;
}

.historyFrameContainer {
    display: flex;
    align-items: flex-end;
    margin: 5px;
    background-color: transparent;
    width: 100%;
    gap: 8px;
}

.historyFrameContainer--user {
    justify-content: flex-end;
}

.historyFrameContainer--bot {
    justify-content: flex-start;
}

.historyFrame {
    font-size: var(--font-size-text) !important;
    max-width: min(90%, 1440px);
    line-height: 1.5;
    border-radius: 14px;
    padding: 10px 12px;
    padding-right: 40px;
    border: 1px solid var(--card-border);
    background: rgba(255,255,255,0.06);
    position: relative;
}

.historyFrame * {
    font-size: inherit;
}

.historyFrame--user {
    background: rgba(255,255,255,0.06);
    border-color: var(--card-border);
}

.historyFrame--bot {
    background: rgba(255,255,255,0.06);
    border-color: var(--card-border);
}

.formTextInput {
    margin: 5px;
    width: 100%;
    resize: vertical;
    border-radius: 5px;
}

.copyButton {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--hairline);
    background: rgba(20,22,26,0.6);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 150ms ease, transform 150ms ease, background-color 150ms ease;
}

.historyFrame:hover .copyButton,
.historyFrame:focus-within .copyButton {
    opacity: 1;
}

.copyButton:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

.copyButton:active {
    transform: translateY(0);
}

.copyButton:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.copyButtonIcon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

@media (hover: none) {
    .copyButton {
        opacity: 1;
    }
}

@media (max-width: 900px) {
    .formTextContainer {
        margin: 14px 12px 0 12px;
    }

    .chatLayout {
        font-size: var(--small-font-size-text);
        margin: 0 10px;
    }

    .historyFrame {
        font-size: var(--small-font-size-text) !important;
    }

    .chatContainer {
        margin: 24px 0 12px 0;
    }

    .chatPromptBar {
        margin: 0 10px 12px 10px;
    }

    .historyFrame {
        max-width: min(94%, 1440px);
        line-height: 1.35;
    }

    .chatbotPage.chatbotMobile {
        height: auto;
        min-height: 100svh;
        max-height: none;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .chatbotPage.chatbotMobile #includeHeader {
        top: 0;
        z-index: 80;
        background: transparent;
    }

    .chatbotPage.chatbotMobile .chatPromptBar {
        top: var(--chatbot-header-height, 0px);
        z-index: 70;
        background: transparent;
        margin: 0 10px 10px 10px;
        padding-top: 8px;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--hairline);
    }

    .chatbotPage.chatbotMobile .pageScroll {
        flex: 0 1 auto;
        margin-top: 0;
        margin-bottom: 0;
        overflow: visible;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .chatbotPage.chatbotMobile .chatContainer {
        margin-top: 12px;
    }

    .chatbotPage.chatbotMobile .progress-bar {
        margin-top: 6px;   /* optional spacing */
        margin-bottom: 0;
    }

    .chatbotPage.chatbotMobile #includeHeader .nav-overlay {
        z-index: 120;
    }

    .chatbotPage.chatbotMobile.chatMode .formTextContainer,
    .chatbotPage.chatbotMobile.chatMode > footer {
        display: none;
    }
}

@media (max-width: 600px) {
    .chatLayout {
        font-size: var(--very-small-font-size-text);
    }

    .historyFrame {
        font-size: var(--very-small-font-size-text) !important;
    }
}
