.bk-heart-shape-panel {
  margin: 8px -15px 10px;
  padding: 10px;
  border: 1px solid #d9dee2;
  background: #f5f6f7;
}

.bk-heart-shape-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.bk-heart-shape-heading strong { color: #333; font-size: 14px; }
.bk-heart-shape-heading span { color: #777; font-size: 12px; }

.bk-heart-shape-scroller {
  position: relative;
  min-width: 0;
}

.bk-heart-shape-options {
  display: flex;
  overflow-x: auto;
  padding: 1px 2px 5px;
  gap: 7px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.bk-heart-shape-options::-webkit-scrollbar {
  display: none;
}

.bk-heart-shape-option {
  display: grid;
  min-width: 112px;
  min-height: 74px;
  flex: 1 0 112px;
  padding: 6px 4px;
  place-items: center;
  border: 1px solid #cbd2d8;
  border-radius: 7px;
  background: #fff;
  color: #535b62;
  line-height: 1.15;
  touch-action: manipulation;
}

.bk-heart-shape-option:hover:not(:disabled),
.bk-heart-shape-option:focus-visible {
  border-color: #7a838b;
  outline: 0;
  box-shadow: 0 0 0 1px #7a838b;
}

.bk-heart-shape-option.is-active {
  border-color: #7a838b;
  background: #eef0f2;
  box-shadow: 0 0 0 1px #7a838b;
  color: #3f474d;
}

.bk-heart-shape-option:disabled { opacity: .55; cursor: not-allowed; }
.bk-heart-shape-option strong { font-size: 13px; }
.bk-heart-shape-icon {
  display: block;
  width: 64px;
  max-width: 100%;
  height: 48px;
}

.bk-heart-shape-scroll-button {
  display: none;
}

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

.bk-heart-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-heart-image-summary-row {
  margin-top: 10px;
  margin-bottom: 10px;
}

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

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

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

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

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

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

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

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

.bk-heart-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-heart-advanced {
  margin: 0 0 12px;
  border: 0;
  background: #fff;
}

.bk-heart-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-heart-advanced-heading h2 {
  margin: 0;
  color: inherit;
  line-height: 45px;
  font-size: 14px;
  font-weight: 700;
}

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

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

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

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

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

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

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

.bk-heart-straighten-row {
  margin-bottom: 9px;
}

.bk-heart-straighten-row .bk-range-stepper .bk-range-value {
  min-width: 64px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.bk-heart-straighten-reset {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

.bk-heart-straighten-help {
  margin: 0;
  color: #777;
}

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

.bk-heart-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-heart-border-modes label::before {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  background: #fff;
  content: "";
  transform: translateY(-50%);
}

.bk-heart-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-heart-border-modes label:has(:checked) {
  border-color: #46b8da;
  background: #5bc0de;
  color: #fff;
}

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

.bk-heart-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-heart-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;
}

@media (max-width: 480px) {
  .bk-heart-straighten-row .bk-range-label {
    padding-right: 6px;
    padding-left: 6px;
  }

  .bk-heart-straighten-row .bk-range-input {
    min-width: 0;
  }

  .bk-heart-straighten-row .bk-range-step-button {
    padding: 0 8px;
  }

  .bk-heart-straighten-row .bk-range-stepper .bk-range-value {
    min-width: 48px;
    padding-right: 5px;
    padding-left: 5px;
  }
}

@media (max-width: 360px) {
  .bk-heart-straighten-row {
    flex-wrap: wrap;
  }

  .bk-heart-straighten-row > input {
    order: 3;
    width: 100%;
    flex-basis: 100%;
  }
}

.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-heart-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 {
  display: none;
}

.bk-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 1px dashed rgba(255,255,255,.5);
  box-shadow: none;
  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-heart-mask-preview {
  position: absolute;
  inset: 0;
  z-index: 2;
  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-heart-advanced-content {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 767px) {
  .bk-heart-shape-options { padding-right: 8px; padding-left: 8px; gap: 5px; }
  .bk-heart-shape-option { min-height: 74px; }

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

  .bk-heart-shape-scroll-button[hidden] { display: none; }
  .bk-heart-shape-scroll-button.is-left {
    left: 0;
    background: linear-gradient(to right, #f5f6f7 55%, rgba(245,246,247,0));
  }
  .bk-heart-shape-scroll-button.is-right {
    right: 0;
    background: linear-gradient(to left, #f5f6f7 55%, rgba(245,246,247,0));
  }
  #center_crop_position {
    min-height: 44px;
  }

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

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

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

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

  .bk-heart-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-heart-border-modes {
    flex-direction: column;
  }

}

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

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