/**
 * DocNova tool pages — compact layout (global)
 * Applies to PDF/image tools that use the standard Alpine root shell:
 *   body > div.min-h-screen.bg-gray-50[x-data]
 * Editor steps (sign canvas, fill form) are outside this shell and stay full-size.
 */

body > div.min-h-screen.bg-gray-50[x-data],
body > div.min-h-screen.bg-gray-100[x-data] {
    min-height: auto !important;
}

/* Breathing room below the sticky nav bar */
body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto,
body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto,
body > div.min-h-screen.bg-gray-50[x-data] > .max-w-5xl.mx-auto,
body > div.min-h-screen.bg-gray-100[x-data] > .max-w-5xl.mx-auto {
    max-width: 42rem !important;
    padding-top: 4.25rem !important;
    padding-bottom: 1.5rem !important;
}

@media (min-width: 640px) {
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto,
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-5xl.mx-auto,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-5xl.mx-auto {
        padding-top: 4.5rem !important;
        padding-bottom: 2rem !important;
    }
}

@media (min-width: 1024px) {
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto,
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-5xl.mx-auto,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-5xl.mx-auto {
        padding-top: 5.5rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Single-column tools (merge, split, compress, …) wrap everything in one max-w-4xl */
body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto,
body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto {
    max-width: 42rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

@media (min-width: 640px) {
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
}

/* Tool titles */
body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto h1,
body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto h1,
body > div.min-h-screen.bg-gray-50[x-data] > .max-w-5xl.mx-auto h1,
body > div.min-h-screen.bg-gray-100[x-data] > .max-w-5xl.mx-auto h1,
body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto .text-center h1,
body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto .text-center h1 {
    font-size: 1.25rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.375rem !important;
}

@media (min-width: 640px) {
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto h1,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto h1,
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-5xl.mx-auto h1,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-5xl.mx-auto h1,
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto .text-center h1,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto .text-center h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
}

@media (min-width: 768px) {
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto h1,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto h1,
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-5xl.mx-auto h1,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-5xl.mx-auto h1,
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto .text-center h1,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto .text-center h1 {
        font-size: 1.75rem !important;
    }
}

/* Header block spacing */
body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto > .text-center,
body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto > .text-center,
body > div.min-h-screen.bg-gray-50[x-data] > .max-w-5xl.mx-auto > .text-center,
body > div.min-h-screen.bg-gray-100[x-data] > .max-w-5xl.mx-auto > .text-center {
    margin-bottom: 1rem !important;
}

@media (min-width: 640px) {
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto > .text-center,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto > .text-center,
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-5xl.mx-auto > .text-center,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-5xl.mx-auto > .text-center {
        margin-bottom: 1.25rem !important;
    }
}

/* White content card */
body > div.min-h-screen.bg-gray-50[x-data] .max-w-4xl.mx-auto > .bg-white,
body > div.min-h-screen.bg-gray-100[x-data] .max-w-4xl.mx-auto > .bg-white,
body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-xl,
body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-xl,
body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-2xl,
body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-2xl {
    padding: 1rem !important;
}

@media (min-width: 640px) {
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-xl,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-xl,
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-2xl,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-2xl {
        padding: 1.25rem !important;
    }
}

@media (min-width: 768px) {
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-xl,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-xl,
    body > div.min-h-screen.bg-gray-50[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-2xl,
    body > div.min-h-screen.bg-gray-100[x-data] > .max-w-4xl.mx-auto .bg-white.rounded-2xl {
        padding: 1.5rem !important;
    }
}

/* Drag-and-drop upload zone */
body > div.min-h-screen.bg-gray-50[x-data] .border-dashed.rounded-xl,
body > div.min-h-screen.bg-gray-100[x-data] .border-dashed.rounded-xl,
body > div.min-h-screen.bg-gray-50[x-data] .border-dashed.rounded-2xl,
body > div.min-h-screen.bg-gray-100[x-data] .border-dashed.rounded-2xl,
body > div.min-h-screen.bg-gray-50[x-data] .docnova-upload-zone,
body > div.min-h-screen.bg-gray-100[x-data] .docnova-upload-zone {
    padding: 1rem !important;
}

@media (min-width: 640px) {
    body > div.min-h-screen.bg-gray-50[x-data] .border-dashed.rounded-xl,
    body > div.min-h-screen.bg-gray-100[x-data] .border-dashed.rounded-xl,
    body > div.min-h-screen.bg-gray-50[x-data] .border-dashed.rounded-2xl,
    body > div.min-h-screen.bg-gray-100[x-data] .border-dashed.rounded-2xl,
    body > div.min-h-screen.bg-gray-50[x-data] .docnova-upload-zone,
    body > div.min-h-screen.bg-gray-100[x-data] .docnova-upload-zone {
        padding: 1.25rem !important;
    }
}

@media (min-width: 768px) {
    body > div.min-h-screen.bg-gray-50[x-data] .border-dashed.rounded-xl,
    body > div.min-h-screen.bg-gray-100[x-data] .border-dashed.rounded-xl,
    body > div.min-h-screen.bg-gray-50[x-data] .border-dashed.rounded-2xl,
    body > div.min-h-screen.bg-gray-100[x-data] .border-dashed.rounded-2xl,
    body > div.min-h-screen.bg-gray-50[x-data] .docnova-upload-zone,
    body > div.min-h-screen.bg-gray-100[x-data] .docnova-upload-zone {
        padding: 1.5rem !important;
    }
}

/* Upload zone: keep gray dashed border on hover (red tint only while dragging) */
body > div.min-h-screen.bg-gray-50[x-data] .docnova-upload-zone.border-gray-300:hover,
body > div.min-h-screen.bg-gray-100[x-data] .docnova-upload-zone.border-gray-300:hover,
body > div.min-h-screen.bg-gray-50[x-data] .border-2.border-dashed.border-gray-300:hover:not(.border-red-500),
body > div.min-h-screen.bg-gray-100[x-data] .border-2.border-dashed.border-gray-300:hover:not(.border-red-500) {
    border-color: #d1d5db !important;
    background-color: transparent !important;
}

/* Premium tool crown badge (home grid + related tool cards) */
.docnova-premium-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: auto;
    height: auto;
    padding: 0;
    border: none;
    background: transparent;
    color: #b45309;
    font-size: 0.6875rem;
    line-height: 1;
    pointer-events: none;
    opacity: 0.9;
}

.docnova-related-tool-card .docnova-premium-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
}

.docnova-tool-card,
.docnova-related-tool-card {
    position: relative;
}

/* Premium tool page label (iLovePDF-style, above tool title) */
.docnova-premium-tool-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.625rem;
    padding: 0.1875rem 0.625rem 0.1875rem 0.1875rem;
    border-radius: 9999px;
    background: #fefce8;
    border: 1px solid #fde047;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    line-height: 1;
}

.docnova-premium-tool-label__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 9999px;
    background: #fef08a;
    color: #111827;
    font-size: 0.5625rem;
    flex-shrink: 0;
}

.docnova-premium-tool-label__text {
    padding-right: 0.125rem;
    letter-spacing: 0.02em;
}

/* Related Tools — isolated from upload-button span rules */
body > div.min-h-screen.bg-gray-50[x-data] .docnova-related-tools,
body > div.min-h-screen.bg-gray-100[x-data] .docnova-related-tools {
    margin-top: 2rem !important;
}

body > div.min-h-screen.bg-gray-50[x-data] .docnova-related-tool-card,
body > div.min-h-screen.bg-gray-100[x-data] .docnova-related-tool-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-decoration: none !important;
}

body > div.min-h-screen.bg-gray-50[x-data] .docnova-related-tool-label,
body > div.min-h-screen.bg-gray-100[x-data] .docnova-related-tool-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 0.75rem !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    color: #374151 !important;
    text-align: center !important;
    width: 100% !important;
}

body > div.min-h-screen.bg-gray-50[x-data] .docnova-related-tool-card:hover .docnova-related-tool-label,
body > div.min-h-screen.bg-gray-100[x-data] .docnova-related-tool-card:hover .docnova-related-tool-label {
    color: #111827 !important;
}

/* “Select file” upload button — compact horizontal pill on mobile (all tools) */
body > div.min-h-screen.bg-gray-50[x-data] .border-dashed > label,
body > div.min-h-screen.bg-gray-100[x-data] .border-dashed > label {
    display: block;
    text-align: center;
}

body > div.min-h-screen.bg-gray-50[x-data] .border-dashed > label > div[class*="from-red-600"],
body > div.min-h-screen.bg-gray-100[x-data] .border-dashed > label > div[class*="from-red-600"] {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.625rem !important;
    width: auto !important;
    max-width: 100% !important;
    min-height: 3rem !important;
    font-size: 0.9375rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: 0.01em !important;
    padding: 0.875rem 1.625rem !important;
    border-radius: 9999px !important;
    box-shadow: 0 6px 14px -3px rgb(220 38 38 / 0.35), 0 4px 6px -4px rgb(0 0 0 / 0.12) !important;
    transform: none !important;
}

body > div.min-h-screen.bg-gray-50[x-data] .border-dashed > label > div[class*="from-red-600"] i,
body > div.min-h-screen.bg-gray-100[x-data] .border-dashed > label > div[class*="from-red-600"] i {
    font-size: 1.25rem !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
}

body > div.min-h-screen.bg-gray-50[x-data] .border-dashed > label > div[class*="from-red-600"] span,
body > div.min-h-screen.bg-gray-100[x-data] .border-dashed > label > div[class*="from-red-600"] span {
    font-size: 0.9375rem !important;
    line-height: 1.25 !important;
}

@media (min-width: 640px) {
    body > div.min-h-screen.bg-gray-50[x-data] .border-dashed > label > div[class*="from-red-600"],
    body > div.min-h-screen.bg-gray-100[x-data] .border-dashed > label > div[class*="from-red-600"] {
        gap: 0.75rem !important;
        font-size: 1rem !important;
        padding: 0.875rem 2rem !important;
    }

body > div.min-h-screen.bg-gray-50[x-data] .border-dashed > label > div[class*="from-red-600"] i,
body > div.min-h-screen.bg-gray-100[x-data] .border-dashed > label > div[class*="from-red-600"] i {
        font-size: 1.5rem !important;
    }

    body > div.min-h-screen.bg-gray-50[x-data] .border-dashed > label > div[class*="from-red-600"] span,
    body > div.min-h-screen.bg-gray-100[x-data] .border-dashed > label > div[class*="from-red-600"] span {
        font-size: 1rem !important;
    }
}

@media (min-width: 768px) {
    body > div.min-h-screen.bg-gray-50[x-data] .border-dashed > label > div[class*="from-red-600"],
    body > div.min-h-screen.bg-gray-100[x-data] .border-dashed > label > div[class*="from-red-600"] {
        font-size: 1.125rem !important;
        padding: 1rem 2.5rem !important;
    }

    body > div.min-h-screen.bg-gray-50[x-data] .border-dashed > label > div[class*="from-red-600"] span,
    body > div.min-h-screen.bg-gray-100[x-data] .border-dashed > label > div[class*="from-red-600"] span {
        font-size: 1.125rem !important;
    }
}

/* Mode / option tab buttons (split range, pages, size, etc.) */
body > div.min-h-screen.bg-gray-50[x-data] button.border-2.rounded-xl,
body > div.min-h-screen.bg-gray-100[x-data] button.border-2.rounded-xl,
body > div.min-h-screen.bg-gray-50[x-data] button.border-2.rounded-2xl,
body > div.min-h-screen.bg-gray-100[x-data] button.border-2.rounded-2xl {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
}

/* Primary action button (Split PDF, Merge, Compress, …) */
body > div.min-h-screen.bg-gray-50[x-data] button.w-full.bg-gradient-to-r,
body > div.min-h-screen.bg-gray-100[x-data] button.w-full.bg-gradient-to-r {
    font-size: 0.875rem !important;
    padding-top: 0.625rem !important;
    padding-bottom: 0.625rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    border-radius: 0.75rem !important;
}

@media (min-width: 640px) {
    body > div.min-h-screen.bg-gray-50[x-data] button.w-full.bg-gradient-to-r,
    body > div.min-h-screen.bg-gray-100[x-data] button.w-full.bg-gradient-to-r {
        font-size: 1rem !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

/* Unified download-success modal (all PDF tools) */
.docnova-success-modal-overlay {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-top: max(1rem, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px)) !important;
    background: rgb(15 23 42 / 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

@media (min-height: 700px) {
    .docnova-success-modal-overlay {
        align-items: center;
    }
}

.docnova-success-modal {
    width: 100%;
    max-width: 28rem;
    max-height: calc(100dvh - 2rem);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: auto;
    flex-shrink: 0;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.28);
}

.docnova-success-modal__header {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 55%, #15803d 100%);
    border-bottom: none;
}

.docnova-success-modal__header-bg {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background:
        radial-gradient(circle at 85% 15%, #fff 0%, transparent 45%),
        radial-gradient(circle at 10% 90%, #fff 0%, transparent 40%);
    pointer-events: none;
}

.docnova-success-modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.12);
    color: #16a34a;
}

.docnova-success-modal__download {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.docnova-success-modal__download:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.docnova-success-modal__related .docnova-related-tool-card {
    min-height: 0;
}

.docnova-success-modal__related .docnova-related-tool-label {
    display: block !important;
    width: 100% !important;
    font-size: 0.6875rem !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    color: #374151 !important;
    text-align: center !important;
}

/* Shorter viewports (common on Windows laptops + browser chrome) */
@media (max-height: 760px) {
    .docnova-success-modal__header {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }

    .docnova-success-modal__header h3 {
        font-size: 1.125rem !important;
    }

    .docnova-success-modal__icon {
        width: 2.75rem !important;
        height: 2.75rem !important;
        margin-bottom: 0.625rem !important;
    }

    .docnova-success-modal__icon i {
        font-size: 1.125rem !important;
    }

    .docnova-success-modal > .px-6.py-5 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .docnova-success-modal__file {
        padding: 0.75rem !important;
    }

    .docnova-success-modal__related {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .docnova-success-modal__related .docnova-related-tool-card {
        padding: 0.5rem !important;
        gap: 0.375rem !important;
    }
}

/* Payment failed modal (pricing checkout) */
.docnova-failure-modal__header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%);
    border-bottom: none;
}

.docnova-failure-modal__header-bg {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background:
        radial-gradient(circle at 85% 15%, #fff 0%, transparent 45%),
        radial-gradient(circle at 10% 90%, #fff 0%, transparent 40%);
    pointer-events: none;
}

.docnova-failure-modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.12);
}

.docnova-failure-modal__cta {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.docnova-failure-modal__cta:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
}

/* Tool limit / file-size error popup */
.docnova-error-popup-overlay {
    background: rgb(15 23 42 / 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: docnova-popup-fade-in 0.2s ease-out;
}

.docnova-error-popup {
    position: relative;
    width: 100%;
    max-width: 26rem;
    background: #fff;
    border-radius: 1.25rem;
    border: 1px solid rgb(226 232 240 / 0.9);
    box-shadow:
        0 24px 48px -12px rgb(15 23 42 / 0.18),
        0 0 0 1px rgb(255 255 255 / 0.6) inset;
    animation: docnova-popup-slide-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.docnova-error-popup__close {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.docnova-error-popup__close:hover {
    color: #475569;
    background: #f1f5f9;
}

.docnova-error-popup__body {
    padding: 2rem 1.75rem 1.5rem;
    text-align: center;
}

.docnova-error-popup__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 1rem;
}

.docnova-error-popup__icon-wrap--error {
    color: #dc2626;
    background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%);
    box-shadow: 0 0 0 1px rgb(254 202 202 / 0.8);
}

.docnova-error-popup__icon-wrap--warning {
    color: #d97706;
    background: linear-gradient(145deg, #fffbeb 0%, #fef3c7 100%);
    box-shadow: 0 0 0 1px rgb(253 230 138 / 0.8);
}

.docnova-error-popup__title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.3;
}

.docnova-error-popup__message {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #64748b;
}

.docnova-error-popup__limits {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0.625rem;
    margin-top: 1.25rem;
}

.docnova-error-popup__limit {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 0.625rem;
    border-radius: 0.875rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.docnova-error-popup__limit--current {
    border-color: #fecaca;
    background: #fff5f5;
}

.docnova-error-popup__limit--pro {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.docnova-error-popup__limit-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.docnova-error-popup__limit--pro .docnova-error-popup__limit-label {
    color: #16a34a;
}

.docnova-error-popup__limit-value {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.docnova-error-popup__limit--pro .docnova-error-popup__limit-value {
    color: #15803d;
}

.docnova-error-popup__limit-note {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.6875rem;
    color: #94a3b8;
}

.docnova-error-popup__limit-arrow {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: #cbd5e1;
}

.docnova-error-popup__hint {
    margin: 1rem 0 0;
    padding: 0.75rem 0.875rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.docnova-error-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 1.25rem;
}

.docnova-error-popup__cta {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 0.875rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%);
    box-shadow: 0 4px 14px rgb(220 38 38 / 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.docnova-error-popup__cta:hover {
    filter: brightness(1.03);
    box-shadow: 0 6px 18px rgb(220 38 38 / 0.34);
}

.docnova-error-popup__cta:active {
    transform: scale(0.985);
}

.docnova-error-popup__cta-icon {
    flex-shrink: 0;
}

.docnova-error-popup__secondary {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    background: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.docnova-error-popup__secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

@keyframes docnova-popup-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes docnova-popup-slide-up {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 380px) {
    .docnova-error-popup__body {
        padding: 1.75rem 1.25rem 1.25rem;
    }

    .docnova-error-popup__limits {
        flex-direction: column;
        align-items: stretch;
    }

    .docnova-error-popup__limit-arrow {
        justify-content: center;
        transform: rotate(90deg);
    }
}

/* Password-protected PDF unlock popup (all tools) */
.docnova-pdf-unlock-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgb(0 0 0 / 0.72);
    backdrop-filter: blur(4px);
    animation: docnova-popup-fade-in 0.2s ease;
}

.docnova-pdf-unlock {
    width: 100%;
    max-width: 24rem;
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 24px 48px rgb(0 0 0 / 0.22);
    animation: docnova-popup-slide-up 0.22s ease;
}

.docnova-pdf-unlock__header {
    position: relative;
    padding: 1.25rem 1.25rem 1rem;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    text-align: center;
}

.docnova-pdf-unlock__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 9999px;
    background: rgb(255 255 255 / 0.18);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.docnova-pdf-unlock__close:hover {
    background: rgb(255 255 255 / 0.28);
}

.docnova-pdf-unlock__header-icon {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto 0.75rem;
    border-radius: 0.75rem;
    background: rgb(255 255 255 / 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.docnova-pdf-unlock__title,
.docnova-pdf-unlock__header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: #ffffff;
}

.docnova-pdf-unlock__subtitle {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: rgb(255 255 255 / 0.85);
}

.docnova-pdf-unlock__body {
    padding: 1.25rem;
}

.docnova-pdf-unlock__file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #f9fafb;
}

.docnova-pdf-unlock__file-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docnova-pdf-unlock__file-meta {
    min-width: 0;
}

.docnova-pdf-unlock__file-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docnova-pdf-unlock__file-hint {
    font-size: 0.75rem;
    color: #6b7280;
}

.docnova-pdf-unlock__label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.docnova-pdf-unlock__input-wrap {
    position: relative;
}

.docnova-pdf-unlock__input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.875rem;
    border: 2px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    color: #111827;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.docnova-pdf-unlock__input:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgb(239 68 68 / 0.15);
}

.docnova-pdf-unlock__input--error {
    border-color: #f87171;
    background: #fef2f2;
}

.docnova-pdf-unlock__toggle-pw {
    position: absolute;
    right: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
}

.docnova-pdf-unlock__toggle-pw:hover {
    color: #6b7280;
}

.docnova-pdf-unlock__error {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #dc2626;
}

.docnova-pdf-unlock__actions {
    display: flex;
    gap: 0.625rem;
    margin-top: 1rem;
}

.docnova-pdf-unlock__btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.docnova-pdf-unlock__btn--secondary {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #475569;
}

.docnova-pdf-unlock__btn--secondary:hover {
    background: #f8fafc;
}

.docnova-pdf-unlock__btn--primary {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 55%, #b91c1c 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgb(220 38 38 / 0.28);
}

.docnova-pdf-unlock__btn--primary:hover:not(:disabled) {
    filter: brightness(1.03);
}

.docnova-pdf-unlock__btn--primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.docnova-pdf-unlock__btn-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgb(255 255 255 / 0.35);
    border-top-color: #fff;
    border-radius: 9999px;
    animation: spin 0.7s linear infinite;
}

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

/* JPG to PDF — compact option rows (orientation, size, margin) */
.docnova-jpg-options {
    border-top: 1px solid #f3f4f6;
    padding-top: 0.875rem;
}

.docnova-jpg-option-row {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

@media (min-width: 640px) {
    .docnova-jpg-option-row {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }
}

.docnova-jpg-option-label {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.25;
}

@media (min-width: 640px) {
    .docnova-jpg-option-label {
        width: 5.5rem;
        font-size: 0.8125rem;
    }
}

.docnova-jpg-segmented {
    display: flex;
    gap: 0.375rem;
    width: 100%;
}

.docnova-jpg-segment {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 2rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #f9fafb;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.docnova-jpg-segment i {
    font-size: 0.75rem;
    color: #9ca3af;
}

.docnova-jpg-segment i.rotate-90 {
    transform: rotate(90deg);
    display: inline-block;
}

.docnova-jpg-segment:hover {
    border-color: #d1d5db;
    background: #fff;
}

.docnova-jpg-segment.is-active {
    border-color: #374151;
    background: #fff;
    color: #111827;
    box-shadow: 0 0 0 1px #374151;
}

.docnova-jpg-segment.is-active i {
    color: #6b7280;
}

@media (min-width: 640px) {
    .docnova-jpg-segment {
        min-height: 2.125rem;
        font-size: 0.8125rem;
    }

    .docnova-jpg-segment i {
        font-size: 0.8125rem;
    }
}

.docnova-jpg-select {
    width: 100%;
    min-height: 2rem;
    padding: 0.375rem 0.625rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.docnova-jpg-select:hover {
    border-color: #d1d5db;
}

.docnova-jpg-select:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgb(254 202 202 / 0.6);
}

@media (min-width: 640px) {
    .docnova-jpg-select {
        flex: 1;
        min-height: 2.125rem;
        font-size: 0.8125rem;
    }
}

.docnova-jpg-merge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0.5rem;
    margin-top: 0.125rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #f9fafb;
    cursor: pointer;
}

.docnova-jpg-merge__check {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    accent-color: #16a34a;
    cursor: pointer;
}

.docnova-jpg-merge__text {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
}

.docnova-jpg-merge__text i {
    font-size: 0.6875rem;
    color: #16a34a;
}

.docnova-jpg-merge__hint {
    width: 100%;
    padding-left: 1.375rem;
    font-size: 0.6875rem;
    line-height: 1.3;
    color: #6b7280;
}

@media (min-width: 640px) {
    .docnova-jpg-merge__text {
        font-size: 0.8125rem;
    }
}

/* Compact post-upload stack (compress, etc.) */
.docnova-tool-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem !important;
}

.docnova-file-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
}

.docnova-file-chip__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    border-radius: 0.375rem;
    background: #fee2e2;
}

.docnova-file-chip__name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.25;
}

.docnova-file-chip__remove {
    flex-shrink: 0;
    padding: 0.125rem;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
}

.docnova-file-chip__remove:hover {
    color: #dc2626;
}

.docnova-jpg-options--flat {
    border-top: none !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.docnova-jpg-option-row--inline {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.docnova-jpg-option-row--inline .docnova-jpg-option-label {
    width: auto !important;
    min-width: 4.75rem;
    margin: 0;
}

.docnova-jpg-option-row--inline .docnova-jpg-segmented {
    flex: 1;
    min-width: 0;
}

.docnova-jpg-segment {
    outline: none;
}

.docnova-jpg-segment:focus,
.docnova-jpg-segment:focus-visible {
    outline: none;
    box-shadow: none;
}

.docnova-jpg-segment.is-active:focus,
.docnova-jpg-segment.is-active:focus-visible {
    box-shadow: 0 0 0 1px #374151;
}

.docnova-tool-primary-btn {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    padding: 0.625rem 1rem !important;
    border-radius: 0.625rem !important;
    box-shadow: none !important;
    transform: none !important;
    min-height: 2.375rem;
}

.docnova-tool-primary-btn:hover {
    transform: none !important;
}

@media (min-width: 640px) {
    .docnova-tool-stack {
        gap: 0.625rem;
        margin-top: 0.875rem !important;
    }

    .docnova-file-chip__name {
        font-size: 0.8125rem;
    }

    .docnova-tool-primary-btn {
        font-size: 0.9375rem !important;
        min-height: 2.5rem;
    }
}

/* Tighter segmented controls inside tool stack */
.docnova-tool-stack .docnova-jpg-segment {
    min-height: 1.75rem;
    padding: 0.25rem 0.375rem;
    font-size: 0.6875rem;
    border-radius: 0.4375rem;
}

@media (min-width: 640px) {
    .docnova-tool-stack .docnova-jpg-segment {
        min-height: 1.875rem;
        padding: 0.3125rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Square option tiles (Compress PDF levels) */
.docnova-compress-levels {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.docnova-compress-levels__label {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.3;
}

.docnova-square-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.625rem;
    width: 100%;
}

.docnova-square-option {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Slightly wider-than-tall tiles (not full squares) */
.docnova-square-option::before {
    content: '';
    display: block;
    padding-top: 78%;
}

.docnova-square-option__inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3125rem;
    padding: 0.375rem 0.25rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    color: #4b5563;
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.docnova-square-option__inner i {
    font-size: 1rem;
    color: #9ca3af;
    line-height: 1;
}

.docnova-square-option__title {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
    max-width: 100%;
}

.docnova-square-option:hover .docnova-square-option__inner {
    border-color: #d1d5db;
    background: #fafafa;
}

.docnova-square-option.is-active .docnova-square-option__inner {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
    box-shadow: 0 0 0 1px rgb(220 38 38 / 0.15);
}

.docnova-square-option.is-active .docnova-square-option__inner i {
    color: #dc2626;
}

.docnova-square-option.is-active .docnova-square-option__inner::after {
    content: '';
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #22c55e;
    box-shadow: 0 0 0 2px #fff;
}

.docnova-square-option:focus-visible .docnova-square-option__inner {
    box-shadow: 0 0 0 2px rgb(220 38 38 / 0.35);
}

@media (min-width: 640px) {
    .docnova-compress-levels__label {
        font-size: 0.875rem;
    }

    .docnova-square-grid {
        gap: 0.75rem;
        max-width: 22rem;
        margin-left: auto;
        margin-right: auto;
    }

    .docnova-square-option__inner i {
        font-size: 1.125rem;
    }

    .docnova-square-option__title {
        font-size: 0.75rem;
    }
}
