/* ===== الثيمات: فاتح / داكن / ليلي ===== */
:root,
:root[data-theme="light"] {
    --bg:        #f6f8fb;
    --bg-elev:   #ffffff;
    --surface:   #ffffff;
    --border:    #e4e8ef;
    --text:      #1a2230;
    --text-dim:  #5b6676;
    --primary:   #4f46e5;
    --primary-2: #7c3aed;
    --primary-ct:#ffffff;
    --accent:    #0ea5e9;
    --shadow:    0 6px 24px rgba(20,30,60,.08);
    --radius:    14px;
}
:root[data-theme="dark"] {
    --bg:        #0f1420;
    --bg-elev:   #161d2c;
    --surface:   #161d2c;
    --border:    #263045;
    --text:      #e8edf5;
    --text-dim:  #9aa6ba;
    --primary:   #6366f1;
    --primary-2: #8b5cf6;
    --primary-ct:#ffffff;
    --accent:    #38bdf8;
    --shadow:    0 8px 30px rgba(0,0,0,.35);
    --radius:    14px;
}
/* الليلي: أغمق وأدفأ، لراحة العين */
:root[data-theme="night"] {
    --bg:        #05070d;
    --bg-elev:   #0b0f18;
    --surface:   #0b0f18;
    --border:    #1a2130;
    --text:      #c8d0de;
    --text-dim:  #76808f;
    --primary:   #5b63d6;
    --primary-2: #7c4ddb;
    --primary-ct:#f2f4fa;
    --accent:    #2b8fc7;
    --shadow:    0 8px 30px rgba(0,0,0,.55);
    --radius:    14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Cairo', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background .25s ease, color .25s ease;
}
[dir="ltr"] body { font-family: 'Inter', 'Cairo', system-ui, sans-serif; }

a { color: inherit; text-decoration: none; }
.container { width: min(1140px, 92%); margin-inline: auto; }

/* ===== الهيدر ===== */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand {
    font-weight: 800; font-size: 1.3rem;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.main-nav { display: flex; gap: 18px; margin-inline-start: 8px; }
.main-nav a { color: var(--text-dim); font-weight: 600; transition: color .2s; }
.main-nav a:hover { color: var(--text); }
.main-nav a { position: relative; display: inline-flex; align-items: center; gap: 6px; }
/* شارة غير المقروء (تذاكر الدعم) */
.tk-badge {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: #ef4444; color: #fff; font-size: .68rem; font-weight: 800;
    display: inline-grid; place-items: center; line-height: 1;
}
.header-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

.lang-switch { display: flex; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.lang-switch a { font-size: .72rem; font-weight: 700; color: var(--text-dim); padding: 3px 7px; border-radius: 7px; }
.lang-switch a.active { background: var(--primary); color: var(--primary-ct); }

.theme-btn {
    width: 38px; height: 38px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--bg);
    color: var(--text); cursor: pointer; font-size: 1.1rem;
    display: grid; place-items: center; transition: .2s;
}
.theme-btn:hover { border-color: var(--primary); color: var(--primary); }

/* رصيد المسجّل في الهيدر (طلب المالك 2026-11-22) — ينقل للمحفظة. الأرقام LTR معزولة داخل صفحة RTL */
:root {
    --ico-wallet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1'/%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4'/%3E%3C/svg%3E");
    --ico-plus:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}
.hdr-bal {
    display: inline-flex; align-items: center; gap: 7px; flex: none;
    height: 38px; padding-inline: 11px 5px; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ok, #16a34a) 40%, var(--border));
    background: color-mix(in srgb, var(--ok, #16a34a) 11%, var(--surface, var(--bg)));
    color: var(--text); font-weight: 800; font-size: .92rem; white-space: nowrap;
    transition: border-color .15s, background .15s, transform .15s;
}
.hdr-bal:hover { border-color: var(--ok, #16a34a); transform: translateY(-1px); }
.hdr-bal-ico {
    width: 17px; height: 17px; flex: none; background: var(--ok, #16a34a);
    -webkit-mask: var(--ico-wallet) center / contain no-repeat; mask: var(--ico-wallet) center / contain no-repeat;
}
.hdr-bal-amt { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.hdr-bal-add {
    width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--ok, #16a34a); position: relative;
}
.hdr-bal-add::before {
    content: ''; position: absolute; inset: 7px; background: #fff;
    -webkit-mask: var(--ico-plus) center / contain no-repeat; mask: var(--ico-plus) center / contain no-repeat;
}

/* قائمة الحساب (≥1200px) */
.hdr-user { position: relative; flex: none; }
.hdr-user > summary { list-style: none; }
.hdr-user > summary::-webkit-details-marker { display: none; }
.hdr-user-btn {
    display: flex; align-items: center; gap: 8px; height: 38px; padding-inline: 4px 10px;
    border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2, var(--bg));
    cursor: pointer; color: var(--text); font-weight: 700; font-size: .9rem; transition: border-color .15s;
}
.hdr-user-btn:hover, .hdr-user[open] .hdr-user-btn { border-color: var(--primary); }
.hdr-ava {
    width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: var(--primary); color: var(--primary-ct); font-weight: 800; font-size: .86rem; line-height: 1;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent);
}
.hdr-ava-lg { width: 40px; height: 40px; font-size: 1.05rem; }
.hdr-user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-caret {
    width: 8px; height: 8px; border: solid var(--text-dim); border-width: 0 2px 2px 0;
    transform: translateY(-2px) rotate(45deg); transition: transform .15s;
}
.hdr-user[open] .hdr-caret { transform: translateY(2px) rotate(-135deg); }
.hdr-user-menu {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 240px; z-index: 60;
    display: flex; flex-direction: column; padding: 8px; border-radius: var(--radius-lg, 16px);
    background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg, var(--shadow));
}
.hdr-user-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); min-width: 0; }
.hdr-user-who { display: flex; flex-direction: column; min-width: 0; }
.hdr-user-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-user-who small { color: var(--text-dim); font-size: .8rem; }
.hdr-user-menu > a, .hdr-user-out button {
    display: block; width: 100%; padding: 9px 10px; border-radius: 10px; border: 0; background: none;
    color: var(--text); font: inherit; font-weight: 600; font-size: .92rem; text-align: start; cursor: pointer;
}
.hdr-user-menu > a:hover, .hdr-user-out button:hover { background: var(--surface-2, var(--bg)); color: var(--primary); }
.hdr-user-out { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--border); }
.hdr-user-out button { color: var(--danger, #ef4444); }
.hdr-user-out button:hover { color: var(--danger, #ef4444); }
/* تحت 1440px: الدائرة وحدها (الاسم يأخذ مكان رابط؛ بالإنجليزية كان يكسر «My Orders» على 1366) */
@media (max-width: 1439px) { .hdr-user-name { display: none; } }
.main-nav > a { white-space: nowrap; }

/* زرّ قائمة الهاتف — يظهر تحت 720px فقط. أيقونة SVG بقناع (بلا رموز نصّية) */
:root {
    --ico-menu:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E");
    --ico-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
}
.nav-toggle {
    display: none; flex: none; width: 38px; height: 38px; padding: 0;
    border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2, var(--bg));
    color: var(--text); cursor: pointer; place-items: center; transition: .2s;
}
.nav-toggle:hover { border-color: var(--primary); color: var(--primary); }
.nav-toggle-ico {
    display: block; width: 18px; height: 18px; background: currentColor;
    -webkit-mask: var(--ico-menu) center / contain no-repeat;
            mask: var(--ico-menu) center / contain no-repeat;
}
.site-header.nav-open .nav-toggle-ico { -webkit-mask-image: var(--ico-close); mask-image: var(--ico-close); }
/* عناصر القائمة الخاصّة بالهاتف (لوحتي/دخول/خروج/اللغة) — مخفية على الشاشات الكبيرة */
.main-nav .nav-m { display: none; }
/* زرّ الدخول: نصّ كامل على الشاشة الكبيرة، وقصير («دخول») على الهاتف */
.hdr-login .lbl-s { display: none; }
.hdr-login-ico {
    display: none; width: 18px; height: 18px; background: currentColor; flex: none;
    -webkit-mask: var(--ico-login) center / contain no-repeat;
            mask: var(--ico-login) center / contain no-repeat;
}

/* ===== الأزرار ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 18px; border-radius: 10px; font-weight: 700; font-size: .92rem;
    border: 1px solid transparent; cursor: pointer; transition: .2s; white-space: nowrap;
}
.btn-primary { background: linear-gradient(90deg, var(--primary), var(--primary-2)); color: var(--primary-ct); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 13px 28px; font-size: 1.02rem; }

/* ===== الهيرو ===== */
.hero { padding: 72px 0 48px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
    content: ''; position: absolute; inset: -40% 10% auto; height: 420px;
    background: radial-gradient(60% 60% at 50% 0, color-mix(in srgb, var(--primary) 28%, transparent), transparent 70%);
    pointer-events: none; z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); font-weight: 800; margin: 0 0 14px; letter-spacing: -.5px; }
.hero p { color: var(--text-dim); font-size: 1.12rem; max-width: 620px; margin: 0 auto 28px; }

/* ===== الميزات ===== */
.features { padding: 40px 0 80px; }
.features h2 { text-align: center; font-size: 1.6rem; margin-bottom: 28px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px; box-shadow: var(--shadow); transition: transform .2s, border-color .2s;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.feature-card .ico {
    width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-size: 1.4rem; margin-bottom: 14px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.12rem; }
.feature-card p { margin: 0; color: var(--text-dim); font-size: .95rem; }

/* ===== نماذج المصادقة ===== */
.auth-wrap {
    display: grid; place-items: center; min-height: calc(100vh - 66px); padding: 40px 16px;
    position: relative; overflow: hidden;
}
/* توهّج خلفي ناعم خلف البطاقة */
.auth-wrap::before {
    content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%;
    top: -160px; inset-inline-end: -140px; pointer-events: none;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary) 22%, transparent), transparent 68%);
}
.auth-card {
    position: relative; width: 100%; max-width: 430px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 18px;
    padding: 34px 30px; box-shadow: var(--shadow);
}
.auth-head { text-align: center; margin-bottom: 22px; }
/* (أيقونة الرأس .auth-logo أُزيلت بطلب المالك — الوسم حُذف من القوالب) */
.auth-card h1 { margin: 0 0 4px; font-size: 1.55rem; text-align: center; letter-spacing: -.4px; }
.auth-sub { color: var(--text-dim); font-size: .9rem; text-align: center; margin: 0; }
.auth-hint { color: var(--text-dim); font-size: .9rem; text-align: center; margin: -8px 0 16px; }

.auth-form .field { display: block; margin-bottom: 15px; }
.auth-form .field-label { display: block; margin-bottom: 6px; font-size: .84rem; font-weight: 700; color: var(--text-dim); }
.auth-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* عمود واحد على الهاتف: gap صفر لأن كل .field له هامش سفلي (وإلا تضاعفت المسافة) */
@media (max-width: 440px) { .auth-form .field-row { grid-template-columns: 1fr; gap: 0; } }
.auth-card input {
    width: 100%; padding: 12px 14px; border-radius: 11px;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    font-family: inherit; font-size: .98rem; transition: border-color .2s, box-shadow .2s;
}
.auth-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }

/* الكابتشا المدمجة */
.cap { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: center; margin-bottom: 15px; }
.cap-img { border-radius: 10px; border: 1px solid var(--border); background: #f5f7fb; display: block; height: 48px; width: auto; }
.cap-reload {
    width: 40px; height: 48px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text-dim); cursor: pointer; font-size: 1.1rem; line-height: 1;
    transition: .15s;
}
.cap-reload:hover { color: var(--primary); border-color: var(--primary); }
.cap-input { text-transform: uppercase; letter-spacing: .18em; font-weight: 700; text-align: center; min-width: 0; }
/* الـplaceholder لا يُكبَّر ولا يُباعَد (وإلا انقصّ) */
.cap-input::placeholder { text-transform: none; letter-spacing: normal; font-weight: 500; }
.g-recaptcha { margin-bottom: 15px; display: flex; justify-content: center; }

/* المصادقة على الهاتف: هوامش أصغر حتى يبقى للحقول عرض */
@media (max-width: 480px) {
    .auth-wrap { padding: 22px 12px 32px; }
    .auth-card { padding: 26px 18px; border-radius: 16px; }
    .auth-wrap::before { width: 340px; height: 340px; top: -120px; inset-inline-end: -120px; }
}
/* الكابتشا على الشاشات الضيّقة: الصورة + التحديث في سطر، والحقل بعرض كامل تحته
   (في سطر واحد كان الحقل ينحشر لعرض لا يتّسع للكود، خاصةً مع تكبير خطّ الهاتف) */
@media (max-width: 420px) {
    .cap { grid-template-columns: minmax(0, 1fr) auto; }
    .cap-img { width: 100%; height: 48px; object-fit: contain; }   /* خلفيته = خلفية الصورة، فالحشو لا يُرى */
    .cap-input { grid-column: 1 / -1; }
}
/* ودجة reCAPTCHA عرضها ثابت 304px — نصغّرها على أضيق الهواتف */
@media (max-width: 350px) {
    .g-recaptcha { transform: scale(.85); transform-origin: 50% 0; }
}

.btn-block { width: 100%; margin-top: 6px; }
.auth-alt { text-align: center; margin: 18px 0 0; font-size: .9rem; color: var(--text-dim); }
.auth-alt a { color: var(--primary); font-weight: 700; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px; }
.alert-error { background: color-mix(in srgb, #ef4444 15%, var(--surface)); border: 1px solid #ef4444; color: #ef4444; }
.alert-success { background: color-mix(in srgb, #22c55e 15%, var(--surface)); border: 1px solid #22c55e; color: #16a34a; }
/* ملاحظة «مقفول» محايدة (بيانات ربط بوابة مخفية…) — قفل SVG بقناع، بلا إيموجي */
.lock-note {
    display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, var(--bg));
    color: var(--text-dim); font-size: .9rem; line-height: 1.6;
}
.lock-note::before {
    content: ''; flex: none; width: 18px; height: 18px; margin-top: 2px; background: currentColor;
    -webkit-mask: var(--ico-lock) center / contain no-repeat; mask: var(--ico-lock) center / contain no-repeat;
}
:root { --ico-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E"); }
:root { --ico-login: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3Cpolyline points='10 17 15 12 10 7'/%3E%3Cline x1='15' y1='12' x2='3' y2='12'/%3E%3C/svg%3E"); }

/* ===== الفوتر ===== */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--text-dim); font-size: .9rem; text-align: center; }

/* ===== صفحات الأخطاء ===== */
.error-page { text-align: center; padding: 100px 0; }
.error-page .code { font-size: 4rem; font-weight: 800; color: var(--primary); }
.error-page h1 { margin: 6px 0 10px; }
.error-page p { color: var(--text-dim); margin-bottom: 24px; }

/* ===== الهيدر على كل العروض =====
   الاسم وحده يتقلّص (بنقاط) إن ضاق المكان — اسم طويل يختاره المشتري لا يدفع الهيدر للفيض. */
.brand { min-width: 18px; }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== هيدر مطويّ (أقلّ من 1200px) =====
   الهيدر الكامل يحتاج ~713px للزائر و~1100px للمسجّل (7 روابط) بالعربية؛ تحت 1200px كان يفيض
   على التابلت واللابتوب الصغير. القائمة تنتقل خلف زرّ ☰ (نفس عتبة xl المعتادة). */
@media (max-width: 1199px) {
    .header-actions .hdr-logout,
    .header-actions .hdr-user,
    .header-actions > .lang-switch { display: none; }
    .nav-toggle { display: grid; }

    /* القائمة: لوحة منسدلة تحت الزرّ (الهيدر sticky فهو مرجع الموضع) */
    .main-nav {
        display: none; position: absolute; top: calc(100% + 6px);
        inset-inline-start: auto; inset-inline-end: 4%; width: 320px;
        flex-direction: column; gap: 0; margin: 0; padding: 4px 16px 16px;
        background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px;
        box-shadow: var(--shadow-lg, var(--shadow));
        max-height: calc(100vh - 80px); overflow-y: auto; overscroll-behavior: contain;
    }
    .site-header.nav-open .main-nav { display: flex; }
    .site-header .main-nav > a,
    .site-header .main-nav .nav-m > a {
        display: flex; padding: 13px 2px; border-bottom: 1px solid var(--border);
        color: var(--text); font-weight: 600;
    }
    .site-header .main-nav > a:hover,
    .site-header .main-nav .nav-m > a:hover { color: var(--primary); border-bottom-color: var(--border); }
    .main-nav .nav-m { display: flex; flex-direction: column; }
    .site-header .main-nav .nav-m > a.nav-m-cta { color: var(--primary); }
    .nav-m-logout { margin: 0; }
    .nav-m-logout button {
        width: 100%; padding: 13px 2px; border: 0; border-bottom: 1px solid var(--border);
        background: none; color: var(--danger, #ef4444); font: inherit; font-weight: 600;
        text-align: start; cursor: pointer;
    }
    .nav-m-row {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 12px 2px 0; color: var(--text-dim); font-size: .9rem; font-weight: 600;
    }
    .site-header .nav-m-lang .lang-switch a { padding: 5px 12px; border-bottom: 0; font-size: .8rem; }
    .main-nav .nav-m-theme { display: none; }   /* زرّ الهيدر ظاهر فوق 720px */
}

/* ===== الهاتف (720px فأقلّ) =====
   كان الهيدر يفيض (329px في حاوية 317px على 360px) فيظهر فراغ عند السحب يميناً/يساراً. */
@media (max-width: 720px) {
    .header-inner { gap: 10px; }
    .header-actions { gap: 6px; flex: 0 1 auto; min-width: 0; }
    /* أولوية الانكماش: الاسم أوّلاً (وزن 1000) حتى شعاره فقط، والأزرار آخر حلّ (بنقاط).
       بهذا لا يفيض الهيدر مهما ضاق العرض أو كبّر المستخدم خطّ هاتفه. */
    .brand { flex: 0 1000 auto; font-size: 1.15rem; }
    .header-actions .btn { padding: 7px 11px; font-size: .84rem; min-width: 0; overflow: hidden; }
    .header-actions .btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .nav-toggle { flex: none; width: 36px; height: 36px; }
    /* المظهر ينتقل للقائمة: يبقى للاسم وزرّي الدخول/التسجيل مكانهم على 360px */
    .header-actions .theme-btn { display: none; }
    .main-nav .nav-m-theme { display: flex; }
    /* الدخول ظاهر في الهيدر (طلب المالك) بنصّ قصير «دخول» حتى يتّسع بجانب «إنشاء حساب» */
    .hdr-login .lbl-l, .hdr-login .lbl-s { display: none; }
    .hdr-login .hdr-login-ico { display: block; }
    .hdr-login { width: 40px; height: 40px; padding: 0; flex: none; }

    /* المسجّل (طلب المالك 2026-11-22): الرصيد + زرّ المظهر ظاهران دائماً، و«لوحتي» داخل ☰ */
    .is-auth .header-actions .theme-btn { display: grid; width: 36px; height: 36px; flex: none; }
    .is-auth .header-actions .hdr-dash { display: none; }
    .is-auth .main-nav .nav-m-theme { display: none; }
    .hdr-bal { height: 36px; padding-inline: 10px 4px; gap: 6px; font-size: .86rem; min-width: 0; }
    .hdr-bal-add { width: 26px; height: 26px; }

    /* القائمة على الهاتف: بعرض الشاشة كاملاً ملتصقة بالهيدر */
    .main-nav {
        top: 100%; inset-inline: 0; width: auto;
        padding: 4px 4% 16px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
        box-shadow: var(--shadow); max-height: calc(100vh - 66px);
    }
}
@media (max-width: 380px) {
    .hdr-bal-ico { display: none; }
    .hdr-bal { padding-inline-start: 9px; }
}
