.community-page{min-height:calc(100vh - 70px);padding-bottom:110px}.community-hero{padding:72px 0 30px}.community-kicker{display:inline-flex;padding:7px 12px;border-radius:999px;background:var(--accent);color:#111;font-size:12px;font-weight:800;letter-spacing:.03em}.community-hero h1{font-size:clamp(36px,6vw,64px);margin-top:18px;letter-spacing:-.05em}.community-hero p{max-width:700px;margin-top:12px;color:var(--muted);font-size:16px}.community-shell{max-width:900px}.community-note{padding:14px 16px;border:1px solid var(--border);border-radius:18px;background:var(--card-bg);color:var(--muted);margin-bottom:16px}.community-tabs{display:flex;gap:8px;padding:6px;border:1px solid var(--border);background:var(--card-bg);border-radius:18px;margin:0 0 20px}.community-tab{flex:1;border:0;background:transparent;color:var(--muted);font-weight:800;padding:12px 14px;border-radius:13px;cursor:pointer}.community-tab.is-active{background:var(--accent);color:#111;box-shadow:0 5px 18px rgba(245,196,0,.16)}.community-section-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin:8px 0 16px}.section-eyebrow{font-size:11px;letter-spacing:.12em;font-weight:800;color:var(--accent)}.community-section-head h2{margin:5px 0 0;font-size:28px;letter-spacing:-.03em}.section-access{font-size:12px;color:var(--muted);padding:7px 10px;border:1px solid var(--border);border-radius:999px}.community-feed{display:grid;gap:12px}.community-loading,.empty-community{padding:36px 18px;text-align:center;color:var(--muted);border:1px dashed var(--border);border-radius:20px}.news-card{border:1px solid var(--border);border-radius:20px;background:var(--card-bg);padding:20px;box-shadow:var(--shadow-sm)}.news-card-head{display:flex;justify-content:space-between;align-items:center;gap:14px}.news-brand{font-size:10px;font-weight:900;letter-spacing:.12em;color:#111;background:var(--accent);border-radius:999px;padding:6px 9px}.news-author{display:flex;align-items:center;gap:10px;margin-left:auto}.news-author strong,.news-author span{display:block}.news-author span{font-size:11px;color:var(--muted);margin-top:2px}.news-card time{font-size:11px;color:var(--muted);white-space:nowrap}.news-body{margin:18px 0;font-size:16px;line-height:1.7;white-space:pre-wrap;word-break:break-word}.news-actions,.chat-actions{display:flex;gap:8px;align-items:center}.post-avatar,.chat-avatar .post-avatar{width:38px;height:38px;border-radius:50%;object-fit:cover;background:var(--input-bg);border:1px solid var(--border);display:grid;place-items:center;font-size:12px;font-weight:800}.reaction-btn,.chat-admin{border:1px solid var(--border);background:var(--surface);color:var(--ink);border-radius:999px;padding:7px 11px;font-size:12px;cursor:pointer}.reaction-btn.active{background:var(--accent);border-color:var(--accent);color:#111}.chat-admin{font-size:11px}.discussion-message{display:flex;gap:9px;align-items:flex-end;max-width:78%}.discussion-message.is-mine{margin-left:auto;flex-direction:row-reverse}.chat-bubble{background:var(--card-bg);border:1px solid var(--border);border-radius:18px 18px 18px 5px;padding:10px 13px;box-shadow:var(--shadow-sm);min-width:0}.discussion-message.is-mine .chat-bubble{border-radius:18px 18px 5px 18px;background:color-mix(in srgb,var(--accent) 17%,var(--card-bg))}.chat-meta{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-bottom:5px}.chat-meta strong{font-size:12px}.chat-meta span,.chat-meta time{font-size:10px;color:var(--muted)}.chat-text{font-size:14px;line-height:1.55;white-space:pre-wrap;word-break:break-word}.chat-actions{margin-top:8px}.community-composer{position:fixed;left:0;right:0;bottom:0;z-index:2000;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(18px);border-top:1px solid var(--border);box-shadow:0 -10px 30px rgba(0,0,0,.08)}.community-composer-inner{padding:10px 18px 12px}.composer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:7px}.composer-context{font-size:11px;color:var(--muted);margin-left:8px}.approval-pill{font-size:10px;font-weight:800;border-radius:999px;padding:5px 9px;background:color-mix(in srgb,var(--accent) 18%,var(--card-bg));color:var(--ink);border:1px solid var(--border)}.composer-row{display:flex;gap:9px;align-items:flex-end}.community-composer textarea{display:block;flex:1;min-width:0;min-height:42px;max-height:120px;padding:11px 13px;border:1px solid var(--border);border-radius:16px;background:var(--input-bg);color:var(--ink);outline:none;resize:none}.community-composer textarea:focus{border-color:var(--accent)}.community-post-btn{background:#f5c400!important;color:#111!important;border:2px solid #f5c400!important;border-radius:999px!important;height:42px;padding-inline:18px}.composer-options{margin-top:7px}.admin-news-toggle{display:inline-flex;align-items:center;gap:7px;font-size:11px;font-weight:800}.admin-news-toggle small{font-weight:500;color:var(--muted)}.composer-foot{display:flex;justify-content:space-between;font-size:10px;color:var(--muted);margin-top:6px}.community-ad-wrap{margin-top:0;margin-bottom:18px}.community-shell>.ad-slot,.community-shell>.adsense-slot{margin-bottom:14px}.toast{z-index:3000}@media(max-width:700px){.community-hero{padding:48px 0 24px}.community-hero h1{font-size:40px}.community-shell{padding-inline:12px}.community-tabs{position:sticky;top:8px;z-index:20}.community-section-head{align-items:flex-start;flex-direction:column;gap:8px}.news-card{padding:16px}.news-card-head{align-items:flex-start}.news-card time{font-size:10px}.discussion-message{max-width:92%}.community-composer-inner{padding-inline:12px}.composer-head{align-items:flex-start}.composer-context{display:block;margin:2px 0 0}.composer-access{display:none}.admin-news-toggle{flex-wrap:wrap}.admin-news-toggle small{width:100%;margin-left:25px}}

/* Compact community UI — keeps the chat-app feel without oversized cards. */
.community-page{padding-bottom:92px}
.community-hero{padding:48px 0 22px}
.community-hero h1{font-size:clamp(30px,4.8vw,52px);margin-top:14px}
.community-hero p{max-width:640px;font-size:14px;margin-top:9px}
.community-note{padding:11px 13px;border-radius:14px;margin-bottom:12px}
.community-tabs{gap:6px;padding:4px;border-radius:14px;margin-bottom:14px}
.community-tab{padding:9px 11px;border-radius:10px;font-size:13px}
.community-section-head{gap:14px;margin:6px 0 12px}
.community-section-head h2{font-size:23px}
.community-feed{gap:9px}
.news-card{border-radius:15px;padding:15px}
.news-body{margin:13px 0;font-size:14px;line-height:1.58}
.post-avatar,.chat-avatar .post-avatar{width:34px;height:34px}
.discussion-message{max-width:74%}
.chat-bubble{border-radius:15px 15px 15px 5px;padding:8px 11px}
.discussion-message.is-mine .chat-bubble{border-radius:15px 15px 5px 15px}
.chat-text{font-size:13px;line-height:1.48}
.community-composer-inner{padding:8px 16px 9px}
.community-composer textarea{min-height:40px;padding:9px 11px;border-radius:14px}
.community-post-btn{height:40px;padding-inline:15px}
@media(max-width:700px){
 .community-hero{padding:34px 0 18px}
 .community-hero h1{font-size:32px}
 .community-shell{padding-inline:10px}
 .community-tabs{position:sticky;top:6px}
 .news-card{padding:13px}
 .discussion-message{max-width:88%}
 .community-composer-inner{padding-inline:10px}
}

/* Final desktop/mobile navigation polish */
@media (min-width:701px){
  .community-tabs{max-width:760px;margin-left:auto;margin-right:auto;gap:5px;padding:4px;border-radius:14px;}
  .community-tab{padding:8px 10px;font-size:12px;border-radius:10px;}
  .community-section-head h2{font-size:21px;}
}
@media (max-width:700px){
  /* The site header is sticky; keep the sticky community tabs below it. */
  .community-tabs{top:68px!important;z-index:40;}
  .community-page{padding-top:2px;}
}


/* Community final positioning + readability fixes */
.community-tabs{border-radius:20px;overflow:hidden;}
[data-theme="light"] .community-tab.is-active{color:#fff!important;}
[data-theme="white"] .community-tab.is-active{color:#fff!important;}

/* Keep the fixed composer from covering the latest post/message. */
.community-page{padding-bottom:150px;}

@media (min-width:701px){
  .community-tabs{border-radius:20px;}
}

@media (max-width:700px){
  /* The community header is sticky; reserve its full height before the kicker. */
  .community-hero{padding-top:92px!important;}
  .community-kicker{position:relative;z-index:2;}
  .community-page{padding-bottom:170px!important;}
  .community-tabs{top:76px!important;border-radius:16px;overflow:hidden;}
}

/* Community card hierarchy + latest news */
.news-card{display:flex;flex-direction:column;overflow:hidden;padding:0;}
.news-card-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;padding:14px 16px;border-bottom:1px solid var(--border);}
.news-card-type{display:flex;align-items:center;gap:7px;flex-wrap:wrap;}
.news-brand{display:inline-flex;align-items:center;justify-content:center;min-width:52px;}
.latest-news-tag{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:5px 8px;background:var(--accent);color:#111;font-size:9px;font-weight:900;letter-spacing:.08em;}
.news-author{margin-left:0;min-width:0;}
.news-author strong{font-size:12px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.news-author span{font-size:10px;}
.news-card time{justify-self:end;}
.news-content{padding:18px 18px 16px;}
.news-body{margin:0;font-size:15px;line-height:1.7;}
.news-actions{padding:11px 16px;border-top:1px solid var(--border);background:color-mix(in srgb,var(--surface) 70%,var(--card-bg));}
[data-theme="light"] .community-tab.is-active,
[data-theme="light"] .community-post-btn,
[data-theme="light"] .reaction-btn.active{color:#fff!important;}
[data-theme="light"] .community-tab.is-active{background:var(--accent);}
[data-theme="white"] .community-tab.is-active,
[data-theme="white"] .community-post-btn,
[data-theme="white"] .reaction-btn.active{color:#fff!important;}
@media(max-width:700px){
  .news-card-head{grid-template-columns:1fr auto;gap:10px;padding:12px 13px;}
  .news-card-type{grid-column:1 / -1;}
  .news-author{grid-column:1;}
  .news-card time{grid-column:2;grid-row:2;}
  .news-content{padding:15px 13px 14px;}
  .news-actions{padding:10px 13px;}
}


/* Community final contrast + identity cleanup */
/* Any blue-accent pill/badge in the white/light theme uses white text. */
:root .community-kicker,
:root .community-tab.is-active,
:root .reaction-btn.active,
:root .news-brand,
:root .latest-news-tag,
[data-theme="light"] .community-kicker,
[data-theme="light"] .community-tab.is-active,
[data-theme="light"] .news-brand,
[data-theme="light"] .latest-news-tag,
[data-theme="white"] .community-kicker,
[data-theme="white"] .community-tab.is-active,
[data-theme="white"] .news-brand,
[data-theme="white"] .latest-news-tag {
  color:#fff !important;
}

/* Keep the white-theme composer Send label black for maximum contrast on yellow. */
:root .community-post-btn,
[data-theme="light"] .community-post-btn,
[data-theme="white"] .community-post-btn {
  color:#111 !important;
}

/* No artificial initials such as “CM” when a member has no profile photo. */
.chat-avatar:empty { display:none; }
.discussion-message:has(.chat-avatar:empty) { gap:0; }
.post-avatar { display:block; }

/* Yellow theme: black text on yellow surfaces. */
[data-theme="colorful"] .community-kicker,
[data-theme="colorful"] .community-tab.is-active,
[data-theme="colorful"] .news-brand,
[data-theme="colorful"] .latest-news-tag,
[data-theme="colorful"] .reaction-btn.active{color:#111!important;}

/* Admin-published external images */
.post-image-wrap{margin-top:14px;border-radius:16px;overflow:hidden;background:var(--card-bg,#f5f5f5)}
.post-image{display:block;width:100%;max-height:520px;object-fit:cover}

/* Admin community composer: optional external image URL */
.community-image-url-row{display:flex;flex-direction:column;gap:6px;margin-top:10px;padding:12px 14px;border:1px solid var(--border-color,rgba(127,127,127,.22));border-radius:14px;background:var(--surface-2,rgba(127,127,127,.06));}
.community-image-url-label{font-size:12px;font-weight:700;letter-spacing:.02em;}
.community-image-url-input{width:100%;box-sizing:border-box;border:1px solid var(--border-color,rgba(127,127,127,.25));border-radius:10px;padding:10px 12px;background:var(--input-bg,transparent);color:inherit;outline:none;}
.community-image-url-input:focus{border-color:currentColor;}
.community-image-url-row small{font-size:11px;opacity:.68;line-height:1.4;}

/* Keep Community navbar controls on the far right and pinned while scrolling */
.community-page ~ *{}
.site-header{position:fixed!important;top:8px!important;left:0!important;right:0!important;width:100%!important;z-index:10000!important;transform:none!important;}
.site-header .header-actions{margin-left:auto!important;}
.site-header .header-inner{justify-content:flex-start;}

/* WhatsApp-style community chat refinements */
.discussion-message{max-width:82%;margin-bottom:4px}
.chat-bubble{border-radius:18px;padding:9px 12px}
.discussion-message.is-mine .chat-bubble{border-radius:18px}
.community-composer{border-top:0}
.community-composer-inner{padding:9px 14px 10px}
.composer-row{gap:8px;align-items:center}
.community-composer textarea{border-radius:20px;min-height:42px;max-height:110px;resize:none}
.community-post-btn{border-radius:20px;height:42px}
.approval-pill{border-radius:999px}
.community-composer textarea:disabled{cursor:not-allowed;opacity:.75}
.community-composer button:disabled{opacity:.55;cursor:not-allowed}
@media(max-width:700px){.discussion-message{max-width:90%}}

/* Community layout: navbar -> section selector; remove redundant hero/head spacing. */
.community-page{padding-top:64px}
.community-tabs{position:sticky;top:64px;z-index:50;margin:0 0 16px}
.community-shell{padding-top:0}
@media(max-width:700px){.community-page{padding-top:60px}.community-tabs{top:60px}}

/* Section selector stays directly under the fixed navbar. */
.community-tabs{position:sticky;top:64px;z-index:50;background:var(--card-bg);}
@media(max-width:700px){.community-tabs{top:60px!important}}

/* Final community fixes: section switch is pinned directly under navbar; ad sits above composer; latest news follows chat. */
.community-page{padding-top:64px;}
.community-tabs{position:sticky!important;top:64px!important;z-index:150!important;margin-bottom:16px;background:var(--card-bg);box-shadow:0 6px 18px rgba(0,0,0,.06);}
.community-composer{display:block;}
.community-composer-ad{width:100%;min-height:0;padding:4px 10px 0;background:color-mix(in srgb,var(--bg) 94%,transparent);}
.community-composer-ad .ad-slot,.community-composer-ad .adsense-slot{margin:0 auto 5px;max-width:900px;}
.discussion-latest-news{margin-top:22px;padding-top:16px;border-top:1px solid var(--border);}
.discussion-latest-head{margin-bottom:10px;}
.discussion-latest-head h3{margin:3px 0 0;font-size:19px;}
.discussion-news-item{border:1px solid var(--border);background:var(--card-bg);border-radius:14px;padding:12px 13px;margin-top:8px;box-shadow:var(--shadow-sm);}
.discussion-news-top{display:flex;align-items:center;gap:8px;min-width:0;}
.discussion-news-top .news-brand{flex:0 0 auto;font-size:9px;padding:4px 7px;}
.discussion-news-top strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.discussion-news-top time{margin-left:auto;font-size:9px;color:var(--muted);white-space:nowrap;}
.discussion-news-body{margin-top:8px;font-size:13px;line-height:1.5;white-space:pre-wrap;word-break:break-word;}
.community-composer textarea:disabled{opacity:.62;}
@media(max-width:700px){.community-page{padding-top:76px!important;}.community-tabs{top:68px!important;margin-bottom:12px;}.community-composer-ad{padding-inline:6px;}.discussion-latest-news{margin-top:18px;}.discussion-news-top{flex-wrap:wrap;}.discussion-news-top time{margin-left:auto;}}

/* FINAL: section switch is a fixed bar directly below the fixed navbar. */
.community-page{padding-top:122px!important;padding-bottom:170px!important;}
.community-tabs{
  position:fixed!important;
  top:64px!important;
  left:50%;
  transform:translateX(-50%);
  width:min(760px,calc(100% - 20px));
  box-sizing:border-box;
  z-index:9990!important;
  margin:0!important;
  background:var(--card-bg,#fff)!important;
  box-shadow:0 5px 18px rgba(0,0,0,.10);
}
/* News stays in its own section; no duplicated news block inside Discussion. */
.discussion-latest-news{display:none!important;}
/* Keep latest/newest News at the bottom of the News & Updates feed. */
.news-card + .news-card{margin-top:9px;}
@media(max-width:700px){
  .community-page{padding-top:128px!important;}
  .community-tabs{top:68px!important;width:calc(100% - 12px);}
}
.avatar-fallback{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--input-bg);border:1px solid var(--border);font-weight:800;font-size:12px}.chat-action{border:1px solid var(--border);background:var(--surface);color:var(--ink);border-radius:999px;padding:6px 9px;font-size:11px;cursor:pointer}.chat-action:hover{border-color:var(--accent)}.chat-action.danger:hover{color:#d33}.is-reply{margin-left:42px!important;max-width:72%}.reply-context{font-size:10px;color:var(--accent);font-weight:800;margin-bottom:4px}.external-card{border:1px solid var(--border);border-radius:15px;padding:12px;background:var(--card-bg);margin-bottom:9px}.external-card p{font-size:12px;color:var(--muted);margin:5px 0}.external-card img{max-width:100%;border-radius:10px;margin-top:8px}
