/* =========================================================
   Dayraban.web — تعديلات نسخة الويب فقط
   (المحددات تبدأ بـ html body حتى تتقدم على أنماط الصفحات)
   ========================================================= */

/* ---------- زر ✕ الأحمر ---------- */
html body .web-close-x {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border: 0;
    border-radius: 50%;
    background: #d32f2f;
    color: #fff;
    font-size: 24px;
    font-weight: 900;
    line-height: 46px;
    padding: 0;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(160, 20, 20, .35);
    -webkit-tap-highlight-color: transparent;
}

html body .web-close-x:active { transform: scale(.94); }

html body .web-close-x-inline {
    width: 38px;
    height: 38px;
    min-width: 38px;
    line-height: 38px;
    font-size: 19px;
}

html body .web-close-x-fixed {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 12px;
    z-index: 6000;
}

/* ---------- الترتيب: الشجرة ثم البحث ---------- */
@media (max-width: 1000px) {
    html body .tree-workspace {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;   /* بعرض الشاشة، وليس بعرض المحتوى */
    }

    html body .tree-main-pane {
        order: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    html body .tree-search-side {
        order: 2 !important;
        margin-top: 4px !important;
    }
}

/* ---------- نتائج البحث أعلى الصفحة ---------- */
html body .web-search-results {
    background: #fff;
    border: 1px solid #dce6e1;
    border-radius: 16px;
    box-shadow: 0 7px 22px rgba(25, 70, 55, .10);
    padding: 12px;
    margin: 0 0 16px;
    scroll-margin-top: 10px;
}

html body .web-search-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

html body .web-search-results-title {
    color: #145c43;
    font-size: 18px;
    font-weight: 900;
}

html body .web-search-results .tree-search-table-wrap {
    max-height: 55vh !important;
    overflow: auto !important;
}

/* ---------- البطاقة المختصرة تطفو فوق الشخص ---------- */
html body .tree-selected-inline-panel:not(.is-full) {
    position: fixed !important;
    z-index: 3000 !important;
    width: var(--web-pop-w, min(320px, calc(100vw - 16px))) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    flex: none !important;
    margin: 0 !important;
    padding: 12px 10px 10px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    border: 1px solid #cfe0d8 !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 34px rgba(21, 70, 55, .28) !important;
    visibility: hidden;
}

html body .tree-selected-inline-panel.web-popover-placed:not(.is-full) {
    visibility: visible;
}

html body .web-popover-close {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: #d32f2f;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 28px;
    padding: 0;
    cursor: pointer;
    z-index: 2;
}

html body .tree-selected-inline-panel:not(.is-full) .tree-selected-person-card {
    padding-left: 30px !important;
}

/* ---------- صندوق المعلومات الكامل على الصفحة كلها ---------- */
html body .tree-selected-inline-panel.is-full {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    flex: none !important;
    margin: 0 !important;
    z-index: 5000 !important;
    background: #fff !important;
}

html body .tree-inline-full-details {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: calc(70px + env(safe-area-inset-top)) 16px 30px !important;
}

html body .tree-inline-full-close {
    position: fixed !important;
    top: calc(12px + env(safe-area-inset-top)) !important;
    left: 12px !important;
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    background: #d32f2f !important;
    color: #fff !important;
    font-size: 28px !important;
    line-height: 46px !important;
    box-shadow: 0 4px 14px rgba(160, 20, 20, .35) !important;
    z-index: 5100 !important;
}

/* نافذة التعديل: زر الإغلاق أحمر أيضًا */
html body .person-details-close {
    background: #d32f2f !important;
    color: #fff !important;
    border-radius: 50% !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 24px !important;
    font-weight: 900 !important;
}

/* منع تمرير الصفحة خلف النوافذ الكاملة */
body.web-modal-open { overflow: hidden !important; }

/* ---------- صفحات الموقع داخل التطبيق ---------- */
html body .web-inapp-page {
    position: fixed;
    inset: 0;
    z-index: 7000;
    display: flex;
    flex-direction: column;
    background: #fff;
}

html body .web-inapp-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    background: #145c43;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

html body .web-inapp-title {
    font-size: 17px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html body .web-inapp-frame {
    flex: 1;
    width: 100%;
    border: 0;
}

/* ---------- حقوق النشر ---------- */
html body .web-footer {
    margin-top: 10px;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 13px;
    color: #5f6f68;
    border-top: 1px solid #dfe8e3;
    background: #fff;
    line-height: 1.8;
}

html body .web-footer-link {
    color: #0a66c2;
    font-weight: 700;
    text-decoration: none;
}

/* ---------- الإحصائيات: الإجمالي / الذكور / الإناث / الوفيات ---------- */
html body .web-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 12px 0 4px;
    direction: rtl;
}

html body .web-stats-compact {
    gap: 6px;
    margin: 4px 0 0;
    flex: 1 1 100%;
}

html body .web-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 9px 4px 8px;
    border-radius: 12px;
    border: 1px solid transparent;
    min-width: 0;
    text-align: center;
}

html body .web-stats-compact .web-stat {
    padding: 6px 2px 5px;
    border-radius: 10px;
}

html body .web-stat-icon { font-size: 15px; line-height: 1.1; }
html body .web-stat-value { font-size: 18px; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
html body .web-stat-label { font-size: 11px; font-weight: 700; opacity: .85; }

html body .web-stats-compact .web-stat-icon { font-size: 12px; }
html body .web-stats-compact .web-stat-value { font-size: 15px; }
html body .web-stats-compact .web-stat-label { font-size: 10px; }

html body .web-stat-total  { background: #eaf5ef; border-color: #cfe6d9; color: #145c43; }
html body .web-stat-male   { background: #eaf2fc; border-color: #cddff5; color: #1f5fa8; }
html body .web-stat-female { background: #fcedf3; border-color: #f3d0de; color: #b23a6b; }
html body .web-stat-death  { background: #f1f2f3; border-color: #dfe2e5; color: #4a4f55; }

html body .web-stats-loading {
    width: 100%;
    margin-top: 6px;
    font-size: 11.5px;
    color: #7a8983;
    text-align: center;
}

/* إجمالي ديرأبان بجانب اسم الجذر */
html body .web-root-total {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #145c43;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
}


/* ---------- البطاقة المختصرة بجانب الشجرة (عريضة وطويلة) ---------- */
html body .tree-selected-inline-panel:not(.is-full) {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    border-inline-end: 4px solid #145c43 !important;   /* خط يربطها بجهة الاسم */
}

html body .tree-selected-inline-panel:not(.is-full) .tree-selected-person-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 0 0 30px !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

html body .tree-selected-inline-panel:not(.is-full) .tree-selected-photo-button {
    flex: 0 0 58px !important;
    width: 58px !important;
    height: 58px !important;
    border-radius: 50% !important;
    border: 2px solid #e2eee8 !important;
}

html body .tree-selected-inline-panel:not(.is-full) .tree-selected-person-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

html body .tree-selected-inline-panel:not(.is-full) .tree-selected-person-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

html body .tree-selected-inline-panel:not(.is-full) .tree-selected-name-button {
    font-size: 15px !important;
    white-space: normal !important;
}

html body .tree-selected-inline-panel:not(.is-full) .tree-selected-person-line {
    font-size: 12px !important;
    line-height: 1.45 !important;
}

html body .tree-selected-inline-panel:not(.is-full) .tree-selected-inline-bottom {
    width: 100% !important;
}

/* في البطاقة الجانبية: الإحصائيات بشكل شريط واحد مضغوط */
html body .web-popover-side .web-stats-compact .web-stat {
    flex-direction: row;
    gap: 4px;
    padding: 5px 3px;
}

html body .web-popover-side .web-stats-compact .web-stat-label { display: none; }

html body .web-popover-side .web-stats-compact .web-stat-value { font-size: 13.5px; }

html body .tree-selected-inline-panel.web-popover-below:not(.is-full) {
    border-inline-end: 0 !important;
    border-top: 4px solid #145c43 !important;
}

/* ---------- عارض PDF ---------- */
html body .web-pdf-tools {
    display: flex;
    gap: 6px;
    margin-inline-start: auto;
}

html body .web-pdf-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 22px;
    font-weight: 900;
    line-height: 40px;
    text-align: center;
    text-decoration: none;
    padding: 0;
}

html body .web-pdf-open { font-size: 19px; }

html body .web-inapp-bar { justify-content: flex-start; }

html body .web-pdf-view {
    position: relative;
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #525659;
    direction: ltr;
}

html body .web-pdf-pages {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 0 60px;
    box-sizing: border-box;
}

html body .web-pdf-page {
    position: relative;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    display: flex;
    align-items: center;
    justify-content: center;
}

html body .web-pdf-page-num { color: #b0b4b8; font-size: 22px; font-weight: 800; }

html body .web-pdf-canvas { display: block; width: 100%; height: auto; }

html body .web-pdf-status {
    padding: 40px 20px;
    text-align: center;
    color: #fff;
    font-size: 15px;
    direction: rtl;
    line-height: 2;
}

html body .web-pdf-fallback { color: #9fe0c3; font-weight: 800; }

html body .web-pdf-counter {
    position: sticky;
    bottom: 12px;
    left: 0;
    width: max-content;
    margin: -48px auto 0;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    direction: ltr;
}

/* ---------- قسم قيد الإعداد ---------- */
html body .web-inapp-missing {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
    background: #f5f7f6;
}

html body .web-inapp-missing-icon { font-size: 54px; }
html body .web-inapp-missing-title { font-size: 22px; font-weight: 900; color: #145c43; }
html body .web-inapp-missing-text { font-size: 15px; color: #5f6f68; }

html body .web-inapp-missing-back {
    margin-top: 10px;
    padding: 11px 22px;
    border: 0;
    border-radius: 12px;
    background: #145c43;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}


/* بطاقة جانبية ضيقة وطويلة: الصورة فوق، ثم الاسم والمعلومات، ثم الإحصائيات 2×2 */
html body .web-popover-narrow:not(.is-full) {
    padding: 10px 8px 8px !important;
}

html body .web-popover-narrow:not(.is-full) .tree-selected-person-card {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 0 !important;
    gap: 6px !important;
}

html body .web-popover-narrow:not(.is-full) .tree-selected-name-button {
    text-align: center !important;
    font-size: 14px !important;
}

html body .web-popover-narrow:not(.is-full) .tree-selected-person-line {
    justify-content: center !important;
    text-align: center !important;
}

html body .web-popover-side.web-popover-narrow .web-stats-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

html body .web-popover-side.web-popover-narrow .web-stats-compact .web-stat {
    flex-direction: column;
    padding: 5px 2px;
}

html body .web-popover-side.web-popover-narrow .web-stats-compact .web-stat-label { display: block; }

html body .web-popover-narrow .web-popover-close {
    top: 4px;
    left: 4px;
}


/* ---------- عمود محجوز للبطاقة المختصرة بجانب الشجرة ---------- */
html body .tree-main-pane {
    --web-side-w: clamp(120px, 40vw, 360px);
    transition: padding .18s ease;
}

html body .tree-main-pane.web-has-side {
    padding-right: var(--web-side-w) !important;
    box-sizing: border-box !important;
}

/* البطاقة داخل العمود لا تحتاج خطاً جانبياً سميكاً */
html body .web-popover-side:not(.is-full) {
    border-inline-end: 0 !important;
    border-top: 4px solid #145c43 !important;
}

/* كلمة السر في البطاقة الضيقة تنزل تحت بعضها */
html body .web-popover-narrow .tree-password-only-box {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

html body .web-popover-narrow .tree-mini-password,
html body .web-popover-narrow .tree-mini-unlock-button {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

html body .web-popover-narrow .tree-selected-inline-bottom {
    flex-direction: column !important;
    align-items: stretch !important;
}

html body .web-popover-narrow .tree-inline-actions {
    flex-wrap: wrap !important;
    justify-content: center !important;
}

/* عمود ضيق جداً (موبايل): صورة صغيرة، وإحصائيات في عمود واحد */
html body .web-popover-xnarrow:not(.is-full) {
    padding: 30px 5px 6px !important;
}

html body .web-popover-xnarrow:not(.is-full) .tree-selected-photo-button {
    flex-basis: 46px !important;
    width: 46px !important;
    height: 46px !important;
}

html body .web-popover-xnarrow:not(.is-full) .tree-selected-name-button { font-size: 12.5px !important; }
html body .web-popover-xnarrow:not(.is-full) .tree-selected-person-line { font-size: 11px !important; }

html body .web-popover-side.web-popover-xnarrow .web-stats-compact {
    grid-template-columns: 1fr;
    gap: 4px;
}

html body .web-popover-side.web-popover-xnarrow .web-stats-compact .web-stat {
    flex-direction: row;
    justify-content: space-between;
    padding: 4px 6px;
}

html body .web-popover-side.web-popover-xnarrow .web-stats-compact .web-stat-label { display: none; }
html body .web-popover-side.web-popover-xnarrow .web-stats-compact .web-stat-value { font-size: 13px; }

html body .web-popover-xnarrow .web-popover-close {
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
}


html body .mobile-family-tree {
    max-width: 100% !important;
    box-sizing: border-box !important;
}


/* ============================================================
   شريط السحب + صندوق التفاصيل كنافذة متحركة
   ============================================================ */
html body .web-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    margin: -8px -6px 2px;
    cursor: grab;
    touch-action: none;           /* السحب بالإصبع لا يمرّر الصفحة */
    -webkit-user-select: none;
    user-select: none;
    flex: 0 0 auto;
}

html body .web-drag-grip {
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: #b9cbc3;
    box-shadow: 0 7px 0 #d6e2dc;
}

html body .web-dragging { transition: none !important; opacity: .96; }
html body .web-dragging .web-drag-handle { cursor: grabbing; }

/* صندوق التفاصيل: نافذة عائمة يمكن تحريكها بدل ملء الشاشة */
html body .tree-selected-inline-panel.is-full {
    inset: auto !important;
    left: var(--web-x, 3vw) !important;
    top: var(--web-y, calc(10px + env(safe-area-inset-top))) !important;
    right: auto !important;
    bottom: auto !important;
    width: min(94vw, 560px) !important;
    min-width: 0 !important;
    max-width: 94vw !important;
    height: calc(100dvh - 24px) !important;
    max-height: calc(100dvh - 24px) !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 18px !important;
    border: 1px solid #cfe0d8 !important;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .30) !important;
    overflow: hidden !important;
}

@media (min-width: 620px) {
    html body .tree-selected-inline-panel.is-full {
        left: var(--web-x, calc(50vw - 280px)) !important;
    }
}

html body .tree-selected-inline-panel.is-full .web-drag-handle {
    height: 44px;
    margin: 0;
    background: #f1f6f3;
    border-bottom: 1px solid #dfe9e4;
}

html body .tree-selected-inline-panel.is-full .tree-inline-full-details {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 14px 16px 30px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

html body .tree-selected-inline-panel.is-full .tree-inline-full-close {
    position: absolute !important;
    top: 4px !important;
    left: 8px !important;
    width: 38px !important;
    height: 38px !important;
    line-height: 38px !important;
    font-size: 22px !important;
}

/* البطاقة المختصرة: الشريط في أعلاها، وزر ✕ بجانبه */
html body .tree-selected-inline-panel:not(.is-full) .web-drag-handle { margin-top: -10px; }
html body .web-popover-xnarrow:not(.is-full) .web-drag-handle { margin-top: -28px; }

html body .tree-selected-inline-panel.is-full .tree-inline-full-details { position: static !important; }
html body .tree-selected-inline-panel.is-full { position: fixed !important; }

html body .web-popover-xnarrow .web-popover-close {
    left: 3px;
    transform: none;
}


/* ---------- الصندوق المختصر العريض تحت الشخص ---------- */
html body .web-popover-wide:not(.is-full) {
    border-inline-end: 0 !important;
    border-top: 4px solid #145c43 !important;
    padding: 10px 12px 12px !important;
}

html body .web-popover-wide .web-stats-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

html body .web-popover-wide .web-stats-compact .web-stat {
    flex-direction: column;
    padding: 7px 3px 6px;
}

html body .web-popover-wide .web-stats-compact .web-stat-label { display: block; }
html body .web-popover-wide .web-stats-compact .web-stat-value { font-size: 17px; }
html body .web-popover-wide .web-stats-compact .web-stat-icon { font-size: 13px; }

/* الشجرة بعرض الشاشة دائماً */
html body .tree-main-pane.web-has-side { padding-right: 0 !important; }

/* ============================================================
   شريط التحريك: الشريط العلوي كله، ومكتوب عليه "تحريك"
   ============================================================ */
html body .web-drag-handle {
    position: relative;
    gap: 6px;
    height: 34px;
    margin: -10px -12px 8px !important;
    padding: 0 44px;
    background: linear-gradient(#eef6f2, #e3efe9);
    border-bottom: 1px solid #d3e3db;
    border-radius: 12px 12px 0 0;
    color: #3d6b5a;
    font-size: 13px;
    font-weight: 800;
}

html body .web-drag-grip {
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
    font-size: 17px;
    line-height: 1;
    color: #5f8b7a;
}

html body .web-drag-text { letter-spacing: .5px; }

html body .tree-selected-inline-panel:not(.is-full) .web-popover-close {
    top: 3px;
    left: 5px;
    z-index: 3;
}

html body .tree-selected-inline-panel.is-full .web-drag-handle {
    height: 46px;
    margin: 0 !important;
    border-radius: 0;
    font-size: 14px;
}

/* ---------- زر "تفاصيل..." البارز ---------- */
html body .web-details-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 6px 16px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff9f1a, #e8590c);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(232, 89, 12, .35);
    cursor: pointer;
    animation: webDetailsPulse 2.2s ease-in-out infinite;
    align-self: flex-start;
    width: auto !important;
}

html body .web-details-btn:active { transform: scale(.96); }

@keyframes webDetailsPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(232, 89, 12, .35); }
    50% { box-shadow: 0 4px 18px rgba(232, 89, 12, .65); }
}

/* ---------- الأفلام ---------- */
html body .web-videos {
    margin: 18px 0 8px;
    padding: 14px 12px;
    background: #fff;
    border: 1px solid #dce6e1;
    border-radius: 16px;
    box-shadow: 0 7px 22px rgba(25, 70, 55, .08);
}

html body .web-videos-title {
    color: #145c43;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 10px;
}

html body .web-videos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 420px) {
    html body .web-videos-grid { grid-template-columns: 1fr; }
}

html body .web-video-card { min-width: 0; }

html body .web-video-thumb,
html body .web-video-frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

html body .web-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: .9;
}

html body .web-video-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    border-radius: 50%;
    background: rgba(211, 47, 47, .92);
    color: #fff;
    font-size: 24px;
    line-height: 58px;
    text-align: center;
    padding-left: 4px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
}

html body .web-video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

html body .web-video-name {
    margin-top: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    color: #243b33;
}

/* ---------- زر دليل الاستخدام ---------- */
html body .web-tour-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 14px;
    padding: 12px 14px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #145c43, #1f7a5a);
    color: #fff;
    text-align: right;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(20, 92, 67, .3);
}

html body .web-tour-icon { font-size: 30px; }
html body .web-tour-text { display: flex; flex-direction: column; flex: 1; }
html body .web-tour-text strong { font-size: 16px; }
html body .web-tour-text small { font-size: 12px; opacity: .85; }
html body .web-tour-go { font-weight: 900; font-size: 14px; background: rgba(255,255,255,.18); padding: 6px 12px; border-radius: 999px; }

/* ---------- الجولة التعليمية ---------- */
html body .web-tour {
    position: fixed;
    inset: 0;
    z-index: 9000;
}

html body .web-tour-spot {
    position: fixed;
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62);
    border: 2px solid #ffb84d;
    transition: all .25s ease;
    pointer-events: none;
}

html body .web-tour-center {
    background: rgba(0, 0, 0, .62);
}

html body .web-tour-card-box {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    max-width: 520px;
    margin: 0 auto;
    padding: 16px 16px 14px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
    direction: rtl;
}

html body .web-tour-card-top .web-tour-card-box {
    top: calc(14px + env(safe-area-inset-top));
    bottom: auto;
}

html body .web-tour-center .web-tour-card-box {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

html body .web-tour-close {
    position: absolute;
    top: 10px;
    left: 10px;
}

html body .web-tour-step { font-size: 12px; font-weight: 800; color: #1f7a5a; }
html body .web-tour-title { margin: 4px 0 8px; font-size: 19px; font-weight: 900; color: #145c43; padding-left: 44px; }
html body .web-tour-body { font-size: 15px; line-height: 1.8; color: #33423c; white-space: pre-line; }

html body .web-tour-music iframe {
    width: 100%;
    height: 80px;
    margin-top: 10px;
    border: 0;
    border-radius: 10px;
}

html body .web-tour-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

html body .web-tour-actions button {
    flex: 1;
    padding: 11px 10px;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 900;
}

html body .web-tour-prev { background: #eef2f0; color: #36584b; }
html body .web-tour-prev:disabled { opacity: .45; }
html body .web-tour-next { background: #145c43; color: #fff; }


/* ---------- الجولة: شريط التقدم وزر التخطي ---------- */
html body .web-tour-progress {
    height: 5px;
    margin: -6px 0 10px;
    padding-left: 44px;
    border-radius: 999px;
    overflow: hidden;
}

html body .web-tour-progress span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #ffb84d, #e8590c);
    transition: width .3s ease;
}

html body .web-tour-actions { gap: 6px; }
html body .web-tour-actions button { padding: 10px 6px; font-size: 14px; }
html body .web-tour-skip { background: #fff4e6; color: #b35400; flex: .8 !important; }
html body .web-tour-skip:disabled { opacity: .45; }
html body .web-tour-body { max-height: 38vh; overflow-y: auto; }

/* ---------- الابن التجريبي ---------- */
html body .web-tour-fake-child {
    position: fixed;
    z-index: 8500;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px 4px 6px;
    background: #fffaf0;
    border: 2px dashed #ffb84d;
    border-radius: 12px;
    direction: rtl;
    animation: webFakeIn .45s ease-out;
    transition: opacity .5s ease, transform .5s ease;
    font-family: inherit;
}

html body .web-tour-fake-child img { width: 30px; height: 30px; border-radius: 50%; }
html body .web-tour-fake-toggle {
    width: 28px; height: 28px; border: 1px solid #ccd8d2; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center; color: #145c43; font-weight: 900; background: #fff;
}
html body .web-tour-fake-name { font-weight: 800; color: #243b33; font-size: 14px; }
html body .web-tour-fake-badge { font-size: 11px; font-weight: 900; color: #fff; background: #e8590c; border-radius: 999px; padding: 1px 8px; }
html body .web-tour-fake-photo img { box-shadow: 0 0 0 3px #ffb84d; }
html body .web-tour-fake-out { opacity: 0; transform: translateX(-30px) scale(.9); }

@keyframes webFakeIn {
    from { opacity: 0; transform: translateY(-8px) scale(.95); }
    to { opacity: 1; transform: none; }
}


/* ---------- العرض التلقائي ---------- */
html body .web-tour-timer {
    height: 3px;
    margin-top: 12px;
    background: #eef2f0;
    border-radius: 999px;
    overflow: hidden;
}
html body .web-tour-timer span { display: block; height: 100%; width: 0; background: #1f7a5a; }
html body .web-tour-auto { background: #e7f3ee; color: #145c43; flex: .8 !important; }
html body .web-tour-auto.is-paused { background: #145c43; color: #fff; }
html body .web-tour-card-in { animation: webTourCardIn .45s ease-out; }
html body .web-tour-spot { transition: all .45s cubic-bezier(.3,.8,.3,1); }
@keyframes webTourCardIn {
    from { opacity: .2; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
html body .web-tour-center .web-tour-card-in { animation: none; }


/* ---------- الجولة: تكبير الخانة، وحفظ تمثيلي ---------- */
html body .web-tour-field-big {
    position: relative;
    z-index: 2;
    grid-column: 1 / -1 !important;
    background: #fffaf0 !important;
    border: 2px solid #ffb84d !important;
    border-radius: 12px !important;
    padding: 8px !important;
}
html body .web-tour-field-big span { font-size: 16px !important; font-weight: 900 !important; color: #b35400 !important; }
html body .web-tour-field-big textarea {
    font-size: 18px !important;
    line-height: 1.8 !important;
    min-height: 190px !important;
}
html body .web-tour-press { transform: scale(.94); box-shadow: 0 0 0 4px rgba(255, 184, 77, .6) !important; transition: transform .15s; }
html body .web-tour-saved {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #edf8f1;
    color: #156046;
    font-weight: 900;
    text-align: center;
    animation: webTourCardIn .35s ease-out;
}


/* ============================================================
   بطاقة الجولة: ثابتة في أسفل الشاشة، صغيرة ومختصرة
   ============================================================ */
html body .web-tour-card-box,
html body .web-tour-card-top .web-tour-card-box,
html body .web-tour-center .web-tour-card-box {
    top: auto !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    transform: none !important;
    left: 8px;
    right: 8px;
    padding: 10px 12px 10px !important;
    border-radius: 16px;
}

html body .web-tour-card-in { animation: none !important; }
html body .web-tour-center { background: rgba(0, 0, 0, .45); }

html body .web-tour-close { top: 8px !important; left: 8px !important; width: 32px !important; height: 32px !important; min-width: 32px !important; line-height: 32px !important; font-size: 15px !important; }
html body .web-tour-progress { margin: -2px 0 6px; padding-left: 40px; height: 4px; }
html body .web-tour-step { font-size: 11px; }
html body .web-tour-title { margin: 2px 0 4px; font-size: 16px; padding-left: 40px; }
html body .web-tour-body { font-size: 14px; line-height: 1.6; max-height: none; overflow: visible; }
html body .web-tour-short { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html body .web-tour-rest { display: none; white-space: pre-line; margin-top: 4px; max-height: 32vh; overflow-y: auto; }
html body .web-tour-expanded .web-tour-short { display: block; -webkit-line-clamp: unset; }
html body .web-tour-expanded .web-tour-rest { display: block; }
html body .web-tour-more {
    border: 0; background: none; padding: 2px 0; margin-top: 2px;
    color: #e8590c; font-weight: 900; font-size: 13px;
}
html body .web-tour-timer { margin-top: 8px; }
html body .web-tour-actions { margin-top: 8px; gap: 5px; }
html body .web-tour-actions button { padding: 8px 4px !important; font-size: 13px !important; border-radius: 10px !important; }
html body .web-tour-music iframe { height: 60px; margin-top: 6px; }

/* أثناء الجولة: الصفحات الكاملة تنتهي فوق البطاقة فلا تغطيها البطاقة */
body.web-tour-on .web-inapp-page { bottom: var(--web-tour-card-h, 190px) !important; }
body.web-tour-on .tree-selected-inline-panel.is-full {
    height: calc(100dvh - var(--web-tour-card-h, 190px) - 16px) !important;
    max-height: calc(100dvh - var(--web-tour-card-h, 190px) - 16px) !important;
}

/* الشرح كاملاً ظاهر دائماً (بدون «المزيد») */
html body .web-tour-more { display: none !important; }
html body .web-tour-short { display: block !important; -webkit-line-clamp: unset !important; overflow: visible !important; }
html body .web-tour-rest { display: block !important; max-height: 30vh; overflow-y: auto; }
html body .web-tour-rest:empty { display: none !important; }

/* بدون تظليل للشاشة: فقط إطار برتقالي حول الجزء المشروح */
html body .web-tour-spot {
    box-shadow: 0 0 0 3px rgba(255, 184, 77, .35), 0 0 18px rgba(232, 89, 12, .35) !important;
    border: 3px solid #ff9f1a !important;
    background: transparent !important;
}
html body .web-tour-center,
html body .web-tour { background: transparent !important; }


/* ---------- عدد المسجلين: الحمائل، والدائرة، والعدّ ---------- */
html body .web-clan-total {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #e7f3ee;
    color: #145c43;
    border: 1px solid #b9d8ca;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
}

html body .web-tour-spot.web-tour-spot-circle {
    border-radius: 999px !important;
    border-width: 3px !important;
    animation: webTourPulse 1.2s ease-in-out infinite;
}
@keyframes webTourPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255, 184, 77, .35), 0 0 14px rgba(232, 89, 12, .35); }
    50% { box-shadow: 0 0 0 7px rgba(255, 184, 77, .25), 0 0 24px rgba(232, 89, 12, .5); }
}

html body .web-tour-count {
    position: fixed;
    z-index: 8600;
    padding: 3px 10px;
    border: 3px solid #ff9f1a;
    border-radius: 999px;
    background: #fff;
    color: #3d4a44;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    direction: ltr;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 4px 12px rgba(232, 89, 12, .25);
    animation: webFakeIn .35s ease-out;
}
html body .web-tour-count s { color: #9aa5a0; }
html body .web-tour-count b { color: #e8590c; font-size: 14px; }
html body .web-tour-count-done { border-color: #1f7a5a; }
html body .web-tour-count-done b { color: #145c43; }
html body .web-tour-count-root { font-size: 15px; padding: 5px 14px; }
html body .web-tour-count-root b { font-size: 17px; }

html body .web-tour-fake-family {
    display: flex;
    gap: 6px;
    margin-inline-start: 8px;
    padding-inline-start: 8px;
    border-inline-start: 2px dashed #ffb84d;
    animation: webFakeIn .45s ease-out;
}
html body .web-tour-fake-family span {
    background: #fdecf3;
    color: #b23a6b;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 800;
}


/* ---------- تفاصيل الابن التجريبي في الجولة ---------- */
html body .web-tour-fake-details {
    position: fixed;
    z-index: 8550;
    right: 10px;
    width: min(330px, calc(100vw - 20px));
    padding: 10px 12px 12px;
    background: #fff;
    border: 2px dashed #ffb84d;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(21, 70, 55, .25);
    direction: rtl;
    font-family: inherit;
    animation: webFakeIn .35s ease-out;
}
html body .web-tour-fake-details .wtfd-head { font-weight: 900; color: #145c43; margin-bottom: 8px; font-size: 14px; }
html body .web-tour-fake-details .wtfd-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 13px; font-weight: 700; color: #3d4a44; }
html body .web-tour-fake-details .wtfd-row span { flex: 0 0 92px; }
html body .web-tour-fake-details .wtfd-row input {
    flex: 1; min-width: 0; height: 30px; padding: 0 8px;
    border: 1px solid #cfe0d8; border-radius: 8px; font: inherit; font-weight: 800; color: #243b33; background: #f8fbfa;
}
html body .web-tour-fake-details .wtfd-row input.wtfd-active { border-color: #ff9f1a; box-shadow: 0 0 0 3px rgba(255, 184, 77, .35); background: #fff; }
html body .web-tour-fake-details .wtfd-save {
    margin-top: 8px; width: 100%; height: 34px; border: 0; border-radius: 10px;
    background: #145c43; color: #fff; font: inherit; font-weight: 900;
}

/* ---------- البطاقة المختصرة أصغر حتى يظهر ما خلفها ---------- */
html body .web-popover-wide .web-stats-compact { gap: 4px; margin-top: 4px; }
html body .web-popover-wide .web-stats-compact .web-stat {
    flex-direction: row;
    gap: 4px;
    padding: 3px 4px;
    border-radius: 8px;
}
html body .web-popover-wide .web-stats-compact .web-stat-icon { font-size: 11px; }
html body .web-popover-wide .web-stats-compact .web-stat-value { font-size: 13px; }
html body .web-popover-wide .web-stats-compact .web-stat-label { font-size: 9.5px; }
html body .web-popover-wide:not(.is-full) { padding: 8px 10px 8px !important; }

/* الزوجة والبنات في سطر تحت الابن التجريبي */
html body .web-tour-fake-child { flex-wrap: wrap; max-width: calc(100vw - 20px); }
html body .web-tour-fake-child .web-tour-fake-name { white-space: nowrap; }
html body .web-tour-fake-family {
    flex: 1 1 100%;
    flex-wrap: wrap;
    margin: 4px 0 0 !important;
    padding: 4px 0 0 !important;
    border-inline-start: 0 !important;
    border-top: 2px dashed #ffb84d;
}
html body .web-tour-fake-family span { white-space: nowrap; }


/* عدد المسجلين بجانب كل عائلة */
html body .web-family-total {
    font-size: 10.5px;
    padding: 0 6px;
    background: #f1f8f4;
    border-color: #cfe6d9;
}

/* الاسم كاملاً في أعلى صفحة التفاصيل */
html body .tree-inline-full-name.web-full-lineage {
    margin: 6px 40px 10px !important;
    font-size: 19px !important;
}


/* ============================================================
   الجولة: الفهرس وأزرار الرأس (الفهرس + الإغلاق)
   ============================================================ */
html body .web-tour-head {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

html body .web-tour-head .web-tour-close {
    position: static !important;
}

html body .web-tour-index-btn {
    height: 32px;
    padding: 0 10px;
    border: 1px solid #b9d8ca;
    border-radius: 999px;
    background: #e7f3ee;
    color: #145c43;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}


/* لوحة الفهرس تغطي الشاشة */
html body .web-tour-index {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5;
    background: rgba(0, 0, 0, .55);
    padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
    overflow-y: auto;
    direction: rtl;
}

html body .web-tour-index-on .web-tour-index { display: block; }
html body .web-tour-index-on .web-tour-card-box,
html body .web-tour-index-on .web-tour-spot { display: none !important; }

html body .web-tour-index > * {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

html body .web-tour-index-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 12px 14px 6px;
}

html body .web-tour-index-title { font-size: 17px; font-weight: 900; color: #145c43; }
html body .web-tour-index-close { position: static !important; width: 32px; height: 32px; min-width: 32px; line-height: 32px; }

html body .web-tour-index-hint {
    background: #fff;
    padding: 0 14px 8px;
    font-size: 13px;
    color: #4d5f58;
    line-height: 1.6;
}

html body .web-tour-index-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    padding: 0 14px 12px;
}

html body .web-tour-index-actions button {
    flex: 1 1 160px;
    padding: 11px 10px;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 900;
}

html body .web-tour-index-auto { background: #145c43; color: #fff; }
html body .web-tour-index-resume { background: #fff4e6; color: #b35400; }

html body .web-tour-index-list {
    background: #fff;
    border-radius: 0 0 16px 16px;
    padding: 0 10px 12px;
}

html body .web-tour-index-sec {
    border: 1px solid #dfece6;
    border-radius: 12px;
    margin-top: 8px;
    overflow: hidden;
}

html body .web-tour-index-sec summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f4faf7;
    cursor: pointer;
    list-style: none;
}

html body .web-tour-index-sec summary::-webkit-details-marker { display: none; }
html body .web-tour-index-sec summary::after { content: '▾'; color: #1f7a5a; font-weight: 900; }
html body .web-tour-index-sec[open] summary::after { content: '▴'; }
html body .web-tour-index-secname { flex: 1; font-size: 15px; font-weight: 900; color: #145c43; }
html body .web-tour-index-count { font-size: 11.5px; color: #5d7a6e; font-weight: 700; }

html body .web-tour-index-sec ol {
    list-style: none;
    margin: 0;
    padding: 4px 6px 6px;
}

html body .web-tour-index-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 8px;
    border: 0;
    border-radius: 9px;
    background: none;
    text-align: right;
    font-size: 14px;
    color: #2b3d36;
}

html body .web-tour-index-item:hover { background: #eef6f2; }

html body .web-tour-index-item.is-current {
    background: #fff4e6;
    color: #b35400;
    font-weight: 900;
}

html body .web-tour-index-num {
    flex: 0 0 auto;
    min-width: 26px;
    height: 22px;
    line-height: 22px;
    border-radius: 999px;
    background: #e7f3ee;
    color: #145c43;
    font-size: 11.5px;
    font-weight: 900;
    text-align: center;
}


/* عنوان الخطوة بجانب الخط البرتقالي */
html body .web-tour-progrow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 132px;
    margin: 0 0 4px;
    min-height: 32px;
}

html body .web-tour-progrow .web-tour-title {
    flex: 0 1 auto;
    max-width: 62%;
    margin: 0 !important;
    padding-left: 0 !important;
    font-size: 15px !important;
    font-weight: 900;
    color: #145c43;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html body .web-tour-progrow .web-tour-progress {
    flex: 1 1 auto;
    margin: 0 !important;
    padding-left: 0 !important;
}


/* الجولة متوقفة مؤقتاً أثناء عرض صندوق التفاصيل */
html body .web-tour-paused { display: none !important; }
html body .web-tour-pause-hint {
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 9500;
    max-width: calc(100vw - 24px);
    padding: 9px 16px;
    border-radius: 999px;
    background: #145c43;
    color: #fff;
    font-size: 13.5px;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
    pointer-events: none;
    text-align: center;
}

/* ============================================================
   دليل الرموز (مثل مفتاح الخريطة) في أعلى الشجرة
   ============================================================ */
html body .tree-legend {
    margin: 0 0 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #d7e8df;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    direction: rtl;
}

html body .tree-legend summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    color: #145c43;
    list-style: none;
}

html body .tree-legend summary::-webkit-details-marker { display: none; }
html body .tree-legend summary::after { content: ' ▾'; color: #1f7a5a; }
html body .tree-legend[open] summary::after { content: ' ▴'; }

html body .tree-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 6px 10px;
    margin-top: 8px;
    font-size: 13px;
    color: #2b3d36;
}

html body .tree-legend-grid span {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

html body .lg-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    border-radius: 7px;
    border: 1px solid #cfe1d8;
    background: #f4faf7;
    color: #23815f;
    font-size: 14px;
    font-weight: 900;
}

html body .lg-toggle { border-color: #b9d8ca; background: #fff; }
html body .lg-del { border-color: #f0c9c9; background: #fff6f6; }
html body .lg-total { background: #e7f3ee; }
html body .lg-male { background: #eaf1fb; color: #24538f; border-color: #c6d7ef; }
html body .lg-female { background: #fbeef4; color: #9a2f63; border-color: #efcadb; }

html body .tree-legend-note {
    margin-top: 8px;
    font-size: 12px;
    color: #5d7a6e;
    line-height: 1.6;
}

/* شريط شجرة الشخص */
html body .tree-subtree-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 10px;
    padding: 10px 12px;
    background: #145c43;
    color: #fff;
    border-radius: 14px;
    direction: rtl;
}

html body .tree-subtree-title { font-size: 15px; font-weight: 900; }

html body .tree-subtree-close {
    border: 0;
    border-radius: 999px;
    padding: 7px 14px;
    background: #fff;
    color: #145c43;
    font-weight: 900;
    font-size: 13px;
}

/* ============================================================
   دليل الرموز إلى جانب الشجرة
   ============================================================ */
html body .tree-with-legend {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

html body .tree-col {
    flex: 1 1 auto;
    min-width: 0;
}

html body .tree-legend-col {
    flex: 0 0 175px;
    position: sticky;
    top: 70px;
    background: #fff;
    border: 1px solid #d7e8df;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    padding: 8px 10px 10px;
    direction: rtl;
    z-index: 5;
}

html body .tree-legend-head {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    border: 0;
    background: none;
    padding: 2px 0 6px;
    font-size: 14px;
    font-weight: 900;
    color: #145c43;
    text-align: right;
    cursor: default;
}

html body .tree-legend-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #2b3d36;
}

html body .tree-legend-list span {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

/* الموبايل: الدليل زر صغير على جانب الشاشة يُفتح بالضغط */
@media (max-width: 760px) {
    html body .tree-legend-col {
        position: fixed;
        left: 0;
        top: 45%;
        flex: none;
        padding: 6px 8px;
        border-radius: 0 12px 12px 0;
        border-left: 0;
        z-index: 60;
        box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
    }

    html body .tree-legend-head { cursor: pointer; padding: 2px 0; font-size: 18px; }
    html body .tree-legend-head-text { display: none; }
    html body .tree-legend-body { display: none; }

    html body .tree-legend-col.is-open { width: 190px; padding: 8px 10px 10px; }
    html body .tree-legend-col.is-open .tree-legend-head { font-size: 14px; padding-bottom: 6px; }
    html body .tree-legend-col.is-open .tree-legend-head-text { display: inline; }
    html body .tree-legend-col.is-open .tree-legend-body { display: block; }
}

/* ============================================================
   الصندوق المختصر: صغير، إلى جانب الأبناء
   ============================================================ */
html body .tree-selected-inline-panel.web-popover-compact:not(.is-full) {
    padding: 6px 8px 8px !important;
    border-radius: 14px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: 70vh !important;
}

html body .web-popover-compact .web-drag-handle {
    padding: 2px 0 !important;
    min-height: 0 !important;
    font-size: 11px !important;
}

html body .web-popover-compact .web-popover-close {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    line-height: 26px !important;
    font-size: 13px !important;
    top: 4px !important;
    left: 4px !important;
}

html body .web-popover-compact .tree-selected-person-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 2px 0 4px !important;
    padding: 0 !important;
}

html body .web-popover-compact .tree-selected-person-photo {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
}

html body .web-popover-compact .tree-selected-person-content {
    min-width: 0 !important;
    gap: 1px !important;
}

html body .web-popover-compact .tree-selected-name-button {
    font-size: 14px !important;
    padding: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

html body .web-popover-compact .tree-selected-person-line {
    font-size: 11.5px !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

html body .web-popover-compact .web-details-btn {
    padding: 3px 12px !important;
    font-size: 12px !important;
    margin-top: 3px !important;
    min-height: 0 !important;
    box-shadow: none !important;
}

html body .web-popover-compact .tree-password-only-box {
    padding: 4px !important;
    margin: 4px 0 !important;
    gap: 4px !important;
}

html body .web-popover-compact .tree-mini-password {
    height: 28px !important;
    font-size: 12px !important;
    min-width: 0 !important;
}

html body .web-popover-compact .tree-mini-unlock-button {
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
}

/* الإحصائية في سطر واحد صغير: 👥 ♂ ♀ ● بدون الكلمات */
html body .web-popover-compact .web-stats {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    margin-top: 4px !important;
}

html body .web-popover-compact .web-stats .web-stat {
    flex: 1 1 0 !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 2px 4px !important;
    min-height: 0 !important;
    border-radius: 999px !important;
}

html body .web-popover-compact .web-stats .web-stat-label { display: none !important; }
html body .web-popover-compact .web-stats .web-stat-value { font-size: 12.5px !important; }
html body .web-popover-compact .web-stats .web-stat-icon { font-size: 11px !important; }

html body .web-popover-compact .tree-inline-actions { margin: 4px 0 !important; }

/* ============================================================
   الصندوق المختصر مرتّباً: المعلومات يميناً والإحصائيات عمودياً يساراً،
   والصندوق ينتهي عند زر «فتح» الأخضر.
   ============================================================ */
html body .tree-selected-inline-panel.web-popover-compact:not(.is-full) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 54px !important;
    column-gap: 8px !important;
    row-gap: 4px !important;
    align-items: start !important;
    width: min(240px, calc(100vw - 16px)) !important;
}

html body .web-popover-compact:not(.is-full) > .web-drag-handle {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
}

html body .web-popover-compact:not(.is-full) > .tree-selected-person-card {
    grid-column: 1 !important;
    grid-row: 2 !important;
    margin: 0 !important;
}

/* محتوى الأسفل يصير جزءاً من نفس الشبكة */
html body .web-popover-compact:not(.is-full) > .tree-selected-inline-bottom {
    display: contents !important;
}

html body .web-popover-compact:not(.is-full) > .tree-selected-inline-bottom > * {
    grid-column: 1 !important;
}

/* الإحصائيات: عمود صغير على اليسار بجانب المعلومات وكلمة السر */
html body .web-popover-compact:not(.is-full) > .tree-selected-inline-bottom > .web-stats {
    grid-column: 2 !important;
    grid-row: 2 / span 3 !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 3px !important;
    margin: 0 !important;
    width: 54px !important;
}

html body .web-popover-compact:not(.is-full) .web-stats .web-stat {
    flex: 0 0 auto !important;
    justify-content: flex-start !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
}

html body .web-popover-compact:not(.is-full) .tree-selected-person-photo {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
}

html body .web-popover-compact:not(.is-full) .tree-password-only-box {
    margin: 2px 0 0 !important;
    padding: 3px !important;
}

html body .web-popover-compact:not(.is-full) .tree-mini-password { width: 100% !important; }

/* الصندوق المختصر: الصورة قريبة من الشريط الأخضر، والتعريف بمحاذاتها */
html body .web-popover-compact:not(.is-full) > .web-drag-handle {
    padding: 0 !important;
    margin: -2px 0 0 !important;
    height: 18px !important;
    line-height: 18px !important;
}

html body .web-popover-compact:not(.is-full) > .tree-selected-person-card {
    align-items: flex-start !important;
    gap: 8px !important;
}

html body .web-popover-compact:not(.is-full) .tree-selected-person-photo {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
}

html body .web-popover-compact:not(.is-full) .tree-selected-person-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1px !important;
    padding-top: 1px !important;
}

html body .web-popover-compact:not(.is-full) .tree-selected-name-button {
    font-size: 13.5px !important;
    font-weight: 900 !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    text-align: right !important;
}

html body .web-popover-compact:not(.is-full) .tree-selected-person-line {
    font-size: 11.5px !important;
    color: #4d5f58 !important;
    white-space: normal !important;
    line-height: 1.35 !important;
}

/* «تفاصيل...» تحت الصورة والتعريف، أكبر قليلاً، بعرض العمود */
html body .web-popover-compact:not(.is-full) > .tree-compact-details {
    grid-column: 1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    margin: 2px 0 0 !important;
    padding: 5px 10px !important;
    font-size: 13px !important;
    border-radius: 9px !important;
}

/* كلمة السر وما بعدها تحت «تفاصيل» في نفس العمود */
html body .web-popover-compact:not(.is-full) > .tree-selected-inline-bottom > .tree-password-only-box,
html body .web-popover-compact:not(.is-full) > .tree-selected-inline-bottom > .tree-inline-actions {
    grid-row: 4 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* الإحصائيات: عمود مرتب بمحاذاة الصورة حتى «فتح» */
html body .web-popover-compact:not(.is-full) > .tree-selected-inline-bottom > .web-stats {
    grid-row: 2 / span 3 !important;
    align-self: stretch !important;
    justify-content: space-between !important;
}

html body .web-popover-compact:not(.is-full) .web-stats .web-stat {
    height: 22px !important;
    align-items: center !important;
}

/* ============================================================
   الصندوق المختصر بأصغر حجم: ثلاثة أسطر متوازية، والإحصائيات عمود بجانبها
   ============================================================ */
html body .tree-selected-inline-panel.web-popover-compact:not(.is-full) {
    width: min(220px, calc(100vw - 16px)) !important;
    grid-template-columns: minmax(0, 1fr) 50px !important;
    column-gap: 6px !important;
    row-gap: 4px !important;
    padding: 4px 7px 7px !important;
}

/* السطر 2: «تفاصيل...» و🌳 جنباً إلى جنب */
html body .web-popover-compact:not(.is-full) > .tree-compact-actions {
    grid-column: 1 !important;
    grid-row: 3 !important;
    display: flex !important;
    gap: 4px !important;
    align-items: stretch !important;
    height: 26px !important;
}

html body .web-popover-compact:not(.is-full) > .tree-compact-actions > .tree-compact-details {
    flex: 1 1 auto !important;
    width: auto !important;
    height: 26px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    font-size: 12.5px !important;
    line-height: 26px !important;
}

html body .tree-compact-tree {
    flex: 0 0 30px !important;
    width: 30px !important;
    height: 26px !important;
    padding: 0 !important;
    border: 1px solid #b9d8ca !important;
    border-radius: 8px !important;
    background: #eaf6ef !important;
    font-size: 16px !important;
    line-height: 24px !important;
    cursor: pointer !important;
}

/* السطر 3: كلمة السر + 👁 + فتح بنفس الارتفاع */
html body .web-popover-compact:not(.is-full) > .tree-selected-inline-bottom > .tree-password-only-box {
    display: flex !important;
    align-items: stretch !important;
    gap: 3px !important;
    height: 26px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

html body .web-popover-compact:not(.is-full) .tree-password-only-box .tree-mini-password {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    height: 26px !important;
    padding: 0 6px !important;
    font-size: 12px !important;
}

html body .web-popover-compact:not(.is-full) .tree-password-only-box .tree-mini-unlock-button {
    flex: 0 0 auto !important;
    height: 26px !important;
    padding: 0 8px !important;
    font-size: 12px !important;
    line-height: 26px !important;
}

html body .tree-pwd-eye {
    flex: 0 0 26px !important;
    width: 26px !important;
    min-width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    border: 1px solid #cfe1d8 !important;
    border-radius: 7px !important;
    background: #f4faf7 !important;
    font-size: 13px !important;
    line-height: 24px !important;
    cursor: pointer !important;
}

/* العمود الأيسر: أربعة أسطر متساوية تبدأ مع الصورة وتنتهي مع «فتح» */
html body .web-popover-compact:not(.is-full) > .tree-selected-inline-bottom > .web-stats {
    width: 50px !important;
    gap: 4px !important;
    justify-content: space-between !important;
}

html body .web-popover-compact:not(.is-full) .web-stats .web-stat {
    height: 21px !important;
    padding: 0 5px !important;
}

html body .web-popover-compact:not(.is-full) .tree-selected-person-photo {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
}

/* في التفاصيل الكاملة: 👁 بجانب خانة كلمة السر */
html body .tree-inline-full-password { display: flex !important; gap: 4px !important; align-items: center !important; }

/* ============================================================
   فقاعة الذِّكر (تظهر وتختفي وحدها)
   ============================================================ */
html body .web-dhikr {
    position: fixed;
    left: 14px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 8800;
    max-width: min(240px, calc(100vw - 40px));
    padding: 10px 16px;
    background: #fff;
    color: #145c43;
    border: 2px solid #1f7a5a;
    border-radius: 22px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(14px) scale(.9);
    pointer-events: none;
    transition: opacity .45s ease, transform .45s ease;
}

/* ذيل الفقاعة مثل فقاعة الكلام */
html body .web-dhikr::after {
    content: '';
    position: absolute;
    left: 22px;
    bottom: -10px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-right: 2px solid #1f7a5a;
    border-bottom: 2px solid #1f7a5a;
    transform: rotate(45deg);
    border-bottom-right-radius: 4px;
}

html body .web-dhikr.is-on {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* أثناء الجولة: الفقاعة في الأعلى حتى لا تغطي لوحة الشرح */
html body .web-dhikr.web-dhikr-top {
    top: calc(70px + env(safe-area-inset-top));
    bottom: auto;
}

html body .web-dhikr.web-dhikr-top::after {
    top: -10px;
    bottom: auto;
    transform: rotate(225deg);
}

/* زر «شجرة فلان» في الصندوق المختصر */
html body .web-popover-compact:not(.is-full) > .tree-compact-actions > .tree-compact-details,
html body .web-popover-compact:not(.is-full) > .tree-compact-actions > .tree-compact-tree {
    flex: 1 1 50% !important;
    width: auto !important;
    min-width: 0 !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 0 4px !important;
}

html body .web-popover-compact:not(.is-full) .tree-compact-tree {
    color: #145c43 !important;
    font-weight: 900 !important;
    line-height: 24px !important;
}

/* اختيار وقت ظهور الذِّكر تحت دليل الرموز */
html body .tree-dhikr-box {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #cfe1d8;
}

html body .tree-dhikr-title {
    font-size: 13.5px;
    font-weight: 900;
    color: #145c43;
    margin-bottom: 6px;
}

html body .tree-dhikr-opts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

html body .web-dhikr-opt {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #cfe1d8;
    border-radius: 8px;
    background: #f4faf7;
    color: #2b3d36;
    font-size: 12.5px;
    font-weight: 700;
    text-align: right;
    cursor: pointer;
}

html body .web-dhikr-opt.is-active {
    background: #145c43;
    border-color: #145c43;
    color: #fff;
}

/* الفقاعة بجانب الجذر: الذيل يشير إلى «ديرأبان» (على اليمين) */
html body .web-dhikr.web-dhikr-root::after {
    left: auto;
    right: -10px;
    top: 50%;
    bottom: auto;
    margin-top: -8px;
    transform: rotate(-45deg);
    border-radius: 0 0 4px 0;
}

/* ============================================================
   مربع «ظهور الذِّكر»: ظاهر دائماً
   ============================================================ */
html body .tree-legend-col {
    max-height: calc(100vh - 90px);
    overflow-y: auto;
}

html body .tree-dhikr-box .tree-dhikr-title {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    border: 0;
    background: none;
    padding: 0;
    text-align: right;
    cursor: default;
}

@media (max-width: 760px) {
    /* على الموبايل: زر 📿 مستقل تحت زر الدليل 🗺️ */
    html body .tree-legend-col {
        max-height: none;
        overflow: visible;
    }

    html body .tree-legend-col:not(.is-open) .tree-dhikr-box {
        margin-top: 4px;
        padding-top: 4px;
    }

    html body .tree-dhikr-box .tree-dhikr-title { cursor: pointer; font-size: 18px; }
    html body .tree-dhikr-box:not(.is-open) .tree-dhikr-title-text { display: none; }
    html body .tree-dhikr-box:not(.is-open) .tree-dhikr-opts { display: none; }
    html body .tree-dhikr-box.is-open { width: 150px; }
    html body .tree-dhikr-box.is-open .tree-dhikr-title { font-size: 13.5px; margin-bottom: 6px; }
}

/* عنوان «دليل الرموز» و«الأذكار» تحته مباشرة */
html body .tree-legend-col > .tree-dhikr-box {
    margin: 2px 0 8px;
    padding: 0 0 8px;
    border-top: 0;
    border-bottom: 1px dashed #cfe1d8;
}

@media (max-width: 760px) {
    /* على الموبايل: العنوانان ظاهران بالكتابة، والضغط على كل منهما يفتحه */
    html body .tree-legend-col:not(.is-open) .tree-legend-head-text { display: inline !important; font-size: 12.5px; }
    html body .tree-legend-col:not(.is-open) .tree-legend-head { font-size: 15px; }
    html body .tree-dhikr-box:not(.is-open) .tree-dhikr-title-text { display: inline !important; font-size: 12.5px; }
    html body .tree-dhikr-box .tree-dhikr-title { font-size: 15px; }
    html body .tree-legend-col > .tree-dhikr-box { margin: 4px 0 0; padding: 4px 0 0; border-bottom: 0; border-top: 1px dashed #cfe1d8; }
}

/* ============================================================
   دليل الرموز والأذكار: أعلى الصفحة فوق صورة المعجم، أقصى اليسار
   ============================================================ */
html body .tree-topbar {
    display: flex;
    justify-content: flex-end;     /* في الصفحة العربية: أقصى اليسار */
    align-items: flex-start;
    gap: 6px;
    margin: 6px 0 6px;
    padding: 0 6px;
    position: relative;
    z-index: 50;
    direction: rtl;
}

html body .tree-tool { position: relative; }

html body .tree-tool-btn {
    padding: 6px 12px;
    border: 1px solid #b9d8ca;
    border-radius: 999px;
    background: #fff;
    color: #145c43;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
    cursor: pointer;
}

html body .tree-tool-btn.is-open {
    background: #145c43;
    border-color: #145c43;
    color: #fff;
}

html body .tree-tool-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 200px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #d7e8df;
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
    direction: rtl;
    z-index: 60;
}

html body .tree-dhikr-panel { width: 170px; }
html body .tree-dhikr-panel .tree-dhikr-title { font-size: 13.5px; font-weight: 900; color: #145c43; margin-bottom: 6px; }

/* ============================================================
   الخروج من الفرع
   ============================================================ */
html body .tree-lock-branch-btn {
    display: inline-block;
    margin: 4px 6px 0 0;
    padding: 3px 10px;
    border: 1px solid #e2b9b9;
    border-radius: 999px;
    background: #fff6f6;
    color: #a12a2a;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}
html body .tree-lock-branch-compact { display: block; margin: 6px auto 2px; }
html body .tree-tool-btn.tree-tool-lock { border-color: #e2b9b9; color: #a12a2a; background: #fff6f6; }

/* الرموز والأذكار في أقصى أعلى الصفحة: داخل الشريط الأخضر، أقصى اليسار */
html body .tree-topbar {
    position: absolute;
    top: 19px;
    left: 12px;
    margin: 0;
    padding: 0;
    z-index: 1500;
    justify-content: flex-start;
    direction: ltr;
}
html body .tree-topbar .tree-tool-btn {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .55);
    color: #fff;
    box-shadow: none;
}
html body .tree-topbar .tree-tool-btn.is-open { background: #fff; color: #145c43; border-color: #fff; }
html body .tree-topbar .tree-tool-btn.tree-tool-lock { background: #fff6f6; color: #a12a2a; border-color: #fff; }
html body .tree-topbar .tree-tool-panel { left: 0; right: auto; text-align: right; }
@media (max-width: 520px) {
    html body .tree-topbar { top: 20px; left: 8px; gap: 4px; }
    html body .tree-topbar .tree-tool-text { display: none; }
    html body .tree-topbar .tree-tool-btn { padding: 5px 9px; font-size: 15px; }
}

/* نطاق البحث: حمولة أو عائلة معلَّمة */
html body .tree-search-scope {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin: 6px 0 8px;
    padding: 6px 10px;
    background: #fff8e8;
    border: 1px solid #ecd3a0;
    border-radius: 12px;
    color: #6b4a12;
    font-size: 13px;
    font-weight: 700;
}
html body .tree-search-scope b { color: #145c43; }
html body .tree-search-scope-clear {
    padding: 2px 10px;
    border: 1px solid #d9b977;
    border-radius: 999px;
    background: #fff;
    color: #6b4a12;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

/* ============================================================
   المهنة بالضغط + الجنس (ذكر أزرق، أنثى زهري)
   ============================================================ */
html body .web-job-current {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #cfe2d8;
    border-radius: 10px;
    background: #fff;
    color: #163a2e;
    font-weight: 800;
    text-align: right;
    cursor: pointer;
}
html body .web-job-current.is-open { border-color: #145c43; box-shadow: 0 0 0 2px rgba(20, 92, 67, .15); }
html body .web-job-caret { color: #145c43; }
html body .web-job-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    margin: 2px 0 4px;
    background: #f3f8f5;
    border: 1px solid #d7e8df;
    border-radius: 12px;
    max-height: 220px;
    overflow-y: auto;
}
html body .web-job-details { background: #fbfdfc; margin-bottom: 6px; }
html body .web-job-chip {
    padding: 5px 11px;
    border: 1px solid #cfe2d8;
    border-radius: 999px;
    background: #fff;
    color: #163a2e;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
html body .web-job-chip.is-on { background: #145c43; border-color: #145c43; color: #fff; }
html body .web-job-clear { color: #a12a2a; border-color: #e2b9b9; }

html body .web-gender-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px 2px;
}
html body .web-gender-label { font-weight: 800; color: #5a7a6c; }
html body .web-gender {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #fff;
    font-weight: 800;
    cursor: pointer;
}
html body .web-gender-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid currentColor;
    box-sizing: border-box;
}
html body .web-gender-m { color: #1e6fd9; border: 2px solid #9cc2f2; }
html body .web-gender-f { color: #d6338a; border: 2px solid #f2a9cf; }
html body .web-gender-m.is-on { background: #e8f1fd; border-color: #1e6fd9; }
html body .web-gender-f.is-on { background: #fdebf4; border-color: #d6338a; }
html body .web-gender.is-on .web-gender-dot { background: currentColor; box-shadow: inset 0 0 0 3px #fff; }
html body .web-gender-msg { color: #a12a2a; font-size: 12.5px; font-weight: 700; }
html body .web-gender-text-m { color: #1e6fd9; font-weight: 800; }
html body .web-gender-text-f { color: #d6338a; font-weight: 800; }

/* روابط التصميم الجديد في شريط الشجرة */
html body a.tree-tool-btn { display: inline-block; text-decoration: none; }
