.chat {
    --c-bg: #1c1f24;
    --c-panel: #2b2e33;
    --c-side: #0d1b26;
    --c-side-row: #11232f;
    --c-line: #3a3f47;
    --c-time: #9a9a9a;
    --c-cyan: #19e6e6;
    --c-orange: #ff7a2e;
    --c-pink: #f08bd9;
    --c-green: #5cff5c;
    --c-blue: #5aa9ff;
    --c-white: #e9e9e9;

    display: flex;
    flex-direction: column;
    background: var(--c-bg);
    color: var(--c-white);
    border: 1px solid #000;
    border-radius: 14px;
    overflow: hidden;
    font: 400 .85rem/1.45 var(--font-b);
    box-shadow: 0 30px 80px -30px #000a;
    transform: rotate(1deg);
}

/* onglets */
.chat-tabs {
    gap: 4px;
    padding: 8px 8px 0;
    background: #14161a;
    overflow-x: auto;
    scrollbar-width: none;
}

.chat-tabs button {
    flex: none;
    min-height: 36px;
    padding: 0 .9rem;
    border: 0;
    border-radius: 10px 10px 0 0;
    background: #1f3a52;
    color: var(--c-white);
    font: 700 .8rem var(--font-b);
    cursor: pointer;
}

.chat-tabs button.on {
    background: #24313f;
    box-shadow: inset 0 -2px 0 #e0a52b;
}

.chat-tabs .green {
    color: var(--c-green);
}

.chat-tabs .yellow {
    color: #ffe14a;
}

.chat-tabs .badge {
    display: inline-block;
    min-width: 20px;
    margin-left: .3rem;
    padding: 0 .35rem;
    border-radius: 6px;
    background: #000;
    color: #fff;
    font-size: .72rem;
}

/* corps : messages + liste */
.chat-body {
    display: grid;
    grid-template-columns: 1fr 128px;
    min-height: 340px;
}

.chat-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 10px;
    gap: 8px;
}

.chat-welcome {
    color: var(--c-cyan);
    font-size: .85rem;
}

.chat-log {
    flex: 1;
    padding: 10px 12px;
    background: var(--c-panel);
    border: 1px solid var(--c-line);
    border-radius: 8px;
    overflow-y: auto;
    max-height: 260px;
    scrollbar-width: thin;
}

.msg {
    display: block;
    margin: 0 0 .35rem;
}

.msg time {
    color: var(--c-time);
    margin-right: .25rem;
}

.msg .nick {
    font-weight: 600;
}

.msg .nick.pink {
    color: var(--c-pink);
}

.msg .nick.orange {
    color: #ffb066;
}

.msg .nick.green {
    color: var(--c-green);
}

.msg .t-cyan {
    color: var(--c-cyan);
}

.msg .t-blue {
    color: var(--c-blue);
}

.msg .t-orange {
    color: var(--c-orange);
    font-weight: 700;
}

.msg .t-green {
    color: var(--c-green);
}

.msg.sys {
    font-size: .75rem;
    font-style: italic;
    color: #bbb;
}

.msg.sys time {
    color: var(--c-green);
    font-style: normal;
}

/* saisie */
.chat-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 2px;
}

.chat-tools .ico {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid #555;
    border-radius: 4px;
    background: #000;
    color: #fff;
    font-size: .8rem;
}

.chat-tools .ico.blue {
    background: #0a0a7a;
}

.chat-input {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.chat-input textarea {
    flex: 1;
    min-height: 64px;
    resize: none;
    padding: .6rem .7rem;
    background: #24272c;
    color: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: 6px;
    font: inherit;
}

.chat-input textarea::placeholder {
    color: #777;
}

.chat-input button {
    align-self: flex-end;
    min-height: 44px;
    padding: 0 1rem;
    border: 1px solid #666;
    border-radius: 8px;
    background: #4a4d52;
    color: #fff;
    font: 600 .85rem var(--font-b);
    cursor: pointer;
}

.chat-input button:hover {
    background: #5a5d63;
}

/* liste des connectés */
.chat-users {
    display: flex;
    flex-direction: column;
    background: var(--c-side);
    border-left: 1px solid #000;
}

.chat-filters {
    display: flex;
    gap: 4px;
    padding: 8px 6px 4px;
}

.chat-filters button {
    flex: 1;
    min-height: 30px;
    border: 0;
    border-radius: 8px;
    background: #1d3b4d;
    color: #fff;
    font: 700 .7rem var(--font-b);
    cursor: pointer;
}

.chat-filters button.on {
    background: #3a6179;
}

.chat-count {
    padding: 2px 10px 6px;
    font-size: .7rem;
    color: #cfd8de;
}

.chat-users ul {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

.chat-users li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-left: 3px solid #2f95d6;
    font-weight: 700;
    font-size: .8rem;
}

.chat-users li:nth-child(odd) {
    background: var(--c-side-row);
}

.chat-users li.f {
    border-left-color: #e0357f;
}

.chat-users .pic {
    position: relative;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #3a4a56;
    display: grid;
    place-items: center;
    font-size: .75rem;
    color: var(--on-lime);
    background: var(--lime);
}

.chat-users .pic::after {
    content: "";
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #35c759;
    border: 2px solid var(--c-side);
}

.chat-users .n1 {
    color: #ff8a8a;
}

.chat-users .n2 {
    color: #ffb066;
}

.chat-users .n3 {
    color: var(--c-green);
}

.chat-users .n4 {
    color: var(--c-blue);
}

@media (max-width: 860px) {
    .chat {
        transform: none;
    }

    .chat-body {
        grid-template-columns: 1fr;
    }

    .chat-users {
        display: none;
    }
}