.tkyt-builder {
  --tkyt-ink: #221b16;
  --tkyt-muted: #75695f;
  --tkyt-line: #e6d8c5;
  --tkyt-surface: #fffaf2;
  --tkyt-accent: #a73524;
  --tkyt-accent-dark: #7d2318;
  --tkyt-plate-width: 100%;
  --tkyt-product-image-size: 64px;
  --tkyt-add-icon-size: 34px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(260px, 32%) minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  min-height: 720px;
  padding: 24px;
  color: var(--tkyt-ink);
  background: #f8f2e8;
  font-family: inherit;
}

.tkyt-builder *,
.tkyt-builder *::before,
.tkyt-builder *::after {
  box-sizing: border-box;
}

.tkyt-products,
.tkyt-stage {
  min-width: 0;
}

.tkyt-products {
  border-right: 1px solid var(--tkyt-line);
  padding-right: 20px;
}

.tkyt-products__header,
.tkyt-stage__topbar,
.tkyt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tkyt-products__header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.tkyt-products__header span,
.tkyt-stage__topbar strong {
  white-space: nowrap;
  color: var(--tkyt-accent-dark);
}

.tkyt-products__list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.tkyt-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tkyt-category,
.tkyt-add {
  border: 1px solid var(--tkyt-line);
  border-radius: 8px;
  background: #fffdf9;
  color: var(--tkyt-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tkyt-category {
  min-height: 34px;
  padding: 0 12px;
}

.tkyt-category[data-active="true"] {
  border-color: var(--tkyt-accent);
  background: var(--tkyt-accent);
  color: #ffffff;
}

.tkyt-product {
  position: relative;
  display: grid;
  grid-template-columns: var(--tkyt-product-image-size) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 1px solid var(--tkyt-line);
  border-radius: 8px;
  background: #fffdf9;
  color: inherit;
  text-align: left;
  cursor: default;
}

.tkyt-product[draggable="true"] {
  cursor: grab;
}

.tkyt-product[draggable="true"]:active {
  cursor: grabbing;
}

.tkyt-product img {
  width: var(--tkyt-product-image-size);
  height: var(--tkyt-product-image-size);
  border-radius: 8px;
  object-fit: cover;
  background: #efe3d2;
}

.tkyt-hide-product-images .tkyt-product {
  grid-template-columns: minmax(0, 1fr);
}

.tkyt-hide-product-images .tkyt-product img {
  display: none;
}

.tkyt-product strong,
.tkyt-product small {
  display: block;
  overflow-wrap: anywhere;
}

.tkyt-product strong {
  font-size: 15px;
  line-height: 1.25;
}

.tkyt-product small {
  margin-top: 4px;
  color: var(--tkyt-muted);
}

.tkyt-add {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none !important;
  align-items: center;
  justify-content: center;
  width: var(--tkyt-add-icon-size) !important;
  height: var(--tkyt-add-icon-size) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: var(--tkyt-add-icon-size) !important;
  max-height: var(--tkyt-add-icon-size) !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--tkyt-accent-dark);
  font-size: var(--tkyt-add-icon-size);
  line-height: 1;
  text-indent: 0;
  overflow: visible;
  appearance: none;
  -webkit-appearance: none;
}

.tkyt-add:hover,
.tkyt-add:focus,
.tkyt-add:focus-visible {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
}

.tkyt-add__icon,
.tkyt-add__icon i,
.tkyt-add__icon svg,
.tkyt-add__custom-icon {
  display: block;
  width: calc(var(--tkyt-add-icon-size) * 0.58) !important;
  height: calc(var(--tkyt-add-icon-size) * 0.58) !important;
  color: currentColor;
  font-size: calc(var(--tkyt-add-icon-size) * 0.58) !important;
  line-height: 1 !important;
}

.tkyt-add__icon {
  display: grid;
  place-items: center;
}

.tkyt-add__icon svg,
.tkyt-add__svg {
  display: block;
  fill: currentColor;
  overflow: visible;
}

.tkyt-add__svg path {
  stroke: currentColor;
}

.tkyt-add__custom-icon {
  background: currentColor !important;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.tkyt-stage {
  display: grid;
  grid-template-rows: auto auto minmax(420px, 1fr) auto auto;
  gap: 18px;
}

.tkyt-back {
  color: var(--tkyt-accent-dark);
  font-weight: 700;
  text-decoration: none;
}

.tkyt-name {
  display: grid;
  gap: 8px;
  max-width: 480px;
}

.tkyt-name span {
  color: var(--tkyt-muted);
  font-size: 14px;
  font-weight: 700;
}

.tkyt-name input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--tkyt-line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdf9;
  color: var(--tkyt-ink);
  font: inherit;
}

.tkyt-plate-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
}

.tkyt-plate {
  position: relative;
  width: min(var(--tkyt-plate-width), 680px);
  max-width: 680px;
  aspect-ratio: 1;
  border: 18px solid #68401f;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 241, 210, 0.58), transparent 22%),
    radial-gradient(circle at 50% 50%, #e4bc88 0 44%, #aa6c36 60%, #6f3e1d 100%);
  box-shadow: inset 0 10px 28px rgba(92, 64, 42, 0.12), 0 18px 36px rgba(75, 49, 30, 0.16);
}

.tkyt-plate.has-image {
  border: 0;
  background: var(--tkyt-plate-image) center / contain no-repeat;
  box-shadow: none;
}

.tkyt-slot {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(86px, 18%, 130px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 8px;
  border: 2px dashed #d2b996;
  border-radius: 50%;
  background: rgba(255, 250, 242, 0.86);
  color: var(--tkyt-muted);
  font-size: 13px;
  line-height: 1.1;
  text-align: center;
  overflow: hidden;
  cursor: pointer;
}

.tkyt-slot.is-filled {
  border-style: solid;
  border-color: #fff8eb;
  background: #b33a28;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(81, 37, 22, 0.22);
}

.tkyt-slot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.tkyt-slot span {
  position: relative;
  z-index: 1;
  max-width: 100%;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tkyt-actions {
  justify-content: flex-end;
}

.tkyt-actions .button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--tkyt-accent);
  font-weight: 700;
  cursor: pointer;
}

.tkyt-primary {
  background: var(--tkyt-accent);
  color: #ffffff;
}

.tkyt-primary:hover {
  background: var(--tkyt-accent-dark);
}

.tkyt-primary:disabled {
  border-color: #c9bfb3;
  background: #c9bfb3;
  cursor: not-allowed;
}

.tkyt-secondary {
  background: #fffdf8;
  color: var(--tkyt-accent-dark);
}

.tkyt-status {
  min-height: 24px;
  margin: 0;
  color: var(--tkyt-muted);
}

.tkyt-status[data-tone="success"] {
  color: #1f7a43;
}

.tkyt-status[data-tone="error"] {
  color: #b00020;
}

.tkyt-empty {
  margin: 0;
  color: var(--tkyt-muted);
}

@media (max-width: 860px) {
  .tkyt-builder {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 16px;
  }

  .tkyt-products {
    border-right: 0;
    border-bottom: 1px solid var(--tkyt-line);
    padding-right: 0;
    padding-bottom: 16px;
  }

  .tkyt-products__list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .tkyt-add {
    display: inline-flex !important;
    width: var(--tkyt-add-icon-size) !important;
    height: var(--tkyt-add-icon-size) !important;
  }

  .tkyt-stage {
    grid-template-rows: auto auto auto auto auto;
  }

  .tkyt-plate {
    width: min(var(--tkyt-plate-width), 560px);
  }
}

@media (max-width: 520px) {
  .tkyt-builder {
    padding: 12px;
  }

  .tkyt-products__header,
  .tkyt-stage__topbar,
  .tkyt-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tkyt-actions .button {
    width: 100%;
  }

  .tkyt-slot {
    width: clamp(64px, 20%, 92px);
    font-size: 11px;
  }

  .tkyt-add {
    min-height: 44px;
  }

  .tkyt-products__list {
    grid-template-columns: 1fr;
  }
}
