/* 線上去背 */
.rmbg-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; margin: 10px 0; padding: 20px 16px; border: 2px dashed var(--brand); border-radius: 14px; background: #f5f8ff; text-align: center; cursor: pointer; }
.rmbg-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rmbg-drop strong { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 1.05rem; }
.rmbg-drop span { color: var(--muted); font-size: .95rem; }
.rmbg-drop.is-over { background: #e3ecff; border-style: solid; }
.rmbg-drop.is-busy { opacity: .6; cursor: progress; }
.rmbg-drop:focus-within { outline: 3px solid #93b4ff; outline-offset: 2px; }
.rmbg-progress { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; margin: 4px 0 8px; }
.rmbg-progress div { height: 100%; width: 0; background: var(--brand); transition: width .2s; }

.rmbg-preview { display: flex; justify-content: center; margin: 10px 0; }
.rmbg-preview canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; border: 1px solid var(--line); }
.rmbg-preview[data-bg="transparent"] canvas {
  background-color: #fff;
  background-image: linear-gradient(45deg, #d5d8dd 25%, transparent 25%), linear-gradient(-45deg, #d5d8dd 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d5d8dd 75%), linear-gradient(-45deg, transparent 75%, #d5d8dd 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.rmbg-size { text-align: center; }
.rmbg-bg { border: 0; padding: 0; margin: 10px 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rmbg-bg legend { font-weight: 600; font-size: 1rem; padding: 0; margin-bottom: 4px; }
.rmbg-bg label { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; border: 2px solid var(--line); border-radius: 10px; font-size: 1rem; cursor: pointer; }
.rmbg-bg label:has(input:checked) { border-color: var(--brand); background: #eff4ff; }
.rmbg-bg input[type=radio] { width: 20px; height: 20px; margin: 0; }
.rmbg-bg input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.rmbg-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rmbg-dl .btn { width: 100%; }
@media (max-width: 480px) {
  .rmbg-dl { grid-template-columns: 1fr; }
  .rmbg-bg label { flex: 1 1 auto; justify-content: center; }
}
