.tfw-builder-page {
  background: #f7f2ea;
  color: #211b16;
  padding: 56px 24px 80px;
  overflow-x: hidden;
}

.tfw-builder-hero {
  max-width: 1320px;
  margin: 0 auto 36px;
}

.tfw-kicker {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  color: #a8844f;
  margin-bottom: 10px;
}

.tfw-builder-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  margin: 0 0 16px;
  font-family: serif;
}

.tfw-builder-hero p {
  max-width: 640px;
  color: #6c6258;
  font-size: 17px;
}

.tfw-builder-layout {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(520px, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.tfw-builder-panel,
.tfw-design-stage,
.tfw-summary-panel {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(120, 96, 63, .14);
  border-radius: 28px;
  box-shadow: 0 18px 50px rgba(39, 31, 21, .08);
}

.tfw-builder-panel,
.tfw-summary-panel {
  padding: 24px;
}

.tfw-builder-panel h2,
.tfw-design-stage h2,
.tfw-summary-panel h2 {
  margin: 0 0 20px;
  font-family: serif;
  font-size: 26px;
}

.tfw-filter-group {
  display: block;
  margin-bottom: 22px;
}

.tfw-filter-title {
  display: block;
  font-size: 13px;
  color: #7b7167;
  margin-bottom: 8px;
}

.tfw-filter-group select {
  width: 100%;
  border: 1px solid rgba(120, 96, 63, .18);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: #211b16;
}

.tfw-chip-row,
.tfw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tfw-tabs {
  margin-bottom: 18px;
}

.tfw-chip-row button,
.tfw-tabs button {
  border: 1px solid rgba(120, 96, 63, .16);
  background: #fff;
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  color: #3d352e;
}

.tfw-chip-row button.active,
.tfw-tabs button.active {
  background: #211b16;
  color: #fff;
  border-color: #211b16;
}

.tfw-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.tfw-product-card {
  border: 1px solid rgba(120, 96, 63, .12);
  background: #fffaf3;
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.tfw-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(39,31,21,.09);
}

.tfw-product-img {
  width: 68px;
  height: 68px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--bead-color);
  box-shadow: inset 12px 12px 20px rgba(255,255,255,.65), inset -10px -10px 18px rgba(0,0,0,.14), 0 8px 18px rgba(0,0,0,.12);
  object-fit: contain;
}

.tfw-product-img.real {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.tfw-product-img-irregular_beads,
.tfw-product-img-spacers,
.tfw-product-img-charms,
.tfw-product-img-caps {
  border-radius: 0;
  box-shadow: none;
}

.tfw-product-card h4 {
  margin: 0 0 5px;
  font-size: 14px;
}

.tfw-product-card p {
  margin: 0;
  color: #7b7167;
  font-size: 12px;
}

.tfw-product-card strong {
  display: block;
  margin-top: 8px;
  color: #a8844f;
}

.tfw-empty {
  color: #7b7167;
  font-size: 14px;
  grid-column: 1 / -1;
}

.tfw-design-stage {
  min-height: 720px;
  padding: 28px;
}

.tfw-stage-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tfw-bracelet-canvas {
  min-height: 560px;
  display: grid;
  place-items: center;
  position: relative;
}

.tfw-bracelet-ring {
  width: 430px;
  height: 430px;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(circle, rgba(255,255,255,.76) 0%, rgba(255,255,255,.5) 52%, rgba(168,132,79,.04) 100%);
}

.tfw-bracelet-ring::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cord-size, 316px);
  height: var(--cord-size, 316px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(168, 132, 79, .32);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.78),
    inset 0 0 12px rgba(168,132,79,.08),
    0 0 16px rgba(168,132,79,.08);
  z-index: 1;
}

.tfw-ring-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 210px;
  min-height: 120px;
  transform: translate(-50%, -50%);
  display: grid;
  align-content: center;
  gap: 14px;
  text-align: center;
  pointer-events: none;
  z-index: 4;
}

.tfw-center-row {
  display: grid;
  gap: 4px;
}

.tfw-ring-center span {
  color: #8a7c70;
  font-size: 13px;
}

.tfw-ring-center strong {
  font-size: 20px;
  line-height: 1.1;
  font-family: serif;
}

.tfw-ring-bead {
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background-color: var(--bead-color);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
  left: 50%;
  top: 50%;
  transform:
    translate(-50%, -50%)
    rotate(var(--angle))
    translate(var(--distance))
    rotate(270deg);
  box-shadow:
    inset 12px 12px 18px rgba(255,255,255,.18),
    inset -10px -10px 16px rgba(0,0,0,.16),
    0 8px 18px rgba(0,0,0,.14);
  cursor: grab;
}

.tfw-ring-beads,
.tfw-ring-irregular_beads {
  z-index: 6;
}

.tfw-ring-irregular_beads,
.tfw-ring-spacers,
.tfw-ring-caps,
.tfw-ring-charms {
  border-radius: 0;
  box-shadow: none;
  background-color: transparent !important;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.tfw-ring-irregular_beads {
  filter: drop-shadow(0 5px 10px rgba(0,0,0,.18));
}

.tfw-ring-spacers,
.tfw-ring-caps,
.tfw-ring-charms {
  filter: drop-shadow(0 3px 7px rgba(0,0,0,.18));
}

.tfw-ring-spacers,
.tfw-ring-caps {
  z-index: 3;
}

.tfw-ring-charms {
  border-radius: 0;
  box-shadow: none;
  z-index: 2;
  transform:
    translate(-50%, -50%)
    rotate(var(--angle))
    translate(calc(var(--distance) + (var(--size) / 2)))
    rotate(270deg);
}

.tfw-ring-bead.dragging {
  opacity: .45;
  cursor: grabbing;
  z-index: 20;
}

.tfw-remove-bead {
  position: absolute;
  right: -8px;
  top: -8px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #211b16;
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 30;
}

.tfw-ring-bead:hover .tfw-remove-bead {
  opacity: 1;
}

.tfw-canvas-hint {
  position: absolute;
  bottom: 18px;
  color: #8a7c70;
  font-size: 14px;
  text-align: center;
}

.tfw-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(120, 96, 63, .12);
}

.tfw-summary-row span {
  color: #7b7167;
}

.tfw-summary-row strong {
  text-align: right;
}

.tfw-material-list,
.tfw-balance-box {
  margin: 24px 0;
  padding: 18px;
  border-radius: 20px;
  background: #fffaf3;
  border: 1px solid rgba(120, 96, 63, .12);
}

.tfw-material-list h3,
.tfw-balance-box h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.tfw-balance-note {
  display: inline-block;
  margin-left: 6px;
  color: #8a7c70;
  font-size: 12px;
  font-weight: 400;
}

.tfw-material-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(120, 96, 63, .08);
}

.tfw-material-row:last-child {
  border-bottom: 0;
}

.tfw-muted {
  color: #8a7c70;
  font-size: 13px;
  margin: 0;
}

.tfw-balance-line {
  margin-bottom: 12px;
}

.tfw-balance-line span {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.tfw-balance-track {
  height: 7px;
  background: rgba(120, 96, 63, .12);
  border-radius: 999px;
  overflow: hidden;
}

.tfw-balance-fill {
  height: 100%;
  background: #a8844f;
  border-radius: 999px;
}

.tfw-main-btn,
.tfw-secondary-btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  font-weight: 600;
}

.tfw-main-btn {
  width: 100%;
  background: #211b16;
  color: #fff;
  margin-bottom: 12px;
}

.tfw-secondary-btn {
  background: #fff;
  color: #211b16;
  border: 1px solid rgba(120,96,63,.16);
}

.tfw-secondary-btn.full {
  width: 100%;
}

.tfw-builder-bottom-notice {
  margin-top: 56px;
  padding: 0 24px;
}

.tfw-builder-bottom-notice__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 30px;
  border-top: 1px solid rgba(168,132,79,.16);
  color: #7b7167;
}

.tfw-builder-bottom-notice strong {
  display: block;
  margin-bottom: 10px;
  color: #211b16;
  font-size: 14px;
  letter-spacing: .04em;
}

.tfw-builder-bottom-notice p {
  margin: 0;
  max-width: 920px;
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .tfw-builder-page {
    padding: 36px 14px 64px;
    overflow-x: hidden;
  }

  .tfw-builder-hero,
  .tfw-builder-layout {
    width: 100%;
    max-width: 100%;
  }

  .tfw-builder-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin: 0 auto;
  }

  .tfw-builder-panel,
  .tfw-design-stage,
  .tfw-summary-panel {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    border-radius: 24px;
  }

  .tfw-builder-panel,
  .tfw-summary-panel {
    padding: 22px;
  }

  .tfw-design-stage {
    min-height: auto;
    padding: 24px 18px 34px;
  }

  .tfw-stage-top {
    align-items: flex-start;
  }

  .tfw-bracelet-canvas {
    min-height: 480px;
  }

  .tfw-bracelet-ring {
    width: min(82vw, 340px);
    height: min(82vw, 340px);
  }

  .tfw-ring-center {
    width: 180px;
    min-height: 110px;
    gap: 12px;
  }

  .tfw-ring-center strong {
    font-size: 18px;
  }

  .tfw-canvas-hint {
    position: static;
    margin-top: 22px;
    padding: 0 16px;
    line-height: 1.45;
  }

  .tfw-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 520px;
  }
}

@media (max-width: 768px) {
  .tfw-ring-center {
    width: 170px;
    line-height: 1.25;
    gap: 8px;
  }

  .tfw-ring-center span {
    font-size: 12px;
  }

  .tfw-ring-center strong {
    font-size: 15px;
  }

  .tfw-incomplete-design strong {
    font-size: 16px;
  }

  .tfw-small-center-row strong {
    font-size: 13px;
  }

  .tfw-builder-bottom-notice {
    padding: 0 16px;
    margin-top: 40px;
  }

  .tfw-builder-bottom-notice__inner {
    padding: 22px 0;
  }

  .tfw-builder-bottom-notice p {
    font-size: 13px;
    line-height: 1.65;
  }
}

@media (max-width: 520px) {
  .tfw-builder-page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .tfw-builder-hero h1 {
    font-size: 36px;
  }

  .tfw-builder-panel,
  .tfw-design-stage,
  .tfw-summary-panel {
    border-radius: 22px;
  }

  .tfw-bracelet-ring {
    width: min(86vw, 320px);
    height: min(86vw, 320px);
  }

  .tfw-bracelet-canvas {
    min-height: 455px;
  }

  .tfw-ring-center {
    width: 160px;
  }

  .tfw-ring-center span {
    font-size: 12px;
  }

  .tfw-ring-center strong {
    font-size: 16px;
  }
}