/*
 * حضور علامة الإغريقية داخل لوحة التحكم.
 *
 * 🔴 ملفّ CSS عاديّ في public/ لا طقم Tailwind مبنيّ: اللوحة تستهلك theme.css
 * الجاهز من فيليمنت، ولا خطوة بناء أصولٍ في deploy.sh. إدخال طقمٍ مخصَّص من أجل
 * أربع قواعد يعني ربط كل نشرةٍ قادمة بخطوة npm لم تكن موجودة. هذه القواعد تُلحَق
 * بعد طقم فيليمنت فتغلبه بالترتيب، ولا تلمس شيئاً من متغيّراته.
 *
 * ما فيها كلّه شكل: لا قاعدة هنا تُظهر أو تُخفي زرّاً أو حقلاً.
 */

/*
 * ١) الشعار في الشريط العلوي على الهاتف.
 *
 * 🔴 فيليمنت يُخفي حاوية الشعار العلوية تحت 64rem (‎.fi-topbar-start{display:none})
 * ويعرض بدلاً منها شعار الشريط الجانبي — والشريط الجانبي على الهاتف دُرج مطويّ لا
 * يُفتح إلا بضغطة. النتيجة: المكتب الذي يعمل من هاتفه لا يرى العلامة إطلاقاً، وهو
 * تحديداً من يقضي وقته في هذه اللوحة. وحاوية الشعار هنا لا تحوي سواه: أزرار طيّ
 * الشريط لا تُرسَم أصلاً ما لم يُفعَّل sidebarCollapsibleOnDesktop، وهو مُطفأ.
 *
 * والشريط العلوي لاصق (sticky)، فيبقى الشعار في الأعلى طوال تعبئة نموذج طويل.
 */
@media (max-width: 63.99rem) {
    .fi-topbar-start {
        display: flex;
    }
}

/*
 * هاتف ضيّق جداً (‎≤360px): القفلة الكاملة تزاحم الجرس والحساب، فتُصغَّر قليلاً.
 * الارتفاع يأتي من brandLogoHeight أسلوباً سطريّاً (style="height: …")، ولا يُردّ
 * إلا بـ ‎!important — وهذا موضعه الوحيد في هذا الملف.
 */
@media (max-width: 22.5rem) {
    .fi-topbar-start .fi-logo {
        height: 1.9rem !important;
    }
}

/*
 * ٢) صفحة الدخول: أوّل ما يراه المكتب كل صباح، وأوسع مساحة فارغة في اللوحة.
 * القفلة أكبر منها في الشريط، ولها متنفَّس قبل عنوان الصفحة.
 */
.fi-simple-header .fi-logo {
    height: 3.25rem !important;
    margin-bottom: 1.5rem;
}

/*
 * غسلة تركوازية خفيفة خلف بطاقة الدخول. التدرّج ينتهي شفافاً قبل أن يصل إلى
 * البطاقة، فلا يمرّ لونٌ تحت نصٍّ أو حقل.
 */
.fi-simple-layout {
    background-image: radial-gradient(60rem 36rem at 50% -14%, rgba(116, 175, 182, 0.2), rgba(116, 175, 182, 0) 70%);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.dark .fi-simple-layout {
    background-image: radial-gradient(60rem 36rem at 50% -14%, rgba(116, 175, 182, 0.1), rgba(116, 175, 182, 0) 70%);
}

/*
 * ورمزُ العلامة علامةً مائية باهتة في زاوية الصفحة.
 *
 * 🔴 الترتيب هنا ليس زينة، وقد كلّفني محاولةً فاشلة: العنصر مثبَّت (fixed) والبطاقة
 * ساكنة (static)، فلو تُرك على حاله لرُسم فوق الحقول. وجرّبتُ ‎z-index: -1‎ أوّلاً
 * فاختفى تماماً — خلفية ‎<body>‎ الرمادية تُرسم بعد الطبقات السالبة فتبتلعها.
 *
 * فالحلّ طبقتان صريحتان: العلامة عند الصفر، وحاوية البطاقة والترويسة عند الواحد.
 * وكلتاهما موضَّعة (relative) لأن الترتيب بالأرقام لا يعمل على عنصرٍ ساكن.
 *
 * ومن 48rem فقط: على الهاتف تملأ البطاقة الشاشة، فلا يبقى من الرمز إلا شظيّة
 * تحتها تبدو خطأً في الرسم لا علامة مائية.
 */
@media (min-width: 48rem) {
    .fi-simple-layout {
        position: relative;
    }

    .fi-simple-layout::before {
        content: '';
        position: fixed;
        z-index: 0;
        inset-block-end: -5rem;
        inset-inline-start: -4rem;
        width: 26rem;
        height: 26rem;
        background: url('/brand/logo-mark-soft.svg') no-repeat center / contain;
        opacity: 0.09;
        pointer-events: none;
    }

    .fi-simple-layout > .fi-simple-main-ctn,
    .fi-simple-layout > .fi-simple-layout-header {
        position: relative;
        z-index: 1;
    }
}

/*
 * ٣) منع المتصفّح من تسويد لوحةٍ فاتحة من عنده.
 *
 * 🔴 هذه هي مشكلة الموقع العام نفسها، وقد كلّفتنا نشرةً فاشلة هناك: سامسونغ
 * إنترنت لا يقرأ ‎color-scheme‎ ليقرّر، بل يفتّش ورقة الأنماط عن استعلام
 * ‎@media (prefers-color-scheme: dark)‎ — يجده فيفهم أن الموقع يتكفّل بطقمه
 * الداكن فيتنحّى، ولا يجده فيُمرّر خوارزميّته على كل لون.
 *
 * وطقم فيليمنت لا يحوي منه ولا واحداً (عدّاً: صفر): وضعه الداكن مبنيٌّ على الصنف
 * ‎.dark‎ الذي يضعه سكربتٌ في الرأس، لا على تفضيل النظام. فالنتيجة على هاتف
 * سامسونغ: لوحة مسوَّدة قسراً مهما كان الوضع المختار.
 *
 * ولذلك يجب أن يبقى الاستعلام أدناه ممتلئاً بتصريحات حقيقية: استعلامٌ فارغ قد
 * يحذفه أيّ مُحسِّنٍ للأنماط، فتعود العلّة ولم يمسّ أحدٌ سطراً.
 *
 * والشرط ‎:not(.dark)‎ هو ما يُبقي الوضع الداكن عاملاً لمن اختاره بنفسه: عندها
 * يحمل ‎<html>‎ الصنف ‎.dark‎ فلا تنطبق هذه القواعد أصلاً.
 */
:root:not(.dark) {
    color-scheme: only light;
}

@media (prefers-color-scheme: dark) {
    :root:not(.dark) {
        color-scheme: only light;
        background-color: var(--gray-50, #fafafa);
    }

    :root:not(.dark) .fi-body {
        background-color: var(--gray-50, #fafafa);
        color: var(--gray-950, #0a0a0a);
    }
}

/*
 * ٤) صفحة الدخول على الهاتف: البطاقة هي الصفحة.
 *
 * 🔴 فيليمنت يرسم بطاقة الدخول بهامشٍ علويّ وسفليّ (margin-block: 4rem) — وهو
 * صحيح على شاشة واسعة تطفو فيها البطاقة وسط فراغ. أمّا على الهاتف فالبطاقة تملأ
 * العرض كلّه، فيتحوّل الهامشان إلى شريطين رماديّين أعلى الشاشة وأسفلها بلا معنى:
 * لا يحملان شيئاً، ولا يبدوان تصميماً، بل حافّتين ناقصتين.
 *
 * فتُمدَّد البطاقة إلى ملء الشاشة ويُوسَّط محتواها فيها. والنتيجة صفحةٌ واحدة
 * بيضاء من الحافة إلى الحافة، وهو النمط المألوف في شاشات الدخول على الهواتف.
 *
 * تحت 40rem وحدها — وهي نقطة فيليمنت نفسها لتدوير حواف البطاقة: فوقها تعود
 * البطاقة بطاقةً طافية، وهناك الهامش في محلّه.
 */
@media (max-width: 40rem) {
    .fi-simple-main {
        /* الشريطان. */
        margin-block: 0;
        /* الأب يوسّط أبناءه عمودياً، وهذا يجعل البطاقة تملأ ارتفاعه بدلاً من ذلك. */
        align-self: stretch;
        /* ثمّ يُوسَّط المحتوى داخل البطاقة، فلا يلتصق بالأعلى بعد تمديدها. */
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* لا ظلّ ولا إطار لشيءٍ صار هو الصفحة. */
        box-shadow: none;
        /*
         * وهالة تركوازية خفيفة خلف الشعار تعويضاً عن الغسلة التي كانت على خلفية
         * الصفحة — فالبطاقة البيضاء صارت تغطّيها. تنتهي شفافةً قبل أوّل حقل.
         */
        background-image: radial-gradient(46rem 28rem at 50% -2%, rgba(116, 175, 182, 0.18), rgba(116, 175, 182, 0) 70%);
    }

    .dark .fi-simple-main {
        background-image: radial-gradient(46rem 28rem at 50% -2%, rgba(116, 175, 182, 0.12), rgba(116, 175, 182, 0) 70%);
    }
}

/*
 * ٥) زرّ «إضافة صور».
 *
 * 🔴 فيليمنت يرسم حقل الصور بصندوق سحبٍ وإفلاتٍ منقّط الحدود بحكم مكتبة FilePond
 * التي يبني عليها — وهذا هو الشكل الذي طُلب استبداله بزرّ عادي. السلوك لم يتغيّر
 * حرفاً واحداً: نفس العنصر القابل للنقر والإفلات، ونفس منطق الرفع في
 * PhotoUpload::bulk() — كل ما هنا هيئة الصندوق نفسه، لا حقلٌ جديد ولا حدثٌ جديد.
 *
 * مقصورة على fi-photo-add-button (انظر PropertyForm::officeSection السطر
 * الخاص بحقل bulk_photos) كي لا تمسّ حقول الصور الأخرى في اللوحة (صورة الغلاف،
 * صور تحديثات المشروع).
 */
/*
 * 🔴 طقم فيليمنت يفرض على نصّ التسمية ‎color: var(--gray-600) !important‎
 * وحشوةً ‎!important‎ — وقاعدته داخل ‎@layer components‎. وفي ‎!important‎ تنقلب
 * قاعدة الطبقات: ما هو داخل طبقةٍ يغلب ما هو خارج الطبقات مهما بلغ تخصيصه، والطبقة
 * الأسبق تغلب اللاحقة. لذلك خسر المحدِّد المضاعَف وحده، وظهر نصٌّ رماديّ على
 * التركواز. فالقيم المفروضة ‎!important‎ هنا داخل ‎@layer base‎ (أسبق من components)،
 * وما عداها يبقى خارج الطبقات حيث يغلب قواعد فيليمنت العادية.
 *
 * 🔴 ولا يُمسّ عرض .filepond--root: هو ‎contain: layout style size‎ فلا يقيس
 * نفسه من محتواه أصلاً، وابنه drop-label مطلقُ التموضع (left:0; right:0).
 * وتجربة ‎width: fit-content‎ هنا أخفت الزرّ كلّياً — انهار العرض إلى صفر.
 * فالجذر يبقى بعرضه الطبيعي شفّافاً بلا خلفية ولا حدّ، والزرّ هو التسمية وحدها.
 */
@layer base {
    .fi-fo-file-upload.fi-photo-add-button .filepond--drop-label {
        min-height: 0 !important;
        /*
         * الحشوة السفلية هي المسافة بين الزرّ وشبكة الصور: FilePond يقيس ارتفاع
         * هذا الشريط كاملاً ويضع القائمة تحته، فلا تلتصق المصغّرات بالزرّ.
         *
         * 🔴 والحشوة الجانبية والعلوية ليست زينة: جذر FilePond يقصّ ما يخرج عن حدوده،
         * والزرّ كان ملتصقاً بطرفه — فعند المرور ارتفع الزرّ واتّسع ظلّه وحلقته،
         * فانقصّ جزءٌ من جهته اليمنى. هذه المساحة تتّسع لذلك كلّه.
         */
        padding: 0.5rem 0.5rem 1.25rem !important;
    }

    .fi-fo-file-upload.fi-photo-add-button .filepond--drop-label label,
    .dark .fi-fo-file-upload.fi-photo-add-button .filepond--drop-label label {
        padding: 0 1.75rem !important;
        color: #fff !important;
        font-size: 0.9375rem !important;
        line-height: 1 !important;
        opacity: 1 !important;
    }

    .dark .fi-fo-file-upload.fi-photo-add-button .filepond--drop-label label {
        color: #0a1e20 !important;
    }
}

.fi-fo-file-upload.fi-photo-add-button .filepond--root {
    background: transparent;
    box-shadow: none;
}

.fi-fo-file-upload.fi-photo-add-button .filepond--panel-root {
    background: transparent;
    box-shadow: none;
}

/*
 * ومحاذاته مع بقية حقول البطاقة: جذر FilePond يفرض ‎direction: ltr‎ على ما
 * بداخله، فلا تتبع flex-start اتجاهَ الصفحة — لذلك يُقلب الطرف يدوياً باتجاه
 * المستند، وإلا طفا الزرّ في وسط البطاقة بينما كل ما حوله محاذٍ لليمين.
 */
[dir='rtl'] .fi-fo-file-upload.fi-photo-add-button .filepond--drop-label {
    justify-content: flex-end;
}

[dir='ltr'] .fi-fo-file-upload.fi-photo-add-button .filepond--drop-label {
    justify-content: flex-start;
}

/*
 * الهيئة: كبسولةٌ بتركواز العلامة الأعمق (#194449) بتدرّجٍ خفيف لا يكاد يُرى،
 * وحلقةٌ داخلية رفيعة فاتحة تحدّ حوافها، وظلٌّ قصير ناعم. الظلّ الواسع الداكن
 * السابق كان يلطّخ ما تحت الزرّ ويبدو ثقيلاً — الفخامة هنا في الهدوء لا في العمق.
 */
.fi-fo-file-upload.fi-photo-add-button .filepond--drop-label label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 2.875rem;
    border-radius: 9999px;
    background-color: #194449;
    background-image: linear-gradient(180deg, #235a60 0%, #194449 100%);
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    box-shadow:
        inset 0 0 0 1px rgba(116, 175, 182, 0.35),
        0 1px 2px rgba(10, 30, 32, 0.1),
        0 3px 8px -2px rgba(25, 68, 73, 0.18);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.dark .fi-fo-file-upload.fi-photo-add-button .filepond--drop-label label {
    background-color: #74afb6;
    background-image: linear-gradient(180deg, #82bac0 0%, #74afb6 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.25),
        0 1px 2px rgba(0, 0, 0, 0.3);
}

/*
 * أيقونة الاستديو — قناع SVG بلون النص، فتتبع لون الزرّ تلقائياً بدل صورة ثابتة.
 * كانت «+» ثم الكاميرا؛ وحين جاء زرّ «تصوير مباشر» بجانبه أخذ هو الكاميرا، وصار
 * لهذا أيقونة الصور — أيقونتان متطابقتان على زرّين مختلفين تُضلّل.
 */
.fi-fo-file-upload.fi-photo-add-button .filepond--drop-label label::before {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    background-color: currentColor;
    -webkit-mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjgiIHN0cm9rZT0iY3VycmVudENvbG9yIiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1zbG90PSJpY29uIj4gICA8cGF0aCBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Im0yLjI1IDE1Ljc1IDUuMTU5LTUuMTU5YTIuMjUgMi4yNSAwIDAgMSAzLjE4MiAwbDUuMTU5IDUuMTU5bS0xLjUtMS41IDEuNDA5LTEuNDA5YTIuMjUgMi4yNSAwIDAgMSAzLjE4MiAwbDIuOTA5IDIuOTA5bS0xOCAzLjc1aDE2LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41VjZhMS41IDEuNSAwIDAgMC0xLjUtMS41SDMuNzVBMS41IDEuNSAwIDAgMCAyLjI1IDZ2MTJhMS41IDEuNSAwIDAgMCAxLjUgMS41Wm0xMC41LTExLjI1aC4wMDh2LjAwOGgtLjAwOFY4LjI1Wm0uMzc1IDBhLjM3NS4zNzUgMCAxIDEtLjc1IDAgLjM3NS4zNzUgMCAwIDEgLjc1IDBaIi8+IDwvc3ZnPg==');
    mask-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjgiIHN0cm9rZT0iY3VycmVudENvbG9yIiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS1zbG90PSJpY29uIj4gICA8cGF0aCBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Im0yLjI1IDE1Ljc1IDUuMTU5LTUuMTU5YTIuMjUgMi4yNSAwIDAgMSAzLjE4MiAwbDUuMTU5IDUuMTU5bS0xLjUtMS41IDEuNDA5LTEuNDA5YTIuMjUgMi4yNSAwIDAgMSAzLjE4MiAwbDIuOTA5IDIuOTA5bS0xOCAzLjc1aDE2LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41VjZhMS41IDEuNSAwIDAgMC0xLjUtMS41SDMuNzVBMS41IDEuNSAwIDAgMCAyLjI1IDZ2MTJhMS41IDEuNSAwIDAgMCAxLjUgMS41Wm0xMC41LTExLjI1aC4wMDh2LjAwOGgtLjAwOFY4LjI1Wm0uMzc1IDBhLjM3NS4zNzUgMCAxIDEtLjc1IDAgLjM3NS4zNzUgMCAwIDEgLjc1IDBaIi8+IDwvc3ZnPg==');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100%;
    mask-size: 100%;
}

.fi-fo-file-upload.fi-photo-add-button .filepond--drop-label label:hover {
    background-image: linear-gradient(180deg, #2a6970 0%, #1d4f55 100%);
    box-shadow:
        inset 0 0 0 1px rgba(116, 175, 182, 0.5),
        0 1px 2px rgba(10, 30, 32, 0.1),
        0 6px 14px -4px rgba(25, 68, 73, 0.25);
    transform: translateY(-1px);
}

.dark .fi-fo-file-upload.fi-photo-add-button .filepond--drop-label label:hover {
    background-image: linear-gradient(180deg, #92c6cb 0%, #82bac0 100%);
}

.fi-fo-file-upload.fi-photo-add-button .filepond--drop-label label:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        inset 0 0 0 1px rgba(116, 175, 182, 0.35),
        0 1px 2px rgba(10, 30, 32, 0.1);
}

/*
 * حلقة تركيز لمن يتنقّل بلوحة المفاتيح: حقل الملف الأصلي مخفيّ بصرياً، فلولا
 * هذه لما ظهر للمستخدم أين هو واقف في الصفحة.
 */
.fi-fo-file-upload.fi-photo-add-button .filepond--root:focus-within .filepond--drop-label label {
    outline: 2px solid rgb(116, 175, 182);
    outline-offset: 2px;
}

/*
 * زرّ «تصوير مباشر» — نصفُ سطر «إضافة صور»، والنصف الآخر لـ«إضافة صور».
 *
 * 🔴 لماذا موضعٌ مطلق وليس سطراً عادياً:
 *  - beforeContent/afterContent في فيليمنت تجعل الزرّ عموداً بجانب المربّع كلّه،
 *    فتقتطع عرضه من شبكة المصغّرات تحته طوال ارتفاعها.
 *  - وaboveContent يُرسم «fi-sc fi-inline» — صفٌّ مرن يتقلّص إلى عرض محتواه، فأيّ
 *    محاذاةٍ داخله تبقى في بداية السطر، أي فوق «إضافة صور» تماماً (هذا ما حدث أولاً:
 *    زرّ الكاميرا غطّى زرّ الرفع).
 * فغلاف aboveContent نفسه (الابن المباشر لعمود المحتوى) يُنتزع من التدفّق ويوضع في
 * النصف المقابل، بعرضٍ مساوٍ لـ«إضافة صور» المحصور في نصفه — فلا تداخل مهما ضاق
 * الهاتف، ولا إزاحة لشبكة الصور.
 *
 * الأرقام: شريط FilePond حشوته 0.5rem من كل جهة (القسم أعلاه)، فكلا الزرّين يبدآن
 * على بعد 0.5rem من الأعلى، ونصف العرض الداخلي ناقص 0.25rem لكلّ منهما = فجوة 0.5rem.
 *
 * وعلى الحاسوب لا كاميرا تُفتح (capture يُتجاهل، فيصير الزرّ «إضافة صور» ثانياً):
 * زرّ الكاميرا مخفيّ، و«إضافة صور» يعود بعرضه وحشوته الأصليّين. ويبقى «صور من فيديو»
 * وحده سطراً عادياً فوقه — الموظف يلتقط على الحاسوب من فيديو وصله على واتساب.
 *
 * والهاتف (أسفل): سطران داخل الشريط نفسه — «إضافة صور» | «تصوير مباشر»، وتحتهما
 * «صور من فيديو» بالعرض كلّه. الغلاف يغطّي العرض كلّه شبكةً بعمودين، خلاياه الفارغة
 * لا تعترض النقر (pointer-events)، فيبقى «إضافة صور» تحت النصف الأول قابلاً للضغط.
 *
 * 🔴 لا ‎:has()‎ في هذا القسم (2026-10-20). كانت القواعد تسأل عمود الحقل «هل فيك زرّ
 * كاميرا؟ زرّ فيديو؟ هل رُسم شريط FilePond؟». أثناء الرفع يغيّر FilePond ما في العمود في
 * كل إطار، فيعيد المتصفح السؤال في كل إطار، وقاعدةٌ في فيليمنت ‎(.fi-input-wrp:not(:has(…)) > *)‎
 * تجعل كل إعادةٍ إعادةَ تنسيقٍ للعمود كله. القياس (20 صورة، هاتف مُحاكى): معظم التمرير
 * المتجمّد أثناء الرفع كان هذا. فالأجوبة تأتي جاهزة:
 *   • .aq-photo-field / .aq-photo-video — يضعهما الخادم على غلاف الحقل (PropertyForm)،
 *     بشرط زرّ الفيديو نفسه؛
 *   • ‎[data-pond-ready]‎ على سطر الأزرار — يضعه partials/photo-camera حين يُرسم
 *     «إضافة صور»، فالسطر مخفيّ (visibility) حتى ذلك الحين بدل أن يُخفى غلافه.
 * ابن العمود المباشر ‎.fi-sc‎ في هذا الحقل هو غلاف aboveContent وحده (الزرّ الآخر هو
 * مربّع الرفع، ولا belowContent ولا helperText هنا).
 */
.aq-photo-field .fi-fo-field-content-col > .fi-sc {
    display: none;
}

.aq-photo-field .fi-photo-camera-row:not([data-pond-ready]) {
    visibility: hidden;
}

/* الحاسوب: «صور من فيديو» في سطر «إضافة صور» نفسه وبجانبه، لا سطراً فوقه — كان فوقه
   بفجوةٍ وإزاحةٍ جانبية (حشوة شريط FilePond) فبدا الزرّان غير متناسقين. «إضافة صور»
   بعرضٍ ثابت كي يُعرف أين ينتهي، والغلاف يُوضع بعده على المسافة نفسها من أعلى الشريط
   (0.5rem، حشوته). وينتظر شريط FilePond كما على الهاتف، فلا يطفو وحده لحظةً. */
@media (hover: hover) and (pointer: fine) {
    .aq-photo-video .fi-fo-field-content-col {
        position: relative;
    }

    .aq-photo-video .fi-fo-field-content-col > .fi-sc {
        display: block;
        position: absolute;
        top: 0.5rem;
        inset-inline-start: calc(0.5rem + 11rem + 0.75rem);
        z-index: 2;
        margin: 0;
    }

    .aq-photo-video .fi-fo-field-content-col .fi-photo-add-button .filepond--drop-label label {
        width: 11rem;
    }
}

.fi-photo-camera-row {
    display: flex;
}

.fi-photo-camera-row [data-photo-camera] {
    display: none;
}

/* سابقٌ لقاعدة .fi-photo-camera-button أدناه في الملف — فالتخصيص المضاعف هو ما يغلب عرضها 100%. */
.fi-photo-camera-row .fi-photo-video-button {
    width: auto;
    padding: 0 1.25rem;
}

.fi-photo-camera-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
    min-height: 2.875rem;
    padding: 0 0.625rem;
    border-radius: 9999px;
    background: #fff;
    color: #194449;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    box-shadow:
        inset 0 0 0 1.5px #194449,
        0 1px 2px rgba(10, 30, 32, 0.08);
    transition: background-color 0.2s ease, transform 0.12s ease;
}

/* 🔴 line-height 1.5 لا 1: مع overflow:hidden (لازمٌ للنقاط «…» على هاتفٍ ضيّق جداً)
   كان صندوق النصّ بارتفاع الحرف تماماً، فقُصَّ ما ينزل من الحروف العربية تحت السطر
   (ذيل الراء والواو). الارتفاع الإضافي يتّسع لها، والزرّ نفسه لا يتغيّر ارتفاعه. */
.fi-photo-camera-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.fi-photo-camera-button svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.fi-photo-camera-button:hover {
    background: rgb(243, 248, 249);
}

.fi-photo-camera-button:active {
    transform: scale(0.98);
}

.fi-photo-camera-button:focus-visible {
    outline: 2px solid rgb(116, 175, 182);
    outline-offset: 2px;
}

.dark .fi-photo-camera-button {
    background: transparent;
    color: #74afb6;
    box-shadow: inset 0 0 0 1.5px #74afb6;
}

.dark .fi-photo-camera-button:hover {
    background: rgba(116, 175, 182, 0.12);
}

/* الهاتف واللوحيّ: كل ما لا يملك مؤشّراً دقيقاً مع hover. */
@media not all and (hover: hover) and (pointer: fine) {
    .aq-photo-field .fi-fo-field-content-col {
        position: relative;
    }

    /* 🔴 يظهر مع «إضافة صور» لا قبله. الزرّ HTML عاديّ يصل مع الصفحة، أما «إضافة صور»
       فيرسمه FilePond بعد أن يُحمَّل سكربته — فكان «تصوير مباشر» يطفو وحده لحظةً في
       أعلى الحقل قبل أن يكتمل ما حوله. الغلاف حاضرٌ دائماً، والسطر داخله مخفيّ حتى يضع
       partials/photo-camera عليه data-pond-ready (أعلى القسم)، فيظهر الزرّان معاً. */
    .aq-photo-field .fi-photo-camera-row[data-pond-ready] {
        animation: aq-camera-in 0.2s ease-out;
    }

    .aq-photo-field .fi-fo-field-content-col > .fi-sc {
        display: block;
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        z-index: 2;
        margin: 0;
        pointer-events: none;
    }

    .fi-photo-camera-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
    }

    .fi-photo-camera-row [data-photo-camera] {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
    }

    .fi-photo-camera-row .fi-photo-video-button {
        grid-column: 1 / span 2;
        grid-row: 2;
        width: 100%;
        padding: 0 0.625rem;
    }

    .fi-photo-camera-row .fi-photo-camera-button {
        pointer-events: auto;
    }

    .aq-photo-field .fi-fo-field-content-col .fi-photo-add-button .filepond--drop-label label {
        width: calc(50% - 0.25rem);
        min-width: 0;
        overflow: hidden;
    }

    /* الحشوة وحجم الخطّ مفروضان !important في ‎@layer base‎ أعلاه — فالتصغير هنا من
       الطبقة نفسها، وبعدها، كي يغلب (انظر تعليق الطبقات في القسم أعلاه). */
    @layer base {
        .aq-photo-field .fi-fo-field-content-col .fi-photo-add-button .filepond--drop-label label {
            padding: 0 0.625rem !important;
            font-size: 0.875rem !important;
        }

        /* السطر الثاني («صور من فيديو») يسكن داخل الشريط: FilePond يقيس ارتفاعه ويضع
           المصغّرات تحته، فتُزاد الحشوة السفلية بارتفاع زرٍّ وفجوة (2.875 + 0.5). */
        .aq-photo-video .fi-fo-field-content-col .fi-photo-add-button .filepond--drop-label {
            padding-bottom: 4.625rem !important;
            align-items: flex-start !important;
        }
    }
}

/*
 * «رجوع» فوق عنوان صفحة إضافة/تعديل عقار (partials/back-link). رابطٌ هادئ بلون
 * العلامة لا زرّ مملوء — هو طريق خروج، لا الفعل الذي جاء المستخدم من أجله.
 */
.fi-page-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    align-self: flex-start;
    margin-bottom: 0.25rem;
    padding: 0.375rem 0.75rem 0.375rem 0.625rem;
    border-radius: 9999px;
    color: #194449;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    background: rgba(116, 175, 182, 0.14);
    transition: background-color 0.15s ease;
}

[dir='rtl'] .fi-page-back-link {
    padding: 0.375rem 0.625rem 0.375rem 0.75rem;
}

.fi-page-back-link svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.fi-page-back-link:hover {
    background: rgba(116, 175, 182, 0.26);
}

.fi-page-back-link:focus-visible {
    outline: 2px solid rgb(116, 175, 182);
    outline-offset: 2px;
}

.dark .fi-page-back-link {
    color: #74afb6;
    background: rgba(116, 175, 182, 0.12);
}

/*
 * معرض صور المكتب — البلاطة هي الصورة نفسها.
 *
 * كانت كل صورة بطاقةً من ثلاث طبقات: شريطٌ علويّ فيه مقبض السحب وسلّة الحذف، ثم
 * سطرٌ فيه مربّع «تحديد»، ثم الصورة — فلا يتّسع الهاتف إلا لصورتين، ونصف كل بطاقة
 * أزرار. الآن: الصورة تملأ البلاطة، والسلّة في زاوية، ومربّع التحديد في الزاوية
 * المقابلة، وثلاث صورٍ في السطر. (مقبض السحب أُزيل من PropertyForm أصلاً.)
 *
 * الصنف fi-office-gallery يضعه PropertyForm على مكرِّر الصور لحساب المكتب وحده —
 * بطاقة الموظّف محرِّرٌ كامل (رفع، غلاف، ترتيب، يوتيوب) ولا تُمَسّ هنا.
 */
.fi-office-gallery .fi-fo-repeater-items {
    gap: 0.5rem;
}

.fi-office-gallery .fi-fo-repeater-item {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

/*
 * أدوات البلاطة: السلّة ومربّع التحديد صغيران، في زاويتي الصورة العلويّتين، فوق
 * تدرّجٍ داكن خفيف يجعلهما مقروءين فوق أيّ صورة — سماءٌ بيضاء أو غرفةٌ معتمة —
 * بلا قاعدةٍ بيضاء تحجب نصف الصورة.
 *
 * ⚠️ فيليمنت يعطي زرّ الأيقونة هامشاً سالباً (‎-m-2‎) ويعطي مربّع التحديد هامشاً علوياً
 * (‎mt-1‎) — كلاهما يزيح العنصر عن مركز ما يحيط به، فيُصفَّران هنا.
 */
.fi-office-gallery .fi-fo-repeater-item::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 2.75rem;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(6, 18, 20, 0.45) 0%, rgba(6, 18, 20, 0) 100%);
}

/* الشريط العلوي ينتزع من التدفّق ويطفو فوق الصورة — لم يبقَ فيه إلا السلّة. */
.fi-office-gallery .fi-fo-repeater-item-header {
    position: absolute;
    top: 0.375rem;
    inset-inline-end: 0.375rem;
    z-index: 2;
    padding: 0;
    overflow: visible;
}

.fi-office-gallery .fi-fo-repeater-item-header .fi-icon-btn {
    margin: 0;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 9999px;
    color: #fff;
    background: rgba(6, 18, 20, 0.45);
    transition: background-color 0.15s ease;
}

.fi-office-gallery .fi-fo-repeater-item-header .fi-icon-btn:hover,
.fi-office-gallery .fi-fo-repeater-item-header .fi-icon-btn:focus-visible {
    background: #dc2626;
}

.fi-office-gallery .fi-fo-repeater-item-header .fi-icon-btn .fi-icon {
    width: 0.9375rem;
    height: 0.9375rem;
}

.fi-office-gallery .fi-fo-repeater-item-has-header > .fi-fo-repeater-item-content {
    border-top: 0;
}

.fi-office-gallery .fi-fo-repeater-item-content {
    padding: 0;
}

.fi-office-gallery .fi-fo-repeater-item-content > .fi-sc {
    gap: 0;
}

/* مربّع التحديد في الزاوية المقابلة للسلّة، بمحاذاة مركزها. */
.fi-office-gallery .fi-fo-repeater-item-content .fi-grid-col:has(.fi-checkbox-input) {
    position: absolute;
    top: 0.375rem;
    inset-inline-start: 0.375rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
}

.fi-office-gallery .fi-checkbox-input {
    margin: 0;
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    border-radius: 0.3125rem;
    background-color: rgba(6, 18, 20, 0.25);
    box-shadow: inset 0 0 0 1.5px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}

.fi-office-gallery .fi-checkbox-input:checked {
    background-color: #3b757e;
    box-shadow: inset 0 0 0 1.5px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* الصورة تملأ البلاطة حتى حوافّها — زوايا البلاطة نفسها هي الإطار. */
.fi-office-gallery .fi-photo-thumb {
    border-radius: 0 !important;
}

/* الصورة المحدَّدة: حلقة العلامة حولها، فتُرى الدفعة المحدَّدة بنظرة قبل «حذف المحدد». */
.fi-office-gallery .fi-fo-repeater-item:has(.fi-checkbox-input:checked) {
    box-shadow: 0 0 0 2px #3b757e;
}

.fi-office-gallery .fi-fo-repeater-item:has(.fi-checkbox-input:checked) .fi-photo-thumb img {
    opacity: 0.85;
}

/*
 * ٦) صفحة المكتب: بطاقةٌ واحدة، تسمياتٌ بجانب حقولها، وفواصل تحمل عناوين الأقسام.
 *
 * 🔴 كل ما هنا يوفّر ارتفاعاً أو لا يأخذ منه شيئاً:
 *
 *  - التسمية بجانب الحقل على الشاشة الأعرض، وفوقه على الهاتف كي يأخذ الحقل السطر
 *    كلّه (انظر «التسمية» أدناه).
 *  - الفاصل بين مجموعتين خيطٌ وعنوانٌ صغير في أوّله، يُرسمان داخل الفجوة بين
 *    المجموعتين — والفجوة موجودة أصلاً — فلا يدفعان شيئاً (انظر «الفاصل» أدناه).
 *
 * كلّه شكل: لا قاعدة هنا تُظهر حقلاً أو تخفيه.
 */

/* الفجوة بين مجموعتين: فيها يسكن الفاصل، ونصفها فوقه ونصفها تحته. */
.fi-office-form .fi-section-content {
    row-gap: 3.5rem;
}

/*
 * على الهاتف: حشوة البطاقة الجانبية أرقّ (1rem بدل 1.5rem). على شاشةٍ عرضها 390px
 * كانت الحشوتان وحدهما تأكلان 48px من عرض الحقول.
 */
/* المحدِّد بطول قاعدة فيليمنت نفسها (خمسة أصناف) وزيادة، وإلّا غلبته. */
@media (max-width: 39.99rem) {
    .fi-office-form .fi-section:not(.fi-section-not-contained):not(.fi-divided) > .fi-section-content-ctn > .fi-section-content {
        padding-inline: 1rem;
    }
}

/* وبين حقول المجموعة الواحدة أضيق: الحقول صارت أسطراً مفردة لا كتلاً. */
.fi-office-group > .fi-sc-has-gap {
    row-gap: 1.25rem;
}

/* ── التسمية: فوق الحقل على الهاتف، بجانبه على الشاشة الأعرض ─────────── */

/*
 * 🔴 على الهاتف التسمية فوق الحقل، والحقل بعرض السطر كلّه (2026-10-03).
 *
 * كانت جانبيّةً على كل عرض بعمودٍ ضيّق (6.25rem) لتوفير سطرٍ في كل حقل، فكانت
 * التسميات الطويلة تلتفّ ثلاثة أسطر («سعر البيع (دولار)»، «عدد طوابق البناء الذي
 * فيه الشقة») والحقل والأزرار تنضغط في ما بقي. وتحت 40rem يعيدها فيليمنت فوق
 * الحقل بنفسه — فالقواعد الجانبيّة أدناه صارت للشاشة الأعرض وحدها.
 */
@media (min-width: 40rem) {
    .fi-office-form .fi-fo-field.fi-fo-field-has-inline-label {
        grid-template-columns: 8rem minmax(0, 1fr);
        column-gap: 0.75rem;
        align-items: start;
    }

    .fi-office-form .fi-fo-field.fi-fo-field-has-inline-label .fi-fo-field-content-col {
        grid-column: auto;
    }

    /*
     * التسمية على خطّ النصّ داخل الحقل: الحقل ارتفاعه 2.25rem وسطر التسمية 1.25rem،
     * فنصف الفرق فوقها. و‎align-content: start‎ هي ما يُبقيها هناك: عمود التسمية بطول
     * الصفّ كلّه، فكانت تنزل إلى وسطه كلّما كان تحت الحقل نصّ مساعدة.
     */
    .fi-office-form .fi-fo-field.fi-fo-field-has-inline-label .fi-fo-field-label-col {
        padding-top: 0.5rem;
        align-content: start;
    }
}

/* على الهاتف: التسمية فوق حقلها بخطوة صغيرة، لا بفجوة فيليمنت الكاملة. */
@media (max-width: 39.99rem) {
    .fi-office-form .fi-fo-field {
        row-gap: 0.375rem;
    }
}

/*
 * نصّ المساعدة تحت الحقل أصغر درجةً من التسمية: هو شرحٌ يُقرأ مرّة، لا ما تُمسح به
 * الصفحة.
 */
.fi-office-form .fi-fo-field .fi-fo-field-content-col .fi-sc-text {
    font-size: 0.8125rem;
    line-height: 1.45;
}

/* ── الفاصل وعنوانه ─────────────────────────────────────────────────── */

.fi-office-group-divided {
    position: relative;
}

.fi-office-group-divided::before,
.fi-office-group-divided::after {
    content: '';
    position: absolute;
    /* منتصف الفجوة فوق المجموعة (3.5rem). */
    top: -1.75rem;
    pointer-events: none;
}

/* الخيط: شفّافٌ عند الحافّتين، فيبدو معلّقاً في وسط البطاقة لا مسطرةً تقطعها. */
.fi-office-group-divided::before {
    left: 0;
    right: 0;
    height: 1px;
    background-image: linear-gradient(
        90deg,
        rgba(116, 175, 182, 0),
        rgba(116, 175, 182, 0.45) 30%,
        rgba(116, 175, 182, 0.45) 70%,
        rgba(116, 175, 182, 0)
    );
}

/*
 * العنوان: كلمةٌ تركوازية صغيرة في أوّل الخيط، بشكل عنوانَي «الغرف والحمّامات»
 * و«المزايا» نفسه. خلفيّتها لون البطاقة فتقطع الخيط عندها، فيبدو الخيط ممتدّاً منها.
 * بلا ‎data-office-label‎ (الوثيقة، الوصف) يبقى الخيط وحده. (كانت دائرةً بأيقونة حتى
 * 2026-10-03 — الأيقونة وحدها لم تكن تقول ما بعدها.)
 */
.fi-office-group-divided[data-office-label]::after {
    content: attr(data-office-label);
    inset-inline-start: 0;
    transform: translateY(-50%);
    padding-inline-end: 0.625rem;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.5;
    color: rgb(42, 92, 99);
}

.dark .fi-office-group-divided[data-office-label]::after {
    background: var(--gray-900);
    color: #9ac8cd;
}

/* الخيط يبدأ صلباً من جهة العنوان ويتلاشى نحو الطرف الآخر. */
.fi-office-group-divided[data-office-label]::before {
    background-image: linear-gradient(
        to left,
        rgba(116, 175, 182, 0.45),
        rgba(116, 175, 182, 0.45) 60%,
        rgba(116, 175, 182, 0)
    );
}

[dir="ltr"] .fi-office-group-divided[data-office-label]::before {
    background-image: linear-gradient(
        to right,
        rgba(116, 175, 182, 0.45),
        rgba(116, 175, 182, 0.45) 60%,
        rgba(116, 175, 182, 0)
    );
}

/* الفاصل يقول «مجموعة جديدة» فوق المزايا؛ خيطٌ ثانٍ بعد عنوانها تكرار. */
.fi-office-form .fi-amenities-fieldset > legend::after {
    display: none;
}

/* ==========================================================================
 * عنوان مجموعة المزايا
 *
 * سبعة مفاتيح — مصعد، موقف، شرفة، ترّاس، مسبح، تدفئة، طاقة شمسية — كانت تبدأ
 * فجأةً بعد «مستوى الإكساء» بلا ما يقول إنها سؤال واحد. صارت الآن ‎Fieldset‎ لها
 * ‎<legend>‎، و‎contained(false)‎ تعني أن فيليمنت لا يرسم لها إطاراً: القسم حولها
 * بطاقة أصلاً، وإطارٌ داخل إطار ضجيج.
 *
 * فيبقى العنوان وحده: كلمةٌ تركوازية صغيرة
 * يمتدّ منها خيطٌ يتلاشى — علامةٌ تقول «هنا يبدأ سؤال جديد» بلا خطٍّ فاصلٍ ثانٍ.
 *
 * كلّه شكل: لا قاعدة هنا تُظهر مفتاحاً أو تخفيه.
 * ========================================================================== */
.fi-amenities-fieldset > legend {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    /* المسافة إلى أوّل مفتاح تحته، وفراغٌ أصغر فوقه يفصله عمّا قبله. */
    margin-block: 0.25rem 0.875rem;
    padding: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.5;
    color: rgb(42, 92, 99);
}

.dark .fi-amenities-fieldset > legend {
    color: rgb(154, 200, 205);
}

/* الخيط الممتدّ من الكلمة، يتلاشى في طرفه البعيد. */
.fi-amenities-fieldset > legend::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    border-radius: 1px;
}

[dir='rtl'] .fi-amenities-fieldset > legend::after {
    background-image: linear-gradient(to left, rgba(116, 175, 182, 0.45), rgba(116, 175, 182, 0));
}

[dir='ltr'] .fi-amenities-fieldset > legend::after {
    background-image: linear-gradient(to right, rgba(116, 175, 182, 0.45), rgba(116, 175, 182, 0));
}

/*
 * 🔴 ارتفاعٌ موحّد لكل مفتاح.
 *
 * تسمياتها تختلف طولاً («مصعد» مقابل «طاقة شمسية»)، وبعضها يلتفّ سطرين على هاتف
 * المكتب — فكان صفّ المفاتيح يتعرّج، ويبدو كأنّ بعضها ينتمي إلى مجموعة أخرى.
 * المحاذاة إلى أعلى الخانة تجعل رؤوس المفاتيح على خطٍّ واحد مهما التفّ النصّ.
 */
.fi-amenities-fieldset .fi-fo-field-wrp {
    align-self: start;
}

/* ==========================================================================
   لافتة «اختر أوّلاً…» (filament.forms.pending-choice)

   🔴 هنا لا في أصناف Tailwind داخل القالب: اللوحة لا تبني أصولها، فأيّ صنفٍ لم
   يستعمله فيليمنت نفسه لا يصل إلى الخادم. ومتغيّرات الألوان في فيليمنت 4 ألوانٌ
   كاملة (oklch) لا ثلاثيّات RGB — فتُكتب var(--warning-50) لا rgb(var(…)).
   ========================================================================== */
.fi-pending-choice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid color-mix(in oklab, var(--warning-300) 70%, transparent);
    background: var(--warning-50);
    color: var(--warning-900);
    font-size: 0.875rem;
    line-height: 1.5;
}

.fi-pending-choice .fi-pending-choice-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
    color: inherit;
}

.dark .fi-pending-choice {
    border-color: color-mix(in oklab, var(--warning-400) 30%, transparent);
    background: color-mix(in oklab, var(--warning-400) 10%, transparent);
    color: var(--warning-200);
}

/* ==========================================================================
 * ٧) تبويبات حالة العقار فوق بطاقات المكتب (ListProperties::getTabs).
 *
 * فيليمنت يرسمها شريطاً واحداً يُمرَّر أفقياً (‎.fi-tabs{overflow-x:auto}) —
 * وخمسة تبويبات لا تتّسع لعرض هاتف، فيختفي «مرفوض» و«مباع / مؤجر» خارج الشاشة
 * ولا يعرف المكتب أنهما موجودان. هنا تلتفّ إلى صفّين يملأ كلٌّ منهما العرض،
 * فتُرى الخمسة معاً بلا تمرير. وعلى الشاشة الواسعة تبقى صفّاً واحداً كما هي.
 * ========================================================================== */
.aq-status-tabs > .fi-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 0.25rem;
}

@media (max-width: 40rem) {
    .aq-status-tabs > .fi-tabs .fi-tabs-item {
        flex: 1 1 auto;
        padding-inline: 0.625rem;
    }
}

/* التبويب الحاليّ بلون العلامة لا بالرماديّ الباهت — على الهاتف هو ما يقول للمكتب
   أيّ قائمة ينظر إليها الآن. */
.aq-status-tabs .fi-tabs-item.fi-active {
    background: color-mix(in oklab, var(--primary-500) 14%, transparent);
}

/* ==========================================================================
 * ٨) زرّ ⋮ في بطاقة العقار (PropertiesTable::cards).
 *
 * 🔴 كان ⋮ يجلس ملاصقاً لزرّ «إعلامنا بأنه مباع»، أي في منتصف البطاقة تقريباً —
 * ومكانه يتغيّر مع طول ذلك الزرّ ومع غيابه. والقائمة تنفتح منه نحو حافة الشاشة،
 * فكان الهاتف يقصّها («تعديل» و«سحب من الموقع» نصف ظاهرَين).
 *
 * هنا يُدفع ⋮ دائماً إلى الطرف البعيد للبطاقة (يسارها في العربية)، والقائمة
 * تنفتح منه عائدةً فوق البطاقة (dropdownPlacement في الكود). البطاقة أعرض من
 * القائمة على أيّ هاتف، فلا تخرج بعدها من الشاشة أياً كان الزرّ الظاهر.
 * ========================================================================== */
.aq-property-cards .fi-ta-record .fi-ta-actions {
    width: 100%;
}

.aq-property-cards .fi-ta-record .fi-ta-actions > :last-child {
    margin-inline-start: auto;
}

/* ظهور «تصوير مباشر» بجانب «إضافة صور» (القسم ٥): تلاشٍ قصير بدل ظهورٍ مفاجئ. */
@keyframes aq-camera-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==========================================================================
 * قوائم المناطق — عنوان المنطقة الإدارية
 *
 * قائمة المنطقة (RegionSelect) مجمّعة تحت المناطق الإدارية، وفيليمنت يرسم عنوان
 * المجموعة سطراً رمادياً بحجم الخيارات نفسه — فيبدو خياراً آخر. وحين تحمل المنطقة
 * الإدارية اسم بلدتها («قدسيا» فوق «قدسيا») يضغط المكتب العنوان ظانّاً أنه المنطقة.
 *
 * فيُرسم العنوان شريطاً: أرضية تركوازية، خط صغير عريض، شرطة في البداية، ويبقى مثبّتاً
 * أعلى القائمة ما دامت مجموعته ظاهرة؛ والخيارات تحته مُزاحة قليلاً فتُقرأ كتلةً
 * تحته. والعنوان نفسه ليس خياراً في الأصل (div لا li) — هذا يجعل ذلك مرئياً.
 * ========================================================================== */
.fi-select-input-option-group > .fi-dropdown-header {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.375rem 0.75rem;
    border-inline-start: 3px solid #74afb6;
    /* معتم لا شفاف: المثبّت يمرّ فوق الخيارات، ولا يجوز أن تُقرأ من خلاله. */
    background: #e8f2f3;
    color: #194449;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: default;
    user-select: none;
}

.fi-select-input-option-group > .fi-dropdown-list > .fi-select-input-option {
    padding-inline-start: 1.5rem;
}

.dark .fi-select-input-option-group > .fi-dropdown-header {
    background: #10302f;
    color: #a9d0d5;
}

/* ==========================================================================
 * ٩) «نسيت كلمة المرور» (filament.auth.*)
 *
 * شاشة «تم استلام طلبك» هي كلّ ما يعرفه المكتب عمّا سيحدث بعد أن عجز عن الدخول،
 * فتُرسم خطواتٍ مرقّمة تُقرأ بنظرة لا فقرةً تُقرأ بتمعّن: علامة صحٍّ تركوازية، ثم
 * ثلاث خطوات في دوائر مرقّمة، ثم الزرّان بعرض البطاقة كاملاً — إصبعٌ على هاتف لا
 * يخطئهما.
 *
 * كلّه شكل: لا قاعدة هنا تُظهر زرّاً أو تخفيه.
 * ========================================================================== */
.aq-auth-back {
    display: flex;
    justify-content: center;
}

.aq-forgot-sent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
}

.aq-forgot-sent-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    background: rgba(116, 175, 182, 0.18);
    box-shadow: 0 0 0 6px rgba(116, 175, 182, 0.08);
    color: #194449;
}

.aq-forgot-sent-icon {
    width: 1.75rem;
    height: 1.75rem;
}

.aq-forgot-sent-lead {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--gray-700);
}

.aq-forgot-steps {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: aq-forgot-step;
    text-align: start;
}

.aq-forgot-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border-radius: 0.75rem;
    background: rgba(116, 175, 182, 0.1);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-950);
    counter-increment: aq-forgot-step;
}

.aq-forgot-steps li::before {
    content: counter(aq-forgot-step);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background: #194449;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
}

.aq-forgot-sent-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
}

.aq-forgot-sent-actions > .fi-btn {
    width: 100%;
}

.dark .aq-forgot-sent-badge {
    background: rgba(116, 175, 182, 0.16);
    box-shadow: 0 0 0 6px rgba(116, 175, 182, 0.06);
    color: #74afb6;
}

.dark .aq-forgot-sent-lead {
    color: var(--gray-300);
}

.dark .aq-forgot-steps li {
    background: rgba(116, 175, 182, 0.08);
    color: var(--gray-100);
}

.dark .aq-forgot-steps li::before {
    background: #74afb6;
    color: #0a1e20;
}

/* ==========================================================================
 * ١٠) غرف النوم، الصالونات، الحمّامات: صفٌّ من مربّعات تُنقر (App\Filament\Forms\CountPicker).
 *
 * سطرٌ واحد لكل سؤال، الأسئلة تحت بعضها (2026-10-03): غرف النوم ‎1 … 7 8+‎، الصالونات
 * ‎0 … 4 5+‎، الحمّامات ‎1 … 4 5+‎. ثمانية أعمدة للجميع فتصطفّ الأزرار عموداً تحت عمود.
 *
 * الارتفاع نفسه لأزرار القسم ١١ (2.25rem) كي تُقرأ الصفحة لغةً واحدة، وهو هدفُ إبهامٍ
 * مريح لمن يملأ النموذج واقفاً. لا أحمر في أيّ حالة: غير المختار رماديّ هادئ، والمختار
 * بلون العلامة، و«مطلوب» رسالة فيليمنت نفسها تحت الحقل.
 * ========================================================================== */
.aq-count-grid {
    display: grid;
    /* ثمانية أعمدة دائماً، لا بعدد الأزرار: سطر الحمّامات (7 أزرار) كان يمدّ أزراره أعرض
       من سطرَي الغرف فوقه. بعرضٍ واحد تصطفّ الأسطر الثلاثة عموداً تحت عمود. */
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.375rem;
    max-width: 24rem;
}

.aq-count-chip {
    height: 2.25rem;
    border-radius: 0.5rem;
    background: #fff;
    color: var(--gray-700);
    box-shadow: inset 0 0 0 1px var(--gray-300);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.12s, color 0.12s, box-shadow 0.12s;
}

.aq-count-chip:hover {
    box-shadow: inset 0 0 0 1px #74afb6;
}

.aq-count-chip:focus-visible {
    outline: 2px solid #74afb6;
    outline-offset: 1px;
}

.aq-count-chip.is-on {
    background: #74afb6;
    color: #0a1e20;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px #74afb6;
}

.aq-count-over {
    font-size: 0.8125rem;
}

.aq-count.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.aq-count-hint {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--gray-500);
}

/*
 * سطر «مجموع الغرف مع الصالونات» ملاصقٌ للصالونات فوقه: كان خانةً في الشبكة تأخذ فجوةً
 * كاملة فوقها وتحتها، فيبدو معلّقاً في فراغ. الهامش السالب يردّ فجوة الخانة، ويبقى
 * الفراغ تحته فجوةَ ما قبل الحمّامات وحدها.
 */
.aq-count-total {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--gray-600);
}

.aq-rooms-fieldset .fi-sc > :has(> .aq-count-total),
.aq-rooms-fieldset .fi-sc > .aq-count-total {
    margin-top: -0.75rem;
}

.aq-count-total .aq-count-hint {
    margin-top: 0.125rem;
}

.aq-count-total bdi {
    font-weight: 700;
    color: #194449;
}

/* الأسئلة الثلاثة كتلةٌ واحدة: فجوةٌ أصغر بينها من فجوة الحقول. */
.aq-rooms-fieldset > .fi-sc,
.aq-rooms-fieldset .fi-fieldset-content,
.aq-rooms-fieldset > div {
    row-gap: 1.125rem;
}

/* أيقونة السرير/الكنبة/المغطس قبل التسمية. */
.aq-count-icon {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-inline-end: 0.3125rem;
    vertical-align: -0.1875rem;
    color: #74afb6;
}

.dark .aq-count-chip {
    background: transparent;
    color: var(--gray-200);
    box-shadow: inset 0 0 0 1px var(--gray-600);
}

.dark .aq-count-chip.is-on {
    background: #74afb6;
    color: #0a1e20;
    box-shadow: inset 0 0 0 1px #74afb6;
}

.dark .aq-count-hint,
.dark .aq-count-total {
    color: var(--gray-400);
}

.dark .aq-count-total bdi {
    color: #74afb6;
}

/* ==========================================================================
 * ١١) قوائم قصيرة صارت أزراراً (PropertyForm::chips — ToggleButtons بصنف ‎.aq-chips‎).
 *
 * نوع العرض، نوع العقار، موقع الطابق، الإكساء، الفرش، وثيقة الملكية، تصنيف الأرض:
 * كلّها أمام العين وتُختار بلمسة. بشكل خانات «غرف النوم» نفسها (القسم ١٠) كي تُقرأ
 * الصفحة لغةً واحدة: أبيض بإطارٍ رماديّ رفيع، والمختار بلون العلامة.
 *
 * الارتفاع 2.25rem لا أقلّ: هدفُ إصبعٍ مريح على الهاتف، وهي أكثر ما يُلمس في الصفحة.
 * ولا أحمر هنا في أيّ حالة: «مطلوب» رسالة فيليمنت نفسها تحت الأزرار.
 * ========================================================================== */
.fi-fo-toggle-buttons.aq-chips {
    gap: 0.375rem;
}

.aq-chips .fi-fo-toggle-buttons-btn-ctn > label.fi-btn {
    min-height: 2.25rem;
    /* أخفّ بالحشوة والخطّ لا بالارتفاع: الارتفاع هدفُ الإبهام. */
    padding: 0.3125rem 0.75rem;
    border-radius: 0.5rem;
    background: #fff;
    color: var(--gray-700);
    box-shadow: inset 0 0 0 1px var(--gray-300);
    font-size: 0.875rem;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.12s, color 0.12s, box-shadow 0.12s;
}

.aq-chips .fi-fo-toggle-buttons-btn-ctn > label.fi-btn:hover {
    background: #fff;
    box-shadow: inset 0 0 0 1px #74afb6;
}

.aq-chips .fi-fo-toggle-buttons-input:focus-visible + label.fi-btn {
    outline: 2px solid #74afb6;
    outline-offset: 1px;
}

.aq-chips .fi-fo-toggle-buttons-input:checked + label.fi-btn,
.aq-chips .fi-fo-toggle-buttons-input:checked + label.fi-btn:hover {
    background: #74afb6;
    color: #0a1e20;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px #74afb6;
}

.dark .aq-chips .fi-fo-toggle-buttons-btn-ctn > label.fi-btn,
.dark .aq-chips .fi-fo-toggle-buttons-btn-ctn > label.fi-btn:hover {
    background: transparent;
    color: var(--gray-200);
    box-shadow: inset 0 0 0 1px var(--gray-600);
}

.dark .aq-chips .fi-fo-toggle-buttons-input:checked + label.fi-btn,
.dark .aq-chips .fi-fo-toggle-buttons-input:checked + label.fi-btn:hover {
    background: #74afb6;
    color: #0a1e20;
    box-shadow: inset 0 0 0 1px #74afb6;
}

/* ==========================================================================
 * ١٢) السطر تحت حقل السعر (filament.forms.price-readout).
 *
 * الرقم بمراتبه بخطٍّ واضح بلون العلامة — هو ما يُقرأ ليُكشف الصفر الناقص — والتنبيه
 * كهرمانيّ هادئ لا أحمر: لا يمنع الحفظ، يطلب نظرةً ثانية فقط.
 * ========================================================================== */
.aq-money {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.45;
}

.aq-money-words {
    font-weight: 700;
    color: #194449;
}

.aq-money-warn {
    font-size: 0.8125rem;
    color: #a16207;
}

.dark .aq-money-words {
    color: #9ac8cd;
}

.dark .aq-money-warn {
    color: #facc15;
}

/* ==========================================================================
 * ١٣) المزايا: رقائق بأيقونات يُختار منها أكثر من واحدة (PropertyForm — ‎.aq-amenities‎).
 *
 * شكل أزرار القسم ١١ نفسه، والأيقونة قبل الكلمة بلون العلامة الفاتح؛ وفي المختارة
 * بلون الكلمة نفسها كي لا تختفي على الخلفية التركوازية.
 * ========================================================================== */
.aq-chips .fi-fo-toggle-buttons-btn-ctn > label.fi-btn > .fi-icon {
    width: 1.0625rem;
    height: 1.0625rem;
    color: #74afb6;
}

.aq-chips .fi-fo-toggle-buttons-btn-ctn > label.fi-btn > .fi-icon svg {
    width: 100%;
    height: 100%;
}

.aq-chips .fi-fo-toggle-buttons-input:checked + label.fi-btn > .fi-icon {
    color: #0a1e20;
}

/*
 * العنوان «المزايا المتوفرة في العقار» ملاصقٌ لرقائقه. فيليمنت يضع حشوةً علويّة (1.5rem)
 * على الـ Fieldset بلا إطار، فوق هامش العنوان نفسه (0.875rem) — فكان بينهما فراغٌ يبدو
 * كأن العنوان لشيءٍ آخر. للمزايا وحدها (‎:has(.aq-amenities)‎)؛ مجموعة الغرف تبقى كما هي.
 */
.fi-amenities-fieldset.fi-fieldset-not-contained:has(.aq-amenities) {
    padding-top: 0;
}

/* ==========================================================================
 * ١٤) شريط «إضافة» / «حفظ التغييرات» أسفل الشاشة (Create/EditProperty — ‎$formActionsAreSticky‎).
 *
 * الشريط نفسه شريط فيليمنت الثابت. هنا الترتيب فقط: «إضافة» الزرّ الرئيسي العريض، وما
 * بقي («إضافة وإدخال عقار آخر»، «إلغاء») أزرارٌ مُحاطةٌ بإطارٍ فقط، بلا تعبئة، بجانبه —
 * تُقرأ كأزرار لا كروابط، ويبقى «إضافة» وحده الممتلئ فلا تبحث العين أيّها المقصود.
 * ========================================================================== */
.fi-resource-properties .fi-ac:has(.aq-primary-action) {
    align-items: center;
    gap: 0.75rem;
}

.fi-resource-properties .fi-ac .aq-primary-action {
    min-height: 2.75rem;
    padding-inline: 1.5rem;
    font-weight: 700;
}

.fi-resource-properties .fi-ac .aq-secondary-action {
    min-height: 2.75rem;
    padding-inline: 1rem;
    font-weight: 600;
    background-color: #fff;
}

.dark .fi-resource-properties .fi-ac .aq-secondary-action {
    background-color: rgb(255 255 255 / 0.04);
}

@media (max-width: 39.99rem) {
    .fi-resource-properties .fi-ac:has(.aq-primary-action) {
        flex-wrap: nowrap;
    }

    .fi-resource-properties .fi-ac .aq-primary-action {
        flex: 1 1 auto;
    }

    /* «إلغاء» في شاشة التعديل ما زال رابطاً. */
    .fi-resource-properties .fi-ac:has(.aq-primary-action) .fi-link {
        flex: 0 0 auto;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    .fi-resource-properties .fi-ac:has(.aq-primary-action) {
        gap: 0.5rem;
    }

    .fi-resource-properties .fi-ac .aq-primary-action {
        padding-inline: 1rem;
    }

    /* على الشاشة الضيّقة ينكسر «إضافة وإدخال عقار آخر» إلى سطرين داخل زرّه بدل أن يدفع
       «إضافة» خارج الشاشة. */
    .fi-resource-properties .fi-ac .aq-secondary-action {
        flex: 0 1 auto;
        padding-inline: 0.75rem;
        font-size: 0.8125rem;
        line-height: 1.2;
        white-space: normal;
        text-align: center;
    }
}

/* بطاقة «ثبّت التطبيق» ثابتةٌ أسفل الشاشة أيضاً: على شاشتَي العقار ترتفع فوق الشريط كي
   لا تغطّي «إضافة». الصنف aq-primary-bar يضعه AdminPanelProvider على الشاشتين نفسيهما.
   🔴 لا body:has(…) هنا (كانت حتى 2026-10-20): كل تغييرٍ في الصفحة — والرفع يغيّرها في كل
   إطار — جعل المتصفح يعيد فحص body، ومعه إعادة تنسيق الصفحة كلها. */
body.aq-primary-bar #install-app-prompt {
    bottom: 5.5rem;
}

/* ==========================================================================
 * الشريط السفلي اللاصق («حفظ التغييرات» / «إضافة») فوق بلاطات الصور
 *
 * 🔴 2026-10-18: عند التمرير كانت سلّة كل صورة ومربّع تحديدها وتدرّجها الداكن تظهر فوق
 * الشريط، فيبدو كأن الصور خيالٌ خلف زرّ الحفظ. السبب: فيليمنت يثبّت الشريط
 * (position: fixed) بلا z-index، وعناصر البلاطة مرفوعة بـ z-index 1–2 (fi-office-gallery
 * أعلاه)، وقائمة FilePond بـ 6 — فالمتصفح يرسمها فوقه.
 *
 * ‎10‎ تحديداً: فوق البلاطات وFilePond، وتحت ما يجب أن يبقى فوق الشريط كما كان —
 * القوائم المنسدلة وشريط التحديد في مربّع الرفع (20)، والشريط العلوي والقائمة
 * الجانبية (30)، ونوافذ التأكيد والمعاينة.
 * ========================================================================== */
.fi-sc-actions.fi-sticky .fi-ac {
    z-index: 10;
}
