#ead-chat-system-chat {
    --bg-main-chat: #f0f2f5;
    --bg-panel-chat: #ffffff;
    --bg-hover-chat: #f9fafb;
    --primary-chat: #ff4500;
    --primary-hover-chat: #cc3700;
    --text-main-chat: #1f2937;
    --text-muted-chat: #6b7280;
    --border-color-chat: #e5e7eb;
    --bubble-sent-chat: #ffedd5;
    --bubble-received-chat: #f3f4f6;

    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: var(--text-main-chat);
}

@media (max-width: 640px) { #ead-chat-system-chat { font-size: 12px; } }

.hidden-chat { display: none !important; }
.fade-in-chat { animation: fadeInChat 0.3s ease-in-out; }
.slide-up-chat { animation: slideUpChat 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes fadeInChat { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUpChat { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulseRec { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8,0,1,1); } 50% { transform: translateY(0); animation-timing-function: cubic-bezier(0,0,0.2,1); } }

.pulse-recording { animation: pulseRec 1.5s infinite; }
.pulse-anim { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.bounce-anim { animation: bounce 1s infinite; }

#ead-chat-system-chat * { scrollbar-width: none; -ms-overflow-style: none; }
#ead-chat-system-chat *::-webkit-scrollbar { display: none; }
.invisible-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.invisible-scrollbar::-webkit-scrollbar { display: none; }
.no-scroll-site { overflow: hidden !important; }

/* ======================== CHAT ESTRUTURA GERAL ======================== */
.chat-container-chat {
    position: fixed; bottom: 80px; right: 20px; width: 400px; height: 600px; max-height: calc(100vh - 100px);
    background-color: var(--bg-panel-chat); border: none;
    border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex; flex-direction: column; overflow: hidden; z-index: 9999; transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .chat-container-chat { 
        width: 100%; height: 100%; top: 0; left: 0; bottom: 0; right: 0; 
        border-radius: 0; border: none; max-height: none; 
    }
}

.chat-view { display: flex; flex-direction: column; height: 100%; }

/* ======================== CHAT HEADER ======================== */
.chat-header-chat { background: linear-gradient(135deg, #111111 0%, #ff4500 100%); color: white; padding: 15px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 10; border-bottom: 2px solid #ea580c; flex-shrink: 0; }
.chat-main-title { font-size: 1.125rem; font-weight: bold; display: flex; align-items: center; gap: 0.5rem; line-height: 1; margin: 0; }
.chat-main-icon { font-size: 20px; }
.chat-header-actions { display: flex; align-items: center; }

.btn-close-elegant-chat { background-color: rgba(255, 255, 255, 0.1); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s; padding: 0; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; margin-left: 5px; color: white; font-size: 0.875rem; }
.btn-close-elegant-chat:hover { background-color: rgba(255, 69, 0, 0.8); transform: scale(1.05); border-color: white; }

/* ======================== CHAT GLOBAL E PESQUISA ======================== */
.chat-global-btns { padding: 0.5rem; background-color: #f9fafb; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; }
.btn-group-full { display: flex; width: 100%; gap: 0.5rem; }
.btn-dinamico-topo { width: 100%; background: linear-gradient(to right, #ea580c, #dc2626, #000000); color: white; font-weight: bold; padding: 0.5rem; border-radius: 0.375rem; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid #f97316; box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: transform 0.2s; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 0.25rem;}
.btn-dinamico-topo:hover { transform: scale(1.02); }
@media(min-width: 640px) { .btn-dinamico-topo { font-size: 13px; } }

.search-container { padding: 0.5rem; background-color: #f9fafb; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; }
.search-input-wrapper { position: relative; }
.search-icon-left { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.user-search-input { width: 100%; background-color: white; border: 1px solid #d1d5db; border-radius: 9999px; padding: 0.375rem 0.75rem 0.375rem 2.25rem; font-size: 0.875rem; transition: border-color 0.2s; font-weight: normal; outline: none; box-sizing: border-box; }
.user-search-input:focus { border-color: #f97316; }

.online-count-header { padding: 0.75rem; background-color: white; font-size: 0.75rem; font-weight: 600; color: #6b7280; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0,0,0,0.05); z-index: 10; position: relative; flex-shrink: 0; }
.online-count-left { display: flex; align-items: center; gap: 0.5rem; }
.online-count-icon { font-size: 1.125rem; }
.online-count-text { color: #ea580c; font-weight: bold; }

.user-list-wrapper { flex-grow: 1; overflow-y: auto; background-color: white; }
.loading-text { padding: 1rem; text-align: center; color: #9ca3af; font-size: 0.875rem; }

/* ======================== CHAT USUÁRIOS E BOLHAS ======================== */
.user-list-item-chat { display: flex; align-items: center; padding: 12px 15px; border-bottom: 1px solid var(--border-color-chat); cursor: pointer; transition: background 0.2s; position: relative; }
.user-list-item-chat:hover { background-color: var(--bg-hover-chat); }
.avatar-chat { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid white; box-shadow: 0 0 0 2px var(--border-color-chat); }
.avatar-chat.online-chat { box-shadow: 0 0 0 2px #10b981; }
.fire-border-chat { border: 2px solid transparent !important; box-shadow: none !important; background: linear-gradient(white, white) padding-box, linear-gradient(135deg, #ff4500, #000000) border-box; }

.status-dot-chat { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot-chat.online-chat { background-color: #10b981; }
.status-dot-chat.offline-chat { background-color: #9ca3af; }

.message-wrapper-chat { display: flex; margin-bottom: 24px; position: relative; align-items: flex-start; gap: 12px; width: 100%; }
.message-wrapper-chat.sent-chat { flex-direction: row-reverse; }
.message-bubble-chat { flex-grow: 1; width: 100%; max-width: 85%; padding: 10px 14px 6px 14px; border-radius: 12px; position: relative; font-size: 0.95rem; line-height: 1.5; word-wrap: break-word; border: 1px solid var(--border-color-chat); display: flex; flex-direction: column; font-weight: normal !important; }
.message-wrapper-chat.received-chat .message-bubble-chat { background-color: var(--bubble-received-chat); border-top-left-radius: 2px; }
.message-wrapper-chat.sent-chat .message-bubble-chat { background-color: var(--bubble-sent-chat); border-top-right-radius: 2px; border-color: #fed7aa; }

.msg-reaction-chat { position: absolute; bottom: -12px; left: 10px; background: white; border: 1px solid var(--border-color-chat); border-radius: 20px; padding: 2px 6px; font-size: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); display: flex; align-items: center; justify-content: center; z-index: 5; }
.msg-options-btn-chat { position: absolute; top: 6px; right: 6px; cursor: pointer; color: var(--text-muted-chat); padding: 4px; border-radius: 4px; transition: all 0.2s; z-index: 2; }
.msg-options-btn-chat:hover { background-color: rgba(0,0,0,0.05); color: var(--text-main-chat); }
.msg-menu-chat { position: absolute; top: 30px; right: 5px; background: white; border: 1px solid var(--border-color-chat); border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); display: none; flex-direction: column; z-index: 20; min-width: 150px; overflow: hidden; }
.msg-menu-chat.show-chat { display: flex; }
.msg-menu-item-chat { padding: 8px 15px; display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-main-chat); cursor: pointer; transition: background 0.2s; }
.msg-menu-item-chat:hover { background-color: var(--bg-hover-chat); color: var(--primary-chat); }
.msg-menu-item-chat.delete-item { color: #ef4444; }
.msg-menu-item-chat.delete-item:hover { background-color: #fef2f2; color: #dc2626; }
.menu-divider-chat { width: 100%; height: 1px; background-color: var(--border-color-chat); }
.reaction-bar-chat { display: flex; justify-content: space-between; padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid var(--border-color-chat); }
.reaction-btn-chat { cursor: pointer; font-size: 16px; transition: transform 0.2s; }
.reaction-btn-chat:hover { transform: scale(1.2); }

.msg-meta-chat { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: 0.65rem; color: var(--text-muted-chat); font-weight: normal; margin-top: 6px; width: 100%; }
.msg-content-chat { display: flex; flex-direction: column; gap: 8px; font-weight: normal; color: #1f2937; }

/* ======================== MEDIAS NA BOLHA ======================== */
.msg-media-container-chat { width: 100%; max-height: 200px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 1px solid rgba(0,0,0,0.1); position: relative; margin-top: 0.5rem; }
.msg-media-container-chat img, .msg-media-container-chat video { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-media-overlay-chat { position: absolute; inset: 0; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; color: white; font-size: 2rem; opacity: 0; transition: opacity 0.2s; }
.msg-media-container-chat:hover .msg-media-overlay-chat { opacity: 1; }
.msg-media-audio-chat { width: 100%; padding: 0px 8px; background-color: rgba(0,0,0,0.05); border-radius: 20px; display: flex; align-items: center; border: 1px solid var(--border-color-chat); margin-top: 4px; height: 34px; }
.msg-media-audio-chat audio { width: 100%; height: 28px; outline: none; }
.msg-media-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #f3f4f6; padding: 1rem; max-width: 100%; box-sizing: border-box; }
.pdf-name-text { font-size: 0.75rem; font-weight: bold; color: #374151; width: 100%; text-align: center; word-wrap: break-word; white-space: normal; word-break: break-all; margin-top: 0.5rem; }

/* ======================== LIGHTBOX DE MÍDIA ======================== */
#mediaLightbox-chat { display: none; position: fixed; inset: 0; background: #000; z-index: 1000000; align-items: center; justify-content: center; padding: 0; border: none; }
#mediaLightbox-chat.show-chat { display: flex; }
.lightbox-inner-chat { position: relative; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; border: none; margin: 0; padding: 0; background: transparent;}
#lightboxContent-chat { width: 100vw; height: 100vh; object-fit: cover; border-radius: 0; box-shadow: none; background: transparent; border: none; margin: 0; padding: 0; outline: none; }
iframe#lightboxContent-chat { background: #fff; object-fit: fill; }
@media (min-width: 769px) {
    #lightboxContent-chat { height: 100vh; width: auto; max-width: 100vw; object-fit: contain; }
    iframe#lightboxContent-chat { width: 75vw; max-width: 1200px; height: 100vh; }
}
.btn-close-lightbox-chat { position: absolute; top: 30px; right: 30px; background: rgba(0, 0, 0, 0.6); color: white; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; transition: all 0.2s; border: 2px solid rgba(255,255,255,0.4); z-index: 100001; }
.btn-close-lightbox-chat:hover { background: #ef4444; border-color: white; transform: scale(1.1); }

/* ======================== CSS NORMAL DA CAIXA DE PUBLICAÇÃO E MODAIS DE CRIAÇÃO ======================== */
.ead-invisible-scrollbar { 
    scrollbar-width: none !important; 
    -ms-overflow-style: none !important; 
}
.ead-invisible-scrollbar::-webkit-scrollbar { 
    display: none !important; 
    width: 0 !important; 
    height: 0 !important; 
    background: transparent !important; 
    -webkit-appearance: none !important;
}

.ead-hidden { display: none !important; }

/* Caixa Principal do Topo (Criar Publicação) */
.ead-pub-wrapper {
    display: flex !important; flex-direction: column !important; width: 100% !important; gap: 0.75rem !important;
    overflow: hidden !important; min-width: 0 !important; flex-grow: 1 !important; padding: 0 !important; margin-bottom: 2rem !important;
}
@media (min-width: 768px) {
    .ead-pub-wrapper { gap: 1rem !important; margin-top: -1.75rem !important; }
}
@media (max-width: 767px) {
    .ead-pub-wrapper { margin-top: -1.75rem !important; }
}

.ead-pub-box {
    width: 100%; background-color: #ffffff; 
    display: flex; align-items: center; gap: 0.75rem;
    margin-top: 1.75rem; margin-bottom: 0.5rem;
}
.dark .ead-pub-box { background-color: #111827; }

@media (max-width: 767px) {
    .ead-pub-box { 
        border: none !important; 
        box-shadow: none !important; 
        border-radius: 0 !important; 
        padding: 0.75rem 1rem !important; 
    }
}
@media (min-width: 768px) {
    .ead-pub-box { 
        border: 1px solid #e5e7eb !important; 
        box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05) !important;
        border-radius: 0.75rem !important; 
        padding: 1rem !important; 
    }
    .dark .ead-pub-box { border-color: #374151 !important; }
}

.ead-pub-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid #e5e7eb; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.dark .ead-pub-avatar { border-color: #374151; }
@media (min-width: 640px) { .ead-pub-avatar { width: 3rem; height: 3rem; } }

.ead-pub-input-fake {
    flex: 1; background-color: #f3f4f6; border-radius: 9999px; padding: 0.625rem 1rem; cursor: pointer;
    color: #6b7280; font-size: 0.875rem; border: 1px solid transparent; transition: all 0.2s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dark .ead-pub-input-fake { background-color: #1f2937; color: #9ca3af; }
.ead-pub-input-fake:hover { background-color: #e5e7eb; border-color: #d1d5db; }
.dark .ead-pub-input-fake:hover { background-color: #374151; border-color: #4b5563; }
@media (min-width: 640px) { .ead-pub-input-fake { padding-top: 0.75rem; padding-bottom: 0.75rem; font-size: 1rem; } }

.ead-pub-media-btn {
    width: 2.5rem; height: 2.5rem; background-color: #f3f4f6; border-radius: 50%; color: #22c55e;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0;
    border: none; cursor: pointer;
}
.dark .ead-pub-media-btn { background-color: #1f2937; }
.ead-pub-media-btn:hover { background-color: #f0fdf4; }
.dark .ead-pub-media-btn:hover { background-color: rgba(20,83,45,0.3); }
@media (min-width: 640px) { .ead-pub-media-btn { width: 3rem; height: 3rem; } }
.ead-pub-media-icon { font-size: 1.125rem; transition: transform 0.2s; }
@media (min-width: 640px) { .ead-pub-media-icon { font-size: 1.25rem; } }
.ead-pub-media-btn:hover .ead-pub-media-icon { transform: scale(1.1); }

.ead-pub-spacer { width: 100%; margin-top: 1rem; height: 10px; visibility: hidden; }

/* FEED CONTAINER */
.ead-feed-container {
    width: 100% !important; display: flex !important; flex-direction: column !important; gap: 0.75rem !important;
    margin-top: -2.5rem !important; padding-bottom: 0.75rem !important; padding-left: 0 !important; padding-right: 0 !important;
}
@media (min-width: 640px) { .ead-feed-container { gap: 1.25rem !important; } }

.ead-feed-container > div { width: 100% !important; background-color: #ffffff !important; }
.dark .ead-feed-container > div { background-color: #111827 !important; }

@media (max-width: 767px) {
    .ead-feed-container > div { border: none !important; box-shadow: none !important; border-radius: 0 !important; }
}
@media (min-width: 768px) {
    .ead-feed-container > div { border: 1px solid #e5e7eb !important; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important; border-radius: 0.75rem !important; overflow: hidden !important; }
    .dark .ead-feed-container > div { border-color: #374151 !important; }

    /* AJUSTE RESPONSIVO NOTEBOOKS/COMPUTADORES: Mídia (imagem/vídeo/pdf/youtube) encostada nas margens do card */
    .post-card {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .post-card > .post-header,
    .post-card > .post-content,
    .post-card > .post-stats,
    .post-card > .post-actions {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    .post-card .post-media,
    .post-media {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }
    .post-media img,
    .post-media video,
    .post-media iframe,
    .post-media embed {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        object-fit: cover !important;
        display: block !important;
        box-sizing: border-box !important;
    }
}

/* COMPUTADORES GRANDES DE MESA (min-width: 1280px): Preenchimento Total das Margens */
@media (min-width: 1280px) {
    .post-media img {
        width: 100% !important;
        height: auto !important;
        max-height: 85vh !important;
        object-fit: cover !important;
        object-position: center !important;
    }
}

/* AJUSTE RESPONSIVO DOS BOTÕES CURTIR E COMENTAR EM TELAS MENORES */
.post-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.post-actions .action-btn {
    transition: all 0.2s ease;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    .post-actions .action-btn {
        padding: 7px 8px !important;
        font-size: 12px !important;
        gap: 4px !important;
        line-height: 1.1 !important;
        height: auto !important;
        min-height: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .post-actions .action-btn i {
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .post-actions .action-btn {
        padding: 7px 6px !important;
        font-size: 11px !important;
        gap: 3px !important;
        line-height: 1 !important;
        height: auto !important;
        min-height: 0 !important;
    }
    .post-actions .action-btn i {
        font-size: 11px !important;
    }
}

.ead-feed-container-raw > div { border: none !important; box-shadow: none !important; border-radius: 0 !important; width: 100% !important; }
@media (min-width: 768px) {
    .ead-feed-container-raw > div { border: 1px solid #e5e7eb !important; border-radius: 0.75rem !important; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important; }
    .dark .ead-feed-container-raw > div { border-color: #374151 !important; }
}

/* Modal Criação Publicação */
.ead-cpub-overlay {
    position: fixed; inset: 0; z-index: 999999999999;
    background-color: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 0; font-family: sans-serif; overflow: hidden;
    transition: opacity 0.075s;
}
@media (min-width: 640px) { .ead-cpub-overlay { align-items: center; } }

.ead-cpub-box {
    background-color: #ffffff; width: 100%; display: flex; flex-direction: column; overflow: hidden;
    height: 100dvh; transform: scale(0.95); transition: transform 0.075s; border: none;
}
.dark .ead-cpub-box { background-color: #111827; }
@media (min-width: 640px) {
    .ead-cpub-box {
        max-width: 36rem; border-radius: 1rem; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
        height: auto; max-height: 85vh; border: 1px solid #e5e7eb; margin-top: auto; margin-bottom: auto;
    }
    .dark .ead-cpub-box { border-color: #374151; }
}

.ead-cpub-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; width: 100%; }

/* Header Modal Criação */
.ead-cpub-header {
    position: relative; width: 100%; padding: 1.25rem 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    background: linear-gradient(to bottom, #000000, #450a0a, #9a3412);
    border-bottom: 1px solid #1f2937; flex-shrink: 0; box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.06);
}
@media (min-width: 640px) { .ead-cpub-header { border-top-left-radius: 1rem; border-top-right-radius: 1rem; } }

.ead-cpub-close-btn { position: absolute; top: 0.75rem; right: 0.75rem; width: 2rem; height: 2rem; border-radius: 50%; background-color: rgba(0,0,0,0.5); color: #ffffff; display: flex; align-items: center; justify-content: center; z-index: 10; border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); cursor: pointer; transition: background-color 0.2s; }
.ead-cpub-close-btn:hover { background-color: #dc2626; }
.ead-cpub-close-icon { font-size: 0.875rem; }

.ead-cpub-header-icon-wrap { width: 2.5rem; height: 2.5rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; background-color: rgba(0,0,0,0.4); border: 1px solid #f97316; margin-bottom: 0.25rem; box-shadow: 0 0 15px rgba(249,115,22,0.5); }
.ead-cpub-header-icon { font-size: 1.125rem; color: #fb923c; }

.ead-cpub-title { font-size: 1.125rem; font-weight: 900; color: #ffffff; letter-spacing: 0.1em; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,0.05); line-height: 1; margin: 0; }
@media (min-width: 640px) { .ead-cpub-title { font-size: 1.25rem; } }
.ead-cpub-subtitle { font-size: 10px; color: rgba(254,215,170,0.8); margin-top: 0.25rem; max-width: 24rem; line-height: 1.25; margin-bottom: 0; }
@media (min-width: 640px) { .ead-cpub-subtitle { font-size: 0.75rem; } }

/* Corpo Modal Criação */
.ead-cpub-body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.75rem; background-color: #ffffff; flex: 1; }
.dark .ead-cpub-body { background-color: #111827; }
@media (min-width: 640px) { .ead-cpub-body { padding: 1.25rem; } }

.ead-cpub-user-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.5rem; flex-shrink: 0; }
.ead-cpub-user-info { display: flex; align-items: center; gap: 0.75rem; }
.ead-cpub-user-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; border: 1px solid #fb923c; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); flex-shrink: 0; }
.ead-cpub-user-details { display: flex; flex-direction: column; }
.ead-cpub-user-name { font-weight: 700; color: #1f2937; font-size: 0.875rem; }
.dark .ead-cpub-user-name { color: #ffffff; }

.ead-cpub-priv-btn {
    margin-top: 0.25rem; display: flex; align-items: center; gap: 0.375rem; width: fit-content;
    background: linear-gradient(to right, #ffedd5, #fff7ed); color: #c2410c;
    border: 1px solid #fdba74; padding: 0.375rem 0.75rem; border-radius: 0.375rem;
    transition: all 0.2s; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); cursor: pointer;
}
.dark .ead-cpub-priv-btn { background: linear-gradient(to right, rgba(124,45,18,0.3), #1f2937); color: #fb923c; border-color: rgba(194,65,12,0.5); }
.ead-cpub-priv-btn:hover { transform: scale(1.05); }
.ead-cpub-priv-icon { font-size: 10px; }
.ead-cpub-priv-text { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.025em; }
@media (min-width: 640px) { .ead-cpub-priv-icon, .ead-cpub-priv-text { font-size: 0.75rem; } }

/* Barra de Ferramentas Edição */
.ead-cpub-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; background-color: #f9fafb;
    padding: 0.25rem; border-radius: 0.5rem; border: 1px solid #e5e7eb; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    width: 100%; margin-top: 0.5rem; flex-shrink: 0;
}
.dark .ead-cpub-toolbar { background-color: #1f2937; border-color: #374151; }
@media (min-width: 640px) { .ead-cpub-toolbar { gap: 0.375rem; padding: 0.375rem; } }

.ead-cpub-tool-btn {
    width: 1.5rem; height: 1.5rem; background-color: #ffffff; border-radius: 0.25rem; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    color: #1f2937; font-weight: 700; transition: background-color 0.2s; font-size: 0.75rem;
    display: flex; align-items: center; justify-content: center; cursor: pointer; border: none;
}
.dark .ead-cpub-tool-btn { background-color: #374151; color: #ffffff; }
.ead-cpub-tool-btn:hover { background-color: #f3f4f6; }
@media (min-width: 640px) { .ead-cpub-tool-btn { width: 1.75rem; height: 1.75rem; font-size: 0.875rem; } }

.ead-cpub-tool-btn-italic { font-style: italic; font-family: serif; }
.ead-cpub-tool-div { width: 1px; height: 1rem; background-color: #d1d5db; margin: 0 0.125rem; }
.dark .ead-cpub-tool-div { background-color: #4b5563; }
@media (min-width: 640px) { .ead-cpub-tool-div { height: 1.25rem; } }

.ead-cpub-tool-btn-color { position: relative; color: #f97316; }
.ead-cpub-color-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

.ead-cpub-emoji-wrap { position: relative; margin-left: auto; }

/* =========================================================================
   MODAL DE EMOJIS (MODIFICADA: Esquerda, Subindo e Muito Compacta)
   ========================================================================= */
.ead-cpub-emoji-picker {
    position: absolute; 
    bottom: 100%; /* Sobe a partir do botão */
    right: 0; /* Prende na direita do botão para crescer pro lado ESQUERDO da tela */
    left: auto; 
    margin-bottom: 0.5rem; /* Um leve distanciamento do botão */
    width: 180px; /* Largura super compacta */
    background-color: #ffffff; 
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem; 
    box-shadow: 0 -5px 15px rgba(0,0,0,0.15); 
    padding: 4px; 
    z-index: 9999;
}
.dark .ead-cpub-emoji-picker { background-color: #1f2937; border-color: #374151; }

.ead-emoji-modal-grid {
    display: grid; 
    grid-template-columns: repeat(6, 1fr); /* 6 emojis colados por linha */
    gap: 2px; /* Super compactos */
    max-height: 8rem; 
    overflow-y: auto;
}

.ead-emoji-item { 
    font-size: 16px; /* Emojis pequenos */
    border-radius: 0.25rem; 
    padding: 2px; 
    transition: transform 0.1s, background-color 0.2s; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    background: none; 
    border: none; 
    user-select: none;
}
.ead-emoji-item:hover { background-color: #e5e7eb; transform: scale(1.3); }
.dark .ead-emoji-item:hover { background-color: #374151; }

/* Área de Texto / Preview */
.ead-cpub-editor-area { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; padding-right: 0.25rem; }
.ead-cpub-textarea { width: 100%; display: block; min-height: 30px; outline: none; color: #1f2937; font-size: 0.875rem; resize: none; cursor: text; padding: 0 0.25rem; flex-shrink: 0; border: none; background: transparent; }
.dark .ead-cpub-textarea { color: #f3f4f6; }
@media (min-width: 640px) { .ead-cpub-textarea { font-size: 1rem; } }

.ead-cpub-preview-wrap { width: 100%; position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; border: none; border-radius: 0.75rem; overflow: hidden; transition: all 0.2s; padding: 0; flex-shrink: 0; }
.ead-cpub-preview-close { position: absolute; top: 0.5rem; right: 0.5rem; width: 1.75rem; height: 1.75rem; background-color: rgba(220,38,38,0.9); color: #ffffff; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); transition: transform 0.2s; z-index: 20; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; }
.ead-cpub-preview-close:hover { transform: scale(1.1); }

.ead-cpub-add-photo-wrap { position: absolute; top: 0.5rem; left: 0.5rem; z-index: 20; }
.ead-cpub-add-photo-btn { background-color: rgba(0,0,0,0.7); color: #ffffff; font-size: 11px; font-weight: 700; padding: 0.375rem 0.625rem; border-radius: 0.5rem; display: flex; align-items: center; gap: 0.375rem; border: 1px solid rgba(255,255,255,0.2); transition: all 0.2s; backdrop-filter: blur(4px); cursor: pointer; }
.ead-cpub-add-photo-btn:hover { background-color: #ea580c; }

.ead-cpub-preview-content { width: 100%; display: flex; align-items: flex-start; justify-content: flex-start; border-radius: 0.75rem; overflow: hidden; background-color: transparent; flex-shrink: 0; }

/* Footer Modal Criação */
.ead-cpub-footer { padding: 0.75rem 1rem; background-color: #f9fafb; border-top: 1px solid #e5e7eb; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 0.75rem; flex-shrink: 0; padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
.dark .ead-cpub-footer { background-color: #1f2937; border-top-color: #374151; }
@media (min-width: 640px) { .ead-cpub-footer { flex-direction: row; gap: 0; } }

.ead-cpub-media-actions { display: flex; items: center; justify-content: center; gap: 0.75rem; width: 100%; }
@media (min-width: 640px) { .ead-cpub-media-actions { justify-content: flex-start; width: auto; } }

.ead-cpub-file-input { display: none; }
.ead-cpub-action-btn-img { width: 2rem; height: 2rem; border-radius: 50%; background: linear-gradient(to bottom right, #f97316, #dc2626); color: #ffffff; display: flex; align-items: center; justify-content: center; transition: all 0.2s; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); border: none; cursor: pointer; }
@media (min-width: 640px) { .ead-cpub-action-btn-img { width: 2.5rem; height: 2.5rem; } }
.ead-cpub-action-btn-img:hover { transform: scale(1.05); box-shadow: 0 10px 15px -3px rgba(249,115,22,0.2); }

.ead-cpub-action-btn-yt { width: 2rem; height: 2rem; border-radius: 50%; background: linear-gradient(to bottom right, #dc2626, #000000); color: #ffffff; display: flex; align-items: center; justify-content: center; transition: all 0.2s; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); border: none; cursor: pointer; }
@media (min-width: 640px) { .ead-cpub-action-btn-yt { width: 2.5rem; height: 2.5rem; } }
.ead-cpub-action-btn-yt:hover { transform: scale(1.05); box-shadow: 0 10px 15px -3px rgba(220,38,38,0.2); }

.ead-cpub-submit-btn { width: 100%; background: linear-gradient(to right, #f97316, #dc2626); color: #ffffff; font-weight: 900; letter-spacing: 0.1em; padding: 0.625rem 1.25rem; border-radius: 0.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-shrink: 0; border: 1px solid rgba(248,113,113,0.5); font-size: 0.875rem; cursor: pointer; }
@media (min-width: 640px) { .ead-cpub-submit-btn { width: auto; padding-top: 0.5rem; padding-bottom: 0.5rem; } }
.ead-cpub-submit-btn:hover { background: linear-gradient(to right, #dc2626, #c2410c); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); transform: translateY(-0.125rem); }

/* Modal Privacidade */
.ead-priv-overlay {
    position: fixed; inset: 0; display: flex; justify-content: flex-end; opacity: 0; pointer-events: none;
    transition: opacity 0.075s; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 999999999999 !important;
}
.ead-priv-box {
    width: 100%; background-color: #ffffff; height: 100%; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transform: translateX(100%); transition: transform 0.075s; display: flex; flex-direction: column; border-left: 1px solid rgba(255,255,255,0.2);
}
@media (min-width: 640px) { .ead-priv-box { width: 24rem; } }
.dark .ead-priv-box { background-color: #111827; }

.ead-priv-header { padding: 1.25rem; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; background-color: #f9fafb; }
.dark .ead-priv-header { border-bottom-color: #374151; background-color: #1f2937; }
.ead-priv-title { font-size: 1.125rem; font-weight: 700; color: #1f2937; display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.dark .ead-priv-title { color: #ffffff; }
.ead-priv-close { color: #6b7280; font-size: 1.5rem; outline: none; background: none; border: none; cursor: pointer; transition: color 0.2s; }
.ead-priv-close:hover { color: #ef4444; }

.ead-priv-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; flex: 1; overflow-y: auto; }

.ead-priv-label { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; border: 1px solid #e5e7eb; border-radius: 0.75rem; cursor: pointer; transition: background-color 0.2s; }
.dark .ead-priv-label { border-color: #374151; }
.ead-priv-label:hover { background-color: #f9fafb; }
.dark .ead-priv-label:hover { background-color: #1f2937; }
.ead-priv-radio { width: 1.25rem; height: 1.25rem; color: #f97316; accent-color: #f97316; }
.ead-priv-text-wrap { display: flex; flex-direction: column; }
.ead-priv-opt-title { font-weight: 700; color: #1f2937; display: flex; align-items: center; gap: 0.375rem; }
.dark .ead-priv-opt-title { color: #ffffff; }
.ead-priv-opt-desc { font-size: 0.75rem; color: #6b7280; }

.ead-priv-friends-box { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.25rem; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 0.625rem; background-color: #f9fafb; }
.dark .ead-priv-friends-box { border-color: #374151; background-color: #1f2937; }
.ead-priv-friends-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0.375rem; border-bottom: 1px solid #e5e7eb; }
.dark .ead-priv-friends-head { border-bottom-color: #4b5563; }
.ead-priv-friends-title { font-weight: 700; font-size: 0.75rem; color: #374151; }
.dark .ead-priv-friends-title { color: #ffffff; }
.ead-priv-friends-btn { font-size: 10px; background-color: #e5e7eb; color: #1f2937; padding: 0.125rem 0.5rem; border-radius: 0.25rem; transition: all 0.2s; border: none; cursor: pointer; }
.dark .ead-priv-friends-btn { background-color: #374151; color: #ffffff; }
.ead-priv-friends-btn:hover { background-color: #f97316; color: #ffffff; }

.ead-priv-search-wrap { position: relative; width: 100%; margin: 0.25rem 0; }
.ead-priv-search-icon { position: absolute; top: 0; bottom: 0; left: 0; display: flex; align-items: center; padding-left: 0.625rem; pointer-events: none; color: #9ca3af; font-size: 0.75rem; }
.ead-priv-search-input { width: 100%; background-color: #ffffff; border: 1px solid #d1d5db; border-radius: 0.5rem; padding: 0.25rem 0.625rem 0.25rem 2rem; font-size: 0.75rem; color: #1f2937; outline: none; transition: border-color 0.2s; }
.dark .ead-priv-search-input { background-color: #374151; border-color: #4b5563; color: #ffffff; }
.ead-priv-search-input:focus { border-color: #f97316; }

.ead-priv-friends-list { display: flex; flex-direction: column; gap: 0.25rem; max-height: 10rem; overflow-y: auto; }
.ead-priv-loading-friends { font-size: 0.75rem; text-align: center; color: #6b7280; padding: 0.75rem 0; }

.ead-priv-section-title { font-size: 0.75rem; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.25rem; margin-top: 0.5rem; }
.dark .ead-priv-section-title { border-bottom-color: #374151; }

.ead-priv-album-box { display: flex; flex-direction: column; gap: 0.375rem; padding: 0.75rem; border: 1px solid #e5e7eb; border-radius: 0.75rem; background-color: #f9fafb; transition: all 0.2s; }
.dark .ead-priv-album-box { border-color: #374151; background-color: #1f2937; }
.ead-priv-album-title { font-size: 0.75rem; font-weight: 700; color: #374151; display: flex; align-items: center; gap: 0.25rem; }
.dark .ead-priv-album-title { color: #d1d5db; }
.ead-priv-album-select { width: 100%; background-color: #e5e7eb; border: 1px solid #d1d5db; border-radius: 0.5rem; padding: 0.5rem 0.625rem; font-size: 0.75rem; color: #1f2937; outline: none; cursor: pointer; }
.dark .ead-priv-album-select { background-color: #1e293b; border-color: #475569; color: #ffffff; }
.ead-priv-album-select:focus { border-color: #f97316; }

.ead-priv-footer { padding: 1.25rem; border-top: 1px solid #e5e7eb; background-color: #f9fafb; }
.dark .ead-priv-footer { border-top-color: #374151; background-color: #1f2937; }
.ead-priv-submit { width: 100%; background: linear-gradient(to right, #f97316, #dc2626); color: #ffffff; font-weight: 900; letter-spacing: 0.1em; padding: 0.75rem 2rem; border-radius: 0.75rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 0.875rem; border: 1px solid #f87171; cursor: pointer; }
.ead-priv-submit:hover { background: linear-gradient(to right, #dc2626, #c2410c); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); transform: translateY(-0.25rem); }

/* Estilos dinâmicos p/ lista de amigos gerada por JS */
.ead-amigo-lbl { display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem; background-color: #ffffff; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); border: 1px solid #ffedd5; border-radius: 0.75rem; cursor: pointer; transition: all 0.3s; }
.dark .ead-amigo-lbl { background-color: #1f2937; border-color: rgba(124,45,18,0.3); }
.ead-amigo-lbl:hover { background: linear-gradient(to right, #fff7ed, #ffedd5); transform: scale(1.01); }
.dark .ead-amigo-lbl:hover { background: linear-gradient(to right, #374151, rgba(124,45,18,0.4)); }
.ead-amigo-chk { width: 1rem; height: 1rem; color: #f97316; accent-color: #f97316; border-radius: 0.25rem; cursor: pointer; flex-shrink: 0; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.ead-amigo-img { width: 1.75rem; height: 1.75rem; border-radius: 50%; object-fit: cover; border: 2px solid #fed7aa; flex-shrink: 0; background-color: #f3f4f6; }
@media (min-width: 640px) { .ead-amigo-img { width: 2rem; height: 2rem; } }
.dark .ead-amigo-img { border-color: rgba(194,65,12,0.5); }
.ead-amigo-name { font-size: 11px; font-weight: 700; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; line-height: 1.25; }
@media (min-width: 640px) { .ead-amigo-name { font-size: 0.75rem; } }
.dark .ead-amigo-name { color: #e5e7eb; }