/* สร้างแบบเอง (builder.mjs) */
.bld-workspace {
  display: none;
  overflow: auto;
  grid-column: 2/-1;
  min-width: 0;
  background: #f5f6f8;
}
.shell.bld-open > .settings,
.shell.bld-open > .workarea {
  display: none;
}
.shell.bld-open > .bld-workspace {
  display: block;
}
.bld-inner {
  max-width: 1280px;
  margin: auto;
  padding: 28px 40px 60px;
}
.bld-head h1 {
  margin: 4px 0 6px;
  font-size: 30px;
  color: #171e2b;
}
.bld-head p {
  margin: 0 0 22px;
  color: #6b778a;
  max-width: 760px;
}
.bld-eyebrow {
  font: 600 11px system-ui;
  letter-spacing: 2.5px;
  color: #6b8a2a;
}
.bld-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 26px;
  align-items: start;
}
.bld-step {
  background: #fff;
  border: 1px solid #e1e6ed;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.bld-step h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 17px;
  color: #1d2838;
}
.bld-step h2 span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #273449;
  color: #d1f36b;
  font: 700 13px system-ui;
}
.bld-kinds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.bld-kind {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  white-space: normal;
  text-align: left;
  padding: 11px 13px;
  border-radius: 11px;
}
.bld-kind b {
  font-size: 14px;
}
.bld-kind small {
  color: #7c899b;
  font-size: 12px;
  line-height: 1.4;
}
.bld-kind em {
  font-style: normal;
  font-size: 11px;
  color: #5d7a2a;
  margin-top: 2px;
}
.bld-kind.on,
.bld-mat.on,
.bld-shape.on,
.bld-chip.on {
  border-color: #9fc24a;
  background: #f3f9e3;
  box-shadow: inset 0 0 0 1px #9fc24a;
}
.bld-mats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}
.bld-mat-group .bld-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
}
.bld-mat-group .bld-mats {
  margin-bottom: 10px;
}
.bld-wood-note {
  background: #f8f3ea;
  border-radius: 8px;
  padding: 7px 10px;
  color: #74593a;
}
.bld-mat {
  gap: 8px;
  border-radius: 20px;
  padding: 6px 13px 6px 7px;
}
.bld-mat i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #0002;
}
.bld-shapes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 7px;
}
.bld-shape {
  flex-direction: column;
  gap: 4px;
  padding: 9px 6px;
  border-radius: 11px;
  color: #3d4d63;
  white-space: normal;
  font-size: 12px;
  line-height: 1.3;
}
.bld-shape svg {
  width: 44px;
  height: 33px;
}
.bld-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
}
.bld-label {
  min-width: 78px;
  color: #647084;
  font-size: 14px;
}
.bld-chip {
  min-height: 32px;
  padding: 4px 11px;
  border-radius: 16px;
  font-size: 13px;
}
.bld-num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #647084;
}
.bld-num input {
  width: 84px;
  border: 1px solid #dce2ea;
  border-radius: 7px;
  padding: 6px 8px;
  font: 14px system-ui;
}
.bld-row select {
  width: auto;
  flex: 1;
  min-width: 220px;
}
.bld-row input[type="range"] {
  flex: 1;
  max-width: 260px;
}
.bld-line {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #647084;
}
.bld-line input {
  border: 1px solid #dce2ea;
  border-radius: 7px;
  padding: 8px 10px;
  font: inherit;
  color: #283449;
  min-width: 0;
}
.bld-sub {
  margin: 12px 0 8px;
}
.bld-fonts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 7px;
}
.bld-font {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 11px;
  border-radius: 11px;
  white-space: normal;
  text-align: left;
  min-width: 0;
}
.bld-font span {
  font-size: 21px;
  line-height: 1.35;
  color: #1d2838;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bld-font small {
  font-size: 11.5px;
  color: #7c899b;
  line-height: 1.35;
}
.bld-font.on {
  border-color: #9fc24a;
  background: #f3f9e3;
  box-shadow: inset 0 0 0 1px #9fc24a;
}
.bld-font-add {
  border-style: dashed;
}
.bld-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #8592a5;
  line-height: 1.6;
}
.bld-side {
  position: sticky;
  top: 16px;
}
.bld-card {
  background: #fff;
  border: 1px solid #e1e6ed;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px #1b2a4012;
}
.bld-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.bld-card-top span {
  font: 600 13px system-ui;
  color: #5d7a2a;
}
.bld-preview {
  background: repeating-conic-gradient(#f3f5f8 0 25%, #fff 0 50%) 0 0 / 18px 18px;
  border: 1px solid #e6eaf0;
  border-radius: 12px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
}
.bld-preview svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  filter: drop-shadow(0 8px 14px #2b1a0c26);
}
.bld-sum {
  margin: 14px 0 6px;
  font-size: 13px;
}
.bld-sum div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #eef1f5;
}
.bld-sum dt {
  color: #7c899b;
}
.bld-sum dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  color: #273449;
}
.bld-sum .ok dd {
  color: #3f6b1f;
}
.bld-sum .bad dd {
  color: #b84444;
}
.bld-warn {
  background: #fff6e7;
  border: 1px solid #eedbbd;
  color: #8e6b35;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12.5px;
  margin-top: 8px;
  line-height: 1.6;
}
.bld-go {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  font-size: 15px;
  border-radius: 12px;
}
@media (max-width: 1000px) {
  .bld-inner {
    padding: 22px 18px 50px;
  }
  .bld-grid {
    grid-template-columns: 1fr;
  }
  .bld-side {
    position: static;
    order: -1;
  }
}
@media (max-width: 720px) {
  .bld-workspace {
    grid-column: 1/-1;
    order: 1;
    overflow: visible;
  }
  .bld-line {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .bld-row select {
    min-width: 0;
  }
}
