#header:empty{display:block;min-height:88px}
@media(max-width:800px){#header:empty{min-height:78px}}
/* مجتمع المصحف الإلكتروني v1.0 — scoped community UI only */
.community-main,.community-shell-top,#community-modal-root,.community-onboarding,.community-toast{
  --c-bg:#f5f8f6;--c-card:#fff;--c-soft:#f8fbf9;--c-text:#17302b;--c-muted:#6a7b76;--c-line:#dfe8e4;
  --c-green:#174c3a;--c-green-2:#123f34;--c-gold:#b89437;--c-gold-soft:#fbf6e8;--c-danger:#8e3434;--c-shadow:0 10px 28px rgba(22,64,52,.06);
  color:var(--c-text);font-family:Vazirmatn,"Al Jazeera",Tahoma,Arial,sans-serif;line-height:1.75;direction:rtl
}
html[data-theme=dark] :is(.community-main,.community-shell-top,#community-modal-root,.community-onboarding,.community-toast){--c-bg:#0b1714;--c-card:#11251f;--c-soft:#163029;--c-text:#eef5f2;--c-muted:#a6b7b1;--c-line:#28473e;--c-green:#d2b45e;--c-green-2:#c09f45;--c-gold:#d2b45e;--c-gold-soft:#302b18;--c-danger:#e08b8b;--c-shadow:0 12px 30px rgba(0,0,0,.18)}
.community-main *,.community-shell-top *,#community-modal-root *,.community-onboarding *,.community-toast{box-sizing:border-box}
.community-main a,.community-shell-top a,#community-modal-root a,.community-onboarding a{color:inherit;text-decoration:none}
.community-main :is(button,input,textarea,select),.community-shell-top button,#community-modal-root :is(button,input,textarea,select),.community-onboarding :is(button,input,textarea,select){font:inherit}
.community-main :is(button,a,input,textarea,select,summary):focus-visible,.community-shell-top :is(button,a,summary):focus-visible,#community-modal-root :is(button,a,input,textarea,select):focus-visible,.community-onboarding :is(button,a,input,textarea,select):focus-visible{outline:3px solid rgba(184,148,55,.58);outline-offset:3px}
.community-scroll-lock{overflow:hidden}
.community-shell-top{position:relative;z-index:40;overflow:visible;max-width:1120px;margin:0 auto;padding:12px 16px 0}
.community-toolbar{position:relative;overflow:visible;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--c-line);border-radius:16px;background:var(--c-card);box-shadow:var(--c-shadow)}
.community-brand{font-weight:900;color:var(--c-green)!important}
.community-account-area{display:flex;align-items:center;gap:8px}
.community-login-button,.community-primary,.community-compose-login{border:0;border-radius:12px;background:var(--c-green);color:#fff;padding:9px 15px;font-weight:800;cursor:pointer;min-height:42px}
html[data-theme=dark] :is(.community-login-button,.community-primary,.community-compose-login){color:#10211c;background:var(--c-green)}
.community-login-button:hover,.community-primary:hover,.community-compose-login:hover{filter:brightness(1.05)}
.community-login-button:disabled,.community-primary:disabled{opacity:.55;cursor:not-allowed}
.community-notify-link{position:relative;display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--c-line);border-radius:12px;background:var(--c-soft)}
.community-badge{position:absolute;inset:-6px auto auto -6px;min-width:20px;height:20px;padding:0 5px;border-radius:99px;background:var(--c-danger);color:#fff;font:700 11px/20px system-ui;text-align:center}
.community-account-menu{position:relative;z-index:70}.community-account-toggle{display:flex;align-items:center;gap:7px;min-height:42px;padding:4px 7px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--c-text);cursor:pointer;touch-action:manipulation}.community-account-toggle:hover,.community-account-toggle[aria-expanded="true"]{background:var(--c-soft);border-color:var(--c-line)}.community-account-toggle img{border-radius:50%;object-fit:cover;background:var(--c-soft)}.community-account-caret{font-size:15px;color:var(--c-muted);transition:transform .16s ease}.community-account-toggle[aria-expanded="true"] .community-account-caret{transform:rotate(180deg)}
.community-menu-panel{position:absolute;z-index:1500;inset-inline-end:0;top:calc(100% + 8px);min-width:220px;max-width:min(92vw,300px);padding:7px;border:1px solid var(--c-line);border-radius:14px;background:var(--c-card);box-shadow:0 18px 42px rgba(7,31,25,.22)}.community-menu-panel[hidden]{display:none!important}
.community-menu-panel :is(a,button){display:block;width:100%;padding:9px 10px;border:0;border-radius:9px;background:transparent;color:var(--c-text);text-align:right;cursor:pointer}.community-menu-panel :is(a,button):hover{background:var(--c-soft)}
.community-main{max-width:1120px;margin:0 auto;padding:12px 16px 56px;min-height:70vh;background:var(--c-bg);border-radius:22px 22px 0 0}
.community-breadcrumb{margin:4px 3px 14px;color:var(--c-muted);font-size:13px;overflow:hidden}.community-breadcrumb ol{display:flex;align-items:center;gap:7px;list-style:none;margin:0;padding:0;white-space:nowrap;overflow-x:auto;scrollbar-width:none}.community-breadcrumb li+li:before{content:'›';margin-inline-end:7px}.community-breadcrumb a:hover{color:var(--c-green)}
.community-intro{padding:20px 18px;margin-bottom:14px;border-radius:18px;background:linear-gradient(135deg,#174c3a,#225a4c);color:#fff}.community-intro h1{margin:0 0 4px;font-size:clamp(22px,4vw,31px)}.community-intro p{margin:0;opacity:.9}
html[data-theme=dark] .community-intro{background:linear-gradient(135deg,#102f28,#173e34);border:1px solid #2a4f45}
.community-announcement,.community-question{padding:13px 15px;margin-bottom:12px;border:1px solid var(--c-line);border-radius:15px;background:var(--c-card)}.community-announcement.is-important{border-color:#c7a64b;background:var(--c-gold-soft)}.community-announcement strong,.community-question>span{color:var(--c-green);font-weight:900}.community-announcement p,.community-question p{margin:3px 0 0}.community-question{border-inline-start:4px solid var(--c-gold)}
.community-tabs,.community-admin-nav,.community-admin-filters{display:flex;gap:7px;overflow-x:auto;padding:2px 0 11px;scrollbar-width:thin}.community-tabs a,.community-admin-nav a,.community-admin-filters a{white-space:nowrap;border:1px solid var(--c-line);border-radius:999px;background:var(--c-card);padding:7px 12px;font-size:14px}.community-tabs a.is-active,.community-admin-nav a.is-active,.community-admin-filters a.is-active{background:var(--c-green);color:#fff;border-color:var(--c-green)}html[data-theme=dark] :is(.community-tabs a.is-active,.community-admin-nav a.is-active,.community-admin-filters a.is-active){color:#12231d}
.community-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:18px;align-items:start}.community-feed-column{min-width:0}.community-side{display:grid;gap:12px;position:sticky;top:86px}.community-side section{padding:14px;border:1px solid var(--c-line);border-radius:16px;background:var(--c-card)}.community-side h2{font-size:17px;margin:0 0 8px}.community-side nav{display:grid;gap:3px}.community-side nav a{padding:7px 8px;border-radius:8px}.community-side nav a:hover{background:var(--c-soft)}.community-side p{color:var(--c-muted);font-size:14px}.community-side section>a{color:var(--c-green);font-weight:800}
.community-composer-card,.community-settings-card,.community-rules,.community-comments,.community-admin-card{margin-bottom:14px;padding:15px;border:1px solid var(--c-line);border-radius:18px;background:var(--c-card);box-shadow:var(--c-shadow)}
.community-composer-card h2,.community-settings-card h1,.community-rules h1,.community-comments h2,.community-admin-card h2{margin:0 0 10px}.community-composer-card form,.community-settings-card form,#community-modal-root form,.community-onboarding form{display:grid;gap:10px}
.community-composer-card label,.community-settings-card label,#community-modal-root label,.community-onboarding label,.community-admin-form label{display:grid;gap:5px;font-size:14px;font-weight:800}
.community-composer-card :is(select,textarea,input),.community-settings-card :is(select,textarea,input),#community-modal-root :is(select,textarea,input),.community-onboarding :is(select,textarea,input),.community-admin-main :is(select,textarea,input){width:100%;border:1px solid var(--c-line);border-radius:12px;background:var(--c-soft);color:var(--c-text);padding:10px 11px}.community-composer-card textarea,.community-settings-card textarea{resize:vertical;min-height:105px}
.community-composer-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.community-file-button{position:relative;display:inline-flex!important;align-items:center!important;border:1px dashed var(--c-line);padding:8px 11px;border-radius:11px;cursor:pointer}.community-file-button input{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none}.community-char-count{margin-inline-start:auto;color:var(--c-muted);font-size:13px}.community-image-preview{max-width:420px}.community-image-preview img{display:block;max-width:100%;max-height:280px;border:1px solid var(--c-line);border-radius:14px;object-fit:contain}.community-image-preview button{margin-top:5px;border:0;background:transparent;color:var(--c-danger);cursor:pointer}.community-muted{margin:8px 0 0;color:var(--c-muted);font-size:13px}
.community-post-list{display:grid;gap:12px}.community-post-card{background:var(--c-card);border:1px solid var(--c-line);border-radius:18px;padding:15px;overflow:hidden;box-shadow:var(--c-shadow)}.community-post-card.is-featured{border-color:#c7a64b;box-shadow:inset 0 0 0 1px rgba(199,166,75,.25),var(--c-shadow)}
.community-post-head{display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:10px;align-items:center}.community-avatar{display:block;border-radius:50%;object-fit:cover;background:var(--c-soft)}.community-post-author>a{font-weight:900}.community-post-meta{display:flex;align-items:center;gap:5px;flex-wrap:wrap;color:var(--c-muted);font-size:12px}.community-post-flags{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end}.community-post-flags span{display:inline-flex;border-radius:99px;padding:2px 7px;background:var(--c-gold-soft);color:#765a17;font-size:11px;font-weight:900}html[data-theme=dark] .community-post-flags span{color:#edd489}
.community-post-body{margin:13px 0;font-size:16px;overflow-wrap:anywhere;white-space:normal}.community-post-image{margin:10px 0}.community-post-image img{display:block;width:100%;height:auto;max-height:620px;object-fit:contain;border:1px solid var(--c-line);border-radius:14px;background:var(--c-soft)}
.community-post-actions{display:flex;align-items:center;gap:4px;flex-wrap:wrap;border-top:1px solid var(--c-line);padding-top:9px}.community-post-actions :is(button,a){border:0;background:transparent;color:var(--c-muted);border-radius:10px;padding:7px 9px;cursor:pointer;font-size:13px}.community-post-actions :is(button,a):hover{background:var(--c-soft);color:var(--c-text)}.community-post-actions button.is-active{background:var(--c-gold-soft);color:#775b18;font-weight:900}.community-post-actions .community-secondary-action{margin-inline-start:auto}
.community-load-more,.community-load-comments{display:block;width:max-content;max-width:100%;margin:16px auto 0;border:1px solid var(--c-line);border-radius:12px;background:var(--c-card);padding:9px 16px;color:var(--c-text);text-align:center}
.community-empty,.community-state{padding:30px 18px;text-align:center;border:1px solid var(--c-line);border-radius:18px;background:var(--c-card)}.community-empty h2,.community-state h1,.community-state h2{margin-top:0}.community-empty p,.community-state p,.community-state-inline{color:var(--c-muted)}
.community-page-head{margin-bottom:14px;padding:16px;border:1px solid var(--c-line);border-radius:18px;background:var(--c-card)}.community-page-head h1{margin:0 0 4px;font-size:clamp(22px,4vw,30px)}.community-page-head p{margin:0;color:var(--c-muted)}.community-head-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}.community-head-actions button,.community-owner-tools button,.community-admin-main button{border:1px solid var(--c-line);border-radius:10px;background:var(--c-card);color:var(--c-text);padding:7px 10px;cursor:pointer}.community-owner-tools{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0 14px}.community-owner-tools .is-danger,.community-admin-main .is-danger{color:var(--c-danger);border-color:rgba(142,52,52,.35)}
.community-comments>form{display:grid;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--c-line)}.community-comments>form label{display:grid;gap:5px;font-weight:800}.community-comments textarea{width:100%;border:1px solid var(--c-line);border-radius:12px;background:var(--c-soft);color:var(--c-text);padding:10px;resize:vertical}.community-comment-list{display:grid}.community-comment{padding:13px 0;border-bottom:1px solid var(--c-line)}.community-comment>header{display:flex;align-items:center;gap:8px}.community-comment>header img{border-radius:50%;object-fit:cover;background:var(--c-soft)}.community-comment>header div{display:flex;align-items:baseline;gap:7px;flex-wrap:wrap}.community-comment time{color:var(--c-muted);font-size:11px}.community-comment-body{margin:7px 0;overflow-wrap:anywhere}.community-comment>footer{display:flex;gap:6px}.community-comment>footer button{border:0;background:transparent;color:var(--c-muted);padding:4px 7px;cursor:pointer}.community-replies{margin-inline-start:36px;border-inline-start:2px solid var(--c-line);padding-inline-start:12px}.community-reply{font-size:14px}
.community-profile-head{display:flex;align-items:center;gap:16px;padding:18px;margin-bottom:14px;border:1px solid var(--c-line);border-radius:18px;background:var(--c-card)}.community-profile-head>img{border-radius:50%;object-fit:cover}.community-profile-head h1{margin:0}.community-profile-head p{margin:2px 0;color:var(--c-muted)}.community-section-title{font-size:20px}
.community-notifications{display:grid;gap:8px}.community-notification{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:9px;align-items:center;padding:12px;border:1px solid var(--c-line);border-radius:14px;background:var(--c-card)}.community-notification.is-unread{border-inline-start:4px solid var(--c-gold);background:var(--c-gold-soft)}.community-notification time{color:var(--c-muted);font-size:12px}
.community-settings-card{max-width:760px}.community-settings-card hr{border:0;border-top:1px solid var(--c-line);margin:20px 0}.community-rules{max-width:850px}.community-rules h2{margin-top:24px;color:var(--c-green)}.community-rules li{margin-bottom:7px}
.community-sheet-backdrop,.community-onboarding{position:fixed;z-index:2000;inset:0;display:grid;place-items:center;padding:16px;background:rgba(3,17,13,.58);backdrop-filter:blur(4px)}.community-sheet,.community-sheet-card{position:relative;width:min(480px,100%);max-height:min(720px,calc(100vh - 32px));overflow:auto;padding:20px;border:1px solid var(--c-line);border-radius:20px;background:var(--c-card);color:var(--c-text);box-shadow:0 24px 70px rgba(0,0,0,.25)}.community-sheet h2,.community-sheet-card h2{margin:0 0 8px}.community-sheet p,.community-sheet-card p{color:var(--c-muted)}.community-sheet-close{position:absolute;inset-inline-start:12px;top:12px;width:38px;height:38px;border:1px solid var(--c-line);border-radius:10px;background:var(--c-soft);color:var(--c-text);cursor:pointer}.community-google-button{display:flex;justify-content:center;min-height:44px;margin:16px 0}.community-sheet-note{font-size:13px}.community-check{display:flex!important;align-items:flex-start;gap:8px!important;font-weight:600!important}.community-check input{width:auto!important;margin-top:6px}
.community-toast{position:fixed;z-index:2500;inset-inline-start:50%;bottom:max(22px,env(safe-area-inset-bottom));transform:translate(-50%,16px);max-width:min(90vw,520px);padding:10px 15px;border-radius:12px;background:#173f36;color:#fff;box-shadow:0 12px 32px rgba(0,0,0,.2);opacity:0;visibility:hidden;transition:.2s ease;pointer-events:none}.community-toast.is-show{opacity:1;visibility:visible;transform:translate(-50%,0)}.community-toast.is-error{background:#7f2f2f}
/* Admin */
.community-admin-main{max-width:1280px}.community-admin-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:9px;margin-bottom:14px}.community-admin-stats article{display:grid;gap:1px;padding:12px;border:1px solid var(--c-line);border-radius:14px;background:var(--c-card)}.community-admin-stats strong{font-size:22px;color:var(--c-green)}.community-admin-stats span{color:var(--c-muted);font-size:12px}.community-admin-flash{padding:10px 12px;margin-bottom:12px;border:1px solid var(--c-gold);border-radius:12px;background:var(--c-gold-soft)}.community-table-wrap{overflow:auto;border:1px solid var(--c-line);border-radius:12px}.community-table-wrap table{width:100%;border-collapse:collapse;min-width:720px}.community-table-wrap th,.community-table-wrap td{padding:9px;border-bottom:1px solid var(--c-line);text-align:right;vertical-align:top;font-size:13px}.community-table-wrap th{background:var(--c-soft);color:var(--c-muted)}.community-table-wrap small{display:block;color:var(--c-muted)}.community-inline-actions{display:flex;gap:5px;flex-wrap:wrap}.community-inline-actions button{padding:5px 8px}.community-bulk-bar{display:flex;gap:8px;align-items:center;margin-bottom:8px}.community-bulk-bar select{max-width:240px}.community-admin-form{margin:8px 0}.community-admin-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;align-items:end}.community-admin-grid-two{display:grid;grid-template-columns:1fr 1fr;gap:14px}.community-admin-form textarea{min-height:100px;resize:vertical}.community-storage-meter{height:12px;margin:12px 0;border:1px solid var(--c-line);border-radius:99px;overflow:hidden;background:var(--c-soft)}.community-storage-meter>div{height:100%;background:linear-gradient(90deg,var(--c-green),var(--c-gold))}.community-health-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}.community-health-list>div{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid var(--c-line);border-radius:12px;background:var(--c-soft)}.community-health-list .is-ok span{color:#2e8b57}.community-health-list .is-bad span{color:var(--c-danger)}
@media(min-width:760px){.community-composer-card form{grid-template-columns:180px minmax(0,1fr);align-items:end}.community-composer-card form>label:nth-of-type(2){grid-column:2}.community-composer-tools,.community-composer-card form>.community-image-preview,.community-composer-card form>.community-primary{grid-column:1/-1}.community-composer-card form>.community-primary{width:max-content}}
@media(max-width:900px){.community-layout{grid-template-columns:1fr}.community-side{position:static;grid-template-columns:1fr 1fr}.community-side section:first-child{grid-column:1/-1}.community-side nav{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.community-shell-top{padding:10px 9px 0}.community-main{padding:10px 9px 42px;border-radius:14px}.community-toolbar{border-radius:13px;padding:8px}.community-brand{font-size:14px}.community-account-toggle .community-account-name,.community-account-toggle .community-account-caret{display:none}.community-intro{padding:16px 14px;border-radius:15px}.community-composer-card,.community-post-card,.community-comments,.community-settings-card,.community-rules,.community-admin-card{padding:12px;border-radius:15px}.community-post-head{grid-template-columns:40px minmax(0,1fr);align-items:start}.community-post-head .community-avatar{width:40px;height:40px}.community-post-flags{grid-column:2;justify-content:flex-start}.community-post-actions{justify-content:space-between}.community-post-actions :is(button,a){padding:7px 5px}.community-action-label{display:none}.community-post-actions .community-secondary-action{margin-inline-start:0}.community-side{grid-template-columns:1fr}.community-side section:first-child{grid-column:auto}.community-head-actions{align-items:flex-start;flex-direction:column}.community-profile-head{align-items:flex-start}.community-profile-head>img{width:68px;height:68px}.community-notification{grid-template-columns:1fr;align-items:start}.community-admin-grid-two{grid-template-columns:1fr}.community-admin-nav a,.community-admin-filters a{font-size:12px;padding:6px 10px}.community-sheet-backdrop,.community-onboarding{place-items:end center;padding:0}.community-sheet,.community-sheet-card{width:100%;max-height:88vh;border-radius:20px 20px 0 0;border-bottom:0;padding:18px 15px calc(18px + env(safe-area-inset-bottom))}.community-toast{bottom:calc(14px + env(safe-area-inset-bottom));font-size:13px}.community-replies{margin-inline-start:20px;padding-inline-start:9px}}
@media(max-width:340px){.community-brand{font-size:13px}.community-login-button{padding-inline:10px}.community-post-actions :is(button,a){font-size:12px}.community-side nav{grid-template-columns:1fr}.community-post-body{font-size:15px}}
@media(prefers-reduced-motion:reduce){.community-toast{transition:none}.community-main *,.community-shell-top *,#community-modal-root *,.community-onboarding *{animation:none!important;transition-duration:.001ms!important;scroll-behavior:auto!important}}

.community-question-link{display:inline-block;margin-top:7px;color:var(--c-green)!important;font-weight:900}

/* System-assigned role badges only; user text can never create these. */
.community-role-badge{display:inline-flex;align-items:center;margin-inline-start:.4rem;padding:.08rem .42rem;border:1px solid rgba(185,151,79,.55);border-radius:999px;font-size:.7rem;line-height:1.55;color:var(--c-muted,#55645f);vertical-align:middle;white-space:nowrap}
.community-role-badge.role-admin,.community-role-badge.role-moderator{color:var(--c-green,#173f36);font-weight:700}
html[data-theme="dark"] .community-role-badge.role-admin,html[data-theme="dark"] .community-role-badge.role-moderator{color:#ead8a8}


/* =========================================================
   v1.1.0 — Responsive + contrast + RTL modal + verification
   Scoped to /community only. No global site CSS is modified.
   ========================================================= */
.community-main,.community-shell-top,#community-modal-root,.community-onboarding,.community-toast{
  --c-bg:#f1f6f3;
  --c-card:#ffffff;
  --c-soft:#eef5f1;
  --c-text:#112c25;
  --c-muted:#526861;
  --c-line:#cfded8;
  --c-green:#14513d;
  --c-green-2:#0f3f31;
  --c-gold:#a98224;
  --c-gold-soft:#f8f0d7;
  --c-danger:#9a3030;
  --c-shadow:0 8px 24px rgba(17,57,45,.08);
}
html[data-theme=dark] :is(.community-main,.community-shell-top,#community-modal-root,.community-onboarding,.community-toast){
  --c-bg:#081512;
  --c-card:#10231d;
  --c-soft:#17352b;
  --c-text:#f4f8f6;
  --c-muted:#bdcbc6;
  --c-line:#36574d;
  --c-green:#e2c56f;
  --c-green-2:#d4b552;
  --c-gold:#e2c56f;
  --c-gold-soft:#352e17;
  --c-danger:#ffaaaa;
  --c-shadow:0 10px 28px rgba(0,0,0,.25);
}

/* Keep every community surface inside the viewport. */
.community-shell-top,.community-main{width:min(100%,1120px);max-width:100%;overflow:clip}
.community-admin-main{width:min(100%,1280px);max-width:100%}
.community-layout,.community-feed-column,.community-side,.community-post-card,.community-composer-card,.community-settings-card,.community-rules,.community-comments,.community-admin-card{min-width:0;max-width:100%}
.community-main img,.community-shell-top img,#community-modal-root img{max-width:100%}
.community-post-body,.community-comment-body,.community-page-head p,.community-admin-card p,.community-menu-panel{overflow-wrap:anywhere;word-break:break-word}

/* Stronger form and action visibility in both themes. */
.community-composer-card :is(select,textarea,input),.community-settings-card :is(select,textarea,input),#community-modal-root :is(select,textarea,input),.community-onboarding :is(select,textarea,input),.community-admin-main :is(select,textarea,input),.community-comments textarea{
  border-color:var(--c-line);background:var(--c-card);color:var(--c-text);box-shadow:inset 0 0 0 1px rgba(20,81,61,.025)
}
html[data-theme=dark] :is(.community-composer-card,.community-settings-card,#community-modal-root,.community-onboarding,.community-admin-main,.community-comments) :is(select,textarea,input){background:#0d201a;color:var(--c-text);border-color:#42665b}
.community-main ::placeholder,#community-modal-root ::placeholder,.community-onboarding ::placeholder{color:var(--c-muted);opacity:.9}
.community-post-actions :is(button,a),.community-comment>footer button{color:var(--c-muted);font-weight:700}
.community-post-actions :is(button,a):hover,.community-comment>footer button:hover{color:var(--c-text);background:var(--c-soft)}
.community-post-actions button.is-active{color:#604708;background:var(--c-gold-soft)}
html[data-theme=dark] .community-post-actions button.is-active{color:#f4dfa0}
.community-head-actions button,.community-owner-tools button,.community-admin-main button,.community-load-more,.community-load-comments{background:var(--c-card);color:var(--c-text);border-color:var(--c-line);font-weight:700}
.community-admin-main button.is-verify{background:#eaf6f1;border-color:#86bbaa;color:#0f5b43;font-weight:900}
html[data-theme=dark] .community-admin-main button.is-verify{background:#173d31;border-color:#4d8b77;color:#d8f3e9}

/* Close button must be physically on the LEFT in Arabic RTL dialogs. */
.community-sheet-close{left:12px!important;right:auto!important;inset-inline-start:auto!important;inset-inline-end:auto!important;z-index:3;font-size:25px;line-height:1;font-weight:800}
.community-sheet h2,.community-sheet-card h2{padding-left:48px}

/* Avatars remain visible and never inherit a black fallback block. */
.community-avatar,.community-comment>header img,.community-profile-head>img,.community-account-toggle img{background:#e8f0ec;border:1px solid var(--c-line);object-fit:cover;aspect-ratio:1/1}
html[data-theme=dark] :is(.community-avatar,.community-comment>header img,.community-profile-head>img,.community-account-toggle img){background:#dbe7e2}

/* Admin-controlled verification badge; independent from role/trusted status. */
.community-verified-badge{display:inline-grid;place-items:center;width:17px;height:17px;margin-inline-start:5px;border-radius:50%;background:#19765a;color:#fff;border:2px solid #d8b759;box-shadow:0 0 0 1px rgba(25,118,90,.16);font:900 11px/1 system-ui;vertical-align:-2px;flex:0 0 auto}
.community-verified-badge>span{transform:translateY(-.2px)}
html[data-theme=dark] .community-verified-badge{background:#257d63;color:#fff;border-color:#e3c665;box-shadow:0 0 0 1px rgba(227,198,101,.22)}
.community-comment-author,.community-account-name{display:inline-flex;align-items:center;min-width:0;max-width:100%}
.community-profile-head h1{display:flex;align-items:center;flex-wrap:wrap;gap:2px}

/* Toolbar and account menu fit small phones without overflow. */
.community-toolbar{min-width:0}
.community-brand{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.community-account-area{min-width:0;flex:0 0 auto}
.community-account-toggle{min-width:0;max-width:min(54vw,320px)}
.community-account-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.community-menu-panel{max-width:calc(100vw - 18px)}

/* Mobile: actions become a stable grid instead of squeezing or escaping the card. */
@media(max-width:700px){
  #header:empty{min-height:72px}
  .community-shell-top{padding:8px 8px 0}
  .community-main{padding:9px 8px 38px;border-radius:13px}
  .community-toolbar{gap:7px;padding:7px 8px}
  .community-brand{font-size:13px}
  .community-notify-link{width:38px;height:38px}
  .community-account-toggle{padding:3px}
  .community-account-toggle img{width:34px;height:34px}
  .community-account-toggle .community-account-name,.community-account-toggle .community-account-caret{display:none}
  .community-login-button{min-height:40px;padding:8px 11px;font-size:13px}
  .community-intro{padding:14px 12px}
  .community-intro h1{font-size:21px}
  .community-post-card,.community-composer-card,.community-comments,.community-settings-card,.community-rules,.community-admin-card,.community-page-head,.community-profile-head{padding:11px;border-radius:14px}
  .community-post-head{grid-template-columns:40px minmax(0,1fr);gap:8px}
  .community-post-flags{grid-column:1/-1;justify-content:flex-start;margin-top:1px}
  .community-post-author{min-width:0}
  .community-post-author>a{display:inline;overflow-wrap:anywhere}
  .community-post-meta{font-size:11px;line-height:1.55}
  .community-post-body{font-size:15.5px;line-height:1.9}
  .community-post-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px}
  .community-post-actions :is(button,a){display:flex;align-items:center;justify-content:center;min-width:0;min-height:38px;padding:6px 3px;font-size:12px;text-align:center}
  .community-post-actions .community-secondary-action{margin:0}
  .community-side,.community-side nav{grid-template-columns:1fr}
  .community-replies{margin-inline-start:10px;padding-inline-start:8px}
  .community-profile-head{display:grid;grid-template-columns:64px minmax(0,1fr);gap:11px}
  .community-profile-head>img{width:64px;height:64px}
  .community-profile-head>div{min-width:0}
  .community-profile-head h1{font-size:20px;overflow-wrap:anywhere}
  .community-notification{grid-template-columns:1fr}
  .community-bulk-bar{align-items:stretch;flex-direction:column}
  .community-bulk-bar select{max-width:none}
  .community-admin-grid{grid-template-columns:1fr}
  .community-table-wrap{max-width:100%;-webkit-overflow-scrolling:touch}
  .community-table-wrap table{min-width:650px}
  .community-sheet-backdrop,.community-onboarding{place-items:end center;padding:0}
  .community-sheet,.community-sheet-card{width:100%;max-width:100%;max-height:88dvh;border-radius:20px 20px 0 0;border-bottom:0;padding:18px 14px calc(18px + env(safe-area-inset-bottom))}
  .community-sheet-close{left:10px!important;top:10px}
  .community-sheet h2,.community-sheet-card h2{padding-left:44px;padding-right:0}
}
@media(max-width:390px){
  .community-post-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
  .community-post-actions :is(button,a){min-height:40px}
  .community-tabs a,.community-admin-nav a,.community-admin-filters a{font-size:12px;padding:6px 9px}
}
@media(max-width:330px){
  .community-brand{max-width:145px}
  .community-post-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .community-main{padding-inline:6px}
}
.community-main,.community-shell-top{box-sizing:border-box}
/* Physical left placement wins over the earlier RTL logical inset. */
.community-sheet-close{left:12px!important;right:auto!important;inset-inline-start:auto!important}
@media(max-width:700px){.community-sheet-close{left:10px!important;right:auto!important;inset-inline-start:auto!important}}


/* =========================================================
   v1.1.1 — Modern like heart + resilient Google avatar
   ========================================================= */
.community-post-actions .community-like-button{
  gap:5px;
  border:1px solid transparent;
  transition:background-color .16s ease,border-color .16s ease,color .16s ease,transform .16s ease;
}
.community-post-actions .community-like-button .community-like-icon{
  color:#8f2630;
  font-size:18px;
  line-height:1;
  filter:drop-shadow(0 1px 0 rgba(86,16,24,.10));
  transform:translateY(-.5px);
}
.community-post-actions .community-like-button:hover{
  background:#fff3f4;
  border-color:#ebc9cd;
  color:#672027;
}
.community-post-actions .community-like-button:hover .community-like-icon{color:#7c1f29}
.community-post-actions .community-like-button.is-active{
  background:#f7e8ea!important;
  border-color:#d9a4aa!important;
  color:#6f2028!important;
  font-weight:900;
}
.community-post-actions .community-like-button.is-active .community-like-icon{
  color:#7a1f28;
  transform:translateY(-.5px) scale(1.08);
}
html[data-theme=dark] .community-post-actions .community-like-button .community-like-icon{color:#e46f79}
html[data-theme=dark] .community-post-actions .community-like-button:hover{background:#321b1f;border-color:#704047;color:#ffd9dd}
html[data-theme=dark] .community-post-actions .community-like-button.is-active{background:#3a1d22!important;border-color:#874951!important;color:#ffd8dc!important}
html[data-theme=dark] .community-post-actions .community-like-button.is-active .community-like-icon{color:#ef7d87}
@media(prefers-reduced-motion:reduce){.community-post-actions .community-like-button{transition:none}.community-post-actions .community-like-button.is-active .community-like-icon{transform:translateY(-.5px)}}

/* v1.1.2 — Profile sync + clear logout + premium avatar fallback */
.community-profile-sync{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid var(--c-line);border-radius:16px;background:var(--c-soft);margin:10px 0 16px}
.community-profile-sync>img{flex:0 0 auto;width:64px;height:64px;border-radius:50%;object-fit:cover;border:2px solid rgba(199,168,74,.55);background:#195245}
.community-profile-sync>div{min-width:0;display:grid;gap:6px}
.community-profile-sync strong{font-size:17px}
.community-profile-sync p{margin:0;color:var(--c-muted);font-size:13px}
.community-google-sync-button{justify-self:start;border:1px solid rgba(19,92,76,.35)!important;background:var(--c-card)!important;color:var(--c-green)!important;font-weight:900!important}
html[data-theme=dark] .community-google-sync-button{border-color:#4e7468!important;background:#10271f!important;color:#bfe9db!important}
.community-account-danger-zone{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px;border:1px solid rgba(154,48,48,.25);border-radius:16px;background:rgba(154,48,48,.055)}
.community-account-danger-zone h2{margin:0 0 3px;font-size:17px}.community-account-danger-zone p{margin:0;color:var(--c-muted);font-size:13px}
.community-logout-button,.community-menu-logout{color:var(--c-danger)!important;font-weight:900!important}
.community-logout-button{border:1px solid rgba(154,48,48,.35)!important;background:var(--c-card)!important}
html[data-theme=dark] .community-account-danger-zone{background:rgba(255,170,170,.06);border-color:rgba(255,170,170,.22)}
@media(max-width:520px){.community-profile-sync{align-items:flex-start}.community-profile-sync>img{width:56px;height:56px}.community-account-danger-zone{align-items:stretch;flex-direction:column}.community-logout-button{width:100%}}

/* v1.1.3 — Reliable explicit account dropdown (no native details dependency) */
@media(prefers-reduced-motion:reduce){.community-account-caret{transition:none}}

/* v1.1.4 — Account menu visibility fix
   Keep the account dropdown outside the toolbar clipping area so it can
   overlay the community intro/hero on desktop and remain visible on phones. */
.community-shell-top{
  overflow:visible!important;
  z-index:5000!important;
  isolation:auto;
}
.community-toolbar,.community-account-area,.community-account-menu{
  overflow:visible!important;
}
.community-account-menu{z-index:5100!important}
.community-menu-panel{
  z-index:5200!important;
  visibility:visible;
  opacity:1;
}
.community-menu-panel[hidden]{display:none!important}
.community-main{
  overflow:clip;
  position:relative;
  z-index:1;
}
@media(max-width:600px){
  .community-menu-panel{
    min-width:min(250px,calc(100vw - 18px));
    width:max-content;
    max-width:calc(100vw - 18px);
    top:calc(100% + 6px);
    inset-inline-end:0;
  }
  .community-menu-panel :is(a,button){
    min-height:42px;
    display:flex;
    align-items:center;
  }
}
