.community-hub{display:grid;gap:18px;max-width:1500px;margin:auto}.ch-hero{min-height:260px;border-radius:28px;padding:34px;display:flex;align-items:flex-end;justify-content:space-between;gap:24px;color:#fff;background-size:cover;background-position:center;background-image:radial-gradient(circle at 82% 12%,rgba(255,255,255,.2),transparent 24%),linear-gradient(130deg,#075c3b,#11a45e);box-shadow:0 20px 50px rgba(7,92,59,.18);overflow:hidden}.ch-hero>div:first-child{max-width:850px}.ch-hero span,.ch-heading span{font-size:11px;letter-spacing:.1em;font-weight:900}.ch-hero h1{font-size:34px;line-height:1.16;margin:8px 0}.ch-hero p{color:#e8fff2;margin:0}.ch-hero-stats{display:flex;gap:8px;flex-wrap:wrap;margin-top:20px}.ch-hero-stats b{padding:7px 10px;border:1px solid rgba(255,255,255,.25);border-radius:999px;background:rgba(255,255,255,.12);font-size:12px;backdrop-filter:blur(8px)}.ch-hero-actions{display:flex;gap:8px;flex-wrap:wrap}.ch-hero-actions .btn.light{background:rgba(255,255,255,.9)}.ch-metrics{display:grid;grid-template-columns:repeat(8,minmax(105px,1fr));gap:9px}.ch-metric{display:grid;grid-template-columns:auto 1fr;gap:2px 8px;padding:13px;border:1px solid #dfece5;border-radius:16px;background:rgba(255,255,255,.88);box-shadow:0 7px 22px rgba(10,70,42,.04)}.ch-metric i{grid-row:1/3;font-style:normal;font-size:20px}.ch-metric b{font-size:18px;color:#075f38}.ch-metric span{font-size:10px;color:#6a7c72;font-weight:700}.ch-section{padding:20px;border:1px solid #dcebe3;border-radius:22px;background:rgba(255,255,255,.9);box-shadow:0 12px 32px rgba(14,70,44,.05);min-width:0}.ch-heading{display:flex;align-items:end;justify-content:space-between;gap:14px;margin-bottom:15px}.ch-heading h2{font-size:23px;margin:3px 0}.ch-heading p{margin:0;color:#6b7c73}.ch-heading>div>span{color:#087443}.ch-heading.compact{margin-bottom:8px}.ch-achievement-grid,.ch-achievement-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.ch-achievement{min-width:0;border:1px solid #e0ebe5;border-radius:17px;overflow:hidden;background:#fff;cursor:pointer}.ch-achievement-media{height:115px;position:relative;display:grid;place-items:center;background:linear-gradient(145deg,#eaf8f0,#d8efe2)}.ch-achievement-media img{width:100%;height:100%;object-fit:cover}.ch-achievement-media>span{font-size:40px}.ch-achievement-media em{position:absolute;top:8px;right:8px;padding:4px 7px;border-radius:999px;background:#fff;color:#087443;font-size:9px;font-style:normal;font-weight:900}.ch-achievement>div:last-child{padding:12px}.ch-achievement small{color:#718178;font-size:9px}.ch-achievement h4{font-size:13px;line-height:1.35;margin:5px 0}.ch-achievement p{font-size:11px;color:#65776d;line-height:1.4;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.ch-horizontal,.ch-honorees{display:flex;gap:12px;overflow-x:auto;padding:2px 2px 8px;scroll-snap-type:x mandatory}.ch-featured-post{flex:0 0 min(340px,82vw);scroll-snap-align:start}.ch-featured-post,.ch-feed-post{border:1px solid #e1ebe6;border-radius:17px;background:#fff;padding:14px}.ch-featured-post header,.ch-feed-post header{display:flex;align-items:center;gap:9px}.ch-featured-post header img,.ch-feed-post header img{width:38px;height:38px;border-radius:50%;object-fit:cover}.ch-featured-post header div,.ch-feed-post header div{display:grid;min-width:0}.ch-featured-post header small,.ch-feed-post header small{font-size:9px;color:#78877f}.ch-pinned{margin-left:auto;color:#087443;font-size:9px;font-weight:800}.ch-featured-post h4,.ch-feed-post h4{margin:11px 0 4px}.ch-featured-post p,.ch-feed-post p{font-size:12px;color:#566a5f;white-space:pre-line}.ch-post-image{width:100%;max-height:260px;object-fit:cover;border-radius:12px;margin-top:10px}.ch-featured-post footer,.ch-feed-post footer{display:flex;gap:7px;border-top:1px solid #edf2ef;padding-top:9px}.ch-featured-post footer button,.ch-feed-post footer button{border:0;background:#f1f7f3;border-radius:9px;padding:7px 9px;color:#315d47;cursor:pointer;font-weight:750;font-size:11px}.ch-honorees article{flex:0 0 180px;text-align:center;padding:14px;border:1px solid #e1ebe5;border-radius:17px;scroll-snap-align:start}.ch-honor-avatar{width:62px;height:62px;position:relative;margin:auto}.ch-honor-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}.ch-honor-avatar i{position:absolute;right:-4px;bottom:-2px;width:25px;height:25px;display:grid;place-items:center;border:2px solid #fff;border-radius:50%;font-style:normal;font-size:12px}.ch-honorees article>b,.ch-honorees article>strong{display:block}.ch-honorees article>b{margin-top:9px}.ch-honorees article>strong{font-size:10px;color:#087443}.ch-honorees article p{font-size:10px;color:#6d7e75}.ch-two{display:grid;grid-template-columns:1.1fr .9fr;gap:18px}.ch-periods,.ch-leader-tabs,.ch-gallery-filter,.ch-admin-tabs{display:flex;gap:6px;overflow:auto;padding-bottom:8px}.ch-periods button,.ch-leader-tabs button,.ch-gallery-filter button,.ch-admin-tabs button{border:1px solid #dce8e1;background:#fff;border-radius:999px;padding:7px 10px;white-space:nowrap;cursor:pointer;font-size:10px;font-weight:750}.ch-periods button.active,.ch-leader-tabs button.active,.ch-gallery-filter button.active,.ch-admin-tabs button.active{background:#087443;color:#fff;border-color:#087443}.ch-leaders{display:grid;gap:5px}.ch-leaders>div{display:grid;grid-template-columns:25px 34px 1fr auto;align-items:center;gap:8px;padding:7px 9px;border-radius:11px;background:#f7faf8}.ch-leaders em{font-style:normal;font-weight:900;color:#087443}.ch-leaders img{width:34px;height:34px;border-radius:50%;object-fit:cover}.ch-leaders strong{color:#087443}.ch-groups{display:flex;gap:9px;overflow-x:auto}.ch-groups article{flex:0 0 230px;padding:12px;border:1px solid #e0ebe5;border-radius:15px}.ch-groups article>div{height:70px;border-radius:11px;background:#edf8f1;display:grid;place-items:center;overflow:hidden}.ch-groups img{width:100%;height:100%;object-fit:cover}.ch-groups article>div span{font-size:27px}.ch-groups article>b{display:block;margin-top:9px}.ch-groups article p{font-size:10px;color:#687970;min-height:29px}.ch-groups article small{font-size:9px}.ch-groups footer{display:flex;gap:5px;margin-top:9px}.ch-groups .btn{padding:6px;font-size:9px}.ch-hide{border:0;background:transparent;color:#7b8982;font-size:9px}.ch-feed{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.ch-load-more{display:block;margin:14px auto 0}.ch-comments{display:grid;gap:8px}.ch-comments>div{display:flex;gap:8px}.ch-comments img{width:35px;height:35px;border-radius:50%;object-fit:cover}.ch-comments p{display:grid;margin:0;padding:8px 10px;border-radius:12px;background:#f3f7f5;flex:1}.ch-comments small{font-size:9px;color:#78877f}.ch-comment-compose{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:12px}.ch-comment-compose textarea{min-height:65px}.ch-admin-pane{display:none;padding-top:10px}.ch-admin-pane.active{display:block}.ch-achievement-detail>img{width:100%;max-height:360px;object-fit:cover;border-radius:16px}.ch-achievement-detail>div{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.ch-achievement-detail>div img{width:100%;height:120px;object-fit:cover;border-radius:10px}.ch-achievement-detail .btn{margin:8px 6px 0 0}.ch-loading{min-height:55vh;display:grid;place-content:center;text-align:center;color:#087443}.ch-loading i{width:42px;height:42px;border:4px solid #dceee4;border-top-color:#087443;border-radius:50%;animation:chspin .8s linear infinite;margin:auto}@keyframes chspin{to{transform:rotate(360deg)}}
@media(max-width:1100px){.ch-metrics{grid-template-columns:repeat(4,1fr)}.ch-achievement-grid,.ch-achievement-gallery{grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.community-hub{gap:12px}.ch-hero{min-height:300px;padding:22px;display:grid;align-content:end;border-radius:21px}.ch-hero h1{font-size:26px}.ch-hero-actions .btn{flex:1;min-width:0}.ch-metrics{display:flex;overflow-x:auto}.ch-metric{flex:0 0 125px}.ch-section{padding:14px;border-radius:18px}.ch-heading h2{font-size:19px}.ch-achievement-grid,.ch-achievement-gallery{display:flex;overflow-x:auto}.ch-achievement{flex:0 0 210px}.ch-two{grid-template-columns:1fr}.ch-feed{grid-template-columns:1fr}.ch-featured-post{flex-basis:86vw}.ch-comment-compose{grid-template-columns:1fr}.ch-comment-compose .btn{width:100%}}
.ch-achievement footer{display:flex;gap:5px;margin-top:8px}.ch-achievement footer button,.ch-revoke{border:0;border-radius:8px;padding:5px 7px;background:#edf7f1;color:#087443;font-size:9px;font-weight:800;cursor:pointer}.ch-achievement footer button:last-child,.ch-revoke{background:#fff0f0;color:#b42323}

/* Community UI v2: resilient layout, polished empty states and image fallback. */
.community-hub{font-family:'Be Vietnam Pro','Inter',sans-serif;padding-bottom:28px}
.community-hub button{font-family:inherit}
.community-hub .btn{min-height:40px;border-radius:12px;padding:10px 15px;line-height:1.15;white-space:normal}
.community-hub .empty{width:100%;min-height:92px;display:grid;place-items:center;padding:22px;border:1px dashed #c9dfd2;border-radius:15px;background:linear-gradient(145deg,#fbfefc,#f3faf6);color:#65776d;font-size:12px;text-align:center}
.ch-horizontal>.empty,.ch-honorees>.empty,.ch-groups>.empty{flex:1 0 100%}
.ch-achievement-grid>.empty,.ch-feed>.empty{grid-column:1/-1}
.ch-achievement{box-shadow:0 8px 24px rgba(8,84,48,.055);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.ch-achievement:hover{transform:translateY(-3px);border-color:#aad4bb;box-shadow:0 14px 32px rgba(8,84,48,.11)}
.ch-achievement-media{isolation:isolate}
.ch-achievement-media .ch-achievement-fallback{position:absolute;inset:0;display:grid;place-items:center;font-size:40px;z-index:0}
.ch-achievement-media img{position:relative;z-index:1}
.community-hub img.ch-image-error{display:none!important}
.ch-upload-preview{display:flex;align-items:center;gap:10px;margin-top:9px;padding:9px;border:1px solid #d9e9df;border-radius:12px;background:#f7fbf8;color:#4d695a;font-size:11px;font-weight:700}
.ch-upload-preview img{width:72px;height:58px;object-fit:cover;border-radius:9px;background:#eaf4ed}
.ch-upload-preview .bad{color:#b42323}
.ch-group-subtitle{margin:14px 0 9px;font-size:13px;color:#315d47}
.ch-group-empty{gap:10px}
.ch-group-empty .btn{width:max-content}
.ch-chat-modal{width:min(920px,96vw);height:min(780px,92vh);overflow:hidden;display:flex;flex-direction:column}
.ch-chat-modal>.modal-head{flex:none}.ch-chat-modal>.modal-body{padding:0;overflow:hidden;flex:1;min-height:0}
.ch-chat-app{height:100%;display:grid;grid-template-rows:auto 1fr auto auto;background:#eef4f0}
.ch-chat-app>header{display:flex;align-items:center;gap:11px;padding:11px 16px;background:#fff;border-bottom:1px solid #dce8e1}
.ch-chat-app>header>div:last-child{display:grid}.ch-chat-app>header span{font-size:10px;color:#708078}
.ch-chat-group-avatar{width:42px;height:42px;display:grid!important;place-items:center;border-radius:50%;overflow:hidden;background:#daf2e3;font-size:20px}
.ch-chat-group-avatar img{width:100%;height:100%;object-fit:cover}
.ch-chat-messages{overflow-y:auto;padding:18px;scroll-behavior:smooth}
.ch-chat-row{display:flex;margin:7px 0}.ch-chat-row.mine{justify-content:flex-end}.ch-chat-row.theirs{justify-content:flex-start}
.ch-chat-bubble{max-width:min(72%,620px);padding:9px 12px;border-radius:17px;background:#fff;box-shadow:0 2px 8px rgba(15,55,35,.07)}
.ch-chat-row.mine .ch-chat-bubble{background:#d9fdd3;border-bottom-right-radius:5px}.ch-chat-row.theirs .ch-chat-bubble{border-bottom-left-radius:5px}
.ch-chat-bubble>b{display:block;font-size:10px;color:#087443;margin-bottom:3px}.ch-chat-bubble p{margin:0;white-space:pre-wrap;line-height:1.45;font-size:13px}.ch-chat-bubble>small{display:block;text-align:right;color:#7b8982;font-size:8px;margin-top:4px}
.ch-chat-files{display:flex;gap:6px;flex-wrap:wrap;margin-top:7px}.ch-chat-files img{width:min(260px,100%);max-height:260px;object-fit:cover;border-radius:11px}.ch-chat-file{display:block;padding:8px;border-radius:9px;background:rgba(255,255,255,.65);font-size:11px;color:#176b4d}
.ch-chat-pending{display:flex;gap:6px;overflow-x:auto;padding:0 12px;background:#fff}.ch-chat-pending:empty{display:none}.ch-chat-pending span{white-space:nowrap;padding:6px 9px;border-radius:9px;background:#edf7f1;font-size:10px}
.ch-chat-app>footer{display:grid;grid-template-columns:auto 1fr auto;align-items:end;gap:8px;padding:10px 12px;background:#fff;border-top:1px solid #dce8e1}
.ch-chat-app>footer textarea{resize:none;max-height:110px;min-height:42px;border:1px solid #d8e4dd;border-radius:20px;padding:11px 14px;font:inherit}
.ch-chat-attach,.ch-chat-send{width:42px;height:42px;display:grid;place-items:center;border:0;border-radius:50%;cursor:pointer;background:#edf7f1;color:#087443;font-size:19px}.ch-chat-attach input{display:none}.ch-chat-send{background:#0b8f50;color:#fff}
.ch-chat-welcome{height:100%;display:grid;place-content:center;text-align:center;color:#718178;gap:5px}.ch-chat-welcome i{font-size:38px;font-style:normal}.ch-chat-welcome b{color:#315d47}
@media(max-width:760px){.ch-chat-modal-bg{padding:0}.ch-chat-modal{width:100vw;height:100dvh;max-height:none;border-radius:0}.ch-chat-modal>.modal-head{padding:12px 14px}.ch-chat-bubble{max-width:86%}.ch-chat-messages{padding:12px 10px}.ch-chat-app>footer{padding-bottom:max(10px,env(safe-area-inset-bottom))}}
.ch-achievement-media em{z-index:2;box-shadow:0 3px 10px rgba(8,84,48,.12)}
.ch-periods button,.ch-leader-tabs button,.ch-gallery-filter button,.ch-admin-tabs button{min-height:34px;padding:8px 12px;transition:.16s ease}
.ch-periods button:hover,.ch-leader-tabs button:hover,.ch-gallery-filter button:hover,.ch-admin-tabs button:hover{border-color:#76b992;background:#eff9f3}
.ch-periods button.active,.ch-leader-tabs button.active,.ch-gallery-filter button.active,.ch-admin-tabs button.active{background:linear-gradient(135deg,#0a8750,#07663e);box-shadow:0 5px 13px rgba(8,116,67,.2)}
.ch-leaders>.empty{display:grid;grid-template-columns:1fr}
.ch-featured-post,.ch-feed-post,.ch-honorees article,.ch-groups article{box-shadow:0 7px 20px rgba(15,60,38,.04)}
.ch-featured-post footer,.ch-feed-post footer{flex-wrap:wrap}
.ch-featured-post footer button,.ch-feed-post footer button{min-height:34px}
@media(max-width:760px){
  .community-hub{padding-bottom:80px}
  .ch-hero-actions{width:100%}
  .ch-hero-actions .btn{white-space:normal;text-align:center}
  .ch-heading{align-items:flex-start;flex-direction:column}
  .ch-heading>.btn{width:100%}
  .community-hub .empty{min-height:78px;padding:18px 12px}
  .ch-periods,.ch-leader-tabs{margin-right:-14px;padding-right:14px}
  .ch-leaders>div{grid-template-columns:24px 32px minmax(0,1fr) auto}
}
