.community-shell{display:grid;gap:18px}.community-hero{display:flex;align-items:center;gap:18px;padding:24px;border:1px solid var(--line);border-radius:20px;background:var(--surface);box-shadow:0 12px 30px rgba(21,52,75,.07)}.community-hero-icon{width:54px;height:54px;flex:0 0 54px;border-radius:15px;display:grid;place-items:center;background:linear-gradient(135deg,rgba(18,105,229,.11),rgba(14,175,104,.12));border:1px solid rgba(18,105,229,.18)}.community-hero-icon svg{width:25px;height:25px;fill:none;stroke:#1269e5;stroke-width:1.7}.community-hero-copy{min-width:0;flex:1}.community-hero-copy h2{font-size:26px;margin:3px 0 6px}.community-hero-copy p{margin:0;color:var(--muted);line-height:1.6;max-width:850px}.community-space-tabs{display:flex;gap:8px;flex-wrap:wrap}.community-space-tab{display:inline-flex;align-items:center;gap:7px;padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);font-weight:750;font-size:12px}.community-space-tab.active{color:white;border-color:transparent;background:linear-gradient(135deg,#1269e5,#10b545);box-shadow:0 8px 20px rgba(18,105,229,.12)}.community-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:18px;align-items:start}.community-panel{background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:0 12px 28px rgba(20,50,74,.06)}.community-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px;border-bottom:1px solid var(--line)}.community-panel-head h3{font-size:17px}.community-thread-list{display:grid}.community-thread{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;padding:17px 20px;border-bottom:1px solid var(--line);transition:.16s ease}.community-thread:last-child{border-bottom:0}.community-thread:hover{background:rgba(18,105,229,.035)}.community-thread-main{min-width:0}.community-thread-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}.community-category{font-size:9px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:var(--cyan)}.community-pin{font-size:9px;font-weight:800;color:#9b6a12;background:#fff6de;border:1px solid #f0d698;border-radius:999px;padding:3px 7px}.community-thread h4{font-size:15px;margin:0 0 6px;line-height:1.35}.community-thread-excerpt{font-size:12px;line-height:1.55;color:var(--muted);margin:0}.community-thread-meta{display:flex;gap:9px;flex-wrap:wrap;font-size:10px;color:var(--muted);margin-top:9px}.community-thread-count{display:flex;align-items:center;gap:5px;white-space:nowrap;font-size:11px;color:var(--muted);align-self:center}.community-thread-count svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7}.community-compose{padding:18px}.community-compose .field{margin-bottom:12px}.community-compose textarea{min-height:150px}.community-empty{padding:38px 20px;text-align:center;color:var(--muted)}.community-rules{padding:18px}.community-rules h4{font-size:14px;margin-bottom:10px}.community-rules ul{margin:0;padding-left:18px;color:var(--muted);font-size:12px;line-height:1.7}.community-thread-page{display:grid;gap:16px}.community-post{padding:20px}.community-post-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}.community-author{display:flex;align-items:center;gap:10px}.community-author-avatar{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:linear-gradient(135deg,rgba(18,105,229,.13),rgba(14,175,104,.13));border:1px solid var(--line);font-weight:850;font-size:11px}.community-author strong{display:block;font-size:12px}.community-author small{display:block;color:var(--muted);font-size:10px;margin-top:2px}.community-post-body{font-size:13px;line-height:1.7;overflow-wrap:anywhere}.community-replies{display:grid;gap:10px}.community-reply{padding:16px 18px}.community-reply .community-post-body{margin-top:10px}.community-thread-tools{display:flex;gap:8px;flex-wrap:wrap}.community-back{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:750;color:var(--muted)}.community-back:hover{color:var(--text)}.community-locked{padding:14px 16px;border:1px solid #e4c56d;border-radius:12px;background:#fff8e5;color:#855e09;font-size:12px;font-weight:700}.community-form-actions{display:flex;justify-content:flex-end;gap:8px}.community-char-hint{font-size:10px;color:var(--muted);margin-top:5px}html[data-theme="dark"] .community-hero,html[data-theme="dark"] .community-panel{background:#10283b;border-color:#274a63;box-shadow:none}html[data-theme="dark"] .community-space-tab{background:#10283b;border-color:#274a63}html[data-theme="dark"] .community-thread:hover{background:rgba(54,217,220,.035)}html[data-theme="dark"] .community-pin{color:#ffd36c;background:#3a3016;border-color:#6a5728}html[data-theme="dark"] .community-locked{background:#352c13;border-color:#655225;color:#ffd36c}@media(max-width:980px){.community-layout{grid-template-columns:1fr}.community-side{order:-1}}@media(max-width:620px){.community-hero{align-items:flex-start;padding:18px}.community-hero-icon{width:44px;height:44px;flex-basis:44px}.community-hero-copy h2{font-size:21px}.community-thread{grid-template-columns:1fr}.community-thread-count{justify-self:start}.community-panel-head{align-items:flex-start;flex-direction:column}.community-form-actions{flex-direction:column}.community-form-actions .btn{width:100%}}


/* Community role tabs: explicit readable states in both themes */
.community-space-tab{color:var(--text)!important;text-decoration:none}
.community-space-tab:hover{color:#1269e5!important;border-color:rgba(18,105,229,.42);background:rgba(18,105,229,.055)}
.community-space-tab.active,.community-space-tab.active:hover{color:#fff!important;border-color:transparent;background:linear-gradient(135deg,#1269e5,#10b545);box-shadow:0 8px 20px rgba(18,105,229,.16)}
html[data-theme="dark"] .community-space-tab{color:#dceaf3!important;background:#10283b;border-color:#315671}
html[data-theme="dark"] .community-space-tab:hover{color:#fff!important;background:#16364b;border-color:#3b7595}
html[data-theme="dark"] .community-space-tab.active,html[data-theme="dark"] .community-space-tab.active:hover{color:#fff!important;background:linear-gradient(135deg,#1269e5,#10b545);border-color:transparent}

/* Safe destructive actions for discussions/replies */
.community-delete-form{margin:0}
.community-delete-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:7px 10px;border-radius:9px;border:1px solid rgba(224,59,71,.42);background:rgba(224,59,71,.07);color:#c82936!important;font-size:11px;font-weight:800;cursor:pointer;transition:.16s ease}
.community-delete-btn:hover{background:#e03b47;color:#fff!important;border-color:#e03b47;transform:translateY(-1px)}
.community-delete-btn svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8}
html[data-theme="dark"] .community-delete-btn{color:#ff929a!important;border-color:#74434a;background:rgba(224,59,71,.08)}
html[data-theme="dark"] .community-delete-btn:hover{color:#fff!important;background:#d83a47;border-color:#d83a47}
.community-reply-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
@media(max-width:620px){.community-reply-head{align-items:flex-start}.community-delete-btn{padding:7px 9px}}


/* Community message tools + emoji picker */
.community-compose .field{position:relative}
.community-text-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:7px}
.community-emoji-toggle{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:6px 10px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);font:inherit;font-size:12px;font-weight:750;cursor:pointer;transition:.16s ease}
.community-emoji-toggle:hover,.community-emoji-toggle[aria-expanded="true"]{border-color:#2d86e8;background:rgba(18,105,229,.06);color:#1269e5}
.community-emoji-picker{position:absolute;z-index:45;right:0;top:100%;margin-top:8px;width:min(390px,calc(100vw - 48px));max-height:365px;overflow:auto;padding:12px;border:1px solid var(--line);border-radius:15px;background:var(--surface);box-shadow:0 18px 46px rgba(8,33,54,.2)}
.community-emoji-picker[hidden]{display:none!important}
.community-emoji-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 4px 9px;font-size:12px;color:var(--muted)}
.community-emoji-head button{width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:21px;line-height:1;cursor:pointer}
.community-emoji-head button:hover{background:rgba(18,105,229,.08);color:var(--text)}
.community-emoji-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:3px}
.community-emoji-item{display:grid;place-items:center;aspect-ratio:1;border:0;border-radius:9px;background:transparent;font-size:23px;cursor:pointer;line-height:1;transition:.12s ease}
.community-emoji-item:hover{background:rgba(18,105,229,.09);transform:scale(1.08)}
html[data-theme="dark"] .community-emoji-toggle,html[data-theme="dark"] .community-emoji-picker{background:#10283b;border-color:#315671;color:#e8f2f7}
html[data-theme="dark"] .community-emoji-toggle:hover,html[data-theme="dark"] .community-emoji-toggle[aria-expanded="true"]{background:#16364b;border-color:#3b7595;color:#72e3df}
html[data-theme="dark"] .community-emoji-item:hover{background:rgba(83,224,216,.1)}
@media(max-width:620px){.community-emoji-picker{left:0;right:auto;width:min(340px,calc(100vw - 56px))}.community-emoji-grid{grid-template-columns:repeat(7,minmax(0,1fr))}.community-emoji-toggle span{display:none}}

.community-reaction-row{display:flex;gap:6px;flex-wrap:wrap;padding:0 1px 10px;margin-bottom:8px;border-bottom:1px solid var(--line)}
.community-reaction-item{border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--text);padding:6px 9px;font-size:11px;font-weight:800;cursor:pointer}
.community-reaction-item:hover{background:rgba(18,105,229,.08);border-color:#2d86e8}
html[data-theme="dark"] .community-reaction-item{border-color:#315671;color:#e8f2f7}
html[data-theme="dark"] .community-reaction-item:hover{background:#16364b;border-color:#3b7595}
