/*
 * Watermark Studio Pro: the tool's own components, styled in the site's design language (6 Oct 2026, on the UltraCompress
 * Pro template, the fifth of the twelve older tools brought onto it). 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 the
 * drop zone, the four stat tiles, the photo queue, the canvas card with its toolbar and grid, the settings card with its
 * five tab pills and forms (type toggle, sliders, colour pairs, position grid, checks, presets, quick templates, export
 * buttons), the loading overlay, the toasts and the information sections. The original's Tailwind runtime, Google Fonts
 * import, glass panels, dark header, own theme (watermark-maker-theme, body.light-mode) and own footer are gone: the
 * site's toggle owns the theme and the shared footer carries the links. The script toggles `active` and `hidden` only
 * (script.js was changed to match); every id it reads keeps its name.
 */

/* ----- Tokens the tool adds ----- */
:root {
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --ring: rgba(139, 92, 246, 0.18);
    --app-max: 1600px;
    --stage: #e9e7f3;
}
:root:not([data-theme="light"]) {
    --surface: #14141f;
    --surface-2: rgba(255, 255, 255, 0.05);
    --stage: #0d0d16;
}

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

/* ----- The site header is the first thing on the page and stays at the top (11 Oct 2026: the Tools bar above it was removed;
   the header's own Tools link leads to the same page) ----- */
body { padding-top: 0; }
body > header { position: sticky; top: 0; z-index: 50; }
header .site-nav { position: relative; top: auto; }
.theme-toggle { top: 90px; }
@media (max-width: 639.98px) { .theme-toggle { top: 75px; } } /* the header is 81 px tall from 640 px, 65 px below */

.hidden { display: none !important; }

/* ----- 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, background 0.2s ease;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.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-danger { background: var(--surface); color: var(--danger); border: 1px solid rgba(185, 28, 28, 0.35); padding: 11px 23px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-strong); color: #fff; border-color: transparent; transform: translateY(-2px); }
.btn-sm { font-size: 0.85rem; padding: 9px 16px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-secondary.btn-sm, .btn-danger.btn-sm { padding: 8px 15px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--danger); }

/* ----- The app ----- */
.app-shell { margin: 0 0 3rem; scroll-margin-top: 90px; }
.card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    box-shadow: var(--surface-shadow);
    overflow: hidden;
}
.card-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; }
.card-title { margin: 0; font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--text-strong); }

/* Drop zone: the site's look, full width */
.drop-zone {
    border: 2px dashed var(--field-border);
    border-radius: 16px;
    padding: 52px 24px;
    text-align: center;
    cursor: pointer;
    background: var(--surface);
    box-shadow: var(--surface-shadow);
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.drop-zone:hover, .drop-zone.dragover, .drop-zone:focus-visible { border-color: var(--brand); background: var(--tint-brand); transform: translateY(-2px); box-shadow: var(--surface-hover-shadow); outline: none; }
.drop-icon { width: 80px; height: 80px; margin: 0 auto 18px; border-radius: 50%; background: var(--gradient-brand); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 25px rgba(139, 92, 246, 0.35); transition: transform 0.25s ease; }
.drop-icon svg { width: 36px; height: 36px; }
.drop-zone:hover .drop-icon, .drop-zone.dragover .drop-icon { transform: scale(1.1); }
.drop-zone h2 { font-size: 1.35rem; margin: 0 0 6px; }
.drop-zone p { margin: 0 0 14px; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chips span { padding: 4px 12px; border-radius: 9999px; background: var(--chip); border: 1px solid var(--chip-border); color: var(--text-2); font-size: 0.75rem; font-weight: 600; }

/* Stat tiles */
.stats-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 20px; }
.stat-card { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--surface-border); box-shadow: var(--surface-shadow); }
.stat-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.stat-value { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--text-strong); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Photo queue */
.queue-card { margin: 0 0 20px; }
.image-list { display: flex; gap: 10px; overflow-x: auto; padding: 14px 20px 16px; }
.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.queue-item:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--surface-hover-shadow); }
.queue-item.active { border-color: var(--brand); background: var(--tint-brand); box-shadow: 0 0 0 3px var(--ring); }
.queue-thumb { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex-shrink: 0; }
.queue-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.queue-info { min-width: 0; max-width: 160px; }
.queue-name { font-size: 0.85rem; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-size { font-size: 0.75rem; color: var(--text-3); }
.queue-status { color: var(--text-3); display: flex; }
.queue-status.done { color: var(--success); }
.queue-status svg { width: 18px; height: 18px; }
.queue-remove { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--chip-border); background: var(--chip); color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color 0.2s ease, color 0.2s ease; flex-shrink: 0; }
.queue-remove svg { width: 14px; height: 14px; }
.queue-remove:hover { border-color: var(--danger); color: var(--danger); }

/* Two columns: the canvas and the settings */
.app-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.canvas-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--surface-border); }
.tool-group { display: flex; align-items: center; gap: 4px; }
.tool-sep { width: 1px; height: 22px; background: var(--surface-border); margin: 0 6px; }
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--chip-border);
    background: var(--chip);
    color: var(--text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { border-color: var(--brand); color: var(--link); transform: translateY(-1px); }
.canvas-meta { display: flex; gap: 12px; font-size: 0.8rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.canvas-stage { position: relative; background: var(--stage); min-height: 480px; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 16px; }
#mainCanvas { max-width: 100%; height: auto; display: block; margin: 0 auto; box-shadow: 0 10px 30px rgba(20, 20, 60, 0.18); }
.grid-overlay { position: absolute; inset: 0; pointer-events: none; }

.controls-card { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow-y: auto; }
.tabs { display: flex; gap: 4px; padding: 14px 16px 0; overflow-x: auto; }
.tab-btn {
    flex: 1 0 auto;
    padding: 9px 14px;
    border: 0;
    border-radius: 9999px;
    background: var(--surface-2);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.tab-btn:hover { color: var(--link); }
.tab-btn.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
.tab-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tab-content { padding: 14px 20px 20px; }
.tab-head { display: flex; justify-content: flex-end; margin-bottom: 8px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-group { min-width: 0; }
.span-2 { grid-column: 1 / -1; }
.form-label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; color: var(--text-strong); }
.form-label--sub { margin-top: 12px; }
.label-hint { font-weight: 500; color: var(--text-3); }
.range-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.range-label.small { margin-top: 8px; font-size: 0.8rem; }
.range-value { font-weight: 700; color: var(--link); font-variant-numeric: tabular-nums; }
.form-input {
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    background: var(--field);
    border: 1px solid var(--field-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input::placeholder { color: var(--placeholder); }
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
select.form-input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; cursor: pointer; }
select.form-input option { color: #0a0a14; background: #fff; }
.form-hint { font-size: 0.78rem; color: var(--text-3); margin: 8px 0 0; }
.range-input { width: 100%; appearance: none; -webkit-appearance: none; height: 8px; border-radius: 4px; background: var(--surface-2); outline: none; margin: 6px 0 2px; cursor: pointer; }
.range-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid #8B5CF6; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); cursor: pointer; transition: transform 0.15s ease; }
.range-input::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid #8B5CF6; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); cursor: pointer; }
.range-input::-webkit-slider-thumb:hover { transform: scale(1.1); }
.range-input:focus-visible { box-shadow: 0 0 0 3px var(--ring); }
.color-pair { display: flex; align-items: center; gap: 8px; }
.color-input { width: 44px; height: 42px; padding: 0; border: 1px solid var(--field-border); border-radius: 12px; background: var(--field); cursor: pointer; flex-shrink: 0; }
.color-input::-webkit-color-swatch-wrapper { padding: 4px; }
.color-input::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color-input::-moz-color-swatch { border: 0; border-radius: 8px; }
.color-hex { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; text-transform: lowercase; }
.size-pair { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.row-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.type-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.type-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--chip-border);
    border-radius: 12px;
    background: var(--chip);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.type-btn svg { width: 18px; height: 18px; }
.type-btn:hover { border-color: var(--brand); color: var(--link); }
.type-btn.active { background: var(--tint-brand); border-color: var(--brand); color: var(--link); box-shadow: 0 0 0 3px var(--ring); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.check-grid .check-item { margin-bottom: 0; }
.custom-checkbox { appearance: auto; width: 18px; height: 18px; accent-color: #8B5CF6; margin: 0; cursor: pointer; flex-shrink: 0; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.preset-btn {
    padding: 7px 14px;
    border: 1px solid var(--chip-border);
    border-radius: 9999px;
    background: var(--chip);
    color: var(--text-2);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.preset-btn:hover { border-color: var(--brand); color: var(--link); }
.custom-preset { position: relative; }
.custom-preset .preset-btn { background: var(--tint-brand); border-color: var(--tint-brand-border); color: var(--link); }
.preset-delete { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--danger-strong); color: #fff; font-size: 0.8rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s ease; }
.custom-preset:hover .preset-delete, .preset-delete:focus-visible { opacity: 1; }
.sub-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--surface-border); }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    border: 1px solid var(--chip-border);
    border-radius: 12px;
    background: var(--chip);
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.quick-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--surface-hover-shadow); }
.quick-icon { font-size: 1.3rem; line-height: 1; margin-bottom: 4px; color: var(--link); font-weight: 700; }
.quick-name { font-size: 0.8rem; font-weight: 700; color: var(--text-strong); }
.quick-sub { font-size: 0.7rem; color: var(--text-3); }
.pos-grid { display: grid; grid-template-columns: repeat(3, 44px); gap: 6px; }
.pos-btn { position: relative; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--chip-border); background: var(--chip); cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.pos-btn i { position: absolute; width: 12px; height: 12px; border-radius: 3px; background: var(--text-3); }
.pos-btn:hover { border-color: var(--brand); }
.pos-btn.active { border-color: var(--brand); background: var(--tint-brand); box-shadow: 0 0 0 3px var(--ring); }
.pos-btn.active i { background: var(--brand); }
.pos-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.export-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.export-actions .btn { flex: 1 1 auto; }

/* ----- Loading overlay and toasts ----- */
.loading-overlay { position: fixed; inset: 0; background: rgba(10, 10, 20, 0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.loading-box { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 20px; padding: 28px 32px; text-align: center; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); min-width: 240px; }
.loading-spinner { width: 48px; height: 48px; margin: 0 auto 14px; border: 4px solid var(--surface-2); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin: 0; font-weight: 700; color: var(--text-strong); }
.loading-subtext { margin: 4px 0 0; font-size: 0.85rem; color: var(--text-3); }
.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;
}
.toast-icon { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: rgba(255, 255, 255, 0.12); }
.toast-icon svg { width: 18px; height: 18px; }
.toast.success { border-left-color: #4ade80; }
.toast.error { border-left-color: #f87171; }
.toast.warning { border-left-color: #fbbf24; }
.toast.info { border-left-color: #38bdf8; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ----- 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; color: var(--text-2); }
.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; }
.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 phones ----- */
@media (max-width: 1023px) {
    .app-layout { grid-template-columns: 1fr; }
    .controls-card { position: static; max-height: none; }
    .stats-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-section .info-grid, .info-three { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 639px) {
    .app-hero { margin-bottom: 1.5rem; }
    .app-tagline { font-size: 1rem; }
    .drop-zone { padding: 36px 16px; }
    .drop-zone h2 { font-size: 1.15rem; }
    .card-header { padding-left: 16px; padding-right: 16px; }
    .image-list { padding: 12px 16px 14px; }
    .canvas-stage { min-height: 320px; padding: 10px; }
    .tabs { padding: 12px 12px 0; }
    .tab-btn { padding: 8px 10px; font-size: 0.8rem; }
    .tab-content { padding: 12px 16px 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .export-actions .btn { flex: 1 1 100%; }
    .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, .info-card, .drop-zone, .drop-icon, .queue-item, .quick-card, .icon-btn, .toast { transition: none; animation: none; }
}
@media print {
    body > header, .theme-toggle, .app-hero, .info-section, footer, .loading-overlay, .toast-container, .controls-card, .queue-card, .canvas-toolbar, .stats-bar { display: none !important; }
    .app-layout { display: block; }
}

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