/* الشريط العلوي للحساب والاشتراك + الأقسام القابلة للطي (تحديث 54) */

/* ---------- صف الحساب والاشتراك ---------- */
html body .hd-acct{display:flex;align-items:center;gap:10px;flex:0 0 auto;}

/* ---------- زر الحساب ---------- */
html body .acct-wrap{position:relative;display:inline-flex;}
html body .acct-chip{display:flex;align-items:center;gap:10px;min-height:46px;max-width:360px;padding:5px 12px 5px 6px;border-radius:14px;border:1px solid var(--ntf-line,#e6dccb);background:var(--ntf-soft,#fbf7ef);color:inherit;font:inherit;text-align:start;cursor:pointer;transition:border-color .15s,box-shadow .15s;}
html body .acct-chip:hover{border-color:var(--ntf-gold,#b8862f);box-shadow:0 4px 14px rgba(0,0,0,.06);}
html body .acct-chip:focus-visible,html body .hd-sub:focus-visible,html body .acct-panel button:focus-visible{outline:3px solid rgba(184,134,47,.45);outline-offset:2px;}
html body .acct-avatar{width:34px;height:34px;flex:0 0 34px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#1f6f5c,#0f3d33);color:#fff;font-weight:800;font-size:15px;}
html body .acct-meta{display:flex;flex-direction:column;min-width:0;line-height:1.35;}
html body .acct-meta b{font-size:14px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px;}
html body .acct-meta small{font-size:12px;color:var(--ntf-muted,#6b6b6b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px;}
html body .acct-state{font-size:11px;font-weight:800;padding:3px 10px;border-radius:999px;white-space:nowrap;}
html body .acct-state.is-ok{background:#e3f4ec;color:#17603f;}
html body .acct-state.is-warn{background:#fdf0d8;color:#8a5a00;}
html body .acct-state.is-danger{background:#fbe3e0;color:#9b2c1f;}
html body .acct-caret{font-size:12px;color:var(--ntf-muted,#6b6b6b);}

/* ---------- لوحة الحساب ---------- */
html body .acct-panel{position:absolute;inset-inline-start:0;top:calc(100% + 8px);z-index:70;width:min(340px,92vw);padding:14px;border-radius:16px;background:#fffdf8;border:1px solid var(--ntf-line,#e6dccb);box-shadow:0 18px 40px rgba(0,0,0,.18);}
html body .acct-panel[hidden]{display:none;}
html body .acct-panel-title{font-weight:800;font-size:14px;margin:0 0 10px;color:var(--ntf-ink,#1d2a26);}
html body .acct-panel .side-account{margin:0;padding:0;background:none;border:0;}
html body .acct-panel .side-account-row{color:var(--ntf-ink,#1d2a26);padding:8px 0;border-bottom:1px solid var(--ntf-line,#e6dccb);}
html body .acct-panel .side-account-row>span:first-child{color:var(--ntf-muted,#6b6b6b);}
html body .acct-panel .side-account-row b{color:var(--ntf-ink,#1d2a26);font-size:13px;}
html body .acct-panel #logoutBtn{margin-top:12px;width:100%;}

/* ---------- زر الاشتراك ---------- */
html body .hd-sub{display:inline-flex;align-items:center;gap:6px;height:46px;padding:0 16px;border:0;border-radius:14px;background:linear-gradient(135deg,#c79a3e,#8a5a00);color:#fff;font:inherit;font-weight:800;font-size:14px;cursor:pointer;box-shadow:0 6px 16px rgba(138,90,0,.22);white-space:nowrap;}
html body .hd-sub:hover{filter:brightness(1.06);}
html body .hd-sub.is-urgent{box-shadow:0 0 0 3px rgba(199,154,62,.38),0 6px 16px rgba(138,90,0,.3);}

/* ---------- الوضع الليلي ---------- */
html[data-theme="dark"] .acct-chip{background:#0f1c19;border-color:#2b3f39;color:#e9e3d6;}
html[data-theme="dark"] .acct-meta small,html[data-theme="dark"] .acct-caret{color:#a9b7b1;}
html[data-theme="dark"] .acct-panel{background:#13211e;border-color:#2b3f39;}
html[data-theme="dark"] .acct-panel-title,html[data-theme="dark"] .acct-panel .side-account-row,html[data-theme="dark"] .acct-panel .side-account-row b{color:#e9e3d6;}
html[data-theme="dark"] .acct-panel .side-account-row{border-color:#2b3f39;}
html[data-theme="dark"] .acct-state.is-ok{background:#143d2c;color:#9fe0bf;}
html[data-theme="dark"] .acct-state.is-warn{background:#3d2e10;color:#f0cf86;}
html[data-theme="dark"] .acct-state.is-danger{background:#44201b;color:#f2a79d;}

/* ---------- الأقسام القابلة للطي (الإشعارات والرسائل) ---------- */
html body .ntf-acc{border:1px solid var(--ntf-line,#e6dccb);border-inline-start:4px solid var(--ntf-line,#e6dccb);border-radius:14px;background:var(--ntf-soft,#fbf7ef);margin:0 0 10px;overflow:hidden;transition:box-shadow .15s;}
html body .ntf-acc[open]{box-shadow:0 8px 22px rgba(0,0,0,.07);}
html body .ntf-acc.is-unread{border-inline-start-color:var(--ntf-gold,#b8862f);background:rgba(184,134,47,.08);}
html body .ntf-acc.is-read{opacity:.85;}
html body .ntf-acc.t-plan_expiring,html body .ntf-acc.t-plan_expired{border-inline-start-color:var(--ntf-red,#b3261e);}
html body .ntf-acc>summary{list-style:none;display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 14px;cursor:pointer;min-height:48px;}
html body .ntf-acc>summary::-webkit-details-marker{display:none;}
html body .ntf-acc>summary::after{content:"";flex:0 0 auto;width:8px;height:8px;margin-inline-start:auto;border-inline-end:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .2s;opacity:.55;margin-top:-4px;}
html body .ntf-acc[open]>summary::after{transform:rotate(-135deg);margin-top:4px;}
html body .ntf-acc>summary:focus-visible{outline:3px solid rgba(184,134,47,.45);outline-offset:-3px;border-radius:12px;}
html body .ntf-acc-title{flex:1 1 180px;min-width:0;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
html body .ntf-acc-meta{font-size:12px;color:var(--ntf-muted,#6b6b6b);white-space:nowrap;}
html body .ntf-acc-body{padding:0 14px 14px;border-top:1px dashed var(--ntf-line,#e6dccb);padding-top:12px;}
html body .ntf-acc-body .ntf-body{display:block;white-space:pre-wrap;line-height:1.7;}
html body .ntf-acc-body .ntf-text{white-space:pre-wrap;line-height:1.7;margin:0 0 8px;}
html[data-theme="dark"] .ntf-acc{background:#13211e;border-color:#2b3f39;}
html[data-theme="dark"] .ntf-acc.is-unread{background:rgba(184,134,47,.14);}
html[data-theme="dark"] .ntf-acc-body{border-color:#2b3f39;}

/* ---------- الجوال ---------- */
@media (max-width:980px){
  /* صف الحساب والاشتراك يأخذ سطرًا كاملًا، وبقية أدوات الرأس تلتف تحته */
  html body .main-head .head-tools{flex-wrap:wrap!important;}
  html body .main-head .hd-acct{flex:1 1 100%;justify-content:space-between;}
  /* درج القائمة الجانبية خارج الشاشة على الجوال، ويجب ألا يسبب تمريرًا جانبيًا للصفحة */
  html{overflow-x:hidden;}
}
@media (max-width:720px){
  html body .head-tools{gap:8px;}
  html body .acct-chip{min-height:44px;padding:4px 8px 4px 4px;gap:8px;max-width:none;}
  html body .acct-meta small,html body .acct-caret{display:none;}
  html body .acct-meta b{max-width:120px;font-size:13px;}
  html body .acct-avatar{width:32px;height:32px;flex-basis:32px;font-size:14px;}
  html body .hd-sub{height:44px;padding:0 12px;}
  html body .hd-sub-lbl{font-size:13px;}
  html body .acct-panel{inset-inline-start:0;inset-inline-end:auto;width:min(340px,94vw);}
}
@media (max-width:420px){
  html body .acct-state{display:none;}
  html body .acct-meta{display:none;}
  html body .acct-chip{padding:4px;border-radius:999px;}
  html body .hd-sub-lbl{display:none;}
  html body .hd-sub{width:44px;padding:0;justify-content:center;border-radius:50%;}
}
