/* === Image Workbench === */
.image-workbench-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.digital-human-page.image-workbench-page > .studio-tool-layout--no-top,
.character-mix-page.image-workbench-page > .studio-tool-layout--no-top {
  flex: 1 1 auto;
  min-height: 0;
}

.digital-human-page .image-workbench-mode-tabs,
.character-mix-page .image-workbench-mode-tabs,
.token-usage-page .image-workbench-mode-tabs {
  margin-left: 0;
}

.digital-human-page .image-workbench-camera-summary,
.character-mix-page .image-workbench-camera-summary,
.token-usage-page .image-workbench-camera-summary {
  margin-left: auto;
}

.digital-human-page .studio-tool-layout--no-top.studio-tool-layout--no-right,
.character-mix-page .studio-tool-layout--no-top.studio-tool-layout--no-right {
  grid-template-columns: 400px minmax(0, 1fr);
}

.digital-human-page .studio-panel--left,
.character-mix-page .studio-panel--left {
  padding: 14px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.012), transparent 42%),
    var(--bg-panel);
}

.digital-human-page .digital-human-source-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.digital-human-page .digital-human-source-panel > .studio-panel__section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--border-weak) 88%, white 8%);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.024), transparent),
    color-mix(in srgb, var(--bg-elevated) 94%, black 6%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.025) inset;
}

.digital-human-page .digital-human-source-panel > .studio-panel__section:first-child {
  padding-top: 14px;
}

.digital-human-page .digital-human-source-panel > .studio-panel__section:last-child {
  border-bottom: 1px solid color-mix(in srgb, var(--border-weak) 88%, white 8%);
}

.digital-human-page .digital-human-source-panel .studio-panel__section-head {
  min-height: 24px;
}

.digital-human-page .digital-human-source-panel .studio-panel__section-title {
  color: var(--fg-body);
  font-weight: 820;
}

.digital-human-page .digital-human-source-panel .studio-panel__section-chip {
  min-height: 22px;
  padding-inline: 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 68%, transparent);
  background: var(--bg-inset);
}

.digital-human-page .digital-human-source-panel .studio-panel__section-chip--ready {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.digital-human-page .digital-human-source-panel .studio-upload-slot--empty,
.digital-human-page .digital-human-source-panel .studio-upload-slot--filled {
  min-height: 92px;
  padding: 14px;
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 78%),
    var(--bg-inset);
}

.digital-human-page .digital-human-source-panel .studio-upload-slot--empty:hover,
.digital-human-page .digital-human-source-panel .studio-upload-slot--filled:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border-subtle));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 78%),
    var(--bg-hover);
}

.digital-human-page .digital-human-source-panel .studio-upload-slot--empty__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent) inset;
}

.digital-human-page .digital-human-source-panel .studio-upload-slot--filled__thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
}

.digital-human-page .digital-human-source-panel .studio-upload-slot--filled__info strong {
  font-weight: 800;
}

.digital-human-page .digital-human-source-panel .studio-upload-slot--filled,
.character-mix-page .character-mix-source-panel .studio-upload-slot--filled {
  position: relative;
}

.digital-human-page .digital-human-source-panel .studio-upload-slot__remove,
.character-mix-page .character-mix-source-panel .studio-upload-slot__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--error, #ef4444) 48%, white 16%);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.16), transparent),
    color-mix(in srgb, var(--error, #ef4444) 86%, black 14%);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 22px rgb(0 0 0 / 0.26);
  transform: translateY(-4px) scale(0.94);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.digital-human-page .digital-human-source-panel .studio-upload-slot--filled:hover .studio-upload-slot__remove,
.character-mix-page .character-mix-source-panel .studio-upload-slot--filled:hover .studio-upload-slot__remove {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.digital-human-page .digital-human-source-panel .studio-upload-slot__remove:hover,
.character-mix-page .character-mix-source-panel .studio-upload-slot__remove:hover {
  border-color: color-mix(in srgb, var(--error, #ef4444) 70%, white 20%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.2), transparent),
    var(--error, #ef4444);
}

.digital-human-page .digital-human-source-panel .studio-upload-slot__remove:focus-visible,
.character-mix-page .character-mix-source-panel .studio-upload-slot__remove:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--error, #ef4444) 62%, transparent);
  outline-offset: 2px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.digital-human-page .digital-human-source-panel .studio-audio-preview {
  margin-top: 2px;
}

.digital-human-page .digital-human-settings-panel {
  gap: 12px;
  margin-top: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--border-weak) 88%, white 8%);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.024), transparent),
    color-mix(in srgb, var(--bg-elevated) 94%, black 6%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.025) inset;
}

.digital-human-page .digital-human-settings-panel .studio-panel__section-head {
  margin-bottom: 0;
}

.digital-human-page .digital-human-settings-panel .studio-panel__section-body {
  display: grid;
  gap: 10px;
}

.digital-human-page .digital-human-prompt-field {
  display: grid;
  gap: 6px;
}

.digital-human-page .digital-human-prompt-field .studio-label {
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 750;
}

.digital-human-page .digital-human-prompt-field textarea {
  width: 100%;
  min-height: 86px;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, white 10%);
  border-radius: var(--radius-xs);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.018), transparent),
    var(--bg-inset);
  color: var(--fg-body);
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.digital-human-page .digital-human-prompt-field textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-inset) 94%, var(--accent) 6%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 13%, transparent);
}

.digital-human-page .digital-human-settings-panel .studio-toggle-row {
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--bg-inset) 94%, transparent);
}

.digital-human-page .digital-human-settings-panel .studio-generate-btn {
  min-height: 42px;
  border-radius: var(--radius-xs);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.18) inset,
    0 10px 22px rgb(0 255 136 / 0.12);
}

.digital-human-page .digital-human-cancel-btn {
  margin-top: 8px;
  border-color: color-mix(in srgb, #9ca3af 66%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #9ca3af 22%, var(--bg-elevated, #171d1b)),
    color-mix(in srgb, #6b7280 16%, var(--bg-elevated, #171d1b))
  );
  color: color-mix(in srgb, var(--fg-body, #f3f5f2) 92%, white 8%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08) inset, 0 10px 24px rgb(148 163 184 / 0.16);
  font-weight: 900;
  letter-spacing: 0;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, opacity 140ms ease, transform 140ms ease;
}

.digital-human-page .digital-human-cancel-btn:hover {
  border-color: color-mix(in srgb, #d1d5db 76%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #d1d5db 28%, var(--bg-elevated, #171d1b)),
    color-mix(in srgb, #9ca3af 20%, var(--bg-elevated, #171d1b))
  );
  color: color-mix(in srgb, var(--fg-body, #f3f5f2) 96%, white 4%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.12) inset, 0 12px 28px rgb(148 163 184 / 0.2);
  opacity: 1;
}

.digital-human-page .digital-human-cancel-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, #d1d5db 78%, transparent);
  outline-offset: 2px;
}

.digital-human-page .digital-human-cancel-btn .anticon {
  font-size: 15px;
}

.character-mix-page .character-mix-source-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.character-mix-page .character-mix-source-panel > .studio-panel__section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--border-weak) 88%, white 8%);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.024), transparent),
    color-mix(in srgb, var(--bg-elevated) 94%, black 6%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.025) inset;
}

.character-mix-page .character-mix-source-panel > .studio-panel__section:first-child {
  padding-top: 14px;
}

.character-mix-page .character-mix-source-panel > .studio-panel__section:last-child {
  border-bottom: 1px solid color-mix(in srgb, var(--border-weak) 88%, white 8%);
}

.character-mix-page .character-mix-source-panel .studio-panel__section-head {
  min-height: 24px;
}

.character-mix-page .character-mix-source-panel .studio-panel__section-title {
  color: var(--fg-body);
  font-weight: 820;
}

.character-mix-page .character-mix-source-panel .studio-panel__section-chip {
  min-height: 22px;
  padding-inline: 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 68%, transparent);
  background: var(--bg-inset);
}

.character-mix-page .character-mix-source-panel .studio-panel__section-chip--ready {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.character-mix-page .character-mix-source-panel .studio-upload-slot--empty,
.character-mix-page .character-mix-source-panel .studio-upload-slot--filled {
  min-height: 88px;
  padding: 14px;
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 78%),
    var(--bg-inset);
}

.character-mix-page .character-mix-source-panel .studio-upload-slot--empty:hover,
.character-mix-page .character-mix-source-panel .studio-upload-slot--filled:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border-subtle));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 78%),
    var(--bg-hover);
}

.character-mix-page .character-mix-source-panel .studio-upload-slot--empty__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent) inset;
}

.character-mix-page .character-mix-source-panel .studio-upload-slot--filled__thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
}

.character-mix-page .character-mix-source-panel .studio-upload-slot--filled__info strong {
  font-weight: 800;
}

.character-mix-page .character-mix-settings-panel {
  gap: 12px;
  margin-top: 0;
}

.character-mix-page .character-mix-settings-panel .studio-panel__section-head {
  margin-bottom: 0;
}

.character-mix-page .character-mix-settings-panel .studio-panel__section-body {
  display: grid;
  gap: 10px;
}

.character-mix-page .character-mix-prompt-field {
  display: grid;
  gap: 6px;
}

.character-mix-page .character-mix-prompt-field .studio-label {
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 750;
}

.character-mix-page .character-mix-prompt-field textarea {
  width: 100%;
  min-height: 92px;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, white 10%);
  border-radius: var(--radius-xs);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.018), transparent),
    var(--bg-inset);
  color: var(--fg-body);
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.character-mix-page .character-mix-prompt-field textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-inset) 94%, var(--accent) 6%);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 13%, transparent);
}

.character-mix-page .character-mix-settings-panel .studio-toggle-row {
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--bg-inset) 94%, transparent);
}

.character-mix-page .character-mix-settings-panel .studio-generate-btn {
  min-height: 42px;
  border-radius: var(--radius-xs);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.18) inset,
    0 10px 22px rgb(0 255 136 / 0.12);
}

@media (min-width: 1440px) {
  .digital-human-page .studio-tool-layout--no-top.studio-tool-layout--no-right,
  .character-mix-page .studio-tool-layout--no-top.studio-tool-layout--no-right {
    grid-template-columns: 420px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .digital-human-page .studio-tool-layout--no-top.studio-tool-layout--no-right,
  .character-mix-page .studio-tool-layout--no-top.studio-tool-layout--no-right {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "left"
      "canvas"
      "status";
  }

  .character-mix-page .studio-tool-layout--no-top.studio-tool-layout--no-right {
    grid-template-rows: minmax(220px, 34vh) minmax(280px, 1fr) 36px;
  }

  .character-mix-page .studio-tool-layout--no-top.studio-tool-layout--no-right .studio-panel--left {
    min-height: 0;
    overflow-y: auto;
  }

  .character-mix-page .studio-tool-layout--no-top.studio-tool-layout--no-right .studio-canvas {
    min-height: 280px;
  }

  .character-mix-page .studio-tool-layout--no-top.studio-tool-layout--no-right .studio-status-bar {
    min-height: 36px;
    max-height: 36px;
  }
}

.character-mix-face-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 4px;
}

.character-mix-face-hint--analyzing {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text-secondary);
}

.character-mix-face-hint--ready {
  background: color-mix(in srgb, #10b981 10%, transparent);
  color: #10b981;
}

.image-workbench-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-weak);
  background: var(--bg-panel);
}

.image-workbench-back-to-more {
  padding: 6px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.image-workbench-back-to-more:hover {
  background: var(--bg-hover);
  color: var(--fg-body);
}

.image-workbench-tool-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.image-workbench-tool-strip button:hover {
  background: var(--bg-hover);
  color: var(--fg-body);
}

.image-workbench-tool-strip button.is-active {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.image-workbench-subbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border-weak);
  background: var(--bg-elevated);
}

.image-workbench-page--image-tool > .image-workbench-subbar {
  justify-content: flex-start;
  overflow: hidden;
  border-bottom-left-radius: var(--radius-md);
}

.image-workbench-subbar__heading {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  gap: 12px;
}

.image-workbench-subbar__next--solo {
  margin-left: auto;
}

.image-workbench-subbar strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-body);
}

.image-workbench-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
}

.image-workbench-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--fg-body);
}

.image-workbench-mode-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.image-workbench-mode-tabs button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.image-workbench-mode-tabs button.is-active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.image-workbench-camera-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 13px;
  color: var(--fg-muted);
}

.image-workbench-camera-summary strong {
  color: var(--fg-body);
}

.image-workbench-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.image-workbench-layout--inpaint {
  grid-template-columns: 260px 1fr;
}

.image-workbench-layout--camera {
  grid-template-columns: 300px 1fr;
}

.image-workbench-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  border-right: 1px solid var(--border-weak);
}

.image-workbench-panel--right {
  border-right: none;
  border-left: 1px solid var(--border-weak);
}

.image-workbench-control-card {
  padding: 14px;
  border: 1px solid var(--border-weak);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.image-workbench-control-card h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-body);
}

.image-workbench-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.image-workbench-section-title h3 {
  margin: 0;
}

.image-workbench-section-title span {
  font-size: 12px;
  color: var(--fg-soft);
}

.image-workbench-upload-shell {
  position: relative;
}

.image-workbench-upload-shell.is-dragging {
  border-radius: var(--radius-sm);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

.image-workbench-upload-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  font-size: 15px;
  font-weight: 800;
  pointer-events: none;
}

.image-workbench-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 140px;
  padding: 20px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.image-workbench-upload:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.04);
}

.image-workbench-upload img {
  max-width: 100%;
  max-height: 120px;
  border-radius: 6px;
  object-fit: contain;
}

.image-workbench-upload strong {
  color: var(--fg-body);
}

.image-workbench-upload--tile {
  min-height: 140px;
}

.image-workbench-upload-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--error, #ef4444) 54%, white 18%);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.16), transparent),
    color-mix(in srgb, var(--error, #ef4444) 86%, black 14%);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 10px 22px rgb(0 0 0 / 0.26);
  transform: translateY(-4px) scale(0.94);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.image-workbench-upload-remove:hover {
  border-color: color-mix(in srgb, var(--error, #ef4444) 72%, white 20%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.2), transparent),
    var(--error, #ef4444);
  transform: translateY(0) scale(1);
}

.image-workbench-control-card input[type="file"] {
  display: none;
}

.image-workbench-url-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.image-workbench-url-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: var(--bg-inset);
  font-size: 13px;
  color: var(--fg-muted);
}

.image-workbench-url-row label input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--fg-body);
  font-size: 13px;
  outline: none;
}

.image-workbench-url-row button {
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
}

.image-workbench-url-row button:hover {
  background: var(--bg-hover);
  color: var(--fg-body);
}

.image-workbench-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.image-workbench-reference-grid .image-workbench-upload--tile {
  grid-column: 1 / -1;
}

.image-workbench-reference-thumb {
  position: relative;
}

.image-workbench-reference-thumb img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
}

.image-workbench-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.image-workbench-segmented button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.image-workbench-segmented button.is-active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.image-workbench-field-label {
  display: block;
  font-size: 12px;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

textarea.image-workbench-prompt {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: var(--bg-inset);
  color: var(--fg-body);
  font-size: 13px;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
}

.image-workbench-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.image-workbench-select span {
  font-size: 13px;
  color: var(--fg-muted);
}

.image-workbench-select select {
  width: 100%;
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs, 8px);
  background: var(--bg-inset);
  color: var(--fg-body);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.image-workbench-select select:hover {
  border-color: rgba(var(--accent-rgb), 0.34);
}

.image-workbench-select select:focus {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
}

.image-workbench-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.image-workbench-count span {
  font-size: 13px;
  color: var(--fg-muted);
}

.image-workbench-count div {
  display: flex;
  gap: 4px;
}

.image-workbench-count button {
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  cursor: pointer;
}

.image-workbench-count button.is-active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.image-workbench-actions {
  display: flex;
  gap: 8px;
  padding: 12px 0 0;
}

.image-workbench-actions button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.image-workbench-actions button:hover {
  background: var(--bg-hover);
  color: var(--fg-body);
}

.image-workbench-primary {
  border-color: var(--accent) !important;
  background: rgba(var(--accent-rgb), 0.1) !important;
  color: var(--accent) !important;
}

.image-workbench-primary:hover {
  background: rgba(var(--accent-rgb), 0.18) !important;
}

.image-workbench-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(var(--accent-rgb), 0.12) 1px, transparent 1.4px),
    var(--bg-inset);
  background-size: 22px 22px;
}

.image-workbench-canvas img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.image-workbench-canvas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  padding: 16px;
  width: 100%;
  align-content: start;
}

.image-workbench-canvas-grid img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.image-workbench-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  color: var(--fg-muted);
  font-size: 14px;
}

.image-workbench-empty .anticon {
  font-size: 40px;
  opacity: 0.35;
}

.image-workbench-empty strong {
  font-size: 18px;
  color: var(--fg-body, #eee);
}

.image-workbench-empty span {
  max-width: 320px;
  text-align: center;
  line-height: 1.5;
}

.image-workbench-empty--button {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s;
}

.image-workbench-empty--button:hover {
  color: var(--accent);
}

.image-workbench-inpaint-stage,
.image-workbench-camera-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.image-workbench-camera-stage {
  flex-direction: column;
  gap: 16px;
}

.image-workbench-inpaint-stage img,
.image-workbench-camera-stage img {
  max-width: 95%;
  max-height: 95%;
  border-radius: 8px;
  object-fit: contain;
}

.image-workbench-camera-stage img {
  max-height: 68%;
}

.image-workbench-inpaint-stage > span {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.image-workbench-camera-stage > span {
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}

/* Inpaint mask canvas */
.image-workbench-inpaint-canvas {
  display: block;
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.image-workbench-inpaint-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.image-workbench-inpaint-tool {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.image-workbench-inpaint-tool:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.image-workbench-camera-stage > .image-workbench-result-actions {
  width: min(360px, calc(100% - 32px));
}

.image-workbench-inpaint-tool.is-active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.image-workbench-inpaint-tool--done {
  color: #2dd4bf;
}

.image-workbench-inpaint-tool--done:hover {
  color: #5eead4;
}

.image-workbench-inpaint-edit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.image-workbench-inpaint-bottom-bar > .image-workbench-inpaint-edit-btn {
  position: static;
  transform: none;
}

.image-workbench-inpaint-edit-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.35);
}

.image-workbench-inpaint-stage {
  overflow: auto;
}

.image-workbench-inpaint-tool-divider {
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.2);
}

.image-workbench-inpaint-zoom-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  min-width: 36px;
  text-align: center;
  padding: 0 4px;
}

.image-workbench-inpaint-bottom-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  pointer-events: auto;
}

.image-workbench-inpaint-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.image-workbench-inpaint-zoom-controls button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  cursor: pointer;
}

.image-workbench-inpaint-zoom-controls button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.image-workbench-inpaint-zoom-controls span {
  position: static;
  transform: none;
  padding: 0 4px;
  background: none;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  min-width: 36px;
  text-align: center;
}

.image-workbench-panel--right .image-workbench-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.image-workbench-result-thumb {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  aspect-ratio: 1;
  transition: border-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.image-workbench-result-thumb:hover {
  border-color: var(--accent, #2dd4bf);
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-workbench-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-workbench-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.image-workbench-range span {
  min-width: 56px;
  font-size: 12px;
  color: var(--fg-muted);
}

.image-workbench-range input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.image-workbench-range em {
  min-width: 40px;
  font-size: 12px;
  font-style: normal;
  color: var(--fg-soft);
  text-align: right;
}

.image-workbench-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.image-workbench-chip-grid button {
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--fg-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.image-workbench-chip-grid button.is-active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.image-workbench-direction-pad {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.image-workbench-direction-pad button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--fg-muted);
  font-size: 14px;
  cursor: pointer;
}

.image-workbench-direction-pad button.is-active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.image-workbench-toggle {
  width: 36px;
  height: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-inset);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.image-workbench-toggle.is-active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.2);
}

.image-workbench-camera-prompt textarea {
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: var(--bg-inset);
  color: var(--fg-body);
  font-size: 13px;
  resize: vertical;
}

.image-workbench-camera-prompt textarea:disabled {
  opacity: 0.5;
}

.image-workbench-right-note {
  padding: 14px;
  border: 1px solid var(--border-weak);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.image-workbench-right-note h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-body);
}

.image-workbench-right-note span {
  font-size: 12px;
  color: var(--fg-soft);
}

.image-workbench-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.image-workbench-switch-row h3 {
  margin: 0;
}

.image-workbench-status {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  border-top: 1px solid var(--border-weak);
  background: var(--bg-panel);
  font-size: 12px;
  overflow: hidden;
}

.image-workbench-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), 0.58));
  pointer-events: none;
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.image-workbench-status span {
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-weight: 500;
}

.image-workbench-status p {
  flex: 1;
  margin: 0;
  color: var(--fg-muted);
}

.image-workbench-status em {
  font-style: normal;
  color: var(--fg-soft);
}

/* BeforeAfterCompare generic component */
.before-after-compare {
  --compare-position: 50%;
  position: relative;
  display: block;
  width: min(100%, 980px);
  aspect-ratio: var(--compare-aspect-ratio, 16 / 9);
  max-height: 72vh;
  overflow: hidden;
  border: 1px solid var(--border-weak);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 50%, rgba(118, 150, 255, 0.08) 50% 100%),
    var(--bg-inset);
}

.before-after-compare__layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.before-after-compare__layer--source {
  clip-path: inset(0 calc(100% - var(--compare-position)) 0 0);
  background: rgba(0, 0, 0, 0.08);
}

.before-after-compare__layer--result {
  clip-path: inset(0 0 0 var(--compare-position));
  background: rgba(105, 137, 255, 0.08);
}

.before-after-compare__layer img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.before-after-compare__layer--source img {
  filter: saturate(0.82) contrast(0.86) brightness(0.88);
}

.before-after-compare__layer--result img {
  filter: saturate(1.12) contrast(1.08) brightness(1.03);
  transform: none;
  transform-origin: center;
}

.before-after-compare__label {
  position: absolute;
  top: 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 20px;
  color: rgb(255 255 255);
  font-size: 14px;
  font-weight: 800;
}

.before-after-compare__label--source {
  left: 0;
  background: rgba(0, 0, 0, 0.34);
}

.before-after-compare__label--result {
  left: var(--compare-position);
  background: rgba(65, 116, 246, 0.42);
}

.before-after-compare__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--compare-position);
  z-index: 4;
  width: 2px;
  padding: 0;
  border: 0;
  background: rgb(37 102 244);
  cursor: ew-resize;
  touch-action: none;
  transform: translateX(-50%);
}

.before-after-compare__divider:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: 4px;
}

.before-after-compare__divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgb(37 102 244);
  box-shadow: none;
  transform: translate(-50%, -50%);
}

.before-after-compare__divider span::before,
.before-after-compare__divider span::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.before-after-compare__divider span::before {
  left: 9px;
  border-right: 6px solid rgb(255 255 255);
}

.before-after-compare__divider span::after {
  right: 9px;
  border-left: 6px solid rgb(255 255 255);
}

/* Resolution Upscale specific */
.resolution-upscale-compare-stage {
  --resolution-compare-position: 50%;
  position: relative;
  display: block;
  width: min(100%, 980px);
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  overflow: hidden;
  border: 1px solid var(--border-weak);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 50%, rgba(118, 150, 255, 0.08) 50% 100%),
    var(--bg-inset);
}

.resolution-upscale-compare__image {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.resolution-upscale-compare__image--source {
  clip-path: inset(0 calc(100% - var(--resolution-compare-position)) 0 0);
  background: rgba(0, 0, 0, 0.08);
}

.resolution-upscale-compare__image--result {
  clip-path: inset(0 0 0 var(--resolution-compare-position));
  background: rgba(105, 137, 255, 0.08);
}

.resolution-upscale-compare__image img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.resolution-upscale-compare__image--source img {
  filter: saturate(0.82) contrast(0.86) brightness(0.88);
}

.resolution-upscale-compare__image--result img {
  filter: saturate(1.12) contrast(1.08) brightness(1.03);
  transform: none;
  transform-origin: center;
}

.resolution-upscale-compare__label {
  position: absolute;
  top: 0;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 20px;
  color: rgb(255 255 255);
  font-size: 14px;
  font-weight: 800;
}

.resolution-upscale-compare__label--source {
  left: 0;
  background: rgba(0, 0, 0, 0.34);
}

.resolution-upscale-compare__label--result {
  left: var(--resolution-compare-position);
  background: rgba(65, 116, 246, 0.42);
}

.resolution-upscale-compare__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--resolution-compare-position);
  z-index: 4;
  width: 2px;
  padding: 0;
  border: 0;
  background: rgb(37 102 244);
  cursor: ew-resize;
  touch-action: none;
  transform: translateX(-50%);
}

.resolution-upscale-compare__divider:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: 4px;
}

.resolution-upscale-compare__divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgb(37 102 244);
  box-shadow: none;
  transform: translate(-50%, -50%);
}

.resolution-upscale-compare__divider span::before,
.resolution-upscale-compare__divider span::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.resolution-upscale-compare__divider span::before {
  left: 9px;
  border-right: 6px solid rgb(255 255 255);
}

.resolution-upscale-compare__divider span::after {
  right: 9px;
  border-left: 6px solid rgb(255 255 255);
}

/* Video style chips */
.resolution-upscale-style-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resolution-upscale-style-chips__title {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.resolution-upscale-style-chips__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.resolution-upscale-style-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border-weak);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.resolution-upscale-style-chip:hover {
  border-color: var(--border-medium, var(--border-weak));
  background: var(--bg-hover, var(--bg-elevated));
}

.resolution-upscale-style-chip.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-weight: 600;
}

.resolution-upscale-style-chip__swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Video toggle */
.resolution-upscale-video-toggle {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 5;
  display: inline-flex;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  overflow: hidden;
  transform: translateX(-50%);
}

.resolution-upscale-video-toggle button {
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.resolution-upscale-video-toggle button:hover {
  color: #fff;
}

.resolution-upscale-video-toggle button.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.resolution-upscale-video-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.resolution-upscale-video-stage video {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.resolution-upscale-video-stage span {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
}

.resolution-upscale-image-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 12px;
}

.resolution-upscale-image-stage > .before-after-compare {
  flex: 0 1 auto;
  width: min(100%, 980px);
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
}

.resolution-upscale-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.resolution-upscale-result-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}

.resolution-upscale-result-actions button:hover:not(:disabled) {
  background: var(--accent);
}

.resolution-upscale-result-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.resolution-upscale-video-header {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.resolution-upscale-video-header .resolution-upscale-video-toggle {
  position: static;
  transform: none;
}

.resolution-upscale-video-header .resolution-upscale-result-actions {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.6);
}

/* === Watermark Removal === */
.watermark-removal-hint {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.watermark-removal-actions {
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 0;
}

.watermark-removal-actions .image-workbench-primary {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  font-size: 14px;
  font-weight: 750;
}

.watermark-removal-actions .image-workbench-cancel {
  width: 100%;
  min-height: 42px;
  justify-content: center;
  font-size: 13px;
}

.watermark-removal-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  height: 100%;
  padding: 16px;
}

.watermark-removal-compare__panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  overflow: hidden;
}

.watermark-removal-compare__panel img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.watermark-removal-compare__label {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
}

.watermark-removal-compare__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.watermark-removal-compare__placeholder .anticon {
  font-size: 32px;
  opacity: 0.4;
}

.watermark-removal-compare__actions {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(480px, calc(100% - 32px));
}

.watermark-removal-compare__actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 64px;
  padding: 0 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: var(--bg-inset);
  color: var(--fg-body);
  font: inherit;
  font-size: 18px;
  font-weight: 750;
  cursor: pointer;
  backdrop-filter: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.watermark-removal-compare__actions button:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--accent);
}

.watermark-removal-compare__actions button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

/* === Utility tool left panels: upscale, watermark removal, subtitle removal === */
@media (min-width: 861px) {
  .resolution-upscale-page > .image-workbench-layout--camera,
  .watermark-removal-page > .image-workbench-layout--camera,
  .subtitle-removal-page > .image-workbench-layout--camera {
    grid-template-columns: 400px minmax(0, 1fr);
  }
}

@media (min-width: 1440px) {
  .resolution-upscale-page > .image-workbench-layout--camera,
  .watermark-removal-page > .image-workbench-layout--camera,
  .subtitle-removal-page > .image-workbench-layout--camera {
    grid-template-columns: 420px minmax(0, 1fr);
  }
}

.resolution-upscale-page .image-workbench-panel--left,
.watermark-removal-page .image-workbench-panel--left,
.subtitle-removal-page .image-workbench-panel--left {
  gap: 12px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.012), transparent 42%),
    var(--bg-panel);
  scrollbar-color: color-mix(in srgb, var(--accent) 34%, transparent) transparent;
}

.resolution-upscale-page .image-workbench-control-card,
.watermark-removal-page .image-workbench-control-card,
.subtitle-removal-page .image-workbench-control-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-color: color-mix(in srgb, var(--border-weak) 88%, white 8%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.024), transparent),
    color-mix(in srgb, var(--bg-elevated) 94%, black 6%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.025) inset;
}

.resolution-upscale-page .image-workbench-control-card h3,
.watermark-removal-page .image-workbench-control-card h3,
.subtitle-removal-page .image-workbench-control-card h3 {
  margin: 0;
  color: var(--fg-body);
  font-size: 13px;
  font-weight: 820;
}

.resolution-upscale-page .image-workbench-section-title,
.watermark-removal-page .image-workbench-section-title,
.subtitle-removal-page .image-workbench-section-title {
  min-height: 24px;
  margin-bottom: 0;
}

.resolution-upscale-page .image-workbench-section-title h3,
.watermark-removal-page .image-workbench-section-title h3,
.subtitle-removal-page .image-workbench-section-title h3 {
  font-weight: 850;
}

.resolution-upscale-page .image-workbench-section-title span,
.watermark-removal-page .image-workbench-section-title span,
.subtitle-removal-page .image-workbench-section-title span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 68%, transparent);
  border-radius: 999px;
  background: var(--bg-inset);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 700;
}

.resolution-upscale-page .image-workbench-upload,
.watermark-removal-page .image-workbench-upload,
.subtitle-removal-page .image-workbench-upload {
  min-height: 126px;
  padding: 16px;
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 78%),
    var(--bg-inset);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.resolution-upscale-page .image-workbench-upload:hover,
.watermark-removal-page .image-workbench-upload:hover,
.subtitle-removal-page .image-workbench-upload:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border-subtle));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 78%),
    var(--bg-hover);
}

.resolution-upscale-page .image-workbench-upload .anticon,
.watermark-removal-page .image-workbench-upload .anticon,
.subtitle-removal-page .image-workbench-upload .anticon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 22px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent) inset;
}

.resolution-upscale-page .image-workbench-upload strong,
.watermark-removal-page .image-workbench-upload strong,
.subtitle-removal-page .image-workbench-upload strong {
  max-width: 100%;
  color: var(--fg-body);
  font-weight: 820;
  line-height: 1.35;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resolution-upscale-page .image-workbench-upload span,
.watermark-removal-page .image-workbench-upload span,
.subtitle-removal-page .image-workbench-upload span {
  max-width: 100%;
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.resolution-upscale-page .image-workbench-upload:has(img),
.watermark-removal-page .image-workbench-upload:has(img) {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: start;
  min-height: 116px;
  column-gap: 14px;
  row-gap: 4px;
  text-align: left;
}

.resolution-upscale-page .image-workbench-upload:has(img) img,
.watermark-removal-page .image-workbench-upload:has(img) img {
  grid-row: 1 / 3;
  width: 88px;
  height: 88px;
  max-width: none;
  max-height: none;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, white 10%);
  border-radius: var(--radius-xs);
  background: var(--bg-inset);
  object-fit: contain;
}

.resolution-upscale-page .image-workbench-upload:has(img) strong,
.watermark-removal-page .image-workbench-upload:has(img) strong,
.resolution-upscale-page .image-workbench-upload:has(img) span,
.watermark-removal-page .image-workbench-upload:has(img) span {
  text-align: left;
}

.resolution-upscale-page .image-workbench-url-row,
.watermark-removal-page .image-workbench-url-row,
.subtitle-removal-page .image-workbench-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 8px;
  margin-top: 0;
}

.resolution-upscale-page .image-workbench-url-row label,
.watermark-removal-page .image-workbench-url-row label,
.subtitle-removal-page .image-workbench-url-row label,
.resolution-upscale-page .image-workbench-url-row button,
.watermark-removal-page .image-workbench-url-row button,
.subtitle-removal-page .image-workbench-url-row button {
  min-height: 36px;
  border-color: color-mix(in srgb, var(--border-subtle) 82%, white 10%);
  border-radius: var(--radius-xs);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.018), transparent),
    var(--bg-inset);
}

.resolution-upscale-page .image-workbench-select {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--bg-inset) 94%, transparent);
}

.resolution-upscale-page .image-workbench-select span {
  color: var(--fg-muted);
  font-weight: 750;
  line-height: 1.25;
}

.resolution-upscale-page .image-workbench-select select {
  min-height: 34px;
  border-color: color-mix(in srgb, var(--border-subtle) 82%, white 10%);
  background-color: var(--bg-inset);
}

.resolution-upscale-page .resolution-upscale-scale-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.resolution-upscale-page .resolution-upscale-scale-option {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-width: 0;
  min-height: 64px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, white 10%);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.018), transparent),
    var(--bg-inset);
  color: var(--fg-muted);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.resolution-upscale-page .resolution-upscale-scale-option:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent),
    var(--bg-hover);
  color: var(--fg-body);
  transform: translateY(-1px);
}

.resolution-upscale-page .resolution-upscale-scale-option.is-active {
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, var(--bg-inset));
  color: var(--accent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent) inset,
    0 12px 24px rgb(0 255 136 / 0.08);
}

.resolution-upscale-page .resolution-upscale-scale-option strong {
  color: var(--fg-body);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.resolution-upscale-page .resolution-upscale-scale-option.is-active strong {
  color: var(--accent);
}

.resolution-upscale-page .resolution-upscale-scale-option span {
  color: currentColor;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  opacity: 0.8;
}

.resolution-upscale-page .image-workbench-actions,
.watermark-removal-page .image-workbench-actions,
.subtitle-removal-page .image-workbench-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding-top: 10px;
}

.resolution-upscale-page .image-workbench-actions button,
.watermark-removal-page .image-workbench-actions button,
.subtitle-removal-page .image-workbench-actions button {
  min-height: 46px;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
}

.resolution-upscale-page .image-workbench-actions .image-workbench-primary,
.watermark-removal-page .image-workbench-actions .image-workbench-primary,
.subtitle-removal-page .image-workbench-actions .image-workbench-primary {
  width: 100%;
  border-color: color-mix(in srgb, var(--accent) 82%, white 18%) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, white 16%, transparent), transparent),
    var(--accent) !important;
  color: #061014 !important;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.2) inset,
    0 12px 26px rgb(0 255 136 / 0.13);
}

.resolution-upscale-page .image-workbench-actions .image-workbench-primary:hover:not(:disabled),
.watermark-removal-page .image-workbench-actions .image-workbench-primary:hover:not(:disabled),
.subtitle-removal-page .image-workbench-actions .image-workbench-primary:hover:not(:disabled) {
  background:
    linear-gradient(180deg, color-mix(in srgb, white 22%, transparent), transparent),
    var(--accent-hover) !important;
  color: #061014 !important;
  transform: translateY(-1px);
}

.resolution-upscale-page .image-workbench-actions button:not(.image-workbench-primary),
.watermark-removal-page .image-workbench-actions button:not(.image-workbench-primary),
.subtitle-removal-page .image-workbench-actions button:not(.image-workbench-primary) {
  border-color: color-mix(in srgb, var(--border-subtle) 80%, white 12%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.025), transparent),
    var(--bg-inset);
  color: var(--fg-muted);
}

.watermark-removal-page .watermark-removal-hint {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--bg-inset) 94%, transparent);
  color: var(--fg-muted);
}

.watermark-removal-page .watermark-removal-actions {
  padding-top: 10px;
}

.watermark-removal-page .watermark-removal-actions .image-workbench-primary {
  min-height: 46px;
  font-size: 13px;
}

@media (max-width: 860px) {
  .resolution-upscale-page > .image-workbench-layout--camera,
  .watermark-removal-page > .image-workbench-layout--camera,
  .subtitle-removal-page > .image-workbench-layout--camera {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    overflow: visible;
  }

  .resolution-upscale-page .image-workbench-panel--left,
  .watermark-removal-page .image-workbench-panel--left,
  .subtitle-removal-page .image-workbench-panel--left {
    overflow: visible;
    max-height: none;
  }
}

/* === Generation Progress & Results === */
.image-workbench-generating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  color: var(--fg-muted);
}

.image-workbench-generating strong {
  font-size: 22px;
  color: var(--fg-default);
}

.image-workbench-progress-bar {
  width: min(420px, 80%);
  height: 10px;
  border-radius: 5px;
  background: var(--bg-inset);
  overflow: hidden;
}

.image-workbench-progress-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, white));
  transition: width 0.35s ease;
}

.image-workbench-cancel {
  margin-top: 12px;
  padding: 8px 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--fg-muted);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.image-workbench-cancel:hover {
  background: var(--bg-hover);
  color: var(--fg-default);
}

.image-workbench-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  align-content: center;
  justify-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 32px;
  overflow-y: auto;
  gap: 20px;
}

.image-workbench-result-item {
  display: block;
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  border: 1px solid var(--border-weak);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.image-workbench-result-item:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(var(--accent-rgb, 45, 212, 191), 0.1);
  transform: translateY(-2px);
}

.image-workbench-result-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: var(--bg-inset);
  transition: transform 300ms ease;
}

.image-workbench-result-item:hover img {
  transform: scale(1.02);
}

.image-workbench-result-card {
  display: grid;
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 560px;
  align-content: start;
  gap: 14px;
}

.image-workbench-result-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--error) 55%, white 12%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--error) 82%, black 18%);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  box-shadow: 0 12px 24px rgb(0 0 0 / 0.24);
  transform: translateY(-4px) scale(0.96);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.image-workbench-result-card:hover .image-workbench-result-remove,
.image-workbench-result-card:focus-within .image-workbench-result-remove {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.image-workbench-result-remove:hover {
  background: var(--error);
}

.image-workbench-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.image-workbench-result-actions button {
  display: inline-flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  background: var(--bg-inset);
  color: var(--fg-body);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.image-workbench-result-actions button:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--accent);
}

.image-workbench-result-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.image-workbench-inpaint-bottom-bar .image-workbench-result-actions {
  flex: 1 1 260px;
}

.image-workbench-empty--error {
  color: var(--fg-muted);
}

.image-workbench-empty--error strong {
  color: var(--error, #ef4444);
}

.image-workbench-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Result card entrance animation */
@keyframes image-workbench-result-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.image-workbench-result-card {
  animation: image-workbench-result-enter 0.4s ease-out both;
}

.image-workbench-result-card:nth-child(2) { animation-delay: 0.08s; }
.image-workbench-result-card:nth-child(3) { animation-delay: 0.16s; }
.image-workbench-result-card:nth-child(4) { animation-delay: 0.24s; }

/* Scoped adjustments from image workbench review comments. */
@media (min-width: 861px) {
  .image-workbench-page--image-tool > .image-workbench-layout:not(.image-workbench-layout--camera):not(.image-workbench-layout--inpaint),
  .image-workbench-page--image-tool > .image-workbench-layout--camera,
  .image-workbench-page--image-tool > .image-workbench-layout--inpaint {
    grid-template-columns: 400px minmax(0, 1fr);
  }
}

@media (min-width: 1440px) {
  .image-workbench-page--image-tool > .image-workbench-layout:not(.image-workbench-layout--camera):not(.image-workbench-layout--inpaint),
  .image-workbench-page--image-tool > .image-workbench-layout--camera,
  .image-workbench-page--image-tool > .image-workbench-layout--inpaint {
    grid-template-columns: 420px minmax(0, 1fr);
  }
}

.image-workbench-page--image-tool .image-workbench-mode-card {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
}

.image-workbench-page--image-tool .image-workbench-mode-card h3 {
  margin: 0;
  white-space: nowrap;
}

.image-workbench-page--image-tool .image-workbench-mode-card .image-workbench-segmented {
  justify-content: stretch;
}

.image-workbench-page--image-tool .image-workbench-prompt textarea {
  min-height: 132px;
}

.image-workbench-page--image-tool .image-workbench-panel--left {
  gap: 11px;
}

.image-workbench-page--image-tool .image-workbench-control-card {
  border-color: color-mix(in srgb, var(--border-weak) 88%, white 8%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.025) inset;
}

.image-workbench-page--image-tool .image-workbench-section-title {
  margin-bottom: 12px;
}

.image-workbench-page--image-tool .image-workbench-url-row {
  margin-top: 12px;
}

.image-workbench-page--image-tool .image-workbench-url-row label,
.image-workbench-page--image-tool .image-workbench-url-row button {
  min-height: 36px;
}

.image-workbench-page--image-tool .image-workbench-output-card {
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 12px;
}

.image-workbench-page--image-tool .image-workbench-output-card h3 {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.image-workbench-page--image-tool .image-workbench-output-card .image-workbench-field-label {
  grid-column: 1;
  margin: 0;
  align-self: center;
  color: var(--fg-muted);
  font-weight: 700;
}

.image-workbench-page--image-tool .image-workbench-output-card > .image-workbench-segmented {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.image-workbench-page--image-tool .image-workbench-output-card > .image-workbench-segmented button,
.image-workbench-page--image-tool .image-workbench-count button {
  min-width: 0;
  min-height: 34px;
  padding-inline: 8px;
  border-radius: 9px;
  font-weight: 750;
}

.image-workbench-page--image-tool .image-workbench-count {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.image-workbench-page--image-tool .image-workbench-count > span {
  color: var(--fg-muted);
  font-weight: 700;
}

.image-workbench-page--image-tool .image-workbench-count > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.image-workbench-page--image-tool .image-workbench-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.82fr);
  gap: 10px;
  padding-top: 10px;
}

.image-workbench-page--image-tool .image-workbench-actions button {
  min-width: 0;
  min-height: 44px;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
}

.image-workbench-page--image-tool .image-workbench-actions .image-workbench-primary {
  border-color: color-mix(in srgb, var(--accent) 82%, white 18%) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, white 16%, transparent), transparent),
    var(--accent) !important;
  color: #061014 !important;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.2) inset,
    0 10px 24px rgb(0 255 136 / 0.14);
}

.image-workbench-page--image-tool .image-workbench-actions .image-workbench-primary:hover:not(:disabled) {
  background:
    linear-gradient(180deg, color-mix(in srgb, white 22%, transparent), transparent),
    var(--accent-hover) !important;
  color: #061014 !important;
  transform: translateY(-1px);
}

.image-workbench-page--image-tool .image-workbench-actions button:not(.image-workbench-primary) {
  border-color: color-mix(in srgb, var(--border-subtle) 80%, white 12%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.025), transparent),
    var(--bg-inset);
  color: var(--fg-muted);
}

.image-workbench-page--image-tool .image-workbench-actions button:not(.image-workbench-primary):hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
  background: var(--bg-hover);
  color: var(--fg-body);
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-params-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 12px;
  padding: 15px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.026), transparent),
    color-mix(in srgb, var(--bg-elevated) 94%, black 6%);
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-params-card h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--fg-body);
  font-weight: 850;
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-params-card .image-workbench-field-label {
  margin: 0;
  color: var(--fg-muted);
  font-weight: 750;
  line-height: 1.2;
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-params-card .image-workbench-segmented {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, white 10%);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-params-card .image-workbench-segmented button {
  min-width: 0;
  min-height: 34px;
  padding-inline: 5px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  font-weight: 750;
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-params-card .image-workbench-segmented button:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-params-card .image-workbench-segmented button.is-active {
  border-color: color-mix(in srgb, var(--accent) 64%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent) inset;
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-prompt-card {
  display: grid;
  gap: 11px;
  padding: 15px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.026), transparent),
    color-mix(in srgb, var(--bg-elevated) 94%, black 6%);
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-prompt-card h3 {
  margin: 0;
  color: var(--fg-body);
  font-weight: 850;
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-prompt-card textarea.image-workbench-prompt {
  min-height: 152px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border-color: color-mix(in srgb, var(--border-subtle) 82%, white 10%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.018), transparent),
    var(--bg-inset);
  line-height: 1.62;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-inpaint-prompt-card textarea.image-workbench-prompt:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-inset) 94%, var(--accent) 6%);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 13%, transparent),
    0 12px 28px rgb(0 0 0 / 0.12);
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-actions {
  grid-template-columns: minmax(0, 1fr);
  padding-top: 8px;
}

.image-workbench-page--image-tool .image-workbench-layout--inpaint .image-workbench-actions .image-workbench-primary {
  width: 100%;
  min-height: 46px;
  border-radius: var(--radius-sm);
  letter-spacing: 0;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.18) inset,
    0 12px 26px rgb(0 255 136 / 0.13);
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-prompt {
  display: grid;
  gap: 11px;
  padding: 15px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.026), transparent),
    color-mix(in srgb, var(--bg-elevated) 94%, black 6%);
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-prompt .image-workbench-section-title {
  margin-bottom: 0;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-prompt h3 {
  color: var(--fg-body);
  font-weight: 850;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-prompt textarea {
  min-height: 112px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border-color: color-mix(in srgb, var(--border-subtle) 82%, white 10%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.018), transparent),
    var(--bg-inset);
  line-height: 1.62;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-prompt textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-inset) 94%, var(--accent) 6%);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 13%, transparent),
    0 12px 28px rgb(0 0 0 / 0.12);
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-actions {
  grid-template-columns: minmax(0, 1fr);
  padding-top: 8px;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-actions .image-workbench-primary {
  width: 100%;
  min-height: 46px;
  border-radius: var(--radius-sm);
  letter-spacing: 0;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.18) inset,
    0 12px 26px rgb(0 255 136 / 0.13);
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-panel--left {
  gap: 10px;
  scrollbar-color: color-mix(in srgb, var(--accent) 34%, transparent) transparent;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-control-card {
  padding: 14px;
  border-color: color-mix(in srgb, var(--border-weak) 86%, white 8%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.022), transparent),
    color-mix(in srgb, var(--bg-elevated) 94%, black 6%);
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-control-card h3 {
  color: var(--fg-body);
  font-weight: 820;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-material .image-workbench-upload,
.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-panel--left > .image-workbench-control-card:first-child .image-workbench-upload {
  min-height: 118px;
  padding: 16px;
  border-style: solid;
  border-color: color-mix(in srgb, var(--border-subtle) 76%, white 8%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 74%),
    var(--bg-inset);
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-material .image-workbench-upload .anticon,
.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-panel--left > .image-workbench-control-card:first-child .image-workbench-upload .anticon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 20px;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-material .image-workbench-url-row,
.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-panel--left > .image-workbench-control-card:first-child .image-workbench-url-row {
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 8px;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-presets .image-workbench-chip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-presets .image-workbench-chip-grid button,
.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-effects .image-workbench-chip {
  min-width: 0;
  min-height: 31px;
  padding: 0 8px !important;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.016), transparent),
    var(--bg-inset) !important;
  color: var(--fg-muted) !important;
  font-size: 12px !important;
  font-weight: 650;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-presets .image-workbench-chip-grid button:hover,
.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-effects .image-workbench-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle)) !important;
  color: var(--fg-body) !important;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-presets .image-workbench-chip-grid button.is-active,
.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-effects .image-workbench-chip.is-active {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent) !important;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-inset)) !important;
  color: var(--accent) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent) inset;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-direction {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 9px;
  min-height: 164px;
  padding: 12px 14px 14px;
  overflow: hidden;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-direction h3 {
  margin: 0;
  align-self: start;
  color: var(--fg-body);
  font-weight: 820;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-direction-pad {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  grid-template-rows: repeat(3, 30px);
  align-self: center;
  justify-self: center;
  justify-content: center;
  width: 118px;
  gap: 5px;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.018), transparent),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 66%),
    var(--bg-inset);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.025) inset;
  box-sizing: border-box;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-direction-pad button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-inset);
  line-height: 1;
  font-size: 12px;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-direction-pad button:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-direction-pad button:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-direction-pad button:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-direction-pad button:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-direction-pad button:nth-child(5) {
  grid-column: 2;
  grid-row: 3;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-direction-pad button:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
  color: var(--fg-body);
  transform: translateY(-1px);
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-fine {
  display: grid;
  gap: 12px;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-fine h3 {
  margin-bottom: 0;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-fine .image-workbench-range {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 44px;
  gap: 10px;
  margin: 0;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-fine .image-workbench-range span {
  min-width: 0;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-fine .image-workbench-range input[type="range"] {
  min-width: 0;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-effects .image-workbench-section-title {
  margin-bottom: 10px;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-effects .image-workbench-section-title span {
  font-weight: 700;
}

.image-workbench-page--image-tool .image-workbench-layout--camera .image-workbench-camera-effects > div:last-child {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px !important;
}

.image-workbench-page--image-tool .image-workbench-canvas .studio-canvas-ghost {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: min(460px, 92%);
  padding: 28px 34px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, transparent);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%),
    rgb(0 0 0 / 0.12);
  text-align: center;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.04) inset,
    0 16px 34px rgb(0 0 0 / 0.16);
}

.image-workbench-page--image-tool .image-workbench-canvas .studio-canvas-ghost:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    rgb(0 0 0 / 0.16);
  outline: none;
}

.image-workbench-page--image-tool .image-workbench-canvas .studio-canvas-ghost__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 26px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent) inset;
}

.image-workbench-page--image-tool .image-workbench-canvas .studio-canvas-ghost__title {
  color: var(--fg-body);
  font-size: 16px;
  font-weight: 850;
}

.image-workbench-page--image-tool .image-workbench-canvas .studio-canvas-ghost__hint {
  max-width: 390px;
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.6;
}

.image-workbench-page--image-tool .image-workbench-canvas .studio-canvas-image {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: clamp(18px, 2.4vw, 34px);
  overflow: hidden;
  box-sizing: border-box;
}

.image-workbench-page--image-tool .image-workbench-canvas .studio-canvas-image img {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: calc(100% - 2px);
  max-height: calc(100% - 2px);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, white 10%);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  box-sizing: border-box;
  object-fit: contain;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.04) inset,
    0 16px 36px rgb(0 0 0 / 0.22);
}

.image-workbench-page--image-tool .image-workbench-result-grid:has(.image-workbench-result-card:only-child) {
  grid-template-columns: minmax(0, 1fr);
  align-content: stretch;
  place-items: center;
  padding: clamp(18px, 2.4vw, 34px);
  overflow: hidden;
}

.image-workbench-page--image-tool .image-workbench-result-grid:has(.image-workbench-result-card:only-child) .image-workbench-result-card {
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(74%, 680px);
  height: min(100%, 940px);
  max-width: calc(100% - 4px);
  max-height: calc(100% - 4px);
  align-content: stretch;
  gap: 0;
}

.image-workbench-page--image-tool .image-workbench-result-grid:has(.image-workbench-result-card:only-child) .image-workbench-result-item {
  display: grid;
  min-height: 0;
  place-items: center;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-inset);
}

.image-workbench-page--image-tool .image-workbench-result-grid:has(.image-workbench-result-card:only-child) .image-workbench-result-item img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  box-sizing: border-box;
}

.image-workbench-page--image-tool .image-workbench-result-grid:has(.image-workbench-result-card:only-child) .image-workbench-result-actions {
  border: 1px solid var(--border-weak);
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: color-mix(in srgb, var(--bg-elevated) 92%, black 8%);
  overflow: hidden;
}

.image-workbench-page--image-tool .image-workbench-result-grid:has(.image-workbench-result-card:only-child) .image-workbench-result-actions button {
  min-height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

@media (max-width: 1180px) {
  .image-workbench-page--image-tool .image-workbench-result-grid:has(.image-workbench-result-card:only-child) .image-workbench-result-card {
    width: min(82%, 620px);
  }
}

.image-workbench-page--image-tool .image-workbench-upload:has(img) {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: start;
  min-height: 112px;
  padding: 14px;
  column-gap: 14px;
  row-gap: 4px;
  text-align: left;
}

.image-workbench-page--image-tool .image-workbench-upload:has(img) img {
  grid-row: 1 / 3;
  width: 84px;
  height: 96px;
  max-width: none;
  max-height: none;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, white 12%);
  border-radius: var(--radius-xs);
  background: var(--bg-inset);
  object-fit: contain;
}

.image-workbench-page--image-tool .image-workbench-upload:has(img) strong {
  align-self: end;
}

.image-workbench-page--image-tool .image-workbench-upload:has(img) span {
  align-self: start;
}

.image-workbench-page--image-tool .image-workbench-reference-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 92px;
  max-height: 238px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: color-mix(in srgb, var(--accent) 34%, transparent) transparent;
}

.image-workbench-page--image-tool .image-workbench-reference-grid .image-workbench-upload--tile {
  grid-column: auto;
  order: -1;
  display: grid;
  grid-template-rows: auto auto auto;
  place-items: center;
  height: 92px;
  min-height: 92px;
  padding: 10px 8px;
  gap: 4px;
  border-style: solid;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent),
    var(--bg-inset);
}

.image-workbench-page--image-tool .image-workbench-reference-grid .image-workbench-upload--tile strong,
.image-workbench-page--image-tool .image-workbench-reference-grid .image-workbench-upload--tile span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.image-workbench-page--image-tool .image-workbench-reference-grid .image-workbench-upload--tile .anticon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 18px;
}

.image-workbench-page--image-tool .image-workbench-reference-grid .image-workbench-upload--tile strong {
  font-size: 12px;
}

.image-workbench-page--image-tool .image-workbench-reference-grid .image-workbench-upload--tile span {
  font-size: 11px;
}

.image-workbench-page--image-tool .image-workbench-reference-thumb {
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius-xs);
}

.image-workbench-page--image-tool .image-workbench-reference-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, white 10%);
  border-radius: var(--radius-xs);
  background: var(--bg-inset);
  box-sizing: border-box;
  object-fit: contain;
}

.image-workbench-page--image-tool .image-workbench-reference-thumb .image-workbench-upload-remove {
  top: 5px;
  right: 5px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px) scale(0.94);
}

.image-workbench-page--image-tool .image-workbench-reference-thumb:hover .image-workbench-upload-remove,
.image-workbench-page--image-tool .image-workbench-reference-thumb:focus-within .image-workbench-upload-remove {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.image-workbench-page--image-tool .image-workbench-upload-shell .image-workbench-upload-remove,
.resolution-upscale-page .image-workbench-upload-shell .image-workbench-upload-remove,
.watermark-removal-page .image-workbench-upload-shell .image-workbench-upload-remove,
.subtitle-removal-page .image-workbench-upload-shell .image-workbench-upload-remove {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px) scale(0.94);
}

.image-workbench-page--image-tool .image-workbench-upload-shell:hover .image-workbench-upload-remove,
.resolution-upscale-page .image-workbench-upload-shell:hover .image-workbench-upload-remove,
.watermark-removal-page .image-workbench-upload-shell:hover .image-workbench-upload-remove,
.subtitle-removal-page .image-workbench-upload-shell:hover .image-workbench-upload-remove {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.image-workbench-page--image-tool .image-workbench-upload-shell .image-workbench-upload-remove:focus-visible,
.resolution-upscale-page .image-workbench-upload-shell .image-workbench-upload-remove:focus-visible,
.watermark-removal-page .image-workbench-upload-shell .image-workbench-upload-remove:focus-visible,
.subtitle-removal-page .image-workbench-upload-shell .image-workbench-upload-remove:focus-visible {
  opacity: 1;
  pointer-events: auto;
  outline: 2px solid color-mix(in srgb, var(--error, #ef4444) 62%, transparent);
  outline-offset: 2px;
  transform: translateY(0) scale(1);
}

.image-workbench-page--image-tool .image-workbench-mode-card {
  min-height: 58px;
  padding-block: 12px;
  border-color: color-mix(in srgb, var(--border-weak) 86%, white 10%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.025), transparent),
    color-mix(in srgb, var(--bg-elevated) 92%, black 8%);
}

.image-workbench-page--image-tool .image-workbench-mode-card h3 {
  color: var(--fg-body);
  font-weight: 850;
}

.image-workbench-page--image-tool .image-workbench-mode-card .image-workbench-segmented {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 80%, white 10%);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  gap: 3px;
}

.image-workbench-page--image-tool .image-workbench-mode-card .image-workbench-segmented button {
  min-height: 32px;
  min-width: 0;
  padding-inline: 12px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
}

.image-workbench-page--image-tool .image-workbench-mode-card .image-workbench-segmented button.is-active {
  border-color: color-mix(in srgb, var(--accent) 58%, transparent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent) inset;
}

.image-workbench-page--image-tool .image-workbench-canvas-grid {
  place-items: center;
  align-content: center;
  padding: clamp(18px, 2.4vw, 34px);
}

.image-workbench-page--image-tool .image-workbench-canvas-grid img {
  object-fit: contain;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 76%, white 10%);
  background: var(--bg-inset);
  box-shadow: 0 14px 30px rgb(0 0 0 / 0.16);
}

@media (max-width: 860px) {
  .image-workbench-page--image-tool {
    height: auto;
    min-height: 100%;
    overflow: auto;
    padding: 0 12px max(72px, env(safe-area-inset-bottom));
    box-sizing: border-box;
  }

  .image-workbench-page--image-tool .image-workbench-topbar {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    min-width: 0;
    min-height: 52px;
    padding: 8px 0;
    overflow: hidden;
  }

  .image-workbench-page--image-tool .image-workbench-back-to-more {
    flex: 0 0 auto;
  }

  .image-workbench-page--image-tool .image-workbench-tool-strip {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .image-workbench-page--image-tool .image-workbench-tool-strip::-webkit-scrollbar {
    display: none;
  }

  .image-workbench-page--image-tool .image-workbench-tool-strip button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .image-workbench-page--image-tool .image-workbench-subbar {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    min-width: 0;
    min-height: 52px;
    padding: 8px 0;
    overflow: hidden;
  }

  .image-workbench-page--image-tool .image-workbench-subbar__heading {
    flex: 0 1 auto;
    min-width: 0;
  }

  .image-workbench-page--image-tool .image-workbench-mode-tabs {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 3px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .image-workbench-page--image-tool .image-workbench-mode-tabs::-webkit-scrollbar {
    display: none;
  }

  .image-workbench-page--image-tool .image-workbench-mode-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .image-workbench-page--image-tool > .image-workbench-layout,
  .image-workbench-page--image-tool > .image-workbench-layout--camera,
  .image-workbench-page--image-tool > .image-workbench-layout--inpaint {
    grid-template-columns: minmax(0, 1fr);
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    gap: 12px;
    padding: 12px 0;
  }

  .image-workbench-page--image-tool .image-workbench-panel {
    overflow: visible;
    max-height: none;
    padding: 0;
    border-right: 0;
  }

  .image-workbench-page--image-tool .image-workbench-canvas {
    min-height: min(440px, 58vh);
    overflow: hidden;
  }

  .image-workbench-page--image-tool .image-workbench-status {
    position: fixed;
    bottom: 0;
    left: 12px;
    right: 12px;
    z-index: 5;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    box-sizing: border-box;
  }

  .image-workbench-page--image-tool .image-workbench-status p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .image-workbench-page--image-tool .image-workbench-status em {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .image-workbench-page--image-tool {
    padding-inline: 10px;
  }

  .image-workbench-page--image-tool .image-workbench-status {
    left: 10px;
    right: 10px;
  }

  .image-workbench-page--image-tool .image-workbench-canvas {
    min-height: 360px;
  }
}
