    /* Font setup: Add Almarai for Arabic text */
    body { 
        font-family: 'Almarai', 'Plus Jakarta Sans', sans-serif;
        /* iOS Rendering Optimizations */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }

    /* Apply Almarai font specifically to elements that might contain Arabic */
    input, select, textarea, button, h1, h2, h3, p, span {
        font-family: 'Almarai', sans-serif;
    }

    /* Glass Effect */
    .glass-header {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid #e0e7ff; /* Indigo tint */
    }

    /* Card Design */
    .design-card {
        background-color: white;
        border-radius: 1.5rem; 
        border: 1px solid #e2e8f0;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
        padding: 1.25rem; 
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    @media (min-width: 640px) {
        .design-card { padding: 2rem; border-radius: 2.5rem; }
    }

    /* قسم الأنشطة: منح محرّر النشاط وبطاقات الجلسات المحفوظة مساحة أوسع
       بسحبها نحو حواف البطاقة، لتعويض جزء من حشوة .design-card وإتاحة
       مساحة أفقية أكبر للتفاصيل، مع إبقاء عنوان القسم محاذياً لبقية البطاقات. */
    #section-schedule #booked-slots-container,
    #section-schedule #session-editor,
    #section-schedule #empty-slots-msg,
    #section-schedule #add-another-area {
        margin-inline-start: -0.5rem;
        margin-inline-end: -0.5rem;
    }
    @media (min-width: 640px) {
        #section-schedule #booked-slots-container,
        #section-schedule #session-editor,
        #section-schedule #empty-slots-msg,
        #section-schedule #add-another-area {
            margin-inline-start: -1rem;
            margin-inline-end: -1rem;
        }
    }

    /* Labels & Inputs */
    .design-label {
        display: block;
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #64748b;
        margin-bottom: 0.5rem;
    }
    .design-sublabel {
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #94a3b8;
    }
    
    .design-input {
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 0.75rem;
        background-color: #f8fafc;
        border: 2px solid #f1f5f9;
        font-weight: 600;
        font-size: 16px; 
        color: #0f172a;
        outline: none;
        transition: all 0.2s;
    }
    @media (min-width: 640px) {
         .design-input { padding: 1rem; border-radius: 1rem; font-size: 1rem; }
    }
    
    .design-input:focus {
        background-color: white;
        border-color: #6366f1; /* Indigo-500 */
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    }

    /* Step Badge */
    .step-badge {
        width: 2rem; height: 2rem;
        font-size: 0.875rem;
        border-radius: 9999px;
        display: flex; align-items: center; justify-content: center;
        font-weight: 800; margin-left: 0.75rem; flex-shrink: 0;
        transition: all 0.3s ease;
    }
    @media (min-width: 640px) {
        .step-badge { width: 2.5rem; height: 2.5rem; font-size: 1rem; margin-left: 1rem; }
    }

    /* Date Scroller */
    .date-scroller {
        display: flex; gap: 0.5rem;
        overflow-x: auto; 
        padding-top: 0.5rem; 
        padding-bottom: 1rem; 
        -ms-overflow-style: none; scrollbar-width: none;
    }
    .date-scroller::-webkit-scrollbar { display: none; }

    .date-btn {
        flex-shrink: 0; width: 4rem; padding: 0.75rem 0;
        border-radius: 1rem; border: 2px solid transparent;
        background: #f8fafc; 
        display: flex; flex-direction: column; align-items: center;
        cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    @media (min-width: 640px) {
        .date-btn { width: 4.5rem; padding: 1rem 0; }
    }
    
    @media (hover: hover) {
        .date-btn:hover { background: #f1f5f9; }
        .time-slot:hover:not(.occupied):not(.selected):not(.range) {
            border-color: #a5b4fc; color: #4f46e5;
        }
        .room-card:hover { background: #f1f5f9; }
        .time-slot.end-candidate:hover {
            background-color: #fef3c7 !important; /* Amber-100 */
            transform: scale(1.02);
        }
    }

    .date-btn.active {
        background: #4f46e5; /* Indigo-600 */
        color: white; 
        border-color: #4338ca;
        box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3); 
        transform: translateY(-2px) scale(1.05);
    }

    /* Time Grid */
    .time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
    
    .time-slot {
        height: 4.25rem; 
        border-radius: 1rem; 
        border: 2px solid #f1f5f9;
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        justify-content: center;
        font-size: 0.75rem; font-weight: 800; color: #64748b;
        background: white; cursor: pointer; 
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        line-height: 1.2;
    }
    @media (min-width: 640px) { 
        .time-slot { height: 5rem; font-size: 0.875rem; } 
    }

    .slot-subtext {
        font-size: 0.6rem; font-weight: 800; text-transform: uppercase;
        margin-top: 0.15rem; letter-spacing: 0.05em; min-height: 0.8rem; 
        display: flex; align-items: center; justify-content: center;
    }
    
    .slot-status {
        font-size: 0.65rem; font-weight: 800; text-transform: uppercase; margin-top: 2px;
    }

    .time-slot.selected { 
        background: #4f46e5 !important; color: white !important; 
        border-color: #4338ca !important; transform: scale(1.05);
        box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3); z-index: 10;
    }
    
    .time-slot.range { 
        background: #eef2ff !important; color: #4f46e5 !important; 
        border-color: #c7d2fe !important;
    }
    
    .time-slot.occupied { 
        cursor: not-allowed; background-color: #f8fafc; color: #cbd5e1; border-color: #f1f5f9;
    }
    .time-slot.occupied .slot-status { color: #64748b !important; }
    
    @keyframes pulse-amber {
        0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
        70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
        100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
    }

    .time-slot.end-candidate {
        opacity: 1 !important; cursor: pointer !important;
        border-color: #f59e0b !important; background-color: #fffbeb !important;
        color: #b45309 !important; z-index: 5; animation: pulse-amber 2s infinite;
    }
    .time-slot.end-candidate .slot-subtext { color: #d97706; }
    .time-slot.end-candidate .slot-status { display: none !important; }

    /* Room Cards - Modified for a Dedicated Status Line */
    .room-card {
        position: relative;
        cursor: pointer; border: 2px solid transparent; 
        padding: 0.75rem;
        padding-bottom: 2.75rem; 
        border-radius: 1.25rem; display: flex; align-items: center; gap: 0.75rem;
        transition: all 0.2s; background: #f8fafc;
    }
    @media (min-width: 640px) { 
        .room-card { 
            padding: 1rem; 
            padding-bottom: 3.25rem; 
            border-radius: 1.5rem; gap: 1rem; 
        } 
    }

    .room-card::after {
        content: "";
        position: absolute;
        bottom: 2rem;
        right: 0.75rem; 
        left: 0.75rem; 
        height: 1px;
        background-color: #e2e8f0; 
        transition: background-color 0.2s;
    }
    @media (min-width: 640px) {
        .room-card::after {
            bottom: 2.5rem;
            right: 1rem; 
            left: 1rem; 
        }
    }

    .room-card::before {
        content: "حالة القاعة"; 
        position: absolute;
        bottom: 0.25rem;
        right: 0.75rem; 
        font-size: 0.65rem;
        font-weight: 800;
        color: #94a3b8; 
        line-height: 1.5rem; 
        text-transform: uppercase;
        letter-spacing: 0.05em;
        transition: color 0.2s;
    }
    @media (min-width: 640px) {
        .room-card::before {
            bottom: 0.375rem;
            right: 1rem; 
            line-height: 1.75rem;
            font-size: 0.7rem;
        }
    }

    .room-card.selected { 
        background-color: white; border-color: #4f46e5; 
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    }
    
    .room-card.selected::after {
        background-color: #e0e7ff; 
    }
    .room-card.selected::before {
        color: #818cf8; 
    }

    .status-btn {
        position: absolute;
        bottom: 0.25rem; 
        left: 0.75rem; 
        width: 1.5rem; height: 1.5rem; border-radius: 9999px;
        background-color: white; border: 1px solid #e2e8f0; color: #64748b;
        display: flex; align-items: center; justify-content: center;
        font-size: 0.7rem; transition: all 0.2s; z-index: 10;
    }
    @media (min-width: 640px) {
        .status-btn {
            bottom: 0.375rem;
            left: 1rem; 
            width: 1.75rem; height: 1.75rem;
            font-size: 0.75rem;
        }
    }
    .status-btn:hover {
        background-color: #e0e7ff; color: #4f46e5; border-color: #c7d2fe; transform: scale(1.1);
    }

    /* Modal - Mobile Bottom Sheet */
    .modal-overlay {
        position: fixed; inset: 0; background-color: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px); z-index: 200;
        display: flex; align-items: flex-end; justify-content: center;
        opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
    }
    .modal-overlay.open { opacity: 1; pointer-events: auto; }
    
    @media (min-width: 640px) {
        .modal-overlay { align-items: center; padding: 1rem; }
    }

    .modal-content {
        background: white; width: 100%; 
        border-radius: 1.5rem 1.5rem 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        overflow: hidden; max-height: 85vh; display: flex; flex-direction: column;
    }
    @media (min-width: 640px) {
        .modal-content {
            max-width: 24rem; border-radius: 1.5rem; 
            transform: scale(0.95); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
        }
    }
    .modal-overlay.open .modal-content { transform: translateY(0); }
    @media (min-width: 640px) {
        .modal-overlay.open .modal-content { transform: scale(1); }
    }

    /* Status Squares */
    .status-row {
        display: flex; justify-content: space-between; align-items: center;
        padding: 0.75rem 0; border-bottom: 1px solid #f1f5f9;
    }
    .status-row:last-child { border-bottom: none; }
    
    .square-block {
        width: 14px; height: 14px; border-radius: 3px; display: inline-block;
    }
    
    /* Loading States */
    .btn-loading .btn-text { opacity: 0; }
    .btn-loading .spinner-overlay { opacity: 1; }
    .spinner-overlay { opacity: 0; transition: opacity 0.3s ease; }
    .spinner {
        border: 2px solid rgba(255,255,255,0.3); border-radius: 50%;
        border-top-color: #fff; width: 1.25rem; height: 1.25rem;
        animation: spin 1s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* Coordinator Collapse / Expand */
    #coord-form-fields {
        transition: opacity 0.25s ease, max-height 0.3s cubic-bezier(0.4,0,0.2,1);
        overflow: hidden;
    }
    #coord-form-fields.hidden { display: none; }
    #coord-summary { transition: opacity 0.25s ease; }
    #coord-edit-btn { transition: all 0.2s ease; }

    /* Dots wave loading animation */
    .dots-wave {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    .dots-wave span {
        width: 6px; height: 6px;
        background: white;
        border-radius: 50%;
        display: inline-block;
        animation: dotWave 1.2s ease-in-out infinite;
    }
    .dots-wave span:nth-child(1) { animation-delay: 0s; }
    .dots-wave span:nth-child(2) { animation-delay: 0.2s; }
    .dots-wave span:nth-child(3) { animation-delay: 0.4s; }
    @keyframes dotWave {
        0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
        30% { transform: translateY(-5px); opacity: 1; }
    }

    /* Indigo dots variant — for dots-wave shown on light/white backgrounds */
    .dots-wave.indigo span { background: #4f46e5; }

    /* White progress "sweep" line on the lower edge of the Check Availability
       button while it is in the "Checking..." state (button stays blue). */
    .btn-loadline {
        position: absolute; left: 0; right: 0; bottom: 0;
        height: 3px; overflow: hidden; border-radius: 0 0 0.75rem 0.75rem;
    }
    .btn-loadline > i {
        position: absolute; top: 0; left: 0; height: 100%; width: 38%;
        background: rgba(255,255,255,0.95); border-radius: 99px;
        animation: btnLoadLine 1.05s ease-in-out infinite;
    }
    @keyframes btnLoadLine {
        0%   { transform: translateX(-120%); }
        100% { transform: translateX(330%); }
    }

    /* ===== Floating Action Button — Liquid Glass (progressive enhancement) ===== */
    .fab-zone {
        position: fixed;
        left: 1.25rem; /* RTL left side positioning */
        bottom: 1.25rem;
        z-index: 60;
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* RTL: flex-end aligns to the physical LEFT */
        gap: 0.75rem;
        pointer-events: none; /* Prevents the invisible bounding box from blocking clicks */
    }
    .fab-actions {
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* RTL: flex-end aligns to the physical LEFT */
        gap: 0.65rem;
    }
    .fab-item {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        text-decoration: none;
        cursor: pointer;
        opacity: 0;
        transform: translateY(14px) scale(0.9);
        transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
        pointer-events: none;
    }
    .fab-zone.open .fab-item {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto; /* Buttons become clickable only when open */
    }
    .fab-zone.open .fab-item:nth-child(2) { transition-delay: 0.06s; }
    .fab-item:hover .fab-mini { transform: scale(1.08); }
    .fab-item:hover .fab-lbl { color: #4f46e5; }

    /* ---- Glossy translucent label ---- */
    .fab-lbl {
        position: relative;
        overflow: hidden;
        background: linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0.3));
        -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.08);
        backdrop-filter: blur(10px) saturate(180%) brightness(1.08);
        border: 1px solid rgba(255,255,255,0.6);
        padding: 0.45rem 0.8rem;
        border-radius: 0.85rem;
        font-size: 0.78rem;
        font-weight: 800;
        color: #334155;
        white-space: nowrap;
        box-shadow: 0 6px 16px -8px rgba(30,41,59,0.35), inset 0 1px 1px rgba(255,255,255,0.95);
    }

    /* ---- Clear-glass mini action buttons (BASE / fallback) ---- */
    .fab-mini {
        position: relative;
        overflow: hidden;
        width: 2.85rem;
        height: 2.85rem;
        border-radius: 50%;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        background: linear-gradient(135deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.12) 55%, rgba(255,255,255,0.28) 100%);
        -webkit-backdrop-filter: blur(14px) saturate(190%) brightness(1.08);
        backdrop-filter: blur(14px) saturate(190%) brightness(1.08);
        border: 1px solid rgba(255,255,255,0.55);
        box-shadow: 0 8px 20px -6px rgba(30,41,59,0.32),
                    inset 0 1.5px 1px rgba(255,255,255,0.9),
                    inset 0 0 0 1px rgba(255,255,255,0.18);
        transition: transform 0.2s;
    }
    .fab-mini::before { /* specular glint */
        content: "";
        position: absolute;
        top: -28%; left: -14%; /* Fixed to left since it's a visual effect */
        width: 82%; height: 66%;
        z-index: 1;
        background: radial-gradient(55% 55% at 50% 50%, rgba(255,255,255,0.85), rgba(255,255,255,0) 70%);
        transform: rotate(-18deg);
        filter: blur(1.5px);
        pointer-events: none;
    }
    .fab-mini i { position: relative; z-index: 2; text-shadow: 0 1px 2px rgba(255,255,255,0.6); }
    .fab-mini.manual { color: #312e81; }
    .fab-mini.report { color: #9f1239; }

    /* ---- Clear-glass main button (BASE / fallback) ---- */
    .fab-main {
        position: relative;
        overflow: hidden;
        width: 3.6rem;
        height: 3.6rem;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
        color: #312e81;
        background: linear-gradient(135deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0.1) 55%, rgba(255,255,255,0.26) 100%);
        -webkit-backdrop-filter: blur(16px) saturate(190%) brightness(1.08);
        backdrop-filter: blur(16px) saturate(190%) brightness(1.08);
        border: 1px solid rgba(255,255,255,0.55);
        box-shadow: 0 12px 30px -8px rgba(30,41,59,0.4),
                    0 2px 6px -2px rgba(30,41,59,0.2),
                    inset 0 1.5px 1px rgba(255,255,255,0.9),
                    inset 0 -8px 14px -8px rgba(255,255,255,0.45),
                    inset 0 0 0 1px rgba(255,255,255,0.18);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
        pointer-events: auto; /* Ensures main button is always clickable despite parent container */
    }
    .fab-main::before { /* bright specular glint */
        content: "";
        position: absolute;
        top: -30%; left: -16%;
        width: 85%; height: 70%;
        z-index: 1;
        background: radial-gradient(55% 55% at 50% 50%, rgba(255,255,255,0.9), rgba(255,255,255,0) 70%);
        transform: rotate(-18deg);
        filter: blur(2px);
        pointer-events: none;
    }
    .fab-main::after { /* light-catching rim */
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        z-index: 2;
        pointer-events: none;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
        background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0) 35%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.18));
    }
    .fab-main:active { transform: scale(0.94); }
    .fab-icon { position: relative; z-index: 3; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); text-shadow: 0 1px 2px rgba(255,255,255,0.6); }

    /* ---- ENHANCEMENT: real refraction where supported (Chromium/Android) ---- */
    .fab-refract .fab-main {
        background: rgba(255,255,255,0.04);
        backdrop-filter: url(#liquidGlass) saturate(190%) brightness(1.06);
    }
    .fab-refract .fab-mini {
        background: rgba(255,255,255,0.05);
        backdrop-filter: url(#liquidGlass) saturate(190%) brightness(1.06);
    }

    .fab-scrim {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.18);
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
        z-index: 55;
    }
    .fab-scrim.open { opacity: 1; pointer-events: auto; }

    /* ---- FAB icon morph: three dots -> question mark on open ---- */
    .fab-morph { display: inline-flex; width: 1.5rem; height: 1.5rem; }
    .fab-morph svg { width: 100%; height: 100%; display: block; overflow: visible; }
    .fab-morph .fm-dot {
        transform-origin: center;
        transition: opacity 0.35s cubic-bezier(0.34,1.56,0.64,1), transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    }
    .fab-morph .fm-q {
        opacity: 0;
        transform: scale(0.3) rotate(-90deg);
        transform-origin: 12px 12px;
        transition: opacity 0.45s cubic-bezier(0.34,1.56,0.64,1), transform 0.45s cubic-bezier(0.34,1.56,0.64,1);
    }
    .fab-zone.open .fab-morph .fm-dot { opacity: 0; transform: scale(0.2); }
    .fab-zone.open .fab-morph .fm-q   { opacity: 1; transform: scale(1) rotate(0deg); }
