/* AI Resource Hub — Background Remover (bg-remover.html) */
.br [hidden] { display: none !important; }
.br-mine { margin-top: 8px; }

/* background type segmented control */
.br-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface-2, var(--color-surface)); }
.br-seg button { font: inherit; font-size: 0.8rem; font-weight: 600; padding: 7px 4px; border-radius: 8px; border: 0; background: transparent; color: var(--color-text-muted); cursor: pointer; }
.br-seg button:hover { color: var(--color-text); }
.br-seg button.is-on { background: var(--color-accent); color: var(--color-on-accent, #fff); }
.br-seg button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.br-sub { margin-top: 10px; display: grid; gap: 8px; }
.br-sub label { font-size: 0.85rem; }
.br-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.br-swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--color-border); background: var(--c); cursor: pointer; padding: 0; }
.br-swatches button.is-on { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent); }
.br-color { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; cursor: pointer; }
.br-color input { width: 36px; height: 28px; border: 1px solid var(--color-border); border-radius: 6px; background: none; padding: 1px; cursor: pointer; }
.br-bgpick { justify-self: start; cursor: pointer; }
.br input[type="range"] { width: 100%; accent-color: var(--color-accent); }
.br-private { display: flex; align-items: flex-start; gap: 6px; margin: 14px 0 0; font-size: 0.78rem; color: var(--color-text-muted); line-height: 1.4; }
.br-private svg { flex: none; margin-top: 2px; }

/* empty state */
.br-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 48px 20px; border: 2px dashed var(--color-border); border-radius: 18px; cursor: pointer; color: var(--color-text-muted); transition: border-color .15s, background .15s; }
.br-empty:hover, .br-over .br-empty { border-color: var(--color-accent); background: var(--color-accent-soft, transparent); }
.br-empty p { margin: 8px 0 0; color: var(--color-text); }
.br-empty small { font-size: 0.78rem; }
.br-empty-art { position: relative; width: 200px; height: 130px; border-radius: 14px; overflow: hidden; border: 1px solid var(--color-border); }
.br-empty-art span { position: absolute; top: 0; bottom: 0; }
.br-empty-before { left: 0; width: 50%; background: linear-gradient(160deg, #3a6ea5, #f2a65a); }
.br-empty-after { right: 0; width: 50%; background: repeating-conic-gradient(#d9d9de 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.br-empty-art::after { content: ""; position: absolute; left: 50%; top: 22px; width: 64px; height: 108px; transform: translateX(-50%); background: radial-gradient(circle at 50% 22%, #1d1d22 0 18px, transparent 19px), radial-gradient(ellipse 32px 46px at 50% 100%, #1d1d22 98%, transparent); }
.br-empty-art::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff; z-index: 1; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.br-over { outline: 2px dashed var(--color-accent); outline-offset: -6px; border-radius: 18px; }

/* viewer + before/after compare */
.br-viewer { border: 1px solid var(--color-border); background: var(--color-surface); border-radius: 16px; overflow: hidden; margin-bottom: 18px; }
.br-stagebox { display: flex; justify-content: center; }
.br-compare { position: relative; margin: 0 auto; width: fit-content; max-width: 100%; line-height: 0; user-select: none; touch-action: pan-y; }
.br-viewer > .br-compare { display: block; }
.br-layer canvas { display: block; max-width: 100%; max-height: min(64vh, 640px); width: auto; height: auto; }
.br-after { background: repeating-conic-gradient(#c9c9cf 0 25%, #f4f4f6 0 50%) 0 0 / 20px 20px; }
.br-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.br-before canvas { width: 100%; height: 100%; max-height: none; }
.br-handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.br-handle span { position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.br-handle span::before, .br-handle span::after { content: ""; position: absolute; top: 50%; margin-top: -5px; border: 5px solid transparent; }
.br-handle span::before { left: 5px; border-right-color: #333; }
.br-handle span::after { right: 5px; border-left-color: #333; }
.br-slider { position: absolute; inset: 0; width: 100% !important; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; }
.br-tag { position: absolute; top: 10px; padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 0.72rem; font-weight: 600; line-height: 1.2; pointer-events: none; z-index: 2; }
.br-tag-l { left: 10px; } .br-tag-r { right: 10px; }
.br-compare.is-pending .br-handle, .br-compare.is-pending .br-slider, .br-compare.is-pending .br-tag { display: none; }
.br-compare.is-pending .br-before { clip-path: none; }
.br-busy { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; text-align: center; line-height: 1.4; background: rgba(7,7,10,.55); color: #fff; font-weight: 600; font-size: 0.92rem; backdrop-filter: blur(2px); }
.br-busy.is-err { background: rgba(60,10,10,.72); }
.br-busy.is-err .br-spin { display: none; }
.br-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: var(--color-accent); animation: br-spin .8s linear infinite; }
@keyframes br-spin { to { transform: rotate(360deg); } }
.br-viewer .t3-viewer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--color-border); }
.br-viewer .t3-viewer-info { display: grid; gap: 2px; min-width: 0; }
.br-viewer .t3-viewer-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-viewer .t3-viewer-info small { color: var(--color-text-muted); font-size: 0.78rem; }
.br-viewer .as-acts { display: flex; flex-wrap: wrap; gap: 6px; }

/* session strip */
.br-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.br-card { position: relative; aspect-ratio: 1; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer; border: 2px solid var(--color-border); background: repeating-conic-gradient(#c9c9cf 0 25%, #f4f4f6 0 50%) 0 0 / 14px 14px; }
.br-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.br-card.is-open { border-color: var(--color-accent); }
.br-card.is-err { border-color: var(--color-red, #ef4444); }
.br-card-st { position: absolute; inset: auto 6px 6px 6px; padding: 3px 6px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: 0.7rem; font-weight: 600; }

/* "pick from my images" grid (shared look with 3D Studio) */
.t3-mine { font-size: 0.85rem; }
.t3-mine summary { cursor: pointer; color: var(--color-text-muted); font-weight: 600; }
.t3-mine-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; max-height: 260px; overflow: auto; }
.t3-mine-grid button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--color-surface-2); cursor: pointer; aspect-ratio: 1; }
.t3-mine-grid button:hover { border-color: var(--color-accent); }
.t3-mine-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t3-check { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 12px; font-size: 0.88rem; cursor: pointer; }
.t3-check input { margin-top: 3px; accent-color: var(--color-accent); }
.t3-check small { color: var(--color-text-muted); }
