.rm-messages {
    --rm-msg-border: #dce3ea;
    --rm-msg-ink: #152336;
    --rm-msg-muted: #4c5d70;
    color: var(--rm-msg-ink);
    margin-block: 1.25rem;
}

.rm-msg-unread-total {
    margin-block: 0 1rem;
}

.rm-msg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 1rem;
    align-items: start;
}

.rm-msg-panel {
    box-sizing: border-box;
    min-width: 0;
    padding: clamp(.9rem, 2.6vw, 1.4rem);
    border: 1px solid var(--rm-msg-border);
    border-radius: 12px;
    background: #fff;
    overflow-wrap: anywhere;
}

.rm-msg-panel h2 {
    margin: 0 0 .75rem;
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
}

.rm-msg-list,
.rm-msg-history {
    padding: 0;
    margin: 0;
    list-style: none;
}

.rm-msg-list li + li {
    margin-top: .35rem;
}

.rm-msg-list li a {
    display: grid;
    gap: .2rem;
    padding: .65rem .75rem;
    color: inherit;
    border-radius: 8px;
    text-decoration: none;
}

.rm-msg-list a:hover,
.rm-msg-list a[aria-current="true"] {
    background: #eaf1ff;
}

.rm-messages a:focus-visible,
.rm-messages button:focus-visible,
.rm-messages textarea:focus-visible {
    outline: 2px solid #174da4;
    outline-offset: 3px;
}

.rm-msg-badge {
    justify-self: start;
    padding: .1em .5em;
    border-radius: 5px;
    color: #17396f;
    background: #dce9ff;
    font-size: .85em;
}

.rm-msg-badge[hidden],
.rm-messages form[hidden] {
    display: none;
}

.rm-msg-thread-heading p,
.rm-msg-meta,
.rm-msg-compose small {
    color: var(--rm-msg-muted);
}

.rm-msg-pages,
.rm-msg-history-nav,
.rm-msg-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35rem .9rem;
}

.rm-msg-pages,
.rm-msg-history-nav:not(:empty) {
    margin-block: .75rem;
}

.rm-msg-history {
    display: grid;
    gap: .65rem;
    margin-block: 1rem;
}

.rm-msg-entry {
    justify-self: start;
    box-sizing: border-box;
    min-width: 0;
    max-width: 94%;
    border-radius: 10px;
    background: #f1f4f8;
    padding: .7rem .9rem;
}

.rm-msg-outgoing {
    justify-self: end;
    background: #eaf1ff;
}

.rm-msg-meta {
    margin-bottom: .25rem;
    font-size: .85em;
}

.rm-msg-text {
    white-space: pre-wrap;
}

.rm-msg-notice {
    padding: .65rem .8rem;
    background: #f1f4f8;
    border-radius: 8px;
}

.rm-msg-compose {
    display: grid;
    gap: .5rem;
    padding-top: 1rem;
}

.rm-msg-compose textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 7rem;
    margin-top: .45rem;
    padding: .65rem;
    border: 1px solid #79889a;
    border-radius: 8px;
    color: var(--rm-msg-ink);
    background: #fff;
    font: inherit;
    resize: vertical;
}

.rm-msg-compose button {
    justify-self: start;
}

@media (max-width: 700px) {
    .rm-msg-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}
