.mp-bc {
  --ink: #1c1917;
  --muted: #6f675f;
  --line: #e7e0d8;
  --paper: #f7f4ef;
  --card: #fff;
  color: var(--ink);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  align-items: start;
  margin: 0 auto 36px;
  max-width: 1080px;
}

.mp-bc * {
  box-sizing: border-box;
}

.mp-bc button,
.mp-bc input {
  font-family: inherit;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
}

.mp-bc__stage {
  min-width: 0;
}

.mp-bc__frame {
  margin: 0 auto;
  position: relative;
  width: min(100%, 42vh, 480px);
}

.mp-bc__canvas {
  aspect-ratio: 1;
  background:
    radial-gradient(ellipse at 50% 36%, #fffdfb 0%, #f3ece4 54%, #e5dbd0 100%);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.mp-bc__canvas svg,
.mp-bc__canvas canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.mp-bc__canvas canvas {
  cursor: grab;
  height: 100% !important;
  left: 0;
  position: absolute;
  top: 0;
  touch-action: none;
  width: 100% !important;
}

.mp-bc__canvas canvas.is-dragging {
  cursor: grabbing;
}

.mp-bc__loading {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  inset: 0;
  justify-content: center;
  margin: 0;
  position: absolute;
}

.mp-bc__view {
  background: rgba(255, 252, 248, 0.92);
  border: 1px solid rgba(28, 25, 23, 0.12);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(40, 30, 20, 0.08);
  display: flex;
  gap: 2px;
  padding: 3px;
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 4;
}

.mp-bc__view button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  min-width: 46px;
  padding: 8px 12px;
}

.mp-bc__view button.is-selected {
  background: var(--ink);
  color: #fff;
}

.mp-bc__hint {
  background: rgba(255, 252, 248, 0.82);
  border-radius: 999px;
  bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  left: 12px;
  line-height: 1.35;
  margin: 0;
  padding: 6px 10px;
  position: absolute;
  right: 12px;
  text-align: center;
  z-index: 4;
}

.mp-bc__hint[hidden] {
  display: none !important;
}

.mp-bc__bead {
  cursor: pointer;
}

.mp-bc__bead:focus-visible {
  outline: none;
}

.mp-bc__bead:focus-visible circle.mp-bc__hit {
  stroke: var(--ink);
  stroke-width: 3px;
}

.mp-bc__tray {
  margin-top: 14px;
}

.mp-bc__trayhead {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mp-bc__placing {
  font-size: 14px;
  font-weight: 650;
  margin: 0;
}

.mp-bc input.mp-bc__search {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  flex: 0 0 148px;
  font-size: 13px;
  margin: 0;
  max-width: 46%;
  padding: 8px 12px;
  width: 148px !important;
}

.mp-bc__stones {
  display: grid;
  gap: 8px 4px;
  grid-template-rows: auto auto;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 12px;
  scroll-snap-type: x proximity;
  scrollbar-color: #d9d0c6 transparent;
  scrollbar-width: thin;
}

.mp-bc__stone {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px 6px;
  scroll-snap-align: start;
  width: 84px;
}

.mp-bc__stone.is-selected {
  background: #fff;
  border-color: var(--ink);
}

.mp-bc__stone img {
  display: block;
  filter: drop-shadow(0 4px 4px rgba(48, 36, 24, 0.18));
  height: 58px;
  max-width: none;
  width: 58px;
}

.mp-bc__stone span {
  display: -webkit-box;
  font-size: 11px;
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mp-bc__tools {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 12px;
}

.mp-bc__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.mp-bc__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mp-bc__chips,
.mp-bc__step,
.mp-bc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mp-bc__step {
  align-items: center;
}

.mp-bc__step strong {
  font-size: 14px;
  font-weight: 650;
  min-width: 1.6rem;
  text-align: center;
}

.mp-bc__chip,
.mp-bc__textbtn,
.mp-bc__step button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 8px 10px;
}

.mp-bc__chip.is-selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.mp-bc__actions {
  align-items: center;
}

.mp-bc__note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 10px 0 0;
}

.mp-bc__empty {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 0;
}

.mp-bc__panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  position: sticky;
  top: 12px;
}

.mp-bc__panel h2 {
  font-size: 16px;
  font-weight: 650;
  margin: 0 0 8px;
}

.mp-bc__counts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mp-bc__counts li {
  font-size: 14px;
}

.mp-bc__counts .is-empty {
  color: var(--muted);
}

.mp-bc__order {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}

.mp-bc__price {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0;
}

.mp-bc__unit,
.mp-bc__progress {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.mp-bc__btn {
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
  margin-top: 14px;
  padding: 14px 18px;
  width: 100%;
}

.mp-bc__btn:disabled {
  background: #ddd7d0;
  color: #6f675f;
  cursor: not-allowed;
}

.mp-bc__error {
  color: #8a2b2b;
  font-size: 14px;
  margin: 10px 0 0;
}

.mp-bc__chip:focus-visible,
.mp-bc__textbtn:focus-visible,
.mp-bc__step button:focus-visible,
.mp-bc__stone:focus-visible,
.mp-bc__btn:focus-visible,
.mp-bc__search:focus-visible,
.mp-bc__view button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 860px) {
  .mp-bc {
    grid-template-columns: 1fr;
  }

  .mp-bc__frame {
    width: min(100%, 46vh, 420px);
  }

  .mp-bc__panel {
    position: static;
  }
}
