.main-nav { min-height: 0; overflow-y: auto; }

.image-editor {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.image-editor button,
.image-editor label,
.image-editor select,
.image-editor input,
.image-editor textarea { letter-spacing: 0; }

.image-editor-header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 2px 4px;
}

.image-editor-header h2,
.image-editor-header p,
.image-editor-inspector h3,
.image-editor-inspector p { margin: 0; }
.image-editor-header h2 { margin-top: 3px; font-size: 20px; line-height: 1.25; }
.image-editor-header p { margin-top: 4px; color: var(--ink-soft); font-size: 11px; }
.image-editor-kicker { color: var(--accent); font-size: 9px; font-weight: 800; }
.image-editor-header-actions { display: flex; align-items: center; gap: 6px; }
.image-editor-header-actions .icon-button.active { border-color: #8cb9b4; background: var(--accent-soft); color: var(--accent); }
.image-editor-lab-badge { min-height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #d1a45d; border-radius: 5px; background: #fff8e9; color: #755018; font-size: 10px; font-weight: 700; white-space: nowrap; }
.image-editor-lab-badge i { width: 6px; height: 6px; border-radius: 50%; background: #ba7b20; }

.image-editor-workspace {
  min-width: 0;
  height: clamp(560px, calc(100vh - 176px), 780px);
  min-height: 0;
  display: grid;
  grid-template-columns: 82px minmax(360px, 1fr) 294px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.image-editor-tool-rail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 7px;
  border-right: 1px solid var(--line);
  background: #f7f9f9;
}
.image-editor-tool-rail button {
  width: 66px;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #4f5d61;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.image-editor-tool-rail button:hover { border-color: var(--line); background: #fff; color: var(--ink); }
.image-editor-tool-rail button.active { border-color: #9cc2bd; background: var(--accent-soft); color: var(--accent-hover); }
.image-editor-tool-rail button svg { width: 18px; height: 18px; }
.image-editor-tool-label { color: inherit; font-size: 9px; font-weight: 700; line-height: 1; white-space: nowrap; }
.image-editor-tool-divider { width: 52px; height: 1px; margin: 3px 0; background: var(--line); }

.image-editor-canvas-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #ecefef; }
.image-editor-canvas-toolbar,
.image-editor-canvas-status {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.image-editor-canvas-toolbar > div:last-child { min-width: 0; flex: 0 1 auto; display: flex; align-items: center; gap: 6px; }
.image-editor-canvas-toolbar .secondary-button { min-height: 34px; padding-inline: 10px; font-size: 10px; }
.image-editor-toolbar-operation { min-width: 112px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.image-editor-toolbar-operation select { min-height: 34px; width: 126px; padding-inline: 8px; font-size: 10px; }
.image-editor-upload-button input,
.image-editor-empty input,
.image-editor-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.image-editor-source-copy { min-width: 0; flex: 1 1 130px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.image-editor-source-copy > svg { width: 18px; height: 18px; color: var(--accent); }
.image-editor-source-copy > span:last-child { min-width: 0; display: grid; gap: 2px; }
.image-editor-source-copy strong,
.image-editor-source-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-editor-source-copy strong { font-size: 10px; }
.image-editor-source-copy small { color: var(--ink-soft); font-size: 8px; }
.image-editor-source-action { min-height: 28px !important; display: inline-flex; align-items: center; gap: 5px; padding-inline: 8px !important; font-size: 8px !important; white-space: nowrap; }
.image-editor-source-action svg { width: 13px; height: 13px; }

.image-editor-canvas-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; background-color: #282d2f; background-image: linear-gradient(45deg, #303638 25%, transparent 25%), linear-gradient(-45deg, #303638 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #303638 75%), linear-gradient(-45deg, transparent 75%, #303638 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; }
.image-editor-stage { position: absolute; inset: 0; touch-action: none; }
.image-editor-stage[data-tool="move"] canvas { cursor: grab; }
.image-editor-stage.is-panning canvas { cursor: grabbing; }
.image-editor-stage[data-tool="brush"] canvas { cursor: crosshair; }
.image-editor-stage[data-tool="lasso"] canvas { cursor: crosshair; }
.image-editor-stage[data-tool="eraser"] canvas { cursor: cell; }
.image-editor-stage[data-tool="text"] canvas { cursor: text; }

.image-editor-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 24px;
  color: #dce4e3;
  text-align: center;
}
.image-editor-empty-icon { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid #566164; border-radius: 7px; background: #343b3d; color: #c8d4d2; }
.image-editor-empty-icon svg { width: 24px; height: 24px; }
.image-editor-empty > strong { font-size: 13px; }
.image-editor-empty > small { color: #9eaaaa; font-size: 9px; }
.image-editor-empty > div { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.image-editor-empty .secondary-button { border-color: #697476; background: #343b3d; color: #eef4f3; }

.image-editor-asset-picker { 
  position: absolute;
  inset: 12px;
  z-index: 6;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #596568;
  border-radius: 7px;
  background: #f8fafa;
}
.image-editor-asset-picker > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.image-editor-asset-picker > header > div { display: grid; gap: 2px; }
.image-editor-asset-picker > header strong { font-size: 11px; }
.image-editor-asset-picker > header small { color: var(--ink-soft); font-size: 8px; }
.image-editor-asset-picker > div { min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-content: start; gap: 8px; padding: 10px; overflow-y: auto; }
.image-editor-asset-picker > div > button { min-width: 0; display: grid; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.image-editor-asset-picker > div > button:hover { border-color: #82aaa5; background: var(--accent-soft); }
.image-editor-asset-picker-actions { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px !important; border-bottom: 1px solid var(--line); background: #fff; overflow: visible !important; }
.image-editor-asset-picker-actions .primary-button { min-height: 32px; padding-inline: 10px; font-size: 9px; }
.image-editor-asset-picker-count { color: var(--ink-soft); font-size: 8px; }
.image-editor-asset-picker-grid { min-height: 0; display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); align-content: start; gap: 8px; padding: 10px !important; overflow-y: auto !important; }
.image-editor-asset-picker img { width: 100%; aspect-ratio: 1; display: block; border-radius: 3px; object-fit: cover; background: var(--surface-strong); }
.image-editor-asset-picker button > span { overflow: hidden; padding-inline: 2px; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.image-editor-asset-empty { grid-column: 1 / -1; min-height: 220px; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--ink-soft); text-align: center; }
.image-editor-asset-empty svg { width: 24px; height: 24px; }
.image-editor-asset-empty strong { font-size: 11px; }
.image-editor-asset-empty small { font-size: 9px; }

.image-editor-batch-panel {
  position: absolute;
  inset: 12px;
  z-index: 7;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #596568;
  border-radius: 7px;
  background: #f8fafa;
}
.image-editor-batch-panel > header,
.image-editor-batch-panel > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.image-editor-batch-panel > header > div { display: grid; gap: 2px; }
.image-editor-batch-panel > header strong { font-size: 11px; }
.image-editor-batch-panel > header small { color: var(--ink-soft); font-size: 8px; }
.image-editor-batch-panel > div { min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: start; gap: 8px; padding: 10px; overflow-y: auto; }
.image-editor-batch-panel > footer { border-top: 1px solid var(--line); border-bottom: 0; }
.image-editor-batch-panel > footer > span { color: var(--ink-soft); font-size: 9px; }
.image-editor-batch-panel > footer .primary-button { min-height: 32px; padding-inline: 10px; font-size: 9px; }
.image-editor-batch-asset { min-width: 0; position: relative; display: grid; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; }
.image-editor-batch-asset:has(input:checked) { border-color: #82aaa5; background: var(--accent-soft); }
.image-editor-batch-asset input { position: absolute; z-index: 1; top: 8px; left: 8px; accent-color: var(--accent); }
.image-editor-batch-asset img { width: 100%; aspect-ratio: 1; display: block; border-radius: 3px; object-fit: cover; background: var(--surface-strong); }
.image-editor-batch-asset span { overflow: hidden; padding-inline: 2px; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.image-editor-processing {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  background: rgba(34, 39, 41, .88);
  color: #f4f7f6;
  text-align: center;
}
.image-editor-processing > svg { width: 25px; height: 25px; }
.image-editor-processing strong { font-size: 12px; }
.image-editor-processing small { color: #bac4c3; font-size: 9px; }
.image-editor-canvas-status { min-height: 35px; padding-block: 7px; border-top: 1px solid var(--line); border-bottom: 0; color: var(--ink-soft); font-size: 8px; }
.image-editor-canvas-status > div { display: flex; align-items: center; gap: 10px; }
.image-editor-canvas-status > div span:last-child { min-width: 46px; color: var(--ink); font-weight: 700; text-align: right; }

.image-editor-inspector { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-left: 1px solid var(--line); background: #fff; overflow: hidden; }
.image-editor-inspector > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.image-editor-inspector > header > div { display: grid; gap: 2px; }
.image-editor-inspector > header > .image-editor-inspector-header-actions { display: flex; align-items: center; gap: 6px; }
.image-editor-inspector-header-actions .icon-button { width: 32px; min-height: 32px; }
.image-editor-inspector > header > div > span { color: var(--accent); font-size: 8px; font-weight: 800; }
.image-editor-inspector h3 { font-size: 15px; }
.image-editor-operation-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #bdd5d2; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.image-editor-operation-icon svg { width: 17px; height: 17px; }
.image-editor-inspector-panel { min-width: 0; min-height: 0; flex: 1; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 11px; }
.image-editor-inspector-scroll { min-width: 0; min-height: 0; display: grid; align-content: start; gap: 11px; padding-right: 2px; overflow-y: auto; overscroll-behavior: contain; }
.image-editor-operation-description { margin: 0; color: var(--ink-soft); font-size: 9px; line-height: 1.6; }
.image-editor-submit-controls { height: 230px; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 9px; padding-top: 11px; border-top: 1px solid var(--line); background: #fff; }
.image-editor-ocr-settings,
.image-editor-selection-settings,
.image-editor-tool-settings,
.image-editor-text-settings { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfc; }
.image-editor-ocr-settings { border-color: #c8dcd9; background: #f4faf9; }
.image-editor-ocr-settings p { color: var(--ink-soft); font-size: 8px; line-height: 1.5; }
.image-editor-field-heading > span.error { background: #fff0f0; color: #b42318; }
.image-editor-ocr-list { display: grid; gap: 5px; max-height: 132px; overflow-y: auto; }
.image-editor-recognize-text { width: 100%; min-height: 30px; font-size: 8px; }
.image-editor-ocr-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border: 1px solid #dce7e5; border-radius: 5px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.image-editor-ocr-row:hover { border-color: #82aaa5; background: var(--accent-soft); }
.image-editor-ocr-row.active { border-color: #d49a28; background: #fff8e9; box-shadow: inset 3px 0 #d49a28; }
.image-editor-ocr-row span { min-width: 0; overflow: hidden; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.image-editor-ocr-row small { flex: 0 0 auto; color: var(--ink-soft); font-size: 8px; }
.image-editor-selection-source { padding: 7px 8px; border-radius: 5px; background: #f1f5f5; color: var(--ink-soft); font-size: 8px; line-height: 1.45; }
.image-editor-selection-source[data-source="ocr"] { background: #fff8e9; color: #755018; }
.image-editor-selection-source[data-source="manual"] { background: var(--accent-soft); color: var(--accent-hover); }
.image-editor-selection-settings label > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.image-editor-selection-settings label strong { color: var(--ink-soft); font-size: 8px; }
.image-editor-inspector > p { min-height: 30px; color: var(--ink-soft); font-size: 9px; line-height: 1.6; }
.image-editor-operation-select { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafa; }
.image-editor-operation-select select { min-height: 38px; background: #fff; }
.image-editor-inspector section,
.image-editor-prompt-field { display: grid; gap: 9px; }
.image-editor-inspector label { min-width: 0; display: grid; gap: 5px; color: #344247; font-size: 9px; font-weight: 700; }
.image-editor-inspector textarea { min-height: 74px; resize: vertical; font-size: 10px; }
.image-editor-inspector input,
.image-editor-inspector select { font-size: 10px; }
.image-editor-inspector input[type="range"] { min-height: 20px; padding: 0; border: 0; accent-color: var(--accent); cursor: pointer; }
.image-editor-inspector input[type="color"] { min-height: 38px; padding: 4px; cursor: pointer; }
.image-editor-mask-settings { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafa; }
.image-editor-field-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.image-editor-field-heading strong { font-size: 10px; }
.image-editor-field-heading span { padding: 3px 6px; border-radius: 4px; background: var(--surface-strong); color: var(--ink-soft); font-size: 8px; }
.image-editor-field-heading span.ready { background: var(--accent-soft); color: var(--accent-hover); }
.image-editor-mask-settings label > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.image-editor-mask-settings label strong { color: var(--ink-soft); font-size: 8px; }
.image-editor-mask-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.image-editor-mask-actions button { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink-soft); font-size: 9px; font-weight: 700; cursor: pointer; }
.image-editor-mask-actions button:hover { border-color: #9aacb0; color: var(--ink); }
.image-editor-smart-settings,
.image-editor-layers-settings,
.image-editor-preset-settings,
.image-editor-version-settings,
.image-editor-metadata-settings { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfc; }
.image-editor-smart-settings { border-color: var(--line); background: #fbfcfc; }
.image-editor-smart-settings p { margin: 0; color: var(--ink-soft); font-size: 8px; line-height: 1.5; }
.image-editor-smart-settings label > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.image-editor-smart-settings label strong { color: var(--ink-soft); font-size: 8px; }
.image-editor-smart-settings > button { min-height: 30px; font-size: 8px; }
.image-editor-tool-settings label > span,
.image-editor-text-settings label > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.image-editor-tool-settings label strong,
.image-editor-text-settings label strong { color: var(--ink-soft); font-size: 8px; }
.image-editor-segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: #eef3f2; }
.image-editor-segmented button { min-height: 29px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-soft); font-size: 8px; font-weight: 800; cursor: pointer; transition: background-color .16s ease, color .16s ease, box-shadow .16s ease; }
.image-editor-segmented button:hover { color: var(--ink); }
.image-editor-segmented button.active { background: #fff; color: var(--accent-hover); box-shadow: 0 1px 3px rgba(30, 55, 54, .12); }
.image-editor-toggle-row { min-height: 30px; display: flex !important; align-items: center; justify-content: space-between; gap: 8px; }
.image-editor-toggle-row input { width: 16px; min-height: 16px; accent-color: var(--accent); cursor: pointer; }
.image-editor-layer-row { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 8px; }
.image-editor-layer-row label { display: flex; align-items: center; gap: 6px; }
.image-editor-layer-row label span { font-size: 9px; font-weight: 700; }
.image-editor-layer-row input[type="range"] { min-height: 18px; padding: 0; border: 0; accent-color: var(--accent); }
.image-editor-inline-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.image-editor-text-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.image-editor-inline-actions .secondary-button { min-height: 30px; min-width: 0; padding-inline: 5px; font-size: 8px; }
.image-editor-version-settings > .image-editor-field-heading { align-items: center; }
.image-editor-version-settings > .image-editor-field-heading .icon-button { width: 26px; min-height: 26px; }
.image-editor-version-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid #e7ecec; }
.image-editor-version-row:first-child { border-top: 0; }
.image-editor-version-row > div:first-child { min-width: 0; display: grid; gap: 2px; }
.image-editor-version-row strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.image-editor-version-row small { color: var(--ink-soft); font-size: 8px; }
.image-editor-version-row > div:last-child { display: flex; gap: 3px; }
.image-editor-version-row .icon-button { width: 25px; min-height: 25px; }
.image-editor-empty-copy { color: var(--ink-soft); font-size: 8px; }
.image-editor-metadata-settings dl { display: grid; gap: 4px; margin: 0; }
.image-editor-metadata-settings dl > div { display: flex; justify-content: space-between; gap: 8px; }
.image-editor-metadata-settings dt { color: var(--ink-soft); font-size: 8px; }
.image-editor-metadata-settings dd { min-width: 0; margin: 0; overflow: hidden; color: var(--ink); font-size: 8px; font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.image-editor-text-settings { border-color: #cfd8e3; background: #f6f8fb; }
.image-editor-text-settings textarea { min-height: 54px; }
.image-editor-text-style { display: grid; grid-template-columns: minmax(0, 1fr) 62px; gap: 8px; }
.image-editor-text-style input[type="color"] { width: 100%; }
.image-editor-prompt-field { min-width: 0; min-height: 0; grid-template-rows: 26px minmax(0, 1fr); gap: 5px; }
.image-editor-prompt-heading { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #344247; font-size: 9px; font-weight: 700; }
.image-editor-prompt-library { min-width: 0; display: flex; align-items: center; gap: 4px; }
.image-editor-prompt-library select { width: 126px; min-height: 26px; padding-block: 0; font-size: 8px; }
.image-editor-prompt-library .icon-button { width: 26px; min-height: 26px; }
.image-editor-prompt-library .icon-button svg { width: 14px; height: 14px; }
.image-editor-prompt-library .image-editor-delete-prompt:not(:disabled):hover { color: #b42318; border-color: #f3aaa3; background: #fff1f0; }
.image-editor-prompt-field textarea { height: 100%; min-height: 0; resize: none; }
.image-editor-add-text { width: 100%; min-height: 34px; font-size: 9px; }
.image-editor-output-settings { grid-template-columns: minmax(0, 1fr) 78px; align-items: end; }
.image-editor-output-settings > div { min-height: 38px; display: grid; align-content: center; justify-items: end; gap: 2px; }
.image-editor-output-settings > div span { color: var(--ink-soft); font-size: 8px; }
.image-editor-output-settings > div strong { color: var(--accent-hover); font-size: 11px; white-space: nowrap; }
.image-editor-run { width: 100%; flex: 0 0 auto; }
.image-editor-export { flex: 0 0 auto; }
.image-editor-run { min-height: 42px; }
.image-editor-run.is-busy svg { animation: spin .9s linear infinite; }
.image-editor-fatal { min-height: 420px; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--ink-soft); }
.image-editor-fatal strong { color: var(--ink); }

@media (max-width: 1220px) {
  .image-editor-workspace { grid-template-columns: 74px minmax(330px, 1fr) 270px; }
  .image-editor-tool-rail button { width: 60px; }
  .image-editor-inspector { padding: 12px; }
  .image-editor-toolbar-operation { min-width: 0; }
  .image-editor-toolbar-operation > span { display: none; }
  .image-editor-toolbar-operation select { width: 84px; padding-inline: 5px; }
  .image-editor-canvas-toolbar > div:last-child .secondary-button { min-width: 0; padding-inline: 7px; }
  .image-editor-export-label { display: none; }
  .image-editor-asset-picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .image-editor-batch-panel > div { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .image-editor-result-card { grid-template-columns: 60px minmax(100px, 1fr); }
  .image-editor-result-preview { width: 60px; height: 60px; }
  .image-editor-result-card footer { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 900px) {
  .image-editor-header { align-items: flex-start; }
  .image-editor-header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .image-editor-workspace { height: auto; grid-template-columns: 70px minmax(0, 1fr); }
  .image-editor-inspector { grid-column: 1 / -1; display: flex; border-top: 1px solid var(--line); border-left: 0; overflow: visible; }
  .image-editor-inspector-panel { grid-template-rows: auto auto; }
  .image-editor-inspector-scroll { overflow: visible; }
  .image-editor-prompt-field { min-width: 0; }
  .image-editor-run,
  .image-editor-export { align-self: end; }
}

@media (max-width: 680px) {
  .image-editor { padding-bottom: 70px; }
  .image-editor-header { display: grid; }
  .image-editor-header-actions { justify-content: flex-start; }
  .image-editor-lab-badge { margin-right: auto; }
  .image-editor-workspace { grid-template-columns: 62px minmax(0, 1fr); }
  .image-editor-tool-rail { padding-inline: 3px; }
  .image-editor-tool-rail button { width: 54px; min-height: 44px; }
  .image-editor-tool-label { font-size: 8px; }
  .image-editor-tool-divider { width: 42px; }
  .image-editor-canvas-toolbar { align-items: stretch; flex-direction: column; }
  .image-editor-canvas-toolbar > div:last-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-editor-canvas-toolbar > div:last-child .secondary-button { min-width: 0; }
  .image-editor-canvas-toolbar .secondary-button { min-width: 0; }
  .image-editor-canvas-wrap { min-height: 390px; }
  .image-editor-empty > div { width: min(100%, 260px); display: grid; grid-template-columns: 1fr; }
  .image-editor-asset-picker { inset: 8px; }
  .image-editor-asset-picker-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .image-editor-batch-panel > div { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .image-editor-canvas-status { align-items: flex-start; flex-direction: column; }
  .image-editor-inspector { padding: 13px; }
  .image-editor-inspector-panel { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .image-editor-header-actions .icon-button { width: 35px; min-height: 35px; }
  .image-editor-asset-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-editor-text-style,
  .image-editor-output-settings { grid-template-columns: 1fr; }
  .image-editor-batch-panel > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-editor-output-settings > div { justify-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  .image-editor button { transition: none; }
  .image-editor .spin { animation-duration: 1.4s; }
}
