/* YouTube Thumbnail Downloader - Complete Tailwind-style CSS */
/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    overflow-x: hidden;
}
img, video, canvas, svg { max-width: 100%; height: auto; }
body {
    margin: 0;
    overflow-x: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: #1e293b !important;
    background: linear-gradient(145deg, #fffcf9 0%, #fef8f2 50%, #fdf3ea 100%) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Dark Mode */
html.dark body {
    color: #e2e8f0 !important;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}
.hidden { display: none !important; }
.block { display: block; }
.inline { display: inline; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:py-4 { padding-top: 1rem; padding-bottom: 1rem; }
    .sm\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
    .sm\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .sm\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .sm\:text-5xl { font-size: 3rem; line-height: 1; }
    .sm\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
    .md\:text-5xl { font-size: 3rem; line-height: 1; }
    .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
}
@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mr-2 { margin-right: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.ml-2 { margin-left: 0.5rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-16 { padding-bottom: 4rem; }
.w-2 { width: 0.5rem; }
.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-full { width: 100%; }
.h-2 { height: 0.5rem; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.min-h-screen { min-height: 100vh; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.relative { position: relative; }
.absolute { position: absolute; }
.top-2 { top: 0.5rem; }
.right-2 { right: 0.5rem; }
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.text-gray-900 { color: #0f172a; }
.text-gray-700 { color: #334155; }
.text-gray-600 { color: #475569; }
.text-gray-500 { color: #64748b; }
.text-gray-400 { color: #94a3b8; }
.text-blue-600 { color: #06b6d4; }
.text-blue-800 { color: #0e7490; }
.text-green-600 { color: #10b981; }
.text-purple-600 { color: #8b5cf6; }
.text-red-700 { color: #dc2626; }
.text-red-500 { color: #ef4444; }
.text-white { color: #ffffff; }
.text-slate-900 { color: #0f172a; }
.text-slate-700 { color: #334155; }
.text-slate-600 { color: #475569; }
.text-slate-500 { color: #64748b; }
.text-slate-400 { color: #94a3b8; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-100 { color: #f1f5f9; }
/* Dark Mode Text Colors */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f8fafc; }
.bg-gray-100 { background-color: #f1f5f9; }
.bg-gray-200 { background-color: #e2e8f0; }
.bg-blue-100 { background-color: #cffafe; }
.bg-blue-600 { background-color: #06b6d4; }
.bg-green-100 { background-color: #d1fae5; }
.bg-green-500 { background-color: #10b981; }
.bg-purple-100 { background-color: #ede9fe; }
.bg-red-100 { background-color: #fee2e2; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-200 { background-color: #e2e8f0; }
.bg-slate-700 { background-color: #334155; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-950 { background-color: #020617; }
/* Dark Mode Backgrounds */
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-blue-50 { --tw-gradient-from: #ecfeff; --tw-gradient-to: rgba(240, 249, 255, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-blue-500 { --tw-gradient-from: #06b6d4; --tw-gradient-to: rgba(14, 165, 233, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-green-500 { --tw-gradient-from: #10b981; --tw-gradient-to: rgba(16, 185, 129, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-purple-500 { --tw-gradient-from: #8b5cf6; --tw-gradient-to: rgba(139, 92, 246, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-slate-50 { --tw-gradient-from: #f8fafc; --tw-gradient-to: rgba(248, 250, 252, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-slate-900 { --tw-gradient-from: #0f172a; --tw-gradient-to: rgba(15, 23, 42, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-white { --tw-gradient-to: #ffffff; }
.to-blue-600 { --tw-gradient-to: #0891b2; }
.to-green-600 { --tw-gradient-to: #059669; }
.to-purple-600 { --tw-gradient-to: #7c3aed; }
.to-slate-100 { --tw-gradient-to: #f1f5f9; }
.to-slate-800 { --tw-gradient-to: #1e293b; }
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-t { border-top-width: 1px; }
.border-gray-200 { border-color: #e2e8f0; }
.border-blue-200 { border-color: #a5f3fc; }
.border-red-200 { border-color: #fecaca; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; }
.border-slate-700 { border-color: #334155; }
.border-slate-800 { border-color: #1e293b; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }
.z-10 { z-index: 10; }
.z-2 { z-index: 2; }
.overflow-hidden { overflow: hidden; }
.font-extrabold { font-weight: 800; }
.font-black { font-weight: 900; }
.tracking-tight { letter-spacing: -0.025em; }
.leading-none { line-height: 1; }
.leading-relaxed { line-height: 1.625; }
.max-w-3xl { max-width: 48rem; }
.max-w-6xl { max-width: 72rem; }
.w-10 { width: 2.5rem; }
.w-11 { width: 2.75rem; }
.w-14 { width: 3.5rem; }
.h-10 { height: 2.5rem; }
.h-11 { height: 2.75rem; }
.h-14 { height: 3.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.pt-8 { padding-top: 2rem; }
.pt-12 { padding-top: 3rem; }
.pb-20 { padding-bottom: 5rem; }
.mt-16 { margin-top: 4rem; }
.mt-20 { margin-top: 5rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-20 { margin-bottom: 5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }

/* Additional utility classes for blog */
.space-y-8 > * + * { margin-top: 2rem; }
.space-y-12 > * + * { margin-top: 3rem; }
.space-y-16 > * + * { margin-top: 4rem; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-5 { gap: 1.25rem; }
.gap-12 { gap: 3rem; }
.gap-16 { gap: 4rem; }
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-5 { padding: 1.25rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.pt-4 { padding-top: 1rem; }
.pt-5 { padding-top: 1.25rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-8 { padding-bottom: 2rem; }
.pb-12 { padding-bottom: 3rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-16 { margin-top: 4rem; }
.mt-20 { margin-top: 5rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-20 { margin-bottom: 5rem; }
.ml-3 { margin-left: 0.75rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.mr-6 { margin-right: 1.5rem; }
.-mt-2 { margin-top: -0.5rem; }
.-mt-3 { margin-top: -0.75rem; }
.w-7 { width: 1.75rem; }
.w-9 { width: 2.25rem; }
.w-20 { width: 5rem; }
.h-7 { height: 1.75rem; }
.h-9 { height: 2.25rem; }
.h-20 { height: 5rem; }
.min-w-0 { min-width: 0px; }
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }
.flex-shrink { flex-shrink: 1; }
.order-1 { order: 1; }
.order-2 { order: 2; }
.order-last { order: 9999; }
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.row-span-1 { grid-row: span 1 / span 1; }
.row-span-2 { grid-row: span 2 / span 2; }
.auto-cols-auto { grid-auto-columns: auto; }
.auto-rows-auto { grid-auto-rows: auto; }
.place-items-center { place-items: center; }
.place-content-center { place-content: center; }
.justify-items-center { justify-items: center; }
.justify-self-center { justify-self: center; }
.self-start { align-self: flex-start; }
.self-end { align-self: flex-end; }
.self-center { align-self: center; }
.self-stretch { align-self: stretch; }
.justify-start { justify-content: flex-start; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }
.content-center { align-content: center; }
.content-start { align-content: flex-start; }
.content-end { align-content: flex-end; }
.content-between { align-content: space-between; }
.content-around { align-content: space-around; }
.content-evenly { align-content: space-evenly; }

/* Additional responsive utilities */
@media (min-width: 640px) {
    .sm\:gap-6 { gap: 1.5rem; }
    .sm\:gap-8 { gap: 2rem; }
    .sm\:space-y-0 > * + * { margin-top: 0; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:items-center { align-items: center; }
    .sm\:justify-between { justify-content: space-between; }
    .sm\:text-left { text-align: left; }
    .sm\:text-center { text-align: center; }
}

@media (min-width: 768px) {
    .md\:gap-6 { gap: 1.5rem; }
    .md\:gap-8 { gap: 2rem; }
    .md\:space-y-0 > * + * { margin-top: 0; }
    .md\:flex-row { flex-direction: row; }
    .md\:items-center { align-items: center; }
    .md\:justify-between { justify-content: space-between; }
    .md\:text-left { text-align: left; }
    .md\:text-center { text-align: center; }
}

@media (min-width: 1024px) {
    .lg\:gap-6 { gap: 1.5rem; }
    .lg\:gap-8 { gap: 2rem; }
    .lg\:space-y-0 > * + * { margin-top: 0; }
    .lg\:flex-row { flex-direction: row; }
    .lg\:items-center { align-items: center; }
    .lg\:justify-between { justify-content: space-between; }
    .lg\:text-left { text-align: left; }
    .lg\:text-center { text-align: center; }
}

/* Ensure our custom classes override any conflicting styles */
body.gradient-surface {
    background: linear-gradient(145deg, #fffcf9 0%, #fef8f2 50%, #fdf3ea 100%) !important;
}

html.dark body.gradient-surface {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%) !important;
}

/* Fix any potential conflicts with navigation */
nav.glass-card {
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    border: none !important;
    border-bottom: none !important;
    box-shadow: 0 1px 3px rgba(120, 90, 50, 0.04), 0 1px 0 rgba(6, 182, 212, 0.08) !important;
    padding: 0 !important;
    position: relative !important;
}

nav.glass-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #06b6d4 0%, #8b5cf6 40%, #f59e0b 70%, #06b6d4 100%);
    background-size: 200% 100%;
    animation: navGradient 6s ease infinite;
    opacity: 0.7;
}

@keyframes navGradient {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
}

html.dark nav.glass-card {
    background: rgba(15, 23, 42, 0.97) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

html.dark nav.glass-card::after {
    opacity: 0.5;
}

/* Additional utility classes that might be missing */
.transition-colors { 
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-all { 
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }

.ease-in { transition-timing-function: cubic-bezier(0.4, 0, 1, 1); }
.ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

.transform { transform: translateVar(--tw-translate-x) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }

.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:scale-110:hover { transform: scale(1.1); }
.hover\:-translate-y-1:hover { transform: translateY(-0.25rem); }
.hover\:-translate-y-2:hover { transform: translateY(-0.5rem); }

.group:hover .group-hover\:scale-110 { transform: scale(1.1); }

/* Ensure proper text colors */
.text-slate-900 { color: #0f172a !important; }
.text-slate-100 { color: #f1f5f9 !important; }

.dark .text-slate-900 { color: #f1f5f9 !important; }
.dark .text-slate-100 { color: #0f172a !important; }
.rounded-full { border-radius: 9999px; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.shadow-inner { box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); }
.shadow-none { box-shadow: none; }

/* Professional glass morphism effects */
.glass-card {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(var(--glass-blur)) !important;
    border: 1px solid rgba(255, 230, 200, 0.35) !important;
    box-shadow: 0 4px 24px var(--shadow-warm, rgba(120,90,50,0.06)), 0 1px 4px rgba(120,90,50,0.03) !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.glass-card:hover {
    box-shadow: 0 12px 40px var(--shadow-warm-lg, rgba(120,90,50,0.1)), 0 4px 12px var(--shadow-brand, rgba(6,182,212,0.06)) !important;
    border-color: rgba(6, 182, 212, 0.2) !important;
}

.dark .glass-card {
    background: rgba(30, 41, 59, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

.dark .glass-card:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(6, 182, 212, 0.08) !important;
    border-color: rgba(6, 182, 212, 0.25) !important;
}

/* Enhanced hover effects */
:root {
    color-scheme: light;
    --bg: #fffcf9;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --brand: #0891b2;
    --brand-2: #06b6d4;
    --brand-warm: #f59e0b;
    --border: #e8ddd0;
    --glass-blur: 16px;
    --shadow-warm: rgba(120, 90, 50, 0.06);
    --shadow-warm-lg: rgba(120, 90, 50, 0.1);
    --shadow-brand: rgba(6, 182, 212, 0.08);
}

@supports (-moz-appearance: none) {
    :root { --glass-blur: 8px; }
}
.gradient-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 50%, #0e7490 100%) !important;
}

.gradient-secondary {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%) !important;
}

.gradient-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%) !important;
}

.gradient-surface {
    background: linear-gradient(145deg, #fffcf9 0%, #fef8f2 50%, #fdf3ea 100%) !important;
}

.dark .gradient-surface {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%) !important;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition: none !important;
    }
    html { scroll-behavior: auto; }
}
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; }
.transition-all { transition-property: all; }
.duration-200 { transition-duration: 200ms; }
.transform { transform: translateVar(--tw-translate-x) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.fill-current { fill: currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.list-disc { list-style-type: disc; }

/* ── Breadcrumb Professional Styling ── */
[aria-label="Breadcrumb"] ol { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
[aria-label="Breadcrumb"] ol li { display: flex; align-items: center; font-size: 0.84rem; color: #64748b; }
.dark [aria-label="Breadcrumb"] ol li { color: #94a3b8; }
[aria-label="Breadcrumb"] ol li + li::before { content: '\203A'; margin: 0 0.45rem; font-size: 1rem; color: #94a3b8; font-weight: 600; }
.dark [aria-label="Breadcrumb"] ol li + li::before { color: #64748b; }
[aria-label="Breadcrumb"] ol li a { color: #64748b; text-decoration: none; transition: color 0.15s ease; }
.dark [aria-label="Breadcrumb"] ol li a { color: #94a3b8; }
[aria-label="Breadcrumb"] ol li a:hover { color: #06b6d4; }
.dark [aria-label="Breadcrumb"] ol li a:hover { color: #22d3ee; }
[aria-label="Breadcrumb"] ol li:last-child { color: #1e293b; font-weight: 600; }
.dark [aria-label="Breadcrumb"] ol li:last-child { color: #e2e8f0; }

/* Breadcrumb class variant (older pages with &gt; separators) */
nav.breadcrumb { font-size: 0.84rem; color: #64748b; padding: 0 0 0.25rem; }
.dark nav.breadcrumb { color: #94a3b8; }
nav.breadcrumb a { color: #64748b; text-decoration: none; transition: color 0.15s ease; }
.dark nav.breadcrumb a { color: #94a3b8; }
nav.breadcrumb a:hover { color: #06b6d4; }
.dark nav.breadcrumb a:hover { color: #22d3ee; }
nav.breadcrumb span { color: #1e293b; font-weight: 600; }
.dark nav.breadcrumb span { color: #e2e8f0; }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.animate-spin {
    animation: spin 1s linear infinite;
}
.border-t-transparent { border-top-color: transparent; }
input, textarea, select {
    font-family: inherit;
    font-size: 100%;
    line-height: inherit;
    margin: 0;
}
input[type="url"], input[type="text"], textarea, select {
    appearance: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(calc(var(--glass-blur) * 0.6));
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: 0.75rem;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    line-height: 1.5rem;
    width: 100%;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

input[type="url"]:focus, input[type="text"]:focus, textarea:focus, select:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 1);
}

.dark input[type="url"], .dark input[type="text"], .dark textarea, .dark select {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(71, 85, 105, 0.6);
    color: #e2e8f0;
}

.dark input[type="url"]:focus, .dark input[type="text"]:focus, .dark textarea:focus, .dark select:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1), 0 4px 12px rgba(0, 0, 0, 0.2);
    background: rgba(51, 65, 85, 1);
}
::placeholder {
    color: #6b7280;
}
.prose {
    max-width: 65ch;
}
.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}
.prose ul {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
}
.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}
.prose strong {
    font-weight: 600;
}
.prose-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}
button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
a {
    color: inherit;
    text-decoration: inherit;
}

/* Professional Button System */
.btn-primary {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.625rem;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.2);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(8, 145, 178, 0.2);
}

.btn-secondary {
    background: #ffffff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #0891b2;
    color: #0891b2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.dark .btn-secondary {
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
    border-color: rgba(71, 85, 105, 0.5);
}

.dark .btn-secondary:hover {
    background: rgba(51, 65, 85, 1);
    border-color: #06b6d4;
    color: #06b6d4;
}

/* Tool link buttons (used across tools.html and "You might also like" sections) */
.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.813rem;
    font-weight: 600;
    color: #fff;
    background: #0891b2;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}
.tool-link:hover {
    background: #0e7490;
    transform: translateY(-1px);
}
html.dark .tool-link {
    background: rgba(8, 145, 178, 0.85);
}
html.dark .tool-link:hover {
    background: #0891b2;
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.625rem;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.btn-success:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.3);
}

/* Legacy button for compatibility */
.btn-dark { 
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff; 
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; 
    padding: 0.875rem 1.5rem; 
    border-radius: 0.75rem; 
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
}

.btn-dark:hover { 
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.4);
}

/* ----- Blog & Article readability fixes ----- */
/* Ensure hero headings on gradient headers remain readable */
header.bg-gradient-to-r h1,
.post-hero-title {
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* Force dark text in blog post hero headers regardless of utility classes
    Many posts use <header class="... text-white ..."> which makes titles/bylines hard to read on light gradients.
    This override ensures strong contrast by switching those to near-black. */
header.text-white h1,
header.text-white .text-sm,
header.text-white span,
header.text-white div {
  color: #0f172a !important; /* slate-900 */
  text-shadow: none !important;
}


/* Improve generic heading contrast inside articles */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    color: #0f172a; /* slate-900 */
}

/* Responsive helpers for blog layout */
@media (max-width: 640px) {
    .blog-grid { grid-template-columns: 1fr !important; gap: 1.25rem !important; }
}

@media (prefers-color-scheme: dark) {
    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4 {
        color: #f1f5f9; /* slate-50 */
        text-shadow: none;
    }
}

/* ---- Custom Range Slider (filled track) ---- */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
    outline: none;
    cursor: pointer;
}
html.dark input[type="range"] {
    background: #334155;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    cursor: pointer;
    transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    cursor: pointer;
}
input[type="range"]::-moz-range-progress {
    background: linear-gradient(90deg, #06b6d4, #0891b2);
    height: 8px;
    border-radius: 999px;
}
input[type="range"]::-moz-range-track {
    background: #e2e8f0;
    height: 8px;
    border-radius: 999px;
}
html.dark input[type="range"]::-moz-range-track {
    background: #334155;
}

/* ---- Quick-Steps Guide (shared across all tools) ---- */
.quick-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 0.75rem;
    background: rgba(6, 182, 212, 0.04);
    border: 1px solid rgba(6, 182, 212, 0.12);
    flex-wrap: wrap;
}
.quick-steps .step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #475569;
    font-weight: 500;
    white-space: nowrap;
}
html.dark .quick-steps { background: rgba(6,182,212,0.06); border-color: rgba(6,182,212,0.15); }
html.dark .quick-steps .step { color: #94a3b8; }
.quick-steps .step-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.quick-steps .step-arrow { color: #cbd5e1; font-size: 1rem; margin: 0 0.15rem; }
html.dark .quick-steps .step-arrow { color: #475569; }
.setting-hint {
    font-size: 0.72rem; color: #94a3b8; margin-top: 0.15rem; line-height: 1.35;
}
@media (max-width: 480px) {
    .quick-steps { gap: 0.35rem; padding: 0.7rem 0.75rem; }
    .quick-steps .step { font-size: 0.75rem; }
    .quick-steps .step-num { width: 20px; height: 20px; font-size: 0.65rem; }
    .quick-steps .step-arrow { font-size: 0.85rem; }
}

/* ---- Tool: Meta/Tag Extractor shared styles (migrated from inline) ---- */
.fade-in { animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Circular loading spinner */
.loading { display: inline-block; width: 50px; height: 50px; border: 3px solid rgba(59, 130, 246, 0.3); border-radius: 50%; border-top-color: #06b6d4; animation: spin 1s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Professional Card System */
.card {
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 230, 200, 0.35);
    border-radius: 1.25rem;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(120, 90, 50, 0.05), 0 1px 3px rgba(120, 90, 50, 0.03);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(120, 90, 50, 0.1), 0 6px 16px rgba(6, 182, 212, 0.06);
    border-color: rgba(6, 182, 212, 0.25);
}

.dark .card {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.dark .card:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.25);
}

/* Enhanced tag card */
.tag-card { 
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(203, 213, 225, 0.3);
    border-radius: 0.875rem;
    padding: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.tag-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: rgba(14, 165, 233, 0.4);
    background: rgba(255, 255, 255, 1);
}

.dark .tag-card {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(71, 85, 105, 0.3);
}

.dark .tag-card:hover {
    background: rgba(51, 65, 85, 1);
    border-color: rgba(14, 165, 233, 0.4);
}

/* Copy button baseline + success state */
.copy-btn { transition: all 0.2s ease-in-out; cursor: pointer; border: none; font-family: inherit; font-weight: 500; position: relative; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.copy-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); }
.copy-btn:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.copy-btn.copied { background-color: #10b981 !important; color: #fff; animation: copySuccess 0.3s ease-in-out; }
@keyframes copySuccess { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* Primary button variant */
.copy-btn-primary { background: #0891b2; color: #fff; }
.copy-btn-primary:hover { background: #0e7490; }

/* Utility additions used by extractor components */
.border-l-4 { border-left-width: 4px; }
.border-blue-500 { border-color: #06b6d4; }
.bg-green-50 { background-color: #f0fdf4; }
.border-green-200 { border-color: #bbf7d0; }
.text-green-700 { color: #15803d; }
.from-slate-50 { --tw-gradient-from: #f8fafc; --tw-gradient-to: rgba(248,250,252,0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }

/* Keyword chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); border: 1px solid #e2e8f0; color: #1f2937; padding: 8px 12px; border-radius: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); font-weight: 500; font-size: 0.875rem; transition: all 0.2s ease-in-out; cursor: pointer; position: relative; overflow: hidden; }
.chip:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(59,130,246,0.15); border-color: #06b6d4; background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); }
.chip.copied { background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%); border-color: #06b6d4; color: #155e75; animation: copySuccess 0.3s ease-in-out; }

/* Professional input with embedded button */
.input-container { 
    position: relative; 
    display: flex; 
    align-items: center; 
    gap: 1rem;
}

.url-input { 
    flex: 1; 
    padding: 1rem 1.25rem; 
    border: 1px solid rgba(203, 213, 225, 0.6); 
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #1e293b; 
    border-radius: 0.75rem; 
    font-size: 1rem; 
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    outline: none; 
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.url-input:focus { 
    border-color: #06b6d4; 
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 1);
}

.url-input:disabled { 
    background-color: rgba(248, 250, 252, 0.8); 
    color: #94a3b8; 
    cursor: not-allowed; 
}

.extract-btn-small { 
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: #ffffff;
    border: none;
    border-radius: 0.75rem; 
    padding: 1rem 1.5rem; 
    cursor: pointer; 
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
    min-width: 100px;
}

.extract-btn-small:hover:not(:disabled) { 
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

.extract-btn-small:active { 
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

.extract-btn-small:disabled { 
    background: #94a3b8; 
    cursor: not-allowed; 
    opacity: 0.6;
    transform: none;
}

.dark .url-input {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(71, 85, 105, 0.6);
    color: #e2e8f0;
}

.dark .url-input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1), 0 4px 12px rgba(0, 0, 0, 0.2);
    background: rgba(51, 65, 85, 1);
}

/* Force light-mode input text to always be dark (mobile browser fix) */
.url-input {
    color: #1e293b !important;
    -webkit-text-fill-color: #1e293b;
}
.dark .url-input {
    color: #e2e8f0 !important;
    -webkit-text-fill-color: #e2e8f0;
}

/* ========================= */
/* Mobile readability & nav  */
/* ========================= */

/* Global: make blog body text dark in all viewports (light mode) */
.article-content {
    color: #000000 !important; /* pure black for strongest readability */
    opacity: 1 !important;
    mix-blend-mode: normal !important;
}
.article-content p,
.article-content li,
.article-content span,
.article-content a,
.article-content blockquote,
.article-content strong,
.article-content em,
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: #000000 !important;
    opacity: 1 !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: auto;
}

/* If authors used gray utility classes inside article content, force darker text */
.article-content .text-gray-500,
.article-content .text-gray-600,
.article-content .text-gray-700,
.article-content .text-gray-800,
.article-content .text-slate-500,
.article-content .text-slate-600,
.article-content .text-slate-700 {
    color: #000000 !important;
}

/* Ensure dark-on-dark components keep white text for contrast */
.article-content .highlight-box,
.article-content .highlight-box p,
.article-content .highlight-box a,
.article-content .highlight-box strong,
.article-content .highlight-box em,
.article-content .security-box,
.article-content .security-box p,
.article-content .security-box a,
.article-content .security-box strong,
.article-content .security-box em,
.article-content .cta-box,
.article-content .cta-box p,
.article-content .cta-box a,
.article-content .cta-box strong,
.article-content .cta-box em {
    color: #ffffff !important;
}

/* Preserve good contrast in dark mode for posts */
@media (prefers-color-scheme: dark) {
    .article-content,
    .article-content p,
    .article-content li,
    .article-content span,
    .article-content a,
    .article-content blockquote,
    .article-content strong,
    .article-content em,
    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4,
    .article-content h5,
    .article-content h6 { color: #e5e7eb !important; }
    .article-content .text-gray-500,
    .article-content .text-gray-600,
    .article-content .text-gray-700,
    .article-content .text-gray-800,
    .article-content .text-slate-500,
    .article-content .text-slate-600,
    .article-content .text-slate-700 { color: #e5e7eb !important; }
    /* Preserve white text in dark background components */
    .article-content .highlight-box,
    .article-content .highlight-box p,
    .article-content .highlight-box a,
    .article-content .highlight-box strong,
    .article-content .highlight-box em,
    .article-content .security-box,
    .article-content .security-box p,
    .article-content .security-box a,
    .article-content .security-box strong,
    .article-content .security-box em,
    .article-content .cta-box,
    .article-content .cta-box p,
    .article-content .cta-box a,
    .article-content .cta-box strong,
    .article-content .cta-box em { color: #ffffff !important; }
}

/* Improve blog text contrast on small screens */
@media (max-width: 640px) {
    /* Force stronger contrast for paragraphs and list items inside articles */
    .article-content p,
    .article-content li {
        color: #000000 !important; /* pure black */
        -webkit-text-fill-color: #000000 !important; /* iOS Safari: ensure solid fill */
        font-size: 1.0625rem;      /* ~17px for mobile */
        line-height: 1.85;         /* relaxed for small screens */
        font-weight: 500;          /* slightly heavier for mobile rendering */
        -webkit-font-smoothing: auto;
        -moz-osx-font-smoothing: grayscale;
        opacity: 1 !important;
        text-shadow: none !important;
    }

    /* Ensure descendants inside paragraphs/lists also render solid black without blending */
    .article-content p *,
    .article-content li * {
        color: #000000 !important;
        -webkit-text-fill-color: #000000 !important;
        opacity: 1 !important;
        mix-blend-mode: normal !important;
        text-shadow: none !important;
    }

    /* Also override common Tailwind gray text utility classes inside article content */
    .article-content .text-gray-500,
    .article-content .text-gray-600,
    .article-content .text-gray-700,
    .article-content .text-gray-800,
    .article-content .text-slate-500,
    .article-content .text-slate-600,
    .article-content .text-slate-700 {
        color: #000000 !important; /* pure black on mobile */
    }

    /* Ensure base article text inherits strong color even if utilities apply */
    .article-content { color: #000000 !important; -webkit-text-fill-color: #000000 !important; }

    /* Headings spacing on mobile */
    .article-content h2 { margin-top: 2rem; margin-bottom: 0.75rem; }
    .article-content h3 { margin-top: 1.25rem; margin-bottom: 0.5rem; }

    /* Cards/notice boxes spacing adjustments */
    .warning-box, .tip-box, .success-box, .stat-box, .sleep-data-box,
    .game-box, .comparison-box, .security-box, .safe-box, .checklist-box {
        padding: 1.0rem !important;
        border-radius: 10px !important;
    }
}

/* Preserve good contrast in dark mode on mobile */
@media (max-width: 640px) and (prefers-color-scheme: dark) {
    .article-content p,
    .article-content li {
        color: #e2e8f0 !important; /* slate-200 */
    }
    .article-content .text-gray-500,
    .article-content .text-gray-600,
    .article-content .text-gray-700,
    .article-content .text-gray-800,
    .article-content .text-slate-500,
    .article-content .text-slate-600,
    .article-content .text-slate-700 {
        color: #e5e7eb !important; /* lighter gray for dark mode */
    }
}

/* Mobile navbar polish: compact and efficient */
nav {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(160%) blur(10px);
}
.dark nav {
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: saturate(160%) blur(10px);
}

/* Ultra-compact navigation for all screen sizes */
nav .max-w-7xl {
    padding: 0.5rem 1rem !important; /* Even more compact globally */
}

/* Compact nav links — always look like text links, not fat buttons */
nav .btn-secondary {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    border-radius: 0.5rem;
}

nav .btn-secondary:hover {
    background: rgba(6,182,212,0.08);
    color: #06b6d4;
    border: none;
    box-shadow: none;
    transform: none;
}

/* Nav brand icon — always visible */
nav .w-8 {
    width: 1.5rem !important;
    height: 1.5rem !important;
}

nav .text-xl {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
}

nav .gap-3 { gap: 0.5rem !important; }
nav .gap-4 { gap: 0.5rem !important; }
nav .gap-6 { gap: 0.6rem !important; }

/* Mobile-specific ultra-compact navigation */
@media (max-width: 640px) {
    nav .max-w-7xl {
        padding: 0.5rem 0.75rem !important;
    }
    
    nav .text-xl {
        font-size: 0.85rem !important;
    }
    
    nav .btn-secondary {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.75rem !important;
        white-space: nowrap !important;
        min-height: 2.5rem;
        display: inline-flex;
        align-items: center;
    }
    
    /* Ensure single row layout — never wrap */
    nav .flex {
        flex-wrap: nowrap !important;
        align-items: center !important;
    }
    
    nav .w-8 {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
    
    /* Sticky nav */
    nav.sticky {
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
    }
    
    main {
        padding-top: 0 !important;
    }
    
    /* Compact page headers on mobile */
    header.text-center {
        margin-bottom: 1.5rem !important;
    }
    
    header.text-center h1 {
        font-size: 2rem !important;
        line-height: 1.1 !important;
        margin-bottom: 1rem !important;
    }
    
    header.text-center p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }
    
    /* Compact footer on mobile */
    footer {
        margin-top: 2rem !important;
        padding-top: 1rem !important;
    }
    
    footer .py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    
    footer .py-6 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    footer nav {
        gap: 0.75rem !important;
    }
    
    footer .w-6 {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
    
    footer .w-8 {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    footer .text-sm {
        font-size: 0.75rem !important;
    }
    
    footer .text-xs {
        font-size: 0.7rem !important;
    }
}

@media (max-width: 640px) {
    /* Scope to header nav only — not footer nav */
    .dark body > nav a { color: #e2e8f0; }
    .dark body > nav a:hover { background-color: #1e293b; }
}

/* Footer nav links — always plain text, never boxes */
footer nav a {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.25rem 0.375rem !important;
    border-radius: 0.25rem !important;
}

footer nav a:hover {
    background: transparent !important;
    box-shadow: none !important;
}

/* Professional Typography Enhancements */
.text-gradient-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-secondary {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Enhanced Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.dark .loading-shimmer {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

/* Professional Status Indicators */
.status-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid #10b981;
    color: #047857;
}

.status-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #ef4444;
    color: #dc2626;
}

.status-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    color: #d97706;
}

.dark .status-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.2) 100%);
    color: #34d399;
}

.dark .status-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.2) 100%);
    color: #f87171;
}

.dark .status-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.2) 100%);
    color: #fbbf24;
}

/* Enhanced Focus States */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    border-color: #06b6d4;
}

.dark .focus-ring:focus {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* Professional Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in-up {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Professional Grid Layouts */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1.5rem;
}

.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
    gap: 1.25rem;
}

/* Enhanced Responsive Utilities */
@media (max-width: 640px) {
    .mobile-full-width {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
    }
    
    .mobile-px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .mobile-text-center {
        text-align: center;
    }
    
    /* Compact hero sections on mobile */
    .pt-12 {
        padding-top: 2rem !important;
    }
    
    .pb-20 {
        padding-bottom: 3rem !important;
    }
    
    /* Reduce large text sizes on mobile */
    .text-4xl {
        font-size: 2rem !important;
        line-height: 1.1 !important;
    }
    
    .text-5xl {
        font-size: 2.5rem !important;
        line-height: 1.1 !important;
    }
    
    .text-6xl {
        font-size: 3rem !important;
        line-height: 1.1 !important;
    }
    
    /* Compact spacing */
    .mb-12 {
        margin-bottom: 2rem !important;
    }
    
    .mb-16 {
        margin-bottom: 2.5rem !important;
    }
    
    .mt-16 {
        margin-top: 2.5rem !important;
    }
    
    /* Compact cards and sections */
    .p-8 {
        padding: 1.5rem !important;
    }
    
    .py-12 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Compact glass cards — exclude nav */
    .glass-card:not(nav) {
        padding: 1.25rem !important;
    }
    
    nav.glass-card {
        padding: 0 !important;
    }
    
    /* Mobile input — keep as row, never stack vertically */
    .input-container {
        flex-direction: row !important;
        gap: 0.5rem !important;
    }
    
    .url-input {
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
        min-width: 0 !important;
        flex: 1 1 0% !important;
    }
    
    .btn-primary {
        padding: 0.55rem 1rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    .btn-success {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.55rem 1rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Compact feature cards */
    .card {
        padding: 1.25rem !important;
    }
    
    .card .w-16 {
        width: 3rem !important;
        height: 3rem !important;
        margin-bottom: 1rem !important;
    }
    
    .card .w-12 {
        width: 2.5rem !important;
        height: 2.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Compact text in cards */
    .card .text-xl {
        font-size: 1.125rem !important;
    }
    
    .card .text-lg {
        font-size: 1rem !important;
    }
}

/* Professional Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

/* Selection Styling */
::selection {
    background: rgba(14, 165, 233, 0.2);
    color: #0f172a;
}

.dark ::selection {
    background: rgba(14, 165, 233, 0.3);
    color: #f1f5f9;
}

/* ═══════════════════════════════════════════
   Mega Footer
   ═══════════════════════════════════════════ */
.mega-footer {
    background: linear-gradient(180deg, #0c1222 0%, #0a0f1e 100%);
    color: #94a3b8;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.7;
    margin-top: 0;
    position: relative;
}
.mega-footer::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, #06b6d4 0%, #8b5cf6 35%, #f59e0b 65%, #06b6d4 100%);
    background-size: 200% 100%;
    animation: navGradient 6s ease infinite;
}
.mega-footer-inner {
    padding: 60px 0 0;
}
.mega-footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
    display: inline-block;
    border-left: 2px solid transparent;
    padding-left: 0;
}
.mega-footer a:hover {
    color: #ffffff;
    border-left-color: #06b6d4;
    padding-left: 8px;
}
.mega-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2.5rem;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 2rem;
}
.mega-footer-brand {
    padding-right: 1rem;
}
.mega-footer-brand .brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    display: block;
    margin-bottom: 0.75rem;
}
.mega-footer-brand .brand-tagline {
    color: #94a3b8;
    line-height: 1.7;
    margin-bottom: 1rem;
}
.mega-footer-col h4 {
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.mega-footer-col h4:not(:first-child) {
    margin-top: 1.5rem;
}
.mega-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mega-footer-col ul li {
    margin-bottom: 0.4rem;
}
.mega-footer-col ul li a {
    font-size: 0.8125rem;
}
.mega-footer-bottom {
    border-top: 1px solid #1e293b;
    margin-top: 40px;
    padding: 1.25rem 2rem;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #475569;
}
.mega-footer-bottom a {
    border-left: none;
    padding-left: 0;
}
.mega-footer-bottom a:hover {
    padding-left: 0;
    border-left: none;
}
@media (max-width: 1024px) {
    .mega-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 768px) {
    .mega-footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .mega-footer a {
        border-left: none;
        padding-left: 0;
    }
    .mega-footer a:hover {
        padding-left: 0;
        border-left: none;
    }
    .mega-footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════
   Warm Theme Enhancements & Animations
   ═══════════════════════════════════════════ */

/* Animated hero background orbs */
.hero-decor {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.hero-decor .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}

.hero-decor .orb-cyan {
    width: min(400px, 60vw);
    height: min(400px, 60vw);
    background: radial-gradient(circle, rgba(6, 182, 212, 0.18), transparent 70%);
    top: -8%;
    left: -5%;
    animation: orbDrift 18s ease-in-out infinite;
}

.hero-decor .orb-amber {
    width: min(350px, 55vw);
    height: min(350px, 55vw);
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15), transparent 70%);
    bottom: -12%;
    right: -5%;
    animation: orbDrift 22s ease-in-out infinite reverse;
}

.hero-decor .orb-purple {
    width: min(280px, 45vw);
    height: min(280px, 45vw);
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12), transparent 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbDrift 20s ease-in-out infinite;
    animation-delay: -8s;
}

@keyframes orbDrift {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); }
    25%      { transform: translateY(-18px) translateX(10px) scale(1.04); }
    50%      { transform: translateY(8px) translateX(-12px) scale(0.97); }
    75%      { transform: translateY(-10px) translateX(6px) scale(1.02); }
}

html.dark .hero-decor .orb-cyan { opacity: 0.4; }
html.dark .hero-decor .orb-amber { opacity: 0.25; }
html.dark .hero-decor .orb-purple { opacity: 0.2; }

/* Trust badges row */
.trust-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 230, 200, 0.4);
    box-shadow: 0 2px 8px rgba(120, 90, 50, 0.05);
    color: #334155;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
}

.trust-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(120, 90, 50, 0.08);
}

.trust-badge svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

html.dark .trust-badge {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

/* Category pills for tools page */
.cat-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cat-label.img  { background: rgba(6, 182, 212, 0.1); color: #0891b2; }
.cat-label.pdf  { background: rgba(239, 68, 68, 0.08); color: #dc2626; }
.cat-label.yt   { background: rgba(239, 68, 68, 0.1); color: #b91c1c; }
.cat-label.util { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }

html.dark .cat-label.img  { background: rgba(6, 182, 212, 0.15); color: #67e8f9; }
html.dark .cat-label.pdf  { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
html.dark .cat-label.yt   { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
html.dark .cat-label.util { background: rgba(139, 92, 246, 0.12); color: #c4b5fd; }

/* Section headings with warm underline */
.section-heading {
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3rem;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #06b6d4, #f59e0b);
}

/* Warm hover-lift */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(120, 90, 50, 0.08), 0 4px 12px rgba(6, 182, 212, 0.04);
}

/* Stats counter in hero */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
}

.hero-stat-num {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-stat-label {
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

html.dark .hero-stat-label {
    color: #94a3b8;
}

/* Warm input styles */
.drop-zone {
    border: 2px dashed rgba(6, 182, 212, 0.3) !important;
    background: rgba(6, 182, 212, 0.02) !important;
    border-radius: 1.25rem !important;
    transition: all 0.3s ease !important;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #06b6d4 !important;
    background: rgba(6, 182, 212, 0.06) !important;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.05) !important;
}

/* Enhanced responsive for tool pages */
@media (max-width: 640px) {
    /* Better hero spacing on mobile */
    .hero-stats { gap: 1.25rem; }
    .hero-stat-num { font-size: 1.5rem; }
    
    .trust-row { gap: 0.5rem; }
    .trust-badge { font-size: 0.75rem; padding: 0.375rem 0.75rem; }
    
    /* Tool controls responsive */
    .controls-grid { grid-template-columns: 1fr !important; }
    .action-row { flex-direction: column; }
    .action-row button,
    .action-row .btn-primary,
    .action-row .btn-success,
    .action-row a { width: 100%; text-align: center; }
    
    /* Compact stats */
    .stats-row { gap: 0.75rem; }
    .stat-item { padding: 0.5rem 0.75rem; }
    
    /* Better card touch targets */
    .tool-link {
        padding: 0.625rem 1.25rem !important;
        font-size: 0.875rem !important;
        width: 100%;
        justify-content: center;
    }
    
    /* Canvas containers — reduce min-height on mobile */
    .canvas-wrap,
    .preview-area,
    .pdf-preview {
        min-height: 280px !important;
    }
    
    /* Touch targets */
    canvas { touch-action: manipulation; }
    
    /* Drop zone compact padding */
    .drop-zone {
        padding: 1.5rem 1rem !important;
    }
    
    /* Table horizontal scroll */
    .table-scroll,
    .image-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Range inputs — never fixed width */
    input[type="range"] {
        width: 100% !important;
        max-width: 200px;
    }
    
    /* Filename inputs responsive */
    .filename-input {
        width: 100% !important;
        max-width: 220px;
    }
    
    /* Toggle/toolbar rows — allow wrapping */
    .toggle-row,
    .toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Settings/controls rows */
    .settings-row,
    .global-controls {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    /* Mega footer mobile compact */
    .mega-footer-grid {
        gap: 1.5rem;
        padding: 0 1.25rem;
    }
    .mega-footer-brand {
        padding-right: 0;
    }
    .mega-footer-col h4 {
        margin-bottom: 0.5rem;
    }
    .mega-footer-col ul li {
        margin-bottom: 0.25rem;
    }
    .mega-footer-bottom {
        padding: 1rem 1.25rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    /* Editor sidebar — limit on mobile when stacked */
    .editor-sidebar,
    .sidebar {
        max-height: 50vh;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .hero-stats { 
        gap: 0.75rem; 
        flex-direction: row;
    }
    
    .hero-stat-num { font-size: 1.25rem; }
    .hero-stat-label { font-size: 0.6875rem; }
    
    /* Stack file info on very small screens */
    .file-info { flex-direction: column; gap: 0.5rem; text-align: center; }
    .file-info .size { margin-left: 0; }
    
    /* Extra compact footer */
    .mega-footer-grid {
        padding: 0 1rem;
        gap: 1.25rem;
    }
    .mega-footer-col ul li a {
        font-size: 0.75rem;
    }
}

/* Pulse animation for CTA */
@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25); }
    50% { box-shadow: 0 4px 24px rgba(6, 182, 212, 0.4); }
}

.btn-pulse {
    animation: gentlePulse 3s ease-in-out infinite;
}

.btn-pulse:hover {
    animation: none;
}

/* Smooth scroll reveal */
@keyframes revealUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal-up {
    animation: revealUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    animation: revealUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(n+9) { animation-delay: 0.45s; }

/* ═══════════════════════════════════════════
   MOBILE COMPACTNESS & FIREFOX PERFORMANCE
   ═══════════════════════════════════════════ */

/* Font rendering optimization */
* {
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}
.tool-interface *,
.settings-panel *,
.tool-container *,
.controls-grid * {
    text-rendering: optimizeLegibility;
}

/* Scrolling performance */
.thumbnails-grid,
.pages-grid,
.output-container,
.pdf-pages-container {
    will-change: transform;
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
}
.pdf-pages-container {
    contain: layout style;
    overflow-y: auto;
    max-height: 70vh;
}

/* Firefox-specific: reduce animations */
.is-firefox * {
    animation-duration: 0.1s !important;
    transition-duration: 0.15s !important;
}
.is-firefox .parallax,
.is-firefox .floating-animation,
.is-firefox .pulse-animation,
.is-firefox .btn-pulse {
    animation: none !important;
}
.is-firefox .hero-decor .orb {
    animation: none !important;
}
/* Reduce stagger animation overhead in Firefox */
.is-firefox .stagger-children > * {
    animation: none !important;
    opacity: 1 !important;
}

/* Firefox: replace backdrop-filter with solid bg on tool pages */
.is-firefox .glass-card:not(nav) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.97) !important;
}
.is-firefox.dark .glass-card:not(nav) {
    background: rgba(30, 41, 59, 0.97) !important;
}
.is-firefox .card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.97) !important;
}
.is-firefox.dark .card {
    background: rgba(30, 41, 59, 0.97) !important;
}
.is-firefox .tag-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.is-firefox .control-group input,
.is-firefox .control-group select,
.is-firefox .url-input,
.is-firefox .tz-search,
.is-firefox .clock-card,
.is-firefox .toolbar,
.is-firefox .tool-card,
.is-firefox .search-box input {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Sticky action bar for mobile */
.sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    z-index: 999;
    display: none;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}
html.dark .sticky-action-bar {
    background: #1e293b;
    border-top-color: #334155;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
.sticky-action-bar .btn-primary,
.sticky-action-bar .btn-success {
    width: 100%;
    padding: 14px !important;
    font-size: 1rem !important;
    font-weight: 600;
    justify-content: center;
}

/* ═══════════════════════════════════════════
   MOBILE BREAKPOINT — TOOL COMPACTNESS
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Upload zone — shrink on mobile */
    .drop-zone {
        padding: 24px 16px !important;
        min-height: 120px !important;
    }
    .drop-zone svg {
        width: 32px !important;
        height: 32px !important;
        margin-bottom: 8px !important;
    }
    .drop-zone .font-semibold,
    .drop-zone p:first-of-type {
        font-size: 0.95rem;
    }
    .drop-zone .text-sm,
    .drop-zone p:last-of-type {
        font-size: 0.8rem;
    }

    /* File info — compact bar after upload */
    .file-info {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        min-height: unset;
        height: 48px;
        border-radius: 8px;
    }
    .file-info .name {
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 55%;
    }
    .file-info .size {
        font-size: 0.75rem;
        margin-left: auto;
    }

    /* Settings panel — compact on mobile */
    .controls-grid,
    .settings-panel {
        gap: 10px !important;
        margin-top: 8px !important;
        margin-bottom: 8px !important;
    }
    .control-group {
        margin-bottom: 4px;
    }
    .control-group label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    .control-group input,
    .control-group select {
        font-size: 16px !important;
        height: 36px;
        padding: 4px 8px !important;
    }
    input[type="range"] {
        height: 36px;
    }
    .setting-group label {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    .setting-group input,
    .setting-group select {
        font-size: 16px !important;
        height: 36px;
        padding: 4px 8px !important;
    }
    .lock-toggle {
        margin-top: 6px;
        font-size: 0.8rem;
    }
    .quality-row {
        margin-top: 6px;
    }

    /* Stats row compact */
    .stats-row {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    .stat-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    .stat-label {
        font-size: 0.65rem;
    }

    /* Tool container compact */
    .tool-container {
        padding: 0 8px;
    }

    /* Tool header compact */
    .tool-container header {
        margin-bottom: 12px !important;
    }
    .tool-container header h1 {
        font-size: 1.3rem !important;
        margin-bottom: 4px !important;
    }
    .tool-container header p {
        font-size: 0.85rem !important;
        margin-bottom: 0 !important;
    }

    /* Breadcrumb compact */
    .breadcrumb,
    [aria-label="Breadcrumb"] {
        font-size: 0.75rem !important;
        margin-bottom: 8px !important;
        padding: 4px 0;
    }
    [aria-label="Breadcrumb"] ol li { font-size: 0.75rem; }
    [aria-label="Breadcrumb"] ol li + li::before { font-size: 0.8rem; margin: 0 0.3rem; }

    /* Main glass card compact */
    .glass-card:not(nav) {
        padding: 12px !important;
        margin-bottom: 8px;
    }

    /* Action row compact */
    .action-row {
        margin-top: 10px !important;
        gap: 8px !important;
    }

    /* Result/output section compact */
    .success-badge {
        margin-bottom: 8px;
    }
    .preview-area {
        margin-top: 10px;
    }
    .preview-area img,
    .preview-area canvas {
        max-height: 200px;
        object-fit: contain;
    }

    /* Download button full width */
    .btn-success,
    .download-btn {
        width: 100% !important;
        padding: 14px !important;
        font-size: 1rem !important;
        justify-content: center;
    }

    /* Two column to single column */
    .two-column,
    .grid-2,
    .side-by-side {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    /* SEO content section compact */
    .seo-section {
        margin-top: 24px !important;
        padding: 16px 12px !important;
    }
    .seo-section h2 {
        font-size: 1.1rem !important;
    }

    /* Related tools grid */
    .related-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    /* FAQ items compact */
    .faq-item {
        padding: 0;
        margin-bottom: 6px;
    }
    .faq-item summary {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    .faq-item .faq-answer {
        padding: 0 12px 10px;
        font-size: 0.85rem;
    }

    /* Thumbnail grids compact */
    .thumbnails-grid,
    .pages-grid,
    .files-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }
    .thumbnail-card,
    .page-card {
        padding: 4px;
    }
    .thumbnail-card img,
    .thumbnail-card canvas,
    .page-card img,
    .page-card canvas {
        width: 100%;
        height: 80px;
        object-fit: cover;
    }
    .page-number,
    .thumbnail-card .page-number {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
    .thumbnail-actions,
    .page-actions {
        gap: 2px;
    }
    .thumbnail-actions button,
    .page-actions button {
        padding: 3px 5px;
        font-size: 0.65rem;
    }

    /* Progress bar full width */
    .progress-container {
        width: 100%;
        padding: 12px;
    }
    .progress-bar {
        height: 8px;
        border-radius: 4px;
    }
    .progress-text {
        font-size: 0.85rem;
        text-align: center;
        margin-top: 6px;
    }

    /* Compact the main section padding */
    section.pt-8 {
        padding-top: 8px !important;
    }
    section.pb-16 {
        padding-bottom: 16px !important;
    }
}

/* ═══════════════════════════════════════════
   PROFESSIONAL COMPACT NAVBAR
   ═══════════════════════════════════════════ */
nav.glass-card {
    padding: 0 !important;
}
nav.glass-card .max-w-7xl {
    padding: 0.4rem 1rem !important;
}
nav.glass-card .flex.items-center.gap-3 {
    gap: 0.4rem !important;
}
nav.glass-card svg.w-8 {
    width: 1.35rem !important;
    height: 1.35rem !important;
}
nav.glass-card .text-xl {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
}
nav.glass-card .btn-secondary {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.3rem 0.65rem !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: #475569;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
nav.glass-card .btn-secondary:hover {
    background: rgba(6,182,212,0.08) !important;
    color: #0891b2 !important;
    transform: none !important;
}
html.dark nav.glass-card .btn-secondary {
    color: #94a3b8;
}
html.dark nav.glass-card .btn-secondary:hover {
    background: rgba(6,182,212,0.12) !important;
    color: #06b6d4 !important;
}

@media (max-width: 768px) {
    nav.glass-card .max-w-7xl {
        padding: 0.35rem 0.75rem !important;
    }
    nav.glass-card svg.w-8 {
        width: 1.1rem !important;
        height: 1.1rem !important;
    }
    nav.glass-card .text-xl {
        font-size: 0.82rem !important;
    }
    nav.glass-card .btn-secondary {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.72rem !important;
        min-height: 2rem;
    }
    nav.glass-card .flex.items-center.gap-4,
    nav.glass-card .flex.items-center.gap-6 {
        gap: 0.35rem !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   TOOL PAGE NEW LAYOUT — appended 2026-04-06
   ═══════════════════════════════════════════════════════════ */

/* --- Variable bridge (maps to existing design tokens) --- */
:root {
  --border-color: #e8ddd0;
  --bg-card: rgba(255,255,255,0.92);
  --bg-input: #ffffff;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --text-secondary: #475569;
  --accent-color: #06b6d4;
}
html.dark {
  --border-color: rgba(71,85,105,0.5);
  --bg-card: rgba(30,41,59,0.88);
  --bg-input: rgba(30,41,59,0.9);
  --text-primary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-secondary: #94a3b8;
}

/* ═══ TOOL HEADER ═══ */
.tool-header-area {
  max-width: 700px;
  margin: 0 auto 20px;
  text-align: center;
  padding: 20px 16px 0;
}
.tool-header-area h1 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  margin-bottom: 6px;
  line-height: 1.3;
}
.tool-header-area .tool-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* STEP INDICATOR */
.tool-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tool-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.tool-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}
.tool-step-sep {
  color: var(--border-color);
  font-size: 0.7rem;
}

/* ═══ TWO-COLUMN LAYOUT ═══ */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
}
.tool-workspace {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.tool-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 900px) {
  .tool-layout {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }
  .tool-sidebar {
    position: static;
  }
}

/* ═══ UPLOAD ZONE (Canva/iLovePDF style) ═══ */
.upload-zone-new {
  border: 2px dashed var(--border-color);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(6,182,212,0.03);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}
.upload-zone-new:hover,
.upload-zone-new.dragover {
  border-color: var(--accent-color);
  background: rgba(6,182,212,0.07);
  box-shadow: 0 0 0 4px rgba(6,182,212,0.08);
}
.upload-zone-new .uz-icon {
  font-size: 2.5rem;
  opacity: 0.7;
  line-height: 1;
}
.upload-zone-new .uz-title,
.upload-zone-new .upload-zone-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.upload-zone-new .uz-sub,
.upload-zone-new .upload-zone-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}
/* Prominent "Select File" button inside upload zone */
.upload-zone-new .uz-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 10px 24px;
  border-radius: 10px;
  background: var(--accent-color);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  pointer-events: none;
  transition: all 0.2s ease;
}
.upload-zone-new:hover .uz-btn {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(6,182,212,0.3);
}
html.dark .upload-zone-new {
  background: rgba(6,182,212,0.04);
}
html.dark .upload-zone-new:hover,
html.dark .upload-zone-new.dragover {
  background: rgba(6,182,212,0.08);
  box-shadow: 0 0 0 4px rgba(6,182,212,0.1);
}

/* ═══ FILE INFO BAR (new layout) ═══ */
.file-info-bar-new {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  min-height: 52px;
}
.file-info-bar-new .fib-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.file-info-bar-new .fib-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.file-info-bar-new .fib-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.file-info-bar-new .fib-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.file-info-bar-new .fib-remove:hover {
  color: #ef4444;
}

/* ═══ SETTINGS PANEL (iLovePDF/Smallpdf card style) ═══ */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.2s ease;
}
.settings-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
html.dark .settings-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.settings-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-color);
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

/* SETTING ROW */
.setting-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setting-row label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

/* COMPACT SELECT */
.setting-select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  transition: border-color 0.15s;
}
.setting-select:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* ICON BUTTON GROUP */
.btn-group {
  display: flex;
  gap: 6px;
}
.btn-group-item {
  flex: 1;
  padding: 8px 4px;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: all 0.15s;
  min-height: 44px;
}
.btn-group-item.active,
.btn-group-item:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(6,182,212,0.06);
}
.btn-group-item svg {
  width: 18px;
  height: 18px;
}

/* SLIDER WITH VALUE */
.slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.slider-header label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.slider-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-color);
  min-width: 36px;
  text-align: right;
}
.slider-new {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  cursor: pointer;
  accent-color: var(--accent-color);
}

/* COMPACT INPUT */
.setting-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.setting-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* PASSWORD WRAP */
.pass-wrap {
  position: relative;
}
.pass-wrap input {
  width: 100%;
  padding: 7px 36px 7px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.85rem;
  box-sizing: border-box;
}
.pass-wrap input:focus {
  outline: none;
  border-color: var(--accent-color);
}
.pass-wrap .pass-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  padding: 2px;
}

/* ═══ CTA BUTTON (iLovePDF/Smallpdf prominent style) ═══ */
.btn-cta {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent-color), #0891b2);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(6,182,212,0.2);
}
.btn-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6,182,212,0.35);
}
.btn-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(6,182,212,0.2);
}
.btn-cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
}
.btn-cta-secondary {
  width: 100%;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-cta-secondary:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* ═══ FILE THUMBNAILS ═══ */
.thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}
.thumb-card {
  position: relative;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 3/4;
  cursor: grab;
}
.thumb-card img,
.thumb-card canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-card .thumb-num {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.65rem;
  text-align: center;
  padding: 3px 4px;
}
.thumb-card .thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.thumb-card.dragging {
  opacity: 0.4;
  border-style: dashed;
}
.thumb-card.drag-over {
  border-color: var(--accent-color);
  border-style: solid;
}

/* ═══ MOBILE STICKY CTA (re-enabled: sidebar is inline, CTA scrolls away) ═══ */
.sticky-cta-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  z-index: 998;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@media (max-width: 900px) {
  .sticky-cta-bar.visible {
    display: block;
  }
  .sticky-cta-bar .btn-cta {
    width: 100%;
  }
  body.has-sticky-cta {
    padding-bottom: 72px;
  }
}

/* ═══ STATES ═══ */
.state-processing {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 20px;
  text-align: center;
}
.state-processing.active { display: flex; }

.spinner-new {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin-new 0.7s linear infinite;
}
@keyframes spin-new {
  to { transform: rotate(360deg); }
}
.processing-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}
.progress-bar-wrap {
  width: 100%;
  max-width: 280px;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent-color);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.state-success {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(34,197,94,0.06);
  border: 1.5px solid rgba(34,197,94,0.25);
}
.state-success.active { display: flex; }
.success-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.success-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  animation: pop-in 0.3s ease;
}
@keyframes pop-in {
  0% { transform: scale(0); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.success-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
}
.file-stats {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.file-stats span strong {
  color: var(--text-primary);
  font-weight: 600;
}

.state-error-new {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
}
.state-error-new.active { display: flex; }
.error-icon-new {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.error-text-new {
  font-size: 0.82rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.5;
}

/* ═══ SEO SECTION SPACING ═══ */
.seo-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

/* ═══ MOBILE POLISH (Canva/iLovePDF patterns) ═══ */
@media (max-width: 600px) {
  .tool-header-area {
    padding: 12px 12px 0;
    margin-bottom: 12px;
  }
  .tool-header-area h1 {
    font-size: 1.2rem;
    margin-bottom: 4px;
  }
  .tool-subtitle {
    font-size: 0.8rem;
  }
  .tool-steps {
    gap: 3px;
    font-size: 0.7rem;
    margin-bottom: 10px;
  }
  .tool-layout {
    padding: 8px;
    gap: 10px;
  }
  .upload-zone-new {
    padding: 28px 16px;
    min-height: 160px;
    gap: 8px;
    border-radius: 14px;
    border-width: 2px;
  }
  .upload-zone-new .uz-icon {
    font-size: 2rem;
  }
  .upload-zone-new .uz-title,
  .upload-zone-new .upload-zone-title {
    font-size: 0.92rem;
  }
  .upload-zone-new .uz-btn {
    padding: 10px 22px;
    font-size: 0.88rem;
  }
  .settings-card {
    padding: 14px;
    gap: 12px;
    border-radius: 12px;
  }
  .btn-group-item {
    min-height: 44px;
    font-size: 0.68rem;
  }
  .setting-select {
    font-size: 16px;
    padding: 9px 10px;
  }
  .setting-input {
    font-size: 16px;
    padding: 9px 10px;
  }
  .btn-cta {
    padding: 13px 16px;
    font-size: 0.95rem;
  }
  .thumbs-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
  .thumb-card {
    aspect-ratio: 3/4;
  }
  .state-success {
    padding: 12px;
  }
  .file-stats {
    flex-direction: column;
    gap: 4px;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE UI/UX OPTIMIZATION — PHASE 1
   Appended 2026-04-08
   ═══════════════════════════════════════════════════════════ */

/* ▸ FIX 1 — PREVENT iOS ZOOM ON INPUTS */
@media (max-width: 768px) {
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="email"],
  input[type="url"],
  input[type="search"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ▸ FIX 2 — MINIMUM TOUCH TARGET SIZE */
@media (max-width: 768px) {
  button,
  .btn,
  .btn-group-item,
  .btn-cta,
  .btn-cta-secondary,
  [role="button"],
  .clickable {
    min-height: 44px;
    min-width: 44px;
  }

  select,
  .setting-select {
    min-height: 44px;
    padding: 10px 32px 10px 12px;
    font-size: 16px;
    border-radius: 8px;
  }

  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="url"],
  textarea {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 8px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
  }

  label {
    cursor: pointer;
    padding: 4px 0;
  }
}

/* ▸ FIX 3 — RANGE SLIDERS MOBILE OPTIMIZED */
@media (max-width: 768px) {
  input[type="range"],
  .slider-new {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    cursor: pointer;
    margin: 8px 0;
  }

  input[type="range"]::-webkit-slider-thumb,
  .slider-new::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-color, #3b82f6);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.2);
  }

  input[type="range"]::-moz-range-thumb,
  .slider-new::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-color, #3b82f6);
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.2);
  }

  input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
  }

  .slider-row {
    padding: 4px 0;
    gap: 6px;
  }

  .slider-header {
    margin-bottom: 2px;
  }

  .slider-value {
    background: var(--accent-color, #3b82f6);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
  }
}

/* ▸ FIX 4 — SETTINGS PANEL FULL OPTIMIZATION */
@media (max-width: 900px) {
  .settings-card {
    width: 100%;
    padding: 14px;
    gap: 14px;
    border-radius: 12px;
  }

  .setting-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .setting-row > label,
  .settings-card label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
  }

  .btn-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 6px;
    width: 100%;
  }

  .btn-group-item {
    flex: 1;
    min-height: 52px;
    padding: 8px 6px;
    font-size: 0.72rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-align: center;
    touch-action: manipulation;
  }

  .btn-group-item svg {
    width: 20px;
    height: 20px;
  }

  .setting-divider {
    height: 1px;
    background: var(--border-color);
    margin: 2px 0;
  }
}

/* ▸ FIX 5 — COLOR PICKER MOBILE */
@media (max-width: 768px) {
  input[type="color"] {
    width: 44px;
    height: 44px;
    padding: 2px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    background: none;
    flex-shrink: 0;
  }

  .color-setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .color-setting-row label {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
  }

  .color-preview-swatch {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    flex-shrink: 0;
  }
}

/* ▸ FIX 6 — TOGGLE SWITCH */
@media (max-width: 768px) {
  .toggle-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 4px 0;
  }

  .toggle-wrap label {
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
    cursor: pointer;
  }

  .toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
  }

  .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
  }

  .toggle-track {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
  }

  .toggle-track::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  }

  .toggle-switch input:checked + .toggle-track {
    background: var(--accent-color, #3b82f6);
  }

  .toggle-switch input:checked + .toggle-track::before {
    transform: translateX(20px);
  }
}

/* ▸ FIX 7 — TOOLBAR OVERFLOW FIX */
@media (max-width: 768px) {
  .tool-toolbar,
  .annotator-toolbar,
  .editor-toolbar,
  .sign-toolbar,
  .drawing-toolbar {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: nowrap;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
  }

  .tool-toolbar::-webkit-scrollbar,
  .annotator-toolbar::-webkit-scrollbar,
  .editor-toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar-btn,
  .tool-toolbar button,
  .annotator-toolbar button,
  .editor-toolbar button {
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.65rem;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s;
    white-space: nowrap;
  }

  .toolbar-btn.active,
  .toolbar-btn:active {
    background: var(--accent-color, #3b82f6);
    color: #fff;
    border-color: var(--accent-color, #3b82f6);
  }

  .toolbar-btn svg,
  .tool-toolbar button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }

  .toolbar-sep {
    width: 1px;
    min-height: 36px;
    background: var(--border-color);
    flex-shrink: 0;
    align-self: center;
  }

  .toolbar-slider-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 120px;
  }

  .toolbar-slider-wrap label {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
  }

  .toolbar-slider-wrap input[type="range"] {
    width: 80px;
    height: 4px;
  }

  .toolbar-color-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .toolbar-color-wrap input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 1px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    cursor: pointer;
  }
}

/* ▸ FIX 8 — THUMBNAIL CONTROLS */
@media (max-width: 768px) {
  .thumb-card,
  .page-thumb,
  .pdf-page-card {
    position: relative;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
  }

  .thumb-remove,
  .page-remove,
  .thumb-card .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 50%;
    background: rgba(239,68,68,0.9);
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    z-index: 10;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .thumb-rotate-left,
  .thumb-rotate-right,
  .page-rotate-btn {
    min-width: 30px;
    min-height: 30px;
    padding: 5px;
    font-size: 0.8rem;
    border-radius: 6px;
    touch-action: manipulation;
  }

  .thumb-num,
  .page-number {
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 0 0 6px 6px;
  }

  .drag-handle {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.4);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    z-index: 10;
  }

  .drag-handle::before {
    content: '\2807';
    color: #fff;
    font-size: 0.9rem;
  }

  .thumb-checkbox {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--accent-color, #3b82f6);
    z-index: 10;
  }
}

/* ▸ FIX 9 — MODAL AND OVERLAY MOBILE FIX */
@media (max-width: 768px) {
  .modal,
  .overlay-panel,
  .settings-modal,
  .popup-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1000;
    padding: 16px;
    background: var(--bg-card);
    border: none;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  .modal.open,
  .overlay-panel.open {
    transform: translateY(0);
  }

  .modal::before,
  .overlay-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 0 auto 16px;
  }

  .modal-close,
  .overlay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-primary);
    touch-action: manipulation;
  }

  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
  }

  .modal-backdrop.active {
    display: block;
  }
}

/* ▸ FIX 10 — KEYBOARD AWARE LAYOUT */
@media (max-width: 768px) {
  .keyboard-open .sticky-cta-bar {
    display: none !important;
  }

  .tool-workspace {
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }

  input:focus,
  textarea:focus,
  select:focus {
    scroll-margin-top: 20px;
    scroll-margin-bottom: 20px;
  }
}

/* ▸ FIX 11 — TOUCH INTERACTION IMPROVEMENTS */
@media (max-width: 768px) {
  button,
  a,
  input,
  select,
  label,
  .clickable,
  .btn-group-item,
  .toolbar-btn {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
  }

  .thumbs-grid,
  .pdf-pages-container,
  .canvas-container,
  .tool-workspace {
    user-select: none;
    -webkit-user-select: none;
  }

  button:active,
  .btn-group-item:active,
  .toolbar-btn:active {
    transform: scale(0.96);
    transition: transform 0.1s;
  }

  .tool-workspace,
  .settings-card,
  .thumbs-grid,
  .tool-toolbar {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  .tool-sidebar {
    overscroll-behavior: contain;
  }
}

/* ▸ FIX 12 — SPECIFIC TOOL PANEL FIXES */

/* PDF ANNOTATOR MOBILE */
@media (max-width: 768px) {
  .annotator-container {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .annotator-canvas-wrap {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    min-height: 50vh;
  }

  .annotator-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px;
    gap: 4px;
  }

  .annotator-toolbar .toolbar-btn {
    min-width: 48px;
    min-height: 48px;
    font-size: 0.6rem;
    padding: 6px 4px;
  }

  .annotator-options-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* PHOTO EDITOR MOBILE */
@media (max-width: 768px) {
  .photo-editor-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .photo-editor-canvas {
    width: 100%;
    max-height: 50vh;
    object-fit: contain;
  }

  .filter-presets {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 10px 12px;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-color);
  }

  .filter-presets::-webkit-scrollbar {
    display: none;
  }

  .filter-preset-btn {
    min-width: 64px;
    min-height: 64px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    padding: 6px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    touch-action: manipulation;
  }

  .filter-preset-btn img,
  .filter-preset-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
  }

  .adjustments-panel {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 40vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* SIGN PDF MOBILE */
@media (max-width: 768px) {
  .sign-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
  }

  .sign-tab {
    flex: 1;
    min-height: 44px;
    font-size: 0.82rem;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    padding: 10px 8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .sign-tab.active {
    border-bottom-color: var(--accent-color, #3b82f6);
    color: var(--accent-color, #3b82f6);
  }

  .sign-canvas {
    width: 100%;
    height: 160px;
    border: 1.5px dashed var(--border-color);
    border-radius: 10px;
    touch-action: none;
    cursor: crosshair;
    background: var(--bg-card);
  }

  .sign-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
  }

  .sign-controls button {
    flex: 1;
    min-height: 44px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
  }
}

/* IMAGE CROPPER MOBILE */
@media (max-width: 768px) {
  .cropper-container {
    position: relative;
    width: 100%;
    max-height: 55vh;
    overflow: hidden;
    touch-action: none;
  }

  .cropper-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    touch-action: none;
  }

  .crop-handle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--accent-color, #3b82f6);
    position: absolute;
    cursor: grab;
    touch-action: none;
    z-index: 20;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  }

  .crop-dimensions {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    white-space: nowrap;
    pointer-events: none;
  }

  .aspect-ratio-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 0 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .aspect-pill {
    min-width: max-content;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border-color);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-card);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
    min-height: 36px;
  }

  .aspect-pill.active {
    background: var(--accent-color, #3b82f6);
    color: #fff;
    border-color: var(--accent-color, #3b82f6);
  }
}

/* MEME GENERATOR MOBILE */
@media (max-width: 768px) {
  .meme-canvas {
    width: 100%;
    max-height: 50vw;
    border-radius: 10px;
    display: block;
  }

  .meme-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }

  .meme-text-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 16px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
  }
}

/* COLOR PICKER MOBILE */
@media (max-width: 768px) {
  .color-picker-canvas {
    width: 100%;
    max-height: 55vw;
    border-radius: 10px;
    cursor: crosshair;
    touch-action: none;
  }

  .color-display-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 12px;
  }

  .color-swatch-big {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
  }

  .color-values {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .color-value-row {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .color-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 28px;
    flex-shrink: 0;
  }

  .color-value-text {
    flex: 1;
    font-size: 0.82rem;
    font-family: monospace;
    background: var(--bg-primary);
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
  }

  .color-copy-btn {
    min-width: 44px;
    min-height: 36px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    touch-action: manipulation;
    padding: 5px 8px;
  }

  .color-copy-btn.copied {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
  }
}

/* PDF VIEWER MOBILE */
@media (max-width: 768px) {
  .pdf-viewer-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .pdf-viewer-toolbar::-webkit-scrollbar {
    display: none;
  }

  .pdf-nav-btn {
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .pdf-page-input {
    width: 48px;
    min-height: 36px;
    text-align: center;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    flex-shrink: 0;
  }

  .pdf-zoom-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.1rem;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .pdf-pages-container {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
  }

  .pdf-page-canvas {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 8px;
    border-radius: 4px;
  }
}

/* UNIT CONVERTER MOBILE */
@media (max-width: 768px) {
  .converter-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .converter-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
  }

  .converter-input-group input {
    flex: 1;
    min-height: 48px;
    font-size: 16px;
    padding: 10px 12px;
    border-radius: 8px;
  }

  .converter-input-group select {
    width: 130px;
    min-height: 48px;
    font-size: 15px;
    flex-shrink: 0;
  }

  .converter-swap-btn {
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .category-tabs {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 8px 0 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .category-tabs::-webkit-scrollbar {
    display: none;
  }

  .category-tab {
    min-width: max-content;
    min-height: 36px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    touch-action: manipulation;
  }
}

/* GIF MAKER MOBILE */
@media (max-width: 768px) {
  .gif-frames-strip {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 10px 0;
    scrollbar-width: none;
  }

  .gif-frames-strip::-webkit-scrollbar {
    display: none;
  }

  .gif-frame-card {
    min-width: 80px;
    max-width: 80px;
    flex-shrink: 0;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    touch-action: none;
  }

  .gif-frame-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
  }

  .gif-frame-card .frame-num {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.6rem;
    text-align: center;
    padding: 2px;
  }
}

  /* Additional mobile overrides for custom tool UIs with inline page styles */
  @media (max-width: 768px) {
    .sp-action-bar,
    .edit-toolbar,
    .context-bar,
    .canvas-toolbar {
      display: flex !important;
      flex-wrap: nowrap !important;
      overflow-x: auto !important;
      overflow-y: hidden !important;
      -webkit-overflow-scrolling: touch !important;
      scrollbar-width: none !important;
      gap: 6px !important;
      padding: 8px !important;
      align-items: center !important;
    }

    .sp-action-bar::-webkit-scrollbar,
    .edit-toolbar::-webkit-scrollbar,
    .context-bar::-webkit-scrollbar,
    .canvas-toolbar::-webkit-scrollbar,
    .sp-stage-layout .sp-page-browser::-webkit-scrollbar,
    .ann-stage-layout .page-browser::-webkit-scrollbar {
      display: none;
    }

    .sp-ab-btn,
    .tb-btn,
    .tool-btn,
    .filter-btn,
    .sp-sig-tab,
    .sig-tab,
    .sidebar-section summary,
    .file-info-remove {
      min-width: 44px !important;
      min-height: 44px !important;
      padding: 10px 12px !important;
      touch-action: manipulation !important;
    }

    .sp-ab-btn,
    .tb-btn,
    .tool-btn,
    .filter-btn {
      flex-shrink: 0 !important;
    }

    .sp-sig-color,
    .ctx-color,
    .setting-group input[type="color"] {
      width: 44px !important;
      height: 44px !important;
      min-width: 44px !important;
      min-height: 44px !important;
      padding: 2px !important;
      border-radius: 8px !important;
    }

    .sp-sig-canvas,
    .sig-draw-canvas {
      height: 160px !important;
    }

    .sp-stage-layout .sp-page-browser,
    .ann-stage-layout .page-browser {
      width: 100% !important;
      flex: 0 0 auto !important;
      max-height: none !important;
      overflow-x: auto !important;
      overflow-y: hidden !important;
      flex-direction: row !important;
      gap: 8px !important;
      padding: 8px !important;
    }

    .sp-pg-actions button,
    .ann-pg-actions button,
    .sp-org-actions button,
    .ann-org-actions button,
    .frame-card .remove-frame {
      width: 30px !important;
      height: 30px !important;
      min-width: 30px !important;
      min-height: 30px !important;
      opacity: 1 !important;
    }

    .sp-org-card,
    .ann-org-card,
    .frame-card {
      touch-action: none !important;
    }

    .sig-overlay {
      align-items: flex-end !important;
      padding: 0 !important;
    }

    .sig-modal {
      width: 100% !important;
      max-width: none !important;
      max-height: 85vh !important;
      overflow-y: auto !important;
      border-radius: 16px 16px 0 0 !important;
      padding: 16px !important;
    }

    .sidebar-section summary {
      font-size: 0.85rem !important;
      padding: 12px 14px !important;
    }

    .sidebar-section .section-body {
      padding: 12px !important;
    }

    .ctrl-row {
      flex-wrap: wrap !important;
      gap: 8px !important;
      align-items: center !important;
    }

    .ctrl-row label {
      min-width: 100% !important;
      font-size: 0.82rem !important;
    }

    .ctrl-row .val {
      min-width: 40px !important;
      font-size: 0.75rem !important;
    }

    .filter-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .crop-handle {
      width: 20px !important;
      height: 20px !important;
    }

    .frames-grid {
      gap: 8px !important;
      justify-content: flex-start !important;
    }

    .frame-card {
      width: 88px !important;
    }

    .sp-organize-overlay,
    .ann-organize-overlay {
      padding: 12px !important;
    }

    .sp-org-head,
    .ann-org-head {
      position: sticky !important;
      top: 0 !important;
      z-index: 2 !important;
      padding: 8px 12px !important;
      background: rgba(15,23,42,0.96) !important;
    }
  }

  /* Mobile layout: simple stacked flow — settings below workspace, no floating panels */
  @media (max-width: 768px) {
    .tool-layout {
      display: flex !important;
      flex-direction: column !important;
      padding: 8px !important;
      gap: 12px !important;
    }

    .tool-workspace {
      min-width: 0;
      order: 1;
    }

    .tool-sidebar,
    aside.tool-sidebar {
      position: static !important;
      order: 2;
      display: flex !important;
      flex-direction: column !important;
      gap: 10px !important;
      width: 100% !important;
      max-height: none !important;
      overflow: visible !important;
      padding: 0 !important;
      border: none !important;
      border-radius: 0 !important;
      background: transparent !important;
      box-shadow: none !important;
      backdrop-filter: none !important;
    }

    .tool-sidebar::before,
    aside.tool-sidebar::before {
      display: none !important;
    }

    .tool-sidebar .settings-card,
    aside.tool-sidebar .settings-card {
      padding: 14px !important;
      gap: 10px !important;
      border-radius: 14px !important;
    }

    .tool-sidebar .settings-card-title,
    aside.tool-sidebar .settings-card-title {
      font-size: 0.7rem !important;
      padding-bottom: 6px !important;
      margin-bottom: 0 !important;
    }

    .tool-sidebar .setting-row,
    .tool-sidebar .slider-row,
    .tool-sidebar .toggle-wrap,
    aside.tool-sidebar .setting-row,
    aside.tool-sidebar .slider-row,
    aside.tool-sidebar .toggle-wrap {
      gap: 4px !important;
    }

    .tool-sidebar .setting-select,
    aside.tool-sidebar .setting-select {
      font-size: 16px !important;
      padding: 10px 12px !important;
      min-height: 44px !important;
    }

    .tool-sidebar .btn-group-item,
    aside.tool-sidebar .btn-group-item {
      padding: 6px 10px !important;
      font-size: 0.8rem !important;
      min-height: 40px !important;
    }

    .tool-sidebar .btn-cta,
    .tool-sidebar .btn-cta-secondary,
    .tool-sidebar .btn-primary,
    .tool-sidebar .btn-success,
    aside.tool-sidebar .btn-cta,
    aside.tool-sidebar .btn-cta-secondary,
    aside.tool-sidebar .btn-primary,
    aside.tool-sidebar .btn-success {
      min-height: 48px !important;
      font-size: 0.95rem !important;
    }

    .tool-sidebar .state-success,
    .tool-sidebar .state-error-new,
    aside.tool-sidebar .state-success,
    aside.tool-sidebar .state-error-new {
      padding: 12px !important;
    }

    .preview-area,
    .canvas-wrap,
    .pdf-preview,
    .annotator-canvas-wrap,
    .sp-stage-paper {
      min-height: min(44vh, 340px) !important;
    }

    .tool-header-area {
      margin-bottom: 10px !important;
    }

    .quick-steps {
      margin-bottom: 10px !important;
      padding: 0.65rem 0.85rem !important;
    }
  }

  /* Sign PDF: inline stacked layout on mobile */
  @media (max-width: 768px) {
    .sp-shell {
      display: flex !important;
      flex-direction: column !important;
      gap: 12px !important;
    }

    .sp-main-card {
      order: 1;
      padding: 12px 12px 10px !important;
    }

    .sp-side-card {
      order: 2;
      position: static !important;
      max-height: none !important;
      overflow: visible !important;
      padding: 14px !important;
      border-radius: 14px !important;
      box-shadow: none !important;
    }

    .sp-side-card::before {
      display: none !important;
    }

    .sp-editor {
      padding-bottom: 0 !important;
    }

    .sp-side-head {
      margin-bottom: 10px !important;
    }

    .sp-size-box {
      margin-top: 10px !important;
      padding: 10px !important;
    }
  }

/* ═══════════════════════════════════════════════════════════
   MOBILE COMPATIBILITY — COMPREHENSIVE FIX
   Appended 2026-04-12
   Fixes: hover-only elements, touch targets, preview
   sizes, tool-specific layouts across all 41 tools
   ═══════════════════════════════════════════════════════════ */

/* ▸ A — HOVER-ONLY ELEMENTS → always visible on touch devices */
@media (hover: none), (pointer: coarse) {
  /* GIF maker: remove buttons hidden via hover are always visible */
  .frame-card .remove-frame,
  .frame-card .remove-btn {
    opacity: 1 !important;
  }

  /* Color picker: palette chip remove always visible */
  .palette-chip .remove {
    opacity: 1 !important;
  }

  /* Generic: any element that uses hover to reveal should always be visible */
  .thumb-card .remove-btn,
  .thumb-card .thumb-remove,
  .pdf-card .pdf-remove,
  .image-card .remove-btn,
  .img-item .ii-remove,
  .batch-item .remove-btn,
  .file-card .remove-btn {
    opacity: 1 !important;
  }

  /* Disable hover-dependent translateY effects (feels glitchy on touch) */
  .related-card,
  .card,
  .tool-card,
  .template-card {
    transform: none !important;
  }
  .related-card:hover,
  .card:hover,
  .tool-card:hover,
  .template-card:hover {
    transform: none !important;
  }
}

/* ▸ B — TOUCH TARGETS — enforce 44px minimum on all interactive elements */
@media (max-width: 768px) {
  /* Remove/delete buttons across all tools */
  .pdf-remove,
  .remove-frame,
  .remove-btn,
  .ii-remove,
  .sel-rect .remove-sel,
  .fib-remove,
  .palette-chip .remove {
    min-width: 32px !important;
    min-height: 32px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    font-size: 0.85rem !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Checkboxes across all tools */
  .thumb-check,
  .perm-item input[type="checkbox"],
  .toggle-row input[type="checkbox"],
  .field-item input[type="checkbox"],
  input[type="checkbox"] {
    min-width: 22px !important;
    min-height: 22px !important;
    width: 22px !important;
    height: 22px !important;
    cursor: pointer;
  }

  /* Toggle switches (protect-pdf, etc.) */
  .toggle-switch {
    min-width: 44px !important;
    min-height: 24px !important;
  }

  /* Password visibility toggles */
  .toggle-vis,
  .pass-toggle {
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation;
  }

  /* Toolbar buttons (pdf-viewer, rotate-pdf, etc.) */
  .toolbar-row button,
  .rot-btn-row button,
  .t-btn,
  .preset-btn,
  .dl-btn,
  .tab-btn,
  .mode-btn,
  .pill-btn,
  .swap-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px 12px !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Thumbnail action buttons (organize-pdf, etc.) */
  .thumb-actions button,
  .page-actions button,
  .org-add-btn {
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 6px !important;
    touch-action: manipulation;
  }

  /* Photo editor: fix 40px → 44px */
  .tool-btn,
  .filter-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 6px 8px !important;
  }

  /* Palette chips (color-picker) */
  .palette-chip {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

/* ▸ C — PREVIEW / CANVAS HEIGHT REDUCTIONS FOR MOBILE */
@media (max-width: 768px) {
  /* Tools with no mobile canvas/preview reduction */
  .preview-canvas-wrap canvas,
  .text-output {
    max-height: min(55vh, 360px) !important;
  }

  /* Textarea outputs (extract-text-pdf) */
  .text-output,
  .tp-textarea {
    min-height: 200px !important;
    max-height: 50vh !important;
  }

  /* Image cards in grids (pdf-to-jpg, extract-images-pdf) */
  .image-card img {
    height: 120px !important;
    object-fit: cover;
  }

  /* Stat cards overflow (flatten-pdf) */
  .stat-card .stat-num {
    font-size: 1.75rem !important;
  }
}

/* ▸ D — GIF MAKER: responsive frame cards */
@media (max-width: 768px) {
  .frames-grid,
  .frame-cards-wrap {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  .frame-card {
    width: 88px !important;
    flex-shrink: 0;
  }

  .frame-card img {
    height: 68px !important;
    object-fit: cover;
  }

  .frame-card .remove-frame {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    opacity: 1 !important;
    font-size: 0.8rem !important;
    background: rgba(239, 68, 68, 0.9) !important;
    border: 2px solid #fff !important;
  }

  .frame-card .frame-num,
  .frame-card .frame-label {
    font-size: 0.6rem !important;
  }
}

/* ▸ E — BULK IMAGE RESIZER: table layout mobile fix */
@media (max-width: 768px) {
  .override-inputs input {
    width: 100% !important;
    min-width: 50px !important;
    max-width: 80px !important;
  }

  .image-table .name-cell {
    max-width: 120px !important;
  }

  .image-table td,
  .image-table th {
    padding: 6px 4px !important;
    font-size: 0.75rem !important;
  }

  .dl-btn {
    padding: 8px 12px !important;
    font-size: 0.78rem !important;
    min-height: 36px !important;
    white-space: nowrap;
  }
}

/* ▸ F — CROP-PDF: responsive crop inputs */
@media (max-width: 768px) {
  .crop-inputs {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .crop-inputs input {
    width: 100% !important;
    min-width: 60px !important;
    max-width: none !important;
  }

  .crop-inputs label {
    min-width: 100% !important;
    display: flex;
    align-items: center;
    gap: 6px;
  }
}

/* ▸ G — PDF FORM FILLER: visual fields mobile fix */
@media (max-width: 768px) {
  .visual-field {
    min-height: 28px !important;
    min-width: 60px !important;
    font-size: 14px !important;
    padding: 4px 6px !important;
  }

  .field-item {
    padding: 10px !important;
  }

  .field-item input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
  }

  .field-item label {
    font-size: 0.85rem !important;
    padding: 4px 0 !important;
  }
}

/* ▸ H — PROTECT-PDF / UNLOCK-PDF: toggles and permissions */
@media (max-width: 768px) {
  .perm-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 44px !important;
    padding: 8px 0 !important;
  }

  .perm-item label {
    flex: 1;
    font-size: 0.85rem !important;
  }

  .perm-item input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0;
  }

  /* Password field with toggle */
  .pass-wrap {
    position: relative !important;
  }

  .pass-wrap input {
    padding-right: 48px !important;
    min-height: 44px !important;
    font-size: 16px !important;
  }
}

/* ▸ I — ROTATE-PDF: rotation buttons */
@media (max-width: 768px) {
  .rot-btn-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: center !important;
  }

  .rot-btn-row button {
    padding: 8px 10px !important;
    min-height: 40px !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
    flex: 1 1 auto !important;
  }

  .rot-badge {
    min-width: 36px !important;
    font-size: 0.7rem !important;
  }
}

/* ▸ J — PDF VIEWER: toolbar compact mobile */
@media (max-width: 768px) {
  .toolbar-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 4px !important;
    padding: 8px !important;
  }

  .toolbar-row::-webkit-scrollbar {
    display: none;
  }

  .toolbar-row button {
    flex-shrink: 0 !important;
  }

  .toolbar-row input[type="number"] {
    width: 48px !important;
    min-height: 36px !important;
    text-align: center !important;
    font-size: 16px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
  }
}

/* ▸ K — IMAGE ROTATE/FLIP: transform buttons */
@media (max-width: 768px) {
  .transform-btns,
  .action-btns {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .t-btn {
    flex: 1 1 calc(50% - 4px) !important;
    text-align: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
  }
}

/* ▸ L — DELETE/EXTRACT PDF PAGES: checkbox sizing */
@media (max-width: 768px) {
  .thumb-check {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    accent-color: var(--accent-color, #06b6d4);
  }
}

/* ▸ M — PDF PAGE NUMBERS: toggle row */
@media (max-width: 768px) {
  .toggle-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
  }

  .toggle-row label {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 44px !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
  }

  .toggle-row input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
  }
}

/* ▸ N — SPLIT-PDF: result items */
@media (max-width: 768px) {
  .result-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px !important;
    flex-wrap: wrap !important;
  }

  .result-item .ri-thumb {
    width: 36px !important;
    height: 50px !important;
    flex-shrink: 0;
    border-radius: 4px !important;
    object-fit: cover;
  }

  .result-item .ri-info {
    flex: 1;
    min-width: 0;
  }
}

/* ▸ O — WATERMARK IMAGE: tabs + logo drop zone */
@media (max-width: 768px) {
  .wm-tabs,
  .tab-bar {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 0 !important;
  }

  .wm-tabs::-webkit-scrollbar,
  .tab-bar::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 10px 14px !important;
    font-size: 0.82rem !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    min-height: 44px !important;
  }

  .wm-logo-drop {
    padding: 16px !important;
    min-height: 80px !important;
  }
}

/* ▸ P — IMAGE-TO-PDF / PNG-TO-PDF: remove button on items */
@media (max-width: 768px) {
  .img-item .ii-remove {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    opacity: 1 !important;
    font-weight: 700 !important;
    touch-action: manipulation;
  }
}

/* ▸ Q — GLOBAL: prevent iOS zoom on all tool inputs (reinforce) */
@media (max-width: 768px) {
  .tool-sidebar input,
  .tool-sidebar select,
  .tool-sidebar textarea,
  .settings-card input,
  .settings-card select,
  .settings-card textarea,
  .tool-workspace input,
  .tool-workspace select,
  .tool-workspace textarea {
    font-size: 16px !important;
  }
}

/* ▸ R — GLOBAL: smooth scrolling for overflowed containers */
@media (max-width: 768px) {
  .table-scroll,
  .image-table-wrap,
  .frames-grid,
  .mode-tabs,
  .tab-bar,
  .wm-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .table-scroll::-webkit-scrollbar,
  .image-table-wrap::-webkit-scrollbar,
  .frames-grid::-webkit-scrollbar,
  .mode-tabs::-webkit-scrollbar,
  .tab-bar::-webkit-scrollbar,
  .wm-tabs::-webkit-scrollbar {
    display: none;
  }
}

/* ▸ S — (removed: sidebar is now inline, no grab handle needed) */

/* ▸ T — RELATED TOOLS GRID: always single-column on mobile */
@media (max-width: 640px) {
  .related-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .related-card {
    padding: 12px !important;
  }
}

/* ▸ U — MEME GENERATOR: template grid mobile */
@media (max-width: 768px) {
  .template-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .template-card {
    border-radius: 8px !important;
    overflow: hidden;
  }

  .template-card img {
    max-height: 100px !important;
    object-fit: cover;
  }
}

/* ▸ V — GLOBAL: ensure all tool buttons have adequate spacing */
@media (max-width: 768px) {
  .action-row,
  .button-group,
  .btn-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .action-row > *,
  .button-group > *,
  .btn-row > * {
    flex: 1 1 auto !important;
    min-height: 44px !important;
  }
}