/* Comunidade v4.35 — salas, suporte e tópicos em uma interface compacta. */
.community-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.community-actions-only { justify-content:flex-end; }
.community-actions-only .community-actions { width:100%; }
.profile-action { order:-1; }
.community-chat-button { position:relative; min-height:38px; padding:7px 11px; gap:7px; border-radius:9px; }
.community-unread-count { display:grid; min-width:18px; height:18px; padding:0 5px; place-items:center; color:#fff; background:#c8323e; border:2px solid var(--panel-surface); border-radius:10px; box-shadow:0 2px 7px rgb(84 11 20 / 28%); font:800 8px/1 var(--type-ui); }
.community-unread-count.hidden { display:none; }
.mobile-action-label { display:none; }
.community-action-icon,.community-modal-symbol { display:grid; place-items:center; width:22px; height:22px; color:#fff; background:#356fc1; border-radius:7px; font:800 12px var(--type-ui); }
.support-action .community-action-icon,.support-symbol { background:#d17b24; }
.topics-action .community-action-icon,.topics-symbol { background:#358b67; }

.community-modal,.chat-modal { display:flex; flex-direction:column; width:min(720px,92vw); height:min(720px,86svh); max-height:86svh; overflow:hidden; border-radius:14px; }
.community-modal-header { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:10px; min-height:66px; padding:11px 14px; background:var(--panel-surface); border-bottom:1px solid var(--line); }
.community-modal-title { display:flex; align-items:center; gap:10px; min-width:0; }
.community-modal-title h2 { margin:0; font:750 17px/1.2 var(--type-heading); }
.community-modal-title small { display:block; overflow:hidden; margin-top:2px; color:var(--text-muted); font:500 9px var(--type-ui); text-overflow:ellipsis; white-space:nowrap; }
.community-header-actions { display:flex; gap:6px; }
.community-icon-button { min-height:32px; padding:6px 9px; color:var(--text-accent); background:var(--canvas-soft); border:1px solid var(--line); border-radius:8px; cursor:pointer; font:700 9px var(--type-ui); }
.community-icon-button:hover { border-color:var(--navy-mid); }
.community-modal-header .modal-close {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    color: var(--text-accent);
    background: var(--canvas-soft);
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: 0 2px 8px rgb(5 15 36 / 10%);
    font: 700 23px/1 var(--type-ui);
}
.community-modal-header .modal-close:hover {
    color: #fff;
    background: var(--signal);
    border-color: var(--signal);
    transform: none;
}
.community-modal-header .modal-close:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
}

.chat-body { position:relative; display:flex; flex:1; min-height:0; flex-direction:column; padding:0; }
.chat-room-panel { position:absolute; z-index:4; top:0; left:0; width:min(280px,78%); max-height:65%; overflow:auto; background:var(--panel-surface); border:0 solid var(--line); border-width:0 1px 1px 0; border-radius:0 0 12px 0; box-shadow:var(--card-shadow); }
.chat-user-panel { position:absolute; z-index:5; top:0; right:0; width:min(340px,88%); max-height:72%; overflow:hidden; background:var(--panel-surface); border:0 solid var(--line); border-width:0 0 1px 1px; border-radius:0 0 0 12px; box-shadow:var(--card-shadow); }
.chat-user-panel > label { display:grid; gap:5px; padding:10px; border-bottom:1px solid var(--line); }
.chat-user-panel > label span { color:var(--text-muted); font:700 9px var(--type-ui); text-transform:uppercase; }
.chat-user-panel input { width:100%; padding:9px 10px; color:var(--text-main); background:var(--canvas-soft); border:1px solid var(--line); border-radius:8px; }
.chat-user-list { display:grid; max-height:360px; overflow:auto; padding:6px; }
.chat-user-list > button { display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:9px; width:100%; padding:8px; color:var(--text-main); text-align:left; background:transparent; border:0; border-radius:8px; cursor:pointer; }
.chat-user-list > button:hover { background:var(--choice-hover); }
.chat-user-list > button span:nth-child(2) { display:grid; min-width:0; }
.chat-user-list strong { font:700 11px var(--type-ui); }
.chat-user-list small { color:var(--text-muted); font-size:8px; }
.chat-user-list i { color:var(--text-accent); font:700 8px var(--type-ui); font-style:normal; }
.chat-user-avatar { display:grid; width:32px; height:32px; place-items:center; color:var(--text-on-primary); background:var(--navy-strong); border-radius:50%; font-weight:800; }
.chat-room-list { display:grid; gap:3px; padding:8px; }
.chat-room-item { display:grid; grid-template-columns:10px minmax(0,1fr); align-items:center; gap:9px; width:100%; padding:9px; color:var(--text-main); background:transparent; border:1px solid transparent; border-radius:8px; cursor:pointer; text-align:left; }
.chat-room-item:hover,.chat-room-item.is-active { background:var(--canvas-soft); border-color:var(--line); }
.chat-room-item span:nth-child(2) { display:grid; }
.chat-room-item strong { font:700 11px var(--type-ui); }
.chat-room-item small { color:var(--text-muted); font:500 8px var(--type-ui); }
.room-color { width:8px; height:24px; border-radius:6px; background:#3b7bd5; }
.room-privada { background:#9b5dcc; }
.chat-room-create { display:grid; grid-template-columns:minmax(0,1fr) 105px minmax(0,1fr) auto; gap:7px; padding:8px 11px; background:var(--canvas-soft); border-bottom:1px solid var(--line); }
.chat-room-create input,.chat-room-create select,.community-compose textarea,.topic-create input,.topic-create select,.topic-create textarea,.topic-reply textarea { width:100%; min-width:0; padding:8px 10px; color:var(--text-main); background:var(--panel-surface); border:1px solid var(--line); border-radius:8px; font:500 11px var(--type-ui); }
.chat-room-note { display:flex; align-items:center; gap:7px; min-height:28px; padding:5px 13px; color:var(--text-muted); background:var(--canvas-soft); border-bottom:1px solid var(--line); font:500 8px var(--type-ui); }
.chat-mention { padding:0 2px; color:var(--text-accent); background:color-mix(in srgb,var(--signal) 16%,transparent); border-radius:3px; font-weight:700; }
.chat-compose { position:relative; }
.chat-mention-list { position:absolute; z-index:7; right:10px; bottom:100%; left:10px; display:grid; max-height:220px; overflow:auto; padding:5px; background:var(--panel-surface); border:1px solid var(--line); border-radius:10px; box-shadow:var(--card-shadow); }
.chat-mention-list button { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; color:var(--text-main); text-align:left; background:transparent; border:0; border-radius:7px; cursor:pointer; }
.chat-mention-list button:hover { background:var(--choice-hover); }
.chat-mention-list strong { font-size:10px; }.chat-mention-list small { color:var(--text-muted); font-size:9px; }

.profile-modal-card { display:flex; width:min(94vw,520px); max-height:min(88dvh,720px); overflow:hidden; flex-direction:column; }
.profile-modal-card > .community-modal-header { flex:0 0 auto; }
.profile-form { display:grid; min-height:0; gap:12px; padding:18px; overflow-y:auto; overscroll-behavior:contain; }
.profile-form > label,.profile-password-fields label { display:grid; gap:5px; color:var(--text-muted); font:700 9px var(--type-ui); text-transform:uppercase; }
.profile-form input { width:100%; padding:10px 11px; color:var(--text-main); background:var(--canvas-soft); border:1px solid var(--line); border-radius:8px; font:500 12px var(--type-ui); }
.profile-form input[readonly] { opacity:.72; cursor:not-allowed; }
.profile-password-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:2px 0 0; padding:13px; border:1px solid var(--line); border-radius:9px; }
.profile-password-fields legend { padding:0 6px; color:var(--text-main); font:700 10px var(--type-ui); }
.profile-password-fields label:first-of-type,.profile-password-fields > small { grid-column:1/-1; }
.profile-password-fields > small { color:var(--text-muted); font-size:9px; }
.profile-form-actions { position:sticky; bottom:-18px; z-index:2; display:flex; align-items:center; justify-content:flex-end; gap:12px; margin:0 -18px -18px; padding:12px 18px; background:var(--panel-surface); border-top:1px solid var(--line); box-shadow:0 -8px 18px rgb(5 15 36 / 6%); }
.profile-form-actions span { flex:1; color:var(--danger); font-size:10px; }
.chat-messages,.community-messages { flex:1; min-height:0; padding:12px; overflow-y:auto; overscroll-behavior:contain; }
.chat-compose { padding:9px 11px 10px; border-top:1px solid var(--line); }

.support-layout { display:grid; grid-template-columns:210px minmax(0,1fr); flex:1; min-height:0; }
.support-conversations { padding:7px; overflow-y:auto; background:var(--canvas-soft); border-right:1px solid var(--line); }
.support-conversation { display:grid; width:100%; gap:3px; padding:9px; color:var(--text-main); background:transparent; border:1px solid transparent; border-radius:8px; cursor:pointer; text-align:left; }
.support-conversation:hover,.support-conversation.is-active { background:var(--panel-surface); border-color:var(--line); }
.support-conversation strong { font:700 10px var(--type-ui); }
.support-conversation-preview { overflow:hidden; color:var(--text-muted); font:500 9px/1.35 var(--type-ui); text-overflow:ellipsis; white-space:nowrap; }
.support-conversation small { color:var(--text-muted); font:500 8px var(--type-ui); }
.community-conversation { display:flex; min-width:0; min-height:0; flex-direction:column; }
.community-compose { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; padding:10px; border-top:1px solid var(--line); }
.community-compose textarea { resize:none; }

.topics-body { flex:1; min-height:0; padding:10px; overflow-y:auto; overscroll-behavior:contain; }
.topic-toolbar { display:grid; grid-template-columns:minmax(0,1fr) 170px; align-items:center; gap:7px; margin-bottom:9px; }
.topic-search { display:flex; align-items:center; gap:7px; min-width:0; padding:0 10px; color:var(--text-muted); background:var(--canvas-soft); border:1px solid var(--line); border-radius:9px; }
.topic-search input,.topic-toolbar select { width:100%; min-height:36px; color:var(--text-main); background:transparent; border:0; outline:0; font:600 10px var(--type-ui); }
.topic-toolbar select { padding:0 9px; background:var(--canvas-soft); border:1px solid var(--line); border-radius:9px; }
.topic-toolbar > small { grid-column:1/-1; color:var(--text-muted); font:600 8px var(--type-ui); }
.topic-list { display:grid; gap:7px; }
.topic-card { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:5px 9px; width:100%; padding:11px; color:var(--text-main); background:var(--panel-surface); border:1px solid var(--line); border-radius:10px; cursor:pointer; text-align:left; }
.topic-card:hover { border-color:var(--navy-mid); transform:translateY(-1px); }
.topic-card strong { font:700 12px var(--type-heading); }
.topic-card p { grid-column:1/-1; overflow:hidden; margin:0; color:var(--text-muted); font:500 10px/1.4 var(--type-ui); text-overflow:ellipsis; white-space:nowrap; }
.topic-card small { grid-column:1/3; color:var(--text-muted); font:500 8px var(--type-ui); }
.topic-card-stats { display:flex; grid-column:3; gap:8px; color:var(--text-muted); font:700 8px var(--type-ui); white-space:nowrap; }
.topic-category { width:max-content; padding:3px 6px; color:#1d507f; background:#dceafa; border-radius:5px; font:800 7px var(--type-ui); text-transform:uppercase; }
.category-discussao { color:#6c3d8b; background:#f0e3f8; }.category-estudo { color:#21684c; background:#dff2e8; }.category-aviso { color:#963e32; background:#f9dfdb; }
.topic-create { display:grid; grid-template-columns:minmax(0,1fr) 130px; gap:8px; }
.topic-create h3 { grid-column:1/-1; margin:2px 0 4px; color:var(--text-accent); font:750 15px var(--type-heading); }
.topic-create textarea,.topic-form-actions { grid-column:1/-1; }
.topic-form-actions { display:flex; justify-content:flex-end; gap:7px; }
.topic-back { margin:0 0 10px; padding:0; color:var(--text-accent); background:none; border:0; cursor:pointer; font:700 9px var(--type-ui); }
.topic-detail-head h3 { margin:8px 0 3px; font:750 20px var(--type-heading); }.topic-detail-head small { color:var(--text-muted); font:500 9px var(--type-ui); }
.topic-detail-labels { display:flex; align-items:center; gap:6px; }
.topic-closed { padding:3px 6px; color:#74540a; background:#f8e7b4; border-radius:5px; font:800 7px var(--type-ui); text-transform:uppercase; }
.topic-manage-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.topic-manage-actions button { min-height:30px; padding:5px 9px; color:var(--text-accent); background:var(--canvas-soft); border:1px solid var(--line); border-radius:7px; cursor:pointer; font:750 8px var(--type-ui); }
.topic-manage-actions button:hover { border-color:var(--navy-mid); }
.topic-manage-actions .danger { color:#a53a34; }
.topic-main-content { padding:13px 0 16px; border-bottom:1px solid var(--line); font:500 14px/1.6 var(--type-reading); }
.topic-reactions { display:flex; align-items:center; gap:7px; padding:10px 0; border-bottom:1px solid var(--line); }
.topic-reactions button { display:flex; align-items:center; gap:5px; min-height:32px; padding:5px 9px; color:var(--text-muted); background:var(--canvas-soft); border:1px solid var(--line); border-radius:18px; cursor:pointer; font:700 8px var(--type-ui); }
.topic-reactions button span { font-size:15px; line-height:1; }
.topic-reactions button.is-active { color:#176646; background:#dff2e8; border-color:#78bb9c; }
.topic-reactions button.is-active.negative { color:#963e32; background:#f9dfdb; border-color:#d9968e; }
.topic-reactions > small { margin-left:auto; color:var(--text-muted); font:600 8px var(--type-ui); }
.topic-answers { display:grid; gap:8px; margin:12px 0; }.topic-answer { padding:11px; background:var(--canvas-soft); border-radius:9px; }.topic-answer strong { font:700 10px var(--type-ui); }.topic-answer p { margin:5px 0; font:500 12px/1.5 var(--type-reading); }.topic-answer small { color:var(--text-muted); font:500 8px var(--type-ui); }
.topic-reply { display:grid; gap:7px; }.topic-reply .ui-button { justify-self:end; }
.collaborator-system-topic { border-color:color-mix(in srgb,#d5a92f 45%,var(--line)); background:linear-gradient(135deg,var(--panel-surface),color-mix(in srgb,#e1bd52 10%,var(--panel-surface))); }
.collaborator-wall-head { display:grid; grid-template-columns:auto 58px minmax(0,1fr); align-items:center; gap:4px 10px; }
.collaborator-wall-head .topic-category { grid-column:1/-1; }
.collaborator-wall-head > img { grid-row:2/4; width:58px; height:58px; object-fit:cover; border-radius:14px; box-shadow:0 3px 12px rgb(102 68 8 / 22%); }
.collaborator-wall-head h3 { margin:0; }.collaborator-wall-head small { grid-column:3; }
.collaborator-wall-list { display:grid; gap:7px; margin-top:12px; }
.collaborator-wall-item { display:grid; grid-template-columns:24px 42px minmax(0,1fr); align-items:center; gap:9px; padding:8px 10px; background:var(--canvas-soft); border:1px solid var(--line); border-radius:9px; }
.collaborator-wall-item > img { width:42px; height:42px; object-fit:cover; border-radius:10px; }
.collaborator-wall-item > span:last-child { display:grid; gap:2px; min-width:0; }
.collaborator-wall-item strong { font:750 11px var(--type-heading); }.collaborator-wall-item small { color:var(--text-muted); font:600 8px var(--type-ui); }
.collaborator-wall-position { color:#8a620e; font:800 10px var(--type-ui); text-align:center; }

@media (max-width:680px) {
    .community-strip { align-items:stretch; flex-direction:column; }
    .community-actions { width:100%; flex-wrap:nowrap; justify-content:stretch; overflow:visible; gap:5px; }
    .community-chat-button { flex:1 1 25%; min-width:0; justify-content:center; padding-inline:4px; font-size:8px; white-space:nowrap; }
    .desktop-action-label { display:none; }
    .mobile-action-label { display:inline; }
    .profile-password-fields { grid-template-columns:1fr; }
    .profile-password-fields label,.profile-password-fields label:first-of-type,.profile-password-fields > small { grid-column:1; }
    .community-modal,.chat-modal { width:min(92vw,430px); height:min(78svh,650px); max-height:78svh; }
    .community-modal-header { grid-template-columns:minmax(0,1fr) auto auto; padding:9px 10px; }
    .community-modal-header .modal-close { width:34px; height:34px; flex-basis:34px; }
    .community-modal-title h2 { font-size:15px; }.community-modal-title small { max-width:170px; }
    .chat-room-create { grid-template-columns:minmax(0,1fr) 96px; }.chat-room-create #chatRoomParticipants { grid-column:1/-1; }.chat-room-create button { grid-column:2; }
    .support-layout { grid-template-columns:1fr; }.support-conversations:not(.hidden) { max-height:120px; border-right:0; border-bottom:1px solid var(--line); }
    .topic-toolbar { grid-template-columns:1fr; }.topic-toolbar > small { grid-column:auto; }
    .topic-create { grid-template-columns:1fr; }.topic-create textarea,.topic-form-actions { grid-column:auto; }
    .topic-create h3 { grid-column:auto; }
    .topic-card { grid-template-columns:auto minmax(0,1fr); }.topic-card small { grid-column:1/-1; }.topic-card-stats { grid-column:1/-1; justify-content:flex-start; }
    .topic-reactions { flex-wrap:wrap; }.topic-reactions > small { width:100%; margin-left:0; }
}

@media (max-width:420px) {
    .community-actions .community-action-icon { display:none; }
    .community-chat-button { min-height:34px; padding-inline:3px; gap:3px; }
    .profile-modal-card { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:14px; }
    .profile-form { padding:14px; }
    .profile-form-actions { bottom:-14px; margin:0 -14px -14px; padding:10px 14px; }
    .profile-form-actions .main-action { flex:0 0 auto; }
}
