:root {
  --bg: #070708;
  --card: #111116;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --muted: #71717a;
  --gold: #fbbf24;
  --gold-dim: rgba(251, 191, 36, 0.12);
  --gold-border: rgba(251, 191, 36, 0.35);
}

* { box-sizing: border-box; }

body.bg-remover {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.br-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.br-hero { margin-bottom: 24px; }

.br-hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.br-hero h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.br-free-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

.br-pro-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: #fcd34d;
}

.br-hero p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 560px;
}

.br-link { color: #fcd34d; text-decoration: none; }
.br-link:hover { text-decoration: underline; }

.br-gate {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--gold-border);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.03));
}

.br-gate.hidden { display: none; }

.br-gate-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #fde68a;
}

.br-gate-body {
  margin: 0 0 12px;
  font-size: 13px;
  color: rgba(254, 243, 199, 0.85);
  line-height: 1.45;
}

.br-gate-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.br-workspace {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(12px, 2vw, 20px);
  align-items: start;
}

.br-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.br-panel--after { border-color: rgba(52, 211, 153, 0.18); }

.br-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.br-step {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: #d4d4d8;
}

.br-panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.br-dropzone,
.br-result {
  position: relative;
  flex: 1;
  min-height: 280px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: #0a0a0d;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.br-dropzone:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.5);
  outline-offset: 2px;
}

.br-dropzone.drag-over {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.04);
}

.br-drop-empty { text-align: center; padding: 24px; }

.br-drop-icon {
  display: block;
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.br-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.br-preview {
  max-width: 92%;
  max-height: 260px;
  object-fit: contain;
}

.br-preview--result {
  position: relative;
  z-index: 2;
  max-width: 88%;
  max-height: 240px;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45));
}

.br-result.has-result .br-result-empty {
  display: none;
}

.br-panel--before .br-preview {
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
}

.br-checker {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, #18181b 25%, transparent 25%),
    linear-gradient(-45deg, #18181b 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #18181b 75%),
    linear-gradient(-45deg, transparent 75%, #18181b 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #0f0f12;
}

.br-result-empty {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 0 16px;
}

.br-mid {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 168px;
  padding: 24px 0;
}

.br-mid-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  max-width: 168px;
}

.br-process-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.28), rgba(217, 119, 6, 0.18));
  color: #fff7ed;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12);
  transition: transform 0.15s, border-color 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.br-process-btn:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: rgba(251, 191, 36, 0.75);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.2);
}

.br-process-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.br-process-btn.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

.br-process-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.95;
}

.br-process-hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
}

.br-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  text-align: center;
}

.br-loading.hidden,
.br-err.hidden,
.br-actions.hidden,
.hidden { display: none !important; }

.br-process-btn.hidden {
  display: none !important;
}

.br-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #fbbf24;
  border-right-color: rgba(251, 191, 36, 0.45);
  animation: brSpin 0.85s linear infinite;
}

.br-spinner--lg {
  width: 44px;
  height: 44px;
  border-width: 3px;
}

.br-result-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(10, 10, 13, 0.72);
  backdrop-filter: blur(4px);
}

.br-result-loading-text {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
}

@keyframes brSpin {
  to { transform: rotate(360deg); }
}

.br-loading-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
}

.br-loading-msg {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 150px;
}

.br-err {
  margin: 0;
  font-size: 11px;
  color: #f87171;
  text-align: center;
  line-height: 1.35;
}

.br-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.br-btn-primary,
.br-btn-secondary,
.br-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.br-btn-primary {
  background: linear-gradient(180deg, #f59e0b, #d97706);
  color: #111;
}

.br-btn-primary:hover { filter: brightness(1.06); }

.br-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}

.br-btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

.br-btn-ghost {
  background: transparent;
  color: var(--muted);
}

.br-btn-ghost:hover { color: var(--text); }

@media (max-width: 900px) {
  .br-workspace {
    grid-template-columns: 1fr;
  }
  .br-mid {
    padding: 0;
    min-width: 0;
  }
  .br-mid-inner {
    max-width: none;
  }
}
