/* ============================================
   OptimizePNG - Complete Stylesheet
   Light default, full dark mode support
   ============================================ */

:root {
    /* Transition speed for theme changes */
    --transition-speed: 0.25s;
    
    /* Primary Colors */
    --primary: #0F172A;
    --primary-light: #dbeafe;
    --primary-dark: #1E293B;
    --accent: #2563EB;
    
    /* Background Colors */
    --body-bg: #F9FAFB;
    --header-bg: #FFFFFF;
    --card-bg: #ffffff;
    --card-secondary: #f8f9fa;
    --card-tertiary: #f1f5f9;
    --bg-elevated: #ffffff;
    
    /* Text Colors */
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #666666;
    --text-light: #999999;
    
    /* Border Colors */
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --border-accent: #ddd;
    
    /* Interactive Colors */
    --accent-color: #2563EB;
    --accent-hover: #2980b9;
    --link-color: #499bc9;
    --link-hover: #ff6b6b;
    
    /* Status Colors */
    --success-color: #2ecc71;
    --success-bg: #e7f7ed;
    --success-light: #D1FAE5;
    --warning-color: #f1c40f;
    --warning-bg: #fef9e7;
    --error-color: #e74c3c;
    --error-bg: #fadbd8;
    --info-color: #3498db;
    --info-bg: #ebf5fb;
    --danger: #EF4444;
    
    /* Component Colors */
    --button-primary-bg: #ACE0E6;
    --button-primary-text: #000000;
    --button-primary-hover: #FFC5C5;
    --button-secondary-bg: #f5f5f5;
    --button-secondary-text: #333333;
    
    /* Category Colors */
    --red-color: #d9535c;
    --blue-color: #4aabcf;
    --green-color: #2ca87c;
    --purple-color: #9b59b6;
    --orange-color: #f39c12;
    --teal-color: #1abc9c;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.07);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --shadow-color: rgba(0,0,0,0.1);
    --shadow-primary: 0 4px 14px rgba(59, 130, 246, 0.35);
    --shadow-primary-hover: 0 6px 20px rgba(59, 130, 246, 0.45);
    
    /* Overlays */
    --overlay-bg: rgba(0,0,0,0.4);
    
    /* Input/Form Colors */
    --input-bg: #ffffff;
    --input-border: #ddd;
    --input-focus-border: #3498db;
    --input-placeholder: #999;
    
    /* Search Box (Header) */
    --search-bg: #ffffff;
    --search-border: rgba(0,0,0,0.1);
    
    /* Footer */
    --footer-bg: #27323d;
    --footer-text: #ecf0f1;
    --footer-muted: #bdc3c7;
    
    /* Card Backgrounds */
    --gradient-card-odd: linear-gradient(to bottom, #fff6f4, #fff0ed);
    --gradient-card-even: linear-gradient(to bottom, #f7fcff, #eef8ff);
    --gradient-card-new: linear-gradient(to bottom, #e4f3fb, #d1ebf7);
    --gradient-noicons: linear-gradient(to bottom, #ffffff, #f7fcff);
    --noicons-icon-bg: #edf5fa;
    --noicons-border: #c8dce6;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Checkerboard for transparency */
    --checker-color: #e5e7eb;
    
    /* Scrollbar */
    --scrollbar-track: var(--card-bg);
    --scrollbar-thumb: var(--text-muted);
    --scrollbar-thumb-hover: var(--text-secondary);
}

[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-light: rgba(96, 165, 250, 0.15);
    --primary-dark: #3b82f6;
    --accent: #93c5fd;
    
    /* Background Colors */
    --body-bg: #0f172a;
    --header-bg: #1e293b;
    --card-bg: #1e293b;
    --card-secondary: #334155;
    --card-tertiary: #475569;
    --bg-elevated: #1e293b;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    
    /* Border Colors */
    --border-color: rgba(255,255,255,0.1);
    --border-light: rgba(255,255,255,0.05);
    --border-accent: #475569;
    
    /* Interactive Colors */
    --accent-color: #60a5fa;
    --accent-hover: #3b82f6;
    --link-color: #60a5fa;
    --link-hover: #f87171;
    
    /* Status Colors */
    --success-color: #4ade80;
    --success-bg: rgba(46, 204, 113, 0.15);
    --success-light: rgba(74, 222, 128, 0.15);
    --warning-color: #fbbf24;
    --warning-bg: rgba(241, 196, 15, 0.15);
    --error-color: #f87171;
    --error-bg: rgba(231, 76, 60, 0.15);
    --info-color: #60a5fa;
    --info-bg: rgba(52, 152, 219, 0.15);
    --danger: #f87171;
    
    /* Component Colors */
    --button-primary-bg: #3b82f6;
    --button-primary-text: #ffffff;
    --button-primary-hover: #60a5fa;
    --button-secondary-bg: #334155;
    --button-secondary-text: #f1f5f9;
    
    /* Category Colors */
    --red-color: #f87171;
    --blue-color: #60a5fa;
    --green-color: #4ade80;
    --purple-color: #a78bfa;
    --orange-color: #fb923c;
    --teal-color: #2dd4bf;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.25);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5);
    --shadow-color: rgba(0,0,0,0.4);
    --shadow-primary: 0 4px 14px rgba(96, 165, 250, 0.25);
    --shadow-primary-hover: 0 6px 20px rgba(96, 165, 250, 0.35);
    
    /* Overlays */
    --overlay-bg: rgba(0,0,0,0.7);
    
    /* Input/Form Colors */
    --input-bg: #334155;
    --input-border: #475569;
    --input-focus-border: #60a5fa;
    --input-placeholder: #64748b;
    
    /* Search Box (Header) */
    --search-bg: #334155;
    --search-border: #475569;
    
    /* Footer */
    --footer-bg: #0f172a;
    --footer-text: #f1f5f9;
    --footer-muted: #94a3b8;
    
    /* Card Backgrounds */
    --gradient-card-odd: linear-gradient(to bottom, #1e293b, #1a2332);
    --gradient-card-even: linear-gradient(to bottom, #1e293b, #1a2a3a);
    --gradient-card-new: linear-gradient(to bottom, #1e3a5f, #1a3050);
    --gradient-noicons: linear-gradient(to bottom, #1e293b, #1a2a3a);
    --noicons-icon-bg: #1a2a3a;
    --noicons-border: rgba(255,255,255,0.08);
    
    /* Checkerboard for transparency */
    --checker-color: #374151;
    
    /* Scrollbar */
    --scrollbar-track: var(--bg-elevated);
    --scrollbar-thumb: var(--text-muted);
    --scrollbar-thumb-hover: var(--text-secondary);
}

/* ============================================
   BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--body-bg);
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--link-hover); text-decoration: underline; }

.container { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding: 36px 0 60px; }

/* ============================================
   HEADER
   ============================================ */
.header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.header__container {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 20px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.header__brand {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    flex-shrink: 0;
}
.header__brand:hover { text-decoration: none; }

.brand__icon {
    width: 38px; height: 38px;
    background: var(--primary);
    border-radius: 50px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.brand__icon i { width: 18px; height: 18px; }

.brand__text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.brand__text strong { color: var(--primary); font-weight: 800; }

.header__nav {
    display: flex; align-items: center; gap: 1px;
    flex: 1; padding: 0 6px;
}

.header__nav-link {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.78rem; font-weight: 500;
    color: var(--text-muted);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    text-decoration: none; white-space: nowrap;
}
.header__nav-link i { width: 13px; height: 13px; }
.header__nav-link:hover { color: var(--primary); background: var(--primary-light); text-decoration: none; }
.header__nav-link.active { color: var(--primary); background: var(--primary-light); font-weight: 600; }

.header__actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.header__link {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.82rem; font-weight: 500;
    color: var(--text-muted);
    padding: 5px 9px;
    border-radius: var(--radius-sm);
    transition: all 0.2s; text-decoration: none;
}
.header__link:hover { color: var(--primary); background: var(--primary-light); text-decoration: none; }
.header__link i { width: 12px; height: 12px; }

/* ============================================
   DROPZONE CORNER ACCENTS - Extend on hover
   ============================================ */
.dropzone__corner {
    position: absolute;
    width: 22px;
    height: 22px;
    pointer-events: none;
    z-index: 2;
    border-radius: 0;
    transition: width 0.3s cubic-bezier(0.34, 1.3, 0.64, 1),
                height 0.3s cubic-bezier(0.34, 1.3, 0.64, 1),
                opacity 0.3s ease;
}
.dropzone__corner--tl {
    top: -1.5px; left: -1.5px;
    border-top: 3px solid var(--primary);
    border-left: 3px solid var(--primary);
}
.dropzone__corner--tr {
    top: -1.5px; right: -1.5px;
    border-top: 3px solid var(--primary);
    border-right: 3px solid var(--primary);
    opacity: 0;
}
.dropzone__corner--bl {
    bottom: -1.5px; left: -1.5px;
    border-bottom: 3px solid var(--primary);
    border-left: 3px solid var(--primary);
    opacity: 0;
}
.dropzone__corner--br {
    bottom: -1.5px; right: -1.5px;
    border-bottom: 3px solid var(--primary);
    border-right: 3px solid var(--primary);
}
.dropzone:hover .dropzone__corner,
.dropzone.dragover .dropzone__corner {
    width: 52px;
    height: 52px;
    opacity: 1;
}

/* ============================================
   THEME TOGGLE - V6 style, no label
   ============================================ */
.theme-toggle {
    display: flex; align-items: center;
    background: none; border: none; cursor: pointer; padding: 0;
}
.theme-toggle__track {
    position: relative;
    width: 52px; height: 28px;
    background: #e8e4e0;
    border: 1px solid #ccc;
    border-radius: 14px;
    transition: background 0.3s, border-color 0.3s;
}
[data-theme="dark"] .theme-toggle__track {
    background: #1e293b;
    border-color: #334155;
}
/* Knob slides behind the icons */
.theme-toggle__knob {
    position: absolute;
    left: 3px; top: 3px;
    width: 20px; height: 20px;
    background: #f9fafb;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    z-index: 1;
}
[data-theme="dark"] .theme-toggle__knob {
    transform: translateX(24px);
    background: #334155;
}
/* Icons sit above the knob */
.theme-toggle__icons {
    position: absolute; inset: 0;
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    z-index: 2;
    pointer-events: none;
}
/* Light mode: sun bright (knob is under it on the right), moon dim on left */
.toggle-sun  { width: 13px; height: 13px; color: #d97706; }
.toggle-moon { width: 13px; height: 13px; color: #94a3b8; }
/* Dark mode: moon bright (knob slides under it on the left), sun dim on right */
[data-theme="dark"] .toggle-moon { color: #93c5fd; }
[data-theme="dark"] .toggle-sun  { color: #475569; }

.theme-toggle__label { display: none; }

/* ============================================
   HERO
   ============================================ */
.hero {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; margin-bottom: 28px; flex-wrap: wrap;
}

.hero__tag {
    font-size: 0.68rem; font-weight: 700; color: var(--primary);
    letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
}
.hero__tag-line { display: block; width: 16px; height: 1.5px; background: var(--primary); }

.hero__title {
    font-size: 2.2rem; font-weight: 800; color: var(--text-primary);
    letter-spacing: -1px; line-height: 1.1; margin-bottom: 10px;
}
.hero__title em { font-style: normal; color: var(--primary); }

.hero__subtitle { font-size: 0.95rem; color: var(--text-muted); max-width: 480px; line-height: 1.6; }

.hero__stats { display: flex; gap: 20px; flex-shrink: 0; }
.hero__stat  { text-align: right; }
.hero__stat-num   { display: block; font-size: 1.8rem; font-weight: 800; color: var(--primary); letter-spacing: -1px; line-height: 1; }
.hero__stat-label { display: block; font-size: 0.68rem; font-weight: 600; color: var(--text-light); letter-spacing: 0.5px; text-transform: uppercase; margin-top: 2px; }

/* ============================================
   DROPZONE
   ============================================ */
.upload-section { margin-bottom: 44px; }

.dropzone {
    position: relative;
    background: var(--dropzone-bg);
    border: 1.5px solid var(--dropzone-border);
    border-radius: 0;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: visible;
}
.dropzone::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(230,78,78,0.05), transparent 70%);
    pointer-events: none; opacity: 0; transition: opacity 0.3s;
}
.dropzone:hover::after { opacity: 1; }
.dropzone:hover,
.dropzone.dragover { box-shadow: var(--shadow-hover); }
.dropzone.dragover::after { opacity: 1; }

.dropzone__idle { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dropzone__icon { width: 80px; height: 80px; color: var(--primary); margin-bottom: 12px; }
.dropzone__icon i,
.dropzone__icon svg { width: 80px; height: 80px; display: block; }
.dropzone__title { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.dropzone__text  { font-size: 1rem; color: var(--text-muted); }
.dropzone__limits { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; margin-bottom: 8px; }

.dropzone__btn {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 10px; padding: 12px 28px;
    background: var(--primary); color: #fff; border: none;
    border-radius: var(--radius-sm); font-size: 1rem; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: all 0.2s;
    letter-spacing: 0.2px;
}
.dropzone__btn:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(var(--primary-rgb),0.32); }
.dropzone__btn i { width: 17px; height: 17px; }

.dropzone__hover { display: none; flex-direction: column; align-items: center; gap: 10px; }
.dropzone.dragover .dropzone__idle  { display: none; }
.dropzone.dragover .dropzone__hover { display: flex; }
.dropzone__hover-icon { width: 44px; height: 44px; animation: bounce 0.7s infinite; }
.dropzone__hover-icon i { width: 44px; height: 44px; color: var(--primary); }
.dropzone__hover p { font-size: 1.1rem; font-weight: 700; color: var(--primary); }

@keyframes bounce { 0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)} }

/* ============================================
   SETTINGS TOGGLE
   ============================================ */
.settings-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.settings-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}
.settings-toggle-btn i { width: 16px; height: 16px; flex-shrink: 0; }
.settings-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.settings-toggle-btn.open {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.settings-toggle-chevron {
    transition: transform 0.25s ease;
}
.settings-toggle-btn.open .settings-toggle-chevron {
    transform: rotate(180deg);
}

.settings-summary {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   SETTINGS PANEL (collapsible)
   ============================================ */
.settings-panel-wrap {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
}
.settings-panel-wrap.open {
    max-height: 900px;
    opacity: 1;
}

.settings-panel {
    background: var(--settings-bg);
    border: 1.5px solid var(--border-mid);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Section block */
.sp-section { display: flex; flex-direction: column; gap: 10px; }

.sp-section__header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: 1.4px;
    text-transform: uppercase;
}
.sp-section__header i { width: 14px; height: 14px; color: var(--primary); }

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

/* ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ Quality Presets ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ */
.sp-quality-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.qp {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px;
    padding: 8px 6px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--card-secondary);
    opacity: 0.6;
}
.qp:hover { opacity: 0.85; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.qp.active {
    opacity: 1;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.qp__name { font-size: 0.88rem; font-weight: 800; color: inherit; line-height: 1; }
.qp__desc { font-size: 0.68rem; font-weight: 500; opacity: 0.85; line-height: 1; }

.qp--max   { color: var(--color-3); }
.qp--max.active { background: var(--color-3); color: #fff; border-color: var(--color-3); }
.qp--max:hover:not(.active) { border-color: var(--color-3); }

.qp--high  { color: var(--color-2); }
.qp--high.active { background: var(--color-2); color: #fff; border-color: var(--color-2); }
.qp--high:hover:not(.active) { border-color: var(--color-2); }

.qp--bal   { color: var(--color-1); }
.qp--bal.active  { background: var(--color-1); color: #fff; border-color: var(--color-1); }
.qp--bal:hover:not(.active) { border-color: var(--color-1); }

.qp--small { color: #d97706; }
.qp--small.active { background: #d97706; color: #fff; border-color: #d97706; }
.qp--small:hover:not(.active) { border-color: #d97706; }

.qp--tiny  { color: #6b7280; }
.qp--tiny.active  { background: #6b7280; color: #fff; border-color: #6b7280; }
.qp--tiny:hover:not(.active) { border-color: #6b7280; }

/* Slider row */
.sp-slider-row {
    display: flex; align-items: center; gap: 12px;
}

.sp-slider-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 62px;
}

.sp-range {
    -webkit-appearance: none;
    flex: 1;
    height: 5px;
    background: linear-gradient(to right, var(--primary) 75%, var(--border-mid) 75%);
    border-radius: 3px;
    cursor: pointer;
    outline: none;
}
.sp-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(var(--primary-rgb),0.35);
}
.sp-range::-moz-range-thumb {
    width: 18px; height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(var(--primary-rgb),0.35);
}

.sp-badge {
    font-size: 0.88rem; font-weight: 800;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 10px;
    border-radius: 20px;
    min-width: 46px;
    text-align: center;
    white-space: nowrap;
}

/* ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ Resize Modes ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ */
.sp-resize-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sp-mode-option {
    position: relative;
    cursor: pointer;
}
.sp-mode-option input { position: absolute; opacity: 0; width: 0; height: 0; }

.sp-mode-box {
    display: flex; flex-direction: row; align-items: center; gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-secondary);
    transition: all 0.15s;
}
.sp-mode-box i,
.sp-mode-box svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.sp-mode-box strong { font-size: 0.88rem; color: var(--text-primary); font-weight: 700; line-height: 1.2; }
.sp-mode-box small  { font-size: 0.75rem; color: var(--text-muted); line-height: 1.2; display: block; }

.sp-mode-option:hover .sp-mode-box {
    border-color: var(--primary);
}
.sp-mode-option input:checked + .sp-mode-box {
    border-color: var(--primary);
    background: var(--primary-light);
}
.sp-mode-option input:checked + .sp-mode-box i,
.sp-mode-option input:checked + .sp-mode-box svg,
.sp-mode-option input:checked + .sp-mode-box strong {
    color: var(--primary);
}

/* ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ Dims Wrap (hidden by default) ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ÃƒÆ’Ã‚Â¢ÃƒÂ¢Ã¢â€šÂ¬Ã‚ÂÃƒÂ¢Ã¢â‚¬Å¡Ã‚Â¬ */
.sp-dims-wrap {
    display: none;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    background: var(--card-secondary);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
}
.sp-dims-wrap.visible { display: flex; }

/* Resolution presets */
.sp-res-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: -4px;
}

.sp-res-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rp {
    display: flex; flex-direction: column; align-items: center;
    gap: 1px;
    padding: 5px 10px;
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    min-width: 64px;
}
.rp:hover { border-color: var(--primary); background: var(--primary-light); }
.rp.active { border-color: var(--primary); background: var(--primary); }
.rp.active .rp__name,
.rp.active .rp__size { color: #fff; }

.rp__name { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.rp__size { font-size: 0.68rem; color: var(--text-muted); white-space: nowrap; }

/* Manual dimension inputs */
.sp-dims-inputs,
.sp-dims-ar-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.sp-dim-group {
    display: flex; flex-direction: column; gap: 5px;
    flex: 0 0 auto;
    min-width: 110px;
}

.sp-dim-label {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.sp-dim-input-wrap {
    display: flex; align-items: center;
    border: 1.5px solid var(--border-mid);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--card-bg);
    transition: border-color 0.2s;
}
.sp-dim-input-wrap:focus-within { border-color: var(--primary); }

.sp-dim {
    flex: 1;
    padding: 7px 10px;
    border: none;
    background: transparent;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: inherit;
    min-width: 0;
    outline: none;
    text-align: center;
    width: 72px;
}
.sp-dim:disabled { opacity: 0.38; cursor: not-allowed; }

.sp-dim-unit {
    padding: 0 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--card-secondary);
    border-left: 1.5px solid var(--border-color);
    height: 100%;
    display: flex; align-items: center;
    white-space: nowrap;
}

.sp-dim-x {
    display: flex; align-items: center; justify-content: center;
    padding-bottom: 6px;
    color: var(--text-light);
    flex-shrink: 0;
}
.sp-dim-x i { width: 14px; height: 14px; }

/* Aspect ratio checkbox */
.sp-ar-check {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    padding: 7px 10px;
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.15s;
    flex: 1;
    min-width: 200px;
}
.sp-ar-check:hover { border-color: var(--primary); }
.sp-ar-check input { display: none; }

.sp-ar-box {
    width: 20px; height: 20px; min-width: 20px;
    border: 2px solid var(--border-mid);
    border-radius: 4px;
    background: var(--card-bg);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.sp-ar-check input:checked + .sp-ar-box {
    background: var(--primary); border-color: var(--primary);
}
.sp-ar-icon { width: 12px; height: 12px; color: #fff; opacity: 0; transition: opacity 0.15s; }
.sp-ar-check input:checked + .sp-ar-box .sp-ar-icon { opacity: 1; }

.sp-ar-text {
    display: flex; flex-direction: column; gap: 1px;
}
.sp-ar-text,
.sp-ar-text > :first-child {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}
.sp-ar-text small {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.3;
}

/* ============================================
   RESULTS
   ============================================ */
.results { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }

.result-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    display: flex; align-items: center; gap: 14px;
    transition: all var(--transition-speed);
    animation: slideIn 0.25s ease;
}
@keyframes slideIn { from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)} }

.result-card__thumb {
    width: 52px; height: 52px;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: var(--card-secondary);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.result-card__thumb img { width:100%; height:100%; object-fit:cover; border-radius:6px; display:block; }
.result-card__thumb i   { width:22px; height:22px; color: var(--text-light); }

.result-card__thumb--loading::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(0,0,0,0.35); border-radius: 6px;
}
.result-card__thumb--loading .thumb-spinner {
    position: absolute;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    z-index: 1;
}
@keyframes spin { to{transform:rotate(360deg)} }

.result-card__info  { flex: 1; min-width: 0; }
.result-card__name  { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.result-card__meta  { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.result-card__dot   { width: 3px; height: 3px; border-radius: 50%; background: var(--border-color); flex-shrink: 0; }
.result-card__savings      { font-weight: 700; color: var(--success); }
.result-card__savings--none{ color: var(--text-light); }
.result-card__error-text   { font-size: 0.82rem; color: var(--error); line-height: 1.4; }

.result-card__progress { width:100%; height:4px; background:var(--border-color); border-radius:2px; margin-top:8px; overflow:hidden; }
.result-card__progress-bar { height:100%; background:var(--primary); border-radius:2px; width:0%; transition:width 0.3s; }
.result-card__progress-bar--done { background: var(--success); }
.result-card__status { font-size: 0.78rem; color: var(--text-light); margin-top: 4px; }

.result-card__actions { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }

.btn-download {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 16px;
    background: var(--success); color: #fff; border: none;
    border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s; text-decoration: none;
    font-family: inherit; white-space: nowrap;
}
.btn-download:hover { opacity:0.88; transform:translateY(-1px); text-decoration:none; color:#fff; }
.btn-download i { width:14px; height:14px; }

.btn-remove {
    background: none; border: none; color: var(--text-light);
    cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
    transition: all 0.2s; display: flex; align-items: center;
}
.btn-remove:hover { color: var(--error); background: var(--error-bg); }
.btn-remove i { width:16px; height:16px; }

/* ============================================
   BATCH ACTIONS
   ============================================ */
.batch-actions {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin-top: 18px;
}

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 26px; border: none;
    border-radius: var(--radius-sm);
    font-size: 0.97rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.btn i { width:16px; height:16px; }
.btn--primary   { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(var(--primary-rgb),0.28); }
.btn--secondary { background: var(--card-secondary); color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn--secondary:hover { background: var(--border-color); }

/* ============================================
   INFO CARDS
   ============================================ */
.info-cards { margin: 0 auto 44px; display: flex; flex-direction: column; gap: 14px; }
.info-cards__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.info-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    transition: border-color 0.2s;
}
.info-card:hover { border-color: rgba(var(--primary-rgb),0.28); }

.info-card__header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.info-card__icon {
    width: 34px; height: 34px;
    background: var(--primary-light); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary); flex-shrink: 0;
}
.info-card__icon i { width:17px; height:17px; }

.info-card__title { font-size: 1rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.2px; line-height: 1.2; }

.info-card p { font-size: 0.93rem; color: var(--text-secondary); line-height: 1.75; margin-bottom: 10px; }
.info-card p:last-child { margin-bottom: 0; }
.info-card a { color: var(--link-color); font-weight: 500; }
.info-card a:hover { color: var(--link-hover); }

/* Steps */
.steps-list { list-style: none; padding: 0; margin: 0; counter-reset: step; display: flex; flex-direction: column; gap: 4px; }
.steps-list li {
    position: relative;
    padding: 8px 0 8px 44px;
    font-size: 0.93rem; color: var(--text-secondary);
    counter-increment: step; line-height: 1.65;
}
.steps-list li::before {
    content: counter(step);
    position: absolute; left: 0; top: 10px;
    width: 26px; height: 26px;
    background: var(--primary); color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
}

/* Related tools pills */
.info-card__tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.info-card__tool {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.83rem; font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none; transition: all 0.2s;
}
.info-card__tool i { width:13px; height:13px; color: var(--primary); }
.info-card__tool:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); text-decoration: none; }

/* ============================================
   FAQ
   ============================================ */
.faq-section { max-width: 100%; margin: 0 auto; }
.faq-title { font-size: 1.25rem; font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.faq-title i { width:20px; height:20px; color: var(--primary); }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1.5px solid var(--border-color); border-radius: var(--radius-md); overflow: hidden; background: var(--card-bg); transition: border-color 0.2s; }
.faq-item.open { border-color: var(--primary); }
.faq-question { width:100%; display:flex; align-items:center; justify-content:space-between; padding:15px 18px; background:none; border:none; cursor:pointer; font-size:0.97rem; font-weight:600; color:var(--text-primary); text-align:left; transition:color 0.2s; font-family:inherit; }
.faq-question:hover { color: var(--primary); }
.faq-chevron { width:17px; height:17px; color:var(--text-light); transition:transform 0.2s; flex-shrink:0; }
.faq-item.open .faq-chevron { transform:rotate(180deg); color:var(--primary); }
.faq-answer { max-height:0; overflow:hidden; transition:max-height 0.3s ease; }
.faq-item.open .faq-answer { max-height:320px; }
.faq-answer p { padding:0 18px 16px; font-size:0.92rem; color:var(--text-secondary); line-height:1.75; }

/* ============================================
   FOOTER
   ============================================ */
.footer { background: var(--footer-bg); color: var(--footer-text); margin-top: auto; }
.footer__container { max-width: 920px; margin: 0 auto; padding: 0 20px; }

.footer__top {
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 32px 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-wrap: wrap; gap: 24px;
}

.footer__brand { display: flex; align-items: center; gap: 12px; }

.footer__brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.footer__brand-link:hover { text-decoration: none; }

.footer__brand-icon {
    width: 42px;
    height: 42px;
    background: var(--primary);
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(230,78,78,0.35);
}

.footer__brand-name {
    font-size: 1.3rem;
    color: #ffffff;
    display: block;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.footer__brand-name span { color: var(--primary); }

.footer__brand p { font-size: 0.78rem; color: #94a3b8; margin: 0; }

.footer__cols { display: flex; gap: 36px; flex-wrap: wrap; }
.footer__col { display: flex; flex-direction: column; gap: 8px; }
.footer__col-title { font-size:0.68rem; font-weight:700; color:#64748b; letter-spacing:1.2px; text-transform:uppercase; margin-bottom:2px; }
.footer__col a { font-size:0.85rem; color:#94a3b8; transition:color 0.2s; }
.footer__col a:hover { color:#fff; text-decoration:none; }

.footer__bottom { display:flex; align-items:center; justify-content:space-between; padding:18px 0; flex-wrap:wrap; gap:10px; }
.footer__bottom p { font-size:0.78rem; color:#64748b; margin:0; }
.footer__bottom a { color:#94a3b8; }
.footer__bottom a:hover { color:#fff; text-decoration:none; }
.footer__legal { display:flex; gap:14px; }
.footer__legal a { font-size:0.78rem; color:#64748b; }
.footer__legal a:hover { color:#fff; text-decoration:none; }

/* ============================================
   NAV DROPDOWN
   ============================================ */
.nav-dropdown {
    position: relative;
}

.nav-dropdown__trigger {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.82rem; font-weight: 500;
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-dropdown__trigger i { width: 13px; height: 13px; }
.nav-dropdown__chevron {
    width: 12px !important; height: 12px !important;
    transition: transform 0.25s ease;
    margin-left: 1px;
}
.nav-dropdown__trigger:hover,
.nav-dropdown__trigger.active {
    color: var(--primary);
    background: var(--primary-light);
}
.nav-dropdown.open .nav-dropdown__trigger {
    color: var(--primary);
    background: var(--primary-light);
}
.nav-dropdown.open .nav-dropdown__chevron { transform: rotate(180deg); }

.nav-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 200;
}
/* Open state - controlled by JS */
.nav-dropdown.open .nav-dropdown__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-dropdown__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
}
.nav-dropdown__item:hover,
.nav-dropdown__item.active {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}
.nav-dropdown__icon {
    width: 32px; height: 32px; min-width: 32px;
    background: var(--card-secondary);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    transition: background 0.15s;
}
.nav-dropdown__item:hover .nav-dropdown__icon,
.nav-dropdown__item.active .nav-dropdown__icon {
    background: rgba(var(--primary-rgb), 0.12);
}
.nav-dropdown__icon i { width: 15px; height: 15px; }
.nav-dropdown__text {
    display: flex; flex-direction: column; gap: 1px;
}
.nav-dropdown__text strong { font-size: 0.88rem; font-weight: 600; line-height: 1.2; }
.nav-dropdown__text small  { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; line-height: 1.2; }
.nav-dropdown__item.active .nav-dropdown__text small { color: var(--primary); opacity: 0.75; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 800px) {
    /* On mobile the dropdown opens below the header full-width */
    .nav-dropdown__menu {
        position: fixed;
        top: 62px;
        left: 0;
        right: 0;
        min-width: unset;
        width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        padding: 8px 16px 14px;
        gap: 2px;
    }
    .nav-dropdown__item { padding: 11px 12px; }
}
.footer__trust {
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 12px 0;
}
.footer__trust-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}
.footer__trust-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
    flex: 1;
    justify-content: center;
    padding: 0 16px;
}
.footer__trust-item + .footer__trust-item {
    border-left: 1px solid rgba(255,255,255,0.08);
}
.footer__trust-item i { width: 13px; height: 13px; color: var(--color-3); flex-shrink: 0; }

/* Footer shield - removed, replaced by .footer__brand-icon */
.footer__shield { display: none; }

/* ============================================
   RESPONSIVE (general)
   ============================================ */
@media (max-width: 768px) {
    .hero { flex-direction: column; align-items: flex-start; gap: 14px; }
    .hero__stats { align-self: flex-start; }
    .hero__stat  { text-align: left; }
    .hero__title { font-size: 1.8rem; }
    .dropzone    { padding: 2.5rem 1.5rem; }
    .sp-quality-presets { grid-template-columns: repeat(5, 1fr); gap: 6px; }
    .qp { padding: 10px 5px; }
    .qp__desc { display: none; }
    .sp-resize-modes { grid-template-columns: 1fr 1fr; }
    .result-card { flex-wrap: wrap; padding: 12px 14px; }
    .result-card__info { min-width: calc(100% - 66px); }
    .result-card__actions { width: 100%; justify-content: flex-end; margin-top: 4px; }
    .batch-actions { flex-direction: column; }
    .batch-actions .btn { width: 100%; justify-content: center; }
    .info-cards__row { grid-template-columns: 1fr; }
    .footer__top { flex-direction: column; }
    .footer__cols { gap: 24px; }
    /* Trust bar: switch to 2x2 grid on tablet and below */
    .footer__trust-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        flex-wrap: unset;
    }
    .footer__trust-item {
        padding: 8px 12px;
        justify-content: flex-start;
        border-left: none;
        white-space: normal;
    }
    .footer__trust-item + .footer__trust-item { border-left: none; }
    /* subtle row separators */
    .footer__trust-item:nth-child(1),
    .footer__trust-item:nth-child(2) {
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .footer__trust-item:nth-child(2),
    .footer__trust-item:nth-child(4) {
        border-left: 1px solid rgba(255,255,255,0.06);
    }
}

@media (max-width: 600px) {
    /* Hide ConvertICO nav link so the theme toggle never overflows */
    .header__link { display: none; }
}

@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .hero__title { font-size: 1.5rem; }
    .dropzone    { padding: 2rem 1rem; }
    .sp-quality-presets { grid-template-columns: repeat(3, 1fr); }
    .sp-resize-modes { grid-template-columns: 1fr; }
    .sp-dims-inputs { flex-direction: column; gap: 8px; }
    .sp-dim-x { display: none; }
    /* sp-dims-ar-row: inputs stay side-by-side, AR check drops to full width */
    .sp-dim-group { min-width: 90px; }
    .sp-ar-check  { min-width: 100%; flex: 1 1 100%; }
    .sp-res-presets { gap: 5px; }
    .rp { min-width: 56px; padding: 5px 8px; }
    .settings-toggle-wrap { flex-direction: column; align-items: flex-start; }
    .theme-toggle__label { display: none; }
    .header__actions { gap: 8px; }
    .footer__trust-item { font-size: 0.75rem; padding: 7px 10px; gap: 5px; }
}

/* ============================================
   SCROLLBAR / SELECTION
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--body-bg); }
::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: rgba(var(--primary-rgb),0.18); color: var(--text-primary); }

/* ============================================
   LEGAL PAGES (Privacy, Terms)
   ============================================ */

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb span[aria-current] { color: var(--text-secondary); font-weight: 500; }

/* Page header */
.page-header {
    margin-bottom: 32px;
}
.page-header .hero__tag {
    margin-bottom: 10px;
}
.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.8px;
    line-height: 1.15;
    margin-bottom: 10px;
}
.page-header h1 em {
    font-style: normal;
    color: var(--primary);
}
.page-header p {
    font-size: 0.97rem;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.65;
}

/* Content card wrapper */
.content-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    margin-bottom: 28px;
    transition: border-color 0.2s;
}

/* Content section (prose inside card) */
.content-section h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 32px 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.content-section h2:first-child { margin-top: 0; }
.content-section h2 i {
    width: 17px;
    height: 17px;
    color: var(--primary);
    flex-shrink: 0;
}
.content-section p {
    font-size: 0.93rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}
.content-section p:last-child { margin-bottom: 0; }
.content-section a {
    color: var(--link-color);
    font-weight: 500;
}
.content-section a:hover { color: var(--link-hover); }
.content-section ul,
.content-section ol {
    margin: 8px 0 14px 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.content-section li {
    font-size: 0.93rem;
    color: var(--text-secondary);
    line-height: 1.7;
}
.content-section li a {
    color: var(--link-color);
    font-weight: 500;
}
.content-section strong { color: var(--text-primary); }
.content-section code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
    background: var(--card-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--primary);
}

/* Responsive legal pages */
@media (max-width: 640px) {
    .content-card { padding: 22px 18px; }
    .page-header h1 { font-size: 1.6rem; }
}


/* ============================================
   AD BANNER - Leaderboard (728x90)
   ============================================ */

/**
 * Wrapper prevents Cumulative Layout Shift (CLS) by reserving
 * the exact pixel height before the AdSense iframe loads.
 * Google recommends always declaring explicit dimensions on
 * ad slots to protect Core Web Vitals scores.
 */
.ad-banner {
    background: var(--body-bg);
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.ad-banner--top {
    padding: 6px 0 0;
    line-height: 0;
    font-size: 0;
}

.ad-banner__inner {
    display: block;
    width: 100%;
    padding: 0 20px;
    max-width: 920px;
    margin: 0 auto;
}


/* ============================================
   FOOTER - SISTER SITE (OptimizeGIF)
   Append this block to style.css.
   ============================================ */

/* Stack brand-link + sister-link vertically inside footer__brand */
.footer__brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.footer__sister {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
}

.footer__sister-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.footer__sister-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 7px;
    border-radius: 50px;
    background: rgba(51, 153, 102, 0.10);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    width: -moz-fit-content;
    width: fit-content;
}

.footer__sister-link:hover,
.footer__sister-link:focus-visible {
    background: rgba(51, 153, 102, 0.20);
    border-color: rgba(51, 153, 102, 0.65);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(51, 153, 102, 0.25);
    outline: none;
}

.footer__sister-icon {
    width: 32px;
    height: 32px;
    background: var(--color-3);
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(51, 153, 102, 0.45);
}

.footer__sister-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.footer__sister-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    gap: 1px;
}

.footer__sister-text strong {
    font-size: 1.3rem;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.footer__sister-text strong span {
    color: var(--color-3);
}

.footer__sister-text small {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 400;
    letter-spacing: 0.1px;
}

/* Mobile: keep things tidy */
@media (max-width: 768px) {
    .footer__brand { gap: 14px; }
    .footer__sister-link { padding: 6px 12px 6px 6px; }
    .footer__sister-icon { width: 28px; height: 28px; }
    .footer__sister-icon svg { width: 14px; height: 14px; }
    .footer__sister-text strong { font-size: 0.88rem; }
}


/* Marquee */
.partners-marquee { background: var(--header-bg); border-top: 1px solid var(--border-color); padding: 12px 0; overflow: hidden; white-space: nowrap; }
.scroll-container { display: inline-block; animation: scroll-marquee 80s linear infinite; }
.scroll-container:hover { animation-play-state: paused; }
.scroll-container a { display: inline-block; padding: 0 20px; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.scroll-container a:hover { color: var(--link-hover); }
@keyframes scroll-marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
/* MEGA MENU INJECTION CSS */
.mega-dropdown-wrapper { position: static !important; }
.mega-dropdown {
    width: 100% !important;
    max-width: 1100px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 30px !important;
    display: none;
    position: absolute;
    background: var(--card-bg, #ffffff) !important;
    border-radius: 12px;
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0,0,0,0.15)) !important;
    border: 1px solid var(--border-color, rgba(128,128,128,0.15)) !important;
    z-index: 1000;
}
.mega-dropdown-wrapper:hover .mega-dropdown,
.mega-dropdown-wrapper.active .mega-dropdown { display: block; animation: megaFadeIn 0.2s ease; }
@keyframes megaFadeIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.mega-dropdown .mega-categories { display: flex; gap: 30px; justify-content: space-between; }
.mega-dropdown .mega-category { flex: 1; min-width: 0; }
.mega-dropdown .mega-category-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid var(--border-color, rgba(128,128,128,0.1)); padding-bottom: 10px; }
.mega-dropdown .mega-category-header h3 { font-size: 16px; font-weight: 700; color: var(--text-primary, #111) !important; margin: 0; }
.mega-dropdown .mega-category-header .cat-count { display: none; }
.mega-dropdown .mega-category-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(128,128,128,0.1); color: var(--text-primary) !important; }
.mega-dropdown .mega-category ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.mega-dropdown .mega-category .subcat-header { font-size: 13px; font-weight: 700; color: var(--text-primary, #111) !important; margin-top: 15px; display: flex; align-items: center; gap: 6px; }
.mega-dropdown .mega-category .subcat-count { opacity: 0.5; font-size: 11px; color: var(--text-muted); }
.mega-dropdown .mega-category .tool-link { font-size: 13px; color: var(--text-muted, #666) !important; text-decoration: none; display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; transition: all 0.2s; }
.mega-dropdown .mega-category .tool-link:hover { background: rgba(128,128,128,0.1) !important; color: var(--text-primary, #111) !important; }
.mega-dropdown .tool-label.new { background: #10b981; color: white; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; margin-left: auto; }