/* ---------- Global tooltips ---------- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 9px);
    transform: translate(-50%, -2px);
    padding: 6px 9px;
    border-radius: 7px;
    background: #07080d;
    border: 1px solid var(--line-strong);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .38);
    color: var(--text-soft);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .14s ease, transform .14s ease, visibility .14s;
    z-index: 200;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.server-rail [data-tooltip]::after {
    left: calc(100% + 12px);
    top: 50%;
    transform: translate(-3px, -50%);
}

.server-rail [data-tooltip]:hover::after {
    transform: translate(0, -50%);
}

.server-rail [data-tooltip]::before {
    content: "";
    position: absolute;
    left: calc(100% + 7px);
    top: 50%;
    width: 6px;
    height: 6px;
    background: #07080d;
    border-left: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
    transform: translateY(-50%) rotate(45deg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .14s ease, visibility .14s;
    z-index: 201;
}

.server-rail [data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* The user bar sits at the bottom of the viewport, so its tooltips need to
   open upward rather than getting clipped below the window. */
.user-bar-actions [data-tooltip]::after {
    top: auto;
    bottom: calc(100% + 9px);
    transform: translate(-50%, 2px);
}

.user-bar-actions [data-tooltip]:hover::after {
    transform: translate(-50%, 0);
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg-deep);
}

.server-rail {
    width: 76px;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 12px 0 13px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 18%),
        var(--bg-rail);
    border-right: 1px solid rgba(255, 255, 255, .045);
    z-index: 30;
}

.rail-button {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: #1b1d29;
    border: 1px solid rgba(255, 255, 255, .055);
    transition: border-radius var(--transition), background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
}

.rail-button:hover {
    border-radius: 14px;
    background: #252838;
    color: var(--text);
    border-color: rgba(255, 255, 255, .1);
}

.rail-button.is-active {
    border-radius: 14px;
}

.rail-active-indicator {
    position: absolute;
    left: -14px;
    top: 50%;
    display: none;
    width: 4px;
    height: 31px;
    transform: translateY(-50%);
    border-radius: 0 4px 4px 0;
    background: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, .16);
    pointer-events: none;
}

.rail-button.is-active > .rail-active-indicator {
    display: block;
}

.rail-home {
    background: linear-gradient(145deg, #957aff, #6747e4);
    border: 0;
    box-shadow: 0 9px 24px rgba(106, 76, 231, .26), inset 0 1px 0 rgba(255, 255, 255, .2);
    color: #fff;
}

.rail-home:hover {
    background: linear-gradient(145deg, #a48cff, #7252ee);
    transform: translateY(-1px);
}

.rail-home.is-active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .14), 0 11px 30px rgba(106, 76, 231, .4), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.rail-home.is-active > .rail-active-indicator {
    height: 35px;
}

.rail-home-mark {
    width: 31px;
    height: 31px;
}

.rail-home-mark svg {
    width: 100%;
    height: 100%;
}

.rail-divider {
    width: 32px;
    height: 1px;
    background: rgba(255, 255, 255, .075);
    margin: 2px 0;
    flex: none;
}

.rail-servers {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 0;
    scrollbar-width: none;
}

.rail-servers::-webkit-scrollbar {
    display: none;
}

.rail-spacer {
    flex: 1;
    min-height: 8px;
}

.rail-server {
    overflow: visible;
}

.rail-server .rail-unread {
    position: absolute;
    left: -14px;
    top: 50%;
    width: 8px;
    height: 8px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: #fff;
    transition: width var(--transition), height var(--transition), border-radius var(--transition);
}

.rail-server:hover .rail-unread {
    width: 4px;
    height: 18px;
    border-radius: 0 4px 4px 0;
}

.rail-server.is-active .rail-unread {
    display: none;
}

.rail-server.is-active > .rail-active-indicator {
    height: 100%;
}

.server-icon {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .15), rgba(0, 0, 0, .1)),
        var(--server-color, #7C5CFF);
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .015em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.server-icon-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rail-add {
    border-style: dashed;
    border-color: rgba(255, 255, 255, .14);
    background: transparent;
    color: var(--mint);
    border-radius: 50%;
}

.rail-add:hover {
    border-style: solid;
    border-color: rgba(77, 212, 192, .4);
    background: rgba(77, 212, 192, .1);
    border-radius: 15px;
    color: #8beadd;
}

.rail-add .icon {
    width: 21px;
    height: 21px;
}

.rail-user-button {
    width: 39px;
    height: 39px;
    border-radius: 50%;
    flex: none;
    display: grid;
    place-items: center;
    transition: transform var(--transition), box-shadow var(--transition);
    margin-top: 2px;
}

.rail-user-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .3);
}

.rail-user-button .avatar {
    width: 36px;
    height: 36px;
    border: 2px solid #0d0e15;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .09);
}

.workspace {
    flex: 1;
    min-width: 0;
    display: flex;
    position: relative;
    height: 100dvh;
    overflow: hidden;
}

.mobile-scrim {
    display: none;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 280px;
    min-width: 0;
    flex: none;
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, .045);
    z-index: 20;
    height: 100%;
}

.sidebar-header {
    height: 64px;
    flex: none;
    display: flex;
    align-items: center;
    padding: 0 14px 0 18px;
    border-bottom: 1px solid rgba(0, 0, 0, .18);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .025);
}

.server-menu-button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    height: 40px;
    padding: 0 8px 0 0;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
}

.server-menu-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-menu-button .icon {
    width: 15px;
    height: 15px;
    color: var(--muted);
    transition: transform var(--transition), color var(--transition);
}

.server-menu-button:hover .icon {
    color: var(--text);
}

.server-menu-button[aria-expanded="true"] .icon {
    transform: rotate(180deg);
}

.sidebar-close {
    display: none;
    margin-left: auto;
}

.sidebar-scroll {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-x: none;
    padding: 18px 10px 12px;
}

.channel-section-head {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 5px 7px 8px;
}

.channel-section-label {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    color: var(--dim);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 4px 0;
}

.channel-section-label:hover {
    color: var(--muted);
}

.section-chevron {
    width: 11px;
    height: 11px;
    transition: transform var(--transition);
}

.channel-section.is-collapsed .section-chevron {
    transform: rotate(-90deg);
}

.channel-section.is-collapsed .channel-list {
    display: none;
}

.channel-section .icon-button {
    opacity: 0;
}

.channel-section:hover .icon-button,
.channel-section:focus-within .icon-button {
    opacity: 1;
}

.channel-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    max-width: 100%;
}

.channel-item {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 37px;
    border-radius: 8px;
    color: #87899d;
    font-size: 13.5px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

.channel-item-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 9px;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.channel-item.has-settings .channel-item-main {
    padding-right: 31px;
}

.channel-item-main:focus-visible {
    outline: 2px solid rgba(139, 109, 255, .4);
    outline-offset: -2px;
}

.channel-settings-button {
    position: absolute;
    right: 5px;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border-radius: 6px;
    color: #85879a;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    transition: opacity var(--transition), background var(--transition), color var(--transition);
}

.channel-settings-button .icon {
    width: 13px;
    height: 13px;
}

.channel-item:hover .channel-settings-button,
.channel-item:focus-within .channel-settings-button,
.channel-item.is-active .channel-settings-button {
    opacity: 1;
    pointer-events: auto;
}

.channel-settings-button:hover {
    background: rgba(255, 255, 255, .08);
    color: #f0edf8;
}

.channel-settings-button:focus-visible {
    outline: 2px solid rgba(139, 109, 255, .45);
    outline-offset: 1px;
}

.channel-item .channel-hash {
    width: 17px;
    height: 17px;
    color: #66687b;
    flex: none;
    transition: color var(--transition);
}

.channel-item:hover {
    color: #c9c6d7;
    background: rgba(255, 255, 255, .035);
}

.channel-item:hover .channel-hash {
    color: #8b8da1;
}

.channel-item.has-unread {
    color: var(--text-soft);
    font-weight: 620;
}

.channel-item.has-unread .channel-hash {
    color: #b6b1c8;
}

.channel-item.has-mention .channel-name {
    color: #ffd7dc;
}

.channel-item.has-mention .channel-hash {
    color: #ffb2bd;
}

.channel-item.is-active {
    color: #fff;
    background: rgba(139, 109, 255, .13);
    font-weight: 600;
}

.channel-item.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 18px;
    border-radius: 0 3px 3px 0;
    transform: translateY(-50%);
    background: var(--accent);
}

.channel-item.is-active .channel-hash {
    color: #bfb1ff;
}

.channel-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-unread {
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-strong);
    color: #fff;
    font-size: 9px;
    font-weight: 750;
    line-height: 1;
}

.channel-item.is-active .channel-unread {
    background: rgba(255, 255, 255, .14);
}

.channel-unread.is-mention {
    background: #ff647c;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 100, 124, .16);
}

.sidebar-invite-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 4px);
    margin: 22px 2px 0;
    padding: 13px 12px;
    border-radius: 13px;
    text-align: left;
    background: linear-gradient(135deg, rgba(139, 109, 255, .12), rgba(77, 212, 192, .055));
    border: 1px solid rgba(139, 109, 255, .17);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition), background var(--transition);
}

.sidebar-invite-card:hover {
    border-color: rgba(139, 109, 255, .34);
    background: linear-gradient(135deg, rgba(139, 109, 255, .17), rgba(77, 212, 192, .07));
    transform: translateY(-1px);
}

.invite-card-glow {
    position: absolute;
    width: 80px;
    height: 80px;
    right: -30px;
    top: -35px;
    border-radius: 50%;
    background: rgba(139, 109, 255, .18);
    filter: blur(17px);
    pointer-events: none;
}

.invite-card-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgba(139, 109, 255, .16);
    color: #cbbdff;
    flex: none;
}

.invite-card-icon .icon {
    width: 16px;
    height: 16px;
}

.invite-card-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.invite-card-copy strong {
    color: #e0dbef;
    font-size: 11.5px;
    font-weight: 650;
}

.invite-card-copy small {
    color: #828497;
    font-size: 9.5px;
    line-height: 1.35;
}

.invite-card-arrow {
    width: 14px;
    height: 14px;
    margin-left: auto;
    color: #74768a;
    flex: none;
}

.sidebar-note {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    max-width: 100%;
    padding: 16px 10px 4px;
    color: #535566;
    font-size: 9px;
    line-height: 1.4;
}

.sidebar-note .status-dot {
    width: 5px;
    height: 5px;
    box-shadow: 0 0 6px rgba(91, 214, 162, .35);
}

.user-bar {
    height: 64px;
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    background: #101119;
    border-top: 1px solid rgba(0, 0, 0, .24);
}

.user-bar-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex: none;
}

.user-bar .presence-dot {
    border-color: #101119;
}

.user-bar-profile {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
    padding: 5px;
    margin-left: -5px;
    border-radius: 8px;
    text-align: left;
    transition: background var(--transition);
}

.user-bar-profile:hover {
    background: rgba(255, 255, 255, .045);
}

.user-bar-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.user-bar-copy strong {
    font-size: 12px;
    font-weight: 650;
    color: #e8e5f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-bar-copy small {
    font-size: 9.5px;
    color: #6e7084;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-bar-actions {
    display: flex;
    gap: 1px;
}

.user-bar .icon-button {
    color: #77798d;
}

/* ---------- Main / shared headers ---------- */
.main-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    height: 100%;
    background: var(--bg-chat);
}

.home-view,
.chat-view {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.home-header,
.chat-header {
    height: 64px;
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 0 24px;
    background: rgba(25, 27, 37, .86);
    border-bottom: 1px solid rgba(0, 0, 0, .22);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .025);
    backdrop-filter: blur(18px);
    position: relative;
    z-index: 10;
}

.home-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.home-header-mark {
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: linear-gradient(145deg, #9275ff, #6747e4);
    display: grid;
    place-items: center;
}

.home-header-mark svg {
    width: 18px;
    height: 18px;
}

.home-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 7px;
}

.avatar-button {
    border-radius: 50%;
    transition: transform var(--transition);
}

.avatar-button:hover {
    transform: scale(1.04);
}

.avatar-button .avatar {
    width: 33px;
    height: 33px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .06);
}

.chat-header-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
}

.header-hash {
    display: grid;
    place-items: center;
    color: #74768b;
}

.header-hash .icon {
    width: 20px;
    height: 20px;
}

.chat-header-title h2 {
    font-size: 15px;
    font-weight: 690;
    letter-spacing: -.015em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-topic {
    margin-left: 7px;
    padding-left: 14px;
    border-left: 1px solid var(--line-strong);
    font-size: 11.5px;
    color: #838598;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 42vw;
}

.chat-header-topic:empty {
    display: none;
}

.chat-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 3px;
}

.chat-header-actions .icon-button {
    color: #8a8c9f;
}

.chat-header-actions .icon-button.is-active {
    color: #cfc4ff;
    background: rgba(139, 109, 255, .13);
}

/* ---------- Home ---------- */
.home-view {
    background:
        radial-gradient(circle at 80% 4%, rgba(119, 84, 236, .08), transparent 34%),
        radial-gradient(circle at 4% 45%, rgba(77, 212, 192, .035), transparent 30%),
        var(--bg-chat);
    overflow: hidden;
}

.home-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 38px 42px 44px;
}

.home-hero,
.home-section,
.home-values,
.home-footer {
    width: min(1120px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.home-hero {
    position: relative;
    min-height: 432px;
    display: grid;
    grid-template-columns: 1.02fr .98fr;
    gap: 28px;
    align-items: center;
    padding: 46px 48px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
    background:
        radial-gradient(circle at 78% 22%, rgba(139, 109, 255, .19), transparent 35%),
        radial-gradient(circle at 15% 100%, rgba(77, 212, 192, .07), transparent 38%),
        linear-gradient(132deg, #202232 0%, #1a1c29 52%, #171925 100%);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .055);
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at 74% 28%, black, transparent 64%);
    pointer-events: none;
}

.home-hero::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    right: 5%;
    top: 10%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .035);
    box-shadow: 0 0 0 60px rgba(255, 255, 255, .016), 0 0 0 130px rgba(255, 255, 255, .009);
    pointer-events: none;
}

.home-hero-copy {
    position: relative;
    z-index: 2;
}

.home-hero-copy h1 {
    margin-top: 16px;
    font-size: clamp(34px, 3.7vw, 49px);
    line-height: 1.02;
    letter-spacing: -.055em;
    font-weight: 670;
}

.home-hero-copy h1 em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -.035em;
    color: #d3c7ff;
}

.home-hero-copy > p {
    margin-top: 16px;
    max-width: 435px;
    color: #b0adbf;
    font-size: 14px;
    line-height: 1.62;
}

.home-cta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 24px;
}

.home-proof {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 23px;
    color: #7f8194;
    font-size: 10.5px;
}

.home-proof .avatar-stack > span {
    border-color: #1c1e2b;
}

.home-hero-art {
    position: relative;
    z-index: 2;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.hero-orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .045);
    pointer-events: none;
}

.hero-orbit--one {
    width: 330px;
    height: 330px;
}

.hero-orbit--two {
    width: 430px;
    height: 430px;
    border-style: dashed;
    opacity: .65;
    animation: slowSpin 90s linear infinite;
}

.hero-chat-card {
    position: relative;
    width: min(360px, 100%);
    padding: 15px 16px 13px;
    border-radius: 19px;
    background: rgba(27, 29, 43, .84);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 34px 70px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .06);
    backdrop-filter: blur(20px);
    transform: rotate(-1.5deg) rotateY(-3deg);
}

.hero-chat-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.hero-chat-head > div:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.hero-chat-head strong {
    font-size: 11.5px;
}

.hero-chat-head small {
    font-size: 8.5px;
    color: var(--dim);
}

.live-pill {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border-radius: 99px;
    background: rgba(91, 214, 162, .08);
    border: 1px solid rgba(91, 214, 162, .14);
    color: #83dfba;
    font-size: 8px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.live-pill span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px rgba(91, 214, 162, .6);
}

.hero-message {
    display: flex;
    gap: 9px;
    padding-top: 12px;
}

.hero-message strong {
    font-size: 10px;
    margin-right: 2px;
}

.hero-message p {
    margin-top: 2px;
    color: #cbc7d7;
    font-size: 10.5px;
    line-height: 1.45;
}

.hero-reaction-row {
    display: flex;
    gap: 4px;
    margin-top: 5px;
}

.hero-reaction-row span {
    display: inline-flex;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(139, 109, 255, .11);
    border: 1px solid rgba(139, 109, 255, .17);
    font-size: 8px;
    color: #d0c6f4;
}

.hero-typing {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 9px 0 0 38px;
    color: #76788b;
    font-size: 8.5px;
}

.typing-dots {
    display: inline-flex;
    gap: 2px;
}

.typing-dots i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #8d8fa2;
    animation: typingBounce 1.2s infinite;
}

.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }

.hero-composer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    height: 36px;
    padding: 0 6px 0 12px;
    border-radius: 9px;
    background: rgba(8, 9, 14, .38);
    border: 1px solid rgba(255, 255, 255, .06);
    color: #606274;
    font-size: 9.5px;
}

.floating-note {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 11px;
    background: rgba(30, 32, 47, .93);
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .28);
    backdrop-filter: blur(14px);
    white-space: nowrap;
    animation: floatNote 5s ease-in-out infinite;
}

.floating-note--top {
    top: -38px;
    right: 14px;
    z-index: 3;
}

.floating-note--top .icon {
    width: 16px;
    height: 16px;
    color: var(--gold);
}

.floating-note--top > div {
    display: flex;
    flex-direction: column;
}

.floating-note strong {
    font-size: 9.5px;
}

.floating-note span {
    font-size: 8px;
    color: var(--dim);
}

.floating-note--bottom {
    bottom: -38px;
    left: 14px;
    animation-delay: -2.4s;
    color: #a7a4b6;
    font-size: 9px;
    z-index: 3;
}

.floating-note--bottom strong {
    font-size: 9px;
    color: var(--text-soft);
    margin-right: 2px;
}

.home-section {
    margin-top: 38px;
}

.section-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 15px;
}

.section-title-row h2 {
    margin-top: 5px;
    font-size: 22px;
    letter-spacing: -.035em;
    font-weight: 660;
}

.section-title-row .text-button {
    padding-bottom: 3px;
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
    gap: 12px;
}

.server-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 158px;
    padding: 17px 17px 15px;
    border-radius: 17px;
    text-align: left;
    background: rgba(31, 33, 46, .72);
    border: 1px solid rgba(255, 255, 255, .065);
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.server-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, .12);
    background: #222432;
    box-shadow: 0 17px 38px rgba(0, 0, 0, .2);
}

.server-card::before {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    right: -60px;
    top: -70px;
    border-radius: 50%;
    background: var(--card-color, #7C5CFF);
    opacity: .11;
    filter: blur(26px);
    pointer-events: none;
}

.server-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.server-card-icon {
    position: relative;
    width: 43px;
    height: 43px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .15), rgba(0, 0, 0, .12)),
        var(--card-color, #7C5CFF);
    color: #fff;
    font-size: 11px;
    font-weight: 760;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .11);
}

.server-card-icon-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-card-arrow {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 8px;
    color: #6b6d80;
    background: rgba(255, 255, 255, .035);
    transition: transform var(--transition), color var(--transition), background var(--transition);
}

.server-card-arrow .icon {
    width: 14px;
    height: 14px;
}

.server-card:hover .server-card-arrow {
    color: #c8c3d8;
    background: rgba(255, 255, 255, .075);
    transform: translateX(2px);
}

.server-card-body {
    margin-top: 15px;
}

.server-card-body strong {
    display: block;
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: #77798c;
    font-size: 10px;
}

.server-card-meta .meta-sep {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #555767;
}

.server-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.server-card-footer--unread {
    justify-content: flex-end;
}

.server-card-unread {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border-radius: 99px;
    background: rgba(139, 109, 255, .12);
    border: 1px solid rgba(139, 109, 255, .17);
    color: #bcaaff;
    font-size: 8.5px;
    font-weight: 650;
}

.server-card-unread .status-dot {
    width: 4px;
    height: 4px;
    background: #a68bff;
    box-shadow: none;
}

.server-card--add {
    align-items: center;
    justify-content: center;
    text-align: center;
    border-style: dashed;
    border-color: rgba(255, 255, 255, .11);
    background: rgba(255, 255, 255, .014);
    min-height: 158px;
    color: #77798b;
}

.server-card--add::before {
    display: none;
}

.server-card--add:hover {
    color: #bdb4db;
    border-color: rgba(139, 109, 255, .28);
    background: rgba(139, 109, 255, .035);
}

.add-server-icon {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(255, 255, 255, .16);
    color: #8f91a5;
    margin-bottom: 9px;
}

.add-server-icon .icon {
    width: 17px;
    height: 17px;
}

.server-card--add strong {
    color: inherit;
    font-size: 12.5px;
    font-weight: 620;
}

.server-card--add span {
    font-size: 9.5px;
    color: #606274;
    margin-top: 3px;
}

.server-empty {
    grid-column: 1 / -1;
    padding: 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .018);
    border: 1px dashed rgba(255, 255, 255, .09);
    color: #8c8e9f;
    font-size: 12px;
    text-align: center;
}

.home-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 34px;
}

.value-card {
    padding: 20px 20px 21px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .018);
    border: 1px solid rgba(255, 255, 255, .045);
}

.value-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(139, 109, 255, .1);
    color: #b7a6ff;
}

.value-icon--peach {
    background: rgba(255, 176, 102, .09);
    color: #ffc18a;
}

.value-icon--mint {
    background: rgba(77, 212, 192, .08);
    color: #7de2d4;
}

.value-icon .icon {
    width: 17px;
    height: 17px;
}

.value-card h3 {
    margin-top: 13px;
    font-size: 13px;
    font-weight: 650;
}

.value-card p {
    margin-top: 6px;
    color: #818396;
    font-size: 10.5px;
    line-height: 1.58;
}

.home-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 35px 0 6px;
    color: #4e5061;
    font-size: 9.5px;
}

.home-footer-mark {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .05);
}

.home-footer-mark svg {
    width: 12px;
    height: 12px;
}

/* ---------- Chat ---------- */
.chat-view {
    background: var(--bg-chat);
}

.chat-body {
    flex: 1;
    min-height: 0;
    display: flex;
    position: relative;
}

.chat-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    background:
        radial-gradient(circle at 50% -20%, rgba(139, 109, 255, .035), transparent 36%),
        var(--bg-chat);
}

.connection-banner {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: 99px;
    background: rgba(17, 18, 27, .92);
    border: 1px solid rgba(255, 176, 102, .18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .32);
    color: #d5b68e;
    font-size: 10.5px;
    backdrop-filter: blur(14px);
}

.connection-spinner {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 176, 102, .22);
    border-top-color: var(--peach);
    animation: spin .8s linear infinite;
}

.message-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 0 12px;
    scrollbar-gutter: stable;
}

.channel-hero {
    padding: 44px 32px 22px;
    max-width: 900px;
}

.channel-hero-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 19px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)),
        rgba(139, 109, 255, .1);
    border: 1px solid rgba(255, 255, 255, .09);
    color: #b8a8fb;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
}

.channel-hero-icon .icon {
    width: 29px;
    height: 29px;
}

.channel-hero h1 {
    margin-top: 17px;
    font-size: clamp(24px, 2.8vw, 32px);
    letter-spacing: -.045em;
    font-weight: 670;
    line-height: 1.15;
}

.channel-hero h1 span {
    color: #fff;
}

.channel-hero p {
    margin-top: 7px;
    color: #8c8ea1;
    font-size: 13px;
    line-height: 1.5;
    max-width: 640px;
}

.welcome-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 5px 10px;
    border-radius: 99px;
    background: rgba(77, 212, 192, .055);
    border: 1px solid rgba(77, 212, 192, .12);
    color: #7fbcb2;
    font-size: 9px;
    font-weight: 600;
}

.welcome-pill .icon {
    width: 12px;
    height: 12px;
}

.load-earlier {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 auto 14px;
    padding: 7px 13px;
    border-radius: 99px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, .025);
    color: #9a9caf;
    font-size: 10.5px;
    font-weight: 600;
    transition: background var(--transition), color var(--transition);
}

.load-earlier:hover {
    background: rgba(255, 255, 255, .055);
    color: var(--text-soft);
}

.load-earlier .icon {
    width: 13px;
    height: 13px;
    transform: rotate(90deg);
}

.message-list {
    padding: 0 12px;
}

.message {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 5px 14px 5px 6px;
    border-radius: 10px;
    transition: background .12s ease;
}

.message:hover {
    background: rgba(255, 255, 255, .018);
}

.message.is-mentioned {
    background: rgba(255, 184, 77, .045);
    box-shadow: inset 2px 0 0 rgba(255, 184, 77, .65);
}

.message.is-mentioned:hover {
    background: rgba(255, 184, 77, .075);
}

.message.is-grouped {
    padding-top: 1px;
    padding-bottom: 1px;
}

.message-avatar-slot {
    display: flex;
    justify-content: center;
    padding-top: 2px;
    position: relative;
}

.message-avatar-slot .avatar {
    width: 40px;
    height: 40px;
    font-size: 11px;
    border-radius: 50%;
    margin-top: 1px;
}

.message.is-grouped .message-avatar-slot .avatar {
    display: none;
}

.message-hover-time {
    display: none;
    color: #5c5e70;
    font-size: 8.5px;
    line-height: 1.3;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.message.is-grouped:hover .message-hover-time {
    display: block;
}

.message-body {
    min-width: 0;
    padding-bottom: 2px;
}

.message.is-grouped .message-body {
    padding-bottom: 1px;
}

.message-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 21px;
    padding-top: 1px;
}

.message-author {
    font-size: 13.5px;
    font-weight: 680;
    letter-spacing: -.012em;
    color: #ebe8f2;
}

.message-author.is-dev {
    color: #ffd479;
}

.message-time {
    color: #606274;
    font-size: 9.5px;
    font-variant-numeric: tabular-nums;
}

.message-edited {
    color: #535566;
    font-size: 8.5px;
}

.message-pin-flag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #b7a6ff;
    font-size: 8.5px;
    font-weight: 650;
    line-height: 1;
}

.message-pin-flag .icon {
    width: 10px;
    height: 10px;
}

.message-pin-flag--compact {
    margin: 0 0 2px 1px;
}

.message-toolbar button.is-pinned {
    color: #bfb1ff;
}

.timeout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 15px;
    height: 15px;
    color: #f0b85a;
    vertical-align: -2px;
}

.timeout-icon .icon {
    width: 12px;
    height: 12px;
}

.timeout-icon--compact {
    margin: 0 0 2px 1px;
}

.message-content {
    color: #cfccd9;
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-width: 980px;
}

.message-content a {
    color: #a997ff;
    text-decoration: underline;
    text-decoration-color: rgba(169, 151, 255, .28);
    text-underline-offset: 2px;
}

.message-content a:hover {
    text-decoration-color: currentColor;
}

.message-mention {
    display: inline;
    padding: 1px 3px;
    margin: 0 1px;
    border-radius: 4px;
    background: rgba(139, 109, 255, .15);
    color: #c6b6ff;
    font-weight: 550;
    cursor: pointer;
}

.message-mention:hover {
    background: rgba(139, 109, 255, .26);
}

.message-mention:focus-visible {
    outline: 2px solid rgba(255, 184, 77, .55);
    outline-offset: 1px;
}

.message-mention.is-self {
    background: rgba(255, 184, 77, .2);
    color: #ffd39a;
    box-shadow: inset 0 0 0 1px rgba(255, 184, 77, .18);
}

.message-mention.is-self:hover {
    background: rgba(255, 184, 77, .3);
}

.reaction-chip:disabled {
    cursor: default;
    opacity: .72;
}

.message-channel-link {
    color: #9b8cf5;
    background: rgba(139, 109, 255, .09);
    border-radius: 4px;
    padding: 1px 3px;
}

.message-reply-ref {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 700px;
    margin: 1px 0 2px;
    padding: 0;
    color: #888a9c;
    font-size: 10px;
    text-align: left;
    line-height: 1.4;
}

.message-reply-ref:hover {
    color: #b4b1c2;
}

.reply-spine {
    width: 18px;
    height: 13px;
    border-left: 1px solid #4a4c5c;
    border-top: 1px solid #4a4c5c;
    border-radius: 5px 0 0 0;
    margin-left: 5px;
    margin-top: 9px;
    flex: none;
}

.reply-ref-avatar {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--avatar);
    display: inline-grid;
    place-items: center;
    font-size: 5px;
    font-weight: 750;
    color: #fff;
    flex: none;
}

.reply-ref-author {
    font-weight: 650;
    color: #aaa7b8;
    flex: none;
}

.reply-ref-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: .82;
}

.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 25px;
    padding: 0 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid rgba(255, 255, 255, .07);
    color: #9c9daf;
    font-size: 10px;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.reaction-chip:hover {
    background: rgba(255, 255, 255, .065);
    border-color: rgba(255, 255, 255, .13);
    transform: translateY(-1px);
}

.reaction-chip.is-mine {
    background: rgba(139, 109, 255, .12);
    border-color: rgba(139, 109, 255, .3);
    color: #d2c6ff;
}

.reaction-chip .reaction-emoji {
    font-size: 13px;
    line-height: 1;
}

.reaction-chip .reaction-count {
    font-size: 9px;
    font-weight: 650;
}

.reaction-add {
    width: 25px;
    height: 25px;
    padding: 0;
    justify-content: center;
    color: #77798b;
}

.reaction-add .icon {
    width: 13px;
    height: 13px;
}

.message-toolbar {
    position: absolute;
    top: -14px;
    right: 20px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 2px;
    border-radius: 9px;
    background: #222432;
    border: 1px solid rgba(255, 255, 255, .09);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(3px);
    transition: opacity .12s ease, transform .12s ease, visibility .12s;
}

.message:hover .message-toolbar,
.message:focus-within .message-toolbar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.message-toolbar button {
    width: 27px;
    height: 27px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    color: #8b8da0;
    transition: background var(--transition), color var(--transition);
}

.message-toolbar button:hover {
    background: rgba(255, 255, 255, .07);
    color: #ddd9e9;
}

.message-toolbar button.is-danger:hover {
    background: rgba(255, 100, 124, .1);
    color: #ff9cae;
}

.message-toolbar .icon {
    width: 14px;
    height: 14px;
}

.message-editor {
    margin-top: 2px;
    padding: 8px;
    border-radius: 10px;
    background: #141620;
    border: 1px solid rgba(139, 109, 255, .32);
}

.message-editor textarea {
    width: 100%;
    min-height: 62px;
    max-height: 200px;
    resize: vertical;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text-soft);
    font-size: 13.5px;
    line-height: 1.5;
    padding: 2px 3px;
}

.message-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 5px;
}

.date-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 17px 24px 11px;
    color: #6b6d80;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .02em;
}

.date-divider::before,
.date-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255, 255, 255, .055);
}

.date-divider span {
    flex: none;
    padding: 0 2px;
}

.message-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 30px;
    color: #6f7183;
    font-size: 10.5px;
}

.loading-dots {
    display: inline-flex;
    gap: 3px;
}

.loading-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #8e7bdb;
    animation: typingBounce 1.2s infinite;
}

.loading-dots i:nth-child(2) { animation-delay: .15s; }
.loading-dots i:nth-child(3) { animation-delay: .3s; }

.empty-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 230px;
    padding: 30px 20px;
    text-align: center;
}

.empty-channel-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(139, 109, 255, .075);
    border: 1px solid rgba(139, 109, 255, .13);
    color: #a795f2;
}

.empty-channel-icon .icon {
    width: 23px;
    height: 23px;
}

.empty-channel h3 {
    margin-top: 13px;
    font-size: 15px;
    font-weight: 650;
}

.empty-channel p {
    margin-top: 5px;
    color: #7f8193;
    font-size: 11.5px;
}

.message-bottom-anchor {
    height: 1px;
}

.typing-indicator {
    min-height: 21px;
    padding: 0 29px 3px;
    color: #6f7184;
    font-size: 9.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.typing-indicator .typing-dots i {
    width: 3px;
    height: 3px;
    background: #727487;
}

.typing-indicator:empty {
    min-height: 9px;
    padding-bottom: 0;
}

.composer {
    flex: none;
    padding: 0 22px 18px;
    position: relative;
}

.reply-banner {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 4px -1px;
    padding: 8px 11px;
    border-radius: 10px 10px 0 0;
    background: rgba(139, 109, 255, .07);
    border: 1px solid rgba(139, 109, 255, .12);
    border-bottom: 0;
}

.reply-banner-icon {
    color: #b3a0ff;
    flex: none;
}

.reply-banner-icon .icon {
    width: 15px;
    height: 15px;
}

.reply-banner > div {
    min-width: 0;
    flex: 1;
}

.reply-banner span {
    color: #9698aa;
    font-size: 9.5px;
}

.reply-banner strong {
    color: #c9c1e8;
    font-weight: 650;
}

.reply-banner p {
    margin-top: 1px;
    color: #6e7083;
    font-size: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reply-banner .icon-button {
    color: #77798c;
}

.composer-shell {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    min-height: 50px;
    padding: 6px;
    border-radius: 13px;
    background: #242633;
    border: 1px solid rgba(255, 255, 255, .085);
    box-shadow: 0 3px 12px rgba(0, 0, 0, .12);
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.composer:focus-within .composer-shell {
    border-color: rgba(139, 109, 255, .38);
    background: #272938;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .16), 0 0 0 3px rgba(139, 109, 255, .055);
}

.reply-banner:not([hidden]) ~ .composer-shell {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.composer-emoji {
    color: #8a8c9f;
    border-radius: 8px;
}

.composer-emoji:hover {
    color: #c7c4d6;
    background: rgba(255, 255, 255, .055);
}

.composer-file {
    width: 31px;
    height: 31px;
}

.composer-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 8px 0;
}

.composer-attachment-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
    padding: 5px 6px 5px 7px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    color: #a9a5b8;
    font-size: 10px;
}

.composer-attachment-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    color: #a99beb;
    background: rgba(139, 109, 255, .1);
}

.composer-attachment-icon .icon {
    width: 11px;
    height: 11px;
}

.composer-attachment-name {
    max-width: 220px;
    overflow: hidden;
    color: #c7c3d4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composer-attachment-chip small {
    flex: none;
    color: #6f7182;
    font-size: 8.5px;
}

.composer-attachment-remove {
    display: grid;
    place-items: center;
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    color: #717385;
}

.composer-attachment-remove:hover {
    background: rgba(255, 255, 255, .08);
    color: #e2dfea;
}

.composer-attachment-remove .icon {
    width: 10px;
    height: 10px;
}

.composer.is-dragging .composer-shell {
    border-color: rgba(139, 109, 255, .65);
    box-shadow: 0 0 0 3px rgba(139, 109, 255, .12);
}

.message-attachments {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 680px;
    margin-top: 6px;
}

.message-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 4px;
    max-width: 520px;
}

.message-image-grid.is-single {
    display: block;
}

.message-image-grid.is-single .message-image-attachment {
    width: fit-content;
    max-width: 100%;
}

.message-image-attachment {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 9px;
    background: #12141d;
}

.message-image-attachment img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.message-image-grid.is-single img {
    width: auto;
    min-width: 96px;
    min-height: 96px;
    max-width: min(420px, 100%);
    max-height: 320px;
    height: auto;
    object-fit: contain;
}

.message-file-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 420px;
}

.message-file-attachment {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 9px;
    background: rgba(255, 255, 255, .025);
    color: inherit;
    transition: background var(--transition), border-color var(--transition);
}

.message-file-attachment:hover {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(139, 109, 255, .25);
}

.message-file-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    color: #a99beb;
    background: rgba(139, 109, 255, .1);
}

.message-file-icon .icon {
    width: 15px;
    height: 15px;
}

.message-file-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.message-file-copy strong {
    overflow: hidden;
    color: #d4d0de;
    font-size: 10.5px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-file-copy small {
    color: #727486;
    font-size: 8.5px;
}

.message-file-download {
    flex: none;
    color: #747688;
}

.message-file-download .icon {
    width: 14px;
    height: 14px;
}

.composer-input {
    flex: 1;
    min-width: 0;
    max-height: 170px;
    min-height: 36px;
    padding: 8px 5px 7px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-soft);
    font-size: 13.5px;
    line-height: 1.48;
    resize: none;
    overflow-y: auto;
}

.composer-input::placeholder {
    color: #65677a;
}

.composer-send {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex: none;
    background: linear-gradient(140deg, #9275ff, #6d4cea);
    color: #fff;
    box-shadow: 0 5px 14px rgba(112, 79, 240, .24);
    transition: opacity var(--transition), transform var(--transition), filter var(--transition);
}

.composer-send:hover:not(:disabled) {
    filter: brightness(1.07);
    transform: translateY(-1px);
}

.composer-send:disabled {
    background: rgba(255, 255, 255, .055);
    color: #5d5f70;
    box-shadow: none;
}

.composer-send .icon {
    width: 17px;
    height: 17px;
    margin-left: -1px;
}

.composer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 5px 0;
    color: #525465;
    font-size: 8.5px;
}

.composer-count {
    font-variant-numeric: tabular-nums;
}

.composer-count.is-near-limit {
    color: #d9a35e;
}

/* ---------- Members panel ---------- */
.members-panel {
    width: 252px;
    flex: none;
    display: flex;
    flex-direction: column;
    background: #161822;
    border-left: 1px solid rgba(0, 0, 0, .18);
    min-height: 0;
}

.members-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 76px;
    padding: 15px 14px 12px 18px;
    border-bottom: 1px solid var(--line);
}

.members-header h3 {
    margin-top: 3px;
    font-size: 14px;
    letter-spacing: -.02em;
    font-weight: 660;
}

.members-close {
    display: none;
}

.member-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 8px 16px;
}

.member-group + .member-group {
    margin-top: 19px;
}

.member-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px 7px;
    color: #707286;
    font-size: 8.5px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.member-group-label span {
    color: #525465;
    font-weight: 600;
    letter-spacing: 0;
}

.member-group-label--role {
    color: #9a9cae;
}

.member-group-label--role .role-color-dot {
    width: 6px;
    height: 6px;
    box-shadow: none;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 42px;
    padding: 5px 8px;
    border-radius: 8px;
    text-align: left;
    transition: background var(--transition);
}

.member-item:hover {
    background: rgba(255, 255, 255, .04);
}

.member-item.is-offline {
    opacity: .56;
}

.member-item.is-offline:hover {
    opacity: .8;
}

.member-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.member-name-line {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.member-name-line strong {
    font-size: 11.5px;
    font-weight: 600;
    color: #c9c6d6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-you {
    color: #6d6f81;
    font-size: 8px;
}

.user-badges {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    vertical-align: middle;
    flex: none;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 17px;
    padding: 0 5px;
    border-radius: 5px;
    border: 1px solid transparent;
    font-size: 8px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: .02em;
    white-space: nowrap;
}

.user-badge .icon {
    width: 10px;
    height: 10px;
}

.user-badges--compact .user-badge {
    width: 16px;
    height: 15px;
    padding: 0;
    border-radius: 4px;
}

.user-badges--compact .user-badge .icon {
    width: 9px;
    height: 9px;
}

.user-badge--staff {
    color: #c9baff;
    background: rgba(139, 109, 255, .14);
    border-color: rgba(139, 109, 255, .22);
}

.user-badge--tester {
    color: #8beadd;
    background: rgba(77, 212, 192, .12);
    border-color: rgba(77, 212, 192, .2);
}

.user-badge--supporter {
    color: #ffc98a;
    background: rgba(255, 184, 77, .12);
    border-color: rgba(255, 184, 77, .2);
}

.friend-name-line {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.message-badges {
    margin-left: -2px;
}

.friends-header-copy h2 .user-badges,
.profile-name-row .user-badges {
    margin-left: 2px;
}

.member-copy small {
    color: #66687b;
    font-size: 8.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 145px;
}

.member-copy small.is-status {
    color: #85879a;
}

.members-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 11px 16px;
    border-top: 1px solid var(--line);
    color: #5b5d6e;
    font-size: 8.5px;
}

.members-footer .status-dot {
    width: 5px;
    height: 5px;
}

.members-footer .status-dot.is-offline {
    background: #5d6071;
    box-shadow: none;
}

.message.is-highlighted {
    animation: messageHighlight 1.4s ease;
}

.message-author[data-profile-id] {
    cursor: pointer;
    border-radius: 3px;
}

.message-author[data-profile-id]:hover {
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, .3);
    text-underline-offset: 2px;
}

.member-empty {
    padding: 7px 10px 12px;
    color: #656779;
    font-size: 9.5px;
}

.field-optional {
    margin-left: 4px;
    color: #6b6d80;
    font-size: 8.5px;
    font-weight: 550;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.profile-meta .icon {
    width: 12px;
    height: 12px;
}

.profile-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

@keyframes messageHighlight {
    0%, 100% { background: transparent; }
    18% { background: rgba(139, 109, 255, .12); }
    70% { background: rgba(139, 109, 255, .06); }
}

/* ---------- Empty and loading states ---------- */
.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #77798c;
    font-size: 12px;
}

.chat-placeholder .loading-dots i {
    width: 5px;
    height: 5px;
}

/* ---------- Channel categories ---------- */
.channel-category {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    max-width: 100%;
}

.channel-category + .channel-category {
    margin-top: 8px;
}

.channel-category-head {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 7px 5px 4px 8px;
}

.channel-category-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    color: var(--dim);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: .1em;
    text-align: left;
    text-transform: uppercase;
}

.channel-category-toggle:hover {
    color: var(--muted);
}

.channel-category-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-category.is-collapsed .section-chevron {
    transform: rotate(-90deg);
}

.channel-category.is-collapsed .channel-category-list {
    display: none;
}

.channel-category-settings {
    display: grid;
    place-items: center;
    flex: none;
    width: 23px;
    height: 23px;
    border-radius: 6px;
    color: #85879a;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), background var(--transition), color var(--transition);
}

.channel-category-settings .icon {
    width: 13px;
    height: 13px;
}

.channel-category-head:hover .channel-category-settings,
.channel-category-head:focus-within .channel-category-settings {
    opacity: 1;
    pointer-events: auto;
}

.channel-category-settings:hover {
    background: rgba(255, 255, 255, .08);
    color: #f0edf8;
}

.channel-category-settings:focus-visible {
    outline: 2px solid rgba(139, 109, 255, .45);
    outline-offset: 1px;
}

.channel-category-empty {
    padding: 5px 9px 7px;
    color: #5c5e70;
    font-size: 10px;
    line-height: 1.4;
}
