.channels-page {
    min-height: 100vh;
}

.channels-page [hidden] {
    display: none !important;
}

.channels-main {
    width: min(1500px, calc(100% - 36px));
    min-height: calc(100vh - 160px);
    margin: 28px auto 0;
}

.channels-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 2px 20px;
}

.channels-intro h1 {
    margin: 5px 0 8px;
    font-size: clamp(2rem, 5vw, 3.65rem);
    letter-spacing: -.055em;
}

.channels-intro p {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    font-size: .96rem;
}

.channels-live {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #98a1af;
    background: rgba(255,255,255,.025);
    font-size: .75rem;
}

.discord-gate {
    min-height: 360px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(14,17,23,.9), rgba(8,10,14,.88));
    box-shadow: 0 30px 90px rgba(0,0,0,.18);
}

.discord-gate-icon {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 18px 50px rgba(255,52,78,.12);
}

.discord-gate h2 {
    margin: 5px 0 8px;
    font-size: 1.7rem;
}

.discord-gate p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
}

.discord-shell {
    height: min(790px, calc(100vh - 185px));
    min-height: 570px;
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    background: rgba(8,10,14,.78);
    box-shadow: 0 34px 100px rgba(0,0,0,.22);
    backdrop-filter: blur(18px) saturate(125%);
}

.channel-rail {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.065);
    background: linear-gradient(180deg, rgba(16,18,24,.92), rgba(10,12,17,.9));
}

.guild-card {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.guild-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    overflow: hidden;
    border: 1px solid rgba(255,78,99,.18);
    border-radius: 13px;
    background: #090a0d;
}

.guild-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.guild-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.guild-copy strong,
.guild-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guild-copy strong {
    color: #f4f5f7;
    font-size: .91rem;
}

.guild-copy span {
    color: #727c8c;
    font-size: .7rem;
}

.rail-close {
    display: none;
    margin-left: auto;
    border: 0;
    color: #8f98a6;
    background: none;
    font: inherit;
    font-size: 1.5rem;
    cursor: pointer;
}

.channel-search {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 12px 7px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 10px;
    background: rgba(255,255,255,.022);
}

.channel-search:focus-within {
    border-color: rgba(255,65,89,.28);
    box-shadow: 0 0 0 3px rgba(255,52,78,.05);
}

.channel-search svg {
    width: 15px;
    fill: none;
    stroke: #6e7785;
    stroke-width: 1.7;
}

.channel-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: #dfe3e9;
    background: transparent;
    font: inherit;
    font-size: .75rem;
}

.channel-tree {
    min-height: 0;
    overflow: auto;
    padding: 5px 8px 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

.channel-category {
    margin-top: 13px;
}

.channel-category:first-child {
    margin-top: 2px;
}

.channel-category-title {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border: 0;
    color: #737d8c;
    background: transparent;
    font: inherit;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
}

.channel-category-title svg {
    width: 10px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform 160ms ease;
}

.channel-category.collapsed .channel-category-title svg {
    transform: rotate(-90deg);
}

.channel-category.collapsed .channel-category-items {
    display: none;
}

.channel-link {
    width: 100%;
    min-height: 35px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 1px 0;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #949daa;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.channel-link:hover {
    color: #d8dde5;
    background: rgba(255,255,255,.03);
}

.channel-link.active {
    color: #fff;
    border-color: rgba(255,75,98,.12);
    background: linear-gradient(90deg, rgba(255,52,78,.105), rgba(255,255,255,.025));
}

.channel-link.thread-link {
    padding-left: 24px;
}

.channel-link-icon {
    width: 18px;
    flex: 0 0 18px;
    display: grid;
    place-items: center;
    color: #687281;
    font-size: .92rem;
}

.channel-link.active .channel-link-icon {
    color: var(--accent-2);
}

.channel-link-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .79rem;
    font-weight: 520;
}

.channel-link-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666f7d;
    font-size: .65rem;
}

.channel-live-count {
    min-width: 20px;
    padding: 2px 6px;
    border: 1px solid rgba(69,229,156,.12);
    border-radius: 999px;
    color: #70dcb0;
    background: rgba(69,229,156,.055);
    text-align: center;
}

.channel-stage {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 85% -20%, rgba(255,52,78,.05), transparent 30rem),
        rgba(9,11,15,.7);
}

.channel-stage-head {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,.065);
    background: rgba(9,11,15,.76);
    backdrop-filter: blur(14px);
}

.rail-open {
    width: 36px;
    height: 36px;
    display: none;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: #a0a8b3;
    background: rgba(255,255,255,.025);
}

.rail-open svg {
    width: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.channel-title-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 8px;
    color: #9da5b1;
    background: rgba(255,255,255,.025);
    font-weight: 700;
}

.channel-title-copy {
    min-width: 0;
    flex: 1;
}

.channel-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-title-copy h2 {
    overflow: hidden;
    margin: 0;
    color: #f2f4f7;
    font-size: 1rem;
    letter-spacing: -.015em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-title-copy p {
    overflow: hidden;
    margin: 3px 0 0;
    color: #717b89;
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-nsfw {
    padding: 2px 5px;
    border: 1px solid rgba(255,82,103,.24);
    border-radius: 4px;
    color: #ff7486;
    font-size: .57rem;
    font-weight: 800;
}

.channel-head-actions {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    background: rgba(255,255,255,.02);
}

.channel-head-button {
    padding: 7px 9px;
    border: 0;
    border-radius: 7px;
    color: #7f8997;
    background: transparent;
    font: inherit;
    font-size: .68rem;
    cursor: pointer;
}

.channel-head-button:hover {
    color: #cbd1d9;
}

.channel-head-button.active {
    color: #fff;
    background: rgba(255,52,78,.1);
}

.channel-content {
    min-height: 0;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.channel-empty {
    height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: #6f7987;
    text-align: center;
}

.channel-empty img {
    width: 66px;
    height: 66px;
    margin-bottom: 7px;
    border-radius: 16px;
    object-fit: cover;
    opacity: .75;
}

.channel-empty strong {
    color: #c8ced7;
    font-size: .9rem;
}

.channel-empty span {
    font-size: .72rem;
}

.message-view {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.older-wrap {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 6;
    transform: translateX(-50%);
}

.older-button {
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    color: #a3acb8;
    background: rgba(9,11,15,.92);
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
    font: inherit;
    font-size: .67rem;
    cursor: pointer;
}

.older-button:hover {
    color: #fff;
    border-color: rgba(255,65,90,.22);
}

.message-list {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 26px 20px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

.message-row {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    padding: 4px 9px 4px 8px;
    border-radius: 9px;
}

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

.message-row.compact {
    min-height: 27px;
    grid-template-columns: 42px minmax(0, 1fr);
    padding-top: 1px;
    padding-bottom: 1px;
}

.message-row.compact .message-avatar,
.message-row.compact .message-head {
    visibility: hidden;
}

.message-row.compact:hover .message-avatar {
    visibility: visible;
    opacity: .25;
}

.message-avatar {
    width: 36px;
    height: 36px;
    margin-top: 2px;
    overflow: hidden;
    border-radius: 50%;
    background: #11151c;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.message-avatar-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #ff8797;
    background: rgba(255,52,78,.08);
    font-size: .74rem;
    font-weight: 800;
}

.message-body {
    min-width: 0;
}

.message-head {
    min-height: 20px;
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.message-author {
    color: #e8ebef;
    font-size: .81rem;
    font-weight: 650;
}

.message-bot-badge {
    padding: 1px 4px;
    border-radius: 3px;
    color: #fff;
    background: #d5233f;
    font-size: .5rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.message-time,
.message-edited {
    color: #5f6977;
    font-size: .59rem;
}

.message-content {
    color: #cbd1d9;
    font-size: .82rem;
    line-height: 1.48;
    overflow-wrap: anywhere;
}

.message-content:empty {
    display: none;
}

.message-content strong {
    color: #e8ebef;
}

.message-content a {
    color: #ff7082;
    text-decoration: none;
}

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

.message-content code {
    padding: 1px 4px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 4px;
    color: #e4e7ec;
    background: #0a0d12;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .76rem;
}

.message-content pre {
    max-width: min(860px, 100%);
    overflow: auto;
    margin: 7px 0;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 8px;
    background: #080b0f;
}

.message-content pre code {
    padding: 0;
    border: 0;
    background: none;
    white-space: pre-wrap;
}

.discord-mention {
    display: inline-block;
    padding: 0 3px;
    border-radius: 3px;
    color: #ff9aa8;
    background: rgba(255,52,78,.1);
    font-weight: 560;
}

.discord-emoji {
    width: 22px;
    height: 22px;
    vertical-align: -.35em;
    object-fit: contain;
}

.message-reply {
    max-width: 760px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    color: #77818f;
    font-size: .67rem;
}

.message-reply::before {
    width: 18px;
    height: 9px;
    flex: 0 0 18px;
    border-top: 1px solid #4c5562;
    border-left: 1px solid #4c5562;
    border-radius: 5px 0 0;
    content: "";
}

.message-reply-author {
    color: #aeb5bf;
    font-weight: 650;
}

.message-reply-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-attachments {
    max-width: 780px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 7px;
}

.attachment-media {
    max-width: min(560px, 100%);
    max-height: 430px;
    display: block;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    background: #080b0f;
}

.attachment-media img,
.attachment-media video {
    max-width: 100%;
    max-height: 430px;
    display: block;
    object-fit: contain;
}

.attachment-audio {
    width: min(480px, 100%);
    margin-top: 2px;
}

.attachment-file {
    min-width: min(350px, 100%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 9px;
    color: #c6ccd5;
    background: rgba(255,255,255,.018);
    text-decoration: none;
}

.attachment-file:hover {
    border-color: rgba(255,69,92,.2);
}

.attachment-file-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #ff7284;
    background: rgba(255,52,78,.07);
    font-size: .65rem;
    font-weight: 800;
}

.attachment-file-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.attachment-file-copy strong {
    overflow: hidden;
    color: #dfe3e8;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-file-copy span {
    color: #687280;
    font-size: .61rem;
}

.discord-embed {
    width: min(540px, 100%);
    position: relative;
    overflow: hidden;
    margin-top: 7px;
    padding: 11px 12px 11px 15px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 8px;
    background: rgba(13,16,22,.82);
}

.discord-embed::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--embed-color, #ff344e);
    content: "";
}

.embed-provider,
.embed-author,
.embed-footer {
    color: #77818f;
    font-size: .63rem;
}

.embed-author {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: #b9c0c9;
    font-weight: 650;
}

.embed-author img,
.embed-footer img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.embed-title {
    display: block;
    margin-bottom: 5px;
    color: #f0f2f5;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
}

.embed-title[href]:hover {
    color: #ff7b8c;
    text-decoration: underline;
}

.embed-description {
    color: #b9c0c9;
    font-size: .73rem;
    line-height: 1.45;
}

.embed-fields {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px 10px;
    margin-top: 9px;
}

.embed-field {
    grid-column: 1 / -1;
    min-width: 0;
}

.embed-field.inline {
    grid-column: span 4;
}

.embed-field strong {
    display: block;
    margin-bottom: 2px;
    color: #dfe3e8;
    font-size: .68rem;
}

.embed-field div {
    color: #aeb6c0;
    font-size: .69rem;
    line-height: 1.4;
}

.embed-image,
.embed-thumbnail {
    display: block;
    max-width: 100%;
    max-height: 360px;
    margin-top: 9px;
    border-radius: 7px;
    object-fit: contain;
}

.embed-thumbnail {
    max-width: 120px;
    max-height: 120px;
    float: right;
    margin: 0 0 8px 12px;
}

.embed-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 9px;
}

.message-stickers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.message-stickers img {
    width: 132px;
    height: 132px;
    object-fit: contain;
}

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

.reaction-pill {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 7px;
    color: #9aa3af;
    background: rgba(255,255,255,.02);
    font-size: .68rem;
}

.reaction-pill.me {
    border-color: rgba(255,67,91,.24);
    color: #ffc1c9;
    background: rgba(255,52,78,.07);
}

.reaction-pill img {
    width: 17px;
    height: 17px;
    object-fit: contain;
}

.message-thread-chip,
.message-component-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 7px;
    color: #aab2bd;
    background: rgba(255,255,255,.02);
    font-size: .66rem;
    text-decoration: none;
}

.message-thread-chip {
    color: #ff8292;
    border-color: rgba(255,52,78,.12);
}

.message-components {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.message-component-button.disabled {
    opacity: .55;
}

.discord-poll {
    width: min(500px, 100%);
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 11px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 9px;
    background: rgba(255,255,255,.016);
}

.discord-poll strong {
    color: #e1e5ea;
    font-size: .76rem;
}

.poll-answer {
    padding: 7px 9px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 7px;
    color: #9fa8b4;
    font-size: .69rem;
}

.system-message {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #7d8794;
    font-size: .69rem;
    font-style: italic;
}

.system-message::before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ff5267;
    box-shadow: 0 0 12px rgba(255,52,78,.3);
    content: "";
}

.typing-row {
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 20px;
    border-top: 1px solid rgba(255,255,255,.04);
    color: #717b89;
    background: rgba(8,10,14,.78);
    font-size: .65rem;
}

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

.typing-dots i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ff6679;
    animation: typing-dot 1s ease-in-out infinite;
}

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

@keyframes typing-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-3px); opacity: 1; }
}

.secondary-view {
    height: 100%;
    overflow: auto;
    padding: 20px;
}

.secondary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.secondary-head h3 {
    margin: 0;
    color: #e9ecf0;
    font-size: .9rem;
}

.secondary-head span {
    color: #687280;
    font-size: .66rem;
}

.thread-grid,
.member-grid,
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
}

.thread-card,
.member-card,
.voice-card,
.empty-secondary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 10px;
    background: rgba(255,255,255,.018);
}

.thread-card {
    cursor: pointer;
}

.thread-card:hover {
    border-color: rgba(255,67,91,.16);
    background: rgba(255,52,78,.025);
}

.thread-icon,
.member-avatar,
.voice-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 10px;
    color: #ff8191;
    background: rgba(255,52,78,.07);
    font-size: .8rem;
    font-weight: 800;
}

.member-avatar,
.voice-avatar {
    border-radius: 50%;
}

.member-avatar img,
.voice-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.thread-copy,
.member-copy,
.voice-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.thread-copy strong,
.member-copy strong,
.voice-copy strong {
    overflow: hidden;
    color: #d9dee5;
    font-size: .73rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-copy span,
.member-copy span,
.voice-copy span {
    overflow: hidden;
    color: #6d7785;
    font-size: .62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-bot {
    padding: 1px 4px;
    border-radius: 3px;
    color: #fff;
    background: #b91c34;
    font-size: .48rem;
    font-weight: 800;
}

.voice-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.voice-flag {
    padding: 2px 5px;
    border-radius: 4px;
    color: #8d97a5;
    background: rgba(255,255,255,.035);
    font-size: .54rem;
}

.voice-flag.live {
    color: #76dfb4;
    background: rgba(69,229,156,.06);
}

.empty-secondary {
    min-height: 130px;
    justify-content: center;
    color: #6e7885;
    text-align: center;
    font-size: .72rem;
}

.channel-loading {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: #717b88;
    font-size: .72rem;
}

.channel-loading::before {
    width: 22px;
    height: 22px;
    margin-bottom: 7px;
    border: 2px solid rgba(255,255,255,.08);
    border-top-color: #ff5267;
    border-radius: 50%;
    animation: channel-spin .7s linear infinite;
    content: "";
}

@keyframes channel-spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
    .channels-main {
        width: min(100% - 20px, 1500px);
    }

    .discord-shell {
        grid-template-columns: 1fr;
    }

    .channel-rail {
        position: absolute;
        inset: 0 auto 0 0;
        z-index: 30;
        width: min(310px, 88vw);
        transform: translateX(-105%);
        transition: transform 210ms cubic-bezier(.2,.8,.2,1);
        box-shadow: 24px 0 70px rgba(0,0,0,.35);
    }

    .discord-shell.rail-visible .channel-rail {
        transform: none;
    }

    .rail-open,
    .rail-close {
        display: grid;
    }

    .channel-head-actions {
        max-width: 44vw;
        overflow-x: auto;
    }
}

@media (max-width: 720px) {
    .channels-main {
        width: min(100% - 12px, 1500px);
        margin-top: 16px;
    }

    .channels-intro {
        align-items: flex-start;
        padding: 16px 4px 14px;
    }

    .channels-intro p {
        display: none;
    }

    .discord-shell {
        height: calc(100dvh - 155px);
        min-height: 500px;
        border-radius: 14px;
    }

    .channel-stage-head {
        min-height: 66px;
        padding: 9px 10px;
    }

    .channel-title-copy p {
        display: none;
    }

    .channel-head-actions {
        max-width: 48vw;
    }

    .channel-head-button {
        padding: 7px 8px;
    }

    .message-list {
        padding: 20px 7px 14px;
    }

    .message-row {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 8px;
        padding-right: 5px;
        padding-left: 5px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
    }

    .discord-gate {
        grid-template-columns: 1fr;
        padding: 28px 22px;
        text-align: center;
    }

    .discord-gate-icon {
        margin: auto;
    }

    .embed-field.inline {
        grid-column: 1 / -1;
    }
}

.message-open {
    margin-left: auto;
    color: #5f6977;
    text-decoration: none;
    opacity: 0;
    transition: color 140ms ease, opacity 140ms ease;
}
.message-row:hover .message-open { opacity: 1; }
.message-open:hover { color: #ff7486; }
.discord-quote {
    display: inline-block;
    padding-left: 8px;
    border-left: 2px solid #4c5663;
    color: #aab2bc;
}

.channel-unread-dot {
    width: 6px;
    height: 6px;
    display: inline-block;
    border-radius: 50%;
    background: #ff5267;
    box-shadow: 0 0 12px rgba(255,52,78,.4);
}
.message-row.mentioned {
    background: linear-gradient(90deg, rgba(255,52,78,.075), rgba(255,52,78,.018));
}
.message-row.mentioned::before {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 2px;
    border-radius: 99px;
    background: #ff5267;
    content: "";
}

.channels-main {
    padding-bottom: 36px;
}

.message-view {
    overflow: hidden;
}

.message-list {
    position: relative;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 112px;
    scroll-padding-bottom: 112px;
}

.message-scroll-end {
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.message-row:last-of-type {
    margin-bottom: 18px;
}

.discord-heading {
    display: block;
    color: #f2f3f5;
    font-weight: 700;
    line-height: 1.25;
}

.discord-heading-1 {
    margin: 8px 0 4px;
    font-size: 1.15em;
}

.discord-heading-2 {
    margin: 7px 0 3px;
    font-size: 1.08em;
}

.discord-heading-3 {
    margin: 6px 0 2px;
    font-size: 1em;
}

.discord-subtext {
    color: #7c8490;
    font-size: .88em;
}

.discord-list-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-left: 4px;
}

.discord-list-item > i {
    width: 4px;
    height: 4px;
    flex: 0 0 4px;
    margin-top: .62em;
    border-radius: 50%;
    background: currentColor;
}

.discord-list-item.ordered > b {
    min-width: 1.4em;
    color: inherit;
    font-weight: 500;
}

.discord-timestamp {
    display: inline-block;
    padding: 0 3px;
    border-radius: 3px;
    color: #c8ccd2;
    background: rgba(255,255,255,.055);
    font-size: .94em;
}

.discord-spoiler {
    padding: 0 3px;
    border-radius: 3px;
    color: transparent;
    background: #1e2025;
    cursor: pointer;
    transition: color 120ms ease, background 120ms ease;
}

.discord-spoiler:hover,
.discord-spoiler:focus {
    color: inherit;
    background: rgba(255,255,255,.075);
    outline: none;
}

.discord-embed {
    width: min(520px, 100%);
    max-width: 520px;
    margin-top: 8px;
    padding: 10px 14px 10px 16px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 5px;
    background: #111318;
    box-shadow: 0 1px 0 rgba(0,0,0,.18);
}

.discord-embed::before {
    width: 4px;
    border-radius: 4px 0 0 4px;
}

.embed-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0 16px;
}

.embed-copy {
    min-width: 0;
}

.embed-provider {
    display: block;
    width: max-content;
    max-width: 100%;
    margin-bottom: 4px;
    color: #a7adb7;
    font-size: .68rem;
    line-height: 1.2;
    text-decoration: none;
}

.embed-provider[href]:hover {
    text-decoration: underline;
}

.embed-author {
    width: max-content;
    max-width: 100%;
    margin-bottom: 7px;
    color: #dbdee3;
    font-size: .71rem;
    line-height: 1.2;
    text-decoration: none;
}

.embed-author[href]:hover span {
    text-decoration: underline;
}

.embed-title {
    margin-bottom: 6px;
    color: #f2f3f5;
    font-size: .82rem;
    line-height: 1.3;
}

.embed-description {
    color: #d4d7dc;
    font-size: .76rem;
    line-height: 1.42;
    white-space: normal;
    overflow-wrap: anywhere;
}

.embed-description pre,
.embed-field pre {
    max-width: 100%;
    overflow: auto;
    margin: 6px 0;
    padding: 7px 9px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 4px;
    background: #0b0d11;
    font-size: .93em;
}

.embed-description code,
.embed-field code {
    padding: 1px 4px;
    border-radius: 3px;
    background: #0b0d11;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .93em;
}

.embed-description pre code,
.embed-field pre code {
    padding: 0;
    background: transparent;
}

.embed-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
    margin-top: 10px;
}

.embed-field {
    grid-column: 1 / -1;
    min-width: 0;
}

.embed-field.inline {
    grid-column: auto;
}

.embed-field strong {
    display: block;
    margin-bottom: 2px;
    color: #f2f3f5;
    font-size: .72rem;
    font-weight: 650;
    line-height: 1.3;
}

.embed-field > div {
    color: #d1d5db;
    font-size: .72rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.embed-thumbnail-link {
    grid-column: 2;
    grid-row: 1;
    display: block;
}

.embed-thumbnail {
    width: 80px;
    height: 80px;
    max-width: 80px;
    max-height: 80px;
    float: none;
    margin: 0;
    border-radius: 4px;
    object-fit: cover;
}

.embed-media-link {
    display: block;
    width: max-content;
    max-width: 100%;
}

.embed-media {
    display: block;
    width: auto;
    max-width: min(100%, 520px);
    max-height: 350px;
    margin-top: 12px;
    border-radius: 4px;
    object-fit: contain;
}

.embed-video {
    width: min(100%, 520px);
    background: #090b0e;
}

.embed-footer {
    min-width: 0;
    margin-top: 9px;
    color: #9299a4;
    font-size: .64rem;
    line-height: 1.25;
}

.embed-footer span {
    overflow-wrap: anywhere;
}

.message-components {
    align-items: center;
    margin-top: 7px;
}

.message-component-button {
    min-height: 32px;
    margin-top: 0;
    padding: 6px 12px;
    border-radius: 4px;
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    line-height: 1;
}

.message-component-button.style-1 {
    border-color: #5865f2;
    background: #5865f2;
}

.message-component-button.style-2 {
    border-color: #4e5058;
    background: #4e5058;
}

.message-component-button.style-3 {
    border-color: #248046;
    background: #248046;
}

.message-component-button.style-4 {
    border-color: #da373c;
    background: #da373c;
}

.message-component-button.style-5 {
    border-color: #4e5058;
    background: #4e5058;
}

.message-component-button:not(.disabled):hover {
    filter: brightness(1.08);
}

.message-component-button.disabled {
    opacity: .72;
}

.component-emoji {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.component-emoji-text {
    font-size: 1rem;
}

.component-external {
    margin-left: 2px;
    opacity: .8;
}

.message-select-menu {
    min-width: min(320px, 100%);
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 4px;
    color: #b7bdc6;
    background: #1e1f22;
    font-size: .7rem;
}

@media (max-width: 720px) {
    .message-list {
        padding-bottom: 96px;
        scroll-padding-bottom: 96px;
    }

    .discord-embed {
        width: min(100%, 520px);
        padding-right: 11px;
    }

    .embed-grid {
        gap: 0 10px;
    }

    .embed-thumbnail {
        width: 64px;
        height: 64px;
        max-width: 64px;
        max-height: 64px;
    }

    .embed-fields {
        grid-template-columns: 1fr;
    }

    .embed-field.inline {
        grid-column: 1;
    }
}
