/* ============================================
   WATERMARK IMAGE MAKER - Side-by-Side Layout
   Dark Mode Support with Light Mode Default
   ============================================ */

/* CSS Variables - Light Mode (Default) */
:root {
    --transition-speed: 0.25s;
    
    /* Primary Colors */
    --primary: #3399cc;
    --primary-light: #e0f4ff;
    --primary-dark: #2980b9;
    
    /* Status Colors */
    --success: #339966;
    --success-light: #e8f5e9;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #e64e4e;
    --danger-light: #fee2e2;
    
    /* Background Colors */
    --bg: #f0f9ff;
    --bg-elevated: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    
    /* Text Colors */
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Border Colors */
    --border: #d1e7f5;
    --border-light: #e2e8f0;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    /* Radius */
    --selected-bg: rgba(51, 153, 204, 0.10);
    --switch-off-bg: #cbd5e1;
    --switch-off-border: #94a3b8;
    --switch-knob-border: #cbd5e1;
    --radius-full: 9999px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    /* Checkerboard */
    --checker-light: #f0f0f0;
    --checker-dark: #e0e0e0;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-light: rgba(96, 165, 250, 0.15);
    --primary-dark: #3b82f6;
    
    --success: #4ade80;
    --success-light: rgba(74, 222, 128, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    
    --bg: #0f172a;
    --bg-elevated: #1e293b;
    --bg-secondary: #334155;
    --bg-tertiary: #475569;
    
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border: #334155;
    --border-light: #475569;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.5);
    
    --selected-bg: rgba(77, 184, 232, 0.16);
    --switch-off-bg: #475569;
    --switch-off-border: #64748b;
    --switch-knob-border: rgba(0, 0, 0, 0.2);
    --checker-light: #334155;
    --checker-dark: #475569;
}

/* Base Styles */
* { box-sizing: border-box; }

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

/* Container */
.tool-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

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

.tool-icon-wrapper {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-md);
}

.tool-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    margin: 0;
    color: var(--primary);
}

.tool-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 900px;
    margin: 0 auto !important;
    line-height: 1.7;
    text-align: center !important;
}

.tool-description a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.tool-description a:hover {
    text-decoration: underline;
}

/* Main Tool Area */
.tool-main {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

/* Upload Section */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: var(--bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-icon {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.5rem;
}

.upload-subtitle {
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

.upload-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   EDITOR SECTION - Side by Side Layout
   ============================================ */

.editor-section {
    display: flex;
    flex-direction: column;
}

/* File Info Bar */
.file-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}

.file-info-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.file-info-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-info-item i, .file-info-item svg {
    color: var(--primary);
    opacity: 0.8;
}

.batch-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Editor Grid - Main Side by Side */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    min-height: 500px;
}

/* Preview Column */
.preview-column {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.drag-hint,
.keyboard-hint {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
}

.preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: repeating-conic-gradient(var(--checker-light) 0% 25%, var(--checker-dark) 0% 50%) 50% / 20px 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 350px;
}

.preview-wrapper {
    max-width: 100%;
    max-height: 100%;
}

#previewCanvas {
    max-width: 100%;
    max-height: 450px;
    display: block;
    cursor: move;
    box-shadow: var(--shadow-lg);
}

/* Batch Thumbnails */
.batch-thumbnails {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.batch-thumbnails-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.batch-file-item {
    position: relative;
    width: 70px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    background: var(--bg);
}

.batch-file-item:hover {
    border-color: var(--primary);
}

.batch-file-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.batch-file-item img {
    width: 100%;
    height: 50px;
    object-fit: cover;
    display: block;
}

.batch-file-name {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 0.25rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--bg-elevated);
}

.batch-file-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 0;
}

.batch-file-item:hover .batch-file-remove {
    opacity: 1;
}

.batch-file-remove:hover {
    background: var(--danger);
}

.batch-file-remove svg {
    width: 12px;
    height: 12px;
}

.batch-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.batch-thumb:hover {
    border-color: var(--primary);
}

.batch-thumb.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.batch-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   SETTINGS SIDEBAR
   ============================================ */

.settings-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    max-height: calc(100vh - 200px);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.sidebar-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.settings-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.panel-content {
    padding: 0 1rem 1rem;
    display: block;
}

/* ============================================
   FORM CONTROLS
   ============================================ */

.control-group {
    margin-bottom: 0.75rem;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.control-label-sm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.value-display {
    color: var(--primary);
    font-weight: 600;
}

/* Text Input */
.text-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg-elevated);
    color: var(--text);
    transition: border-color 0.2s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Select Input */
.select-input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
}

.select-sm {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
}

.select-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Range Input */
.range-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.range-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

/* Color Input */
.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-input {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-input::-webkit-color-swatch {
    border-radius: 3px;
    border: none;
}

.color-hex {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Checkbox */
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-inline input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* File Upload Compact */
.file-upload-compact {
    margin-bottom: 0.75rem;
}

.watermark-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.watermark-thumb {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--checker-light);
}

.watermark-file-name {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tiling Options */
.tiling-options {
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px dashed var(--border);
}

/* Resize Options */
.resize-options {
    padding-top: 0.5rem;
}

.resize-presets {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.resize-btn {
    flex: 1;
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.resize-btn:hover {
    border-color: var(--primary);
}

.resize-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.resize-info {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Output Format boxes (mirror Image Resizer tool) */
.wm-format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.wm-format-grid .format-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.wm-format-grid .format-btn i {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.wm-format-grid .format-btn:hover {
    border-color: var(--primary);
}

.wm-format-grid .format-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.wm-format-grid .format-btn.active i {
    color: #fff;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #2d8659;
}

.btn-outline {
    background: var(--bg-elevated) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

.btn-outline:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon-sm {
    width: 28px;
    height: 28px;
}

.btn-icon.btn-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-light);
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    margin: 0;
    color: var(--text);
}

.modal-header h3 i, .modal-header h3 svg {
    color: var(--primary);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ============================================
   RELATED TOOLS
   ============================================ */

.related-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.related-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.related-label i, .related-label svg {
    color: var(--primary);
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 50px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.related-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   INFO SECTIONS
   ============================================ */

.info-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.info-card h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.3rem;
    color: var(--text);
    margin: 0 0 1.5rem 0;
}

.info-card h2 i, .info-card h2 svg {
    color: var(--primary);
}

/* Steps List */
.steps-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 0;
}

.steps-list li {
    position: relative;
    padding-left: 3.25rem;
    margin-bottom: 1rem;
    counter-increment: step;
    color: var(--text-secondary);
    line-height: 1.6;
}

.steps-list li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: calc(1rem - 1px);
    top: 2rem;
    bottom: 0;
    width: 2px;
    background: var(--primary-light);
}

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 1;
}

.steps-list li:last-child {
    margin-bottom: 0;
}

.steps-list li a {
    color: var(--primary);
    text-decoration: none;
}

.steps-list li a:hover {
    text-decoration: underline;
}

.steps-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--warning-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.steps-tip i, .steps-tip svg {
    color: var(--warning);
    flex-shrink: 0;
}

.steps-tip a {
    color: var(--warning);
    font-weight: 600;
    text-decoration: none;
}

.steps-tip a:hover {
    text-decoration: underline;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.feature-item {
    display: flex;
    gap: 1rem;
}

.feature-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.feature-content h4 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    color: var(--text);
}

.feature-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
    text-align: left;
    transition: all 0.2s ease;
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-question i, .faq-question svg {
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.open .faq-question i,
.faq-item.open .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    padding: 1rem 1.25rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
    background: var(--bg-elevated);
}

.faq-answer a {
    color: var(--primary);
    text-decoration: none;
}

.faq-answer a:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .editor-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-column {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .settings-sidebar {
        max-height: none;
    }
    
    #previewCanvas {
        max-height: 350px;
    }
}

@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }
    
    .tool-title-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .upload-section {
        padding: 2rem 1.5rem;
    }
    
    .upload-area {
        padding: 2.5rem 1.5rem;
    }
    
    .file-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .preview-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .control-row-2col {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .related-tools {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    
    .resize-presets {
        flex-wrap: wrap;
    }
    
    .resize-btn {
        flex: 0 0 calc(50% - 0.2rem);
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Selection */
::selection {
    background: rgba(51, 153, 204, 0.2);
}

[data-theme="dark"] ::selection {
    background: rgba(96, 165, 250, 0.3);
}

/* ============================================
   v2 ADDITIONS - Sleeker UI & New Features
   (tool-prefixed, self-contained)
   ============================================ */

/* Toast Notifications */
.wm-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: min(420px, calc(100vw - 2rem));
    pointer-events: none;
}

.wm-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.45;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}

.wm-toast.wm-toast-in { opacity: 1; transform: translateX(0); }
.wm-toast.wm-toast-out { opacity: 0; transform: translateX(20px); }

.wm-toast-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.wm-toast-error .wm-toast-icon { color: var(--danger); }
.wm-toast-success .wm-toast-icon { color: var(--success); }
.wm-toast-info .wm-toast-icon { color: var(--primary); }

.wm-toast-error { border-color: var(--danger); }
.wm-toast-success { border-color: var(--success); }

.wm-toast-msg { flex: 1; min-width: 0; word-wrap: break-word; }

.wm-toast-close {
    all: unset;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.wm-toast-close:hover { background: var(--bg-secondary); color: var(--text); }
.wm-toast-close svg { width: 15px; height: 15px; }

/* Batch progress (loading + zip building) */
.wm-batch-progress {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.wm-batch-progress-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
}
.wm-batch-progress-head i, .wm-batch-progress-head svg { color: var(--primary); }

.wm-batch-progress-track {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 999px;
    overflow: hidden;
}

.wm-batch-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* Quick Position Grid */
.wm-hint-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0 0 0.6rem;
}

.wm-position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
    aspect-ratio: 3 / 2;
    max-width: 220px;
}

.wm-position-grid .position-btn {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    position: relative;
    transition: border-color 0.15s ease, background 0.15s ease;
    min-height: 34px;
}

.wm-position-grid .position-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    transform: translate(-50%, -50%);
    transition: background 0.15s ease, transform 0.15s ease;
}

.wm-position-grid .position-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.wm-position-grid .position-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
}
.wm-position-grid .position-btn.active::after {
    background: var(--primary);
    transform: translate(-50%, -50%) scale(1.35);
}

/* Color swatches */
.wm-swatches {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.45rem;
}

.wm-swatches .wm-swatch {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    transition: transform 0.12s ease, border-color 0.12s ease;
}
.wm-swatches .wm-swatch:hover {
    transform: scale(1.12);
    border-color: var(--primary);
}

/* Output estimate */
.wm-estimate {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.5rem 0.65rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
}
.wm-estimate i, .wm-estimate svg { color: var(--success); flex-shrink: 0; }

/* Sleeker polish */
.btn { transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.btn-primary:not(:disabled):hover,
.btn-success:not(:disabled):hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active:not(:disabled) { transform: translateY(0); }

.preview-wrapper canvas {
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.upload-area {
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.upload-area:hover { transform: translateY(-1px); }

@media (max-width: 600px) {
    .wm-toast-stack { left: 1rem; right: 1rem; max-width: none; }
    .wm-position-grid { max-width: 100%; }
}

/* ==========================================================
   APPROVED SETTINGS-PANEL PATTERN
   ----------------------------------------------------------
   Progressive disclosure: presets, then the mode tabs, then
   the ONE main setting fully expanded, then every secondary
   setting as a collapsed one-line row carrying its current
   value. Matches the Image Resizer.
   ========================================================== */

[hidden] { display: none !important; }

/* ── Layout stability ─────────────────────────────────────
   "1fr" is minmax(auto, 1fr), so the preview column could not
   shrink below its content's min-content width. The grid then
   overflowed and .tool-main's overflow:hidden clipped the right
   edge of the sidebar - the reported clipping. */
.editor-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
}

.preview-column,
.settings-sidebar {
    min-width: 0;
}

.settings-sidebar {
    overflow: hidden;
}

/* A classic (non-overlay) scrollbar must not steal content width */
.settings-scroll {
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.preview-header {
    flex-wrap: wrap;
}

.preview-header .drag-hint,
.preview-header .keyboard-hint {
    min-width: 0;
}

.sidebar-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.sidebar-title svg,
.sidebar-title i {
    color: var(--primary);
}

/* ── Option block card (the main setting) ───────────────── */
.opt-block {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.9rem;
    margin: 0 0.75rem 0.75rem;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.opt-block .panel-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.opt-block .control-group {
    min-width: 0;
}

/* ── Watermark type: mode tabs ──────────────────────────── */
.wm-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0.75rem;
}

.wm-mode-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.7rem 0.5rem;
    min-height: 64px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wm-mode-tab input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.wm-mode-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.wm-mode-tab svg,
.wm-mode-tab i {
    flex-shrink: 0;
}

.wm-mode-tab.active {
    border-color: var(--primary);
    border-width: 2px;
    background: var(--selected-bg);
    color: var(--primary);
    padding: calc(0.7rem - 1px) calc(0.5rem - 1px);
}

/* ── Secondary settings: one-line collapsible rows ─────── */
.adv-options {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin: 0 0.75rem 0.75rem;
    overflow: hidden;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.adv-row + .adv-row {
    border-top: 1px solid var(--border);
}

.adv-row-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    min-height: 52px;
    padding: 0.6rem 0.75rem;
    background: none;
    border: none;
    text-align: left;
    font: inherit;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.adv-row-head:hover {
    background: var(--bg-secondary);
}

.adv-row-head:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.adv-row.open .adv-row-head {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.adv-row-left,
.adv-row-right {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.adv-row-left {
    flex: 1 1 auto;
}

.adv-row-right {
    flex-shrink: 0;
    gap: 0.45rem;
}

.adv-row-left svg,
.adv-row-left i,
.adv-toggle svg,
.adv-toggle i {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.adv-row-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    text-align: left;
}

.adv-row-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: normal;
}

.adv-row-hint {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--text-muted);
    transition: color var(--transition-speed);
}

.adv-value {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--selected-bg);
    border-radius: var(--radius-sm);
    padding: 0.15rem 0.45rem;
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adv-chevron {
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.adv-row.open .adv-chevron {
    transform: rotate(180deg);
}

.adv-row-body {
    padding: 0.8rem 0.75rem;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: advReveal 0.18s ease;
}

@keyframes advReveal {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Switch rows inside a body ──────────────────────────── */
.wm-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.adv-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    min-width: 0;
    flex: 1 1 auto;
}

.switch-state {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
    min-width: 22px;
    text-align: right;
    transition: color var(--transition-speed);
}

.switch-state.is-on {
    color: var(--primary);
}

/* ----------------------------------------------------------
   styles/custom_styles.css forces every checkbox inside
   .tool-container to 20x20 with a 2px border and injects a
   "✓" via :checked:after. That block out-specifies a plain
   .adv-switch rule, so the pill rendered as a ticked square.
   Per the note in that file, win with the prefix selector
   plus !important.
   ---------------------------------------------------------- */
.tool-container input[type="checkbox"].adv-switch,
input[type="checkbox"].adv-switch {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    position: relative !important;
    display: inline-block !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 22px !important;
    min-height: 22px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--switch-off-border) !important;
    border-radius: var(--radius-full) !important;
    background: var(--switch-off-bg) !important;
    background-color: var(--switch-off-bg) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    outline: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

.tool-container input[type="checkbox"].adv-switch:hover,
input[type="checkbox"].adv-switch:hover {
    border-color: var(--primary) !important;
}

.tool-container input[type="checkbox"].adv-switch:checked,
input[type="checkbox"].adv-switch:checked {
    background: var(--primary) !important;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: none !important;
}

.tool-container input[type="checkbox"].adv-switch::after,
.tool-container input[type="checkbox"].adv-switch:checked::after,
input[type="checkbox"].adv-switch::after,
input[type="checkbox"].adv-switch:checked::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    right: auto !important;
    bottom: auto !important;
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0 !important;
    border-radius: 50% !important;
    border: 1px solid var(--switch-knob-border) !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
    transform: none !important;
    transition: transform 0.2s ease !important;
}

.tool-container input[type="checkbox"].adv-switch:checked::after,
input[type="checkbox"].adv-switch:checked::after {
    transform: translateX(18px) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.tool-container input[type="checkbox"].adv-switch:focus-visible,
input[type="checkbox"].adv-switch:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* ── Presets ────────────────────────────────────────────── */
.preset-bar {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.75rem;
    margin: 0.75rem 0.75rem 0;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.preset-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.preset-bar-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.preset-bar-label svg,
.preset-bar-label i {
    color: var(--primary);
}

.preset-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-save-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-chip > span:not(.preset-chip-icon):not(.preset-chip-remove) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.preset-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.preset-chip.active .preset-chip-icon,
.preset-chip.active .preset-chip-remove {
    color: rgba(255, 255, 255, 0.85);
}

.preset-chip-icon {
    color: var(--primary);
    flex-shrink: 0;
    display: inline-flex;
}

.preset-chip-icon svg,
.preset-chip-icon i {
    width: 12px !important;
    height: 12px !important;
    display: block;
}

.preset-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.preset-chip-remove:hover {
    color: var(--danger);
}

.preset-chip-remove svg,
.preset-chip-remove i {
    width: 11px !important;
    height: 11px !important;
    display: block;
}

/* ── Grouped sub-block inside the main setting ─────────── */
.wm-subgroup {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.wm-subgroup-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.wm-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.wm-check-row .color-input-wrapper {
    flex-shrink: 0;
}

/* ── Component fixes so nothing overflows 360px ─────────── */
.control-row-2col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-row-2col > .control-group,
.select-input,
.text-input {
    min-width: 0;
    max-width: 100%;
}

.wm-format-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.3rem;
}

.wm-format-grid .format-btn {
    padding: 0.45rem 0.15rem;
    font-size: 0.62rem;
}

.wm-position-grid {
    max-width: 100%;
}

.resize-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
}

@media (max-width: 900px) {
    .editor-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.wm-swatches .wm-swatch.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--selected-bg);
}

/* In dark mode --border equals --bg-secondary, so a range track sitting on a
   bg-secondary surface (the Legibility sub-block, the row bodies) vanished.
   Use the switch track colour, which contrasts with both surfaces. */
.range-input {
    background: var(--switch-off-bg);
}

/* ==========================================================
   PER-IMAGE OVERRIDE, GUARD, MULTI-LINE TEXT
   ========================================================== */

.override-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    margin: 0 0.75rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.override-row.is-custom {
    border-color: var(--primary);
    background: var(--selected-bg);
}

.override-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.22rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.override-copy-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Badge on a batch thumbnail that carries its own settings */
.batch-file-item {
    position: relative;
}

.batch-thumb-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 4px;
    background: var(--primary);
    color: #ffffff;
    z-index: 2;
    pointer-events: none;
}

.batch-thumb-badge svg,
.batch-thumb-badge i {
    width: 10px !important;
    height: 10px !important;
}

/* Legibility guard */
.wm-guard {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0 0.75rem 0.75rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    font-size: 0.75rem;
    line-height: 1.45;
}

.wm-guard-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.wm-guard-text strong {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
}

.wm-guard-text span {
    color: var(--text-secondary);
}

.wm-guard-icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: var(--text-muted);
}

.wm-guard.level-notice {
    border-color: var(--primary);
    background: var(--selected-bg);
}

.wm-guard.level-notice .wm-guard-icon {
    color: var(--primary);
}

.wm-guard.level-warning {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.wm-guard.level-warning .wm-guard-icon,
.wm-guard.level-warning .wm-guard-text strong {
    color: var(--warning);
}

/* Multi-line watermark text */
.wm-textarea {
    min-height: 58px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
}

.wm-inline-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Presets and Text style are standalone collapsible cards */
.opt-block.opt-collapsible {
    padding: 0;
    overflow: hidden;
}

.opt-block.opt-collapsible .adv-row-head {
    min-height: 52px;
}

.opt-block.opt-collapsible.open .adv-row-head {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

#presetPanel .preset-save-btn {
    width: 100%;
    justify-content: center;
}

/* The text card now holds only the text itself */
#textSettingsPanel .panel-content > .control-group:only-child {
    margin: 0;
}

/* ==========================================================
   TARGET FILE SIZE
   ========================================================== */

.target-size-options {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.7rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.target-size-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 0.4rem;
}

.target-size-input {
    min-width: 0;
    text-align: center;
    font-weight: 600;
}

.target-size-unit {
    min-width: 0;
}

.target-size-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
}

.target-btn {
    padding: 0.35rem 0.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.target-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.target-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

/* The measured size is exact now, so flag when a target could not be met */
.wm-estimate.is-over-target {
    color: var(--warning);
}

.wm-estimate.is-over-target svg,
.wm-estimate.is-over-target i {
    color: var(--warning);
}

/* ==========================================================
   CUSTOM OUTPUT RESOLUTION
   ========================================================== */

.resize-custom {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-top: 0.6rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.resize-custom-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.resize-dim-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    align-items: end;
    gap: 0.35rem;
}

.resize-dim {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.resize-dim-input {
    min-width: 0;
    text-align: center;
    font-weight: 600;
    padding: 0.45rem 0.3rem;
}

.aspect-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.aspect-lock:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.aspect-lock.is-locked {
    background: var(--selected-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.resize-info {
    font-variant-numeric: tabular-nums;
}
