/* One persistent visual, positioned within the editing boundary. */
#editor-visual-host{width:100%}.product-media:has(#editor-visual-host:not([hidden])){top:var(--editor-header-top,120px)}.product-media .editor-visual{position:relative;top:auto;margin:0;padding:19px;background:var(--soft);border:1px solid var(--line);border-radius:6px}.product-media .editor-visual #engraving-preview{display:block;width:100%;height:min(53vh,520px);max-width:100%;margin:auto;background:#fff;border-radius:3px}.editor-visual .preview-heading{margin-bottom:12px}.editor-visual .badge{font-size:8px;letter-spacing:.1em;color:var(--muted)}.editor-visual .preview-heading>span:last-child{font-size:9px;color:var(--muted);text-align:right}.editor-visual p{font-size:10px;line-height:1.6;color:var(--muted);margin:9px 0 0}.editor-visual p.editor-drag-hint{font-size:10px;color:var(--ink)}#engraving-preview{touch-action:none;cursor:move;user-select:none;-webkit-user-select:none}#engraving-preview:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.editor-tone-indicator{display:flex;align-items:center;justify-content:center;gap:7px;margin-top:12px;font-size:10px}.editor-tone-indicator>span{width:11px;height:11px;border:1px solid #fff8;border-radius:50%}.editor-tone-indicator b{font-weight:500}.editor-tone-indicator small{color:var(--muted);font-size:9px;margin-left:8px}.editor-photo-button{margin-top:13px;font-size:10px}.editor-size-label{position:relative}.editor-size-label>output{position:absolute;right:0;top:0;color:var(--accent);font-weight:600}.font-sample{display:block;font-size:25px;line-height:1.4;padding:12px 14px;background:var(--soft);border-radius:4px;margin-top:7px;overflow-wrap:anywhere}.converted-text{display:block;font-size:13px;color:var(--accent);white-space:pre-line;margin-top:7px;overflow-wrap:anywhere}.editor-move{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 0;margin-top:10px;border-bottom:1px solid var(--line)}.editor-move h3{font-size:12px;font-weight:600;margin:0 0 5px}.editor-move p{font-size:10px;color:var(--muted);margin:0}.editor-direction-pad{display:grid;grid-template-columns:repeat(3,32px);grid-template-rows:repeat(3,29px);gap:4px;flex:0 0 auto}.editor-direction-pad button{border:1px solid var(--line);border-radius:3px;background:var(--card);font-size:18px;padding:0;line-height:1}.editor-direction-pad button:nth-child(1){grid-area:1/2}.editor-direction-pad button:nth-child(2){grid-area:2/1}.editor-direction-pad button:nth-child(3){grid-area:2/2;font-size:10px;color:var(--accent)}.editor-direction-pad button:nth-child(4){grid-area:2/3}.editor-direction-pad button:nth-child(5){grid-area:3/2}.editor-direction-pad button:hover{border-color:var(--accent);background:var(--accent-soft)}.editor-shortcuts{display:flex;gap:20px;margin:15px 0 22px}.editor-shortcuts .text-link{font-size:10px}.editor-note{margin-top:15px}.upload-prepared{display:flex;align-items:center;gap:13px;padding:12px;background:var(--soft);border-radius:4px;margin-top:12px;min-width:0}.upload-prepared img{height:90px;width:90px;padding:8px;object-fit:contain;background:#fff;border:1px solid var(--line);flex:0 0 auto}.upload-prepared>div{min-width:0;overflow-wrap:anywhere}.upload-prepared b{display:block;font-size:11px}.upload-prepared small{display:block;font-size:9px;color:var(--muted);margin-top:5px}.upload-threshold{margin:15px 0 9px;position:relative}.upload-threshold output{position:absolute;top:0;right:0;color:var(--accent)}.upload-invert{display:flex;align-items:center;gap:9px;font-size:11px;margin:10px 0 15px}.product-config .upload-invert input{width:16px;height:16px;accent-color:var(--accent)}.upload-progress{font-size:11px;color:var(--muted);margin:15px 0}.product-config #upload-error{font-size:10px;margin-bottom:13px}.product-config .field input[type=file]{font-size:11px;max-width:100%;overflow:hidden;padding:10px}.editor-visual-host{min-width:0}.product-config .personal-fields .field:has(#rotation){min-width:0}.product-config .personal-fields #rotation{width:100%;accent-color:var(--accent);padding:0}.product-config #upload-result .field{margin-top:15px}
@media(min-width:901px){#mobile-editor-visual-host{display:none}.product-config .positions-heading{scroll-margin-top:140px}.product-config .field{scroll-margin-top:140px}}
@media(max-width:900px){.product-detail-layout{grid-template-columns:minmax(0,1fr);grid-template-areas:'title' 'media' 'config'}.product-media{position:relative;top:auto}.product-media #product-photo-panel .gallery-main{max-height:450px}.product-config .designer{position:relative}#mobile-editor-visual-host{position:sticky;top:var(--editor-header-top,120px);z-index:12;background:var(--bg);margin-bottom:20px;box-shadow:0 6px 16px #00000008}.product-config .editor-visual{position:relative;top:auto;padding:10px 12px;margin:0;background:var(--soft);border:1px solid var(--line);border-radius:5px}.product-config .editor-visual #engraving-preview{height:clamp(145px,23vh,240px);width:100%;max-width:100%;background:#fff;border-radius:3px}.product-config .editor-visual .preview-heading{margin:0 0 5px}.product-config .editor-visual p{font-size:8px;line-height:1.4;margin-top:5px;max-width:none}.product-config .editor-visual .editor-drag-hint{display:none}.editor-tone-indicator{margin-top:6px;font-size:9px}.editor-tone-indicator small{font-size:8px}.editor-photo-button{display:none}.product-config .editor-visual .badge{font-size:7px}.product-config .positions-heading{scroll-margin-top:calc(var(--editor-header-top,120px) + clamp(145px,23vh,240px) + 95px)}.product-config .field{scroll-margin-top:calc(var(--editor-header-top,120px) + clamp(145px,23vh,240px) + 95px)}.product-config .approve{scroll-margin-top:calc(var(--editor-header-top,120px) + clamp(145px,23vh,240px) + 90px)}.product-config .font-sample{font-size:23px}.editor-move{gap:15px}.editor-move p{font-size:9px}.editor-move h3{font-size:11px}}
@media(max-width:700px){.product-config .personal-fields .field input[type=range]{padding:0}.editor-visual .preview-heading>span:last-child{font-size:8px}.upload-prepared img{width:72px;height:72px}.upload-prepared b{font-size:10px}.upload-prepared small{font-size:8px}.upload-invert{font-size:10px}.editor-shortcuts .text-link{font-size:10px}.product-config .editor-size-label>output{font-size:11px}}
@media(max-height:550px){.product-config .editor-visual #engraving-preview{height:115px}.product-config .editor-visual p{display:none}.product-config .editor-visual .editor-tone-indicator{margin-top:3px}.product-config .field,.product-config .positions-heading,.product-config .approve{scroll-margin-top:calc(var(--editor-header-top,100px) + 185px)}}

.editor-visual .badge{position:static;display:inline;inset:auto}.editor-photo-button .arrow-icon{width:14px;height:14px;display:inline-block;background:transparent;margin:0}
.product-config .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.product-config .field{min-width:0}.product-config .field input,.product-config .field select,.product-config .field textarea{min-width:0;max-width:100%}.product-config .field input[type=range]{margin-inline:0}
.product-config fieldset.field{border:0;padding:0;margin:0;min-inline-size:0}.product-config fieldset.field>legend{padding:0;margin-bottom:9px;font-size:11px}.editor-content-options{display:grid;grid-template-columns:1fr 1fr;gap:9px}.editor-content-options>label{display:flex;align-items:center;gap:9px;border:1px solid var(--line);border-radius:5px;padding:12px;cursor:pointer;background:var(--card);font-size:11px}.editor-content-options>label:has(input:checked){background:var(--accent-soft);border-color:var(--accent)}.product-config .editor-content-options input{width:16px;height:16px;flex:0 0 auto;margin:0;padding:0;accent-color:var(--accent)}.editor-upload-field{position:relative;padding:15px;border:1px dashed var(--accent);border-radius:5px;background:var(--soft)}.editor-upload-field>small{display:block;text-align:center;margin-top:9px!important}.editor-upload-field>#file-name{display:block;font-size:10px;overflow-wrap:anywhere;margin-top:5px}.editor-font-help{font-size:10px;color:var(--muted);margin:0 0 13px;line-height:1.6}.editor-font-group+.editor-font-group{margin-top:20px}.editor-font-group h4{font-size:10px;font-weight:500;color:var(--muted);margin:0 0 9px}.editor-font-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.editor-font-choice{position:relative;display:flex;flex-direction:column;min-width:0;gap:7px;border:1px solid var(--line);border-radius:6px;padding:11px 12px 12px 31px;background:var(--card);cursor:pointer;min-height:91px}.editor-font-choice.selected{border-color:var(--accent);background:var(--accent-soft);box-shadow:0 0 0 1px var(--accent)}.editor-font-choice:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:3px}.product-config .editor-font-choice>input{position:absolute;left:10px;top:12px;width:13px;height:13px;padding:0;margin:0;accent-color:var(--accent)}.editor-font-title{font-size:9px;line-height:1.5;color:var(--muted)}.editor-font-sample{display:block;font-size:25px;line-height:1.4;white-space:pre-line;overflow-wrap:anywhere;color:var(--ink)}.editor-fixed-tone p{display:flex;align-items:center;gap:8px;margin:8px 0 0;font-size:11px}.editor-fixed-tone strong{font-weight:500}.editor-fixed-tone p>span{width:13px;height:13px;flex:0 0 auto;border:1px solid #7776;border-radius:50%}.editor-tone-indicator>span{border-color:#7776}
@media(max-width:700px){.editor-font-choice{padding:10px 8px 11px 26px;min-height:87px}.product-config .editor-font-choice>input{left:8px;top:11px;width:12px;height:12px}.editor-font-sample{font-size:22px}.editor-font-title{font-size:8px}.editor-content-options>label{padding:11px 8px;font-size:10px;gap:7px}.product-config #script-field>.field{margin:0}}
.product-config .surface-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.product-config .surface-fields>.field{margin:0}.engraving-unavailable{padding:15px 17px;background:var(--soft);border:1px solid var(--line);border-radius:5px;margin-bottom:20px;font-size:11px}.engraving-unavailable b{font-weight:600}.engraving-unavailable p{margin:6px 0;color:var(--muted);line-height:1.6}.engraving-unavailable small{font-size:10px;color:var(--muted)}

/* The whole button is a native file input, including its touch area. */
.editor-file-button {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 9px 14px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--card);
  font-weight: 650;
  font-size: 14px;
  text-align: center;
}
.product-config #engrave-file.editor-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.editor-file-input::file-selector-button { width: 100%; min-height: 48px; }
.editor-file-button:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.editor-file-button:has(input:disabled) { opacity: .65; }
.editor-upload-label { pointer-events: none; }
.editor-upload-field[hidden] { display: none; }

@media (max-width: 900px) {
  .designer[data-content="image"] #mobile-editor-visual-host {
    position: static;
    margin-bottom: 16px;
    box-shadow: none;
  }
  .designer[data-content="image"] #file-field {
    scroll-margin-top: calc(var(--editor-header-top, 120px) + 12px);
  }
  .designer[data-content="image"] .approve {
    scroll-margin-top: calc(var(--editor-header-top, 120px) + 12px);
  }
}
.editor-upload-field .editor-upload-fallback {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.editor-upload-fallback a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

#engraving-preview { cursor: zoom-in; }
#engraving-preview.is-dragging { cursor: grabbing; }
.editor-zoom-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin-top: 4px;
  padding: 2px 0;
  color: var(--accent);
}
.dark .product-config .editor-visual .editor-zoom-button { color: #793b40; }
.editor-zoom-button span { font-size: 1.2em; }
.editor-visual .editor-photo-button { margin-left: 12px; }
.engraving-lightbox-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px 12px;
  color: var(--muted);
  font-size: 12px;
}
.engraving-lightbox-caption b { color: var(--ink); }
.engraving-lightbox-viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  touch-action: pan-x pan-y;
}
.engraving-lightbox-viewport:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.engraving-lightbox-images {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
}
.engraving-lightbox-images.with-context { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.engraving-lightbox-images figure {
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: min(2vw, 16px);
}
.engraving-lightbox-images.with-context figure + figure { border-left: 1px solid var(--line); }
.engraving-lightbox-images figcaption {
  text-align: center;
  color: #50504a;
  font-size: 11px;
  padding-top: 5px;
}
.engraving-lightbox-simulation, .engraving-lightbox-images img {
  flex: 1;
  width: 100%;
  min-height: 0;
}
.engraving-lightbox-images img { object-fit: contain; }
.engraving-lightbox-images img.mirrored { transform: scaleX(-1); }
.engraving-lightbox-simulation svg { width: 100%; height: 100%; }
.engraving-lightbox-viewport.is-zoomed .engraving-lightbox-images { width: 200%; height: 200%; }
.engraving-lightbox-controls button { margin-right: 6px; }
@media (max-width: 700px) {
  .engraving-lightbox-images.with-context {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .engraving-lightbox-images.with-context figure + figure {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
