/* ============================================
   PNG to JXL Converter
   Prefix: pjx- (avoids custom_styles.css conflicts)
   Theme: Blue #3399cc
   ============================================ */

:root {
    --pjx-transition: 0.25s;
    --pjx-primary: #3399cc;
    --pjx-primary-light: #e6f4fa;
    --pjx-primary-dark: #2980b9;
    --pjx-success: #339966;
    --pjx-success-light: #e8f5e9;
    --pjx-warning: #f59e0b;
    --pjx-warning-light: #fef3c7;
    --pjx-danger: #e64e4e;
    --pjx-danger-light: #fee2e2;
    --pjx-bg: #f5f5f5;
    --pjx-bg-elevated: #ffffff;
    --pjx-bg-secondary: #f1f5f9;
    --pjx-bg-tertiary: #e2e8f0;
    --pjx-text: #1e293b;
    --pjx-text-secondary: #475569;
    --pjx-text-muted: #64748b;
    --pjx-border: #d1d5db;
    --pjx-border-light: #e2e8f0;
    --pjx-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --pjx-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --pjx-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --pjx-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    --pjx-shadow-primary: 0 4px 14px rgba(51,153,204,0.25);
    --pjx-shadow-primary-hover: 0 6px 20px rgba(51,153,204,0.35);
    --pjx-radius-sm: 6px;
    --pjx-radius-md: 12px;
    --pjx-radius-lg: 16px;
    --pjx-radius-xl: 24px;
    --pjx-radius-full: 9999px;
}

[data-theme="dark"] {
    --pjx-primary: #5fadd6;
    --pjx-primary-light: rgba(95,173,214,0.15);
    --pjx-primary-dark: #3399cc;
    --pjx-success: #4ade80;
    --pjx-success-light: rgba(74,222,128,0.15);
    --pjx-warning: #fbbf24;
    --pjx-warning-light: rgba(251,191,36,0.15);
    --pjx-danger: #f87171;
    --pjx-danger-light: rgba(248,113,113,0.15);
    --pjx-bg: #0f172a;
    --pjx-bg-elevated: #1e293b;
    --pjx-bg-secondary: #334155;
    --pjx-bg-tertiary: #475569;
    --pjx-text: #f1f5f9;
    --pjx-text-secondary: #cbd5e1;
    --pjx-text-muted: #94a3b8;
    --pjx-border: #334155;
    --pjx-border-light: #475569;
    --pjx-shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --pjx-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --pjx-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --pjx-shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5);
    --pjx-shadow-primary: 0 4px 14px rgba(95,173,214,0.2);
    --pjx-shadow-primary-hover: 0 6px 20px rgba(95,173,214,0.3);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--pjx-bg);
    color: var(--pjx-text);
    line-height: 1.6;
    margin: 0; padding: 0;
    transition: background-color var(--pjx-transition), color var(--pjx-transition);
}

/* ── Layout ──────────────────────────────────────── */
.pjx-container { max-width: 1000px; margin: 0 auto; padding: 2rem; }

.pjx-header { text-align: center; margin-bottom: 2rem; }

.pjx-title-row {
    display: flex; align-items: center; justify-content: center;
    gap: 1rem; margin-bottom: 1rem;
}

.pjx-icon-wrapper {
    width: 64px; height: 64px;
    background: var(--pjx-primary);
    border-radius: var(--pjx-radius-lg);
    display: flex; align-items: center; justify-content: center;
    color: white;
    box-shadow: var(--pjx-shadow-primary);
    flex-shrink: 0;
    transition: background-color var(--pjx-transition);
}
.pjx-icon-wrapper svg { width: 28px; height: 28px; }

.pjx-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700; margin: 0;
    color: var(--pjx-primary);
    letter-spacing: -0.02em;
}

.pjx-description {
    font-size: 1.1rem; color: var(--pjx-text-secondary);
    max-width: 800px; margin: 0 auto; line-height: 1.7;
}
.pjx-description a { color: var(--pjx-primary); text-decoration: none; font-weight: 500; }
.pjx-description a:hover { text-decoration: underline; }

/* ── Main Card ───────────────────────────────────── */
.pjx-main {
    background: var(--pjx-bg-elevated);
    border-radius: var(--pjx-radius-xl);
    box-shadow: var(--pjx-shadow-xl);
    overflow: visible;
    border: 1px solid var(--pjx-border);
    margin-bottom: 2rem;
    transition: background-color var(--pjx-transition), border-color var(--pjx-transition);
}

/* ── Upload ──────────────────────────────────────── */
.pjx-upload-section { padding: 3rem; }

.pjx-upload-area {
    border: 2px dashed var(--pjx-border);
    border-radius: var(--pjx-radius-lg);
    padding: 4rem 2rem; text-align: center; cursor: pointer;
    transition: all 0.3s ease;
    background: var(--pjx-bg-secondary);
    position: relative; overflow: hidden;
}
.pjx-upload-area::before {
    content: ''; position: absolute; inset: 0;
    background: var(--pjx-primary-light); opacity: 0;
    transition: opacity 0.3s ease;
}
.pjx-upload-area:hover, .pjx-upload-area.dragover {
    border-color: var(--pjx-primary); background: var(--pjx-bg);
    transform: translateY(-2px); box-shadow: var(--pjx-shadow-md);
}
.pjx-upload-area:hover::before, .pjx-upload-area.dragover::before { opacity: 0.5; }
.pjx-upload-content { position: relative; z-index: 1; }
.pjx-upload-icon { color: var(--pjx-primary); margin-bottom: 1.5rem; transition: transform 0.3s ease; }
.pjx-upload-area:hover .pjx-upload-icon { transform: translateY(-5px); }
.pjx-upload-title { font-size: 1.5rem; font-weight: 600; color: var(--pjx-text); margin: 0 0 0.5rem; }
.pjx-upload-subtitle { color: var(--pjx-text-secondary); margin: 0 0 1rem; }
.pjx-file-types { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.pjx-badge {
    background: var(--pjx-primary-light); color: var(--pjx-primary);
    padding: 0.35rem 0.85rem; border-radius: var(--pjx-radius-full);
    font-size: 0.8rem; font-weight: 600;
}
.pjx-upload-hint { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--pjx-text-muted); font-size: 0.875rem; }

/* ── Editor ──────────────────────────────────────── */
.pjx-editor-section { background: var(--pjx-bg-elevated); animation: pjx-fadeIn 0.4s ease; }

.pjx-files-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem;
    background: var(--pjx-bg-secondary);
    border-bottom: 1px solid var(--pjx-border);
}
.pjx-files-header-left { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--pjx-text); }
.pjx-files-header-left svg { color: var(--pjx-primary); }

.pjx-btn-text {
    display: flex; align-items: center; gap: 0.25rem;
    background: none; border: none; color: var(--pjx-primary);
    font-weight: 600; font-size: 0.9rem; cursor: pointer;
    padding: 0.5rem 0.75rem; border-radius: var(--pjx-radius-md);
    transition: all 0.2s ease;
}

.pjx-files-list {
    display: flex; flex-direction: column; gap: 0.75rem;
    padding: 1.5rem 2rem; max-height: 300px; overflow-y: auto;
    border-bottom: 1px solid var(--pjx-border);
}

.pjx-file-item {
    display: flex; align-items: center; gap: 1rem; padding: 0.875rem;
    background: var(--pjx-bg-secondary); border: 1px solid var(--pjx-border);
    border-radius: var(--pjx-radius-md); transition: all 0.2s ease;
}
.pjx-file-item:hover { border-color: var(--pjx-primary); }
.pjx-file-icon {
    width: 44px; height: 44px; border-radius: var(--pjx-radius-md);
    background: var(--pjx-primary-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pjx-file-icon svg { width: 22px; height: 22px; color: var(--pjx-primary); }
.pjx-file-info { flex: 1; min-width: 0; }
.pjx-file-name { font-weight: 600; font-size: 0.875rem; color: var(--pjx-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pjx-file-size { font-size: 0.8rem; color: var(--pjx-text-muted); margin-top: 0.2rem; }
.pjx-file-remove {
    width: 32px; height: 32px; border-radius: var(--pjx-radius-sm);
    background: var(--pjx-danger-light); color: var(--pjx-danger);
    border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; flex-shrink: 0;
}
.pjx-file-remove svg { width: 16px; height: 16px; }
.pjx-file-remove:hover { background: var(--pjx-danger); color: white; }

/* ── Settings Panel ──────────────────────────────── */
.pjx-settings-panel {
    padding: 2rem;
    border-bottom: 1px solid var(--pjx-border);
}

.pjx-panel-header { margin-bottom: 1.5rem; }
.pjx-panel-header h3 {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1.05rem; font-weight: 600; color: var(--pjx-text); margin: 0;
}
.pjx-panel-header h3 svg { color: var(--pjx-primary); }

.pjx-settings-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
}

.pjx-settings-col { display: flex; flex-direction: column; gap: 1.5rem; }

.pjx-section-label {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.875rem; font-weight: 600; color: var(--pjx-text-secondary);
    margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.pjx-section-label svg { color: var(--pjx-primary); }

/* Quality slider */
.pjx-quality-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }

.pjx-slider {
    flex: 1; -webkit-appearance: none; appearance: none;
    height: 6px; border-radius: 3px;
    background: linear-gradient(to right, var(--pjx-primary) 0%, var(--pjx-primary) var(--pjx-progress, 84%), var(--pjx-border) var(--pjx-progress, 84%));
    outline: none; cursor: pointer;
    transition: background var(--pjx-transition);
}
.pjx-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px;
    border-radius: 50%; background: var(--pjx-primary);
    box-shadow: 0 2px 6px rgba(51,153,204,0.4); cursor: pointer;
    transition: transform 0.15s ease;
}
.pjx-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.pjx-slider:disabled { opacity: 0.45; cursor: not-allowed; }

.pjx-quality-val {
    font-size: 1.1rem; font-weight: 700; color: var(--pjx-primary);
    min-width: 54px; text-align: right; white-space: nowrap;
}

.pjx-slider-labels {
    display: flex; justify-content: space-between;
    font-size: 0.75rem; color: var(--pjx-text-muted); margin-bottom: 0.75rem;
}

.pjx-presets { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pjx-preset-label { font-size: 0.78rem; color: var(--pjx-text-muted); font-weight: 500; }
.pjx-preset-btn {
    padding: 0.3rem 0.7rem;
    background: var(--pjx-bg-elevated); border: 1px solid var(--pjx-border);
    border-radius: var(--pjx-radius-full); font-size: 0.8rem; font-weight: 500;
    cursor: pointer; color: var(--pjx-text); transition: all 0.2s ease;
}
.pjx-preset-btn:hover { border-color: var(--pjx-primary); color: var(--pjx-primary); }
.pjx-preset-active, .pjx-preset-btn.pjx-preset-active {
    background: var(--pjx-primary); border-color: var(--pjx-primary); color: white;
}

/* Lossless toggle */
.pjx-lossless-row { display: flex; flex-direction: column; gap: 0.75rem; }

.pjx-toggle-group { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.pjx-mode-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
    padding: 0.75rem; border-radius: var(--pjx-radius-md);
    border: 2px solid var(--pjx-border); background: var(--pjx-bg-elevated);
    cursor: pointer; transition: all 0.2s ease; color: var(--pjx-text);
}
.pjx-mode-btn:hover { border-color: var(--pjx-primary); }
.pjx-mode-btn.active { background: var(--pjx-primary-light); border-color: var(--pjx-primary); }
.pjx-mode-btn svg { width: 18px; height: 18px; color: var(--pjx-text-muted); }
.pjx-mode-btn.active svg { color: var(--pjx-primary); }
.pjx-mode-label { font-size: 0.875rem; font-weight: 600; }
.pjx-mode-desc { font-size: 0.72rem; color: var(--pjx-text-muted); }

.pjx-mode-info {
    display: flex; align-items: flex-start; gap: 0.5rem;
    padding: 0.75rem; background: var(--pjx-primary-light);
    border-radius: var(--pjx-radius-md); font-size: 0.82rem;
    color: var(--pjx-text-secondary); line-height: 1.5;
}
.pjx-mode-info svg { color: var(--pjx-primary); flex-shrink: 0; margin-top: 2px; }

/* Quality section fade when lossless on */
.pjx-quality-section.disabled { opacity: 0.4; pointer-events: none; }

/* Encoding effort */
.pjx-effort-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem;
}

.pjx-effort-btn {
    display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
    padding: 0.6rem 0.5rem; border-radius: var(--pjx-radius-md);
    border: 2px solid var(--pjx-border); background: var(--pjx-bg-elevated);
    cursor: pointer; transition: all 0.2s ease; text-align: center;
}
.pjx-effort-btn:hover { border-color: var(--pjx-primary); }
.pjx-effort-btn.active { background: var(--pjx-primary-light); border-color: var(--pjx-primary); }
.pjx-effort-name { font-size: 0.82rem; font-weight: 600; color: var(--pjx-text); }
.pjx-effort-sub { font-size: 0.7rem; color: var(--pjx-text-muted); }
.pjx-effort-btn.active .pjx-effort-name { color: var(--pjx-primary); }

/* Options checkboxes */
.pjx-options-list { display: flex; flex-direction: column; gap: 0.5rem; }

.pjx-option-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem; background: var(--pjx-bg-secondary);
    border-radius: var(--pjx-radius-md); border: 1px solid var(--pjx-border);
    cursor: pointer; transition: border-color 0.2s;
}
.pjx-option-item:hover { border-color: var(--pjx-primary); }

/* Checkbox fix for custom_styles.css override */
.pjx-container .pjx-checkbox {
    width: 16px !important; height: 16px !important;
    min-width: 16px !important;
    border: 1px solid var(--pjx-border) !important;
    background: var(--pjx-bg-elevated) !important;
    margin-right: 0 !important;
    accent-color: var(--pjx-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.pjx-container .pjx-checkbox:checked {
    background: var(--pjx-primary) !important;
    border-color: var(--pjx-primary) !important;
}

.pjx-option-text { display: flex; flex-direction: column; gap: 0.1rem; }
.pjx-option-label { font-size: 0.875rem; font-weight: 600; color: var(--pjx-text); }
.pjx-option-desc { font-size: 0.77rem; color: var(--pjx-text-muted); }

/* ── Action Bar ──────────────────────────────────── */
.pjx-action-bar {
    display: flex; justify-content: flex-end; align-items: center; gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--pjx-bg-secondary);
    border-radius: 0 0 var(--pjx-radius-xl) var(--pjx-radius-xl);
}

.pjx-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border-radius: var(--pjx-radius-md);
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
    border: none; transition: all 0.2s ease;
}
.pjx-btn svg { width: 18px; height: 18px; }

.pjx-btn-primary {
    background: var(--pjx-primary); color: white;
    box-shadow: var(--pjx-shadow-primary);
}
.pjx-btn-primary:hover {
    background: var(--pjx-primary-dark);
    box-shadow: var(--pjx-shadow-primary-hover);
    transform: translateY(-1px);
}

.pjx-btn-secondary {
    background: var(--pjx-bg-elevated); color: var(--pjx-text);
    border: 1px solid var(--pjx-border);
}
.pjx-btn-secondary:hover { border-color: var(--pjx-primary); color: var(--pjx-primary); }

/* Button override - prevent custom_styles.css interference */
.pjx-container .pjx-btn-primary { background: var(--pjx-primary) !important; color: white !important; transform: none !important; box-shadow: var(--pjx-shadow-primary) !important; }
.pjx-container .pjx-btn-primary:hover { background: var(--pjx-primary-dark) !important; transform: translateY(-1px) !important; box-shadow: var(--pjx-shadow-primary-hover) !important; }
.pjx-container .pjx-btn-secondary { background: var(--pjx-bg-elevated) !important; color: var(--pjx-text) !important; box-shadow: none !important; }
.pjx-container .pjx-btn-secondary:hover { border-color: var(--pjx-primary) !important; color: var(--pjx-primary) !important; transform: none !important; box-shadow: none !important; }
.pjx-container .pjx-btn-text { background: none !important; box-shadow: none !important; transform: none !important; }
.pjx-container .pjx-btn-text:hover { background: var(--pjx-primary-light) !important; color: var(--pjx-primary) !important; transform: none !important; box-shadow: none !important; }
.pjx-container .pjx-preset-btn { background: var(--pjx-bg-elevated) !important; color: var(--pjx-text) !important; box-shadow: none !important; transform: none !important; }
.pjx-container .pjx-preset-btn:hover { border-color: var(--pjx-primary) !important; color: var(--pjx-primary) !important; transform: none !important; box-shadow: none !important; }
.pjx-container .pjx-preset-active, .pjx-container .pjx-preset-btn.pjx-preset-active { background: var(--pjx-primary) !important; border-color: var(--pjx-primary) !important; color: white !important; }
.pjx-container .pjx-mode-btn { background: var(--pjx-bg-elevated) !important; color: var(--pjx-text) !important; box-shadow: none !important; transform: none !important; }
.pjx-container .pjx-mode-btn:hover { border-color: var(--pjx-primary) !important; transform: none !important; box-shadow: none !important; }
.pjx-container .pjx-mode-btn.active { background: var(--pjx-primary-light) !important; border-color: var(--pjx-primary) !important; }
.pjx-container .pjx-effort-btn { background: var(--pjx-bg-elevated) !important; color: var(--pjx-text) !important; box-shadow: none !important; transform: none !important; }
.pjx-container .pjx-effort-btn:hover { border-color: var(--pjx-primary) !important; transform: none !important; box-shadow: none !important; }
.pjx-container .pjx-effort-btn.active { background: var(--pjx-primary-light) !important; border-color: var(--pjx-primary) !important; }
.pjx-container .pjx-file-remove { background: var(--pjx-danger-light) !important; color: var(--pjx-danger) !important; border: none !important; box-shadow: none !important; transform: none !important; }
.pjx-container .pjx-file-remove:hover { background: var(--pjx-danger) !important; color: white !important; transform: none !important; }

/* ── Processing Overlay ──────────────────────────── */
.pjx-processing-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 9000;
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.pjx-processing-card {
    background: var(--pjx-bg-elevated);
    border-radius: var(--pjx-radius-xl);
    padding: 2rem 2.5rem; text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
    min-width: 320px; max-width: 420px; width: 90%;
    border: 1px solid var(--pjx-border);
}
.pjx-progress-stages { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 1.75rem; }
.pjx-stage-dot { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; color: var(--pjx-text-muted); transition: color 0.3s; }
.pjx-stage-icon {
    width: 20px; height: 20px; padding: 7px;
    background: var(--pjx-bg-secondary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s; box-sizing: content-box;
}
.pjx-stage-icon svg { width: 14px; height: 14px; display: block; }
.pjx-stage-dot span { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.pjx-stage-dot.active .pjx-stage-icon { background: var(--pjx-primary); color: #fff; }
.pjx-stage-dot.active { color: var(--pjx-primary); }
.pjx-stage-dot.done .pjx-stage-icon { background: var(--pjx-success); color: #fff; }
.pjx-stage-dot.done { color: var(--pjx-success); }
.pjx-stage-connector { width: 28px; height: 2px; background: var(--pjx-border); margin: 0 0.25rem 1.1rem; flex-shrink: 0; }
.pjx-css-spinner {
    width: 44px; height: 44px;
    border: 4px solid var(--pjx-border);
    border-top-color: var(--pjx-primary);
    border-radius: 50%;
    animation: pjx-spin 0.8s linear infinite;
    margin: 0 auto 1.25rem;
}
@keyframes pjx-spin { to { transform: rotate(360deg); } }
.pjx-progress-bar-wrap { height: 6px; background: var(--pjx-border); border-radius: var(--pjx-radius-full); overflow: hidden; margin-bottom: 0.875rem; }
.pjx-progress-bar-fill { height: 100%; background: var(--pjx-primary); width: 0%; transition: width 0.4s ease; border-radius: var(--pjx-radius-full); }
.pjx-processing-status { font-size: 0.9rem; font-weight: 500; color: var(--pjx-text); margin: 0 0 0.25rem; }
.pjx-progress-pct { font-size: 0.82rem; color: var(--pjx-text-muted); margin: 0; }

/* ── Results ─────────────────────────────────────── */
.pjx-results-section { padding: 2.5rem; text-align: center; animation: pjx-fadeIn 0.4s ease; }
.pjx-results-header { margin-bottom: 1.5rem; }
.pjx-success-icon {
    width: 72px; height: 72px; background: var(--pjx-success); border-radius: var(--pjx-radius-full);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.25rem; color: white;
}
.pjx-success-icon svg { width: 36px; height: 36px; }
.pjx-results-header h2 { font-size: 1.75rem; color: var(--pjx-text); margin: 0 0 0.5rem 0; }
.pjx-results-header p { color: var(--pjx-text-muted); margin: 0; }

.pjx-results-stats {
    display: flex; justify-content: center; align-items: center;
    gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.pjx-stat { text-align: center; }
.pjx-stat-label { display: block; font-size: 0.78rem; color: var(--pjx-text-muted); margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.5px; }
.pjx-stat-value { font-size: 1.25rem; font-weight: 700; color: var(--pjx-text); }
.pjx-stat.highlight .pjx-stat-value { color: var(--pjx-primary); }
.pjx-stat.savings .pjx-stat-value { color: var(--pjx-success); }
.pjx-stat-arrow { color: var(--pjx-text-muted); font-size: 1.25rem; }

.pjx-converted-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; text-align: left; }
.pjx-converted-item {
    display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem;
    background: var(--pjx-bg-secondary); border: 1px solid var(--pjx-border);
    border-radius: var(--pjx-radius-md); transition: border-color 0.2s;
}
.pjx-converted-item:hover { border-color: var(--pjx-primary); }
.pjx-converted-icon {
    width: 44px; height: 44px; border-radius: var(--pjx-radius-md);
    background: var(--pjx-primary-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pjx-converted-icon svg { width: 22px; height: 22px; color: var(--pjx-primary); }
.pjx-converted-info { flex: 1; min-width: 0; }
.pjx-converted-name { font-weight: 600; font-size: 0.9rem; color: var(--pjx-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.25rem; }
.pjx-converted-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.78rem; color: var(--pjx-text-muted); flex-wrap: wrap; }
.pjx-size-reduction { color: var(--pjx-success); font-weight: 600; }
.pjx-size-increase  { color: var(--pjx-danger);  font-weight: 600; }

.pjx-cs-chip {
    display: inline-flex; align-items: center;
    padding: 0.15rem 0.55rem; background: var(--pjx-primary-light);
    color: var(--pjx-primary); border-radius: var(--pjx-radius-full);
    font-size: 0.72rem; font-weight: 600;
}

.pjx-meta-chip {
    display: inline-flex; align-items: center; gap: 0.2rem;
    padding: 0.15rem 0.55rem; background: var(--pjx-bg-tertiary);
    color: var(--pjx-text-muted); border-radius: var(--pjx-radius-full);
    font-size: 0.72rem; font-weight: 600;
}
.pjx-meta-chip svg { width: 11px; height: 11px; }
.pjx-download-btn {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.5rem 1rem; background: var(--pjx-primary); color: white;
    border-radius: var(--pjx-radius-md); text-decoration: none;
    font-size: 0.85rem; font-weight: 600; transition: all 0.2s ease; flex-shrink: 0;
}
.pjx-download-btn:hover { background: var(--pjx-primary-dark); color: white; }
.pjx-download-btn svg { width: 16px; height: 16px; }

.pjx-results-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ── Error ───────────────────────────────────────── */
.pjx-error {
    display: flex; align-items: flex-start; gap: 0.75rem;
    background: var(--pjx-danger-light); border: 1px solid var(--pjx-danger);
    padding: 1rem 1.25rem; border-radius: var(--pjx-radius-md); margin: 1.25rem;
}
.pjx-error svg { color: var(--pjx-danger); flex-shrink: 0; margin-top: 2px; }
.pjx-error-body { flex: 1; }
.pjx-error-title { font-weight: 600; color: var(--pjx-danger); margin: 0 0 0.25rem; font-size: 0.95rem; }
.pjx-error-detail { color: var(--pjx-danger); margin: 0 0 0.5rem; font-size: 0.875rem; opacity: 0.9; }
.pjx-error-contact { font-size: 0.82rem; color: var(--pjx-text-secondary); margin: 0; }
.pjx-error-contact a { color: var(--pjx-primary); font-weight: 600; text-decoration: none; }
.pjx-error-contact a:hover { text-decoration: underline; }

/* ── Browser Notice ──────────────────────────────── */
.pjx-browser-notice {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.875rem 1.25rem; background: var(--pjx-bg-elevated);
    border: 1px solid var(--pjx-border); border-radius: var(--pjx-radius-md);
    margin-bottom: 1.5rem; font-size: 0.875rem; color: var(--pjx-text-secondary);
}
.pjx-browser-notice svg { color: var(--pjx-primary); flex-shrink: 0; }
.pjx-browser-notice a { color: var(--pjx-primary); text-decoration: none; font-weight: 500; }
.pjx-browser-notice a:hover { text-decoration: underline; }

/* ── Related Tools ───────────────────────────────── */
.pjx-related-tools {
    display: flex; align-items: center; flex-wrap: wrap; gap: 1rem;
    padding: 1.25rem 1.5rem; background: var(--pjx-bg-elevated);
    border-radius: var(--pjx-radius-lg); margin-bottom: 2rem;
    border: 1px solid var(--pjx-border); box-shadow: var(--pjx-shadow-sm);
}
.pjx-related-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--pjx-text); font-size: 0.875rem; }
.pjx-related-label svg { color: var(--pjx-primary); width: 16px; height: 16px; }
.pjx-related-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pjx-related-link {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; background: var(--pjx-bg-secondary);
    border-radius: var(--pjx-radius-full); color: var(--pjx-text-secondary);
    text-decoration: none; font-size: 0.875rem; font-weight: 500;
    transition: all 0.2s ease; border: 1px solid var(--pjx-border);
}
.pjx-related-link:hover { background: var(--pjx-primary); color: white; border-color: var(--pjx-primary); transform: translateY(-2px); }
.pjx-related-link svg { width: 15px; height: 15px; }

/* ── Info Cards ──────────────────────────────────── */
.pjx-info-sections { display: flex; flex-direction: column; gap: 1.5rem; }
.pjx-info-card {
    background: var(--pjx-bg-elevated); border-radius: var(--pjx-radius-xl);
    padding: 2rem; box-shadow: var(--pjx-shadow-md); border: 1px solid var(--pjx-border);
    transition: background-color var(--pjx-transition), border-color var(--pjx-transition);
}
.pjx-info-card h2 { display: flex; align-items: center; gap: 0.75rem; font-size: 1.3rem; color: var(--pjx-text); margin: 0 0 1.5rem 0; }
.pjx-info-card h2 svg { color: var(--pjx-primary); width: 24px; height: 24px; }

.pjx-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.pjx-steps li { position: relative; padding-left: 3.25rem; margin-bottom: 1rem; counter-increment: step; color: var(--pjx-text-secondary); line-height: 1.6; }
.pjx-steps li:not(:last-child)::after { content: ''; position: absolute; left: calc(1rem - 1px); top: 2rem; bottom: 0; width: 2px; background: var(--pjx-primary-light); }
.pjx-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; background: var(--pjx-primary); color: white; border-radius: var(--pjx-radius-full); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.875rem; z-index: 1; }
.pjx-steps li a { color: var(--pjx-primary); text-decoration: none; }
.pjx-steps li a:hover { text-decoration: underline; }

.pjx-tip {
    display: flex; align-items: flex-start; gap: 0.75rem; margin-top: 1.5rem;
    padding: 1rem 1.25rem; background: var(--pjx-warning-light);
    border-radius: var(--pjx-radius-md); font-size: 0.875rem; color: var(--pjx-text-secondary); line-height: 1.6;
}
.pjx-tip svg { color: var(--pjx-warning); flex-shrink: 0; margin-top: 2px; }
.pjx-tip a { color: var(--pjx-warning); font-weight: 600; text-decoration: none; }
.pjx-tip a:hover { text-decoration: underline; }

.pjx-benefits-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.pjx-benefit-item { display: flex; gap: 1rem; align-items: flex-start; }
.pjx-benefit-icon { width: 44px; height: 44px; background: var(--pjx-primary-light); border-radius: var(--pjx-radius-md); display: flex; align-items: center; justify-content: center; color: var(--pjx-primary); flex-shrink: 0; }
.pjx-benefit-icon svg { width: 20px; height: 20px; }
.pjx-benefit-content h4 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--pjx-text); }
.pjx-benefit-content p { margin: 0; font-size: 0.875rem; color: var(--pjx-text-secondary); line-height: 1.5; }
.pjx-benefit-content a { color: var(--pjx-primary); text-decoration: none; }
.pjx-benefit-content a:hover { text-decoration: underline; }

.pjx-comparison { display: flex; flex-direction: column; gap: 1rem; }
.pjx-compare-row { display: flex; align-items: flex-start; gap: 1rem; }
.pjx-compare-tag { flex-shrink: 0; padding: 0.4rem 1rem; border-radius: var(--pjx-radius-full); font-size: 0.85rem; font-weight: 600; white-space: nowrap; color: white; }
.pjx-compare-tag.lossless { background: var(--pjx-success); }
.pjx-compare-tag.high { background: var(--pjx-primary); }
.pjx-compare-tag.medium { background: var(--pjx-warning); color: #1a1a1a; }
.pjx-compare-tag.low { background: #94a3b8; }
.pjx-compare-row p { margin: 0; color: var(--pjx-text-secondary); line-height: 1.6; }
.pjx-compare-row p a { color: var(--pjx-primary); text-decoration: none; }
.pjx-compare-row p a:hover { text-decoration: underline; }

/* FAQ - uses .open class (global _footer.php accordion) */
.pjx-faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item { border: 1px solid var(--pjx-border); border-radius: var(--pjx-radius-md); overflow: hidden; }
.faq-question {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem; background: var(--pjx-bg-secondary); border: none;
    cursor: pointer; font-size: 0.975rem; font-weight: 500; color: var(--pjx-text); text-align: left;
    transition: all 0.2s ease;
}
.faq-question:hover { background: var(--pjx-bg-tertiary); }
.faq-question svg { flex-shrink: 0; color: var(--pjx-primary); width: 20px; height: 20px; transition: transform 0.3s ease; }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.faq-item.open .faq-answer { max-height: 400px; }
.faq-answer p { margin: 0; color: var(--pjx-text-secondary); line-height: 1.7; background: var(--pjx-bg-elevated); }
.faq-answer a { color: var(--pjx-primary); text-decoration: none; }
.faq-answer a:hover { text-decoration: underline; }

/* ── File Thumbnails ─────────────────────────────── */
.pjx-file-thumb {
    width: 60px; height: 60px;
    border-radius: var(--pjx-radius-md);
    overflow: hidden; flex-shrink: 0;
    position: relative;
    background: var(--pjx-bg-tertiary);
}

.pjx-thumb-img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    border-radius: var(--pjx-radius-md);
    transition: opacity 0.2s ease;
}

.pjx-thumb-dims {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff; font-size: 0.6rem; font-weight: 600;
    text-align: center; padding: 2px 0;
    line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pjx-thumb-skeleton {
    width: 100%; height: 100%;
    background: linear-gradient(90deg, var(--pjx-bg-tertiary) 25%, var(--pjx-bg-secondary) 50%, var(--pjx-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: pjx-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--pjx-radius-md);
}
@keyframes pjx-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Thumbnail in results */
.pjx-converted-thumb {
    width: 52px; height: 52px;
    object-fit: cover; border-radius: var(--pjx-radius-md);
    flex-shrink: 0;
}
.pjx-converted-thumb-placeholder {
    width: 52px; height: 52px;
    border-radius: var(--pjx-radius-md);
    background: var(--pjx-primary-light);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.pjx-converted-thumb-placeholder svg { width: 22px; height: 22px; color: var(--pjx-primary); }

/* ── Color Space Selector ────────────────────────── */
.pjx-cs-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.pjx-cs-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
    padding: 0.6rem 0.4rem; border-radius: var(--pjx-radius-md);
    border: 2px solid var(--pjx-border); background: var(--pjx-bg-elevated);
    cursor: pointer; transition: all 0.2s ease; text-align: center;
}
.pjx-cs-btn:hover { border-color: var(--pjx-primary); }
.pjx-cs-btn.active { background: var(--pjx-primary-light); border-color: var(--pjx-primary); }
.pjx-cs-name { font-size: 0.8rem; font-weight: 600; color: var(--pjx-text); }
.pjx-cs-sub  { font-size: 0.68rem; color: var(--pjx-text-muted); }
.pjx-cs-btn.active .pjx-cs-name { color: var(--pjx-primary); }

.pjx-cs-info {
    display: flex; align-items: flex-start; gap: 0.4rem;
    font-size: 0.78rem; color: var(--pjx-text-muted); line-height: 1.4;
    padding: 0.4rem 0.5rem; background: var(--pjx-bg-secondary);
    border-radius: var(--pjx-radius-sm);
}
.pjx-cs-info svg { color: var(--pjx-primary); flex-shrink: 0; margin-top: 1px; }

/* Override buttons from custom_styles.css */
.pjx-container .pjx-cs-btn { background: var(--pjx-bg-elevated) !important; color: var(--pjx-text) !important; box-shadow: none !important; transform: none !important; }
.pjx-container .pjx-cs-btn:hover { border-color: var(--pjx-primary) !important; transform: none !important; box-shadow: none !important; }
.pjx-container .pjx-cs-btn.active { background: var(--pjx-primary-light) !important; border-color: var(--pjx-primary) !important; }
.pjx-container .pjx-cs-btn.active .pjx-cs-name { color: var(--pjx-primary) !important; }

/* ── Responsive additions ────────────────────────── */
@media (max-width: 480px) {
    .pjx-cs-grid { grid-template-columns: repeat(3, 1fr); }
    .pjx-cs-name { font-size: 0.72rem; }
}

/* ── File list height increase for thumbnails ────── */
@media (max-width: 900px) {
    .pjx-settings-grid, .pjx-benefits-grid { grid-template-columns: 1fr; }
    .pjx-effort-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .pjx-container { padding: 1rem; }
    .pjx-upload-section { padding: 2rem 1.5rem; }
    .pjx-upload-area { padding: 2.5rem 1.5rem; }
    .pjx-files-list { padding: 1rem 1.5rem; }
    .pjx-settings-panel { padding: 1.5rem; }
    .pjx-toggle-group { grid-template-columns: 1fr; }
    .pjx-effort-grid { grid-template-columns: repeat(2, 1fr); }
    .pjx-action-bar { flex-direction: column; padding: 1.25rem; }
    .pjx-btn { width: 100%; justify-content: center; }
    .pjx-results-section { padding: 2rem 1.5rem; }
    .pjx-converted-item { flex-wrap: wrap; }
    .pjx-download-btn { width: 100%; margin-top: 0.5rem; justify-content: center; }
    .pjx-results-stats { flex-direction: column; gap: 1rem; }
    .pjx-stat-arrow { transform: rotate(90deg); }
    .pjx-results-actions { flex-direction: column; }
    .pjx-results-actions .pjx-btn { width: 100%; justify-content: center; }
    .pjx-related-tools { flex-direction: column; align-items: flex-start; }
    .pjx-compare-row { flex-direction: column; gap: 0.5rem; }
    .pjx-info-card { padding: 1.5rem; }
}
@media (max-width: 480px) {
    .pjx-title-row { flex-direction: column; }
    .pjx-presets { justify-content: center; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--pjx-bg); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--pjx-text-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--pjx-text-secondary); }

@keyframes pjx-fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
