:root {
  color-scheme: light;
  --ink: #111318;
  --muted: #647084;
  --line: #d9dee7;
  --line-soft: #e8ebef;
  --accent: #ed5b3a;
  --accent-hover: #d94b2b;
  --accent-wash: #fff3ef;
  --surface: #f5f6f8;
  --radius: 7px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #fff; line-height: 1.5; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, select, summary { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-underline-offset: 3px; }
svg { display: block; flex: 0 0 auto; }
button svg, .privacy svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
button:focus-visible, a:focus-visible, summary:focus-visible, canvas:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
input:focus-visible, select:focus-visible { outline: 3px solid #ed5b3a38; outline-offset: 2px; border-color: var(--accent); }
button:disabled, fieldset:disabled button { cursor: not-allowed; }
fieldset:disabled { opacity: .65; }

.container, .header-inner { width: min(1400px, calc(100% - 64px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 750; letter-spacing: -.8px; text-decoration: none; white-space: nowrap; }
.brand svg { width: 29px; height: 29px; fill: none; stroke: var(--accent); stroke-width: 3.4; }
.header-nav { display: flex; align-items: center; gap: 24px; }
.header-nav > a { padding-left: 24px; border-left: 1px solid #cdd3dd; text-decoration: none; line-height: 20px; }
.header-nav > a:hover, .presets-note a:hover { color: var(--accent-hover); }
.privacy { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.privacy svg { width: 16px; height: 16px; }
.intro { padding-block: 20px 20px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(34px, 3.15vw, 46px); line-height: 1.14; letter-spacing: -1.8px; font-weight: 750; }
.intro p { margin-top: 8px; color: #586477; font-size: 20px; line-height: 1.4; letter-spacing: -.2px; }
.editor { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: stretch; gap: 24px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; min-width: 0; }
h2 { font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.6px; }
.settings-panel { padding: 18px 20px; }
.settings-panel > h2 { margin-bottom: 16px; }
form, fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.setting-group h3 { font-size: 15px; line-height: 20px; font-weight: 650; margin-bottom: 6px; }
.setting-group + .setting-group { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line-soft); }
.platform-row { display: flex; min-height: 30px; align-items: center; justify-content: space-between; gap: 10px; }
.platform-row > label, .radio-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { flex: 0 0 auto; width: 19px; height: 19px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.dimension-toggle { padding: 4px 0 4px 6px; color: var(--muted); background: none; border: 0; border-bottom: 1px solid transparent; font-size: 14px; white-space: nowrap; }
.dimension-toggle:hover, .dimension-toggle[aria-expanded="true"] { color: var(--accent-hover); border-bottom-color: currentColor; }
.radio-row { min-height: 30px; }
.size-inputs { display: grid; grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr); align-items: end; gap: 7px; padding: 8px 0 12px 29px; }
.size-inputs label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.size-inputs > span { padding-bottom: 8px; color: var(--muted); }
.size-inputs input { width: 100%; min-width: 0; height: 36px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; }
.focus-controls { display: grid; gap: 8px; margin-top: 9px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 5px; background: #fafbfc; }
.focus-controls > label { display: grid; gap: 4px; color: #566175; font-size: 12px; }
.focus-controls input[type="range"] { width: 100%; }
.focus-controls .text-button { justify-self: start; font-size: 12px; }
.output-options { display: grid; gap: 14px; }
.field-label { display: grid; gap: 5px; position: relative; font-size: 14px; line-height: 20px; font-weight: 600; }
.field-label > select, .field-label > input[type="text"] { width: 100%; min-width: 0; height: 38px; padding: 8px 12px; border: 1px solid #d5dce6; border-radius: 6px; color: var(--ink); background: #fff; font-weight: 400; line-height: 20px; }
.field-label > select { padding-right: 30px; }
.range-label { grid-template-columns: 1fr auto; gap: 5px 8px; }
.range-label > output { color: var(--muted); font-weight: 400; }
.range-label > input { grid-column: 1 / -1; width: 100%; }
input[type="range"] { --track-size: 6px; height: 29px; margin: 0; accent-color: var(--accent); cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: var(--track-size); border-radius: 99px; background: #dce1e7; }
input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -7px; border: 2px solid var(--accent); border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #1018281a; -webkit-appearance: none; }
input[type="range"] { -webkit-appearance: none; background: transparent; }
input[type="range"]::-moz-range-track { height: var(--track-size); border-radius: 99px; background: #dce1e7; }
input[type="range"]::-moz-range-progress { height: var(--track-size); border-radius: 99px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 2px solid var(--accent); border-radius: 50%; background: #fff; }
.color-row { display: flex; align-items: center; justify-content: space-between; color: #566175; font-size: 13px; }
input[type="color"] { width: 48px; height: 32px; border: 1px solid var(--line); border-radius: 5px; background: #fff; padding: 3px; cursor: pointer; }
.field-hint { font-size: 12px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.inline-error { color: #a12d19; background: #fff2ef; border: 1px solid #efc4bb; padding: 10px 12px; border-radius: 5px; margin-top: 14px; font-size: 13px; }

.workspace { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.images-panel { position: relative; padding: 12px 16px 10px; transition: border-color .15s ease, background-color .15s ease; }
.images-panel.dragging { border-color: var(--accent); outline: 2px solid #ed5b3a24; background: #fffaf8; }
.images-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; }
.images-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 16px; }
#image-count { color: #586477; font-size: 13px; }
.image-actions { display: flex; align-items: center; gap: 12px; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 9px; padding: 9px 15px; border: 1px solid transparent; border-radius: 7px; font-size: 14px; line-height: 22px; font-weight: 550; text-align: center; text-decoration: none; white-space: nowrap; transition: background-color .15s ease, border-color .15s ease; }
.button-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-primary:disabled { background: #f1a18e; border-color: #f1a18e; color: #fff; }
.button-primary > span { font-size: 23px; line-height: 18px; font-weight: 350; }
.button-secondary { border-color: #e0e4eb; color: #26303d; background: #f6f7f9; }
.button-secondary:hover:not(:disabled) { background: #eceff3; border-color: #cdd4df; }
.button:disabled { opacity: .68; }
.image-list { display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; padding: 13px 1px 2px; scrollbar-width: thin; scrollbar-color: #c9d0da transparent; }
.image-item { position: relative; flex: 0 0 158px; width: 158px; min-width: 0; margin: 0; text-align: center; }
.thumbnail { display: block; width: 100%; height: 118px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 6px; background: #f2f0ed; }
.thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumbnail:hover:not(.selected) { border-color: #a9b3c1; }
.thumbnail.selected, .thumbnail[aria-pressed="true"] { border-color: var(--accent); }
.image-name { display: block; margin-top: 5px; padding-inline: 1px; color: #566175; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 21px; font-weight: 400; }
.remove-image { position: absolute; top: 6px; right: 6px; display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 1px solid #d8dce2; border-radius: 50%; background: #fffffff0; color: #303a49; opacity: .12; font-size: 20px; line-height: 1; box-shadow: 0 1px 3px #10182812; transition: opacity .15s ease; }
.image-item:hover .remove-image, .image-item:focus-within .remove-image { opacity: 1; }
.remove-image:hover { border-color: #d89484; background: #fff1ed; color: #ac3520; }
.empty-state { display: grid; min-height: 136px; align-content: center; justify-items: center; gap: 5px; padding: 18px; text-align: center; }
.empty-state strong { font-size: 16px; font-weight: 600; }
.empty-state p { color: var(--muted); font-size: 13px; }
.batch-actions { min-height: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; }
.batch-actions:has(:not([hidden])) { margin-top: 2px; }
.text-button { padding: 2px 0; border: 0; border-radius: 2px; color: #626e80; background: none; font-size: 12px; line-height: 20px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--accent-hover); }
.preview-panel { display: flex; flex: 1 0 auto; min-height: 0; flex-direction: column; padding: 12px 16px 14px; }
.preview-toolbar { display: flex; align-items: center; gap: 20px; min-height: 34px; margin-bottom: 9px; }
.preview-toolbar h2 { flex: 0 0 auto; }
.preview-tabs { display: flex; min-width: 0; margin-inline: auto; overflow-x: auto; border: 1px solid #e0e5ec; border-radius: 6px; background: #f6f7f9; scrollbar-width: thin; }
.preview-tab, .preview-tabs [role="tab"] { flex: 1 0 auto; min-height: 34px; margin: -1px; padding: 6px 22px; border: 1px solid transparent; border-radius: 5px; color: #465265; background: transparent; font-size: 13px; line-height: 20px; white-space: nowrap; }
.preview-tab:hover, .preview-tabs [role="tab"]:hover { background: #eceff3; }
.preview-tab.active, .preview-tab.is-active, .preview-tabs [role="tab"][aria-selected="true"] { z-index: 1; color: var(--ink); border-color: var(--accent); background: #fff; font-weight: 550; }
.preview-stage { position: relative; display: grid; flex: 1 0 350px; min-height: 350px; height: 369px; place-items: center; overflow: hidden; border-radius: 6px; background: #e9ecef; }
#preview { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; max-width: 100%; max-height: 100%; object-fit: contain; touch-action: manipulation; }
#preview.crop-mode { cursor: crosshair; }
#preview-placeholder { position: absolute; inset: 20px; display: grid; place-items: center; color: #7b8492; font-size: 14px; text-align: center; pointer-events: none; }
.preview-caption { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 20px; }
#preview-size { margin-left: auto; text-align: right; }
.preview-panel > .field-hint { margin-top: 5px; }

.export-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; padding-block: 15px 12px; border-top: 1px solid var(--line); }
.export-summary { display: grid; gap: 1px; min-width: 0; }
.export-summary strong { font-size: 17px; line-height: 24px; font-weight: 650; letter-spacing: -.25px; }
.export-summary > span { color: var(--muted); font-size: 13px; }
.export-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.export-button { min-width: 234px; min-height: 49px; font-size: 16px; }
.export-button svg { width: 20px; height: 20px; }
.progress-area { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 4px 0 12px; color: #596577; font-size: 13px; }
progress { width: 260px; max-width: 100%; height: 7px; overflow: hidden; appearance: none; border: 0; border-radius: 99px; background: #e6e9ee; accent-color: var(--accent); }
progress::-webkit-progress-bar { border-radius: 99px; background: #e6e9ee; }
progress::-webkit-progress-value { border-radius: 99px; background: var(--accent); }
progress::-moz-progress-bar { border-radius: 99px; background: var(--accent); }
.message { margin-top: 8px; padding: 12px 14px; border: 1px solid #d6dfd8; border-radius: 6px; background: #f3f8f4; color: #36513e; font-size: 14px; overflow-wrap: anywhere; }
.message.error, .message[data-type="error"], .message[data-kind="error"] { border-color: #edc3b8; color: #9e331e; background: #fff3ef; }
.message[data-kind="info"] { border-color: #dce2e9; color: #566175; background: #f7f8fa; }
.message[data-kind="warning"] { border-color: #edd8bb; color: #785529; background: #fff9ee; }
.file-errors { padding: 11px 16px 11px 32px; margin: 9px 0 0; border: 1px solid #edd8bb; border-radius: 6px; color: #785529; background: #fff9ee; font-size: 13px; overflow-wrap: anywhere; }
.file-errors li + li { margin-top: 4px; }
.presets-note { margin-top: 9px; color: #737e90; font-size: 12px; line-height: 1.5; font-style: italic; }
.presets-note a { color: #5e697b; }
.help { margin-top: 22px; border-top: 1px solid var(--line-soft); }
.help > summary { padding: 15px 0; color: #596577; font-size: 13px; font-weight: 550; }
.help-content { max-width: 900px; padding: 0 0 16px; color: #596577; font-size: 14px; line-height: 1.7; }
.help-content h2 { margin: 6px 0 12px; font-size: 18px; color: var(--ink); }
.help-content ol { padding-left: 21px; margin: 0 0 14px; }
.help-content li + li { margin-top: 5px; }
.help-content p + p { margin-top: 12px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; padding-block: 18px 25px; border-top: 1px solid var(--line-soft); color: #707b8b; font-size: 12px; }
.site-footer > span { color: #8a93a1; }

@media (min-width: 1280px) {
  .batch-actions { position: absolute; top: 21px; right: 320px; min-height: 0; max-width: 140px; margin: 0; }
  .batch-actions:has(:not([hidden])) { margin-top: 0; }
  #batch-note:empty { display: none; }
}

@media (min-width: 1100px) and (max-height: 940px) {
  .intro { padding-block: 17px; }
  h1 { font-size: 40px; }
  .intro p { font-size: 18px; }
  .settings-panel { padding-block: 16px; }
  .settings-panel > h2 { margin-bottom: 14px; }
  .setting-group + .setting-group { margin-top: 13px; padding-top: 13px; }
  .platform-row, .radio-row { min-height: 30px; }
  .output-options { gap: 13px; }
  .field-label > select, .field-label > input[type="text"] { height: 38px; }
  .preview-stage { flex-basis: 290px; height: 315px; min-height: 290px; }
  .export-bar { margin-top: 13px; padding-block: 12px 8px; }
}

@media (max-width: 1100px) {
  .container, .header-inner { width: calc(100% - 40px); }
  .editor { grid-template-columns: 278px minmax(0, 1fr); gap: 18px; }
  .settings-panel { padding-inline: 16px; }
  .intro p { font-size: 18px; }
  .images-panel, .preview-panel { padding-inline: 13px; }
  .images-toolbar { align-items: flex-start; }
  .images-title { gap: 3px 10px; }
  .image-actions { gap: 8px; }
  .button { padding-inline: 12px; }
  .preview-toolbar { flex-wrap: wrap; gap: 10px; }
  .preview-tabs { width: 100%; margin: 0; }
  .preview-tab, .preview-tabs [role="tab"] { padding-inline: 14px; }
  .preview-stage { height: 350px; }
}

@media (max-width: 760px) {
  .container, .header-inner { width: calc(100% - 32px); }
  .header-inner { min-height: 62px; gap: 12px; }
  .brand { font-size: 21px; gap: 8px; letter-spacing: -.7px; }
  .brand svg { width: 25px; height: 25px; }
  .header-nav { gap: 12px; }
  .privacy { max-width: 137px; gap: 6px; font-size: 11px; line-height: 1.35; }
  .privacy svg { width: 14px; height: 14px; }
  .header-nav > a { display: none; }
  .intro { padding-block: 23px 22px; }
  h1 { max-width: 520px; font-size: clamp(30px, 7vw, 42px); line-height: 1.12; letter-spacing: -1.15px; }
  .intro p { margin-top: 11px; font-size: 16px; line-height: 1.5; }
  .editor { display: flex; flex-direction: column; gap: 18px; }
  .workspace { display: contents; }
  .images-panel { order: -1; }
  .settings-panel { order: 0; }
  .preview-panel { order: 1; }
  .settings-panel { padding: 18px; }
  .settings-panel > h2 { margin-bottom: 15px; }
  h2 { font-size: 20px; }
  .setting-group h3 { font-size: 14px; }
  .platform-row, .radio-row { min-height: 42px; }
  .dimension-toggle { min-height: 42px; padding-inline: 8px 0; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  .size-inputs { padding-top: 3px; padding-bottom: 11px; }
  .size-inputs input { height: 42px; font-size: 16px; }
  .focus-controls { padding: 12px; gap: 7px; }
  .focus-controls > label { font-size: 13px; }
  .focus-controls .text-button { min-height: 42px; }
  .output-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 14px; }
  .field-label > select, .field-label > input[type="text"] { height: 44px; padding-inline: 10px; font-size: 16px; }
  .range-label { align-content: start; }
  .range-label > input { height: 44px; }
  .output-options > .field-hint { grid-column: 1 / -1; }
  .color-row { min-height: 44px; gap: 8px; }
  .color-row input { height: 40px; }
  .images-panel { padding: 15px 13px 10px; }
  .images-toolbar { gap: 13px; }
  .images-title { width: 100%; align-items: baseline; gap: 6px 12px; }
  .image-actions { width: 100%; gap: 10px; }
  .image-actions .button { flex: 1; min-height: 44px; font-size: 13px; padding-inline: 8px; }
  .image-list { gap: 11px; padding-block: 13px 5px; }
  .image-item { width: 142px; flex-basis: 142px; padding-top: 0; }
  .thumbnail { height: 108px; }
  .image-name { font-size: 12px; }
  .remove-image { top: 3px; right: 3px; width: 42px; height: 42px; background: #fffffff2; opacity: .88; font-size: 22px; }
  .batch-actions { font-size: 11px; min-height: 23px; }
  .batch-actions .text-button { min-height: 42px; font-size: 12px; }
  .empty-state { min-height: 150px; padding-inline: 10px; }
  .empty-state strong { font-size: 15px; }
  .empty-state p { font-size: 12px; }
  .preview-panel { padding: 15px 13px 12px; }
  .preview-toolbar { gap: 12px; margin-bottom: 12px; }
  .preview-tabs { max-width: 100%; }
  .preview-tab, .preview-tabs [role="tab"] { min-height: 44px; padding: 10px 16px; font-size: 12px; }
  .preview-stage { flex: none; width: 100%; height: clamp(230px, 68vw, 400px); min-height: 230px; }
  .preview-caption { font-size: 12px; gap: 3px 12px; margin-top: 10px; }
  #preview-size { margin-left: 0; text-align: left; }
  .preview-panel > .field-hint { font-size: 11px; }
  .export-bar { align-items: stretch; flex-direction: column; gap: 14px; margin-top: 18px; padding-top: 17px; }
  .export-summary strong { font-size: 16px; }
  .export-actions { gap: 9px; }
  .export-button { width: 100%; min-width: 0; min-height: 50px; order: -1; }
  .export-actions > .button-secondary { min-height: 44px; flex: 1; }
  .progress-area { align-items: stretch; flex-direction: column; gap: 8px; margin-top: 6px; }
  progress { width: 100%; }
  .presets-note { font-size: 11px; margin-top: 12px; }
  .help { margin-top: 20px; }
  .help > summary { min-height: 48px; padding-block: 14px; font-size: 12px; }
  .help-content { font-size: 13px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 4px; padding-block: 17px 24px; }
}

@media (max-width: 360px) {
  .container, .header-inner { width: calc(100% - 24px); }
  .brand { font-size: 19px; }
  .privacy { max-width: 120px; font-size: 10px; }
  .settings-panel { padding-inline: 15px; }
  .output-options { gap: 15px 10px; }
  .field-label { font-size: 13px; }
  .image-actions { flex-direction: column; }
  .image-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; }
}

.faq { max-width: 900px; padding: 22px 0 28px; border-top: 1px solid var(--line-soft); }
.faq h2 { margin-bottom: 18px; }
.faq-item + .faq-item { margin-top: 18px; }
.faq-item h3 { font-size: 15px; line-height: 1.4; font-weight: 650; }
.faq-item p { margin-top: 5px; color: #596577; font-size: 14px; line-height: 1.7; }
