#channel-window {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 79%;
    height: 100vh;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #101828;
    z-index: 100000;
}

#channel-window .chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(36, 49, 65, 1);
    border-bottom: 1px solid rgba(73, 96, 125, 0.55);
}

#channel-window .chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
    min-width: 0;
}

#channel-window .chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

#channel-window .chat-title {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
}

#channel-window .chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#channel-window .icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: #343c63;
    color: white;
    cursor: pointer;
    font-size: 22px;
    padding: 0;
}

.channel-subtitle {
    display: block;
    margin-top: 2px;
    color: #cfcfcf;
    font-size: 0.85rem;
}

.channel-posts-area,
.mobile-channel-posts {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0 104px;
    background: radial-gradient(circle at 24% 30%, #000000, #1d2f4b);
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.channel-post {
    width: min(50%, 760px);
    margin: 0 auto 16px;
    align-self: center;
}

.channel-post--mobile {
    width: 94%;
    margin: 0 auto 16px;
}

.channel-post-author {
    margin-bottom: 10px;
}

.channel-post-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channel-post-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 123, 255, 0.18);
    color: #cfd9ff;
    font-size: 0.8rem;
}

.channel-post-badge--pending {
    background: rgba(255, 193, 7, 0.16);
    color: #ffe08a;
}

.channel-post-badge--blurred {
    background: rgba(255, 87, 34, 0.16);
    color: #ffb199;
}

.channel-comments-bar,
.post-comments-bar {
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    border: none;
    border-radius: 14px;
    background: rgba(18, 24, 37, 1);
    color: #d4f1d5;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.channel-comments-bar:hover,
.post-comments-bar:hover {
    background: rgba(28, 36, 52, 1);
}

.channel-post .post-footer {
    justify-content: flex-start;
}

.channel-post-empty {
    width: min(50%, 760px);
    margin: 18px auto 0;
    padding: 18px;
    border-radius: 16px;
    background: rgba(36, 49, 65, 1);
    border: 1px solid rgba(73, 96, 125, 1);
    color: white;
    text-align: center;
    box-sizing: border-box;
}

.channel-post-empty__title {
    margin-bottom: 6px;
    font-size: 1.05rem;
    font-weight: 700;
}

.channel-post-empty__text {
    color: #cfcfcf;
}

.channel-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    padding: 12px 16px 18px;
    background: linear-gradient(180deg, rgba(16, 24, 40, 0), rgba(16, 24, 40, 0.96) 35%);
}

.channel-footer button,
#channel-post-submit-btn,
.chat-create-choice-actions button {
    width: min(50%, 760px);
    min-height: 46px;
    border: none;
    border-radius: 12px;
    background: #343c63;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
}

.channel-footer button.secondary {
    background: rgba(52, 60, 99, 0.7);
    color: #d8def7;
}

#channel-post-submit-btn,
.chat-create-choice-actions button {
    width: 100%;
}

.channel-post-modal-content {
    width: min(460px, calc(100vw - 24px));
}

.chat-create-choice-modal-content {
    width: min(360px, calc(100vw - 24px));
}

.chat-create-choice-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.channel-post-modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#channel-post-text {
    min-height: 130px;
    max-height: 320px;
    resize: vertical;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(73, 96, 125, 1);
    background: rgba(31, 38, 53, 1);
    color: white;
    box-sizing: border-box;
}

.channel-post-modal-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-post-modal-row select {
    flex: 1;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(73, 96, 125, 1);
    background: rgba(31, 38, 53, 1);
    color: white;
}

.channel-post-modal-upload {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 12px;
    background: rgba(31, 38, 53, 1);
    border: 1px solid rgba(73, 96, 125, 1);
    box-sizing: border-box;
    overflow: hidden;
    flex: 0 0 44px;
}

.channel-post-modal-upload img {
    width: 24px;
    height: 24px;
    display: block;
}

.channel-post-file-preview {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(73, 96, 125, 1);
    background: rgba(31, 38, 53, 1);
    overflow: hidden;
}

.channel-post-file-preview.hidden {
    display: none;
}

.channel-post-file-preview img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 10px;
}

.channel-post-file-preview__name {
    color: white;
    font-size: 0.95rem;
}

#channel-info-modal {
    position: fixed;
    inset: 0;
    z-index: 1000010;
    display: flex;
    align-items: center;
    justify-content: center;
}

#channel-info-modal.hidden {
    display: none !important;
}

#channel-info-modal .channel-info-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 18, 0.62);
}

#channel-info-modal .channel-info-sheet {
    position: relative;
    width: min(760px, calc(100vw - 32px));
    max-height: min(90vh, 920px);
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.08);
    background: #0f172a;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
}

#channel-info-modal .channel-info-top {
    padding: 24px 24px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

#channel-info-modal .channel-info-close {
    width: 42px;
    height: 42px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

#channel-info-modal .channel-info-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
}

#channel-info-modal .channel-info-avatar-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    min-width: 110px;
}

#channel-info-modal .channel-info-avatar-wrap img {
    width: 110px;
    height: 110px;
    border-radius: 20px;
    object-fit: cover;
    display: block;
}

#channel-info-modal .channel-info-avatar-edit {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 12px;
    background: #343c63;
    color: white;
    cursor: pointer;
}

#channel-info-modal .channel-info-hero-text {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#channel-info-modal input,
#channel-info-modal textarea {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    background: rgba(255,255,255,0.05);
    color: white;
    padding: 12px 14px;
    box-sizing: border-box;
}

#channel-info-modal textarea {
    min-height: 110px;
    resize: vertical;
}

#channel-info-modal input:disabled,
#channel-info-modal textarea:disabled {
    opacity: 0.72;
    cursor: default;
}

#channel-info-modal .channel-info-subtitle,
#channel-info-modal .channel-info-hint {
    color: #aeb9c8;
    font-size: 0.92rem;
}

#channel-info-modal .channel-info-actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#channel-info-modal .channel-info-actions button {
    width: auto;
    min-width: 180px;
    padding: 12px 16px;
    border: none;
    border-radius: 14px;
    background: #343c63;
    color: white;
    cursor: pointer;
    font-weight: 700;
}

#channel-info-modal .channel-info-actions button.secondary {
    background: rgba(255,255,255,0.08);
    color: #f3f4f6;
}

#channel-info-modal .channel-info-body {
    overflow-y: auto;
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#channel-info-modal .channel-info-section {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#channel-info-modal .channel-info-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#channel-info-modal .channel-info-label {
    color: white;
    font-size: 0.98rem;
    font-weight: 700;
}

#channel-info-modal .channel-info-tag-row,
#channel-info-modal .channel-info-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

#channel-info-modal .channel-info-tag-prefix {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

#channel-info-modal .channel-info-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.20);
    color: #bfdbfe;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 700;
}

#channel-info-modal .channel-info-media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

#channel-info-modal .channel-info-media-card {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.05);
    cursor: pointer;
    padding: 0;
}

#channel-info-modal .channel-info-media-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#channel-info-modal .channel-info-empty {
    padding: 20px 14px;
    border-radius: 16px;
    text-align: center;
    color: #94a3b8;
    background: rgba(255,255,255,0.04);
}

@media (max-width: 1000px) {
    #channel-window {
        width: 100%;
    }

    #channel-window .chat-header-left {
        margin-left: 0;
    }

    #channel-window .chat-avatar {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
    }

    .channel-post,
    .channel-post-empty,
    .channel-footer button {
        width: 94%;
        margin-left: auto;
        margin-right: auto;
    }

    .channel-post-modal-content,
    .chat-create-choice-modal-content {
        width: calc(100vw - 20px);
    }

    .channel-footer {
        padding: 10px 10px 12px;
    }

    .mobile-channel-footer {
        position: sticky;
        bottom: 0;
    }

    .mobile-chat-header .chat-info-wrapper > img {
        width: 34px;
        height: 34px;
        min-width: 34px;
        max-width: 34px;
        min-height: 34px;
        max-height: 34px;
    }

    .mobile-chat-header--channel {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
    }

    .mobile-chat-header--channel .channel-mobile-info {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .mobile-chat-header--channel .channel-mobile-info > img {
        width: 34px;
        height: 34px;
        min-width: 34px;
        max-width: 34px;
        min-height: 34px;
        max-height: 34px;
        border-radius: 8px;
        object-fit: cover;
        flex-shrink: 0;
    }

    .mobile-chat-header--channel .chat-title-wrap {
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .mobile-chat-header--channel .chat-title {
        color: white;
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-chat-header--channel .chat-title-info {
        margin-top: 2px;
        color: #cfcfcf;
        font-size: 0.8rem;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-chat-header--channel #mobile-channel-post-top-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        padding: 0;
        border: none;
        border-radius: 10px;
        background: #343c63;
        color: white;
        font-size: 22px;
        line-height: 1;
        margin: 0;
        flex: 0 0 auto;
    }

    #channel-info-modal {
        align-items: flex-end;
    }

    #channel-info-modal .channel-info-sheet {
        width: 100%;
        max-height: 94vh;
        border-radius: 24px 24px 0 0;
    }

    #channel-info-modal .channel-info-top {
        padding: 12px 14px 14px;
    }

    #channel-info-modal .channel-info-body {
        padding: 14px 14px 20px;
    }

    #channel-info-modal .channel-info-hero {
        align-items: flex-start;
    }

    #channel-info-modal .channel-info-avatar-wrap,
    #channel-info-modal .channel-info-avatar-wrap img {
        width: 84px;
        height: 84px;
        min-width: 84px;
    }

    #channel-info-modal .channel-info-actions button {
        flex: 1 1 100%;
        min-width: 0;
    }

    #channel-info-modal .channel-info-media-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
