/* =================================================================
💰 MOBILE-FIRST RESPONSIVE PDF PAGE REMOVER - 2025年Google AdSense最適化仕様
================================================================= */

/* 広告サイズ定数 (Google AdSense 2025仕様準拠) */
:root {
    --mobile-banner-width: 320px;
    --mobile-banner-height: 50px;
    --mobile-banner-large-height: 100px;
    --medium-rectangle-width: 300px;
    --medium-rectangle-height: 250px;
    --leaderboard-width: 728px;
    --leaderboard-height: 90px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #374151;
    background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - Mobile First */
header {
    text-align: center;
    margin-bottom: 24px;
    padding: 0 16px;
}

header h1 {
    font-size: 1.875rem; /* 30px mobile */
    color: #3b82f6;
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.2;
}

header p {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 16px;
}

.enhanced-features {
    font-size: 0.875rem; /* 14px */
    color: #059669;
    font-weight: 500;
    margin-bottom: 8px;
    margin-top: 8px;
}

/* 3 Steps Visual Design - Oval Style */
.three-steps-visual {
    margin: 16px 0;
    text-align: center;
}

.steps-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px; /* Reduced gap to accommodate arrows */
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.step {
    /* Remove positioning for separate ovals */
}

.step-circle {
    width: 80px;
    height: 36px;
    border-radius: 18px;
    background: #e2e8f0;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.step:first-child .step-circle {
    background: #dbeafe;
    border-color: #93c5fd;
}

.step:last-child .step-circle {
    background: #dbeafe;
    border-color: #93c5fd;
}

.step-label {
    /* Labels are now inside the ovals, no separate text needed */
    display: none;
}

.step-arrow {
    color: #6b7280;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0 4px;
    display: flex;
    align-items: center;
}

.steps-subtitle {
    font-size: 0.875rem;
    color: #3b82f6;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.025em;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .step-circle {
        width: 70px;
        height: 32px;
        border-radius: 16px;
        font-size: 0.75rem;
    }

    .steps-container {
        gap: 6px;
    }

    .step-arrow {
        font-size: 1rem;
        margin: 0 2px;
    }
}

/* Navigation Styles */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.main-nav a {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.main-nav a:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* Main Content - Mobile First */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Upload Area - Mobile First */
.upload-area {
    width: 100%;
    max-width: 480px;
    min-height: 280px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
    /* Mobile touch improvements */
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
    touch-action: manipulation;
    position: relative;
    z-index: 1;
}

.upload-area:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
}

.upload-area.dragover {
    border-color: #10b981;
    background: #f0fdf4;
    transform: scale(1.02);
}

.upload-content {
    text-align: center;
    padding: 24px;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.7;
}

.upload-content h2 {
    font-size: 1.5rem;
    color: #374151;
    margin-bottom: 12px;
}

.upload-content p {
    font-size: 1rem;
    color: #6b7280;
}

.file-select-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Mobile touch improvements */
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
    touch-action: manipulation;
    user-select: none;
    position: relative;
    z-index: 10;
    min-height: 44px; /* iOS minimum touch target */
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.file-select-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.file-select-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Processing Area */
.processing-area {
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.processing-area h3 {
    text-align: center;
    font-size: 1.25rem;
    color: #374151;
    margin-bottom: 20px;
}

.page-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.page-thumbnail {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-thumbnail:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
    background: #f8fafc;
}

.page-thumbnail.selected {
    border-color: #ef4444;
    background: #fef2f2;
}

.page-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 8px;
}

.page-thumbnail canvas {
    width: 100%;
    height: auto;
    border-radius: 4px;
    max-width: 200px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #f9fafb;
}

.page-number {
    margin-top: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.page-controls {
    margin-top: 8px;
    text-align: center;
    width: 100%;
}

.delete-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    user-select: none;
}

.delete-checkbox input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.page-thumbnail.selected-for-deletion {
    border-color: #ef4444;
    background-color: #fee2e2;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.delete-indicator {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    margin-top: 4px;
    align-self: flex-end;
}

/* Actions - Mobile First */
.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    align-items: center;
}

.process-btn,
.cancel-btn,
.download-btn,
.restart-btn {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.process-btn {
    background: #ef4444;
    color: white;
}

.process-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.process-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.cancel-btn,
.restart-btn {
    background: #6b7280;
    color: white;
}

.cancel-btn:hover,
.restart-btn:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.download-btn {
    background: #10b981;
    color: white;
    margin-right: 0;
}

.download-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Download Area */
.download-area {
    text-align: center;
    background: white;
    border-radius: 12px;
    padding: 32px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 480px;
}

/* Responsive container for leaderboard ads */
@media (min-width: 768px) {
    .download-area {
        max-width: 760px; /* 728px leaderboard + 32px padding */
    }
}

.download-area h3 {
    font-size: 1.5rem;
    color: #10b981;
    margin-bottom: 12px;
}

.download-area p {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 20px;
}

/* SEO Content Section */
.seo-content {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    margin: 24px auto;
    max-width: 700px;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.seo-content h2 {
    color: #1f2937;
    font-size: 1.25rem;
    margin: 20px 0 12px 0;
    font-weight: 600;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content p {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.seo-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.seo-list li {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.8;
    padding: 4px 0;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 32px;
    padding: 16px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

/* 🔒 Security Guarantee Section */
.security-guarantee {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.security-guarantee h4 {
    color: #0369a1;
    font-size: 1rem;
    margin-bottom: 8px;
    text-align: center;
}

.security-features {
    list-style: none;
    color: #0f172a;
    font-size: 0.875rem;
    line-height: 1.5;
}

.security-features li {
    margin-bottom: 4px;
    padding-left: 0;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.footer-nav a {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.footer-nav a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* Legal Pages Styles */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    line-height: 1.7;
    text-align: left;
    word-wrap: break-word;
}

.legal-content h1 {
    color: #1f2937;
    margin-bottom: 16px;
    font-size: 2rem;
    border-bottom: 3px solid #3b82f6;
    padding-bottom: 12px;
}

.legal-content h2 {
    color: #374151;
    margin: 32px 0 16px 0;
    font-size: 1.5rem;
    text-align: left;
    width: 100%;
}

.legal-content h3 {
    color: #4b5563;
    margin: 24px 0 12px 0;
    font-size: 1.25rem;
    text-align: left;
    width: 100%;
}

.legal-content h4 {
    color: #6b7280;
    margin: 20px 0 8px 0;
    font-size: 1.125rem;
    text-align: left;
    width: 100%;
}

.legal-content section {
    margin-bottom: 24px;
    text-align: left;
    width: 100%;
    display: block;
}

.legal-content ul {
    margin: 12px 0;
    padding-left: 32px;
    list-style-type: disc;
    text-align: left;
    width: 100%;
}

.legal-content li {
    margin-bottom: 8px;
    padding-left: 4px;
    text-indent: 0;
    text-align: left;
}

.legal-content ol {
    margin: 12px 0;
    padding-left: 32px;
    list-style-type: decimal;
    text-align: left;
    width: 100%;
}

.legal-content ol li {
    margin-bottom: 8px;
    padding-left: 4px;
    text-align: left;
}

.legal-content p {
    margin-bottom: 12px;
    text-align: left;
    width: 100%;
}

.last-updated {
    color: #6b7280;
    font-style: italic;
    margin-bottom: 32px;
    padding: 12px;
    background: #f9fafb;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
}

/* Contact Page Specific Styles */
.contact-info {
    background: #f8fafc;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin: 24px 0;
}

.email-address {
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    font-family: monospace;
    text-align: center;
    margin: 16px 0;
}

.contact-guidelines, .response-time {
    margin: 20px 0;
    padding: 16px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #10b981;
}

.faq-item {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 4px solid #3b82f6;
}

.faq-item h3 {
    color: #1f2937;
    margin-bottom: 8px;
}

.operator-info {
    background: #eff6ff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    margin: 20px 0;
}

/* Legal Pages Responsive */
@media (max-width: 768px) {
    .legal-content {
        padding: 16px;
        margin: 16px;
        border-radius: 8px;
    }

    .legal-content h1 {
        font-size: 1.75rem;
    }

    .legal-content h2 {
        font-size: 1.25rem;
    }

    .legal-content h3 {
        font-size: 1.125rem;
    }

    .legal-content ul, .legal-content ol {
        padding-left: 24px;
    }

    .contact-info, .faq-item, .operator-info {
        padding: 16px;
        margin: 16px 0;
    }
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =================================================================
💰 2025年Google AdSense最適化 - Mobile First広告配置
================================================================= */

/* 広告コンテナ共通スタイル - Mobile First */
.ad-container {
    margin: 16px 0;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.ad-container:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.ad-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* AD ZONE 1: アップロード段階 - Mobile Banner (320x50) */
.ad-upload-phase {
    margin-top: 20px;
    width: 100%;
    max-width: var(--mobile-banner-width);
}

.upload-banner {
    width: var(--mobile-banner-width);
    height: var(--mobile-banner-height);
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #6b7280;
}

/* AD ZONE 2: ページ選択段階 - Medium Rectangle (300x250) */
.selection-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.selection-content {
    width: 100%;
}

.ad-sidebar {
    height: fit-content;
    width: 100%;
}

.selection-sidebar {
    width: var(--medium-rectangle-width);
    height: var(--medium-rectangle-height);
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #6b7280;
    align-self: center;
}

/* AD ZONE 3: 処理中オーバーレイ（黄金時間） - Medium Rectangle */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.processing-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.processing-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.processing-ads {
    margin-top: 20px;
    background: #f8fafc;
    width: 100%;
    display: flex;
    justify-content: center;
}

.processing-banner {
    width: var(--medium-rectangle-width);
    height: var(--medium-rectangle-height);
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #6b7280;
}

/* AD ZONE 4: 完了段階 - Mobile Banner Large + Leaderboard */
.completion-ads {
    margin-bottom: 16px;
    background: #f0fdf4;
    border-color: #bbf7d0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.completion-banner {
    width: var(--mobile-banner-width);
    height: var(--mobile-banner-large-height);
    background: #f0fdf4;
    border: 2px dashed #bbf7d0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #047857;
}

/* Desktop用Leaderboard広告 */
.completion-leaderboard {
    display: none;
}

/* アフィリエイト推薦エリア - Mobile First */
.affiliate-recommendations {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    width: 100%;
}

.affiliate-recommendations h4 {
    color: #374151;
    margin-bottom: 16px;
    font-size: 1rem;
    text-align: center;
}

.affiliate-products {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 100%;
}

.affiliate-product {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: all 0.3s ease;
    overflow: hidden;
}

.affiliate-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: #3b82f6;
}

.product-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    min-height: 140px;
    background: #f9fafb;
    border-radius: 6px;
    overflow: hidden;
}

.product-image {
    max-width: 100%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.product-name {
    display: block;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.product-desc {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
}

/* 🎯 差別化要素の視覚的強調 */
.differentiation-highlight {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.differentiation-highlight::before {
    content: "⚡ 競合より簡単";
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    align-self: flex-end;
    width: fit-content;
}

/* AdSense最適化 - 2025年仕様対応 */
.adsbygoogle {
    display: block;
    width: 100%;
    height: auto;
}

/* Mobile Banner (320x50) */
.adsbygoogle.mobile-banner {
    width: var(--mobile-banner-width);
    height: var(--mobile-banner-height);
}

/* Mobile Banner Large (320x100) */
.adsbygoogle.mobile-banner-large {
    width: var(--mobile-banner-width);
    height: var(--mobile-banner-large-height);
}

/* Medium Rectangle (300x250) */
.adsbygoogle.medium-rectangle {
    width: var(--medium-rectangle-width);
    height: var(--medium-rectangle-height);
}

/* Leaderboard (728x90) - Desktop only */
.adsbygoogle.leaderboard {
    width: 100%;
    max-width: var(--leaderboard-width);
    height: var(--leaderboard-height);
    display: none;
}

/* Responsive ads */
.adsbygoogle.responsive {
    width: 100%;
    min-height: 50px;
}

/* 広告ブロッカー対策 */
.ad-fallback {
    display: none;
    padding: 16px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    color: #92400e;
    text-align: center;
    font-size: 0.875rem;
}

/* 💰 収益最適化のための処理遅延インジケーター */
.revenue-optimization {
    opacity: 0;
    animation: fadeInRevenue 0.5s ease forwards;
}

@keyframes fadeInRevenue {
    to {
        opacity: 1;
    }
}

/* フォーカス状態の改善 */
.process-btn:focus,
.cancel-btn:focus,
.download-btn:focus,
.restart-btn:focus,
.file-select-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* =================================================================
📱 TABLET & DESKTOP BREAKPOINTS - Progressive Enhancement
================================================================= */

/* Tablet (768px+) */
@media (min-width: 768px) {
    .container {
        padding: 20px;
    }

    header {
        margin-bottom: 40px;
    }

    header h1 {
        font-size: 2.5rem;
        margin-bottom: 10px;
    }

    header p {
        font-size: 1.2rem;
    }

    .upload-area {
        max-width: 600px;
        min-height: 400px;
        border-width: 3px;
        border-radius: 20px;
        margin-bottom: 30px;
    }

    .upload-content {
        padding: 40px;
    }

    .upload-content h2 {
        font-size: 1.8rem;
    }

    .upload-icon {
        font-size: 4rem;
        margin-bottom: 20px;
    }

    .file-select-btn {
        padding: 12px 24px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .processing-area {
        padding: 30px;
    }

    .processing-area h3 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .page-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
    }

    .page-thumbnail {
        padding: 10px;
    }

    .page-number {
        font-size: 1rem;
    }

    .delete-indicator {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .actions {
        flex-direction: row;
        gap: 15px;
        max-width: none;
        width: auto;
    }

    .process-btn,
    .cancel-btn,
    .download-btn,
    .restart-btn {
        width: auto;
        min-width: 120px;
        padding: 15px 30px;
        font-size: 1.1rem;
        border-radius: 8px;
    }

    .download-area {
        padding: 40px;
        max-width: 600px;
    }

    .download-area h3 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .download-area p {
        font-size: 1.1rem;
        margin-bottom: 25px;
    }

    .download-btn {
        margin-right: 15px;
    }

    footer {
        margin-top: 40px;
        padding: 20px;
        font-size: 1rem;
    }

    /* 広告最適化 - Tablet */
    .ad-container {
        margin: 20px 0;
        padding: 15px;
    }

    .ad-upload-phase {
        margin-top: 30px;
        max-width: 600px;
    }

    .upload-banner {
        height: 90px;
        width: 100%;
        max-width: 600px;
        font-size: 0.875rem;
    }

    .processing-content {
        padding: 40px;
        max-width: 500px;
    }

    .processing-spinner {
        width: 50px;
        height: 50px;
        border-width: 4px;
        margin-bottom: 20px;
    }

    .processing-ads {
        margin-top: 30px;
    }

    .processing-banner {
        font-size: 0.875rem;
    }

    .completion-ads {
        margin-bottom: 20px;
    }

    .completion-banner {
        display: none;
    }

    .completion-leaderboard {
        display: flex;
        width: 100%;
        max-width: var(--leaderboard-width);
        height: var(--leaderboard-height);
        background: #f0fdf4;
        border: 2px dashed #bbf7d0;
        border-radius: 4px;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
        color: #047857;
    }

    .affiliate-recommendations {
        margin-top: 30px;
        padding: 25px;
        border-radius: 12px;
    }

    .affiliate-recommendations h4 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .affiliate-products {
        grid-template-columns: repeat(2, 1fr);
    }

    .affiliate-product {
        padding: 20px;
        border-radius: 10px;
    }

    .product-image-container {
        min-height: 160px;
    }

    .product-image {
        max-height: 140px;
    }

    .product-name {
        font-size: 1rem;
        margin-bottom: 5px;
    }

    .product-desc {
        font-size: 0.9rem;
    }

    .adsbygoogle.leaderboard {
        display: block;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .page-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .selection-layout {
        display: grid;
        grid-template-columns: 1fr 320px;
        gap: 30px;
        margin-bottom: 30px;
    }

    .selection-content {
        min-height: 400px;
    }

    .ad-sidebar {
        position: sticky;
        top: 20px;
    }

    .selection-sidebar {
        min-height: 600px;
        width: 100%;
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }

    .affiliate-products {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .affiliate-product {
        padding: 24px;
        border-radius: 12px;
    }

    .product-image-container {
        min-height: 180px;
    }

    .product-image {
        max-height: 160px;
    }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
    .page-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 25px;
    }
}

/* =================================================================
📱 MOBILE OPTIMIZATION CSS
================================================================= */

/* Mobile device warnings and notifications */
.mobile-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

.mobile-notice {
    font-size: 0.875rem;
    font-weight: 600;
    color: #b45309;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mobile-limit {
    font-size: 0.75rem;
    color: #92400e;
    margin: 0;
    line-height: 1.4;
}

/* Enhanced mobile touch optimization */
@media (max-width: 768px) {
    .mobile-warning {
        margin: 16px auto;
        max-width: 90%;
    }

    .page-thumbnail {
        min-height: 60px;
        touch-action: manipulation;
        -webkit-user-select: none;
        user-select: none;
    }

    .page-thumbnail:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* ================================================================= */
/* 💰 MONETIZATION PROGRESS MODAL - 収益最大化CSS */
/* ================================================================= */

/* Progress Modal Overlay - Mobile First */
.progress-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000; /* 最高優先度 */
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    animation: modalFadeIn 0.4s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(6px);
    }
}

/* Progress Modal Container */
.progress-modal-container {
    background: white;
    border-radius: 20px;
    padding: 32px 24px;
    width: 90%;
    max-width: 420px;
    box-shadow:
        0 25px 80px rgba(0,0,0,0.4),
        0 0 0 1px rgba(255,255,255,0.1);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Progress Header */
.progress-header {
    text-align: center;
    margin-bottom: 24px;
}

.progress-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: pulseIcon 2s ease-in-out infinite;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.progress-title {
    font-size: 1.375rem;
    color: #1f2937;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

/* Progress Bar Section */
.progress-section {
    margin-bottom: 24px;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: transparent;
    border-radius: 8px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 50%, #06d6a0 100%);
    border-radius: 8px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.4),
        transparent
    );
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
}

#progress-percentage {
    font-size: 1.125rem;
    font-weight: 600;
    color: #3b82f6;
}

/* 💰 Monetization Zone - 広告エリア */
.monetization-zone {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
}

.ad-label {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.ad-container-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px; /* レクタングル広告対応 */
    width: 100%;
    max-width: 300px; /* Medium Rectangle 幅確保 */
    border-radius: 8px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    position: relative;
    margin: 0 auto; /* 中央配置 */
}

.progress-ad {
    width: 300px; /* Medium Rectangle 固定幅 */
    height: 250px; /* Medium Rectangle 固定高 */
    display: block !important;
}

/* Progress Message */
.progress-message {
    text-align: center;
    margin-bottom: 20px;
}

#progress-text {
    font-size: 1rem;
    color: #4b5563;
    margin: 0;
    line-height: 1.5;
}

/* Progress Actions - ボタンエリア */
.progress-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.progress-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.progress-btn-ok {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.progress-btn-ok:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.progress-btn-ok:disabled {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 6px rgba(107, 114, 128, 0.2);
    opacity: 0.8;
}

.progress-btn-cancel {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.progress-btn-cancel:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* ================================================================= */
/* RESPONSIVE DESIGN - モバイル最適化 */
/* ================================================================= */

/* モバイル (320px-767px) */
@media (max-width: 767px) {
    .progress-modal-container {
        width: 95%;
        padding: 24px 20px;
        margin: 16px;
    }

    .progress-title {
        font-size: 1.25rem;
    }

    .ad-container-progress {
        min-height: 200px; /* モバイル広告調整 */
    }

    .progress-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: 80px;
    }
}

/* タブレット (768px-1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .progress-modal-container {
        width: 80%;
        max-width: 480px;
    }

    .ad-container-progress {
        min-height: 250px;
    }
}

/* デスクトップ (1024px以上) */
@media (min-width: 1024px) {
    .progress-modal-container {
        width: 70%;
        max-width: 500px;
        padding: 36px 32px;
    }

    .progress-title {
        font-size: 1.5rem;
    }

    .ad-container-progress {
        min-height: 250px;
    }
}

/* ================================================================= */
/* ACCESSIBILITY & PERFORMANCE */
/* ================================================================= */

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .progress-modal-container {
        border: 2px solid #000;
    }

    .progress-fill {
        background: #000;
    }

    .ad-label {
        color: #000;
    }
}

/* アニメーション削減設定 */
@media (prefers-reduced-motion: reduce) {
    .progress-modal-overlay,
    .progress-modal-container,
    .progress-fill,
    .progress-icon {
        animation: none;
        transition: none;
    }
}

/* Mobile processing overlay enhancements */
.processing-overlay {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Memory optimization indicators */
.memory-warning {
    background: #fef2f2;
    border: 1px solid #f87171;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 8px;
    text-align: center;
}

/* =================================================================
🚨 開発者への収益化リマインダー
================================================================= */

/*
💰 常に意識すべき収益化ポイント:
1. シンプル特化 = 滞在時間増加 = 広告表示機会増
2. 処理待機時間 = 広告効果最大化の黄金時間
3. ログイン不要 = 離脱率低下 = より多くの広告表示
4. 専用ツール = 高い満足度 = アフィリエイト効果向上

🎯 差別化要素チェックリスト:
✅ 3ステップで完了しているか？
✅ ログイン不要を維持しているか？
✅ 競合より明らかに使いやすいか？
✅ 広告が自然に配置されているか？

📱 2025年AdSense最適化ポイント:
✅ Mobile Banner (320x50) - モバイル基本
✅ Mobile Banner Large (320x100) - モバイル完了時
✅ Medium Rectangle (300x250) - 選択・処理時
✅ Leaderboard (728x90) - デスクトップ完了時
✅ Responsive ads対応
✅ position:absolute完全除去
✅ Flexbox/Grid完全対応
✅ Mobile-First設計
*/

/* =================================================================
🔧 MOBILE FILE SELECTION FIX - Critical Regression Repair
================================================================= */

/* 極小スクリーン専用：ファイル選択確実動作保証 */
@media (max-width: 480px) {
    .file-select-btn {
        min-height: 48px; /* より大きなタッチターゲット */
        min-width: 120px;
        padding: 12px 24px;
        font-size: 1rem;
        font-weight: 600;
        /* タッチイベント最適化 */
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.4);
        tap-highlight-color: rgba(59, 130, 246, 0.4);
    }

    .upload-area {
        min-height: 320px; /* より大きなタッチエリア */
        /* タッチイベント強化 */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    .upload-content {
        padding: 32px 16px; /* より余裕のあるパディング */
    }

    .upload-content h2 {
        font-size: 1.25rem; /* モバイルで読みやすく */
        margin-bottom: 16px;
    }

    .upload-content p {
        font-size: 1.125rem; /* ボタン周辺のテキストを大きく */
        margin-top: 16px;
    }
}