.wandering-waterfall {
    font-size: 0.75rem;

    * {
        box-sizing: border-box;
    }

    #chat_text {
        font-size: 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 2em;
    }

    .open-button {
        font-size: 1em;
        font-weight: 700;
        background-color: #65b530;
        color: #fff;
        padding: 0.75em 1em;
        border: none;
        border-radius: 1em;
        cursor: pointer;
        position: fixed;
        bottom: 1.5em;
        right: 1.5em;
        box-shadow: 0 4px 6px rgb(0 0 0 / 10%);
        z-index: 9000;
        letter-spacing: -.025em;
        display: flex;
        white-space: nowrap;
        align-items: center;

        &:hover {
            background-color: #61ad2e;
        }

        svg {
            width: 1.5em;
            height: 1.5em;
            margin-right: 0.3em;
        }
    }

    .chat-popup {
        display: none;
        position: fixed;
        bottom: 1.5em;
        right: 1.5em;
        border-radius: 1em;
        box-shadow: 0 5px 15px rgb(0 0 0 / 20%);
        border: 1px solid #ddd;
        z-index: 9001;
        overflow: hidden;
    }

    .form-container {
        width: 100vw;
        max-width: 25em;
        background-color: #fff;
        display: flex;
        flex-direction: column;
        max-height: 80vh;
        min-height: 25em;

        textarea {
            width: 100%;
            padding: 0.75em;
            max-height: 40vh;
            border: none;
            border-radius: 1em;
            font-size: 0.7rem;
            font-family: inherit;
            resize: none;
            align-self: center;

            &:focus {
                outline: none;
            }
        }

        h2 {
            font-size: 1.4em;
            letter-spacing: -.025em;
            margin: 0 0 1em;
        }

        .docs-submit {
            display: flex;
            align-self: end;
            margin: 0.7em;
        }

        .docs-button {
            flex: 1;
            height: fit-content;
            color: #fff;
            border: none;
            border-radius: 10em;
            cursor: pointer;
            background-color: #65b530;
            width: 2em;
            height: 2em;
            padding: 0.3em;

            &:hover {
                background-color: #61ad2e;
            }
        }

        .svg-hide {
            height: 1.8em;
            width: 1.8em;
        }

        .cancel {
            cursor: pointer;
            margin-left: auto;
            padding: 1em;

            &:hover {
                opacity: 0.7;
            }
        }
    }

    .button-group {
        display: flex;
        gap: 0.5em;
    }

    .searchbox {
        border: 1px solid #dddddd;
        border-radius: 1em;
        display: flex;
        background-color: #fff;
    }
}

.panel.panel-default:nth-child(odd) {
    justify-items: right;
}

.panel.panel-default:nth-child(even) {
    border-bottom: 1px solid #dcdcdc;
}

.panel.panel-default .panel-body {
    line-height: 1.8;
}

.panel.panel-default:nth-child(odd) .panel-body {
    padding: 0.7em 1em;
    text-align: right;
    border-radius: 1em;
    border-bottom: none;
    background-color: #f0f0f0;
    width: fit-content;
    max-width: 75%;
    margin-left: auto;
    line-height: 1.4;
    margin-bottom: 0;
}

.panel.panel-default:last-child {
    border: none;
}

.panel-heading {
    display: none;
}

.panel.panel-default p:first-child {
    margin-top: 0;
}

.text-container {
    overflow-y: auto;
    margin: auto 0;
}

.text-padding {
    padding: 0 1.25em;
}

.bottom-bar {
    position: sticky;
    bottom: 0;
    padding: 1em;
    background-color: #ffffffb3;
    -webkit-backdrop-filter: blur(.4rem);
    backdrop-filter: blur(.4rem);
}

.text-container::-webkit-scrollbar-thumb {
    background-color: #e6e6e6;
    border: 4px solid transparent;
    border-radius: 8px;
    background-clip: padding-box;
}

.text-container::-webkit-scrollbar {
    width: 16px;
}

.chat-header {
    display: flex;
    align-items: center;
}

.crowdlogo {
    padding-left: 1em;
    font-weight: bold;
    display: flex;
}

.crowdlogo img {
    height: 2.4em;
    align-self: end;
}

.crowdlogo span {
    align-self: end;
    font-size: 1.2em;
    letter-spacing: -.025em;
}

.panel-thinking svg {
    height: 1em;
    width: 1em;
}

.panel.panel-default p:first-child {
    padding-top: 0;
}

.panel.panel-default p:first-child {
    margin-top: 0;
}

.panel-thinking {
    display: flex;
    align-items: center;
    animation: pulseFade 3s infinite;
    justify-content: right;
    margin-top: 1em;
}

.panel-thinking span {
    margin-left: 0.2em;
}

@keyframes pulseFade {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

@media (width <=600px) {
    .wandering-waterfall {

        .chat-popup {
            right: 0;
            bottom: 0;
            width: 100%;
            height: 100%;
            border-radius: 0;
            border: none;
        }

        .form-container {
            max-width: 100%;
            height: 100%;
            max-height: unset;
        }

        #chat_text {
            flex-grow: 1;
            max-height: none;
        }

        .panel.panel-default:nth-child(odd) .panel-body {
            max-width: 85%;
        }

        .text-container {
            margin-top: auto;
            margin-bottom: 0;
        }
        .form-container textarea {
            font-size: 16px;
        }
        .bottom-bar {
            padding-bottom: 2em;
        }
    }
}

[data-md-color-scheme="slate"] .form-container {
    background-color: #141415;
}

[data-md-color-scheme="slate"] .chat-popup, [data-md-color-scheme="slate"] .panel.panel-default {
    border-color: #3b3b3b;
}

[data-md-color-scheme="slate"] .searchbox {
    border: 1px solid #3b3b3b;
    background-color: #202020;
}

[data-md-color-scheme="slate"] .searchbox textarea {
    background-color: #202020;
}

[data-md-color-scheme="slate"] .searchbox textarea::placeholder {
    color: #e2e4e9d1;
}

[data-md-color-scheme="slate"] .panel.panel-default:nth-child(odd) .panel-body {
    background-color: #2b2b2b;
}

[data-md-color-scheme="slate"] .text-container::-webkit-scrollbar-thumb {
    background-color: #484848;
}

[data-md-color-scheme="slate"] .bottom-bar {
    background-color: #1717178a;
}
