.community-page{max-width:1120px;margin:28px auto 70px;padding:0 18px}.community-intro{margin:0 0 24px}.community-intro h1{margin:5px 0;font:700 34px 'Playfair Display',Georgia,serif}.community-intro p{margin:0;color:var(--muted,#aaa)}.community-tabs{display:flex;gap:8px;border-bottom:1px solid var(--line,#45384b);padding-bottom:10px;margin-bottom:18px}.community-tabs button,.community-tabs a,.friend-add button,.friend-actions button,.chat-compose button{cursor:pointer;border:1px solid #614968;background:#302239;color:#f4eaf2;border-radius:9px;padding:9px 14px}.community-tabs a{display:inline-flex;align-items:center;text-decoration:none}.community-tabs button.active{background:#a85d7f;border-color:#a85d7f}.community-tabs button:hover,.community-tabs a:hover{background:#49334e}.community-section[hidden]{display:none}.community-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,.7fr);gap:16px}.community-card{background:#1c1722;border:1px solid #45364c;border-radius:14px;padding:18px}.community-card h2{font-size:20px;margin:0 0 14px}.friend-add{margin-bottom:16px}.friend-add label,.chat-search-label{display:block;font-size:13px;color:#c5b6c8;margin-bottom:7px}.friend-add>div{display:flex;gap:8px}.friend-add input,.chat-search-label input,.chat-compose textarea{min-width:0;width:100%;padding:10px 12px;border:1px solid #594661;border-radius:9px;background:#17121c;color:#fff}.friend-row,.request-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-top:1px solid #382d3e}.community-user{display:flex;align-items:center;gap:10px;min-width:0;color:inherit;text-decoration:none}.community-avatar{width:42px;height:42px;flex:none;display:grid;place-items:center;border-radius:50%;background:#3b2a42;overflow:hidden}.community-avatar img{width:100%;height:100%;object-fit:cover}.community-user b,.community-user small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.community-user small{font-size:12px;color:#b9aabb}.friend-actions{display:flex;gap:6px;flex-wrap:wrap}.friend-actions button{padding:6px 9px;font-size:12px}.friend-actions .accept{background:#5a765b;border-color:#749a76}.friend-actions .reject,.friend-actions .remove{background:#3b2b3d}.community-empty,.community-error{padding:14px 0;color:#bdafc1}.community-error{color:#ffb3b3}.chat-layout{display:grid;grid-template-columns:minmax(220px,320px) minmax(0,1fr);gap:18px;min-height:480px}.chat-contacts{border-right:1px solid #45364c;padding-right:14px}.chat-contacts h2{margin-bottom:12px}.chat-search-label input{display:block;margin-top:6px}.chat-contact{width:100%;display:flex;gap:10px;align-items:center;text-align:left;padding:9px;margin:4px 0;border:0;border-radius:10px;background:transparent;color:inherit;cursor:pointer}.chat-contact:hover,.chat-contact.active{background:#38283e}.chat-contact span:last-child{min-width:0}.chat-contact b,.chat-contact small{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.chat-contact small{font-size:12px;color:#b9aabb}.chat-main{display:flex;min-width:0;flex-direction:column}.chat-main>header{padding:0 0 12px;border-bottom:1px solid #45364c}.chat-main>header h2{margin:0}.chat-history{flex:1;min-height:260px;max-height:56vh;overflow:auto;padding:12px 4px}.chat-message{width:fit-content;max-width:86%;margin:8px 0;padding:10px 12px;border-radius:12px;background:#30253a;overflow-wrap:anywhere}.chat-message.mine{margin-left:auto;background:#634057}.chat-message p{margin:4px 0}.chat-message time{font-size:11px;opacity:.65}.chat-compose{display:flex;align-items:end;gap:8px}.chat-compose textarea{flex:1;min-height:50px;resize:vertical}.chat-compose button{height:44px}.chat-contact-list-empty{padding:12px;color:#bdafc1}#community-status{min-height:0;margin:0;color:#e1b978}#community-status:empty{display:none}@media(max-width:720px){.community-grid,.chat-layout{grid-template-columns:1fr}.chat-contacts{border:0;border-bottom:1px solid #45364c;padding:0 0 14px}.chat-contact-list{max-height:210px;overflow:auto}.community-intro h1{font-size:28px}.friend-add>div{flex-direction:column}.friend-add button{align-self:flex-start}}
/* 0.29 — единый интерфейс друзей и переписок, без постов и форума */
.community-page{max-width:1260px;margin:22px auto;padding:0 20px 30px}.community-intro{margin-bottom:15px}.community-intro p{font-size:13px}
.community-messenger{display:grid;grid-template-columns:minmax(240px,340px) minmax(0,1fr);height:min(75vh,790px);min-height:520px;background:var(--ui,#1c1722);border:1px solid var(--ln,#44344a);border-radius:18px;overflow:hidden}
.community-sidebar{display:flex;flex-direction:column;min-width:0;border-right:1px solid var(--ln,#44344a);background:color-mix(in srgb,var(--ui,#1c1722) 88%,#090609);padding:14px 10px}
.friend-search-toolbar{display:flex;gap:7px;align-items:center;margin:0 4px 12px}.friend-search-wrap{flex:1;min-width:0}.friend-search-wrap input{width:100%;padding:10px;background:var(--bg,#17121c);color:var(--fg,#fff);border:1px solid var(--ln,#58435b);border-radius:10px;font-size:13px}
.friend-search-toolbar button{position:relative;width:38px;height:38px;flex:none;border:1px solid var(--ln,#58435b);background:var(--ui);color:var(--fg);border-radius:10px;cursor:pointer;font-size:18px}.friend-search-toolbar button[aria-expanded=true]{background:#734763}.friend-search-toolbar #request-count{position:absolute;top:-7px;right:-5px;font-size:10px;background:#aa5e7d;color:white;padding:2px 5px;border-radius:20px}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.friend-list-heading{display:flex;justify-content:space-between;align-items:center;padding:8px 12px}.friend-list-heading h2{font-size:15px;margin:0}.friend-list-heading small{opacity:.6}.friend-list{flex:1;overflow-y:auto;min-height:80px;padding:0 3px}.friend-entry{display:flex;align-items:center;border-radius:11px;margin:2px 0;gap:3px}.friend-entry:hover,.friend-entry.active{background:color-mix(in srgb,var(--ac,#bd7da0) 18%,transparent)}.friend-open{border:0;color:var(--fg,#fff);background:none;display:flex;align-items:center;text-align:left;gap:10px;width:100%;min-width:0;padding:10px 8px;cursor:pointer}.friend-open span:last-child{min-width:0}.friend-open b,.friend-open small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.friend-open small{font-size:12px;opacity:.6}.friend-remove{border:0;background:transparent;color:var(--fg);opacity:.3;cursor:pointer;padding:5px 10px}.friend-remove:hover{opacity:1;color:#ed9da9}
.requests-panel{overflow-y:auto;max-height:44%;border:1px solid var(--ln,#58435b);border-radius:12px;padding:10px;margin:0 4px 10px;background:var(--ui)}.requests-panel[hidden]{display:none}.requests-panel h2{font-size:15px;margin:0 0 8px}.requests-panel h3{font-size:12px;margin:10px 0 6px;opacity:.7}.requests-panel .request-row{flex-wrap:wrap}.requests-panel button{border-radius:8px;padding:6px 8px;font-size:12px}.requests-panel .community-avatar{width:29px;height:29px}.friend-add{margin:0 4px 12px}.friend-add[hidden]{display:none}.friend-add>div{flex-wrap:wrap}.friend-add input{min-width:0;flex:1}.friend-add button{font-size:12px}
.community-chat-panel{display:flex;flex-direction:column;min-width:0;padding:14px 18px}.community-chat-heading{border-bottom:1px solid var(--ln,#45364c);padding:3px 0 14px;display:flex;justify-content:space-between;align-items:center;gap:10px}.community-chat-heading>div{display:flex;align-items:center;gap:12px}.community-chat-heading h2{font-size:18px;margin:0}.community-chat-heading small{opacity:.65;font-size:12px}.community-chat-heading .community-avatar{width:43px;height:43px}.chat-profile-link{font-size:12px;color:var(--fg);border:1px solid var(--ln);border-radius:9px;padding:7px 10px;text-decoration:none}.community-chat-panel .chat-history{max-height:none;min-height:0;flex:1;overflow-y:auto;padding:12px 6px}.community-chat-panel .chat-compose{border-top:1px solid var(--ln);padding-top:12px}.community-chat-panel .chat-compose textarea{min-height:44px;max-height:150px;resize:vertical}.community-chat-panel .chat-message{max-width:75%}.community-page .community-empty{font-size:13px;padding:8px;color:var(--muted,#bdaec0)}
@media(max-width:690px){.community-page{padding:0 10px 20px}.community-messenger{height:auto;min-height:0;grid-template-columns:1fr}.community-sidebar{border-right:0;border-bottom:1px solid var(--ln);max-height:340px}.friend-list{max-height:190px}.community-chat-panel{min-height:420px;padding:12px}.community-chat-panel .chat-history{min-height:280px}.community-chat-panel .chat-message{max-width:92%}.friend-add>div{flex-direction:row}.community-intro h1{font-size:26px}}
/* 0.33 — composer must never scroll away with the message history. */
.community-messenger{height:clamp(520px,77vh,830px)}
.community-chat-panel{height:100%;min-height:0;overflow:hidden;display:flex;flex-direction:column}
.community-chat-panel .chat-history{flex:1 1 0;min-height:0!important;max-height:none!important;overflow-y:auto;overscroll-behavior:contain}
.community-chat-panel .chat-compose{flex:0 0 auto;display:flex!important;gap:10px;padding:12px 0 2px;background:var(--ui,#241b2b);position:relative;z-index:1}
.community-chat-panel .chat-compose[hidden]{display:none!important}
.community-chat-panel .chat-compose textarea{min-width:0;flex:1 1 auto;resize:none;min-height:58px;max-height:110px}
.community-chat-panel .chat-compose button{flex:0 0 auto;align-self:end;height:44px}
@media(max-width:690px){.community-messenger{height:auto;min-height:0}.community-chat-panel{height:clamp(400px,68vh,650px);min-height:400px}}
