/* Full Room Layout */
.chugli-room-layout {
    max-width: 1060px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    align-items: start;
    height: auto;
    min-height: auto;
    width: 100%;
}

.chugli-main-col {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: visible;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    min-width: 0;
    height: auto;
    max-height: none;
}

.chugli-sidebar-col {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: visible;
}

.chugli-side-card {
    padding: 1.25rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.side-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-room-stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.82rem;
}

.side-stat-row {
    display: flex;
    justify-content: space-between;
    color: #64748b;
}

.side-members-avatars {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.side-member-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.15s;
}

.side-member-pill:hover {
    background: #f8fafc;
}

.side-member-pill img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Room Header */
.chugli-room-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    z-index: 10;
}

.chugli-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-back-chugli {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-back-chugli:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.chugli-room-avatar-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(236,72,153,0.12), rgba(168,85,247,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 1.5px solid rgba(236,72,153,0.25);
}

.chugli-header-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chugli-header-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Today's Topic Banner */
.chugli-today-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-bottom: 1.5px solid #fde68a;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.today-badge {
    font-size: 0.68rem;
    font-weight: 800;
    color: #b45309;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.today-topic-text {
    font-size: 0.88rem;
    font-weight: 800;
    color: #78350f;
    margin: 0;
    line-height: 1.35;
}

.today-quick-actions {
    display: flex;
    gap: 0.4rem;
}

.btn-today-action {
    background: #ffffff;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
}

.btn-today-action:hover {
    background: #fef3c7;
    color: #78350f;
}

/* Panga Arena Card */
.chugli-live-panga-arena {
    background: linear-gradient(135deg, #fff5f5, #ffffff);
    border-bottom: 1.5px solid #fecaca;
    padding: 0.85rem 1.25rem;
}

.panga-arena-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

/* Admin Delete Button for Panga Battles and Public Faisla Polls */
.btn-admin-item-delete {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.22rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #e11d48;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1;
    text-decoration: none;
    box-sizing: border-box;
    white-space: nowrap;
}

.btn-admin-item-delete:hover {
    background: #e11d48;
    color: #ffffff;
    border-color: #e11d48;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.22);
}

.btn-admin-item-delete:active {
    transform: translateY(0);
}

.btn-admin-item-delete i {
    font-size: 0.68rem;
}

.panga-live-pill {
    font-size: 0.68rem;
    font-weight: 900;
    background: #ef4444;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.panga-arena-topic {
    font-size: 0.94rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.65rem 0;
}

.panga-faceoff-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
}

.panga-side-card {
    background: #ffffff;
    border: 1.5px solid #fee2e2;
    border-radius: 14px;
    padding: 0.6rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
    text-align: center;
}

.panga-side-card.voted {
    border-color: #ef4444;
    background: #fef2f2;
}

.side-tag {
    font-size: 0.68rem;
    font-weight: 900;
    color: #dc2626;
    text-transform: uppercase;
}

.fighter-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fighter-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.fighter-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b;
}

.btn-vote-panga {
    width: 100%;
    padding: 0.35rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    border: 1px solid #fca5a5;
    background: #fff;
    color: #ef4444;
    cursor: pointer;
}

.btn-vote-panga:hover {
    background: #ef4444;
    color: #fff;
}

.panga-vs-divider {
    font-size: 0.75rem;
    font-weight: 900;
    background: #0f172a;
    color: #fff;
    padding: 3px 6px;
    border-radius: 6px;
}

.panga-progress-bar-wrap {
    margin-top: 0.6rem;
    height: 6px;
    background: #cbd5e1;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.panga-progress-bar {
    height: 100%;
    background: #ef4444;
}

.panga-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 700;
    margin-top: 2px;
}

/* Polls Container */
.chugli-polls-container {
    padding: 0.75rem 1.25rem 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chugli-poll-card {
    padding: 1rem;
    border-radius: 16px;
    border: 1.5px solid #dbeafe;
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.poll-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.poll-badge {
    font-size: 0.68rem;
    font-weight: 800;
    color: #2563eb;
    background: #dbeafe;
    padding: 2px 7px;
    border-radius: 6px;
}

.poll-meta {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
}

.poll-question {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.65rem 0;
}

.poll-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.poll-opt-btn {
    position: relative;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
}

.poll-opt-btn.voted {
    border-color: #3b82f6;
    font-weight: 800;
}

.poll-opt-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.15);
    pointer-events: none;
}

/* Feed & Messages */
.chugli-messages-feed {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    background: #fbfbfd;
    overflow: visible;
    flex: none;
    min-height: 160px;
}

.chugli-msg-row {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    max-width: 85%;
}

.chugli-msg-row.own-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chugli-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #e2e8f0;
}

.chugli-ghost-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.chugli-msg-bubble-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 0.65rem 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    position: relative;
}

.own-msg .chugli-msg-bubble-wrapper {
    background: #fdf2f8;
    border-color: #fbcfe8;
}

.is-patanger-row .chugli-msg-bubble-wrapper {
    border: 2px solid #f97316;
    background: #fffaf5;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.12);
}

.chugli-msg-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
}

.chugli-sender-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
}

.chugli-sender-name.ghost-name {
    color: #d946ef;
}

.ghost-badge {
    font-size: 0.6rem;
    font-weight: 800;
    background: #fae8ff;
    color: #c026d3;
    padding: 1px 5px;
    border-radius: 4px;
}

.chugli-msg-time {
    font-size: 0.68rem;
    color: #94a3b8;
    margin-left: auto;
}

.chugli-reply-ref {
    background: rgba(0, 0, 0, 0.03);
    border-left: 2.5px solid var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.74rem;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.patanger-badge-pill, .hottake-badge-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    margin-bottom: 0.3rem;
}

.patanger-badge-pill {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #ffedd5;
}

.hottake-badge-pill {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.chugli-msg-text {
    font-size: 0.88rem;
    color: #1e293b;
    line-height: 1.45;
    word-break: break-word;
}

.chugli-msg-media img {
    margin-top: 0.5rem;
    max-height: 220px;
    max-width: 100%;
    border-radius: 12px;
    cursor: pointer;
}

.chugli-msg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.45rem;
    min-height: 24px;
}

.chugli-reactions-pills-box {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.reaction-pill-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.reaction-pill-btn.active {
    background: #fdf2f8;
    border-color: #fbcfe8;
    color: #ec4899;
}

.chugli-hover-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.75;
    transition: opacity 0.2s;
}

.chugli-msg-row:hover .chugli-hover-actions {
    opacity: 1;
}

.btn-msg-act {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 6px;
    transition: all 0.15s;
}

.btn-msg-act:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.chugli-no-messages {
    text-align: center;
    padding: 3rem 1.5rem;
}

/* Typing Bar */
.chugli-typing-bar {
    padding: 0.3rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

/* Reply Bar */
.reply-preview-bar {
    padding: 0.45rem 1.25rem;
    background: #fdf2f8;
    border-top: 1.5px solid #fbcfe8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.btn-cancel-reply {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
}

/* Composer Container */
.chugli-composer-container {
    padding: 0.85rem 1.25rem calc(0.85rem + env(safe-area-inset-bottom, 0px)) 1.25rem;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    position: sticky;
    bottom: 0;
    z-index: 50;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.03);
}

.composer-sender-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.sender-toggle-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
}

.sender-toggle-pills {
    display: flex;
    gap: 0.4rem;
}

.sender-pill-label {
    cursor: pointer;
}

.sender-pill-label input {
    display: none;
}

.sender-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    transition: all 0.2s;
}

.sender-pill-label input:checked + .sender-pill {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fdf2f8;
}

.ghost-pill {
    background: #faf5ff;
}

.sender-pill-label input:checked + .ghost-pill {
    border-color: #c026d3;
    color: #c026d3;
    background: #fae8ff;
}

.pill-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
}

.btn-composer-tag {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.72rem;
    font-weight: 800;
    color: #ea580c;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
}

.btn-composer-tag.active {
    background: #ea580c;
    color: #ffffff;
    border-color: transparent;
}

.composer-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 0.35rem 0.5rem 0.35rem 0.85rem;
}

.btn-composer-icon {
    font-size: 1.15rem;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.btn-composer-icon:hover {
    color: var(--primary-color);
}

.chugli-textarea {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
    color: #0f172a;
    resize: none;
    max-height: 90px;
    font-family: inherit;
    line-height: 1.4;
    padding: 4px 0;
}

.btn-send-msg {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
    flex-shrink: 0;
    transition: transform 0.15s;
}

.btn-send-msg:active {
    transform: scale(0.92);
}

.composer-preview-box {
    margin-top: 0.5rem;
    position: relative;
    display: inline-block;
}

.composer-preview-box img {
    max-height: 70px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
}

.btn-remove-preview {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Floating Emoji Picker */
.floating-reaction-picker {
    position: absolute;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 999px;
    padding: 4px 8px;
    display: flex;
    gap: 4px;
    z-index: 1000;
}

.btn-picker-emoji {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 50%;
    transition: transform 0.15s;
}

.btn-picker-emoji:hover {
    transform: scale(1.3);
}

/* Locked Room View */
.chugli-locked-wrapper {
    max-width: 580px;
    margin: 2rem auto;
    padding: 0 1rem 3rem 1rem;
}

.chugli-locked-top-nav {
    margin-bottom: 1.25rem;
}

.chugli-locked-card {
    padding: 2.5rem 2rem;
    border-radius: 28px;
    text-align: center;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
}

.locked-icon-bubble {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(236,72,153,0.15), rgba(168,85,247,0.15));
    border: 1.5px solid rgba(236,72,153,0.3);
    margin: 0 auto 1.25rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 2.5rem;
}

.locked-badge-lock {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: #db2777;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.locked-room-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}

.locked-tags-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.locked-meta-pill {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 999px;
}

.locked-room-desc {
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.5;
    margin: 0 0 1.5rem 0;
}

.locked-invite-box {
    background: #fdf2f8;
    border: 1.5px solid #fbcfe8;
    border-radius: 20px;
    padding: 1.25rem;
    text-align: left;
    margin-top: 1rem;
}

.invite-sender-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.invite-sender-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #ec4899;
}

.invite-sender-title {
    font-size: 0.88rem;
    color: #0f172a;
    margin: 0 0 2px 0;
}

.invite-time {
    font-size: 0.75rem;
    color: #64748b;
}

.invite-note-bubble {
    background: #ffffff;
    border: 1px solid #f9a8d4;
    border-radius: 12px;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    color: #831843;
    font-style: italic;
    margin: 0.85rem 0;
}

.locked-denied-notice {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 1rem;
    text-align: center;
}

.denied-icon-wrap {
    font-size: 2rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.denied-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.35rem 0;
}

.denied-text {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.locked-actions-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.btn-join-private-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 999px;
    background: linear-gradient(135deg, #ec4899, #db2777);
    border: none;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(236,72,153,0.3);
}

.chugli-private-pill {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fbcfe8;
    padding: 2px 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Header Admin Quick Buttons */
.chugli-header-admin-btns {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-header-admin-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-header-admin-action.invite {
    background: #fdf2f8;
    color: #db2777;
    border: 1.5px solid #fbcfe8;
}

.btn-header-admin-action.invite:hover {
    background: #db2777;
    color: #ffffff;
    border-color: #db2777;
}

.btn-header-admin-action.manage {
    background: #eef2ff;
    color: #4f46e5;
    border: 1.5px solid #c7d2fe;
}

.btn-header-admin-action.manage:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
}

/* Modals System Styles */
.chugli-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.chugli-modal-card {
    background: #ffffff;
    border-radius: 28px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.6rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    border: 1px solid rgba(226, 232, 240, 0.9);
    position: relative;
}

.chugli-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1.5px solid #f1f5f9;
    padding-bottom: 0.85rem;
}

.chugli-modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chugli-modal-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.chugli-modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.chugli-modal-subtitle {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0.2rem 0 0 0;
}

.btn-close-chugli-modal {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    line-height: 1;
}

.btn-close-chugli-modal:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.chugli-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

/* Option 1 & 2 Cards */
.invite-section-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.invite-section-label {
    font-size: 0.84rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.invite-section-desc {
    font-size: 0.76rem;
    color: #64748b;
    margin: 0;
    line-height: 1.35;
}

.invite-link-copy-row {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.invite-link-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    color: #334155;
    outline: none;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.btn-copy-link {
    flex-shrink: 0;
    background: linear-gradient(135deg, #ec4899, #db2777);
    color: #ffffff;
    border: none;
    padding: 0.45rem 0.95rem;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
    transition: opacity 0.15s;
    box-sizing: border-box;
}

.btn-copy-link:hover {
    opacity: 0.92;
}

.copy-link-toast {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.invite-divider-or {
    display: flex;
    align-items: center;
    text-align: center;
    margin: -0.25rem 0;
}

.invite-divider-or::before, .invite-divider-or::after {
    content: '';
    flex: 1;
    border-bottom: 1px dashed #cbd5e1;
}

.invite-divider-or span {
    padding: 0 0.65rem;
    font-size: 0.68rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.chugli-modal-search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.45rem 0.85rem;
    color: #64748b;
}

.chugli-modal-search-box input {
    border: none;
    background: transparent;
    padding: 0;
    width: 100%;
    font-size: 0.85rem;
}

.chugli-modal-search-box input:focus {
    box-shadow: none;
    outline: none;
}

.invite-results-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.45rem;
    background: #ffffff;
    margin-top: 0.25rem;
}

.invite-search-hint {
    text-align: center;
    font-size: 0.78rem;
    color: #94a3b8;
    padding: 0.85rem 0;
}

.invite-student-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    margin-bottom: 0.35rem;
    transition: background 0.15s;
}

.invite-student-row:hover {
    background: #f8fafc;
}

.invite-student-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.invite-student-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.invite-student-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.invite-student-meta {
    font-size: 0.72rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.invite-student-username {
    color: #6366f1;
    font-weight: 600;
}

.btn-invite-student {
    background: #fdf2f8;
    color: #db2777;
    border: 1.5px solid #fbcfe8;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-invite-student:hover {
    background: #db2777;
    color: #ffffff;
}

.badge-already-member {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-invited {
    background: #fdf2f8;
    color: #db2777;
    border: 1px solid #fbcfe8;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.pending-invites-section {
    margin-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.65rem;
}

.pending-invites-title {
    font-size: 0.76rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    margin: 0 0 0.45rem 0;
}

.pending-invites-list {
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pending-invite-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.65rem;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
}

.pending-invite-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pending-invite-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.pending-invite-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    display: block;
}

.pending-invite-dept {
    font-size: 0.68rem;
    color: #94a3b8;
    display: block;
}

.btn-cancel-invite {
    background: transparent;
    border: none;
    color: #ef4444;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.manage-members-list {
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.manage-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
}

.manage-member-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.manage-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.manage-member-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
}

.manage-member-dept {
    font-size: 0.75rem;
    color: #64748b;
    display: block;
}

.role-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
}

.role-owner {
    background: #fef3c7;
    color: #d97706;
}

.role-admin {
    background: #e0e7ff;
    color: #4f46e5;
}

.role-muted {
    background: #fee2e2;
    color: #dc2626;
}

.manage-member-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-member-act {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-member-act.mute {
    color: #f59e0b;
}

.btn-member-act.unmute {
    color: #10b981;
}

.btn-member-act.kick {
    color: #ef4444;
}

.btn-member-act:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Header Meta Invite Pill (Mobile only) */
.btn-meta-invite-pill {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #db2777;
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    border-radius: 999px;
    cursor: pointer;
    margin-left: 0.25rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
    font-family: inherit;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(236, 72, 153, 0.1);
}

.btn-meta-invite-pill:hover, .btn-meta-invite-pill:active {
    background: #db2777;
    color: #ffffff;
    border-color: #db2777;
}

@media (min-width: 769px) {
    .btn-meta-invite-pill {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .btn-meta-invite-pill {
        display: inline-flex !important;
    }
    .desktop-only-admin-btns {
        display: none !important;
    }

    .main-content {
        padding-top: 0.35rem !important;
        padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
        overflow-x: hidden !important;
    }

    .chugli-room-layout {
        grid-template-columns: 1fr !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        gap: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .chugli-main-col {
        border-radius: 20px !important;
        height: auto !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .chugli-room-header {
        padding: 0.65rem 0.85rem !important;
        gap: 0.4rem !important;
        flex-shrink: 0 !important;
        border-top-left-radius: 20px !important;
        border-top-right-radius: 20px !important;
    }

    .chugli-header-left {
        gap: 0.5rem !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .chugli-room-title-box {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .chugli-header-name {
        font-size: 0.98rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .chugli-room-avatar-badge {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.25rem !important;
        flex-shrink: 0 !important;
    }

    .chugli-header-meta {
        font-size: 0.72rem !important;
        flex-wrap: wrap !important;
        gap: 0.3rem !important;
        align-items: center !important;
    }

    .chugli-polls-container {
        padding: 0.65rem 0.85rem 0 0.85rem !important;
    }

    .chugli-messages-feed {
        flex: none !important;
        min-height: 120px !important;
        overflow: visible !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0.75rem !important;
    }

    .chugli-composer-container {
        padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px)) 0.75rem !important;
        background: #ffffff !important;
        border-top: 1px solid #f1f5f9 !important;
        position: sticky !important;
        bottom: 62px !important;
        z-index: 50 !important;
        border-radius: 0 0 20px 20px !important;
        box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.04) !important;
    }

    .composer-sender-toggle-row {
        margin-bottom: 0.35rem !important;
    }

    .composer-input-wrapper {
        padding: 0.25rem 0.4rem 0.25rem 0.75rem !important;
        border-radius: 999px !important;
    }

    .chugli-textarea {
        font-size: 16px !important; /* Prevents auto zoom */
    }

    .chugli-sidebar-col {
        display: none !important;
    }

    .chugli-msg-row {
        max-width: 94% !important;
    }

    .chugli-modal-backdrop {
        padding: 0.75rem !important;
    }

    .chugli-modal-card {
        padding: 1.25rem 1rem !important;
        border-radius: 22px !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 360px) {
    .chugli-composer-container {
        bottom: 56px !important;
    }
}

@media (max-width: 480px) {
    .chugli-modal-backdrop {
        padding: 0.5rem !important;
    }

    .chugli-modal-card {
        padding: 1.15rem 0.85rem !important;
        border-radius: 18px !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 0.85rem !important;
    }

    .chugli-modal-header {
        padding-bottom: 0.65rem !important;
    }

    .chugli-modal-title {
        font-size: 1.05rem !important;
    }

    .chugli-modal-subtitle {
        font-size: 0.75rem !important;
    }

    .invite-section-card {
        padding: 0.75rem 0.65rem !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .invite-link-copy-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.45rem !important;
        width: 100% !important;
    }

    .invite-link-input {
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 0.78rem !important;
        text-align: left !important;
    }

    .btn-copy-link {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.55rem 0.85rem !important;
        font-size: 0.8rem !important;
        box-sizing: border-box !important;
    }

    .invite-student-row {
        padding: 0.4rem 0.5rem !important;
        gap: 0.4rem !important;
    }

    .invite-student-info {
        gap: 0.45rem !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .invite-student-avatar {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
    }

    .invite-student-name {
        font-size: 0.8rem !important;
    }

    .invite-student-meta {
        font-size: 0.68rem !important;
        flex-wrap: wrap !important;
    }

    .btn-invite-student {
        padding: 0.3rem 0.65rem !important;
        font-size: 0.72rem !important;
        flex-shrink: 0 !important;
    }

    .manage-member-row {
        padding: 0.5rem 0.6rem !important;
        gap: 0.5rem !important;
    }

    .manage-member-info {
        gap: 0.5rem !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .manage-member-avatar {
        width: 34px !important;
        height: 34px !important;
        flex-shrink: 0 !important;
    }

    .manage-member-name {
        font-size: 0.82rem !important;
    }

    .manage-member-dept {
        font-size: 0.68rem !important;
    }

    .btn-member-act {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.75rem !important;
    }
}
