/* Community surfaces share their own tokens across the three workspace skins. */
.community-dialog, .community-inbox, .community-settings, .community-inbox-trigger {
    --co-surface: #fffefa; --co-soft: #f5f3ed; --co-border: #e5e1d7;
    --co-text: #302f2b; --co-muted: #7c7b73; --co-accent: #a64e3d;
    --co-tint: #f6e9e3; --co-danger: #b33d38; --co-toggle-thumb: #fffefa;
    --co-primary: #9c503f; --co-primary-hover: #854032; --co-badge: #b54c40;
    --co-overlay: #18201db3; --co-source-overlay: #18201d66;
    --co-shadow: 0 24px 80px #161a1833; --co-inbox-shadow: 0 16px 54px #20271f26;
    box-sizing: border-box; color: var(--co-text); font-size: 14px;
}
body.theme-dark .community-dialog, body.theme-dark .community-inbox,
body.theme-dark .community-settings, body.theme-dark .community-inbox-trigger {
    --co-surface: #242723; --co-soft: #2d312c; --co-border: #41463d;
    --co-text: #eeece5; --co-muted: #b1b3a6; --co-accent: #e4a58d;
    --co-tint: #49382f; --co-danger: #f2a09a;
}
.community-dialog *, .community-inbox *, .community-settings * { box-sizing: border-box; }
.community-dialog [hidden], .community-inbox [hidden], .community-settings [hidden], .community-inbox-trigger[hidden], .community-unread[hidden] { display: none !important; }
.community-inbox-trigger {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; width: 38px; height: 38px; border: 1px solid var(--co-border);
    border-radius: 12px; background: var(--co-surface); cursor: pointer;
}
.community-inbox-trigger:hover { background: var(--co-soft); }
.community-inbox-trigger svg { width: 19px; height: 19px; }
.community-unread { position: absolute; right: -5px; top: -5px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--co-badge); font-size: 10px; font-weight: 700; border: 2px solid var(--co-surface); box-sizing: content-box; }
.community-dialog {
    position: fixed; padding: 0; margin: auto; inset: 0; width: min(440px, calc(100vw - 32px));
    max-height: min(740px, calc(100dvh - 40px)); border: 1px solid var(--co-border);
    border-radius: 20px; background: var(--co-surface); box-shadow: var(--co-shadow);
    overflow: hidden; overscroll-behavior: contain;
}
.community-dialog[open] { display: flex; flex-direction: column; }
.community-dialog::backdrop { background: var(--co-overlay, #18201db3); backdrop-filter: blur(5px); }
.community-dialog.is-conversation { width: min(570px, calc(100vw - 32px)); height: min(720px, calc(100dvh - 40px)); }
.community-dialog-header, .community-inbox-header { display: flex; align-items: center; gap: 12px; padding: 15px 19px; border-bottom: 1px solid var(--co-border); flex-shrink: 0; }
.community-dialog-header h2, .community-inbox-header > div { flex: 1; margin: 0; font-size: 15px; font-weight: 750; letter-spacing: .01em; }
.community-icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 0; min-width: 32px; height: 32px; background: transparent; border: 0; border-radius: 9px; font-size: 24px; line-height: 1; color: var(--co-muted); cursor: pointer; }
.community-icon-button:hover { background: var(--co-soft); color: var(--co-text); }
.community-back { font-size: 19px; }
.community-dialog-body { padding: 20px; overflow: auto; min-height: 0; }
.community-button { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 8px 16px; font-size: 13px; font-weight: 650; border: 1px solid var(--co-border); border-radius: 10px; color: var(--co-text); background: var(--co-surface); cursor: pointer; }
.community-button:hover { background: var(--co-soft); }
.community-button.is-primary { color: #fff; background: var(--co-primary); border-color: var(--co-primary); }
.community-button.is-primary:hover { background: var(--co-primary-hover); }
.community-button:disabled { opacity: .45; cursor: not-allowed; }
.community-text-button { padding: 7px 0; color: var(--co-accent); font-size: 12px; font-weight: 650; background: transparent; border: 0; cursor: pointer; }
.community-text-button:hover { text-decoration: underline; }
.community-status { padding: 10px 0; margin: 0; color: var(--co-muted); font-size: 13px; line-height: 1.65; text-align: center; }
.community-status:empty { display: none; }
.community-status.is-error { color: var(--co-danger); }
.community-avatar { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; border: 1px solid var(--co-border); background: var(--co-tint); color: var(--co-accent); border-radius: 50%; font-size: 16px; font-weight: 700; }
.community-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-avatar.is-large { width: 82px; height: 82px; font-size: 30px; box-shadow: 0 0 0 6px var(--co-soft); }
.community-person-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.community-display-name { min-width: 0; overflow-wrap: anywhere; }
.community-profile { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 8px 2px; container: community-profile-card / inline-size; }
.community-profile h3 { margin: 18px 0 6px; font-size: 22px; font-weight: 750; max-width: 100%; overflow-wrap: anywhere; }
.community-profile h3.community-person-name { display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, auto) minmax(max-content, 1fr); width: 100%; }
.community-profile-name-balance { display: inline-flex; justify-self: end; visibility: hidden; pointer-events: none; }
.community-profile h3 > .community-display-name { grid-column: 2; text-align: center; }
.community-profile h3 > .cie-role-badge { grid-column: 3; justify-self: start; }
@container community-profile-card (max-width: 340px) {
    .community-profile h3.community-person-name { grid-template-columns: minmax(0, 1fr); }
    .community-profile-name-balance { display: none; }
    .community-profile h3 > .community-display-name { grid-column: 1; }
    .community-profile h3 > .cie-role-badge { grid-column: 1; justify-self: center; }
}
.community-profile-details { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; }
.community-profile-details:empty { display: none; }
.community-profile-detail { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--co-border); color: var(--co-muted); background: var(--co-soft); font-size: 11px; line-height: 1.5; }
.community-profile-detail.is-gender { color: var(--co-accent); }
.community-gender-symbol { font-family: system-ui, sans-serif; font-size: 17px; line-height: 1; font-weight: 650; }
.community-relation { color: var(--co-accent); font-size: 11px; background: var(--co-tint); border-radius: 20px; padding: 3px 10px; }
.community-signature { color: var(--co-muted); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; font-size: 13px; margin: 18px 0; }
.community-stats { display: flex; align-items: center; justify-content: center; gap: 0; width: 100%; padding: 14px 0; border-top: 1px solid var(--co-border); border-bottom: 1px solid var(--co-border); margin: 2px 0 18px; }
.community-stat { display: flex; align-items: center; justify-content: center; gap: 8px; background: transparent; border: 0; color: var(--co-muted); font-size: 12px; width: 50%; cursor: pointer; padding: 4px 8px; }
.community-stat + .community-stat { border-left: 1px solid var(--co-border); }
.community-stat strong { color: var(--co-text); font-size: 20px; font-weight: 700; }
.community-stat:not(.is-private):hover strong { color: var(--co-accent); }
.community-profile-actions { display: flex; gap: 10px; width: 100%; margin-bottom: 9px; }
.community-profile-actions button { flex: 1; }
.community-profile-secondary { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.community-profile-report-trigger { color: var(--co-muted); }
.community-button.is-fixed-follow:disabled { opacity: 1; background: var(--co-soft); color: var(--co-muted); cursor: default; }
.community-stat.is-private { cursor: default; }
.community-follow-active { display: none; }
.is-following:focus-visible .community-follow-rest { display: none; }
.is-following:focus-visible .community-follow-active { display: inline; }
@media (hover: hover) and (pointer: fine) {
    .is-following:hover .community-follow-rest { display: none; }
    .is-following:hover .community-follow-active { display: inline; }
}
.community-comment-entry { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--co-border); border-radius: 10px; background: var(--co-soft); color: var(--co-text); text-align: left; cursor: pointer; }
.community-comment-entry:hover { background: var(--co-tint); }
.community-dialog-header h2 { min-width: 0; overflow-wrap: anywhere; }
.community-folder-entry { margin-bottom: 10px; }
.community-folder-entry .community-person-detail strong { white-space: normal; overflow-wrap: anywhere; }
.community-folder-icon { flex: 0 0 28px; width: 28px; height: 28px; color: var(--co-accent); }
.community-favorite-item { margin-top: 6px; }
.community-favorite-source { min-height: 40px; margin-bottom: 0; padding: 8px 12px; gap: 8px; border-radius: 8px; text-align: left; }
.community-favorite-source .community-chevron { font-size: 18px; line-height: 22px; }
.community-favorite-id { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 600 13px/22px ui-monospace, monospace; scrollbar-width: none; }
.community-favorite-id::-webkit-scrollbar { display: none; }
.community-favorite-item .community-status { text-align: left; }
.community-comment-intro { padding-bottom: 12px; }
.community-comment-intro > strong { display: block; font-size: 15px; overflow-wrap: anywhere; margin-bottom: 6px; }
.community-comment-intro .community-hint { margin-bottom: 0; }
.community-history-comment { padding: 16px 0; border-top: 1px solid var(--co-border); }
.community-history-meta { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 11px; color: var(--co-muted); }
.community-history-body { margin: 10px 0 5px; font-size: 13px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.community-comment-source { text-align: left; overflow-wrap: anywhere; max-width: 100%; line-height: 1.6; }
.community-history-comment .community-status { text-align: left; }
/* The full basket preview needs its own top layer above a community dialog. */
.community-preview-layer {
    position: fixed; inset: 0; margin: 0; padding: 0; border: 0;
    width: 100vw; height: 100dvh; max-width: none; max-height: none;
    background: transparent; color: inherit; overflow: hidden;
}
.community-preview-layer::backdrop { background: #18201d66; backdrop-filter: blur(2px); }
.community-preview-layer #previewQuestionsContent { max-height: calc(100dvh - 48px); }
@media (max-width: 767px) {
    .community-preview-layer #previewQuestionsContent { width: calc(100vw - 32px); }
    .community-preview-layer #previewQuestionsGrid { padding: 12px; }
    .community-preview-layer .question-card { display: flex !important; flex-direction: column !important; }
    .community-preview-layer .question-card > .p-7 { width: 100% !important; min-width: 0; }
    .community-preview-layer .question-card-meta { border-left: 0; }
    .community-preview-layer .question-card-meta h3 { font-size: 15px !important; }
    .community-preview-layer .question-card-meta > .text-\[14\.5px\] { font-size: 12px !important; line-height: 1.5 !important; }
    .community-preview-layer .question-card-meta > .mt-auto button { min-height: 40px !important; font-size: 12px !important; }
}
.community-hint { font-size: 11px; line-height: 1.6; color: var(--co-muted); margin: 4px 0 10px; }
.community-person-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 2px; text-align: left; background: transparent; border: 0; color: var(--co-text); cursor: pointer; }
.community-person-row:hover { background: var(--co-soft); border-radius: 9px; }
.community-people .community-person-row + .community-person-row { border-top: 1px solid var(--co-border); }
.community-person-detail { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; flex: 1; }
.community-person-detail strong { color: var(--co-text); font-size: 13px; font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-person-detail > span { max-width: 100%; color: var(--co-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-chevron { color: var(--co-muted); font-size: 21px; padding-right: 4px; }
.community-list-footer { text-align: center; margin-top: 10px; }
.community-inbox { position: fixed; z-index: 500; width: min(380px, calc(100vw - 24px)); overflow: auto; border: 1px solid var(--co-border); border-radius: 15px; background: var(--co-surface); box-shadow: var(--co-inbox-shadow); overscroll-behavior: contain; }
.community-inbox-header { position: sticky; top: 0; padding: 11px 16px; background: var(--co-surface); z-index: 1; }
.community-inbox-row { display: flex; width: 100%; align-items: center; gap: 10px; padding: 16px; border: 0; border-bottom: 1px solid var(--co-border); background: transparent; cursor: pointer; text-align: left; }
.community-inbox-row:hover { background: var(--co-soft); }
.community-inbox-row.is-unread { background: var(--co-tint); }
.community-inbox-notification { cursor: default; }
.community-inbox-notification:hover { background: transparent; }
.community-inbox-notification.is-unread:hover { background: var(--co-tint); }
.community-inbox-notification .community-system-label { display: block; color: var(--co-muted); font-size: 10px; margin-bottom: 3px; }
.community-notification-copy { color: var(--co-text); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.community-notification-name { display: inline; margin: 0; padding: 0; border: 0; background: transparent; color: var(--co-accent); font: inherit; font-weight: 750; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.community-notification-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.community-inbox-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; max-width: 90px; }
.community-inbox-meta time { color: var(--co-muted); font-size: 9px; white-space: nowrap; }
.community-row-unread { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; background: var(--co-primary); color: #fff; border-radius: 10px; font-size: 10px; }
.community-inbox-more { display: flex; margin: 14px auto; }
.community-empty-symbol { color: var(--co-accent); text-align: center; font-size: 35px; margin: 28px 0 12px; }
.community-empty-title { display: block; text-align: center; font-size: 14px; color: var(--co-text); }
.community-empty-copy { text-align: center; color: var(--co-muted); line-height: 1.8; font-size: 12px; padding: 0 30px; margin: 12px 0 30px; }
.community-inbox-list > .community-button { margin: 10px auto; display: flex; }
.is-conversation .community-dialog-body { display: flex; flex-direction: column; padding: 0; flex: 1; }
.community-conversation-peer { padding: 2px 20px; border-bottom: 1px solid var(--co-border); flex-shrink: 0; }
.community-conversation-peer .community-hint { padding-bottom: 5px; }
.community-message-log { flex: 1; overflow-y: auto; min-height: 90px; padding: 14px 20px; background: var(--co-soft); overscroll-behavior: contain; }
.community-earlier { display: block; margin: 0 auto 12px; }
.community-messages { display: flex; flex-direction: column; gap: 14px; }
.community-message { align-self: flex-start; max-width: 85%; min-width: 72px; }
.community-message p { margin: 0; padding: 11px 13px; background: var(--co-surface); border: 1px solid var(--co-border); border-radius: 13px 13px 13px 3px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; }
.community-message time { display: block; margin: 5px 2px 0; color: var(--co-muted); font-size: 10px; }
.community-message.is-mine { align-self: flex-end; }
.community-message.is-mine p { background: var(--co-tint); border-color: transparent; border-radius: 13px 13px 3px 13px; }
.community-message.is-mine time { text-align: right; }
.community-message-meta { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 2px; }
.community-message-meta time { margin-top: 0; }
.community-message.is-mine .community-message-meta { justify-content: flex-end; }
.community-report-trigger { font-size: 10px; color: var(--co-muted); padding: 4px 0; }
.community-report-form label { display: block; font-size: 12px; font-weight: 650; margin: 16px 0 8px; }
.community-report-quote { margin: 12px 0 18px; padding: 12px 14px; border-left: 3px solid var(--co-border); border-radius: 0 8px 8px 0; background: var(--co-soft); font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 140px; overflow: auto; }
.community-report-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; }
.community-report-card { padding: 16px; border: 1px solid var(--co-border); border-radius: 10px; margin: 12px 0; }
.community-report-card blockquote { margin: 12px 0; padding: 12px; border-left: 3px solid var(--co-accent); background: var(--co-soft); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.community-report-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.community-report-filters label { display: block; margin: 0 0 8px; }
.community-report-avatar { display: block; width: 80px; height: 80px; object-fit: contain; border-radius: 8px; margin: 12px 0; background: var(--co-soft); }
.community-report-confirmation { text-align: center; padding: 12px 0; }
.community-profile-report-preview .community-report-quote { margin-bottom: 0; }
.community-report-form .community-status { text-align: left; }
.community-composer { flex-shrink: 0; padding: 14px 20px; border-top: 1px solid var(--co-border); }
.community-composer textarea, .community-settings textarea, .community-settings select, .community-report-form textarea, .community-report-form select { display: block; width: 100%; padding: 10px 12px; font: inherit; line-height: 1.6; background: var(--co-surface); color: var(--co-text); border: 1px solid var(--co-border); border-radius: 9px; outline: none; }
.community-composer-input { position: relative; }
.community-composer textarea { resize: none; min-height: 76px; max-height: 120px; padding-right: 84px; }
.community-composer-send { position: absolute; right: 8px; bottom: 8px; min-height: 40px; padding: 8px 14px; }
.community-composer textarea:disabled { background: var(--co-soft); }
.community-composer textarea:focus, .community-settings textarea:focus, .community-settings select:focus, .community-report-form textarea:focus, .community-report-form select:focus { border-color: var(--co-accent); box-shadow: 0 0 0 2px var(--co-tint); }
.community-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.community-composer-foot .community-hint { margin: 0; font-size: 10px; }
.community-composer .community-status { text-align: left; padding-bottom: 0; }
.community-settings { padding: 22px; background: var(--co-surface); border: 1px solid var(--co-border); border-radius: 14px; }
.community-settings:empty { display: none; }
.community-settings-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.community-settings .community-stats { justify-content: flex-start; margin-bottom: 18px; }
.community-settings label { display: block; font-size: 12px; font-weight: 650; margin: 14px 0 8px; }
.community-settings .community-hint { display: block; margin-top: 4px; text-align: right; }
.community-settings textarea { resize: vertical; min-height: 75px; }
.community-settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 18px; }
.community-settings .community-status { text-align: left; }
.community-person-detail .community-person-name { display: flex; white-space: normal; overflow: visible; }
.community-settings-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.community-settings-summary, .community-settings-form { min-width: 0; }
.community-settings-heading h3, .community-form-title, .community-basic-fields > h3 { margin: 0; color: var(--co-text); font-size: 15px; font-weight: 750; }
.community-settings-identity { display: flex; align-items: center; gap: 18px; padding: 8px 4px; }
.community-settings-identity .community-avatar.is-large { width: 64px; height: 64px; font-size: 24px; }
.community-settings-identity .community-person-name { font-size: 18px; }
.community-settings-identity .community-profile-details { justify-content: flex-start; margin-top: 5px; }
.community-settings-summary .community-signature { margin-block: 16px; }
.community-settings-summary .community-stats { margin-bottom: 0; }
.community-settings-form { padding-top: 22px; border-top: 1px solid var(--co-border); }
.community-list-privacy { margin: 22px 0 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--co-border); min-width: 0; }
.community-list-privacy legend { padding: 0 6px 0 0; color: var(--co-text); font-size: 12px; font-weight: 650; }
.community-settings .community-privacy-option { position: relative; display: flex; align-items: center; gap: 12px; margin: 0; padding: 9px 0; min-height: 44px; cursor: pointer; }
.community-privacy-option input[type="checkbox"] { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 44px; height: 26px; margin: 0; opacity: 0; z-index: 1; cursor: pointer; }
.community-privacy-track { position: relative; flex: 0 0 44px; width: 44px; height: 26px; border: 1px solid var(--co-border); border-radius: 999px; background: var(--co-soft); transition: background-color .16s, border-color .16s; }
.community-privacy-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--co-toggle-thumb); box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .16s, background-color .16s; }
.community-privacy-option input:checked + .community-privacy-track { background: var(--co-accent); border-color: var(--co-accent); }
.community-privacy-option input:checked + .community-privacy-track::after { transform: translateX(18px); }
.community-privacy-option input:focus-visible + .community-privacy-track { outline: 2px solid var(--co-accent); outline-offset: 3px; }
.community-privacy-option input:disabled + .community-privacy-track { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .community-privacy-track, .community-privacy-track::after { transition: none; } }
.community-settings .community-list-privacy .community-hint { text-align: left; line-height: 1.7; }
.community-settings [aria-invalid="true"] { border-color: var(--co-danger); }
.community-basic-fields .community-hint { text-align: left; }
.community-basic-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; gap: 18px; margin-top: 16px; }
.community-field { min-width: 0; }
.community-basic-grid label, .community-birthday legend { margin: 0 0 8px; padding: 0; font-size: 12px; font-weight: 650; color: var(--co-text); }
.community-birthday { border: 0; padding: 0; margin: 0; }
.community-birthday-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.community-birthday-inputs select { min-width: 0; }
.community-birthday-inputs .community-text-button { padding: 10px 2px; }
@media (min-width: 1200px) {
    .community-settings-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; }
    .community-settings-form { padding-top: 0; padding-left: 28px; border-top: 0; border-left: 1px solid var(--co-border); }
}
.comment-profile-trigger { align-self: flex-start; border: 0; background: transparent; text-align: left; cursor: pointer; padding: 0; color: inherit; }
.comment-name.comment-profile-trigger:hover { text-decoration: underline; text-underline-offset: 3px; }
.community-dialog button:focus-visible, .community-inbox button:focus-visible, .community-settings button:focus-visible, .community-inbox-trigger:focus-visible, .comment-profile-trigger:focus-visible { outline: 2px solid var(--co-accent, #a64e3d); outline-offset: 3px; }
@media (max-width: 767px) {
    .mobile-topbar-actions .community-inbox-trigger { width: 29px; height: 29px; border-radius: 9px; }
    .mobile-topbar-actions .community-inbox-trigger svg { width: 16px; height: 16px; }
    .community-unread { min-width: 13px; height: 13px; font-size: 8px; right: -4px; top: -4px; }
    .community-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); border-radius: 16px; }
    .community-dialog.is-conversation { width: calc(100vw - 20px); height: calc(100dvh - 24px); }
    .community-dialog-header { padding: 11px 14px; }
    .community-dialog-body { padding: 16px; }
    .community-conversation-peer { padding-inline: 14px; }
    .community-message-log { padding: 12px 14px; }
    .community-composer { padding: 10px 14px max(12px, env(safe-area-inset-bottom)); }
    .community-composer textarea { min-height: 68px; max-height: 90px; }
    .community-settings { padding: 17px; }
    .community-settings textarea, .community-settings select, .community-report-form textarea, .community-report-form select { font-size: 16px; }
    .community-report-filters { grid-template-columns: minmax(0, 1fr); }
    .community-basic-grid { grid-template-columns: minmax(0, 1fr); }
    .community-settings-actions { flex-wrap: wrap; gap: 10px; }
    .community-inbox-meta { max-width: 76px; }
    .community-inbox-row { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) { .community-dialog, .community-inbox { scroll-behavior: auto; } }

/* Mutual-follow voice notes share the existing private-message palette. */
.community-composer textarea.is-voice-enabled { touch-action: none; -webkit-touch-callout: none; }
.community-voice-status { margin-top: 8px; padding: 11px 14px; border-radius: 10px; background: var(--co-tint); color: var(--co-accent); text-align: center; font-size: 13px; font-weight: 650; }
.community-voice-status.is-cancelling { background: var(--co-danger); color: #fff; }
.community-message-delivery { color: var(--co-muted); font-size: 10px; }
.community-message-delivery.is-error, .community-voice-failure { color: var(--co-danger); }
.community-voice-failure { margin-top: 6px; max-width: 240px; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.community-send-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--co-border); border-top-color: var(--co-accent); border-radius: 50%; animation: community-send-spin .8s linear infinite; }
.community-message-delivery.is-error::before { content: '!'; display: inline-grid; place-items: center; width: 12px; height: 12px; margin-right: 4px; border: 1px solid currentColor; border-radius: 50%; font-size: 9px; font-weight: 700; }
@keyframes community-send-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .community-send-spinner { animation: none; } }
.community-voice-message { display: flex; align-items: center; gap: 9px; max-width: 100%; padding-left: 5px; }
.community-message.is-mine .community-voice-message { justify-content: flex-end; padding-left: 0; padding-right: 5px; }
.community-voice-bubble { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 9px; max-width: 100%; min-height: 46px; padding: 10px 14px; border: 0; border-radius: 9px; background: var(--co-surface); color: var(--co-text); font: inherit; font-weight: 600; cursor: pointer; }
.community-voice-bubble::before { content: ''; position: absolute; left: -5px; top: 16px; width: 8px; height: 12px; background: inherit; clip-path: polygon(100% 0, 0 50%, 100% 100%); }
.community-message.is-mine .community-voice-bubble { flex-direction: row-reverse; background: var(--co-tint); }
.community-message.is-mine .community-voice-bubble::before { left: auto; right: -5px; transform: rotate(180deg); }
.community-voice-bubble:disabled { opacity: .6; cursor: wait; }
.community-voice-wave { display: block; width: 23px; height: 23px; flex: 0 0 23px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.community-message.is-mine .community-voice-wave { transform: scaleX(-1); }
.community-voice-duration { font-size: 15px; line-height: 1; white-space: nowrap; }
.community-voice-unread { width: 7px; height: 7px; border-radius: 50%; background: var(--co-danger); flex: 0 0 7px; }
.community-voice-bubble.is-playing .community-wave-1 { animation: community-voice-wave-middle 1s steps(1) infinite; }
.community-voice-bubble.is-playing .community-wave-2 { animation: community-voice-wave-outer 1s steps(1) infinite; }
@keyframes community-voice-wave-middle { 0%, 100% { opacity: .15; } 33%, 66% { opacity: 1; } }
@keyframes community-voice-wave-outer { 0%, 33%, 100% { opacity: .15; } 66% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .community-voice-bubble.is-playing .community-voice-wave path { animation: none; } }

/* Portal dialogs and popovers follow the workspace skin, including live switches.
   Warm Paper also carries style-default, so Classic must exclude its skin. */
body.style-default:not(.skin-warm-paper) :is(.community-dialog, .community-inbox, .community-settings, .community-inbox-trigger) {
    --co-surface: #fff; --co-soft: #f8fafc; --co-border: #e2e8f0;
    --co-text: #1e293b; --co-muted: #64748b; --co-accent: #dc343c;
    --co-tint: #fff1f2; --co-danger: #dc2626; --co-toggle-thumb: #fff;
    --co-primary: #ff4b4b; --co-primary-hover: #ed343b; --co-badge: #ef4444;
    --co-overlay: rgb(15 23 42 / 48%); --co-source-overlay: rgb(15 23 42 / 24%);
    --co-shadow: 0 24px 72px rgb(15 23 42 / 22%); --co-inbox-shadow: 0 12px 36px rgb(15 23 42 / 16%);
}
body.style-default.theme-dark:not(.skin-warm-paper) :is(.community-dialog, .community-inbox, .community-settings, .community-inbox-trigger) {
    --co-surface: var(--dark-surface, #202020); --co-soft: var(--dark-surface-2, #262626);
    --co-border: var(--dark-border, #3a3a3a); --co-text: var(--dark-text, #f2f2f2);
    --co-muted: #b0b0b0; --co-accent: #ff8585; --co-tint: #40292b; --co-danger: #fca5a5;
    --co-overlay: rgb(0 0 0 / 64%); --co-source-overlay: rgb(0 0 0 / 34%);
    --co-shadow: 0 24px 72px rgb(0 0 0 / 50%); --co-inbox-shadow: 0 14px 42px rgb(0 0 0 / 42%);
}
body.style-liquid-glass :is(.community-dialog, .community-inbox, .community-settings, .community-inbox-trigger) {
    --co-surface: var(--glass-fill-strong, rgb(255 255 255 / 70%));
    --co-soft: rgb(238 243 252 / 58%); --co-border: var(--glass-border, rgb(255 255 255 / 60%));
    --co-text: #1e293b; --co-muted: #536176; --co-accent: #cf3549;
    --co-tint: rgb(255 220 227 / 70%); --co-danger: #d92d45; --co-toggle-thumb: #fff;
    --co-primary: #ff4b4b; --co-primary-hover: #f5373d; --co-badge: #ef4444;
    --co-overlay: rgb(226 233 248 / 32%); --co-source-overlay: rgb(218 227 246 / 22%);
    --co-shadow: var(--glass-shadow), var(--glass-highlight);
    --co-inbox-shadow: var(--glass-shadow), var(--glass-highlight);
    background-image: var(--glass-sheen);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    box-shadow: var(--co-shadow);
}
body.style-liquid-glass.theme-dark :is(.community-dialog, .community-inbox, .community-settings, .community-inbox-trigger) {
    --co-soft: rgb(16 20 31 / 36%); --co-text: #f1f5f9; --co-muted: #b6c0d1;
    --co-accent: #ffabb7; --co-tint: rgb(148 59 81 / 38%); --co-danger: #fda4af;
    --co-overlay: rgb(6 9 18 / 44%); --co-source-overlay: rgb(6 9 18 / 28%);
}
body.style-liquid-glass :is(.community-dialog-header, .community-inbox-header) {
    background-color: var(--co-surface); background-image: var(--glass-sheen);
}
body.style-liquid-glass .community-inbox-header {
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
body.style-liquid-glass :is(.community-button, .community-comment-entry, .community-avatar, .community-report-card) {
    background-image: var(--glass-sheen); box-shadow: var(--glass-highlight);
}
body.style-liquid-glass .community-button.is-primary {
    background-image: var(--btn-gloss); box-shadow: 0 4px 12px rgb(255 75 75 / 22%), inset 0 1px 0 rgb(255 255 255 / 22%);
}
body.style-liquid-glass :is(.community-composer, .community-settings, .community-report-form) :is(textarea, select) {
    background-color: var(--co-surface) !important; color: var(--co-text) !important;
    border-color: var(--co-border) !important;
}
body.style-liquid-glass :is(.community-composer, .community-settings, .community-report-form) :is(textarea, select):focus {
    border-color: var(--co-accent) !important;
}
body:not(.skin-warm-paper) .community-dialog .comments-panel {
    --cm-surface: var(--co-surface); --cm-sunken: var(--co-soft); --cm-line: var(--co-border);
    --cm-text: var(--co-text); --cm-muted: var(--co-muted); --cm-accent: var(--co-accent);
    --cm-accent-soft: var(--co-tint); --cm-danger: var(--co-danger);
}

/* Account sections flow with the existing page; only their controls are boxed. */
#accountModal :is(#communitySettingsMount, #communityBasicFields) {
    padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
}
