 /* =========================================
           1. UI STYLES
           ========================================= */
        :root { --primary: #2563eb; --bg: #f8fafc; --border: #cbd5e1; }
        * { box-sizing: border-box; }
        body { font-family: 'Inter', sans-serif; background: var(--bg); margin: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
        
        .app-header { background: white; border-bottom: 1px solid var(--border); height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; z-index: 50; }
        .app-brand { font-weight: 800; font-size: 1.3rem; color: #0f172a; }
        
        .container { display: flex; flex: 1; overflow: hidden; position: relative; }
        
        /* PANELS */
        .editor-panel { width: 50%; background: white; border-right: 1px solid var(--border); display: flex; flex-direction: column; transition: width 0.4s ease; z-index: 20; }
        .preview-panel { width: 50%; background: #525659; overflow-y: scroll; position: relative; display: block; padding: 40px; transition: width 0.4s ease; text-align: center; }
        #preview-scaler { display: inline-block; transform-origin: top center; transition: transform 0.2s; box-shadow: 0 15px 50px rgba(0,0,0,0.4); margin-bottom: 100px; }

        body.mode-finalize .editor-panel { width: 25%; }
        body.mode-finalize .preview-panel { width: 75%; }
        body.mode-finalize .form-scroll { display: none; }
        body.mode-finalize .footer-nav { display: none; }
        body.mode-finalize .finalize-tools { display: flex; }

        /* EDITOR UI */
        .progress-container { padding: 15px 20px; border-bottom: 1px solid var(--border); background: white; }
        .progress-bar { display: flex; justify-content: space-between; position: relative; }
        .progress-bar::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 2px; background: #e2e8f0; z-index: 0; }
        .step { width: 30px; height: 30px; background: white; border: 2px solid #94a3b8; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; position: relative; z-index: 1; cursor: pointer; color: #64748b; transition: 0.2s; }
        .step.active { border-color: var(--primary); background: var(--primary); color: white; transform: scale(1.1); }

        .form-scroll { flex: 1; overflow-y: auto; padding: 25px; }
        .form-section { display: none; animation: fadeIn 0.3s; }
        .form-section.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        h2 { font-size: 1.2rem; color: #1e293b; margin-bottom: 20px; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px; }
        .input-group { margin-bottom: 15px; text-align: left; }
        .row { display: flex; gap: 15px; margin-bottom: 15px; }
        .col { flex: 1; }
        label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; color: #475569; }
        input[type="text"], input[type="email"], select, textarea { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.9rem; transition: 0.2s; }
        input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

        .rte-container { border: 1px solid #cbd5e1; border-radius: 6px; overflow: hidden; background: white; }
        .rte-toolbar { background: #f1f5f9; border-bottom: 1px solid #cbd5e1; padding: 6px; display: flex; gap: 5px; }
        .rte-btn { width: 28px; height: 28px; border: 1px solid #cbd5e1; background: white; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #475569; }
        .rte-btn:hover { background: #e2e8f0; color: #0f172a; }
        .rte-content { padding: 12px; min-height: 100px; outline: none; font-size: 0.95rem; line-height: 1.5; }
        /* RTE EDITOR FIX */
        .rte-content ul, .rte-content ol { margin: 0; padding-left: 20px; list-style-position: inside; }

        .footer-nav { padding: 15px 25px; border-top: 1px solid var(--border); background: white; display: flex; justify-content: space-between; }
        .btn { padding: 10px 20px; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; font-size: 0.9rem; transition: 0.2s; }
        .btn-next { background: var(--primary); color: white; }
        .btn-back { background: #f1f5f9; color: #475569; }
        .add-btn { width: 100%; padding: 12px; border: 2px dashed #cbd5e1; background: #f8fafc; color: #64748b; font-weight: 600; border-radius: 8px; cursor: pointer; margin-top: 5px; }
        
        .item-card { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px; margin-bottom: 10px; position: relative; }
        .delete-btn { position: absolute; top: 10px; right: 10px; background: none; border: none; color: #ef4444; cursor: pointer; opacity: 0.6; }
        
        .finalize-tools { display: none; flex-direction: column; height: 100%; overflow-y: auto; padding: 20px; background: #fff; }
        .tool-tabs { display: flex; gap: 5px; margin-bottom: 20px; background: #f1f5f9; padding: 4px; border-radius: 8px; }
        .tool-tab-btn { flex: 1; padding: 8px; border: none; background: none; cursor: pointer; font-weight: 600; font-size: 0.85rem; color: #64748b; border-radius: 6px; }
        .tool-tab-btn.active { background: white; color: var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
        .tool-content { display: none; }
        .tool-content.active { display: block; animation: fadeIn 0.3s; }
        .color-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
        .color-opt { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid white; box-shadow: 0 0 0 1px #cbd5e1; }

        /* =========================================
           2. RESUME STYLES & RESETS
           ========================================= */
        .resume-sheet * { margin: 0; padding: 0; box-sizing: border-box; }
        
        .resume-sheet {
            width: 210mm;
            min-height: 297mm;
            background: white;
            position: relative;
            overflow: hidden;
            color: #1e293b;
            font-family: var(--res-font, 'Inter', sans-serif);
            font-size: var(--res-body-size, 0.9rem);
            line-height: var(--res-line-height, 1.6);
            text-align: left;
        }

        /* --- BULLET POINT FIX (INWARD & GAP) --- */
        .resume-sheet ul, .resume-sheet ol {
            margin: 0;
            padding-left: 18px; /* Indents the whole list */
            list-style-position: outside; /* Keeps bullet outside text block */
        }
        
        .resume-sheet li {
            margin-bottom: 6px;
            padding-left: 8px; /* Adds gap between bullet and text */
        }

        /* ICONS FIX */
        .fa, .fas, .far { font-family: "Font Awesome 6 Free" !important; font-weight: 900; }
        .fab { font-family: "Font Awesome 6 Brands" !important; font-weight: 400; }

        /* PAGE BREAK */
        .page-break-marker {
            height: 40px; background: #525659; width: 100%; position: absolute; left: 0; z-index: 100;
            display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
        }

        /* GLOBAL COMPONENTS */
        .res-section { margin-bottom: var(--res-sec-spacing, 30px); }
        .res-section-title {
            font-family: var(--res-head-font, 'Inter', sans-serif);
            font-size: var(--res-head-size, 1.15rem);
            font-weight: 700;
            text-transform: uppercase;
            color: var(--res-head-color, #2563eb);
            margin-bottom: 15px;
            margin-top: 10px;
            letter-spacing: 0.5px;
            border-bottom: 2px solid var(--res-color, #2563eb);
            padding-bottom: 6px;
        }

        .res-name { font-size: var(--res-name-size, 2.4rem); font-weight: 800; line-height: 1.1; color: var(--res-head-color, #2563eb); text-transform: uppercase; margin-bottom: 6px; }
        .res-job { font-size: 1.1rem; color: var(--res-head-color); font-weight: 700; opacity: 0.9; margin-bottom: 12px; }
        
        .res-contact-row { font-size: 0.9em; display: flex; flex-wrap: wrap; gap: 15px; color: #334155; margin-top: 10px; }
        .res-contact-item { display: flex; align-items: center; gap: 6px; }
        .res-contact-item i { font-size: 0.9em; opacity: 0.8; }

        .res-photo { width: 120px; height: 120px; background-color: #eee; background-size: cover; background-position: center; border-radius: 50%; border: 3px solid rgba(0,0,0,0.05); display: block; margin-bottom: 15px; }

        /* LISTS */
        .res-entry { margin-bottom: 18px; }
        .res-entry-header { display: flex; justify-content: space-between; align-items: baseline; }
        .res-bold { font-weight: 700; color: #0f172a; font-size: 1.05em; }
        .res-date { font-size: 0.85em; color: #64748b; white-space: nowrap; font-weight: 500; }
        .res-desc { margin-top: 6px; font-size: 0.95em; color: #334155; }

        /* SKILLS (2 Col Default) */
        .res-skills-grid { display: flex; flex-wrap: wrap; gap: 8px 20px; }
        .skill-item { width: 45%; flex-grow: 1; }
        .skill-name { font-weight: 600; font-size: 0.9em; display: block; margin-bottom: 3px; }
        .skill-bar-bg { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
        .skill-bar-fill { height: 100%; background: var(--res-color, #2563eb); }
        
        /* SIDEBAR RULES */
        .res-sidebar .res-section { margin-bottom: 30px; }
        .res-sidebar .skill-item { width: 100%; margin-bottom: 10px; } /* 1 Col in Sidebar */
        .res-sidebar .res-section-title { border-bottom: 1px solid rgba(0,0,0,0.1); font-size: 1.05rem; }

        /* --- LAYOUTS --- */
        
        /* 1. CLASSIC */
        .classic-layout { padding: 45px; }
        .classic-layout .res-header { border-bottom: 2px solid #f1f5f9; padding-bottom: 30px; margin-bottom: 35px; display: flex; justify-content: space-between; align-items: flex-start; }
        
        /* 2. LEFT SIDEBAR */
        .sidebar-layout { display: flex; min-height: 297mm; }
        .res-sidebar { width: 34%; padding: 45px 30px; background-color: #f8fafc; color: #333; flex-shrink: 0; }
        .res-main { width: 66%; padding: 45px; flex-grow: 1; }

        /* 3. RIGHT SIDEBAR */
        .right-sidebar-layout { display: flex; min-height: 297mm; }
        .right-sidebar-layout .res-main { width: 66%; padding: 45px; flex-grow: 1; }
        .right-sidebar-layout .res-sidebar { width: 34%; padding: 45px 30px; background-color: #f8fafc; color: #333; flex-shrink: 0; }

        /* 4. TOP HEADER (TEMPLATE 9) */
        .top-header-layout .res-header {
            background: var(--res-color); 
            color: white;
            padding: 50px;
            margin: -45px -45px 40px -45px; 
            text-align: center;
        }
        .top-header-layout .res-header .res-name, 
        .top-header-layout .res-header .res-job,
        .top-header-layout .res-header .res-contact-row { color: white !important; }
        .top-header-layout .res-contact-row { justify-content: center; margin-top: 15px; }
        .top-header-layout .res-contact-item { color: rgba(255,255,255,0.9); }
        .top-header-layout { padding: 45px; }

        /* 5. BOX LAYOUT (Template 15) */
        .box-layout { display: flex; min-height: 297mm; }
        .box-sidebar { width: 36%; background: var(--res-color); color: white; padding: 50px 30px; text-align: left; }
        .box-main { width: 64%; padding: 50px; background: white; }
        .box-sidebar .res-section-title { color: white !important; border-bottom: 1px solid rgba(255,255,255,0.4); margin-bottom: 20px; }
        .box-sidebar .res-contact-item { color: rgba(255,255,255,0.9); margin-bottom: 12px; }
        .box-sidebar .res-photo { width: 150px; height: 150px; border-radius: 0; border: 5px solid rgba(255,255,255,0.3); margin-bottom: 30px; }
        .box-sidebar .skill-item { width: 100%; } 
        .box-sidebar .skill-bar-bg { background: rgba(0,0,0,0.3); } 
        .box-sidebar .skill-bar-fill { background: white; }

        /* 6. BANNER HEADER (Template 17 - Shishir Style) */
        .banner-layout { padding: 45px 0 0 0; }
        .banner-layout .res-header { padding: 0 45px 30px 45px; }
        .banner-layout .res-name { color: var(--res-color); text-transform: uppercase; font-size: 2.8rem; }
        .banner-bar { 
            background: #1e293b; 
            color: white; 
            padding: 15px 45px; 
            margin-bottom: 40px; 
            font-size: 0.9rem;
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            align-items: center;
        }
        .banner-bar .res-contact-item { color: white; }
        .banner-bar i { color: var(--res-color); }
        .banner-layout .res-main-content { padding: 0 45px 45px 45px; }

        /* --- SKINS --- */
        .skin-1 .res-name { letter-spacing: 1px; }
        .skin-2 .res-header { background: var(--res-color); color: white; padding: 40px; margin: -45px -45px 30px -45px; } .skin-2 .res-name, .skin-2 .res-job, .skin-2 .res-contact-item { color: white !important; } .skin-2 .res-contact-item i { color: white !important; }
        .skin-3 .res-header { flex-direction: column; text-align: center; align-items: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 20px; margin-bottom: 30px; } .skin-3 .header-right { display: none; } .skin-3 .res-contact-row { justify-content: center; } .skin-3 .res-section-title { text-align: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 5px; }
        .skin-4 .res-section-title { border-left: 5px solid var(--res-color); padding-left: 15px; background: #f8fafc; padding-top: 8px; padding-bottom: 8px; border-bottom: none; }
        .skin-5 { background: linear-gradient(to right, var(--res-color) 34%, #fff 34%); } .skin-5 .res-sidebar { background: transparent; color: white; } .skin-5 .res-sidebar .res-section-title { color: white !important; border-color: rgba(255,255,255,0.3); } .skin-5 .res-sidebar .res-contact-item { color: rgba(255,255,255,0.9); }
        .skin-6 .res-header { background: #333; color: white; padding: 45px; margin: -45px -45px 30px -45px; text-align: center; } .skin-6 .res-name { color: white !important; } .skin-6 .res-contact-row { justify-content: center; color: #ccc; }
        .skin-7 { background: linear-gradient(to right, var(--res-color) 34%, #fff 34%); } .skin-7 .res-sidebar { background: transparent; color: white; } .skin-7 .res-sidebar .res-section-title { color: white !important; border-color: rgba(255,255,255,0.3); } .skin-7 .res-sidebar .res-contact-item { color: rgba(255,255,255,0.9); }
        .skin-8 .res-sidebar { background: var(--res-color); color: white; } .skin-8 .res-sidebar .res-section-title { color: white !important; border-color: rgba(255,255,255,0.3); } .skin-8 .res-sidebar .res-contact-item { color: rgba(255,255,255,0.9); }
        .skin-9 .res-section-title { color: var(--res-color); border-color: var(--res-color); }
        .skin-10 { background: #fff1f2; } .skin-10 .res-header { border-bottom: 2px solid #fecdd3; }
        .skin-11 .res-name { font-family: 'Playfair Display', serif; font-style: italic; }
        .skin-12 { background: linear-gradient(to right, #f1f5f9 34%, #fff 34%); } .skin-12 .res-sidebar { background: transparent; }
        .skin-13 * { font-family: 'Merriweather', serif; } .skin-13 .res-section-title { border-bottom: 1px solid #000; letter-spacing: 2px; font-style: italic; }
        .skin-14 .res-section-title { background: var(--res-color); color: white !important; padding: 8px 18px; border-radius: 4px; display: inline-block; }
        .skin-15 { /* Handled by box-layout class */ }

        /* NEW TEMPLATES */
        .skin-16 .res-header { text-align: center; border-bottom: 4px solid var(--res-color); padding-bottom: 25px; } .skin-16 .res-contact-row { justify-content: center; } .skin-16 .res-section-title { text-align: center; border-bottom: none; position: relative; } .skin-16 .res-section-title::after { content:''; display:block; width: 50px; height: 3px; background: var(--res-color); margin: 5px auto 0; }
        .skin-17 { /* Handled by banner-layout */ }
        .skin-18 .res-entry { border-left: 3px solid #e2e8f0; padding-left: 20px; position: relative; } .skin-18 .res-entry::before { content:''; position:absolute; left:-7px; top:5px; width:11px; height:11px; background:var(--res-color); border-radius:50%; }
        .skin-19 .res-header { text-align: right; border-bottom: 2px solid var(--res-color); } .skin-19 .res-contact-row { justify-content: flex-end; } .skin-19 .res-section-title { border-left: 5px solid var(--res-color); border-bottom: none; padding-left: 15px; }
        .skin-20 .res-header { border-bottom: none; } .skin-20 .res-section-title { font-size: 1rem; letter-spacing: 2px; border-bottom: 1px solid #000; color: #000; } .skin-20 * { font-family: 'Roboto', sans-serif; }

        @media print { .editor-panel { display: none; } .preview-panel { width: 100%; display: block; padding: 0; background: white; } .resume-sheet { box-shadow: none; margin: 0; } .page-break-marker { display: none; } }

/* =========================================
   MOBILE RESPONSIVENESS FIXES
   ========================================= */
@media screen and (max-width: 900px) {
    
    /* 1. Unlock Page Height (Allow Scrolling) */
    body {
        height: auto !important;
        overflow-y: auto !important; /* Enable vertical scroll */
        display: block; /* Remove flex constraint */
    }

    /* 2. Stack Panels Vertically */
    .container {
        flex-direction: column;
        height: auto !important;
        overflow: visible !important;
        display: block;
    }

    /* 3. Editor Panel (Top) */
    .editor-panel {
        width: 100% !important;
        height: auto !important;
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
        position: relative;
        z-index: 20;
    }

    /* 4. Form Area Adjustment */
    .form-scroll {
        max-height: 50vh; /* Limit height so you can see preview below */
        overflow-y: auto;
    }

    /* 5. Preview Panel (Bottom) */
    .preview-panel {
        width: 100% !important;
        height: auto !important;
        min-height: 600px; /* Ensure space for resume */
        padding: 20px 10px !important; /* Smaller padding */
        background: #525659;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        overflow: visible !important; /* Let content flow */
    }

    /* 6. Fix "Finalize" Mode on Mobile */
    body.mode-finalize .editor-panel,
    body.mode-finalize .preview-panel {
        width: 100% !important;
    }
    
    body.mode-finalize .finalize-tools {
        height: auto !important; /* Let tools expand */
        max-height: 40vh; /* Limit height */
        overflow-y: auto;
    }

    /* 7. Scaler Fix */
    #preview-scaler {
        margin-bottom: 0 !important;
        transform-origin: top center !important;
    }

    /* 8. Hide "Exit" button on small phones to save space */
    .app-header .btn-back {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    /* 9. Progress Bar Tweaks */
    .step {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}
