/* Página Comunidade (community.js): conversa única */
.community-page .primary,.community-page .secondary{margin-top:0}
.community-page .secondary{width:auto;padding:9px 14px}

/* Faixa de prévia (só administradores, com a Comunidade fechada) */
.community-preview{display:flex;align-items:center;gap:14px;margin-bottom:20px;padding:14px 18px;border:1px solid var(--info-border);background:var(--info-soft);border-radius:12px}
.community-preview[hidden]{display:none}
.community-preview p{flex:1;font-size:14px;line-height:1.6;color:var(--ink-2)}
.community-preview-icon{display:grid;place-items:center;width:34px;height:34px;flex-shrink:0;border-radius:9px;background:var(--surface);color:var(--info)}
.community-preview-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.community-preview-actions .text-button{color:var(--info)}

/* "Em breve" (tela dos alunos) */
.community-soon{display:flex;flex-direction:column;align-items:center;text-align:center;padding:44px 28px 36px}
.community-soon[hidden]{display:none}
.community-soon-art svg{display:block;width:132px;height:auto}
.community-soon-badge{margin-top:18px;font-size:12px;font-weight:700;letter-spacing:1.4px;text-transform:uppercase;color:var(--warn);background:var(--warn-soft);border-radius:999px;padding:5px 12px}
.community-soon h2{font-size:24px;letter-spacing:-.6px;margin-top:14px}
.community-soon-lead{max-width:540px;margin-top:10px;font-size:15px;line-height:1.75;color:var(--muted)}
.community-soon-list{list-style:none;padding:0;margin:28px 0 0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;width:100%;max-width:860px;text-align:left}
.community-soon-list li{display:flex;gap:12px;align-items:flex-start;padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
.community-soon-list strong{display:block;font-size:14px;color:var(--ink)}
.community-soon-list span:not(.community-soon-icon){display:block;font-size:13px;line-height:1.6;color:var(--muted);margin-top:4px}
.community-soon-icon{display:grid;place-items:center;width:34px;height:34px;flex-shrink:0;border-radius:9px;background:var(--brand-soft);color:var(--brand-text)}
.community-soon-icon .icon{width:18px;height:18px}
.community-soon-foot{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;margin-top:28px;padding-top:22px;border-top:1px solid var(--line);width:100%;max-width:860px}
.community-soon-foot p{font-size:14px;color:var(--muted)}
.community-soon-foot .icon{width:16px;height:16px}
.community-status-card[hidden],.community-layout[hidden]{display:none}

/* Conversa + coluna lateral */
.community-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;align-items:start}
.community-chat{position:relative;display:flex;flex-direction:column;padding:0;overflow:hidden;height:calc(100vh - 300px);min-height:460px}
.community-preview:not([hidden])~.community-layout .community-chat{height:calc(100vh - 400px)}
.community-chat-head{display:flex;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid var(--line)}
.community-chat-head>div{flex:1;min-width:0}
.community-chat-head h2{font-size:16px}
.community-chat-head p{font-size:12px;color:var(--muted-2);margin-top:2px}
.community-chat-icon{display:grid;place-items:center;width:36px;height:36px;flex-shrink:0;border-radius:10px;background:var(--brand-soft);color:var(--brand-text)}
.community-chat-icon .icon{width:19px;height:19px}
.community-rules-button{display:none}
.community-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:10px 18px 16px;background:var(--surface-2)}
.community-messages:focus-visible{outline:3px solid var(--focus);outline-offset:-3px}
.community-older-wrap{display:flex;justify-content:center}
.community-older-wrap .text-button{font-size:13px;margin:4px 0 6px}
.community-older-wrap .text-button[hidden]{display:none}
.community-feed{display:flex;flex-direction:column}
.community-loading{text-align:center;font-size:14px;color:var(--muted);padding:30px 0}

.community-day{display:flex;justify-content:center;margin:16px 0 4px}
.community-day span{font-size:11.5px;font-weight:600;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:3px 10px}
.community-msg{display:flex;margin-top:10px}
.community-msg.is-grouped{margin-top:3px}
.community-msg.is-mine{justify-content:flex-end}
.community-bubble{max-width:min(78%,560px);min-width:90px;background:var(--surface);border:1px solid var(--line);border-radius:14px 14px 14px 4px;padding:7px 12px 5px;transition:box-shadow .2s}
.is-mine .community-bubble{background:var(--brand-soft);border-color:color-mix(in srgb,var(--brand-border) 45%,var(--line));border-radius:14px 14px 4px 14px}
.is-team:not(.is-mine) .community-bubble{border-color:var(--info-border)}
.community-msg.is-flash .community-bubble{box-shadow:0 0 0 3px var(--focus)}
.community-msg-author{display:block;font-size:12px;font-weight:700;color:var(--brand-text);margin-bottom:2px}
.is-team .community-msg-author{color:var(--info)}
.community-msg-body{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14.5px;line-height:1.5;color:var(--ink)}
.community-msg-meta{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin-top:2px;font-size:11px;color:var(--muted-2)}
.community-msg-actions{display:none;gap:10px;align-items:center}
.community-msg:hover .community-msg-actions,.community-msg:focus-within .community-msg-actions,.community-msg.is-active .community-msg-actions{display:inline-flex}
.community-msg-actions button{font-size:11.5px;font-weight:600;color:var(--muted);padding:0}
.community-msg-actions button:hover{color:var(--brand-text);text-decoration:underline}
.community-msg-actions .danger,.community-msg-actions .danger:hover{color:var(--danger)}
.community-msg.is-removed .community-bubble{background:transparent;border-style:dashed}
.community-msg-removed{font-size:13px;font-style:italic;color:var(--muted-2)}
.community-msg.is-removed .community-msg-body{color:var(--muted)}
.community-quote{display:block;width:100%;text-align:left;border-left:3px solid var(--brand-border);background:color-mix(in srgb,var(--surface-3) 75%,transparent);border-radius:6px;padding:4px 8px;margin:2px 0 5px;font-size:12.5px;line-height:1.45;color:var(--muted)}
.community-quote strong{display:block;font-size:12px;color:var(--brand-text)}
.community-quote span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.community-quote.is-missing{font-style:italic}
.community-qchip{display:inline-flex;align-items:center;gap:6px;margin-top:6px;font-size:12.5px;font-weight:600;color:var(--ev-exam-text);background:var(--ev-exam-bg);border-radius:8px;padding:5px 9px;text-align:left}
.community-qchip .icon{width:15px;height:15px}
.community-qchip:hover{text-decoration:underline}

.community-empty-chat{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:48px 20px}
.community-empty-chat h3{font-size:17px}
.community-empty-chat p{max-width:380px;font-size:14px;line-height:1.7;color:var(--muted)}

.community-new-pill{position:absolute;left:50%;bottom:86px;transform:translateX(-50%);font-size:13px;font-weight:700;color:var(--on-brand);background:var(--brand);border-radius:999px;padding:7px 14px;box-shadow:0 6px 20px var(--shadow)}
.community-new-pill[hidden]{display:none}

.community-composer{border-top:1px solid var(--line);padding:10px 14px 12px;background:var(--surface)}
.community-attach{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
.community-attach[hidden]{display:none}
.community-attach-item{display:flex;align-items:center;gap:8px;font-size:13px;line-height:1.45;color:var(--muted);background:var(--surface-2);border-left:3px solid var(--brand-border);border-radius:6px;padding:6px 8px}
.community-attach-item>span{flex:1;min-width:0;overflow-wrap:anywhere}
.community-attach-item strong{color:var(--ink-2)}
.community-attach-item>.icon{width:16px;height:16px;color:var(--ev-exam-text);flex-shrink:0}
.community-attach-item button{display:grid;place-items:center;width:28px;height:28px;flex-shrink:0;border-radius:7px;color:var(--muted)}
.community-attach-item button:hover{background:var(--surface-3)}
.community-attach-item button .icon{width:15px;height:15px}
.community-composer-row{display:flex;align-items:flex-end;gap:10px}
.community-composer textarea{flex:1;min-width:0;resize:none;height:46px;min-height:46px;max-height:140px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface-2);color:var(--ink);font:400 15px/1.45 'DM Sans',sans-serif;padding:11px 13px}
.community-composer textarea:focus-visible{outline:3px solid var(--focus);outline-offset:1px}
.community-send{display:grid;place-items:center;width:46px;height:46px;flex-shrink:0;border-radius:12px;background:var(--lime);color:var(--on-accent);transition:background .2s}
.community-send:hover{background:var(--accent-hover)}
.community-send:disabled{opacity:.6}
.community-send .icon{width:20px;height:20px}
.community-composer-error{font-size:13px;line-height:1.5;color:var(--danger);margin-top:6px}
.community-composer-error:empty{display:none}

/* Coluna lateral: combinados e moderação */
.community-side{display:flex;flex-direction:column;gap:18px}
.community-rules h2,.community-mod h2{font-size:16px}
.community-rules-list{margin:12px 0 0;padding-left:20px;display:flex;flex-direction:column;gap:9px}
.community-rules-list li{font-size:13px;line-height:1.6;color:var(--muted)}
.community-rules-list li strong{color:var(--ink-2)}
#modal-content .community-rules-list li{font-size:15px}
.community-mod h3{font-size:14px;margin-top:16px}
.community-mod-state{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:12px}
.community-mod-stats{font-size:12px;color:var(--muted-2);margin-top:8px}
.community-mod-list{list-style:none;padding:0;margin:10px 0 0;display:flex;flex-direction:column;gap:12px}
.community-mod-item{border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:var(--surface-2);font-size:13px;line-height:1.55}
.community-mod-item small{color:var(--muted-2)}
.community-mod-text{color:var(--ink-2);margin-top:6px;overflow-wrap:anywhere;white-space:pre-wrap}
.community-mod-reasons{color:var(--muted);margin-top:6px}
.community-mod-details{color:var(--muted-2);margin-top:4px;font-style:italic;overflow-wrap:anywhere}
.community-mod-actions{display:flex;gap:14px;margin-top:8px}
.community-mod-actions .text-button{font-size:13px;padding:2px 0}
.community-mod-item .status-tag{margin-top:6px}

/* Janelas: questão anexada e denúncia */
.community-answer{margin-top:6px;font-size:14px}
.community-answer summary{cursor:pointer;font-weight:600;color:var(--brand-text);padding:4px 0}
.community-answer p{margin-top:6px;color:var(--ink-2)}
.community-reasons{border:0;padding:0;margin:0;display:flex;flex-direction:column;gap:9px}
.community-reasons .checkbox-label{display:flex;align-items:center;gap:10px;cursor:pointer;color:var(--ink-2);font-size:14px}
.community-report-form .community-reasons input[type=radio]{accent-color:var(--success);width:17px;height:17px;flex:none;margin:0;padding:0;border:0}
.community-report-form>p:first-child{font-size:14px;line-height:1.6}
.community-report-form .content-form-actions .primary{margin:0 0 0 auto}

/* Ponto de mensagens novas no menu e botão no Banco de Questões (enem.js) */
.nav-dot{width:8px;height:8px;border-radius:50%;background:var(--warn-strong);margin-left:auto;flex-shrink:0}
.nav-dot[hidden]{display:none}
.enem-discuss{margin-top:12px}
.enem-discuss .icon{width:16px;height:16px}

@media(max-width:1100px){
  .community-layout{grid-template-columns:minmax(0,1fr)}
  .community-rules-button{display:inline-flex}
  .community-side .community-rules{display:none}
}
@media(max-width:720px){
  .community-heading p{display:none}
  .community-heading{margin-bottom:14px}
  .community-preview{flex-direction:column;align-items:flex-start}
  .community-soon{padding:32px 18px 28px}
  .community-soon-list{grid-template-columns:minmax(0,1fr)}
  .community-chat{height:calc(100vh - 258px);height:calc(100dvh - 258px);min-height:380px}
  .community-chat-head{padding:12px 14px}
  .community-messages{padding:8px 12px 14px}
  .community-bubble{max-width:86%}
  .community-composer{padding:8px 10px 10px}
}
