/* Shade inside the floating assistant's panel (Components/Layout/ShadePane.razor): the channel or direct message the person
   was last in, the list of servers and direct messages behind it, and the call they are in. The eclipse, its badge, the
   bubble and the panel itself are the assistant's (assistant.css); this is only what goes inside, in Shade's blue rather
   than the assistant's violet so the two tabs are told apart at a glance. */

.rl-shade {
    --shade-tint: #5865f2;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.rl-shade__head {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .6rem .6rem .55rem .9rem;
    border-bottom: 1px solid var(--rl-border);
    background: linear-gradient(120deg, color-mix(in srgb, var(--shade-tint) 16%, transparent), transparent 70%);
}
.rl-shade__title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rl-shade__title strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .95rem; }
.rl-shade__title small { color: var(--rl-text-muted); font-size: .75rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.rl-shade__icon {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--rl-text-muted);
    cursor: pointer;
}
.rl-shade__icon svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.rl-shade__icon:hover { background: var(--rl-surface-sunken); color: var(--rl-text); }
.rl-shade__icon--back { margin-left: -.45rem; }
.rl-shade__icon--back svg { transform: rotate(180deg); }

/* ── the call, when there is one ─────────────────────────────────────────────────────────────────────────────── */
.rl-shade__call {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .6rem .4rem .9rem;
    border-bottom: 1px solid var(--rl-border);
    background: color-mix(in srgb, #22c55e 9%, transparent);
}
.rl-shade__pulse { flex: none; width: .55rem; height: .55rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .22); }
.rl-shade__callName { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.rl-shade__callName strong { font-size: .84rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rl-shade__callName small { font-size: .72rem; color: var(--rl-text-muted); }
.rl-shade__callBtn {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 1px solid var(--rl-border);
    border-radius: 50%;
    background: var(--rl-surface);
    color: var(--rl-text);
    cursor: pointer;
}
.rl-shade__callBtn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.rl-shade__callBtn:hover { background: var(--rl-surface-sunken); }
.rl-shade__callBtn.is-off { color: var(--rl-danger); border-color: color-mix(in srgb, var(--rl-danger) 55%, transparent); }
.rl-shade__callBtn--leave { background: var(--rl-danger); border-color: transparent; color: #fff; }
.rl-shade__callBtn--leave:hover { background: color-mix(in srgb, var(--rl-danger) 85%, #000); }

/* ── the lists: direct messages, servers, a server's channels ────────────────────────────────────────────────── */
.rl-shade__list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: .45rem .45rem .6rem;
    overscroll-behavior: contain;
}
.rl-shade__label {
    margin: .55rem .5rem .2rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--rl-text-muted);
}
.rl-shade__row {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .38rem .5rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--rl-text);
    font: inherit;
    font-size: .9rem;
    text-align: left;
    cursor: pointer;
}
.rl-shade__row:hover, .rl-shade__row:focus-visible { background: color-mix(in srgb, var(--shade-tint) 13%, transparent); outline: none; }
.rl-shade__row--channel { color: var(--rl-text-muted); padding-left: .65rem; }
.rl-shade__row--channel.is-unread { color: var(--rl-text); font-weight: 600; }
.rl-shade__rowName { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rl-shade__hash { flex: none; width: 1.1rem; text-align: center; opacity: .7; }
.rl-shade__go { flex: none; width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: .45; }

.rl-shade__av {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    overflow: hidden;
}
.rl-shade__av img, .rl-shade__av video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rl-shade__av--server { border-radius: 10px; }

.rl-shade__count {
    flex: none;
    min-width: 1.25rem;
    padding: 0 .35rem;
    border-radius: 999px;
    background: var(--shade-tint);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
}
.rl-shade__count--mention { background: #ef4444; }

.rl-shade__hint { color: var(--rl-text-muted); font-size: .85rem; margin: auto 0; text-align: center; padding: 0 1rem; }
.rl-shade__hint--foot { margin: 0; flex: 1; padding: .2rem 0; }
.rl-shade__note { margin: .3rem .5rem 0; font-size: .8rem; color: var(--rl-danger); }

/* ── a conversation ──────────────────────────────────────────────────────────────────────────────────────────── */
.rl-shade__log {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: .5rem .7rem .4rem;
    overscroll-behavior: contain;
}
.rl-shade__msg {
    position: relative;
    padding: .1rem 0 .1rem 2.5rem;
    margin-top: .55rem;
    font-size: .88rem;
    line-height: 1.42;
    overflow-wrap: anywhere;
}
.rl-shade__msg--follows { margin-top: 0; }
.rl-shade__av--msg { position: absolute; left: 0; top: .2rem; }
.rl-shade__who { display: flex; align-items: baseline; gap: .45rem; }
.rl-shade__who strong { font-size: .86rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rl-shade__msg--mine .rl-shade__who strong { color: var(--shade-tint); }
.rl-shade__who time { flex: none; font-size: .68rem; color: var(--rl-text-muted); }
.rl-shade__reply { font-size: .76rem; color: var(--rl-text-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rl-shade__body { white-space: pre-wrap; }
.rl-shade__body pre { font-size: .76rem; max-height: 10rem; overflow: auto; white-space: pre; }
.rl-shade__files { display: flex; flex-wrap: wrap; gap: .35rem; margin: .25rem 0; }
.rl-shade__files img { display: block; max-width: 100%; max-height: 9rem; border-radius: 8px; border: 1px solid var(--rl-border); }
.rl-shade__file { font-size: .8rem; }
.rl-shade__extra { display: inline-block; margin-top: .15rem; font-size: .78rem; color: var(--rl-text-muted); }
.rl-shade__reacts { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.rl-shade__reacts span {
    padding: 0 .4rem;
    border: 1px solid var(--rl-border);
    border-radius: 999px;
    background: var(--rl-surface-raised);
    font-size: .74rem;
    line-height: 1.35rem;
}

.rl-shade__compose {
    display: flex;
    align-items: flex-end;
    gap: .35rem;
    padding: .55rem .6rem .6rem;
    border-top: 1px solid var(--rl-border);
}
.rl-shade__compose textarea {
    flex: 1;
    min-height: 2.25rem;
    max-height: 7rem;
    resize: none;
    padding: .45rem .6rem;
    border: 1px solid var(--rl-border);
    border-radius: 12px;
    background: var(--rl-surface);
    color: var(--rl-text);
    font: inherit;
    font-size: .88rem;
    field-sizing: content;
}
.rl-shade__compose textarea:focus { outline: none; border-color: var(--shade-tint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--shade-tint) 20%, transparent); }
.rl-shade__send {
    flex: none;
    height: 2.25rem;
    padding: 0 .85rem;
    border: 0;
    border-radius: 12px;
    background: var(--shade-tint);
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
}
.rl-shade__send:hover { background: color-mix(in srgb, var(--shade-tint) 88%, #000); }

@media (prefers-reduced-motion: reduce) {
    .rl-shade__row, .rl-shade__icon, .rl-shade__callBtn { transition: none; }
}
