#compressForm {
    position: relative;
    background:
        radial-gradient(circle at 18% 22%, rgba(211,47,47,0.10), transparent 46%),
        linear-gradient(135deg, #161B22 0%, #111827 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
#compressForm::before {
    content: '';
    position: absolute;
    inset: -30% 0;
    background: linear-gradient(120deg, rgba(211,47,47,0) 0%, rgba(211,47,47,0.35) 45%, rgba(211,47,47,0) 80%);
    transform: translateX(-60%);
    animation: compressSweep 6s linear infinite;
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}
#compressForm > * { position: relative; z-index: 1; }

.compress-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    margin-top: 26px;
    padding: 30px;
    text-align: left;
}

.compress-hero h1 {
    margin: 0 0 10px;
    font-size: 2.7rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.compress-hero p {
    max-width: 780px;
}

.tool-kicker {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.tool-status-badges {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 430px;
}

.tool-status-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(22,27,34,0.82);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.compress-workspace {
    max-width: 1200px;
    margin: 22px auto 0;
    padding: 28px;
    display: block;
    border: 1px solid var(--border);
    border-radius: 16px;
    background:
        radial-gradient(110% 90% at 0% 0%, rgba(211,47,47,0.08), transparent 42%),
        var(--bg-card);
    box-shadow: 0 18px 44px rgba(0,0,0,0.45);
    text-align: left;
}

.workspace-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 22px;
    align-items: start;
    margin-bottom: 18px;
}

.workspace-header h2 {
    color: var(--text-heading);
    font-size: 1.55rem;
    margin: 0 0 6px;
    letter-spacing: 0;
}

.workspace-header p:not(.tool-kicker) {
    color: var(--text-muted);
    margin: 0;
    max-width: 680px;
}

.workspace-mini-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
    min-width: 280px;
}

.workspace-mini-steps span {
    color: var(--text-primary);
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
}

.compress-result { margin-bottom: 20px; }
.compress-result h3 { margin: 0 0 10px 0; color: var(--text-heading); }
.result-card {
    background: var(--bg-section);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-primary);
    box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}
.result-log { margin: 8px 0 0 18px; color: var(--text-muted); }
.result-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.result-actions .btn-share {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
    gap: 0;
}
.result-actions .btn-share svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}
.btn-share::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: rgba(22, 27, 34, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    z-index: 20;
}
.btn-share:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}
.reduction { background: rgba(211,47,47,0.15); color: var(--text-primary); padding:2px 6px; border-radius:4px; font-weight:700; }

.hero-note { font-size: 0.9rem; color: var(--text-muted); margin-top: 10px; max-width: 700px; }

.processing-panel {
    margin-bottom: 20px;
    background: var(--bg-section);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 26px rgba(0,0,0,0.35);
}
.processing-header { display:flex; align-items:center; gap:12px; color: var(--text-primary); }
.processing-logs { margin-top:6px; font-size:0.9rem; color: var(--text-muted); }
.processing-progress { margin-top:12px; }
.processing-meta { margin-top:8px; display:flex; align-items:center; gap:8px; }
.progress-pct { font-weight:700; color: var(--success); }
.progress-note { font-size:0.9rem; color: var(--text-muted); }

.pdf-card {
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    padding:25px;
    border-radius:12px;
    border:2px dashed rgba(211,47,47,0.35);
    background:var(--bg-section);
    color:var(--text-muted);
    cursor:pointer;
    transition:transform .2s, background .2s, border-color .2s;
}
.pdf-card:hover { transform:translateY(-1px); border-color:var(--accent); background:var(--bg-elevated); }
.pdf-card.dragover { border-color:var(--accent); background:var(--bg-elevated); color:var(--text-primary); }
.upload-card p { margin: 0; font-weight: 600; color: var(--text-primary); }
.upload-sweep { color: var(--text-muted); }
@supports (-webkit-background-clip: text) {
    .upload-sweep {
        color: transparent;
        background-image: linear-gradient(90deg, transparent 0%, rgba(211, 47, 47, 0.85) 50%, transparent 100%);
        background-size: 200% 100%;
        background-position: 200% 0;
        -webkit-background-clip: text;
        background-clip: text;
        animation: placeholderSweep 3s linear infinite;
    }
}

.thumb-card { background:var(--bg-elevated); border-radius:12px; box-shadow:0 10px 28px rgba(0,0,0,0.4); padding:10px; display:flex; flex-direction:column; align-items:center; border:1px solid var(--border); margin-top:10px; }
.page-count { background:linear-gradient(135deg,var(--accent),var(--accent-hover)); color:#fff; padding:3px 8px; border-radius:8px; margin-top:6px; font-size:0.85rem; display:block; }
.file-size { background:linear-gradient(135deg,var(--success),#1b5e20); color:#fff; padding:3px 8px; border-radius:8px; margin-top:6px; font-size:0.85rem; display:block; }

.remove-file-btn { background:linear-gradient(135deg,var(--error),#8e1e1e); color:#fff; padding:6px 12px; border:none; border-radius:6px; margin-top:10px; font-size:0.85rem; cursor:pointer; transition:0.2s; }
.remove-file-btn:hover { background:linear-gradient(135deg,#8e1e1e,#721414); transform:translateY(-1px); }

.merge-btn { background:linear-gradient(135deg,var(--accent),var(--accent-hover)); color:#fff; padding:12px 25px; border:1px solid rgba(255,255,255,0.08); border-radius:12px; font-size:1.1rem; cursor:pointer; transition:0.2s; }
.merge-btn:hover { transform:translateY(-2px); box-shadow:0 10px 24px rgba(211,47,47,0.35); }
.compress-submit { margin-top: 20px; align-self: center; }

body[data-tool-page="true"] .download-btn {
    background: var(--bg-elevated) !important;
    color: #fff !important;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
    display: inline-block;
    border: 1px solid var(--border);
}
body[data-tool-page="true"] .download-btn:hover { border-color: rgba(211,47,47,0.5); }
body[data-tool-page="true"] .download-btn .sweep-text { display: inline-block; color: var(--text-primary); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    body[data-tool-page="true"] .download-btn .sweep-text {
        color: transparent !important;
        background-image: linear-gradient(90deg, transparent 0%, rgba(211, 47, 47, 0.85) 50%, transparent 100%);
        background-size: 200% 100%;
        background-position: 200% 0;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent !important;
        background-clip: text;
        animation: placeholderSweep 3s linear infinite;
    }
}

.compression-box {
    margin-top:15px;
    background:var(--bg-section);
    padding:16px;
    border-radius:12px;
    border:1px solid var(--border);
    color:var(--text-primary);
}
.compression-box h4 { margin:0 0 10px 0; color:var(--text-heading); }
.compression-box label {
    display:block;
    margin:8px 0;
    cursor:pointer;
    color:var(--text-primary);
    background: rgba(15,20,25,0.52);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
}
.compression-box label:hover {
    border-color: rgba(211,47,47,0.45);
    background: rgba(211,47,47,0.08);
}
.compression-box input { accent-color: var(--accent); }
.helper-text { font-size:12px; color:var(--text-muted); margin-top:10px; }
.error-text { color:var(--error); margin-top:10px; }

.share-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 25, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
    backdrop-filter: blur(6px);
}
.share-modal[hidden] { display: none; }
.share-dialog {
    background: linear-gradient(135deg, #161B22 0%, #111827 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 26px;
    width: min(460px, 92vw);
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
    color: var(--text-primary);
    position: relative;
}
.share-dialog h3 {
    margin: 0 0 8px 0;
    color: var(--text-heading);
    font-size: 1.25rem;
}
.share-subtext {
    color: var(--text-muted);
    margin: 0 0 18px 0;
}
.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
}
.share-copy {
    width: 42px;
    height: 42px;
}
.share-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.share-icon-btn svg {
    width: 20px;
    height: 20px;
}
.share-icon-btn:hover {
    color: #fff;
    border-color: rgba(211,47,47,0.5);
    box-shadow: 0 10px 24px rgba(211,47,47,0.2);
    transform: translateY(-2px);
}
.share-icon-btn.is-copied::after {
    content: 'Copied';
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, -4px);
    background: rgba(22, 27, 34, 0.96);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 8px;
    font-size: 0.8rem;
    opacity: 1;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    pointer-events: none;
}
.share-bmc-wrap {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}
.share-bmc {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 14px 32px rgba(211,47,47,0.4);
    overflow: hidden;
}
.share-bmc::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 999px;
    border: 1px solid rgba(211,47,47,0.45);
    opacity: 0;
    animation: sharePulse 2.8s ease-out infinite;
}
.share-note {
    margin-top: 18px;
    padding: 12px 14px;
    background: rgba(31, 41, 55, 0.7);
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.share-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}
.share-close:hover {
    background: var(--bg-card);
}
@keyframes sharePulse {
    0% { transform: scale(0.95); opacity: 0; }
    15% { opacity: 0.8; }
    100% { transform: scale(1.25); opacity: 0; }
}

.pdf-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 20, 25, 0.82);
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.pdf-loading[hidden] { display: none; }
.pdf-loading-inner {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(17, 24, 39, 0.95));
    border: 1px solid rgba(211, 47, 47, 0.35);
    border-radius: 999px;
    padding: 12px 18px;
    color: var(--text-primary);
    box-shadow: 0 18px 40px rgba(0,0,0,0.55), 0 0 28px rgba(211,47,47,0.25);
}
.pdf-spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(211,47,47,0.25);
    border-top-color: var(--accent);
    box-shadow: 0 0 12px rgba(211,47,47,0.55);
    animation: pdfSpinner 0.9s linear infinite;
}
.pdf-loading-text {
    font-size: 0.98rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}
@keyframes pdfSpinner {
    to { transform: rotate(360deg); }
}

.spinner {
    width:22px;
    height:22px;
    border:3px solid rgba(255,255,255,0.12);
    border-top-color:var(--accent);
    border-radius:50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes compressSweep {
    0% { transform: translateX(-60%); }
    100% { transform: translateX(60%); }
}
@keyframes placeholderSweep {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-bar { background:var(--bg-elevated); border-radius:8px; height:10px; width:100%; overflow:hidden; border:1px solid var(--border); }
.progress-fill { height:100%; width:0%; background:linear-gradient(90deg,var(--accent),var(--accent-hover)); transition:width 300ms linear; }

/* Content Sections */
.content-section {
    max-width: 900px;
    margin: 50px auto;
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
}
.content-section h2 {
    font-size: 1.6rem;
    color: var(--text-heading);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.content-section p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Steps Guide */
.steps-guide { margin-top: 25px; }
.step-item { display: flex; gap: 20px; margin-bottom: 25px; align-items: flex-start; }
.step-num { width: 40px; height: 40px; background: linear-gradient(135deg,var(--accent),var(--accent-hover)); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; flex-shrink: 0; }
.step-content h3 { font-size: 1.15rem; color: var(--text-heading); margin-bottom: 8px; }
.step-content p { margin: 0; font-size: 1rem; color: var(--text-muted); }

/* Features Grid */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 25px; justify-items: center; }
.feature-card { background: var(--bg-section); border-radius: 12px; padding: 25px; text-align: center; display: flex; flex-direction: column; align-items: center; border:1px solid var(--border); }
.feature-icon { width: 40px; height: 40px; margin-bottom: 10px; }
.feature-card h3 { font-size: 1.1rem; color: var(--text-heading); margin-bottom: 10px; }
.feature-card p { font-size: 0.95rem; margin: 0; line-height: 1.6; color: var(--text-muted); }

/* Use Cases List */
.use-cases-list { margin: 20px 0; padding-left: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.use-cases-list li { font-size: 1rem; line-height: 1.6; color: var(--text-primary); margin-bottom: 0; background: var(--bg-section); border:1px solid var(--border); padding: 12px 14px; border-radius: 10px; }

/* Tips Container */
.tips-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 20px; }
.tip-box { background: var(--bg-section); border:1px solid var(--border); padding: 20px; border-radius: 12px; }
.tip-box h3 { font-size: 1rem; color: var(--text-heading); margin-bottom: 10px; }
.tip-box p { font-size: 0.95rem; margin: 0; line-height: 1.6; color: var(--text-muted); }
.tip-box a { color: var(--text-primary); text-decoration: underline; }
.tip-box a:hover { color: var(--accent); }

/* FAQ Section */
.faq-container { margin-top: 20px; }
.faq-item { background: var(--bg-section); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 15px; }
.faq-item h3 { font-size: 1.05rem; color: var(--text-heading); margin-bottom: 10px; }
.faq-item p { font-size: 0.95rem; margin: 0; line-height: 1.7; color: var(--text-muted); }
.faq-item a { color: var(--text-primary); text-decoration: underline; }
.faq-item a:hover { color: var(--accent); }
.faq-more { text-align: center; margin-top: 20px; font-size: 0.95rem; color: var(--text-muted); }
.faq-more a { color: var(--text-primary); font-weight: 600; text-decoration: underline; }
.faq-more a:hover { color: var(--accent); }

/* Related Tools */
.cta-section { background: linear-gradient(135deg,var(--accent),var(--accent-hover)); padding: 40px; border-radius: 16px; text-align: center; color:#fff; }
.cta-section h2 { border: none; text-align: center; color:#fff; }
.cta-section p { color: rgba(255,255,255,0.85); }
.related-tools { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 25px; }
.related-tool-card { display: flex; flex-direction: column; align-items: center; background: var(--bg-section); padding: 20px 25px; border-radius: 12px; text-decoration: none; border: 1px solid var(--border); transition: transform 0.2s, box-shadow 0.2s; min-width: 140px; color: var(--text-primary); }
.related-tool-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); border-color: var(--accent); }
.tool-name { font-weight: 600; color: var(--text-heading); margin-bottom: 5px; }
.tool-desc { font-size: 0.85rem; color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
    .progress-fill { transition:none; }
    .spinner { animation:none; }
    #compressForm::before { animation:none; }
    .upload-sweep { animation:none; background-position: 0 0; }
    body[data-tool-page="true"] .download-btn .sweep-text { animation:none; background-position: 0 0; }
    .share-bmc::before { animation:none; }
    .pdf-spinner { animation:none; }
}

@media (max-width: 768px) {
    .compress-hero,
    .workspace-header {
        grid-template-columns: 1fr;
    }

    .compress-hero {
        padding: 24px 18px;
    }

    .compress-hero h1 {
        font-size: 2rem;
    }

    .tool-status-badges {
        justify-content: flex-start;
        max-width: none;
    }

    .compress-workspace {
        padding: 20px 14px;
    }

    .workspace-mini-steps {
        min-width: 0;
        width: 100%;
    }

    .content-section h2 { font-size: 1.4rem; }
    .step-item { flex-direction: column; gap: 10px; }
    .features-grid { grid-template-columns: 1fr; }
    .tips-container { grid-template-columns: 1fr; }
    .related-tools { flex-direction: column; align-items: center; }
    .cta-section { padding: 25px; }
}

@media (max-width: 600px) {
    .workspace-mini-steps {
        grid-template-columns: 1fr;
    }

    .btn-share::after {
        white-space: normal;
        width: 200px;
        text-align: center;
    }
    .share-dialog .btn {
        width: 100%;
    }
}
