.tkd-host {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 1.25rem 0 !important;
  clear: both;
}

.tkd-designer {
  --tkd-ink: #211b18;
  --tkd-muted: #6a5e57;
  --tkd-border: #ddcec1;
  --tkd-panel: #fffdf9;
  --tkd-accent: #861b2d;
  --tkd-accent-dark: #651120;
  color: var(--tkd-ink);
  font-family: Inter, Arial, sans-serif;
}

.tkd-designer *,
.tkd-designer *::before,
.tkd-designer *::after {
  box-sizing: border-box;
}

.tkd-heading {
  margin-bottom: 1rem;
}

.tkd-heading h2 {
  margin: 0 0 .35rem;
  color: var(--tkd-accent);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.tkd-heading p {
  margin: 0;
  color: var(--tkd-muted);
}

.tkd-workspace {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(330px, 1.1fr);
  gap: 1.25rem;
  align-items: start;
}

.tkd-preview-panel,
.tkd-controls {
  padding: clamp(.9rem, 2vw, 1.3rem);
  background: var(--tkd-panel);
  border: 1px solid var(--tkd-border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(52, 35, 24, .07);
}

.tkd-controls {
  container-name: tkd-controls;
  container-type: inline-size;
}

.tkd-preview-panel {
  position: static;
}

.tkd-preview-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
  font-weight: 800;
}

.tkd-preview-size {
  color: var(--tkd-muted);
  font-weight: 600;
}

.tkd-canvas-wrap {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  background: #eee9e2;
  border-radius: 10px;
  overflow: hidden;
}

.tkd-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.tkd-preview-note {
  margin: .75rem 0 0;
  color: var(--tkd-muted);
  font-size: .86rem;
  line-height: 1.45;
  text-align: center;
}

.tkd-progress {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .4rem;
  margin: 0 0 1rem;
  scroll-margin-top: 4.25rem;
}

.tkd-progress button {
  min-width: 0;
  min-height: 42px;
  padding: .45rem .35rem;
  background: #f5eee8;
  border: 1px solid var(--tkd-border);
  border-radius: 9px;
  color: var(--tkd-muted);
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.tkd-progress button.is-active,
.tkd-progress button.is-complete {
  background: var(--tkd-accent);
  border-color: var(--tkd-accent);
  color: #fff;
}

.tkd-step[hidden] {
  display: none !important;
}

.tkd-guided-review[hidden] {
  display: none !important;
}

.tkd-step h3 {
  margin: 0 0 .9rem;
  color: var(--tkd-accent);
  font-size: 1.2rem;
}

.tkd-field {
  margin-bottom: .9rem;
}

.tkd-field label,
.tkd-label {
  display: block;
  margin-bottom: .35rem;
  font-weight: 800;
}

.tkd-help {
  display: block;
  margin-top: .28rem;
  color: var(--tkd-muted);
  font-size: .8rem;
  line-height: 1.4;
}

.tkd-field input[type="text"],
.tkd-field input[type="file"],
.tkd-field textarea,
.tkd-field select {
  width: 100%;
  min-height: 44px;
  padding: .65rem .72rem;
  background: #fff;
  border: 1px solid #bfae9f;
  border-radius: 8px;
  color: var(--tkd-ink);
  font: inherit;
}

.tkd-field input[type="file"] {
  width: 100%;
  padding: .65rem;
  background: #fff;
  border: 1px solid #bfae9f;
  border-radius: 8px;
  color: var(--tkd-ink);
}

.tkd-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: -.25rem 0 .9rem;
}

.tkd-background-question {
  margin: -.2rem 0 .9rem;
  padding: .7rem;
  background: #f7f2eb;
  border-radius: 8px;
}

.tkd-background-question[hidden] {
  display: none !important;
}

.tkd-background-question > strong {
  display: block;
  margin-bottom: .55rem;
}

.tkd-background-question .tkd-inline-actions {
  margin: 0;
}

.tkd-inline-actions[hidden] {
  display: none !important;
}

.tkd-flourish-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin: -.2rem 0 .9rem;
  padding: .75rem;
  background: #f7f2eb;
  border-radius: 8px;
}

.tkd-flourish-options[hidden],
.tkd-decoration-warning[hidden] {
  display: none !important;
}

.tkd-flourish-options .tkd-field {
  margin: 0;
}

.tkd-decoration-warning {
  margin: -.2rem 0 .9rem;
  padding: .75rem;
  background: #fff4d6;
  border: 1px solid #d69a17;
  border-left: 5px solid #b77900;
  border-radius: 8px;
  color: #663c00;
  font-weight: 800;
  line-height: 1.4;
}

.tkd-size-control {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) 42px 58px 42px;
  gap: .45rem;
  align-items: center;
  margin: .2rem 0 .9rem;
  padding: .6rem;
  background: #f7f2eb;
  border-radius: 8px;
}

.tkd-size-control button {
  width: 42px;
  height: 42px;
  padding: 0;
  background: #fff;
  border: 1px solid #861b2d;
  border-radius: 8px;
  color: #861b2d;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
}

.tkd-size-control button:hover,
.tkd-size-control button:focus-visible {
  background: #f7ecee;
  outline: 2px solid rgba(134, 27, 45, .25);
}

.tkd-size-control output {
  font-weight: 800;
  text-align: center;
}

.tkd-field textarea {
  min-height: 105px;
  resize: vertical;
}

.tkd-theme-preview {
  display: grid;
  gap: .2rem;
  margin: 0 0 .65rem;
  padding: .8rem;
  background: #fffaf4;
  border: 1px solid var(--tkd-border);
  border-left: 5px solid var(--tkd-accent);
  border-radius: 8px;
  line-height: 1.4;
}

.tkd-theme-preview strong {
  color: var(--tkd-accent);
  text-transform: capitalize;
}

.tkd-theme-preview span {
  color: var(--tkd-muted);
  font-size: .86rem;
}

.tkd-text-style {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: .65rem;
  align-items: end;
  margin: -.45rem 0 1rem;
  padding: .7rem;
  background: #faf7f2;
  border: 1px solid #e7ddd3;
  border-radius: 9px;
}

.tkd-text-style .tkd-field,
.tkd-text-style .tkd-size-control {
  min-width: 0;
  margin: 0;
}

.tkd-text-style .tkd-field select {
  width: 100%;
  min-width: 0;
}

.tkd-text-style .tkd-size-control {
  grid-template-columns: minmax(0, 1fr) 42px 52px 42px;
  gap: .35rem;
  padding: .5rem;
}

.tkd-position-control {
  grid-column: 1 / -1;
  grid-template-columns: minmax(105px, 1fr) 42px 76px 42px;
}

.tkd-choice-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .55rem;
}

.tkd-choice {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  padding: .7rem;
  background: #fff;
  border: 1px solid var(--tkd-border);
  border-radius: 9px;
  cursor: pointer;
}

.tkd-choice input {
  margin-top: .2rem;
}

.tkd-suggestions {
  display: grid;
  gap: .55rem;
  margin-top: .7rem;
}

.tkd-suggestions-heading {
  margin: 0;
  color: var(--tkd-accent);
  font-weight: 800;
  text-align: left;
}

.tkd-suggestion {
  width: 100%;
  padding: .7rem;
  background: #fffaf4;
  border: 1px solid var(--tkd-border);
  border-radius: 8px;
  color: var(--tkd-ink);
  font: inherit;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.tkd-suggestion:hover,
.tkd-suggestion:focus {
  border-color: var(--tkd-accent);
}

.tkd-suggestion-number,
.tkd-suggestion-use {
  display: block;
  color: var(--tkd-accent);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tkd-suggestion-number {
  margin-bottom: .2rem;
}

.tkd-suggestion-use {
  margin-top: .55rem;
  text-align: right;
}

.tkd-wording-help {
  margin: 1rem 0;
  padding: .85rem;
  background: #f7f2eb;
  border: 1px solid var(--tkd-border);
  border-radius: 10px;
}

.tkd-wording-help h4 {
  margin: 0 0 .25rem;
  color: var(--tkd-accent);
  font-size: 1rem;
}

.tkd-ai-rewrite {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--tkd-border);
}

.tkd-ai-rewrite > label {
  display: block;
  margin-bottom: .35rem;
  font-weight: 800;
}

.tkd-ai-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem;
}

.tkd-ai-row select {
  width: 100%;
  min-height: 44px;
  padding: .65rem .72rem;
  background: #fff;
  border: 1px solid #bfae9f;
  border-radius: 8px;
  color: var(--tkd-ink);
  font: inherit;
}

.tkd-actions {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1rem;
}

.tkd-button {
  min-height: 44px;
  padding: .65rem 1rem;
  border: 1px solid var(--tkd-accent);
  border-radius: 9px;
  background: var(--tkd-accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tkd-button:hover,
.tkd-button:focus {
  background: var(--tkd-accent-dark);
}

.tkd-button--secondary {
  background: #fff;
  color: var(--tkd-accent);
}

.tkd-button--secondary:hover,
.tkd-button--secondary:focus {
  background: #f7ecee;
  color: var(--tkd-accent-dark);
}

.tkd-status {
  min-height: 1.5rem;
  margin: .8rem 0 0;
  color: var(--tkd-muted);
  font-size: .9rem;
  font-weight: 700;
}

.tkd-status.is-error {
  color: #a40000;
}

.tkd-status.is-success {
  color: #166534;
}

.tkd-review {
  display: grid;
  gap: .5rem;
  margin: 0;
}

.tkd-review div {
  display: grid;
  grid-template-columns: 115px 1fr;
  gap: .65rem;
  padding: .55rem 0;
  border-bottom: 1px solid #eee2d8;
}

.tkd-review dt {
  font-weight: 800;
}

.tkd-review dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.tkd-designer .tkd-hidden,
.tkd-host ~ .designer-samples {
  display: none !important;
}

/* The preview replaces the normal product photograph; controls follow the native options. */
#mainbodyspan.proddetail .detailimage.tkd-preview-host {
  display: block !important;
  height: auto !important;
  overflow: visible !important;
}

#mainbodyspan.proddetail .detailoptions.tkd-controls-host {
  overflow: visible !important;
}

@media (min-width: 851px) {
  #mainbodyspan.proddetail .detailimage.tkd-preview-host {
    position: relative !important;
    top: auto;
    z-index: 5;
    grid-row: 2 / 5;
    align-self: stretch;
  }

  #mainbodyspan.proddetail .detailimage.tkd-preview-host .tkd-preview-panel {
    position: sticky;
    top: 3.25rem;
  }
}

.tkd-preview-host .tkd-preview-panel {
  width: 100%;
  margin: 0;
}

#mainbodyspan.proddetail .detailoptions .tkd-controls {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 1rem 0 0 !important;
  clear: both;
}

.tkd-controls > .tkd-step,
.tkd-controls > .tkd-progress,
.tkd-controls > .tkd-status {
  width: 100%;
}

.tkd-mobile-preview-button {
  display: none;
}

.tkd-preview-lightbox[hidden] {
  display: none !important;
}

.tkd-preview-lightbox {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, .78);
}

.tkd-preview-lightbox__dialog {
  position: relative;
  max-width: min(92vw, 620px);
  max-height: 92vh;
  padding: .65rem;
  background: #fff;
  border-radius: 12px;
}

.tkd-preview-lightbox__dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 1.3rem);
  width: auto;
  height: auto;
}

.tkd-preview-lightbox__close {
  position: absolute;
  z-index: 1;
  top: -.7rem;
  right: -.7rem;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #861b2d;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Graphic choices inside the existing size, plate, and plaque help dialogs. */
.tkd-option-tile {
  display: inline-flex;
  flex: 0 1 125px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: .45rem;
  min-width: 105px;
  margin: .35rem;
  padding: .55rem;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 9px;
  color: #171717;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}

.tkd-option-tile img {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
}

.tkd-option-tile:hover,
.tkd-option-tile:focus-visible {
  border-color: #861b2d;
  outline: none;
}

.tkd-option-tile.is-selected {
  background: #f7ecee;
  border-color: #861b2d;
  box-shadow: 0 0 0 2px rgba(134, 27, 45, .14);
}

/* The legacy product description hid ordering controls below 1218px. */
@media (max-width: 1217px) {
  #mainbodyspan.proddetail .detailquantity,
  #mainbodyspan.proddetail .detailoptions,
  #mainbodyspan.proddetail .detailaddtocart .ectbutton {
    display: block !important;
  }
}

[class*="how-to-use-the-plaque-designer"] {
  display: none !important;
}

/* The product-options column can become narrow while the viewport is still
   desktop-sized. Reflow against the designer itself instead of relying only
   on viewport media queries. */
@container tkd-controls (max-width: 430px) {
  .tkd-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .35rem;
  }

  .tkd-progress button {
    padding: .38rem .2rem;
    font-size: .74rem;
  }

  .tkd-text-style {
    grid-template-columns: minmax(0, 1fr);
  }

  .tkd-size-control,
  .tkd-text-style .tkd-size-control {
    grid-template-columns: minmax(0, 1fr) 36px minmax(48px, auto) 36px;
    gap: .3rem;
  }

  .tkd-position-control,
  .tkd-text-style .tkd-position-control {
    grid-template-columns: minmax(0, 1fr) 36px minmax(62px, auto) 36px;
  }

  .tkd-size-control button {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}

@media (max-width: 820px) {
  .tkd-progress {
    scroll-margin-top: 7.25rem;
  }

  #mainbodyspan.proddetail .detailimage.tkd-preview-host {
    display: none !important;
  }

  .tkd-mobile-preview-button {
    position: sticky;
    z-index: 9990;
    top: 3.25rem;
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 0 0 .8rem;
    padding: .7rem 1rem;
    background: #861b2d;
    border: 1px solid #861b2d;
    border-radius: 9px;
    box-shadow: 0 5px 15px rgba(52, 20, 27, .2);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
  }

  .tkd-workspace {
    grid-template-columns: 1fr;
  }

  .tkd-preview-panel {
    position: static;
  }

  .tkd-canvas-wrap {
    max-width: 360px;
  }
}

@media (max-width: 520px) {
  .tkd-preview-panel,
  .tkd-controls {
    padding: .75rem;
    border-radius: 11px;
  }

  .tkd-progress {
    grid-template-columns: repeat(2, 1fr);
  }

  .tkd-choice-row {
    grid-template-columns: 1fr;
  }

  .tkd-flourish-options {
    grid-template-columns: 1fr;
  }

  .tkd-text-style {
    grid-template-columns: 1fr;
  }

  .tkd-ai-row {
    grid-template-columns: 1fr;
  }

  .tkd-review div {
    grid-template-columns: 1fr;
    gap: .15rem;
  }
}
