.remove-workspace {
  min-height: 520px;
  grid-template-columns: minmax(0, 680px) minmax(420px, 1fr);
}

.remove-workspace .tool-workspace__preview,
.remove-workspace .tool-workspace__upload {
  min-height: 520px;
}

.remove-workspace__preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-xl);
  background:
    radial-gradient(circle at 12% 10%, var(--brand-pixpix-surface-subtle), transparent 42%),
    var(--surface-muted);
}

:root[data-theme="dark"] .remove-workspace__preview {
  background:
    radial-gradient(circle at 12% 10%, rgb(134 98 255 / 12%), transparent 42%),
    var(--surface-muted);
}

.remove-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.remove-preview-head > div {
  min-width: 0;
}

.remove-preview-head span {
  display: block;
  margin-bottom: var(--space-4xs);
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-4);
}

.remove-preview-head h2 {
  max-width: 480px;
  margin: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-7);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-preview-head strong {
  flex: 0 0 auto;
  padding: var(--space-3xs) var(--space-sm);
  border: 1px solid var(--brand-pixpix-border-subtle);
  border-radius: var(--radius-full);
  color: var(--brand-pixpix-text);
  background: var(--brand-pixpix-surface-subtle);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-4);
}

:root[data-theme="dark"] .remove-preview-head strong {
  color: var(--brand-pixpix-primary);
  border-color: var(--feedback-info-border-subtle);
  background: var(--feedback-info-surface-subtle);
}

.remove-preview-stage {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  padding: var(--space-md);
  overflow: hidden;
  border: 1px solid var(--border-default-muted);
  border-radius: var(--radius-4xl);
  background: var(--surface-card);
}

.remove-preview-pane {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 320px;
  flex-direction: column;
  padding: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  background: var(--surface-container);
}

.remove-preview-pane figcaption {
  position: absolute;
  z-index: 2;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-3xs) var(--space-sm);
  border-radius: var(--radius-full);
  color: var(--text-overlay-primary);
  background: var(--surface-overlay);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-4);
}

.remove-preview-surface {
  display: grid;
  width: 100%;
  min-height: 320px;
  flex: 1 1 auto;
  place-items: center;
  overflow: hidden;
}

.remove-preview-surface img,
.remove-preview-surface canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.remove-preview-pane--after .remove-preview-surface {
  background: var(--component-translucent-subtle);
}

.remove-preview-note {
  margin: 0;
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-4);
}

.remove-workspace__controls {
  border-style: solid;
  border-color: var(--border-default-muted);
  background: var(--surface-card);
}

.remove-workspace__controls::before {
  display: none;
}

:root[data-theme="dark"] .remove-workspace__controls {
  background: var(--surface-card);
}

.remove-app,
.remove-app .drop,
.remove-processing,
.remove-control-panel {
  min-height: 516px;
}

.remove-app .drop .big {
  width: 92px;
  height: 92px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-4xl);
  background: var(--surface-muted);
}

.remove-app .drop .big img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  opacity: 1;
}

.remove-app .drop p {
  max-width: 320px;
}

.remove-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  color: var(--text-secondary);
  text-align: center;
}

.remove-processing[hidden],
.remove-control-panel[hidden],
.remove-app .drop[hidden] {
  display: none !important;
}

.remove-processing strong,
.remove-processing span {
  max-width: 320px;
}

.remove-processing__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-default);
  border-top-color: var(--brand-pixpix-primary);
  border-radius: var(--radius-full);
  animation: remove-spin 0.8s linear infinite;
}

@keyframes remove-spin {
  to { transform: rotate(1turn); }
}

/* H7 — WeChat module extractor */
.wechat-workspace {
  min-height: 560px;
  grid-template-columns: minmax(0, 680px) minmax(420px, 1fr);
}

.wechat-workspace .tool-workspace__preview,
.wechat-workspace .tool-workspace__upload {
  min-height: 560px;
}

.wechat-workspace__preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-xl);
  background: radial-gradient(circle at 12% 10%, var(--brand-pixpix-surface-subtle), transparent 42%), var(--surface-muted);
}

:root[data-theme="dark"] .wechat-workspace__preview {
  background: radial-gradient(circle at 12% 10%, rgb(134 98 255 / 12%), transparent 42%), var(--surface-muted);
}

.wechat-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.wechat-preview-head span {
  display: block;
  margin-bottom: var(--space-4xs);
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.wechat-preview-head h2 {
  max-width: 500px;
  margin: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-7);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-preview-head strong {
  flex: 0 0 auto;
  padding: var(--space-3xs) var(--space-sm);
  border: 1px solid var(--brand-pixpix-border-subtle);
  border-radius: var(--radius-full);
  color: var(--brand-pixpix-text);
  background: var(--brand-pixpix-surface-subtle);
  font-size: var(--font-size-xs);
}

.wechat-preview-stage {
  position: relative;
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  place-items: center;
  padding: var(--space-xl);
  overflow: auto;
  border: 1px solid var(--border-default-muted);
  border-radius: var(--radius-4xl);
  background: var(--surface-card);
}

.wechat-preview-sample {
  width: min(82%, 460px);
  padding: var(--space-xl);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  background: var(--surface-container);
  box-shadow: var(--shadow-sm);
}

.wechat-preview-sample span {
  display: block;
  width: 72px;
  height: 6px;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-full);
  background: var(--brand-pixpix-primary);
}

.wechat-preview-sample strong {
  display: block;
  color: var(--text-primary);
  font-size: var(--font-size-lg);
}

.wechat-preview-sample p,
.wechat-preview-note {
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-4);
}

.wechat-preview-note { margin: 0; }

.wechat-preview-stage:not([data-asset-status]) .wechat-preview-sample { display: none; }

.wechat-preview-results {
  display: grid;
  width: 100%;
  gap: var(--space-md);
}

.wechat-preview-module {
  min-height: 90px;
  padding: var(--space-md);
  overflow: auto;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: #fff;
}

.wechat-workspace__controls {
  padding: 0;
  border-style: solid;
  border-color: var(--border-default-muted);
  background: var(--surface-card);
}

.wechat-workspace__controls::before { display: none; }

.wechat-app {
  min-height: 556px;
  max-height: 720px;
  padding: var(--space-xl);
  overflow: auto;
}

.wechat-app .seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3xs);
  padding: var(--space-3xs);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--surface-muted);
}

.wechat-app .seg button {
  min-height: 40px;
  padding: 0 var(--space-md);
  border: 0;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.wechat-app .seg button.on {
  color: var(--text-inverse);
  background: var(--surface-inverse);
}

.wechat-app .wm-paste,
.wechat-app textarea {
  box-sizing: border-box;
  width: 100%;
  border-color: var(--border-default) !important;
  border-radius: var(--radius-2xl) !important;
  color: var(--text-primary) !important;
  background: var(--surface-muted) !important;
}

.wechat-app .wm-paste:empty::before {
  color: var(--text-tertiary);
  content: attr(data-ph);
}

.wechat-app .btn {
  min-height: 40px;
  padding: 0 var(--space-lg);
  border: 1px solid var(--surface-inverse);
  border-radius: var(--radius-full);
  color: var(--text-inverse);
  background: var(--surface-inverse);
  cursor: pointer;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.wechat-app .btn.sec {
  color: var(--text-primary);
  border-color: var(--border-default);
  background: var(--surface-card);
}

.wechat-app .btn.sm { min-height: 34px; padding: 0 var(--space-md); font-size: var(--font-size-xs); }

.wechat-app a { color: var(--brand-pixpix-text); }

.wechat-app .note {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  color: var(--text-tertiary);
  background: var(--feedback-info-surface-subtle);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-4);
}

.wechat-app .wm-privacy img { width: 18px; height: 18px; }

.wechat-app .wm-grid {
  display: grid;
  gap: var(--space-md);
}

.wechat-app .wm-card {
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--surface-muted);
}

.wechat-app .wm-prevwrap {
  min-height: 90px;
  padding: var(--space-sm);
  overflow: auto;
  border-radius: var(--radius-lg);
  background: #fff;
}

.wechat-app .wm-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.wechat-app .wm-panel { display: grid; gap: var(--space-xs); padding-top: var(--space-sm); border-top: 1px solid var(--border-default); }
.wechat-app .wm-swaprow { display: flex; align-items: center; gap: var(--space-xs); }
.wechat-app .wm-thumb { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; }
.wechat-app .wm-sw { width: 24px; height: 24px; border: 1px solid var(--border-default); border-radius: var(--radius-full); }
.wechat-app input[type="text"] { min-height: 36px; border: 1px solid var(--border-default); border-radius: var(--radius-lg); color: var(--text-primary); background: var(--surface-card); }
.wechat-app .muted { margin: var(--space-md) 0 0; color: var(--text-tertiary); }

@media (max-width: 960px) {
  .wechat-workspace { grid-template-columns: 1fr; }
  .wechat-workspace__controls { order: -1; }
  .wechat-workspace .tool-workspace__preview,
  .wechat-workspace .tool-workspace__upload,
  .wechat-app { min-height: 500px; }
}

@media (max-width: 640px) {
  .wechat-workspace__preview,
  .wechat-app { padding: var(--space-lg); }
  .wechat-preview-stage { padding: var(--space-md); }
  .wechat-preview-sample { width: 100%; padding: var(--space-lg); }
  .wechat-preview-head h2 { white-space: normal; }
  .wechat-app .wm-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

.remove-processing__progress {
  width: min(280px, 100%);
  height: 7px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--component-translucent-subtle);
}

.remove-processing__bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-pixpix-primary), var(--brand-default-primary));
  transition: width 180ms ease;
}

.remove-control-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-xl);
}

.remove-control-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.remove-control-panel__head h3,
.remove-control-panel__head p {
  margin: 0;
}

.remove-control-panel__head h3 {
  color: var(--text-primary);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-8);
}

.remove-control-panel__head p {
  margin-top: var(--space-3xs);
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-5);
}

.remove-replace-button,
.remove-control-actions .btn,
.remove-item__save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: var(--font-weight-medium);
}

.remove-replace-button {
  min-height: 36px;
  flex: 0 0 auto;
  padding-inline: var(--space-md);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  background: var(--surface-card);
  font-size: var(--font-size-xs);
}

.remove-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
}

.remove-summary > div {
  display: flex;
  min-width: 0;
  min-height: 70px;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  background: var(--surface-muted);
}

.remove-summary span,
.remove-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-summary span {
  color: var(--text-tertiary);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-4);
}

.remove-summary strong {
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-5);
}

.remove-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.remove-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-sm);
}

.remove-field > label {
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-5);
}

.remove-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2xs);
}

.remove-segment--background {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.remove-segment button {
  min-height: 40px;
  padding-inline: var(--space-sm);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--surface-card);
  font-size: var(--font-size-xs);
}

.remove-segment button:hover,
.remove-segment button.on {
  color: var(--brand-default-on-primary);
  border-color: var(--brand-default-primary);
  background: var(--brand-default-primary);
}

.remove-color-row[hidden] {
  display: none !important;
}

.remove-color-row input {
  min-height: 40px;
  padding-inline: var(--space-md);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  background: var(--surface-card);
  font-size: var(--font-size-sm);
}

.remove-queue {
  display: flex;
  max-height: 116px;
  flex-direction: column;
  gap: var(--space-2xs);
  overflow: auto;
}

.remove-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-2xs) var(--space-sm);
  border: 1px solid var(--border-default-muted);
  border-radius: var(--radius-xl);
  background: var(--surface-muted);
}

.remove-item img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  object-fit: cover;
}

.remove-item__copy {
  min-width: 0;
}

.remove-item__copy strong,
.remove-item__copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-item__copy strong {
  color: var(--text-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

.remove-item__copy span {
  margin-top: 2px;
  color: var(--text-tertiary);
  font-size: 11px;
}

.remove-item__save {
  min-height: 30px;
  padding-inline: var(--space-sm);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  background: var(--surface-card);
  font-size: 11px;
}

.remove-privacy-note,
.remove-error-note {
  padding: var(--space-sm) var(--space-md);
  margin: 0;
  border-radius: var(--radius-2xl);
  color: var(--text-secondary);
  background: var(--feedback-info-surface-subtle);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-4);
}

.remove-error-note {
  color: #b42318;
  background: #fff1f1;
}

:root[data-theme="dark"] .remove-error-note {
  color: #ffb4b4;
  background: #3c1513;
}

.remove-control-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-sm);
  margin-top: auto;
}

.remove-control-actions .btn {
  min-height: 48px;
  padding-inline: var(--space-lg);
  border: 1px solid var(--brand-default-primary);
  color: var(--brand-default-on-primary);
  background: var(--brand-default-primary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-5);
}

.remove-control-actions .btn.sec {
  color: var(--text-primary);
  border-color: var(--border-default);
  background: var(--surface-card);
}

.remove-control-actions .btn:disabled,
.remove-item__save:disabled,
.remove-replace-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.remove-replace-button:focus-visible,
.remove-segment button:focus-visible,
.remove-color-row input:focus-visible,
.remove-control-actions .btn:focus-visible,
.remove-item__save:focus-visible {
  outline: 3px solid var(--border-default-accent);
  outline-offset: 2px;
}

.tool-effect {
  background: var(--surface-container);
}

.tool-effect__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xl);
}

.tool-effect-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-lg);
}

.tool-effect-card__media {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-4xl);
}

.tool-effect-card__copy h3,
.tool-effect-card__copy p { margin: 0; }

.tool-effect-card__copy h3 {
  color: var(--text-primary);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-7);
}

.tool-effect-card__copy p {
  margin-top: var(--space-2xs);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-5);
}

@media (max-width: 1439px) {
  .remove-workspace { grid-template-columns: minmax(0, 1.28fr) minmax(420px, 1fr); }
}

@media (max-width: 1023px) {
  .remove-workspace { grid-template-columns: 1fr; }
  .remove-workspace__preview { min-height: 480px; }
}

@media (max-width: 767px) {
  .remove-workspace .tool-workspace__preview,
  .remove-workspace .tool-workspace__upload,
  .remove-app,
  .remove-app .drop,
  .remove-processing,
  .remove-control-panel { height: auto; min-height: 440px; }

  .remove-workspace__preview { padding: var(--space-md); }
  .remove-preview-pane,
  .remove-preview-surface { min-height: 240px; }
  .remove-control-panel { padding: var(--space-lg); }
  .remove-control-panel__head { flex-direction: column; }
  .remove-summary { grid-template-columns: 1fr 1fr; }
  .tool-effect__grid { grid-template-columns: 1fr; }
  .tool-effect-card__media { height: 240px; }
}

@media (max-width: 479px) {
  .remove-preview-stage { grid-template-columns: 1fr; overflow: visible; }
  .remove-preview-pane,
  .remove-preview-surface { min-height: 220px; }
  .remove-segment--background,
  .remove-summary,
  .remove-control-actions { grid-template-columns: 1fr; }
  .remove-control-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .remove-processing__spinner { animation-duration: 0.01ms; }
  .remove-processing__bar { transition: none; }
}
