:root {
    color-scheme: light;
    --ink: #18392e;
    --muted: #52665a;
    --forest: #163e31;
    --paper: #f6f5ec;
    --rule: #d6ddcc;
    --white: #fffef8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 1rem/1.55 system-ui,sans-serif;
}

.mast {
    background: var(--forest);
    color: #fffef6;
}

.bar,main {
    max-width: 55rem;
    margin: auto;
    padding: 1.15rem clamp(1rem,4vw,2.5rem);
}

.bar,.brand,.actions,.room-head,.tools,.by {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bar,.room-head,.tools {
    justify-content: space-between;
}

.brand,.back {
    color: inherit;
}

.brand {
    gap: .65rem;
    text-decoration: none;
    font: 600 1.5rem Georgia,serif;
}

.brand img {
    background: #ecf0dd;
    border-radius: 50%;
    width: 2.35rem;
    height: 2.35rem;
}

.back {
    font-size: .93rem;
    text-underline-offset: .24em;
}

main {
    padding-top: clamp(1.7rem,5vh,3rem);
    padding-bottom: 3rem;
}

h1,h2 {
    font-family: Georgia,serif;
    line-height: 1.15;
}

h1 {
    font-size: clamp(2.1rem,5vw,3.1rem);
    font-weight: 500;
    margin: 0 0 1.4rem;
}

h2 {
    margin: 0;
    font-size: clamp(1.22rem,2.6vw,1.45rem);
}

.guest,.room {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: .65rem;
}

.guest {
    padding: clamp(1.2rem,4vw,2rem);
}

.guest p {
    margin: .6rem 0 1.3rem;
}

.actions {
    flex-wrap: wrap;
}

.actions a:not(.primary) {
    color: var(--forest);
    text-underline-offset: .22em;
}

.primary {
    display: inline-block;
    border: 0;
    border-radius: .35rem;
    background: var(--forest);
    color: #fff;
    padding: .62rem 1.2rem;
    text-decoration: none;
    font: 600 1rem/1.35 system-ui,sans-serif;
    cursor: pointer;
}

.primary:hover {
    background: #24563f;
}

.primary:disabled {
    opacity: .65;
}

.room-head,.compose {
    padding: 1rem clamp(.8rem,3vw,1.4rem);
}

.room-head {
    border-bottom: 1px solid var(--rule);
}

#connection,small,time {
    color: var(--muted);
    font-size: .85rem;
}

#messages {
    list-style: none;
    margin: 0;
    padding: 0 clamp(.8rem,3vw,1.4rem);
    max-height: min(52vh,32rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

#messages li {
    border-bottom: 1px solid #e7eadf;
    padding: .75rem 0;
}

#messages li:last-child {
    border: 0;
}

.by {
    gap: .7rem;
    flex-wrap: wrap;
}

.by strong {
    font-size: .96rem;
    overflow-wrap: anywhere;
}

.by .hide {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: #505d4c;
    text-decoration: underline;
    cursor: pointer;
}

#messages p {
    margin: .22rem 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#empty {
    padding: .6rem 1.4rem;
    color: var(--muted);
}

.compose {
    border-top: 1px solid var(--rule);
    background: #f5f7ef;
    border-radius: 0 0 .65rem .65rem;
}

.compose label {
    display: block;
    font-weight: 600;
    margin-bottom: .35rem;
}

.compose textarea {
    width: 100%;
    resize: vertical;
    min-height: 4.1rem;
    border: 1px solid #819482;
    border-radius: .3rem;
    background: #fff;
    color: var(--ink);
    font: inherit;
    padding: .55rem;
}

.tools {
    margin-top: .35rem;
}

#feedback:empty {
    display: none;
}

#feedback {
    margin: .5rem 0 0;
    color: #803c25;
}

[hidden] {
    display: none!important;
}

:focus-visible {
    outline: 3px solid #a2762a;
    outline-offset: 3px;
}

@media(max-width:450px) {
    .bar {
        gap: .4rem;
    }

    .brand {
        font-size: 1.15rem;
    }

    .back {
        font-size: .84rem;
    }

    .room-head {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: .3rem;
    }

}
