.te-tb {
  --te-gold: #d7a900;
  --te-black: #1e1f21;
  --te-border: #d9d9d9;
  --te-soft: #f7f5ef;
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--te-border);
  border-radius: 8px;
  background: #fff;
  color: #222;
}

.te-tb__header h2,
.te-tb__header p { margin: 0 0 .6rem; }
.te-tb__eyebrow {
  color: #735b00;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.te-tb__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, .75fr);
  gap: 1.4rem;
  align-items: start;
  margin-top: 1.2rem;
}

.te-tb__step { padding: 1rem 0; border-top: 1px solid var(--te-border); }
.te-tb__conditional[hidden] { display: none !important; }
.te-tb__step h3 { display: flex; align-items: center; gap: .55rem; margin: 0 0 .75rem; font-size: 1rem; }
.te-tb__step h3 > span:first-child {
  display: inline-grid;
  flex: 0 0 1.7rem;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border-radius: 50%;
  background: var(--te-black);
  color: white;
  font-size: .85rem;
}
.te-tb__step h3 > span:not(:first-child) {
  display: block;
  min-width: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  line-height: 1.35;
}
.te-tb__help { margin: -.25rem 0 .75rem; color: #666; font-size: .9rem; }
.te-tb__field-label { display: block; margin: 0 0 .4rem; font-weight: 700; }
.te-tb__plate-editor {
  width: 100%;
  min-height: 96px;
  padding: .65rem .75rem;
  border: 2px solid var(--te-border);
  border-radius: 6px;
  background: #fff;
  color: #222;
  font: inherit;
  line-height: 1.4;
  resize: vertical;
}
.te-tb__plate-editor:focus { border-color: var(--te-gold); outline: 2px solid rgba(215, 169, 0, .25); }

.te-tb__select,
.te-tb__picker-trigger {
  width: 100%;
  min-height: 48px;
  padding: .65rem .75rem;
  border: 2px solid var(--te-border);
  border-radius: 6px;
  background: #fff;
  color: #222;
  font: inherit;
}
.te-tb__select:focus,
.te-tb__picker-trigger:focus {
  border-color: var(--te-gold);
  outline: 2px solid rgba(215, 169, 0, .25);
}

.te-tb__picker { position: relative; }
.te-tb__picker-trigger {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: center;
  text-align: left;
  cursor: pointer;
}
.te-tb__picker-trigger:disabled { cursor: not-allowed; opacity: .6; }
.te-tb__picker-selected-image {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #fff;
}
.te-tb__picker-selected-image[hidden] { display: block; visibility: hidden; }
.te-tb__picker-selected-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-tb__picker-arrow { color: #725b00; font-size: 1.1rem; }
.te-tb__picker-menu {
  position: absolute;
  z-index: 999;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 310px;
  overflow-y: auto;
  padding: .35rem;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
}
.te-tb__picker-search {
  position: sticky;
  z-index: 2;
  top: 0;
  width: 100%;
  min-height: 42px;
  margin: 0 0 .35rem;
  padding: .55rem .65rem;
  border: 1px solid #aaa;
  border-radius: 5px;
  background: #fff;
  color: #222;
  font: inherit;
}
.te-tb__picker-search:focus { border-color: var(--te-gold); outline: 2px solid rgba(215, 169, 0, .25); }
.te-tb__picker-option {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: .45rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #fff;
  color: #222;
  text-align: left;
  cursor: pointer;
}
.te-tb__picker-option:hover,
.te-tb__picker-option:focus,
.te-tb__picker-option[aria-selected="true"] {
  border-color: var(--te-gold);
  background: #fffaf0;
  outline: none;
}
.te-tb__picker-thumb {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  background: #fff;
}
.te-tb__picker-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.te-tb__picker-option strong,
.te-tb__picker-option small { display: block; line-height: 1.3; }
.te-tb__picker-option small { margin-top: .2rem; color: #666; font-size: .76rem; }

.te-tb__button-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.te-tb__choice-button,
.te-tb__card {
  border: 2px solid var(--te-border);
  border-radius: 6px;
  background: white;
  color: #222;
  cursor: pointer;
  box-shadow: none;
}
.te-tb__choice-button { min-width: 80px; padding: .65rem .85rem; }
.te-tb__choice-button:hover,
.te-tb__choice-button:focus,
.te-tb__card:hover,
.te-tb__card:focus { border-color: #9a7a00; outline: 2px solid transparent; }
.te-tb__choice-button[aria-pressed="true"],
.te-tb__card[aria-pressed="true"] {
  border-color: var(--te-gold);
  box-shadow: 0 0 0 2px rgba(215, 169, 0, .22);
}

.te-tb__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: .7rem;
}
.te-tb__card { min-height: 190px; padding: .55rem; text-align: left; }
.te-tb__cards--compact .te-tb__card { min-height: 160px; }
.te-tb__card-image {
  display: grid;
  height: 115px;
  place-items: center;
  margin-bottom: .45rem;
  overflow: hidden;
  background: #fff;
}
.te-tb__card img { display: block; max-width: 100%; max-height: 110px; object-fit: contain; }
.te-tb__card strong,
.te-tb__card small { display: block; line-height: 1.25; }
.te-tb__card small { margin-top: .3rem; color: #666; font-size: .75rem; }

.te-tb__preview {
  position: sticky;
  top: 2rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--te-soft);
}
.te-tb__preview h3 { margin: 0 0 .7rem; }
.te-tb__preview-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
  margin-bottom: .7rem;
  padding: .25rem;
  border-radius: 6px;
  background: #e9e6dc;
}
.te-tb__preview-switch-button {
  min-height: 40px;
  padding: .45rem .55rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #333;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}
.te-tb__preview-switch-button.is-active {
  background: var(--te-black);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.te-tb__parts {
  display: grid;
  gap: .55rem;
  min-height: 340px;
  padding: .65rem;
  border: 1px solid #ddd3b3;
  border-radius: 6px;
  background: #fff;
}
.te-tb__part {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  min-height: 84px;
  padding: .45rem;
  border: 1px solid #ece8dc;
  border-radius: 5px;
  background: #fffdf8;
}
.te-tb__part-image {
  display: grid;
  width: 76px;
  height: 72px;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
}
.te-tb__part-image img { display: block; max-width: 100%; max-height: 70px; object-fit: contain; }
.te-tb__part-copy { min-width: 0; }
.te-tb__part-copy strong,
.te-tb__part-copy span,
.te-tb__part-copy small { display: block; }
.te-tb__part-copy strong { color: var(--te-black); font-size: .76rem; text-transform: uppercase; letter-spacing: .035em; }
.te-tb__part-copy span { margin-top: .12rem; font-size: .82rem; line-height: 1.3; }
.te-tb__part-copy small { margin-top: .12rem; color: #666; font-size: .72rem; }
.te-tb__part-quantity {
  display: inline-block;
  margin-left: .3rem;
  padding: .05rem .35rem;
  border-radius: 999px;
  background: var(--te-gold);
  color: #1d1d1d;
  font-size: .7rem;
}
.te-tb__part--plate .te-tb__part-image {
  height: 50px;
  padding: .25rem;
  border: 1px solid #8a7025;
  background: linear-gradient(135deg, #ead581, #b99638);
  color: #17130a;
  font-size: .62rem;
  line-height: 1.15;
  text-align: center;
  white-space: pre-line;
}
.te-tb__parts-empty {
  display: grid;
  min-height: 310px;
  place-items: center;
  padding: 1rem;
  color: #777;
  font-size: .85rem;
  line-height: 1.45;
  text-align: center;
}
.te-tb__stage {
  display: grid;
  min-height: 420px;
  place-items: center;
  padding: .75rem;
  overflow: hidden;
  border: 1px solid #ddd3b3;
  border-radius: 6px;
  background: white;
}
.te-tb__stage canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
}
.te-tb__stage[hidden],
.te-tb__parts[hidden] { display: none !important; }
.te-tb__preview-note { display: block; margin-top: .45rem; color: #777; font-size: .68rem; line-height: 1.3; text-align: center; }
.te-tb__source-images { display: none !important; }

.te-tb__summary { margin: .8rem 0; font-size: .82rem; }
.te-tb__summary div { display: grid; grid-template-columns: 70px 1fr; gap: .45rem; padding: .25rem 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.te-tb__summary dt { font-weight: 700; }
.te-tb__summary dd { margin: 0; }
.te-tb__price { padding-top: .7rem; border-top: 2px solid var(--te-gold); }
.te-tb__price span,
.te-tb__price small { display: block; }
.te-tb__price strong { display: block; margin: .15rem 0; font-size: 1.7rem; color: var(--te-black); }
.te-tb__price small { color: #666; line-height: 1.35; }
.te-tb__minimum-notice {
  margin-top: .65rem;
  padding: .55rem .65rem;
  border-left: 3px solid var(--te-gold);
  background: #fff;
  color: #453900 !important;
}
.te-tb__volume-quote {
  margin-top: .8rem;
  padding: .8rem;
  border: 1px solid #d9c677;
  border-radius: 6px;
  background: #fffaf0;
}
.te-tb__volume-quote strong,
.te-tb__volume-quote small { display: block; }
.te-tb__volume-quote strong { margin-bottom: .25rem; color: var(--te-black); font-size: .92rem; line-height: 1.35; }
.te-tb__volume-quote small { margin-bottom: .65rem; }
.te-tb__volume-quote-button {
  display: block !important;
  width: 100%;
  min-height: 44px;
  padding: .7rem .8rem !important;
  border: 2px solid var(--te-black) !important;
  border-radius: 4px;
  background: var(--te-black) !important;
  color: #fff !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-align: center;
  text-decoration: none !important;
}
.te-tb__volume-quote-button:hover,
.te-tb__volume-quote-button:focus { border-color: #9a7a00 !important; background: #9a7a00 !important; color: #fff !important; }
.te-tb__volume-quote--wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 1rem;
  align-items: center;
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-width: 2px;
}
.te-tb__volume-quote--wide strong { font-size: 1.05rem; }
.te-tb__volume-quote--wide small { margin: 0; }

@media (max-width: 780px) {
  .te-tb { padding: .9rem; }
  .te-tb__layout { grid-template-columns: 1fr; }
  .te-tb__controls { order: 1; min-width: 0; }
  .te-tb__preview { position: static; order: 2; min-width: 0; width: 100%; }
  #te-tb-styles,
  #te-tb-styles .te-tb__select,
  .te-tb__select-wrap {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px !important;
    opacity: 1 !important;
  }
  .te-tb__preview-switch {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    width: 100% !important;
  }
  .te-tb__preview-switch-button {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: .55rem .35rem !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: #333 !important;
    box-shadow: none !important;
    font-size: .72rem !important;
    line-height: 1.2 !important;
    text-align: center !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }
  .te-tb__preview-switch-button.is-active {
    background: var(--te-black) !important;
    color: #fff !important;
  }
  .te-tb__parts:not([hidden]) { display: grid !important; width: 100% !important; }
  .te-tb__parts {
    max-height: none !important;
    overflow: visible !important;
  }
  .te-tb__part--plate {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .te-tb__part--plate .te-tb__part-image {
    display: grid !important;
    width: 100% !important;
    min-height: 64px;
  }
  .te-tb__stage:not([hidden]) { display: grid !important; width: 100% !important; }
  .te-tb__stage { min-height: 340px; }
  .te-tb__stage canvas { max-height: 420px; }
  .te-tb__volume-quote--wide { grid-template-columns: 1fr; }
}
.te-tb__order-field {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.te-mb__choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}
.te-mb .te-mb__choice {
  display: block;
  width: 100%;
  min-height: 112px;
  padding: .85rem;
  border: 2px solid var(--te-border);
  border-radius: 6px;
  background: #fff;
  color: #222;
  text-align: left;
  cursor: pointer;
}
.te-mb .te-mb__choice strong,
.te-mb .te-mb__choice small { display: block; }
.te-mb .te-mb__choice strong { color: #222; line-height: 1.3; }
.te-mb .te-mb__choice small { margin-top: .35rem; color: #666; line-height: 1.4; }
.te-mb .te-mb__choice:hover,
.te-mb .te-mb__choice:focus,
.te-mb .te-mb__choice[aria-pressed="true"] {
  border-color: var(--te-gold);
  background: #fffaf0;
  outline: 2px solid rgba(215, 169, 0, .2);
}
.te-mb__conditional[hidden] { display: none !important; }
.te-mb__field-label {
  display: block;
  margin: 1rem 0 .4rem;
  font-weight: 700;
}
.te-mb textarea {
  width: 100%;
  min-height: 92px;
  padding: .65rem .75rem;
  border: 2px solid var(--te-border);
  border-radius: 6px;
  background: #fff;
  color: #222;
  font: inherit;
}
.te-mb textarea:focus {
  border-color: var(--te-gold);
  outline: 2px solid rgba(215, 169, 0, .25);
}
.te-mb__stage { min-height: 410px; }
.te-mb__stage canvas { max-height: 460px; }
.te-mb__proof-note {
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid rgba(0, 0, 0, .12);
  font-weight: 600;
}
.te-mb__quote-wrap { margin: .85rem 0 1rem; }
.te-mb__quote-button {
  display: inline-block;
  min-height: 44px;
  padding: .72rem 1rem;
  border: 2px solid var(--te-black, #1e1f21);
  border-radius: 4px;
  background: var(--te-black, #1e1f21);
  color: #fff !important;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none !important;
}
.te-mb__quote-button:hover,
.te-mb__quote-button:focus { border-color: #9a7a00; background: #9a7a00; color: #fff !important; }

@media (max-width: 520px) {
  .te-mb__choice-grid { grid-template-columns: 1fr; }
  .te-tb__step h3 { align-items: flex-start; font-size: 1.05rem; line-height: 1.35; }
  .te-mb .te-mb__choice { min-height: 0; padding: .8rem; }
  .te-mb__stage { min-height: 330px; }
  .te-mb__stage canvas { max-height: 360px; }
}
