
.dpht-shell{--ink:#283842;--muted:#72818a;--cyan:#29a8c5;--line:#dce6ea;--soft:#f3f8fa;max-width:1180px;margin:40px auto;padding:0 20px;color:var(--ink);font-family:inherit}
.dpht-top{display:flex;align-items:end;justify-content:space-between;gap:24px;margin-bottom:22px}.dpht-kicker{font-size:11px;letter-spacing:.16em;font-weight:800;color:var(--cyan)}.dpht-top h2{font-size:clamp(34px,5vw,56px);line-height:1;margin:7px 0 10px;letter-spacing:-.045em}.dpht-top p{max-width:640px;color:var(--muted);font-size:16px}.dpht-badge{border:1px solid var(--line);border-radius:999px;padding:9px 13px;font-size:12px;font-weight:700;white-space:nowrap}
.dpht-grid{display:grid;grid-template-columns:minmax(330px,.85fr) minmax(420px,1.15fr);gap:18px}.dpht-panel{background:#fff;border:1px solid var(--line);border-radius:22px;padding:22px;box-shadow:0 18px 50px rgba(38,57,67,.06)}
.dpht-step{display:flex;align-items:center;gap:10px;margin:2px 0 12px}.dpht-step span{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--soft);font-size:10px;font-weight:800;color:var(--cyan)}.dpht-step h3{margin:0;font-size:15px}.dpht-step:not(:first-child){margin-top:24px}
.dpht-options{display:flex;flex-wrap:wrap;gap:8px}.dpht-choice{appearance:none;border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:11px;padding:10px 13px;font-weight:700;cursor:pointer}.dpht-choice.is-active{border-color:var(--cyan);box-shadow:0 0 0 2px rgba(41,168,197,.12);color:#1687a2}
.dpht-engravings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.dpht-engraving{appearance:none;border:1px solid var(--line);background:#fff;border-radius:14px;padding:10px;cursor:pointer;text-align:left}.dpht-engraving.is-active{border-color:var(--cyan);box-shadow:0 0 0 2px rgba(41,168,197,.12)}.dpht-engraving img{width:100%;height:90px;object-fit:contain;background:var(--soft);border-radius:9px}.dpht-engraving span{display:block;margin-top:7px;font-size:12px;font-weight:700}
.dpht-upload{display:block;margin-top:12px;border:1px dashed #b9cbd2;border-radius:14px;padding:14px;cursor:pointer}.dpht-upload strong,.dpht-upload span{display:block}.dpht-upload strong{font-size:13px}.dpht-upload span{font-size:12px;color:var(--muted);margin-top:3px}.dpht-upload input{margin-top:10px;font-size:12px;max-width:100%}
.dpht-preview-head{display:flex;justify-content:space-between;align-items:center;gap:18px}.dpht-preview-head>div span{display:block;font-size:10px;letter-spacing:.14em;color:var(--cyan);font-weight:800}.dpht-preview-head strong{font-size:15px}.dpht-depth{font-size:11px;padding:7px 9px;border-radius:999px;background:var(--soft);font-weight:700}
.dpht-preview{min-height:430px;display:grid;place-items:center;padding:30px}.dpht-candy-tray{position:relative;width:min(360px,75vw);aspect-ratio:1;background:linear-gradient(145deg,#f7fafb,#dde7eb);box-shadow:0 30px 45px rgba(36,54,64,.18), inset -15px -17px 30px rgba(87,109,119,.1), inset 12px 12px 24px rgba(255,255,255,.9);overflow:hidden}.dpht-candy-tray.is-circle{border-radius:50%}.dpht-candy-tray.is-square{border-radius:10%}.dpht-groove{position:absolute;inset:3.1%;border:2px solid rgba(49,69,78,.18);border-radius:inherit;z-index:2;pointer-events:none}.dpht-candy-tray img{position:absolute;inset:7%;width:86%;height:86%;object-fit:contain;mix-blend-mode:multiply;opacity:.72;z-index:1}
.dpht-safe-note{font-size:12px;color:var(--muted);text-align:center;margin-top:-8px}.dpht-export{border-top:1px solid var(--line);margin-top:20px;padding-top:20px}.dpht-export>div:first-child{display:flex;justify-content:space-between;align-items:end}.dpht-export h3{margin:3px 0 0;font-size:20px}.dpht-export-btn{width:100%;border:0;border-radius:14px;padding:14px 18px;margin-top:14px;background:var(--cyan);color:#fff;font-weight:800;cursor:pointer}.dpht-export-btn.is-locked{background:#30434d}.dpht-member-cta{margin-top:12px;background:var(--soft);border-radius:14px;padding:14px}.dpht-member-cta strong,.dpht-member-cta span{display:block}.dpht-member-cta strong{font-size:13px}.dpht-member-cta span{font-size:12px;color:var(--muted);margin-top:3px}.dpht-member-cta>div{display:flex;gap:12px;flex-wrap:wrap;margin-top:9px}.dpht-member-cta a,.dpht-member-cta button{border:0;background:none;padding:0;color:#1687a2;font:inherit;font-size:12px;font-weight:800;text-decoration:none;cursor:pointer}.dpht-export-note{font-size:12px;color:var(--muted)}
@media(max-width:820px){.dpht-grid{grid-template-columns:1fr}.dpht-top{align-items:flex-start;flex-direction:column}.dpht-preview{min-height:350px;padding:20px}.dpht-panel{padding:18px}}

.dpht-upload.is-uploading{opacity:.65;pointer-events:none}
.dpht-upload.is-success{border-color:var(--cyan);background:rgba(41,168,197,.05)}

.dpht-export-btn:disabled{opacity:.6;cursor:wait}

/* 0.4.2 shape-aware preview */
.dpht-candy-tray.is-hexagon{clip-path:polygon(50% 0,93.3% 25%,93.3% 75%,50% 100%,6.7% 75%,6.7% 25%)}
.dpht-candy-tray.is-octagon{clip-path:polygon(29.3% 0,70.7% 0,100% 29.3%,100% 70.7%,70.7% 100%,29.3% 100%,0 70.7%,0 29.3%)}


/* 0.4.3 – shape-aware preview safe area + generation notice */
.dpht-candy-tray img[data-engraving-preview]{
  position:absolute;
  object-fit:contain;
  mix-blend-mode:multiply;
  opacity:.72;
  z-index:1;
  transition:width .2s ease,height .2s ease,inset .2s ease,clip-path .2s ease;
}

.dpht-generating-note{
  margin-top:12px;
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border:1px solid rgba(41,168,197,.32);
  border-radius:14px;
  background:rgba(41,168,197,.06);
}
.dpht-generating-note[hidden]{display:none!important}
.dpht-generating-note strong,
.dpht-generating-note span{display:block}
.dpht-generating-note strong{
  font-size:13px;
  color:var(--ink);
}
.dpht-generating-note div>span{
  margin-top:2px;
  font-size:12px;
  line-height:1.4;
  color:var(--muted);
}
.dpht-generating-spinner{
  width:28px;
  height:28px;
  flex:0 0 28px;
  border-radius:50%;
  border:2px solid rgba(41,168,197,.18);
  border-top-color:var(--cyan);
  border-right-color:var(--cyan);
  animation:dpht-spin .8s linear infinite;
  box-shadow:0 0 0 4px rgba(41,168,197,.05);
}
@keyframes dpht-spin{to{transform:rotate(360deg)}}


/* 0.5.0 – SVG preflight modal */
.dpht-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:999999;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(20,31,37,.58);
  backdrop-filter:blur(7px);
}
.dpht-modal-backdrop[hidden]{display:none!important}
.dpht-modal{
  position:relative;
  width:min(520px,calc(100vw - 32px));
  border-radius:22px;
  background:#fff;
  padding:26px;
  box-shadow:0 30px 80px rgba(18,29,35,.3);
  color:var(--ink);
}
.dpht-modal h3{
  margin:6px 36px 8px 0;
  font-size:28px;
  line-height:1.08;
  letter-spacing:-.03em;
}
.dpht-modal>p{
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.5;
}
.dpht-preflight-details{
  margin-top:16px;
  padding:14px;
  border-radius:14px;
  background:var(--soft);
  font-size:13px;
  line-height:1.45;
}
.dpht-preflight-details:empty{display:none}
.dpht-preflight-details p{margin:4px 0}
.dpht-modal-close{
  position:absolute;
  top:14px;
  right:14px;
  width:34px;
  height:34px;
  border:1px solid var(--line);
  border-radius:50%;
  background:#fff;
  color:var(--ink);
  font-size:22px;
  cursor:pointer;
}
.dpht-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:18px;
  flex-wrap:wrap;
}
.dpht-modal-primary,
.dpht-modal-secondary{
  border-radius:12px;
  padding:11px 15px;
  font:inherit;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
}
.dpht-modal-primary{
  border:0;
  background:var(--cyan);
  color:#fff;
}
.dpht-modal-secondary{
  border:1px solid var(--line);
  background:#fff;
  color:var(--ink);
}


/* 0.5.2 – Keychain-style generator header */
.dpht-shell{
  padding-top:38px;
}

.dpht-tool-card{
  position:relative;
  overflow:hidden;
  margin:0 0 18px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:0 18px 50px rgba(38,57,67,.06);
}

.dpht-tool-accent{
  position:absolute;
  top:0;
  left:30px;
  width:64px;
  height:4px;
  border-radius:0 0 4px 4px;
  background:var(--cyan);
}

.dpht-tool-head{
  min-height:114px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
  padding:25px 30px 23px;
}

.dpht-tool-copy h2{
  margin:0 0 7px;
  font-size:30px;
  line-height:1.08;
  letter-spacing:-.035em;
  font-weight:500;
  color:var(--ink);
}

.dpht-tool-copy p{
  margin:0;
  max-width:650px;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.dpht-tool-runtime{
  flex:0 0 auto;
  white-space:nowrap;
  border:1px solid rgba(41,168,197,.23);
  border-radius:999px;
  padding:9px 14px;
  background:rgba(41,168,197,.045);
  color:var(--ink);
  font-size:11px;
  line-height:1;
  font-weight:700;
}

/* Old free-standing hero styles are no longer used. */
.dpht-top{display:none!important}

@media(max-width:760px){
  .dpht-shell{padding-top:22px}
  .dpht-tool-head{
    min-height:0;
    align-items:flex-start;
    flex-direction:column;
    gap:16px;
    padding:24px 20px 20px;
  }
  .dpht-tool-accent{
    left:20px;
    width:58px;
  }
  .dpht-tool-copy h2{
    font-size:26px;
  }
  .dpht-tool-runtime{
    white-space:normal;
  }
}


/* 0.5.4 – mobile usability */
@media (max-width: 820px){
  .dpht-shell{
    width:100%;
    max-width:100%;
    margin:18px auto 28px;
    padding:0 12px;
    box-sizing:border-box;
    overflow:hidden;
  }

  .dpht-tool-card,
  .dpht-panel{
    border-radius:18px;
  }

  .dpht-tool-head{
    padding:22px 18px 18px;
  }

  .dpht-tool-copy h2{
    font-size:27px;
    line-height:1.08;
  }

  .dpht-tool-copy p{
    font-size:13px;
    line-height:1.45;
  }

  .dpht-tool-runtime{
    align-self:flex-start;
    max-width:100%;
    padding:8px 11px;
    font-size:10px;
  }

  .dpht-grid{
    grid-template-columns:minmax(0,1fr);
    gap:14px;
  }

  .dpht-panel{
    min-width:0;
    padding:16px;
  }

  .dpht-step{
    margin-bottom:10px;
  }

  .dpht-step:not(:first-child){
    margin-top:20px;
  }

  .dpht-step h3{
    font-size:15px;
  }

  .dpht-options{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }

  .dpht-choice{
    min-height:46px;
    width:100%;
    padding:10px 8px;
    font-size:13px;
    line-height:1.25;
    text-align:center;
    touch-action:manipulation;
  }

  [data-thickness]{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .dpht-engravings{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:9px;
  }

  .dpht-engraving{
    min-width:0;
    padding:8px;
    border-radius:12px;
    touch-action:manipulation;
  }

  .dpht-engraving img{
    height:92px;
  }

  .dpht-engraving span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .dpht-upload{
    padding:13px;
  }

  .dpht-upload input{
    display:block;
    width:100%;
    max-width:100%;
    margin-top:10px;
    font-size:13px;
  }

  .dpht-preview-panel{
    padding:15px;
  }

  .dpht-preview-head{
    align-items:flex-start;
    gap:10px;
  }

  .dpht-preview-head strong{
    font-size:14px;
  }

  .dpht-depth{
    flex:0 0 auto;
    font-size:10px;
    padding:6px 8px;
  }

  .dpht-preview{
    min-height:0;
    padding:18px 4px 14px;
  }

  .dpht-candy-tray{
    width:min(82vw,360px);
    max-width:100%;
  }

  .dpht-safe-note{
    margin-top:2px;
    padding:0 4px;
    font-size:11px;
    line-height:1.45;
  }

  .dpht-export{
    margin-top:16px;
    padding-top:16px;
  }

  .dpht-export>div:first-child{
    align-items:center;
  }

  .dpht-export h3{
    font-size:20px;
  }

  .dpht-export-btn{
    min-height:50px;
    padding:14px 12px;
    font-size:14px;
    touch-action:manipulation;
  }

  .dpht-member-cta{
    padding:13px;
  }

  .dpht-member-cta>div{
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }

  .dpht-member-cta a,
  .dpht-member-cta button{
    min-height:38px;
    display:inline-flex;
    align-items:center;
    font-size:13px;
  }

  .dpht-generating-note{
    align-items:flex-start;
    padding:12px;
  }

  .dpht-modal-backdrop{
    align-items:end;
    padding:10px;
  }

  .dpht-modal{
    width:100%;
    max-width:none;
    max-height:calc(100dvh - 20px);
    overflow:auto;
    border-radius:20px;
    padding:22px 18px 18px;
  }

  .dpht-modal h3{
    font-size:25px;
    padding-right:30px;
  }

  .dpht-modal-actions{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .dpht-modal-primary,
  .dpht-modal-secondary{
    width:100%;
    min-height:46px;
  }

  .dpht-modal-close{
    width:38px;
    height:38px;
    top:12px;
    right:12px;
  }
}

@media (max-width: 430px){
  .dpht-shell{
    padding:0 8px;
  }

  .dpht-tool-card,
  .dpht-panel{
    border-radius:16px;
  }

  .dpht-tool-head{
    padding:20px 15px 16px;
  }

  .dpht-tool-copy h2{
    font-size:25px;
  }

  .dpht-panel{
    padding:14px;
  }

  .dpht-options{
    grid-template-columns:1fr 1fr;
  }

  [data-thickness]{
    grid-template-columns:repeat(3,1fr);
  }

  .dpht-choice{
    min-height:44px;
    font-size:12px;
  }

  .dpht-engravings{
    grid-template-columns:1fr 1fr;
  }

  .dpht-engraving img{
    height:82px;
  }

  .dpht-preview-head{
    flex-wrap:wrap;
  }

  .dpht-depth{
    margin-left:auto;
  }

  .dpht-candy-tray{
    width:min(88vw,330px);
  }

  .dpht-export>div:first-child{
    flex-wrap:wrap;
    gap:5px;
  }

  .dpht-export h3{
    font-size:19px;
  }
}

/* Prevent accidental horizontal overflow from long SVG/file names. */
.dpht-shell *,
.dpht-shell *::before,
.dpht-shell *::after{
  box-sizing:border-box;
}
.dpht-shell img,
.dpht-shell svg{
  max-width:100%;
}
.dpht-upload,
.dpht-export-note,
.dpht-generating-note,
.dpht-member-cta,
.dpht-preflight-details{
  overflow-wrap:anywhere;
}

html.dpht-modal-open,
html.dpht-modal-open body{
  overflow:hidden!important;
}
@media (hover:none) and (pointer:coarse){
  .dpht-choice,
  .dpht-engraving,
  .dpht-export-btn,
  .dpht-modal button,
  .dpht-member-cta a,
  .dpht-member-cta button{
    -webkit-tap-highlight-color:transparent;
  }
}


/* 0.6.11 — Engraving thumbnails: consistent black/white artwork.
   Visual treatment only; STL/vector generation is untouched. */
.dpht-engraving img,
.dpht-engraving-card img,
[data-engraving-url] img {
    filter: grayscale(1) contrast(1.35) brightness(0.82);
    mix-blend-mode: multiply;
}

/* Keep thumbnail canvas clean and neutral. */
.dpht-engraving,
.dpht-engraving-card,
[data-engraving-url] {
    background: #fff;
}



/* 0.6.13 — All motif previews render solid black.
   This affects display only; vector/raster processing and STL export remain unchanged. */
.dpht-candy-tray img,
.dpht-candy-tray img[data-engraving-preview] {
    filter: grayscale(1) brightness(0) !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
}

/* Engraving cards: black artwork on a neutral white thumbnail canvas. */
.dpht-engraving img,
.dpht-engraving-card img,
[data-engraving-url] img {
    filter: grayscale(1) brightness(0) !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    background: #fff !important;
}


/* 0.6.14 — Correct monochrome preview rendering.
   White background stays white; gray/dark artwork becomes black.
   Visual only; STL/vector processing is unchanged. */
.dpht-candy-tray img,
.dpht-candy-tray img[data-engraving-preview],
.dpht-engraving img,
.dpht-engraving-card img,
[data-engraving-url] img {
    filter: grayscale(1) contrast(1000%) brightness(1) !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
}

.dpht-engraving img,
.dpht-engraving-card img,
[data-engraving-url] img {
    background: #fff !important;
}


/* 0.6.15 — High-quality monochrome previews.
   Preserve browser anti-aliasing instead of hard-thresholding pixels. */
.dpht-candy-tray img,
.dpht-candy-tray img[data-engraving-preview] {
    filter: grayscale(1) contrast(175%) !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    image-rendering: auto !important;
}

.dpht-engraving img,
.dpht-engraving-card img,
[data-engraving-url] img {
    filter: grayscale(1) contrast(185%) !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    image-rendering: auto !important;
    background: #fff !important;
}


/* 0.6.16 — High-quality thumbnail rendering.
   Softer monochrome conversion keeps fine SVG/PNG anti-aliasing intact. */
.dpht-engraving img,
.dpht-engraving-card img,
[data-engraving-url] img {
    filter: grayscale(1) contrast(125%) !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    image-rendering: auto !important;
    object-fit: contain !important;
    background: #fff !important;
}


/* 0.6.18 — Shape-aware groove preview for polygon candy-trays.
   Hexagonal and Octagonal now draw the groove as the same polygon as the candy-tray,
   rather than clipping a rectangular border. STL geometry is unchanged. */

.dpht-candy-tray.is-hexagon .dpht-groove,
.dpht-candy-tray.is-octagon .dpht-groove {
    border: 0 !important;
    border-radius: 0 !important;
    inset: 3.1% !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 100% 100% !important;
}

/* True hexagonal groove line. */
.dpht-candy-tray.is-hexagon .dpht-groove {
    clip-path: polygon(
        50% 0,
        93.301% 25%,
        93.301% 75%,
        50% 100%,
        6.699% 75%,
        6.699% 25%
    ) !important;
    background-image:
        linear-gradient(rgba(49,69,78,.20), rgba(49,69,78,.20)) !important;
}

/* Cut out the center so only a slim polygon ring remains. */
.dpht-candy-tray.is-hexagon .dpht-groove::after {
    content: "";
    position: absolute;
    inset: 2px;
    background: rgba(247,251,252,.96);
    clip-path: polygon(
        50% 0,
        93.301% 25%,
        93.301% 75%,
        50% 100%,
        6.699% 75%,
        6.699% 25%
    );
}

/* True octagonal groove line. */
.dpht-candy-tray.is-octagon .dpht-groove {
    clip-path: polygon(
        29.289% 0,
        70.711% 0,
        100% 29.289%,
        100% 70.711%,
        70.711% 100%,
        29.289% 100%,
        0 70.711%,
        0 29.289%
    ) !important;
    background-image:
        linear-gradient(rgba(49,69,78,.20), rgba(49,69,78,.20)) !important;
}

/* Cut out the center so only a slim polygon ring remains. */
.dpht-candy-tray.is-octagon .dpht-groove::after {
    content: "";
    position: absolute;
    inset: 2px;
    background: rgba(247,251,252,.96);
    clip-path: polygon(
        29.289% 0,
        70.711% 0,
        100% 29.289%,
        100% 70.711%,
        70.711% 100%,
        29.289% 100%,
        0 70.711%,
        0 29.289%
    );
}


/* 0.6.19 — Keep SVG/PNG motif solid black in polygon previews.
   0.6.18's polygon groove center mask visually washed out the artwork.
   Preserve the hex/oct groove while ensuring artwork renders above it. */

.dpht-candy-tray.is-hexagon .dpht-groove,
.dpht-candy-tray.is-octagon .dpht-groove {
    z-index: 1 !important;
    pointer-events: none !important;
}

.dpht-candy-tray.is-hexagon .dpht-groove::after,
.dpht-candy-tray.is-octagon .dpht-groove::after {
    z-index: 0 !important;
    pointer-events: none !important;
}

/* Engraving/artwork must always sit above the groove visualization. */
.dpht-candy-tray .dpht-engraving,
.dpht-candy-tray .dpht-engraving-layer,
.dpht-candy-tray .dpht-artwork,
.dpht-candy-tray svg.dpht-engraving,
.dpht-candy-tray canvas {
    position: relative;
    z-index: 3 !important;
}

/* SVG motifs: black artwork without changing white/transparent negative space. */
.dpht-candy-tray .dpht-engraving svg,
.dpht-candy-tray .dpht-engraving-layer svg,
.dpht-candy-tray .dpht-artwork svg {
    opacity: 1 !important;
}

.dpht-candy-tray .dpht-engraving svg path,
.dpht-candy-tray .dpht-engraving svg polygon,
.dpht-candy-tray .dpht-engraving svg circle,
.dpht-candy-tray .dpht-engraving svg ellipse,
.dpht-candy-tray .dpht-engraving svg rect,
.dpht-candy-tray .dpht-engraving-layer svg path,
.dpht-candy-tray .dpht-engraving-layer svg polygon,
.dpht-candy-tray .dpht-engraving-layer svg circle,
.dpht-candy-tray .dpht-engraving-layer svg ellipse,
.dpht-candy-tray .dpht-engraving-layer svg rect {
    opacity: 1 !important;
}

/* PNG/canvas vector preview: don't fade the generated black motif. */
.dpht-candy-tray canvas,
.dpht-candy-tray .dpht-engraving img,
.dpht-candy-tray .dpht-engraving-layer img,
.dpht-candy-tray .dpht-artwork img {
    opacity: 1 !important;
}


/* 0.6.21 — Match Halloween Candy Tray Designer top accent bar to Keychain Generator. */
.dpht-tool-accent {
    background: #2ab5e0 !important;
}




/* 0.6.23 — Mobile-only preview sizing/centering.
   Desktop remains unchanged. */
@media (max-width: 640px) {

    /* Never clip the candy-tray on mobile. */
    .dpht-preview-card,
    .dpht__preview-card,
    .dpht-preview,
    .dpht-live-preview,
    .dpht-candy-tray-wrap,
    .dpht-candy-tray-stage,
    .dpht-preview-stage {
        overflow: visible !important;
    }

    /* Center the preview area without altering desktop behavior. */
    .dpht-candy-tray-wrap,
    .dpht-candy-tray-stage,
    .dpht-preview-stage,
    .dpht-live-preview {
        width: 100% !important;
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    /* Smaller, centered candy-tray model on phones. */
    .dpht-candy-tray {
        width: min(78vw, 430px) !important;
        height: min(78vw, 430px) !important;
        max-width: 430px !important;
        max-height: 430px !important;
        margin: 22px auto 18px !important;
        left: auto !important;
        right: auto !important;
        translate: none !important;
        transform-origin: center center !important;

        /* Flat mobile presentation: remove all drop shadows. */
        box-shadow: none !important;
        filter: none !important;
    }

    /* Also remove pseudo-element shadow/glow layers if defined elsewhere. */
    .dpht-candy-tray::before,
    .dpht-candy-tray::after {
        box-shadow: none !important;
        filter: none !important;
    }
}

/* Slightly smaller again on narrow Android phones. */
@media (max-width: 420px) {
    .dpht-candy-tray {
        width: 74vw !important;
        height: 74vw !important;
        max-width: 360px !important;
        max-height: 360px !important;
        margin-top: 18px !important;
        margin-bottom: 16px !important;
    }
}


/* 0.6.24 — Mobile preview depth aligned with Social Tag Generator.
   Keep the candy-tray itself completely flat on mobile; only the card keeps its
   normal subtle elevation. Desktop remains unchanged. */
@media (max-width: 640px) {

    /* No shadow/glow on the candy-tray object itself. */
    .dpht-candy-tray,
    .dpht-candy-tray::before,
    .dpht-candy-tray::after {
        box-shadow: none !important;
        filter: none !important;
        text-shadow: none !important;
    }

    /* Remove any radial/blurred halo from preview wrappers around the object. */
    .dpht-candy-tray-wrap,
    .dpht-candy-tray-stage,
    .dpht-preview-stage,
    .dpht-live-preview {
        box-shadow: none !important;
        filter: none !important;
        background-image: none !important;
    }

    /* Pseudo layers used for decorative depth must also stay flat on phones. */
    .dpht-candy-tray-wrap::before,
    .dpht-candy-tray-wrap::after,
    .dpht-candy-tray-stage::before,
    .dpht-candy-tray-stage::after,
    .dpht-preview-stage::before,
    .dpht-preview-stage::after,
    .dpht-live-preview::before,
    .dpht-live-preview::after {
        box-shadow: none !important;
        filter: none !important;
        background-image: none !important;
        opacity: 0 !important;
    }

    /* Match the Social Tag Generator feel: subtle depth only on the preview card. */
    .dpht-preview-card,
    .dpht__preview-card {
        box-shadow: 0 10px 28px rgba(35, 58, 70, .055) !important;
    }
}


/* 0.6.25 — Flat mobile cards, matching the cleaner Social Tag presentation.
   Desktop shadows remain untouched. */
@media (max-width: 640px) {

    .dpht,
    .dpht-card,
    .dpht__card,
    .dpht-panel,
    .dpht-controls,
    .dpht__controls,
    .dpht-preview-card,
    .dpht__preview-card,
    .dpht-engraving-card,
    .dpht-engraving,
    .dpht-upload,
    .dpht-upload-box,
    .dpht-export,
    .dpht__export {
        box-shadow: none !important;
        filter: none !important;
    }

    /* Also neutralize decorative pseudo-element shadows on mobile cards. */
    .dpht-card::before,
    .dpht-card::after,
    .dpht__card::before,
    .dpht__card::after,
    .dpht-panel::before,
    .dpht-panel::after,
    .dpht-controls::before,
    .dpht-controls::after,
    .dpht__controls::before,
    .dpht__controls::after,
    .dpht-preview-card::before,
    .dpht-preview-card::after,
    .dpht__preview-card::before,
    .dpht__preview-card::after {
        box-shadow: none !important;
        filter: none !important;
    }

    /* Keep cards defined by their border/background instead of depth. */
    .dpht-card,
    .dpht__card,
    .dpht-panel,
    .dpht-controls,
    .dpht__controls,
    .dpht-preview-card,
    .dpht__preview-card {
        border-color: #dfe7eb !important;
    }
}


/* 0.6.26 — Remove the remaining mobile shadow from the top
   "Halloween Candy Tray Designer" tool header card. Desktop remains unchanged. */
@media (max-width: 640px) {
    .dpht-tool-card,
    .dpht-tool-card::before,
    .dpht-tool-card::after {
        box-shadow: none !important;
        filter: none !important;
    }

    .dpht-tool-card {
        border-color: #dfe7eb !important;
    }
}

/* Test 4: real STL / engraved mesh previews */
.dpht-shape-choice{display:flex!important;flex-direction:column;align-items:stretch;gap:7px;padding:8px!important;min-width:150px}
.dpht-shape-thumb{display:block;width:100%;height:92px;border-radius:10px;background:linear-gradient(180deg,#f8fbfc,#eef5f7);pointer-events:none}
.dpht-shape-label{display:block;text-align:center;font-weight:700;padding:2px 5px 4px}
.dpht-preview-3d{position:relative;min-height:520px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:radial-gradient(circle at 50% 42%,#fff 0,#f5f9fa 58%,#edf4f6 100%)}
.dpht-model-canvas{display:block;width:100%;height:auto;max-height:620px;min-height:460px;cursor:grab;touch-action:none;outline:none}
.dpht-model-canvas:active{cursor:grabbing}
.dpht-model-loading{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:10px 16px;border-radius:999px;background:rgba(255,255,255,.9);border:1px solid #dce9ed;font-weight:700;color:#3b4b56;pointer-events:none}
.dpht-model-loading[hidden]{display:none}
.dpht-model-hint{position:absolute;right:16px;bottom:14px;background:rgba(255,255,255,.86);border:1px solid #dce9ed;border-radius:999px;padding:7px 11px;font-size:12px;color:#687983;pointer-events:none}
@media(max-width:700px){.dpht-preview-3d{min-height:360px}.dpht-model-canvas{min-height:340px}.dpht-shape-thumb{height:78px}}


/* Test 5: cleaner solid 3D material + contained live preview */
.dpht-preview-3d{
  box-sizing:border-box;
  width:100%;
  height:clamp(430px,44vw,560px);
  min-height:0;
  padding:0!important;
  margin:14px 0 14px;
  overflow:hidden;
  border-radius:0;
  background:linear-gradient(180deg,#f4f8fa 0%,#edf4f6 100%);
}
.dpht-model-canvas{
  display:block;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:auto!important;
}
.dpht-preview-panel>.dpht-safe-note{
  position:relative;
  z-index:1;
  margin:0!important;
  padding:0 18px 4px;
  line-height:1.45;
}
.dpht-model-hint{z-index:3}
.dpht-model-loading{z-index:4}
@media(max-width:700px){
  .dpht-preview-3d{height:380px;min-height:0;margin-bottom:12px}
  .dpht-model-canvas{height:100%!important;min-height:0!important}
  .dpht-preview-panel>.dpht-safe-note{padding-left:8px;padding-right:8px}
}

/* Test 6: compact engraving library + clean WebGL solid previews */
.dpht-engravings{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:10px!important;
}
.dpht-engraving{
  min-width:0;
  padding:8px!important;
}
.dpht-engraving img,
.dpht-engraving-card img,
[data-engraving-url] img{
  height:76px!important;
}
.dpht-engraving span{
  margin-top:5px!important;
  font-size:11px!important;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.dpht-shape-thumb{
  background:#eef5f7!important;
}
.dpht-preview-3d{
  background:#eef5f7!important;
}
@media(max-width:560px){
  .dpht-engravings{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}


/* Test 11: never crop engraving library artwork */
.dpht-engraving img,
.dpht-engraving-card img,
[data-engraving-url] img{
  object-fit:contain!important;
  object-position:center center!important;
  padding:7px!important;
  box-sizing:border-box!important;
  overflow:visible!important;
}


/* Test 12: user-controlled engraving size */
.dpht-engraving-size{margin:16px 0 14px;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:var(--soft)}
.dpht-engraving-size-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}
.dpht-engraving-size-head label{font-weight:800;color:var(--ink)}
.dpht-engraving-size-head output{font-weight:800;color:var(--cyan);font-variant-numeric:tabular-nums}
.dpht-engraving-size input[type=range]{width:100%;accent-color:var(--cyan);cursor:pointer}
.dpht-engraving-size>span{display:block;margin-top:6px;font-size:12px;line-height:1.4;color:var(--muted)}

/* Test 15: engraving-size typography + mobile usability refinement */
.dpht-engraving-size{
  margin:14px 0 13px;
  padding:12px 14px;
}
.dpht-engraving-size-head{
  margin-bottom:7px;
  gap:10px;
}
.dpht-engraving-size-head label{
  font-size:14px;
  line-height:1.25;
  font-weight:700;
}
.dpht-engraving-size-head output{
  font-size:15px;
  line-height:1.2;
  font-weight:800;
}
.dpht-engraving-size>span{
  margin-top:5px;
  font-size:11px;
  line-height:1.4;
}
.dpht-engraving-size input[type=range]{
  display:block;
  width:100%;
  height:28px;
  margin:0;
  padding:0;
  background:transparent;
}

/* Keep the control easy to grab without making the typography oversized. */
.dpht-engraving-size input[type=range]::-webkit-slider-runnable-track{
  height:6px;
  border-radius:999px;
  background:#dce7eb;
}
.dpht-engraving-size input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:20px;
  height:20px;
  margin-top:-7px;
  border:2px solid #fff;
  border-radius:50%;
  background:var(--cyan);
  box-shadow:0 1px 4px rgba(36,58,69,.22);
}
.dpht-engraving-size input[type=range]::-moz-range-track{
  height:6px;
  border:0;
  border-radius:999px;
  background:#dce7eb;
}
.dpht-engraving-size input[type=range]::-moz-range-progress{
  height:6px;
  border-radius:999px;
  background:var(--cyan);
}
.dpht-engraving-size input[type=range]::-moz-range-thumb{
  width:18px;
  height:18px;
  border:2px solid #fff;
  border-radius:50%;
  background:var(--cyan);
  box-shadow:0 1px 4px rgba(36,58,69,.22);
}

@media (max-width:820px){
  /* Controls first, preview second, with compact but touch-friendly spacing. */
  .dpht-grid{gap:12px;}
  .dpht-panel{padding:14px;}
  .dpht-step:not(:first-child){margin-top:18px;}

  .dpht-shape-choice{
    min-width:0;
    padding:7px!important;
    gap:5px;
  }
  .dpht-shape-thumb{height:74px;}
  .dpht-shape-label{
    font-size:12px;
    line-height:1.25;
    padding-bottom:2px;
  }

  .dpht-engravings{gap:8px!important;}
  .dpht-engraving{padding:7px!important;}
  .dpht-engraving img,
  .dpht-engraving-card img,
  [data-engraving-url] img{
    height:72px!important;
    padding:6px!important;
  }
  .dpht-engraving span{
    font-size:11px!important;
    margin-top:4px!important;
  }

  .dpht-engraving-size{
    margin:13px 0 12px;
    padding:11px 12px;
    border-radius:12px;
  }
  .dpht-engraving-size-head label{font-size:13px;}
  .dpht-engraving-size-head output{font-size:14px;}
  .dpht-engraving-size>span{font-size:10.5px;}
  .dpht-engraving-size input[type=range]{height:36px;}

  .dpht-upload{
    margin-top:10px;
    padding:12px;
  }
  .dpht-upload strong{font-size:13px;}
  .dpht-upload span{font-size:11px;line-height:1.4;}
  .dpht-upload input{min-height:40px;}

  .dpht-preview-3d{
    height:clamp(300px,72vw,360px);
    margin-top:10px;
  }
  .dpht-model-hint{
    right:10px;
    bottom:10px;
    padding:6px 9px;
    font-size:10px;
  }
  .dpht-preview-panel>.dpht-safe-note{
    padding-left:4px;
    padding-right:4px;
    font-size:10.5px;
  }
}

@media (max-width:560px){
  /* Two engraving tiles are much easier to hit/read on a phone than three. */
  .dpht-engravings{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .dpht-options{grid-template-columns:repeat(2,minmax(0,1fr));}
  .dpht-shape-thumb{height:70px;}
  .dpht-preview-3d{height:310px;}
}

@media (max-width:390px){
  .dpht-shell{padding-left:6px;padding-right:6px;}
  .dpht-panel{padding:12px;}
  .dpht-shape-label{font-size:11px;}
  .dpht-engraving img,
  .dpht-engraving-card img,
  [data-engraving-url] img{height:66px!important;}
  .dpht-preview-3d{height:285px;}
  .dpht-preview-head{gap:6px;}
  .dpht-depth{font-size:9px;}
}


/* Test 20: denser tray selector + higher quality geometry build */
.dpht-options[data-shapes]{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  width:100%;
}
.dpht-options[data-shapes] .dpht-shape-choice{
  min-width:0!important;
  width:100%;
}
@media (max-width:820px){
  .dpht-options[data-shapes]{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
}


/* Export progress --------------------------------------------------------- */
.dpht-export-progress{
  margin-top:12px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--soft);
}
.dpht-export-progress[hidden]{display:none!important}
.dpht-export-progress__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.dpht-export-progress__head strong{
  min-width:0;
  font-size:13px;
  line-height:1.35;
  color:var(--text);
}
.dpht-export-progress__head span{
  flex:0 0 auto;
  font-size:12px;
  font-weight:800;
  color:var(--cyan);
}
.dpht-export-progress__track{
  position:relative;
  height:9px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(39,72,86,.12);
}
.dpht-export-progress__track>span{
  position:absolute;
  inset:0 auto 0 0;
  width:0;
  border-radius:inherit;
  background:var(--cyan);
  transition:width .28s ease;
}
.dpht-export-progress__track.is-indeterminate>span{
  width:38%!important;
  animation:dpht-export-progress-slide 1.15s ease-in-out infinite;
}
.dpht-export-progress__track.is-error>span{
  animation:none;
  width:100%!important;
  background:#c44848;
}
.dpht-export-progress__hint{
  display:block;
  margin-top:7px;
  font-size:11px;
  line-height:1.4;
  color:var(--muted);
}
@keyframes dpht-export-progress-slide{
  0%{left:-38%}
  50%{left:55%}
  100%{left:100%}
}
@media (prefers-reduced-motion:reduce){
  .dpht-export-progress__track>span{transition:none}
  .dpht-export-progress__track.is-indeterminate>span{
    animation:none;
    left:31%;
  }
}
@media (max-width:640px){
  .dpht-export-progress{padding:11px 12px}
  .dpht-export-progress__head{gap:8px}
  .dpht-export-progress__head strong{font-size:12px}
  .dpht-export-progress__hint{font-size:10.5px}
  .dpht-export-progress__track{height:10px}
}
