/* =========================================================
   الدعم العلمي — نفس ألوان وتوكنز منصة abdelmaaboud.com
   ========================================================= */
:root, [data-theme="light"] {
  --main-color: #6366f1; --p-h: #4f46e5; --p-light: #818cf8; --p-ultra: #eef2ff;
  --bg-body: #edf2fb; --bg-white: #fff; --inp-bg: #f3f4f6;
  --main-font-color: #374151; --sc-font-color: #6b7280; --tx-m: #9ca3af;
  --border: #6366f124; --line: #e5e7eb;
  --s: #10b981; --s-h: #059669; --s-ultra: #d1fae5; --s-tx: #047857;
  --gold: #f59e0b; --gold-ultra: #fef3c7; --gold-tx: #b45309;
  --rose: #f43f5e; --rose-ultra: #ffe4e6;
  --card-shadow: 0 0 10px 1px #eee;
  --bubble-me: #f3f4f6;
}
[data-theme="dark"] {
  --bg-body: #0f1428; --bg-white: #1e253a; --inp-bg: #161b27;
  --main-font-color: #fff; --sc-font-color: #94a3b8; --tx-m: #9ca3af;
  --p-ultra: #1a1f3c; --line: #2a3350;
  --s-ultra: #0f2e2a; --s-tx: #34d399; --gold-ultra: #2e2614; --gold-tx: #fbbf24; --rose-ultra: #3a1622;
  --card-shadow: 0 0 10px 1px #00000028;
  --bubble-me: #161b27;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg-body); color: var(--main-font-color);
  font-family: Tajawal, sans-serif; direction: rtl; line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 1em; height: 1em; flex: none; }
[hidden] { display: none !important; }
a { color: var(--main-color); }

/* ---------- شريط التجربة ---------- */
.demo-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 12px; font-size: 12px; font-weight: 700;
  background: #111827; color: #e5e7eb;
}
.demo-bar select { background: #374151; color: #fff; border: 0; border-radius: 8px; padding: 3px 8px; font-weight: 700; }
.demo-bar a { color: #a5b4fc; text-decoration: none; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

/* ---------- الهيدر ---------- */
.header { background: var(--bg-white); position: sticky; top: 0; z-index: 50; box-shadow: 0 5px 20px #00000010; }
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 15px; max-width: 1400px; margin: auto; }
.hdr-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.hdr-logo img { border-radius: 50%; }
.hdr-logo p { margin: 0; font-size: 16px; font-weight: 800; color: var(--main-font-color); line-height: 1.1; white-space: nowrap; }
.hdr-logo p span { color: var(--main-color); font-weight: 400; }
.hdr-logo small { color: var(--tx-m); font-size: 10.5px; white-space: nowrap; }
.hdr-links { display: flex; align-items: center; }
.hdr-links a { display: flex; align-items: center; gap: 6px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--main-font-color); font-size: 14px; font-weight: 700; transition: .3s; }
.hdr-links a svg { font-size: 15px; }
.hdr-links a:hover { background: var(--border); transform: translateY(-2px); }
.hdr-links a.active { background: var(--border); color: var(--main-color); }
.hdr-left { display: flex; align-items: center; gap: 10px; }
.theme-btn { width: 64px; height: 34px; border-radius: 99px; border: 0; background: var(--inp-bg); display: flex; align-items: center; justify-content: space-around; color: var(--sc-font-color); position: relative; }
.theme-btn::after { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; background: var(--main-color); top: 4px; right: 4px; transition: .3s; opacity: .18; }
[data-theme="dark"] .theme-btn::after { right: 34px; }
.theme-btn svg { font-size: 16px; position: relative; z-index: 1; }
.hdr-user { border-radius: 50%; border: 2px solid var(--border); object-fit: cover; }

/* ---------- عنوان الصفحة ---------- */
.page-header { background: rgba(99,102,241,.14); padding: 25px 16px; }
.ph-title { display: flex; justify-content: center; align-items: center; gap: 20px; }
.ph-icon { width: 60px; height: 60px; background: var(--bg-white); color: var(--main-color); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.ph-title h1 { margin: 0; font-size: 24px; font-weight: 700; color: var(--main-font-color); }
.ph-labels { display: flex; gap: 2px; font-size: 12px; color: var(--sc-font-color); }
.ph-labels span:not(:last-child)::after { content: "•"; margin: 0 6px; }
.ph-desc { text-align: center; margin: 10px 0 0; font-size: 13px; color: var(--sc-font-color); }

/* ---------- عام ---------- */
.wrap { max-width: 1400px; margin: auto; padding: 30px 40px 60px; }
.card { background: var(--bg-white); border-radius: 20px; box-shadow: var(--card-shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 13px; padding: 10px 18px; font-weight: 700; font-size: 14px; transition: .2s; white-space: nowrap; }
.btn svg { font-size: 17px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-main { background: var(--main-color); color: #fff; }
.btn-main:hover:not(:disabled) { background: var(--p-h); }
.btn-soft { background: var(--border); color: var(--main-color); }
.btn-ghost { background: transparent; border: 2px solid var(--main-color); color: var(--main-color); }
.btn-ok { background: var(--s-h); color: #fff; }
.btn-ok:hover { background: #047857; }
.btn-link { background: none; padding: 4px 6px; color: var(--sc-font-color); font-size: 13px; }
.btn-link.danger { color: var(--rose); }
.btn-lg { padding: 13px 22px; font-size: 16px; border-radius: 15px; }

/* ---------- التابات ---------- */
.tabs { list-style: none; margin: 0 0 24px; padding: 0; display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.tabs li { flex: 0 1 350px; }
.tabs button {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; position: relative;
  background: var(--bg-white); color: var(--tx-m); border: 0; border-radius: 15px; padding: 10px 15px;
  font-size: 14px; font-weight: 600; box-shadow: var(--card-shadow); transition: .2s;
}
.tabs button i { width: 35px; height: 35px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--border); color: var(--main-color); }
.tabs button.active { background: var(--main-color); color: #fff; }
.tabs button.active i { background: #ffffff2a; color: #fff; }
.tabs button em { font-style: normal; opacity: .85; }
.tab-dot { position: absolute; top: 8px; left: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 3px var(--bg-white); }

/* ---------- اسأل سؤال ---------- */
.ask-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 20px; align-items: start; }
.ask-card { padding: 20px; min-height: 420px; }
.ask-head { display: flex; align-items: center; gap: 15px; padding-bottom: 12px; margin-bottom: 18px; border-bottom: 2px solid var(--border); }
.ask-head img { width: 50px; height: 50px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; }
.ask-head-txt { flex: 1; min-width: 0; }
.ask-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ask-name p { margin: 0; font-size: 20px; font-weight: 800; }
.ask-name span { background: var(--gold-ultra); color: var(--gold-tx); border-radius: 20px; padding: 3px 14px; font-size: 13px; font-weight: 600; }
.ask-head small { color: var(--tx-m); font-size: 13px; font-weight: 600; }

/* المحرر */
.composer { display: flex; flex-direction: column; gap: 12px; }
.composer-box {
  background: var(--inp-bg); border: 2px solid transparent; border-radius: 18px; transition: .2s; position: relative;
}
.composer-box:focus-within { border-color: var(--main-color); background: var(--bg-white); }
.composer-box.drag { border-color: var(--main-color); border-style: dashed; }
.composer textarea {
  display: block; width: 100%; min-height: 120px; max-height: 340px; resize: none; border: 0; outline: 0; background: transparent;
  padding: 16px 16px 8px; font-size: 16px; line-height: 1.8; color: var(--main-font-color);
}
.composer.small textarea { min-height: 52px; }
.composer textarea::placeholder { color: var(--tx-m); }
.composer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px; flex-wrap: wrap; }
.attach-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; border: 0;
  background: var(--bg-white); color: var(--main-color); font-weight: 700; font-size: 13px; box-shadow: 0 1px 2px #0000000d;
}
.composer-box:focus-within .attach-btn { background: var(--p-ultra); }
.attach-btn svg { font-size: 18px; }
.attach-btn input { display: none; }
.composer-bar .spacer { flex: 1; }
.composer-hint { font-size: 12px; color: var(--tx-m); }
.send-btn { height: 44px; padding: 0 22px; }
.send-btn svg { transform: scaleX(-1); }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 12px 4px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; border: 2px solid var(--border); background: var(--bg-white); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #111827cc; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.progress { height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--main-color); transition: width .2s; }

/* أسئلة مشابهة */
.similar { border: 2px solid var(--border); border-radius: 18px; padding: 14px 16px; }
.similar h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--main-color); }
.similar h4 svg { font-size: 18px; }
.similar p.sub { margin: 0 0 10px; font-size: 12.5px; color: var(--sc-font-color); }
.sim-item { border-radius: 14px; background: var(--inp-bg); margin-bottom: 8px; }
.sim-item > button { width: 100%; text-align: start; background: none; border: 0; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.sim-item > button span { flex: 1; font-size: 14px; font-weight: 600; line-height: 1.6; }
.sim-item > button svg { color: var(--tx-m); transition: .2s; }
.sim-item.open > button svg { transform: rotate(180deg); }
.sim-body { padding: 0 12px 12px; }

/* الرسائل */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; align-items: flex-start; gap: 12px; }
.msg > img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; flex: none; }
.msg.assistant { flex-direction: row-reverse; }
.bubble {
  max-width: min(78%, 560px); background: var(--bubble-me); color: var(--main-font-color);
  border-radius: 6px 20px 20px 20px; padding: 10px 16px 6px; font-size: 15px; font-weight: 500; line-height: 1.85;
}
.msg.assistant .bubble { background: var(--main-color); color: #fff; border-radius: 20px 6px 20px 20px; }
.bubble .who { display: block; font-size: 13.5px; font-weight: 800; margin-bottom: 2px; color: var(--main-font-color); }
.msg.assistant .bubble .who { color: #fff; opacity: .92; }
.bubble .txt { white-space: pre-wrap; word-break: break-word; }
.bubble .txt a { color: inherit; font-weight: 700; }
.bubble .meta { display: flex; justify-content: flex-end; align-items: center; gap: 5px; font-size: 11px; opacity: .75; margin-top: 2px; }
.bubble .meta svg { font-size: 15px; color: var(--s); }
.msg.assistant .bubble .meta svg { color: #a7f3d0; }
.bubble-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0 4px; max-width: 360px; }
.bubble-imgs button { padding: 0; border: 2px solid #ffffff55; border-radius: 14px; overflow: hidden; background: #0000000d; aspect-ratio: 4/3; }
.bubble-imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-actions { display: flex; gap: 4px; margin-top: 2px; }
.day-sep { align-self: center; font-size: 12px; font-weight: 700; color: var(--sc-font-color); background: var(--inp-bg); padding: 3px 12px; border-radius: 99px; }

/* مشغل الصوت */
.aplayer { display: flex; align-items: center; gap: 10px; background: #ffffff26; border-radius: 99px; padding: 5px 6px 5px 12px; margin: 6px 0 4px; min-width: 230px; }
.q-card .aplayer, .sim-body .aplayer { background: var(--p-ultra); }
.aplayer .ap-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fff; color: var(--main-color); display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.q-card .aplayer .ap-btn, .sim-body .aplayer .ap-btn { background: var(--main-color); color: #fff; }
.ap-track { flex: 1; height: 26px; position: relative; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 2px; direction: ltr; max-width: 260px; }
.ap-track i { flex: 1; max-width: 4px; border-radius: 2px; background: currentColor; opacity: .35; min-width: 2px; }
.ap-track i.on { opacity: 1; }
.ap-time { font-size: 12px; font-weight: 700; min-width: 34px; text-align: center; direction: ltr; }
.ap-speed { border: 0; background: #ffffff33; color: inherit; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 3px 7px; direction: ltr; }
.q-card .ap-speed, .sim-body .ap-speed { background: var(--bg-white); color: var(--main-color); }
.q-card .aplayer, .sim-body .aplayer { color: var(--main-color); }

/* حالة السؤال */
.status-card { border-radius: 18px; padding: 16px 18px; background: var(--inp-bg); display: flex; flex-direction: column; gap: 14px; }
.status-card.ok { background: var(--s-ultra); }
.status-top { display: flex; align-items: center; gap: 12px; }
.status-top b { font-size: 16px; font-weight: 800; }
.status-top small { display: block; font-size: 13px; color: var(--sc-font-color); font-weight: 600; }
.status-card.ok .status-top b { color: var(--s-tx); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--tx-m); position: relative; }
.steps li::before { content: ""; position: absolute; top: 15px; right: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.now::before { background: var(--s); }
.steps .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-white); border: 3px solid var(--line); display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; font-size: 14px; color: #fff; }
.steps li.done { color: var(--s-tx); }
.steps li.done .dot { background: var(--s); border-color: var(--s); }
.steps li.now { color: var(--main-font-color); }
.steps li.now .dot { border-color: var(--gold); background: var(--gold-ultra); }
.steps li.now .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { transform: scale(.7); opacity: .6 } 50% { transform: scale(1.15); opacity: 1 } }
.notify-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--main-color); background: var(--bg-white); border-radius: 14px; padding: 10px 12px; }
.notify-row svg { font-size: 18px; }
.notify-row .btn { padding: 6px 12px; font-size: 13px; margin-inline-start: auto; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--main-color); animation: tp 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s } .typing i:nth-child(3) { animation-delay: .3s }
@keyframes tp { 0%,60%,100% { transform: translateY(0); opacity: .4 } 30% { transform: translateY(-5px); opacity: 1 } }

.answer-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.answer-actions .btn { flex: 1 1 180px; }
.done-card { text-align: center; padding: 26px 16px; border-radius: 18px; background: var(--s-ultra); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.done-card .big { width: 56px; height: 56px; border-radius: 50%; background: var(--s); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.done-card h3 { margin: 0; font-size: 19px; }
.rate { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rate button { display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 99px; border: 2px solid transparent; background: var(--bg-white); font-weight: 700; font-size: 14px; color: var(--main-font-color); }
.rate button svg { font-size: 19px; }
.rate button.on { border-color: var(--s-h); color: var(--s-tx); }
.blocked-note { display: flex; gap: 10px; align-items: center; background: var(--gold-ultra); color: var(--gold-tx); border-radius: 14px; padding: 10px 14px; font-size: 13.5px; font-weight: 700; }

/* السايد بار */
.side-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; margin: 0 0 16px; }
.side-title i, .side-title > svg { width: 40px; height: 40px; border-radius: 15px; background: var(--border); color: var(--main-color); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.pend {
  background: var(--bg-white); border: 2px solid var(--border); border-radius: 20px; padding: 14px; margin-bottom: 12px;
  display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--card-shadow); width: 100%; text-align: start;
}
.pend.active { border-color: var(--main-color); }
.pend > i { width: 44px; height: 44px; border-radius: 14px; background: var(--inp-bg); display: flex; align-items: center; justify-content: center; font-size: 21px; flex: none; color: var(--main-font-color); }
.pend.active > i { background: var(--main-color); color: #fff; }
.pend p { margin: 0 0 8px; font-size: 14.5px; font-weight: 600; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty-side { min-height: 70px; display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--sc-font-color); }
.tips { padding: 18px 20px; margin-top: 20px; }
.tips h3 { margin: 0 0 8px; font-size: 16px; }
.tips ol { margin: 0 0 10px; padding-inline-start: 20px; font-size: 14px; line-height: 2; color: var(--sc-font-color); }
.tips-link { font-size: 13px; font-weight: 700; text-decoration: none; }

/* شارات الحالة */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 12px; border-radius: 50px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge.waiting { background: var(--gold-ultra); color: var(--gold-tx); }
.badge.claimed { background: var(--p-ultra); color: var(--main-color); }
.badge.answered { background: var(--s-ultra); color: var(--s-tx); }
.badge.closed { background: var(--inp-bg); color: var(--sc-font-color); }

/* ---------- القوايم (أسئلتي / الكل) ---------- */
.all-tools { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-bottom: 8px; }
.search { width: min(100%, 640px); display: flex; align-items: center; gap: 10px; background: var(--bg-white); border-radius: 16px; padding: 0 16px; box-shadow: var(--card-shadow); color: var(--main-color); font-size: 19px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; height: 52px; font-size: 15px; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { border: 0; border-radius: 99px; padding: 7px 16px; background: var(--bg-white); color: var(--main-font-color); font-weight: 700; font-size: 13.5px; box-shadow: var(--card-shadow); }
.chip.active { background: var(--main-color); color: #fff; }
.all-meta { text-align: center; color: var(--sc-font-color); font-size: 13px; font-weight: 600; margin: 4px 0 16px; }
.list { max-width: 980px; margin: auto; }
.q-card { background: var(--bg-white); border-radius: 25px; padding: 20px; margin-bottom: 20px; box-shadow: var(--card-shadow); }
.q-head { display: flex; align-items: center; gap: 10px; }
.q-head img { width: 50px; height: 50px; border-radius: 16px; border: 2px solid var(--line); padding: 4px; background: var(--bg-white); object-fit: cover; }
.q-head > div { flex: 1; min-width: 0; }
.q-head p { margin: 0; font-size: 17px; font-weight: 800; }
.q-head span.time { color: var(--tx-m); font-size: 13px; font-weight: 600; }
.q-text { margin: 12px 0 0; font-size: 15.5px; font-weight: 500; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.q-imgs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.q-imgs button { padding: 0; border: 2px solid var(--line); border-radius: 15px; overflow: hidden; width: 150px; height: 112px; background: var(--inp-bg); }
.q-imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.q-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.q-foot .btn { padding: 8px 14px; font-size: 13.5px; }
.replies { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.reply { background: var(--inp-bg); border-radius: 20px; padding: 14px 16px; }
.reply.from-student { background: transparent; border: 2px dashed var(--line); }
.reply .q-head img { width: 40px; height: 40px; border-radius: 13px; }
.reply .q-head p { font-size: 15px; }
.reply .q-text { margin-top: 8px; font-size: 15px; }
.reply .tag { font-size: 11px; font-weight: 800; color: var(--s-tx); background: var(--s-ultra); border-radius: 99px; padding: 2px 10px; }
.empty { text-align: center; padding: 50px 16px; color: var(--sc-font-color); font-weight: 600; }
.empty svg { font-size: 54px; color: var(--tx-m); display: block; margin: 0 auto 10px; }
.more-btn { display: flex; margin: 0 auto; }
.sentinel { height: 40px; }
mark { background: #fde68a; color: inherit; border-radius: 4px; padding: 0 2px; }

.skeleton { height: 220px; border-radius: 18px; background: linear-gradient(90deg, var(--inp-bg) 25%, var(--bg-white) 50%, var(--inp-bg) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

.lightbox { position: fixed; inset: 0; background: #000000e6; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; touch-action: pinch-zoom; }
.lb-x { position: absolute; top: 14px; left: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #ffffff22; color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 420px; pointer-events: none; }
.toast { background: #111827; color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 700; box-shadow: 0 10px 30px #0004; animation: tin .25s; pointer-events: auto; }
.toast.err { background: #be123c; }
.toast.ok { background: var(--s-h); }
@keyframes tin { from { transform: translateY(10px); opacity: 0 } }

.foot { text-align: center; font-size: 13px; color: var(--sc-font-color); padding: 24px 16px 40px; }

/* ---------- موبايل وتابلت ---------- */
@media (max-width: 1100px) {
  .hdr-links span { display: none; }
}
@media (max-width: 992px) {
  .wrap { padding: 20px 16px 40px; }
  .ask-grid { grid-template-columns: 1fr; }
  .side { order: 2; }
  .hdr-links { display: none; }
  .ph-title h1 { font-size: 20px; }
  .ph-icon { width: 50px; height: 50px; font-size: 26px; }
  .page-header { padding: 18px 16px; }
}
@media (max-width: 640px) {
  .hdr-logo p { font-size: 13px; }
  .hdr-logo small { font-size: 8.5px; }
  .theme-btn { width: 56px; }
  .page-header { padding: 14px 12px; }
  .ph-title { gap: 12px; }
  .ph-desc { display: none; }
  .wrap { padding: 14px 10px 30px; }
  .tabs { gap: 6px; margin-bottom: 14px; flex-wrap: nowrap; }
  .tabs li { flex: 1 1 0; min-width: 0; }
  .tabs button { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 12.5px; border-radius: 14px; }
  .tabs button i { width: 30px; height: 30px; font-size: 17px; }
  .tabs button em { display: none; }
  .ask-card { padding: 14px; border-radius: 18px; min-height: 0; }
  .ask-head { gap: 10px; margin-bottom: 14px; }
  .ask-head img { width: 42px; height: 42px; }
  .ask-name p { font-size: 16px; }
  .ask-name span { font-size: 11.5px; padding: 2px 10px; }
  .ask-head small { display: none; }
  .composer textarea { font-size: 16px; min-height: 110px; }
  .attach-btn span { display: none; }
  .attach-btn { width: 44px; justify-content: center; padding: 0; }
  .composer-hint { display: none; }
  .send-btn { flex: 1; }
  .composer-bar .spacer { display: none; }
  .bubble { max-width: 86%; font-size: 15px; padding: 9px 13px 5px; }
  .msg { gap: 8px; }
  .msg > img { width: 34px; height: 34px; }
  .aplayer { min-width: 0; width: 100%; }
  .steps li { font-size: 11.5px; }
  .q-card { padding: 14px; border-radius: 20px; margin-bottom: 14px; }
  .q-head img { width: 42px; height: 42px; border-radius: 13px; }
  .q-head p { font-size: 15px; }
  .q-imgs button { width: calc(50% - 5px); height: 120px; }
  .side-title { font-size: 17px; }
  /* زرار الرد ثابت تحت على الموبايل */
  .sticky-reply { position: sticky; bottom: 0; background: var(--bg-white); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); margin: 0 -14px -14px; padding-inline: 14px; border-radius: 0 0 18px 18px; box-shadow: 0 -8px 20px #0000000f; z-index: 5; }
}
