/* تاج الوقار – تكملة صغيرة لـ app.css (المنقول كما هو من النسخة التجريبية)
 * لازمة فقط لأن بعض الأزرار صارت روابط ونماذج حقيقية في Blade. */

/* الروابط التي تأخذ شكل زر أو عنصر قائمة تبدو مطابقة للأزرار الأصلية */
a.btn, a.item { text-decoration: none; color: inherit; }
a.item { cursor: pointer; text-align: start; }

/* النماذج داخل الشريط العلوي والصفوف لا تكسر التخطيط */
.topbar form, .row form.inline, .models form { display: contents; }
a.iconbtn { text-decoration: none; }

/* تبويبات لوحة الإدارة صارت روابط: نفس شكل .tabs button في app.css */
.tabs a { flex: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 14px; font-weight: 700; cursor: pointer; white-space: nowrap; color: inherit; text-decoration: none; }
.tabs a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.lvbar a { padding: 6px 12px; font-size: 14px; border-radius: 99px; }
.lvbar a.on { background: var(--accent); border-color: var(--accent); }

/* ---------- تجربة تطبيق الموبايل (PWA) ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, label, .item, .eb, .mcard, .seg button, .steps button, .quran .v { touch-action: manipulation; }   /* بدون تكبير بالضغط المزدوج */
@view-transition { navigation: auto; }                                                                        /* انتقال ناعم بين الشاشات */
.install img { display: block; }

/* بعد التثبيت: لا سحب للتحديث، لا تحديد للنصوص، ولا قائمة الضغط الطويل — كأنه تطبيق أصلي */
@media (display-mode: standalone), (display-mode: fullscreen) {
  html, body { overscroll-behavior: none; }
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
  img, a { -webkit-user-drag: none; }
}

/* أيقونة الثيم: تظهر الشمس في الوضع الداكن والقمر في الفاتح */
[data-theme-icon] { display: contents; }
[data-theme="dark"] [data-theme-icon="light"],
:root:not([data-theme="dark"]) [data-theme-icon="dark"] { display: none; }

/* ---------- واجهة المختبر: الرئيسية والبطاقات ---------- */
.greet { margin: 4px 0 14px; }
.greet h1 { margin: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 0 10px; font-size: 17px; }
.ic-circle { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--em-100); color: var(--primary); }
.ic-circle.small { width: 36px; height: 36px; border-radius: 11px; }
.ic-circle.gold { background: var(--gold-100); color: var(--gold-600); }
.ic-circle.muted-bg { background: var(--surface-2); color: var(--muted); }
[data-theme="dark"] .ic-circle { color: #8FD3B8; }
[data-theme="dark"] .ic-circle.gold { color: var(--accent); }
.resume-card { border: 1.5px solid var(--accent); }
.level-card b { display: block; }
.level-card { display: flex; align-items: center; gap: 12px; padding: 16px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); min-height: 76px; }
.level-card:active { transform: scale(.99); }
.level-card .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.level-card b { font-size: 17px; font-weight: 800; }
.level-card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.level-card.closed { box-shadow: none; opacity: .8; }
.level-card.closed .ic-circle { background: var(--surface-2); color: var(--muted); }
.empty-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 16px; }
.closed-levels { margin-top: 14px; }
.closed-levels > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px dashed var(--line); cursor: pointer; font-weight: 700; }
.closed-levels > summary::-webkit-details-marker { display: none; }
.closed-levels[open] > summary .ic { transform: rotate(180deg); }
.item .btn .ic, .btn .ic { flex: none; }

/* البحث في كشف المتسابقين */
.search-field { position: relative; display: block; }
.search-field .ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field .input { padding-inline-start: 44px; }

/* شاشة الاختبار: الرسائل فوق لوحة الأزرار لا عليها */
body.padded .toast { bottom: calc(210px + env(safe-area-inset-bottom)); }
.navrow .btn .ic { width: 22px; height: 22px; }

/* أهداف لمس مريحة في شاشة الاختبار */
.steps button { height: 42px; min-width: 46px; }
.openinc button { min-height: 38px; padding: 6px 12px; }
.fontctl button { width: 44px; height: 42px; }

/* الشريط العلوي على الشاشات الضيقة: السطر الفرعي يُقص بنقاط بدل أن يمتد تحت شارة الاتصال */
.brand > div { min-width: 0; flex: 1; }
@media (max-width: 400px) {
  .topbar { gap: 6px; padding-inline: 10px; }
  .brand .crown { width: 32px; height: 32px; }
  .syncpill { font-size: 10px; padding: 3px 7px; }
  .brand b, .brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* المسؤول في واجهة المختبر: زر لوحة التحكم + الرئيسية = شريط مزدحم */
  .topbar:has(> a.iconbtn + a.iconbtn) .iconbtn { width: 36px; height: 36px; border-radius: 11px; }
  .topbar:has(> a.iconbtn + a.iconbtn) { gap: 5px; }
}
