/* =====================================================================
   branding — لوغو الهيدر + بطاقة «الشعار والأيقونة» في /admin/settings (النافذة Q)
   الهيدر: <img class="brand-logo"> داخل .brand (Branding::brandInner). width/height صريحان من الخادم؛
   هنا: إظهار المناسب للثيم، وحدود الهاتف.
   ===================================================================== */

/* ===== الهيدر ===== */
.brand .brand-logo {
    display: block;
    flex: none;
    width: auto;            /* الارتفاع من الخاصيّة height، والعرض يتبع نسبة الصورة */
    max-width: 300px;
    object-fit: contain;
    object-position: center;
}
.brand:has(.brand-logo)::before { display: none; }   /* لا علامة المربّعين بجانب لوغو حقيقي */
.brand:has(.brand-logo) { background: none; overflow: hidden; min-width: 0; }
/* الهاتف الضيّق (جرس + رصيد + عملة): اللوغو يصغر داخل علبته (object-fit: contain) بدل أن يفيض فوق الأزرار.
   notify.js يقيس «هل اللوغو مضغوط؟» لينقل الجرس إلى قائمة الهاتف كما يفعل مع الاسم النصّي (مراجعة M، 2026-11-28) */
.brand .brand-logo { flex: 0 1 auto; min-width: 0; }

/* لوغوان: النهاري في light، والليلي في dark وnight (theme.js: light → dark → night) */
.brand .brand-logo-dark { display: none; }
html[data-theme="dark"] .brand .brand-logo-light,
html[data-theme="night"] .brand .brand-logo-light { display: none; }
html[data-theme="dark"] .brand .brand-logo-dark,
html[data-theme="night"] .brand .brand-logo-dark { display: block; }

/* هيدر مطويّ ثم الهاتف: الارتفاع ≤ 32 والعرض بنسبة من الشاشة — الأزرار تبقى في مكانها */
@media (max-width: 1199px) {
    .brand .brand-logo { max-width: 240px; }
}
@media (max-width: 720px) {
    .brand .brand-logo { max-height: 32px; max-width: 44vw; }
}
@media (max-width: 380px) {
    .brand .brand-logo { max-width: 38vw; }
}

/* ===== البطاقة في الإعدادات ===== */
.brand-card { margin-bottom: 18px; }
.brand-slots {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 14px;
}
.brand-slot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.brand-slot-t { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand-slot .btn { align-self: flex-start; }
.brand-prev {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 88px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.brand-prev img { width: auto; max-width: 100%; object-fit: contain; }
/* المعاينة على خلفيّتين ثابتتين: ما يراه الزائر في الوضع النهاري ثم الداكن */
.brand-prev-light { background: #ffffff; color: #111827; }
.brand-prev-dark  { background: #0f1420; color: #e5e7eb; }
.brand-prev-icon  { background: var(--surface-2); }
.brand-prev-name  { font-weight: 800; font-size: 1.2rem; }
.brand-prev-mask  { border-radius: 50%; }   /* كما يقصّها أندرويد */
.brand-dims { font-variant-numeric: tabular-nums; min-height: 0; }
.brand-dims:empty { display: none; }
.brand-h input { max-width: 140px; }

@media (max-width: 720px) {
    .brand-slots { grid-template-columns: 1fr; }
}
