.chat-input-wrapper {
    position: relative;
}

.chat-input-group {
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border, #dee2e6);
    border-radius: var(--radius-sm, 10px);
    background: var(--surface, #ffffff);
    overflow: hidden;
}

.chat-input-group #messageBox {
    font-size: 0.82em;
}


.chat-input-group:focus-within {
    border-color: rgba(31, 122, 140, 0.4);
    box-shadow: 0 0 0 0.15rem rgba(31, 122, 140, 0.18);
}

.chat-input-group #messageBox {
    border: 0;
    border-radius: 0;
    margin: 0 !important;
    box-shadow: none;
}

.chat-input-group #sendButton {
    border: 0;
    border-top: 1px solid var(--border, #dee2e6);
    border-radius: 0;
    margin: 0;
}

.chat-input-wrapper.game-active {
    border: 1px solid var(--border, #dee2e6);
    border-radius: var(--radius-sm, 10px);
    background: var(--surface, #ffffff);
    overflow: visible;
}

.chat-input-wrapper.game-active #quizBox {
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--border, #dee2e6);
    border-radius: var(--radius-sm, 10px) var(--radius-sm, 10px) 0 0;
}

.chat-input-wrapper.game-active .chat-input-group {
    border: 0;
    border-radius: 0 0 var(--radius-sm, 10px) var(--radius-sm, 10px);
}

.chat-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

.chat-suggestion-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
}

.chat-suggestion-item.active,
.chat-suggestion-item:hover {
    background: #e9f2ff;
}

.game-command-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    background: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.2);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #0d6efd;
    font-size: 14px;
}

.game-command-btn:hover {
    background: rgba(13, 110, 253, 0.2);
    border-color: rgba(13, 110, 253, 0.4);
}

.game-command-btn i {
    display: block;
}

.chat-reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 12px;
}

.chat-reply-preview.display-none {
    display: none;
}

.chat-reply-preview-body {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-reply-preview-label {
    color: #6c757d;
}

.chat-reply-preview-user {
    font-weight: 600;
}

.chat-reply-preview-text {
    color: #495057;
}

.chat-reply-cancel {
    border: 0;
    background: transparent;
    color: #6c757d;
    padding: 0 4px;
    cursor: pointer;
}

.chat-reply-cancel:hover {
    color: #0d6efd;
}

.chat-reply-inline {
    display: block;
    border-left: 2px solid #dee2e6;
    padding-left: 8px;
    margin: 4px 0;
    font-size: 12px;
    color: #6c757d;
}

.chat-reply-user {
    font-weight: 600;
}

.chat-reply-text {
    color: #495057;
}

.chat-reply-btn {
    border: 0;
    background: transparent;
    color: #6c757d;
    margin-left: 6px;
    padding: 0;
    font-size: 12px;
    cursor: pointer;
}

.chat-reply-btn:hover {
    color: #0d6efd;
}

.onboarding-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--bs-body-bg, #fff);
    border-radius: 16px;
    padding: 14px;
    margin: 12px 0;
}

.onboarding-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.onboarding-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--bs-body-color, #212529);
}

.onboarding-subtitle {
    font-size: 13px;
    color: #6c757d;
}

.onboarding-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.onboarding-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.onboarding-info {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.onboarding-info-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6c757d;
}

.onboarding-info-link {
    text-decoration: none;
    font-weight: 600;
    color: #0d6efd;
}

.onboarding-info-link:hover {
    text-decoration: underline;
}

.onboarding-channels {
    margin-top: 12px;
}

.onboarding-channels-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.onboarding-channel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.onboarding-channel-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(13, 110, 253, 0.2);
    background: rgba(13, 110, 253, 0.06);
    color: var(--bs-body-color, #212529);
    text-decoration: none;
    font-size: 12px;
}

.onboarding-channel-chip:hover {
    border-color: rgba(13, 110, 253, 0.4);
    background: rgba(13, 110, 253, 0.12);
}

.onboarding-channel-chip .badge {
    font-size: 10px;
    padding: 2px 6px;
}

.onboarding-dismiss {
    border: 0;
    background: transparent;
    color: #adb5bd;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.avatar-nudge {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.avatar-nudge.display-none {
    display: none;
}

.avatar-nudge-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.avatar-nudge-text {
    font-size: 13px;
}

.avatar-nudge-actions .btn {
    white-space: nowrap;
}

.avatar-nudge-dismiss {
    border: 0;
    background: transparent;
    color: #6c757d;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.user-menu-offcanvas {
    width: min(100vw, 360px);
}

.user-menu-offcanvas .offcanvas-header {
    padding: 12px 16px;
}

.user-menu-offcanvas .offcanvas-body {
    padding: 12px 16px 16px;
}

.user-menu-profile {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.channel-info-card {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--bs-body-bg, #fff);
}

.channel-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.channel-info-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 40px;
}

.channel-info-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.channel-info-title {
    font-weight: 600;
    font-size: 0.82rem;
    color: #111827;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}

.channel-info-desc {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    font-size: 12px;
    color: #6c757d;
    line-height: 1.4;
    font-family: "Georgia", "Times New Roman", serif;
}

.channel-info-desc i {
    font-size: 0.95em;
    color: #adb5bd;
    margin-top: 1px;
}

.channel-info-desc-text {
    min-width: 0;
}

.channel-info-link {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
    margin-top: 8px;
}

.channel-info-link i {
    font-size: 0.95em;
    color: #adb5bd;
}

.channel-info-link-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6c757d;
    font-size: 12px;
    cursor: pointer;
    word-break: break-all;
}

.channel-info-link-button:hover,
.channel-info-link-button:focus {
    color: #6c757d;
    box-shadow: none;
}

.channel-info-meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.channel-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

.channel-info-badge i {
    font-size: 0.9em;
}

.channel-info-public {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.15);
    color: #1d4ed8;
}

.channel-info-private {
    border-color: rgba(100, 116, 139, 0.35);
    background: rgba(100, 116, 139, 0.15);
    color: #475569;
}

.channel-info-registered {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.16);
    color: #16a34a;
}

.channel-info-moderators {
    border-color: rgba(14, 116, 144, 0.35);
    background: rgba(14, 116, 144, 0.16);
    color: #0e7490;
}

.user-menu-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f3f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #6c757d;
    flex-shrink: 0;
}

.user-menu-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu-profile-info {
    min-width: 0;
    flex: 1;
}

.user-menu-username {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.user-menu-profile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}

.user-menu-profile-emoji {
    font-size: 13px;
}

.user-menu-section {
    margin-top: 12px;
}

.user-menu-section:first-child {
    margin-top: 0;
}

.user-menu-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 6px;
}

.user-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.user-menu-tile {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--bs-body-bg, #fff);
}

.user-menu-tile-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    flex-shrink: 0;
}

.user-menu-tile-icon.is-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

.user-menu-tile-icon.is-success {
    background: rgba(22, 163, 74, 0.18);
    color: #16a34a;
}

.user-menu-tile-icon.is-indigo {
    background: rgba(37, 99, 235, 0.18);
    color: #2563eb;
}

.user-menu-tile-icon.is-teal {
    background: rgba(13, 148, 136, 0.18);
    color: #0d9488;
}

.user-menu-tile-title {
    font-size: 14px;
    font-weight: 600;
    display: block;
}

.user-menu-tile-meta {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-menu-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #0d6efd;
    color: #fff;
    font-size: 11px;
}

.user-menu-count.is-coin {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.user-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--bs-body-bg, #fff);
}

.user-menu-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-menu-row-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: #6c757d;
}

.user-menu-list {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bs-body-bg, #fff);
}

.user-menu-list .user-menu-row {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.user-menu-list .user-menu-row + .user-menu-row {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.user-menu-list .user-menu-row .ti-chevron-right {
    color: #adb5bd;
}

@media (max-width: 576px) {
    .user-menu-offcanvas {
        width: 100vw;
    }
}

body.chat-compact .message-block {
    gap: 6px;
    margin-bottom: 4px;
}

body.chat-compact .chat-card-body {
    padding: 0.5em 0.6em !important;
}

body.chat-compact .chat-message-row {
    gap: 8px;
}

body.chat-compact .chat-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    font-size: 0.75em;
}

body.chat-compact .chat-sys-text {
    font-size: 0.8em;
}

body.chat-compact .chat-message-text {
    line-height: 1.4;
    font-size: 0.95em;
}

body.chat-compact .chat-grouped-row {
    margin-top: 0.08rem;
    margin-bottom: 0.08rem;
}

body.chat-compact .chat-footer-meta {
    gap: 4px;
    font-size: 0.72em;
}

body.chat-compact .chat-footer-inline {
    margin-left: 4px;
}

body.chat-compact .chat-footer-separator {
    color: var(--text-muted, #6c757d);
    margin-right: 4px;
}

body.chat-compact .chat-footer-meta .chat-time-text {
    font-size: 1em;
    margin-left: 2px;
}

body.chat-compact .chat-input-group {
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
}

body.chat-compact .chat-input-group #messageBox {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 8px;
    font-size: 0.74em;
    line-height: 1.35;
    min-height: 32px;
    resize: none;
    order: 1;
}


body.chat-compact .game-command-btn {
    position: static;
    transform: none;
    margin: 0;
    align-self: center;
    order: 2;
}

body.chat-compact .chat-input-group #sendButton {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    width: auto !important;
    min-width: 44px;
    padding: 7px 10px;
    font-size: 0.85em;
    border-top: 0;
    border-left: 1px solid var(--border, #dee2e6);
    border-radius: 0;
    flex: 0 0 auto;
    white-space: nowrap;
    order: 3;
}

body.chat-compact .chat-input-group #sendButton i,
body.chat-compact .chat-input-group #sendButton svg,
body.chat-compact .chat-input-group #sendButton .spinner-border {
    width: 0.95em;
    height: 0.95em;
    font-size: 0.95em;
}

body.chat-compact .chat-input-wrapper #quizBox {
    padding: 6px 8px;
}

body.chat-compact .chat-navbar .nav-actions {
    gap: 4px;
}

body.chat-compact .chat-navbar .nav-actions .btn {
    height: 28px !important;
    padding: 0 8px;
    border-radius: 8px !important;
}

body.chat-compact .navbar .btn i {
    font-size: 1.05em;
}

body.chat-compact .header-layout-pill .nav-actions-full,
body.chat-compact .header-layout-pill .nav-actions-admin {
    padding: 3px;
    border-radius: 12px;
}
