.bk-circle-size-preset-panel {
  margin: 8px -15px 10px;
  padding: 10px;
  border: 1px solid #d8dde1;
  background: #f7f8f9;
}

.bk-circle-size-preset-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.bk-circle-size-preset-heading strong {
  color: #40464b;
  font-size: 14px;
}

.bk-circle-size-preset-heading span {
  color: #778089;
  font-size: 12px;
}

.bk-circle-size-presets {
  display: flex;
  gap: 6px;
}

.bk-circle-size-preset-scroller {
  position: relative;
  min-width: 0;
}

.bk-circle-size-scroll-button {
  display: none;
}

.bk-circle-size-preset {
  position: relative;
  display: inline-flex;
  min-width: 0;
  min-height: 66px;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 5px;
  border: 1px solid #cbd2d8;
  border-radius: 6px;
  background: #fff;
  color: #535b62;
  font-size: 13px;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.bk-circle-size-preset[hidden] {
  display: none;
}

.bk-circle-size-preset:first-child,
.bk-circle-size-preset.is-custom {
  flex-direction: column;
}

.bk-circle-size-preset > strong {
  font-size: 18px;
}

.bk-circle-size-preset > small {
  font-size: 10px;
  font-weight: 400;
}

.bk-circle-size-preset:hover:not(:disabled),
.bk-circle-size-preset:focus-visible {
  border-color: #1689c5;
  box-shadow: 0 0 0 1px #1689c5;
  outline: 0;
}

.bk-circle-size-preset.is-active {
  border-color: #1689c5;
  background: #e9f6fc;
  box-shadow: 0 0 0 1px #1689c5;
  color: #0878b3;
}

.bk-circle-size-preset.is-custom {
  border-color: #b9a7d4;
}

.bk-circle-size-preset:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.bk-circle-operation-guide {
  display: flex;
  min-height: 44px;
  margin-top: 0;
  margin-bottom: 10px;
  align-items: center;
  gap: 6px;
}

.bk-circle-operation-guide > strong {
  min-width: 0;
  flex: 1 1 auto;
}

#crop_center_controls {
  flex: 0 0 auto;
  margin-left: auto;
}

#center_crop_position {
  min-height: 34px;
  padding: 5px 12px;
  color: #245580;
  font-weight: 700;
}

.bk-circle-image-summary-row {
  margin-top: 10px;
  margin-bottom: 10px;
}

.bk-circle-image-summary {
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d9dee2;
  border-radius: 5px;
  background: #fff;
}

.bk-circle-image-summary h2 {
  margin: 0;
  padding: 8px 11px;
  border-bottom: 1px solid #d9dee2;
  background: #eef8fc;
  color: #286b8c;
  font-size: 13px;
  font-weight: 700;
}

.bk-circle-image-summary h2 i {
  width: 18px;
  text-align: center;
}

.bk-circle-image-summary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.bk-circle-image-summary dl > div {
  min-width: 0;
  border-right: 1px solid #e2e5e7;
}

.bk-circle-image-summary dl > div:last-child {
  border-right: 0;
}

.bk-circle-image-summary dt,
.bk-circle-image-summary dd {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 7px 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.bk-circle-image-summary dt {
  border-bottom: 1px solid #e2e5e7;
  background: #fafafa;
  color: #59636b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.bk-circle-image-summary dd {
  min-height: 40px;
  color: #26343d;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#crop_center_controls[hidden],
.bk-crop-layer[hidden] {
  display: none !important;
}

.bk-circle-advanced {
  margin: 0 0 12px;
  border: 0;
  background: #fff;
}

.bk-circle-advanced-heading {
  display: flex;
  min-height: 45px;
  height: 45px;
  padding: 0 20px;
  align-items: center;
  justify-content: flex-start;
  color: #fff;
  border-bottom: 0;
  background: #7ec200;
  background: linear-gradient(to bottom, #7ec200 0%, #7ec200 50%, #61a200 51%, #61a200 100%);
}

.bk-circle-advanced-heading h2 {
  margin: 0;
  color: inherit;
  line-height: 45px;
  font-size: 14px;
  font-weight: 700;
}

.bk-circle-advanced-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  background: #fafafa;
}

.bk-circle-settings-note {
  display: flex;
  margin: 0 11px 11px;
  padding: 9px 11px;
  align-items: flex-start;
  gap: 7px;
  border: 1px solid #bce8f1;
  border-radius: 5px;
  background: #eef9fc;
  color: #31708f;
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}

.bk-circle-settings-note .fa-solid {
  margin-top: 3px;
  flex: 0 0 auto;
  color: #28a7c7;
}

.bk-circle-setting-card {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #d9dee2;
  border-radius: 5px;
  background: #fff;
}

.bk-circle-setting-card h2 {
  margin: 0 0 3px;
  color: #42494f;
  font-size: 14px;
  font-weight: 700;
}

.bk-circle-setting-card p {
  min-height: 17px;
  margin: 0 0 8px;
  color: #777f86;
  font-size: 12px;
}

.bk-circle-output-row {
  display: flex;
  width: 100%;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

.bk-circle-output-row > label {
  display: flex;
  min-height: 46px;
  margin: 0;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #ccc;
  background: #eee;
  color: #333;
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
}

.bk-circle-output-row input {
  min-width: 0;
  height: 46px;
  padding: 0 10px;
  flex: 1 1 auto;
  border: 0;
  background: #fff;
  font-size: 16px;
  box-shadow: none;
}

.bk-circle-output-row > button {
  min-width: 58px;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-left: 1px solid #ccc;
  border-radius: 0;
  background: #fff;
  color: #333;
  font-size: 16px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.bk-circle-output-row > button:hover:not(:disabled),
.bk-circle-output-row > button:focus-visible {
  background: #e6e6e6;
}

.bk-circle-output-row > button:disabled {
  color: #aaa;
  cursor: not-allowed;
}

.bk-circle-advanced .btn,
#center_crop_position,
.bk-editor-titlebar-action,
.main-btn-wrapper .btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.bk-circle-clear-button {
  width: 46px;
  min-width: 46px !important;
  padding-right: 0;
  padding-left: 0;
}

.bk-circle-quarter-turn > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bk-circle-quarter-turn .btn {
  min-height: 38px;
}

.bk-circle-unit {
  display: flex;
  padding: 0 8px;
  align-items: center;
  color: #666;
  white-space: nowrap;
}

.bk-circle-border-modes {
  display: flex;
  padding: 0;
  border: 0;
  margin: 5px 0 10px;
  gap: 8px;
}

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

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

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

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

.bk-circle-border-modes input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bk-circle-border-color {
  margin-bottom: 10px;
}

.bk-color-history-row {
  display: flex;
  align-items: stretch;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #eee;
}

.bk-color-history-label {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 6px 10px;
  border-right: 1px solid #ccc;
  color: #555;
  font-weight: 400;
}

.bk-color-history {
  display: flex;
  min-width: 0;
  padding: 6px 8px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.bk-color-history-item {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
  cursor: pointer;
}

.bk-color-history-item.is-current {
  box-shadow: 0 0 0 2px #337ab7;
}

.bk-circle-border-thickness-row {
  margin-top: 10px;
}

.bk-range-stepper {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
}

.bk-range-stepper .bk-range-value {
  min-width: 82px;
  padding-right: 8px;
  padding-left: 8px;
  border-left: 1px solid #ccc;
  font-size: 13px;
}

.bk-range-step-button {
  display: flex;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-left: 1px solid #ccc;
  background: #fff;
  color: #333;
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.bk-range-step-button:hover:not(:disabled),
.bk-range-step-button:focus {
  background: #e6e6e6;
}

.bk-range-step-button:disabled {
  color: #aaa;
  cursor: not-allowed;
}

.bk-canvas-layer-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.bk-canvas-layer-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.bk-canvas-layer-wrap:not(.is-circle-crop-active) canvas {
  cursor: pointer;
}

.bk-canvas-drawing-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bk-crop-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: pan-y;
}

.bk-crop-shade {
  position: absolute;
  background: rgba(0, 0, 0, .46);
  pointer-events: none;
}

.bk-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .68);
  cursor: move;
  touch-action: none;
}

.bk-crop-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,
      transparent calc(33.333% - .5px),
      rgba(255,255,255,.5) calc(33.333% - .5px),
      rgba(255,255,255,.5) calc(33.333% + .5px),
      transparent calc(33.333% + .5px),
      transparent calc(66.666% - .5px),
      rgba(255,255,255,.5) calc(66.666% - .5px),
      rgba(255,255,255,.5) calc(66.666% + .5px),
      transparent calc(66.666% + .5px)),
    linear-gradient(to bottom,
      transparent calc(33.333% - .5px),
      rgba(255,255,255,.5) calc(33.333% - .5px),
      rgba(255,255,255,.5) calc(33.333% + .5px),
      transparent calc(33.333% + .5px),
      transparent calc(66.666% - .5px),
      rgba(255,255,255,.5) calc(66.666% - .5px),
      rgba(255,255,255,.5) calc(66.666% + .5px),
      transparent calc(66.666% + .5px));
  pointer-events: none;
}

.bk-circle-border-preview {
  position: absolute;
  z-index: 4;
  box-sizing: border-box;
  border-style: solid;
  border-radius: 50%;
  pointer-events: none;
}

.bk-crop-handle {
  position: absolute;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  touch-action: none;
}

.bk-crop-handle::after {
  position: absolute;
  inset: 15px;
  box-sizing: border-box;
  border: 2px solid #1689c5;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.bk-crop-handle:focus-visible {
  outline: 0;
}

.bk-crop-handle:focus-visible::after {
  box-shadow: 0 0 0 3px rgba(22, 137, 197, .32);
}

.bk-crop-handle[data-handle="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.bk-crop-handle[data-handle="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.bk-crop-handle[data-handle="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.bk-crop-handle[data-handle="sw"] { left: 0; top: 100%; cursor: nesw-resize; }

@media (max-width: 1000px) {
  .bk-circle-advanced-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .bk-circle-setting-card p {
    min-height: 0;
  }
}

@media (max-width: 767px) {
  .bk-circle-size-presets {
    overflow-x: auto;
    padding: 1px 7px 5px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .bk-circle-size-presets::-webkit-scrollbar {
    display: none;
  }

  .bk-circle-size-preset {
    min-width: 76px;
    flex: 1 0 76px;
  }

  .bk-circle-size-scroll-button {
    position: absolute;
    z-index: 2;
    top: 0;
    display: flex;
    width: 31px;
    height: 72px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #0878b3;
    font-size: 16px;
    touch-action: manipulation;
  }

  .bk-circle-size-scroll-button[hidden] {
    display: none;
  }

  .bk-circle-size-scroll-button.is-left {
    left: 0;
    background: linear-gradient(to right, #f7f8f9 55%, rgba(247, 248, 249, 0));
  }

  .bk-circle-size-scroll-button.is-right {
    right: 0;
    background: linear-gradient(to left, #f7f8f9 55%, rgba(247, 248, 249, 0));
  }

  #center_crop_position {
    min-height: 44px;
  }

  .bk-circle-image-summary dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .bk-circle-image-summary dl > div {
    display: grid;
    grid-template-columns: minmax(130px, 44%) minmax(0, 1fr);
    border-right: 0;
    border-bottom: 1px solid #e2e5e7;
  }

  .bk-circle-image-summary dl > div:last-child {
    border-bottom: 0;
  }

  .bk-circle-image-summary dt {
    border-right: 1px solid #e2e5e7;
    border-bottom: 0;
  }

  .bk-circle-image-summary dd {
    justify-content: flex-start;
    text-align: left;
  }

  .bk-crop-handle {
    width: 56px;
    height: 56px;
  }

  .bk-crop-handle::after {
    inset: 19px;
  }

}

@media (max-width: 360px) {
  .bk-circle-border-modes {
    flex-direction: column;
  }

  .bk-circle-size-preset-panel {
    padding-right: 6px;
    padding-left: 6px;
  }

  .bk-circle-size-preset-heading span {
    display: none;
  }

  .bk-circle-size-presets {
    gap: 3px;
  }

  .bk-circle-size-preset {
    min-height: 62px;
    padding-right: 2px;
    padding-left: 2px;
    font-size: 11px;
  }

  .bk-circle-size-preset > strong {
    font-size: 16px;
  }

  .bk-circle-output-row > label {
    padding-right: 9px;
    padding-left: 9px;
    font-size: 14px;
  }

  .bk-circle-output-row input {
    padding-right: 6px;
    padding-left: 6px;
  }

  .bk-circle-output-row > button {
    min-width: 52px;
    padding-right: 9px;
    padding-left: 9px;
    font-size: 14px;
  }

}

/* 円形切り取りでは、選択円の外側が完成時に透明になる範囲を示す。 */
.bk-crop-layer {
  overflow: hidden;
}

.bk-crop-shade {
  display: none;
}

.bk-crop-box {
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .68),
    0 0 0 9999px rgba(19, 30, 42, .58);
}

.bk-crop-box.is-border-preview-active {
  border-color: transparent;
  box-shadow: 0 0 0 9999px rgba(19, 30, 42, .58);
}

.bk-crop-grid {
  border-radius: 50%;
}
