.community-body { background: var(--background); }
.community-shell { width: min(1500px, calc(100% - 32px)); min-height: calc(100vh - 76px); margin: 0 auto; padding: 24px 0 56px; }
.community-app { display: grid; grid-template-columns: 230px minmax(0, 720px) 250px; justify-content: center; align-items: start; gap: 24px; }
.community-main { min-width: 0; }
.community-sidebar { position: sticky; top: 100px; display: grid; gap: 12px; }
.community-sidebar nav { display: grid; gap: 5px; }
.community-side-label,.community-kicker { margin: 0; color: var(--purple-light); font-size: .69rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.community-topic-link { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 44px; padding: 8px 11px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 700; text-align: left; cursor: pointer; }
.community-topic-link:hover,.community-topic-link[aria-current="true"] { border-color: var(--purple-line); background: var(--purple-soft); color: var(--text); }
.community-topic-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--purple); box-shadow: 0 0 10px rgba(var(--purple-rgb),.65); }
.community-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.community-toolbar h1 { margin: 2px 0 0; font-size: clamp(1.7rem,4vw,2.25rem); }
.community-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.community-primary,.community-load-more { min-height: 44px; padding: 9px 18px; border: 1px solid rgba(var(--purple-light-rgb),.35); border-radius: 999px; background: var(--purple); color: white; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 10px 28px -14px rgba(var(--purple-rgb),.9); }
.community-primary:hover,.community-load-more:hover { background: var(--purple-hover); }
.community-primary:disabled { opacity: .55; cursor: wait; }
.community-icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 1.4rem; cursor: pointer; }
.community-feed-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.community-feed-nav label { padding-left: 4px; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.community-feed-nav select,.community-feed-nav input { min-width: 0; min-height: 40px; border: 1px solid var(--purple-line); border-radius: 10px; background: var(--background); color: var(--text); font: inherit; }
.community-feed-nav select { flex: 0 0 auto; padding: 5px 34px 5px 10px; font-weight: 750; }
.community-feed-nav input { flex: 1; padding: 6px 11px; }
.community-notice { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--danger-line); border-radius: 12px; background: var(--danger-soft); color: var(--text); font-size: .88rem; }
.community-feed { display: grid; gap: 12px; }
.community-post { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 14px 32px -25px #000; }
.community-post.is-own { border-color: rgba(var(--purple-border-rgb),.65); }
.community-post-header { display: flex; align-items: center; gap: 11px; padding: 13px 14px 10px; }
.community-author { display: flex; min-width: 0; flex: 1; align-items: center; gap: 11px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.community-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 1px solid var(--purple-line); border-radius: 50%; background: radial-gradient(circle at 35% 25%,rgba(var(--hero-glow-rgb),.9),var(--hero-deep)); color: white; font-weight: 850; }
.community-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-author-meta { min-width: 0; display: grid; line-height: 1.35; }
.community-author-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.community-author-meta small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.community-post-topic { color: var(--purple-light)!important; }
.community-menu-wrap { position: relative; }
.community-menu-button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.25rem; cursor: pointer; }
.community-menu-button:hover { background: var(--purple-soft); color: var(--text); }
.community-post-menu { position: absolute; z-index: 3; top: 42px; right: 0; display: grid; min-width: 210px; padding: 6px; border: 1px solid var(--purple-line); border-radius: 13px; background: rgba(var(--surface-raised-rgb),.99); box-shadow: 0 22px 50px -18px #000; }
.community-post-menu button { min-height: 42px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.community-post-menu button:hover { background: var(--purple-soft); }
.community-post-menu button.is-danger { color: var(--danger); }
.community-post-text { margin: 0; padding: 7px 15px 13px; color: var(--text); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.community-post-media { display: block; width: 100%; max-height: 680px; object-fit: cover; background: var(--surface-raised); }
.community-post-actions { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 4px; padding: 7px 11px; border-top: 1px solid var(--line); }
.community-action { min-height: 42px; padding: 5px 8px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 750; cursor: pointer; text-align: left; }
.community-action:hover { background: var(--purple-soft); color: var(--text); }
.community-action.is-active { color: var(--purple-light); }
.community-comments { border-top: 1px solid var(--line); padding: 12px 14px 14px; }
.community-comment-list { display: grid; gap: 12px; margin-bottom: 12px; }
.community-comment { display: grid; grid-template-columns: 32px 1fr auto; gap: 9px; align-items: start; }
.community-comment .community-avatar { width: 32px; height: 32px; font-size: .72rem; }
.community-comment p { margin: 1px 0 0; color: var(--text); font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.community-comment small { color: var(--muted); }
.community-comment-delete { border: 0; background: none; color: var(--danger); cursor: pointer; }
.community-comment-form { display: flex; gap: 8px; }
.community-comment-form input { min-width: 0; flex: 1; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--background); color: var(--text); font: inherit; }
.community-comment-form button { min-height: 42px; border: 0; border-radius: 11px; background: var(--purple); color: #fff; font-weight: 800; cursor: pointer; }
.community-profile-card,.community-rules { width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--text); }
.community-profile-card { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; font: inherit; text-align: left; cursor: pointer; }
.community-profile-card strong,.community-profile-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-profile-card small { color: var(--muted); }
.community-rules h2 { margin: 8px 0 6px; font-size: 1rem; }
.community-rules p { color: var(--muted); font-size: .84rem; line-height: 1.55; }
.community-auth-state { display: grid; min-height: 60vh; place-items: center; }
.community-state-card { width: min(620px,100%); padding: clamp(24px,5vw,42px); border: 1px solid var(--purple-line); border-radius: 22px; background: linear-gradient(145deg,rgba(var(--hero-deep-rgb),.98),var(--surface)); text-align: center; }
.community-state-card h1 { margin: 8px 0; font-size: clamp(1.8rem,5vw,2.8rem); }
.community-state-card p { color: var(--muted); }
.community-state-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.community-spinner { display: inline-block; width: 34px; height: 34px; border: 3px solid var(--purple-soft); border-top-color: var(--purple-light); border-radius: 50%; animation: community-spin .8s linear infinite; }
@keyframes community-spin { to { transform: rotate(360deg); } }
.community-empty { padding: 38px 24px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); text-align: center; }
.community-empty h2 { margin-bottom: 5px; }
.community-empty p { margin: 0; color: var(--muted); }
.community-load-more { display: block; margin: 18px auto 0; background: var(--surface); border-color: var(--purple-line); }
.community-dialog { width: min(610px,calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: auto; border: 1px solid var(--purple-line); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 32px 90px -30px #000; }
.community-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.community-dialog form,.community-profile-dialog { padding: 20px; }
.community-dialog header { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.community-dialog header h2 { margin: 0 0 14px; }
.community-dialog header button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--background); color: var(--text); font-size: 1.25rem; cursor: pointer; }
.community-dialog label { display: grid; gap: 6px; margin-top: 13px; font-size: .86rem; font-weight: 750; }
.community-dialog input,.community-dialog select,.community-dialog textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--background); color: var(--text); font: inherit; resize: vertical; }
.community-dialog label small { color: var(--muted); text-align: right; }
.community-dialog footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.community-dialog footer .button-outline { width: auto; }
.community-form-error { min-height: 1.4em; margin: 10px 0 0; color: var(--danger); }
[data-post-preview] { width: 100%; max-height: 300px; margin-top: 10px; border-radius: 12px; object-fit: cover; }
.community-profile-dialog { text-align: center; }
.community-profile-dialog .community-avatar { width: 78px; height: 78px; margin: 0 auto 12px; font-size: 1.3rem; }
.community-profile-dialog p { color: var(--muted); }

@media (max-width: 1180px) { .community-app { grid-template-columns: 210px minmax(0,720px); }.community-sidebar-right { display:none; } }
@media (max-width: 850px) { .community-shell { width:min(720px,calc(100% - 24px)); padding-top:16px; }.community-app { display:block; }.community-sidebar-left { display:none; }.community-toolbar { position:sticky; z-index:2; top:76px; padding:10px 0; background:rgba(var(--background-rgb),.94); backdrop-filter:blur(12px); } }
@media (max-width: 560px) { .community-shell { width:100%; padding:0 0 32px; }.community-main { width:100%; }.community-toolbar,.community-feed-nav,.community-notice { margin-left:12px; margin-right:12px; }.community-toolbar { top:68px; }.community-toolbar h1 { font-size:1.55rem; }.community-primary { padding-inline:13px; }.community-feed { gap:8px; }.community-post { border-left:0; border-right:0; border-radius:0; }.community-post-actions { grid-template-columns:1fr 1fr auto; }.community-action { font-size:.76rem; }.community-comment-form button { padding-inline:12px; }.community-dialog footer { flex-direction:column-reverse; }.community-dialog footer button { width:100%!important; }.community-feed-nav { flex-wrap:wrap; }.community-feed-nav input { flex-basis:100%; }.site-footer { margin-top:0; } }
@media (prefers-reduced-motion:reduce) { .community-spinner { animation:none; } }
