:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f0;
  --ink: #111111;
  --muted: #666666;
  --line: #d5d5d2;
  --accent: #111111;
  --accent-dark: #111111;
  --ok: #27633b;
  --danger: #9b2929;
  --heading: Inter, "Helvetica Neue", Arial, "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --body: Inter, "Helvetica Neue", Arial, "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 14px; line-height: 1.7; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[tabindex]:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 50; padding: 8px 14px; background: var(--ink); color: white; }
.skip-link:focus { top: 12px; }

.tool-hero { width: min(100%, var(--max)); margin: 0 auto; padding: 34px clamp(20px, 4vw, 48px) 88px; }
.breadcrumb { display: flex; gap: 9px; color: var(--muted); font-size: 10px; letter-spacing: .03em; margin-bottom: 36px; }
.breadcrumb a { text-decoration: none; border-bottom: 1px solid transparent; }
.breadcrumb a:hover { border-color: currentColor; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 9px; font-weight: 700; letter-spacing: .12em; margin-bottom: 12px; }
.on-device { color: var(--ink); border: 1px solid var(--ink); padding: 1px 7px; border-radius: 0; }
h1, h2, h3 { margin: 0; font-family: var(--heading); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(32px, 4.4vw, 48px); letter-spacing: -.04em; }
.lead { margin: 18px 0 16px; max-width: 690px; font-size: clamp(15px, 1.7vw, 18px); line-height: 1.75; }
.privacy-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.compressor-card + .privacy-line { margin-top: 18px; }
.privacy-line strong { color: var(--ink); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.privacy-icon { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 0; color: var(--ink); font-size: 15px; }

.compressor-card { margin-top: 48px; border: 2px solid var(--ink); background: var(--surface); box-shadow: none; display: flex; flex-direction: column; }
.compressor-card > .drop-zone { order: 1; }
.compressor-card > .queue-panel { order: 1; }
.compressor-card > .settings-panel { order: 2; }
.compressor-card > .results-panel { order: 3; }
.compressor-card:has(> .queue-panel:not([hidden])) > .drop-zone { display: none; }
/* "01 Files" heading above the empty drop zone; the file list shows its own once files are added. */
.compressor-card > .drop-heading { order: 1; display: flex; align-items: center; gap: 13px; padding: 30px 40px 4px; }
.drop-heading h2 { font-size: 21px; }
.compressor-card:has(> .queue-panel:not([hidden])) > .drop-heading { display: none; }
.drop-zone { min-height: 340px; margin: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #8c8c88; background: #fafafa; transition: background-color .18s, border-color .18s; cursor: pointer; text-align: center; }
.drop-zone.is-over { background-color: #eeeeec; border-color: var(--ink); }
.drop-mark { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid var(--ink); border-radius: 0; }
.drop-mark span { font-size: 30px; line-height: 1; font-family: Arial, sans-serif; font-weight: 200; }
.drop-zone h2 { font-size: 23px; }
.drop-zone > p { margin: 5px 0 12px; color: var(--muted); }
.drop-zone .drop-note { margin: 14px 0 0; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }

.button { min-height: 42px; padding: 9px 18px; border-radius: 0; border: 1px solid var(--ink); font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.button:hover:not(:disabled) { background: #333; color: #fff; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button-dark { background: var(--ink); color: var(--surface); }
.button-light { background: transparent; color: var(--ink); border-color: var(--line); }
.button-accent { background: var(--ink); border-color: var(--ink); color: #fff; min-width: 210px; display: inline-flex; justify-content: space-between; align-items: center; gap: 24px; }
.button-accent:hover:not(:disabled) { background: #333; border-color: #333; }
.text-button { border: 0; padding: 5px 0; background: none; color: var(--muted); font-size: 11px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.settings-panel, .queue-panel, .results-panel { padding: 34px 40px; border-top: 1px solid var(--line); }
.queue-panel { position: relative; }
.queue-panel.is-over::after { content: attr(data-drop-label); position: absolute; inset: 12px; z-index: 5; display: grid; place-items: center; border: 2px dashed var(--ink); background: rgba(250, 250, 250, .94); color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: .04em; pointer-events: none; }
.setting-heading, .queue-top, .results-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.setting-heading > div, .queue-top > div:first-child, .results-heading > div { display: flex; align-items: center; gap: 13px; }
.setting-number { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; letter-spacing: .06em; }
.settings-panel h2, .queue-panel h2, .results-panel h2 { font-size: 21px; }
.mode-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border: 0; padding: 0; margin: 25px 0 0; }
.mode-option { position: relative; margin-left: -1px; cursor: pointer; }
.mode-option:first-of-type { margin-left: 0; }
.mode-option input { position: absolute; opacity: 0; }
.mode-option span { min-height: 86px; display: flex; flex-direction: column; justify-content: center; padding: 12px 16px; border: 1px solid var(--line); background: var(--surface); }
.mode-option b { font-family: var(--heading); font-size: 15px; font-weight: 700; }
.mode-option small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.mode-option input:checked + span { position: relative; z-index: 1; border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); background: #f2f2f0; }
.mode-option input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.mode-grid.mode-grid-primary { grid-template-columns: minmax(220px, 1fr); }
.advanced { margin-top: 19px; border-top: 1px solid var(--line); }
.advanced summary { list-style: none; padding: 15px 0 0; display: flex; justify-content: space-between; cursor: pointer; font-size: 12px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced[open] summary span { transform: rotate(45deg); }
.advanced-body { display: flex; gap: 30px; align-items: center; margin-top: 14px; padding: 15px; background: var(--surface-2); font-size: 11px; }
.advanced-body label { white-space: nowrap; }
.advanced-body select { margin-left: 8px; padding: 5px 22px 5px 8px; background: var(--surface); border: 1px solid var(--line); }
.advanced-body p { margin: 0; color: var(--muted); }
.compressor-advanced-body { align-items: stretch; flex-direction: column; }
.advanced-mode-grid { grid-template-columns: repeat(4, 1fr); width: 100%; margin: 0; }
.advanced-mode-grid legend { margin-bottom: 8px; color: var(--muted); font-size: 10px; }

.queue-actions { display: flex; align-items: center; gap: 18px; }
.file-count { margin-left: 2px; padding: 1px 8px; background: var(--surface-2); font-size: 10px; }
.detection-summary { margin-top: 20px; padding: 9px 13px; border-left: 3px solid var(--ink); background: var(--surface-2); color: var(--ink); font-size: 11px; }
.file-list { margin-top: 22px; border-top: 1px solid var(--line); }
.file-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto auto; align-items: center; gap: 15px; min-height: 88px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.file-row.has-result { grid-template-columns: 132px minmax(0, 1fr) auto auto; }
.file-compare { display: flex; align-items: flex-end; gap: 8px; }
.file-compare figure { min-width: 0; margin: 0; }
.file-compare figcaption { margin-bottom: 3px; color: var(--muted); font: 7px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.file-thumb { width: 58px; height: 58px; display: block; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.file-main { min-width: 0; }
.file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.file-meta { color: var(--muted); font-size: 10px; }
.result-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.result-badges span { padding: 2px 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 8px; line-height: 1.4; }
.file-status { min-width: 105px; text-align: right; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.file-status.done { color: var(--ok); }
.file-status.error { color: var(--danger); }
.file-result { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; min-width: 165px; font-size: 11px; }
.file-result strong { color: var(--ok); font-size: 12px; }
.icon-button { width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.icon-button:hover { color: var(--ink); }
.progress-track { height: 2px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
/* Rows only show the bar while a file is processing; there is no real percentage, so it sweeps. */
.file-row .progress-bar { width: 40% !important; animation: busy-sweep 1.2s ease-in-out infinite; }

/* Busy spinner (assets/js/busy-indicator.js) and processing rows. */
@keyframes busy-spin { to { transform: rotate(360deg); } }
@keyframes busy-sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.busy-indicator { display: inline-flex; align-items: center; gap: 8px; align-self: center; color: var(--muted); font-size: 11px; white-space: nowrap; }
.busy-indicator::before, .file-status.processing::before { content: ""; flex: 0 0 auto; width: 14px; height: 14px; box-sizing: border-box; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: busy-spin .8s linear infinite; }
.busy-indicator-labelled { margin-right: auto; color: var(--ink); font-weight: 600; }
.file-status.processing { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--ink); }
.file-status.processing::before { width: 12px; height: 12px; }
@media (prefers-reduced-motion: reduce) {
  /* Still turning so progress stays visible, just slower. */
  .busy-indicator::before, .file-status.processing::before { animation-duration: 2.4s; }
  .file-row .progress-bar { animation-duration: 3s; }
}
.run-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 26px; }

.results-panel { background: var(--surface-2); }
.join-order-actions { display: flex; gap: 6px; align-items: center; }
.join-order-actions .icon-button { position: static; flex: 0 0 auto; }
.join-preview { margin: 24px 0 0; padding: 18px; border: 1px solid var(--line); background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 18px 18px; text-align: center; overflow: auto; }
.join-preview img { display: block; max-width: 100%; max-height: 560px; margin: auto; object-fit: contain; box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.results-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.complete-mark { border: 1px solid var(--ok); color: var(--ok); padding: 2px 7px; font-size: 9px; letter-spacing: .12em; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; margin-top: 25px; border: 1px solid var(--line); background: var(--surface); }
.summary-grid > div { padding: 20px 24px; border-right: 1px solid var(--line); }
.summary-grid > div:last-child { border: 0; }
.summary-grid span { display: block; color: var(--muted); font-size: 10px; }
.summary-grid strong { font-family: var(--heading); font-size: 25px; font-weight: 700; }
.summary-grid .saved strong { color: var(--ok); }
.summary-grid small { margin-left: 9px; color: var(--ok); }
.compression-comparison { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.compression-comparison-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.compression-comparison-heading span { color: var(--muted); font: 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; }
.compression-comparison-heading h3 { margin: 5px 0 0; font: 700 18px/1.3 var(--heading); }
.compression-comparison-heading p { max-width: 44%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.compression-comparison-tabs { display: flex; gap: 6px; margin-top: 16px; padding-bottom: 5px; overflow-x: auto; }
.compression-comparison-tabs button { max-width: 220px; min-height: 34px; padding: 6px 10px; display: inline-flex; align-items: center; gap: 7px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.compression-comparison-tabs button span { color: inherit; font: 8px ui-monospace, SFMono-Regular, Consolas, monospace; }
.compression-comparison-tabs button[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.compression-comparison-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.compression-comparison-grid figure { min-width: 0; margin: 0; border: 1px solid var(--line); background: var(--surface); }
.compression-comparison-grid figcaption { min-height: 40px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.compression-comparison-grid figcaption small { color: var(--muted); font-size: 9px; font-weight: 400; }
.compression-comparison-grid figure > div { height: clamp(300px, 42vw, 580px); padding: 14px; display: grid; place-items: center; overflow: auto; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 16px 16px; }
.compression-comparison-grid img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.image-before-after-placeholder { max-width: 260px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; text-align: center; }
.download-row { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 24px; }
.download-row p { color: var(--muted); font-size: 10px; }

/* Image converter */
.converter-output-grid { grid-template-columns: repeat(3, 1fr); }
.converter-quality { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11px; }
.converter-quality select { padding: 7px 30px 7px 10px; border: 1px solid var(--line); background: var(--surface); }
.converter-same-format { margin-top: 16px; padding: 10px 12px; border-left: 2px solid var(--ink); background: var(--surface-2); color: var(--ink); font-size: 11px; line-height: 1.7; }
.converter-same-format a { font-weight: 700; text-underline-offset: 3px; }
.converter-format-placeholder { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: 8px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; text-align: center; }
.converter-error { display: block; margin-top: 4px; color: var(--danger); font-size: 9px; }
.converter-file-row .file-result strong { white-space: nowrap; color: var(--muted); font-size: 10px; }

/* Image resizer */
.resize-mode-grid { grid-template-columns: repeat(2, 1fr); }
.raster-size-grid { grid-template-columns: repeat(3, 1fr); }
.raster-background-grid { grid-template-columns: repeat(4, 1fr); }
.color-mode-grid { grid-template-columns: repeat(4, 1fr); }
.color-tool-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 14px 22px; margin-top: 20px; padding: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.color-tool-field { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 10px; }
.color-pair { display: flex; align-items: center; border: 1px solid var(--line); background: #fff; }
.color-pair input[type="color"] { width: 44px; height: 40px; padding: 2px; border: 0; border-right: 1px solid var(--line); background: #fff; }
.color-pair input[type="text"] { width: 92px; min-height: 40px; padding: 8px; border: 0; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.color-range { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); background: #fff; }
.color-range input { width: 150px; }
.color-range output { min-width: 34px; color: var(--ink); font-weight: 700; }
.color-presets { display: flex; gap: 8px; margin-top: 14px; }
.favicon-source { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.favicon-source > .queue-top { grid-column: 1 / -1; }
.favicon-source img { width: 76px; height: 76px; object-fit: contain; border: 1px solid var(--line); background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 14px 14px; }
.favicon-source-copy { min-width: 0; display: flex; flex-direction: column; }
.favicon-source-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favicon-source-copy small { color: var(--muted); }
.favicon-result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.favicon-result-card { min-width: 0; display: grid; grid-template-columns: 84px minmax(0, 1fr); border: 1px solid var(--line); background: #fff; }
.favicon-preview { width: 84px; min-height: 100px; display: grid; place-items: center; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 14px 14px; border-right: 1px solid var(--line); }
.favicon-preview img { width: 68px; height: 68px; object-fit: contain; image-rendering: auto; }
.favicon-preview.is-file { background: var(--surface-2); color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.favicon-result-card > div:last-child { min-width: 0; padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.favicon-result-card strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.favicon-result-card small { color: var(--muted); font-size: 9px; }
.favicon-result-card .button { min-height: 30px; margin-top: auto; padding: 5px 10px; font-size: 10px; }
.favicon-snippet { margin-top: 22px; padding: 16px; border: 1px solid var(--line); background: #fff; }
.favicon-snippet textarea { width: 100%; min-height: 122px; margin: 10px 0; padding: 10px; resize: vertical; border: 1px solid var(--line); font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.resize-fields { display: flex; align-items: end; gap: 12px; margin-top: 20px; padding: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.resize-fields > label:not(.resize-aspect) { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 10px; }
.number-input { display: flex; align-items: center; border: 1px solid var(--line); background: var(--surface); }
.number-input input { width: 126px; min-height: 42px; padding: 8px 10px; border: 0; background: transparent; color: var(--ink); font-size: 16px; font-weight: 700; }
.number-input b { min-width: 38px; padding: 0 10px; border-left: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }
.resize-times { align-self: center; margin-top: 17px; color: var(--muted); }
.resize-aspect { display: flex; align-items: center; gap: 8px; margin: 0 0 9px 8px; font-size: 11px; cursor: pointer; }
.resize-aspect input { width: 17px; height: 17px; margin: 0; accent-color: var(--ink); }
.resize-aspect-wrap { align-self: center; margin: 15px 0 0 8px; }
.resize-aspect-wrap .resize-aspect { margin: 0; }
.resize-aspect-wrap small { display: block; margin: 4px 0 0 25px; color: var(--muted); font-size: 8px; }
.resize-percent { align-items: center; }
.resize-output { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.resize-output label { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.resize-output select { padding: 7px 30px 7px 10px; border: 1px solid var(--line); background: var(--surface); }

/* Image cropper */
.crop-mode-grid { grid-template-columns: repeat(3, 1fr); }
.crop-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 14px 24px; margin-top: 20px; padding: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.crop-controls label, .crop-manual label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 10px; }
.crop-controls input:not([type="color"]), .crop-controls select, .crop-manual select { min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); background: #fff; }
.crop-controls input[type="color"] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--line); background: #fff; }
.crop-controls label > span { font-size: 9px; }
.crop-normalize strong { align-self: center; font-size: 11px; }
.crop-manual { margin-top: 20px; padding: 18px; border: 1px solid var(--line); background: var(--surface-2); }
.crop-manual p { margin: 8px 0; color: var(--muted); font-size: 10px; }
.crop-manual canvas { max-width: 100%; display: block; border: 1px solid var(--ink); background: #ddd; cursor: crosshair; touch-action: none; }
.crop-result-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.crop-result-card { min-width: 0; border: 1px solid var(--line); background: #fff; }
.crop-result-card > img { width: 100%; aspect-ratio: 1; display: block; object-fit: contain; }
.crop-result-card > div { display: grid; grid-template-columns: auto 1fr; gap: 5px 9px; padding: 12px; border-top: 1px solid var(--line); }
.crop-result-card span, .crop-result-card small { color: var(--muted); font-size: 9px; }
.crop-result-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.crop-result-card small { grid-column: 2; }
.crop-result-card .crop-result-note { grid-column: 2; color: var(--muted); font-size: 10px; font-style: normal; }
.crop-result-card button { grid-column: 1 / -1; margin-top: 6px; }

/* PNG to SVG */
.vector-mode-grid { grid-template-columns: repeat(2, 1fr); }
.vector-settings-block { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.vector-settings-block > .setting-number { margin-right: 12px; }
.vector-settings-block > h3 { display: inline; font-size: 17px; }
.vector-quality-grid { grid-template-columns: repeat(3, 1fr); margin-top: 15px; }
.setting-note { margin: 10px 0 0; color: var(--muted); font-size: 10px; }
.vector-progress { align-self: center; margin-right: auto; color: var(--muted); font-size: 10px; }
.vector-summary { grid-template-columns: repeat(2, 1fr); }
.vector-result-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 25px; }
.vector-result-card { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.vector-compare { display: grid; grid-template-columns: 1fr 1fr; }
.vector-compare figure { position: relative; aspect-ratio: 1; min-width: 0; margin: 0; background: #fff; }
.vector-compare figure + figure { border-left: 1px solid var(--line); }
.vector-compare img { width: 100%; height: 100%; display: block; object-fit: contain; }
.vector-compare figcaption { position: absolute; left: 8px; top: 8px; padding: 3px 6px; background: rgba(255,255,255,.9); color: var(--muted); font: 8px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.vector-result-card > div:last-child { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px 12px; padding: 14px; border-top: 1px solid var(--line); }
.vector-result-card > div:last-child > span { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.vector-result-card > div:last-child > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.vector-result-card > div:last-child > small { grid-column: 2; color: var(--muted); font-size: 9px; }
.vector-result-card > div:last-child > button { grid-column: 3; grid-row: 1 / span 2; }

/* Image splitter */
.splitter-subtitle { margin-top: 28px; font-size: 15px; }
.splitter-detection-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 12px; }
.splitter-detection { margin: 0; border: 1px solid var(--line); background: #fff; }
.splitter-detection img { width: 100%; max-height: 420px; display: block; object-fit: contain; }
.splitter-detection figcaption { padding: 10px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.splitter-result-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.splitter-result-card { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.splitter-result-card > img { width: 100%; aspect-ratio: 1; display: block; object-fit: contain; background: #fff; }
.splitter-result-card > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 9px; padding: 12px; border-top: 1px solid var(--line); }
.splitter-result-card span { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.splitter-result-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.splitter-result-card small { grid-column: 2; color: var(--muted); font-size: 9px; }
.splitter-result-card button { grid-column: 1 / -1; margin-top: 7px; }

/* Workflows */
.workflow-pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 34px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); }
.workflow-pipeline-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.workflow-pipeline-six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.workflow-pipeline-seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.workflow-pipeline li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; background: var(--surface); }
.workflow-pipeline li + li { border-left: 1px solid var(--line); }
.workflow-pipeline li + li::before { content: "→"; position: absolute; left: -9px; top: 50%; transform: translateY(-50%); width: 16px; background: var(--surface); color: var(--muted); font-size: 11px; text-align: center; }
.workflow-pipeline span { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.workflow-pipeline b { font-size: 14px; }
.workflow-pipeline small { color: var(--muted); font-size: 10px; }
.workflow-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 34px; margin-top: 22px; }
.web-preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.web-optimizer-fields { align-items: start; }
.web-rename-field { grid-column: 1 / -1; }
.web-rename-controls { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 12px; }
.web-rename-controls label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 700; }
.compact-option { margin: 0; padding: 10px 12px; }
.web-optimizer-fields .number-input { align-self: flex-start; }
.workflow-field { display: flex; flex-direction: column; gap: 8px; }
.workflow-field > label { font-size: 11px; font-weight: 700; }
.workflow-field > small { color: var(--muted); font-size: 10px; }
.workflow-sequence-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 2px; }
.workflow-sequence-row > label { font-size: 10px; font-weight: 700; }
.workflow-sequence-row .number-input input { width: 96px; }
.workflow-field > .workflow-sequence-hint { color: var(--ok); }
.workflow-size { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.workflow-presets { display: flex; }
.workflow-presets button { min-height: 44px; padding: 0 14px; margin-left: -1px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12px; cursor: pointer; }
.workflow-presets button.is-active { position: relative; border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 -3px 0 var(--ink); }
.workflow-presets button:disabled { opacity: .5; cursor: not-allowed; }
.workflow-text { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); font-size: 16px; font-weight: 700; }
.workflow-text:focus, .workflow-presets button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.workflow-option { margin-top: 18px; padding: 14px 16px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.workflow-option input { margin-top: 3px; }
.workflow-option span { display: flex; flex-direction: column; gap: 3px; }
.workflow-option b { font-size: 12px; }
.workflow-option small { color: var(--muted); font-size: 10px; }
#namePreview { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.workflow-rename { display: block; color: var(--ok); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.normalize-setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.normalize-step { min-width: 0; margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line); }
.normalize-step legend { padding: 0 7px; font-size: 12px; font-weight: 800; }
.normalize-step legend span { margin-right: 8px; color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.normalize-step > label { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10px; font-weight: 700; }
.normalize-step select, .normalize-step input[type="number"] { min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.normalize-step > small { color: var(--muted); font-size: 9px; line-height: 1.55; }
.normalize-step .workflow-text { min-height: 38px; font-size: 13px; }
.normalize-inline { display: flex; align-items: stretch; }
.normalize-inline input { width: 92px; }
.normalize-inline select { margin-left: -1px; }
.normalize-dimensions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.normalize-dimensions label { position: relative; display: flex; flex-direction: column; gap: 5px; font-size: 9px; font-weight: 700; }
.normalize-dimensions label input { width: 100%; padding-right: 28px; }
.normalize-dimensions label b { position: absolute; right: 8px; bottom: 12px; color: var(--muted); font-size: 8px; }
.normalize-dimensions > span { padding-bottom: 10px; color: var(--muted); }
.normalize-step input[type="color"] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--line); background: #fff; }
.asset-spec-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 22px 0 0; border: 1px solid var(--ink); background: var(--surface); }
.asset-spec-summary div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.asset-spec-summary div:nth-child(3n) { border-right: 0; }
.asset-spec-summary div:nth-last-child(-n + 3) { border-bottom: 0; }
.asset-spec-summary span { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.asset-spec-summary strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

/* Background remover */
.bg-second-heading { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--line); }
.bg-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 34px; margin-top: 18px; font-size: 11px; }
.bg-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0; padding: 0; border: 0; font-size: 11px; }
.bg-inline legend { float: left; margin-right: 6px; font-weight: 700; }
.bg-inline label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.bg-range { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.bg-range output { min-width: 2ch; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.bg-range input { width: 130px; accent-color: var(--ink); }
.bg-select { font-weight: 700; }
.bg-select select { margin-left: 8px; padding: 5px 22px 5px 8px; background: var(--surface); border: 1px solid var(--line); }
.bg-controls input[type="color"], .mode-option input[type="color"] { position: static; opacity: 1; width: 30px; height: 22px; padding: 0; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.bg-controls :disabled, .bg-controls label:has(:disabled) { opacity: .45; cursor: not-allowed; }
.bg-fill-grid { grid-template-columns: repeat(4, 1fr); margin-top: 15px; }
.bg-fill-grid b { display: inline-flex; align-items: center; gap: 8px; }
.bg-chip { width: 18px; height: 18px; display: inline-block; border: 1px solid var(--line); }
.bg-chip.is-checker, .bg-result-list .bg-after { background-color: #fff; background-image: linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%), linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%); background-size: 12px 12px; background-position: 0 0, 6px 6px; }
.bg-chip.is-checker { background-size: 8px 8px; background-position: 0 0, 4px 4px; }
.bg-preview-toggle { margin-top: 22px; }
.bg-result-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 14px; }
.bg-result-card { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.bg-compare { display: grid; grid-template-columns: 1fr 1fr; }
.bg-compare figure { position: relative; min-width: 0; margin: 0; aspect-ratio: 1; background: #fff; }
.bg-compare figure + figure { border-left: 1px solid var(--line); }
.bg-compare img { width: 100%; height: 100%; display: block; object-fit: contain; }
.bg-compare .bg-picker { cursor: crosshair; }
.bg-compare figcaption { position: absolute; left: 6px; top: 6px; padding: 2px 5px; background: rgba(255,255,255,.88); color: var(--muted); font: 7px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; pointer-events: none; }
.results-panel[data-preview="white"] .bg-result-list .bg-after { background: #fff; }
.results-panel[data-preview="dark"] .bg-result-list .bg-after { background: #1b1b1b; }
.bg-result-card > div { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 5px 12px; padding: 14px; border-top: 1px solid var(--line); }
.bg-result-card > div > span { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.bg-result-card > div > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.bg-result-card > div > small { grid-column: 2; color: var(--muted); font-size: 9px; }
.bg-result-card > div > small.is-error { color: var(--danger); }
.bg-result-card > div > button.button { grid-column: 3; grid-row: 1 / span 3; }
.bg-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bg-key i { width: 12px; height: 12px; display: inline-block; border: 1px solid var(--line); }
.bg-key .text-button { font-size: 9px; }

/* Batch rename */
.rename-rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 25px; }
.rename-rule-grid label { display: flex; flex-direction: column; gap: 7px; }
.rename-rule-grid label > span { font-size: 11px; font-weight: 700; }
.rename-rule-grid label small { color: var(--muted); font-weight: 400; }
.rename-rule-grid input, .rename-rule-grid select { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); font: inherit; }
.rename-rule-grid input:focus, .rename-rule-grid select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.rename-list { margin-top: 22px; border-top: 1px solid var(--line); }
.rename-row { display: grid; grid-template-columns: 35px minmax(0, 1fr) 30px minmax(0, 1fr) auto 34px; align-items: center; gap: 12px; min-height: 76px; border-bottom: 1px solid var(--line); }
.rename-order, .rename-size { color: var(--muted); font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.rename-name { min-width: 0; }
.rename-name small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.rename-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.rename-name.after strong { color: var(--ok); }
.rename-arrow { color: var(--muted); text-align: center; }
.rename-next-actions { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: end; margin-top: 24px; }
.rename-next-actions > div { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.rename-next-actions p { margin: 0 8px 0 0; color: var(--muted); font-size: 10px; }
.svg-file-mark { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.cleaner-rule-list { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 25px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cleaner-rule-list span { min-height: 64px; padding: 14px; display: flex; align-items: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; }

.content-section { width: min(100%, var(--max)); margin: 0 auto; padding: 95px clamp(20px, 4vw, 48px); border-top: 1px solid var(--line); }
.section-kicker { margin-bottom: 12px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.content-section > h2, .split-section h2 { max-width: 700px; font-size: clamp(30px, 4vw, 42px); }
.tool-proof > p { max-width: 760px; }
.tool-proof-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tool-proof-grid figure { min-width: 0; margin: 0; border: 1px solid var(--line); background: #fff; }
.tool-proof-image { min-height: 230px; padding: 24px; display: grid; place-items: center; overflow: hidden; background: #fff; }
.tool-proof-image.checker { background-color: #fff; background-image: linear-gradient(45deg, #e7e7e4 25%, transparent 25%), linear-gradient(-45deg, #e7e7e4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e7e7e4 75%), linear-gradient(-45deg, transparent 75%, #e7e7e4 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; }
.tool-proof-image img { display: block; max-width: 100%; height: auto; box-shadow: 0 0 0 1px rgba(17,17,17,.08); }
.tool-proof-grid figcaption { padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); font: 700 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.tool-proof-grid figcaption span { color: var(--muted); font-weight: 400; letter-spacing: 0; }
.tool-proof-facts { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tool-proof-facts div { min-width: 0; padding: 14px; border-left: 1px solid var(--line); }
.tool-proof-facts dt { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tool-proof-facts dd { margin: 4px 0 0; font-size: 12px; font-weight: 700; }
.tool-proof-cases { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tool-proof-cases article { min-width: 0; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tool-proof-cases h3 { margin: 0 0 7px; font-size: 13px; }
.tool-proof-cases p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.tool-proof-related { margin-top: 22px !important; padding-left: 14px; border-left: 2px solid var(--ink); font-size: 12px; }
.tool-proof-related a { color: inherit; font-weight: 700; text-underline-offset: 3px; }
.svg-proof-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.svg-proof-case { min-width: 0; border: 1px solid var(--line); background: #fff; }
.svg-proof-case > header { padding: 14px; border-bottom: 1px solid var(--line); }
.svg-proof-case h3 { margin: 0; font-size: 13px; }
.svg-proof-case header p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.svg-proof-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.svg-proof-pair figure { min-width: 0; margin: 0; }
.svg-proof-pair figure + figure { border-left: 1px solid var(--line); }
.svg-proof-pair .tool-proof-image { min-height: 145px; padding: 14px; }
.svg-proof-pair figcaption { padding: 9px; border-top: 1px solid var(--line); text-align: center; font: 700 9px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.svg-proof-result { margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.65; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 54px; }
.steps article { position: relative; padding-top: 22px; border-top: 1px solid var(--ink); }
.steps article > span { position: absolute; right: 0; top: 19px; color: var(--accent-dark); font-family: var(--heading); font-size: 11px; }
.steps h3 { font-size: 19px; }
.steps p, .split-section p { color: var(--muted); font-size: 13px; }
.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.split-section > div:last-child { padding-top: 27px; }
.split-section .note { margin-top: 26px; padding-left: 16px; border-left: 2px solid var(--accent); font-size: 11px; }
.faq-section details { max-width: 900px; }
.faq-section details { border-top: 1px solid var(--line); }
.faq-section details:last-child { border-bottom: 1px solid var(--line); }
.faq-section h2 { margin-bottom: 45px; }
.faq-section summary { list-style: none; display: flex; justify-content: space-between; padding: 20px 0; cursor: pointer; font-size: 14px; }
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section details[open] summary span { transform: rotate(45deg); }
.faq-section details p { max-width: 700px; margin: -5px 0 24px; color: var(--muted); font-size: 12px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 45px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.related-grid a { position: relative; min-height: 180px; padding: 25px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; transition: background .15s; }
.related-grid a:hover { background: var(--surface); }
.related-grid span { color: var(--accent-dark); font-size: 9px; letter-spacing: .14em; }
.related-grid h3 { margin-top: 25px; font-size: 18px; }
.related-grid p { margin: 7px 30px 0 0; color: var(--muted); font-size: 11px; }
.related-grid b { position: absolute; right: 23px; bottom: 22px; font-weight: 400; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translate(-50%, 20px); padding: 9px 16px; background: var(--ink); color: var(--surface); font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Shared work tray */
.work-tray { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: min(390px, calc(100vw - 36px)); font-family: var(--body); }
.work-tray-toggle { width: 154px; min-height: 54px; margin-left: auto; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: #fff; cursor: pointer; box-shadow: 5px 5px 0 rgba(0,0,0,.12); }
.work-tray-toggle > span { display: flex; flex-direction: column; align-items: flex-start; }
.work-tray-toggle small { font: 7px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.work-tray-toggle strong { font-size: 12px; }
.work-tray-toggle b { min-width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #777; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.work-tray-panel { margin-bottom: 9px; border: 1px solid var(--ink); background: #fff; box-shadow: 7px 7px 0 rgba(0,0,0,.12); }
.work-tray-panel[hidden] { display: none; }
.work-tray-heading { padding: 15px 16px; display: flex; justify-content: space-between; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); }
.work-tray-heading-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 2px; }
.work-tray-heading small { color: var(--muted); font-size: 8px; letter-spacing: .08em; }
.work-tray-heading strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.work-tray-heading-actions { display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; }
.work-tray-heading button { height: 28px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.work-tray-heading button:disabled { opacity: .35; cursor: default; }
.work-tray-clear { min-width: 48px; padding: 0 9px; border: 1px solid var(--line) !important; font-size: 9px; white-space: nowrap; }
.work-tray-close { width: 28px; flex: 0 0 28px; padding: 0; font-size: 15px; }
.work-tray-files { max-height: 116px; padding: 9px 16px; display: flex; flex-direction: column; overflow: auto; border-bottom: 1px solid var(--line); }
.work-tray-files:empty::before { content: attr(data-empty-label); padding: 7px 0; color: var(--muted); font-size: 10px; }
.work-tray-files span { overflow: hidden; padding: 3px 0; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.work-tray-panel > p { margin: 13px 16px 8px; font-size: 10px; font-weight: 700; }
.work-tray-tools { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin: 0 16px; }
.work-tray-tools a { min-width: 0; padding: 10px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; }
.work-tray-tools a:hover:not(.is-disabled) { background: var(--surface-2); }
.work-tray-tools a.is-current { box-shadow: inset 3px 0 0 var(--ink); }
.work-tray-tools a.is-disabled { color: #aaa; cursor: not-allowed; }
.work-tray-tools span { overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.work-tray-tools small { color: var(--muted); font-size: 8px; }
.work-tray-note { display: block; padding: 11px 16px 15px; color: var(--muted); font-size: 8px; line-height: 1.5; }

/* SVG white-fill manual editor */
.editor-page { min-height: 100vh; overflow-x: hidden; }
.svg-editor { height: calc(100vh - 69px); display: grid; grid-template-rows: auto minmax(0, 1fr); }
.editor-topbar { min-height: 62px; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.editor-topbar > div:first-child { min-width: 0; display: flex; align-items: center; gap: 13px; }
.editor-topbar strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.editor-back { padding-right: 11px; border-right: 1px solid var(--line); font-size: 9px; text-decoration: none; white-space: nowrap; }
.editor-toolbar { min-width: 0; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.editor-nav { display: flex; gap: 7px; order: 2; }
.editor-zoom { position: absolute; top: 12px; right: 12px; z-index: 3; display: flex; border: 1px solid var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.editor-zoom button { min-width: 34px; min-height: 34px; padding: 6px 9px; border: 0; border-right: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 10px; }
.editor-zoom button:last-child { border-right: 0; }
.editor-layout { min-height: 0; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.editor-sidebar { min-height: 0; padding: 18px; overflow-y: auto; border-right: 1px solid var(--ink); background: #fff; }
.editor-select { width: 100%; }
.editor-group { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.editor-group h2 { margin-bottom: 9px; font-size: 12px; }
.editor-mode { position: relative; display: block; margin-top: -1px; cursor: pointer; }
.editor-mode input { position: absolute; opacity: 0; }
.editor-mode span { min-height: 58px; padding: 9px 11px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--line); }
.editor-mode b { font-size: 11px; }
.editor-mode small { color: var(--muted); font-size: 8px; }
.editor-mode input:checked + span { position: relative; z-index: 1; border-color: var(--ink); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink); }
.editor-close-card { cursor: default; }
.editor-close-main { display: block; cursor: pointer; }
.editor-close-main > span { padding-bottom: 31px; }
.editor-close-methods { position: absolute; z-index: 2; right: 8px; bottom: 7px; left: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; transition: opacity .15s ease; }
.editor-close-methods.is-inactive { opacity: .58; }
.editor-close-methods button { position: relative; min-height: 20px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--muted); font: inherit; font-size: 8px; font-weight: 700; line-height: 1; cursor: pointer; }
.editor-close-methods button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.editor-close-methods button::after { position: absolute; z-index: 20; bottom: calc(100% + 7px); left: 0; width: 190px; padding: 7px 8px; border-radius: 3px; background: var(--ink); color: #fff; content: attr(data-tooltip); font-size: 9px; font-weight: 500; line-height: 1.45; text-align: left; opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .15s ease, transform .15s ease; }
.editor-close-methods button:last-child::after { right: 0; left: auto; }
.editor-close-methods button:hover::after, .editor-close-methods button:focus-visible::after { opacity: 1; transform: translateY(0); }
.editor-field { display: flex; flex-direction: column; gap: 6px; font-size: 10px; font-weight: 700; }
.editor-field select { min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); background: #fff; }
.editor-button-stack { display: grid; gap: 7px; }
.editor-button-stack p { margin: 2px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.editor-stats dl { margin: 0 0 14px; }
.editor-stats dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 9px; }
.editor-stats dt { color: var(--muted); }
.editor-stats dd { margin: 0; font-weight: 700; }
.editor-save-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; order: 1; }
.editor-save-actions .button, .editor-nav .button { min-height: 34px; padding: 6px 11px; white-space: nowrap; }
.editor-save-actions .button-accent { min-width: 0; gap: 12px; }
.editor-save-option { min-height: 34px; padding: 5px 9px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); font-size: 9px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.editor-save-option input { width: 13px; height: 13px; margin: 0; accent-color: var(--ink); }
.editor-workspace { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: #c8c8c8; }
.editor-canvas-wrap { position: relative; min-height: 0; }
.editor-canvas-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.editor-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; color: #555; pointer-events: none; }
.editor-empty[hidden] { display: none; }
.editor-empty strong { font-size: 16px; }
.editor-empty span { font-size: 10px; }
.editor-help { min-height: 35px; padding: 7px 12px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 15px; border-top: 1px solid #aaa; background: #fff; color: var(--muted); font-size: 8px; }
.editor-help-touch { display: none; }
.red-mark { width: 22px; height: 3px; background: #f02020; }
.blue-mark { color: #2070ff; font-size: 16px; font-weight: 700; line-height: 1; }

@media (max-width: 760px) {
  .tool-hero h1 { font-size: 28px; line-height: 1.18; letter-spacing: -.025em; }
  .compression-comparison-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .compression-comparison-heading p { max-width: 100%; }
  .compression-comparison-grid { grid-template-columns: 1fr; }
  .compression-comparison-grid figure > div { height: clamp(280px, 90vw, 520px); }
  .tool-hero { padding: 28px 20px 65px; }
  .breadcrumb { margin-bottom: 28px; overflow: hidden; white-space: nowrap; }
  .lead br { display: none; }
  .privacy-line span:last-child { width: 100%; margin-left: 31px; }
  .compressor-card { margin-top: 38px; box-shadow: none; }
  .drop-zone { min-height: 300px; margin: 10px; padding: 30px 16px; }
  .drop-zone h2 { font-size: 24px; }
  .settings-panel, .queue-panel, .results-panel { padding: 26px 18px; }
  .compressor-card > .drop-heading { padding: 22px 18px 2px; }
  .mode-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .mode-option { margin: 0; }
  .mode-option:first-of-type { grid-column: 1 / -1; }
  .mode-option span { min-height: 75px; }
  .advanced-body { align-items: flex-start; flex-direction: column; gap: 8px; }
  .queue-top { align-items: flex-start; }
  .queue-actions .text-button { display: none; }
  .file-row { grid-template-columns: 46px minmax(0, 1fr) auto; padding: 9px 0; gap: 10px; }
  .file-row.has-result { grid-template-columns: 100px minmax(0, 1fr) auto; }
  .file-thumb { width: 44px; height: 44px; }
  .converter-format-placeholder { width: 44px; height: 44px; }
  .file-compare { gap: 6px; }
  .file-status { grid-column: 2; min-width: 0; text-align: left; }
  .file-status.processing { justify-content: flex-start; }
  .file-result { grid-column: 2 / -1; justify-content: flex-start; }
  .run-actions { justify-content: stretch; }
  .run-actions .button { flex: 1; }
  .queue-panel > .run-actions, .settings-panel > .run-actions {
    position: sticky;
    z-index: 8;
    bottom: max(0px, env(safe-area-inset-bottom));
    margin: 24px -18px -26px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
  }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid > div { padding: 15px; }
  .summary-grid > div:nth-child(2) { border-right: 0; }
  .summary-grid > .saved { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .download-row { align-items: stretch; flex-direction: column; }
  .download-row p { margin: 0; }
  .vector-mode-grid, .vector-quality-grid, .vector-result-list, .splitter-detection-list, .converter-output-grid, .resize-mode-grid, .raster-size-grid, .raster-background-grid, .color-mode-grid, .crop-mode-grid, .crop-result-list { grid-template-columns: 1fr; }
  .color-tool-controls { align-items: stretch; flex-direction: column; }
  .favicon-source { grid-template-columns: 58px minmax(0, 1fr); }
  .favicon-source img { width: 58px; height: 58px; }
  .favicon-source .run-actions { grid-column: 1 / -1; }
  .favicon-result-grid { grid-template-columns: 1fr; }
  .resize-fields { align-items: stretch; flex-direction: column; }
  .resize-times { display: none; }
  .resize-aspect-wrap { margin: 5px 0 0; }
  .number-input input { width: 100%; }
  .resize-output { align-items: stretch; flex-direction: column; }
  .resize-output label { align-items: stretch; flex-direction: column; gap: 5px; }
  .splitter-result-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-pipeline, .workflow-pipeline-five, .workflow-pipeline-six, .workflow-pipeline-seven { display: flex; grid-template-columns: none; overflow-x: auto; scrollbar-width: thin; white-space: nowrap; }
  .workflow-pipeline li, .workflow-pipeline-five li:nth-child(n), .workflow-pipeline-six li:nth-child(n), .workflow-pipeline-seven li:nth-child(n) { flex: 0 0 auto; padding: 10px 13px; flex-direction: row; align-items: center; border-top: 0; }
  .workflow-pipeline li + li, .workflow-pipeline li:nth-child(3) { border-left: 1px solid var(--line); }
  .workflow-pipeline li + li::before, .workflow-pipeline li:nth-child(3)::before, .workflow-pipeline-five li + li::before, .workflow-pipeline-six li + li::before, .workflow-pipeline-seven li + li::before { display: block; }
  .workflow-pipeline span, .workflow-pipeline small { display: none; }
  .workflow-pipeline b { font-size: 12px; }
  .workflow-fields { grid-template-columns: 1fr; }
  .web-preset-grid { grid-template-columns: 1fr; }
  .web-rename-controls { grid-template-columns: 1fr; }
  .normalize-setting-grid { grid-template-columns: 1fr; }
  .asset-spec-summary { grid-template-columns: 1fr 1fr; }
  .asset-spec-summary div:nth-child(n) { border-right: 0; border-bottom: 1px solid var(--line); }
  .asset-spec-summary div:nth-child(odd) { border-right: 1px solid var(--line); }
  .asset-spec-summary div:nth-last-child(-n + 2) { border-bottom: 0; }
  .bg-result-list { grid-template-columns: 1fr; }
  .bg-fill-grid .mode-option:first-of-type { grid-column: auto; }
  .bg-controls { align-items: flex-start; flex-direction: column; }
  .bg-range input { width: 160px; }
  .bg-result-card > div { grid-template-columns: auto minmax(0, 1fr); }
  .bg-result-card > div > button.button { grid-column: 1 / -1; grid-row: auto; margin-top: 5px; }
  .rename-rule-grid { grid-template-columns: 1fr 1fr; }
  .rename-row { grid-template-columns: 28px minmax(0, 1fr) auto 30px; gap: 8px; padding: 10px 0; }
  .rename-arrow { display: none; }
  .rename-name.after { grid-column: 2; }
  .rename-size { grid-column: 3; grid-row: 1 / span 2; }
  .rename-row .icon-button { grid-column: 4; grid-row: 1 / span 2; }
  .rename-next-actions { grid-template-columns: 1fr; align-items: stretch; }
  .rename-next-actions > div { align-items: stretch; flex-direction: column; }
  .cleaner-rule-list { grid-template-columns: 1fr 1fr; }
  .editor-page { overflow: auto; }
  .svg-editor { height: auto; min-height: calc(100vh - 64px); }
  .editor-topbar { align-items: flex-start; flex-direction: column; padding: 12px 16px; }
  .editor-toolbar { width: 100%; justify-content: flex-start; }
  .editor-save-actions { width: 100%; }
  .editor-nav { width: 100%; overflow-x: auto; }
  .editor-nav .button { white-space: nowrap; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { border-right: 0; border-bottom: 1px solid var(--ink); }
  .editor-mode-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .editor-mode-group h2 { grid-column: 1 / -1; }
  .editor-mode-group .editor-mode { margin: 0 0 0 -1px; }
  .editor-mode-group > h2 + .editor-mode { margin-left: 0; }
  .editor-mode-group .editor-mode span { min-height: 66px; padding: 7px; }
  .editor-mode-group .editor-mode small { line-height: 1.35; }
  .editor-mode-group .editor-close-main > span { min-height: 78px; padding-bottom: 29px; }
  .editor-close-methods { right: 6px; bottom: 6px; left: 6px; gap: 2px; }
  .editor-close-methods button { min-height: 21px; padding: 2px; font-size: 7px; }
  .editor-button-stack p, .editor-stats { display: none; }
  .editor-workspace { min-height: 70vh; }
  .editor-zoom { top: 10px; right: 10px; }
  .editor-zoom button { min-width: 42px; min-height: 42px; }
  .editor-help-desktop { display: none; }
  .editor-help-touch { display: inline; }
  .vector-result-card > div:last-child { grid-template-columns: auto minmax(0, 1fr); }
  .vector-result-card > div:last-child > button { grid-column: 1 / -1; grid-row: auto; margin-top: 5px; }
  .content-section { padding: 65px 20px; }
  .tool-proof-grid, .tool-proof-cases, .svg-proof-grid { grid-template-columns: 1fr; }
  .tool-proof-image { min-height: 180px; padding: 18px; }
  .tool-proof-facts { grid-template-columns: 1fr; border-top: 1px solid var(--line); }
  .tool-proof-facts div { border-top: 0; }
  .steps, .split-section, .related-grid { grid-template-columns: 1fr; }
  .steps { gap: 32px; }
  .split-section { gap: 16px; }
}

@media (max-width: 430px) {
  .splitter-result-list { grid-template-columns: 1fr; }
  .work-tray { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.output-suffix-setting {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line, #d9d9d9);
}
.output-suffix-setting > label,
.editor-save-option {
  display: flex;
  align-items: center;
  gap: 10px;
}
.output-suffix-setting span { display: grid; gap: 2px; margin-right: auto; }
.output-suffix-setting small { color: var(--muted, #666); font-size: 11px; font-weight: 400; }
.output-suffix-text {
  width: min(140px, 32vw);
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line, #cfcfcf);
  border-radius: 0;
  background: #fff;
  color: inherit;
  font: inherit;
}
.output-suffix-text:disabled { opacity: .45; }
.editor-save-option .output-suffix-text { width: 92px; min-height: 28px; padding: 4px 6px; font-size: 10px; }
.output-save-setting {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* Google Picker focuses its dialog before adding the class that positions it,
   so the browser scrolled to the end of the page and left the dialog off-screen. */
body > .picker[role="dialog"] { position: absolute; top: 0; left: 0; }
.drop-zone .drive-input-button { margin-top: 8px; background: var(--surface, #fff); }
.drive-input-button:not(.drop-zone *) { margin-left: 8px; }
.drive-input-status { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.drive-input-status.is-error { color: var(--danger, #a1281d); }
.output-save-setting small,
.editor-direct-save small { color: var(--muted); font-size: 8px; font-weight: 400; }
.output-save-setting .button { min-height: 32px; padding: 5px 9px; }
.download-row .is-download-row-control {
  margin: 0;
  padding: 0;
  border: 0;
}
.download-row .output-suffix-setting > label { min-height: 42px; gap: 7px; }
.download-row .output-suffix-setting span { display: block; margin: 0; }
.download-row .output-suffix-setting b { font-size: 10px; white-space: nowrap; }
.download-row .output-suffix-setting small { display: none; }
.download-row .output-suffix-text { width: 88px; height: 42px; min-height: 42px; padding: 5px 7px; font-size: 10px; }
.download-row .output-save-setting { justify-content: flex-start; gap: 7px; }
.download-row .output-save-setting .button { height: 42px; min-height: 42px; padding: 9px 18px; }
.download-row .output-save-setting small { max-width: 120px; }
.editor-direct-save { min-height: 34px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.editor-direct-save small { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-direct-save .button { min-height: 24px; padding: 3px 6px; font-size: 8px; }
@media (max-width: 560px) {
  .output-suffix-setting > label { align-items: flex-start; flex-wrap: wrap; }
  .output-suffix-setting span { flex: 1; min-width: 180px; }
  .output-suffix-text { width: 100%; margin-left: 26px; }
  .output-save-setting { align-items: flex-start; flex-direction: column; }
  .download-row .is-download-row-control { width: 100%; }
  .download-row .output-suffix-setting > label { align-items: center; flex-wrap: nowrap; }
  .download-row .output-suffix-setting span { min-width: 0; flex: 0 1 auto; }
  .download-row .output-suffix-text { width: min(110px, 38vw); margin-left: 0; }
  .download-row .output-save-setting { width: 100%; }
  .editor-direct-save small { display: none; }
}
