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

:root {
    --transition-speed: 0.25s;
    --primary:       #e64e4e;
    --primary-light: #fef2f2;
    --primary-dark:  #c0392b;
    --primary-rgb:   230, 78, 78;
    --color-1: #e64e4e;
    --color-2: #3399cc;
    --color-3: #339966;
    --body-bg:       #f5f4f3;
    --header-bg:     #ffffff;
    --card-bg:       #ffffff;
    --card-secondary:#f9fafb;
    --settings-bg:   #ffffff;
    --text-primary:  #111111;
    --text-secondary:#374151;
    --text-muted:    #6b7280;
    --text-light:    #9ca3af;
    --border-color:  #e8e4e0;
    --border-mid:    #e0dbd7;
    --link-color:    #e64e4e;
    --link-hover:    #c0392b;
    --success:       #22c55e;
    --success-bg:    #f0fdf4;
    --warning:       #f59e0b;
    --error:         #ef4444;
    --error-bg:      #fef2f2;
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.06);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.09);
    --shadow-hover:  0 0 0 4px rgba(230,78,78,0.08);
    --radius-sm:     6px;
    --radius-md:     10px;
    --radius-lg:     14px;
    --dropzone-bg:   #ffffff;
    --dropzone-border:#ddd8d4;
    --toggle-track:  #1e293b;
    --footer-bg:     #1e293b;
    --footer-text:   #e2e8f0;
}

[data-theme="dark"] {
    --primary:       #f87171;
    --primary-light: rgba(248,113,113,0.12);
    --primary-dark:  #ef4444;
    --primary-rgb:   248, 113, 113;
    --body-bg:       #0c0c0e;
    --header-bg:     #111116;
    --card-bg:       #111116;
    --card-secondary:#1a1a1e;
    --settings-bg:   #111116;
    --text-primary:  #f0f0f0;
    --text-secondary:#d1d5db;
    --text-muted:    #6b7280;
    --text-light:    #4b5563;
    --border-color:  rgba(255,255,255,0.08);
    --border-mid:    rgba(255,255,255,0.08);
    --link-color:    #f87171;
    --link-hover:    #fca5a5;
    --success:       #4ade80;
    --success-bg:    rgba(74,222,128,0.1);
    --error:         #f87171;
    --error-bg:      rgba(248,113,113,0.1);
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.25);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.38);
    --shadow-hover:  0 0 0 4px rgba(248,113,113,0.1);
    --dropzone-bg:   #111116;
    --dropzone-border:rgba(255,255,255,0.1);
    --toggle-track:  #334155;
    --footer-bg:     #0a0a0c;
    --footer-text:   #cbd5e1;
}

/* ============================================
   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; }
}

