.bk-canvas-viewport-host {
  width: 100%;
  margin: 0;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

.bk-canvas-zoom-viewport {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  margin: 0 auto;
  line-height: 0;
}

.bk-canvas-zoom-stage {
  position: relative;
  transform-origin: 0 0;
  will-change: transform;
}

.bk-mosaic-canvas-wrap {
  position: relative;
  display: inline-block;
  max-width: none;
}

.bk-mosaic-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.bk-mosaic-titlebar-text {
  min-width: 0;
  text-align: left;
}

.bk-mosaic-titlebar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
  margin-right: -6px;
  letter-spacing: 0;
  white-space: nowrap;
}

.bk-mosaic-tool {
  min-width: 44px;
}

.bk-editor-action-band {
  padding: 14px 12px;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  background: #f8f8f8;
}

.bk-editor-action-band-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.bk-mosaic-mode-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.bk-mosaic-mode-button {
  margin: 0;
  white-space: nowrap;
}

.bk-mosaic-mode-button.active,
.bk-mosaic-mode-button:hover,
.bk-mosaic-mode-button:focus,
.bk-mosaic-target-preset.active,
.bk-mosaic-target-preset:hover,
.bk-mosaic-target-preset:focus {
  border-color: #1a84b3;
  background: #3fb1e4;
  background: linear-gradient(to bottom, #3fb1e4 0%, #3fb1e4 50%, #2daae1 51%, #2daae1 100%);
  color: #fff;
}

.bk-mosaic-target-menu {
  position: relative;
  display: inline-block;
}

.bk-mosaic-target-toggle {
  min-height: 38px;
  white-space: nowrap;
}

.bk-mosaic-target-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 210px;
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.bk-mosaic-target-list[hidden] {
  display: none !important;
}

.bk-mosaic-target-preset {
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

.bk-zoom-toolbar {
  margin-top: 5px;
  padding: 8px 10px;
  background: #eee;
  text-align: center;
}

.bk-canvas-mode-toolbar {
  margin-top: 1px;
  padding: 8px 10px;
  background: #eee;
  text-align: center;
}

.bk-zoom-controls {
  margin: 0 auto 8px;
  max-width: 100%;
}

.bk-zoom-controls.row,
.bk-canvas-mode-controls.row,
.bk-brush-size-controls.row,
.bk-selection-clear-controls.row,
.bk-selection-size-controls.row,
.bk-selection-corner-controls.row,
.bk-selection-edge-controls.row {
  margin-left: -4px;
  margin-right: -4px;
}

.bk-zoom-controls > [class*="col-xs-"],
.bk-canvas-mode-controls > [class*="col-xs-"],
.bk-brush-size-controls > [class*="col-xs-"],
.bk-selection-clear-controls > [class*="col-xs-"],
.bk-selection-size-controls > [class*="col-xs-"],
.bk-selection-corner-controls > [class*="col-xs-"],
.bk-selection-edge-controls > [class*="col-xs-"] {
  padding-left: 4px;
  padding-right: 4px;
}

.bk-canvas-mode-controls {
  max-width: none;
  margin: 0 auto;
}

.bk-brush-size-controls {
  max-width: none;
  margin: 8px auto 0;
}

.bk-selection-clear-controls,
.bk-selection-size-controls,
.bk-selection-corner-controls,
.bk-selection-edge-controls {
  max-width: none;
  margin: 0 auto;
}

.bk-selection-size-controls,
.bk-selection-corner-controls,
.bk-selection-edge-controls {
  margin-top: 8px;
}

#corner_radius_group.is-disabled {
  opacity: 0.55;
}

.bk-fill-size-row {
  min-width: 0;
}

.bk-fill-size-label {
  flex: 0 0 auto;
}

.bk-fill-size-field {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  padding: 5px 8px;
  background: #fff;
}

.bk-fill-size-input {
  flex: 1 1 88px;
  min-width: 72px;
  max-width: 140px;
  height: 34px;
}

.bk-fill-size-unit {
  flex: 0 0 auto;
  color: #666;
  line-height: 34px;
}

.bk-fill-size-apply,
.bk-fill-size-clear {
  flex: 0 0 auto;
  white-space: nowrap;
}

.bk-zoom-icon {
  min-width: 0;
}

.bk-zoom-value {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #555;
  line-height: 20px;
  text-align: center;
}

.bk-zoom-pan.active,
.bk-zoom-pan:hover:not(:disabled),
.bk-zoom-pan:focus,
.bk-magnifier-edit-mode.active,
.bk-magnifier-edit-mode:hover:not(:disabled),
.bk-magnifier-edit-mode:focus {
  border-color: #1a84b3;
  background: #3fb1e4;
  background: linear-gradient(to bottom, #3fb1e4 0%, #3fb1e4 50%, #2daae1 51%, #2daae1 100%);
  color: #fff;
}

.bk-zoom-status {
  margin-top: 5px;
  padding: 9px 12px;
  border-left: 4px solid #337ab7;
  background: #d9edf7;
  color: #245580;
  line-height: 1.5;
}

.bk-zoom-status .fa {
  margin-right: 4px;
}

.bk-zoom-status-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.bk-zoom-status-link:hover,
.bk-zoom-status-link:focus {
  color: #123f5d;
  text-decoration: underline;
}

.bk-mosaic-effect-canvas,
.bk-mosaic-mask-canvas {
  position: absolute;
  left: 0;
  top: 0;
}

.bk-mosaic-mask-canvas {
  opacity: 0;
  pointer-events: none;
}

.bk-magnifier-guide-handle {
  position: absolute;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
  color: #333;
  line-height: 1;
  transform: translate(-50%, -50%);
  touch-action: none;
  cursor: grab;
}

.bk-magnifier-guide-handle[hidden] {
  display: none !important;
}

.bk-magnifier-guide-handle:active {
  cursor: grabbing;
}

.bk-magnifier-source-handle {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.01);
  box-shadow: none;
}

.bk-magnifier-source-handle::before {
  display: none;
  content: none;
}

.bk-magnifier-resize-handle {
  width: 38px;
  height: 38px;
  font-size: 17px;
}

.bk-magnifier-resize-handle .fa-solid {
  pointer-events: none;
  transform: scaleX(-1);
}

.bk-mosaic-overlay {
  position: absolute;
  border: 2px solid #46b8da;
  background: transparent;
  box-sizing: border-box;
  cursor: grab;
  touch-action: none;
  transform-origin: center center;
  user-select: none;
}

.bk-mosaic-overlay.is-circle {
  border-radius: 50%;
}

.bk-mosaic-overlay-handle,
.bk-mosaic-overlay-rotate,
.bk-mosaic-overlay-move {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  touch-action: none;
}

.bk-mosaic-overlay-handle {
  width: 34px;
  height: 34px;
  background: transparent;
  box-shadow: none;
}

.bk-mosaic-overlay-handle::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.bk-mosaic-overlay-handle-northwest {
  left: -17px;
  top: -17px;
  cursor: grab;
}

.bk-mosaic-overlay-handle-northeast {
  right: -17px;
  top: -17px;
  cursor: grab;
}

.bk-mosaic-overlay-handle-southwest {
  left: -17px;
  bottom: -17px;
  cursor: grab;
}

.bk-mosaic-overlay-handle-southeast {
  right: -17px;
  bottom: -17px;
  cursor: grab;
}

.bk-mosaic-overlay-rotate {
  left: 50%;
  bottom: -48px;
  margin-left: -39px;
  cursor: grab;
}

.bk-mosaic-overlay-rotate:active {
  cursor: grab;
}

.bk-mosaic-overlay-move {
  left: 50%;
  bottom: -48px;
  margin-left: 5px;
  cursor: grab;
}

.bk-mosaic-overlay.bk-overlay-is-small .bk-mosaic-overlay-rotate,
.bk-mosaic-overlay.bk-overlay-is-small .bk-mosaic-overlay-move {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.bk-mosaic-overlay.bk-overlay-is-small .bk-mosaic-overlay-rotate {
  bottom: -34px;
  margin-left: -27px;
}

.bk-mosaic-overlay.bk-overlay-is-small .bk-mosaic-overlay-move {
  bottom: -34px;
  margin-left: 3px;
}

.bk-mosaic-overlay-rotate .fa-solid,
.bk-mosaic-overlay-move .fa-solid {
  pointer-events: none;
}

.bk-mosaic-overlay-rotation-label {
  position: absolute;
  left: 50%;
  bottom: -84px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}

.bk-choice-group {
  display: flex;
  gap: 8px;
  border: 0;
  padding: 0;
}

.bk-choice-group label {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px 8px 42px;
  border: 1px solid #bdbdbd;
  border-radius: 4px;
  background: #f6f6f6;
  color: #333;
  font-weight: 400;
  cursor: pointer;
}

.bk-choice-group label::before {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  background: #fff;
  content: "";
  transform: translateY(-50%);
}

.bk-choice-group label:has(:checked)::after {
  position: absolute;
  left: 18px;
  top: 50%;
  width: 7px;
  height: 12px;
  border: solid #2f8ecb;
  border-width: 0 3px 3px 0;
  content: "";
  transform: translateY(-62%) rotate(45deg);
}

.bk-choice-group label:has(:checked) {
  border-color: #46b8da;
  background: #5bc0de;
  color: #fff;
}

.bk-choice-group input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 360px) {
  .bk-mosaic-target-preset {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (max-width: 480px) {
  .bk-zoom-icon {
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .bk-canvas-mode-controls,
  .bk-brush-size-controls {
    max-width: none;
  }

  .bk-zoom-icon,
  .bk-zoom-value,
  .bk-canvas-mode-controls .btn {
    font-size: 14px;
  }

  .bk-zoom-value {
    padding-left: 4px;
    padding-right: 4px;
  }

  .bk-fill-size-field {
    gap: 5px;
  }

  .bk-fill-size-input {
    flex: 1 1 72px;
    min-width: 0;
    max-width: none;
  }

  .bk-fill-size-apply,
  .bk-fill-size-clear {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
  }
}

@media (max-width: 767px) {
  .bk-canvas-viewport-host {
    width: calc(100% - 4px);
    margin-left: auto;
    margin-right: auto;
  }
}
