.new-badge {
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    background-color: #ef4444;
    color: #ffffff;
    border-radius: 4px;
    text-transform: uppercase;
    line-height: 1;
    animation: pulse 1.4s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}


        /* CARDS */
        .card { background: var(--card-bg); border-radius: 20px; padding: 25px; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2); height: fit-content; }
        .card-header { margin-bottom: 20px; border-bottom: 2px solid #f1f5f9; padding-bottom: 15px; }
        .card-header h1 { font-size: 24px; font-weight: 800; color: #1e293b; margin: 0; }
/* book-planner */

        .page-wrapper {
            display: flex;
            justify-content: center;
            align-items: flex-start;
            gap: 20px;
            padding-top: 160px;
            padding-bottom: 40px;
            padding-left: 10px;
            padding-right: 10px;
            max-width: 1600px;
            margin: 0 auto;
        }

        .side-ad { width: 300px; min-width: 300px; position: sticky; top: 130px; display: flex; flex-direction: column; gap: 20px; }
        .tool-container { flex-grow: 1; width: 100%; display: flex; flex-direction: column; gap: 25px; max-width: 1100px; }

        .form-group { margin-bottom: 15px; }
        label { display: block; font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 6px; text-transform: uppercase; }
        .input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
        input, select, textarea { width: 100%; padding: 10px 12px; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 14px; background: #f8fafc; color: #334155; }
        input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; background: #fff; }
        textarea { resize: vertical; }
        .btn-calc { background: #1e293b; color: white; border: none; padding: 14px; width: 100%; border-radius: 10px; font-weight: 700; cursor: pointer; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; }
        .btn-calc:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -5px rgba(0,0,0,0.2); }
        .inner-ad-container { margin-top: 20px; text-align: center; background: #f8fafc; border-radius: 10px; padding: 10px; border: 1px dashed #cbd5e1; }
        #resultSection { display: none; opacity: 0; animation: slideUp 0.6s forwards; }
        .result-header { background: #f0fdfa; border: 1px solid #ccfbf1; border-radius: 10px; padding: 15px; display: flex; justify-content: space-around; text-align: center; margin-bottom: 15px; }
        .rh-val { font-size: 24px; font-weight: 800; color: #0f766e; } 
        .rh-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #115e59; margin-top: 4px; }
        .money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
        .money-box { border-radius: 10px; padding: 12px; }
        .profit-box { background: #f0fdf4; border: 1px solid #bbf7d0; }
        .cost-box { background: #eff6ff; border: 1px solid #bfdbfe; }
        .pb-title { font-size: 10px; font-weight: 700; color: #166534; text-transform: uppercase; }
        .pb-val { font-size: 22px; font-weight: 800; color: #15803d; margin-top: 2px; }
        .cb-title { font-size: 10px; font-weight: 700; color: #1e40af; text-transform: uppercase; }
        .cb-val { font-size: 22px; font-weight: 800; color: #1d4ed8; margin-top: 2px; }
        .stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 15px; }
        .stat-box { background: #f8fafc; padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; text-align: center; }
        .sb-title { font-size: 9px; color: #64748b; font-weight: 700; text-transform: uppercase; }
        .sb-val { font-size: 13px; font-weight: 700; color: var(--primary); }
        .split-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 15px; margin-bottom: 15px; }
        .spec-box { background: #fff; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 10px; }
        .spec-row { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; }
        .breakdown { list-style: none; padding: 0; margin: 0; }
        .breakdown li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f1f5f9; font-size: 11px; }
        .roadmap-container { margin-top: 10px; border-top: 2px solid #f1f5f9; padding-top: 10px; }
        .roadmap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
        .step-item { display: flex; gap: 8px; }
        .step-num { width: 20px; height: 20px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; }
        .step-content h5 { margin: 0 0 2px 0; font-size: 11px; } 
        .step-content p { margin: 0; font-size: 10px; color: #64748b; }
        .action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
        .btn-outline { background: white; border: 2px solid #e2e8f0; padding: 12px; border-radius: 10px; cursor: pointer; font-weight: 700; color: #475569; font-size: 14px; }
        .btn-primary { background: var(--accent); color: white; border: none; padding: 12px; border-radius: 10px; cursor: pointer; font-weight: 700; text-decoration: none; text-align: center; font-size: 14px; }
        .word-counter-box, #customSizeBox { display: none; }
        .toggle-link { font-size: 11px; color: var(--accent); cursor: pointer; text-decoration: underline; font-weight: 600; }

        .faq-item { border: 1px solid #e2e8f0; border-radius: 8px; padding: 4px; margin-bottom: 0px; cursor: pointer; }
        .faq-item summary { font-weight: 700; color: #334155; font-size: 14px; }
        @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        @media (max-width: 1350px) {
            .side-ad { display: none; }
            .tool-container { max-width: 100%; }
        }
        @media (min-width: 1351px) {
            .inner-ad-container { display: none; }
        }
        @media (max-width: 900px) {
            .tool-container { grid-template-columns: 1fr; }
        }



        
        /* CARDS */

        
        .section-title { 
            font-size: 18px; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; margin-top: 30px; 
            color: #334155; font-weight: 700; display: flex; align-items: center; gap: 10px;
        }
        
        /* FORM ELEMENTS */
        label { display: block; font-size: 13px; font-weight: 700; color: #64748b; margin-bottom: 6px; margin-top: 15px; }
        input, textarea, select { 
            width: 100%; padding: 12px; border: 2px solid #e2e8f0; border-radius: 10px; font-size: 14px; transition: 0.2s;
        }
        input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; background: #f8fafc; }
        
        /* DYNAMIC ITEMS */
        .item-box { background: #f8fafc; border: 1px solid #e2e8f0; padding: 20px; border-radius: 12px; margin-bottom: 15px; position: relative; }
        .btn-remove { 
            position: absolute; top: 10px; right: 10px; color: var(--danger); cursor: pointer; border: none; background: white; 
            width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.1); display: flex; justify-content: center; align-items: center;
        }
        
        .btn-add { 
            background: #eff6ff; color: var(--accent); border: 2px dashed #bfdbfe; width: 100%; padding: 12px; 
            border-radius: 10px; font-weight: 700; cursor: pointer; margin-top: 5px; transition: 0.2s;
        }
        .btn-add:hover { background: #dbeafe; border-color: var(--accent); }

        /* ACTIONS */
        .actions { 
            position: sticky; bottom: 20px; background: white; padding: 15px; border: 1px solid #e2e8f0; 
            margin-top: 30px; z-index: 10; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
        }
        .btn-main { 
            background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); color: white; border: none; 
            padding: 15px 25px; border-radius: 10px; width: 100%;
            font-weight: 800; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
            transition: 0.2s; box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
        }
        .btn-main:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4); }
        
        /* SEO & FAQ */
        .feature-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-top: 20px; }
        .feature-box h3 { font-size: 16px; color: #0f172a; margin-bottom: 5px; }
        .feature-box p { font-size: 13px; color: #64748b; line-height: 1.5; }
        details { background: #f8fafc; padding: 15px; border-radius: 8px; margin-bottom: 10px; cursor: pointer; border: 1px solid #e2e8f0; }
        summary { font-weight: 700; color: #334155; }
        details p { margin-top: 10px; font-size: 14px; color: #475569; }

    .pdf-container { 
    padding: 40px; font-family: 'Inter', sans-serif; 
    color: #000; background: #ffffff; 
    width: 700px; 
    margin: 0 auto; 
}
        .brief-header { text-align: center; border-bottom: 2px solid #000; padding-bottom: 20px; margin-bottom: 30px; }
        .brief-title { font-size: 32px; font-weight: bold; margin: 0; text-transform: uppercase; }
        .brief-meta { font-size: 14px; color: #444; margin-top: 10px; }
        .brief-section { margin-bottom: 30px; page-break-inside: avoid; }
        .brief-h3 { background: #eee; padding: 10px; font-size: 16px; font-weight: bold; border-left: 5px solid #000; margin-bottom: 15px; text-transform: uppercase; }
        .char-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; page-break-inside: avoid; }
        .char-card { border: 1px solid #ccc; padding: 15px; font-size: 13px; page-break-inside: avoid; background: #fff; }
        .page-row { border-bottom: 1px solid #eee; padding: 15px 0; display: flex; gap: 20px; page-break-inside: avoid; }
        .page-num { font-weight: bold; font-size: 16px; width: 80px; flex-shrink: 0; color: #444; }
        .page-detail { flex-grow: 1; font-size: 13px; line-height: 1.6; }
        .page-label { font-weight: bold; display: block; margin-bottom: 3px; color: #000; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
        
        /* COVER PAGE STYLES */
        .pdf-cover {
            height: 900px; 
            display: flex; flex-direction: column; justify-content: center; align-items: center;
            text-align: center; border-bottom: none; page-break-after: always;
        }
        .cover-title { font-size: 42px; font-weight: 800; margin-bottom: 10px; text-transform: uppercase; line-height: 1.2; }
        .cover-subtitle { font-size: 20px; color: #555; margin-bottom: 40px; text-transform: uppercase; letter-spacing: 2px; }
        .cover-note { font-size: 14px; color: #666; font-style: italic; margin-top: 20px; }
        .cover-meta { font-size: 16px; color: #444; border: 2px solid #000; padding: 20px 40px; border-radius: 8px; background: #f9f9f9; }

        .pdf-footer { 
            margin-top: 50px; text-align: center; font-size: 12px; color: #666; 
            border-top: 1px solid #eee; padding-top: 20px;
            display: flex; justify-content: space-between; align-items: center; 
        }
        .pdf-cta { color: #2563eb; text-decoration: none; font-weight: bold; }

        @media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } }


/* epub_generator */ 
    /* --- Global Styles --- */

    /* --- Layout System --- */
    .main-layout-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 32px;
    padding: 130px 0px 0px 0px;
    max-width: 1450px;
    margin: 0 auto;
    width: 100%;
}

    /* Sidebars for Ads */
    .ad-sidebar {
        width: 300px;
        min-width: 300px;
        display: flex;
        flex-direction: column;
        gap: 30px;
        position: sticky;
        top: 100px; /* Stick near top during scroll */
    }

    ins.adsbygoogle { display: block !important; width: 100%; }

    .ad-unit {
    background: transparent;
    border: none;
    box-shadow: none;
    min-height: 250px; /* 🔥 ADD THIS: Give it a minimum height */
    height: auto;
    padding: 0;
    display: block; /* Change from 'none' to 'block' initially to test */
    margin-bottom: 20px;
}

    /* Main Tool Container */
    .epub-tool-container {
        flex-grow: 1;
        max-width: 850px; 
        background: #ffffff;
        border-radius: 24px;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        border: 1px solid #e0e7ff;
        overflow: hidden; /* Mobile overflow fix */
    }

    /* Tool UI Elements */
    .section-label { display: block; font-size: 0.75rem; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
    .input-label { display: block; font-size: 0.85rem; font-weight: 700; color: #475569; margin-bottom: 0.35rem; }
    .input-field { width: 100%; border: 1px solid #cbd5e1; background: #f8fafc; padding: 0.75rem; border-radius: 0.5rem; outline: none; transition: 0.2s; font-size: 16px; /* Prevents iOS auto-zoom */}
    .input-field:focus { background: white; border-color: #6366f1; ring: 2px solid #6366f1; }

    /* Content Area */
    .content-area { padding: 40px; color: #334155; line-height: 1.7; background: #ffffff; }
    .content-area h2 { font-size: 1.75rem; font-weight: 800; color: #1e293b; margin-top: 2.5rem; margin-bottom: 1rem; line-height: 1.3; }
    .content-area h3 { font-size: 1.35rem; font-weight: 700; color: #334155; margin-top: 2rem; margin-bottom: 0.75rem; }
    .feature-box { background: #f8fafc; border-left: 4px solid #6366f1; padding: 20px; margin: 20px 0; border-radius: 0 8px 8px 0; }

    /* --- RESPONSIVE FIXES --- */
    /* Tablet View (1280px down to 1024px) */
    @media (max-width: 1280px) {
        .ad-sidebar { display: none !important; /* Hide sidebar ads */ }
        .main-layout-wrapper { padding: 100px 40px 40px; /* Reduced side padding */ display: block; }
        .epub-tool-container { margin: 0 auto; width: 100%; }
    }

    /* Mobile View (768px and down) */
    @media (max-width: 768px) {
        .main-layout-wrapper { padding: 80px 15px 20px; /* Minimized padding for small screens */ }
        .epub-tool-container { border-radius: 16px; /* Slightly smaller radius */ }
        .content-area { padding: 25px 15px; /* Less padding inside content */ }
        .content-area h2 { font-size: 1.4rem; /* Smaller headings on mobile */ }
        .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr !important; /* Stack all grids vertically */ gap: 15px; }
        .p-8 { padding: 1.5rem !important; /* Tailwind p-8 override */ }
        .text-3xl { font-size: 1.5rem !important; /* Header title resize */ }
    }


        
        /* Layout */


        /* Cards */
        


        /* Toolbar */
        .toolbar {
            display: flex; gap: 8px; flex-wrap: wrap; padding: 10px;
            background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 10px 10px 0 0; border-bottom: none;
        }
        .tool-btn {
            background: white; border: 1px solid #cbd5e1; border-radius: 6px; width: 36px; height: 36px;
            cursor: pointer; color: #475569; display: flex; align-items: center; justify-content: center;
            font-size: 14px; transition: 0.2s;
        }
        .tool-btn:hover { background: #e2e8f0; color: var(--accent); }
        
        /* ACTIVE STATE STYLE */
        .tool-btn.active { 
            background: var(--accent); 
            color: white; 
            border-color: var(--accent); 
            box-shadow: 0 2px 5px rgba(37, 99, 235, 0.3); 
        }

        .h-btn { width: auto; padding: 0 8px; font-weight: 700; font-family: serif; }

        /* Editor Input */
        

        /* Output Box */
        .output-box { margin-top: 20px; }
        .code-area {
            width: 100%; height: 150px; padding: 15px; background: #1e293b; color: #a5b4fc;
            font-family: 'Courier New', monospace; font-size: 13px; border-radius: 10px; border: none; resize: vertical;
        }
        .action-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
        .btn-copy {
            background: var(--accent); color: white; border: none; padding: 10px 20px;
            border-radius: 8px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 8px;
        }

        /* Preview */
        .amazon-preview { margin-top: 30px; border: 1px solid #ddd; background: white; padding: 20px; border-radius: 4px; }
        .preview-label { font-size: 12px; color: #999; text-transform: uppercase; font-weight: 700; margin-bottom: 10px; display: block; }
        .amz-content { font-family: "Arial", sans-serif; color: #333; font-size: 14px; line-height: 20px; }
        .amz-content h1 { font-size: 24px; font-weight: 700; color: #c60; margin: 0 0 4px 0; }
        .amz-content h2 { font-size: 20px; font-weight: 700; color: #c60; margin: 0 0 4px 0; }
        .amz-content h3 { font-size: 16px; font-weight: 700; margin: 0 0 4px 0; }
        .amz-content ul, .amz-content ol { padding-left: 25px; margin: 0 0 14px 0; }
        .amz-content li { margin-bottom: 4px; }
        .amz-content b { font-weight: 700; }



        /* Content & Promo */
        .content-card { background: white; padding: 40px; border-radius: 20px; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1); }
        .content-card h2 { font-size: 20px; margin-bottom: 15px; color: #0f172a; margin-top: 30px; }
        .content-card h3 { font-size: 16px; margin-bottom: 10px; color: #2563eb; margin-top: 20px; }
        .content-card p { font-size: 14px; line-height: 1.6; color: #475569; margin-bottom: 15px; }
        .content-card ul { padding-left: 20px; margin-bottom: 20px; color: #475569; font-size: 14px; line-height: 1.6; }
        .content-card li { margin-bottom: 8px; }
        
        .promo-banner {
            background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%);
            border: 1px dashed #2563eb; border-radius: 10px; padding: 15px; margin: 20px 0;
            display: flex; align-items: center; justify-content: space-between; gap: 15px;
        }
        .promo-btn { background: #2563eb; color: white; padding: 8px 15px; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 13px; white-space: nowrap; }

        /* Inner Ad */



/* kpd-html-formatter */


        /* Editor Input */
        #visualEditor {
            width: 100%; min-height: 300px; padding: 20px;
            border: 2px solid #e2e8f0; border-radius: 0 0 10px 10px;
            background: white; font-size: 16px; line-height: 1.6;
            outline: none; overflow-y: auto;
        }
        #visualEditor:focus { border-color: var(--accent); }
        
        /* FIX: LIST VISIBILITY */
        #visualEditor ul, #visualEditor ol { padding-left: 25px; list-style-position: inside; }
        #visualEditor li { margin-bottom: 5px; }


        /* Output Box */
        

        
        /* Content & Promo */
        .content-card { background: white; padding: 40px; border-radius: 20px; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1); }
        .content-card h2 { font-size: 20px; margin-bottom: 15px; color: #0f172a; margin-top: 30px; }
        .content-card h3 { font-size: 16px; margin-bottom: 10px; color: #2563eb; margin-top: 20px; }
        .content-card p { font-size: 14px; line-height: 1.6; color: #475569; margin-bottom: 15px; }
        .content-card ul { padding-left: 20px; margin-bottom: 20px; color: #475569; font-size: 14px; line-height: 1.6; }
        .content-card li { margin-bottom: 8px; }
        
        .promo-banner {
            background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%);
            border: 1px dashed #2563eb; border-radius: 10px; padding: 15px; margin: 20px 0;
            display: flex; align-items: center; justify-content: space-between; gap: 15px;
        }
        .promo-btn { background: #2563eb; color: white; padding: 8px 15px; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 13px; white-space: nowrap; }

        /* Inner Ad */

        
    

        
        textarea.story-input {
            width: 100%; height: 150px; padding: 15px; border: 2px solid #e2e8f0; border-radius: 10px;
            font-size: 14px; line-height: 1.6; resize: vertical; margin-bottom: 10px;
        }
        textarea.story-input:focus { border-color: var(--accent); outline: none; }
/* CTA BOX STYLES */
        .cta-container {
            margin-top: 25px; padding: 25px; 
            background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
            border: 2px dashed #f59e0b; border-radius: 12px; 
            text-align: center; position: relative; overflow: hidden;
        }
        .cta-container h3 { margin: 0 0 5px 0; color: #92400e; font-size: 18px; font-weight: 800; }
        .cta-container p { margin: 0 0 15px 0; color: #b45309; font-size: 14px; }
        
        .btn-cta {
            display: inline-flex; align-items: center; gap: 8px; 
            /* ✅ NEW GRADIENT APPLIED HERE */
            background: linear-gradient(90deg, #00d4ff, #b38bff, #ff9bd7);
            color: white; 
            padding: 12px 25px; border-radius: 30px; font-weight: 700; text-decoration: none; 
            transition: all 0.3s ease; 
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }
        
        .btn-cta:hover { 
            transform: translateY(-3px); 
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); 
            filter: brightness(1.1); /* Thoda chamkega hover par */
        }
        
        .cta-badge {
            position: absolute; top: 10px; right: 10px; 
            background: #ef4444; color: white; 
            font-size: 10px; font-weight: 800; padding: 3px 8px; 
            border-radius: 4px; text-transform: uppercase;
        }
        /* CONTROLS */
        .page-controls { display: flex; gap: 5px; align-items: center; }
        .page-select {
            padding: 8px 10px; border-radius: 8px; border: 2px solid var(--accent); 
            color: var(--accent); font-weight: 700; cursor: pointer; background: #eff6ff; outline:none;
        }
        .btn-mini { background: #e2e8f0; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-weight: 700; color: #475569; }
        .btn-mini:hover { background: #cbd5e1; color: #1e293b; }

        /* BUTTONS */
        .btn-action {
            background: var(--primary); color: white; border: none; padding: 10px 20px;
            border-radius: 8px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
            font-size: 13px; transition: 0.2s;
        }
        .btn-action:hover { transform: translateY(-2px); }
        .btn-magic { background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%); }
        .btn-reset { background: white; color: var(--danger); border: 2px solid #fee2e2; }
        .btn-pdf { background: var(--accent); width: 100%; justify-content: center; margin-top: 10px; }

        /* PAGINATION BOARD */
        .spread-container { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
        
        /* Spread Controls */
        .spread-wrapper { position: relative; }
        .spread-controls {
            display: flex; justify-content: center; gap: 10px; margin-bottom: 5px;
            opacity: 0; transition: 0.2s; visibility: hidden;
        }
        .spread-wrapper:hover .spread-controls { opacity: 1; visibility: visible; }
        
        .btn-spread {
            font-size: 11px; padding: 4px 10px; border-radius: 15px; border: none; cursor: pointer;
            font-weight: 700; display: flex; align-items: center; gap: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .btn-add-spread { background: #dbeafe; color: #1e40af; }
        .btn-del-spread { background: #fee2e2; color: #991b1b; }

        .spread-row { 
            display: grid; grid-template-columns: 1fr 1fr; gap: 6px; 
            background: #cbd5e1; padding: 6px; border-radius: 8px; 
            page-break-inside: avoid;
        }
        
        .page-box {
            background: white; padding: 15px; min-height: 220px; display: flex; flex-direction: column;
            position: relative; border-radius: 4px; 
        }
        .page-box.locked { background: var(--locked-bg); opacity: 0.9; }

        .page-num { position: absolute; bottom: 8px; font-size: 11px; color: #94a3b8; font-weight: 800; z-index: 2; }
        .left-page .page-num { left: 15px; } .right-page .page-num { right: 15px; }
        .page-type { font-size: 10px; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; color: var(--accent); z-index: 2; }

        /* CONTENT AREAS */
        .page-content {
            width: 100%; flex-grow: 1; border: 1px dashed #e2e8f0; border-radius: 6px; padding: 10px; 
            font-size: 13px; line-height: 1.5; resize: none; color: #334155; transition: 0.2s; overflow: hidden; z-index: 2; position: relative;
        }
        .page-content:focus { border-color: var(--accent); outline: none; background: #f8fafc; }
        
        /* ✅ PDF FIX: Divs replace Textareas */
        .pdf-text-div {
            width: 100%; flex-grow: 1; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px;
            font-size: 13px; line-height: 1.5; white-space: pre-wrap; color: #334155; display: block !important;
            z-index: 2; position: relative; min-height: 150px;
        }
        .pdf-header-div {
            text-align: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #e2e8f0;
        }
        .pdf-watermark {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-30deg);
            font-size: 60px; color: rgba(200, 0, 0, 0.08); font-weight: 900; 
            z-index: 0; pointer-events: none; white-space: nowrap; user-select: none;
        }

        .art-note {
            margin-top: 8px; font-size: 11px; border: 1px solid #fcd34d; background: #fffbeb; 
            padding: 5px; border-radius: 4px; display: none; color: #b45309; resize: vertical; min-height: 40px; z-index: 2; position: relative;
        }
        .show-art { display: block !important; }

        .box-controls { display: flex; gap: 5px; justify-content: flex-end; margin-top: 5px; opacity: 0.6; z-index: 2; position: relative; }
        .page-box:hover .box-controls { opacity: 1; }
        .btn-icon { background: #f1f5f9; border: 1px solid #e2e8f0; color: #64748b; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; font-size: 10px; display: flex; align-items: center; justify-content: center; }
        .btn-icon:hover { background: var(--accent); color: white; border-color: var(--accent); }
        .save-status { font-size: 11px; color: var(--success); font-weight: 700; display: none; margin-left: 10px; }
        
        .word-counter { font-size: 10px; color: #cbd5e1; text-align: right; margin-top: 4px; cursor: help; z-index: 2; position: relative; }
        .warning .page-content { border-color: var(--danger); background: var(--warning-bg); }
        .warning .word-counter { color: var(--danger); font-weight: 700; }

        @media (max-width: 768px) { .spread-row { grid-template-columns: 1fr; padding: 0; background: transparent; } .page-box { border: 1px solid #e2e8f0; } }



/* isbn-barcode-generator */

    /* --- Main Layout Wrapper (For Ads) --- */
    .main-layout-wrapper {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
        max-width: 1600px;
        margin: 70px auto;

    }

    /* Sidebars for Ads */
    .ad-sidebar {
        width: 300px;
        min-width: 300px;
        display: flex;
        flex-direction: column;
        gap: 30px;
        padding-top: 50px; /* Align with tool top */
    }

    .ad-unit {
        background: #f9f9f9;
        border: 1px solid #eee;
        border-radius: 8px;
        overflow: hidden;
        min-height: 250px; /* Placeholder height */
        text-align: center;
    }

    /* Hide Ads on Mobile/Tablet to save space */
    @media (max-width: 1200px) {
        .ad-sidebar {
            display: none;
        }
    }

    /* --- Existing Layout --- */
    .isbn-tool-container {
        max-width: 650px;
        /* Adjusted margin for flex layout */
        margin: 50px 0; 
        background: #ffffff;
        padding: 40px;
        border-radius: 12px;
        border: 1px solid #e1e4e8;
        box-shadow: 0 4px 20px rgba(0,0,0,0.05);
        font-family: 'Inter', Helvetica, Arial, sans-serif;
        text-align: center;
        flex-grow: 1; /* Allow it to take space */
    }

    .isbn-tool-container h1 { margin-top: 0; color: #1a1a1a; font-weight: 800; }
    .isbn-tool-container p { color: #555; margin-bottom: 30px; font-size: 15px; }

    /* --- Input --- */
    .input-group { text-align: left; margin-bottom: 25px; }
    .input-label { font-weight: 600; color: #333; margin-bottom: 8px; display: block; font-size: 14px; }
    
    .isbn-input {
        width: 100%;
        padding: 16px;
        font-size: 18px;
        border: 2px solid #e1e4e8;
        border-radius: 8px;
        font-family: 'Courier New', monospace; 
        letter-spacing: 1px;
    }
    .isbn-input:focus { border-color: #ff7a18; outline: none; }

    /* --- Button --- */
    .generate-btn {
        background: #111;
        color: #fff;
        border: none;
        padding: 18px 30px;
        font-size: 16px;
        font-weight: 700;
        border-radius: 8px;
        cursor: pointer;
        width: 100%;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        transition: 0.2s;
    }
    .generate-btn:hover { background: #333; transform: translateY(-1px); }
    .generate-btn:disabled { background: #999; cursor: not-allowed; }

    /* --- Output --- */
    .barcode-output {
        margin-top: 40px;
        display: none;
        background: #fafbfc;
        padding: 30px;
        border-radius: 10px;
        border: 1px solid #e1e4e8;
    }

    #svgContainer {
        margin-bottom: 25px;
        background: white; 
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        display: inline-block;
        padding: 10px;
    }

    /* --- Downloads --- */
    .dl-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 15px;
        margin-top: 20px;
    }
    .btn-dl {
        padding: 12px;
        border-radius: 6px;
        border: none;
        font-weight: 600;
        font-size: 14px;
        cursor: pointer;
        text-decoration: none;
        color: white;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .btn-svg { background-color: #8e44ad; } 
    .btn-png { background-color: #2980b9; } 
    .btn-pdf { background-color: #27ae60; } 
    .btn-dl:hover { opacity: 0.9; }

    .error-msg {
        background: #fff5f5; color: #c53030;
        padding: 15px; border-radius: 8px;
        margin-top: 20px; display: none; font-weight: 600;
        border: 1px solid #fc8181;
    }
    
    .tech-specs { font-size: 11px; color: #999; margin-top: 20px; text-align: center; }

    /* --- Content Section Styles --- */
    .content-area {
        text-align: left;
        margin-top: 60px;
        padding-top: 30px;
        border-top: 1px solid #e1e4e8;
    }
    .content-area h2 { font-size: 24px; font-weight: 800; margin-bottom: 20px; color: #111; }
    .content-area h3 { font-size: 18px; font-weight: 700; margin-top: 30px; margin-bottom: 10px; color: #222; }
    .content-area h4 { font-size: 15px; font-weight: 700; margin-top: 15px; margin-bottom: 5px; color: #444; }
    .content-area p { margin-bottom: 15px; line-height: 1.6; color: #555; }
    .content-area ul { margin-bottom: 20px; padding-left: 20px; text-align: left; }
    .content-area li { margin-bottom: 8px; color: #555; line-height: 1.6; font-size: 15px; }
    .disclaimer { font-size: 13px; color: #777; margin-top: 30px; padding: 15px; background: #f9f9f9; border-radius: 6px; border-left: 3px solid #ccc; }
  /* --- MOBILE CSS START --- */
@media (max-width: 768px) {
    
    /* Layout Fixes */
    .main-layout-wrapper {
        margin: 10px auto;
        /* OLD: padding: 80px; <--- YE GALAT THA (Too much side space) */
        
        /* NEW CORRECTED: Top pe 80px (header ke liye), baaki sides 15px */
        padding: 80px 15px 20px 15px; 
        
        display: block; 
    }

    /* Tool Container - Padding kam ki */
    .isbn-tool-container {
        padding: 25px 15px;
        margin: 0 auto;
        width: 100%;
        border: none; 
        box-shadow: none;
    }

    /* Heading Size Adjustment */
    .isbn-tool-container h1 {
        font-size: 22px;
    }

    /* Input Field - iOS Zoom Fix */
    .isbn-input {
        font-size: 16px; 
        padding: 14px;
    }

    /* Download Buttons - Stack vertically */
    .dl-grid {
        grid-template-columns: 1fr; 
        gap: 10px;
    }

    .btn-dl {
        padding: 14px;
        font-size: 16px;
    }

    /* Content Area Readability */
    .content-area {
        margin-top: 30px;
        padding-top: 20px;
    }
    
    .content-area h2 {
        font-size: 20px;
    }
}
/* --- MOBILE CSS END --- */
