/* ============ نفس: الحسابات ولوحة التحكم ============ */
.x-acct { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--fill-tertiary); color: var(--text-primary); text-decoration: none; overflow: hidden; }
.x-acct:hover { box-shadow: inset 0 0 0 100px var(--hover-wash); }
.x-acct > svg { width: 18px; height: 18px; }
.x-acct.is-in { background: transparent; }
@media (max-width: 720px) { .x-acct { width: var(--tap); height: var(--tap); } }

.x-ava { flex: none; width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden; background: var(--fill-primary); color: var(--text-primary-on); font-weight: 700; font-size: 18px; }
.x-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.x-ava svg { width: 60%; height: 60%; }
.x-ava--nav { width: 100%; height: 100%; font-size: 15px; }
.x-ava--lg { width: 64px; height: 64px; font-size: 26px; }
.x-ava--xl { width: 112px; height: 112px; font-size: 44px; }

.x-muted { color: var(--text-secondary); font-size: 14px; line-height: 1.7; }
.x-center { text-align: center; justify-content: center; }
.x-sub { font: var(--type-heading); margin: 28px 0 12px; }
.x-stack { display: grid; gap: 12px; }
.x-row { display: flex; align-items: center; gap: 12px; }
.x-wrap { flex-wrap: wrap; }
.x-grow { flex: 1 1 180px; min-width: 0; }
.x-clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-card { display: grid; gap: 10px; padding: 18px; border-radius: var(--r-xl); background: var(--fill-tertiary); border: 1px solid var(--stroke-secondary); color: var(--text-primary); }
.x-card.x-row { display: flex; }
.x-card h3 { font-size: 18px; }
.x-card p { line-height: 1.8; }
.x-link-card { text-decoration: none; transition: border-color .25s; }
.x-link-card:hover { border-color: var(--stroke-primary); }
.x-cta.x-sm { min-height: 38px; margin: 0; padding: 6px 18px; }
.x-cta.x-wide { width: 100%; }
.x-cta[disabled] { opacity: .55; pointer-events: none; }
.x-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 16px; border-radius: var(--r-pill); border: 1.5px solid var(--stroke-primary); background: transparent; color: var(--text-primary); font: var(--type-label); text-decoration: none; cursor: pointer; white-space: nowrap; }
.x-ghost:hover { background: var(--fill-tertiary); }
.x-ghost[aria-pressed="true"] { background: var(--fill-primary); color: var(--text-primary-on); border-color: var(--fill-primary); }
.x-danger { color: var(--fill-system-red, #d33); border-color: color-mix(in srgb, var(--fill-system-red, #d33) 45%, transparent); }
.x-link { background: none; border: 0; padding: 4px; color: var(--text-secondary); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; justify-self: center; }
.x-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.x-check input { width: 20px; height: 20px; accent-color: var(--fill-primary); }
textarea.x-in { resize: vertical; line-height: 1.8; }
.x-tall { min-height: 320px; }
.x-sel { width: auto; min-height: 38px; padding: 4px 12px; }
.x-thumb { width: 160px; border-radius: 12px; }
.x-mini { width: 48px; height: 64px; object-fit: cover; border-radius: 8px; }
.x-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--fill-system-red, #d33); color: #fff; font-size: 12px; font-weight: 700; }

.x-pill { flex: none; font-size: 13px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--fill-tertiary); border: 1px solid var(--stroke-secondary); white-space: nowrap; }
.x-pill.is-published, .x-pill.is-accepted { background: color-mix(in srgb, #2e9d5b 18%, transparent); border-color: color-mix(in srgb, #2e9d5b 45%, transparent); }
.x-pill.is-pending { background: color-mix(in srgb, #d99a1e 18%, transparent); border-color: color-mix(in srgb, #d99a1e 45%, transparent); }
.x-pill.is-rejected { background: color-mix(in srgb, #d33 14%, transparent); border-color: color-mix(in srgb, #d33 40%, transparent); }

/* تسجيل الدخول */
.x-auth__box { max-width: 460px; margin-inline: auto; display: grid; gap: 14px; }
.x-auth__f { display: grid; gap: 12px; }
.x-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--fill-tertiary); border: 1px solid var(--stroke-secondary); }
.x-seg button { min-height: 42px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-secondary); font: var(--type-label); cursor: pointer; }
.x-seg button[aria-selected="true"] { background: var(--fill-primary); color: var(--text-primary-on); }

/* حسابي / لوحة التحكم */
.x-acct-page { max-width: 960px; margin-inline: auto; }
.x-acct-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.x-acct-head > div { flex: 1 1 200px; }
.x-acct-head .x-h { margin: 0; }
.x-subnav { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin-bottom: 22px; border-radius: var(--r-pill); background: var(--fill-tertiary); border: 1px solid var(--stroke-secondary); scrollbar-width: none; }
.x-subnav::-webkit-scrollbar { display: none; }
.x-subnav a { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 16px; border-radius: var(--r-pill); color: var(--text-secondary); text-decoration: none; font: var(--type-label); white-space: nowrap; }
.x-subnav a[aria-current="page"] { background: var(--fill-primary); color: var(--text-primary-on); }
.x-pane { display: grid; gap: 14px; }
.x-ava-edit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.x-ava-edit label { cursor: pointer; }

.x-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.x-stat { display: grid; gap: 4px; padding: 18px; border-radius: var(--r-xl); background: var(--fill-tertiary); border: 1px solid var(--stroke-secondary); }
.x-stat b { font-size: 30px; line-height: 1.2; }
.x-stat span { color: var(--text-secondary); font-size: 14px; }
.x-top { display: grid; gap: 8px; padding-inline-start: 22px; }
.x-top li a { color: var(--text-primary); }
.x-top li span { color: var(--text-secondary); font-size: 13px; margin-inline-start: 8px; }
.x-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 15px; }
.x-dl dt { color: var(--text-secondary); }
.x-dl dd { margin: 0; overflow-wrap: anywhere; }
.x-gal-admin figure { gap: 8px; }

/* الرسائل */
.x-chat { display: grid; gap: 10px; align-content: start; max-height: 56vh; min-height: 200px; overflow-y: auto; padding: 16px; border-radius: var(--r-xl); background: var(--fill-tertiary); border: 1px solid var(--stroke-secondary); }
.x-bub { max-width: 80%; justify-self: end; display: grid; gap: 4px; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--fill-primary-on); border: 1px solid var(--stroke-secondary); }
.x-bub.is-mine { justify-self: start; border-radius: 18px 18px 6px 18px; background: var(--fill-primary); color: var(--text-primary-on); border-color: transparent; }
.x-bub p { line-height: 1.7; overflow-wrap: anywhere; }
.x-bub time { font-size: 11px; opacity: .65; }
.x-send-row { display: flex; gap: 10px; align-items: flex-end; }
.x-send-row textarea { flex: 1; min-height: 52px; }
.x-send-row .x-cta { margin: 0; }

/* المقال */
.x-read__tools { margin-top: -6px; }
.x-author { margin-top: 18px; }

/* نافذة الكتاب */
.x-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgb(0 0 0 / .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: x-fade .2s ease; }
.x-modal__box { position: relative; width: min(440px, 100%); max-height: 90vh; overflow-y: auto; display: grid; gap: 12px; justify-items: center; text-align: center; padding: 28px 22px 22px; border-radius: var(--r-xl); background: var(--fill-primary-on); color: var(--text-primary); border: 1px solid var(--stroke-primary); }
.x-modal__x { position: absolute; top: 10px; left: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--fill-tertiary); color: var(--text-primary); font-size: 22px; cursor: pointer; }
.x-modal__cover { width: 160px; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; box-shadow: var(--hark-shadow); }
@keyframes x-fade { from { opacity: 0; } }

.x-toast { position: fixed; bottom: 84px; left: 50%; z-index: 120; transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 12px 20px; border-radius: var(--r-pill); background: var(--fill-primary); color: var(--text-primary-on); font: var(--type-label); text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.x-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.x-toast.is-err { background: var(--fill-system-red, #d33); color: #fff; }

.x-apply-acct { text-align: center; font-size: 14px; opacity: .8; margin: -6px 0 6px; }
.x-apply-acct a { color: inherit; font-weight: 600; }
.x-apply-acct:empty { display: none; }
.x-apply:has(.x-done:not([hidden])) .x-apply-acct { display: none; }

/* بحث المقالات */
.x-art-search { display: grid; gap: 12px; margin-bottom: 18px; }
.x-art-search[hidden], .x-art[hidden], .x-art-none[hidden] { display: none; }
.x-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.x-chips:empty { display: none; }
button.x-chip { min-height: 36px; padding: 6px 16px; border-radius: var(--r-pill, 999px); border: 1px solid var(--stroke-primary); background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; cursor: pointer; transition: background .2s, color .2s; }
button.x-chip[aria-pressed="true"] { background: var(--text-primary); color: var(--bg-primary, #000); border-color: var(--text-primary); }
.x-art-none { text-align: center; padding: 24px 0; }

/* التعليقات */
.x-comments { display: grid; gap: 14px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--stroke-secondary); }
.x-comments h3 { font-size: 20px; }
.x-cmt { display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--fill-tertiary); border: 1px solid var(--stroke-secondary); }
.x-cmt .x-grow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.x-cmt time { font-size: 12px; width: 100%; }
.x-cmt__body { white-space: pre-wrap; line-height: 1.8; overflow-wrap: anywhere; }
.x-badge--soft { background: var(--fill-secondary, rgb(127 127 127 / .2)); color: var(--text-primary); font-size: 11px; height: 18px; }
.x-ghost.x-sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.x-comments a { color: inherit; font-weight: 600; }

@media (max-width: 600px) {
  .x-card.x-row { flex-wrap: wrap; }
  .x-send-row { flex-direction: column; align-items: stretch; }
  .x-bub { max-width: 92%; }
}

/* ===== محرر الموقع ===== */
.x-hidden-sec { display: none !important; }
.x-editing [contenteditable="true"] { outline: 1.5px dashed color-mix(in srgb, var(--text-primary) 45%, transparent); outline-offset: 4px; border-radius: 6px; cursor: text; transition: outline-color .2s, background .2s; }
.x-editing [contenteditable="true"]:hover { outline-color: var(--text-primary); }
.x-editing [contenteditable="true"]:focus { outline: 2px solid var(--text-primary); background: color-mix(in srgb, var(--text-primary) 6%, transparent); }
.x-editing img.x-ed-img { outline: 2px dashed var(--text-primary); outline-offset: 4px; cursor: copy; }
.x-editing .x-ed-link { outline: 2px dashed var(--text-primary); outline-offset: 3px; border-radius: 50%; }
.x-editing .x-rv { opacity: 1 !important; transform: none !important; }
.x-editing [data-sec] { position: relative; }
.x-ed-off { opacity: .35; filter: grayscale(1); }
.x-ed-hide { position: absolute; top: 8px; left: 8px; z-index: 5; min-height: 34px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--stroke-primary); background: var(--fill-primary); color: var(--text-primary-on); font: inherit; font-size: 13px; cursor: pointer; box-shadow: var(--hark-shadow); }
.x-ed-bar { position: fixed; z-index: 130; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--mat-inverse, rgb(20 20 20 / .9)); color: var(--text-primary-on, #fff); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 12px 40px rgb(0 0 0 / .35); font-size: 14px; white-space: nowrap; max-width: calc(100% - 24px); animation: x-up .35s cubic-bezier(.2,.8,.2,1); }
.x-ed-bar .x-ghost { color: inherit; border-color: currentColor; }
.x-ed-bar #ed-n { overflow: hidden; text-overflow: ellipsis; }
.x-ed-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff5a5f; box-shadow: 0 0 0 0 #ff5a5f88; animation: x-pulse 1.6s infinite; flex: none; }
.x-ed-fab { position: fixed; z-index: 70; bottom: 76px; left: 18px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 14px; border-radius: 999px; border: 0; background: var(--fill-primary); color: var(--text-primary-on); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--hark-shadow); transition: transform .2s; }
.x-ed-fab svg { width: 18px; height: 18px; }
.x-ed-fab:hover { transform: translateY(-2px); }
.x-editing .x-ed-fab { display: none; }
@keyframes x-up { from { opacity: 0; transform: translate(-50%, 24px); } }
@keyframes x-pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.x-site-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--text-primary) 8%, transparent), transparent); }

/* ===== فكرة اليوم ===== */
.x-tip { position: relative; display: flex; align-items: flex-start; gap: 14px; margin: 4px auto 0; width: min(760px, 100%); padding: 18px 20px; border-radius: var(--r-xl, 24px); border: 1px solid var(--stroke-primary); background: linear-gradient(120deg, color-mix(in srgb, var(--text-primary) 7%, transparent), transparent 60%), var(--fill-tertiary); overflow: hidden; animation: x-fade .6s ease both; }
.x-tip::after { content: ""; position: absolute; inset: -40% auto auto -20%; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--text-primary) 14%, transparent), transparent); pointer-events: none; animation: x-float 9s ease-in-out infinite alternate; }
.x-tip__ic { font-size: 26px; line-height: 1; flex: none; animation: x-glowpulse 3s ease-in-out infinite; }
.x-tip__tx { display: grid; gap: 4px; flex: 1; position: relative; z-index: 1; }
.x-tip__k { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--text-secondary); }
.x-tip__tx p { font-size: 17px; line-height: 1.8; }
.x-tip__tx small { color: var(--text-secondary); font-size: 12px; justify-self: start; }
.x-tip__sh { position: relative; z-index: 1; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--stroke-primary); background: transparent; color: var(--text-primary); display: grid; place-items: center; cursor: pointer; }
.x-tip__sh svg { width: 18px; height: 18px; }
@keyframes x-float { to { transform: translate(60px, 40px); } }
@keyframes x-glowpulse { 50% { transform: scale(1.12) rotate(-6deg); } }

/* ===== القراءة ===== */
.x-prog { position: fixed; top: 0; right: 0; left: 0; height: 3px; z-index: 140; background: var(--text-primary); transform-origin: right; transform: scaleX(0); transition: transform .1s linear; pointer-events: none; }
.x-read__tools { gap: 10px; margin: 8px 0 18px; }
.x-like { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 16px; border-radius: 999px; border: 1.5px solid var(--stroke-primary); background: transparent; color: var(--text-primary); font: inherit; cursor: pointer; transition: background .2s, border-color .2s; }
.x-like svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: fill .2s, transform .2s; }
.x-like[aria-pressed="true"] { border-color: #ff4d6d; color: #ff4d6d; }
.x-like[aria-pressed="true"] svg { fill: #ff4d6d; }
.x-like.is-pop svg { animation: x-heart .45s cubic-bezier(.2,.8,.2,1.4); }
@keyframes x-heart { 40% { transform: scale(1.45); } }
.x-fig { margin: 18px 0; display: grid; gap: 8px; }
.x-fig img { width: 100%; border-radius: 16px; }
.x-fig figcaption { color: var(--text-secondary); font-size: 14px; text-align: center; }
.x-rt { white-space: nowrap; }

/* ===== شريط المحرر ===== */
.x-tb { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--stroke-secondary); border-radius: 14px; background: var(--fill-tertiary); }
.x-tb__b { min-height: 36px; padding: 4px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; cursor: pointer; }
.x-tb__b:hover { background: var(--fill-secondary); }
.x-tb__b[data-tb="bold"] { font-weight: 800; }
.x-tb__pv { margin-inline-start: auto; }
.x-preview { padding: 16px; border: 1px dashed var(--stroke-primary); border-radius: 14px; min-height: 200px; }

/* ===== هيكل التحميل ===== */
.x-skel { pointer-events: none; }
.x-skel i, .x-skel b { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--fill-secondary) 25%, color-mix(in srgb, var(--text-primary) 18%, transparent) 50%, var(--fill-secondary) 75%); background-size: 200% 100%; animation: x-shim 1.3s linear infinite; opacity: .5; }
.x-skel i { aspect-ratio: 16/9; border-radius: 14px; }
.x-skel b { height: 14px; }
.x-skel b.s { width: 55%; }
@keyframes x-shim { to { background-position: -200% 0; } }

/* ===== اقتراح التثبيت ===== */
.x-inst { position: fixed; z-index: 125; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); width: min(460px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 22px; background: var(--mat-agent, var(--fill-tertiary)); border: 1px solid var(--stroke-primary); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 16px 48px rgb(0 0 0 / .3); color: var(--text-primary); transform: translate(-50%, 140%); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.x-inst.is-on { transform: translate(-50%, 0); }
.x-inst img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.x-inst .x-grow { display: grid; gap: 2px; min-width: 0; }
.x-inst strong { font-size: 15px; }
.x-inst span { font-size: 13px; color: var(--text-secondary); }
.x-inst .x-cta { margin: 0; flex: none; }
.x-inst__x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--fill-secondary); color: var(--text-primary); font-size: 18px; cursor: pointer; }
.x-inst-ic img { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--hark-shadow); }
.x-steps { text-align: start; display: grid; gap: 10px; padding-inline-start: 22px; line-height: 1.8; }
.x-key { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--stroke-primary); font-size: 14px; }

/* ===== إحساس التطبيق على الجوال ===== */
html { -webkit-tap-highlight-color: transparent; }
.x-standalone body { overscroll-behavior-y: none; }
@media (max-width: 600px) {
  .x-ed-fab { bottom: calc(env(safe-area-inset-bottom, 0px) + 76px); }
  .x-ed-fab span { display: none; }
  .x-ed-fab { padding: 0; width: 46px; justify-content: center; }
  .x-inst, .x-ed-bar { bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); }
  .x-tip { padding: 16px; }
  .x-tip__tx p { font-size: 16px; }
  .x-standalone .shell, .x-standalone .main { padding-top: env(safe-area-inset-top, 0px); }
}
@media (prefers-reduced-motion: reduce) { .x-tip::after, .x-tip__ic, .x-ed-dot, .x-skel i, .x-skel b { animation: none; } }

/* ================= نموذج الانضمام — معالج متعدد الخطوات ================= */
.x-apply:has(.x-wz) { gap: 18px; }
.x-apply:has(.x-wz) .x-apply__t { font-size: clamp(26px, 6vw, 40px); }
.x-apply-acct { text-align: center; font-size: 13px; color: rgb(var(--ap-rgb) / .55); }
.x-apply-acct a { color: var(--ap-fg); }
.x-wz { display: grid; gap: 26px; }
.x-wz-badge { justify-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 13px; border: 1px solid rgb(var(--ap-rgb) / .14); color: rgb(var(--ap-rgb) / .8); }
.x-wz-badge i { width: 7px; height: 7px; border-radius: 50%; background: #34c759; animation: wzPulse 1.8s ease-in-out infinite; }
@keyframes wzPulse { 0%,100% { box-shadow: 0 0 0 0 rgb(52 199 89 / .5); } 50% { box-shadow: 0 0 0 6px rgb(52 199 89 / 0); } }
@keyframes wzUp { to { opacity: 1; transform: none; } }

/* التقدّم: شريط مقسّم */
.x-wz-top { display: grid; gap: 10px; }
.x-wz-segs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.x-wz-seg { position: relative; height: 5px; border: 0; padding: 0; border-radius: 5px; background: rgb(var(--ap-rgb) / .12); overflow: hidden; cursor: pointer; }
.x-wz-seg::before { content: ""; position: absolute; inset: -10px 0; }
.x-wz-seg i { position: absolute; inset: 0; transform-origin: right; transform: scaleX(0); background: var(--ap-fg); border-radius: inherit; transition: transform .6s cubic-bezier(.65,0,.35,1); }
.x-wz-seg[disabled] { cursor: default; }
.x-wz-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: rgb(var(--ap-rgb) / .5); }
.x-wz-meta b { color: var(--ap-fg); font-weight: 600; }

/* الخطوات */
.x-wz-step { display: grid; gap: 22px; }
.x-wz-step[hidden] { display: none !important; }
.x-wz-step__h { display: grid; gap: 6px; }
.x-wz-step__h h3 { font-size: clamp(24px, 5.4vw, 32px); line-height: 1.25; color: var(--ap-fg); margin: 0; letter-spacing: -.01em; }
.x-wz-step__h p { margin: 0; color: rgb(var(--ap-rgb) / .55); font-size: 15px; }
.x-wz-step.is-enter-f { animation: wzInF .5s cubic-bezier(.2,.8,.2,1) both; }
.x-wz-step.is-enter-b { animation: wzInB .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes wzInF { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes wzInB { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.x-wz-step > * { animation: wzRise .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i,0) * 70ms); }
@keyframes wzRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* الحقول: بدون صناديق ثقيلة */
.x-apply .x-wz .x-field { background: none; border: 0; box-shadow: none; padding: 0; gap: 10px; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; }
.x-wz .x-field > span, .x-wz .x-field legend { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.x-wz .x-field legend { margin-bottom: 0; }
.x-wz .x-field small { margin-top: -6px; font-size: 13px; }
.x-apply .x-wz .x-in { min-height: 54px; padding: 14px 16px; border-radius: 16px; font-size: 17px; background: rgb(var(--ap-rgb) / .06); border: 1px solid rgb(var(--ap-rgb) / .1); transition: border-color .25s, background .25s, box-shadow .25s; }
.x-apply .x-wz .x-in:hover { background: rgb(var(--ap-rgb) / .08); }
.x-apply .x-wz .x-in:focus { background: transparent; border-color: var(--ap-fg); box-shadow: 0 0 0 4px rgb(var(--ap-rgb) / .1); }
.x-wz .x-field.is-ok > span::after, .x-wz .x-field.is-ok legend::after { content: "✓"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; background: #34c759; color: #fff; animation: wzPop .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes wzPop { from { transform: scale(0); } to { transform: scale(1); } }
.x-wz .x-field.is-bad { animation: wzShake .4s; }
.x-wz .x-field.is-bad .x-in, .x-wz .x-field.is-bad .x-chip span { border-color: var(--ap-err) !important; }
.x-wz .x-field.is-bad > span, .x-wz .x-field.is-bad legend { color: var(--ap-err); }
@keyframes wzShake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* الخيارات: بطاقات أنيقة */
.x-wz .x-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.x-wz .x-chip { display: block; }
.x-apply .x-wz .x-chip span { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 50px; padding: 10px 12px; border-radius: 14px; text-align: center; font-size: 15px; background: rgb(var(--ap-rgb) / .06); border: 1px solid rgb(var(--ap-rgb) / .1); transition: background .25s, color .25s, border-color .25s, transform .3s cubic-bezier(.34,1.56,.64,1); }
.x-apply .x-wz .x-chip:hover span { border-color: rgb(var(--ap-rgb) / .35); }
.x-apply .x-wz .x-chip input:checked + span { background: var(--ap-fg); color: var(--ap-bg); border-color: var(--ap-fg); animation: wzChip .4s cubic-bezier(.34,1.56,.64,1); }
.x-wz .x-chip input:checked + span::before { content: "✓"; font-size: 13px; }
.x-wz .x-chip input:active + span { transform: scale(.96); }
@keyframes wzChip { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.x-wz .x-other { grid-column: 1 / -1; }
.x-wz-count { justify-self: end; font-size: 12px; color: rgb(var(--ap-rgb) / .45); }
.x-wz-count.is-hi { color: var(--ap-err); }

/* الأزرار */
.x-wz-nav { display: grid; gap: 10px; }
.x-apply .x-wz-nav .x-cta { width: 100%; min-height: 56px; justify-content: center; font-size: 17px; margin: 0; border-radius: 16px; }
.x-wz-nav .x-cta svg { transition: transform .3s; }
.x-wz-nav .x-cta:hover svg { transform: translateX(-4px); }
.x-wz-back { justify-self: center; background: none; border: 0; color: rgb(var(--ap-rgb) / .6); min-height: 40px; padding: 0 14px; font: inherit; font-size: 15px; cursor: pointer; border-radius: 999px; }
.x-wz-back:hover { color: var(--ap-fg); background: rgb(var(--ap-rgb) / .06); }
.x-apply .x-wz-back[hidden], .x-apply .x-wz-nav [hidden] { display: none !important; }
.x-wz .x-send.is-busy { pointer-events: none; }
.x-wz .x-send.is-busy svg { display: none; }
.x-wz .x-send.is-busy::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: wzSpin .7s linear infinite; }
@keyframes wzSpin { to { transform: rotate(360deg); } }

/* المراجعة */
.x-wz-rev { display: grid; gap: 0; padding: 6px 16px; border-radius: 16px; background: rgb(var(--ap-rgb) / .05); }
.x-wz-rev h4 { margin: 10px 0 4px; font-size: 13px; font-weight: 500; color: rgb(var(--ap-rgb) / .55); }
.x-wz-rev div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 10px 0; border-bottom: 1px solid rgb(var(--ap-rgb) / .08); }
.x-wz-rev div:last-child { border: 0; }
.x-wz-rev span { color: rgb(var(--ap-rgb) / .55); }
.x-wz-rev b { color: var(--ap-fg); font-weight: 500; text-align: left; overflow-wrap: anywhere; }

/* النجاح */
.x-done.is-on { animation: wzRise .7s cubic-bezier(.2,.8,.2,1) both; }
.x-done-check { width: 96px; height: 96px; }
.x-done-check circle { fill: none; stroke: #34c759; stroke-width: 3; stroke-dasharray: 290; stroke-dashoffset: 290; animation: wzDraw .8s .1s cubic-bezier(.65,0,.35,1) forwards; }
.x-done-check path { fill: none; stroke: #34c759; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: wzDraw .5s .8s cubic-bezier(.65,0,.35,1) forwards; }
@keyframes wzDraw { to { stroke-dashoffset: 0; } }
.x-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }
.x-rm .x-wz *, .x-rm .x-done { animation: none !important; opacity: 1 !important; transform: none !important; }

/* ================= شريط التنقل — زجاج سائل ================= */
.x-nav.nav {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 70;
  justify-self: center; width: auto; max-width: calc(100% - 4px);
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px;
  background: linear-gradient(180deg, rgb(255 255 255 / .62), rgb(255 255 255 / .42));
  backdrop-filter: blur(22px) saturate(190%) brightness(1.05); -webkit-backdrop-filter: blur(22px) saturate(190%) brightness(1.05);
  border: 1px solid rgb(255 255 255 / .7);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .9), inset 0 -1px 1px rgb(0 0 0 / .04), 0 10px 30px -8px rgb(0 0 0 / .18), 0 2px 6px rgb(0 0 0 / .05);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .3s, box-shadow .3s;
  isolation: isolate;
}
.x-nav.nav::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(120% 140% at 15% -30%, rgb(255 255 255 / .75), transparent 45%), radial-gradient(90% 120% at 100% 130%, rgb(255 255 255 / .35), transparent 50%); opacity: .8; }
:root[data-theme="dark"] .x-nav.nav {
  background: linear-gradient(180deg, rgb(40 40 44 / .58), rgb(22 22 24 / .48));
  border-color: rgb(255 255 255 / .14);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), inset 0 -1px 1px rgb(0 0 0 / .3), 0 12px 32px -8px rgb(0 0 0 / .6);
}
:root[data-theme="dark"] .x-nav.nav::before { background: radial-gradient(120% 140% at 15% -30%, rgb(255 255 255 / .14), transparent 45%); }
.x-nav.nav.is-away { transform: translateY(calc(-100% - 24px)); opacity: 0; pointer-events: none; }
.x-nav .x-brand { padding-inline: 10px 6px; min-height: 40px; }
.x-nav .x-brand img { width: 64px; }
.x-nav .x-tabs { background: transparent; gap: 2px; border-radius: 999px; }
.x-nav .x-tabs a { min-height: 40px; padding: 6px 16px; font-size: 15px; font-weight: 500; color: rgb(0 0 0 / .62); transition: color .3s, transform .3s cubic-bezier(.34,1.56,.64,1); }
:root[data-theme="dark"] .x-nav .x-tabs a { color: rgb(255 255 255 / .62); }
.x-nav .x-tabs a:hover { color: var(--text-primary); }
.x-nav .x-tabs a:active { transform: scale(.94); }
.x-nav .x-tabs a[aria-current="page"], .x-nav .x-tabs.is-moving a[aria-current="page"] { color: var(--text-primary); background: transparent; font-weight: 600; }
.x-nav .x-ind {
  background: linear-gradient(180deg, rgb(255 255 255 / .95), rgb(255 255 255 / .7));
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgb(0 0 0 / .12), 0 0 0 .5px rgb(0 0 0 / .06);
  transition: transform .55s cubic-bezier(.34,1.3,.64,1), width .55s cubic-bezier(.34,1.3,.64,1);
}
:root[data-theme="dark"] .x-nav .x-ind { background: linear-gradient(180deg, rgb(255 255 255 / .22), rgb(255 255 255 / .1)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), 0 2px 10px rgb(0 0 0 / .4); }
.x-nav .x-tabs.is-moving .x-ind { animation: x-blob .55s cubic-bezier(.34,1.3,.64,1); }
@keyframes x-blob { 40% { scale: 1.12 .86; } 100% { scale: 1 1; } }
.x-nav .x-acct { width: 40px; height: 40px; background: rgb(0 0 0 / .05); }
:root[data-theme="dark"] .x-nav .x-acct { background: rgb(255 255 255 / .08); }
.x-nav .x-acct.is-in { background: transparent; }
@media (max-width: 600px) {
  .x-nav.nav { width: calc(100% - 8px); padding: 5px; gap: 4px; top: calc(env(safe-area-inset-top, 0px) + 8px); }
  .x-nav .x-brand { display: none; }
  .x-nav .x-tabs { flex: 1 1 auto; order: 0; flex-basis: auto; }
  .x-nav .x-tabs a { flex: 1 1 0; min-width: 0; padding: 4px 6px; font-size: 14px; min-height: 42px; }
  .x-nav .x-acct { width: 42px; height: 42px; }
}
@media (max-width: 360px) { .x-nav .x-tabs a { font-size: 13px; padding-inline: 3px; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .x-nav.nav { background: var(--bg-primary, #fff); } }

/* زر المظهر في التذييل */
.x-theme--foot { width: auto !important; height: auto !important; min-height: 40px; padding: 8px 16px !important; gap: 8px; display: inline-flex !important; align-items: center; border-radius: 999px !important; border: 1px solid var(--stroke-primary) !important; background: transparent !important; font: inherit; font-size: 14px; color: var(--text-primary); align-self: center; }
.x-theme--foot:hover { background: var(--fill-tertiary) !important; }

/* ================= بطاقة الرئيسية (إعلانات وأفكار) ================= */
.x-spot { position: relative; width: min(820px, 100%); margin: 6px auto 0; border-radius: 28px; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, color-mix(in srgb, var(--text-primary) 9%, transparent), color-mix(in srgb, var(--text-primary) 3%, transparent));
  border: 1px solid color-mix(in srgb, var(--text-primary) 12%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 10%, transparent), 0 20px 50px -30px rgb(0 0 0 / .5);
  animation: spIn .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes spIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.x-spot::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; background: conic-gradient(from var(--sp-a, 0deg), transparent 0 70%, color-mix(in srgb, var(--text-primary) 35%, transparent) 80%, transparent 90%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px; animation: spRot 6s linear infinite; }
@property --sp-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spRot { to { --sp-a: 360deg; } }
.x-spot::after { content: ""; position: absolute; width: 260px; height: 260px; top: -120px; left: -80px; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--text-primary) 14%, transparent), transparent); animation: x-float 9s ease-in-out infinite alternate; pointer-events: none; }
.x-spot__track { display: flex; transition: transform .7s cubic-bezier(.65,0,.35,1); }
.x-spot__it { flex: 0 0 100%; display: grid; grid-template-columns: 1fr; }
.x-spot__it.has-img { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.x-spot__img { position: relative; overflow: hidden; min-height: 200px; }
.x-spot__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.2s cubic-bezier(.2,.8,.2,1); }
.x-spot__it.is-on .x-spot__img img { transform: scale(1); }
.x-spot__body { display: grid; gap: 10px; align-content: center; padding: clamp(20px, 4vw, 30px); }
.x-spot__top { display: flex; align-items: center; gap: 10px; }
.x-spot__em { width: 38px; height: 38px; display: grid; place-items: center; font-size: 20px; border-radius: 12px; background: color-mix(in srgb, var(--text-primary) 8%, transparent); animation: spBob 3.2s ease-in-out infinite; }
@keyframes spBob { 50% { transform: translateY(-3px) rotate(-6deg); } }
.x-spot__k { font-size: 13px; font-weight: 700; letter-spacing: .02em; padding: 4px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--text-primary) 18%, transparent); color: var(--text-primary); }
.x-spot__it[data-kind="announce"] .x-spot__k { background: var(--text-primary); color: var(--bg-primary, #000); border-color: transparent; }
.x-spot__tx { font-size: clamp(17px, 2.4vw, 20px); line-height: 1.8; color: var(--text-primary); margin: 0; }
.x-spot__it.is-on .x-spot__tx { animation: spTx .7s .15s cubic-bezier(.2,.8,.2,1) both; }
@keyframes spTx { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.x-spot__src { color: var(--text-secondary); font-size: 12px; }
.x-spot__acts { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.x-spot__go { margin: 0 !important; }
.x-spot__sh { margin-inline-start: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--text-primary) 18%, transparent); background: transparent; color: var(--text-primary); cursor: pointer; transition: transform .3s cubic-bezier(.34,1.56,.64,1), background .25s; }
.x-spot__sh:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.x-spot__sh svg { width: 18px; height: 18px; }
.x-spot__dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.x-spot__dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 99px; background: color-mix(in srgb, var(--text-primary) 25%, transparent); cursor: pointer; transition: width .4s cubic-bezier(.34,1.56,.64,1), background .3s; }
.x-spot__dots button.is-on { width: 22px; background: var(--text-primary); }
.x-spot.is-preview { animation: none; margin: 0; }
@media (max-width: 640px) { .x-spot__it.has-img { grid-template-columns: 1fr; } .x-spot__img { min-height: 180px; } .x-spot { border-radius: 24px; } }

/* لوحة الأدمن: أدوات */
.x-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.x-checks { display: flex; flex-wrap: wrap; gap: 18px; }
.x-help { font-size: 13px; }
.x-seg label { position: relative; display: block; cursor: pointer; }
.x-seg label input { position: absolute; opacity: 0; inset: 0; }
.x-seg label span { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: var(--r-pill); color: var(--text-secondary); font: var(--type-label); transition: background .25s, color .25s; }
.x-seg label input:checked + span { background: var(--fill-primary); color: var(--text-primary-on); }
.x-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; flex: none; }
.x-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.x-switch span { width: 52px; height: 32px; border-radius: 99px; background: var(--fill-secondary, rgb(127 127 127 / .3)); position: relative; transition: background .3s; }
.x-switch span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .25); transition: transform .35s cubic-bezier(.34,1.56,.64,1); }
.x-switch input:checked + span { background: #34c759; }
.x-switch input:checked + span::after { transform: translateX(-20px); }
.x-switch b { font-weight: 600; font-size: 14px; min-width: 44px; }
.x-spot-prev { display: grid; gap: 8px; margin: 14px 0 18px; }
.x-spot-row { display: grid !important; gap: 10px; }
.x-spot-row.is-off { opacity: .55; }
.x-spot-row p { margin: 6px 0 0; white-space: pre-line; }
.x-ghost[hidden], .x-cta[hidden], .x-row [hidden] { display: none !important; }

/* منع تمدد الصفحات أوسع من الشاشة (لوحة التحكم وحسابي) */
.x-acct-page, .x-acct-page > *, #x-me, #x-dash, .x-pane, .x-pane > *, .x-card, .x-stack > * { min-width: 0; max-width: 100%; }
.x-acct-page { display: block; overflow-x: clip; }
.x-subnav { max-width: 100%; }
.x-card .x-muted[dir="ltr"], .x-dl dd { overflow-wrap: anywhere; }
.x-dl dd { min-width: 0; }
@media (max-width: 640px) {
  .x-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .x-stat { padding: 14px; }
  .x-stat b { font-size: 26px; }
  .x-acct-head { gap: 12px; }
  .x-pane .x-row.x-wrap > .x-sel, .x-pane .x-row.x-wrap > .x-ghost, .x-pane .x-row.x-wrap > .x-cta { flex: 1 1 auto; }
}

.x-acct-acts { display: flex; gap: 8px; align-items: center; margin-inline-start: auto; }
.x-acct-acts .x-ghost, .x-acct-acts .x-cta { margin: 0; }
@media (max-width: 640px) { .x-acct-acts { width: 100%; margin: 0; } .x-acct-acts > * { flex: 1 1 0; justify-content: center; } }

/* التحقق الثنائي */
.x-mfa { margin-top: 1.5rem; max-width: 560px; }
.x-mfa .x-h3, .x-mfa h3 { margin: 0; font-size: 1.1rem; }
.x-mfa__on { font-weight: 700; color: #1f7a4d; margin: 0 0 .5rem; }
.x-mfa__steps { margin: 0; padding-inline-start: 1.2rem; line-height: 1.9; font-size: .95rem; }
.x-mfa__qr { display: block; width: 190px; height: 190px; max-width: 100%; background: #fff; padding: 10px; border-radius: 14px; margin: .5rem auto; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.x-mfa__key { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: center; margin: 0; }
.x-mfa__key code { font-size: .8rem; word-break: break-all; background: rgba(0,0,0,.05); padding: .35rem .55rem; border-radius: 8px; max-width: 100%; }
.x-mfa__code { letter-spacing: .4em; text-align: center; font-size: 1.25rem; font-variant-numeric: tabular-nums; max-width: 220px; }
#x-mfa-gate .x-mfa__code { max-width: none; width: 100%; }
#x-mfa-gate h2 { margin: 0; }
.x-mfa__form { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: stretch; }
.x-mfa__form .x-mfa__code { max-width: none; width: 100%; }
.x-mfa__form #mfa-cancel { grid-column: 1 / -1; }

.x-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.x-google svg { flex: none; background: #fff; border-radius: 50%; padding: 2px; box-sizing: content-box; }
