/* Стили виджета «bgremove» (удаление фона) — подключаются только на его странице */
.bgr.has-work .ik-drop { padding: 16px 18px; grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 14px; row-gap: 2px; }
.bgr.has-work .ik-drop-icon { grid-row: span 2; width: 42px; height: 42px; margin: 0; }
.bgr.has-work .ik-drop-icon svg { width: 20px; height: 20px; }
.bgr.has-work .ik-drop-title { font-size: 16px; }
.bgr.has-work .ik-drop-note { display: none; }
.bgr.is-busy .ik-drop { opacity: .6; pointer-events: none; }

.bgr__models { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bgr .ik-seg button:focus-visible, .bgr .chip:focus-visible, .bgr__zoom-val:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* Статус загрузки */
.bgr__status { display: grid; gap: 10px; }
.bgr__status-row { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.bgr__spinner { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2.5px solid var(--green-line); border-top-color: var(--green); animation: bgr-spin .8s linear infinite; }
@keyframes bgr-spin { to { transform: rotate(360deg); } }
.ik-progress.is-indeterminate i { width: 35% !important; animation: bgr-indet 1.2s ease-in-out infinite; }
@keyframes bgr-indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* Рабочая область */
.bgr__work { display: grid; gap: 12px; }
.bgr__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.bgr__zoom { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.bgr__zoom .icon-btn { width: 38px; height: 38px; }
.bgr__zoom .icon-btn:disabled { opacity: .35; cursor: default; background: none; color: inherit; }
.bgr__zoom-val {
  min-width: 58px; padding: 7px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text-strong);
  font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer;
}
.bgr__zoom-val:hover { background: var(--surface-2); color: var(--green); }
.bgr__zoom-val:disabled { opacity: .35; cursor: default; }
.bgr__sep { width: 1px; height: 22px; margin: 0 4px; background: var(--border); }

.bgr__brush { display: grid; gap: 10px; padding: 12px 16px; border: 1px solid var(--green-line); border-radius: var(--radius); background: var(--green-soft); }
.bgr__brush .ik-hint { line-height: 1.5; }
.bgr__brush kbd { font-size: 11.5px; }
@media (min-width: 760px) {
  .bgr__brush { grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .bgr__brush .ik-check, .bgr__brush .ik-hint { grid-column: 1 / -1; }
}

.bgr__stage {
  position: relative; overflow: hidden; height: 420px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-2); touch-action: pan-y;
}
.bgr__stage.is-zoomed, .bgr__stage.is-brush { touch-action: none; }
.bgr__stage.is-zoomed .bgr__canvas { cursor: grab; }
.bgr__stage.is-zoomed .bgr__canvas:active { cursor: grabbing; }
.bgr__stage.is-brush .bgr__canvas { cursor: none; }
.bgr__stage.is-pan .bgr__canvas { cursor: grab; }
.bgr__stage.is-over { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.bgr__canvas { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; }
.bgr__stage:has(.bgr__cmp:not([hidden])) { height: auto !important; overflow: visible; border: 0; background: none; }
.bgr__cmp { margin: 0 auto; width: 100%; }

/* Фоны */
.bgr__bgs .chip { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.bgr__sw { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1px solid var(--border-2); background-size: 8px 8px !important; background-position: 0 0, 0 4px, 4px -4px, -4px 0 !important; }
.bgr__sw--blur { background: radial-gradient(circle at 35% 35%, #9fd9b4, #4f7d8f 70%); filter: blur(.6px); }
.bgr__sw--img { background: linear-gradient(135deg, #f6c16b 0 45%, #6aa9e9 45% 100%); }
.bgr__color-chip { position: relative; }
.bgr__color-chip input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.bgr__color-chip:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }

/* Советы */
.bgr__tips summary { cursor: pointer; font-weight: 600; color: var(--text-strong); }
.bgr__tips ul { margin: 10px 0 0; padding-left: 4px; list-style: none; display: grid; gap: 6px; font-size: 14.5px; }

@media (max-width: 640px) {
  .bgr__bar { flex-direction: column; align-items: stretch; }
  .bgr__bar .ik-seg { display: grid; grid-template-columns: repeat(4, auto); }
  .bgr__bar .ik-seg button { padding: 9px 6px; font-size: 13px; }
  .bgr__zoom { justify-content: space-between; }
  .bgr__zoom .icon-btn { width: 44px; height: 44px; }
  .bgr__keys { display: none; }
  .bgr .ik-actions .btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
  .bgr.has-work .ik-drop-sub { display: none; }
  .bgr .ik-range { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; }
}
