
.wc-bg-remover {
  --wc-soft-surface:#f6f8fc;
  --wc-drop-surface:linear-gradient(180deg,#f2f6ff 0%,#fbfcff 100%);
  --wc-drop-hover:#edf3ff;
  --wc-badge-surface:#eef2f7;
  --wc-track:#e4e9f2;
}

html[data-theme="dark"] .wc-bg-remover {
  --wc-soft-surface:#0e1726;
  --wc-drop-surface:linear-gradient(180deg,#0e1726 0%,#111a2b 100%);
  --wc-drop-hover:#14223a;
  --wc-badge-surface:#17243a;
  --wc-track:#223149;
}
.wc-bg-remover {
  display: block;
}

.wc-bg-runtime {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 14px;
}

.wc-bg-runtime strong {
  font-size: 14px;
}

.wc-bg-runtime-error {
  background: rgba(220, 76, 100, 0.10);
  border: 1px solid rgba(220, 76, 100, 0.20);
}

.wc-bg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.wc-bg-main,
.wc-bg-side {
  min-width: 0;
}

.wc-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 12px 32px rgba(18, 24, 67, 0.06);
}

.wc-panel + .wc-panel,
.wc-submit-row {
  margin-top: 18px;
}

.wc-panel-header {
  margin-bottom: 16px;
}

.wc-panel-header h2 {
  margin: 0 0 6px;
  font-size: 21px;
}

.wc-panel-header p,
.wc-settings-intro {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.wc-file-input {
  position: absolute;
  inset: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wc-dropzone {
  border: 2px dashed rgba(46, 78, 204, 0.28);
  border-radius: 24px;
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease, opacity .2s ease;
  background: var(--wc-drop-surface, linear-gradient(180deg, #f1f5ff 0%, #fcfdff 100%));
}

.wc-dropzone:hover,
.wc-dropzone:focus,
.wc-dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--wc-drop-hover, #ebf1ff);
  transform: translateY(-1px);
  outline: none;
}

.wc-dropzone.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.wc-dropzone-icon {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--accent);
}

.wc-dropzone-title {
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
}

.wc-dropzone-sub {
  margin-top: 4px;
  color: var(--muted);
}

.wc-source {
  display: grid;
  gap: 14px;
}

.wc-source-preview,
.wc-result-preview {
  border-radius: 18px;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wc-soft-surface, #f5f7fb);
  border: 1px solid var(--line);
}

.checkerboard {
  background-image:
    linear-gradient(45deg, rgba(31,34,108,0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(31,34,108,0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(31,34,108,0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(31,34,108,0.05) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

.wc-source-preview img,
.wc-result-preview img {
  display: block;
  max-width: 100%;
  max-height: 440px;
  object-fit: contain;
}

.wc-source-placeholder {
  color: var(--muted);
  font-size: 14px;
}

.wc-source-name,
.wc-result-title {
  font-weight: 800;
  color: var(--text);
}

.wc-source-size {
  color: var(--muted);
  font-size: 14px;
}

.wc-settings-dropdown {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--wc-soft-surface, #f5f7fb);
  padding: 0;
  overflow: hidden;
}

.wc-settings-dropdown summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
  color: var(--text);
}

.wc-settings-dropdown summary::-webkit-details-marker {
  display: none;
}

.wc-settings-dropdown summary small {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--wc-badge-surface, #eef2f7);
  border-radius: 999px;
  padding: 6px 10px;
}

.wc-settings-dropdown[open] summary {
  border-bottom: 1px solid var(--line);
}

.wc-settings-body {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.wc-grid {
  display: grid;
  gap: 14px;
}

.wc-grid-1 { grid-template-columns: 1fr; }
.wc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wc-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.wc-field {
  display: grid;
  gap: 7px;
}

.wc-label {
  font-weight: 700;
  color: var(--text);
}

.wc-field input[type="number"],
.wc-field select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  font: inherit;
}

.wc-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.wc-checkbox-field {
  align-items: start;
}

.wc-checkbox-wrap {
  display: inline-flex;
  gap: 10px;
  align-items: flex-start;
}

.wc-checkbox-wrap input {
  margin-top: 3px;
}

[data-alpha-fields].is-disabled {
  opacity: 0.58;
}

.wc-message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
}

.wc-message[data-kind="error"] {
  background: rgba(220, 76, 100, 0.10);
  color: #a22a46;
  border: 1px solid rgba(220, 76, 100, 0.18);
}

.wc-message[data-kind="success"] {
  background: rgba(47, 180, 130, 0.12);
  color: #1f6d4f;
  border: 1px solid rgba(47, 180, 130, 0.18);
}

.wc-submit-row {
  display: grid;
  gap: 14px;
}

.wc-submit {
  min-height: 50px;
  font-weight: 800;
}

.wc-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}

.wc-progress-track {
  position: relative;
  height: 10px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--wc-track, #e7ebf2);
}

.wc-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2E4ECC 0%, #667BFF 100%);
  transition: width .2s ease;
}

.wc-progress.is-processing .wc-progress-track span {
  width: 100% !important;
  opacity: 0.28;
}

.wc-progress.is-processing .wc-progress-track::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 35%;
  background: linear-gradient(90deg, transparent 0%, rgba(102,123,255,0.75) 50%, transparent 100%);
  animation: wc-bg-progress-slide 1.2s linear infinite;
}

@keyframes wc-bg-progress-slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

.wc-progress-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.result-panel {
  position: sticky;
  top: 18px;
}

.wc-result-empty {
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 18px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: var(--wc-soft-surface, #f5f7fb);
  padding: 20px;
}

.wc-result-empty-icon {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--accent);
}

.wc-result {
  display: grid;
  gap: 14px;
}

.wc-result-stats {
  display: grid;
  gap: 10px;
  margin: 0;
}

.wc-result-stats > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: start;
}

.wc-result-stats dt {
  font-weight: 700;
  color: var(--text);
}

.wc-result-stats dd {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.wc-warning-list {
  margin: 0;
  padding-left: 18px;
  color: #8a5a16;
  font-size: 14px;
  background: rgba(255, 191, 84, 0.12);
  border: 1px solid rgba(255, 191, 84, 0.25);
  border-radius: 14px;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-right: 12px;
}

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

.wc-result-actions .button {
  justify-content: center;
  text-align: center;
}

.wc-result-expiry {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .wc-bg-layout,
  .wc-grid-2,
  .wc-grid-3,
  .wc-result-actions {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }
}


.wc-result-stage {
  position:relative;
  min-height:320px;
}

.wc-result-stage .wc-result-empty {
  min-height:320px;
}


.wc-processing-overlay[hidden],
.wc-result-stage[hidden] {
  display: none !important;
}

.wc-processing-overlay {
  position:absolute;
  inset:0;
  z-index:4;
  border-radius:18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:28px;
  text-align:center;
  background:color-mix(in srgb,var(--surface) 88%,transparent);
  border:1px solid var(--line);
  backdrop-filter:blur(6px);
}

.wc-processing-overlay strong {
  color:var(--text);
  font-size:17px;
}

.wc-processing-overlay span {
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
  max-width:300px;
}

.wc-processing-spinner {
  width:38px;
  height:38px;
  border-radius:50%;
  border:4px solid color-mix(in srgb,var(--accent) 18%,transparent);
  border-top-color:var(--accent);
  animation:wc-bg-spin .85s linear infinite;
}

.wc-processing-pulse {
  width:min(220px,80%);
  height:7px;
  margin-top:4px;
  border-radius:999px;
  overflow:hidden;
  background:var(--wc-track);
}

.wc-processing-pulse span {
  display:block;
  width:38%;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  animation:wc-bg-pulse 1.25s ease-in-out infinite;
}

@keyframes wc-bg-spin { to { transform:rotate(360deg); } }
@keyframes wc-bg-pulse {
  0% { transform:translateX(-110%); }
  100% { transform:translateX(290%); }
}

html[data-theme="dark"] .wc-bg-remover .wc-panel,
html[data-theme="dark"] .wc-bg-remover .wc-settings-dropdown,
html[data-theme="dark"] .wc-bg-remover .wc-source-preview,
html[data-theme="dark"] .wc-bg-remover .wc-result-preview,
html[data-theme="dark"] .wc-bg-remover .wc-result-empty {
  background-color:var(--surface);
  border-color:var(--line);
  color:var(--text);
}

html[data-theme="dark"] .wc-bg-remover .wc-dropzone {
  color:var(--text);
}

html[data-theme="dark"] .wc-bg-remover .checkerboard {
  background-color:#0e1726;
  background-image:
    linear-gradient(45deg,rgba(255,255,255,.035) 25%,transparent 25%),
    linear-gradient(-45deg,rgba(255,255,255,.035) 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,rgba(255,255,255,.035) 75%),
    linear-gradient(-45deg,transparent 75%,rgba(255,255,255,.035) 75%);
}

html[data-theme="dark"] .wc-bg-remover 
.wc-processing-overlay[hidden],
.wc-result-stage[hidden] {
  display: none !important;
}

.wc-processing-overlay {
  background:color-mix(in srgb,var(--surface) 92%,transparent);
}


.wc-bg-remover.is-busy .wc-result-actions {
  pointer-events:none;
  opacity:.48;
}

.wc-bg-remover.is-busy .wc-settings-dropdown summary {
  pointer-events:none;
  opacity:.65;
}
