/* ============================================
   RESET & BASE
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #4a7cff;
    --primary-dark: #3b6ce6;
    --primary-light: #eef3ff;
    --accent: #8b5cf6;
    --text: #1a1d23;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg: #f5f7fa;
    --white: #ffffff;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --success: #10b981;
    --success-bg: #d1fae5;
    --danger: #ef4444;
    --warning: #f59e0b;
    --transition: all 0.2s ease;
    --navbar-h: 68px;
}

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    height: var(--navbar-h);
    flex-shrink: 0;
}
.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 2rem;
}
.navbar-logo {
    display: flex; align-items: center; gap: 0.6rem;
    font-weight: 800; font-size: 1.15rem;
    color: var(--text); flex-shrink: 0;
    transition: var(--transition);
}
.navbar-logo:hover { color: var(--primary); }
.logo-icon {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    box-shadow: 0 4px 12px #3d6de64d;
    flex-shrink: 0;
}
.logo-text {
    background: linear-gradient(135deg, #25223f, #151058);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.navbar-links {
    display: flex; align-items: center; gap: 0.25rem;
    list-style: none; margin: 0; padding: 0;
}
.nav-link {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.5rem 0.9rem; border-radius: 10px;
    font-size: 0.95rem; font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    white-space: nowrap; background: none; border: none;
    cursor: pointer; font-family: inherit;
}
.nav-link:hover { background: var(--primary-light); color: var(--primary); }
.nav-link.active { color: var(--primary); background: var(--primary-light); }
.nav-dropdown { position: relative; }
.dropdown-toggle .chevron {
    width: 14px; height: 14px;
    transition: transform 0.2s;
    stroke: currentColor;
}
.dropdown-toggle.open .chevron { transform: rotate(180deg); }
.dropdown-menu {
    position: absolute; top: calc(100% + 8px); left: 0;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}
.dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
    display: block; padding: 0.6rem 0.9rem;
    border-radius: 8px; font-size: 0.9rem; font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.navbar-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none;
    padding: 8px; cursor: pointer; border-radius: 8px;
}
.navbar-toggle:hover { background: var(--bg); }
.navbar-toggle span {
    width: 22px; height: 2.5px;
    background: var(--text); border-radius: 999px;
    transition: var(--transition);
}
.navbar-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; }
.navbar-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 3rem 1.5rem 1.5rem;
    margin-top: 2rem;
}
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-top {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem; padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border);
}
.footer-col { display: flex; flex-direction: column; }
.footer-heading {
    font-size: 11px; font-weight: 800;
    color: var(--text); text-transform: uppercase;
    letter-spacing: 0.08em; margin-bottom: 1.15rem;
}
.footer-links {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 0.7rem;
}
.footer-links a {
    color: var(--text-muted); font-size: 14px;
    font-weight: 500; transition: var(--transition);
    display: inline-block;
}
.footer-links a:hover { color: var(--primary); transform: translateX(2px); }
.footer-bottom {
    display: flex; justify-content: space-between;
    align-items: center; padding-top: 1.5rem;
    gap: 1rem; flex-wrap: wrap;
}
.footer-copy { font-size: 13px; color: var(--text-light); margin: 0; }
.footer-socials { display: flex; gap: 0.4rem; align-items: center; }
.footer-socials a {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; color: var(--text-muted);
    transition: var(--transition);
}
.footer-socials a:hover {
    background: var(--primary-light); color: var(--primary);
    transform: translateY(-2px);
}
.footer-socials svg { width: 18px; height: 18px; }

/* ============================================
   HOME PAGE
   ============================================ */
.home-page {
    height: calc(100vh - var(--navbar-h));
    overflow-y: auto;
    background: var(--bg);
    padding: 2rem 1rem;
}
.home-page::-webkit-scrollbar { width: 8px; }
.home-page::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.home-container {
    max-width: 900px; margin: 0 auto;
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}
.home-header { text-align: center; margin-bottom: 1.5rem; }
.home-title {
    font-size: 2.25rem; font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #4a7cff, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.home-subtitle {
    color: var(--text-muted);
    font-size: 1rem; max-width: 620px;
    margin: 0 auto; line-height: 1.6;
}
.feature-badges {
    display: flex; flex-wrap: wrap;
    justify-content: center; gap: 0.5rem;
    margin-bottom: 2rem;
}
.badge {
    padding: 0.35rem 0.85rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.8rem; font-weight: 600;
}
.upload-launcher {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 24px;
    cursor: pointer;
    transition: var(--transition);
    margin: 1.5rem 0 2rem;
    min-height: 340px;
}
.upload-launcher:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(74, 124, 255, 0.15);
}
.upload-launcher.dragover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    transform: scale(1.02);
}
.upload-launcher-icon {
    width: 90px; height: 90px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4a7cff, #8b5cf6);
    border-radius: 22px;
    margin-bottom: 1.25rem;
    box-shadow: 0 12px 32px rgba(74, 124, 255, 0.35);
    animation: floatIcon 3s ease-in-out infinite;
}
@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.upload-launcher-icon svg { width: 42px; height: 42px; color: white; stroke-width: 2.2; }
.upload-launcher h2 {
    font-size: 1.65rem; font-weight: 800;
    color: var(--text); margin-bottom: 0.5rem;
}
.upload-launcher p {
    color: var(--text-muted); font-size: 1rem;
    margin-bottom: 1.75rem; max-width: 420px;
}
.upload-btn-big {
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #4a7cff, #8b5cf6);
    color: white; border-radius: 14px;
    font-size: 1.05rem; font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 12px 32px rgba(74, 124, 255, 0.35);
}
.upload-btn-big:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 44px rgba(74, 124, 255, 0.45);
}
.upload-btn-big .icon { font-size: 1.3rem; }
.formats {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem; font-weight: 600;
    color: var(--text-muted);
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.privacy-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}
.seo-section {
    margin-top: 2.5rem; padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.seo-title { font-size: 1.35rem; font-weight: 700; margin-bottom: 1rem; }
.seo-steps, .seo-features {
    padding-left: 1.25rem;
    display: flex; flex-direction: column; gap: 0.6rem;
}
.seo-steps li, .seo-features li {
    color: var(--text-muted); font-size: 0.95rem; line-height: 1.6;
}
.seo-steps li strong, .seo-features li strong { color: var(--text); }
.faq-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1.25rem;
    margin-bottom: 0.6rem;
}
.faq-item[open] { border-color: var(--primary); }
.faq-item summary {
    font-weight: 600; font-size: 0.95rem;
    cursor: pointer; list-style: none;
    display: flex; justify-content: space-between;
    align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+'; font-size: 1.3rem;
    color: var(--primary); font-weight: 300;
    transition: var(--transition);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
    color: var(--text-muted); font-size: 0.9rem;
    margin-top: 0.6rem; padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}

/* ============================================
   EDITOR PAGE
   ============================================ */
.editor-wrap {
    display: flex; flex-direction: column;
    height: 100vh; overflow: hidden;
}
.editor-scroll {
    flex: 1; overflow-y: auto; overflow-x: hidden;
}
.app-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    min-height: calc(100vh - var(--navbar-h));
}
.sidebar {
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

.top-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0;
    background: var(--white); z-index: 10;
}
.toolbar-icon-btn {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    transition: var(--transition);
    flex-shrink: 0;
}
.toolbar-icon-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.toolbar-icon-btn svg { width: 20px; height: 20px; stroke-width: 2; }
.toolbar-icon-btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.toolbar-icon-btn.primary:hover {
    background: var(--primary-dark); color: white;
}
.toolbar-spacer { flex: 1; }
.max-file-info {
    padding: 10px 20px 16px;
    font-size: 12px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-light);
}
.sidebar-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}
.section-title {
    font-size: 16px; font-weight: 700;
    color: var(--text); margin-bottom: 14px;
    display: flex; align-items: center;
    justify-content: space-between;
}

/* Target size presets */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.preset-btn {
    display: flex; flex-direction: column;
    align-items: center; gap: 0.1rem;
    padding: 0.6rem 0.3rem;
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 13px; font-weight: 700;
    color: var(--text);
    transition: var(--transition);
    cursor: pointer;
    font-family: inherit;
}
.preset-btn small {
    font-size: 9px;
    font-weight: 500;
    color: var(--text-light);
}
.preset-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.preset-btn.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.preset-btn.active small { color: var(--primary); }

.preset-btn[data-size="custom"] {
    grid-column: span 2;
}
.custom-size-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.custom-size-input input {
    flex: 1;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    min-width: 0;
}
.custom-size-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 124, 255, 0.1);
}
.custom-size-input select {
    padding: 11px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    background: white;
    cursor: pointer;
    outline: none;
}
.custom-size-input select:focus { border-color: var(--primary); }

.help-text {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 8px;
    line-height: 1.5;
}

/* Quality slider */
.quality-slider {
    width: 100%;
    margin: 0.5rem 0;
    accent-color: var(--primary);
}
.quality-labels {
    display: flex; justify-content: space-between;
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
}

/* Info boxes */
.info-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}
.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 0.5rem;
}
.info-row:last-child { margin-bottom: 0; }
.info-row .label { color: var(--text-muted); }
.info-row .value { font-weight: 700; color: var(--text); }
.info-row .value.success { color: var(--success); }

/* Action buttons */
.action-buttons {
    padding: 20px;
    display: flex; flex-direction: column;
    gap: 0.6rem;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: var(--white);
}
.btn-full {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px; font-weight: 700;
    display: flex; align-items: center;
    justify-content: center; gap: 8px;
    transition: var(--transition);
    font-family: inherit;
    cursor: pointer;
}
.btn-apply {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(74, 124, 255, 0.35);
}
.btn-apply:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
.btn-apply:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-download {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-download:hover:not(:disabled) { background: #059669; transform: translateY(-1px); }
.btn-download:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-outline {
    background: white; color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}
.btn-full svg { width: 18px; height: 18px; }

/* Main content — PDF preview */
.main-content {
    background: var(--bg);
    display: flex; flex-direction: column;
    min-height: 100%;
    padding: 24px;
    gap: 16px;
}

.pdf-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid var(--border-light);
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.pdf-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

.pdf-info {
    flex: 1;
    min-width: 200px;
}
.pdf-info h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    word-break: break-word;
    color: var(--text);
}
.pdf-info p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Preview grid */
.preview-section {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid var(--border-light);
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.preview-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.preview-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}
.preview-page {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.preview-page canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}
.preview-page .page-num {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Processing overlay */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 2rem;
    text-align: center;
}
.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.15);
    border-top-color: #4a7cff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.processing-status {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-bottom: 1.5rem;
    min-height: 1.4em;
}
.progress-track {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a7cff, #8b5cf6);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 999px;
}

/* Result modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex; align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: scaleIn 0.3s ease;
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.modal h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: center;
}
.result-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.stat-box { text-align: center; }
.stat-box .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.stat-box .value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-top: 4px;
}
.stat-box .value.success { color: var(--success); }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    transition: var(--transition);
}
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }

/* Toast */
.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 99999;
    display: flex; flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    padding: 12px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease;
    min-width: 220px;
}
.toast-success { background: rgba(16, 185, 129, 0.96); }
.toast-error { background: rgba(239, 68, 68, 0.96); }
.toast-info { background: rgba(74, 124, 255, 0.96); }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .navbar-container { padding: 0 1rem; height: 60px; }
    .navbar-toggle { display: flex; }
    .navbar-links {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: white;
        flex-direction: column;
        align-items: stretch;
        padding: 0 1rem;
        gap: 0.25rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
    }
    .navbar-links.open {
        max-height: 600px;
        opacity: 1;
        padding: 1rem;
    }
    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    .nav-dropdown { width: 100%; }
    .dropdown-toggle { width: 100%; justify-content: space-between; }
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--bg);
        padding: 0;
        margin-top: 0.25rem;
        max-height: 0;
        overflow: hidden;
    }
    .dropdown-menu.open { max-height: 300px; padding: 0.5rem; }

    .app-layout { grid-template-columns: 1fr; }
    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .footer-top { grid-template-columns: repeat(2, 1fr); gap: 2rem 1.5rem; }
}

@media (max-width: 600px) {
    .home-page { padding: 1rem; }
    .home-container { padding: 1.5rem 1.25rem; border-radius: 20px; }
    .home-title { font-size: 1.6rem; }
    .home-subtitle { font-size: 0.9rem; }
    .upload-launcher { padding: 2.5rem 1rem; min-height: 280px; }
    .upload-launcher-icon { width: 70px; height: 70px; border-radius: 18px; }
    .upload-launcher-icon svg { width: 34px; height: 34px; }
    .upload-launcher h2 { font-size: 1.3rem; }
    .upload-launcher p { font-size: 0.9rem; }
    .upload-btn-big {
        padding: 0.9rem 1.75rem;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
    }
    .seo-title { font-size: 1.1rem; }
    .seo-steps li, .seo-features li { font-size: 0.85rem; }
    .faq-item { padding: 0.75rem 1rem; }
    .faq-item summary { font-size: 0.85rem; }
    .faq-item p { font-size: 0.8rem; }

    .top-toolbar { padding: 12px 16px; gap: 6px; }
    .toolbar-icon-btn { width: 42px; height: 42px; }
    .toolbar-icon-btn svg { width: 18px; height: 18px; }
    .sidebar-section { padding: 16px; }
    .section-title { font-size: 15px; }
    .action-buttons { padding: 16px; }
    .btn-full { padding: 12px 16px; font-size: 14px; }

    .main-content { padding: 16px; gap: 12px; }
    .pdf-card { padding: 16px; gap: 12px; }
    .pdf-icon { width: 48px; height: 48px; font-size: 20px; }
    .preview-section { padding: 16px; }
    .preview-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }

    .toast-container { top: 10px; right: 10px; left: 10px; }
    .toast { min-width: auto; font-size: 12px; padding: 10px 14px; }

    .modal { padding: 24px 20px; }
    .modal h2 { font-size: 18px; }
    .stat-box .value { font-size: 16px; }

    /* Footer mobile */
    .site-footer { padding: 2rem 1rem 1rem; }
    .footer-top {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        text-align: center;
        padding-bottom: 1.75rem;
    }
    .footer-col {
        align-items: center;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--border-light);
    }
    .footer-col:last-child { border-bottom: none; padding-bottom: 0; }
    .footer-links { align-items: center; gap: 0.7rem; }
    .footer-links a { padding: 0.4rem 0; min-height: 32px; line-height: 24px; }
    .footer-links a:hover { transform: none; }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding-top: 1.5rem;
    }
    .footer-copy { order: 2; font-size: 12px; }
    .footer-socials { order: 1; justify-content: center; width: 100%; }
    .footer-socials a { width: 42px; height: 42px; background: var(--bg); }
    .footer-socials svg { width: 20px; height: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* ============================================
   📊 PDF INFO SECTION (below preview)
   ============================================ */
.info-section-main {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid var(--border-light);
}

.info-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.info-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    transition: var(--transition);
}

.info-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.info-card-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.info-card-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    word-break: break-word;
}

.info-card-value.success {
    color: var(--success);
}

/* Mobile */
@media (max-width: 600px) {
    .info-section-main { padding: 16px; }
    .info-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .info-card { padding: 10px 8px; }
    .info-card-label { font-size: 10px; margin-bottom: 4px; }
    .info-card-value { font-size: 15px; }
}

@media (max-width: 400px) {
    .info-cards { grid-template-columns: 1fr 1fr; }
}