* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botão de atualizar moderno */
.refresh-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.refresh-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

.refresh-btn i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.refresh-btn:hover i {
    transform: rotate(180deg);
}

.refresh-btn span {
    font-weight: 500;
}

.channel-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.channel-item {
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

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

.channel-item.active {
    background-color: rgba(0, 123, 255, 0.3);
}

.channel-name {
    font-weight: 500;
}

/* DESTAQUE PROFISSIONAL PARA QUANTIDADE DE USUÁRIOS */
.channel-users {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--accent-color), #0056b3);
    color: #ffffff !important;
    min-width: 40px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,123,255,0.4);
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.channel-users::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.channel-item:hover .channel-users::before {
    left: 100%;
}

.channel-item:hover .channel-users {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,123,255,0.6);
}

/* Para canais com muitos usuários, um destaque especial */
.channel-users[data-users="high"] {
    background: #cc0000;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(255,68,68,0.4);
}

.channel-users[data-users="medium"] {
    background: linear-gradient(135deg, #ffaa00, #ff8800);
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(255,170,0,0.4);
}

/* Garantir que números fiquem brancos em qualquer tema */
.theme-light .channel-users,
.theme-light .channel-users[data-users="high"],
.theme-light .channel-users[data-users="medium"] {
    color: #ffffff !important;
}

.user-controls {
    padding: 15px;
    border-top: 1px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* BOTÃO DE TEMA MODERNO */
.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.theme-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.theme-btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.theme-btn:hover i {
    transform: rotate(15deg);
}

.theme-btn .theme-text {
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    min-width: 0;
    height: 100vh;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

/* Chat Windows */
.chat-windows {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

/* Tabs */
.tabs-container {
    padding: 10px 10px 0;
    border-bottom: 1px solid;
    flex-shrink: 0;
    overflow: hidden;
}

.tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0;
    white-space: nowrap;
    scrollbar-width: thin;
}

.tabs::-webkit-scrollbar {
    height: 4px;
}

.tabs::-webkit-scrollbar-track {
    background: transparent;
}

.tabs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.tab {
    padding: 8px 15px;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
    border-bottom: none;
    position: relative;
    flex-shrink: 0;
}

.tab.active {
    border: 1px solid;
    border-bottom: none;
    margin-bottom: -1px;
}

.tab.highlight {
    animation: blink 1s infinite;
}

.tab.has-mention {
    background-color: rgba(255, 0, 0, 0.2);
}

.tab-close {
    margin-left: 8px;
    font-size: 1.2rem;
    font-weight: bold;
}

.tab-close:hover {
    color: red;
}

/* RADIO PLAYER */
.radio-player {
    padding: 12px 15px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-shrink: 0;
}

.radio-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.radio-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #0056b3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    box-shadow: 0 4px 10px rgba(0,123,255,0.3);
}

.radio-details {
    display: flex;
    flex-direction: column;
}

.radio-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.radio-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

/* CORES DO STATUS DA RÁDIO */
.radio-status.playing {
    color: #00ff00 !important;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.theme-light .radio-status.playing {
    color: #00cc00 !important;
    font-weight: 700;
    text-shadow: 0 0 3px rgba(0, 204, 0, 0.5);
}

.radio-status.error {
    color: #ff4444 !important;
    font-weight: 600;
}

.radio-status.connecting {
    color: var(--text-secondary);
    font-style: italic;
}

.radio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.radio-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.radio-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.radio-btn.play-btn {
    background: var(--accent-color);
    color: white;
}

.radio-btn.play-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.radio-btn.stop-btn {
    background: #ff4444;
    color: white;
}

.radio-btn.stop-btn:hover {
    background: #cc0000;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.volume-control i {
    font-size: 1rem;
}

.volume-control input[type="range"] {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--accent-hover);
}

/* Chat Window */
.chat-window {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
}

.chat-window.active {
    display: flex;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
}

/* Mensagens - espaçamento padrão */
.message {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 1px 0;
    animation: fadeIn 0.3s;
    line-height: 1.3;
}

.message .timestamp {
    font-size: 0.8rem;
    opacity: 0.7;
    min-width: 45px;
    color: var(--text-secondary);
    text-align: right;
    padding-right: 4px;
}

.message .nickname {
    font-weight: 600;
    min-width: 80px;
    max-width: 100px;
    cursor: pointer;
    text-align: right;
    color: var(--accent-color);
    padding-right: 4px;
}

/* Mensagens de sistema */
.message.system {
    opacity: 0.9;
    font-style: normal;
}

.message.system .nickname {
    color: var(--text-secondary);
    font-weight: 500;
    text-align: right;
}

.message.system .text {
    color: var(--text-secondary);
}

/* Mensagens de join/part/quit */
.message.join .text,
.message.part .text,
.message.quit .text {
    color: var(--text-secondary);
}

.message.join .nickname {
    color: #44ff44;
}

.message.part .nickname,
.message.quit .nickname {
    color: #ff4444;
}

.message .text {
    word-break: break-word;
    flex: 1;
    padding-left: 0;
}

/* Remove espaçamento extra */
.message .text:first-child {
    margin-left: 0;
}

/* Mensagens privadas */
.message.private {
    background-color: rgba(255, 255, 0, 0.05);
    border-radius: 4px;
    padding: 1px 0;
    margin: 1px 0;
}

.message.private .timestamp {
    min-width: 45px;
    font-size: 0.8rem;
    opacity: 0.7;
    color: var(--text-secondary);
    text-align: right;
    padding-right: 4px;
}

.message.private .nickname {
    min-width: 80px;
    max-width: 100px;
    font-weight: 600;
    cursor: pointer;
    text-align: right;
    color: #ffaa00;
    padding-right: 4px;
}

.message.private .text {
    word-break: break-word;
    flex: 1;
    padding-left: 0;
}

.message.highlight {
    background-color: rgba(255, 0, 0, 0.1);
    border-radius: 4px;
    padding: 2px 4px;
}

/* Chat Input */
.chat-input-area {
    padding: 15px;
    border-top: 1px solid;
    flex-shrink: 0;
}

.input-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.toolbar-btn {
    padding: 5px 10px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
}

.input-wrapper {
    display: flex;
    gap: 10px;
}

#messageInput,
.channel-input {
    flex: 1;
    padding: 10px;
    border: 1px solid;
    border-radius: 5px;
    outline: none;
    font-size: 1rem;
}

#sendBtn,
.send-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

/* User Panel */
.user-panel {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid;
    height: 100%;
    background-color: var(--bg-secondary);
}

.user-panel[style*="display: none"] {
    display: none !important;
}

.user-panel-header {
    padding: 15px;
    border-bottom: 1px solid;
    flex-shrink: 0;
}

/* DESTAQUE PARA CONTADOR DE USUÁRIOS NO PAINEL */
.user-count-badge {
    background: linear-gradient(135deg, var(--accent-color), #0056b3);
    color: #ffffff !important;
    padding: 3px 10px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-left: 10px;
    box-shadow: 0 3px 8px rgba(0,123,255,0.4);
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.user-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.user-item {
    padding: 4px 8px;
    margin: 1px 0;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-size: 0.9rem;
    position: relative;
}

.user-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* BOLINHAS DE STATUS */
.user-item .user-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 0 1px var(--bg-primary);
}

.user-status.owner {
    background-color: #ffaa00;
    box-shadow: 0 0 6px #ffaa00, 0 0 0 1px var(--bg-primary);
}

.user-status.admin {
    background-color: #ff5500;
    box-shadow: 0 0 6px #ff5500, 0 0 0 1px var(--bg-primary);
}

.user-status.op {
    background-color: #ff4444;
    box-shadow: 0 0 6px #ff4444, 0 0 0 1px var(--bg-primary);
}

.user-status.halfop {
    background-color: #44aaff;
    box-shadow: 0 0 6px #44aaff, 0 0 0 1px var(--bg-primary);
}

.user-status.voice {
    background-color: #44ff44;
    box-shadow: 0 0 6px #44ff44, 0 0 0 1px var(--bg-primary);
}

.user-status.normal {
    background-color: #888;
    box-shadow: 0 0 0 1px var(--bg-primary);
}

/* Nome do usuário */
.user-nick {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    flex: 1;
}

/* BADGES DE STATUS */
.status-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.status-badge.owner {
    background-color: #ffaa0022;
    color: #ffaa00;
    border: 1px solid #ffaa0044;
}

.status-badge.admin {
    background-color: #ff550022;
    color: #ff5500;
    border: 1px solid #ff550044;
}

.status-badge.op {
    background-color: #ff444422;
    color: #ff4444;
    border: 1px solid #ff444444;
}

.status-badge.halfop {
    background-color: #44aaff22;
    color: #44aaff;
    border: 1px solid #44aaff44;
}

.status-badge.voice {
    background-color: #44ff4422;
    color: #44ff44;
    border: 1px solid #44ff4444;
}

/* EMOJI PICKER */
.emoji-picker {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 3000;
    width: 350px;
    max-height: 400px;
    display: none;
    animation: fadeIn 0.2s ease;
}

.emoji-picker-header {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    border-radius: 12px 12px 0 0;
}

.emoji-picker-header span {
    font-weight: 600;
    color: var(--text-primary);
}

.emoji-picker-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.emoji-picker-close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.emoji-picker-content {
    padding: 10px;
    overflow-y: auto;
    max-height: 340px;
}

.emoji-category {
    margin-bottom: 15px;
}

.emoji-category-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    padding: 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
}

.emoji-btn:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.2);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: none;
    z-index: 1000;
    min-width: 200px;
}

.context-menu ul {
    list-style: none;
    padding: 5px 0;
    margin: 0;
}

.context-menu li {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.context-menu li:hover {
    background-color: var(--bg-tertiary);
}

.context-menu li i {
    width: 20px;
    color: var(--accent-color);
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    min-width: 380px;
    max-width: 450px;
    color: var(--text-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: modalFadeIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--accent-color);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

/* Color Picker */
.color-picker {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.color-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-field label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px 4px 4px 12px;
}

.color-input-wrapper input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.color-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.modal-actions {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-tertiary);
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.modal-btn.cancel {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-btn.cancel:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.modal-btn.apply {
    background: var(--accent-color);
    color: white;
}

.modal-btn.apply:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
}

/* Animações */
@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: #888;
}

/* Estilos para mensagens de áudio */
.audio-message {
    margin: 5px 0;
}

.audio-message audio {
    max-width: 300px;
    height: 40px;
    vertical-align: middle;
}

.audio-message .audio-duration {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 5px;
}

/* Estilos para o botão de áudio quando gravando */
.toolbar-btn.recording {
    animation: pulse 1s infinite;
    position: relative;
}

.toolbar-btn.recording::after {
    content: attr(data-recording-time);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    background: var(--bg-tertiary);
    padding: 2px 5px;
    border-radius: 10px;
    white-space: nowrap;
}

/* Estilos para as janelas com input */
.chat-window .chat-input-area {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.chat-window .toolbar-btn {
    color: var(--text-primary);
}

.chat-window .toolbar-btn:hover {
    background-color: var(--bg-tertiary);
}

.chat-window .channel-input {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.chat-window .send-btn {
    background-color: var(--accent-color);
    color: white;
}

.chat-window .send-btn:hover {
    background-color: var(--accent-hover);
}

/* Ajustes para o tema claro */
.theme-light .audio-message audio {
    background-color: var(--bg-secondary);
    border-radius: 20px;
}

.theme-light .toolbar-btn.recording {
    background-color: #ff4444 !important;
    color: white !important;
}

/* Mobile layout */
.mobile-panel-toggle,
.mobile-overlay {
    display: none;
}

@media (max-width: 768px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }

    .app-container,
    .main-content,
    .chat-area,
    .chat-windows,
    .chat-window {
        min-height: 0;
    }

    .app-container {
        width: 100%;
        height: 100dvh;
        position: relative;
        overflow: hidden;
    }

    .main-content {
        width: 100%;
        height: 100dvh;
    }

    .chat-area {
        width: 100%;
        height: 100dvh;
    }

    .sidebar,
    .user-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        width: min(84vw, 320px);
        max-width: 320px;
        height: 100dvh;
        z-index: 1200;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
        transition: transform 0.25s ease;
        background: var(--bg-secondary);
    }

    .sidebar {
        left: 0;
        transform: translateX(-102%);
        border-right: 1px solid var(--border-color);
    }

    .user-panel {
        right: 0;
        transform: translateX(102%);
        border-left: 1px solid var(--border-color);
    }

    body.mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.mobile-users-open .user-panel {
        transform: translateX(0);
    }

    .mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 1100;
    }

    body.mobile-sidebar-open .mobile-overlay,
    body.mobile-users-open .mobile-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-panel-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 16px;
        width: 46px;
        height: 46px;
        border: none;
        border-radius: 50%;
        background: var(--accent-color);
        color: #fff;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
        z-index: 1300;
        cursor: pointer;
    }

    .mobile-panel-toggle.left-toggle {
        left: 16px;
    }

    .mobile-panel-toggle.right-toggle {
        right: 16px;
    }

    .tabs-container {
        padding: 8px 8px 0;
    }

    .tab {
        padding: 8px 10px;
        max-width: 70vw;
    }

    .radio-player {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 12px;
    }

    .radio-info,
    .radio-controls {
        width: 100%;
    }

    .radio-controls {
        justify-content: space-between;
    }

    .volume-control {
        flex: 1;
        justify-content: flex-end;
    }

    .volume-control input[type="range"] {
        width: min(110px, 35vw);
    }

    .chat-header {
        padding: 12px;
        align-items: flex-start;
    }

    .chat-header h3 {
        font-size: 1rem;
    }

    .chat-messages {
        padding: 10px;
    }

    .message {
        gap: 6px;
        flex-wrap: wrap;
    }

    .message .timestamp {
        min-width: auto;
        padding-right: 0;
        text-align: left;
    }

    .message .nickname,
    .message.private .nickname {
        min-width: auto;
        max-width: none;
        text-align: left;
        padding-right: 0;
    }

    .message .text,
    .message.private .text {
        flex-basis: 100%;
        width: 100%;
    }

    .chat-input-area {
        padding: 10px;
        background: var(--bg-secondary);
    }

    .input-toolbar {
        gap: 6px;
        margin-bottom: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .toolbar-btn {
        flex: 0 0 auto;
    }

    .input-wrapper {
        gap: 8px;
        align-items: center;
    }

    #messageInput,
    .channel-input {
        min-width: 0;
        font-size: 16px;
        padding: 12px;
    }

    #sendBtn,
    .send-btn {
        padding: 12px 14px;
        flex: 0 0 auto;
    }

    .sidebar-header,
    .user-panel-header,
    .user-controls {
        padding: 12px;
    }

    .refresh-btn span,
    .theme-btn .theme-text,
    .connection-status span:last-child {
        display: none;
    }

    .refresh-btn,
    .theme-btn {
        padding: 8px 10px;
    }

    .channel-list,
    .user-list {
        padding-bottom: 80px;
    }

    .user-item {
        padding: 8px;
    }

    .status-badge {
        font-size: 0.6rem;
        padding: 2px 5px;
    }
}

/* Mobile refinements - April 2026 */
.global-channel-topic {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.35;
}

.global-channel-topic.hidden {
    display: none;
}

.panel-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    min-height: 180px;
    padding: 20px 16px;
    color: var(--text-secondary);
}

.panel-empty-state i {
    font-size: 1.6rem;
    color: var(--accent-color);
}

.panel-empty-state strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.mobile-inline-notice {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.94);
    color: #fff;
    padding: 12px 16px;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    width: min(88vw, 360px);
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.35;
}

.mobile-inline-notice.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .sidebar,
    .user-panel {
        width: min(72vw, 280px);
        max-width: 280px;
    }

    .mobile-panel-toggle {
        top: calc(env(safe-area-inset-top, 0px) + 98px);
        bottom: auto;
        width: 44px;
        height: 44px;
        border-radius: 14px;
        background: color-mix(in srgb, var(--accent-color) 92%, black 8%);
    }

    .mobile-panel-toggle.left-toggle {
        left: 10px;
    }

    .mobile-panel-toggle.right-toggle {
        right: 10px;
    }

    .tabs-container {
        padding: 10px 10px 0;
    }

    .tab {
        padding: 10px 12px;
        font-size: 0.95rem;
        max-width: 72vw;
    }

    .radio-player {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 8px 12px;
        padding: 10px 14px;
    }

    .radio-info,
    .radio-controls {
        width: auto;
        min-width: 0;
    }

    .radio-info {
        gap: 8px;
    }

    .radio-logo {
        display: none;
    }

    .radio-details {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .radio-name {
        font-size: 1rem;
        white-space: nowrap;
    }

    .radio-status {
        font-size: 0.76rem;
        padding: 3px 8px;
        border-radius: 999px;
        background: var(--bg-tertiary);
        white-space: nowrap;
    }

    .radio-controls {
        gap: 8px;
        justify-self: end;
    }

    .radio-btn {
        width: 38px;
        height: 38px;
    }

    .volume-control {
        gap: 6px;
        min-width: 0;
    }

    .volume-control input[type="range"] {
        width: 78px;
    }

    .global-channel-topic {
        grid-column: 1 / -1;
        margin-top: 0;
        padding-top: 7px;
        font-size: 0.86rem;
    }

    .chat-header {
        padding: 12px 14px;
    }

    .chat-header h3 {
        font-size: 1.08rem;
    }

    .chat-header .topic {
        font-size: 0.86rem;
        line-height: 1.35;
        margin-top: 4px;
    }

    .chat-messages {
        padding: 12px 14px;
    }

    .message {
        font-size: 0.97rem;
        line-height: 1.45;
    }

    .message .timestamp {
        font-size: 0.8rem;
    }

    .message .nickname,
    .message.private .nickname {
        font-size: 0.94rem;
        font-weight: 700;
    }

    .chat-input-area {
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--border-color);
    }

    .input-toolbar {
        gap: 8px;
        margin-bottom: 10px;
    }

    .toolbar-btn {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 1rem;
    }

    #messageInput,
    .channel-input {
        font-size: 16px;
        padding: 14px 14px;
        border-radius: 14px;
    }

    #sendBtn,
    .send-btn {
        min-width: 48px;
        height: 48px;
        border-radius: 14px;
        padding: 0 14px;
    }

    .user-panel-header h4,
    .sidebar-header h2 {
        font-size: 1rem;
    }

    .user-item {
        padding: 10px 8px;
        gap: 8px;
    }

    .user-nick {
        font-size: 0.95rem;
    }

    .status-badge {
        font-size: 0.68rem;
        padding: 3px 6px;
    }
}

/* Mobile app-like polish v3 */
@media (max-width: 768px) {
    :root {
        --mobile-surface: color-mix(in srgb, var(--bg-secondary) 92%, black 8%);
        --mobile-surface-soft: color-mix(in srgb, var(--bg-tertiary) 88%, transparent 12%);
    }

    body {
        background: var(--bg-primary);
    }

    .tabs-container {
        position: sticky;
        top: 0;
        z-index: 25;
        padding: 10px 12px 8px;
        background: linear-gradient(180deg, color-mix(in srgb, var(--bg-primary) 94%, transparent 6%), color-mix(in srgb, var(--bg-secondary) 94%, transparent 6%));
        backdrop-filter: blur(10px);
        border-bottom: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent 20%);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }

    .tabs {
        gap: 8px;
        padding-bottom: 2px;
        scroll-snap-type: x proximity;
    }

    .tab {
        min-height: 42px;
        padding: 10px 14px;
        border: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent 25%);
        border-radius: 14px;
        background: color-mix(in srgb, var(--bg-secondary) 84%, var(--bg-primary) 16%);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
        margin-bottom: 0;
        scroll-snap-align: start;
    }

    .tab .tab-icon {
        width: 22px;
        text-align: center;
        opacity: 0.92;
    }

    .tab .tab-name {
        font-weight: 700;
        letter-spacing: 0.01em;
    }

    .tab.active {
        background: linear-gradient(135deg, color-mix(in srgb, var(--accent-color) 18%, var(--bg-secondary) 82%), color-mix(in srgb, var(--accent-color) 10%, var(--bg-secondary) 90%));
        border-color: color-mix(in srgb, var(--accent-color) 55%, var(--border-color) 45%);
        box-shadow: 0 8px 18px rgba(0, 123, 255, 0.18);
    }

    .tab-close {
        width: 22px;
        height: 22px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        margin-left: 4px;
        background: color-mix(in srgb, var(--bg-primary) 70%, transparent 30%);
        font-size: 0.95rem;
        line-height: 1;
    }

    .chat-window {
        background: linear-gradient(180deg, color-mix(in srgb, var(--bg-primary) 97%, transparent 3%), color-mix(in srgb, var(--bg-secondary) 97%, transparent 3%));
    }

    .chat-header {
        padding: 14px 16px 10px;
        background: transparent;
        border-bottom: none;
    }

    .chat-header h3 {
        font-size: 1.1rem;
        font-weight: 800;
        letter-spacing: -0.01em;
    }

    .chat-header .topic {
        opacity: 0.92;
        max-width: 100%;
    }

    .chat-messages {
        padding: 10px 12px 8px;
        gap: 8px;
        scroll-padding-bottom: 120px;
    }

    .message {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "meta meta"
            "body body";
        gap: 4px;
        padding: 10px 12px;
        border-radius: 16px;
        background: color-mix(in srgb, var(--bg-secondary) 92%, var(--bg-primary) 8%);
        border: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent 30%);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    }

    .message.system,
    .message.join,
    .message.part,
    .message.quit,
    .message.topic,
    .message.mode,
    .message.kick {
        background: color-mix(in srgb, var(--bg-tertiary) 78%, transparent 22%);
    }

    .message.private {
        background: linear-gradient(135deg, rgba(255, 190, 32, 0.12), color-mix(in srgb, var(--bg-secondary) 90%, transparent 10%));
        border-color: rgba(255, 190, 32, 0.22);
    }

    .message.highlight {
        background: linear-gradient(135deg, rgba(255, 80, 80, 0.16), color-mix(in srgb, var(--bg-secondary) 92%, transparent 8%));
        border-color: rgba(255, 80, 80, 0.28);
        padding: 10px 12px;
    }

    .message .timestamp,
    .message .nickname,
    .message.private .timestamp,
    .message.private .nickname {
        min-width: 0;
        max-width: none;
        text-align: left;
        padding-right: 0;
    }

    .message .timestamp,
    .message.private .timestamp {
        grid-area: meta;
        font-size: 0.76rem;
        letter-spacing: 0.01em;
        opacity: 0.78;
    }

    .message .nickname,
    .message.private .nickname {
        display: inline-block;
        margin-left: 6px;
        font-size: 0.92rem;
        font-weight: 800;
    }

    .message .text,
    .message.private .text {
        grid-area: body;
        width: 100%;
        font-size: 0.98rem;
        line-height: 1.5;
    }

    .chat-input-area {
        position: sticky;
        bottom: 0;
        z-index: 30;
        margin: 0 10px 10px;
        padding: 10px;
        background: color-mix(in srgb, var(--bg-secondary) 95%, transparent 5%);
        backdrop-filter: blur(12px);
        border: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent 22%);
        border-radius: 18px;
        box-shadow: 0 -2px 0 rgba(255,255,255,0.02), 0 10px 28px rgba(0, 0, 0, 0.16);
    }

    .input-toolbar {
        margin-bottom: 8px;
        padding-bottom: 2px;
        gap: 8px;
    }

    .toolbar-btn {
        background: color-mix(in srgb, var(--bg-tertiary) 88%, transparent 12%);
        border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent 28%);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .input-wrapper {
        align-items: flex-end;
        gap: 10px;
    }

    #messageInput,
    .channel-input {
        min-height: 50px;
        max-height: 124px;
        padding: 14px 16px;
        background: color-mix(in srgb, var(--bg-primary) 82%, var(--bg-secondary) 18%);
        border: 1px solid color-mix(in srgb, var(--border-color) 76%, transparent 24%);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    }

    #messageInput::placeholder,
    .channel-input::placeholder {
        color: var(--text-secondary);
        opacity: 0.86;
    }

    #sendBtn,
    .send-btn {
        min-width: 52px;
        height: 52px;
        border-radius: 16px;
        font-weight: 700;
        box-shadow: 0 10px 18px rgba(0, 123, 255, 0.28);
    }

    .mobile-panel-toggle {
        top: auto;
        bottom: calc(94px + env(safe-area-inset-bottom, 0px));
        width: 48px;
        height: 48px;
        border-radius: 16px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    }

    .mobile-panel-toggle.left-toggle {
        left: 12px;
    }

    .mobile-panel-toggle.right-toggle {
        right: 12px;
    }

    .sidebar,
    .user-panel {
        background: color-mix(in srgb, var(--bg-secondary) 96%, var(--bg-primary) 4%);
        backdrop-filter: blur(10px);
    }

    .channel-item,
    .user-item {
        min-height: 44px;
        border-radius: 12px;
    }

    .channel-item.active {
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color) 52%, transparent 48%), 0 6px 16px rgba(0, 123, 255, 0.14);
    }
}

/* Message experience refinement v4 - messenger style */
@media (max-width: 768px) {
    .chat-messages {
        padding: 12px 14px 6px;
        gap: 10px;
        background:
            radial-gradient(circle at top, color-mix(in srgb, var(--bg-secondary) 92%, transparent 8%), transparent 55%),
            linear-gradient(180deg, color-mix(in srgb, var(--bg-primary) 98%, transparent 2%), color-mix(in srgb, var(--bg-secondary) 98%, transparent 2%));
    }

    .message {
        position: relative;
        width: 100%;
        max-width: min(88vw, 640px);
        margin-right: auto;
        padding: 10px 12px 11px;
        border-radius: 18px 18px 18px 8px;
        background: linear-gradient(180deg, color-mix(in srgb, var(--bg-primary) 92%, white 8%), color-mix(in srgb, var(--bg-secondary) 96%, transparent 4%));
        border: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent 26%);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }

    .message::after {
        content: '';
        position: absolute;
        left: -1px;
        bottom: -1px;
        width: 12px;
        height: 12px;
        background: inherit;
        clip-path: polygon(0 100%, 100% 100%, 0 0);
        border-left: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent 26%);
        border-bottom: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent 26%);
        border-bottom-left-radius: 6px;
    }

    .message .timestamp,
    .message.private .timestamp {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin: 0;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: color-mix(in srgb, var(--text-secondary) 82%, transparent 18%);
    }

    .message .nickname,
    .message.private .nickname {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-left: 0;
        margin-top: 2px;
        font-size: 0.94rem;
        line-height: 1.2;
        color: var(--accent-color);
    }

    .message .nickname::before,
    .message.private .nickname::before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 999px;
        background: currentColor;
        opacity: 0.9;
        flex: 0 0 auto;
    }

    .message .text,
    .message.private .text {
        margin-top: 2px;
        font-size: 1rem;
        line-height: 1.52;
        color: var(--text-primary);
    }

    .message.system,
    .message.join,
    .message.part,
    .message.quit,
    .message.topic,
    .message.mode,
    .message.kick,
    .message.error {
        max-width: 100%;
        margin: 2px auto;
        padding: 8px 12px;
        border-radius: 999px;
        text-align: center;
        background: color-mix(in srgb, var(--bg-tertiary) 84%, transparent 16%);
        border-color: color-mix(in srgb, var(--border-color) 58%, transparent 42%);
        box-shadow: none;
    }

    .message.system::after,
    .message.join::after,
    .message.part::after,
    .message.quit::after,
    .message.topic::after,
    .message.mode::after,
    .message.kick::after,
    .message.error::after {
        display: none;
    }

    .message.system .timestamp,
    .message.join .timestamp,
    .message.part .timestamp,
    .message.quit .timestamp,
    .message.topic .timestamp,
    .message.mode .timestamp,
    .message.kick .timestamp,
    .message.error .timestamp {
        justify-content: center;
        width: 100%;
        font-size: 0.68rem;
        opacity: 0.72;
    }

    .message.system .nickname,
    .message.join .nickname,
    .message.part .nickname,
    .message.quit .nickname,
    .message.topic .nickname,
    .message.mode .nickname,
    .message.kick .nickname,
    .message.error .nickname {
        justify-content: center;
        width: 100%;
        font-size: 0.8rem;
        color: var(--text-secondary);
    }

    .message.system .nickname::before,
    .message.join .nickname::before,
    .message.part .nickname::before,
    .message.quit .nickname::before,
    .message.topic .nickname::before,
    .message.mode .nickname::before,
    .message.kick .nickname::before,
    .message.error .nickname::before {
        display: none;
    }

    .message.system .text,
    .message.join .text,
    .message.part .text,
    .message.quit .text,
    .message.topic .text,
    .message.mode .text,
    .message.kick .text,
    .message.error .text {
        margin-top: 0;
        text-align: center;
        font-size: 0.92rem;
        line-height: 1.42;
        color: var(--text-secondary);
    }

    .message.private {
        margin-left: auto;
        margin-right: 0;
        border-radius: 18px 18px 8px 18px;
        background: linear-gradient(180deg, color-mix(in srgb, var(--accent-color) 13%, var(--bg-primary) 87%), color-mix(in srgb, var(--accent-color) 8%, var(--bg-secondary) 92%));
        border-color: color-mix(in srgb, var(--accent-color) 24%, transparent 76%);
        box-shadow: 0 10px 24px rgba(0, 123, 255, 0.10);
    }

    .message.private::after {
        left: auto;
        right: -1px;
        clip-path: polygon(100% 100%, 100% 0, 0 100%);
        border-left: none;
        border-right: 1px solid color-mix(in srgb, var(--accent-color) 24%, transparent 76%);
        border-bottom: 1px solid color-mix(in srgb, var(--accent-color) 24%, transparent 76%);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 6px;
    }

    .message.private .nickname {
        color: color-mix(in srgb, var(--accent-color) 86%, white 14%);
    }

    .message.highlight {
        background: linear-gradient(180deg, rgba(255, 215, 100, 0.22), color-mix(in srgb, var(--bg-secondary) 95%, transparent 5%));
        border-color: rgba(255, 177, 0, 0.34);
    }

    .message.highlight .nickname {
        color: #ffb000;
    }

    .message a {
        font-weight: 600;
        text-decoration-thickness: 1.5px;
        text-underline-offset: 2px;
    }

    .chat-input-area {
        margin: 0 10px 10px;
        border-radius: 20px;
    }

    #messageInput,
    .channel-input {
        border-radius: 16px;
        font-size: 1rem;
    }
}


/* Visual refinement v5 - mobile + desktop polish */
:root {
    --chat-accent-rgb: 124, 58, 237;
    --chat-accent-2: #a855f7;
    --chat-accent-soft: rgba(124, 58, 237, 0.14);
}

.app-container {
    background: var(--bg-primary);
}

.sidebar {
    width: 218px;
}

.user-panel {
    width: 198px;
}

.tabs-container {
    padding: 8px 10px 0;
}

.tab {
    padding: 7px 12px;
    border-radius: 12px 12px 0 0;
}

.radio-player {
    padding: 10px 14px;
    gap: 12px;
}

.radio-logo {
    background: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2));
    box-shadow: 0 8px 18px rgba(var(--chat-accent-rgb), 0.28);
}

.radio-controls {
    gap: 10px;
}

.radio-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent 25%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--bg-tertiary) 88%, white 12%), color-mix(in srgb, var(--bg-secondary) 94%, transparent 6%));
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.radio-btn:hover {
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent-color) 80%, white 20%), var(--accent-color));
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(var(--chat-accent-rgb), 0.28);
}

.radio-btn.play-btn {
    background: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2));
    box-shadow: 0 10px 20px rgba(var(--chat-accent-rgb), 0.26);
}

.radio-btn.stop-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.22);
}

.volume-control {
    padding: 8px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-tertiary) 80%, transparent 20%);
    border: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent 22%);
}

.volume-control input[type="range"] {
    width: 92px;
    height: 5px;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2));
    box-shadow: 0 3px 8px rgba(var(--chat-accent-rgb), 0.35);
}

.chat-header {
    padding: 12px 14px;
}

.chat-header .topic,
.global-channel-topic {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chat-header .topic span[style],
.global-channel-topic span[style] {
    display: inline;
    padding: 0 0.12em;
    border-radius: 0.25em;
    text-shadow: 0 1px 1px rgba(0,0,0,0.45);
}

.chat-messages {
    padding: 12px 14px;
}

.message,
.message.private {
    max-width: min(78%, 780px);
}

.message .text,
.message.private .text,
.message .text *,
.message.private .text * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}

.user-panel-header {
    padding: 12px;
}

.user-list {
    padding: 8px;
}

.user-item {
    min-height: 40px;
    font-size: 0.98rem;
    padding: 7px 10px;
}

.user-item .user-status {
    width: 9px;
    height: 9px;
}

@media (max-width: 768px) {
    .sidebar {
        width: min(68vw, 270px);
        max-width: 270px;
    }

    .user-panel {
        width: min(58vw, 228px);
        max-width: 228px;
    }

    .mobile-panel-toggle {
        bottom: calc(104px + env(safe-area-inset-bottom, 0px));
        width: 50px;
        height: 50px;
        border-radius: 18px;
        background: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2));
        box-shadow: 0 14px 28px rgba(var(--chat-accent-rgb), 0.30);
    }

    .mobile-panel-toggle.left-toggle {
        left: 10px;
    }

    .mobile-panel-toggle.right-toggle {
        right: 10px;
    }

    .tabs-container {
        padding: 8px 10px 0;
    }

    .tab {
        padding: 9px 12px;
        max-width: 74vw;
        font-size: 0.98rem;
    }

    .radio-player {
        display: grid;
        grid-template-columns: minmax(0,1fr) auto;
        align-items: center;
        gap: 8px 10px;
        padding: 10px 12px 8px;
    }

    .radio-info {
        min-width: 0;
        width: 100%;
    }

    .radio-details {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: max-content;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .radio-name {
        font-size: 0.98rem;
        max-width: 40vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .radio-status {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 28px;
        max-width: calc(100vw - 190px);
        padding: 4px 10px;
        font-size: 0.74rem;
        line-height: 1.1;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .radio-controls {
        justify-self: end;
        gap: 8px;
    }

    .radio-btn {
        width: 42px;
        height: 42px;
        border-radius: 16px;
    }

    .volume-control {
        gap: 7px;
        padding: 7px 9px;
    }

    .volume-control i {
        font-size: 0.92rem;
    }

    .volume-control input[type="range"] {
        width: 64px;
    }

    .global-channel-topic {
        grid-column: 1 / -1;
        margin-top: 2px;
        padding-top: 7px;
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .chat-messages {
        padding: 12px 12px 6px;
    }

    .message,
    .message.private {
        width: min(100%, 100%);
        max-width: calc(100% - 8px);
        padding: 11px 12px 12px;
    }

    .message .nickname,
    .message.private .nickname {
        font-size: 0.98rem;
    }

    .message .text,
    .message.private .text {
        font-size: 1rem;
        line-height: 1.55;
    }

    .user-panel-header h4,
    .sidebar-header h2 {
        font-size: 1rem;
    }

    .user-list {
        padding: 8px 8px 84px;
    }

    .user-item {
        min-height: 44px;
        font-size: 1.04rem;
        padding: 9px 10px;
        border-radius: 12px;
    }

    .user-item .user-status {
        width: 10px;
        height: 10px;
    }
}


/* === Refino v7 estável: base v5 + correções seguras === */
:root {
    --chat-accent-rgb: 179, 18, 23;
    --chat-accent-2: #e52d27;
    --chat-accent-3: #8e0e00;
    --chat-accent-soft: rgba(179, 18, 23, 0.14);
}

/* Desktop: menos sufoco nas colunas */
.sidebar {
    width: 186px;
}

.user-panel {
    width: 198px;
}

/* Cabeçalho lateral: evita embolo entre Canais/Atualizar */
.sidebar-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    padding: 12px 12px 10px;
}

.sidebar-header h2 {
    justify-content: flex-start;
    gap: 8px;
    font-size: 1rem;
    min-width: 0;
}

.refresh-btn {
    justify-content: center;
    width: 100%;
    min-height: 38px;
    background: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2));
    border-color: color-mix(in srgb, var(--accent-hover) 72%, white 28%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(var(--chat-accent-rgb), 0.24);
}

.refresh-btn span,
.refresh-btn i {
    color: #fff;
}

.refresh-btn:hover,
.refresh-btn:focus-visible {
    background: linear-gradient(135deg, var(--chat-accent-2), var(--chat-accent-3));
    border-color: color-mix(in srgb, var(--chat-accent-2) 82%, white 18%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(var(--chat-accent-rgb), 0.34);
}

.refresh-btn:hover span,
.refresh-btn:hover i,
.refresh-btn:focus-visible span,
.refresh-btn:focus-visible i {
    color: #fff !important;
}

.refresh-btn.is-loading i {
    animation: spin 0.85s linear infinite;
}

/* Tema + conectado sem embolo */
.user-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    padding: 12px;
}

.theme-toggle {
    width: 100%;
}

.theme-btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--bg-tertiary) 92%, white 8%), color-mix(in srgb, var(--bg-secondary) 96%, transparent 4%));
    border-color: var(--border-color);
}

.theme-btn:hover,
.theme-btn:focus-visible {
    background: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2));
    border-color: color-mix(in srgb, var(--accent-hover) 72%, white 28%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(var(--chat-accent-rgb), 0.24);
}

.theme-btn:hover .theme-text,
.theme-btn:hover i,
.theme-btn:focus-visible .theme-text,
.theme-btn:focus-visible i {
    color: #fff !important;
}

.connection-status {
    width: 100%;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-tertiary) 72%, transparent 28%);
    white-space: nowrap;
}

.connection-status .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    background: var(--danger-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-color) 18%, transparent 82%);
}

.connection-status .status-indicator.connected {
    background: var(--success-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success-color) 18%, transparent 82%);
}

.connection-status .status-indicator.connecting {
    background: var(--warning-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning-color) 18%, transparent 82%);
    animation: pulse 1s infinite;
}

.connection-status .status-indicator.disconnected {
    background: var(--danger-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-color) 18%, transparent 82%);
}

/* Remove azul remanescente e troca por vermelho degradê */
.channel-item.active {
    background-color: color-mix(in srgb, var(--accent-color) 18%, var(--bg-secondary) 82%);
}

.channel-users,
.user-count-badge,
.radio-logo,
.radio-btn.play-btn,
#sendBtn,
.chat-window .send-btn,
.mobile-panel-toggle {
    background: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2)) !important;
}

.channel-users {
    box-shadow: 0 4px 10px rgba(var(--chat-accent-rgb), 0.34) !important;
}

.channel-item:hover .channel-users {
    box-shadow: 0 6px 15px rgba(var(--chat-accent-rgb), 0.45) !important;
}

.refresh-btn:hover,
.theme-btn:hover,
.radio-btn:hover,
#sendBtn:hover,
.chat-window .send-btn:hover {
    box-shadow: 0 10px 22px rgba(var(--chat-accent-rgb), 0.28);
}

/* Chat e abas menos sufocantes */
.tabs-container {
    padding: 6px 10px 0;
}

.tabs {
    gap: 6px;
}

.tab {
    padding: 6px 10px;
    border-radius: 12px 12px 0 0;
    font-size: 0.94rem;
}

.radio-player {
    padding: 10px 14px;
    gap: 10px 14px;
    align-items: center;
}

.radio-info {
    min-width: 0;
    flex: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.radio-logo {
    width: 38px;
    height: 38px;
    box-shadow: 0 4px 10px rgba(var(--chat-accent-rgb), 0.34);
}

.radio-details {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.radio-name {
    font-size: 0.98rem;
    line-height: 1.1;
}

.radio-status {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-tertiary) 82%, transparent 18%);
    color: var(--text-secondary);
    line-height: 1.2;
    white-space: normal;
}

/* Remove o tópico global ao lado da rádio */
.global-channel-topic {
    display: none !important;
}

/* Tópicos só no cabeçalho do canal, com cores IRC legíveis */
.chat-header .topic {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
    color: inherit;
    font-size: 0.92rem;
    line-height: 1.35;
}

.chat-header .topic span[style] {
    font-weight: inherit !important;
    text-shadow: none !important;
}

.chat-header .topic * {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Player mais profissional sem perder função */
.radio-controls {
    gap: 10px;
    flex-wrap: nowrap;
}

.radio-btn {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--border-color) 84%, white 16%);
    background: color-mix(in srgb, var(--bg-tertiary) 92%, white 8%);
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

.radio-btn.play-btn {
    color: #fff;
}

.radio-btn.stop-btn {
    background: linear-gradient(135deg, #6b7280, #374151);
    color: #fff;
}

.radio-btn.stop-btn:hover {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.volume-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 112px;
    padding: 6px 8px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-tertiary) 82%, transparent 18%);
}

.volume-control i {
    color: var(--text-primary);
}

.volume-control input[type="range"] {
    width: 88px;
    height: 5px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent-color) 65%, white 35%), color-mix(in srgb, var(--accent-hover) 72%, white 28%));
    border-radius: 999px;
}

.volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 5px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent-color) 65%, white 35%), color-mix(in srgb, var(--accent-hover) 72%, white 28%));
    border-radius: 999px;
}

.volume-control input[type="range"]::-moz-range-track {
    height: 5px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent-color) 65%, white 35%), color-mix(in srgb, var(--accent-hover) 72%, white 28%));
    border-radius: 999px;
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--chat-accent-rgb), 0.24);
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    width: 13px;
    height: 13px;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(var(--chat-accent-rgb), 0.24);
}

.chat-messages {
    padding-top: 8px;
}

.message,
.message.private {
    max-width: min(74%, 760px);
}

.message .text,
.message.private .text,
.message .text *,
.message.private .text * {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: pre-wrap !important;
}

/* Lista de usuários mais compacta, mas sem cortar Nick */
.user-panel-header {
    padding: 12px;
}

.user-list {
    padding: 10px 8px 84px;
}

.user-item {
    padding: 7px 8px;
    gap: 7px;
}

.user-nick {
    font-size: 0.98rem;
    font-weight: 700;
}

/* Toolbar centralizada */
.input-toolbar {
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Botão enviar com hover de volta */
#sendBtn,
.chat-window .send-btn {
    box-shadow: 0 10px 18px rgba(var(--chat-accent-rgb), 0.22);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

#sendBtn:hover,
.chat-window .send-btn:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.06);
    color: #fff;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar,
    .user-panel {
        width: min(72vw, 260px);
        max-width: 260px;
    }

    .user-panel {
        width: min(56vw, 216px);
        max-width: 216px;
    }

    .sidebar-header,
    .user-controls,
    .user-panel-header {
        padding: 12px 10px;
    }

    .sidebar-header h2,
    .user-panel-header h4 {
        font-size: 1rem;
    }

    .mobile-panel-toggle {
        bottom: calc(102px + env(safe-area-inset-bottom, 0px));
        width: 48px;
        height: 48px;
        border-radius: 16px;
        box-shadow: 0 12px 24px rgba(var(--chat-accent-rgb), 0.28);
    }

    .tabs-container {
        padding: 6px 8px 0;
    }

    .tab {
        max-width: 64vw;
        padding: 8px 10px;
        font-size: 0.95rem;
    }

    .radio-player {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 10px 12px;
    }

    .radio-info {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .radio-controls {
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .radio-status {
        width: 100%;
        max-width: none;
        border-radius: 12px;
    }

    .message,
    .message.private {
        max-width: calc(100% - 2px);
        width: calc(100% - 2px);
    }

    .user-list {
        padding-bottom: 92px;
    }

    .user-item {
        padding: 9px 8px;
    }

    .user-nick {
        font-size: 1.05rem;
    }

    .status-badge {
        font-size: 0.62rem;
        padding: 2px 5px;
    }
}

/* Tema conectado em duas linhas só se precisar */
@media (min-width: 769px) {
    .sidebar-header .refresh-btn,
    .user-controls .theme-btn,
    .user-controls .connection-status {
        width: 100%;
    }
}

/* Linha do volume visível em tema claro/escuro */
.theme-light .volume-control,
.theme-dark .volume-control {
    border: 1px solid color-mix(in srgb, var(--border-color) 84%, white 16%);
}

/* Tópico com cores IRC herdando legibilidade do tema */
.theme-dark .chat-header .topic {
    color: var(--text-secondary);
}

.theme-light .chat-header .topic {
    color: var(--text-secondary);
}


/* ===== v9 targeted fixes ===== */
:root {
    --chat-accent-rgb: 179, 18, 23;
    --chat-accent-2: #d7262d;
    --chat-accent-3: #ff5a5f;
}

.sidebar {
    width: 228px !important;
}

.user-panel {
    width: 188px !important;
}

.sidebar-header {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px;
    align-items: center;
}

.sidebar-header h2,
.user-panel-header h4 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.sidebar-header h2 i,
.user-panel-header h4 i {
    margin: 0;
}

.refresh-btn {
    width: fit-content !important;
    min-width: 0 !important;
    margin: 0 auto;
    padding: 6px 12px !important;
}

.refresh-btn span,
.theme-btn .theme-text {
    display: inline !important;
}

.user-controls {
    justify-items: center;
    text-align: center;
}

.theme-btn {
    width: fit-content !important;
    min-width: 110px;
    margin: 0 auto;
}

.connection-status {
    width: fit-content !important;
    margin: 0 auto;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.connection-status .status-label {
    display: inline !important;
}

.channel-users,
.user-count-badge {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    box-shadow: 0 6px 14px rgba(var(--chat-accent-rgb), 0.28) !important;
}

.channel-users,
.user-count-badge,
.radio-btn.play-btn,
#sendBtn,
.chat-window .send-btn,
.mobile-panel-toggle,
.radio-logo {
    background: #8f1117 !important;
}

.refresh-btn:hover,
.theme-btn:hover,
.radio-btn:hover,
#sendBtn:hover,
.chat-window .send-btn:hover,
.mobile-panel-toggle:hover {
    box-shadow: 0 10px 24px rgba(var(--chat-accent-rgb), 0.32) !important;
}

.radio-player {
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    gap: 10px 14px !important;
}

.radio-info {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
}

.radio-logo {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    overflow: hidden;
    display: grid !important;
    place-items: center !important;
}

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

.radio-logo i {
    display: none !important;
}

.radio-details {
    display: grid !important;
    grid-template-columns: auto auto !important;
    align-items: center !important;
    justify-content: start !important;
    gap: 4px 10px !important;
}

.radio-name {
    font-weight: 700;
}

.radio-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    opacity: 0.9;
    justify-self: start;
}

.radio-status {
    grid-column: 1 / -1;
    width: 100%;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.radio-controls {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.radio-btn {
    opacity: 1 !important;
    align-self: center !important;
}

.radio-btn.play-btn {
    width: 40px !important;
    height: 40px !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    color: #fff !important;
}

.volume-control {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: color-mix(in srgb, var(--bg-tertiary) 82%, transparent 18%) !important;
}

.volume-control i {
    color: var(--accent-color) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.volume-control input[type="range"],
.volume-control input[type="range"]::-webkit-slider-runnable-track,
.volume-control input[type="range"]::-moz-range-track {
    background: #8f1117 !important;
}

.volume-control input[type="range"]::-webkit-slider-thumb,
.volume-control input[type="range"]::-moz-range-thumb {
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(var(--chat-accent-rgb), 0.28) !important;
}

/* Remove floating/extra player overlays if any */
.radio-floating-btn,
.floating-volume-btn,
.player-floating-btn,
.radio-volume-float,
.radio-mini-toggle {
    display: none !important;
}

.chat-header .topic {
    color: inherit !important;
    font-weight: 400 !important;
    text-shadow: none !important;
}

.chat-header .topic,
.chat-header .topic *,
.global-channel-topic,
.global-channel-topic * {
    font-style: normal !important;
    font-weight: 400 !important;
    text-shadow: none !important;
}

.chat-header .topic span[style],
.global-channel-topic span[style] {
    display: inline !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    text-shadow: none !important;
    font-weight: 400 !important;
}

.theme-dark .message.system,
.theme-light .message.system,
.theme-dark .message.system .text,
.theme-light .message.system .text,
.theme-dark .message.system .nickname,
.theme-light .message.system .nickname {
    font-style: normal !important;
}

.message,
.message.private {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 0 10px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    background: color-mix(in srgb, var(--bg-secondary) 78%, transparent 22%) !important;
    box-shadow: none !important;
    border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent 12%) !important;
}

.message.private {
    background: color-mix(in srgb, var(--bg-secondary) 66%, var(--accent-color) 34%) !important;
}

.message::after,
.message::before,
.message.private::after,
.message.private::before {
    display: none !important;
    content: none !important;
}

.message .text,
.message.private .text,
.message .text *,
.message.private .text * {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: pre-wrap !important;
}

/* kill remaining blue */
.tab.active,
.channel-item.active,
.refresh-btn:hover,
.theme-btn:hover,
.tab.highlight,
.user-item:hover,
.toolbar-btn:hover,
.mobile-panel-toggle,
.radio-btn.play-btn,
#sendBtn,
.chat-window .send-btn {
    box-shadow: 0 8px 18px rgba(var(--chat-accent-rgb), 0.24) !important;
}

.user-nick {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .sidebar {
        width: min(68vw, 230px) !important;
        max-width: 230px !important;
    }

    .user-panel {
        width: min(60vw, 210px) !important;
        max-width: 210px !important;
    }

    .sidebar-header h2,
    .user-panel-header h4 {
        justify-content: center !important;
    }

    .refresh-btn,
    .theme-btn {
        width: fit-content !important;
        min-width: 96px !important;
        padding: 6px 10px !important;
        font-size: 0.84rem !important;
    }

    .refresh-btn span,
    .theme-btn .theme-text,
    .connection-status .status-label {
        display: inline !important;
    }

    .mobile-panel-toggle {
        bottom: calc(118px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .radio-player {
        grid-template-columns: 1fr !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .radio-details {
        grid-template-columns: 1fr auto !important;
        gap: 4px 8px !important;
    }

    .radio-status {
        grid-column: 1 / -1;
    }

    .radio-controls {
        justify-content: space-between !important;
    }

    .user-nick {
        font-size: 1.08rem !important;
    }
}


/* v10 targeted fixes */
.radio-logo {
    background: #fff url("https://radioflow.com.br/favicon-48x48.png") center/72% no-repeat !important;
    padding: 0 !important;
}
.radio-logo.logo-fallback {
    background: #fff url("https://radioflow.com.br/favicon-48x48.png") center/72% no-repeat !important;
}
.radio-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #fff !important;
}

.radio-player .radio-logo,
.radio-player .radio-btn.play-btn,
.radio-player .radio-btn.stop-btn,
.radio-player .volume-toggle-btn {
    background-image: #8e0e00 !important;
}

.volume-control {
    align-items: center !important;
}

.volume-toggle-btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    opacity: 1 !important;
    box-shadow: 0 8px 18px rgba(var(--chat-accent-rgb), 0.24);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.volume-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(var(--chat-accent-rgb), 0.3);
    filter: brightness(1.04);
}
.volume-toggle-btn i {
    color: #fff !important;
    font-size: 1rem;
    line-height: 1;
}
.volume-toggle-btn .mute-mark {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0,0,0,.28);
}
.volume-toggle-btn.muted .mute-mark {
    display: flex !important;
}
.volume-toggle-btn.muted i {
    opacity: .55;
}

.volume-control input[type="range"] {
    accent-color: #d7262d !important;
    background: #8e0e00 !important;
}
.volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 6px !important;
    border-radius: 999px !important;
    background: #8e0e00 !important;
}
.volume-control input[type="range"]::-moz-range-track {
    height: 6px !important;
    border-radius: 999px !important;
    background: #8e0e00 !important;
}
.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    margin-top: -5px !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    border: 0 !important;
    background: #d7262d !important;
    box-shadow: 0 0 0 3px rgba(var(--chat-accent-rgb), 0.22) !important;
}
.volume-control input[type="range"]::-moz-range-thumb {
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    border: 0 !important;
    background: #d7262d !important;
    box-shadow: 0 0 0 3px rgba(var(--chat-accent-rgb), 0.22) !important;
}

.message, .message.system, .message.notice, .message.welcome, .message.join, .message.part, .message.quit, .message.nick, .message.topic, .message.error {
    font-style: normal !important;
}

.chat-header .topic,
.chat-header .topic *,
.global-channel-topic,
.global-channel-topic * {
    font-weight: inherit !important;
    color: inherit !important;
}
.chat-header .topic span[style],
.global-channel-topic span[style] {
    color: unset !important;
}


/* ===== v11 targeted fixes ===== */
:root {
    --chat-accent-rgb: 184, 16, 28 !important;
    --accent-color: #b8101c !important;
    --accent-hover: #df2432 !important;
}

/* kill remaining blue shadows/highlights */
.radio-logo,
.user-count-badge,
.channel-users,
.radio-btn.play-btn,
#sendBtn,
.chat-window .send-btn,
.mobile-panel-toggle,
.refresh-btn:hover,
.theme-btn:hover,
.radio-btn:hover,
#sendBtn:hover,
.chat-window .send-btn:hover,
.channel-item.active,
.tab.active {
    box-shadow: 0 8px 20px rgba(184,16,28,0.28) !important;
}

.radio-logo {
    background: #8f1117 !important;
    box-shadow: 0 10px 20px rgba(184,16,28,0.30) !important;
}
.radio-logo.logo-fallback::after {
    content: "RF";
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
}

/* channel list topics */
.channel-item {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
    align-items: start !important;
}
.channel-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.channel-topic-preview {
    display: block;
    font-size: 0.81rem;
    line-height: 1.25;
    color: var(--text-secondary);
    opacity: 0.96;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin-left: 2px;
}
.channel-topic-preview span[style] {
    font-weight: inherit !important;
    text-shadow: none !important;
}

/* keep IRC colors in channel header topics */
.chat-header .topic,
.chat-header .topic *,
.channel-topic-preview,
.channel-topic-preview * {
    font-style: normal !important;
    text-shadow: none !important;
}
.chat-header .topic {
    display: block !important;
    color: var(--text-secondary) !important;
    font-weight: 400 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}
.chat-header .topic span[style],
.channel-topic-preview span[style] {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-weight: inherit !important;
    color: inherit;
}

/* messages as strips, no bubble overflow */
.message,
.message.private,
.message.system,
.message.join,
.message.part,
.message.quit,
.message.topic,
.message.mode,
.message.kick,
.message.error,
.message.welcome {
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    grid-template-areas:
        "time nick"
        "text text" !important;
    gap: 4px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 8px !important;
    padding: 9px 10px !important;
    border-radius: 10px !important;
    border: 1px solid color-mix(in srgb, var(--border-color) 86%, transparent 14%) !important;
    background: color-mix(in srgb, var(--bg-secondary) 84%, transparent 16%) !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
.message .timestamp {
    grid-area: time !important;
    margin: 0 !important;
    white-space: nowrap !important;
    align-self: start;
}
.message .nickname {
    grid-area: nick !important;
    margin: 0 !important;
    align-self: start;
    font-size: 0.98rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
}
.message .text {
    grid-area: text !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: pre-wrap !important;
}
.message.private .nickname,
.message .nickname[data-nick="Papinho"] {
    color: color-mix(in srgb, var(--accent-color) 86%, white 14%) !important;
}
.message.system .nickname,
.message.error .nickname,
.message.welcome .nickname,
.message.join .nickname,
.message.part .nickname,
.message.quit .nickname,
.message.kick .nickname,
.message.mode .nickname,
.message.topic .nickname {
    font-style: normal !important;
}

/* desktop/mobilenick placement and size */
@media (max-width: 768px) {
    .message,
    .message.private,
    .message.system,
    .message.join,
    .message.part,
    .message.quit,
    .message.topic,
    .message.mode,
    .message.kick,
    .message.error,
    .message.welcome {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "nick"
            "time"
            "text" !important;
        gap: 3px !important;
        padding: 9px 10px !important;
    }
    .message .nickname {
        font-size: 1.06rem !important;
        line-height: 1.2 !important;
    }
    .message .timestamp {
        font-size: 0.72rem !important;
    }
}

/* radio */
.radio-meta {
    color: var(--text-secondary) !important;
}
.volume-control {
    align-items: center !important;
}
.volume-toggle-btn {
    opacity: 1 !important;
    align-self: center !important;
    margin: 0 !important;
    transform: none !important;
    color: #fff !important;
    background: #8f1117 !important;
    border-color: color-mix(in srgb, var(--accent-hover) 72%, white 28%) !important;
    box-shadow: 0 8px 18px rgba(184,16,28,0.24) !important;
}
.volume-toggle-btn:hover {
    box-shadow: 0 10px 22px rgba(184,16,28,0.32) !important;
    color: #fff !important;
}
.volume-toggle-btn i,
.volume-toggle-btn .mute-mark {
    color: #fff !important;
}
.volume-control input[type="range"],
.volume-control input[type="range"]::-webkit-slider-runnable-track,
.volume-control input[type="range"]::-moz-range-track {
    background: #8f1117 !important;
}
.volume-control input[type="range"]::-webkit-slider-thumb,
.volume-control input[type="range"]::-moz-range-thumb {
    background: #c81d25 !important;
    border: 2px solid #fff !important;
    box-shadow: 0 0 0 3px rgba(184,16,28,0.24) !important;
}

/* connection status centering */
.user-controls {
    justify-items: center !important;
}
.connection-status {
    justify-content: center !important;
    text-align: center !important;
}

/* larger mobile username list if needed */
@media (max-width: 768px) {
    .user-nick {
        font-size: 1.12rem !important;
    }
}

/* ===== v12 focused fixes ===== */
:root {
    --accent-primary: #c1121f;
    --accent-secondary: #8b1020;
    --accent-soft: rgba(193,18,31,0.18);
    --accent-strong: rgba(193,18,31,0.38);
}

body.theme-dark,
body.theme-light {
    --primary-color: var(--accent-primary);
    --secondary-color: var(--accent-secondary);
}

/* remove leftover blue-ish glows */
.radio-logo,
.radio-player .radio-logo,
.radio-player .radio-btn,
.radio-player .volume-toggle-btn,
.refresh-btn,
.send-btn,
#sendBtn,
.toolbar-btn,
.theme-btn,
.channel-users,
.status-badge,
.user-panel-count {
    box-shadow: 0 10px 24px rgba(193,18,31,0.16) !important;
}

.radio-logo img,
.radio-player .radio-logo img {
    filter: drop-shadow(0 0 10px rgba(193,18,31,0.35)) !important;
}

/* channel header alignment */
.sidebar-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center !important;
    gap: 10px 12px !important;
}
.sidebar-header h2 {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0;
    margin: 0 !important;
}
.sidebar-header .refresh-btn {
    justify-self: end;
    align-self: center;
    min-height: 38px;
}
.channel-list {
    padding-top: 8px !important;
}
.channel-item {
    align-items: flex-start !important;
}
.channel-main {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}
.channel-users,
.user-panel-count,
.chat-header .user-count,
.user-count {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* no italics for server/system text */
.message.system,
.message.system .text,
.message.error,
.message.error .text,
.message.join,
.message.part,
.message.quit,
.message.nick,
.message.kick,
.message.mode,
.radio-status.connecting {
    font-style: normal !important;
}

/* conversation strips instead of bubbles */
.message {
    display: grid !important;
    grid-template-columns: auto minmax(0,1fr);
    grid-template-areas: "time body";
    gap: 8px;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02)) !important;
    border-left: 3px solid rgba(193,18,31,0.65) !important;
    overflow: hidden !important;
}
.message .timestamp {
    grid-area: time;
    align-self: start;
    white-space: nowrap;
}
.message .nickname,
.message .text {
    min-width: 0;
}
.message .text {
    grid-area: body;
    display: inline !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: pre-wrap !important;
}
.message .nickname {
    margin-right: 6px;
}
.message .text a,
.message .text span,
.message .text strong,
.message .text em,
.message .text u {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}
.message.system,
.message.error,
.message.join,
.message.part,
.message.quit,
.message.nick,
.message.kick,
.message.mode {
    border-left-color: rgba(193,18,31,0.4) !important;
    background: rgba(193,18,31,0.06) !important;
}

/* radio controls */
.radio-player {
    grid-template-columns: minmax(0,1fr) auto !important;
}
.radio-controls {
    align-items: center !important;
}
.volume-control {
    align-items: center !important;
}
.volume-toggle-btn,
.volume-toggle-btn:hover,
.volume-toggle-btn:focus-visible {
    background: linear-gradient(135deg, #d62839, #9d1023) !important;
    opacity: 1 !important;
    transform: none;
}
.volume-toggle-btn i,
.volume-toggle-btn .mute-mark {
    color: #fff !important;
}
.volume-control input[type="range"],
.volume-control input[type="range"]::-webkit-slider-runnable-track,
.volume-control input[type="range"]::-moz-range-track {
    background: linear-gradient(90deg, #d62839, #9d1023) !important;
}
.volume-control input[type="range"]::-webkit-slider-thumb,
.volume-control input[type="range"]::-moz-range-thumb {
    background: #d62839 !important;
    border-color: #7f0d1a !important;
}

/* remove stray floating player controls */
.radio-floating-btn,
.floating-volume-btn,
.player-floating-btn,
.radio-volume-float,
[class*="radio-floating"],
[class*="player-floating"],
[class*="volume-floating"] {
    display: none !important;
}

/* connection status plain and centered */
.user-controls {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px !important;
}
.theme-toggle,
.connection-status {
    justify-content: center !important;
}
.connection-status {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    min-height: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100%;
}
.connection-status .status-label {
    line-height: 1;
}

/* topics with IRC colors only */
.channel-topic-preview,
.topic,
.chat-header .topic,
.header-info .topic {
    color: inherit !important;
    font-weight: 400 !important;
    text-shadow: none !important;
}
.channel-topic-preview * ,
.topic *,
.chat-header .topic * {
    font-weight: inherit !important;
    text-shadow: none !important;
}

/* user list width and names */
.user-panel {
    min-width: 190px !important;
    width: 190px !important;
}
.user-item {
    grid-template-columns: auto minmax(0,1fr) auto !important;
    align-items: center !important;
}
.user-item .user-nick {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* emoji picker upward and visible */
.emoji-picker {
    max-height: min(340px, 55vh) !important;
    z-index: 10050 !important;
}
.emoji-picker-content {
    max-height: calc(min(340px, 55vh) - 52px) !important;
}

/* mobile */
@media (max-width: 768px) {
    .sidebar-header {
        grid-template-columns: 1fr !important;
        justify-items: stretch;
    }
    .sidebar-header h2 {
        justify-content: center !important;
    }
    .sidebar-header .refresh-btn {
        justify-self: center;
        width: auto;
        padding-inline: 14px;
    }
    .refresh-btn span,
    .theme-btn .theme-text,
    .connection-status .status-label {
        display: inline !important;
    }
    .user-panel {
        width: 220px !important;
        min-width: 220px !important;
        max-width: 78vw !important;
    }
    .user-item .user-nick {
        font-size: 1rem !important;
        font-weight: 700 !important;
    }
    .message {
        grid-template-columns: auto 1fr !important;
        grid-template-areas: "time nick" "time text" !important;
        row-gap: 4px;
        column-gap: 8px;
    }
    .message .nickname {
        grid-area: nick;
        display: block !important;
        margin: 0 !important;
        font-size: 0.98rem !important;
    }
    .message .text {
        grid-area: text;
        display: block !important;
        margin: 0 !important;
    }
    .radio-player {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    .radio-controls {
        width: 100%;
        justify-content: space-between;
    }
    .volume-control {
        flex: 1 1 auto;
        min-width: 0;
    }
}


/* v13 targeted fixes */
.channel-name {
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

.sidebar .channel-item {
    align-items: stretch !important;
}

.channel-topic-preview:empty {
    display: none !important;
}

.channel-users, .user-panel-count, .chat-header .user-count, .user-count {
    border-radius: 9999px !important;
}

.connection-status, .connection-status span {
    align-items: center;
}


/* v14 focused fixes */
.channel-item { align-items: center !important; }
.channel-main { min-height: 34px; }
.channel-name { font-size: 1rem !important; font-weight: 700 !important; line-height: 1.15 !important; }
.channel-topic-preview { display: none !important; }


/* v16 radio mobile cleanup */
.radio-player {
  align-items: center;
}
.radio-info {
  display: grid;
  grid-template-columns: 56px minmax(0,1fr);
  align-items: center;
  gap: 12px;
}
.radio-logo {
  box-shadow: 0 10px 28px rgba(190, 24, 49, 0.22) !important;
}
.radio-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.radio-btn.stop-btn { display:none !important; }
.radio-btn.play-btn {
  width: 60px;
  min-width: 60px;
  height: 60px;
  border-radius: 20px;
  background: linear-gradient(135deg, #b91c1c, #ef4444) !important;
  box-shadow: 0 14px 30px rgba(190,24,49,.28);
  opacity: 1 !important;
}
.radio-btn.play-btn:hover,
.radio-btn.play-btn.is-playing {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(190,24,49,.33);
}
.volume-control {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(127,29,29,.08);
}
.volume-toggle-btn {
  width: 54px !important;
  height: 54px !important;
  border-radius: 18px !important;
  background: linear-gradient(135deg, #b91c1c, #ef4444) !important;
  color: #fff !important;
  box-shadow: 0 12px 26px rgba(190,24,49,.24) !important;
  opacity: 1 !important;
}
.volume-toggle-btn .mute-mark { display:none !important; }
.volume-toggle-btn.muted {
  background: linear-gradient(135deg, #7f1d1d, #dc2626) !important;
}
.volume-toggle-btn i {
  color: #fff !important;
  font-size: 1.1rem;
}
.volume-control input[type="range"] {
  flex: 1;
  margin: 0;
  accent-color: #dc2626;
}
.volume-control input[type="range"]::-webkit-slider-runnable-track {
  height: 6px !important;
  background: linear-gradient(90deg, #b91c1c, #ef4444) !important;
  border-radius: 999px;
}
.volume-control input[type="range"]::-moz-range-track {
  height: 6px !important;
  background: linear-gradient(90deg, #b91c1c, #ef4444) !important;
  border-radius: 999px;
}
.volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dc2626 !important;
  border: 3px solid #fff !important;
  margin-top: -8px;
  box-shadow: 0 6px 12px rgba(220,38,38,.28);
}
.volume-control input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dc2626 !important;
  border: 3px solid #fff !important;
  box-shadow: 0 6px 12px rgba(220,38,38,.28);
}
@media (max-width: 768px) {
  .radio-player {
    padding: 14px 16px !important;
    gap: 12px !important;
  }
  .radio-info {
    grid-template-columns: 46px minmax(0,1fr);
    gap: 10px;
  }
  .radio-details {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas:
      "name status"
      "meta meta";
    align-items: center;
    gap: 2px 10px;
  }
  .radio-name { grid-area: name; font-size: 1.05rem !important; }
  .radio-status { grid-area: status; text-align: right; white-space: nowrap; font-size: .9rem !important; }
  .radio-meta { grid-area: meta; font-size: .82rem !important; opacity: .82; }
  .radio-controls {
    gap: 10px;
  }
  .radio-btn.play-btn {
    width: 52px;
    min-width: 52px;
    height: 52px;
    border-radius: 18px;
  }
  .volume-control {
    min-height: 52px;
    padding: 0 12px;
    border-radius: 18px;
  }
  .volume-toggle-btn {
    width: 46px !important;
    height: 46px !important;
    border-radius: 15px !important;
  }
}


/* ===== v29 final message layout override ===== */
/* Objetivo:
   - Desktop: linha 1 = relógio + nick; linha 2 = mensagem em largura total
   - Mobile: mesmo padrão para mensagens normais e de sistema
   - Welcome: sem relógio oculto nem espaço fantasma
*/

@media (min-width: 769px) {
  .chat-messages .message,
  .chat-messages .message.private,
  .chat-messages .message.system,
  .chat-messages .message.error,
  .chat-messages .message.join,
  .chat-messages .message.part,
  .chat-messages .message.quit,
  .chat-messages .message.nick,
  .chat-messages .message.kick,
  .chat-messages .message.mode,
  .chat-messages .message.topic {
    display: grid !important;
    grid-template-columns: 52px minmax(0, 1fr) !important;
    grid-template-areas:
      "time nick"
      "text text" !important;
    gap: 2px 6px !important;
    column-gap: 6px !important;
    align-items: start !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 8px !important;
    padding: 8px 10px !important;
    overflow: visible !important;
  }

  .chat-messages .message .timestamp,
  .chat-messages .message.private .timestamp,
  .chat-messages .message.system .timestamp,
  .chat-messages .message.error .timestamp,
  .chat-messages .message.join .timestamp,
  .chat-messages .message.part .timestamp,
  .chat-messages .message.quit .timestamp,
  .chat-messages .message.nick .timestamp,
  .chat-messages .message.kick .timestamp,
  .chat-messages .message.mode .timestamp,
  .chat-messages .message.topic .timestamp {
    grid-area: time !important;
    min-width: 52px !important;
    width: 52px !important;
    max-width: 52px !important;
    margin: 0 !important;
    padding-right: 2px !important;
    text-align: right !important;
    white-space: nowrap !important;
    align-self: start !important;
  }

  .chat-messages .message .nickname,
  .chat-messages .message.private .nickname,
  .chat-messages .message.system .nickname,
  .chat-messages .message.error .nickname,
  .chat-messages .message.join .nickname,
  .chat-messages .message.part .nickname,
  .chat-messages .message.quit .nickname,
  .chat-messages .message.nick .nickname,
  .chat-messages .message.kick .nickname,
  .chat-messages .message.mode .nickname,
  .chat-messages .message.topic .nickname {
    grid-area: nick !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding-right: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: unset !important;
    align-self: start !important;
  }

  .chat-messages .message .text,
  .chat-messages .message.private .text,
  .chat-messages .message.system .text,
  .chat-messages .message.error .text,
  .chat-messages .message.join .text,
  .chat-messages .message.part .text,
  .chat-messages .message.quit .text,
  .chat-messages .message.nick .text,
  .chat-messages .message.kick .text,
  .chat-messages .message.mode .text,
  .chat-messages .message.topic .text {
    grid-area: text !important;
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: pre-wrap !important;
    line-height: 1.45 !important;
  }

  .chat-messages .message.welcome {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "nick"
      "text" !important;
    gap: 2px !important;
    align-items: start !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 8px !important;
    padding: 8px 10px !important;
  }

  .chat-messages .message.welcome .timestamp {
    display: none !important;
  }

  .chat-messages .message.welcome .nickname,
  .chat-messages .message.welcome .text {
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

@media (max-width: 768px) {
  .chat-messages .message,
  .chat-messages .message.private,
  .chat-messages .message.system,
  .chat-messages .message.error,
  .chat-messages .message.join,
  .chat-messages .message.part,
  .chat-messages .message.quit,
  .chat-messages .message.nick,
  .chat-messages .message.kick,
  .chat-messages .message.mode,
  .chat-messages .message.topic {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    grid-template-areas:
      "time nick"
      "text text" !important;
    gap: 2px 6px !important;
    column-gap: 6px !important;
    align-items: start !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .chat-messages .message .timestamp,
  .chat-messages .message.private .timestamp,
  .chat-messages .message.system .timestamp,
  .chat-messages .message.error .timestamp,
  .chat-messages .message.join .timestamp,
  .chat-messages .message.part .timestamp,
  .chat-messages .message.quit .timestamp,
  .chat-messages .message.nick .timestamp,
  .chat-messages .message.kick .timestamp,
  .chat-messages .message.mode .timestamp,
  .chat-messages .message.topic .timestamp {
    grid-area: time !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding-right: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  .chat-messages .message .nickname,
  .chat-messages .message.private .nickname,
  .chat-messages .message.system .nickname,
  .chat-messages .message.error .nickname,
  .chat-messages .message.join .nickname,
  .chat-messages .message.part .nickname,
  .chat-messages .message.quit .nickname,
  .chat-messages .message.nick .nickname,
  .chat-messages .message.kick .nickname,
  .chat-messages .message.mode .nickname,
  .chat-messages .message.topic .nickname {
    grid-area: nick !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding-right: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  .chat-messages .message .text,
  .chat-messages .message.private .text,
  .chat-messages .message.system .text,
  .chat-messages .message.error .text,
  .chat-messages .message.join .text,
  .chat-messages .message.part .text,
  .chat-messages .message.quit .text,
  .chat-messages .message.nick .text,
  .chat-messages .message.kick .text,
  .chat-messages .message.mode .text,
  .chat-messages .message.topic .text {
    grid-area: text !important;
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: pre-wrap !important;
  }

  .chat-messages .message.welcome {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "nick"
      "text" !important;
    gap: 2px !important;
    align-items: start !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .chat-messages .message.welcome .timestamp {
    display: none !important;
  }

  .chat-messages .message.welcome .nickname,
  .chat-messages .message.welcome .text {
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}


/* ===== v47 emoji/gif popup, inline media and no overlap ===== */
.emoji-picker,
.gif-picker {
  position: fixed !important;
  z-index: 3200 !important;
  display: none;
  visibility: hidden;
  box-sizing: border-box !important;
}
.emoji-picker *,
.gif-picker * {
  box-sizing: border-box !important;
}
.emoji-picker {
  width: min(360px, calc(100vw - 16px)) !important;
  max-width: calc(100vw - 16px) !important;
  max-height: min(420px, 70vh) !important;
  overflow: hidden !important;
}
.emoji-picker-content {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
.emoji-grid {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
}
.emoji-btn {
  min-width: 0 !important;
  width: 100% !important;
}
.gif-picker {
  width: min(420px, calc(100vw - 16px)) !important;
  max-width: calc(100vw - 16px) !important;
  max-height: min(520px, 76vh) !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 16px !important;
  box-shadow: 0 18px 40px rgba(0,0,0,.26) !important;
  overflow: hidden !important;
}
.gif-picker-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--border-color) !important;
  background: var(--bg-tertiary) !important;
}
.gif-picker-search {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--border-color) !important;
}
#gifSearchInput {
  width: 100% !important;
  min-width: 0 !important;
  padding: 11px 12px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}
.gif-picker-close,
#gifSearchBtn {
  width: 38px !important;
  height: 38px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
}
.gif-picker-results {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  padding: 12px 14px 14px !important;
  max-height: calc(min(520px, 76vh) - 116px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
.gif-picker-loading,
.gif-picker-empty {
  grid-column: 1 / -1 !important;
  padding: 10px 4px !important;
  text-align: center !important;
  color: var(--text-secondary) !important;
}
.gif-result {
  border: 1px solid var(--border-color) !important;
  background: var(--bg-primary) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  cursor: pointer !important;
  padding: 0 !important;
  aspect-ratio: 1 / 1 !important;
}
.gif-result img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.inline-media-wrap {
  margin-top: 8px !important;
  width: 100% !important;
}
.inline-media {
  display: block !important;
  width: auto !important;
  max-width: min(320px, 100%) !important;
  max-height: 320px !important;
  border-radius: 12px !important;
  border: 1px solid var(--border-color) !important;
}
.media-link {
  display: inline-block !important;
  margin-bottom: 6px !important;
}
.chat-window,
.chat-window.active,
.chat-messages {
  min-height: 0 !important;
}
.chat-messages {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
.chat-messages .message,
.chat-messages .message.private,
.chat-messages .message.system,
.chat-messages .message.error,
.chat-messages .message.join,
.chat-messages .message.part,
.chat-messages .message.quit,
.chat-messages .message.nick,
.chat-messages .message.kick,
.chat-messages .message.mode,
.chat-messages .message.topic,
.chat-messages .message.welcome {
  overflow: visible !important;
  height: auto !important;
}
.chat-messages .message .text,
.chat-messages .message.private .text,
.chat-messages .message.system .text,
.chat-messages .message.error .text,
.chat-messages .message.join .text,
.chat-messages .message.part .text,
.chat-messages .message.quit .text,
.chat-messages .message.nick .text,
.chat-messages .message.kick .text,
.chat-messages .message.mode .text,
.chat-messages .message.topic .text,
.chat-messages .message.welcome .text {
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: pre-wrap !important;
}
@media (max-width: 768px) {
  .emoji-picker {
    width: min(340px, calc(100vw - 12px)) !important;
    max-width: calc(100vw - 12px) !important;
  }
  .emoji-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
  .gif-picker {
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px) !important;
  }
  .inline-media {
    max-width: min(260px, 100%) !important;
    max-height: 260px !important;
  }
}

/* ===== PAPINHO PRO V81: acabamento visual, responsividade e mídia inline ===== */
:root {
  color-scheme: dark light;
}

.app-container {
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(0, 210, 255, 0.10), transparent 28%),
    var(--bg-primary) !important;
}

.sidebar,
.user-panel,
.radio-player,
.tabs-container,
.chat-header,
.chat-input-area {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sidebar,
.user-panel {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.20) !important;
}

.main-content,
.chat-area,
.chat-window.active {
  min-width: 0 !important;
  min-height: 0 !important;
}

.chat-messages {
  scroll-behavior: smooth;
  padding: 18px !important;
}

.chat-messages .message {
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 15px !important;
  margin: 8px 0 !important;
  padding: 9px 12px !important;
  background: rgba(255, 255, 255, 0.035) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.chat-messages .message.private {
  background: color-mix(in srgb, var(--accent-color) 16%, var(--bg-secondary)) !important;
  border-color: color-mix(in srgb, var(--accent-color) 45%, var(--border-color)) !important;
}

.chat-messages .message.error {
  border-color: rgba(255, 90, 90, 0.40) !important;
}

.message .nickname {
  font-weight: 800 !important;
}

.message .timestamp {
  opacity: 0.72 !important;
}

.input-wrapper,
.channel-input,
#messageInput {
  border-radius: 16px !important;
}

#messageInput,
.channel-input {
  min-height: 44px !important;
}

#sendBtn,
.send-btn,
.toolbar-btn,
.radio-btn,
.refresh-btn,
.theme-btn,
.emoji-btn,
.gif-result {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease !important;
}

#sendBtn:hover,
.send-btn:hover,
.toolbar-btn:hover,
.radio-btn:hover,
.refresh-btn:hover,
.theme-btn:hover,
.emoji-btn:hover,
.gif-result:hover {
  transform: translateY(-1px);
}

.toolbar-btn:focus-visible,
.send-btn:focus-visible,
#sendBtn:focus-visible,
.emoji-btn:focus-visible,
.gif-result:focus-visible,
.refresh-btn:focus-visible,
.theme-btn:focus-visible,
.radio-btn:focus-visible {
  outline: 2px solid var(--accent-hover) !important;
  outline-offset: 2px !important;
}

.inline-media-wrap {
  display: block !important;
  margin-top: 8px !important;
  max-width: 100% !important;
}

.inline-media {
  display: block !important;
  width: auto !important;
  max-width: min(360px, 100%) !important;
  max-height: 360px !important;
  border-radius: 14px !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  object-fit: contain !important;
  background: rgba(0, 0, 0, 0.12);
}

.inline-audio {
  width: min(360px, 100%) !important;
  display: block !important;
}

.media-link {
  word-break: break-all !important;
  opacity: 0.86;
}

.emoji-picker,
.gif-picker,
.context-menu {
  border-radius: 18px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32) !important;
}

.emoji-btn {
  min-height: 36px !important;
  line-height: 1 !important;
}

.user-item,
.channel-item {
  border-radius: 14px !important;
}

.user-item {
  margin: 3px 6px !important;
}

.channel-item {
  padding: 10px 12px !important;
}

.channel-main {
  width: 100%;
  min-width: 0;
}

.channel-name,
.tab-name,
.user-nick {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.highlight,
.tab.has-mention {
  animation: papinhoPulse 1.4s ease-in-out infinite;
}

@keyframes papinhoPulse {
  0%, 100% { box-shadow: inset 0 -2px 0 var(--accent-color), 0 0 0 rgba(124, 92, 255, 0); }
  50% { box-shadow: inset 0 -2px 0 var(--accent-hover), 0 0 18px rgba(124, 92, 255, 0.35); }
}

@media (max-width: 768px) {
  .chat-messages {
    padding: 12px !important;
  }

  .chat-messages .message {
    border-radius: 13px !important;
    padding: 9px 10px !important;
  }

  .inline-media {
    max-width: min(280px, 100%) !important;
    max-height: 280px !important;
  }

  .emoji-picker,
  .gif-picker {
    left: 8px !important;
    right: 8px !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
  }

  .emoji-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }

  .tabs {
    gap: 4px !important;
  }
}

/* ===== PAPINHO PRO V83: radio profissional + abas piscando ===== */
.radio-player {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 14px 18px !important;
  min-height: 82px !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bg-secondary) 92%, #ffffff 8%), color-mix(in srgb, var(--bg-tertiary) 76%, transparent 24%)) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent 22%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 34px rgba(0,0,0,0.12) !important;
  overflow: hidden !important;
}

.radio-player::before {
  content: "" !important;
  position: absolute !important;
  inset: -35% auto auto -12% !important;
  width: 260px !important;
  height: 260px !important;
  border-radius: 999px !important;
  background: radial-gradient(circle, rgba(220,38,38,0.22), transparent 68%) !important;
  pointer-events: none !important;
}

.radio-info {
  position: relative !important;
  z-index: 1 !important;
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 13px !important;
  min-width: 0 !important;
}

.radio-logo,
.radio-player .radio-logo {
  width: 52px !important;
  height: 52px !important;
  border-radius: 18px !important;
  padding: 6px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  background: linear-gradient(135deg, #ffffff, #ffe9e9) !important;
  border: 1px solid rgba(255,255,255,0.54) !important;
  box-shadow: 0 14px 30px rgba(184,16,28,0.22) !important;
}

.radio-logo img,
.radio-player .radio-logo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: transparent !important;
  filter: none !important;
}

.radio-logo.logo-fallback::after {
  content: "RF" !important;
  color: #b8101c !important;
  font-weight: 900 !important;
  letter-spacing: -0.03em !important;
}

.radio-details {
  display: grid !important;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) !important;
  grid-template-areas:
    "name status"
    "meta meta" !important;
  align-items: center !important;
  justify-content: start !important;
  gap: 4px 10px !important;
  min-width: 0 !important;
}

.radio-name {
  grid-area: name !important;
  font-size: 1.02rem !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
  color: var(--text-primary) !important;
  white-space: nowrap !important;
}

.radio-meta {
  grid-area: meta !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0 !important;
  font-size: 0.82rem !important;
  line-height: 1.25 !important;
  color: var(--text-secondary) !important;
  opacity: 0.94 !important;
}

.radio-live-dot {
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  border-radius: 999px !important;
  background: #9ca3af !important;
  box-shadow: 0 0 0 4px rgba(156,163,175,0.16) !important;
}

.radio-player.radio-playing .radio-live-dot {
  background: #22c55e !important;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.18), 0 0 16px rgba(34,197,94,0.42) !important;
  animation: radioLivePulse 1.4s ease-in-out infinite !important;
}

.radio-status,
.radio-player .radio-status {
  grid-area: status !important;
  justify-self: start !important;
  display: inline-flex !important;
  align-items: center !important;
  width: auto !important;
  max-width: 100% !important;
  min-height: 24px !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  background: rgba(156,163,175,0.12) !important;
  color: var(--text-secondary) !important;
  font-size: 0.76rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  border: 1px solid rgba(156,163,175,0.18) !important;
  text-shadow: none !important;
}

.radio-status.playing {
  color: #16a34a !important;
  background: rgba(34,197,94,0.12) !important;
  border-color: rgba(34,197,94,0.25) !important;
}

.radio-status.connecting {
  color: #b45309 !important;
  background: rgba(245,158,11,0.13) !important;
  border-color: rgba(245,158,11,0.26) !important;
  font-style: normal !important;
}

.radio-status.error {
  color: #dc2626 !important;
  background: rgba(239,68,68,0.12) !important;
  border-color: rgba(239,68,68,0.26) !important;
}

.radio-status.idle {
  color: var(--text-secondary) !important;
}

.radio-controls {
  position: relative !important;
  z-index: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.radio-btn.stop-btn {
  display: none !important;
}

.radio-main-btn,
.radio-player .radio-main-btn,
.radio-btn.play-btn.radio-main-btn {
  width: 54px !important;
  min-width: 54px !important;
  height: 54px !important;
  min-height: 54px !important;
  border: 0 !important;
  border-radius: 19px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  opacity: 1 !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #b8101c, #ef4444) !important;
  box-shadow: 0 16px 34px rgba(184,16,28,0.30) !important;
  transform: none !important;
}

.radio-main-btn i {
  color: #ffffff !important;
  font-size: 1.08rem !important;
  line-height: 1 !important;
  margin-left: 2px !important;
}

.radio-main-btn:hover,
.radio-main-btn:focus-visible {
  transform: translateY(-1px) !important;
  filter: brightness(1.05) !important;
  box-shadow: 0 18px 38px rgba(184,16,28,0.36) !important;
}

.radio-main-btn.is-playing,
.radio-player.radio-playing .radio-main-btn,
.radio-player.radio-loading .radio-main-btn {
  background: linear-gradient(135deg, #6b7280, #374151) !important;
  box-shadow: 0 16px 34px rgba(17,24,39,0.25) !important;
}

.radio-main-btn.is-playing i,
.radio-player.radio-playing .radio-main-btn i,
.radio-player.radio-loading .radio-main-btn i {
  margin-left: 0 !important;
}

.volume-control,
.radio-player .volume-control {
  --volume-percent: 70%;
  flex: 0 1 242px !important;
  width: 242px !important;
  min-width: 218px !important;
  min-height: 54px !important;
  display: grid !important;
  grid-template-columns: 42px minmax(92px, 1fr) 44px !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 6px 10px !important;
  border-radius: 20px !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent 28%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07) !important;
}

.volume-toggle-btn,
.volume-toggle-btn:hover,
.volume-toggle-btn:focus-visible,
.radio-player .volume-toggle-btn,
.radio-player .volume-toggle-btn:hover,
.radio-player .volume-toggle-btn:focus-visible {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  border: 0 !important;
  border-radius: 15px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  color: var(--text-primary) !important;
  background: color-mix(in srgb, var(--bg-tertiary) 78%, #ffffff 8%) !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 1 !important;
  filter: none !important;
}

.volume-toggle-btn:hover,
.volume-toggle-btn:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(135deg, #b8101c, #ef4444) !important;
}

.volume-toggle-btn.muted,
.volume-toggle-btn.muted:hover,
.volume-toggle-btn.muted:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(135deg, #6b7280, #374151) !important;
}

.volume-toggle-btn i,
.radio-player .volume-toggle-btn i {
  color: currentColor !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  opacity: 1 !important;
}

.volume-toggle-btn .mute-mark,
#muteMark {
  display: none !important;
  visibility: hidden !important;
  content: none !important;
}

.volume-control input[type="range"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 100% !important;
  height: 8px !important;
  min-width: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  outline: none !important;
  background: linear-gradient(90deg, #dc2626 0%, #ef4444 var(--volume-percent), rgba(148,163,184,0.30) var(--volume-percent), rgba(148,163,184,0.30) 100%) !important;
  box-shadow: none !important;
  cursor: pointer !important;
  accent-color: #dc2626 !important;
}

.volume-control input[type="range"]::-webkit-slider-runnable-track {
  height: 8px !important;
  border-radius: 999px !important;
  background: transparent !important;
}

.volume-control input[type="range"]::-moz-range-track {
  height: 8px !important;
  border-radius: 999px !important;
  background: rgba(148,163,184,0.30) !important;
}

.volume-control input[type="range"]::-moz-range-progress {
  height: 8px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #dc2626, #ef4444) !important;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 20px !important;
  height: 20px !important;
  margin-top: -6px !important;
  border-radius: 999px !important;
  border: 3px solid #ffffff !important;
  background: #dc2626 !important;
  box-shadow: 0 7px 16px rgba(220,38,38,0.32) !important;
}

.volume-control input[type="range"]::-moz-range-thumb {
  width: 20px !important;
  height: 20px !important;
  border-radius: 999px !important;
  border: 3px solid #ffffff !important;
  background: #dc2626 !important;
  box-shadow: 0 7px 16px rgba(220,38,38,0.32) !important;
}

.volume-value {
  min-width: 38px !important;
  color: var(--text-secondary) !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  text-align: right !important;
  white-space: nowrap !important;
}

.volume-toggle-btn.muted + input[type="range"] {
  background: linear-gradient(90deg, #6b7280 0%, #9ca3af var(--volume-percent), rgba(148,163,184,0.30) var(--volume-percent), rgba(148,163,184,0.30) 100%) !important;
}

.theme-light .radio-player {
  background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(248,250,252,0.92)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 12px 34px rgba(15,23,42,0.08) !important;
}

.theme-light .volume-control {
  background: rgba(15,23,42,0.035) !important;
}

.theme-light .volume-toggle-btn {
  background: #ffffff !important;
  color: #475569 !important;
  box-shadow: 0 1px 4px rgba(15,23,42,0.08) !important;
}

.theme-light .volume-toggle-btn:hover,
.theme-light .volume-toggle-btn:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(135deg, #b8101c, #ef4444) !important;
}

.theme-light .volume-toggle-btn.muted,
.theme-light .volume-toggle-btn.muted:hover,
.theme-light .volume-toggle-btn.muted:focus-visible {
  color: #ffffff !important;
  background: linear-gradient(135deg, #6b7280, #374151) !important;
}

@keyframes radioLivePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.72); opacity: 0.68; }
}

.tab {
  isolation: isolate !important;
}

.tab-unread {
  display: none !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 6px !important;
  border-radius: 999px !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.68rem !important;
  line-height: 18px !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #ef4444, #b8101c) !important;
  box-shadow: 0 0 0 2px var(--bg-secondary), 0 8px 16px rgba(184,16,28,0.28) !important;
}

.tab-unread.visible,
.tab.tab-blink .tab-unread,
.tab.highlight .tab-unread {
  display: inline-flex !important;
}

.tab.tab-blink,
.tab.highlight,
.tab.has-mention {
  position: relative !important;
  animation: papinhoTabBlinkV83 0.95s ease-in-out infinite !important;
  border-color: rgba(239,68,68,0.82) !important;
}

.tab.private-ping {
  animation-duration: 0.72s !important;
}

.tab.private-ping .tab-icon,
.tab.has-mention .tab-icon {
  color: #ffffff !important;
}

.tab.channel-ping:not(.active),
.tab.private-ping:not(.active),
.tab.has-mention:not(.active) {
  background: linear-gradient(135deg, rgba(184,16,28,0.26), rgba(239,68,68,0.14)) !important;
}

@keyframes papinhoTabBlinkV83 {
  0%, 100% {
    box-shadow: inset 0 -3px 0 rgba(239,68,68,0.95), 0 0 0 rgba(239,68,68,0) !important;
    filter: brightness(1);
  }
  50% {
    box-shadow: inset 0 -3px 0 #ffffff, 0 0 22px rgba(239,68,68,0.55) !important;
    filter: brightness(1.18);
  }
}

@media (max-width: 900px) {
  .radio-player {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 13px 14px !important;
  }

  .radio-controls {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .volume-control,
  .radio-player .volume-control {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
  }
}

@media (max-width: 520px) {
  .radio-player {
    min-height: auto !important;
  }

  .radio-info {
    grid-template-columns: 46px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .radio-logo,
  .radio-player .radio-logo {
    width: 46px !important;
    height: 46px !important;
    border-radius: 16px !important;
  }

  .radio-details {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "name"
      "meta"
      "status" !important;
    gap: 4px !important;
  }

  .radio-status,
  .radio-player .radio-status {
    justify-self: start !important;
    max-width: 100% !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }

  .radio-controls {
    gap: 10px !important;
  }

  .radio-main-btn,
  .radio-player .radio-main-btn,
  .radio-btn.play-btn.radio-main-btn {
    width: 50px !important;
    min-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    border-radius: 17px !important;
  }

  .volume-control,
  .radio-player .volume-control {
    grid-template-columns: 40px minmax(72px, 1fr) !important;
    min-height: 50px !important;
    padding: 5px 8px !important;
    border-radius: 17px !important;
  }

  .volume-toggle-btn,
  .radio-player .volume-toggle-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 14px !important;
  }

  .volume-value {
    display: none !important;
  }
}


/* ===== PAPINHO PRO V84: status onboarding e composer contextual ===== */
.status-home-card {
  display: grid;
  gap: 18px;
  margin: 2px 0 16px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--accent-color) 24%, var(--border-color));
  background:
    radial-gradient(circle at top right, rgba(124, 92, 255, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.status-home-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.status-home-icon,
.status-entry-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-color) 76%, white), var(--accent-color));
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.status-home-copy h4 {
  margin: 4px 0 8px;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.status-home-copy p,
.status-entry-content p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.status-home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 15%, transparent);
}

.status-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
}

.status-home-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.status-home-item i {
  font-size: 1rem;
  color: var(--accent-color);
}

.status-home-item strong {
  color: var(--text-primary);
  font-size: 0.96rem;
}

.status-home-item span {
  color: var(--text-secondary);
  line-height: 1.45;
  font-size: 0.91rem;
}

.status-home-item code,
.status-entry-content code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

#window-status .chat-messages {
  gap: 0;
}

#window-status .chat-input-area.status-mode {
  padding-top: 12px;
}

.status-entry-hint {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--accent-color) 22%, var(--border-color));
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.status-entry-content {
  min-width: 0;
  flex: 1;
}

.status-entry-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.status-entry-headline strong {
  color: var(--text-primary);
  font-size: 0.98rem;
}

.status-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-chip.accent,
.status-chip.is-online {
  color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-color) 82%, white), var(--accent-color));
  border-color: transparent;
}

.status-command-input {
  border-style: dashed !important;
}

.status-command-btn {
  min-width: 52px;
}

#window-status #sendBtn.status-command-btn:not(:disabled) {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-color) 82%, white), var(--accent-color));
  color: #fff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.toolbar-btn.is-unavailable,
.toolbar-btn:disabled {
  opacity: 0.48 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  filter: saturate(0.75);
}

.toolbar-btn.is-unavailable:hover,
.toolbar-btn:disabled:hover {
  transform: none !important;
}

@media (max-width: 768px) {
  .status-home-card,
  .status-entry-hint {
    border-radius: 18px;
  }

  .status-home-hero,
  .status-entry-hint {
    flex-direction: column;
  }

  .status-entry-headline {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-home-grid {
    grid-template-columns: 1fr;
  }
}


/* ===== PAPINHO PRO V85: status minimalista ===== */
.status-home-card,
.status-entry-hint {
  display: none !important;
}

#window-status .input-toolbar {
  display: none !important;
}

.status-subtle-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.status-subtle-note i {
  color: var(--accent-color);
  font-size: 0.95rem;
}

#window-status #messageInput.status-command-input {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--text-secondary) !important;
  cursor: not-allowed !important;
  border-style: solid !important;
}

#window-status #messageInput.status-command-input::placeholder {
  color: var(--text-secondary) !important;
  opacity: 0.85;
}

#window-status #sendBtn.status-command-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

#window-status #sendBtn.status-command-btn:disabled,
#window-status #messageInput:disabled {
  opacity: 1 !important;
}

@media (max-width: 768px) {
  .status-subtle-note {
    font-size: 0.9rem;
    border-radius: 12px;
    padding: 9px 12px;
  }
}


/* ===== PAPINHO PRO V87: mídia sem URL no IRC ===== */
.papinho-media-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 4px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}


/* ===== PAPINHO PRO V89: canais e radio compactos ===== */
.channels-drawer-header,
.sidebar-header.channels-drawer-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 11px 12px !important;
  min-height: 58px !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 82%, transparent) !important;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-secondary) 96%, white 4%), var(--bg-secondary)) !important;
}

.sidebar-title-block {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.sidebar-title-block h2,
.sidebar-header.channels-drawer-header h2 {
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  font-size: 1.02rem !important;
  line-height: 1.1 !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: var(--text-primary) !important;
}

.sidebar-title-block span {
  font-size: 0.74rem;
  line-height: 1.15;
  font-weight: 600;
  color: var(--text-secondary);
  opacity: 0.82;
}

.sidebar-header.channels-drawer-header h2 i,
.sidebar-title-block i {
  display: none !important;
}

.sidebar-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.sidebar-header.channels-drawer-header .refresh-btn {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 13px !important;
  justify-content: center !important;
  background: color-mix(in srgb, var(--bg-tertiary) 88%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

.sidebar-header.channels-drawer-header .refresh-btn span {
  display: none !important;
}

.sidebar-header.channels-drawer-header .refresh-btn i {
  color: inherit !important;
  font-size: 0.92rem !important;
}

.sidebar-header.channels-drawer-header .refresh-btn:hover,
.sidebar-header.channels-drawer-header .refresh-btn:focus-visible {
  background: var(--accent-color) !important;
  color: #fff !important;
  border-color: var(--accent-hover) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 22px rgba(var(--chat-accent-rgb), 0.28) !important;
}

.sidebar-close-btn {
  display: none;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg-tertiary) 88%, transparent);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-close-btn i {
  font-size: 1.04rem;
  transition: transform 0.22s ease;
}

.sidebar-close-btn:hover,
.sidebar-close-btn:focus-visible {
  background: color-mix(in srgb, #ef4444 92%, black 8%);
  color: #fff;
  border-color: color-mix(in srgb, #ef4444 80%, white 20%);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.25);
}

.sidebar-close-btn:hover i,
.sidebar-close-btn:focus-visible i {
  transform: rotate(90deg);
}

/* Radio menor: libera area real do chat */
.radio-player {
  min-height: 52px !important;
  max-height: 56px !important;
  padding: 6px 12px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent) !important;
}

.radio-info {
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 9px !important;
  min-width: 0 !important;
}

.radio-logo,
.radio-player .radio-logo {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 16px rgba(190, 24, 49, 0.18) !important;
}

.radio-details {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-areas: "name status" !important;
  align-items: center !important;
  gap: 8px !important;
}

.radio-name {
  grid-area: name !important;
  font-size: 0.92rem !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

.radio-status {
  grid-area: status !important;
  font-size: 0.74rem !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  opacity: 0.88 !important;
}

.radio-meta {
  display: none !important;
}

.radio-controls {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 7px !important;
  min-width: 0 !important;
}

.radio-btn.play-btn,
.radio-player .radio-btn.play-btn {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 13px !important;
  box-shadow: 0 8px 18px rgba(190, 24, 49, 0.22) !important;
}

.volume-control {
  flex: 0 1 190px !important;
  min-height: 38px !important;
  max-width: 210px !important;
  padding: 0 9px !important;
  border-radius: 13px !important;
  gap: 7px !important;
  background: color-mix(in srgb, var(--bg-tertiary) 82%, transparent 18%) !important;
}

.volume-toggle-btn,
.radio-player .volume-toggle-btn {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  border-radius: 10px !important;
  box-shadow: 0 7px 16px rgba(190, 24, 49, 0.18) !important;
}

.volume-control input[type="range"] {
  width: 84px !important;
  min-width: 64px !important;
  height: 4px !important;
}

.volume-control input[type="range"]::-webkit-slider-runnable-track,
.volume-control input[type="range"]::-moz-range-track {
  height: 4px !important;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
  width: 16px !important;
  height: 16px !important;
  margin-top: -6px !important;
}

.volume-control input[type="range"]::-moz-range-thumb {
  width: 16px !important;
  height: 16px !important;
}

.volume-value {
  font-size: 0.72rem !important;
  min-width: 32px !important;
}

@media (max-width: 768px) {
  .sidebar-close-btn {
    display: inline-flex !important;
  }

  body.mobile-sidebar-open #mobileChannelsToggle,
  body.mobile-users-open #mobileUsersToggle {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(16px) scale(0.82) !important;
  }

  .mobile-panel-toggle {
    bottom: calc(138px + env(safe-area-inset-bottom, 0px)) !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 17px !important;
  }

  .channels-drawer-header,
  .sidebar-header.channels-drawer-header {
    min-height: 56px !important;
    padding: 10px 11px !important;
  }

  .sidebar-title-block h2,
  .sidebar-header.channels-drawer-header h2 {
    font-size: 1rem !important;
  }

  .radio-player {
    min-height: 44px !important;
    max-height: 46px !important;
    padding: 5px 9px !important;
    gap: 6px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .radio-info {
    grid-template-columns: 26px minmax(0, 1fr) !important;
    gap: 7px !important;
  }

  .radio-logo,
  .radio-player .radio-logo {
    width: 26px !important;
    min-width: 26px !important;
    height: 26px !important;
    border-radius: 8px !important;
  }

  .radio-details {
    display: block !important;
    min-width: 0 !important;
  }

  .radio-name {
    display: block !important;
    font-size: 0.84rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 92px !important;
  }

  .radio-status,
  .radio-meta {
    display: none !important;
  }

  .radio-controls {
    gap: 6px !important;
  }

  .radio-btn.play-btn,
  .radio-player .radio-btn.play-btn {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 11px !important;
  }

  .volume-control {
    min-height: 34px !important;
    max-width: 134px !important;
    padding: 0 7px !important;
    gap: 5px !important;
    border-radius: 11px !important;
  }

  .volume-toggle-btn,
  .radio-player .volume-toggle-btn {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    border-radius: 9px !important;
  }

  .volume-control input[type="range"] {
    width: 58px !important;
    min-width: 48px !important;
  }

  .volume-value {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .radio-name {
    max-width: 72px !important;
  }

  .volume-control {
    max-width: 112px !important;
  }

  .volume-control input[type="range"] {
    width: 46px !important;
    min-width: 42px !important;
  }
}


/* ===== PAPINHO PRO V90: radio sem corte/sobreposicao + status compacto ===== */
.radio-player,
.main-content .radio-player {
  box-sizing: border-box !important;
  min-height: 62px !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  padding: 8px 13px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent) !important;
}

.radio-info,
.radio-player .radio-info {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.radio-logo,
.radio-player .radio-logo {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 11px !important;
  overflow: hidden !important;
  flex: 0 0 34px !important;
}

.radio-details,
.radio-player .radio-details {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 2px !important;
}

.radio-name,
.radio-player .radio-name {
  display: block !important;
  max-width: 100% !important;
  font-size: 0.92rem !important;
  line-height: 1.12 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.radio-status,
.radio-player .radio-status {
  display: block !important;
  max-width: 100% !important;
  font-size: 0.73rem !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  opacity: 0.82 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.radio-meta,
.radio-player .radio-meta {
  display: none !important;
}

.radio-controls,
.radio-player .radio-controls {
  position: relative !important;
  z-index: 2 !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}

.radio-btn,
.radio-player .radio-btn,
.volume-toggle-btn,
.radio-player .volume-toggle-btn {
  position: relative !important;
  z-index: 3 !important;
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  transform: none !important;
}

.radio-btn.play-btn,
.radio-player .radio-btn.play-btn,
.radio-main-btn,
.radio-player .radio-main-btn {
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 13px !important;
}

.volume-control,
.radio-player .volume-control {
  position: relative !important;
  z-index: 2 !important;
  box-sizing: border-box !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 8px !important;
  border-radius: 13px !important;
  display: grid !important;
  grid-template-columns: 30px 82px 34px !important;
  align-items: center !important;
  gap: 7px !important;
  overflow: visible !important;
}

.volume-toggle-btn,
.radio-player .volume-toggle-btn {
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  border-radius: 10px !important;
  grid-column: 1 !important;
}

.volume-control input[type="range"],
.radio-player .volume-control input[type="range"] {
  position: relative !important;
  z-index: 2 !important;
  grid-column: 2 !important;
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  height: 4px !important;
  margin: 0 !important;
}

.volume-value,
.radio-player .volume-value {
  grid-column: 3 !important;
  min-width: 34px !important;
  width: 34px !important;
  font-size: 0.72rem !important;
  line-height: 1 !important;
  text-align: right !important;
}

/* Aba Status: aproxima titulo e conteudo */
#window-status .chat-header {
  min-height: 42px !important;
  height: auto !important;
  padding: 7px 16px !important;
  align-items: center !important;
  border-bottom: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent) !important;
}

#window-status .chat-header .header-info {
  gap: 0 !important;
  min-height: 0 !important;
}

#window-status .chat-header h3 {
  margin: 0 !important;
  line-height: 1.1 !important;
  font-size: 1rem !important;
}

#window-status .chat-header .topic {
  display: none !important;
}

#window-status .chat-messages,
#messages-status {
  padding-top: 8px !important;
}

#window-status .message.welcome:first-child {
  margin-top: 0 !important;
}

@media (max-width: 768px) {
  .radio-player,
  .main-content .radio-player {
    min-height: 56px !important;
    padding: 7px 10px !important;
    gap: 8px !important;
  }

  .radio-info,
  .radio-player .radio-info {
    gap: 8px !important;
  }

  .radio-logo,
  .radio-player .radio-logo {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    border-radius: 10px !important;
    flex-basis: 30px !important;
  }

  .radio-name,
  .radio-player .radio-name {
    max-width: none !important;
    font-size: 0.88rem !important;
  }

  .radio-status,
  .radio-player .radio-status {
    display: none !important;
  }

  .radio-controls,
  .radio-player .radio-controls {
    gap: 7px !important;
  }

  .radio-btn.play-btn,
  .radio-player .radio-btn.play-btn,
  .radio-main-btn,
  .radio-player .radio-main-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    border-radius: 12px !important;
  }

  .volume-control,
  .radio-player .volume-control {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .volume-toggle-btn,
  .radio-player .volume-toggle-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    border-radius: 12px !important;
  }

  .volume-control input[type="range"],
  .radio-player .volume-control input[type="range"],
  .volume-value,
  .radio-player .volume-value {
    display: none !important;
  }

  #window-status .chat-header {
    min-height: 38px !important;
    padding: 6px 13px !important;
  }

  #window-status .chat-messages,
  #messages-status {
    padding-top: 7px !important;
  }
}

@media (max-width: 420px) {
  .radio-player,
  .main-content .radio-player {
    min-height: 54px !important;
  }

  .radio-name,
  .radio-player .radio-name {
    max-width: 110px !important;
  }
}


/* ===== PAPINHO PRO V91: player com status e volume visiveis ===== */
.radio-player,
.main-content .radio-player {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 66px !important;
  height: auto !important;
  padding: 9px 12px !important;
  overflow: visible !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px 14px !important;
}

.radio-player .radio-info,
.radio-info {
  min-width: 0 !important;
  overflow: hidden !important;
}

.radio-player .radio-details,
.radio-details {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 2px 9px !important;
}

.radio-player .radio-meta,
.radio-meta {
  display: inline-flex !important;
  align-items: center !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 0.75rem !important;
  opacity: 0.82 !important;
}

.radio-player .radio-status,
.radio-status {
  grid-column: 1 / -1 !important;
  display: inline-flex !important;
  align-items: center !important;
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 0.74rem !important;
  line-height: 1.15 !important;
  opacity: 0.92 !important;
  color: var(--text-secondary) !important;
}

.radio-status.playing,
.radio-player .radio-status.playing {
  color: #34d399 !important;
}

.radio-status.connecting,
.radio-player .radio-status.connecting {
  color: #fbbf24 !important;
}

.radio-status.error,
.radio-player .radio-status.error {
  color: #fb7185 !important;
}

.radio-player .radio-controls,
.radio-controls {
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
}

.radio-player .volume-control,
.volume-control {
  box-sizing: border-box !important;
  min-width: 160px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 8px !important;
  display: grid !important;
  grid-template-columns: 30px minmax(72px, 1fr) 38px !important;
  align-items: center !important;
  gap: 7px !important;
  overflow: visible !important;
}

.radio-player .volume-control input[type="range"],
.volume-control input[type="range"] {
  display: block !important;
  grid-column: 2 !important;
  width: 100% !important;
  min-width: 72px !important;
  max-width: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.radio-player .volume-value,
.volume-value {
  display: inline-block !important;
  grid-column: 3 !important;
  min-width: 38px !important;
  width: 38px !important;
  text-align: right !important;
  opacity: 0.9 !important;
  visibility: visible !important;
}

@media (max-width: 768px) {
  .radio-player,
  .main-content .radio-player {
    min-height: 78px !important;
    padding: 8px 10px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 7px !important;
  }

  .radio-player .radio-info,
  .radio-info {
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
  }

  .radio-player .radio-logo,
  .radio-logo {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
  }

  .radio-player .radio-details,
  .radio-details {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 1px 8px !important;
  }

  .radio-player .radio-meta,
  .radio-meta {
    display: inline-flex !important;
    font-size: 0.7rem !important;
  }

  .radio-player .radio-status,
  .radio-status {
    display: inline-flex !important;
    grid-column: 1 / -1 !important;
    font-size: 0.71rem !important;
    line-height: 1.1 !important;
  }

  .radio-player .radio-controls,
  .radio-controls {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .radio-player .radio-main-btn,
  .radio-main-btn,
  .radio-player .radio-btn.play-btn,
  .radio-btn.play-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
  }

  .radio-player .volume-control,
  .volume-control {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 8px !important;
    display: grid !important;
    grid-template-columns: 32px minmax(78px, 1fr) 38px !important;
    align-items: center !important;
    justify-content: stretch !important;
    background: color-mix(in srgb, var(--bg-tertiary) 82%, transparent 18%) !important;
    border: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent) !important;
    box-shadow: none !important;
  }

  .radio-player .volume-toggle-btn,
  .volume-toggle-btn {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    border-radius: 11px !important;
  }

  .radio-player .volume-control input[type="range"],
  .volume-control input[type="range"] {
    display: block !important;
    width: 100% !important;
    min-width: 78px !important;
    max-width: none !important;
  }

  .radio-player .volume-value,
  .volume-value {
    display: inline-block !important;
    min-width: 38px !important;
    width: 38px !important;
    font-size: 0.7rem !important;
  }
}

@media (max-width: 420px) {
  .radio-player,
  .main-content .radio-player {
    min-height: 80px !important;
  }

  .radio-player .radio-name,
  .radio-name {
    max-width: 120px !important;
  }

  .radio-player .volume-control,
  .volume-control {
    grid-template-columns: 30px minmax(62px, 1fr) 34px !important;
    gap: 6px !important;
    padding: 0 7px !important;
  }

  .radio-player .volume-control input[type="range"],
  .volume-control input[type="range"] {
    min-width: 62px !important;
  }

  .radio-player .volume-value,
  .volume-value {
    min-width: 34px !important;
    width: 34px !important;
  }
}


/* ===== PAPINHO PRO V92: radio player em uma linha compacta ===== */
.radio-player {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 9px 12px !important;
    min-height: 58px !important;
    overflow: visible !important;
}

.radio-info {
    display: grid !important;
    grid-template-columns: 36px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 9px !important;
    min-width: 0 !important;
}

.radio-logo {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 12px !important;
}

.radio-details {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

.radio-name {
    flex: 0 0 auto !important;
    font-size: 0.94rem !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
    color: var(--text-primary) !important;
    max-width: none !important;
    white-space: nowrap !important;
}

.radio-status {
    order: 2 !important;
    grid-column: auto !important;
    flex: 0 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 4px 8px !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--bg-tertiary) 84%, transparent 16%) !important;
    border: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent 26%) !important;
    color: var(--text-secondary) !important;
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.radio-status.playing {
    color: #fff !important;
    background: #8f1117 !important;
    border-color: transparent !important;
}

.radio-status.connecting {
    color: var(--accent-color) !important;
    background: color-mix(in srgb, var(--accent-color) 12%, transparent) !important;
    border-color: color-mix(in srgb, var(--accent-color) 28%, transparent) !important;
}

.radio-status.error {
    color: #ef4444 !important;
    background: color-mix(in srgb, #ef4444 12%, transparent) !important;
    border-color: color-mix(in srgb, #ef4444 32%, transparent) !important;
}

.radio-meta {
    order: 3 !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    justify-self: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 0 !important;
    color: var(--text-secondary) !important;
    opacity: 0.82 !important;
    font-size: 0.76rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.radio-live-dot {
    width: 6px !important;
    height: 6px !important;
    min-width: 6px !important;
    min-height: 6px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
}

.radio-controls {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    min-width: 0 !important;
    flex-wrap: nowrap !important;
}

.radio-btn.play-btn,
.volume-toggle-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 12px !important;
    margin: 0 !important;
}

.volume-control {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 150px !important;
    padding: 5px 7px !important;
    border-radius: 14px !important;
    overflow: visible !important;
}

.volume-control input[type="range"] {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    height: 6px !important;
    flex: 0 0 64px !important;
}

.volume-value {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    font-size: 0.72rem !important;
    line-height: 1 !important;
    color: var(--text-secondary) !important;
    white-space: nowrap !important;
}

.volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 5px !important;
}
.volume-control input[type="range"]::-moz-range-track {
    height: 5px !important;
}
.volume-control input[type="range"]::-webkit-slider-thumb {
    width: 13px !important;
    height: 13px !important;
    margin-top: -4px !important;
}
.volume-control input[type="range"]::-moz-range-thumb {
    width: 13px !important;
    height: 13px !important;
}

@media (max-width: 768px) {
    .radio-player {
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 8px !important;
        padding: 8px 10px !important;
        min-height: 54px !important;
    }

    .radio-info {
        grid-template-columns: 32px minmax(0, 1fr) !important;
        gap: 8px !important;
    }

    .radio-logo {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        border-radius: 10px !important;
    }

    .radio-details {
        gap: 5px !important;
    }

    .radio-name {
        font-size: 0.88rem !important;
    }

    .radio-status {
        padding: 3px 6px !important;
        font-size: 0.68rem !important;
        max-width: 96px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .radio-meta {
        font-size: 0.68rem !important;
        max-width: 96px !important;
    }

    .radio-controls {
        gap: 6px !important;
    }

    .radio-btn.play-btn,
    .volume-toggle-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        border-radius: 10px !important;
    }

    .volume-control {
        gap: 5px !important;
        padding: 4px 5px !important;
        max-width: 98px !important;
    }

    .volume-control input[type="range"] {
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        flex-basis: 44px !important;
    }

    .volume-value {
        width: 26px !important;
        min-width: 26px !important;
        max-width: 26px !important;
        font-size: 0.66rem !important;
    }
}

@media (max-width: 430px) {
    .radio-player {
        grid-template-columns: 1fr !important;
    }

    .radio-controls {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    .volume-control input[type="range"] {
        width: 58px !important;
        min-width: 58px !important;
        max-width: 58px !important;
        flex-basis: 58px !important;
    }
}


/* ===== PAPINHO PRO V93: player fixado em uma linha real ===== */
.radio-player,
.main-content .radio-player,
body .radio-player#radioPlayer {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 54px !important;
  height: auto !important;
  padding: 8px 12px !important;
  overflow: visible !important;
}

.radio-player .radio-info,
body .radio-player#radioPlayer .radio-info {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 9px !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.radio-player .radio-logo,
body .radio-player#radioPlayer .radio-logo {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  flex: 0 0 34px !important;
  border-radius: 11px !important;
}

.radio-player .radio-details,
body .radio-player#radioPlayer .radio-details {
  display: grid !important;
  grid-template-columns: auto auto auto minmax(0, 1fr) !important;
  grid-template-rows: 1fr !important;
  align-items: center !important;
  justify-content: start !important;
  column-gap: 9px !important;
  row-gap: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
  white-space: nowrap !important;
}

.radio-player .radio-name,
body .radio-player#radioPlayer .radio-name {
  grid-column: 1 !important;
  grid-row: 1 !important;
  order: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0.94rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.radio-player .radio-meta,
body .radio-player#radioPlayer .radio-meta {
  grid-column: 2 !important;
  grid-row: 1 !important;
  order: 0 !important;
  justify-self: start !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 210px !important;
  margin: 0 !important;
  padding: 0 2px 0 0 !important;
  color: var(--text-secondary) !important;
  opacity: 0.86 !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.radio-player .radio-live-dot,
body .radio-player#radioPlayer .radio-live-dot {
  width: 6px !important;
  min-width: 6px !important;
  height: 6px !important;
  min-height: 6px !important;
  margin: 0 !important;
  flex: 0 0 6px !important;
}

.radio-player .radio-status,
body .radio-player#radioPlayer .radio-status {
  grid-column: 3 !important;
  grid-row: 1 !important;
  order: 0 !important;
  justify-self: start !important;
  align-self: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 170px !important;
  margin: 0 !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--border-color) 72%, transparent 28%) !important;
  background: color-mix(in srgb, var(--bg-tertiary) 86%, transparent 14%) !important;
  color: var(--text-secondary) !important;
  opacity: 1 !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  transform: none !important;
}

.radio-player .radio-status.playing,
body .radio-player#radioPlayer .radio-status.playing {
  color: #fff !important;
  background: #8f1117 !important;
  border-color: transparent !important;
}

.radio-player .radio-status.connecting,
body .radio-player#radioPlayer .radio-status.connecting {
  color: var(--accent-color) !important;
  background: color-mix(in srgb, var(--accent-color) 12%, transparent) !important;
  border-color: color-mix(in srgb, var(--accent-color) 28%, transparent) !important;
}

.radio-player .radio-status.error,
body .radio-player#radioPlayer .radio-status.error {
  color: #ef4444 !important;
  background: color-mix(in srgb, #ef4444 12%, transparent) !important;
  border-color: color-mix(in srgb, #ef4444 30%, transparent) !important;
}

.radio-player .radio-controls,
body .radio-player#radioPlayer .radio-controls {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  min-width: 0 !important;
  width: auto !important;
  overflow: visible !important;
  flex-wrap: nowrap !important;
}

.radio-player .radio-main-btn,
.radio-player .radio-btn.play-btn,
body .radio-player#radioPlayer .radio-main-btn,
body .radio-player#radioPlayer .radio-btn.play-btn {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 11px !important;
  margin: 0 !important;
  flex: 0 0 34px !important;
}

.radio-player .volume-control,
body .radio-player#radioPlayer .volume-control {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 30px 48px 32px !important;
  align-items: center !important;
  justify-content: start !important;
  gap: 6px !important;
  width: 126px !important;
  min-width: 126px !important;
  max-width: 126px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 6px !important;
  border-radius: 12px !important;
  overflow: visible !important;
  flex: 0 0 126px !important;
  background: color-mix(in srgb, var(--bg-tertiary) 84%, transparent 16%) !important;
  border: 1px solid color-mix(in srgb, var(--border-color) 74%, transparent 26%) !important;
  box-shadow: none !important;
}

.radio-player .volume-toggle-btn,
body .radio-player#radioPlayer .volume-toggle-btn {
  grid-column: 1 !important;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  border-radius: 10px !important;
  margin: 0 !important;
}

.radio-player .volume-control input[type="range"],
body .radio-player#radioPlayer .volume-control input[type="range"] {
  grid-column: 2 !important;
  display: block !important;
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  height: 4px !important;
  flex: 0 0 48px !important;
  margin: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.radio-player .volume-value,
body .radio-player#radioPlayer .volume-value {
  grid-column: 3 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  margin: 0 !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  color: var(--text-secondary) !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

.radio-player .volume-control input[type="range"]::-webkit-slider-runnable-track,
body .radio-player#radioPlayer .volume-control input[type="range"]::-webkit-slider-runnable-track {
  height: 4px !important;
  border-radius: 999px !important;
}

.radio-player .volume-control input[type="range"]::-moz-range-track,
body .radio-player#radioPlayer .volume-control input[type="range"]::-moz-range-track {
  height: 4px !important;
  border-radius: 999px !important;
}

.radio-player .volume-control input[type="range"]::-webkit-slider-thumb,
body .radio-player#radioPlayer .volume-control input[type="range"]::-webkit-slider-thumb {
  width: 12px !important;
  height: 12px !important;
  margin-top: -4px !important;
}

.radio-player .volume-control input[type="range"]::-moz-range-thumb,
body .radio-player#radioPlayer .volume-control input[type="range"]::-moz-range-thumb {
  width: 12px !important;
  height: 12px !important;
}

@media (max-width: 768px) {
  .radio-player,
  .main-content .radio-player,
  body .radio-player#radioPlayer {
    grid-template-columns: minmax(0, 1fr) auto !important;
    min-height: 52px !important;
    padding: 8px 9px !important;
    gap: 8px !important;
  }

  .radio-player .radio-info,
  body .radio-player#radioPlayer .radio-info {
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .radio-player .radio-logo,
  body .radio-player#radioPlayer .radio-logo {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    flex-basis: 32px !important;
  }

  .radio-player .radio-details,
  body .radio-player#radioPlayer .radio-details {
    grid-template-columns: auto auto minmax(0, 1fr) !important;
    column-gap: 7px !important;
    overflow: hidden !important;
  }

  .radio-player .radio-name,
  body .radio-player#radioPlayer .radio-name {
    font-size: 0.88rem !important;
  }

  .radio-player .radio-meta,
  body .radio-player#radioPlayer .radio-meta {
    grid-column: 2 !important;
    max-width: 122px !important;
    font-size: 0.68rem !important;
  }

  .radio-player .radio-status,
  body .radio-player#radioPlayer .radio-status {
    grid-column: 3 !important;
    max-width: 110px !important;
    padding: 3px 6px !important;
    font-size: 0.66rem !important;
  }

  .radio-player .radio-controls,
  body .radio-player#radioPlayer .radio-controls {
    width: auto !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  .radio-player .radio-main-btn,
  .radio-player .radio-btn.play-btn,
  body .radio-player#radioPlayer .radio-main-btn,
  body .radio-player#radioPlayer .radio-btn.play-btn {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    flex-basis: 32px !important;
  }

  .radio-player .volume-control,
  body .radio-player#radioPlayer .volume-control {
    grid-template-columns: 28px 42px 28px !important;
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    flex-basis: 110px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 5px !important;
    gap: 5px !important;
  }

  .radio-player .volume-toggle-btn,
  body .radio-player#radioPlayer .volume-toggle-btn {
    width: 26px !important;
    min-width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
  }

  .radio-player .volume-control input[type="range"],
  body .radio-player#radioPlayer .volume-control input[type="range"] {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    flex-basis: 42px !important;
  }

  .radio-player .volume-value,
  body .radio-player#radioPlayer .volume-value {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    font-size: 0.64rem !important;
  }
}

@media (max-width: 520px) {
  .radio-player,
  .main-content .radio-player,
  body .radio-player#radioPlayer {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 7px !important;
    min-height: 84px !important;
  }

  .radio-player .radio-details,
  body .radio-player#radioPlayer .radio-details {
    grid-template-columns: auto auto auto minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  .radio-player .radio-meta,
  body .radio-player#radioPlayer .radio-meta {
    max-width: 132px !important;
  }

  .radio-player .radio-status,
  body .radio-player#radioPlayer .radio-status {
    max-width: 126px !important;
  }

  .radio-player .radio-controls,
  body .radio-player#radioPlayer .radio-controls {
    width: auto !important;
    justify-content: flex-start !important;
  }
}

@media (max-width: 390px) {
  .radio-player .radio-meta,
  body .radio-player#radioPlayer .radio-meta {
    max-width: 104px !important;
  }

  .radio-player .radio-status,
  body .radio-player#radioPlayer .radio-status {
    max-width: 98px !important;
  }

  .radio-player .volume-control,
  body .radio-player#radioPlayer .volume-control {
    width: 104px !important;
    min-width: 104px !important;
    max-width: 104px !important;
    flex-basis: 104px !important;
    grid-template-columns: 26px 38px 26px !important;
  }

  .radio-player .volume-control input[type="range"],
  body .radio-player#radioPlayer .volume-control input[type="range"] {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    flex-basis: 38px !important;
  }
}


/* ===== PAPINHO PRO V94: radio player saneado sem sobreposicao ===== */
body .main-content #radioPlayer.radio-player,
body #radioPlayer.radio-player {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 10px 12px 9px !important;
  gap: 8px !important;
  overflow: visible !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border-color) !important;
  outline: 0 !important;
  box-shadow: none !important;
}

body #radioPlayer.radio-player .radio-info {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body #radioPlayer.radio-player .radio-logo {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 11px !important;
  flex: 0 0 34px !important;
  box-shadow: none !important;
}

body #radioPlayer.radio-player .radio-details {
  grid-column: 2 !important;
  grid-row: 1 !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: auto minmax(96px, max-content) auto !important;
  grid-template-rows: 1fr !important;
  align-items: center !important;
  justify-content: start !important;
  column-gap: 14px !important;
  row-gap: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
}

body #radioPlayer.radio-player .radio-name {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  color: var(--text-primary) !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  transform: none !important;
}

body #radioPlayer.radio-player .radio-meta {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: start !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 185px !important;
  font-size: 0.75rem !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  color: var(--text-secondary) !important;
  opacity: 0.9 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  transform: none !important;
}

body #radioPlayer.radio-player .radio-live-dot {
  display: inline-block !important;
  width: 6px !important;
  min-width: 6px !important;
  height: 6px !important;
  min-height: 6px !important;
  border-radius: 999px !important;
  flex: 0 0 6px !important;
  margin: 0 !important;
  background: #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.16) !important;
}

body #radioPlayer.radio-player .radio-status {
  grid-column: 3 !important;
  grid-row: 1 !important;
  justify-self: start !important;
  align-self: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 175px !important;
  height: 22px !important;
  min-height: 22px !important;
  margin: 0 !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: 999px !important;
  outline: 0 !important;
  box-shadow: none !important;
  font-size: 0.71rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  font-style: normal !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  transform: none !important;
}

body #radioPlayer.radio-player .radio-status.idle {
  color: var(--text-secondary) !important;
  background: rgba(148, 163, 184, 0.14) !important;
}

body #radioPlayer.radio-player .radio-status.loading,
body #radioPlayer.radio-player .radio-status.connecting {
  color: #b45309 !important;
  background: rgba(245, 158, 11, 0.18) !important;
}

body #radioPlayer.radio-player .radio-status.playing {
  color: #15803d !important;
  background: rgba(34, 197, 94, 0.18) !important;
  text-shadow: none !important;
}

body #radioPlayer.radio-player .radio-status.error {
  color: #dc2626 !important;
  background: rgba(239, 68, 68, 0.14) !important;
}

body #radioPlayer.radio-player .radio-controls {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  flex-wrap: nowrap !important;
}

body #radioPlayer.radio-player .radio-main-btn,
body #radioPlayer.radio-player .radio-btn.play-btn {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  flex: 0 0 36px !important;
  margin: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

body #radioPlayer.radio-player .volume-control {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 28px 46px 30px !important;
  align-items: center !important;
  justify-content: start !important;
  gap: 6px !important;
  width: 122px !important;
  min-width: 122px !important;
  max-width: 122px !important;
  height: 34px !important;
  min-height: 34px !important;
  flex: 0 0 122px !important;
  margin: 0 !important;
  padding: 0 6px !important;
  border-radius: 12px !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  background: rgba(148, 163, 184, 0.12) !important;
}

body #radioPlayer.radio-player .volume-toggle-btn {
  grid-column: 1 !important;
  width: 26px !important;
  min-width: 26px !important;
  height: 26px !important;
  min-height: 26px !important;
  border-radius: 9px !important;
  margin: 0 !important;
  box-shadow: none !important;
}

body #radioPlayer.radio-player .volume-control input[type="range"] {
  grid-column: 2 !important;
  display: block !important;
  width: 46px !important;
  min-width: 46px !important;
  max-width: 46px !important;
  height: 4px !important;
  flex: 0 0 46px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

body #radioPlayer.radio-player .volume-value {
  grid-column: 3 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  margin: 0 !important;
  font-size: 0.66rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  color: var(--text-secondary) !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-runnable-track {
  height: 4px !important;
  border-radius: 999px !important;
}

body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-track {
  height: 4px !important;
  border-radius: 999px !important;
}

body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-thumb {
  width: 12px !important;
  height: 12px !important;
  margin-top: -4px !important;
  border: 0 !important;
}

body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-thumb {
  width: 12px !important;
  height: 12px !important;
  border: 0 !important;
}

@media (max-width: 620px) {
  body #radioPlayer.radio-player {
    padding: 9px 10px !important;
    gap: 8px !important;
  }

  body #radioPlayer.radio-player .radio-details {
    grid-template-columns: auto minmax(72px, 1fr) auto !important;
    column-gap: 10px !important;
  }

  body #radioPlayer.radio-player .radio-name {
    font-size: 0.88rem !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    max-width: 132px !important;
    font-size: 0.68rem !important;
  }

  body #radioPlayer.radio-player .radio-status {
    max-width: 118px !important;
    height: 20px !important;
    min-height: 20px !important;
    padding: 0 6px !important;
    font-size: 0.64rem !important;
  }
}

@media (max-width: 430px) {
  body #radioPlayer.radio-player .radio-info {
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
  }

  body #radioPlayer.radio-player .radio-details {
    grid-template-columns: auto minmax(66px, 1fr) auto !important;
    column-gap: 8px !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    max-width: 104px !important;
  }

  body #radioPlayer.radio-player .radio-status {
    max-width: 102px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    grid-template-columns: 26px 40px 28px !important;
    width: 106px !important;
    min-width: 106px !important;
    max-width: 106px !important;
    flex-basis: 106px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    font-size: 0.62rem !important;
  }
}


/* ===== PAPINHO PRO V95: saneamento final do player da radio =====
   Esta camada anula os overrides anteriores que estavam comprimindo textos,
   criando sobreposicao e mudando cores de estado indevidamente. */
body #radioPlayer.radio-player {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-areas: "info controls" !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  min-height: 0 !important;
  padding: 10px 16px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border-color) !important;
  outline: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body #radioPlayer.radio-player .radio-info {
  grid-area: info !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body #radioPlayer.radio-player .radio-logo {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 14px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden !important;
  flex: 0 0 44px !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

body #radioPlayer.radio-player .radio-logo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

body #radioPlayer.radio-player .radio-details {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, max-content) auto !important;
  grid-template-areas: "name meta status" !important;
  align-items: center !important;
  justify-content: start !important;
  column-gap: 14px !important;
  row-gap: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body #radioPlayer.radio-player .radio-name {
  grid-area: name !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--text-primary) !important;
  font-size: 0.96rem !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body #radioPlayer.radio-player .radio-meta {
  grid-area: meta !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--text-secondary) !important;
  opacity: 0.9 !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body #radioPlayer.radio-player .radio-live-dot {
  width: 8px !important;
  min-width: 8px !important;
  height: 8px !important;
  min-height: 8px !important;
  border-radius: 999px !important;
  background: #22c55e !important;
  box-shadow: none !important;
  display: inline-block !important;
  margin: 0 !important;
}

body #radioPlayer.radio-player .radio-status {
  grid-area: status !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: start !important;
  align-self: center !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
  height: 24px !important;
  min-height: 24px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  border-radius: 999px !important;
  text-shadow: none !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  font-style: normal !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  transform: none !important;
}

body #radioPlayer.radio-player .radio-status.idle {
  color: var(--text-secondary) !important;
  background: rgba(148, 163, 184, 0.16) !important;
}

body #radioPlayer.radio-player .radio-status.loading,
body #radioPlayer.radio-player .radio-status.connecting {
  color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.16) !important;
}

body #radioPlayer.radio-player .radio-status.playing {
  color: #22c55e !important;
  background: rgba(34, 197, 94, 0.16) !important;
}

body #radioPlayer.radio-player .radio-status.error {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.14) !important;
}

body #radioPlayer.radio-player .radio-controls {
  grid-area: controls !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  flex-wrap: nowrap !important;
}

body #radioPlayer.radio-player .radio-main-btn,
body #radioPlayer.radio-player .radio-btn.play-btn {
  box-sizing: border-box !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  flex: 0 0 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 10px 22px rgba(var(--chat-accent-rgb), 0.22) !important;
}

body #radioPlayer.radio-player .volume-control {
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: 30px 62px 34px !important;
  align-items: center !important;
  justify-content: start !important;
  gap: 8px !important;
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 38px !important;
  min-height: 38px !important;
  flex: 0 0 150px !important;
  margin: 0 !important;
  padding: 0 8px !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  border-radius: 14px !important;
  overflow: visible !important;
  background: rgba(148, 163, 184, 0.12) !important;
  color: var(--text-secondary) !important;
}

body #radioPlayer.radio-player .volume-toggle-btn {
  grid-column: 1 !important;
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  border-radius: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body #radioPlayer.radio-player .volume-control i {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--accent-color) !important;
  font-size: 0.92rem !important;
}

body #radioPlayer.radio-player .volume-control input[type="range"] {
  grid-column: 2 !important;
  box-sizing: border-box !important;
  display: block !important;
  width: 62px !important;
  min-width: 62px !important;
  max-width: 62px !important;
  height: 4px !important;
  flex: 0 0 62px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: linear-gradient(90deg, var(--accent-color) var(--volume-percent, 70%), rgba(148, 163, 184, 0.32) var(--volume-percent, 70%)) !important;
  border-radius: 999px !important;
}

body #radioPlayer.radio-player .volume-value {
  grid-column: 3 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  margin: 0 !important;
  color: var(--text-secondary) !important;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-runnable-track {
  height: 4px !important;
  border-radius: 999px !important;
  background: transparent !important;
}

body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-track {
  height: 4px !important;
  border-radius: 999px !important;
  background: transparent !important;
}

body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-thumb {
  width: 12px !important;
  height: 12px !important;
  margin-top: -4px !important;
  border: 0 !important;
  background: var(--accent-color) !important;
  box-shadow: none !important;
}

body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-thumb {
  width: 12px !important;
  height: 12px !important;
  border: 0 !important;
  background: var(--accent-color) !important;
  box-shadow: none !important;
}

@media (max-width: 720px) {
  body #radioPlayer.radio-player {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "info"
      "controls" !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 12px 22px !important;
  }

  body #radioPlayer.radio-player .radio-info {
    grid-template-columns: 46px minmax(0, 1fr) !important;
    gap: 14px !important;
    align-items: center !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
  }

  body #radioPlayer.radio-player .radio-details {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "name"
      "meta"
      "status" !important;
    align-items: start !important;
    justify-content: stretch !important;
    row-gap: 5px !important;
    column-gap: 0 !important;
    width: 100% !important;
  }

  body #radioPlayer.radio-player .radio-name {
    font-size: 1rem !important;
    line-height: 1.1 !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    max-width: 100% !important;
    font-size: 0.78rem !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .radio-status {
    justify-self: start !important;
    width: auto !important;
    max-width: 100% !important;
    height: 22px !important;
    min-height: 22px !important;
    padding: 0 9px !important;
    font-size: 0.68rem !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    flex-basis: 44px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    width: 154px !important;
    min-width: 154px !important;
    max-width: 154px !important;
    flex-basis: 154px !important;
    grid-template-columns: 30px 64px 34px !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
  }
}

@media (max-width: 430px) {
  body #radioPlayer.radio-player {
    padding: 12px 22px !important;
  }

  body #radioPlayer.radio-player .radio-info {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    font-size: 0.74rem !important;
  }

  body #radioPlayer.radio-player .volume-control {
    width: 146px !important;
    min-width: 146px !important;
    max-width: 146px !important;
    flex-basis: 146px !important;
    grid-template-columns: 30px 56px 34px !important;
    gap: 8px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
  }
}


/* ===== PAPINHO PRO V96: rádio compacta sem segunda linha vazia ===== */
@media (max-width: 720px) {
  body #radioPlayer.radio-player {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "info controls" !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 10px !important;
    padding: 10px 18px !important;
    min-height: 0 !important;
  }

  body #radioPlayer.radio-player .radio-info {
    grid-area: info !important;
    min-width: 0 !important;
    width: 100% !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  body #radioPlayer.radio-player .radio-details {
    min-width: 0 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "name"
      "meta"
      "status" !important;
    row-gap: 3px !important;
    align-items: start !important;
    justify-content: stretch !important;
  }

  body #radioPlayer.radio-player .radio-name {
    grid-area: name !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    grid-area: meta !important;
    max-width: 100% !important;
    font-size: 0.72rem !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    opacity: 0.92 !important;
  }

  body #radioPlayer.radio-player .radio-status {
    grid-area: status !important;
    justify-self: start !important;
    width: auto !important;
    max-width: 100% !important;
    min-height: 19px !important;
    height: 19px !important;
    padding: 0 8px !important;
    font-size: 0.62rem !important;
    line-height: 19px !important;
    white-space: nowrap !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    grid-area: controls !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    align-self: center !important;
    gap: 8px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    flex: 0 0 38px !important;
    border-radius: 13px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    width: 108px !important;
    min-width: 108px !important;
    max-width: 108px !important;
    height: 36px !important;
    min-height: 36px !important;
    flex: 0 0 108px !important;
    grid-template-columns: 28px 36px 26px !important;
    gap: 5px !important;
    padding: 0 6px !important;
    border-radius: 13px !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    border-radius: 9px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    font-size: 0.61rem !important;
  }
}

@media (max-width: 430px) {
  body #radioPlayer.radio-player {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "info controls" !important;
    gap: 8px !important;
    padding: 9px 14px !important;
  }

  body #radioPlayer.radio-player .radio-info {
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 9px !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
  }

  body #radioPlayer.radio-player .radio-name {
    font-size: 0.94rem !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    font-size: 0.68rem !important;
  }

  body #radioPlayer.radio-player .radio-status {
    max-width: 132px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    gap: 6px !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    flex-basis: 36px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    flex-basis: 96px !important;
    grid-template-columns: 26px 30px 24px !important;
    gap: 5px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 5px !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    width: 26px !important;
    min-width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    font-size: 0.58rem !important;
  }
}


/* ===== PAPINHO V97: radio mobile controls no topo ===== */
@media (max-width: 768px) {
  #radioPlayer.radio-player {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "info controls" !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 0 !important;
    padding: 10px 12px !important;
    min-height: 74px !important;
    overflow: hidden !important;
  }

  #radioPlayer .radio-info {
    grid-area: info !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 9px !important;
  }

  #radioPlayer .radio-logo {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    border-radius: 13px !important;
  }

  #radioPlayer .radio-details {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 2px !important;
    line-height: 1.12 !important;
  }

  #radioPlayer .radio-name {
    max-width: 100% !important;
    font-size: 1rem !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #radioPlayer .radio-meta {
    max-width: 100% !important;
    font-size: .72rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: .85 !important;
  }

  #radioPlayer .radio-status {
    max-width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    align-self: flex-start !important;
    margin-top: 1px !important;
    padding: 2px 8px !important;
    min-height: 18px !important;
    border-radius: 999px !important;
    font-size: .68rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #radioPlayer .radio-controls {
    grid-area: controls !important;
    width: 156px !important;
    min-width: 156px !important;
    max-width: 156px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #radioPlayer .radio-btn.play-btn {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    border-radius: 15px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #radioPlayer .volume-control {
    width: 108px !important;
    min-width: 108px !important;
    max-width: 108px !important;
    min-height: 42px !important;
    height: 42px !important;
    display: grid !important;
    grid-template-columns: 30px 1fr 34px !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 7px !important;
    border-radius: 15px !important;
    overflow: visible !important;
  }

  #radioPlayer .volume-toggle-btn {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    border-radius: 11px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #radioPlayer .volume-toggle-btn i {
    font-size: .84rem !important;
  }

  #radioPlayer .volume-control input[type="range"] {
    width: 100% !important;
    min-width: 34px !important;
    max-width: 44px !important;
    height: 16px !important;
    margin: 0 !important;
  }

  #radioPlayer .volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 5px !important;
  }

  #radioPlayer .volume-control input[type="range"]::-moz-range-track {
    height: 5px !important;
  }

  #radioPlayer .volume-control input[type="range"]::-webkit-slider-thumb {
    width: 16px !important;
    height: 16px !important;
    margin-top: -5.5px !important;
    border-width: 2px !important;
  }

  #radioPlayer .volume-control input[type="range"]::-moz-range-thumb {
    width: 16px !important;
    height: 16px !important;
    border-width: 2px !important;
  }

  #radioPlayer .volume-value {
    min-width: 34px !important;
    max-width: 34px !important;
    display: inline-block !important;
    text-align: right !important;
    font-size: .68rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
  }
}

@media (max-width: 370px) {
  #radioPlayer.radio-player {
    grid-template-columns: minmax(0, 1fr) 142px !important;
    column-gap: 8px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  #radioPlayer .radio-controls {
    width: 142px !important;
    min-width: 142px !important;
    max-width: 142px !important;
    gap: 5px !important;
  }

  #radioPlayer .radio-btn.play-btn {
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
  }

  #radioPlayer .volume-control {
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    grid-template-columns: 28px 1fr 30px !important;
    gap: 4px !important;
    padding: 0 6px !important;
  }

  #radioPlayer .volume-toggle-btn {
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
  }

  #radioPlayer .volume-value {
    min-width: 30px !important;
    max-width: 30px !important;
    font-size: .64rem !important;
  }
}


/* ===== PAPINHO V98: radio mobile controls realmente no topo =====
   Correção estrutural: no mobile, os controles saem do fluxo normal e ficam
   absolutamente posicionados no topo direito do player. Isso impede que caiam
   para uma segunda linha, mesmo com regras antigas ainda presentes no arquivo. */
@media (max-width: 768px) {
  body #radioPlayer.radio-player {
    position: relative !important;
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 72px !important;
    max-height: 72px !important;
    height: 72px !important;
    padding: 10px 12px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-info {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 9px !important;
    width: calc(100% - 166px) !important;
    max-width: calc(100% - 166px) !important;
    min-width: 0 !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    border-radius: 13px !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  body #radioPlayer.radio-player .radio-details {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "name"
      "meta"
      "status" !important;
    align-content: center !important;
    justify-items: start !important;
    row-gap: 2px !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-name {
    grid-area: name !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.96rem !important;
    line-height: 1.05 !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    grid-area: meta !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.68rem !important;
    line-height: 1.05 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: 0.86 !important;
  }

  body #radioPlayer.radio-player .radio-live-dot {
    width: 7px !important;
    min-width: 7px !important;
    height: 7px !important;
    min-height: 7px !important;
    flex: 0 0 7px !important;
    border-radius: 999px !important;
    background: #22c55e !important;
  }

  body #radioPlayer.radio-player .radio-status {
    grid-area: status !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    justify-self: start !important;
    align-self: start !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 17px !important;
    min-height: 17px !important;
    margin: 0 !important;
    padding: 0 7px !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 999px !important;
    font-size: 0.6rem !important;
    font-weight: 800 !important;
    line-height: 17px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transform: none !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    position: absolute !important;
    top: 14px !important;
    right: 12px !important;
    grid-area: unset !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    width: 154px !important;
    min-width: 154px !important;
    max-width: 154px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    transform: none !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    flex: 0 0 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 14px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    display: grid !important;
    grid-template-columns: 28px 34px 38px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 108px !important;
    min-width: 108px !important;
    max-width: 108px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    flex: 0 0 108px !important;
    margin: 0 !important;
    padding: 0 6px !important;
    border: 0 !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    grid-column: 1 !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 10px !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn i {
    font-size: 0.82rem !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    grid-column: 2 !important;
    display: block !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 34px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    grid-column: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.64rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

@media (max-width: 370px) {
  body #radioPlayer.radio-player .radio-info {
    width: calc(100% - 154px) !important;
    max-width: calc(100% - 154px) !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    width: 144px !important;
    min-width: 144px !important;
    max-width: 144px !important;
    gap: 5px !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    width: 101px !important;
    min-width: 101px !important;
    max-width: 101px !important;
    flex-basis: 101px !important;
    grid-template-columns: 26px 29px 36px !important;
    gap: 4px !important;
    padding: 0 5px !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 29px !important;
    min-width: 29px !important;
    max-width: 29px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    font-size: 0.62rem !important;
  }
}


/* ===== PAPINHO V99: ajuste fino do player mobile =====
   Objetivo: controles na primeira faixa, menores, mais à esquerda, volume fino e texto sem corte. */
@media (max-width: 768px) {
  body #radioPlayer.radio-player {
    position: relative !important;
    display: block !important;
    box-sizing: border-box !important;
    min-height: 74px !important;
    height: 74px !important;
    max-height: 74px !important;
    padding: 10px 214px 10px 14px !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-info {
    position: static !important;
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 54px !important;
    min-height: 54px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    border-radius: 13px !important;
  }

  body #radioPlayer.radio-player .radio-details {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "name"
      "meta"
      "status" !important;
    align-content: center !important;
    gap: 2px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-name {
    grid-area: name !important;
    font-size: 0.94rem !important;
    line-height: 1.05 !important;
    max-width: 100% !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    grid-area: meta !important;
    font-size: 0.66rem !important;
    line-height: 1.05 !important;
    max-width: 100% !important;
  }

  body #radioPlayer.radio-player .radio-status {
    grid-area: status !important;
    max-width: 100% !important;
    height: 16px !important;
    min-height: 16px !important;
    padding: 0 7px !important;
    font-size: 0.58rem !important;
    line-height: 16px !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    position: absolute !important;
    top: 50% !important;
    right: 16px !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    width: 190px !important;
    min-width: 190px !important;
    max-width: 190px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    grid-area: unset !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    flex: 0 0 34px !important;
    border-radius: 12px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body #radioPlayer.radio-player .radio-main-btn i,
  body #radioPlayer.radio-player .radio-btn.play-btn i {
    font-size: 0.82rem !important;
  }

  body #radioPlayer.radio-player .volume-control {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 26px 52px 42px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: 148px !important;
    min-width: 148px !important;
    max-width: 148px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    flex: 0 0 148px !important;
    margin: 0 !important;
    padding: 0 9px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    grid-column: 1 !important;
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    border-radius: 9px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn i {
    font-size: 0.78rem !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    grid-column: 2 !important;
    display: block !important;
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 12px !important;
    min-height: 12px !important;
    max-height: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 52px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 3px !important;
    border-radius: 999px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-track {
    height: 3px !important;
    border-radius: 999px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-thumb {
    width: 12px !important;
    height: 12px !important;
    margin-top: -4.5px !important;
    box-shadow: 0 0 0 2px rgba(184,16,28,0.22) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-thumb {
    width: 12px !important;
    height: 12px !important;
    box-shadow: 0 0 0 2px rgba(184,16,28,0.22) !important;
  }

  body #radioPlayer.radio-player .volume-value {
    grid-column: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    margin: 0 !important;
    padding: 0 1px 0 0 !important;
    font-size: 0.62rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }
}

@media (max-width: 370px) {
  body #radioPlayer.radio-player {
    padding-right: 202px !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    right: 12px !important;
    width: 182px !important;
    min-width: 182px !important;
    max-width: 182px !important;
    gap: 7px !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    flex-basis: 32px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    width: 143px !important;
    min-width: 143px !important;
    max-width: 143px !important;
    flex-basis: 143px !important;
    grid-template-columns: 24px 50px 41px !important;
    gap: 5px !important;
    padding: 0 8px !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    width: 41px !important;
    min-width: 41px !important;
    max-width: 41px !important;
    font-size: 0.6rem !important;
  }
}


/* ===== PAPINHO V100: player mobile integrado, sem segunda linha ===== */
@media (max-width: 768px) {
  body #radioPlayer.radio-player {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    column-gap: 8px !important;
    row-gap: 0 !important;
    width: 100% !important;
    min-height: 64px !important;
    height: auto !important;
    padding: 8px 9px 8px 10px !important;
    position: relative !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-info {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    border-radius: 12px !important;
  }

  body #radioPlayer.radio-player .radio-details {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "name"
      "meta"
      "status" !important;
    align-content: center !important;
    justify-items: start !important;
    gap: 2px !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-name {
    grid-area: name !important;
    display: block !important;
    max-width: 100% !important;
    font-size: 0.93rem !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    grid-area: meta !important;
    display: flex !important;
    align-items: center !important;
    max-width: 100% !important;
    font-size: 0.66rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-status {
    grid-area: status !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
    padding: 0 7px !important;
    border-radius: 999px !important;
    font-size: 0.58rem !important;
    font-weight: 800 !important;
    line-height: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    grid-column: 2 !important;
    grid-row: 1 !important;
    box-sizing: border-box !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    justify-self: end !important;
    align-self: center !important;
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    margin: 0 !important;
    padding: 4px 5px 4px 7px !important;
    border-radius: 15px !important;
    border: 1px solid color-mix(in srgb, var(--border-color) 75%, transparent 25%) !important;
    background: color-mix(in srgb, var(--bg-tertiary) 82%, transparent 18%) !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .volume-control {
    order: 1 !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 24px 58px 44px !important;
    align-items: center !important;
    justify-content: start !important;
    gap: 5px !important;
    width: 136px !important;
    min-width: 136px !important;
    max-width: 136px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    flex: 0 0 136px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    order: 2 !important;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    flex: 0 0 30px !important;
    border-radius: 11px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body #radioPlayer.radio-player .radio-main-btn i,
  body #radioPlayer.radio-player .radio-btn.play-btn i {
    font-size: 0.76rem !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    grid-column: 1 !important;
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    border-radius: 9px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn i {
    font-size: 0.74rem !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    grid-column: 2 !important;
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 10px !important;
    min-height: 10px !important;
    max-height: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 58px !important;
    background: transparent !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 3px !important;
    border-radius: 999px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-track {
    height: 3px !important;
    border-radius: 999px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-thumb {
    width: 10px !important;
    height: 10px !important;
    margin-top: -3.5px !important;
    box-shadow: 0 0 0 2px rgba(var(--chat-accent-rgb), 0.18) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-thumb {
    width: 10px !important;
    height: 10px !important;
    box-shadow: 0 0 0 2px rgba(var(--chat-accent-rgb), 0.18) !important;
  }

  body #radioPlayer.radio-player .volume-value {
    grid-column: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.62rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

@media (max-width: 370px) {
  body #radioPlayer.radio-player {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 7px 7px 7px 8px !important;
    column-gap: 6px !important;
  }

  body #radioPlayer.radio-player .radio-info {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
  }

  body #radioPlayer.radio-player .radio-name {
    font-size: 0.88rem !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    font-size: 0.61rem !important;
  }

  body #radioPlayer.radio-player .radio-status {
    height: 15px !important;
    min-height: 15px !important;
    max-height: 15px !important;
    padding: 0 6px !important;
    font-size: 0.55rem !important;
    line-height: 15px !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    gap: 5px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 3px 4px 3px 6px !important;
    border-radius: 14px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    grid-template-columns: 22px 48px 40px !important;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    flex-basis: 120px !important;
    gap: 5px !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    font-size: 0.59rem !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    flex-basis: 28px !important;
  }
}


/* ===== PAPINHO V101: restaura player visível e integra controles com flex seguro ===== */
@media (max-width: 768px) {
  body #radioPlayer.radio-player {
    box-sizing: border-box !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 58px !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 7px 9px !important;
    overflow: visible !important;
    position: relative !important;
  }

  body #radioPlayer.radio-player .radio-info {
    box-sizing: border-box !important;
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    gap: 7px !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: calc(100% - 164px) !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    display: flex !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    border-radius: 12px !important;
  }

  body #radioPlayer.radio-player .radio-details {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "name" "meta" "status" !important;
    align-content: center !important;
    justify-items: start !important;
    gap: 2px !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .radio-name {
    grid-area: name !important;
    display: block !important;
    max-width: 100% !important;
    font-size: 0.9rem !important;
    line-height: 1.04 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    grid-area: meta !important;
    display: flex !important;
    align-items: center !important;
    max-width: 100% !important;
    font-size: 0.62rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-status {
    grid-area: status !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
    margin: 0 !important;
    padding: 0 7px !important;
    border-radius: 999px !important;
    font-size: 0.56rem !important;
    font-weight: 800 !important;
    line-height: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    box-sizing: border-box !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 0 0 156px !important;
    width: 156px !important;
    min-width: 156px !important;
    max-width: 156px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 3px 5px 3px 7px !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    border-radius: 15px !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    background: rgba(255, 255, 255, 0.045) !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .volume-control {
    box-sizing: border-box !important;
    order: 1 !important;
    display: grid !important;
    grid-template-columns: 23px 46px 35px !important;
    align-items: center !important;
    justify-content: start !important;
    gap: 5px !important;
    flex: 0 0 114px !important;
    width: 114px !important;
    min-width: 114px !important;
    max-width: 114px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    box-sizing: border-box !important;
    order: 2 !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 30px !important;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 11px !important;
  }

  body #radioPlayer.radio-player .radio-main-btn i,
  body #radioPlayer.radio-player .radio-btn.play-btn i {
    font-size: 0.76rem !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    grid-column: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 23px !important;
    min-width: 23px !important;
    max-width: 23px !important;
    height: 23px !important;
    min-height: 23px !important;
    max-height: 23px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 9px !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn i {
    font-size: 0.72rem !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    grid-column: 2 !important;
    display: block !important;
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 10px !important;
    min-height: 10px !important;
    max-height: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 46px !important;
    background: transparent !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 2px !important;
    border-radius: 999px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-track {
    height: 2px !important;
    border-radius: 999px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-thumb {
    width: 9px !important;
    height: 9px !important;
    margin-top: -3.5px !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-thumb {
    width: 9px !important;
    height: 9px !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12) !important;
  }

  body #radioPlayer.radio-player .volume-value {
    grid-column: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 35px !important;
    min-width: 35px !important;
    max-width: 35px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.58rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

@media (max-width: 370px) {
  body #radioPlayer.radio-player {
    gap: 6px !important;
    padding: 7px 7px !important;
  }

  body #radioPlayer.radio-player .radio-info {
    max-width: calc(100% - 146px) !important;
    gap: 6px !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    flex-basis: 33px !important;
    width: 33px !important;
    min-width: 33px !important;
    max-width: 33px !important;
    height: 33px !important;
    min-height: 33px !important;
    max-height: 33px !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    flex-basis: 140px !important;
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    gap: 5px !important;
    padding: 3px 4px 3px 5px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    grid-template-columns: 22px 41px 32px !important;
    flex-basis: 105px !important;
    width: 105px !important;
    min-width: 105px !important;
    max-width: 105px !important;
    gap: 5px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 41px !important;
    min-width: 41px !important;
    max-width: 41px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    font-size: 0.55rem !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    flex-basis: 28px !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
  }
}

/* ===== PAPINHO V102: player mobile com play integrado no topo direito ===== */
@media (max-width: 768px) {
  body #radioPlayer.radio-player {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 136px !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 7px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 7px 8px 7px 9px !important;
    overflow: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-info {
    box-sizing: border-box !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    display: flex !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-logo img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  body #radioPlayer.radio-player .radio-details {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "name" "meta" "status" !important;
    align-content: center !important;
    justify-items: start !important;
    gap: 2px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-name {
    grid-area: name !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    line-height: 1.04 !important;
    color: var(--text-primary) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    grid-area: meta !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.62rem !important;
    line-height: 1.05 !important;
    color: var(--text-secondary) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-status {
    grid-area: status !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
    margin: 0 !important;
    padding: 0 7px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--bg-tertiary) 88%, transparent 12%) !important;
    font-size: 0.56rem !important;
    font-weight: 800 !important;
    line-height: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: 1 !important;
    box-shadow: none !important;
  }

  body #radioPlayer.radio-player .radio-status.idle,
  body #radioPlayer.radio-player.radio-idle .radio-status {
    color: var(--text-secondary) !important;
  }

  body #radioPlayer.radio-player .radio-status.loading,
  body #radioPlayer.radio-player .radio-status.connecting,
  body #radioPlayer.radio-player.radio-loading .radio-status {
    color: #facc15 !important;
    background: rgba(250, 204, 21, 0.13) !important;
  }

  body #radioPlayer.radio-player .radio-status.playing,
  body #radioPlayer.radio-player.radio-playing .radio-status {
    color: #22c55e !important;
    background: rgba(34, 197, 94, 0.13) !important;
    text-shadow: none !important;
  }

  body #radioPlayer.radio-player .radio-status.error,
  body #radioPlayer.radio-player.radio-error .radio-status {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.13) !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    box-sizing: border-box !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 30px !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 5px !important;
    width: 136px !important;
    min-width: 136px !important;
    max-width: 136px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    margin: 0 !important;
    padding: 3px 4px 3px 6px !important;
    justify-self: end !important;
    align-self: center !important;
    border-radius: 16px !important;
    border: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent 22%) !important;
    background: color-mix(in srgb, var(--bg-tertiary) 72%, transparent 28%) !important;
    box-shadow: none !important;
    overflow: visible !important;
    position: static !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .volume-control {
    box-sizing: border-box !important;
    order: 1 !important;
    grid-column: 1 !important;
    display: grid !important;
    grid-template-columns: 21px 36px minmax(25px, 1fr) !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    box-sizing: border-box !important;
    order: 2 !important;
    grid-column: 2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-main-btn i,
  body #radioPlayer.radio-player .radio-btn.play-btn i {
    font-size: 0.72rem !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    grid-column: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 21px !important;
    min-width: 21px !important;
    max-width: 21px !important;
    height: 21px !important;
    min-height: 21px !important;
    max-height: 21px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 8px !important;
    border: 0 !important;
    background: transparent !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn i {
    font-size: 0.7rem !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    grid-column: 2 !important;
    display: block !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 10px !important;
    min-height: 10px !important;
    max-height: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 2px !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, var(--accent-color), var(--chat-accent-2)) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-track {
    height: 2px !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, var(--accent-color), var(--chat-accent-2)) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 9px !important;
    height: 9px !important;
    margin-top: -3.5px !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(var(--chat-accent-rgb), 0.18) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-thumb {
    width: 9px !important;
    height: 9px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(var(--chat-accent-rgb), 0.18) !important;
  }

  body #radioPlayer.radio-player .volume-value {
    grid-column: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-width: 25px !important;
    max-width: 34px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 1px 0 0 !important;
    font-size: 0.56rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

@media (max-width: 370px) {
  body #radioPlayer.radio-player {
    grid-template-columns: minmax(0, 1fr) 126px !important;
    gap: 5px !important;
    padding: 7px 6px 7px 7px !important;
  }

  body #radioPlayer.radio-player .radio-info {
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
  }

  body #radioPlayer.radio-player .radio-name {
    font-size: 0.84rem !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    font-size: 0.58rem !important;
  }

  body #radioPlayer.radio-player .radio-status {
    height: 15px !important;
    min-height: 15px !important;
    max-height: 15px !important;
    padding: 0 6px !important;
    font-size: 0.52rem !important;
    line-height: 15px !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    grid-template-columns: minmax(0, 1fr) 28px !important;
    width: 126px !important;
    min-width: 126px !important;
    max-width: 126px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    gap: 4px !important;
    padding: 3px 3px 3px 5px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    grid-template-columns: 20px 32px minmax(24px, 1fr) !important;
    gap: 3px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    border-radius: 11px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    font-size: 0.52rem !important;
    max-width: 31px !important;
  }
}


/* ===== PAPINHO V103: player mobile SEM segunda linha =====
   Controles presos por position:absolute na primeira faixa, dentro da moldura do player. */
@media (max-width: 768px) {
  body #radioPlayer.radio-player {
    box-sizing: border-box !important;
    position: relative !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 7px 150px 7px 9px !important;
    overflow: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-info {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 38px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    border-radius: 12px !important;
  }

  body #radioPlayer.radio-player .radio-details {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "name" "meta" "status" !important;
    align-content: center !important;
    gap: 2px !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-name {
    grid-area: name !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    font-size: 0.9rem !important;
    line-height: 1.04 !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    grid-area: meta !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    font-size: 0.62rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-status {
    grid-area: status !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: fit-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
    margin: 0 !important;
    padding: 0 7px !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-size: 0.56rem !important;
    font-weight: 800 !important;
    line-height: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-shadow: none !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-status.idle,
  body #radioPlayer.radio-player.radio-idle .radio-status {
    color: var(--text-secondary) !important;
    background: color-mix(in srgb, var(--bg-tertiary) 88%, transparent 12%) !important;
  }

  body #radioPlayer.radio-player .radio-status.loading,
  body #radioPlayer.radio-player .radio-status.connecting,
  body #radioPlayer.radio-player.radio-loading .radio-status {
    color: #facc15 !important;
    background: rgba(250, 204, 21, 0.13) !important;
  }

  body #radioPlayer.radio-player .radio-status.playing,
  body #radioPlayer.radio-player.radio-playing .radio-status {
    color: #22c55e !important;
    background: rgba(34, 197, 94, 0.13) !important;
  }

  body #radioPlayer.radio-player .radio-status.error,
  body #radioPlayer.radio-player.radio-error .radio-status {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.13) !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    box-sizing: border-box !important;
    position: absolute !important;
    top: 50% !important;
    right: 8px !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    width: 136px !important;
    min-width: 136px !important;
    max-width: 136px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
    padding: 3px 4px 3px 6px !important;
    border-radius: 16px !important;
    border: 1px solid color-mix(in srgb, var(--border-color) 78%, transparent 22%) !important;
    background: color-mix(in srgb, var(--bg-tertiary) 72%, transparent 28%) !important;
    box-shadow: none !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    box-sizing: border-box !important;
    order: 2 !important;
    flex: 0 0 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 11px !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-main-btn i,
  body #radioPlayer.radio-player .radio-btn.play-btn i {
    font-size: 0.68rem !important;
  }

  body #radioPlayer.radio-player .volume-control {
    box-sizing: border-box !important;
    order: 1 !important;
    flex: 1 1 auto !important;
    display: grid !important;
    grid-template-columns: 20px 36px minmax(26px, 1fr) !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 4px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    grid-column: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn i {
    font-size: 0.68rem !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    grid-column: 2 !important;
    display: block !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 10px !important;
    min-height: 10px !important;
    max-height: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 2px !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, var(--accent-color), var(--chat-accent-2)) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-track {
    height: 2px !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, var(--accent-color), var(--chat-accent-2)) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 9px !important;
    height: 9px !important;
    margin-top: -3.5px !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(var(--chat-accent-rgb), 0.18) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-thumb {
    width: 9px !important;
    height: 9px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(var(--chat-accent-rgb), 0.18) !important;
  }

  body #radioPlayer.radio-player .volume-value {
    grid-column: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-width: 26px !important;
    max-width: 34px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.54rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

@media (max-width: 370px) {
  body #radioPlayer.radio-player {
    padding-right: 138px !important;
    padding-left: 7px !important;
    min-height: 50px !important;
  }

  body #radioPlayer.radio-player .radio-info {
    grid-template-columns: 32px minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
  }

  body #radioPlayer.radio-player .radio-name {
    font-size: 0.84rem !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    font-size: 0.56rem !important;
  }

  body #radioPlayer.radio-player .radio-status {
    height: 15px !important;
    min-height: 15px !important;
    max-height: 15px !important;
    padding: 0 6px !important;
    font-size: 0.51rem !important;
    line-height: 15px !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    right: 6px !important;
    width: 126px !important;
    min-width: 126px !important;
    max-width: 126px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    gap: 4px !important;
    padding: 2px 3px 2px 5px !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    flex-basis: 27px !important;
    width: 27px !important;
    min-width: 27px !important;
    max-width: 27px !important;
    height: 27px !important;
    min-height: 27px !important;
    max-height: 27px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    grid-template-columns: 19px 31px minmax(25px, 1fr) !important;
    gap: 3px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 31px !important;
    min-width: 31px !important;
    max-width: 31px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    min-width: 25px !important;
    max-width: 31px !important;
    font-size: 0.5rem !important;
  }
}


/* ===== PAPINHO V104: player mobile maior + play à esquerda dos controles =====
   Mantém os controles integrados na moldura, no lado direito da primeira faixa,
   mas coloca o play/stop à ESQUERDA dentro da cápsula e aumenta o player. */
@media (max-width: 768px) {
  body #radioPlayer.radio-player,
  body .main-content #radioPlayer.radio-player {
    box-sizing: border-box !important;
    position: relative !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 66px !important;
    height: 66px !important;
    max-height: 66px !important;
    margin: 0 !important;
    padding: 9px 164px 9px 11px !important;
    overflow: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-info {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 9px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    border-radius: 14px !important;
  }

  body #radioPlayer.radio-player .radio-details {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "name" "meta" "status" !important;
    align-content: center !important;
    gap: 3px !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-name {
    grid-area: name !important;
    display: block !important;
    max-width: 100% !important;
    font-size: 0.98rem !important;
    line-height: 1.08 !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    grid-area: meta !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    max-width: 100% !important;
    font-size: 0.68rem !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: 0.86 !important;
  }

  body #radioPlayer.radio-player .radio-status {
    grid-area: status !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: fit-content !important;
    max-width: 100% !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    padding: 0 8px !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-size: 0.6rem !important;
    font-weight: 850 !important;
    line-height: 18px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: 1 !important;
    box-shadow: none !important;
  }

  body #radioPlayer.radio-player .radio-status.idle,
  body #radioPlayer.radio-player.radio-idle .radio-status {
    color: var(--text-secondary) !important;
    background: color-mix(in srgb, var(--bg-tertiary) 88%, transparent 12%) !important;
  }

  body #radioPlayer.radio-player .radio-status.loading,
  body #radioPlayer.radio-player .radio-status.connecting,
  body #radioPlayer.radio-player.radio-loading .radio-status {
    color: #facc15 !important;
    background: rgba(250, 204, 21, 0.14) !important;
  }

  body #radioPlayer.radio-player .radio-status.playing,
  body #radioPlayer.radio-player.radio-playing .radio-status {
    color: #22c55e !important;
    background: rgba(34, 197, 94, 0.14) !important;
  }

  body #radioPlayer.radio-player .radio-status.error,
  body #radioPlayer.radio-player.radio-error .radio-status {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.14) !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    box-sizing: border-box !important;
    position: absolute !important;
    top: 50% !important;
    right: 10px !important;
    left: auto !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    z-index: 4 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    width: 148px !important;
    min-width: 148px !important;
    max-width: 148px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    margin: 0 !important;
    padding: 4px 7px !important;
    border-radius: 18px !important;
    border: 1px solid color-mix(in srgb, var(--border-color) 76%, transparent 24%) !important;
    background: color-mix(in srgb, var(--bg-tertiary) 78%, transparent 22%) !important;
    box-shadow: none !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    order: 1 !important;
    box-sizing: border-box !important;
    flex: 0 0 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 13px !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-main-btn i,
  body #radioPlayer.radio-player .radio-btn.play-btn i {
    font-size: 0.74rem !important;
  }

  body #radioPlayer.radio-player .volume-control {
    order: 2 !important;
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    display: grid !important;
    grid-template-columns: 21px 42px minmax(28px, 1fr) !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 4px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    grid-column: 1 !important;
    width: 21px !important;
    min-width: 21px !important;
    max-width: 21px !important;
    height: 21px !important;
    min-height: 21px !important;
    max-height: 21px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn i {
    font-size: 0.7rem !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    grid-column: 2 !important;
    display: block !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 10px !important;
    min-height: 10px !important;
    max-height: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 2px !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, var(--accent-color), var(--chat-accent-2)) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-track {
    height: 2px !important;
    border-radius: 999px !important;
    background: linear-gradient(90deg, var(--accent-color), var(--chat-accent-2)) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 9px !important;
    height: 9px !important;
    margin-top: -3.5px !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(var(--chat-accent-rgb), 0.18) !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"]::-moz-range-thumb {
    width: 9px !important;
    height: 9px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 0 0 2px rgba(var(--chat-accent-rgb), 0.18) !important;
  }

  body #radioPlayer.radio-player .volume-value {
    grid-column: 3 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-width: 28px !important;
    max-width: 36px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.56rem !important;
    font-weight: 850 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

@media (max-width: 370px) {
  body #radioPlayer.radio-player,
  body .main-content #radioPlayer.radio-player {
    min-height: 64px !important;
    height: 64px !important;
    max-height: 64px !important;
    padding: 8px 151px 8px 9px !important;
  }

  body #radioPlayer.radio-player .radio-info {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    min-height: 46px !important;
    height: 46px !important;
    gap: 7px !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    border-radius: 13px !important;
  }

  body #radioPlayer.radio-player .radio-name {
    font-size: 0.9rem !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    font-size: 0.6rem !important;
  }

  body #radioPlayer.radio-player .radio-status {
    height: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
    padding: 0 6px !important;
    font-size: 0.52rem !important;
    line-height: 16px !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    right: 7px !important;
    width: 137px !important;
    min-width: 137px !important;
    max-width: 137px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    gap: 5px !important;
    padding: 4px 6px !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    flex-basis: 32px !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    grid-template-columns: 20px 36px minmax(27px, 1fr) !important;
    gap: 3px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    min-width: 27px !important;
    max-width: 34px !important;
    font-size: 0.51rem !important;
  }
}


/* ===== PAPINHO V105: player mobile maior com controles na primeira faixa =====
   Mantém o play/stop à esquerda dentro da cápsula de controles, no topo direito,
   e aumenta o bloco inteiro aproveitando melhor o espaço livre. */
@media (max-width: 768px) {
  body #radioPlayer.radio-player,
  body .main-content #radioPlayer.radio-player {
    box-sizing: border-box !important;
    position: relative !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 76px !important;
    height: 76px !important;
    max-height: 76px !important;
    margin: 0 !important;
    padding: 10px 178px 10px 13px !important;
    overflow: hidden !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-info {
    display: grid !important;
    grid-template-columns: 50px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 11px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 56px !important;
    height: 56px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    border-radius: 16px !important;
  }

  body #radioPlayer.radio-player .radio-details {
    display: grid !important;
    grid-template-areas: "name" "meta" "status" !important;
    align-content: center !important;
    gap: 4px !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  body #radioPlayer.radio-player .radio-name {
    grid-area: name !important;
    font-size: 1.06rem !important;
    line-height: 1.08 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    grid-area: meta !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 0.72rem !important;
    line-height: 1.08 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: 0.9 !important;
  }

  body #radioPlayer.radio-player .radio-status {
    grid-area: status !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: fit-content !important;
    max-width: 100% !important;
    height: 19px !important;
    min-height: 19px !important;
    max-height: 19px !important;
    padding: 0 9px !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-size: 0.62rem !important;
    font-weight: 850 !important;
    line-height: 19px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    opacity: 1 !important;
    box-shadow: none !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    box-sizing: border-box !important;
    position: absolute !important;
    top: 50% !important;
    right: 10px !important;
    left: auto !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    z-index: 4 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 158px !important;
    min-width: 158px !important;
    max-width: 158px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    margin: 0 !important;
    padding: 5px 8px !important;
    border-radius: 20px !important;
    border: 1px solid color-mix(in srgb, var(--border-color) 76%, transparent 24%) !important;
    background: color-mix(in srgb, var(--bg-tertiary) 80%, transparent 20%) !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14) !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    order: 1 !important;
    box-sizing: border-box !important;
    flex: 0 0 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 15px !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body #radioPlayer.radio-player .radio-main-btn i,
  body #radioPlayer.radio-player .radio-btn.play-btn i {
    font-size: 0.82rem !important;
  }

  body #radioPlayer.radio-player .volume-control {
    order: 2 !important;
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    display: grid !important;
    grid-template-columns: 22px 48px minmax(30px, 1fr) !important;
    align-items: center !important;
    justify-content: stretch !important;
    gap: 5px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body #radioPlayer.radio-player .volume-toggle-btn {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 10px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    min-width: 30px !important;
    max-width: 42px !important;
    font-size: 0.58rem !important;
  }
}

@media (max-width: 370px) {
  body #radioPlayer.radio-player,
  body .main-content #radioPlayer.radio-player {
    min-height: 72px !important;
    height: 72px !important;
    max-height: 72px !important;
    padding: 9px 162px 9px 10px !important;
  }

  body #radioPlayer.radio-player .radio-info {
    grid-template-columns: 46px minmax(0, 1fr) !important;
    min-height: 54px !important;
    height: 54px !important;
    gap: 8px !important;
  }

  body #radioPlayer.radio-player .radio-logo {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
    border-radius: 15px !important;
  }

  body #radioPlayer.radio-player .radio-name {
    font-size: 0.98rem !important;
  }

  body #radioPlayer.radio-player .radio-meta {
    font-size: 0.64rem !important;
  }

  body #radioPlayer.radio-player .radio-status {
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    padding: 0 7px !important;
    font-size: 0.56rem !important;
    line-height: 18px !important;
  }

  body #radioPlayer.radio-player .radio-controls {
    right: 7px !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    gap: 6px !important;
    padding: 5px 7px !important;
  }

  body #radioPlayer.radio-player .radio-main-btn,
  body #radioPlayer.radio-player .radio-btn.play-btn {
    flex-basis: 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
  }

  body #radioPlayer.radio-player .volume-control {
    grid-template-columns: 21px 42px minmax(29px, 1fr) !important;
    gap: 4px !important;
  }

  body #radioPlayer.radio-player .volume-control input[type="range"] {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
  }

  body #radioPlayer.radio-player .volume-value {
    min-width: 29px !important;
    max-width: 38px !important;
    font-size: 0.54rem !important;
  }
}


/* ===== PAPINHO PRO V106: polimento de menus, pickers, mídia e reconexão visual ===== */
:root {
  --panel-glass-bg: color-mix(in srgb, var(--bg-secondary) 90%, transparent 10%);
  --panel-soft-border: color-mix(in srgb, var(--border-color) 74%, transparent 26%);
}

/* Abas: seta de rolagem moderna */
.tabs-container {
  position: relative !important;
  padding-right: 42px !important;
}
.tabs-scroll-hint {
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) translateX(8px) !important;
  width: 32px !important;
  height: 32px !important;
  border: 1px solid color-mix(in srgb, var(--accent-color) 34%, var(--border-color)) !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: var(--accent-color) !important;
  box-shadow: 0 12px 24px rgba(0,0,0,.22) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .22s ease, transform .22s ease !important;
  z-index: 5 !important;
}
.tabs-scroll-hint.is-visible {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(-50%) translateX(0) !important;
  animation: papinhoHintNudge 1.7s ease-in-out infinite !important;
}
@keyframes papinhoHintNudge {
  0%,100% { margin-right: 0; }
  50% { margin-right: -4px; }
}

/* Menus laterais mais profissionais */
.sidebar,
.user-panel {
  border: 1px solid var(--panel-soft-border) !important;
}
.sidebar-header,
.user-panel-header,
.channels-drawer-header,
.users-drawer-header {
  min-height: auto !important;
  padding: 16px 16px 12px !important;
  gap: 12px !important;
  border-bottom: 1px solid var(--panel-soft-border) !important;
}
.sidebar-title-block h2,
.user-panel-title-block h4 {
  margin: 0 !important;
  font-size: 1.02rem !important;
  line-height: 1.1 !important;
  letter-spacing: .01em !important;
}
.sidebar-title-block span,
.user-panel-title-block span {
  display: block !important;
  margin-top: 4px !important;
  color: var(--text-secondary) !important;
  font-size: .78rem !important;
}
.sidebar-header-actions {
  gap: 8px !important;
}
.sidebar-close-btn,
.user-panel-close-btn,
.picker-close-btn,
.emoji-picker-close,
.gif-picker-close {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 12px !important;
  border: 1px solid var(--panel-soft-border) !important;
  background: color-mix(in srgb, var(--bg-tertiary) 88%, transparent) !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
  transition: transform .18s ease, background .18s ease, border-color .18s ease !important;
}
.sidebar-close-btn:hover,
.user-panel-close-btn:hover,
.picker-close-btn:hover,
.emoji-picker-close:hover,
.gif-picker-close:hover {
  transform: rotate(90deg) scale(1.04) !important;
  background: color-mix(in srgb, var(--accent-color) 22%, var(--bg-tertiary)) !important;
  border-color: color-mix(in srgb, var(--accent-color) 45%, var(--border-color)) !important;
}

.user-panel-title-block {
  min-width: 0 !important;
}
.user-panel-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

/* Contadores profissionais, sem bolha vermelha amadora */
.channel-users,
.user-count-badge,
.user-panel-count,
.chat-header .user-count,
.user-count {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 28px !important;
  height: 22px !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  color: color-mix(in srgb, var(--text-primary) 84%, var(--accent-color) 16%) !important;
  background: color-mix(in srgb, var(--accent-color) 12%, var(--bg-tertiary)) !important;
  border: 1px solid color-mix(in srgb, var(--accent-color) 24%, var(--border-color)) !important;
  box-shadow: none !important;
  font-size: .75rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}
.channel-users::before { display: none !important; content: none !important; }
.channel-users[data-users="high"],
.channel-users[data-users="medium"] {
  color: color-mix(in srgb, var(--text-primary) 88%, var(--accent-color) 12%) !important;
  background: color-mix(in srgb, var(--accent-color) 16%, var(--bg-tertiary)) !important;
}

/* Canais mais compactos; número mais perto do nome */
.channel-list {
  padding: 8px 10px 12px !important;
}
.channel-item {
  padding: 9px 10px !important;
}
.channel-main {
  display: grid !important;
  grid-template-columns: minmax(0, auto) max-content !important;
  justify-content: start !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}
.channel-name {
  min-width: 0 !important;
  max-width: 210px !important;
}

/* Base do menu de canais elevada e mais limpa */
.user-controls {
  margin: 12px 12px 16px !important;
  padding: 10px !important;
  border-radius: 18px !important;
  border: 1px solid var(--panel-soft-border) !important;
  background: color-mix(in srgb, var(--bg-tertiary) 70%, transparent) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.12) !important;
}
.connection-status {
  border-radius: 14px !important;
}

/* Pickers padronizados */
.emoji-picker,
.gif-picker {
  width: min(440px, calc(100vw - 16px)) !important;
  max-height: min(560px, 78vh) !important;
  border-radius: 20px !important;
  border: 1px solid var(--panel-soft-border) !important;
  background: var(--panel-glass-bg) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  animation: papinhoPanelIn .18s ease both !important;
}
.emoji-picker-header,
.gif-picker-header,
.picker-panel-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 14px !important;
  background: color-mix(in srgb, var(--bg-tertiary) 82%, transparent) !important;
  border-bottom: 1px solid var(--panel-soft-border) !important;
  color: var(--text-primary) !important;
  font-weight: 900 !important;
}
.emoji-picker-content {
  max-height: calc(min(560px, 78vh) - 54px) !important;
  padding: 12px !important;
}
.gif-picker-search {
  padding: 10px 12px !important;
}
.gif-picker-results {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)) !important;
  gap: 8px !important;
  padding: 10px 12px 12px !important;
  max-height: calc(min(560px, 78vh) - 112px) !important;
}
.gif-result {
  aspect-ratio: 1.12 / 1 !important;
  border-radius: 12px !important;
}
.gif-result img {
  object-fit: cover !important;
}
.emoji-grid {
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
}
.emoji-btn {
  border-radius: 12px !important;
}

/* Padrão médio de mídia recebida/enviada */
.inline-media-wrap {
  width: 100% !important;
  max-width: 100% !important;
}
.inline-media {
  width: auto !important;
  max-width: min(300px, 100%) !important;
  max-height: 230px !important;
  min-height: 90px !important;
  object-fit: contain !important;
  background: rgba(0,0,0,.16) !important;
}
.inline-audio {
  width: min(320px, 100%) !important;
}

/* Privado com indicação clara */
.private-chat-header {
  border-color: color-mix(in srgb, var(--accent-color) 25%, var(--border-color)) !important;
}
.private-chat-note {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  margin-top: 4px !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  color: color-mix(in srgb, var(--text-primary) 88%, var(--accent-color) 12%) !important;
  background: color-mix(in srgb, var(--accent-color) 12%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--accent-color) 22%, var(--border-color)) !important;
  font-size: .82rem !important;
  font-weight: 700 !important;
}

/* Animações de abertura */
@keyframes papinhoPanelIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes papinhoDrawerInLeft {
  from { transform: translateX(-104%); opacity: .82; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes papinhoDrawerInRight {
  from { transform: translateX(104%); opacity: .82; }
  to { transform: translateX(0); opacity: 1; }
}
.modal-content,
.context-menu {
  animation: papinhoPanelIn .18s ease both !important;
}
.chat-window.active {
  animation: papinhoPanelIn .16s ease both !important;
}

/* Botões flutuantes como alças laterais, sem cobrir mensagens embaixo */
.mobile-panel-toggle {
  top: 50% !important;
  bottom: auto !important;
  width: 46px !important;
  height: 46px !important;
  transform: translateY(-50%) !important;
  border-radius: 16px !important;
  opacity: .94 !important;
}
.mobile-panel-toggle.left-toggle { left: 10px !important; }
.mobile-panel-toggle.right-toggle { right: 10px !important; }
body.mobile-sidebar-open #mobileChannelsToggle,
body.mobile-users-open #mobileUsersToggle {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-50%) scale(.86) !important;
}

@media (max-width: 768px) {
  .sidebar,
  .user-panel {
    width: min(330px, 84vw) !important;
    max-width: 84vw !important;
  }
  body.mobile-sidebar-open .sidebar {
    animation: papinhoDrawerInLeft .22s ease both !important;
  }
  body.mobile-users-open .user-panel {
    animation: papinhoDrawerInRight .22s ease both !important;
  }
  .channel-name {
    max-width: 190px !important;
  }
  .gif-picker-results {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .emoji-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
  .inline-media {
    max-width: min(260px, 100%) !important;
    max-height: 210px !important;
  }
  .tabs-container {
    padding-right: 38px !important;
  }
}

@media (min-width: 769px) {
  .user-panel-close-btn {
    display: none !important;
  }
}


/* ===== PAPINHO V107: painéis laterais compactos e contagem alinhada =====
   Correção focada: a V106 deixou os painéis largos demais e aproximou
   indevidamente a contagem do nome do canal. Estes overrides ficam no fim
   do arquivo para vencer regras antigas conflitantes. */

/* Canais: nome à esquerda, quantidade sempre alinhada na coluna direita */
.sidebar .channel-item,
body .sidebar .channel-item {
  display: block !important;
  width: 100% !important;
  padding: 8px 9px !important;
}

.sidebar .channel-main,
body .sidebar .channel-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 10px !important;
  width: 100% !important;
}

.sidebar .channel-name,
body .sidebar .channel-name {
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.sidebar .channel-users,
body .sidebar .channel-users {
  justify-self: end !important;
  margin-left: 8px !important;
  min-width: 34px !important;
  height: 22px !important;
  padding: 0 8px !important;
  text-align: center !important;
  flex: 0 0 auto !important;
}

/* Largura desktop/tablet: compacta, sem exagero */
body .sidebar {
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
}

body .user-panel {
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
}

/* Mobile: painéis menores, suficientes para conteúdo, sem ocupar quase a tela toda */
@media (max-width: 768px) {
  body .sidebar,
  body.mobile-sidebar-open .sidebar {
    width: min(74vw, 292px) !important;
    min-width: 0 !important;
    max-width: min(74vw, 292px) !important;
  }

  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(64vw, 248px) !important;
    min-width: 0 !important;
    max-width: min(64vw, 248px) !important;
  }

  body .sidebar .channel-list {
    padding: 8px 8px 12px !important;
  }

  body .sidebar .channel-item {
    padding: 8px 8px !important;
  }

  body .sidebar .channel-main {
    grid-template-columns: minmax(0, 1fr) max-content !important;
    gap: 8px !important;
  }

  body .sidebar .channel-name {
    font-size: .94rem !important;
  }

  body .sidebar .channel-users {
    min-width: 32px !important;
    height: 21px !important;
    padding: 0 7px !important;
    font-size: .72rem !important;
  }

  body .sidebar-header,
  body .user-panel-header,
  body .channels-drawer-header,
  body .users-drawer-header {
    padding: 14px 12px 10px !important;
  }

  body .sidebar-title-block h2,
  body .user-panel-title-block h4 {
    font-size: .98rem !important;
  }

  body .sidebar-title-block span,
  body .user-panel-title-block span {
    font-size: .73rem !important;
  }
}

@media (max-width: 390px) {
  body .sidebar,
  body.mobile-sidebar-open .sidebar {
    width: min(72vw, 278px) !important;
    max-width: min(72vw, 278px) !important;
  }

  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(62vw, 236px) !important;
    max-width: min(62vw, 236px) !important;
  }
}


/* ===== PAPINHO V108: painéis menores e toggles integrados na barra de escrita ===== */
/* Painéis realmente mais compactos, vencendo os limites anteriores. */
body .sidebar {
  width: 238px !important;
  min-width: 238px !important;
  max-width: 238px !important;
}

body .user-panel {
  width: 198px !important;
  min-width: 198px !important;
  max-width: 198px !important;
}

/* Contador do painel de usuários alinhado ao texto, sem fundo torto/deslocado. */
body .user-panel-title-block h4 {
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0 !important;
}

body .user-count-badge,
body #userPanelCount.user-count-badge {
  position: static !important;
  transform: none !important;
  vertical-align: middle !important;
  box-sizing: border-box !important;
  min-width: 30px !important;
  height: 22px !important;
  line-height: 1 !important;
  padding: 0 8px !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* Botões de canais/usuários saem do meio do chat e passam para a toolbar inferior. */
@media (max-width: 768px) {
  body .sidebar,
  body.mobile-sidebar-open .sidebar {
    width: min(64vw, 258px) !important;
    min-width: 0 !important;
    max-width: min(64vw, 258px) !important;
  }

  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(56vw, 220px) !important;
    min-width: 0 !important;
    max-width: min(56vw, 220px) !important;
  }

  body .sidebar .channel-item {
    padding: 7px 7px !important;
  }

  body .sidebar .channel-main {
    gap: 7px !important;
  }

  body .sidebar .channel-users {
    min-width: 30px !important;
    height: 20px !important;
    padding: 0 6px !important;
  }

  body .user-panel-title-block h4 {
    font-size: .94rem !important;
  }

  body .user-count-badge,
  body #userPanelCount.user-count-badge {
    min-width: 28px !important;
    height: 21px !important;
    padding: 0 7px !important;
    font-size: .72rem !important;
  }

  /* dentro da barra de ferramentas: mantém o modelo visual, mas sem posição fixa/flutuante */
  body .input-toolbar .mobile-panel-toggle,
  body .mobile-panel-toggle-dock .mobile-panel-toggle {
    display: inline-flex !important;
    position: static !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    flex: 0 0 38px !important;
    margin: 0 !important;
    border-radius: 13px !important;
    z-index: 1 !important;
    opacity: .96 !important;
    pointer-events: auto !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .20) !important;
  }

  body .input-toolbar #mobileChannelsToggle,
  body .mobile-panel-toggle-dock #mobileChannelsToggle {
    order: -20 !important;
  }

  body .input-toolbar #mobileUsersToggle,
  body .mobile-panel-toggle-dock #mobileUsersToggle {
    order: 20 !important;
  }

  body.mobile-sidebar-open .input-toolbar #mobileChannelsToggle,
  body.mobile-users-open .input-toolbar #mobileUsersToggle,
  body.mobile-sidebar-open .mobile-panel-toggle-dock #mobileChannelsToggle,
  body.mobile-users-open .mobile-panel-toggle-dock #mobileUsersToggle {
    opacity: .42 !important;
    pointer-events: none !important;
    transform: none !important;
  }

  body .input-toolbar {
    align-items: center !important;
    gap: 7px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }

  body .input-toolbar::-webkit-scrollbar {
    display: none !important;
  }

  body .mobile-panel-toggle-dock {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 8px 0 10px !important;
  }
}

@media (max-width: 390px) {
  body .sidebar,
  body.mobile-sidebar-open .sidebar {
    width: min(62vw, 242px) !important;
    max-width: min(62vw, 242px) !important;
  }

  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(54vw, 208px) !important;
    max-width: min(54vw, 208px) !important;
  }
}


/* ===== PAPINHO PRO V109: toolbar restaurada, badges e reconnect visual ===== */
@media (max-width: 768px) {
  /* Painéis realmente compactos no mobile */
  body .sidebar,
  body.mobile-sidebar-open .sidebar {
    width: min(52vw, 214px) !important;
    max-width: min(52vw, 214px) !important;
  }

  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(46vw, 190px) !important;
    max-width: min(46vw, 190px) !important;
  }

  /* Toolbar: mantém canais à esquerda, ferramentas no meio e usuários após cor */
  body .chat-window:not(#window-status) .input-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    overflow: visible !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    padding-inline: 2px !important;
  }

  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    flex: 0 0 35px !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  body .chat-window:not(#window-status) .input-toolbar #mobileChannelsToggle {
    order: 0 !important;
  }
  body .chat-window:not(#window-status) .input-toolbar .window-emoji-btn,
  body .chat-window:not(#window-status) .input-toolbar #emojiBtn {
    order: 1 !important;
  }
  body .chat-window:not(#window-status) .input-toolbar .window-gif-btn,
  body .chat-window:not(#window-status) .input-toolbar #gifBtn {
    order: 2 !important;
  }
  body .chat-window:not(#window-status) .input-toolbar .window-image-btn,
  body .chat-window:not(#window-status) .input-toolbar #imageBtn {
    order: 3 !important;
  }
  body .chat-window:not(#window-status) .input-toolbar .window-audio-btn,
  body .chat-window:not(#window-status) .input-toolbar #audioBtn {
    order: 4 !important;
  }
  body .chat-window:not(#window-status) .input-toolbar .window-color-btn,
  body .chat-window:not(#window-status) .input-toolbar #colorBtn {
    order: 5 !important;
  }
  body .chat-window:not(#window-status) .input-toolbar #mobileUsersToggle {
    order: 6 !important;
  }

  /* Remove comportamento de bolha antiga nos toggles dentro da toolbar */
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle {
    display: inline-flex !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    opacity: .98 !important;
    z-index: 2 !important;
    pointer-events: auto !important;
  }

  /* Status fica só com o dock discreto, sem disputar espaço com ferramentas inexistentes. */
  body #window-status .mobile-panel-toggle-dock {
    justify-content: center !important;
    margin: 8px 0 10px !important;
  }

  /* Contador do painel de usuários: pill alinhado, sem número escapando da base. */
  body .users-drawer-header .user-panel-title-block h4 {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    line-height: 1.1 !important;
    text-align: left !important;
  }

  body .users-drawer-header #userPanelCount.user-count-badge,
  body #userPanelCount.user-count-badge {
    position: static !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 34px !important;
    width: auto !important;
    height: 20px !important;
    min-height: 20px !important;
    padding: 0 9px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    line-height: 20px !important;
    font-size: .72rem !important;
    font-weight: 800 !important;
    background: color-mix(in srgb, var(--accent-color) 14%, var(--bg-tertiary)) !important;
    color: var(--text-primary) !important;
    border: 1px solid color-mix(in srgb, var(--accent-color) 28%, var(--border-color)) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    vertical-align: middle !important;
  }

  /* Canal continua com número alinhado à direita, mas painel menor. */
  body .sidebar .channel-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    column-gap: 6px !important;
  }
  body .sidebar .channel-users {
    justify-self: end !important;
    min-width: 30px !important;
    height: 20px !important;
    padding: 0 6px !important;
    border-radius: 999px !important;
  }
}

@media (max-width: 390px) {
  body .sidebar,
  body.mobile-sidebar-open .sidebar {
    width: min(54vw, 202px) !important;
    max-width: min(54vw, 202px) !important;
  }

  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(48vw, 176px) !important;
    max-width: min(48vw, 176px) !important;
  }

  body .chat-window:not(#window-status) .input-toolbar {
    gap: 4px !important;
  }
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle {
    width: 33px !important;
    height: 33px !important;
    min-width: 33px !important;
    flex-basis: 33px !important;
  }
}


/* ===== PAPINHO PRO V110: toolbar restaurada de verdade + badges estáveis ===== */
@media (max-width: 768px) {
  /* Os toggles globais só aparecem quando forem movidos para o dock da aba Status. */
  body > #mobileChannelsToggle,
  body > #mobileUsersToggle {
    display: none !important;
  }

  #window-status .mobile-panel-toggle-dock #mobileChannelsToggle,
  #window-status .mobile-panel-toggle-dock #mobileUsersToggle {
    display: inline-flex !important;
    position: static !important;
    transform: none !important;
    opacity: .96 !important;
    pointer-events: auto !important;
  }

  body .chat-window:not(#window-status) .input-toolbar {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 36px !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 0 2px 3px !important;
    margin-bottom: 8px !important;
    scrollbar-width: none !important;
  }

  body .chat-window:not(#window-status) .input-toolbar::-webkit-scrollbar {
    display: none !important;
  }

  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    min-height: 36px !important;
    flex: 0 0 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px !important;
    opacity: .98 !important;
    z-index: 2 !important;
    pointer-events: auto !important;
  }

  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle { order: 0 !important; }
  body .chat-window:not(#window-status) .input-toolbar .window-emoji-btn { order: 1 !important; }
  body .chat-window:not(#window-status) .input-toolbar .window-gif-btn { order: 2 !important; }
  body .chat-window:not(#window-status) .input-toolbar .window-image-btn { order: 3 !important; }
  body .chat-window:not(#window-status) .input-toolbar .window-audio-btn { order: 4 !important; }
  body .chat-window:not(#window-status) .input-toolbar .window-color-btn { order: 5 !important; }
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle { order: 6 !important; }

  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn:disabled,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn.is-disabled {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: .48 !important;
  }

  body .private-window .input-toolbar .window-users-toggle {
    display: none !important;
  }

  body .users-drawer-header .user-panel-title-block h4 {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    line-height: 1 !important;
    min-height: 24px !important;
    white-space: nowrap !important;
  }

  body #userPanelCount.user-count-badge {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    min-width: 34px !important;
    width: auto !important;
    height: 22px !important;
    min-height: 22px !important;
    padding: 0 9px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    line-height: 22px !important;
    overflow: visible !important;
    text-align: center !important;
    font-size: .74rem !important;
    font-weight: 800 !important;
    background: color-mix(in srgb, var(--accent-color) 14%, var(--bg-tertiary)) !important;
    color: var(--text-primary) !important;
    border: 1px solid color-mix(in srgb, var(--accent-color) 28%, var(--border-color)) !important;
    box-shadow: none !important;
  }

  body .sidebar,
  body.mobile-sidebar-open .sidebar {
    width: min(50vw, 204px) !important;
    max-width: min(50vw, 204px) !important;
  }

  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(46vw, 188px) !important;
    max-width: min(46vw, 188px) !important;
  }
}

@media (max-width: 390px) {
  body .chat-window:not(#window-status) .input-toolbar {
    grid-auto-columns: 34px !important;
    gap: 5px !important;
  }

  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    min-height: 34px !important;
    flex-basis: 34px !important;
  }
}


/* ===== PAPINHO PRO V111: ferramentas visíveis no Status + toggles maiores ===== */
@media (max-width: 768px) {
  body #window-status .input-toolbar.status-toolbar,
  body #window-status .mobile-panel-toggle-dock.status-toolbar,
  body #window-status .chat-input-area .input-toolbar.status-toolbar {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: auto !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 0 2px 4px !important;
    margin: 8px 0 10px !important;
    scrollbar-width: none !important;
  }

  body #window-status .input-toolbar.status-toolbar::-webkit-scrollbar {
    display: none !important;
  }

  body #window-status .status-toolbar .toolbar-btn,
  body #window-status .status-toolbar .mobile-panel-toggle,
  body #window-status .status-toolbar .toolbar-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: .98 !important;
    pointer-events: auto !important;
  }

  body #window-status .status-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    max-width: 35px !important;
    min-height: 35px !important;
    flex: 0 0 35px !important;
    border-radius: 12px !important;
  }

  body #window-status .status-toolbar .mobile-panel-toggle,
  body #window-status .status-toolbar .toolbar-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    min-height: 42px !important;
    flex: 0 0 42px !important;
    border-radius: 15px !important;
    font-size: 1.05rem !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle { order: 0 !important; }
  body #window-status .status-toolbar #emojiBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-emoji-btn { order: 1 !important; }
  body #window-status .status-toolbar #gifBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-gif-btn { order: 2 !important; }
  body #window-status .status-toolbar #imageBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-image-btn { order: 3 !important; }
  body #window-status .status-toolbar #audioBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-audio-btn { order: 4 !important; }
  body #window-status .status-toolbar #colorBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-color-btn { order: 5 !important; }
  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle { order: 6 !important; }

  body #window-status .status-toolbar .toolbar-btn.is-unavailable,
  body #window-status .status-toolbar .toolbar-btn[aria-disabled="true"] {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: .82 !important;
    cursor: pointer !important;
    filter: saturate(.85) brightness(.95) !important;
  }

  body #window-status .status-toolbar .toolbar-btn.is-unavailable:hover {
    transform: translateY(-1px) !important;
  }
}

@media (min-width: 769px) {
  body #window-status .input-toolbar.status-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 8px 0 12px !important;
  }

  body #window-status .status-toolbar .toolbar-btn.is-unavailable {
    opacity: .82 !important;
    cursor: pointer !important;
  }
}


/* ===== PAPINHO PRO V112: toggles destacados e usuarios legiveis ===== */
@keyframes papinhoToolNudge {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-4px); }
  70% { transform: translateY(2px); }
}

@media (max-width: 768px) {
  /* Os botões de canais/usuarios sao atalhos de painel, nao ferramentas de envio.
     Por isso ficam maiores e afastados do miolo emoji/GIF/imagem/audio/cor. */
  body #window-status .status-toolbar,
  body .chat-window:not(#window-status) .input-toolbar {
    gap: 6px !important;
    justify-content: center !important;
    align-items: center !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding-top: 5px !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle {
    margin-right: 13px !important;
  }

  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
    margin-left: 13px !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle,
  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    flex: 0 0 44px !important;
    border-radius: 16px !important;
    animation: papinhoToolNudge 1.25s ease-in-out 0.45s 4 both !important;
    box-shadow: 0 10px 24px rgba(var(--chat-accent-rgb), 0.20) !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle:hover,
  body #window-status .status-toolbar #mobileUsersToggle:hover,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle:hover,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle:hover {
    transform: translateY(-2px) !important;
  }

  /* O painel de usuarios estava estreito demais e cortava nicks curtos. */
  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(68vw, 270px) !important;
    max-width: min(68vw, 270px) !important;
  }

  body .user-list {
    padding: 10px 10px 14px !important;
  }

  body .user-item {
    display: grid !important;
    grid-template-columns: 10px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    margin: 4px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  body .user-item .user-status {
    width: 8px !important;
    height: 8px !important;
  }

  body .user-item .user-nick {
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body .user-item .status-badge {
    justify-self: end !important;
    margin-left: 0 !important;
  }
}

@media (max-width: 390px) {
  body #window-status .status-toolbar #mobileChannelsToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle {
    margin-right: 10px !important;
  }

  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
    margin-left: 10px !important;
  }

  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(74vw, 260px) !important;
    max-width: min(74vw, 260px) !important;
  }
}

@media (min-width: 769px) {
  body .user-panel {
    width: 280px !important;
    max-width: 280px !important;
  }
}


/* ===== PAPINHO PRO V113: toolbar padronizada e lista de usuarios compacta ===== */
@media (max-width: 768px) {
  /* Status e canais usam exatamente o mesmo alinhamento de ferramentas. */
  body #window-status .input-toolbar.status-toolbar,
  body #window-status .mobile-panel-toggle-dock.status-toolbar,
  body .chat-window:not(#window-status) .input-toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 5px 4px 4px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    scrollbar-width: none !important;
  }

  body #window-status .input-toolbar.status-toolbar::-webkit-scrollbar,
  body .chat-window:not(#window-status) .input-toolbar::-webkit-scrollbar {
    display: none !important;
  }

  body #window-status .status-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    max-width: 35px !important;
    min-height: 35px !important;
    flex: 0 0 35px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle,
  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    min-height: 44px !important;
    flex: 0 0 44px !important;
    padding: 0 !important;
    border-radius: 16px !important;
    opacity: .98 !important;
    pointer-events: auto !important;
    z-index: 2 !important;
    animation: papinhoToolNudge 1.25s ease-in-out 0.45s 4 both !important;
    box-shadow: 0 10px 24px rgba(var(--chat-accent-rgb), 0.20) !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle {
    order: 0 !important;
    margin: 0 16px 0 0 !important;
  }

  body #window-status .status-toolbar #emojiBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-emoji-btn { order: 1 !important; }
  body #window-status .status-toolbar #gifBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-gif-btn { order: 2 !important; }
  body #window-status .status-toolbar #imageBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-image-btn { order: 3 !important; }
  body #window-status .status-toolbar #audioBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-audio-btn { order: 4 !important; }
  body #window-status .status-toolbar #colorBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-color-btn { order: 5 !important; }

  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
    order: 6 !important;
    margin: 0 0 0 16px !important;
  }

  /* Menu de usuarios: sem coluna invisivel entre nick e cargo. */
  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(60vw, 238px) !important;
    max-width: min(60vw, 238px) !important;
  }

  body .user-list {
    padding: 10px 9px 14px !important;
  }

  body .user-item,
  body .user-list .user-item {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 9px !important;
    margin: 4px 0 !important;
    min-width: 0 !important;
  }

  body .user-item .user-status {
    flex: 0 0 8px !important;
    width: 8px !important;
    height: 8px !important;
    margin: 0 !important;
  }

  body .user-item .user-identity {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  body .user-item .user-nick {
    display: inline-block !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 70px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body .user-item .status-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    justify-self: auto !important;
    margin-left: 0 !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 390px) {
  body #window-status .status-toolbar #mobileChannelsToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle {
    margin-right: 13px !important;
  }

  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
    margin-left: 13px !important;
  }

  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(68vw, 232px) !important;
    max-width: min(68vw, 232px) !important;
  }

  body .user-item .user-nick {
    max-width: calc(100% - 66px) !important;
  }
}

@media (min-width: 769px) {
  body .user-panel {
    width: 260px !important;
    max-width: 260px !important;
  }

  body .user-item,
  body .user-list .user-item {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  body .user-item .user-identity {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  body .user-item .user-nick {
    max-width: 145px !important;
  }
}


/* ===== PAPINHO V114: painéis, badges e toggles refinados ===== */
/* Cabeçalho de canais centralizado de verdade, sem depender do tamanho dos botões à direita. */
body .sidebar-header.channels-drawer-header,
body .sidebar .sidebar-header.channels-drawer-header {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  min-height: 58px !important;
  padding: 12px 10px !important;
}

body .sidebar-header.channels-drawer-header .sidebar-title-block {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(130px, calc(100% - 98px)) !important;
  min-width: 0 !important;
  text-align: center !important;
  pointer-events: none !important;
}

body .sidebar-header.channels-drawer-header .sidebar-title-block h2 {
  text-align: center !important;
  font-size: .98rem !important;
  line-height: 1.05 !important;
  margin: 0 !important;
}

body .sidebar-header.channels-drawer-header .sidebar-title-block span {
  text-align: center !important;
  font-size: .68rem !important;
  line-height: 1.05 !important;
  margin-top: 3px !important;
  white-space: nowrap !important;
}

body .sidebar-header.channels-drawer-header .sidebar-header-actions {
  position: relative !important;
  z-index: 2 !important;
  margin-left: auto !important;
  gap: 6px !important;
}

@media (max-width: 768px) {
  body .sidebar-header.channels-drawer-header .refresh-btn span {
    display: none !important;
  }
  body .sidebar-header.channels-drawer-header .refresh-btn {
    width: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
}

/* Lista de usuários: painel menor, nick e cargo em colunas reais, sem wrapper invisível. */
body .user-panel {
  width: 226px !important;
  min-width: 226px !important;
  max-width: 226px !important;
}

body .user-list {
  padding: 9px 8px 13px !important;
}

body .user-item,
body .user-list .user-item {
  display: grid !important;
  grid-template-columns: 9px minmax(0, 1fr) max-content !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 8px 8px !important;
  margin: 4px 0 !important;
}

body .user-item .user-status {
  grid-column: 1 !important;
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  margin: 0 !important;
}

body .user-item .user-identity {
  display: contents !important;
}

body .user-item .user-nick {
  grid-column: 2 !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body .user-item .status-badge {
  grid-column: 3 !important;
  justify-self: end !important;
  align-self: center !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  max-width: none !important;
}

@media (max-width: 768px) {
  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(56vw, 218px) !important;
    min-width: 0 !important;
    max-width: min(56vw, 218px) !important;
  }
  body .user-item,
  body .user-list .user-item {
    grid-template-columns: 9px minmax(0, 1fr) max-content !important;
    gap: 7px !important;
    padding: 8px 8px !important;
  }
  body .user-item .status-badge {
    font-size: .66rem !important;
    padding: 3px 6px !important;
  }
}

@media (max-width: 390px) {
  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(58vw, 212px) !important;
    max-width: min(58vw, 212px) !important;
  }
  body .user-item,
  body .user-list .user-item {
    gap: 6px !important;
    padding-left: 7px !important;
    padding-right: 7px !important;
  }
}

@media (min-width: 769px) {
  body .user-panel {
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
  }
}

/* Contadores no tema claro: sai do rosa fraco e vira vermelho vinho forte, dentro do padrão Papinho. */
body.theme-light .channel-users,
body.theme-light .user-count-badge,
body.theme-light .user-panel-count,
body.theme-light .chat-header .user-count,
body.theme-light .user-count {
  color: #ffffff !important;
  background: linear-gradient(135deg, #b31217, #7f1d1d) !important;
  border-color: rgba(127, 29, 29, .42) !important;
  box-shadow: 0 6px 14px rgba(127, 29, 29, .20) !important;
}

body.theme-light .channel-users[data-users="high"],
body.theme-light .channel-users[data-users="medium"] {
  color: #ffffff !important;
  background: linear-gradient(135deg, #b31217, #7f1d1d) !important;
  border-color: rgba(127, 29, 29, .42) !important;
}

body.theme-light .tab-unread,
body.theme-light .tab.highlight .tab-unread {
  background: linear-gradient(135deg, #b31217, #7f1d1d) !important;
  color: #ffffff !important;
  box-shadow: 0 5px 12px rgba(127, 29, 29, .24) !important;
}

/* Animação inicial mais perceptível para os atalhos de canais e usuários. */
@keyframes papinhoToggleIntroV114 {
  0% { transform: translateY(0) scale(1); }
  18% { transform: translateY(-7px) scale(1.04); }
  36% { transform: translateY(2px) scale(.99); }
  54% { transform: translateY(-5px) scale(1.025); }
  72% { transform: translateY(1px) scale(1); }
  100% { transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
  body #window-status .status-toolbar #mobileChannelsToggle,
  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
    animation: papinhoToggleIntroV114 1.65s ease-in-out .35s 3 both !important;
    will-change: transform !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle:hover,
  body #window-status .status-toolbar #mobileUsersToggle:hover,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle:hover,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle:hover {
    transform: translateY(-2px) scale(1.02) !important;
  }
}


/* ===== PAPINHO V115: cabeçalho de canais no espaço útil + scrollbar destacada ===== */
/* O título deve ficar centralizado na área útil à esquerda dos botões, não no painel inteiro. */
body .sidebar-header.channels-drawer-header,
body .sidebar .sidebar-header.channels-drawer-header {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  justify-content: stretch !important;
  column-gap: 8px !important;
  min-height: 58px !important;
  padding: 12px 10px !important;
}

body .sidebar-header.channels-drawer-header .sidebar-title-block,
body .sidebar .sidebar-header.channels-drawer-header .sidebar-title-block {
  position: static !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  justify-self: stretch !important;
  align-self: center !important;
  display: grid !important;
  justify-items: center !important;
  text-align: center !important;
  pointer-events: auto !important;
  padding-left: 2px !important;
}

body .sidebar-header.channels-drawer-header .sidebar-title-block h2,
body .sidebar .sidebar-header.channels-drawer-header .sidebar-title-block h2 {
  width: 100% !important;
  text-align: center !important;
  font-size: .98rem !important;
  line-height: 1.05 !important;
  margin: 0 !important;
}

body .sidebar-header.channels-drawer-header .sidebar-title-block span,
body .sidebar .sidebar-header.channels-drawer-header .sidebar-title-block span {
  width: 100% !important;
  text-align: center !important;
  font-size: .66rem !important;
  line-height: 1.05 !important;
  margin-top: 3px !important;
  white-space: nowrap !important;
  letter-spacing: .01em !important;
}

body .sidebar-header.channels-drawer-header .sidebar-header-actions,
body .sidebar .sidebar-header.channels-drawer-header .sidebar-header-actions {
  position: static !important;
  z-index: 2 !important;
  justify-self: end !important;
  margin-left: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* Barra de rolagem destacada: evita o branco puro e mantém a identidade visual. */
:root {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent-color) 72%, #1f2937 28%) color-mix(in srgb, var(--bg-tertiary) 76%, transparent);
}

body,
.sidebar,
.user-panel,
.channel-list,
.user-list,
.chat-messages,
.tabs,
.emoji-picker-content,
.gif-picker-results,
.gif-picker {
  scrollbar-width: thin !important;
  scrollbar-color: color-mix(in srgb, var(--accent-color) 72%, #1f2937 28%) color-mix(in srgb, var(--bg-tertiary) 80%, transparent) !important;
}

*::-webkit-scrollbar {
  width: 9px !important;
  height: 9px !important;
}

*::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--bg-tertiary) 82%, transparent) !important;
  border-radius: 999px !important;
}

*::-webkit-scrollbar-thumb {
  min-height: 38px !important;
  border-radius: 999px !important;
  border: 2px solid color-mix(in srgb, var(--bg-tertiary) 82%, transparent) !important;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent-color) 82%, white 6%),
    color-mix(in srgb, var(--accent-hover) 86%, black 10%)
  ) !important;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent-color) 92%, white 4%),
    color-mix(in srgb, var(--accent-hover) 94%, black 8%)
  ) !important;
}

body.theme-light,
body.theme-light .sidebar,
body.theme-light .user-panel,
body.theme-light .channel-list,
body.theme-light .user-list,
body.theme-light .chat-messages,
body.theme-light .tabs,
body.theme-light .emoji-picker-content,
body.theme-light .gif-picker-results,
body.theme-light .gif-picker {
  scrollbar-color: #7f1d1d #f1f5f9 !important;
}

body.theme-light *::-webkit-scrollbar-track {
  background: #eef2f7 !important;
}

body.theme-light *::-webkit-scrollbar-thumb {
  border-color: #eef2f7 !important;
  background: linear-gradient(180deg, #b31217, #7f1d1d) !important;
}

@media (max-width: 768px) {
  body .sidebar-header.channels-drawer-header,
  body .sidebar .sidebar-header.channels-drawer-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 12px 9px !important;
    column-gap: 7px !important;
  }

  body .sidebar-header.channels-drawer-header .sidebar-title-block h2 {
    font-size: .97rem !important;
  }

  body .sidebar-header.channels-drawer-header .sidebar-title-block span {
    font-size: .64rem !important;
  }
}


/* ===== PAPINHO V116: correcoes finais de paineis e toolbar ===== */
/* Canais: centraliza o subtitulo no mesmo eixo do titulo, sem quebra. */
body .sidebar-header.channels-drawer-header,
body .sidebar .sidebar-header.channels-drawer-header {
  grid-template-columns: minmax(0, 1fr) auto !important;
  column-gap: 8px !important;
}

body .sidebar-header.channels-drawer-header .sidebar-title-block,
body .sidebar .sidebar-header.channels-drawer-header .sidebar-title-block {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: stretch !important;
  text-align: center !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body .sidebar-header.channels-drawer-header .sidebar-title-block h2,
body .sidebar .sidebar-header.channels-drawer-header .sidebar-title-block h2 {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin: 0 !important;
}

body .sidebar-header.channels-drawer-header .sidebar-title-block span,
body .sidebar .sidebar-header.channels-drawer-header .sidebar-title-block span {
  display: block !important;
  width: max-content !important;
  max-width: 100% !important;
  align-self: center !important;
  text-align: center !important;
  margin: 3px auto 0 !important;
  font-size: .60rem !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

@media (max-width: 380px) {
  body .sidebar-header.channels-drawer-header .sidebar-title-block span,
  body .sidebar .sidebar-header.channels-drawer-header .sidebar-title-block span {
    font-size: .57rem !important;
  }
}

/* Usuarios: painel menor, sem espaco invisivel entre nick e funcao. */
body .user-panel,
body.mobile-users-open .user-panel {
  width: 214px !important;
  min-width: 214px !important;
  max-width: 214px !important;
}

body .user-panel-header.users-drawer-header,
body .users-drawer-header {
  padding-left: 10px !important;
  padding-right: 8px !important;
}

body .user-list {
  padding: 8px 7px 12px !important;
}

body .user-list .user-item,
body .user-item {
  display: grid !important;
  grid-template-columns: 8px minmax(0, 1fr) max-content !important;
  align-items: center !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 8px 7px !important;
  margin: 4px 0 !important;
}

body .user-item .user-status {
  grid-column: 1 !important;
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  margin: 0 !important;
}

body .user-item .user-identity {
  display: contents !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: visible !important;
}

body .user-item .user-nick {
  grid-column: 2 !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body .user-item .status-badge {
  grid-column: 3 !important;
  justify-self: end !important;
  align-self: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 3px 6px !important;
  max-width: none !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  font-size: .65rem !important;
}

@media (max-width: 768px) {
  body .user-panel,
  body.mobile-users-open .user-panel {
    width: clamp(196px, 54vw, 212px) !important;
    min-width: clamp(196px, 54vw, 212px) !important;
    max-width: clamp(196px, 54vw, 212px) !important;
  }
}

@media (max-width: 380px) {
  body .user-panel,
  body.mobile-users-open .user-panel {
    width: clamp(190px, 55vw, 206px) !important;
    min-width: clamp(190px, 55vw, 206px) !important;
    max-width: clamp(190px, 55vw, 206px) !important;
  }

  body .user-list .user-item,
  body .user-item {
    gap: 6px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}

@media (min-width: 769px) {
  body .user-panel {
    width: 218px !important;
    min-width: 218px !important;
    max-width: 218px !important;
  }
}

/* Toolbar: Status, canais e privados usam o mesmo padrao visual. */
@media (max-width: 768px) {
  body #window-status .input-toolbar.status-toolbar,
  body #window-status .mobile-panel-toggle-dock.status-toolbar,
  body #window-status .chat-input-area .input-toolbar.status-toolbar,
  body .chat-window:not(#window-status) .input-toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 5px 4px 4px !important;
    margin: 8px 0 10px !important;
    scrollbar-width: none !important;
  }

  body #window-status .input-toolbar.status-toolbar::-webkit-scrollbar,
  body #window-status .mobile-panel-toggle-dock.status-toolbar::-webkit-scrollbar,
  body .chat-window:not(#window-status) .input-toolbar::-webkit-scrollbar {
    display: none !important;
  }

  body #window-status .status-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    max-width: 35px !important;
    min-height: 35px !important;
    flex: 0 0 35px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle,
  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    inset: auto !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    min-height: 44px !important;
    flex: 0 0 44px !important;
    padding: 0 !important;
    border-radius: 16px !important;
    opacity: .98 !important;
    pointer-events: auto !important;
    z-index: 2 !important;
    box-shadow: 0 10px 24px rgba(var(--chat-accent-rgb), 0.20) !important;
    animation: papinhoToggleIntroV114 1.65s ease-in-out .35s 3 both !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle {
    order: 0 !important;
    margin: 0 16px 0 0 !important;
  }

  body #window-status .status-toolbar #emojiBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-emoji-btn { order: 1 !important; }
  body #window-status .status-toolbar #gifBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-gif-btn { order: 2 !important; }
  body #window-status .status-toolbar #imageBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-image-btn { order: 3 !important; }
  body #window-status .status-toolbar #audioBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-audio-btn { order: 4 !important; }
  body #window-status .status-toolbar #colorBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-color-btn { order: 5 !important; }

  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
    order: 6 !important;
    margin: 0 0 0 16px !important;
  }
}

/* ===== PAPINHO PRO V119: pickers compactos em 1/3 da tela ===== */
:root {
  --papinho-picker-max-h: min(33dvh, 260px);
  --papinho-picker-min-h: 190px;
}

body .emoji-picker,
body .gif-picker {
  box-sizing: border-box !important;
  display: none;
  flex-direction: column !important;
  width: min(390px, calc(100vw - 18px)) !important;
  max-height: var(--papinho-picker-max-h) !important;
  min-height: min(var(--papinho-picker-min-h), calc(100dvh - 20px)) !important;
  overflow: hidden !important;
}

body .emoji-picker[style*="display: block"],
body .gif-picker[style*="display: block"] {
  display: flex !important;
}

body .emoji-picker-header,
body .gif-picker-header,
body .picker-panel-header {
  flex: 0 0 auto !important;
  min-height: 42px !important;
  padding: 9px 12px !important;
}

body .emoji-picker-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: calc(var(--papinho-picker-max-h) - 42px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding: 9px 10px 10px !important;
}

body .emoji-grid {
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

body .emoji-btn {
  width: 100% !important;
  min-width: 0 !important;
  height: 30px !important;
  min-height: 30px !important;
  font-size: 1.08rem !important;
  border-radius: 9px !important;
}

body .gif-picker-search {
  flex: 0 0 auto !important;
  min-height: 42px !important;
  padding: 7px 9px !important;
  gap: 7px !important;
}

body .gif-picker-search input {
  height: 30px !important;
  min-height: 30px !important;
  font-size: .88rem !important;
}

body .gif-picker-search button {
  width: 34px !important;
  height: 30px !important;
  min-width: 34px !important;
}

body .gif-picker-results {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: calc(var(--papinho-picker-max-h) - 84px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)) !important;
  gap: 7px !important;
  padding: 8px 9px 10px !important;
}

body .gif-result {
  aspect-ratio: 1.12 / 1 !important;
  min-height: 58px !important;
  border-radius: 10px !important;
}

body .gif-result img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

@media (max-width: 768px) {
  :root {
    --papinho-picker-max-h: min(33dvh, 235px);
    --papinho-picker-min-h: 176px;
  }

  body .emoji-picker,
  body .gif-picker {
    width: min(360px, calc(100vw - 14px)) !important;
  }

  body .emoji-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  }

  body .emoji-btn {
    height: 29px !important;
    min-height: 29px !important;
  }

  body .gif-picker-results {
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)) !important;
    gap: 6px !important;
  }

  body .gif-result {
    min-height: 54px !important;
  }
}


/* ===== PAPINHO PRO V121: chamada inicial dos botões de canais/usuários ===== */
@keyframes papinhoPanelToggleInitialShakeV121 {
  0% { transform: translateY(0) rotate(0deg) scale(1); }
  14% { transform: translateY(-5px) rotate(-5deg) scale(1.045); }
  30% { transform: translateY(2px) rotate(4deg) scale(1.02); }
  45% { transform: translateY(-4px) rotate(-3deg) scale(1.04); }
  62% { transform: translateY(1px) rotate(2deg) scale(1.015); }
  78% { transform: translateY(-2px) rotate(-1deg) scale(1.025); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}

@keyframes papinhoPanelToggleInitialGlowV121 {
  0%, 100% { box-shadow: 0 10px 24px rgba(var(--chat-accent-rgb), 0.20); }
  35%, 68% { box-shadow: 0 0 0 5px rgba(var(--chat-accent-rgb), 0.16), 0 16px 32px rgba(var(--chat-accent-rgb), 0.30); }
}

@media (max-width: 768px) {
  body #window-status .status-toolbar #mobileChannelsToggle.panel-toggle-intro-shake,
  body #window-status .status-toolbar #mobileUsersToggle.panel-toggle-intro-shake,
  body #mobileChannelsToggle.panel-toggle-intro-shake,
  body #mobileUsersToggle.panel-toggle-intro-shake,
  body .chat-window .input-toolbar .window-channels-toggle.panel-toggle-intro-shake,
  body .chat-window .input-toolbar .window-users-toggle.panel-toggle-intro-shake {
    animation:
      papinhoPanelToggleInitialShakeV121 .78s cubic-bezier(.2,.9,.2,1) both,
      papinhoPanelToggleInitialGlowV121 .78s ease both !important;
    transform-origin: 50% 70% !important;
  }

  @media (prefers-reduced-motion: reduce) {
    body #window-status .status-toolbar #mobileChannelsToggle.panel-toggle-intro-shake,
    body #window-status .status-toolbar #mobileUsersToggle.panel-toggle-intro-shake,
    body #mobileChannelsToggle.panel-toggle-intro-shake,
    body #mobileUsersToggle.panel-toggle-intro-shake,
    body .chat-window .input-toolbar .window-channels-toggle.panel-toggle-intro-shake,
    body .chat-window .input-toolbar .window-users-toggle.panel-toggle-intro-shake {
      animation: papinhoPanelToggleInitialGlowV121 .6s ease both !important;
    }
  }
}


/* ===== PAPINHO PRO V122: prioridade inteligente das abas ===== */
.tab.tab-priority-shift {
  animation: papinhoTabPriorityShiftV122 .62s cubic-bezier(.2,.85,.25,1) both;
}

@keyframes papinhoTabPriorityShiftV122 {
  0% {
    transform: translateY(0) scale(.98);
    box-shadow: 0 0 0 rgba(0,0,0,0);
  }
  42% {
    transform: translateY(-2px) scale(1.035);
    box-shadow: 0 10px 24px rgba(0,0,0,.18);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.12));
  }
}


/* ===== PAPINHO PRO V123: animação inicial real dos botões de canais/usuários ===== */
@keyframes papinhoPanelToggleChannelIntroV123 {
  0% { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
  12% { transform: translate3d(0,-7px,0) rotate(-7deg) scale(1.07); }
  24% { transform: translate3d(0,3px,0) rotate(6deg) scale(1.03); }
  38% { transform: translate3d(0,-5px,0) rotate(-4deg) scale(1.055); }
  54% { transform: translate3d(0,2px,0) rotate(3deg) scale(1.025); }
  72% { transform: translate3d(0,-2px,0) rotate(-2deg) scale(1.035); }
  100% { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
}

@keyframes papinhoPanelToggleUserIntroV123 {
  0% { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
  12% { transform: translate3d(0,-7px,0) rotate(7deg) scale(1.07); }
  24% { transform: translate3d(0,3px,0) rotate(-6deg) scale(1.03); }
  38% { transform: translate3d(0,-5px,0) rotate(4deg) scale(1.055); }
  54% { transform: translate3d(0,2px,0) rotate(-3deg) scale(1.025); }
  72% { transform: translate3d(0,-2px,0) rotate(2deg) scale(1.035); }
  100% { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
}

@keyframes papinhoPanelToggleIntroPulseV123 {
  0%, 100% { box-shadow: 0 10px 24px rgba(var(--chat-accent-rgb), 0.20); }
  35%, 70% { box-shadow: 0 0 0 5px rgba(var(--chat-accent-rgb), 0.18), 0 18px 34px rgba(var(--chat-accent-rgb), 0.34); }
}

@media (max-width: 768px) {
  body.panel-toggle-intro-playing #window-status .status-toolbar #mobileChannelsToggle,
  body #window-status .status-toolbar #mobileChannelsToggle.panel-toggle-intro-shake {
    animation:
      papinhoPanelToggleChannelIntroV123 .86s cubic-bezier(.18,.92,.22,1) both,
      papinhoPanelToggleIntroPulseV123 .86s ease both !important;
    transform-origin: 50% 72% !important;
    will-change: transform, box-shadow !important;
  }

  body.panel-toggle-intro-playing #window-status .status-toolbar #mobileUsersToggle,
  body #window-status .status-toolbar #mobileUsersToggle.panel-toggle-intro-shake {
    animation:
      papinhoPanelToggleUserIntroV123 .86s cubic-bezier(.18,.92,.22,1) .72s both,
      papinhoPanelToggleIntroPulseV123 .86s ease .72s both !important;
    transform-origin: 50% 72% !important;
    will-change: transform, box-shadow !important;
  }

  body.panel-toggle-intro-playing #window-status .status-toolbar #mobileChannelsToggle i,
  body.panel-toggle-intro-playing #window-status .status-toolbar #mobileUsersToggle i,
  body #window-status .status-toolbar #mobileChannelsToggle.panel-toggle-intro-shake i,
  body #window-status .status-toolbar #mobileUsersToggle.panel-toggle-intro-shake i {
    filter: drop-shadow(0 3px 8px rgba(var(--chat-accent-rgb), .34));
  }

  @media (prefers-reduced-motion: reduce) {
    body.panel-toggle-intro-playing #window-status .status-toolbar #mobileChannelsToggle,
    body.panel-toggle-intro-playing #window-status .status-toolbar #mobileUsersToggle,
    body #window-status .status-toolbar #mobileChannelsToggle.panel-toggle-intro-shake,
    body #window-status .status-toolbar #mobileUsersToggle.panel-toggle-intro-shake {
      animation: papinhoPanelToggleIntroPulseV123 .75s ease both !important;
    }
  }
}


/* ===== PAPINHO PRO V124: animação inicial garantida dos atalhos de canais/nicks ===== */
@keyframes papinhoPanelToggleTranslateChannelV124 {
  0% { translate: 0 0; rotate: 0deg; scale: 1; }
  14% { translate: 0 -9px; rotate: -7deg; scale: 1.08; }
  30% { translate: 0 4px; rotate: 6deg; scale: 1.03; }
  48% { translate: 0 -7px; rotate: -4deg; scale: 1.06; }
  66% { translate: 0 2px; rotate: 3deg; scale: 1.025; }
  82% { translate: 0 -3px; rotate: -2deg; scale: 1.035; }
  100% { translate: 0 0; rotate: 0deg; scale: 1; }
}

@keyframes papinhoPanelToggleTranslateUsersV124 {
  0% { translate: 0 0; rotate: 0deg; scale: 1; }
  14% { translate: 0 -9px; rotate: 7deg; scale: 1.08; }
  30% { translate: 0 4px; rotate: -6deg; scale: 1.03; }
  48% { translate: 0 -7px; rotate: 4deg; scale: 1.06; }
  66% { translate: 0 2px; rotate: -3deg; scale: 1.025; }
  82% { translate: 0 -3px; rotate: 2deg; scale: 1.035; }
  100% { translate: 0 0; rotate: 0deg; scale: 1; }
}

@media (max-width: 768px) {
  body #window-status .status-toolbar #mobileChannelsToggle.panel-toggle-intro-channel,
  body #mobileChannelsToggle.panel-toggle-intro-channel {
    animation: papinhoPanelToggleTranslateChannelV124 .9s cubic-bezier(.18,.92,.22,1) both !important;
    will-change: translate, rotate, scale, box-shadow, filter !important;
    box-shadow: 0 0 0 6px rgba(var(--chat-accent-rgb), .18), 0 18px 34px rgba(var(--chat-accent-rgb), .34) !important;
    filter: brightness(1.08) !important;
  }

  body #window-status .status-toolbar #mobileUsersToggle.panel-toggle-intro-users,
  body #mobileUsersToggle.panel-toggle-intro-users {
    animation: papinhoPanelToggleTranslateUsersV124 .9s cubic-bezier(.18,.92,.22,1) both !important;
    will-change: translate, rotate, scale, box-shadow, filter !important;
    box-shadow: 0 0 0 6px rgba(var(--chat-accent-rgb), .18), 0 18px 34px rgba(var(--chat-accent-rgb), .34) !important;
    filter: brightness(1.08) !important;
  }
}


/* ===== PAPINHO PRO V125: animacao inicial suave e notificacoes preservadas ===== */
@media (max-width: 768px) {
  body #window-status .status-toolbar #mobileChannelsToggle.panel-toggle-intro-channel,
  body #mobileChannelsToggle.panel-toggle-intro-channel,
  body #window-status .status-toolbar #mobileUsersToggle.panel-toggle-intro-users,
  body #mobileUsersToggle.panel-toggle-intro-users {
    animation: none !important;
    filter: brightness(1.025) !important;
    box-shadow: 0 0 0 3px rgba(var(--chat-accent-rgb), .10), 0 12px 24px rgba(var(--chat-accent-rgb), .22) !important;
    will-change: translate, rotate, scale, box-shadow !important;
  }
}


/* ===== PAPINHO PRO V127: entrada com gesto real para sons ===== */
.connect-gate {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: radial-gradient(circle at 18% 15%, rgba(124,92,255,.24), transparent 34%),
              radial-gradient(circle at 80% 18%, rgba(236,72,153,.14), transparent 30%),
              rgba(7, 9, 18, .88);
  backdrop-filter: blur(18px);
}

.connect-gate.is-hidden {
  pointer-events: none;
  opacity: 0;
  transform: scale(.985);
  transition: opacity .22s ease, transform .22s ease;
}

.connect-gate-card {
  width: min(92vw, 390px);
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(145deg, rgba(24, 28, 45, .96), rgba(15, 18, 31, .96));
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
  color: #fff;
}

.connect-gate-mark {
  width: 54px;
  height: 54px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  background: var(--accent-color);
  box-shadow: 0 16px 34px rgba(124,92,255,.32);
  font-size: 1.35rem;
}

.connect-gate-copy { display: grid; gap: 4px; }
.connect-gate-eyebrow {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent-color) 68%, #fff);
}
.connect-gate-copy h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.15;
}
.connect-gate-copy p {
  margin: 0;
  color: rgba(255,255,255,.72);
  line-height: 1.45;
}
.connect-gate-field {
  margin-top: 4px;
  font-size: .82rem;
  font-weight: 800;
  color: rgba(255,255,255,.76);
}
.connect-gate-input {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  padding: 0 14px;
  outline: none;
  color: #fff;
  background: rgba(255,255,255,.08);
  font-weight: 700;
}
.connect-gate-input:focus {
  border-color: color-mix(in srgb, var(--accent-color) 72%, #fff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 18%, transparent);
}
.connect-gate-button {
  height: 48px;
  border: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: var(--accent-color);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(124,92,255,.28);
}
.connect-gate-button:active { transform: translateY(1px); }

body.theme-light .connect-gate {
  background: radial-gradient(circle at 18% 15%, rgba(124,92,255,.16), transparent 34%), rgba(245,247,252,.82);
}
body.theme-light .connect-gate-card {
  color: var(--text-primary);
  background: rgba(255,255,255,.96);
  border-color: rgba(20,24,38,.08);
}
body.theme-light .connect-gate-copy p,
body.theme-light .connect-gate-field { color: var(--text-secondary); }
body.theme-light .connect-gate-input {
  color: var(--text-primary);
  background: rgba(20,24,38,.045);
  border-color: rgba(20,24,38,.12);
}

/* PAPINHO_PRO_V128 - registro, presença, avatar e mídia moderna */
.connect-mode-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0 10px;
    background: rgba(255,255,255,0.06);
    padding: 5px;
    border-radius: 14px;
}
.connect-mode-btn {
    border: 0;
    border-radius: 11px;
    padding: 10px 12px;
    color: var(--text-primary, #f7fff9);
    background: transparent;
    font-weight: 800;
    cursor: pointer;
}
.connect-mode-btn.active {
    color: #06140b;
    background: linear-gradient(135deg, #36ff8b, #8cffbd);
    box-shadow: 0 0 18px rgba(54,255,139,.35);
}
.register-fields { display: grid; gap: 8px; }
.register-hint,
.connect-gate-feedback {
    font-size: .82rem;
    color: rgba(255,255,255,.72);
    margin: 4px 0 0;
}
.connect-gate-feedback.error { color: #ff8f8f; }
.connect-gate-feedback.success { color: #45ff90; }

.presence-control {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    margin: 8px 0;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    background: rgba(0,0,0,.18);
}
.presence-control label {
    color: rgba(255,255,255,.68);
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.presence-control select {
    width: 100%;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    background: rgba(10,15,22,.92);
    color: #fff;
    padding: 9px 10px;
    outline: none;
}
.connection-status[data-state="connected"] {
    border-color: rgba(0, 255, 116, .45);
    box-shadow: 0 0 20px rgba(0, 255, 116, .20), inset 0 0 18px rgba(0, 255, 116, .08);
}
.connection-status[data-state="connected"] .status-label {
    color: #45ff90;
    font-weight: 900;
    text-shadow: 0 0 10px rgba(69,255,144,.55);
    animation: papinhoConnectedTextPulse 1.15s ease-in-out infinite;
}
.status-indicator.connected {
    background: #27ff77 !important;
    box-shadow: 0 0 0 0 rgba(39,255,119,.85), 0 0 15px rgba(39,255,119,.9);
    animation: papinhoConnectedDot 1s infinite;
}
@keyframes papinhoConnectedDot {
    0% { transform: scale(.9); box-shadow: 0 0 0 0 rgba(39,255,119,.78), 0 0 13px rgba(39,255,119,.85); }
    70% { transform: scale(1.08); box-shadow: 0 0 0 9px rgba(39,255,119,0), 0 0 22px rgba(39,255,119,.95); }
    100% { transform: scale(.9); box-shadow: 0 0 0 0 rgba(39,255,119,0), 0 0 13px rgba(39,255,119,.85); }
}
@keyframes papinhoConnectedTextPulse { 50% { opacity: .72; } }

.user-item { position: relative; gap: 8px; align-items: center; }
.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 26px;
    border: 1px solid rgba(255,255,255,.22);
    box-shadow: 0 0 0 2px rgba(0,0,0,.16);
}
.user-avatar-fallback {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(50,255,132,.35), rgba(0,160,255,.24));
    color: #fff;
    font-weight: 900;
    font-size: .78rem;
}
.user-presence-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
    background: #26ff76;
    box-shadow: 0 0 10px rgba(38,255,118,.65);
}
.user-presence-dot.away { background: #ffd33d; box-shadow: 0 0 10px rgba(255,211,61,.65); }
.user-presence-dot.busy { background: #ff8b33; box-shadow: 0 0 10px rgba(255,139,51,.65); }
.user-presence-dot.unavailable { background: #ff4d5f; box-shadow: 0 0 10px rgba(255,77,95,.72); }
.user-presence-dot.offline { background: #697382; box-shadow: none; }
.user-private-unread {
    width: 12px;
    height: 12px;
    margin-left: auto;
    border-radius: 50%;
    background: #38ff7f;
    box-shadow: 0 0 0 0 rgba(56,255,127,.9), 0 0 16px rgba(56,255,127,.9);
    animation: papinhoUnreadPulse .85s infinite;
}
@keyframes papinhoUnreadPulse {
    0% { transform: scale(.85); opacity: .65; box-shadow: 0 0 0 0 rgba(56,255,127,.85); }
    70% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 0 8px rgba(56,255,127,0); }
    100% { transform: scale(.85); opacity: .65; box-shadow: 0 0 0 0 rgba(56,255,127,0); }
}
.private-chat-header .private-avatar-large {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    object-fit: cover;
}

.papinho-audio-player {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: min(330px, 100%);
    padding: 9px 11px;
    margin-top: 6px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(15,22,32,.96), rgba(21,38,48,.92));
    box-shadow: 0 12px 28px rgba(0,0,0,.22);
    vertical-align: middle;
}
.papinho-audio-player audio { display: none; }
.papinho-audio-play {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #04110b;
    background: linear-gradient(135deg, #38ff83, #9affc5);
    cursor: pointer;
    box-shadow: 0 0 18px rgba(56,255,131,.32);
}
.papinho-audio-wave {
    position: relative;
    height: 9px;
    flex: 1;
    overflow: hidden;
    border-radius: 999px;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 4px, rgba(255,255,255,.06) 4px 8px);
}
.papinho-audio-progress {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: rgba(56,255,131,.75);
    transition: width .12s linear;
}
.papinho-audio-duration {
    min-width: 52px;
    font-size: .76rem;
    color: rgba(255,255,255,.72);
    font-weight: 800;
}
.modal-btn.avatar {
    background: rgba(255,255,255,.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,.12);
}
@media (max-width: 768px) {
    .presence-control { margin: 10px 12px; }
    .papinho-audio-player { width: 100%; }
    .user-avatar { width: 30px; height: 30px; flex-basis: 30px; }
}

/* PAPINHO_PRO_V129 - ajustes finos solicitados: textos limpos, rodapé centralizado e lista de nicks alinhada */
.user-controls {
    box-sizing: border-box !important;
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    margin: 10px auto 14px !important;
    padding: 10px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: center !important;
    justify-items: center !important;
    overflow: hidden !important;
    text-align: center !important;
}

.user-controls .presence-control,
.user-controls .theme-toggle,
.user-controls .connection-status {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.user-controls .presence-control {
    padding: 9px 10px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    justify-items: center !important;
}

.user-controls .presence-control label {
    width: 100% !important;
    text-align: center !important;
}

.user-controls .presence-control select {
    width: min(100%, 190px) !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    text-align: center !important;
    text-align-last: center !important;
}

.user-controls .theme-toggle {
    display: flex !important;
    justify-content: center !important;
}

.user-controls .theme-btn {
    width: min(100%, 150px) !important;
    max-width: 100% !important;
    justify-content: center !important;
}

.user-controls .connection-status {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 6px 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    line-height: 1 !important;
}

.user-controls .connection-status .status-label {
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body .user-list .user-item,
body .user-item {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 7px 8px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

body .user-item .user-avatar-wrap {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
}

body .user-item .user-avatar {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    display: inline-flex !important;
}

body .user-item .user-presence-dot {
    position: absolute !important;
    right: -1px !important;
    bottom: -1px !important;
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    flex: 0 0 8px !important;
    border: 2px solid rgba(8, 13, 20, .96) !important;
    z-index: 2 !important;
}

body .user-item .user-nick {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    text-align: left !important;
}

body .user-item .status-badge {
    flex: 0 0 auto !important;
    margin-left: 2px !important;
    max-width: 58px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body .user-item .user-private-unread {
    flex: 0 0 11px !important;
    width: 11px !important;
    height: 11px !important;
    margin-left: 4px !important;
}

@media (max-width: 768px) {
    .user-controls {
        width: calc(100% - 18px) !important;
        max-width: calc(100% - 18px) !important;
        margin: 8px auto 12px !important;
        padding: 9px !important;
    }

    body .user-list .user-item,
    body .user-item {
        min-height: 40px !important;
        padding: 7px 8px !important;
    }
}

/* ===== PAPINHO V130: acabamento responsavel de entrada, canais e nicks ===== */
[hidden],
.register-fields[hidden] {
  display: none !important;
}

.connect-gate-card {
  justify-items: stretch !important;
}
.connect-gate-mark {
  justify-self: center !important;
  margin-inline: auto !important;
}
.connect-gate-copy {
  justify-items: center !important;
  text-align: center !important;
}
.connect-gate-copy h1,
.connect-gate-copy p,
.connect-gate-eyebrow {
  text-align: center !important;
}

.user-controls {
  width: calc(100% - 24px) !important;
  max-width: calc(100% - 24px) !important;
  margin: 12px auto 16px !important;
  box-sizing: border-box !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  justify-items: center !important;
  align-items: center !important;
  overflow: hidden !important;
}
.presence-control {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  text-align: center !important;
  justify-items: center !important;
  overflow: hidden !important;
}
.presence-control label {
  width: 100% !important;
  text-align: center !important;
}
.presence-control select {
  width: min(100%, 190px) !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  text-align: center !important;
  text-align-last: center !important;
  padding: 9px 34px 9px 12px !important;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%) !important;
  background-position: calc(100% - 18px) 52%, calc(100% - 12px) 52% !important;
  background-size: 6px 6px, 6px 6px !important;
  background-repeat: no-repeat !important;
}
.profile-avatar-btn,
.user-controls .profile-avatar-btn {
  width: min(100%, 190px) !important;
  height: 38px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  color: var(--text-primary) !important;
  background: rgba(255,255,255,.07) !important;
  font-weight: 850 !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}
.profile-avatar-btn:hover {
  border-color: color-mix(in srgb, var(--accent-color) 42%, rgba(255,255,255,.12)) !important;
  background: color-mix(in srgb, var(--accent-color) 12%, rgba(255,255,255,.07)) !important;
}
.connection-status,
.user-controls .connection-status {
  width: min(100%, 190px) !important;
  max-width: 100% !important;
  justify-content: center !important;
  text-align: center !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}
.connection-status .status-label {
  max-width: 145px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body .user-panel {
  width: 246px !important;
  min-width: 246px !important;
  max-width: 246px !important;
}
body .user-list {
  padding: 8px 8px 12px !important;
}
body .user-list .user-item,
body .user-item {
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) max-content max-content !important;
  grid-auto-flow: column !important;
  align-items: center !important;
  justify-items: start !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 7px 8px !important;
  margin: 3px 0 !important;
  overflow: hidden !important;
}
body .user-avatar-wrap {
  position: relative !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  grid-column: 1 !important;
}
body .user-avatar,
body .user-avatar-fallback {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  flex: 0 0 30px !important;
  border-radius: 50% !important;
}
body .user-presence-dot {
  position: absolute !important;
  right: -1px !important;
  bottom: -1px !important;
  width: 8px !important;
  height: 8px !important;
  min-width: 8px !important;
  max-width: 8px !important;
  border: 2px solid var(--bg-secondary, #101521) !important;
  border-radius: 50% !important;
  transform: none !important;
  margin: 0 !important;
  z-index: 2 !important;
}
body .user-item .user-nick,
body .user-nick {
  grid-column: 2 !important;
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  line-height: 1.1 !important;
  font-size: .95rem !important;
}
body .user-private-unread {
  grid-column: 3 !important;
  justify-self: end !important;
  margin: 0 !important;
  width: 10px !important;
  height: 10px !important;
  min-width: 10px !important;
}
body .user-item .status-badge,
body .status-badge {
  grid-column: 4 !important;
  justify-self: end !important;
  max-width: 34px !important;
  min-width: 0 !important;
  padding: 3px 5px !important;
  font-size: .58rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
}
.private-chat-header {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}
.private-chat-header .private-avatar-large,
.private-avatar-large {
  width: 58px !important;
  height: 58px !important;
  min-width: 58px !important;
  border-radius: 18px !important;
  object-fit: cover !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, rgba(50,255,132,.35), rgba(0,160,255,.24)) !important;
  color: #fff !important;
  font-weight: 950 !important;
  font-size: 1.2rem !important;
  border: 1px solid rgba(255,255,255,.20) !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.18) !important;
}
.private-chat-header .header-info {
  min-width: 0 !important;
}
.private-chat-header .header-info h3 {
  margin: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
@media (max-width: 768px) {
  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(72vw, 248px) !important;
    min-width: min(72vw, 248px) !important;
    max-width: min(72vw, 248px) !important;
  }
  body .user-list .user-item,
  body .user-item {
    grid-template-columns: 30px minmax(0, 1fr) max-content max-content !important;
    gap: 6px !important;
    padding: 7px 7px !important;
  }
  body .user-item .status-badge,
  body .status-badge {
    max-width: 30px !important;
    font-size: .56rem !important;
  }
  .private-chat-header .private-avatar-large,
  .private-avatar-large {
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
  }
}

/* PAPINHO_V131 - seletor visual de status, status técnico útil e avatar ao vivo */
.presence-control select#presenceSelect {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
}
.presence-custom-select {
  position: relative !important;
  width: min(100%, 190px) !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  z-index: 12 !important;
}
.presence-custom-trigger {
  width: 100% !important;
  height: 38px !important;
  border-radius: 13px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(255,255,255,.075) !important;
  color: var(--text-primary) !important;
  display: grid !important;
  grid-template-columns: 12px minmax(0, 1fr) 14px !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 12px !important;
  box-sizing: border-box !important;
  font-weight: 850 !important;
  cursor: pointer !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05) !important;
}
.presence-custom-trigger i {
  font-size: .72rem !important;
  opacity: .82 !important;
  transition: transform .18s ease !important;
}
.presence-custom-select.open .presence-custom-trigger i {
  transform: rotate(180deg) !important;
}
.presence-custom-label {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  text-align: left !important;
}
.presence-custom-menu {
  position: absolute !important;
  left: 50% !important;
  bottom: calc(100% + 8px) !important;
  transform: translateX(-50%) translateY(6px) scale(.98) !important;
  width: min(218px, calc(100vw - 30px)) !important;
  padding: 7px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(18, 24, 38, .98) !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.36) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .16s ease, transform .16s ease !important;
  backdrop-filter: blur(14px) !important;
}
.presence-custom-select.open .presence-custom-menu {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateX(-50%) translateY(0) scale(1) !important;
}
.presence-custom-option {
  width: 100% !important;
  height: 36px !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: transparent !important;
  color: var(--text-primary) !important;
  display: grid !important;
  grid-template-columns: 12px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 0 10px !important;
  font-weight: 780 !important;
  text-align: left !important;
  cursor: pointer !important;
}
.presence-custom-option:hover,
.presence-custom-option.active {
  background: rgba(255,255,255,.10) !important;
}
.presence-dot-mini {
  width: 10px !important;
  height: 10px !important;
  min-width: 10px !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,.09), 0 0 12px currentColor !important;
}
.presence-dot-mini.online, .user-presence-dot.online { background: #36f57d !important; color: #36f57d !important; }
.presence-dot-mini.away, .user-presence-dot.away { background: #ffd54a !important; color: #ffd54a !important; }
.presence-dot-mini.busy, .user-presence-dot.busy { background: #ff6b4a !important; color: #ff6b4a !important; }
.presence-dot-mini.unavailable, .user-presence-dot.unavailable { background: #9aa3b2 !important; color: #9aa3b2 !important; }

body .user-list .user-item,
body .user-item {
  grid-template-columns: 32px minmax(0, 1fr) max-content max-content !important;
  gap: 8px !important;
  overflow: hidden !important;
}
body .user-avatar-wrap {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  overflow: visible !important;
  justify-self: center !important;
}
body .user-avatar,
body .user-avatar-fallback {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  object-fit: cover !important;
}
body .user-presence-dot {
  right: 0 !important;
  bottom: 0 !important;
  width: 7px !important;
  height: 7px !important;
  min-width: 7px !important;
  max-width: 7px !important;
  border: 2px solid #111827 !important;
  box-shadow: 0 0 0 1px rgba(0,0,0,.28) !important;
}
body .user-item .status-badge,
body .status-badge {
  max-width: 30px !important;
  padding: 3px 5px !important;
  font-size: .56rem !important;
}
.private-chat-header .private-avatar-large,
.private-avatar-large {
  object-fit: cover !important;
}

/* ===== PAPINHO V132: correções minuciosas de status, avatar, privado e desktop ===== */
.user-controls,
.sidebar,
.presence-control {
  overflow: visible !important;
}

.presence-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.presence-custom-select {
  width: min(100%, 190px) !important;
  max-width: 190px !important;
  margin: 0 auto !important;
  position: relative !important;
  z-index: 50 !important;
}

.presence-custom-trigger {
  width: 100% !important;
  min-height: 40px !important;
  display: grid !important;
  grid-template-columns: 14px minmax(0, 1fr) 14px !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 10px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  background: linear-gradient(135deg, rgba(20,31,43,.98), rgba(8,14,22,.96)) !important;
  color: var(--text-primary) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 24px rgba(0,0,0,.18) !important;
  cursor: pointer !important;
}

.presence-custom-label {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  text-align: center !important;
  font-weight: 900 !important;
  font-size: .82rem !important;
}

.presence-custom-trigger i {
  font-size: .72rem !important;
  opacity: .78 !important;
  justify-self: end !important;
  transition: transform .16s ease !important;
}

.presence-custom-select.open .presence-custom-trigger i {
  transform: rotate(180deg) !important;
}

#presenceCustomMenu.presence-custom-menu {
  position: fixed !important;
  z-index: 2147483000 !important;
  display: none !important;
  max-height: min(230px, calc(100vh - 20px)) !important;
  overflow-y: auto !important;
  padding: 7px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  background: linear-gradient(145deg, rgba(13,20,30,.99), rgba(20,31,43,.99)) !important;
  box-shadow: 0 22px 55px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04) inset !important;
}

#presenceCustomMenu.presence-custom-menu.open {
  display: grid !important;
  gap: 5px !important;
}

.presence-custom-option {
  width: 100% !important;
  min-height: 38px !important;
  display: grid !important;
  grid-template-columns: 14px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 8px 10px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
  text-align: left !important;
  font-weight: 800 !important;
}

.presence-custom-option:hover,
.presence-custom-option.active {
  background: rgba(57,255,136,.12) !important;
  color: #fff !important;
}

.presence-dot-mini {
  display: inline-block !important;
  width: 10px !important;
  height: 10px !important;
  border-radius: 999px !important;
  background: #26ff76 !important;
  box-shadow: 0 0 12px rgba(38,255,118,.75) !important;
}
.presence-dot-mini.away { background: #ffd33d !important; box-shadow: 0 0 12px rgba(255,211,61,.75) !important; }
.presence-dot-mini.busy { background: #ff8b33 !important; box-shadow: 0 0 12px rgba(255,139,51,.75) !important; }
.presence-dot-mini.unavailable { background: #ff4d5f !important; box-shadow: 0 0 12px rgba(255,77,95,.78) !important; }

body .user-list,
body #userList {
  overflow-x: hidden !important;
}

body .user-list .user-item,
body .user-item {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  column-gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body .user-item .user-avatar-wrap {
  position: relative !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  display: inline-grid !important;
  place-items: center !important;
  overflow: visible !important;
}

body .user-item .user-avatar,
body .user-item .user-avatar-fallback {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  object-fit: cover !important;
}

body .user-item .user-presence-dot {
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 9px !important;
  height: 9px !important;
  min-width: 9px !important;
  border: 2px solid var(--bg-secondary) !important;
  border-radius: 999px !important;
  z-index: 3 !important;
  pointer-events: none !important;
}

body .user-item .user-nick {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  text-align: left !important;
  line-height: 1.15 !important;
}

body .user-item .status-badge {
  justify-self: end !important;
  max-width: 34px !important;
  min-width: 0 !important;
  padding: 2px 6px !important;
  font-size: .64rem !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
}

body .user-item .user-private-unread {
  justify-self: end !important;
  margin-left: 0 !important;
  width: 10px !important;
  height: 10px !important;
  min-width: 10px !important;
}

.private-chat-header {
  justify-content: center !important;
  text-align: center !important;
  gap: 12px !important;
}

.private-chat-header .header-info {
  align-items: center !important;
  text-align: center !important;
}

.private-chat-header h3 {
  width: 100% !important;
  text-align: center !important;
}

.private-chat-header .topic,
.private-chat-note {
  display: none !important;
}

.private-chat-header .private-avatar-large,
.private-avatar-large {
  width: 58px !important;
  height: 58px !important;
  min-width: 58px !important;
  border-radius: 20px !important;
  object-fit: cover !important;
}

.user-count-badge,
#userPanelCount.user-count-badge,
.chat-header .user-count,
.user-count {
  position: static !important;
  transform: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 34px !important;
  height: 22px !important;
  padding: 0 9px !important;
  margin-left: 8px !important;
  border-radius: 999px !important;
  line-height: 22px !important;
  overflow: visible !important;
  text-align: center !important;
  font-size: .74rem !important;
  font-weight: 900 !important;
}

@media (min-width: 769px) {
  body .mobile-panel-toggle,
  body .mobile-panel-toggle-dock,
  body #mobileChannelsToggle,
  body #mobileUsersToggle,
  body .chat-window .input-toolbar .mobile-panel-toggle,
  body .toolbar-panel-toggle,
  body .window-channels-toggle,
  body .window-users-toggle {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body .user-panel {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  body .private-window .input-toolbar .window-users-toggle {
    display: inline-flex !important;
  }
}

/* ===== PAPINHO V133: foco em status, avatar, privado mobile e rádio desktop ===== */
.user-controls,
.sidebar,
.sidebar-radio-mount,
.presence-control {
  overflow: visible !important;
}

.presence-control {
  position: relative !important;
  z-index: 200 !important;
  cursor: pointer !important;
}

#presenceCustomSelect.presence-custom-select {
  position: relative !important;
  width: min(100%, 198px) !important;
  max-width: 198px !important;
  margin: 0 auto !important;
  z-index: 2147482000 !important;
}

#presenceCustomSelect .presence-custom-trigger {
  min-height: 42px !important;
  border-radius: 15px !important;
  grid-template-columns: 14px minmax(0, 1fr) 14px !important;
  padding: 9px 11px !important;
}

#presenceCustomMenu.presence-custom-menu {
  position: fixed !important;
  z-index: 2147483640 !important;
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: none !important;
  min-width: 198px !important;
  max-width: calc(100vw - 18px) !important;
  max-height: min(252px, calc(100vh - 18px)) !important;
  overflow-y: auto !important;
}

#presenceCustomMenu.presence-custom-menu.open {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  gap: 6px !important;
}

body .user-item .user-avatar-wrap {
  position: relative !important;
  display: inline-grid !important;
  place-items: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  overflow: visible !important;
  flex: 0 0 36px !important;
}

body .user-item .user-avatar,
body .user-item .user-avatar-fallback {
  display: inline-flex !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  border-radius: 999px !important;
  object-fit: cover !important;
}

body .user-item .user-presence-dot {
  position: absolute !important;
  right: 1px !important;
  bottom: 1px !important;
  width: 9px !important;
  height: 9px !important;
  min-width: 9px !important;
  max-width: 9px !important;
  border: 2px solid var(--bg-secondary) !important;
  border-radius: 50% !important;
  z-index: 5 !important;
  transform: none !important;
}

.private-chat-header {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
}

.private-chat-header .header-info,
.private-chat-header h3 {
  text-align: center !important;
  align-items: center !important;
  justify-content: center !important;
}

@media (min-width: 769px) {
  .sidebar-radio-mount {
    display: block !important;
    padding: 0 12px 12px !important;
    flex: 0 0 auto !important;
  }

  .sidebar-radio-mount #radioPlayer.radio-player {
    width: 100% !important;
    min-height: 156px !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 14px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 13px !important;
    overflow: visible !important;
  }

  .sidebar-radio-mount #radioPlayer .radio-info {
    display: grid !important;
    grid-template-columns: 58px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .sidebar-radio-mount #radioPlayer .radio-logo {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    border-radius: 18px !important;
  }

  .sidebar-radio-mount #radioPlayer .radio-name {
    font-size: 1.08rem !important;
    line-height: 1.1 !important;
  }

  .sidebar-radio-mount #radioPlayer .radio-meta,
  .sidebar-radio-mount #radioPlayer .radio-status {
    white-space: normal !important;
  }

  .sidebar-radio-mount #radioPlayer .radio-controls {
    position: static !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 48px !important;
    padding: 8px !important;
    gap: 10px !important;
  }

  .sidebar-radio-mount #radioPlayer .radio-main-btn,
  .sidebar-radio-mount #radioPlayer .radio-btn.play-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    border-radius: 16px !important;
  }

  .sidebar-radio-mount #radioPlayer .volume-control {
    display: grid !important;
    grid-template-columns: 28px minmax(78px, 1fr) 44px !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .sidebar-radio-mount #radioPlayer .volume-control input[type="range"] {
    width: 100% !important;
    min-width: 78px !important;
    max-width: none !important;
  }

  .sidebar-radio-mount #radioPlayer .volume-value {
    min-width: 40px !important;
    max-width: none !important;
    font-size: .68rem !important;
  }
}

@media (max-width: 768px) {
  .sidebar-radio-mount {
    display: none !important;
  }
}

/* ===== PAPINHO V134: correções focadas — status, avatar, privado, imagem e rádio desktop ===== */
#presenceSelect.presence-native-hidden,
.presence-control select#presenceSelect {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#presenceCustomSelect.presence-custom-select {
  position: relative !important;
  display: block !important;
  width: min(100%, 208px) !important;
  max-width: 208px !important;
  margin: 0 auto !important;
  z-index: 50 !important;
}

#presenceCustomSelect .presence-custom-trigger {
  display: grid !important;
  grid-template-columns: 14px minmax(0, 1fr) 14px !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 42px !important;
  border-radius: 15px !important;
  padding: 9px 12px !important;
  touch-action: manipulation !important;
}

#presenceCustomMenu.presence-custom-menu {
  position: fixed !important;
  z-index: 2147483647 !important;
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: none !important;
  min-width: 208px !important;
  width: 208px !important;
  max-width: calc(100vw - 20px) !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 8px !important;
  border-radius: 17px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  background: linear-gradient(145deg, rgba(12, 18, 28, .99), rgba(23, 35, 50, .99)) !important;
  box-shadow: 0 24px 58px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.06) !important;
}

#presenceCustomMenu.presence-custom-menu.open {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#presenceCustomMenu .presence-custom-option {
  width: 100% !important;
  min-height: 40px !important;
  border-radius: 13px !important;
  overflow: hidden !important;
}

.user-item img.user-avatar,
.private-chat-header img.private-avatar-large {
  display: block !important;
  object-fit: cover !important;
  background: rgba(255,255,255,.08) !important;
}

@media (min-width: 769px) {
  .sidebar {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .sidebar-header.channels-drawer-header {
    order: 0 !important;
    flex: 0 0 auto !important;
  }

  .sidebar-radio-mount {
    order: 1 !important;
    display: block !important;
    position: relative !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    padding: 10px 12px 12px !important;
    margin: 0 !important;
    overflow: visible !important;
    z-index: 1 !important;
  }

  .channel-list {
    order: 2 !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  .user-controls {
    order: 3 !important;
    flex: 0 0 auto !important;
  }

  .sidebar-radio-mount #radioPlayer.radio-player {
    position: static !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 154px !important;
    height: auto !important;
    padding: 14px !important;
    margin: 0 !important;
    overflow: visible !important;
    transform: none !important;
  }

  .sidebar-radio-mount #radioPlayer .radio-info {
    position: static !important;
    display: grid !important;
    grid-template-columns: 58px minmax(0, 1fr) !important;
    align-items: center !important;
    justify-content: start !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .sidebar-radio-mount #radioPlayer .radio-controls {
    position: static !important;
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 50px !important;
    height: auto !important;
    padding: 8px !important;
    gap: 10px !important;
    margin: 0 !important;
  }

  .sidebar-radio-mount #radioPlayer .radio-logo {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
  }

  .sidebar-radio-mount #radioPlayer .volume-control {
    display: grid !important;
    grid-template-columns: 30px minmax(80px, 1fr) 42px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}

/* ===== PAPINHO V135: correções focadas em rádio, status, imagem e avatar ===== */
#sidebarRadioMount.sidebar-radio-mount {
  display: none !important;
}

.main-radio-mount {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 0 !important;
  overflow: visible !important;
}

.main-content > #radioPlayer.radio-player,
#mainRadioMount + #radioPlayer.radio-player {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  display: flex !important;
  margin: 10px auto 12px !important;
  width: min(760px, calc(100% - 28px)) !important;
  max-width: 760px !important;
  min-height: auto !important;
  overflow: visible !important;
  z-index: 2 !important;
}

@media (min-width: 769px) {
  .main-content > #radioPlayer.radio-player,
  #mainRadioMount + #radioPlayer.radio-player {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 10px !important;
    margin: 12px auto 14px !important;
    padding: 14px 16px !important;
    width: min(860px, calc(100% - 40px)) !important;
    max-width: 860px !important;
  }

  #mainRadioMount + #radioPlayer .radio-info {
    display: grid !important;
    grid-template-columns: 58px minmax(0, 1fr) !important;
    justify-content: start !important;
    justify-items: start !important;
    text-align: left !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  #mainRadioMount + #radioPlayer .radio-logo {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
  }

  #mainRadioMount + #radioPlayer .radio-details,
  #mainRadioMount + #radioPlayer .radio-name,
  #mainRadioMount + #radioPlayer .radio-status,
  #mainRadioMount + #radioPlayer .radio-meta {
    text-align: left !important;
    justify-self: start !important;
  }

  #mainRadioMount + #radioPlayer .radio-controls {
    display: grid !important;
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 8px !important;
  }
}

.sidebar,
.user-controls,
.presence-control,
#presenceCustomSelect.presence-custom-select {
  overflow: visible !important;
}

#presenceCustomSelect.presence-custom-select {
  position: relative !important;
  z-index: 9999 !important;
}

#presenceCustomMenu.presence-custom-menu {
  position: absolute !important;
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  min-width: 190px !important;
  max-width: min(230px, calc(100vw - 18px)) !important;
  max-height: 240px !important;
  overflow: hidden !important;
  border-radius: 16px !important;
  z-index: 2147483647 !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.44) !important;
}

#presenceCustomMenu.presence-custom-menu.open {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#presenceCustomMenu .presence-custom-option {
  display: grid !important;
  grid-template-columns: 14px minmax(0,1fr) !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 40px !important;
  white-space: nowrap !important;
  text-align: left !important;
}

.inline-media-wrap {
  display: block !important;
  max-width: min(360px, 92vw) !important;
  margin-top: 6px !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  background: rgba(255,255,255,.06) !important;
}

.inline-media {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  max-height: 320px !important;
  height: auto !important;
  object-fit: contain !important;
}

.inline-media-wrap.media-load-error::before {
  content: 'Não foi possível carregar a imagem.';
  display: block;
  padding: 10px 12px;
  font-size: .82rem;
  color: var(--text-muted);
}

.inline-media-wrap.media-load-error img {
  display: none !important;
}

.user-avatar,
.private-avatar-large {
  object-fit: cover !important;
  background: rgba(255,255,255,.08) !important;
}

/* ===== PAPINHO V136: correções focadas em avatar no privado, lixeira de imagem e rádio restaurada ===== */
.inline-media-wrap {
  position: relative !important;
}
.image-delete-btn {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  width: 32px !important;
  height: 32px !important;
  border: 0 !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  background: rgba(220, 38, 38, .92) !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.38) !important;
  cursor: pointer !important;
  opacity: .92 !important;
  transition: transform .14s ease, opacity .14s ease, background .14s ease !important;
  z-index: 4 !important;
}
.image-delete-btn:hover {
  transform: scale(1.06) !important;
  opacity: 1 !important;
  background: rgba(239, 68, 68, .98) !important;
}
.image-delete-btn:disabled {
  opacity: .5 !important;
  cursor: wait !important;
}
.image-deleted-notice {
  display: inline-block !important;
  color: var(--text-secondary) !important;
  font-style: italic !important;
  padding: 4px 0 !important;
}
.private-chat-header .private-avatar-large,
.private-chat-header .private-avatar-fallback {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  border-radius: 18px !important;
  overflow: hidden !important;
}

/* Restaura a rádio dentro da área central do chat, como antes das tentativas de mover para a lateral. */
.sidebar-radio-mount,
.main-radio-mount {
  display: none !important;
}
.chat-area > #radioPlayer.radio-player {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  z-index: 1 !important;
}

/* ===== PAPINHO V137: correções de status, nicks, rádio, emoji/GIF e preferências ===== */
#presenceCustomMenu.presence-custom-menu {
  position: fixed !important;
  display: none;
  max-height: none !important;
  overflow: visible !important;
  border-radius: 16px !important;
  padding: 8px !important;
  background: rgba(13, 22, 32, .98) !important;
  border: 1px solid rgba(57, 255, 136, .28) !important;
  box-shadow: 0 18px 48px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.04) inset !important;
  backdrop-filter: blur(14px) !important;
  pointer-events: auto !important;
}
#presenceCustomMenu.presence-custom-menu.open { display: block !important; }
#presenceCustomMenu .presence-custom-option {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 42px !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--text-primary) !important;
  font-weight: 700 !important;
  text-align: left !important;
  cursor: pointer !important;
}
#presenceCustomMenu .presence-custom-option:hover,
#presenceCustomMenu .presence-custom-option.active {
  background: rgba(57,255,136,.13) !important;
}
.presence-dot-mini.unavailable,
.user-presence-dot.unavailable {
  background: #ff344f !important;
  color: #ff344f !important;
  box-shadow: 0 0 10px rgba(255,52,79,.78) !important;
}

.user-panel-header {
  gap: 8px !important;
}
.user-panel-title-block {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}
.user-panel-refresh-btn,
.user-panel-close-btn {
  flex: 0 0 auto !important;
}
.user-panel-refresh-btn.is-loading i {
  animation: spin 0.8s linear infinite !important;
}
@media (min-width: 769px) {
  #closeUsersPanel.sidebar-close-btn,
  #refreshUsersPanel.sidebar-close-btn {
    display: inline-flex !important;
  }
}

.emoji-picker,
.gif-picker {
  transform: translateY(-34px) !important;
}
.emoji-picker-content button,
.emoji-btn,
.emoji-picker .emoji-item {
  font-size: 1.55rem !important;
  line-height: 1 !important;
  min-height: 38px !important;
}
.emoji-picker-content {
  grid-auto-rows: minmax(38px, auto) !important;
}
.gif-picker-results {
  max-height: min(460px, calc(100vh - 210px)) !important;
}


/* ===== PAPINHO V138: correções pontuais sem alterar rádio/player ===== */
/* Dropdown de status sempre preso ao botão, acima do layout, nunca no centro. */
body #presenceCustomMenu.presence-custom-menu {
  position: fixed !important;
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: none !important;
  right: auto !important;
  bottom: auto !important;
  min-width: 190px !important;
  max-width: min(240px, calc(100vw - 20px)) !important;
  max-height: min(260px, calc(100vh - 20px)) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 2147483647 !important;
}
body #presenceCustomMenu.presence-custom-menu.open {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
}
/* Não disponível deve ser vermelho. */
body .presence-dot-mini.unavailable,
body .user-presence-dot.unavailable {
  background: #ff344f !important;
  color: #ff344f !important;
  box-shadow: 0 0 10px rgba(255,52,79,.78), 0 0 0 2px var(--bg-secondary) !important;
}
/* A cor escolhida pelo usuário deve vencer qualquer regra visual posterior. */
body .user-item .user-nick[style],
body .message .nickname[style],
body .message.private .nickname[style],
body .message .text[style],
body .message.private .text[style] {
  color: inherit;
}

/* ===== PAPINHO V139: correções focadas em painéis, reconexão e avatar no privado ===== */
.user-panel-channel-label {
  display: inline-flex !important;
  align-items: center !important;
  max-width: 100% !important;
  margin-top: 2px !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  background: rgba(57, 255, 136, .10) !important;
  border: 1px solid rgba(57, 255, 136, .18) !important;
  color: rgba(232, 255, 242, .86) !important;
  font-size: .72rem !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.private-chat-header {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  min-height: 72px !important;
}

.private-avatar-shell {
  width: 56px !important;
  height: 56px !important;
  flex: 0 0 56px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  background: rgba(255,255,255,.08) !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,.10), 0 12px 28px rgba(0,0,0,.24) !important;
}

.private-avatar-shell .private-avatar-large,
.private-avatar-shell img.private-avatar-large,
.private-avatar-shell .private-avatar-fallback {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  min-height: 56px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  object-fit: cover !important;
  border-radius: 18px !important;
  font-weight: 900 !important;
  font-size: 1.35rem !important;
  color: #eafff2 !important;
  background: linear-gradient(135deg, rgba(34,197,94,.35), rgba(20,184,166,.22)) !important;
}

.sidebar-header-actions button,
#refreshChannels,
#closeChannelsPanel,
#refreshUsersPanel,
#closeUsersPanel {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 5 !important;
}

@media (min-width: 769px) {
  body.channels-panel-collapsed .sidebar {
    display: none !important;
  }
  body.channels-panel-collapsed .main-content {
    grid-column: 1 / -1 !important;
  }
  .reopen-channels-panel {
    display: none;
  }
  body.channels-panel-collapsed .reopen-channels-panel {
    position: fixed !important;
    left: 14px !important;
    top: 14px !important;
    z-index: 2000 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 38px !important;
    padding: 0 13px !important;
    border: 1px solid rgba(57,255,136,.35) !important;
    border-radius: 999px !important;
    background: rgba(10,18,25,.92) !important;
    color: #eafff2 !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.35) !important;
  }
}

@media (max-width: 768px) {
  .reopen-channels-panel { display: none !important; }
}

/* PAPINHO_PRO_V140 - login registrado e preview de avatar */
.register-fields[hidden],
.login-password-fields[hidden] {
    display: none !important;
}
.login-password-fields {
    display: grid;
    gap: 8px;
}
.login-registered-row {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 9px 0 2px;
    color: rgba(255,255,255,.86);
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}
.login-registered-row input {
    width: 18px;
    height: 18px;
    accent-color: #36ff8b;
}
.connect-gate-feedback {
    min-height: 20px;
    padding: 4px 0;
    font-weight: 800;
}
.connect-gate-feedback.error {
    color: #ff6b6b !important;
    text-shadow: 0 0 12px rgba(255, 70, 70, .22);
}
.connect-gate-feedback.success {
    color: #43ff96 !important;
    text-shadow: 0 0 12px rgba(67, 255, 150, .26);
}
.private-avatar-shell {
    border: 0 !important;
    cursor: pointer !important;
    padding: 0 !important;
}
.private-avatar-shell:focus-visible {
    outline: 2px solid rgba(67,255,150,.78) !important;
    outline-offset: 3px !important;
}
.avatar-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(0,0,0,.72);
    backdrop-filter: blur(8px);
}
.avatar-preview-overlay.open {
    display: flex;
}
.avatar-preview-dialog {
    width: min(86vw, 390px);
    height: min(86vw, 390px);
    max-height: 78vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,.16);
    background: linear-gradient(145deg, rgba(12,18,28,.96), rgba(20,29,42,.94));
    box-shadow: 0 28px 80px rgba(0,0,0,.5), 0 0 35px rgba(67,255,150,.10);
}
.avatar-preview-frame {
    width: calc(100% - 42px);
    height: calc(100% - 42px);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-preview-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.avatar-preview-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.18);
    background: #ff4d5e;
    color: white;
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0,0,0,.38);
}

/* PAPINHO_PRO_V141 - login logo oficial e ajustes finais de autenticação */
.connect-gate-logo-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2px;
}
.connect-gate-logo {
  display: block;
  width: min(260px, 72vw);
  max-height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.35));
}
.connect-gate-mark,
.connect-gate-eyebrow {
  display: none !important;
}
.connect-gate-copy {
  justify-items: center !important;
  text-align: center !important;
  gap: 6px !important;
}
.connect-gate-copy h1 {
  margin-top: 0 !important;
}
@media (max-width: 520px) {
  .connect-gate-card {
    padding: 20px !important;
  }
  .connect-gate-logo {
    width: min(230px, 76vw);
    max-height: 98px;
  }
}


/* PAPINHO_PRO_V142 - ajustes tela de entrada/registro */
.connect-gate-logo {
  width: min(340px, 82vw) !important;
  max-height: 156px !important;
}
.login-registered-row[hidden] {
  display: none !important;
}
.login-registered-row {
  margin: 10px 0 0 !important;
  justify-content: center !important;
  width: 100% !important;
}
.login-password-fields {
  margin-top: 4px !important;
}
@media (max-width: 520px) {
  .connect-gate-logo {
    width: min(310px, 86vw) !important;
    max-height: 138px !important;
  }
}

/* ===== PAPINHO_PRO_V152 - restauração visual + correções sem trocar cores ===== */
/* Mantém modais/avisos usando as variáveis originais do tema, sem inventar fundo/cor. */
.papinho-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(18px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  max-width: min(92vw, 440px);
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg, 0 12px 30px rgba(0,0,0,.28));
  font-weight: 700;
  text-align: center;
}
.papinho-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.papinho-toast.error { border-color: rgba(255,82,82,.42); }

.legal-links { display:flex; justify-content:center; gap:12px; flex-wrap:wrap; margin-top:12px; font-size:.86rem; }
.legal-links button { border:0; background:transparent; color:var(--text-secondary); cursor:pointer; font:inherit; padding:4px 2px; }
.legal-links button:hover { color:var(--accent-color); text-decoration:underline; }
.legal-modal-overlay,
.reauth-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.62);
  z-index: 10000;
}
.legal-modal-overlay.show,
.reauth-modal-overlay.show { display:flex; }
.legal-modal,
.reauth-modal {
  width: min(94vw, 520px);
  max-height: min(86vh, 720px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg, 0 18px 50px rgba(0,0,0,.34));
  padding: 24px;
  position: relative;
}
.legal-modal-close,
.reauth-modal-close {
  position:absolute;
  top:12px;
  right:12px;
  width:34px;
  height:34px;
  border-radius:50%;
  border:1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor:pointer;
}
.legal-modal h3,
.reauth-modal h3 { margin:0 42px 14px 0; }
.legal-modal-body { color:var(--text-secondary); line-height:1.55; font-size:.94rem; }
.legal-modal-body strong { color:var(--accent-color); }
.reauth-modal p { color:var(--text-secondary); margin:0 0 14px; }
.reauth-modal input { width:100%; box-sizing:border-box; }
#reauthSubmitBtn.connect-gate-button,
#reauthSubmitBtn {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  height: auto;
  box-sizing: border-box;
  padding: 12px 16px;
  white-space: normal;
  overflow: hidden;
  line-height: 1.18;
  text-align: center;
  flex-wrap: nowrap;
}
#reauthSubmitBtn span { max-width: calc(100% - 34px); overflow:hidden; text-overflow:ellipsis; }
.connect-gate-feedback.connecting { color:#ffd84d; }

/* Botão sair no rodapé do menu de usuários, usando tema atual. */
.user-panel { display:flex; flex-direction:column; }
.user-panel .user-list { flex:1 1 auto; min-height:0; overflow-y:auto; }
.user-panel-footer { flex:0 0 auto; padding:12px 14px 14px; border-top:1px solid var(--border-color); }
.user-panel-logout-btn {
  width:100%; min-height:42px; display:inline-flex; align-items:center; justify-content:center; gap:9px;
  border:1px solid var(--border-color); border-radius:16px; background:var(--bg-tertiary); color:var(--text-primary);
  font-weight:800; cursor:pointer;
}
.user-panel-logout-btn i { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; }

/* Título do canal no menu de usuários: texto simples, sem moldura. */
.user-panel-channel-label {
  display:block !important;
  margin-top:2px !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  color:var(--text-secondary) !important;
  font-size:.78rem !important;
  line-height:1.2 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

/* Avisos de conexão/desconexão sem balão destacado, sem borda vermelha. */
.message.connection-notice,
.message.connection-notice.system,
.message.connection-notice.error,
.chat-messages .message.connection-notice,
.chat-messages .message.connection-notice.error {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 1px 0 !important;
  margin: 1px 0 !important;
}
.message.connection-notice::after { display:none !important; }

/* Desktop: os ícones ficam no mesmo lugar da toolbar do mobile, sem quadrado/vazamento. */
@media (min-width: 769px) {
  body > #mobileChannelsToggle,
  body > #mobileUsersToggle { display:none !important; }

  body #window-status .input-toolbar.status-toolbar,
  body #window-status .mobile-panel-toggle-dock.status-toolbar,
  body .chat-window:not(#window-status) .input-toolbar {
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    justify-content:center !important;
    gap:6px !important;
    width:100% !important;
    max-width:100% !important;
    overflow:visible !important;
    padding:5px 4px 4px !important;
    margin:8px 0 10px !important;
  }

  body #window-status .status-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn,
  body #window-status .status-toolbar .mobile-panel-toggle,
  body #window-status .status-toolbar .toolbar-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle {
    display:inline-flex !important;
    visibility:visible !important;
    position:static !important;
    inset:auto !important;
    transform:none !important;
    align-items:center !important;
    justify-content:center !important;
    margin:0 !important;
    padding:0 !important;
    overflow:hidden !important;
    opacity:.98 !important;
    pointer-events:auto !important;
    z-index:2 !important;
    line-height:1 !important;
  }

  body #window-status .status-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn {
    width:35px !important;
    height:35px !important;
    min-width:35px !important;
    max-width:35px !important;
    min-height:35px !important;
    flex:0 0 35px !important;
    border-radius:12px !important;
  }

  body #window-status .status-toolbar .mobile-panel-toggle,
  body #window-status .status-toolbar .toolbar-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle {
    width:44px !important;
    height:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    min-height:44px !important;
    flex:0 0 44px !important;
    border-radius:16px !important;
  }

  body #window-status .status-toolbar .toolbar-btn i,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn i,
  body #window-status .status-toolbar .mobile-panel-toggle i,
  body #window-status .status-toolbar .toolbar-panel-toggle i,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle i,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle i {
    display:block !important;
    position:static !important;
    margin:0 !important;
    padding:0 !important;
    transform:none !important;
    line-height:1 !important;
    font-size:1rem !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle { order:0 !important; margin-right:16px !important; }
  body #window-status .status-toolbar #emojiBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-emoji-btn { order:1 !important; }
  body #window-status .status-toolbar #gifBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-gif-btn { order:2 !important; }
  body #window-status .status-toolbar #imageBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-image-btn { order:3 !important; }
  body #window-status .status-toolbar #audioBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-audio-btn { order:4 !important; }
  body #window-status .status-toolbar #colorBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-color-btn { order:5 !important; }
  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle { order:6 !important; margin-left:16px !important; }

  body #window-status .status-toolbar .toolbar-btn.is-unavailable,
  body #window-status .status-toolbar .toolbar-btn[aria-disabled="true"] {
    display:inline-flex !important;
    visibility:visible !important;
    opacity:.48 !important;
    cursor:not-allowed !important;
    pointer-events:none !important;
  }
}


/* ===== PAPINHO_PRO_V153 - correções cirúrgicas: tema, botões, modais e auth ===== */
/* Restaura superfícies originais: sem azul/roxo inventado atrás das abas/tópico. */
.theme-dark .tabs-container,
.theme-light .tabs-container {
  background: var(--bg-secondary) !important;
  border-bottom-color: var(--border-color) !important;
}
.theme-dark .chat-header,
.theme-light .chat-header {
  background: var(--bg-primary) !important;
  border-bottom-color: var(--border-color) !important;
}
.theme-dark .global-channel-topic,
.theme-light .global-channel-topic {
  background: transparent !important;
  border-top-color: var(--border-color) !important;
}
.theme-dark .chat-messages,
.theme-light .chat-messages {
  background: var(--bg-primary) !important;
}
/* Remove qualquer realce especial nos avisos de conexão/desconexão. */
.message.connection-notice,
.message.connection-notice.system,
.message.connection-notice.error,
.chat-messages .message.connection-notice,
.chat-messages .message.connection-notice.error {
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 1px 0 !important;
  margin: 1px 0 !important;
}
.message.connection-notice::before,
.message.connection-notice::after { display: none !important; content: none !important; }

/* Modais de política/termos: voltam a abrir e recuperam acabamento/hover no padrão do tema. */
.legal-modal-overlay:not([hidden]),
.legal-modal-overlay.show,
.reauth-modal-overlay:not([hidden]),
.reauth-modal-overlay.show {
  display: flex !important;
}
.legal-links {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  margin-top: 13px !important;
  font-size: .86rem !important;
  color: var(--text-secondary) !important;
}
.legal-links button {
  border: 0 !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  font: inherit !important;
  padding: 5px 3px !important;
  border-radius: 10px !important;
  transition: color .18s ease, background .18s ease, transform .18s ease !important;
}
.legal-links button:hover,
.legal-links button:focus-visible {
  color: var(--accent-hover) !important;
  background: color-mix(in srgb, var(--accent-color) 12%, transparent) !important;
  transform: translateY(-1px) !important;
  text-decoration: none !important;
  outline: none !important;
}
.legal-modal,
.reauth-modal {
  border: 1px solid color-mix(in srgb, var(--accent-color) 22%, var(--border-color)) !important;
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.34) !important;
  animation: modalFadeIn .24s ease both !important;
}
.legal-modal-close,
.reauth-modal-close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background .18s ease, transform .18s ease !important;
}
.legal-modal-close:hover,
.reauth-modal-close:hover {
  background: color-mix(in srgb, var(--accent-color) 16%, var(--bg-tertiary)) !important;
  transform: scale(1.04) !important;
}

/* Desktop: mesma posição e acabamento do mobile, sem alterar a paleta do tema. */
@media (min-width: 769px) {
  body > #mobileChannelsToggle,
  body > #mobileUsersToggle { display: none !important; }

  body #window-status .input-toolbar.status-toolbar,
  body #window-status .mobile-panel-toggle-dock.status-toolbar,
  body .chat-window:not(#window-status) .input-toolbar {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 36px !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 2px 4px !important;
    margin: 8px 0 10px !important;
    overflow: visible !important;
  }

  body #window-status .status-toolbar .toolbar-btn,
  body #window-status .status-toolbar .mobile-panel-toggle,
  body #window-status .status-toolbar .toolbar-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    flex: 0 0 36px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    opacity: .98 !important;
    z-index: 2 !important;
    pointer-events: auto !important;
    background-clip: padding-box !important;
  }

  body #window-status .status-toolbar .toolbar-btn i,
  body #window-status .status-toolbar .mobile-panel-toggle i,
  body #window-status .status-toolbar .toolbar-panel-toggle i,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-btn i,
  body .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle i,
  body .chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: static !important;
    width: 1em !important;
    height: 1em !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    line-height: 1 !important;
    font-size: 1rem !important;
    text-align: center !important;
    vertical-align: middle !important;
  }

  body #window-status .status-toolbar #mobileChannelsToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-channels-toggle { order: 0 !important; }
  body #window-status .status-toolbar #emojiBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-emoji-btn { order: 1 !important; }
  body #window-status .status-toolbar #gifBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-gif-btn { order: 2 !important; }
  body #window-status .status-toolbar #imageBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-image-btn { order: 3 !important; }
  body #window-status .status-toolbar #audioBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-audio-btn { order: 4 !important; }
  body #window-status .status-toolbar #colorBtn,
  body .chat-window:not(#window-status) .input-toolbar .window-color-btn { order: 5 !important; }
  body #window-status .status-toolbar #mobileUsersToggle,
  body .chat-window:not(#window-status) .input-toolbar .window-users-toggle { order: 6 !important; }

  body #window-status .status-toolbar .toolbar-btn.is-unavailable,
  body #window-status .status-toolbar .toolbar-btn[aria-disabled="true"],
  body #window-status .status-toolbar .toolbar-btn:disabled {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: .48 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
  }
}


/* ===== PAPINHO_PRO_V154 - modais acima da autenticação ===== */
.legal-modal-overlay,
.legal-modal-overlay.show,
.legal-modal-overlay:not([hidden]),
.reauth-modal-overlay,
.reauth-modal-overlay.show,
.reauth-modal-overlay:not([hidden]) {
  z-index: 250000 !important;
}
.legal-modal,
.reauth-modal {
  position: relative !important;
  z-index: 250001 !important;
}

/* PAPINHO_PRO_V163 - refinamento da tela de autenticação */
.login-registered-row {
  width: 100% !important;
  justify-content: flex-start !important;
  align-items: center !important;
  margin: 10px 0 0 !important;
  padding: 0 2px !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}
.login-registered-row input {
  flex: 0 0 auto !important;
}
.password-input-wrap {
  position: relative;
  width: 100%;
  display: block;
}
.password-input-wrap .connect-gate-input {
  padding-right: 48px !important;
}
.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.08);
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  color: #fff;
  background: rgba(255,255,255,.14);
  outline: none;
}
.password-toggle:active {
  transform: translateY(-50%) scale(.96);
}
body.theme-light .password-toggle {
  color: rgba(20,24,38,.68);
  background: rgba(20,24,38,.06);
}
body.theme-light .password-toggle:hover,
body.theme-light .password-toggle:focus-visible {
  color: var(--text-primary);
  background: rgba(20,24,38,.10);
}

/* PAPINHO_PRO_V165 - autenticação sem scroll interno: Registrar desce como página normal */
/* Remove o comportamento da v164 que criava rolagem dentro do card. A rolagem, quando necessária,
   acontece na tela inteira de autenticação, mantendo a mesma lógica visual da aba Entrar. */
.connect-gate {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 22px !important;
  box-sizing: border-box !important;
}
.connect-gate-card {
  max-height: none !important;
  overflow: visible !important;
  overscroll-behavior: auto !important;
  scrollbar-width: auto !important;
}
.connect-gate.is-register-mode {
  align-items: flex-start !important;
  justify-content: center !important;
  padding-top: max(22px, env(safe-area-inset-top)) !important;
  padding-bottom: max(22px, env(safe-area-inset-bottom)) !important;
}
.connect-gate.is-register-mode .connect-gate-card {
  margin: 0 auto !important;
  gap: 14px !important;
  padding: 24px !important;
  max-height: none !important;
  overflow: visible !important;
}
.connect-gate.is-register-mode .connect-gate-logo-wrap {
  margin: 0 auto 2px !important;
}
.connect-gate.is-register-mode .connect-gate-logo {
  width: min(340px, 82vw) !important;
  max-height: 156px !important;
  object-fit: contain !important;
}
.connect-gate.is-register-mode .connect-gate-copy {
  gap: 6px !important;
}
.connect-gate.is-register-mode .connect-gate-copy p {
  display: block !important;
}
.connect-gate.is-register-mode .connect-mode-tabs {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
@media (max-width: 520px) {
  .connect-gate {
    padding: 18px !important;
  }
  .connect-gate.is-register-mode {
    padding-top: max(18px, env(safe-area-inset-top)) !important;
    padding-bottom: max(18px, env(safe-area-inset-bottom)) !important;
  }
  .connect-gate.is-register-mode .connect-gate-card {
    padding: 20px !important;
  }
  .connect-gate.is-register-mode .connect-gate-logo {
    width: min(310px, 86vw) !important;
    max-height: 138px !important;
  }
}


/* PAPINHO_PRO_V167 - padroniza altura do card Entrar/Registrar sem scroll interno */
/* A tela inteira de autenticação rola quando necessário; o card não cria rolagem própria.
   Entrar e Registrar começam na mesma altura visual. */
.connect-gate {
  align-items: flex-start !important;
  justify-content: center !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-top: clamp(28px, 8vh, 86px) !important;
  padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
}
.connect-gate-card,
.connect-gate.is-register-mode .connect-gate-card {
  margin: 0 auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.connect-gate.is-register-mode {
  align-items: flex-start !important;
  justify-content: center !important;
  padding-top: clamp(28px, 8vh, 86px) !important;
  padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
}
@media (max-width: 520px) {
  .connect-gate,
  .connect-gate.is-register-mode {
    padding-top: clamp(20px, 5.5vh, 46px) !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
}

/* ===== PAPINHO_PRO_V168 - acabamento do modal Reconectar conta ===== */
.reauth-modal-overlay.show {
  display: flex !important;
}
.reauth-modal {
  overflow: visible;
}
.reauth-countdown {
  margin: 10px 0 8px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-align: center;
}
.reauth-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 2;
}
#reauthSubmitBtn,
#reauthSubmitBtn.connect-gate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#reauthSubmitBtn span {
  display: inline-block;
  min-width: 0;
}


/* ===== PAPINHO_PRO_V171 - acabamento: player, envio, status, presença e toolbars ===== */
/* conexão/desconexão sem destaque agressivo */
.message.connection-notice,
.message.connection-notice.connected,
.message.connection-notice.connecting,
.message.connection-notice.disconnected,
.message.error.connection-notice {
  box-shadow: none;
}
.message.connection-notice.disconnected,
.message.connection-notice.connecting,
.message.connection-notice.connected {
  border-color: transparent !important;
  outline: 0 !important;
}

/* botões de rádio totalmente redondos, sem trocar a cor base */
.radio-btn.play-btn,
.radio-btn.stop-btn,
#playRadio.radio-btn,
.radio-player .radio-btn.play-btn,
.radio-player .radio-btn.stop-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  border-radius: 999px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}
.radio-btn.play-btn i,
.radio-btn.stop-btn i,
#playRadio.radio-btn i {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1em !important;
  height: 1em !important;
  line-height: 1 !important;
  margin: 0 !important;
  transform: none !important;
}

/* envio inteligente: microfone quando vazio, avião quando há texto */
#sendBtn,
.chat-window .send-btn,
.smart-send-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  border-radius: 999px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, border-radius .18s ease !important;
}
#sendBtn i,
.chat-window .send-btn i,
.smart-send-btn i {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1em !important;
  height: 1em !important;
  line-height: 1 !important;
  margin: 0 !important;
  transform: scale(1) rotate(0deg) !important;
  transition: transform .22s ease, opacity .16s ease !important;
}
.smart-send-btn.audio-mode i { transform: scale(1.05) rotate(0deg) !important; }
.smart-send-btn.text-mode i { transform: scale(1.02) rotate(-8deg) !important; }
.smart-send-btn:not(:disabled):active { transform: scale(.96) !important; }

/* degradês vermelhos com parte clara removidos: vermelho forte único */
.channel-users,
.user-count-badge,
.radio-btn.play-btn,
.radio-btn.stop-btn,
#sendBtn,
.chat-window .send-btn,
.mobile-panel-toggle,
.toolbar-panel-toggle,
.volume-toggle-btn,
.radio-status.playing,
.connect-gate-button,
.connect-gate-tab.active,
.connect-gate-tabs .active,
.auth-primary-btn,
.papinho-toast.error {
  background-image: none !important;
  background: #8f1117 !important;
}
.volume-control input[type="range"],
.volume-control input[type="range"]::-webkit-slider-runnable-track,
.volume-control input[type="range"]::-moz-range-track {
  background-image: none !important;
  background: #8f1117 !important;
}

/* presença: disponibilidade sempre consistente */
.presence-dot-mini.online,
.user-presence-dot.online { background: #22c55e !important; color: #22c55e !important; }
.presence-dot-mini.away,
.user-presence-dot.away { background: #ffd33d !important; color: #ffd33d !important; }
.presence-dot-mini.busy,
.user-presence-dot.busy { background: #ff8b33 !important; color: #ff8b33 !important; }
.presence-dot-mini.unavailable,
.user-presence-dot.unavailable { background: #ff344f !important; color: #ff344f !important; }

/* subir levemente os botões de painel/toolbar e padronizar acabamento */
#window-status .input-toolbar.status-toolbar,
.chat-window:not(#window-status) .input-toolbar {
  transform: translateY(-4px) !important;
}
.chat-window .input-toolbar .mobile-panel-toggle,
.chat-window .input-toolbar .toolbar-panel-toggle,
#window-status .status-toolbar .toolbar-panel-toggle,
#window-status .status-toolbar .mobile-panel-toggle {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 999px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  line-height: 1 !important;
}
.chat-window .input-toolbar .mobile-panel-toggle i,
.chat-window .input-toolbar .toolbar-panel-toggle i,
#window-status .status-toolbar .toolbar-panel-toggle i,
#window-status .status-toolbar .mobile-panel-toggle i {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1em !important;
  height: 1em !important;
  line-height: 1 !important;
  margin: 0 !important;
  transform: none !important;
}

/* status de conexão no login */
.connect-gate-feedback.connecting,
.connect-gate-feedback.warning {
  color: #ffd33d !important;
}


/* ===== PAPINHO_PRO_V172 - rádio: play/stop redondo com vermelho forte único ===== */
.radio-player .radio-btn,
.radio-player .radio-btn.play-btn,
.radio-player .radio-btn.stop-btn,
.radio-player .radio-main-btn,
#playRadio,
#playRadio.radio-btn,
#playRadio.radio-main-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 44px !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}
.radio-player .radio-btn:hover,
.radio-player .radio-btn.play-btn:hover,
.radio-player .radio-btn.stop-btn:hover,
.radio-player .radio-main-btn:hover,
#playRadio:hover {
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
}
.radio-player .radio-btn i,
.radio-player .radio-main-btn i,
#playRadio i,
#radioMainIcon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  font-size: 16px !important;
  text-align: center !important;
  transform: none !important;
  color: #ffffff !important;
}
.radio-player .radio-btn .fa-play,
#radioMainIcon.fa-play {
  transform: translateX(1px) !important;
}
.radio-player .radio-btn .fa-stop,
#radioMainIcon.fa-stop {
  transform: none !important;
  font-size: 14px !important;
}


/* ===== PAPINHO_PRO_V173 - reconexão sem bloquear digitação ===== */
.papinho-toast {
  bottom: auto !important;
  top: calc(env(safe-area-inset-top, 0px) + 72px) !important;
}
.message.connection-notice,
.message.connection-notice.connected,
.message.connection-notice.connecting,
.message.connection-notice.disconnected,
.message.error.connection-notice {
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 1px 0 !important;
  margin: 1px 0 !important;
}

/* PAPINHO_PRO_V174 - ajustes pontuais solicitados */
.avatar-preview-close {
    background: #8f1117 !important;
    border-color: rgba(143, 17, 23, .9) !important;
    color: #fff !important;
}

@media (min-width: 769px) {
    .user-panel {
        width: 220px !important;
        max-width: 220px !important;
        flex-basis: 220px !important;
    }
}

@media (max-width: 768px) {
    .user-panel {
        width: min(80vw, 300px) !important;
        max-width: 300px !important;
    }
}

/* ===== PAPINHO_PRO_V175 - menu de usuários mais estreito e destaque de nick/canal ===== */
body .user-panel {
  width: 190px !important;
  max-width: 190px !important;
  flex-basis: 190px !important;
}

@media (min-width: 769px) {
  body .user-panel {
    width: 190px !important;
    max-width: 190px !important;
    flex: 0 0 190px !important;
  }
}

@media (max-width: 768px) {
  body .user-panel,
  body.mobile-users-open .user-panel {
    width: min(72vw, 270px) !important;
    max-width: 270px !important;
  }
}

.papinho-entity-highlight {
  color: #ffffff !important;
  font-weight: 900 !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.45) !important;
}

body.theme-light .papinho-entity-highlight {
  color: #111827 !important;
  text-shadow: none !important;
}

.reauth-modal .papinho-entity-highlight {
  color: #ffffff !important;
}

body.theme-light .reauth-modal .papinho-entity-highlight {
  color: #111827 !important;
}

/* ===== PAPINHO_PRO_V176 - aviso temporário volta ao rodapé e some sozinho ===== */
.papinho-toast {
  top: auto !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px) !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) translateY(18px) !important;
  z-index: 9999 !important;
  pointer-events: none !important;
}
.papinho-toast.show {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}
.papinho-toast[hidden] {
  display: none !important;
}

/* ===== PAPINHO_PRO_V178 - largura real do menu de usuários =====
   Correção definitiva: regras no final do arquivo e pelo ID do painel para vencer
   os blocos antigos que voltavam a deixar o painel largo. */
#userPanel.user-panel,
body #userPanel.user-panel {
  width: 160px !important;
  min-width: 160px !important;
  max-width: 160px !important;
  flex: 0 0 160px !important;
  flex-basis: 160px !important;
}

#userPanel.user-panel .user-panel-header,
body #userPanel.user-panel .user-panel-header {
  padding-left: 10px !important;
  padding-right: 8px !important;
  gap: 6px !important;
}

#userPanel.user-panel .user-panel-title-block h4,
body #userPanel.user-panel .user-panel-title-block h4 {
  font-size: .9rem !important;
  white-space: nowrap !important;
}

#userPanel.user-panel .user-panel-channel-label,
body #userPanel.user-panel .user-panel-channel-label {
  font-size: .68rem !important;
  max-width: 112px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#userPanel.user-panel .user-list,
body #userPanel.user-panel .user-list {
  padding-left: 6px !important;
  padding-right: 6px !important;
}

#userPanel.user-panel .user-item,
body #userPanel.user-panel .user-item {
  gap: 6px !important;
  padding-left: 5px !important;
  padding-right: 5px !important;
}

#userPanel.user-panel .user-avatar,
body #userPanel.user-panel .user-avatar,
#userPanel.user-panel .user-avatar-wrap,
body #userPanel.user-panel .user-avatar-wrap {
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
}

#userPanel.user-panel .user-nick,
body #userPanel.user-panel .user-nick,
#userPanel.user-panel .user-name,
body #userPanel.user-panel .user-name {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#userPanel.user-panel .user-panel-logout-btn,
body #userPanel.user-panel .user-panel-logout-btn {
  font-size: .82rem !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

@media (max-width: 768px) {
  #userPanel.user-panel,
  body #userPanel.user-panel,
  body.mobile-users-open #userPanel.user-panel {
    width: min(62vw, 230px) !important;
    min-width: 188px !important;
    max-width: 230px !important;
    flex-basis: min(62vw, 230px) !important;
  }

  #userPanel.user-panel .user-panel-channel-label,
  body #userPanel.user-panel .user-panel-channel-label {
    max-width: 150px !important;
  }
}


/* ===== PAPINHO_PRO_V180 - Alterar usuário no menu de usuários ===== */
#userPanel .user-panel-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.user-panel-switch-btn {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.user-panel-switch-btn:hover,
.user-panel-switch-btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.09);
    outline: none;
}
.theme-light .user-panel-switch-btn {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.04);
}
.theme-light .user-panel-switch-btn:hover,
.theme-light .user-panel-switch-btn:focus-visible {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.07);
}
.switch-user-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99995;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(8px);
}
.switch-user-modal-overlay[hidden] { display: none !important; }
.switch-user-modal {
    width: min(420px, 94vw);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: var(--panel-bg, #161820);
    color: var(--text-primary, #fff);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
    padding: 18px;
    animation: papinhoModalIn .18s ease-out;
}
.theme-light .switch-user-modal {
    border-color: rgba(0, 0, 0, 0.1);
    background: var(--panel-bg, #fff);
    color: var(--text-primary, #111);
}
.switch-user-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.switch-user-modal-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.02rem;
    font-weight: 800;
}
.switch-user-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    background: #8f1117;
}
.switch-user-modal p {
    margin: 0 0 12px;
    opacity: .82;
    line-height: 1.42;
    font-size: .92rem;
}
.switch-user-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0;
}
.switch-user-field label {
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .82;
}
.switch-user-input-wrap {
    position: relative;
}
.switch-user-field input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    padding: 12px 42px 12px 12px;
    outline: none;
}
.theme-light .switch-user-field input {
    border-color: rgba(0, 0, 0, 0.13);
    background: rgba(0, 0, 0, 0.04);
}
.switch-user-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: inherit;
    opacity: .72;
    cursor: pointer;
}
.switch-user-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.switch-user-submit,
.switch-user-back {
    min-height: 42px;
    border-radius: 14px;
    border: 0;
    padding: 0 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.switch-user-submit {
    flex: 1;
    background: #8f1117;
    color: #fff;
}
.switch-user-back {
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
}
.theme-light .switch-user-back { background: rgba(0, 0, 0, 0.06); }
.switch-user-feedback {
    min-height: 20px;
    margin-top: 8px;
    font-size: .88rem;
    font-weight: 700;
}
.switch-user-feedback.success { color: #26d07c; }
.switch-user-feedback.error { color: #ff6b6b; }
.switch-user-feedback.info { color: #f5c85c; }
@keyframes papinhoModalIn {
    from { transform: translateY(8px) scale(.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ===== PAPINHO V183: revisão definitiva do tema claro =====
   Regra final para impedir que ajustes do tema escuro vazem para o tema claro.
   Não altera o tema escuro. */
body.theme-light {
  --bg-primary: #ffffff !important;
  --bg-secondary: #f7f3f3 !important;
  --bg-tertiary: #ede7e7 !important;
  --surface-card: #ffffff !important;
  --surface-soft: #fff8f8 !important;
  --text-primary: #171717 !important;
  --text-secondary: #55545a !important;
  --border-color: #d8cfd0 !important;
  --accent-color: #8f1117 !important;
  --accent-hover: #8f1117 !important;
  --danger-color: #8f1117 !important;
  --link-color: #8f1117 !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  color-scheme: light !important;
}

body.theme-light .app-container,
body.theme-light .main-content,
body.theme-light .chat-area,
body.theme-light .chat-window,
body.theme-light .chat-messages {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

body.theme-light .sidebar,
body.theme-light .user-panel,
body.theme-light .tabs-container,
body.theme-light .chat-input-area,
body.theme-light .radio-player,
body.theme-light .connect-gate-card,
body.theme-light .modal-content,
body.theme-light .legal-modal,
body.theme-light .reauth-modal,
body.theme-light .switch-user-modal,
body.theme-light .emoji-picker,
body.theme-light .gif-picker,
body.theme-light .context-menu,
body.theme-light .color-picker,
body.theme-light .presence-custom-menu {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 16px 38px rgba(28, 20, 20, 0.12) !important;
}

body.theme-light .sidebar-header,
body.theme-light .user-panel-header,
body.theme-light .chat-header,
body.theme-light .tabs,
body.theme-light .global-channel-topic,
body.theme-light .radio-info,
body.theme-light .radio-controls,
body.theme-light .modal-header,
body.theme-light .emoji-picker-header,
body.theme-light .gif-picker-header {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

body.theme-light .chat-header,
body.theme-light .global-channel-topic {
  background: #ffffff !important;
}

body.theme-light .chat-header .topic,
body.theme-light .global-channel-topic,
body.theme-light .channel-topic-preview,
body.theme-light .radio-meta,
body.theme-light .radio-status,
body.theme-light .connect-gate-copy p,
body.theme-light .user-panel-channel-label,
body.theme-light .status-text,
body.theme-light .message .timestamp,
body.theme-light .message.system .text,
body.theme-light .message.system .nickname {
  color: var(--text-secondary) !important;
}

body.theme-light .tab,
body.theme-light .channel-item,
body.theme-light .user-item,
body.theme-light .presence-custom-option,
body.theme-light .gif-picker-search input,
body.theme-light .connect-gate-input,
body.theme-light #messageInput,
body.theme-light .channel-input,
body.theme-light .switch-user-field input,
body.theme-light .reauth-modal input,
body.theme-light .modal-content input,
body.theme-light .modal-content select,
body.theme-light .modal-content textarea {
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

body.theme-light .tab.active,
body.theme-light .channel-item.active,
body.theme-light .user-item:hover,
body.theme-light .channel-item:hover,
body.theme-light .presence-custom-option:hover,
body.theme-light .presence-custom-option.active {
  background: #fff2f2 !important;
  color: var(--text-primary) !important;
  border-color: rgba(143, 17, 23, 0.28) !important;
}

body.theme-light .tab.highlight,
body.theme-light .tab-unread,
body.theme-light .user-count-badge,
body.theme-light .user-panel-count,
body.theme-light .channel-users,
body.theme-light .chat-header .user-count,
body.theme-light .user-count {
  background: #8f1117 !important;
  color: #ffffff !important;
  border-color: #8f1117 !important;
  box-shadow: none !important;
}

/* Mensagens no tema claro: nunca preto em fundo preto e restaura o balão privado vermelho clarinho. */
body.theme-light .chat-messages .message,
body.theme-light .message,
body.theme-light .message.system,
body.theme-light .message.join,
body.theme-light .message.part,
body.theme-light .message.quit,
body.theme-light .message.topic,
body.theme-light .message.mode,
body.theme-light .message.kick,
body.theme-light .message.error,
body.theme-light .message.welcome {
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border-color: #e5dcdd !important;
  box-shadow: 0 8px 20px rgba(28, 20, 20, 0.055) !important;
}

body.theme-light .chat-messages .message.private,
body.theme-light .message.private {
  background: #fff0f1 !important;
  color: var(--text-primary) !important;
  border-color: rgba(143, 17, 23, 0.22) !important;
  box-shadow: 0 8px 20px rgba(143, 17, 23, 0.07) !important;
}

body.theme-light .message .text,
body.theme-light .message .text *,
body.theme-light .message.private .text,
body.theme-light .message.private .text *,
body.theme-light .message.system .text,
body.theme-light .message.error .text,
body.theme-light .message.welcome .text {
  color: var(--text-primary) !important;
}

body.theme-light .message.system,
body.theme-light .message.connection-notice,
body.theme-light .message.connection-notice.system,
body.theme-light .message.connection-notice.error {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text-secondary) !important;
}

body.theme-light .message.system .text,
body.theme-light .message.connection-notice .text,
body.theme-light .message.connection-notice .nickname,
body.theme-light .message.connection-notice .timestamp {
  color: var(--text-secondary) !important;
}

body.theme-light .message .nickname,
body.theme-light .message.private .nickname,
body.theme-light .message .nickname[data-nick="Papinho"] {
  color: #8f1117 !important;
}

body.theme-light .papinho-entity-highlight,
body.theme-light .reauth-modal .papinho-entity-highlight {
  color: #111111 !important;
  font-weight: 800 !important;
  text-shadow: none !important;
}

/* Botões, ações e fechamentos no claro: mesmo vermelho forte, sem degradê fraco. */
body.theme-light #sendBtn,
body.theme-light .send-btn,
body.theme-light .radio-btn.play-btn,
body.theme-light .radio-main-btn,
body.theme-light .modal-btn.apply,
body.theme-light .connect-gate-button,
body.theme-light .reauth-submit,
body.theme-light .switch-user-submit,
body.theme-light .user-panel-logout-btn,
body.theme-light .user-panel-switch-btn,
body.theme-light .gif-picker-search button,
body.theme-light .toolbar-btn.recording {
  background: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: #8f1117 !important;
  box-shadow: 0 8px 18px rgba(143, 17, 23, 0.22) !important;
}

body.theme-light .toolbar-btn,
body.theme-light .mobile-panel-toggle,
body.theme-light .window-channels-toggle,
body.theme-light .window-users-toggle,
body.theme-light #mobileChannelsToggle,
body.theme-light #mobileUsersToggle,
body.theme-light .theme-btn,
body.theme-light .refresh-btn,
body.theme-light .sidebar-close-btn,
body.theme-light .user-panel-close-btn,
body.theme-light .emoji-picker-close,
body.theme-light .gif-picker-close,
body.theme-light .modal-close,
body.theme-light .legal-modal-close,
body.theme-light .reauth-modal-close,
body.theme-light .switch-user-close,
body.theme-light .avatar-preview-close,
body.theme-light .password-toggle {
  background: #ffffff !important;
  color: #8f1117 !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 6px 14px rgba(28, 20, 20, 0.09) !important;
}

body.theme-light .toolbar-btn:hover,
body.theme-light .mobile-panel-toggle:hover,
body.theme-light .window-channels-toggle:hover,
body.theme-light .window-users-toggle:hover,
body.theme-light #mobileChannelsToggle:hover,
body.theme-light #mobileUsersToggle:hover,
body.theme-light .theme-btn:hover,
body.theme-light .refresh-btn:hover,
body.theme-light .sidebar-close-btn:hover,
body.theme-light .user-panel-close-btn:hover,
body.theme-light .emoji-picker-close:hover,
body.theme-light .gif-picker-close:hover,
body.theme-light .modal-close:hover,
body.theme-light .legal-modal-close:hover,
body.theme-light .reauth-modal-close:hover,
body.theme-light .switch-user-close:hover,
body.theme-light .avatar-preview-close:hover,
body.theme-light .password-toggle:hover {
  background: #fff0f1 !important;
  color: #8f1117 !important;
  border-color: rgba(143, 17, 23, 0.32) !important;
}

body.theme-light .toolbar-btn.is-unavailable,
body.theme-light .toolbar-btn[aria-disabled="true"] {
  color: #888 !important;
  background: #f2eeee !important;
  opacity: .7 !important;
}

body.theme-light .legal-links,
body.theme-light .legal-links button {
  color: var(--text-secondary) !important;
}
body.theme-light .legal-links button:hover,
body.theme-light .legal-links button:focus-visible {
  color: #8f1117 !important;
  background: #fff0f1 !important;
}

/* Seletores, emojis, GIFs, áudio e mídia no claro. */
body.theme-light .emoji-picker-content,
body.theme-light .gif-picker-results {
  background: #ffffff !important;
  color: var(--text-primary) !important;
}
body.theme-light .emoji-picker-content button,
body.theme-light .emoji-picker .emoji-item,
body.theme-light .gif-item,
body.theme-light .media-message,
body.theme-light .audio-message,
body.theme-light .custom-audio-player,
body.theme-light .image-message {
  background: #fffafa !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}
body.theme-light .emoji-picker-content button:hover,
body.theme-light .emoji-picker .emoji-item:hover,
body.theme-light .gif-item:hover {
  background: #fff0f1 !important;
}
body.theme-light .audio-time,
body.theme-light .audio-duration,
body.theme-light .custom-audio-meta,
body.theme-light .upload-hint {
  color: var(--text-secondary) !important;
}

/* Avisos/toasts no claro: legíveis e sem ficar preto sobre preto. */
body.theme-light .papinho-toast {
  background: #ffffff !important;
  color: var(--text-primary) !important;
  border-color: rgba(143, 17, 23, 0.22) !important;
  box-shadow: 0 14px 32px rgba(28, 20, 20, 0.18) !important;
}
body.theme-light .papinho-toast.error {
  border-color: rgba(143, 17, 23, 0.38) !important;
  color: #8f1117 !important;
}

/* Mantém as bolinhas de status iguais no claro e no escuro, com contraste no aro. */
body.theme-light .presence-dot-mini,
body.theme-light .user-presence-dot {
  border-color: #ffffff !important;
}
body.theme-light .presence-dot-mini.online,
body.theme-light .user-presence-dot.online { background: #22c55e !important; color: #22c55e !important; }
body.theme-light .presence-dot-mini.away,
body.theme-light .user-presence-dot.away { background: #ffd33d !important; color: #ffd33d !important; }
body.theme-light .presence-dot-mini.busy,
body.theme-light .user-presence-dot.busy { background: #ff8b33 !important; color: #ff8b33 !important; }
body.theme-light .presence-dot-mini.unavailable,
body.theme-light .user-presence-dot.unavailable { background: #ff344f !important; color: #ff344f !important; }

/* Campos e placeholders. */
body.theme-light input,
body.theme-light textarea,
body.theme-light select {
  color: var(--text-primary) !important;
  caret-color: #8f1117 !important;
}
body.theme-light input::placeholder,
body.theme-light textarea::placeholder {
  color: #77727a !important;
  opacity: 1 !important;
}

/* Scrollbar no claro sem degradê vermelho fraco. */
body.theme-light,
body.theme-light * {
  scrollbar-color: #8f1117 #f1eeee !important;
}
body.theme-light *::-webkit-scrollbar-track { background: #f1eeee !important; }
body.theme-light *::-webkit-scrollbar-thumb {
  background: #8f1117 !important;
  border-color: #f1eeee !important;
}

/* Evita que estilos inline/cores herdadas deixem textos invisíveis no claro, sem apagar cor escolhida pelo usuário em nick/texto. */
body.theme-light .chat-header *,
body.theme-light .sidebar *,
body.theme-light .user-panel *,
body.theme-light .connect-gate *,
body.theme-light .modal-content *,
body.theme-light .legal-modal *,
body.theme-light .reauth-modal *,
body.theme-light .switch-user-modal *,
body.theme-light .emoji-picker *,
body.theme-light .gif-picker * {
  text-shadow: none !important;
}

/* PAPINHO_PRO_V184 - ajuste fino login/registro: sombra branca e logo padronizado */
.connect-gate-button,
body.theme-light .connect-gate-button,
.connect-mode-btn.active,
body.theme-light .connect-mode-btn.active {
  box-shadow: 0 14px 30px rgba(255, 255, 255, .26) !important;
}
.connect-gate-button:hover,
body.theme-light .connect-gate-button:hover,
.connect-mode-btn.active:hover,
body.theme-light .connect-mode-btn.active:hover {
  box-shadow: 0 16px 34px rgba(255, 255, 255, .32) !important;
}
.connect-gate-logo,
.connect-gate.is-register-mode .connect-gate-logo {
  width: min(380px, 88vw) !important;
  max-height: 174px !important;
}
@media (max-width: 520px) {
  .connect-gate-logo,
  .connect-gate.is-register-mode .connect-gate-logo {
    width: min(340px, 90vw) !important;
    max-height: 154px !important;
  }
}


/* PAPINHO_PRO_V185 - corrige alinhamento interno do card de login/registro sem alterar estrutura */
.connect-gate-card {
  box-sizing: border-box !important;
}
.connect-gate-logo-wrap {
  width: 100% !important;
  max-width: 100% !important;
  justify-self: center !important;
  box-sizing: border-box !important;
}
.connect-gate-card > :not(.connect-gate-logo-wrap) {
  width: 100% !important;
  max-width: 100% !important;
  justify-self: stretch !important;
  box-sizing: border-box !important;
}
.connect-gate-card .connect-gate-copy,
.connect-gate-card .connect-mode-tabs,
.connect-gate-card .login-password-fields,
.connect-gate-card .register-fields,
.connect-gate-card .password-input-wrap,
.connect-gate-card .connect-gate-input,
.connect-gate-card .connect-gate-button,
.connect-gate-card .auth-primary-btn,
.connect-gate-card .legal-links,
.connect-gate-card .connect-gate-feedback {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.connect-gate-card .connect-gate-field,
.connect-gate-card .login-registered-row {
  box-sizing: border-box !important;
}

/* ===== PAPINHO_PRO_V186 - tema claro refinado definitivamente =====
   Correções exclusivas do tema claro, sem alterar estrutura nem tema escuro. */
body.theme-light {
  --papinho-red-strong: #8f1117;
  --papinho-light-bubble: #fff0f1;
  --papinho-light-bubble-border: rgba(143, 17, 23, .18);
  --papinho-light-surface: #ffffff;
  --papinho-light-soft: #fff7f8;
  --papinho-light-text: #171717;
}

/* Rádio: play/stop totalmente redondo também no tema claro. */
body.theme-light #radioPlayer .radio-main-btn,
body.theme-light #radioPlayer .radio-btn.play-btn,
body.theme-light #radioPlayer .radio-btn.stop-btn,
body.theme-light #playRadio,
body.theme-light #playRadio.radio-main-btn,
body.theme-light #playRadio.radio-btn.play-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  border-radius: 999px !important;
  padding: 0 !important;
  aspect-ratio: 1 / 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--papinho-red-strong) !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1px solid var(--papinho-red-strong) !important;
  box-shadow: 0 8px 18px rgba(143, 17, 23, .22) !important;
  overflow: hidden !important;
}
body.theme-light #radioPlayer .radio-main-btn i,
body.theme-light #radioPlayer .radio-btn.play-btn i,
body.theme-light #playRadio i {
  margin: 0 !important;
  line-height: 1 !important;
  transform: none !important;
}

/* Ícones flutuantes e botões da toolbar no claro: mesmo tamanho do escuro/mobile, vermelho com interior branco. */
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle,
body.theme-light .chat-window .input-toolbar .toolbar-panel-toggle,
body.theme-light #window-status .status-toolbar .mobile-panel-toggle,
body.theme-light #window-status .status-toolbar .toolbar-panel-toggle,
body.theme-light .window-channels-toggle,
body.theme-light .window-users-toggle,
body.theme-light #mobileChannelsToggle,
body.theme-light #mobileUsersToggle,
body.theme-light .toolbar-btn,
body.theme-light .theme-btn,
body.theme-light .refresh-btn,
body.theme-light .sidebar-close-btn,
body.theme-light .user-panel-close-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  border-radius: 999px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ffffff !important;
  background-image: none !important;
  color: var(--papinho-red-strong) !important;
  border: 1px solid rgba(143, 17, 23, .34) !important;
  box-shadow: 0 6px 14px rgba(28, 20, 20, .10) !important;
  line-height: 1 !important;
  overflow: hidden !important;
}
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle i,
body.theme-light .chat-window .input-toolbar .toolbar-panel-toggle i,
body.theme-light #window-status .status-toolbar .mobile-panel-toggle i,
body.theme-light #window-status .status-toolbar .toolbar-panel-toggle i,
body.theme-light .window-channels-toggle i,
body.theme-light .window-users-toggle i,
body.theme-light #mobileChannelsToggle i,
body.theme-light #mobileUsersToggle i,
body.theme-light .toolbar-btn i,
body.theme-light .theme-btn i,
body.theme-light .refresh-btn i,
body.theme-light .sidebar-close-btn i,
body.theme-light .user-panel-close-btn i {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1em !important;
  height: 1em !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--papinho-red-strong) !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  transform: none !important;
}
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle:hover,
body.theme-light .chat-window .input-toolbar .toolbar-panel-toggle:hover,
body.theme-light #window-status .status-toolbar .mobile-panel-toggle:hover,
body.theme-light #window-status .status-toolbar .toolbar-panel-toggle:hover,
body.theme-light .window-channels-toggle:hover,
body.theme-light .window-users-toggle:hover,
body.theme-light #mobileChannelsToggle:hover,
body.theme-light #mobileUsersToggle:hover,
body.theme-light .toolbar-btn:hover,
body.theme-light .theme-btn:hover,
body.theme-light .refresh-btn:hover {
  background: #fff4f5 !important;
  color: var(--papinho-red-strong) !important;
  border-color: var(--papinho-red-strong) !important;
  transform: translateY(-1px) !important;
}
body.theme-light .toolbar-btn.is-unavailable,
body.theme-light .toolbar-btn[aria-disabled="true"],
body.theme-light .toolbar-btn:disabled {
  background: #ffffff !important;
  color: rgba(143, 17, 23, .42) !important;
  border-color: rgba(143, 17, 23, .18) !important;
  opacity: .74 !important;
}
body.theme-light .toolbar-btn.is-unavailable i,
body.theme-light .toolbar-btn[aria-disabled="true"] i,
body.theme-light .toolbar-btn:disabled i {
  color: rgba(143, 17, 23, .42) !important;
}

/* Balões/mensagens no claro: volta o vermelho clarinho solicitado. */
body.theme-light .chat-messages .message:not(.system):not(.connection-notice),
body.theme-light .message:not(.system):not(.connection-notice),
body.theme-light .message.private:not(.system) {
  background: var(--papinho-light-bubble) !important;
  color: var(--papinho-light-text) !important;
  border: 1px solid var(--papinho-light-bubble-border) !important;
  box-shadow: 0 7px 18px rgba(143, 17, 23, .055) !important;
}
body.theme-light .message .text,
body.theme-light .message.private .text,
body.theme-light .message .text * {
  color: var(--papinho-light-text) !important;
}
body.theme-light .message.system,
body.theme-light .message.connection-notice,
body.theme-light .message.connection-notice.system,
body.theme-light .message.connection-notice.error {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text-secondary) !important;
}
body.theme-light .message.system .text,
body.theme-light .message.connection-notice .text {
  color: var(--text-secondary) !important;
}

/* Seletor Meu status no claro: menu escuro com escrita branca, como no escuro. */
body.theme-light #presenceCustomMenu.presence-custom-menu,
body.theme-light .presence-custom-menu {
  background: #151519 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, .12) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .32) !important;
}
body.theme-light #presenceCustomMenu .presence-custom-option,
body.theme-light .presence-custom-menu .presence-custom-option {
  background: #1f2026 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, .10) !important;
}
body.theme-light #presenceCustomMenu .presence-custom-option span:not(.presence-dot-mini),
body.theme-light .presence-custom-menu .presence-custom-option span:not(.presence-dot-mini) {
  color: #ffffff !important;
}
body.theme-light #presenceCustomMenu .presence-custom-option:hover,
body.theme-light #presenceCustomMenu .presence-custom-option.active,
body.theme-light .presence-custom-menu .presence-custom-option:hover,
body.theme-light .presence-custom-menu .presence-custom-option.active {
  background: #2a2b33 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, .18) !important;
}

/* Botão do tema no claro: texto sempre vermelho, inclusive logo após alternar. */
body.theme-light .theme-btn,
body.theme-light .theme-btn .theme-text,
body.theme-light .theme-btn span,
body.theme-light .theme-btn i {
  color: var(--papinho-red-strong) !important;
  -webkit-text-fill-color: var(--papinho-red-strong) !important;
}
body.theme-light .theme-btn {
  background: #ffffff !important;
  border-color: rgba(143, 17, 23, .34) !important;
}

/* Status Conectado/Conectando/Desconectado no menu de canais: neon legível no fundo branco. */
body.theme-light .connection-status,
body.theme-light .connection-status .status-label,
body.theme-light .connection-status span:last-child {
  color: #161616 !important;
  text-shadow: none !important;
  font-weight: 800 !important;
}
body.theme-light .connection-status[data-state="connected"] .status-label,
body.theme-light .connection-status .status-indicator.connected + .status-label {
  color: #087a32 !important;
}
body.theme-light .connection-status[data-state="connecting"] .status-label,
body.theme-light .connection-status .status-indicator.connecting + .status-label {
  color: #8a6400 !important;
}
body.theme-light .connection-status[data-state="disconnected"] .status-label,
body.theme-light .connection-status .status-indicator.disconnected + .status-label {
  color: var(--papinho-red-strong) !important;
}
body.theme-light .connection-status .status-indicator.connected {
  background: #159947 !important;
  box-shadow: 0 0 0 1px rgba(21, 153, 71, .24), 0 0 8px rgba(21, 153, 71, .38) !important;
}
body.theme-light .connection-status .status-indicator.connecting {
  background: #b88900 !important;
  box-shadow: 0 0 0 1px rgba(184, 137, 0, .24), 0 0 8px rgba(184, 137, 0, .34) !important;
}
body.theme-light .connection-status .status-indicator.disconnected {
  background: var(--papinho-red-strong) !important;
  box-shadow: 0 0 0 1px rgba(143, 17, 23, .24), 0 0 8px rgba(143, 17, 23, .34) !important;
}

/* Mantém botões de ação vermelhos fortes no claro sem degradê. */
body.theme-light #sendBtn,
body.theme-light .send-btn,
body.theme-light .smart-send-btn,
body.theme-light .connect-gate-button,
body.theme-light .auth-primary-btn,
body.theme-light .modal-btn.apply,
body.theme-light .reauth-submit,
body.theme-light .switch-user-submit,
body.theme-light .user-panel-logout-btn,
body.theme-light .user-panel-switch-btn {
  background: var(--papinho-red-strong) !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: var(--papinho-red-strong) !important;
}

/* ===== PAPINHO_PRO_V187 - correções finais do tema claro e autenticação =====
   Camada final e específica para vencer regras antigas sem alterar estrutura. */

/* 1) Tela de login/registro: corrige deslocamento para direita e corte dos campos. */
.connect-gate-card,
.connect-gate.is-register-mode .connect-gate-card {
  width: min(390px, calc(100vw - 44px)) !important;
  max-width: calc(100vw - 44px) !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box !important;
  justify-items: stretch !important;
  align-items: stretch !important;
  overflow: visible !important;
}
.connect-gate-card > *,
.connect-gate-card form,
.connect-gate-card label,
.connect-gate-card input,
.connect-gate-card button,
.connect-gate-card .connect-gate-copy,
.connect-gate-card .connect-mode-tabs,
.connect-gate-card .login-password-fields,
.connect-gate-card .register-fields,
.connect-gate-card .password-input-wrap,
.connect-gate-card .legal-links,
.connect-gate-card .connect-gate-feedback {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.connect-gate-card .connect-gate-input,
.connect-gate-card .connect-gate-button,
.connect-gate-card .auth-primary-btn,
.connect-gate-card .connect-mode-tabs,
.connect-gate-card .password-input-wrap,
.connect-gate-card .login-password-fields,
.connect-gate-card .register-fields,
.connect-gate-card .connect-gate-feedback,
.connect-gate-card .legal-links {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.connect-gate-card .connect-gate-field,
.connect-gate-card .login-registered-row {
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.connect-gate-logo-wrap,
.connect-gate.is-register-mode .connect-gate-logo-wrap {
  width: 100% !important;
  max-width: 100% !important;
  justify-content: center !important;
  overflow: visible !important;
}
.connect-gate-logo,
.connect-gate.is-register-mode .connect-gate-logo {
  width: min(360px, 100%) !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
@media (max-width: 520px) {
  .connect-gate-card,
  .connect-gate.is-register-mode .connect-gate-card {
    width: min(390px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .connect-gate-logo,
  .connect-gate.is-register-mode .connect-gate-logo {
    width: min(330px, 100%) !important;
  }
}

/* 2) Tema claro: botões flutuantes/menu exatamente invertidos: aro vermelho, interior branco, ícone vermelho. */
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle,
body.theme-light .chat-window .input-toolbar .toolbar-panel-toggle,
body.theme-light .chat-window .input-toolbar .window-channels-toggle,
body.theme-light .chat-window .input-toolbar .window-users-toggle,
body.theme-light #window-status .input-toolbar.status-toolbar .mobile-panel-toggle,
body.theme-light #window-status .input-toolbar.status-toolbar .toolbar-panel-toggle,
body.theme-light #window-status .mobile-panel-toggle,
body.theme-light #window-status .toolbar-panel-toggle,
body.theme-light #mobileChannelsToggle,
body.theme-light #mobileUsersToggle {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  border-radius: 999px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ffffff !important;
  background-image: none !important;
  color: #8f1117 !important;
  border: 1.5px solid #8f1117 !important;
  box-shadow: 0 6px 14px rgba(143, 17, 23, .13) !important;
  overflow: hidden !important;
  line-height: 1 !important;
  opacity: 1 !important;
}
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle i,
body.theme-light .chat-window .input-toolbar .toolbar-panel-toggle i,
body.theme-light .chat-window .input-toolbar .window-channels-toggle i,
body.theme-light .chat-window .input-toolbar .window-users-toggle i,
body.theme-light #window-status .input-toolbar.status-toolbar .mobile-panel-toggle i,
body.theme-light #window-status .input-toolbar.status-toolbar .toolbar-panel-toggle i,
body.theme-light #window-status .mobile-panel-toggle i,
body.theme-light #window-status .toolbar-panel-toggle i,
body.theme-light #mobileChannelsToggle i,
body.theme-light #mobileUsersToggle i {
  color: #8f1117 !important;
  -webkit-text-fill-color: #8f1117 !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle:hover,
body.theme-light .chat-window .input-toolbar .toolbar-panel-toggle:hover,
body.theme-light .chat-window .input-toolbar .window-channels-toggle:hover,
body.theme-light .chat-window .input-toolbar .window-users-toggle:hover,
body.theme-light #window-status .input-toolbar.status-toolbar .mobile-panel-toggle:hover,
body.theme-light #window-status .input-toolbar.status-toolbar .toolbar-panel-toggle:hover,
body.theme-light #mobileChannelsToggle:hover,
body.theme-light #mobileUsersToggle:hover {
  background: #fff6f7 !important;
  color: #8f1117 !important;
  border-color: #8f1117 !important;
}

/* 3) Tema claro: seletor Meu status continua escuro, então todo texto interno fica branco. */
body.theme-light .presence-control,
body.theme-light .presence-custom-trigger,
body.theme-light .presence-custom-select,
body.theme-light #presenceCustomTrigger {
  color: #ffffff !important;
}
body.theme-light .presence-control label {
  color: #8f1117 !important;
}
body.theme-light .presence-custom-trigger span,
body.theme-light .presence-custom-trigger strong,
body.theme-light .presence-custom-trigger .presence-label,
body.theme-light .presence-custom-trigger .presence-current-label,
body.theme-light .presence-custom-select span,
body.theme-light #presenceCustomTrigger span,
body.theme-light #presenceCustomTrigger strong {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
body.theme-light #presenceCustomMenu,
body.theme-light .presence-custom-menu,
body.theme-light #presenceCustomMenu *,
body.theme-light .presence-custom-menu * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
body.theme-light #presenceCustomMenu .presence-dot-mini,
body.theme-light .presence-custom-menu .presence-dot-mini,
body.theme-light #presenceCustomTrigger .presence-dot-mini,
body.theme-light .presence-custom-trigger .presence-dot-mini {
  -webkit-text-fill-color: currentColor !important;
}

/* 4) Tema claro: botão de tema volta a parecer botão, não bolinha pequena. */
body.theme-light .user-controls .theme-toggle {
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
}
body.theme-light .user-controls .theme-btn,
body.theme-light .theme-toggle .theme-btn,
body.theme-light #themeToggle.theme-btn {
  width: min(100%, 156px) !important;
  min-width: 122px !important;
  max-width: 156px !important;
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  border-radius: 999px !important;
  padding: 0 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: #ffffff !important;
  background-image: none !important;
  color: #8f1117 !important;
  -webkit-text-fill-color: #8f1117 !important;
  border: 1px solid rgba(143, 17, 23, .34) !important;
  box-shadow: 0 6px 14px rgba(143, 17, 23, .10) !important;
  overflow: hidden !important;
}
body.theme-light #themeToggle.theme-btn i,
body.theme-light #themeToggle.theme-btn .theme-text,
body.theme-light #themeToggle.theme-btn span {
  color: #8f1117 !important;
  -webkit-text-fill-color: #8f1117 !important;
  opacity: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

/* ===== PAPINHO_PRO_V188 - tema claro: botões de menu e duplicados =====
   Corrige os botões extras soltos e faz os botões corretos seguirem o padrão
   visual do tema escuro: vermelho forte com ícone branco. */

/* Remove os botões globais antigos/duplicados que aparecem soltos no meio da tela.
   Os botões válidos são os inseridos dentro da toolbar/status-toolbar. */
body > #mobileChannelsToggle,
body > #mobileUsersToggle,
body.theme-light > #mobileChannelsToggle,
body.theme-light > #mobileUsersToggle {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Tema claro: botões corretos de abrir Canais/Usuários iguais ao padrão do escuro. */
body.theme-light .chat-window .input-toolbar .window-channels-toggle,
body.theme-light .chat-window .input-toolbar .window-users-toggle,
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle.toolbar-panel-toggle,
body.theme-light #window-status .status-toolbar #mobileChannelsToggle,
body.theme-light #window-status .status-toolbar #mobileUsersToggle,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileChannelsToggle,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileUsersToggle {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  flex: 0 0 38px !important;
  border-radius: 999px !important;
  padding: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid #8f1117 !important;
  box-shadow: 0 7px 16px rgba(143, 17, 23, .22) !important;
  line-height: 1 !important;
  opacity: 1 !important;
}

body.theme-light .chat-window .input-toolbar .window-channels-toggle i,
body.theme-light .chat-window .input-toolbar .window-users-toggle i,
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle.toolbar-panel-toggle i,
body.theme-light #window-status .status-toolbar #mobileChannelsToggle i,
body.theme-light #window-status .status-toolbar #mobileUsersToggle i,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileChannelsToggle i,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileUsersToggle i {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  fill: #ffffff !important;
  stroke: #ffffff !important;
  width: 1em !important;
  height: 1em !important;
  min-width: 1em !important;
  min-height: 1em !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  transform: none !important;
  position: static !important;
}

body.theme-light .chat-window .input-toolbar .window-channels-toggle:hover,
body.theme-light .chat-window .input-toolbar .window-users-toggle:hover,
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle.toolbar-panel-toggle:hover,
body.theme-light #window-status .status-toolbar #mobileChannelsToggle:hover,
body.theme-light #window-status .status-toolbar #mobileUsersToggle:hover,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileChannelsToggle:hover,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileUsersToggle:hover {
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #8f1117 !important;
  transform: translateY(-1px) !important;
}

/* Mantém os demais botões da toolbar no tema claro sem serem afetados por esta correção. */
body.theme-light .chat-window .input-toolbar .toolbar-btn:not(.mobile-panel-toggle):not(.window-channels-toggle):not(.window-users-toggle) i,
body.theme-light #window-status .status-toolbar .toolbar-btn:not(.mobile-panel-toggle) i {
  transform: none !important;
}


/* ===== PAPINHO_PRO_V189 - ajuste final: formato dos botões de painel e player =====
   Não altera paleta. Apenas corrige formato/acabamento:
   - Tema claro: botões de Canais/Usuários seguem o mesmo formato arredondado do tema escuro, sem virar bola.
   - Tema escuro: play/stop da rádio fica redondo igual ao tema claro. */

/* Botões de menu/painel: vermelho com ícone branco, mas no formato arredondado correto do chat, não circular. */
body.theme-light .chat-window .input-toolbar .window-channels-toggle,
body.theme-light .chat-window .input-toolbar .window-users-toggle,
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle.toolbar-panel-toggle,
body.theme-light #window-status .status-toolbar #mobileChannelsToggle,
body.theme-light #window-status .status-toolbar #mobileUsersToggle,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileChannelsToggle,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileUsersToggle {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  flex: 0 0 38px !important;
  border-radius: 13px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid #8f1117 !important;
  box-shadow: 0 8px 18px rgba(143, 17, 23, .24) !important;
  line-height: 1 !important;
  opacity: 1 !important;
}

body.theme-light .chat-window .input-toolbar .window-channels-toggle i,
body.theme-light .chat-window .input-toolbar .window-users-toggle i,
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle.toolbar-panel-toggle i,
body.theme-light #window-status .status-toolbar #mobileChannelsToggle i,
body.theme-light #window-status .status-toolbar #mobileUsersToggle i,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileChannelsToggle i,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileUsersToggle i {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  fill: #ffffff !important;
  stroke: #ffffff !important;
  width: 1em !important;
  height: 1em !important;
  min-width: 1em !important;
  min-height: 1em !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  transform: none !important;
  position: static !important;
}

body.theme-light .chat-window .input-toolbar .window-channels-toggle:hover,
body.theme-light .chat-window .input-toolbar .window-users-toggle:hover,
body.theme-light .chat-window .input-toolbar .mobile-panel-toggle.toolbar-panel-toggle:hover,
body.theme-light #window-status .status-toolbar #mobileChannelsToggle:hover,
body.theme-light #window-status .status-toolbar #mobileUsersToggle:hover,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileChannelsToggle:hover,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileUsersToggle:hover {
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #8f1117 !important;
  transform: translateY(-1px) !important;
}

/* Player: play/stop redondo em qualquer tema, inclusive escuro. */
.radio-player .radio-btn.play-btn,
.radio-player .radio-btn.stop-btn,
.radio-player #playRadio,
.radio-player #stopRadio,
#playRadio.radio-btn,
#stopRadio.radio-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 0 !important;
}

.radio-player .radio-btn.play-btn i,
.radio-player .radio-btn.stop-btn i,
.radio-player #playRadio i,
.radio-player #stopRadio i,
#playRadio.radio-btn i,
#stopRadio.radio-btn i {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1em !important;
  height: 1em !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  transform: none !important;
}

/* ===== PAPINHO_PRO_V190 - correção definitiva: botões flutuantes e player =====
   - Tema claro: botões de Canais/Usuários com o mesmo tamanho/acabamento do tema escuro.
   - Mantém vermelho forte com ícones brancos.
   - Player: botão principal play/stop redondo de verdade no tema escuro e claro. */

/* Padroniza a área onde ficam os botões de painel para não comprimir os botões no tema claro. */
body.theme-light #window-status .input-toolbar.status-toolbar,
body.theme-light #window-status .mobile-panel-toggle-dock.status-toolbar,
body.theme-light .chat-window:not(#window-status) .input-toolbar {
  grid-auto-columns: 44px !important;
  gap: 8px !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

/* Botões flutuantes corretos: mesmo tamanho do padrão, sem encolher e sem virar bolinha. */

/* ===== PAPINHO_PRO_V198 - padronização definitiva das toolbars e menu/modais ===== */
:root {
  --papinho-tool-size: 38px;
  --papinho-tool-radius: 13px;
}

/* Todos os botões de envio e botões de abrir painéis usam o mesmo tamanho/posição da toolbar do Status. */
#window-status .input-toolbar.status-toolbar,
#window-status .mobile-panel-toggle-dock.status-toolbar,
.chat-window:not(#window-status) .input-toolbar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 5px 4px 4px !important;
  margin: 8px 0 10px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-width: none !important;
}
#window-status .input-toolbar.status-toolbar::-webkit-scrollbar,
#window-status .mobile-panel-toggle-dock.status-toolbar::-webkit-scrollbar,
.chat-window:not(#window-status) .input-toolbar::-webkit-scrollbar {
  display: none !important;
}
#window-status .status-toolbar .toolbar-btn,
#window-status .status-toolbar .mobile-panel-toggle,
#window-status .status-toolbar .toolbar-panel-toggle,
#mobileChannelsToggle,
#mobileUsersToggle,
.chat-window:not(#window-status) .input-toolbar .toolbar-btn,
.chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle,
.chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle,
.chat-window:not(#window-status) .input-toolbar .window-channels-toggle,
.chat-window:not(#window-status) .input-toolbar .window-users-toggle {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  width: var(--papinho-tool-size) !important;
  height: var(--papinho-tool-size) !important;
  min-width: var(--papinho-tool-size) !important;
  min-height: var(--papinho-tool-size) !important;
  max-width: var(--papinho-tool-size) !important;
  max-height: var(--papinho-tool-size) !important;
  flex: 0 0 var(--papinho-tool-size) !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: var(--papinho-tool-radius) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: hidden !important;
  animation: none !important;
}
#window-status .status-toolbar .toolbar-btn i,
#window-status .status-toolbar .mobile-panel-toggle i,
#window-status .status-toolbar .toolbar-panel-toggle i,
#mobileChannelsToggle i,
#mobileUsersToggle i,
.chat-window:not(#window-status) .input-toolbar .toolbar-btn i,
.chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle i,
.chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle i,
.chat-window:not(#window-status) .input-toolbar .window-channels-toggle i,
.chat-window:not(#window-status) .input-toolbar .window-users-toggle i {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1em !important;
  height: 1em !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  transform: none !important;
  position: static !important;
}
#window-status .status-toolbar #mobileChannelsToggle,
.chat-window:not(#window-status) .input-toolbar .window-channels-toggle {
  order: 0 !important;
  margin-right: 8px !important;
}
#window-status .status-toolbar #emojiBtn,
.chat-window:not(#window-status) .input-toolbar .window-emoji-btn { order: 1 !important; }
#window-status .status-toolbar #gifBtn,
.chat-window:not(#window-status) .input-toolbar .window-gif-btn { order: 2 !important; }
#window-status .status-toolbar #imageBtn,
.chat-window:not(#window-status) .input-toolbar .window-image-btn { order: 3 !important; }
#window-status .status-toolbar #audioBtn,
.chat-window:not(#window-status) .input-toolbar .window-audio-btn { order: 4 !important; }
#window-status .status-toolbar #colorBtn,
.chat-window:not(#window-status) .input-toolbar .window-color-btn { order: 5 !important; }
#window-status .status-toolbar #mobileUsersToggle,
.chat-window:not(#window-status) .input-toolbar .window-users-toggle {
  order: 6 !important;
  margin-left: 8px !important;
}
.private-window .input-toolbar .window-users-toggle {
  display: none !important;
}
body > #mobileChannelsToggle,
body > #mobileUsersToggle {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Tema claro: replica as mesmas medidas e acabamento nos botões da toolbar. */
body.theme-light #window-status .status-toolbar .toolbar-btn,
body.theme-light #window-status .status-toolbar .mobile-panel-toggle,
body.theme-light #window-status .status-toolbar .toolbar-panel-toggle,
body.theme-light #mobileChannelsToggle,
body.theme-light #mobileUsersToggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .toolbar-btn,
body.theme-light .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .toolbar-panel-toggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-channels-toggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
  width: var(--papinho-tool-size) !important;
  height: var(--papinho-tool-size) !important;
  min-width: var(--papinho-tool-size) !important;
  min-height: var(--papinho-tool-size) !important;
  max-width: var(--papinho-tool-size) !important;
  max-height: var(--papinho-tool-size) !important;
  flex: 0 0 var(--papinho-tool-size) !important;
  border-radius: var(--papinho-tool-radius) !important;
}
body.theme-light #window-status .status-toolbar #mobileChannelsToggle,
body.theme-light #window-status .status-toolbar #mobileUsersToggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-channels-toggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-users-toggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle.toolbar-panel-toggle {
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid #8f1117 !important;
  box-shadow: 0 8px 18px rgba(143, 17, 23, .24) !important;
}
body.theme-light #window-status .status-toolbar #mobileChannelsToggle i,
body.theme-light #window-status .status-toolbar #mobileUsersToggle i,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-channels-toggle i,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-users-toggle i,
body.theme-light .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle.toolbar-panel-toggle i {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Context menu acima do painel de nicks também no mobile. */
.context-menu {
  position: fixed !important;
  z-index: 2147483600 !important;
  min-width: 210px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: #151519 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .42) !important;
}
.context-menu ul { padding: 6px !important; }
.context-menu li,
.context-menu li span,
.context-menu li i,
body.theme-light .context-menu li,
body.theme-light .context-menu li span,
body.theme-light .context-menu li i {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.context-menu li {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 12px !important;
  border-radius: 9px !important;
  white-space: nowrap !important;
}
.context-menu li:hover {
  background: rgba(255, 255, 255, .12) !important;
}
.context-menu li i {
  width: 18px !important;
  text-align: center !important;
}
.user-panel,
body.mobile-users-open .user-panel {
  z-index: 1200 !important;
}

/* Modal de moderação no estilo do chat. */
.moderation-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483550;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(6px);
}
.moderation-modal-overlay[hidden] {
  display: none !important;
}
.moderation-modal {
  width: min(420px, calc(100vw - 34px));
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, .42);
  padding: 22px;
  position: relative;
  animation: papinhoPanelIn .18s ease both;
}
.moderation-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
}
.moderation-modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.moderation-modal h3 {
  margin: 0 36px 8px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
}
.moderation-modal-subtitle {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: .92rem;
}
.moderation-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 12px 0;
  font-weight: 700;
  color: var(--text-primary);
}
.moderation-field select,
.moderation-field input,
.moderation-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 11px 12px;
  outline: none;
  resize: vertical;
  font: inherit;
}
.moderation-field textarea { min-height: 86px; }
.moderation-field select:focus,
.moderation-field input:focus,
.moderation-field textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(var(--chat-accent-rgb), .14);
}
.moderation-modal-feedback {
  min-height: 18px;
  margin-top: 4px;
  color: #ffb4b4;
  font-size: .88rem;
}
.moderation-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
@media (max-width: 520px) {
  .moderation-modal {
    width: min(100%, calc(100vw - 24px));
    padding: 20px;
  }
  .moderation-modal-actions {
    flex-direction: column-reverse;
  }
  .moderation-modal-actions .modal-btn {
    width: 100%;
  }
}

/* ===== PAPINHO_PRO_V199 - tema claro replica exatamente a hierarquia do tema escuro =====
   No escuro os botões fixos da toolbar ficam menores que os botões flutuantes
   de abrir canais/usuários. Esta camada corrige o claro sem alterar o escuro. */
body.theme-light #window-status .input-toolbar.status-toolbar,
body.theme-light #window-status .mobile-panel-toggle-dock.status-toolbar,
body.theme-light .chat-window:not(#window-status) .input-toolbar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 5px 4px 4px !important;
  margin: 8px 0 10px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-width: none !important;
}

body.theme-light #window-status .input-toolbar.status-toolbar::-webkit-scrollbar,
body.theme-light #window-status .mobile-panel-toggle-dock.status-toolbar::-webkit-scrollbar,
body.theme-light .chat-window:not(#window-status) .input-toolbar::-webkit-scrollbar {
  display: none !important;
}

/* Ícones fixos de envio/emoji/gif/imagem/áudio/cor: mesmo tamanho usado no escuro. */
body.theme-light #window-status .status-toolbar .toolbar-btn:not(.mobile-panel-toggle):not(.toolbar-panel-toggle),
body.theme-light .chat-window:not(#window-status) .input-toolbar .toolbar-btn:not(.mobile-panel-toggle):not(.toolbar-panel-toggle):not(.window-channels-toggle):not(.window-users-toggle) {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  width: 35px !important;
  height: 35px !important;
  min-width: 35px !important;
  min-height: 35px !important;
  max-width: 35px !important;
  max-height: 35px !important;
  flex: 0 0 35px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  overflow: hidden !important;
}

/* Botões flutuantes de canais/usuários: maiores, como no tema escuro. */
body.theme-light #window-status .status-toolbar #mobileChannelsToggle,
body.theme-light #window-status .status-toolbar #mobileUsersToggle,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileChannelsToggle,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileUsersToggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-channels-toggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-users-toggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .mobile-panel-toggle.toolbar-panel-toggle {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  flex: 0 0 44px !important;
  aspect-ratio: 1 / 1 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  border-radius: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: hidden !important;
  animation: none !important;
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid #8f1117 !important;
  box-shadow: 0 8px 18px rgba(143, 17, 23, .24) !important;
}

body.theme-light #window-status .status-toolbar #mobileChannelsToggle,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileChannelsToggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-channels-toggle {
  order: 0 !important;
  margin-right: 16px !important;
}
body.theme-light #window-status .status-toolbar #mobileUsersToggle,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileUsersToggle,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-users-toggle {
  order: 6 !important;
  margin-left: 16px !important;
}

body.theme-light #window-status .status-toolbar .toolbar-btn i,
body.theme-light .chat-window:not(#window-status) .input-toolbar .toolbar-btn i,
body.theme-light #window-status .status-toolbar #mobileChannelsToggle i,
body.theme-light #window-status .status-toolbar #mobileUsersToggle i,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileChannelsToggle i,
body.theme-light #window-status .mobile-panel-toggle-dock #mobileUsersToggle i,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-channels-toggle i,
body.theme-light .chat-window:not(#window-status) .input-toolbar .window-users-toggle i {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1em !important;
  height: 1em !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  transform: none !important;
  position: static !important;
}

body.theme-light .private-window .input-toolbar .window-users-toggle {
  display: none !important;
}

/* ===== PAPINHO_PRO_V200 - rádio escuro com play/stop redondo como no claro =====
   Ajuste final somente no player: mantém o vermelho/sombra do tema escuro e troca
   o formato do play/stop para círculo perfeito, igual ao tema claro. */
body:not(.theme-light) #radioPlayer .radio-main-btn,
body:not(.theme-light) #radioPlayer .radio-btn.play-btn,
body:not(.theme-light) #radioPlayer .radio-btn.stop-btn,
body:not(.theme-light) #playRadio,
body:not(.theme-light) #playRadio.radio-main-btn,
body:not(.theme-light) #playRadio.radio-btn.play-btn,
body:not(.theme-light) #stopRadio,
body:not(.theme-light) #stopRadio.radio-btn.stop-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  max-height: 44px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 999px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  overflow: hidden !important;
}

body:not(.theme-light) #radioPlayer .radio-main-btn i,
body:not(.theme-light) #radioPlayer .radio-btn.play-btn i,
body:not(.theme-light) #radioPlayer .radio-btn.stop-btn i,
body:not(.theme-light) #playRadio i,
body:not(.theme-light) #stopRadio i {
  margin: 0 !important;
  line-height: 1 !important;
  transform: none !important;
  position: static !important;
}

/* ===== PAPINHO_PRO_V201 - tema claro: contraste real em menus/modais de moderação e iniciais de avatar =====
   Corrige vazamento de branco no tema claro: menu de ações, modal Kick/Ban e
   iniciais/fallback de avatar continuam legíveis sem ficar branco sobre fundo claro. */
body.theme-light .context-menu,
body.theme-light #userContextMenu,
body.theme-light .moderation-modal,
body.theme-light .moderation-modal * {
  color-scheme: dark !important;
}

body.theme-light .context-menu,
body.theme-light #userContextMenu {
  background: #171a22 !important;
  background-image: none !important;
  color: #f8f1f1 !important;
  border: 1px solid rgba(143, 17, 23, .48) !important;
  box-shadow: 0 22px 54px rgba(0, 0, 0, .34), 0 0 0 1px rgba(255, 255, 255, .035) inset !important;
}

body.theme-light .context-menu li,
body.theme-light #userContextMenu li,
body.theme-light .context-menu button,
body.theme-light #userContextMenu button,
body.theme-light .context-menu a,
body.theme-light #userContextMenu a {
  color: #f8f1f1 !important;
  -webkit-text-fill-color: #f8f1f1 !important;
  background: transparent !important;
}

body.theme-light .context-menu li i,
body.theme-light #userContextMenu li i,
body.theme-light .context-menu button i,
body.theme-light #userContextMenu button i {
  color: #ffb4b8 !important;
  -webkit-text-fill-color: #ffb4b8 !important;
}

body.theme-light .context-menu li:hover,
body.theme-light #userContextMenu li:hover,
body.theme-light .context-menu button:hover,
body.theme-light #userContextMenu button:hover {
  background: rgba(143, 17, 23, .32) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.theme-light .moderation-modal-overlay {
  background: rgba(0, 0, 0, .62) !important;
}

body.theme-light .moderation-modal {
  background: #171a22 !important;
  background-image: linear-gradient(180deg, #1d202a 0%, #151821 100%) !important;
  color: #f8f1f1 !important;
  border: 1px solid rgba(143, 17, 23, .55) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .42), 0 0 0 1px rgba(255, 255, 255, .035) inset !important;
}

body.theme-light .moderation-modal h3,
body.theme-light .moderation-modal h3 i,
body.theme-light .moderation-field,
body.theme-light .moderation-field label {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

body.theme-light .moderation-modal-subtitle {
  color: #d7c9ca !important;
  -webkit-text-fill-color: #d7c9ca !important;
}

body.theme-light .moderation-field select,
body.theme-light .moderation-field input,
body.theme-light .moderation-field textarea {
  background: #0f121a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: rgba(255, 255, 255, .16) !important;
  box-shadow: none !important;
}

body.theme-light .moderation-field select option {
  background: #0f121a !important;
  color: #ffffff !important;
}

body.theme-light .moderation-field input::placeholder,
body.theme-light .moderation-field textarea::placeholder {
  color: rgba(255, 255, 255, .56) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, .56) !important;
}

body.theme-light .moderation-modal-close,
body.theme-light .moderation-modal-actions .modal-btn.cancel {
  background: rgba(255, 255, 255, .08) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: rgba(255, 255, 255, .13) !important;
}

body.theme-light .moderation-modal-close:hover,
body.theme-light .moderation-modal-actions .modal-btn.cancel:hover {
  background: rgba(255, 255, 255, .14) !important;
  color: #ffffff !important;
}

body.theme-light .moderation-modal-actions .modal-btn.apply,
body.theme-light #moderationConfirmBtn {
  background: #8f1117 !important;
  background-image: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #8f1117 !important;
}

body.theme-light .moderation-modal-feedback {
  color: #ffb4b4 !important;
  -webkit-text-fill-color: #ffb4b4 !important;
}

/* Iniciais/fallback de avatar no tema claro: nunca branco sobre área clara. */
body.theme-light .user-avatar-fallback,
body.theme-light .private-avatar-fallback,
body.theme-light .private-chat-header .private-avatar-fallback,
body.theme-light .private-avatar-shell .private-avatar-fallback,
body.theme-light .avatar-preview-frame .private-avatar-fallback,
body.theme-light .avatar-preview-frame .user-avatar-fallback,
body.theme-light .user-controls .user-avatar-fallback,
body.theme-light .user-controls .private-avatar-fallback {
  background: #fff1f2 !important;
  background-image: none !important;
  color: #8f1117 !important;
  -webkit-text-fill-color: #8f1117 !important;
  border: 1px solid rgba(143, 17, 23, .32) !important;
  text-shadow: none !important;
  box-shadow: 0 0 0 2px rgba(143, 17, 23, .08) !important;
}

body.theme-light .profile-avatar-btn,
body.theme-light .user-controls .profile-avatar-btn,
body.theme-light .modal-btn.avatar {
  background: #ffffff !important;
  color: #8f1117 !important;
  -webkit-text-fill-color: #8f1117 !important;
  border-color: rgba(143, 17, 23, .32) !important;
}

body.theme-light .profile-avatar-btn i,
body.theme-light .user-controls .profile-avatar-btn i,
body.theme-light .modal-btn.avatar i {
  color: #8f1117 !important;
  -webkit-text-fill-color: #8f1117 !important;
}

/* Ajuste solicitado: no desktop, o player da rádio fica abaixo do logotipo/nome. */
@media (min-width: 769px) {
  .radio-player {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "radio-info"
      "radio-controls" !important;
    align-items: start !important;
    justify-items: start !important;
    gap: 8px 12px !important;
  }

  .radio-player .radio-info {
    grid-area: radio-info !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .radio-player .radio-controls {
    grid-area: radio-controls !important;
    justify-self: start !important;
    align-self: start !important;
    margin-left: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    display: inline-flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
}

/* Ajuste solicitado: ampliar molde do volume no desktop para não cortar o "%". */
@media (min-width: 769px) {
  .radio-player .volume-control,
  .volume-control {
    width: 268px !important;
    min-width: 248px !important;
    flex-basis: 268px !important;
    grid-template-columns: 42px minmax(104px, 1fr) 54px !important;
    padding-right: 14px !important;
  }

  .radio-player .volume-value,
  .volume-value {
    min-width: 48px !important;
    width: 48px !important;
    padding-right: 2px !important;
    overflow: visible !important;
  }
}

/* Ajuste solicitado: deslocar somente o texto do percentual do volume um pouco para a esquerda no desktop. */
@media (min-width: 769px) {
  .radio-player .volume-value,
  .volume-value {
    position: relative !important;
    left: -5px !important;
    text-align: right !important;
  }
}

/* PAPINHO_PRO_V178 - tema claro: hover do Alterar Avatar igual ao botão de tema */
body.theme-light .profile-avatar-btn:hover,
body.theme-light .user-controls .profile-avatar-btn:hover,
body.theme-light .profile-avatar-btn:focus-visible,
body.theme-light .user-controls .profile-avatar-btn:focus-visible {
  background: #fff4f5 !important;
  color: var(--papinho-red-strong, #8f1117) !important;
  border-color: var(--papinho-red-strong, #8f1117) !important;
  transform: translateY(-1px) !important;
}

body.theme-light .profile-avatar-btn:hover i,
body.theme-light .profile-avatar-btn:focus-visible i {
  color: var(--papinho-red-strong, #8f1117) !important;
}

/* PAPINHO_FIX_AVATAR_HOVER_FORTE - Alterar Avatar com o mesmo hover vermelho forte do botão de tema */
body.theme-light .profile-avatar-btn:hover,
body.theme-light .user-controls .profile-avatar-btn:hover,
body.theme-light .modal-btn.avatar:hover,
body.theme-light .profile-avatar-btn:focus-visible,
body.theme-light .user-controls .profile-avatar-btn:focus-visible,
body.theme-light .modal-btn.avatar:focus-visible {
  background: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2)) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: color-mix(in srgb, var(--accent-hover) 72%, white 28%) !important;
  box-shadow: 0 10px 22px rgba(var(--chat-accent-rgb), 0.28) !important;
  transform: translateY(-1px) !important;
}

body.theme-light .profile-avatar-btn:hover i,
body.theme-light .user-controls .profile-avatar-btn:hover i,
body.theme-light .modal-btn.avatar:hover i,
body.theme-light .profile-avatar-btn:hover span,
body.theme-light .user-controls .profile-avatar-btn:hover span,
body.theme-light .modal-btn.avatar:hover span,
body.theme-light .profile-avatar-btn:focus-visible i,
body.theme-light .user-controls .profile-avatar-btn:focus-visible i,
body.theme-light .modal-btn.avatar:focus-visible i,
body.theme-light .profile-avatar-btn:focus-visible span,
body.theme-light .user-controls .profile-avatar-btn:focus-visible span,
body.theme-light .modal-btn.avatar:focus-visible span {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* PAPINHO_FIX_AVATAR_HOVER_FINAL - tema claro: hover do Alterar Avatar realmente preenchido.
   A regra anterior ainda podia herdar um vermelho lavado por var/gradiente e por
   regras gerais de hover. Aqui o botão recebe preenchimento sólido, sem camada
   translúcida, igualando a força visual do botão de tema. */
body.theme-light .user-controls button.profile-avatar-btn:hover,
body.theme-light .user-controls .profile-avatar-btn:hover,
body.theme-light button.profile-avatar-btn:hover,
body.theme-light .profile-avatar-btn:hover,
body.theme-light .user-controls button.profile-avatar-btn:focus-visible,
body.theme-light .user-controls .profile-avatar-btn:focus-visible,
body.theme-light button.profile-avatar-btn:focus-visible,
body.theme-light .profile-avatar-btn:focus-visible {
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  border-color: #8f1117 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(143, 17, 23, .34) !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  isolation: isolate !important;
  transform: translateY(-1px) !important;
}

body.theme-light .user-controls button.profile-avatar-btn:hover *,
body.theme-light .user-controls .profile-avatar-btn:hover *,
body.theme-light button.profile-avatar-btn:hover *,
body.theme-light .profile-avatar-btn:hover *,
body.theme-light .user-controls button.profile-avatar-btn:focus-visible *,
body.theme-light .user-controls .profile-avatar-btn:focus-visible *,
body.theme-light button.profile-avatar-btn:focus-visible *,
body.theme-light .profile-avatar-btn:focus-visible * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

/* PAPINHO_FIX_AVATAR_HOVER_DARK_LIGHT - Alterar Avatar com hover forte nos dois temas.
   A versão anterior estava limitada ao body.theme-light, por isso o tema escuro
   continuava herdando o hover fraco/translúcido definido em .profile-avatar-btn:hover. */
body.theme-dark .user-controls button.profile-avatar-btn:hover,
body.theme-dark .user-controls .profile-avatar-btn:hover,
body.theme-dark button.profile-avatar-btn:hover,
body.theme-dark .profile-avatar-btn:hover,
body:not(.theme-light) .user-controls button.profile-avatar-btn:hover,
body:not(.theme-light) .user-controls .profile-avatar-btn:hover,
body:not(.theme-light) button.profile-avatar-btn:hover,
body:not(.theme-light) .profile-avatar-btn:hover,
body.theme-dark .user-controls button.profile-avatar-btn:focus-visible,
body.theme-dark .user-controls .profile-avatar-btn:focus-visible,
body.theme-dark button.profile-avatar-btn:focus-visible,
body.theme-dark .profile-avatar-btn:focus-visible,
body:not(.theme-light) .user-controls button.profile-avatar-btn:focus-visible,
body:not(.theme-light) .user-controls .profile-avatar-btn:focus-visible,
body:not(.theme-light) button.profile-avatar-btn:focus-visible,
body:not(.theme-light) .profile-avatar-btn:focus-visible {
  background: #8f1117 !important;
  background-color: #8f1117 !important;
  background-image: none !important;
  border-color: #8f1117 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(143, 17, 23, .36) !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  isolation: isolate !important;
  transform: translateY(-1px) !important;
}

body.theme-dark .user-controls button.profile-avatar-btn:hover *,
body.theme-dark .user-controls .profile-avatar-btn:hover *,
body.theme-dark button.profile-avatar-btn:hover *,
body.theme-dark .profile-avatar-btn:hover *,
body:not(.theme-light) .user-controls button.profile-avatar-btn:hover *,
body:not(.theme-light) .user-controls .profile-avatar-btn:hover *,
body:not(.theme-light) button.profile-avatar-btn:hover *,
body:not(.theme-light) .profile-avatar-btn:hover *,
body.theme-dark .user-controls button.profile-avatar-btn:focus-visible *,
body.theme-dark .user-controls .profile-avatar-btn:focus-visible *,
body.theme-dark button.profile-avatar-btn:focus-visible *,
body.theme-dark .profile-avatar-btn:focus-visible *,
body:not(.theme-light) .user-controls button.profile-avatar-btn:focus-visible *,
body:not(.theme-light) .user-controls .profile-avatar-btn:focus-visible *,
body:not(.theme-light) button.profile-avatar-btn:focus-visible *,
body:not(.theme-light) .profile-avatar-btn:focus-visible * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

/* PAPINHO_V207 - hover unificado dos botões do perfil/menu de usuários.
   Usa exatamente a mesma base visual do hover do botão de tema no tema atual,
   corrigindo o vermelho escuro demais no tema escuro e aplicando o padrão a
   Alterar Avatar, Alterar usuário e Sair do bate-papo. */
body.theme-dark .profile-avatar-btn:hover,
body.theme-dark .profile-avatar-btn:focus-visible,
body.theme-dark .user-controls .profile-avatar-btn:hover,
body.theme-dark .user-controls .profile-avatar-btn:focus-visible,
body.theme-dark .user-panel-switch-btn:hover,
body.theme-dark .user-panel-switch-btn:focus-visible,
body.theme-dark .user-panel-logout-btn:hover,
body.theme-dark .user-panel-logout-btn:focus-visible,
body:not(.theme-light) .profile-avatar-btn:hover,
body:not(.theme-light) .profile-avatar-btn:focus-visible,
body:not(.theme-light) .user-controls .profile-avatar-btn:hover,
body:not(.theme-light) .user-controls .profile-avatar-btn:focus-visible,
body:not(.theme-light) .user-panel-switch-btn:hover,
body:not(.theme-light) .user-panel-switch-btn:focus-visible,
body:not(.theme-light) .user-panel-logout-btn:hover,
body:not(.theme-light) .user-panel-logout-btn:focus-visible {
  background: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2)) !important;
  background-color: var(--accent-color) !important;
  background-image: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2)) !important;
  border-color: color-mix(in srgb, var(--accent-hover, var(--accent-color)) 72%, white 28%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(var(--chat-accent-rgb), 0.32) !important;
  opacity: 1 !important;
  filter: none !important;
  transform: translateY(-1px) !important;
}

body.theme-light .profile-avatar-btn:hover,
body.theme-light .profile-avatar-btn:focus-visible,
body.theme-light .user-controls .profile-avatar-btn:hover,
body.theme-light .user-controls .profile-avatar-btn:focus-visible,
body.theme-light .user-panel-switch-btn:hover,
body.theme-light .user-panel-switch-btn:focus-visible,
body.theme-light .user-panel-logout-btn:hover,
body.theme-light .user-panel-logout-btn:focus-visible {
  background: #fff4f5 !important;
  background-color: #fff4f5 !important;
  background-image: none !important;
  border-color: var(--papinho-red-strong, #8f1117) !important;
  color: var(--papinho-red-strong, #8f1117) !important;
  -webkit-text-fill-color: var(--papinho-red-strong, #8f1117) !important;
  box-shadow: 0 8px 18px rgba(143, 17, 23, 0.18) !important;
  opacity: 1 !important;
  filter: none !important;
  transform: translateY(-1px) !important;
}

body.theme-dark .profile-avatar-btn:hover *,
body.theme-dark .profile-avatar-btn:focus-visible *,
body.theme-dark .user-controls .profile-avatar-btn:hover *,
body.theme-dark .user-controls .profile-avatar-btn:focus-visible *,
body.theme-dark .user-panel-switch-btn:hover *,
body.theme-dark .user-panel-switch-btn:focus-visible *,
body.theme-dark .user-panel-logout-btn:hover *,
body.theme-dark .user-panel-logout-btn:focus-visible *,
body:not(.theme-light) .profile-avatar-btn:hover *,
body:not(.theme-light) .profile-avatar-btn:focus-visible *,
body:not(.theme-light) .user-controls .profile-avatar-btn:hover *,
body:not(.theme-light) .user-controls .profile-avatar-btn:focus-visible *,
body:not(.theme-light) .user-panel-switch-btn:hover *,
body:not(.theme-light) .user-panel-switch-btn:focus-visible *,
body:not(.theme-light) .user-panel-logout-btn:hover *,
body:not(.theme-light) .user-panel-logout-btn:focus-visible * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

body.theme-light .profile-avatar-btn:hover *,
body.theme-light .profile-avatar-btn:focus-visible *,
body.theme-light .user-controls .profile-avatar-btn:hover *,
body.theme-light .user-controls .profile-avatar-btn:focus-visible *,
body.theme-light .user-panel-switch-btn:hover *,
body.theme-light .user-panel-switch-btn:focus-visible *,
body.theme-light .user-panel-logout-btn:hover *,
body.theme-light .user-panel-logout-btn:focus-visible * {
  color: var(--papinho-red-strong, #8f1117) !important;
  -webkit-text-fill-color: var(--papinho-red-strong, #8f1117) !important;
  opacity: 1 !important;
  filter: none !important;
}

/* Desktop: quebra apenas o texto do botão Sair do bate-papo em duas linhas,
   mantendo centralizado e sem alterar o mobile. */
@media (min-width: 769px) {
  #chatLogoutUserPanelBtn span,
  .user-panel-logout-btn span {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 0 !important;
    white-space: normal !important;
    line-height: 1.05 !important;
    font-size: 0 !important;
  }

  #chatLogoutUserPanelBtn span::before,
  .user-panel-logout-btn span::before {
    content: 'Sair do';
    display: block !important;
    font-size: .82rem !important;
    line-height: 1.05 !important;
    font-weight: inherit !important;
  }

  #chatLogoutUserPanelBtn span::after,
  .user-panel-logout-btn span::after {
    content: 'bate-papo';
    display: block !important;
    font-size: .82rem !important;
    line-height: 1.05 !important;
    font-weight: inherit !important;
  }
}

/* PAPINHO_V208 - hover do Alterar Avatar com a MESMA regra vencedora do botão de tema.
   O V207 ainda perdia no tema escuro para a regra antiga mais específica
   `button.profile-avatar-btn:hover`, que deixava o vermelho sólido/escuro.
   Esta regra final usa a mesma aparência do `.theme-btn:hover` e inclui o
   seletor com `button` para vencer a cascata corretamente. */
body.theme-dark .user-controls button.profile-avatar-btn:hover,
body.theme-dark .user-controls button.profile-avatar-btn:focus-visible,
body.theme-dark button.profile-avatar-btn:hover,
body.theme-dark button.profile-avatar-btn:focus-visible,
body:not(.theme-light) .user-controls button.profile-avatar-btn:hover,
body:not(.theme-light) .user-controls button.profile-avatar-btn:focus-visible,
body:not(.theme-light) button.profile-avatar-btn:hover,
body:not(.theme-light) button.profile-avatar-btn:focus-visible,
body.theme-dark .user-controls .profile-avatar-btn:hover,
body.theme-dark .user-controls .profile-avatar-btn:focus-visible,
body.theme-dark .profile-avatar-btn:hover,
body.theme-dark .profile-avatar-btn:focus-visible,
body:not(.theme-light) .user-controls .profile-avatar-btn:hover,
body:not(.theme-light) .user-controls .profile-avatar-btn:focus-visible,
body:not(.theme-light) .profile-avatar-btn:hover,
body:not(.theme-light) .profile-avatar-btn:focus-visible,
body.theme-dark .user-panel-switch-btn:hover,
body.theme-dark .user-panel-switch-btn:focus-visible,
body.theme-dark .user-panel-logout-btn:hover,
body.theme-dark .user-panel-logout-btn:focus-visible,
body:not(.theme-light) .user-panel-switch-btn:hover,
body:not(.theme-light) .user-panel-switch-btn:focus-visible,
body:not(.theme-light) .user-panel-logout-btn:hover,
body:not(.theme-light) .user-panel-logout-btn:focus-visible {
  background: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2)) !important;
  background-color: var(--accent-color) !important;
  background-image: linear-gradient(135deg, var(--accent-color), var(--chat-accent-2)) !important;
  border-color: color-mix(in srgb, var(--accent-hover) 72%, white 28%) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(var(--chat-accent-rgb), 0.24) !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  isolation: isolate !important;
  transform: translateY(-1px) !important;
}

body.theme-dark .user-controls button.profile-avatar-btn:hover *,
body.theme-dark .user-controls button.profile-avatar-btn:focus-visible *,
body.theme-dark button.profile-avatar-btn:hover *,
body.theme-dark button.profile-avatar-btn:focus-visible *,
body:not(.theme-light) .user-controls button.profile-avatar-btn:hover *,
body:not(.theme-light) .user-controls button.profile-avatar-btn:focus-visible *,
body:not(.theme-light) button.profile-avatar-btn:hover *,
body:not(.theme-light) button.profile-avatar-btn:focus-visible *,
body.theme-dark .user-controls .profile-avatar-btn:hover *,
body.theme-dark .user-controls .profile-avatar-btn:focus-visible *,
body.theme-dark .profile-avatar-btn:hover *,
body.theme-dark .profile-avatar-btn:focus-visible *,
body:not(.theme-light) .user-controls .profile-avatar-btn:hover *,
body:not(.theme-light) .user-controls .profile-avatar-btn:focus-visible *,
body:not(.theme-light) .profile-avatar-btn:hover *,
body:not(.theme-light) .profile-avatar-btn:focus-visible *,
body.theme-dark .user-panel-switch-btn:hover *,
body.theme-dark .user-panel-switch-btn:focus-visible *,
body.theme-dark .user-panel-logout-btn:hover *,
body.theme-dark .user-panel-logout-btn:focus-visible *,
body:not(.theme-light) .user-panel-switch-btn:hover *,
body:not(.theme-light) .user-panel-switch-btn:focus-visible *,
body:not(.theme-light) .user-panel-logout-btn:hover *,
body:not(.theme-light) .user-panel-logout-btn:focus-visible * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}


/* Desktop only: floating menu icons white */
@media (min-width: 1024px) {
  .mobile-panel-toggle i,
  .toolbar-panel-toggle i,
  .floating-menu-btn i {
    color: #fff !important;
  }
}

/* PAPINHO_FIX_130526 - tema claro: texto padrão preto somente no tema claro.
   Correção visual isolada: não altera o tema escuro nem fluxos JS/IRC. */
body.theme-light {
  --text-primary: #111111 !important;
  --papinho-light-text: #111111 !important;
  color: #111111 !important;
}

body.theme-light .chat-header,
body.theme-light .chat-header .chat-title,
body.theme-light .chat-header .private-title,
body.theme-light .chat-header .channel-title,
body.theme-light .sidebar,
body.theme-light .sidebar-header,
body.theme-light .sidebar-title,
body.theme-light .channel-item,
body.theme-light .channel-name,
body.theme-light .user-panel,
body.theme-light .user-panel-header,
body.theme-light .user-panel-title,
body.theme-light .user-panel-channel-label,
body.theme-light .tabs,
body.theme-light .tab,
body.theme-light .tab span:not(.tab-unread),
body.theme-light .chat-messages,
body.theme-light .message,
body.theme-light .message .text,
body.theme-light .message .text *:not(.nickname),
body.theme-light .modal-content,
body.theme-light .modal-content label,
body.theme-light .modal-content p,
body.theme-light .legal-modal,
body.theme-light .legal-modal p,
body.theme-light .connect-gate-card,
body.theme-light .connect-gate-card label,
body.theme-light .connect-gate-copy,
body.theme-light .connect-gate-copy p,
body.theme-light .radio-player,
body.theme-light .radio-info,
body.theme-light .radio-name,
body.theme-light .status-text,
body.theme-light .connection-status,
body.theme-light .presence-control,
body.theme-light .presence-custom-trigger,
body.theme-light .presence-custom-trigger span,
body.theme-light .presence-custom-trigger strong,
body.theme-light .presence-custom-trigger .presence-label,
body.theme-light .presence-custom-trigger .presence-current-label,
body.theme-light .presence-custom-select,
body.theme-light #presenceCustomTrigger,
body.theme-light #presenceCustomTrigger span,
body.theme-light #presenceCustomTrigger strong {
  color: #111111 !important;
  -webkit-text-fill-color: #111111 !important;
  text-shadow: none !important;
}

/* Mantém branco apenas onde o próprio tema claro usa fundo vermelho/escuro proposital. */
body.theme-light #sendBtn,
body.theme-light .send-btn,
body.theme-light .smart-send-btn,
body.theme-light .connect-gate-button,
body.theme-light .auth-primary-btn,
body.theme-light .modal-btn.apply,
body.theme-light .reauth-submit,
body.theme-light .switch-user-submit,
body.theme-light .user-panel-logout-btn,
body.theme-light .user-panel-switch-btn,
body.theme-light .tab-unread,
body.theme-light .channel-users,
body.theme-light .user-count-badge,
body.theme-light .user-panel-count,
body.theme-light #presenceCustomMenu,
body.theme-light .presence-custom-menu,
body.theme-light #presenceCustomMenu *:not(.presence-dot-mini),
body.theme-light .presence-custom-menu *:not(.presence-dot-mini) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* ===== FIX 13/05/2026: modal Alterar Avatar visível/clicável no desktop e mobile =====
   Corrige somente a abertura visual do seletor de avatar; não altera upload, perfil, IRC ou menus. */
.avatar-source-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 18px !important;
  background: rgba(0, 0, 0, .62) !important;
  z-index: 999999 !important;
  box-sizing: border-box !important;
}

.avatar-source-modal {
  width: min(92vw, 380px) !important;
  max-width: 380px !important;
  border-radius: 18px !important;
  padding: 22px !important;
  position: relative !important;
  box-sizing: border-box !important;
  background: var(--bg-secondary, #1f2937) !important;
  border: 1px solid var(--border-color, rgba(255,255,255,.12)) !important;
  color: var(--text-primary, #ffffff) !important;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .42) !important;
}

.avatar-source-modal h3 {
  margin: 0 34px 18px 0 !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
  color: inherit !important;
}

.avatar-source-close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 34px !important;
  height: 34px !important;
  border: 0 !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 22px !important;
  line-height: 1 !important;
  color: var(--text-primary, #ffffff) !important;
  background: rgba(255, 255, 255, .10) !important;
}

.avatar-source-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  margin-bottom: 16px !important;
}

.avatar-source-tab,
.avatar-source-main {
  min-height: 42px !important;
  border: 1px solid var(--border-color, rgba(255,255,255,.14)) !important;
  border-radius: 13px !important;
  cursor: pointer !important;
  font-weight: 800 !important;
  color: var(--text-primary, #ffffff) !important;
  background: rgba(255, 255, 255, .08) !important;
}

.avatar-source-tab.active,
.avatar-source-main {
  background: var(--accent-color, #b91c1c) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

.avatar-source-pane {
  display: grid !important;
  gap: 10px !important;
}

.avatar-source-pane[hidden] {
  display: none !important;
}

.avatar-source-input {
  width: 100% !important;
  min-height: 42px !important;
  border-radius: 12px !important;
  border: 1px solid var(--border-color, rgba(255,255,255,.14)) !important;
  padding: 0 12px !important;
  box-sizing: border-box !important;
  color: var(--text-primary, #ffffff) !important;
  background: var(--bg-primary, #111827) !important;
}

.avatar-source-input.invalid {
  border-color: #ef4444 !important;
}

.avatar-source-pane small {
  color: var(--text-secondary, rgba(255,255,255,.72)) !important;
  text-align: center !important;
}

body.theme-light .avatar-source-modal {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: rgba(0, 0, 0, .12) !important;
}

body.theme-light .avatar-source-close,
body.theme-light .avatar-source-tab {
  color: #111111 !important;
  background: rgba(0, 0, 0, .06) !important;
  border-color: rgba(0, 0, 0, .12) !important;
}

body.theme-light .avatar-source-tab.active,
body.theme-light .avatar-source-main {
  color: #ffffff !important;
  background: var(--accent-color, #b91c1c) !important;
}

body.theme-light .avatar-source-input {
  background: #ffffff !important;
  color: #111111 !important;
  border-color: rgba(0, 0, 0, .18) !important;
}

body.theme-light .avatar-source-pane small {
  color: #333333 !important;
}

/* Linha discreta separando canais e nicks nos menus */
.channel-list .channel-item,
.user-list .user-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-light .channel-list .channel-item,
.theme-light .user-list .user-item {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.channel-list .channel-item:last-child,
.user-list .user-item:last-child {
    border-bottom-color: transparent;
}

/* ===== FIX 13/05/2026: tema claro - texto do status atual no seletor Meu status =====
   Mantém branco somente o texto da posição/status atual do seletor, pois o fundo do trigger é escuro.
   Não altera o menu aberto nem o tema escuro. */
body.theme-light #presenceCustomTrigger,
body.theme-light #presenceCustomTrigger span,
body.theme-light #presenceCustomTrigger strong,
body.theme-light #presenceCustomTrigger .presence-label,
body.theme-light #presenceCustomTrigger .presence-current-label,
body.theme-light .presence-custom-trigger,
body.theme-light .presence-custom-trigger span,
body.theme-light .presence-custom-trigger strong,
body.theme-light .presence-custom-trigger .presence-label,
body.theme-light .presence-custom-trigger .presence-current-label {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* ===== PAPINHO FIX 13/05/2026 v2 - iniciais de avatar sem piscar no menu =====
   Corrige o aumento/pisca das letras ao abrir o menu de nicks.
   A causa era conflito entre wrapper 28px do menu e fallback 30px global,
   além de transições/transform nas iniciais. Não altera imagem real de avatar. */
#userPanel.user-panel .user-avatar-fallback,
body #userPanel.user-panel .user-avatar-fallback {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  flex: 0 0 28px !important;
  font-size: 11px !important;
  line-height: 28px !important;
}

body .user-avatar-fallback,
body .user-item .user-avatar-fallback,
body .private-avatar-fallback {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  font-synthesis: none !important;
  font-style: normal !important;
  font-variant: normal !important;
  letter-spacing: 0 !important;
  text-rendering: auto !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  transform: none !important;
  scale: 1 !important;
  backface-visibility: visible !important;
  animation: none !important;
  transition: none !important;
}

body .user-avatar-wrap,
body .user-item .user-avatar-wrap,
#userPanel.user-panel .user-avatar-wrap,
body #userPanel.user-panel .user-avatar-wrap,
body .user-avatar,
body .user-item .user-avatar,
#userPanel.user-panel .user-avatar,
body #userPanel.user-panel .user-avatar {
  animation: none !important;
  transition: none !important;
}
