/* Scoped community UI: intentionally does not alter site headers, footers or profiles. */
.community-page, [data-community-widget], .community-overlay, .community-notices {
    --community-bg: #16213e;
    --community-border: rgba(184, 199, 228, .22);
    --community-text: #f1f1f1;
    --community-muted: #c0c8da;
    --community-accent: #ff829a;
    color: var(--community-text);
    font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-wrap: anywhere;
}
.community-page *, [data-community-widget] *, .community-overlay * { box-sizing: border-box; }
.community-page { max-width: 980px; margin: 32px auto 56px; padding: 0 20px; min-height: 50vh; }
.community-page [hidden], [data-community-widget] [hidden], .community-overlay [hidden] { display: none !important; }
.community-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 20px; }
.community-heading h1 { font-size: clamp(26px, 4vw, 36px); margin: 0 0 8px; line-height: 1.3; }
.community-eyebrow { color: var(--community-accent); margin: 0 0 8px; font-size: 13px; letter-spacing: .08em; }
.community-muted, .community-meta { color: var(--community-muted); }
.community-muted { margin: 6px 0 12px; }
.community-actions, .community-tabs, .community-pagination, .community-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.community-heading > .community-actions { flex-shrink: 0; }
.community-btn, .community-page a.community-btn, [data-community-widget] a.community-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    min-height: 44px; padding: 9px 15px; border: 1px solid var(--community-border); border-radius: 10px;
    background: #1d2b49; color: var(--community-text); font: inherit; line-height: 1.4; text-decoration: none; cursor: pointer;
    touch-action: manipulation;
}
.community-btn:hover { background: #293a5d; border-color: #8c9bb8; }
.community-btn[aria-pressed="true"], .community-btn.community-primary { background: #c72e50; border-color: #f87692; color: #fff; }
.community-btn.community-danger { color: #ffafb9; border-color: #b35169; }
.community-btn:disabled { opacity: .6; cursor: not-allowed; }
.community-page :focus-visible, [data-community-widget] :focus-visible, .community-overlay :focus-visible, .community-notices :focus-visible { outline: 3px solid #a4cfff; outline-offset: 3px; }
.community-tabs { margin: 12px 0; }
.community-types { padding-bottom: 12px; border-bottom: 1px solid var(--community-border); }
.community-context, .community-session:not(:empty) { margin: 14px 0; padding: 12px 16px; border: 1px solid var(--community-border); border-radius: 10px; background: #192944; }
.community-session:empty { display: none; }
.community-posts { display: grid; gap: 16px; margin: 18px 0; }
.community-card { background: var(--community-bg); border: 1px solid var(--community-border); border-radius: 16px; padding: 20px; min-width: 0; }
.community-author { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.community-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #314261; flex-shrink: 0; }
.community-avatar-fallback { display: inline-flex; justify-content: center; align-items: center; font-weight: 700; color: #fff; }
.community-author-main { flex: 1; min-width: 0; }
.community-author-name { color: #fff; font-weight: 650; text-decoration: none; }
.community-meta { font-size: 12px; }
.community-content { white-space: pre-wrap; word-break: break-word; margin: 12px 0; }
.community-card.compact .community-content { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.community-page a:not(.community-btn), [data-community-widget] a:not(.community-btn), .community-overlay a:not(.community-btn) { color: #a9c9ff; }
.community-badge { display: inline-block; color: #ffd2df; background: #3e2549; padding: 2px 9px; margin: 0 6px 4px 0; border-radius: 6px; font-size: 12px; }
.community-device { display: block; padding: 10px 12px; border: 1px solid var(--community-border); border-radius: 9px; margin: 12px 0; text-decoration: none; }
.community-images { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.community-images a { display: block; min-width: 0; }
.community-images img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #263653; }
.community-images.single { grid-template-columns: minmax(0, 420px); }
.community-images.single img { aspect-ratio: auto; max-height: 540px; object-fit: contain; }
.community-card-actions { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--community-border); }
.community-state { text-align: center; padding: 28px 16px; background: #19243b; border: 1px dashed var(--community-border); border-radius: 12px; }
.community-state p { margin-bottom: 12px; white-space: pre-wrap; }
.community-error { color: #ffc3cc; }
.community-pagination { justify-content: center; margin: 20px 0; }
[data-community-widget] { margin-block: 24px; padding: 20px; background: #16213e; border: 1px solid var(--community-border); border-radius: 16px; }
[data-community-widget] h2 { font-size: 21px; margin: 0 0 8px; }
.community-widget-tools { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
[data-community-widget] .community-card { padding: 16px; background: #192842; }
.community-comments { margin-top: 24px; }
.community-comments h2 { font-size: 21px; margin-bottom: 14px; }
.community-comment { padding: 18px 0; border-bottom: 1px solid var(--community-border); scroll-margin-top: 120px; }
.community-comment.is-reply { margin-left: 20px; padding-left: 14px; border-left: 2px solid #586a8b; }
.community-comment.is-focus { padding: 18px 14px; border: 2px solid #ff94a9; border-radius: 10px; background: #352641; }
.community-comment .community-content { margin: 8px 0; }
.community-comment .community-author { margin-bottom: 8px; }
.community-reply-hint { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.community-form { display: grid; gap: 14px; }
.community-field { display: grid; gap: 6px; text-align: left; }
.community-field input, .community-field textarea, .community-field select {
    width: 100%; min-height: 44px; color: #fff; background: #101c32; border: 1px solid #647492;
    border-radius: 9px; padding: 10px 12px; font: inherit;
}
.community-field textarea { min-height: 115px; resize: vertical; }
.community-field select option { background: #16213e; color: #fff; }
.community-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--community-border); border-radius: 9px; }
.community-toggle input[type="checkbox"] { width: 24px; height: 24px; min-height: 24px; flex-shrink: 0; padding: 0; accent-color: #c72e50; cursor: pointer; }
.community-field input:disabled { opacity: .6; cursor: not-allowed; }
.community-copy-link { width: 100%; min-width: 0; min-height: 44px; padding: 10px; border: 1px solid #8393af; border-radius: 8px; background: #101c32; color: #fff; font: inherit; }
.community-location { margin: 6px 0; }
.community-counter { text-align: right; color: var(--community-muted); font-size: 12px; }
.community-overlay { position: fixed; inset: 0; z-index: 12000; background: rgba(4, 9, 22, .83); display: flex; align-items: center; justify-content: center; padding: 20px; }
.community-dialog { width: min(700px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; background: #16213e; border: 1px solid #667796; border-radius: 16px; padding: 22px; box-shadow: 0 20px 70px #0008; }
.community-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.community-dialog-head h2 { font-size: 22px; margin: 0; }
.community-dialog .community-actions { justify-content: flex-end; }
.community-upload-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.community-upload { padding: 8px; border: 1px solid var(--community-border); border-radius: 9px; min-width: 0; }
.community-upload img { display: block; width: 100%; height: 95px; object-fit: cover; border-radius: 5px; }
.community-upload p { font-size: 12px; margin: 5px 0; }
.community-upload .community-btn { width: 100%; margin-top: 5px; padding: 8px 4px; }
.community-device-results { display: grid; gap: 6px; }
.community-device-results .community-btn { justify-content: flex-start; text-align: left; }
.community-notices { position: fixed; z-index: 13000; right: 16px; bottom: 18px; width: min(440px, calc(100% - 32px)); max-height: 55vh; overflow-y: auto; }
.community-notice { padding: 14px; margin-top: 8px; border-radius: 12px; border: 1px solid #9a647a; background: #25314b; box-shadow: 0 5px 24px #0007; }
.community-notice p { margin: 0 0 8px; white-space: pre-wrap; }
.community-question-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.community-badge.community-solved { color: #c7ffe4; background: #204b3d; border: 1px solid #70b995; }
.community-comment.is-accepted { padding-inline: 12px; border-left: 3px solid #70b995; background: #19382f; border-radius: 8px; }
.community-subscription { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--community-border); }
.community-subscription .community-field { max-width: 260px; }
.community-subscription-row { display: grid; gap: 12px; margin: 12px 0; padding: 16px; border: 1px solid var(--community-border); border-radius: 12px; }
.community-subscription-row .community-actions, .community-subscription .community-actions { justify-content: flex-start; }
[data-community-device-discussions] > .community-btn { margin: 4px 8px 4px 0; }
.community-block-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--community-border); }
.community-block-row .community-author-name { flex: 1; }
@media (max-width: 640px) {
    .community-page { padding: 0 14px; margin-top: 20px; }
    .community-heading { flex-direction: column; gap: 12px; }
    .community-heading > .community-actions { width: 100%; }
    .community-card { padding: 15px; border-radius: 12px; }
    [data-community-widget] { padding: 15px; }
    .community-btn { padding: 9px 11px; }
    .community-overlay { padding: 8px; align-items: flex-end; }
    .community-dialog { padding: 16px; max-height: calc(100dvh - 16px); border-radius: 16px 16px 8px 8px; }
    .community-comment.is-reply { margin-left: 8px; padding-left: 10px; }
    .community-upload-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .community-question-filters { grid-template-columns: minmax(0, 1fr); }
    .community-subscription .community-field { max-width: none; }
    .community-heading > .community-actions { flex-shrink: 1; }
    .community-subscription-row { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .community-page *, [data-community-widget] *, .community-overlay * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
