/*
 * SocialSizer: the tool's own components, styled in the site's design language (6 Oct 2026, on the UltraCompress Pro
 * template, after CertificateMaker). Base: /libs/site-pages.css (tokens, Inter and Space Grotesk, buttons, theme toggle,
 * focus rings) and /libs/shared-nav.css (the site's header and footer). This file holds only what the tool itself needs:
 * the toolbar, the three panels (platform sizes, preview, export settings), the preset list, the drop zone, the preview
 * canvas with its safe-zone overlay and zoom controls, the thumbnails of a batch, the sliders, format buttons, switches,
 * the selected-size list, the shortcuts window, the progress window and the toasts. Light is the default; dark applies
 * when <html> has no data-theme. Every class and id the script touches keeps its name.
 */

/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;                 /* cards are true white in the light theme */
    --surface-2: #f3f4f8;               /* a quiet inset inside a card */
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
}

/* ----- Page: full width, the page provides the side space ----- */
.container.app-container {
    max-width: calc(var(--app-max) + 2 * var(--content-gutter));
    margin-top: 16px;
}
@media (min-width: 640px) { .container.app-container { margin-top: 24px; } }

/* ----- Tools back link above the header, as on every other tool: the bar scrolls away under the sticky header ----- */
body { padding-top: 0; }
.back-bar { height: 48px; display: flex; align-items: center; padding: 0 var(--zdu-gutter, 24px); }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: calc(90px + var(--bar-offset, 48px)); }
@media (max-width: 768px) { .theme-toggle { top: calc(75px + var(--bar-offset, 48px)); } }

/* ----- Hero: brand row, headline, tagline ----- */
.app-hero { margin: 0 0 2rem; text-align: center; }
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.25rem;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-strong);
}
.app-brand img { width: 44px; height: 44px; border-radius: 12px; display: block; }
.app-hero h1 { margin-bottom: 0.75rem; }
.app-tagline { color: var(--text-2); font-size: 1.125rem; line-height: 1.6; max-width: 46rem; margin: 0 auto; }

/* ----- Buttons: the site's pills in the tool's sizes ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 9999px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    padding: 12px 24px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text-strong); border: 1px solid var(--surface-border); padding: 11px 23px; }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--link); transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-secondary.btn-sm { padding: 8px 15px; }

/* ----- The app: the toolbar above the three panels ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.app-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin: 0 0 1.25rem; }
.app-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ----- The three panels ----- */
.main-content { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr) minmax(0, 320px); gap: 20px; align-items: start; }
.panel {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--surface-shadow);
    overflow: hidden;
}
.panel-header { padding: 14px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.panel-note { font-size: 0.8125rem; color: var(--text-3); }
.panel-content { padding: 16px 20px 20px; }
.presets-panel, .settings-panel { position: sticky; top: 100px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.presets-panel .panel-content, .settings-panel .panel-content { overflow-y: auto; flex: 1; }
.preview-panel { display: flex; flex-direction: column; min-height: 560px; }

/* Preset list */
.preset-category { margin-bottom: 1.25rem; }
.preset-category:last-child { margin-bottom: 0; }
.preset-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}
.preset-category-icon { font-size: 1rem; line-height: 1; }
.preset-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 6px;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.preset-item:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--surface-hover-shadow); }
.preset-item.active { border-color: var(--brand); background: var(--tint-brand); box-shadow: 0 0 0 3px var(--ring); }
.preset-checkbox { width: 18px; height: 18px; flex-shrink: 0; margin: 0; accent-color: var(--brand); cursor: pointer; }
.preset-info { display: flex; flex-direction: column; min-width: 0; }
.preset-name { font-size: 0.875rem; font-weight: 600; color: var(--text-strong); }
.preset-size { font-size: 0.75rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.custom-size-section, .recent-presets { padding-top: 1rem; border-top: 1px solid var(--surface-border); }
.custom-size-inputs { display: flex; gap: 8px; align-items: center; }
.size-input, .color-input {
    width: 100%;
    min-width: 0;
    padding: 9px 12px;
    background: var(--field);
    border: 1px solid var(--field-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.size-input { text-align: center; }
.size-input::placeholder, .color-input::placeholder { color: var(--placeholder); }
.size-input:focus, .color-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.size-input.input-error { border-color: var(--danger); animation: shake 0.4s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.size-separator { color: var(--text-3); font-weight: 600; }
.add-custom-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border: 2px dashed rgba(139, 92, 246, 0.45);
    border-radius: 12px;
    background: transparent;
    color: var(--text-2);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.add-custom-btn:hover { border-color: var(--brand); color: var(--link); background: var(--tint-brand); }
.recent-preset-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-2);
    font-family: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.recent-preset-item:hover { background: var(--surface-2); color: var(--text-strong); border-color: var(--surface-border); }
.empty-note { margin: 0; padding: 6px 2px; font-size: 0.8125rem; color: var(--text-3); }

/* Drop zone: the site's drop zone (tint, lift, the icon grows) */
.file-upload, .upload-zone {
    border: 2px dashed rgba(139, 92, 246, 0.45);
    border-radius: 14px;
    padding: 36px 20px;
    margin: 20px;
    flex: 1;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    background: var(--surface-2);
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.upload-zone.hidden { display: none; }
.hidden-input { display: none; }
.file-upload:hover, .file-upload.dragover, .upload-zone.drag-over { border-color: var(--brand); background: var(--tint-brand); transform: translateY(-2px); box-shadow: var(--surface-hover-shadow); }
.file-upload:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.file-upload-icon {
    width: 72px;
    height: 72px;
    padding: 18px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    display: block;
    transition: transform 0.25s ease;
}
.file-upload:hover .file-upload-icon, .file-upload.dragover .file-upload-icon, .upload-zone.drag-over .file-upload-icon { transform: scale(1.1); }
.upload-title { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--text-strong); margin-bottom: 6px; }
.file-upload-text { font-size: 0.95rem; color: var(--text-2); }
.file-upload-text span { color: var(--link); font-weight: 600; }
.file-upload-hint { font-size: 0.8rem; color: var(--text-3); margin-top: 8px; }

/* Preview */
.preview-container { display: none; flex: 1; padding: 20px; flex-direction: column; gap: 14px; }
.preview-container.active { display: flex; }
.preview-canvas-wrapper {
    flex: 1;
    position: relative;
    min-height: 420px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-2);
    background-image: linear-gradient(45deg, rgba(128, 128, 128, 0.12) 25%, transparent 25%), linear-gradient(-45deg, rgba(128, 128, 128, 0.12) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(128, 128, 128, 0.12) 75%), linear-gradient(-45deg, transparent 75%, rgba(128, 128, 128, 0.12) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
.preview-canvas { display: block; cursor: grab; flex-shrink: 0; }
.preview-canvas.grabbing { cursor: grabbing; }
.safe-zone-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: 2px dashed rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4000px rgba(10, 10, 20, 0.45);
}
.safe-zone-overlay[hidden] { display: none; }
.safe-zone-label {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-brand);
    color: #fff;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.safe-zone-inner { position: absolute; border: 1px dashed rgba(74, 222, 128, 0.95); pointer-events: none; }
.safe-zone-inner::after {
    content: 'Safe zone';
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    color: #4ade80;
    background: rgba(10, 10, 20, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
}
.preview-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.zoom-controls { display: flex; align-items: center; gap: 8px; }
.zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--chip-border);
    background: var(--chip);
    color: var(--text-strong);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.zoom-btn:hover { border-color: var(--brand); color: var(--link); }
.zoom-slider, .quality-slider { accent-color: var(--brand); cursor: pointer; }
.zoom-slider { width: 130px; }
.zoom-value { font-size: 0.875rem; color: var(--text-2); min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.preview-actions { display: flex; gap: 8px; }
.batch-section { padding-top: 14px; border-top: 1px solid var(--surface-border); }
.batch-section[hidden] { display: none; }
.batch-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.batch-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--surface-border);
    background: var(--surface-2);
    padding: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.batch-image-item:hover { border-color: var(--brand); transform: translateY(-2px); }
.batch-image-item.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.batch-image-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.batch-image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(185, 28, 28, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.batch-image-item:hover .batch-image-remove, .batch-image-item:focus-within .batch-image-remove { opacity: 1; }
.batch-add-btn {
    aspect-ratio: 1;
    border: 2px dashed rgba(139, 92, 246, 0.45);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-3);
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.batch-add-btn:hover { border-color: var(--brand); color: var(--link); background: var(--tint-brand); }

/* Settings */
.settings-section { display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--surface-border); }
.settings-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.settings-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--text-strong); }
.settings-label label { font: inherit; color: inherit; }
.settings-value { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.form-hint { font-size: 0.78rem; color: var(--text-3); font-weight: 400; }
.quality-slider { width: 100%; }
.quality-marks { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-3); }
.format-options { display: flex; gap: 8px; }
.format-option {
    flex: 1;
    padding: 9px 8px;
    border: 1px solid var(--chip-border);
    border-radius: 9999px;
    background: var(--chip);
    color: var(--text-2);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.format-option:hover { border-color: var(--brand); color: var(--link); }
.format-option.active { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.bg-color-container { display: flex; align-items: center; gap: 8px; }
.color-picker { width: 42px; height: 42px; flex-shrink: 0; padding: 2px; border: 1px solid var(--surface-border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker::-webkit-color-swatch { border: none; border-radius: 7px; }
.color-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.toggle-container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-label--inline { margin: 0; }
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 13px;
    border: 1px solid var(--field-border);
    background: var(--field);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}
.toggle-switch.active { background: var(--gradient-brand); border-color: transparent; }
.toggle-switch.active::after { transform: translateX(22px); }
.selected-presets { display: flex; flex-direction: column; gap: 6px; }
.selected-preset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--text);
}
.selected-preset-info { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.selected-preset-icon { font-size: 0.95rem; }
.remove-preset-btn {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(185, 28, 28, 0.3);
    background: rgba(185, 28, 28, 0.08);
    color: var(--danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}
.remove-preset-btn:hover { background: var(--danger-strong); color: #fff; }

/* ----- Windows (shortcuts, progress) ----- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(12px);
    transition: transform 0.25s ease;
}
.modal--narrow { max-width: 380px; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 18px 20px; border-bottom: 1px solid var(--surface-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { margin: 0; font-size: 1.15rem; }
.modal-close {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--chip-border);
    background: var(--chip);
    color: var(--text-strong);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.modal-close:hover { border-color: var(--brand); color: var(--link); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.modal-hint { margin: 0; }
.shortcuts-list { display: grid; gap: 10px; }
.shortcut-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shortcut-keys { display: flex; gap: 4px; }
.shortcut-key {
    background: var(--surface-2);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    color: var(--text-2);
}
.shortcut-description { font-size: 0.875rem; color: var(--text-2); }
.progress-container .modal-body { text-align: center; }
.progress-bar-container { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--gradient-brand); transition: width 0.15s ease; }
.progress-text { margin: 0; font-size: 0.875rem; color: var(--text-2); }

/* ----- Toasts ----- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); }
.toast {
    background: #0a0a14;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 4px solid var(--brand);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    min-width: 260px;
    max-width: 400px;
    font-size: 0.875rem;
    font-weight: 500;
    overflow-wrap: anywhere;
    animation: slideIn 0.3s ease;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left-color: #4ade80; }
.toast.error { border-left-color: #f87171; }
.toast.warning { border-left-color: #fbbf24; }
.toast.info { border-left-color: #38bdf8; }
.hidden { display: none !important; }

/* ----- Information sections below the tool ----- */
.info-section { margin: 0 0 2.5rem; }
.info-section h2 { font-size: 1.75rem; margin: 0 0 1.25rem; }
.info-section > p { max-width: 70ch; }
/* Three columns on desktops, two on tablets, one on phones: six cards fill two rows without a gap. */
.info-section .info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 1rem 0 1.5rem; }
.info-stack { display: grid; gap: 12px; }
.info-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    box-shadow: var(--surface-shadow);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.info-card:hover { transform: translateY(-4px); box-shadow: var(--surface-hover-shadow); }
.info-card--small { padding: 16px; box-shadow: none; }
.info-card h3 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.info-card p { color: var(--text-2); margin-bottom: 0.75rem; }
.info-card p:last-child { margin-bottom: 0; }
.info-section article:not(.info-card) p { color: var(--text-2); max-width: 70ch; }
.step-card { position: relative; padding-top: 24px; }
.step-num {
    position: absolute;
    top: -16px;
    left: 20px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 0.75rem; }
.step-head h3 { margin: 0; }
.step-emoji { font-size: 1.6rem; line-height: 1; }
.info-section details.info-card { padding: 0; }
.info-section details.info-card summary {
    cursor: pointer;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-strong);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.info-section details.info-card summary::-webkit-details-marker { display: none; }
.info-section details.info-card summary::after { content: '+'; color: var(--link); font-weight: 700; font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.info-section details.info-card[open] summary::after { content: '\2212'; }
.info-section details.info-card p { padding: 0 20px 16px; margin: 0; color: var(--text-2); }

/* ----- Tablets and small desktops: the preview across the top, the two lists beneath ----- */
@media (max-width: 1199px) {
    .main-content { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .preview-panel { grid-column: 1 / -1; order: -1; }
    .presets-panel, .settings-panel { position: static; max-height: none; }
    .presets-panel .panel-content { max-height: 560px; }
}
@media (max-width: 1023px) {
    .info-section .info-grid, .info-three { grid-template-columns: repeat(2, 1fr); }
}

/* ----- Phones ----- */
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .app-toolbar { gap: 10px; }
    .app-actions { width: 100%; }
    .app-actions .btn { flex: 1 1 auto; padding-left: 12px; padding-right: 12px; }
    .main-content { grid-template-columns: 1fr; }
    .panel-header { padding-left: 16px; padding-right: 16px; }
    .panel-content { padding: 14px 16px 16px; }
    .preview-panel { min-height: 0; }
    .upload-zone { margin: 16px; min-height: 300px; padding: 28px 16px; }
    .preview-container { padding: 16px; }
    .preview-canvas-wrapper { min-height: 300px; }
    .preview-controls { flex-direction: column; align-items: stretch; }
    .zoom-controls { justify-content: center; }
    .zoom-slider { flex: 1; }
    .preview-actions { justify-content: center; }
    .modal-overlay { padding: 8px; }
    .modal-body, .modal-header { padding-left: 16px; padding-right: 16px; }
    .toast-container { bottom: 16px; right: 16px; left: 16px; align-items: flex-end; }
    .toast { min-width: 0; }
    .info-section h2 { font-size: 1.4rem; }
    .info-section .info-grid, .info-three { grid-template-columns: 1fr; }
    .info-card { padding: 16px; }
    .step-num { left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .file-upload, .upload-zone, .file-upload-icon, .preset-item, .batch-image-item, .info-card, .modal, .toast { transition: none; animation: none; }
}

/* Phones: 16 px text, 44 px tap targets (AdSense audit H-04, 8 Oct 2026) */
@media (max-width: 639.98px) {
    main button, main select, main summary, main [role="button"],
    main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) { min-height: 44px; }
    div#recentPresetsList > p.empty-note,
    div#selectedPresets.selected-presets > p.empty-note { font-size: 1rem; }
    main input[type="color"] { min-width: 44px; }
}
