html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: grid;
    grid-template-columns: auto min-content;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-row-gap: 1em;
    font-family: 'Roboto', sans-serif;
}

@media (prefers-color-scheme: dark) {
    * {
        background: black;
        color: white;
    }
}

body:not(.signed-in) {
    opacity: 0.5;
}

body:not(.signed-in) * {
    pointer-events: none;
}

.messages {
    overflow-y: auto;
}

.message {
    text-indent: 1em;
    text-indent: -1em;
    padding-left: 1em;
}

.text {
    white-space: pre-wrap;
    font-family: 'Roboto Mono', monospace;
}

.message img {
    max-width: 100vw;
    max-height: 50vh;
}

.new-message {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-column-gap: 1em;
}

.placeholder {
    opacity: 0.5;
}

.new-message .name {
    /* make a span look like a text input */
    display: inline-block;
    padding: 0.5em;
    border: 1px solid black;
    border-radius: 0.25em;
}

.new-message .text {
    /* make a span look like a textarea */
    display: inline-block;
    padding: 0.5em;
    border: 1px solid black;
    border-radius: 0.25em;
    resize: vertical;
    min-height: 3.6em;
    line-height: 1.2em;
}

@media (prefers-color-scheme: dark) {
    .new-message .name {
        border-color: white;
    }

    .new-message .text {
        border-color: white;
    }
}

textarea {
    width: 100%;
    resize: vertical;
}
