/* Communities share the messenger's quiet colors and comfortable touch targets. */
.area-tabs { display: flex; gap: 4px; margin: 0; padding: 7px 12px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.area-tab { flex: 1; min-width: 0; min-height: 44px; padding: 9px 7px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; }
.area-tab.active { color: var(--green-dark); background: var(--green-pale); }
.area-tab:hover { background: #17444a0b; }
.social-tabs { display: flex; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.social-tab { flex: 1; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; }
.social-tab.active { background: var(--green-pale); color: var(--green-dark); border-color: transparent; }
.social-tab:hover { background: var(--green-pale); }
.app.social-mode .sidebar :is(.account-bar, .drive-shortcut, #profile-button) { display: none !important; }
.chat-tabs { display: flex; flex: 0 0 auto; padding: 10px 14px 0; gap: 8px; }
.chat-tabs .tab { flex: 1; min-height: 40px; }
.community-side { min-height: 0; flex: 1; padding: 22px 18px; overflow-y: auto; }
.community-side-intro strong { font-size: 22px; letter-spacing: -.7px; color: #173f45; }
.community-side-intro p { margin: 8px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.community-side .section-head { padding: 26px 0 12px; }
.community-side #community-my-posts { margin-top: 20px; min-height: 44px; }
.community-shortcut { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-block: 4px; padding: 9px; text-align: left; font-weight: 600; border: 0; border-radius: 10px; background: transparent; color: inherit; overflow-wrap: anywhere; }
.community-shortcut:hover { background: var(--green-pale); }
.community-shortcut-icon { font-size: 21px; flex: none; }
.social-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; overflow: hidden; background: #f7f8f6; }
.social-panel.hidden, .chat-panel.hidden, .community-side.hidden, .chat-tabs.hidden { display: none !important; }
.social-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex: 0 0 auto; min-height: 96px; padding: 20px clamp(20px, 4vw, 48px); border-bottom: 1px solid var(--line); background: #fff; }
.social-header h1 { margin: 3px 0 0; font-size: 26px; line-height: 1.25; letter-spacing: -.9px; overflow-wrap: anywhere; }
.social-eyebrow { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.social-header > button { flex: none; }
.social-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; overflow-anchor: auto; }
.social-content { width: min(100%, 1060px); margin-inline: auto; padding: 26px clamp(18px, 4vw, 48px) max(48px, env(safe-area-inset-bottom)); }
.social-content :is(h2, h3, p) { overflow-wrap: anywhere; }
.social-content h2 { font-size: 20px; letter-spacing: -.45px; line-height: 1.4; }
.social-content .setting-help { line-height: 1.65; }
.social-welcome { display: flex; align-items: center; gap: 20px; padding: 20px; border: 1px solid #c8dfd7; background: #ebf4ef; border-radius: 12px; margin-bottom: 24px; }
.social-welcome strong { font-size: 17px; }
.social-welcome p { margin: 7px 0 0; line-height: 1.6; font-size: 14px; }
.social-welcome button { flex: none; }
.social-refresh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding: 9px 14px; border: 1px solid #c4dce1; background: #eaf3f6; border-radius: 10px; font-size: 13px; }
.social-introduction { margin-bottom: 22px; }
.social-introduction h2 { margin: 0 0 9px; font-size: clamp(23px, 2.7vw, 30px); font-weight: 650; letter-spacing: -.85px; }
.social-introduction p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.community-search { display: flex; flex-wrap: wrap; gap: 9px; margin-block: 20px 28px; }
.community-search input { flex: 1 1 210px; width: 0; min-width: 140px; }
.community-search select { flex: 0 1 160px; min-width: 110px; }
.community-search input, .community-search select { background: #fff; border: 1px solid var(--line); border-radius: 9px; min-height: 44px; padding: 10px 12px; }
.social-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.social-section-head h2 { margin: 0; }
.community-grid, .people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.community-card, .person-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.community-card { display: flex; flex-direction: column; }
.community-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.community-card-icon { font-size: 32px; line-height: 1.3; }
.community-card h3 { margin: 17px 0 8px; font-size: 20px; line-height: 1.4; letter-spacing: -.4px; }
.community-card p { flex: 1; color: var(--muted); font-size: 14px; line-height: 1.75; margin: 0 0 18px; }
.community-counts { display: block; color: var(--muted); font-size: 12px; margin-bottom: 17px; }
.social-inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.social-section-title { margin: 36px 0 8px; }
.interest-chip { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 7px; background: #edf2ef; color: #416158; font-size: 12px; line-height: 1.3; }
.interest-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 14px; }
.shared-interest-note { display: block; margin-top: 16px; color: var(--muted); font-size: 12px; }
.shared-interests { font-size: 13px; margin-top: 5px; color: var(--green-dark); }
.person-card > p { font-size: 14px; line-height: 1.6; }
.social-author { display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; min-height: 44px; max-width: 100%; }
.social-author strong { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.social-author .avatar { width: 36px; height: 36px; flex: none; font-size: 13px; }
.social-author:disabled { opacity: 1; cursor: default; }
.community-person-identity { display: flex; align-items: center; gap: 14px; }
.community-person-identity h3 { overflow-wrap: anywhere; font-size: 23px; }
.community-person-bio { line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.community-person-identity .avatar { flex: none; width: 60px; height: 60px; }
#community-person-body > button { margin: 8px 10px 8px 0; }
.community-detail { padding: 22px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.community-detail > .interest-chip { margin-left: 12px; vertical-align: middle; }
.community-detail > p { color: var(--muted); font-size: 15px; line-height: 1.7; }
.community-detail > small { color: var(--muted); }
.community-rules { margin: 18px 0; font-size: 13px; line-height: 1.7; }
.community-rules summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.community-rules p { margin-bottom: 0; }
.community-quick-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.community-composer { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 22px; }
.community-link-entry { margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #fff); }
.community-link-entry summary { cursor: pointer; font-weight: 700; min-height: 28px; }
.community-link-entry input { width: 100%; margin: 12px 0; }
.community-link-entry > button { margin: 0 8px 8px 0; }
.community-link-entry label { display: block; margin: 8px 0; }
.space-entry-settings form { margin: 14px 0 20px; }
.space-entry-settings :is(input,select) { width: 100%; max-width: 100%; }
.space-new-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.space-new-link input { flex: 1 1 220px; }
.community-composer > label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.community-composer textarea, .community-comment-form textarea { resize: vertical; width: 100%; max-width: 100%; min-height: 88px; max-height: 260px; border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 9px; padding: 12px; line-height: 1.6; font-size: 16px; }
.community-compose-tools { display: flex; justify-content: space-between; gap: 12px; margin-block: 12px; }
.community-file-label { position: relative; display: inline-flex; align-items: center; cursor: pointer; overflow: hidden; }
.community-file-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.community-file-label:focus-within { outline: 2px solid var(--green); outline-offset: 3px; }
.community-image-preview { display: flex; align-items: center; gap: 12px; }
.community-image-preview img { display: block; width: 100px; height: 100px; object-fit: contain; border-radius: 8px; margin-top: 12px; }
.community-feed { display: grid; gap: 18px; }
.community-post { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 20px; animation: community-arrive .2s ease-out; }
.community-post-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.post-time { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.post-community-link { display: inline-block; padding: 0; margin-top: 12px; border: 0; background: transparent; color: var(--green-dark); font-size: 12px; font-weight: 600; text-align: left; min-height: 32px; }
.community-post-text, .community-comment-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; font-size: 15px; margin: 9px 0 16px; }
.community-post-image { display: block; width: 100%; max-height: 480px; height: auto; object-fit: contain; background: #f3f4f1; border-radius: 9px; margin-block: 8px 16px; }
.community-post-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.community-post-actions button[aria-pressed="true"] { color: #b13b57; background: #fbeef2; border-color: #f0cfda; }
.community-comments { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 10px; }
.community-comment { padding: 14px 0; border-bottom: 1px solid var(--line); }
.community-comment header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.community-comment-text { font-size: 14px; margin-block: 5px; }
.community-comment-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.community-comment-form textarea { flex: 1 1 200px; min-height: 70px; }
.community-comment-form .form-notice { width: 100%; }
.social-content-menu { position: relative; flex: none; }
.social-content-menu > summary { display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 8px; cursor: pointer; list-style: none; font-size: 18px; }
.social-content-menu > summary::-webkit-details-marker { display: none; }
.social-content-menu[open] > summary { background: var(--green-pale); }
.social-menu-actions { position: absolute; z-index: 10; right: 0; top: 44px; width: 190px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px #173f451f; }
.social-menu-actions button { display: block; width: 100%; text-align: left; min-height: 44px; white-space: normal; }
.danger-text { color: #bb3848; }
.social-empty { grid-column: 1 / -1; text-align: center; padding: 35px 20px; border: 1px dashed var(--line); border-radius: 13px; }
.social-empty h2 { margin: 0 0 10px; font-size: 19px; }
.social-empty p { max-width: 440px; margin: 0 auto 18px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.social-load-more { display: block; margin: 24px auto 0; }
.interest-fieldset { border: 0; padding: 0; margin: 20px 0; min-width: 0; }
.interest-fieldset legend { font-weight: 650; font-size: 14px; margin-bottom: 13px; }
.interest-options { display: flex; flex-wrap: wrap; gap: 9px; }
.interest-option { display: flex; align-items: center; gap: 8px; width: auto; min-height: 44px; padding: 9px 12px; margin: 0 !important; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; cursor: pointer; }
.interest-option:has(input:checked) { border-color: var(--green); background: var(--green-pale); color: var(--green-dark); }
.interest-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.community-blocked { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; }
.community-blocked h3 { font-size: 15px; }
.community-blocked .social-inline-actions { justify-content: space-between; margin-bottom: 8px; }
body.theme-dark .social-panel { background: #151a19; }
body.theme-dark :is(.social-header, .community-card, .person-card, .community-detail, .community-composer, .community-post, .social-menu-actions, .community-search input, .community-search select) { background: #202725; color: #e3e8e5; }
body.theme-dark :is(.community-side-intro strong, .post-community-link, .shared-interests) { color: #a4d1cf; }
body.theme-dark .interest-chip { background: #2b3933; color: #b9d7c7; }
body.theme-dark .social-welcome { background: #243b32; border-color: #3a5848; }
body.theme-dark .social-refresh { background: #20383c; border-color: #36575e; }
body.theme-dark .community-post-image { background: #19201d; }
body.theme-dark .community-post-actions button[aria-pressed="true"] { color: #f4adbd; background: #492d37; border-color: #66404d; }
body.theme-dark .area-tab.active { color: #a4d1cf; background: #243d41; }
body.theme-dark .social-tab.active { color: #a4d1cf; background: #243d41; }
@keyframes community-arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1100px) {
  .community-grid, .people-grid { grid-template-columns: 1fr; }
  .social-header { padding: 18px 22px; }
}
@media (max-width: 720px) {
  .app.social-mode:not(.hidden):not(.chat-open) { position: fixed; top: var(--viewport-top, 0px); height: var(--app-height, 100dvh); min-height: 0; max-height: var(--app-height, 100dvh); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  .app.social-mode:not(.chat-open) .sidebar { display: flex; height: auto; min-height: 0; overflow: visible; border-right: 0; padding-bottom: 0; }
  .app.social-mode .sidebar :is(.community-side, .account-bar, .drive-shortcut) { display: none !important; }
  .app.social-mode .side-top { height: 56px; flex: 0 0 56px; padding-top: env(safe-area-inset-top); box-sizing: content-box; }
  .app.social-mode .area-tabs { padding: 0 12px 7px; }
  .app.social-mode .social-panel { display: flex; height: 100%; min-height: 0; max-height: 100%; }
  .social-header { min-height: 76px; padding: 12px 16px; gap: 10px; }
  .social-header h1 { font-size: 23px; }
  .social-header > button { padding-inline: 9px; font-size: 12px; max-width: 135px; }
  .social-eyebrow { font-size: 11px; }
  .social-content { padding: 20px 14px max(36px, env(safe-area-inset-bottom)); }
  .social-welcome { flex-direction: column; align-items: flex-start; padding: 17px; gap: 12px; }
  .social-section-head { align-items: flex-start; }
  .social-section-head button { max-width: 150px; }
  .community-card, .person-card, .community-detail, .community-composer, .community-post { padding: 17px; }
  .community-post-image { max-height: 360px; }
  .social-panel :is(button, select), .community-compose-tools label { min-height: 44px; }
  .community-search input, .community-search select { font-size: 16px; }
  .community-search input { flex-basis: 100%; }
  .community-search select { flex: 1; }
  .social-scroll { touch-action: pan-y; }
}
@media (prefers-reduced-motion: reduce) { .community-post { animation: none; } }

.space-label, .post-format-label, .bot-badge { display: inline-flex; align-items: center; max-width: 100%; width: fit-content; padding: 4px 8px; font-size: 11px; line-height: 1.5; border-radius: 6px; background: var(--green-pale); color: var(--green-dark); }
.space-label { margin-block: 4px 12px; }
.bot-badge { flex: none; background: #e8edf8; color: #455c94; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-block: 4px 10px; }
.post-tags .space-label { margin: 0; }
.community-post-title { font-size: 20px; line-height: 1.5; margin-block: 10px 8px; letter-spacing: -.4px; overflow-wrap: anywhere; }
.community-composer > :is(select, .post-title-input) { display: block; width: 100%; min-height: 44px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: inherit; font-size: 16px; }
.community-composer > select { font-size: 14px; }
.community-compose-tools { flex-wrap: wrap; justify-content: flex-start; }
.community-compose-tools > button { margin-left: auto; }
.community-image-preview { flex-wrap: wrap; }
.shared-file-name { font-size: 14px; overflow-wrap: anywhere; }
.community-file-download { display: flex; flex-direction: column; gap: 5px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; margin-block: 12px; color: var(--green-dark); text-decoration: none; overflow-wrap: anywhere; }
.community-file-download strong::before { content: '↓ '; }
.community-file-download small { color: var(--muted); }
.accepted-answer, .helper-welcome { margin-block: 15px; padding: 15px; border-left: 3px solid #539875; border-radius: 7px; background: #edf5ef; font-size: 14px; }
.accepted-answer p, .helper-welcome p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.accepted-answer > strong { font-size: 12px; color: #376e51; }
.answer-button { margin-top: 10px; font-size: 12px; }
.feed-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-block: 18px; }
.feed-filters :is(input[type="search"], select) { min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; font-size: 14px; }
.feed-filters input[type="search"] { flex: 1 1 190px; }
.feed-filters select { flex: 0 1 160px; }
.unanswered-toggle { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 12px; }
.unanswered-toggle input { width: 18px; height: 18px; accent-color: var(--green); }
.space-invitations { margin-bottom: 28px; }
.space-invitations .community-card { margin-bottom: 10px; }
.space-invite-form { padding-block: 10px 18px; }
.space-invite-form label { margin-bottom: 10px; }
.space-settings-fold { margin-block: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.space-settings-fold > summary, .bot-api-guide > summary { cursor: pointer; min-height: 44px; padding-block: 10px; font-size: 14px; font-weight: 650; }
.space-member-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding-block: 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.space-member-row > strong { margin-right: auto; font-size: 14px; }
.space-member-row > small { color: var(--muted); }
.space-rules-form, .space-developer-bots { margin-top: 18px; }
.space-rules-form h3, .space-developer-bots h3 { font-size: 17px; }
.space-faq-rule { padding: 12px; margin-block: 12px; border: 1px solid var(--line); border-radius: 10px; }
.installed-bot { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-block: 12px; overflow-wrap: anywhere; }
.installed-bot small { color: var(--muted); }
.installed-bot .social-inline-actions { margin-top: 12px; }
.bot-install-form { margin-block: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.bot-secret-area:not(:empty) { padding: 16px; margin-block: 16px; background: var(--green-pale); border-radius: 10px; }
.bot-secret-area > input { width: 100%; min-height: 44px; font-family: monospace; margin-bottom: 10px; }
.bot-secret-area > button { margin-right: 8px; }
.bot-api-guide pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; padding: 14px; border-radius: 8px; background: #edf0ed; font: 12px/1.7 monospace; }
body.theme-dark :is(.accepted-answer, .helper-welcome) { background: #243a2e; }
body.theme-dark .accepted-answer > strong { color: #a4d1b2; }
body.theme-dark .bot-badge { background: #303e5b; color: #c0cdf3; }
body.theme-dark .bot-api-guide pre { background: #19211e; }
body.theme-dark .community-file-download { color: #acd4d1; }
@media (max-width: 720px) { .feed-filters :is(input[type="search"], select) { font-size: 16px; } .feed-filters input[type="search"] { flex-basis: 100%; } .feed-filters select { flex: 1; } }

/* Independent public identity controls share the active account theme. */
#community-interests-form > label:not(.toggle-row) { display: block; margin: 16px 0; }
#public-profile-bio { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; min-height: 88px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; color: inherit; background: transparent; }
#public-profile-handle { overflow-wrap: anywhere; user-select: text; }
body.theme-dark .interest-option { color: #e8efeb; }
body.theme-dark .interest-option:has(input:checked) { background: #243d41; color: #d5efec; border-color: #4b777b; }

.public-picture-editor{display:flex;align-items:center;gap:20px;margin:20px 0;padding:16px;border:1px solid var(--g-divider,#dce2ed);border-radius:18px}.public-picture-preview{width:88px!important;height:88px!important;flex:0 0 88px;font-size:34px;overflow:hidden}.public-picture-preview img,.avatar img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.public-picture-editor input{display:block;max-width:100%;margin:8px 0}.public-picture-editor>div{min-width:0}.public-picture-editor p{margin-bottom:0}@media(max-width:480px){.public-picture-editor{align-items:flex-start;flex-direction:column;gap:8px}}
.community-moderation-entry{display:block;margin:12px 0;padding:14px 16px;border:1px solid var(--line,#dbe3df);border-radius:14px;background:var(--g-panel,#f4f7f5);color:var(--g-text,#243d36)}.community-moderation-entry>strong,.community-moderation-entry>small{display:block}.community-moderation-entry>small{margin-top:4px;line-height:1.5}.community-moderation-entry p{margin:9px 0;white-space:pre-wrap;overflow-wrap:anywhere}.community-moderation-activity{margin:12px 0}
.community-inline-emoji{display:inline-block!important;width:1.5em!important;height:1.5em!important;max-width:none!important;margin:0 .08em;vertical-align:-.35em;object-fit:contain}.community-emoji-choices{display:flex;flex-wrap:wrap;gap:8px;padding:10px 0}.community-emoji-choices button{width:46px;min-height:46px;padding:6px}.community-emoji-choices img{object-fit:contain}.community-emoji-picker{margin:6px 0 12px}.community-emoji-picker summary,.community-emoji-settings summary{cursor:pointer;font-weight:650}.community-emoji-settings{margin:16px 0}.community-emoji-upload{margin:14px 0}.community-emoji-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line,#dbe3df)}.community-emoji-row img{object-fit:contain;flex:none}.community-emoji-row span{flex:1;overflow-wrap:anywhere}
