html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Helvetica, sans-serif;
    color: #efeff0;
    background-color: #202122;
}

#col-container {
    display: flex;
    flex-direction: column;
    /* height: 100vh; */
    height: 100%;
    max-width: 75%;
    margin-left: auto;
    margin-right: auto;
}

#header {
    margin: 0;
    padding: 12px;
    text-align: center;
}

#header:has(+#chat-container>#chat>.message) {
    display: none;
}

#chat-container {
    flex: 1;
    padding: 10px 0px;
    overflow-y: overlay;
}

#input-container {
    padding: 8px;
    background-color: #343542;
    display: flex;
    flex-direction: row;
    align-items: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#input-container textarea {
    /* #message-inp */
    width: 100%;
    resize: none;
    border: 1px solid #20212280;
    outline: none;
    border-radius: 5px;
    background-color: #40424f;
    color: #fff;
    padding: 8px;
    margin-right: 8px;
}

/* Generic tool buttons */

.toolbtn {
    background-color: #40424f;
    border: 1px solid #20212280;
    color: #fff;
    border: none;
    padding: 2px;
    margin: 1px 0px;
    border-radius: 4px;
    width: 35px;
    height: 29px;
    cursor: pointer;
}

.toolbtn.small {
    background-color: #40424f60;
    border-radius: 4px;
    padding: 0px;
    margin: 0px;
    width: 26px;
    height: 16px;
}

/* Source link */

#source {
    position: absolute;
    bottom: 10px;
    left: 10px;
}

a {
    color: #aaa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* New chat button, settings button and dialog */

#buttons {
    position: absolute;
    white-space: nowrap;
    text-align: right;
    bottom: 10px;
    right: 10px;
}

#settings {
    display: none;
    white-space: nowrap;
    width: fit-content;
    font-size: 14px;
    padding: 8px;
    background-color: #343542dd;
    border-radius: 8px;
    position: absolute;
    bottom: 100px;
    right: 10px;
}

#settings.open {
    display: block;
}

#settings p {
    margin: 8px 0px;
}

/* Chat flow */

#chat {
    display: flex;
    flex-direction: column;
    min-height: 200px;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

#chat>.message {
    margin: 8px;
    margin-bottom: 0px;
    padding: 8px;
    border-radius: 16px;
}

#chat>.ping {
    background-color: #383333;
    margin-left: 40px;
    margin-right: 0px;
    border-bottom-right-radius: 0px;
}

#chat>.pong {
    background-color: #333338;
    margin-left: 0px;
    margin-right: 40px;
    border-bottom-left-radius: 0px;
    margin-bottom: 8px;
}

#chat>.system {
    background-color: #583333;
}

#chat .avatar {
    width: 24px;
    height: 24px;
    object-fit: cover;
    float: left;
    margin-right: 8px;
    border-radius: 3px;
}

#chat p {
    margin-block-start: .3em;
    margin-block-end: .3em;
}

#chat pre {
    margin: .3em 0px;
    white-space: pre-wrap;
}

#chat table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0px;
    border-right: 1px solid #d9d9e2;
    border-bottom: 1px solid #d9d9e2;
    border-radius: 5px;
    font-size: 14px;
}

#chat td,
#chat th {
    padding: 5px 8px;
    border-left: 1px solid #d9d9e2;
    border-top: 1px solid #d9d9e2;
    color: #d1d5db;
}

#chat th {
    text-align: left;
    background-color: #ececf033;
    color: #fff;
}

#chat th:first-of-type {
    border-top-left-radius: 5px;
}

#chat th:last-of-type {
    border-top-right-radius: 5px;
}

#chat tr:last-of-type td:first-of-type {
    border-bottom-left-radius: 5px;
}

#chat tr:last-of-type td:last-of-type {
    border-bottom-right-radius: 5px;
}

#chat .katex-html {
    display: none;
    font-size: 0px;
}

#chat .katex-error {
    display: block;
}

#chat .hljs > svg,
#chat .content img {
    max-width: 50%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Scrollbar */

::-webkit-scrollbar {
    width: 10px;
    background-color: #00000000;
}

::-webkit-scrollbar-thumb {
    background-color: #ffffff15;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #909090;
}

/* Session */

#session {
    text-align: right;
}

/* Highlight.js additional styles */

.hljs {
    padding: 8px;
    border-radius: 5px;
    background-color: #282b2e60;
}

/* Generic parts */

.nobreak {
    white-space: nowrap;
}

.right {
    float: right;
}

.clickable {
    cursor: pointer;
}

/* Media types */

#spacer-bottom {
    width: 100%;
    height: 48px;
}

/* On mobile */
@media only screen and (max-width: 1037px) {

    /* 767px */
    .only-desktop {
        display: none;
    }

    #col-container {
        max-width: 100%;
    }
}

/* On desktop */
@media only screen and (min-width: 1038px) {

    /* 768px */
    .only-mobile {
        display: none;
    }
}

/* Print */
@media print {
    html, body {
        background-color: #ffffffff;
    }
    #chat-container {
        overflow: visible;
    }
    #input-container, #header, #buttons, #settings, #spacer-bottom, #source {
        display: none;
    }
    #col-container {
        max-width: 100%;
        width: 100%;
    }
    .clip-badge-copy-icon, button {
        display: none;
    }
    #chat>.ping {
        border: 1px solid #383333;
    }
    #chat>.pong {
        border: 1px solid #333338;
    }    
    #chat>.system {
        border: 1px solid #583333;
    }
}
