/* ==========================================================================
   Smart Check Pro 2.0 - Clinic Design System
   مطورة من قبل "وداعاً للألم" (تقنية الكايروبراكتيك)
   Theme: Medical Dark Elegance (Emerald & Gold)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&family=Cairo:wght@400;600;700;800&display=swap');

:root {
    --primary-gold: #d4af37;
    --primary-gold-dark: #997819;
    --primary-gold-light: #fef08a;
    --bg-dark-obsidian: #080c14;
    --bg-card: #111827;
    --bg-card-alt: #162032;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-emerald: #10b981;
    --accent-red: #ef4444;
    --accent-blue: #38bdf8;
    --border-gold-subtle: rgba(212, 175, 55, 0.3);
    --shadow-gold-glow: 0 8px 32px rgba(212, 175, 55, 0.15);
    --font-main: 'Almarai', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-dark-obsidian);
    color: var(--text-main);
    direction: rtl;
    min-height: 100vh;
    padding-bottom: 60px;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(212, 175, 55, 0.07) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.06) 0%, transparent 45%);
}

/* Header */
.app-header {
    background: rgba(11, 16, 27, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-gold-subtle);
    padding: calc(12px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 12px max(24px, env(safe-area-inset-left, 0px));
    position: sticky;
    top: 0;
    z-index: 999999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 25px rgba(0,0,0,0.6);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: max-content;
}

.clinic-logo-img {
    height: 52px;
    width: 52px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--primary-gold);
    background: #0a0e14;
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.45);
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.25em;
    font-weight: bold;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
}

.brand-subtitle {
    font-size: 0.8em;
    color: var(--primary-gold);
    letter-spacing: 0.5px;
    margin-top: 2px;
    white-space: nowrap;
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    flex: 1;
    margin: 0 auto;
    min-width: 0;
}

.btn-mobile-menu-toggle {
    display: none;
    background: #1e293b;
    border: 1.5px solid var(--primary-gold);
    color: var(--primary-gold);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.3em;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.btn-mobile-menu-toggle:active {
    background: var(--primary-gold);
    color: #080c14;
}

.mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999990;
    touch-action: manipulation;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 960px;
    margin: 0 auto;
}

/* شارة تمييز الخطة المجانية المضيئة */
.free-plan-highlight-badge {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(212, 175, 55, 0.2) 100%);
    border: 1.5px solid #10b981;
    color: #6ee7b7;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 8px;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

/* مؤشر السهم المتحرك لسحب شرائح التقييم */
.slider-drag-hint-animated {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 5px 14px;
    border-radius: 20px;
    color: #38bdf8;
    font-size: 0.82em;
    font-weight: bold;
    margin-bottom: 8px;
    animation: slideHintPulse 2s ease-in-out infinite;
}

.pulse-arrow-hand-left {
    display: inline-block;
    animation: arrowNudgeLeft 1.2s ease-in-out infinite alternate;
}

.pulse-arrow-hand-right {
    display: inline-block;
    animation: arrowNudgeRight 1.2s ease-in-out infinite alternate;
}

@keyframes slideHintPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(56, 189, 248, 0.2); }
    50% { box-shadow: 0 0 16px rgba(56, 189, 248, 0.5); background: rgba(56, 189, 248, 0.18); }
}

@keyframes arrowNudgeLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-6px); }
}

@keyframes arrowNudgeRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(6px); }
}

/* شارة إبراز الخطة المجانية في التقرير */
.free-plan-highlight-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(212, 175, 55, 0.22) 100%);
    border: 1.5px solid var(--primary-gold);
    color: #fef08a;
    padding: 7px 16px;
    border-radius: 22px;
    font-size: 0.88em;
    font-weight: 800;
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
    animation: freeBadgeGlow 2.5s ease-in-out infinite;
}

@keyframes freeBadgeGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.25); border-color: var(--primary-gold); }
    50% { box-shadow: 0 0 22px rgba(16, 185, 129, 0.55); border-color: #10b981; }
}

.btn-header {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.3;
}

.btn-header:hover {
    background: var(--primary-gold);
    color: #0a0e14;
    border-color: var(--primary-gold);
    transform: translateY(-1px);
}

.btn-whatsapp-cta,
.btn-header-emerald {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    border: 1px solid #34d399;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.btn-header-emerald:hover,
.btn-whatsapp-cta:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #6ee7b7;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.btn-header-emerald-soft {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid #10b981;
    color: #6ee7b7;
    font-weight: bold;
}

.btn-header-emerald-soft:hover {
    background: #10b981;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-header-gold {
    background: #1e293b;
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #fef08a;
}

.btn-header-gold:hover {
    background: var(--primary-gold);
    border-color: var(--primary-gold);
    color: #0a0e14;
    transform: translateY(-1px);
}

.btn-header-unified {
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid rgba(212, 175, 55, 0.4);
    transition: all 0.2s ease;
}

.btn-header-unified:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--primary-gold);
    color: #fef08a;
    transform: translateY(-1px);
}

.btn-header-whatsapp {
    background: #25d366 !important;
    color: #ffffff !important;
    border: 1px solid #1ebe5d !important;
    font-weight: bold !important;
    box-shadow: 0 0 10px rgba(37, 211, 102, 0.4) !important;
}

.btn-header-whatsapp:hover {
    background: #1ebe5d !important;
    transform: translateY(-1px);
}

.btn-header-call {
    background: #10b981 !important;
    color: #ffffff !important;
    border: 1px solid #059669 !important;
    font-weight: bold !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4) !important;
}

.btn-header-call:hover {
    background: #059669 !important;
    transform: translateY(-1px);
}

.btn-header-new-test {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    border: 1px solid #60a5fa !important;
    font-weight: 800 !important;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5) !important;
}

.btn-header-new-test:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%) !important;
    transform: translateY(-1px);
}

/* شريط المشاكل والتخصصات التي نعالجها */
.clinical-specialties-banner {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.specialties-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 10px;
}

.specialties-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.specialties-icon {
    font-size: 1.3em;
}

.specialties-title {
    color: var(--primary-gold);
    margin: 0;
    font-size: 1.08em;
    font-weight: 800;
}

.specialties-tag {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #6ee7b7;
    font-size: 0.78em;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 20px;
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.specialty-chip {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.specialty-chip:hover {
    border-color: var(--primary-gold);
    transform: translateY(-2px);
}

.chip-icon {
    font-size: 1.25em;
    flex-shrink: 0;
    margin-top: 1px;
}

.chip-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: right;
}

.chip-content strong {
    color: #ffffff;
    font-size: 0.88em;
    font-weight: 700;
}

.chip-content span {
    color: #94a3b8;
    font-size: 0.75em;
    line-height: 1.4;
}

/* التنسيق المتجاوب مع شاشات الهواتف والتابلت */
@media (max-width: 960px) {
    .app-header {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999999 !important;
        background: rgba(11, 16, 27, 0.98) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        padding-top: calc(14px + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: 12px !important;
        padding-left: max(14px, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(14px, env(safe-area-inset-right, 0px)) !important;
        min-height: calc(66px + env(safe-area-inset-top, 0px)) !important;
        box-sizing: border-box !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7) !important;
    }

    .brand-wrapper {
        gap: 10px;
    }

    .clinic-logo-img {
        height: 44px;
        width: 44px;
    }

    .brand-title {
        font-size: 1.05em !important;
        font-weight: 800 !important;
        white-space: nowrap;
        line-height: 1.25;
    }

    .brand-subtitle {
        font-size: 0.72em !important;
        line-height: 1.3;
        color: var(--primary-gold-light) !important;
    }

    .btn-mobile-menu-toggle {
        display: inline-flex !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        background: #1e293b !important;
        border: 2px solid #fef08a !important;
        color: #fef08a !important;
        box-shadow: 0 0 12px rgba(254, 240, 138, 0.35) !important;
        border-radius: 10px !important;
        font-size: 1.4em !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
        z-index: 1001 !important;
    }

    .btn-mobile-menu-toggle:active {
        background: var(--primary-gold) !important;
        color: #080c14 !important;
    }

    .header-right-group {
        position: static !important;
    }

    .btn-header-install {
        padding: 7px 11px !important;
        font-size: 0.82em !important;
        border-radius: 6px !important;
    }

    .header-actions {
        display: none;
        position: fixed !important;
        top: calc(76px + env(safe-area-inset-top, 0px)) !important;
        left: 12px !important;
        right: 12px !important;
        max-width: 440px;
        margin: 0 auto;
        background: linear-gradient(180deg, #111c33 0%, #0a101d 100%) !important;
        border: 2px solid var(--primary-gold) !important;
        border-radius: 16px;
        padding: 16px 12px;
        box-shadow: 0 20px 50px rgba(0,0,0,0.95), 0 0 25px rgba(212, 175, 55, 0.3) !important;
        z-index: 1000000 !important;
        max-height: calc(100vh - 90px - env(safe-area-inset-top, 0px));
        overflow-y: auto;
        pointer-events: auto !important;
    }

    .header-actions.open {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        animation: slideDownMenu 0.22s ease-out;
        pointer-events: auto !important;
    }

    .header-actions .btn-header {
        width: 100%;
        justify-content: center;
        padding: 11px 10px !important;
        font-size: 0.88em !important;
        font-weight: 700 !important;
        text-align: center;
        white-space: nowrap;
        background: #1e293b !important;
        color: #ffffff !important;
        border: 1.5px solid rgba(212, 175, 55, 0.5) !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
        cursor: pointer !important;
        pointer-events: auto !important;
    }

    .header-actions .btn-header:active {
        background: var(--primary-gold) !important;
        color: #080c14 !important;
    }

    .header-actions .btn-header-emerald,
    .header-actions .btn-whatsapp-cta {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
        color: #ffffff !important;
        border-color: #34d399 !important;
    }

    .header-actions .btn-span-full {
        grid-column: span 2;
    }

    .spinal-sim-svg {
        height: 170px !important;
        max-height: 180px !important;
    }

    .skeleton-column {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin-bottom: 8px !important;
    }

    .skeleton-viewport {
        position: relative !important;
        width: 100% !important;
        max-width: 210px !important;
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
        padding: 10px 8px !important;
        overflow: visible !important;
        display: block !important;
        margin: 0 auto !important;
    }

    .skeleton-container-layer {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
        margin: 0 auto !important;
    }

    .skeleton-container-layer[style*="display: none"],
    .skeleton-container-layer.is-hidden {
        display: none !important;
    }

    .skeleton-img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: unset !important;
        display: block !important;
        margin: 0 auto !important;
        object-fit: unset !important;
        pointer-events: none !important;
        user-select: none !important;
    }

    .anatomy-hotspot {
        width: 16px !important;
        height: 16px !important;
        border: 1.5px solid #ffffff !important;
        box-shadow: 0 0 6px rgba(239, 68, 68, 0.85) !important;
        animation: pulseHotspotMobile 2.2s infinite ease-in-out !important;
        will-change: transform;
    }

    .anatomy-hotspot.active {
        width: 18px !important;
        height: 18px !important;
        box-shadow: 0 0 14px #10b981 !important;
        animation: none !important;
        transform: translate(-50%, -50%) scale(1.2) !important;
    }

    @keyframes pulseHotspotMobile {
        0% { transform: translate(-50%, -50%) scale(1); }
        50% { transform: translate(-50%, -50%) scale(1.22); }
        100% { transform: translate(-50%, -50%) scale(1); }
    }

    .anatomy-card {
        display: flex !important;
        flex-direction: column !important;
        padding: 12px 8px !important;
        gap: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .anatomy-form-col {
        width: 100% !important;
        padding: 16px 12px !important;
        box-sizing: border-box !important;
        position: relative !important;
        clear: both !important;
    }

    .main-wrapper {
        padding: 0 8px !important;
    }

    /* أزرار الاتصال والتواصل على الموبايل - أحجام متناسقة ومريحة */
    .btn-header {
        padding: 10px 14px !important;
        font-size: 0.85em !important;
        border-radius: 8px !important;
    }

    /* تحويل جدول المقارنة على شاشات الموبايل إلى كروت أنيقة وواضحة جداً */
    .comparison-table, .comparison-table thead, .comparison-table tbody, .comparison-table th, .comparison-table td, .comparison-table tr {
        display: block;
    }

    .comparison-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .comparison-table tr {
        background: #111827 !important;
        border: 1.5px solid rgba(212, 175, 55, 0.3) !important;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 12px 14px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }

    .comparison-table td {
        border: none !important;
        padding: 6px 0 !important;
        position: relative;
        text-align: right !important;
        font-size: 0.88em;
    }

    .comparison-table td:nth-child(1) {
        color: var(--primary-gold);
        font-size: 0.98em;
        font-weight: 800;
        border-bottom: 1px solid rgba(212, 175, 55, 0.2) !important;
        padding-bottom: 8px !important;
        margin-bottom: 6px;
    }

    .comparison-table td:nth-child(2) {
        color: #10b981;
        font-weight: 700;
        padding: 6px 0;
    }

    .comparison-table td:nth-child(3) {
        color: #cbd5e1;
        font-size: 0.82em;
        line-height: 1.5;
        border-top: 1px dashed rgba(255,255,255,0.1) !important;
        padding-top: 8px !important;
        margin-top: 6px;
    }

    /* أزرار التواصل العائمة على الموبايل لتكون غير مزعجة للشاشة */
    #floating-quick-contact a {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.25em !important;
    }

    #floating-quick-contact {
        bottom: 14px !important;
        left: 14px !important;
        gap: 8px !important;
    }

    /* شريط المشاكل والتخصصات على الموبايل */
    .clinical-specialties-banner {
        padding: 12px 10px !important;
        margin-bottom: 14px !important;
        border-radius: 12px !important;
    }

    .specialties-title {
        font-size: 0.95em !important;
    }

    .specialties-tag {
        font-size: 0.72em !important;
        padding: 2px 8px !important;
    }

    .specialties-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    .specialty-chip {
        padding: 8px 8px !important;
        gap: 6px !important;
        border-radius: 8px !important;
    }

    .chip-icon {
        font-size: 1.1em !important;
    }

    .chip-content strong {
        font-size: 0.8em !important;
    }

    .chip-content span {
        font-size: 0.68em !important;
        line-height: 1.3 !important;
    }

    /* ضبط وتنسيق أزرار كرت الاستشارة الثلاثة بصف واحد متناسق داخل حواف الكرت تماماً على الموبايل */
    .promotional-hub-card {
        padding: 16px 10px !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .promotional-contact-actions {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 5px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-top: 12px !important;
        overflow: hidden !important;
    }

    .promotional-contact-actions a,
    .promotional-contact-actions .promotional-action-btn {
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 0.82em !important;
        font-weight: 800 !important;
        padding: 9px 2px !important;
        text-align: center !important;
        justify-content: center !important;
        border-radius: 8px !important;
        letter-spacing: 0 !important;
        white-space: nowrap !important;
        gap: 3px !important;
        overflow: hidden !important;
    }

    .promotional-phone-btn span {
        font-size: 0.95em !important;
        letter-spacing: 0 !important;
    }

    @media (max-width: 420px) {
        .promotional-contact-actions .hide-on-compact {
            display: none !important;
        }
        .promotional-contact-actions a,
        .promotional-contact-actions .promotional-action-btn {
            font-size: 0.76em !important;
            padding: 8px 1px !important;
        }
        .promotional-phone-btn span {
            font-size: 0.88em !important;
        }
    }
}

@keyframes slideDownMenu {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .stepper-container {
        padding: 0 4px;
        margin: 10px auto 6px auto;
    }

    .stepper-container::before {
        left: 16px;
        right: 16px;
        top: 14px;
    }

    .node-circle {
        width: 28px;
        height: 28px;
        font-size: 0.76em;
    }

    .node-label {
        font-size: 0.62em;
        text-align: center;
        max-width: 52px;
        line-height: 1.25;
        word-break: normal;
    }

    #completion-certificate-modal .modal-inner {
        padding: 12px 8px !important;
        margin: 6px !important;
        max-height: 94vh !important;
    }

    .certificate-printable {
        padding: 18px 10px !important;
    }

    #cert-patient-name {
        font-size: 1.35em !important;
    }
}

/* Stepper Indicator */
.stepper-container {
    max-width: 1000px;
    margin: 20px auto 15px auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.stepper-container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #1e293b;
    z-index: 1;
}

.stepper-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    cursor: default;
}

.node-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid #334155;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.node-label {
    font-size: 0.82em;
    color: #94a3b8;
    font-weight: 500;
}

.stepper-node.active .node-circle {
    border-color: var(--primary-gold);
    background: var(--primary-gold);
    color: #0a0e14;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.stepper-node.active .node-label {
    color: var(--primary-gold);
    font-weight: bold;
}

.stepper-node.completed .node-circle {
    border-color: var(--accent-emerald);
    background: var(--accent-emerald);
    color: #ffffff;
}

.stepper-node.completed .node-label {
    color: #6ee7b7;
}

.stepper-node.completed,
.stepper-node.active,
.stepper-node.unlocked {
    cursor: pointer !important;
}

.stepper-node.completed:hover .node-circle,
.stepper-node.unlocked:hover .node-circle {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.stepper-node.locked {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Expansive Full-Width Layout */
.main-wrapper {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Anatomy Section & Hotspots */
.anatomy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold-subtle);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-gold-glow);
    display: grid;
    grid-template-columns: 1.1fr 1.3fr;
    gap: 35px;
    align-items: center;
}

@media (max-width: 860px) {
    .anatomy-card {
        grid-template-columns: 1fr;
    }
}

.view-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    justify-content: center;
}

.btn-view-toggle {
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 9px 22px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.btn-view-toggle.active {
    background: var(--primary-gold);
    color: #0a0e14;
    border-color: var(--primary-gold);
}

.anatomy-form-col {
    padding: 30px;
}

.skeleton-viewport {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    background: #090e17;
    border-radius: 14px;
    padding: 15px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    min-height: 520px;
}

.skeleton-container-layer {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
}

.skeleton-container-layer[style*="display: none"],
.skeleton-container-layer.is-hidden {
    display: none !important;
}

.skeleton-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    pointer-events: none;
}

/* Vivid Red/Gold High-Visibility Hotspots */
.anatomy-hotspot {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, #ef4444 20%, #b91c1c 80%);
    border: 2px solid #ffffff;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8), 0 0 16px rgba(212, 175, 55, 0.5);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulseHotspot 2.2s infinite ease-in-out;
    will-change: transform;
}

.anatomy-hotspot:hover {
    transform: translate(-50%, -50%) scale(1.35);
    background: #f59e0b;
    box-shadow: 0 0 20px #f59e0b;
}

.anatomy-hotspot.active {
    background: radial-gradient(circle, #10b981 30%, #047857 100%);
    border-color: #ffffff;
    box-shadow: 0 0 22px #10b981;
    transform: translate(-50%, -50%) scale(1.3);
    animation: none;
}

@keyframes pulseHotspot {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* التمييز الفاخر لكرت خطة التعافي المجانية */
.recovery-plan-distinct-card {
    position: relative;
    background: radial-gradient(ellipse at top, #0f2723 0%, #0c1a2c 50%, #070c14 100%) !important;
    border: 2.5px solid #10b981 !important;
    border-radius: 18px !important;
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.3), 0 0 15px rgba(212, 175, 55, 0.25), 0 10px 40px rgba(0, 0, 0, 0.8) !important;
    transition: all 0.3s ease;
    overflow: hidden;
}

.recovery-plan-distinct-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #d4af37, #38bdf8, #10b981);
    background-size: 300% 100%;
    animation: gradientShimmer 4s infinite linear;
}

@keyframes gradientShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-plan-shimmer {
    position: relative;
    overflow: hidden;
    animation: pulseCtaGlow 2.5s infinite;
}

@keyframes pulseCtaGlow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5), 0 0 15px rgba(212, 175, 55, 0.4);
        transform: scale(1.015);
    }
}

/* =========================================================================
   الزر الملكي الاستثنائي ثلاثي الأبعاد لتفعيل الخطة المجانية (Royal 3D Plan Activation)
   ========================================================================= */
.btn-plan-royal-card {
    position: relative;
    width: 100%;
    max-width: 620px;
    background: linear-gradient(135deg, #064e3b 0%, #047857 35%, #0f172a 75%, #1e293b 100%);
    border: 2.5px solid #fef08a;
    border-radius: 20px;
    padding: 16px 22px;
    cursor: pointer;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 30px rgba(16, 185, 129, 0.45), 0 0 20px rgba(212, 175, 55, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: right;
    box-sizing: border-box;
}

.btn-plan-royal-card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: #ffffff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7), 0 0 40px rgba(16, 185, 129, 0.65), 0 0 30px rgba(254, 240, 138, 0.65);
}

.btn-plan-royal-card:active {
    transform: translateY(1px) scale(0.99);
}

.royal-card-halo {
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.45), rgba(16, 185, 129, 0.45), rgba(212, 175, 55, 0.45));
    background-size: 200% 100%;
    animation: royalHaloMove 3s linear infinite;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

@keyframes royalHaloMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.royal-card-shimmer {
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    animation: royalShimmerSweep 3.5s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
}

@keyframes royalShimmerSweep {
    0% { left: -120%; }
    35% { left: 140%; }
    100% { left: 140%; }
}

.royal-badge-pill {
    position: relative;
    z-index: 2;
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid #10b981;
    border-radius: 20px;
    padding: 5px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #a7f3d0;
    font-size: 0.84em;
    font-weight: 800;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.royal-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.royal-main-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.royal-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1.5px solid #6ee7b7;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.55);
    flex-shrink: 0;
}

.royal-icon-emoji {
    font-size: 1.7em;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.royal-text-col {
    flex: 1;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.royal-cta-headline {
    color: #ffffff;
    font-size: 1.22em;
    font-weight: 900;
    letter-spacing: 0.4px;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.royal-cta-subline {
    color: #cbd5e1;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.4;
}

.royal-arrow-box {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(254, 240, 138, 0.18);
    border: 1.5px solid #fef08a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(254, 240, 138, 0.35);
    transition: all 0.25s ease;
}

.btn-plan-royal-card:hover .royal-arrow-box {
    transform: translateX(-5px);
    background: #fef08a;
    box-shadow: 0 0 16px rgba(254, 240, 138, 0.7);
}

.btn-plan-royal-card:hover .royal-arrow-anim {
    filter: invert(1);
}

.royal-arrow-anim {
    font-size: 1.2em;
}

@media (max-width: 600px) {
    .btn-plan-royal-card {
        padding: 14px 14px;
        border-radius: 16px;
    }
    .royal-cta-headline {
        font-size: 1.05em;
    }
    .royal-cta-subline {
        font-size: 0.78em;
    }
    .royal-icon-box {
        width: 42px;
        height: 42px;
    }
    .royal-icon-emoji {
        font-size: 1.35em;
    }
    .royal-arrow-box {
        width: 34px;
        height: 34px;
    }
}

/* Modals */
.app-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 8, 15, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000000 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .app-modal {
        padding: 14px 10px !important;
        align-items: center;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.modal-inner {
    background: #111827;
    border: 1px solid var(--primary-gold);
    border-radius: 16px;
    max-width: 950px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
}

/* Matrix Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9em;
}

.comparison-table th, .comparison-table td {
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    text-align: right;
}

.comparison-table th {
    background: #1e293b;
    color: var(--primary-gold);
    font-weight: bold;
}

.comparison-table tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.4);
}

/* Print Optimization */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        padding: 0;
    }

    .app-header, .stepper-container, .btn-header, .no-print, .btn-exercise-timer, .timer-progress-fill {
        display: none !important;
    }

    .main-wrapper {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .clinical-report-printable {
        border: 2px solid #000000 !important;
        box-shadow: none !important;
        background: #ffffff !important;
        color: #000000 !important;
        padding: 20px !important;
    }

    .clinical-exercise-card {
        page-break-inside: avoid;
        border: 1px solid #999999 !important;
        background: #fafafa !important;
        color: #000000 !important;
    }

    .clinical-exercise-card * {
        color: #000000 !important;
    }

    .certificate-printable {
        page-break-inside: avoid;
        border: 3px double #b8860b !important;
        background: #ffffff !important;
        color: #000000 !important;
        padding: 30px !important;
        box-shadow: none !important;
    }

    .certificate-printable * {
        color: #000000 !important;
    }

    .doctor-summary-printable {
        page-break-inside: avoid;
        border: 2px solid #333333 !important;
        background: #ffffff !important;
        color: #000000 !important;
        padding: 20px !important;
        box-shadow: none !important;
    }

    .doctor-summary-printable * {
        color: #000000 !important;
    }

    .app-modal {
        position: static !important;
        background: none !important;
        padding: 0 !important;
    }

    .app-modal .modal-inner {
        max-width: 100% !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: none !important;
    }
}

/* ==========================================================================
   وسام الريادة العالمية المستقل والفاخر (Royal World-First Innovation Medal)
   ========================================================================== */
.world-first-prestige-showcase {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(8, 12, 20, 0.98) 50%, rgba(6, 78, 59, 0.35) 100%);
    border: 1.5px solid rgba(212, 175, 55, 0.45);
    border-radius: 18px;
    padding: 18px 26px;
    margin-bottom: 22px;
    gap: 26px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(254, 240, 138, 0.25), 0 0 25px rgba(212, 175, 55, 0.15);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.world-first-prestige-showcase::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(212, 175, 55, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.world-first-prestige-showcase:hover {
    border-color: rgba(212, 175, 55, 0.75);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 32px rgba(212, 175, 55, 0.25);
}

.prestige-medal-col {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.royal-3d-medal-badge {
    position: relative;
    width: 145px;
    height: 165px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 800px;
    animation: royalMedalFloat 4.2s ease-in-out infinite;
    cursor: default;
    user-select: none;
}

.royal-medal-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.7));
}

/* طبقة النصوص المحفورة داخل الوسام المعروضة بتقنية HTML الأصلية لمنع تقطيع الحروف العربية على الموبايل نهائياً */
.medal-center-text-overlay {
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 72px;
    max-width: 72px;
    pointer-events: none;
    direction: rtl;
    line-height: 1.15;
    z-index: 3;
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
}

.medal-line-1 {
    color: #ffffff;
    font-size: 0.96em;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.95), 0 0 8px rgba(254, 240, 138, 0.35);
    letter-spacing: 0 !important;
}

.medal-line-2 {
    color: #fef08a;
    font-size: 0.86em;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.95);
    letter-spacing: 0 !important;
}

.medal-line-3 {
    color: #6ee7b7;
    font-size: 0.74em;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.95);
    letter-spacing: 0 !important;
}

@keyframes royalMedalFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-6px) rotate(1.5deg);
    }
}

.prestige-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: right;
}

.prestige-top-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 7px;
    background: rgba(212, 175, 55, 0.16);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #fef08a;
    font-size: 0.82em;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.prestige-sparkle {
    font-size: 1.1em;
    animation: sparkleSpin 3s ease-in-out infinite alternate;
}

@keyframes sparkleSpin {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.25) rotate(15deg); }
}

.prestige-heading {
    color: #ffffff;
    font-size: 1.38em;
    font-weight: 900;
    margin: 0 0 8px 0;
    line-height: 1.35;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.gold-text-gradient {
    background: linear-gradient(135deg, #fff59d 0%, #fef08a 40%, #d4af37 80%, #eab308 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 6px rgba(212, 175, 55, 0.4));
    font-weight: 900;
}

.prestige-desc {
    color: #cbd5e1;
    font-size: 0.93em;
    line-height: 1.68;
    margin: 0 0 14px 0;
}

.prestige-highlights-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.prestige-highlight-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 0.84em;
    color: #f1f5f9;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.prestige-highlight-item:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--primary-gold);
}

.highlight-icon {
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .world-first-prestige-showcase {
        flex-direction: column;
        text-align: center;
        padding: 18px 14px;
        gap: 16px;
    }
    .prestige-info-col {
        text-align: center;
        align-items: center;
    }
    .prestige-top-badge {
        align-self: center;
        font-size: 0.78em;
    }
    .royal-3d-medal-badge {
        width: 125px;
        height: 145px;
    }
    .medal-center-text-overlay {
        top: 46%;
        width: 62px;
        max-width: 62px;
        line-height: 1.12;
    }
    .medal-line-1 {
        font-size: 0.82em;
    }
    .medal-line-2 {
        font-size: 0.74em;
    }
    .medal-line-3 {
        font-size: 0.64em;
    }
    .prestige-heading {
        font-size: 1.22em;
    }
    .prestige-desc {
        font-size: 0.88em;
    }
    .prestige-highlights-row {
        justify-content: center;
    }
    .prestige-highlight-item {
        font-size: 0.78em;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .royal-3d-medal-badge {
        width: 120px;
        height: 140px;
    }
    .medal-center-text-overlay {
        top: 46%;
        width: 58px;
        max-width: 58px;
        line-height: 1.1;
    }
    .medal-line-1 {
        font-size: 0.78em;
    }
    .medal-line-2 {
        font-size: 0.70em;
    }
    .medal-line-3 {
        font-size: 0.60em;
    }
}

/* ==========================================================================
   صندوق الهدية التفاعلي ثلاثي الأبعاد المتحرك دورياً مع خروج العبارة (Animated Looping Gift Box)
   ========================================================================== */
.animated-gift-container {
    display: inline-flex;
    position: relative;
    width: 115px;
    height: 115px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    perspective: 700px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.25s ease;
}

.animated-gift-container:hover {
    transform: scale(1.06);
}

.animated-gift-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* غطاء صندوق الهدية الذي يفتح ويغلق بشكل دوري سلس */
.gift-lid-group {
    transform-origin: 35px 75px;
    animation: loopOpenGiftLid 4.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* العنصر الصاعد المبهج (هدية مجانية) والشرارات المتوهجة التي تنبعث عند انفتاح الصندوق */
.gift-emerging-content {
    animation: emergeGiftBadgeText 4.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transform-origin: 80px 50px;
}

/* حركة نبض جسم الصندوق لتجسيد الحركة الحيوية */
.gift-box-base {
    animation: giftBasePulse 4.8s ease-in-out infinite;
    transform-origin: 80px 115px;
}

@keyframes loopOpenGiftLid {
    0%, 15% {
        transform: translateY(0) rotate(0deg);
    }
    23%, 58% {
        /* يفتح الغطاء لأعلى وللجانب كاشفاً النور والهدية */
        transform: translateY(-28px) translateX(-14px) rotate(-38deg);
    }
    68%, 100% {
        /* يعود للإغلاق بهدوء وسلاسة */
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes emergeGiftBadgeText {
    0%, 16% {
        opacity: 0;
        transform: translateY(45px) scale(0.3);
    }
    24% {
        opacity: 0.9;
        transform: translateY(-22px) scale(1.05);
    }
    32%, 52% {
        opacity: 1;
        transform: translateY(-30px) scale(1.15);
        filter: drop-shadow(0 0 16px rgba(254, 240, 138, 0.85));
    }
    59% {
        opacity: 0.85;
        transform: translateY(-12px) scale(0.95);
    }
    66%, 100% {
        opacity: 0;
        transform: translateY(45px) scale(0.3);
    }
}

@keyframes giftBasePulse {
    0%, 15% { transform: scale(1); }
    23% { transform: scale(1.05, 0.96); }
    29% { transform: scale(0.98, 1.03); }
    35%, 58% { transform: scale(1.02); }
    68%, 100% { transform: scale(1); }
}

@media (max-width: 600px) {
    .animated-gift-container {
        width: 95px;
        height: 95px;
    }
}

/* ================= Doctor Welcome Presentation Card & International Care ================= */
.doctor-welcome-presentation-card {
    animation: fadeInWelcomeCard 0.4s ease-out;
    border: 1.5px solid rgba(212, 175, 55, 0.45);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 50%, rgba(212, 175, 55, 0.15) 100%);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes fadeInWelcomeCard {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.international-patients-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.international-patients-card:hover {
    box-shadow: 0 12px 40px rgba(2, 132, 199, 0.25);
}

/* ================= Live Floating Clinical Audio Pill ================= */
.ai-live-audio-pill {
    animation: slideUpLivePill 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
}

@keyframes slideUpLivePill {
    from {
        opacity: 0;
        transform: translate(-50%, 25px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

@keyframes liveSoundWave {
    0% {
        height: 4px;
        opacity: 0.5;
    }
    50% {
        height: 16px;
        opacity: 1;
    }
    100% {
        height: 7px;
        opacity: 0.8;
    }
}

/* ================= Mobile Viewport Optimization & Typography Stabilization ================= */
@media (max-width: 768px) {
    /* منع التكبير والانزياح الأفقي على هواتف الآيفون والأندرويد عند الكتابة داخل الشات والحقول */
    input, textarea, select {
        font-size: 16px !important;
    }

    html, body {
        overflow-x: clip !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    .container, .main-container, .wrapper, .chat-container, .step-card {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* تحجيم العناوين الكبيرة على شاشات الهواتف حتى لا تستحوذ على مساحة رأسية هائلة */
    h1 {
        font-size: clamp(1.25rem, 5vw, 1.55rem) !important;
        line-height: 1.35 !important;
    }

    h2 {
        font-size: clamp(1.1rem, 4.2vw, 1.3rem) !important;
        line-height: 1.35 !important;
    }

    h3 {
        font-size: clamp(0.98rem, 3.8vw, 1.15rem) !important;
        line-height: 1.35 !important;
    }

    /* تحسين انسيابية بطاقة الخطة الشاملة على الهواتف */
    #recovery-plan-master-card {
        padding: 14px 12px !important;
        margin-top: 15px !important;
    }

    /* إخفاء زر محرر النصوص العائم على شاشات الهواتف لمنع تغطية المحتوى والأزرار والتقارير */
    #btn-open-text-editor {
        display: none !important;
    }

    /* محاذاة طبيعية مريحة للنصوص السريرية تمنع أي تباعد أو تمزق للكلمات على شاشات الهواتف */
    .clinical-report-printable,
    #ai-clinical-insight-card,
    #ai-insight-content-area,
    .ai-insight-formatted-content,
    .ai-report-paragraph,
    .clinical-report-printable p,
    #patient-recovery-dashboard p,
    .ai-clinical-card p,
    .chat-message p {
        text-align: right !important;
        text-justify: none !important;
        text-align-last: right !important;
        direction: rtl !important;
        word-spacing: normal !important;
        letter-spacing: normal !important;
        line-height: 1.75 !important;
    }

    .clinical-report-printable h1,
    .clinical-report-printable h2,
    .clinical-report-printable h3,
    .clinical-report-printable h4,
    #patient-recovery-dashboard h2,
    #patient-recovery-dashboard h3,
    #patient-recovery-dashboard h4 {
        text-align: right !important;
        text-align-last: right !important;
        direction: rtl !important;
        word-spacing: normal !important;
        letter-spacing: normal !important;
    }

    /* مسافة أمان سفلية لحماية التقرير من تغطية أزرار الواتساب والاتصال العائمة */
    .clinical-report-printable,
    #patient-recovery-dashboard {
        padding-bottom: 95px !important;
    }

    /* تنسيق شبكي لأزرار الترويسات والتقارير لتكون بجانب بعض دوماً على الهواتف */
    .report-header-buttons,
    .ai-card-header-actions,
    .session-top-badges,
    .completion-action-grid,
    .stories-action-buttons {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .report-header-buttons button,
    .ai-card-header-actions button,
    .ai-card-header-actions span,
    .session-top-badges button,
    .completion-action-grid button,
    .completion-action-grid a,
    .stories-action-buttons a {
        width: 100% !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 8px 4px !important;
        font-size: 0.78em !important;
        box-sizing: border-box !important;
    }

    .session-top-badges div {
        width: 100% !important;
        min-width: 0 !important;
        white-space: normal !important;
        line-height: 1.35 !important;
        word-break: break-word !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 6px 6px !important;
        font-size: 0.76em !important;
        box-sizing: border-box !important;
    }

    /* كروت التمارين على الهواتف */
    .clinical-exercise-card {
        padding: 16px 14px !important;
    }

    .clinical-exercise-card p,
    .clinical-exercise-card div {
        text-align: right !important;
        text-justify: none !important;
        text-align-last: right !important;
        direction: rtl !important;
        word-spacing: normal !important;
        letter-spacing: normal !important;
    }
}

/* ================= Clinical Typography & Bidi Latin Badge Isolation ================= */
.medical-latin-badge {
    display: inline-block !important;
    direction: ltr !important;
    unicode-bidi: isolate !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-weight: 700 !important;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.12) !important;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
    border-radius: 6px !important;
    padding: 1px 7px !important;
    margin: 0 3px !important;
    font-size: 0.88em !important;
    vertical-align: baseline !important;
    white-space: normal !important;
    word-break: keep-all !important;
}

.medical-latin-term {
    display: inline-block !important;
    direction: ltr !important;
    unicode-bidi: isolate !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 0.92em !important;
    color: #38bdf8 !important;
    margin: 0 2px !important;
}

/* ================= AI Clinical Insight Formatted Typography ================= */
.ai-insight-formatted-content {
    color: #e2e8f0;
    font-size: 0.95em;
    line-height: 1.8;
    direction: rtl !important;
    text-align: right !important;
    text-justify: none !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
}

.ai-report-paragraph {
    color: #cbd5e1;
    font-size: 0.94em;
    line-height: 1.8;
    margin: 0 0 12px 0;
    direction: rtl !important;
    text-align: right !important;
    text-justify: none !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    word-break: normal;
}

.ai-report-mainheading {
    color: var(--primary-gold);
    margin: 18px 0 10px 0;
    font-size: 1.15em;
    font-weight: 900;
    text-align: right !important;
    direction: rtl !important;
    border-right: 3px solid var(--primary-gold);
    padding-right: 10px;
}

.ai-report-subheading {
    color: #fef08a;
    margin: 14px 0 8px 0;
    font-size: 1.02em;
    font-weight: 800;
    text-align: right !important;
    direction: rtl !important;
    border-right: 2.5px solid #38bdf8;
    padding-right: 8px;
}

.ai-bold-highlight {
    color: #38bdf8;
    font-weight: 800;
}

.ai-styled-list,
.ai-styled-num-list {
    margin: 10px 0 14px 0;
    padding-right: 24px;
    padding-left: 0;
    direction: rtl !important;
    text-align: right !important;
    text-justify: none !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
}

.ai-styled-list li,
.ai-styled-num-list li {
    margin-bottom: 8px;
    color: #e2e8f0;
    line-height: 1.75;
    font-size: 0.93em;
    text-align: right !important;
    text-justify: none !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
}

.ai-styled-list li::marker {
    color: var(--primary-gold);
}

.ai-styled-num-list li::marker {
    color: #38bdf8;
    font-weight: bold;
}

/* ==========================================================================
   🟢 أنيميشن وتنسيق شريط المراجعين أونلاين والمصداقية الحية
   ========================================================================== */
@keyframes pulseOnline {
    0% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

#live-online-bar {
    position: relative;
    z-index: 100;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    #live-online-bar {
        padding: 7px 12px !important;
        font-size: 0.82em !important;
    }
}