@font-face {
    font-family: 'Icon';
    src: url(fonts/icons.woff2);
}

.wikiloader {
    display: none;
}
/* to do: let it actually scroll because right now it fucking sucks */
body {
    background: rgba(234, 232, 230);
    height: 100dvh;                /* better than 100vh on mobile */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;   /* don't shove everything to the bottom */
    padding: 10px;
    min-height: 0;                 /* allow inner flex kids to shrink */
    overflow: hidden;
}
* {
    box-sizing: border-box;
}
.uniwidth, .input, .messages, .typing {
    width: calc(100vw - 20px);
    max-width: 1000px;
}

.input {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    min-height: fit-content;
}
.chatbox {
    border: none;
    padding: 20px;
    font-size: 16px;
    width: 100%;
    background: transparent;
}
.chatbox:focus {
    outline: none;
}
.send {
    margin-left: auto;
    background: transparent;
    color: green;
    border: none;
    width: 50px;
    height: 50px;
    font-family: 'Icon';
    font-size: 24px;
    font-variation-settings:
        'FILL' 0,
        'wght' 200,
        'GRAD' 0,
        'opsz' 24;
    cursor: pointer;
}

.message {
    padding: 15px;
    font-size: 16px;
    font-family: sans-serif;
    min-width: 200px;
    max-width: 50%;
    width: fit-content;
    background: white;
    font-weight: 300;
    border-radius: 10px;
}
.messages {
    display: flex;
    flex-direction: column;
    gap: 5px;

    /* the magic trio */
    flex: 1 1 auto;                /* fill leftover vertical space */
    min-height: 0;                 /* CRUCIAL: let it shrink so overflow can scroll */
    overflow-y: auto;              /* let it scroll */

    justify-content: flex-end;     /* keep messages hugging the bottom */
    -webkit-overflow-scrolling: touch;
}
.message.out {
    background: rgba(240,255,240);
    font-weight: 400;
    align-self: flex-end;
}
.typing {
    height: 20px;
    font-family: sans-serif;
    font-size: 12px;
    font-weight: 300;
    display: flex;
    align-items: center;
    padding: 3px;
}

:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.send:disabled {
    color: gray;
}

.footer {
    color: gray;
    width: 100%;
    text-align: center;
    font-family: sans-serif;
    font-size: 12px;
    margin-bottom: 5px;
}
a {
    color: dodgerblue;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
.header {
    background: white;
    width: 100%;
    padding: 15px;
    font-family: sans-serif;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}
.title {
    font-size: 18px;
    font-weight: 600;
}
.apikeyinput {
    width: 100%;
    max-width: 400px;
    font-family: monospace;
    border-radius: 3px;
    border: 1px solid gray;
    background: rgba(245,245,245);
    font-size: 14px;
    padding: 5px 8px;
}