@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@600;700;800&display=swap');

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.12);
    --secondary: #8b5cf6;
    --secondary-light: rgba(139, 92, 246, 0.12);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --danger: #ef4444;

    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-focus: rgba(99, 102, 241, 0.5);

    --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.08);
    --shadow: 0 4px 16px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.12);
    --shadow-glow: 0 0 0 3px rgba(99, 102, 241, 0.2);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-theme {
    --bg-app: #080f1f;
    --bg-card: #111827;
    --bg-glass: rgba(17, 24, 39, 0.8);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --shadow: 0 4px 16px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.5);
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;                /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;          /* Prevent element dragging */
}

/* Allow selection in specific inputs and canvases */
input, textarea, .rz-canvas, .crop-canvas {
    user-select: text;
    -webkit-user-select: text;
}

/* Ambient background blobs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
}
body::before {
    width: 600px; height: 600px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -200px; left: -200px;
}
body::after {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -150px; right: -150px;
}
.dark-theme::before { opacity: 0.2; }
.dark-theme::after  { opacity: 0.15; }

h1, h2, h3 { font-family: 'Outfit', sans-serif; }

.app-container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 4rem;
    position: relative;
    z-index: 1;
}

/* ─── Header ─────────────────────────────────────────────────── */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.55rem 0.55rem 0.55rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.8rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color var(--transition);
}
.breadcrumb a:hover { color: var(--primary); }

.breadcrumb li {
    display: flex;
    align-items: center;
}

/* Hide Home + Tools on mobile, show only current page */
.breadcrumb li:not(:last-child):not(.bc-sep) { }

.breadcrumb i {
    width: 11px;
    height: 11px;
    display: block;       /* makes Lucide SVG render inline correctly */
    color: var(--text-muted);
    opacity: 0.45;
    flex-shrink: 0;
}

.breadcrumb .active { color: var(--primary); font-weight: 600; font-size: 0.8rem; }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-pill);
    margin-bottom: 1.25rem;
    border: 1px solid rgba(99, 102, 241, 0.25);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

.subtitle {
    font-size: 1.0625rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
}

/* ─── Format Converter Panel ─────────────────────────────────── */
.converter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.converter-panel-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* ─── Dual Format Selector ───────────────────────────────────── */
.format-duo {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: start;
    margin-bottom: 2rem;
}

.format-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.format-column-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.format-column-label i {
    width: 14px;
    height: 14px;
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.format-card {
    background: var(--bg-app);
    border: 2px solid var(--border);
    padding: 0.625rem 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
    letter-spacing: 0.03em;
    box-shadow: var(--shadow-sm);
    user-select: none;
}

.format-card:hover:not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    background: var(--primary-light);
}

.format-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(139,92,246,0.14));
    color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary), var(--shadow);
}

.format-card.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Swap arrow divider */
.format-swap-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 2.25rem;
    gap: 0.5rem;
}

.swap-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99,102,241,0.45);
    transition: all var(--transition);
    flex-shrink: 0;
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(99,102,241,0.55);
}

.swap-btn i { width: 18px; height: 18px; }

/* ─── Quality Slider ─────────────────────────────────────────── */
.quality-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.quality-row label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 110px;
}

.quality-row label span {
    color: var(--primary);
    font-size: 0.9rem;
}

.slider {
    -webkit-appearance: none;
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 5px;
    outline: none;
    transition: background var(--transition);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--bg-card);
    box-shadow: 0 2px 8px rgba(99,102,241,0.4);
    transition: transform 0.15s;
}

.slider::-webkit-slider-thumb:hover { transform: scale(1.25); }

/* ─── Upload Area ────────────────────────────────────────────── */
.upload-section {
    margin-bottom: 2rem;
}

.dropzone {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3.5rem 2rem;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99,102,241,0.04), rgba(139,92,246,0.04));
    opacity: 0;
    transition: opacity var(--transition);
}

.dropzone:hover::before, .dropzone.dragover::before { opacity: 1; }

.dropzone.dragover {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    transform: scale(1.01);
}

.dropzone-inner { position: relative; z-index: 1; }

.icon-blob {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
    animation: float 3s ease-in-out infinite;
}

.icon-blob i { width: 28px; height: 28px; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

.dropzone h3 {
    font-size: 1.3125rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.dropzone p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.dropzone-formats {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.dropzone-formats span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-app);
    border: 1px solid var(--border);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    letter-spacing: 0.04em;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.8rem 2.25rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(99,102,241,0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(99,102,241,0.5);
}
.btn-primary:active { transform: translateY(0); }

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-secondary {
    background: var(--bg-app);
    border: 1px solid var(--border);
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    border: none;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 12px rgba(16,185,129,0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16,185,129,0.45);
}

/* ─── Preview Card ───────────────────────────────────────────── */
.preview-container { margin-top: 1.5rem; }

.batch-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
}

.batch-actions > span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.preview-list { display: grid; gap: 0.75rem; }

.preview-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transition: box-shadow var(--transition);
}

.preview-item:hover { box-shadow: var(--shadow); }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.preview-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.file-info { flex-grow: 1; min-width: 0; }

.file-name {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.status-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.status-pending   { background: #fee2e2; color: #b91c1c; }
.status-converting{ background: #fef3c7; color: #92400e; }
.status-done      { background: #dcfce7; color: #15803d; }

/* Dark mode badge overrides */
.dark-theme .status-pending    { background: rgba(239,68,68,0.15); color: #fca5a5; }
.dark-theme .status-converting { background: rgba(245,158,11,0.15); color: #fcd34d; }
.dark-theme .status-done       { background: rgba(16,185,129,0.15); color: #6ee7b7; }

/* ─── Dark Mode Toggle Icons ─────────────────────────────────── */
.moon-icon { display: none; }
.dark-theme .sun-icon  { display: none; }
.dark-theme .moon-icon { display: block; }

/* \u2500\u2500\u2500 Header brand / logo \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo {
    width: 32px; height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(99,102,241,0.4);
    flex-shrink: 0;
    overflow: hidden; /* Ensure image fits radius */
}
.header-logo i { width: 16px; height: 16px; color: white; display: block; }
.header-logo img { width: 100%; height: 100%; object-fit: cover; }

.header-brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.0625rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
}

.header-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}

/* \u2500\u2500\u2500 Tab scroll arrows \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
.tool-tabs-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    margin-bottom: 1.75rem;
}

.tab-arrow {
    flex-shrink: 0;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}
.tab-arrow:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.tab-arrow i { width: 16px; height: 16px; display: block; }
.tab-arrow.hidden { opacity: 0; pointer-events: none; }

/* \u2500\u2500\u2500 Footer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
.footer {
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    padding-top: 3rem;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 2.5rem 2rem;
    margin-top: 4rem;     /* Space after SEO section */
    margin-bottom: 2.5rem;
}

/* Brand column */
.footer-brand-col { display: flex; flex-direction: column; gap: 0.875rem; }

.footer-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.footer-logo {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(99,102,241,0.35);
    flex-shrink: 0;
    overflow: hidden;
}
.footer-logo i { width: 18px; height: 18px; color: white; display: block; }
.footer-logo img { width: 100%; height: 100%; object-fit: cover; }

.footer-brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.125rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    font-size: 0.825rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 280px;
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-app);
    color: var(--text-muted);
}
.footer-badge i { width: 11px; height: 11px; display: block; }

/* Links column */
.footer-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links li { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.825rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--primary); }
.footer-links i { width: 13px; height: 13px; display: block; flex-shrink: 0; }

/* Format chips */
.footer-fmt-chip {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(99,102,241,0.2);
    letter-spacing: 0.04em;
}

/* Copyright bar */
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-credit { font-size: 0.78rem; }

.footer-credit-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    border-bottom: 1px solid transparent;
}

.footer-credit-link:hover {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
    opacity: 0.8;
}

/* \u2500\u2500\u2500 Footer responsive \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
@media (max-width: 780px) {
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
    .footer-brand-col { grid-column: 1 / -1; } /* full width on tablets */
}

@media (max-width: 540px) {
    .footer-inner { grid-template-columns: 1fr; gap: 1.75rem; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .footer-tagline { max-width: 100%; }
    .breadcrumb { display: none; }  /* hide breadcrumb on very small — brand takes the space */
}


/* ─── Toasts ─────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.toast {
    background: var(--bg-card);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 240px;
    max-width: 340px;
    transition: opacity 0.3s, transform 0.3s;
}

.toast-success { border-color: var(--success); }
.toast-error   { border-color: var(--danger); }
.toast-info    { border-color: var(--primary); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%) scale(0.9); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}


/* ─── Tool Tabs ───────────────────────────────────────────────── */
.tool-tabs {
    display: flex;
    gap: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.4rem;
    width: fit-content;
    max-width: 100%;              /* never overflow the container */
    overflow-x: auto;             /* scroll if tabs don't fit */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;        /* hide scrollbar on Firefox */
    flex-wrap: nowrap;            /* keep tabs on one line */
    box-shadow: var(--shadow-sm);
    /* remove the old margin-bottom — now on .tool-tabs-wrap */
}

.tool-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-pill);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.tool-tabs::-webkit-scrollbar { display: none; }  /* hide scrollbar on Chrome/Safari */

.tool-tab i { width: 16px; height: 16px; flex-shrink: 0; }

.tool-tab:hover:not(.active) {
    color: var(--text-main);
    background: var(--bg-app);
}

.tool-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

.tab-badge {
    background: rgba(255,255,255,0.25);
    color: inherit;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-pill);
}

.tool-tab:not(.active) .tab-badge {
    background: var(--primary-light);
    color: var(--primary);
}

.tool-panel { /* No extra styles needed – uses hidden utility */ }
.hidden { display: none !important; }

/* ─── Info Banner ────────────────────────────────────────────── */
.info-banner {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.06));
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.info-banner > i {
    width: 20px; height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.info-banner strong { color: var(--text-main); }

.info-banner div:nth-child(2) { flex: 1; }

/* ─── Model Toggle ───────────────────────────────────────────── */
.model-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-thumb {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 22px;
    transition: background var(--transition);
}

.toggle-thumb::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 3px; top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.toggle-switch input:checked + .toggle-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.toggle-switch input:checked + .toggle-thumb::before {
    transform: translateX(18px);
}

/* ─── Purple Blob Variant ────────────────────────────────────── */
.icon-blob-purple {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    box-shadow: 0 8px 24px rgba(139,92,246,0.45);
}

.bg-dropzone { margin-bottom: 0; }

/* ─── AI Loader ──────────────────────────────────────────────── */
.bg-loader {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4rem 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.bg-loader-inner {
    max-width: 380px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Spinner */
.ai-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    animation: spin 1.2s linear infinite;
}

.spinner-ring-2 {
    inset: 8px;
    border-top-color: var(--secondary);
    animation-duration: 0.8s;
    animation-direction: reverse;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.6; transform: scale(0.85); }
}

.loader-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-main);
}

.loader-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 99px;
    transition: width 0.35s ease;
}

/* ─── Before/After Comparison ────────────────────────────────── */
.bg-result-area {
    margin-top: 0.5rem;
}

.comparison-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

.comparison-container {
    position: relative;
    width: 100%;
    max-height: 520px;
    overflow: hidden;
    cursor: col-resize;
    user-select: none;
    /* Transparent checkerboard bg to show alpha */
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.dark-theme .comparison-container {
    background-image:
        linear-gradient(45deg, #1e293b 25%, transparent 25%),
        linear-gradient(-45deg, #1e293b 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1e293b 75%),
        linear-gradient(-45deg, transparent 75%, #1e293b 75%);
}

.comparison-img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    pointer-events: none;
}

.comparison-result {
    position: relative;
    z-index: 1;
}

.comparison-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
}

.comparison-overlay .comparison-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0; left: 0;
}

/* Slider handle */
.comparison-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 10;
    transform: translateX(-50%);
    width: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: col-resize;
    pointer-events: auto;
}

.slider-line {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: white;
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
}

.slider-pill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 99px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    color: #475569;
    flex-shrink: 0;
}

.slider-pill i { width: 14px; height: 14px; }

/* Labels */
.comparison-label {
    position: absolute;
    top: 0.85rem;
    background: rgba(0,0,0,0.55);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill);
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 5;
}

.comparison-label-left  { left:  0.85rem; }
.comparison-label-right { right: 0.85rem; }

/* ─── Result Actions ─────────────────────────────────────────── */
.result-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0 0.25rem 1rem;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — 780px (tablets / large phones landscape)
════════════════════════════════════════════════════════════ */
@media (max-width: 780px) {
    .app-container { padding: 1rem 1rem 3rem; }
    main { padding: 0 0 2rem; }

    /* Header: keep pill but tighter */
    .header {
        margin-bottom: 1.75rem;
        padding: 0.45rem 0.45rem 0.45rem 1rem;
    }
    .breadcrumb ol { font-size: 0.75rem; gap: 0.25rem; }

    /* Tab bar: show slightly smaller text, keep scrolling */
    .tool-tab { font-size: 0.8rem; padding: 0.55rem 0.9rem; }

    /* Format converter */
    .format-duo {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .format-swap-divider {
        flex-direction: row;
        justify-content: center;
        padding-top: 0;
    }

    /* BG remover result */
    .result-actions { flex-direction: column; }
    .comparison-container { max-height: 360px; }

    /* Compressor */
    .cmp-settings { flex-direction: column; align-items: stretch; gap: 0.875rem; }
    .cmp-setting-actions { margin-left: 0; }
    .cmp-summary { flex-direction: column; gap: 0.75rem; }

    /* Resizer */
    .rz-workspace { grid-template-columns: 1fr; }
    .rz-controls-panel { max-height: none; }
    .rz-presets-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — 640px (phones)
════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    /* Global */
    .app-container { padding: 0.75rem 0.75rem 2.5rem; }
    main { padding: 0 0 1.5rem; }

    /* Header: flat transparent bar on phones (pill takes too much space) */
    .header {
        background: transparent;
        border: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0.5rem 0 0.75rem;
        margin-bottom: 1.5rem;
        box-shadow: none;
    }
    /* Show only the current page in breadcrumb — hide Home > Tools > */
    .breadcrumb li:nth-child(-n+4) { display: none; }
    .breadcrumb .active { font-size: 0.85rem; }

    .hero { padding: 1.5rem 0.5rem 1.5rem; }
    .hero h1 { font-size: 1.75rem; }
    .hero .subtitle { font-size: 0.875rem; }

    /* Tabs: full width, scrollable */
    .tool-tabs {
        width: 100%;
        border-radius: var(--radius);
    }
    .tool-tab {
        flex-shrink: 0;
        font-size: 0.78rem;
        padding: 0.5rem 0.8rem;
        gap: 0.35rem;
    }
    /* Hide AI badge on small screens */
    .tab-badge { display: none; }



    /* Panels */
    .converter-panel { padding: 1.1rem; }
    .format-grid { grid-template-columns: repeat(4, 1fr); }
    .quality-row { flex-wrap: wrap; gap: 0.75rem; }
    .dropzone { padding: 2rem 1rem; }
    .info-banner { flex-wrap: wrap; gap: 0.625rem; }
    .model-toggle-wrap { margin-left: 0; }

    /* Circle crop controls */
    .crop-controls { flex-direction: column; align-items: stretch; }
    .crop-actions { flex-direction: column; }
    .crop-actions .btn-primary,
    .crop-actions .btn-secondary { width: 100%; justify-content: center; }

    /* Compressor row */
    .cmp-row { flex-wrap: wrap; gap: 0.625rem; }
    .cmp-thumb { width: 44px; height: 44px; }
    #cmp-quality-slider { width: 100%; }

    /* Resizer */
    .rz-mode-tabs { width: 100%; }
    .rz-mode-tab { flex: 1; justify-content: center; }
    .rz-presets-grid { grid-template-columns: repeat(2, 1fr); }
    .rz-dim-row { gap: 0.35rem; }
    .rz-dim-input { font-size: 0.85rem; padding: 0.45rem 0.5rem; }

    /* BG comparison */
    .slider-pill { width: 36px; height: 36px; }
    .comparison-container { max-height: 280px; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — 420px (small phones)
════════════════════════════════════════════════════════════ */
@media (max-width: 420px) {
    main { padding: 0 0.625rem 1.5rem; }
    .hero h1 { font-size: 1.5rem; }
    .hero-badge { font-size: 0.7rem; padding: 0.3rem 0.75rem; }

    /* Tab icons only — hide text labels to fit 5 tabs */
    .tab-label { display: none; }
    .tool-tab {
        padding: 0.55rem 0.75rem;
        gap: 0;
        justify-content: center;
    }
    .tool-tab i { width: 18px; height: 18px; }

    /* Compressor format buttons smaller */
    .cmp-fmt-btn { padding: 0.3rem 0.6rem; font-size: 0.72rem; }
    .rz-scale-btn,
    .rz-ratio-btn,
    .rz-fmt-btn { padding: 0.3rem 0.55rem; font-size: 0.72rem; }

    /* Presets: single column */
    .rz-presets-grid { grid-template-columns: repeat(2, 1fr); }
    .format-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Teal Blob Variant (Circle Crop) ───────────────────────── */
.icon-blob-teal {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.45);
}

/* ─── Circle Crop Editor ─────────────────────────────────────── */
.crop-editor-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crop-canvas-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Checkerboard to indicate transparency context */
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.dark-theme .crop-canvas-wrap {
    background-image:
        linear-gradient(45deg, #1e293b 25%, transparent 25%),
        linear-gradient(-45deg, #1e293b 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1e293b 75%),
        linear-gradient(-45deg, transparent 75%, #1e293b 75%);
}

.crop-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    cursor: default;
    border-radius: calc(var(--radius) - 2px);
}

/* Controls bar beneath the canvas */
.crop-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.crop-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.crop-info i {
    width: 16px; height: 16px;
    color: #0ea5e9;
    flex-shrink: 0;
}

.crop-info strong { color: var(--text-main); }

.crop-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.crop-actions {
    display: flex;
    gap: 0.65rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   IMAGE COMPRESSOR
════════════════════════════════════════════════════════════ */

/* Orange blob for Compress tab */
.icon-blob-orange {
    background: linear-gradient(135deg, #f97316, #ef4444);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.45);
}

/* ─── Settings bar ────────────────────────────────────────── */
.cmp-settings {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.cmp-setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cmp-setting-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.cmp-setting-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin-left: auto;
    align-items: flex-end;
}

/* Format pills */
.cmp-fmt-group {
    display: flex;
    gap: 0.35rem;
}

.cmp-fmt-btn {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
    background: var(--bg-app);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.04em;
}

.cmp-fmt-btn:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.cmp-fmt-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 10px rgba(99,102,241,0.35);
}

/* Quality slider inside cmp-settings */
#cmp-quality-slider {
    width: 180px;
}

/* ─── Drop zone variant ───────────────────────────────────── */
.cmp-dropzone {
    margin-bottom: 1.25rem;
    padding: 2.5rem 2rem;
}

/* ─── Summary bar ─────────────────────────────────────────── */
.cmp-summary {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
    background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(6,182,212,0.07));
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.25rem;
}

.cmp-summary-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.cmp-summary-stat i {
    width: 16px; height: 16px;
    color: var(--success);
    flex-shrink: 0;
}

.cmp-summary-stat strong { color: var(--text-main); font-size: 1rem; }

/* ─── Results Section ─────────────────────────────────────── */
.cmp-results { /* container */ }

.cmp-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* ─── Per-file result row ─────────────────────────────────── */
.cmp-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.875rem 1.25rem;
    animation: slideIn 0.3s ease-out;
    transition: box-shadow var(--transition);
}

.cmp-row:hover { box-shadow: var(--shadow); }

.cmp-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.cmp-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cmp-filename {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmp-sizes {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
}

.cmp-original { color: var(--text-muted); }

/* Progress bar beneath size info */
.cmp-bar-track {
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 0.1rem;
}

.cmp-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}

/* ─── Savings badge ───────────────────────────────────────── */
.cmp-badge-wrap { flex-shrink: 0; }

.cmp-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
}

.badge-great {
    background: rgba(16,185,129,0.15);
    color: #059669;
}
.badge-good {
    background: rgba(99,102,241,0.13);
    color: var(--primary);
}
.badge-low {
    background: rgba(245,158,11,0.15);
    color: #d97706;
}

.dark-theme .badge-great { background: rgba(16,185,129,0.2);  color: #6ee7b7; }
.dark-theme .badge-good  { background: rgba(99,102,241,0.2);  color: #a5b4fc; }
.dark-theme .badge-low   { background: rgba(245,158,11,0.2);  color: #fcd34d; }

/* ─── Download button in row ──────────────────────────────── */
.cmp-dl-wrap { flex-shrink: 0; }

.cmp-dl-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
    text-decoration: none;
}

.cmp-dl-btn i { width: 15px; height: 15px; }

/* ─── Spinner inside size cell ────────────────────────────── */
.cmp-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 680px) {
    .cmp-settings { flex-direction: column; align-items: stretch; gap: 1rem; }
    .cmp-setting-actions { margin-left: 0; }
    #cmp-quality-slider { width: 100%; }
    .cmp-row { flex-wrap: wrap; }
    .cmp-thumb { width: 44px; height: 44px; }
    .cmp-summary { flex-direction: column; gap: 0.75rem; }
}

/* ═══════════════════════════════════════════════════════════
   IMAGE RESIZER + CROP
════════════════════════════════════════════════════════════ */

/* Green blob for Resize tab */
.icon-blob-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.45);
}

/* ─── Mode tabs (Resize / Crop) ───────────────────────────── */
.rz-mode-tabs {
    display: flex;
    gap: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.3rem;
    width: fit-content;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.rz-mode-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.rz-mode-tab i { width: 15px; height: 15px; flex-shrink: 0; }

.rz-mode-tab:hover:not(.active) { background: var(--bg-app); color: var(--text-main); }

.rz-mode-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 10px rgba(99,102,241,0.35);
}

/* ─── Editor container ────────────────────────────────────── */
.rz-editor { display: flex; flex-direction: column; gap: 1rem; }

/* Top bar */
.rz-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.rz-orig-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Workspace: canvas + controls ───────────────────────── */
.rz-workspace {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.25rem;
    align-items: start;
}

/* Canvas */
.rz-canvas-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.dark-theme .rz-canvas-wrap {
    background-image:
        linear-gradient(45deg, #1e293b 25%, transparent 25%),
        linear-gradient(-45deg, #1e293b 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1e293b 75%),
        linear-gradient(-45deg, transparent 75%, #1e293b 75%);
}

.rz-canvas { display: block; max-width: 100%; height: auto; }

/* ─── Controls panel ──────────────────────────────────────── */
.rz-controls-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 540px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* ─── Section label ───────────────────────────────────────── */
.rz-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ─── W × H inputs + lock ─────────────────────────────────── */
.rz-dim-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.rz-dim-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.rz-dim-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}

.rz-dim-input {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-app);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: border-color var(--transition);
    -moz-appearance: textfield;
}

.rz-dim-input::-webkit-inner-spin-button,
.rz-dim-input::-webkit-outer-spin-button { opacity: 0; }
.rz-dim-input:focus { outline: none; border-color: var(--primary); }

/* Lock button */
.rz-lock-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-app);
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
    margin-bottom: 0;
}

.rz-lock-btn i { width: 14px; height: 14px; }

.rz-lock-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

/* ─── Button groups (scale, format, ratio) ────────────────── */
.rz-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.rz-scale-btn,
.rz-ratio-btn,
.rz-fmt-btn {
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border);
    background: var(--bg-app);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
}

.rz-scale-btn:hover,
.rz-ratio-btn:hover,
.rz-fmt-btn:hover { border-color: var(--primary); color: var(--primary); }

.rz-ratio-btn.active,
.rz-fmt-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

/* ─── Social media preset grid ────────────────────────────── */
.rz-presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
}

.rz-preset-btn {
    padding: 0.5rem 0.5rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--bg-app);
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    line-height: 1.3;
}

.rz-preset-btn small { color: var(--text-muted); font-size: 0.68rem; font-weight: 400; }
.rz-preset-btn:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.rz-preset-btn:hover small { color: var(--primary); }

/* ─── Crop info row ───────────────────────────────────────── */
.rz-crop-info-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 0.875rem;
}

.rz-crop-info-row i { width: 14px; height: 14px; color: var(--primary); flex-shrink: 0; }
.rz-crop-info-row strong { color: var(--text-main); }

.rz-help-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ─── Download button ─────────────────────────────────────── */
.rz-dl-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 820px) {
    .rz-workspace { grid-template-columns: 1fr; }
    .rz-controls-panel { max-height: none; }
    .rz-presets-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
    .rz-mode-tabs { width: 100%; }
    .rz-mode-tab { flex: 1; justify-content: center; }
    .rz-presets-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Menu & Dropdown ───────────────────────────────────────── */
.menu-container {
    position: relative;
    display: inline-flex;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 220px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    transform-origin: top right;
    animation: dropdownIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownIn {
    from { opacity: 0; transform: scale(0.9) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.dropdown-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.75rem 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}

.dropdown-item i { width: 16px; height: 16px; color: var(--text-muted); transition: color 0.3s; }
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.dropdown-item:hover i { color: var(--primary); }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0.75rem;
}

/* ─── Modal (About Us) ───────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal.hidden { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.25rem;
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--bg-app);
    border: none;
    color: var(--text-muted);
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
}
.modal-close:hover { color: var(--danger); background: #fee2e2; transform: rotate(90deg); }

.modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.modal-header h2 { font-size: 1.5rem; color: var(--text-main); margin: 0; }

.modal-body { color: var(--text-muted); line-height: 1.6; font-size: 0.9375rem; }
.modal-body p { margin-bottom: 1rem; }

.about-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.75rem;
}
.about-feature {
    text-align: center;
    padding: 1rem 0.5rem;
    border-radius: var(--radius);
    background: var(--bg-app);
    border: 1px solid var(--border);
}
.about-feature i { width: 20px; height: 20px; color: var(--primary); margin-bottom: 0.625rem; }
.about-feature span { display: block; font-size: 0.75rem; line-height: 1.3; font-weight: 500; }

.modal-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
}
.modal-footer button { padding-left: 2rem; padding-right: 2rem; }

/* ─── Tool Disclaimer ────────────────────────────────────────── */
.tool-disclaimer {
    margin-top: 1.75rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-app);
    border: 1px dashed var(--border);
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.tool-disclaimer i { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; margin-top: 0.125rem; }
.tool-disclaimer strong { color: var(--text-main); font-weight: 600; }

@media (max-width: 640px) {
    .modal-content { padding: 1.75rem; }
    .about-features { grid-template-columns: 1fr; }
    .about-feature { display: flex; align-items: center; text-align: left; gap: 1rem; padding: 0.875rem 1rem; }
    .about-feature i { margin-bottom: 0; }
}

/* ─── SEO Section ────────────────────────────────────────────── */
.seo-section {
    padding: 2rem 1.5rem;
    background: linear-gradient(to bottom, transparent, var(--bg-card));
}

.seo-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
}

.seo-text h2 { font-size: 1.75rem; color: var(--text-main); margin-bottom: 1.25rem; }
.seo-text h3 { font-size: 1.25rem; color: var(--text-main); margin: 2rem 0 0.75rem; }
.seo-text p { color: var(--text-muted); line-height: 1.8; margin-bottom: 1.25rem; }

.seo-faq h3 { font-size: 1.5rem; color: var(--text-main); margin-bottom: 2rem; }
.faq-list { display: flex; flex-direction: column; gap: 1.75rem; }

.faq-item h4 { 
    font-size: 1rem; 
    color: var(--primary); 
    margin-bottom: 0.5rem; 
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.faq-item p { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.6; }

@media (max-width: 900px) {
    .seo-grid { grid-template-columns: 1fr; gap: 3rem; }
    .seo-section { padding: 4rem 1.25rem; }
}

/* ─── Scroll Progress & Back to Top ───────────────────────────── */
.progress-wrap {
    position: fixed;
    right: 30px;
    bottom: 30px;
    height: 46px;
    width: 46px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 400ms linear;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.progress-wrap.active-progress {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.progress-wrap i, 
.progress-wrap svg:not(.progress-circle) {
    color: var(--primary);
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 2;
    transition: all 400ms linear;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-wrap svg.progress-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.progress-wrap:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(99,102,241,0.25);
}

.progress-wrap svg path { 
    fill: none; 
}

.progress-wrap svg.progress-circle path {
    stroke: var(--primary);
    stroke-width: 4;
    box-sizing: border-box;
    transition: all 400ms linear;
}

.dark-theme .progress-wrap {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
    .progress-wrap {
        right: 20px;
        bottom: 20px;
    }
}
