/**
 * 3D configurator item-field surface (DEMO).
 *
 * Only the root .alfa-configurator3d is namespaced (it faces the global site
 * document); everything inside is scoped under it, so inner names stay plain.
 */

.alfa-configurator3d { margin: 1.2rem 0; }
.alfa-configurator3d .configurator-title { font-size: 0.95rem; margin-bottom: 0.5rem; }
.alfa-configurator3d .configurator-stage { position: relative; border: 1px solid #d8dce1; border-radius: 8px; overflow: hidden; background: #f2f4f6; }
.alfa-configurator3d .configurator-stage canvas { display: block; width: 100%; height: 100%; }
.alfa-configurator3d .configurator-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: #8a9099; pointer-events: none; }

/* Per-area upload slots (one per admin place-area). */
.alfa-configurator3d .configurator-slots { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.7rem; }
.alfa-configurator3d .configurator-slot { display: flex; flex-direction: column; gap: 0.25rem; flex: 1 1 12rem; max-width: 18rem; padding: 0.6rem 0.7rem; border: 1px dashed #c7ccd2; border-radius: 8px; cursor: pointer; transition: border-color 0.15s ease; }
.alfa-configurator3d .configurator-slot:hover { border-color: #b3873a; }
.alfa-configurator3d .configurator-slot-label { font-size: 0.78rem; font-weight: 600; color: #1f2327; }
.alfa-configurator3d .configurator-slot-hint { font-size: 0.7rem; color: #8a9099; }
.alfa-configurator3d .configurator-slot input[type="file"] { font-size: 0.74rem; }
.alfa-configurator3d .configurator-controls { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.6rem; }
.alfa-configurator3d .configurator-control { display: flex; align-items: center; gap: 0.5rem; }
.alfa-configurator3d .configurator-label { font-size: 0.78rem; font-weight: 600; color: #1f2327; }
.alfa-configurator3d .configurator-swatches { display: inline-flex; gap: 0.35rem; }
.alfa-configurator3d .configurator-swatch { width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #d8dce1; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.alfa-configurator3d .configurator-swatch.is-active { box-shadow: 0 0 0 2px #b3873a; transform: scale(1.12); }
.alfa-configurator3d .configurator-readout { margin: 0.4rem 0 0; font-size: 0.76rem; color: #4a5158; }
.alfa-configurator3d .configurator-readout code { font-size: 0.72rem; }

/* Per-area buyer size control inside a slot. */
.alfa-configurator3d .configurator-slot-size { display: flex; align-items: center; gap: 0.4rem; font-size: 0.7rem; color: #8a9099; margin-top: 0.25rem; }
.alfa-configurator3d .configurator-slot-size input[type="range"] { flex: 1 1 auto; }
.alfa-configurator3d .configurator-actions { margin-top: 0.6rem; }

/* Backend Configure popup: the three.js area editor */
.cfg3d-editor .cfg3d-stage { position: relative; height: 360px; border: 1px solid #d8dce1; border-radius: 8px; overflow: hidden; background: #eef1f4; }
.cfg3d-editor .cfg3d-stage canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.cfg3d-editor .cfg3d-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: #8a9099; pointer-events: none; }
.cfg3d-editor [data-cfg3d-add].active { background: #b3873a; border-color: #b3873a; color: #fff; }
.cfg3d-editor .cfg3d-areas:empty::before { content: ""; }
.cfg3d-editor .cfg3d-row-selected { outline: 2px solid #2f6db3; outline-offset: 2px; border-radius: 6px; }

/* Stage overlay controls (grouped tools top-right, zoom, hint). */
.alfa-configurator3d .configurator-tools { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 3; display: flex; flex-direction: column; gap: 0.25rem; }
.alfa-configurator3d .configurator-tool-btn { width: 2rem; height: 2rem; border: 1px solid #d8dce1; border-radius: 6px; background: rgba(255,255,255,0.9); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.alfa-configurator3d .configurator-tool-btn:hover { background: #fff; box-shadow: 0 0 0 2px #b3873a; }
.alfa-configurator3d .configurator-zoom { position: absolute; bottom: 0.5rem; right: 0.5rem; z-index: 3; display: flex; flex-direction: column; gap: 0.25rem; }
.alfa-configurator3d .configurator-zoom button { width: 1.9rem; height: 1.9rem; border: 1px solid #d8dce1; border-radius: 6px; background: rgba(255,255,255,0.9); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.alfa-configurator3d .configurator-zoom button:hover { background: #fff; }
.alfa-configurator3d .configurator-controls-hint { position: absolute; bottom: 0.5rem; left: 0.6rem; z-index: 3; font-size: 0.68rem; color: #6a7178; background: rgba(255,255,255,0.7); padding: 0.1rem 0.4rem; border-radius: 4px; pointer-events: none; }
/* In-canvas fit toolbar, pinned to the selected logo's top-right corner. */
.alfa-configurator3d .configurator-stage canvas { cursor: grab; }
.alfa-configurator3d .configurator-fit-toolbar { position: absolute; z-index: 4; transform: translate(-50%, -150%); display: inline-flex; gap: 0.15rem; padding: 0.15rem; background: rgba(255,255,255,0.95); border: 1px solid #d8dce1; border-radius: 7px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.alfa-configurator3d .configurator-fit-toolbar button { font-size: 0.68rem; line-height: 1; padding: 0.2rem 0.4rem; border: 0; border-radius: 5px; background: transparent; color: #4a5158; cursor: pointer; }
.alfa-configurator3d .configurator-fit-toolbar button:hover { background: #eef1f4; }
.alfa-configurator3d .configurator-fit-toolbar button.is-active { background: #2f6db3; color: #fff; }
.alfa-configurator3d .configurator-fit-sep { width: 1px; align-self: stretch; background: #e1e5ea; margin: 0.1rem 0.05rem; }
.alfa-configurator3d .configurator-fit-remove { color: #d9534f !important; font-size: 0.95rem !important; font-weight: 700; }
.alfa-configurator3d .configurator-fit-remove:hover { background: #fbe9e8 !important; }

/* "Maximum area reached" flash when a hand-resize hits the limit. */
.alfa-configurator3d .configurator-limit-msg { position: absolute; top: 0.5rem; left: 50%; transform: translateX(-50%); z-index: 5; font-size: 0.72rem; font-weight: 600; color: #fff; background: #d9534f; padding: 0.2rem 0.6rem; border-radius: 5px; box-shadow: 0 2px 8px rgba(0,0,0,0.18); animation: cfg3d-limit-blink 0.45s ease-in-out 2; }
@keyframes cfg3d-limit-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Backend editor overlay: area labels, zoom, hint. */
.cfg3d-editor .cfg3d-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cfg3d-editor .cfg3d-label { position: absolute; transform: translate(-50%, -120%); font-size: 0.66rem; font-weight: 600; color: #fff; background: #b3873a; padding: 0.05rem 0.35rem; border-radius: 4px; white-space: nowrap; }
.cfg3d-editor .cfg3d-label.is-selected { background: #2f6db3; }
.cfg3d-editor .cfg3d-zoom { position: absolute; bottom: 0.5rem; right: 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; }
.cfg3d-editor .cfg3d-zoom button { width: 1.9rem; height: 1.9rem; border: 1px solid #d8dce1; border-radius: 6px; background: rgba(255,255,255,0.9); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.cfg3d-editor .cfg3d-controls-hint { position: absolute; bottom: 0.5rem; left: 0.6rem; font-size: 0.66rem; color: #6a7178; background: rgba(255,255,255,0.7); padding: 0.1rem 0.4rem; border-radius: 4px; pointer-events: none; }

/* In-canvas toolbar for the selected area (rename / resize / remove). */
.cfg3d-editor .cfg3d-float { position: absolute; z-index: 5; transform: translate(-50%, -160%); display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.35rem; background: rgba(255,255,255,0.97); border: 1px solid #d8dce1; border-radius: 7px; box-shadow: 0 2px 10px rgba(0,0,0,0.14); white-space: nowrap; }
.cfg3d-editor .cfg3d-float-label { width: 6rem; font-size: 0.72rem; padding: 0.1rem 0.3rem; border: 1px solid #d8dce1; border-radius: 4px; }
.cfg3d-editor .cfg3d-float-dim { display: inline-flex; align-items: center; gap: 0.15rem; font-size: 0.66rem; color: #6a7178; }
.cfg3d-editor .cfg3d-float-dim input { width: 3.2rem; font-size: 0.7rem; padding: 0.1rem 0.2rem; border: 1px solid #d8dce1; border-radius: 4px; }
.cfg3d-editor .cfg3d-float-fit,
.cfg3d-editor .cfg3d-float-auto { border: 1px solid #d8dce1; background: #fff; color: #4a5158; cursor: pointer; padding: 0.12rem 0.4rem; font-size: 0.68rem; border-radius: 5px; line-height: 1; }
.cfg3d-editor .cfg3d-float-fit:hover { background: #eef1f4; }
.cfg3d-editor .cfg3d-float-fit.is-active,
.cfg3d-editor .cfg3d-float-auto.is-active { background: #2f6db3; border-color: #2f6db3; color: #fff; }
.cfg3d-editor .cfg3d-float-del { border: 0; background: transparent; color: #d9534f; cursor: pointer; padding: 0.1rem 0.2rem; font-size: 0.85rem; line-height: 1; }
.cfg3d-editor .cfg3d-float-del:hover { color: #b52b27; }

/* Net/gross target: the SAME dark cycle chip as the options/prices lists
   (op-cycle look), so the studio speaks the one pricing dialect. */
.cfg3d-editor .cfg3d-float-target {
  min-width: 2.4rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--alfa-ink, #212529);
  background: var(--alfa-ink, #212529);
  color: #fff;
  border-radius: 4px;
  font-size: 0.7rem;
  line-height: 1.3;
  cursor: pointer;
}

/* v3 album designer: opener + fullscreen overlay */
.alfa-configurator3d .configurator-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid #1d2b3a;
  background: #1d2b3a;
  color: #fff;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
}

.alfa-configurator3d .configurator-open-btn:hover { background: #2f4661; }

.alfa-configurator3d .configurator-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem 1rem;
  overflow: auto;
}

.alfa-configurator3d .configurator-overlay[hidden] { display: none; }

/* The stage grows to fill the overlay; its inline height acts as a minimum. */
.alfa-configurator3d .configurator-overlay .configurator-stage { flex: 1 1 auto; min-height: 320px; }

.alfa-configurator3d .configurator-overlay-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.alfa-configurator3d .configurator-page-title { font-size: 1.05rem; }

.alfa-configurator3d .configurator-pagenav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.alfa-configurator3d .configurator-pagenav button {
  border: 1px solid #c9cfd6;
  background: #fff;
  border-radius: 4px;
  min-width: 2rem;
  padding: 0.1rem 0.4rem;
  font-size: 1.1rem;
  line-height: 1.4;
  cursor: pointer;
}

.alfa-configurator3d .configurator-overlay-close {
  margin-left: auto;
  border: 0;
  background: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: #4a5158;
}

body.configurator-overlay-open { overflow: hidden; }

/* v3.1: text slots, flex pages, history, preview */
.alfa-configurator3d .configurator-slot-text input[type="text"] {
  width: 100%;
  padding: 0.3rem 0.5rem;
  border: 1px solid #c9cfd6;
  border-radius: 4px;
  font-size: 0.9rem;
}

.alfa-configurator3d .configurator-text-opts {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  margin-top: 0.3rem;
}

.alfa-configurator3d .configurator-text-opts select,
.alfa-configurator3d .configurator-text-opts button {
  border: 1px solid #c9cfd6;
  background: #fff;
  border-radius: 4px;
  font-size: 0.78rem;
  padding: 0.15rem 0.35rem;
  cursor: pointer;
}

.alfa-configurator3d .configurator-text-opts button.is-active {
  background: #2f6db3;
  border-color: #2f6db3;
  color: #fff;
}

.alfa-configurator3d .configurator-text-opts input[type="color"] {
  width: 1.9rem;
  height: 1.7rem;
  padding: 0;
  border: 1px solid #c9cfd6;
  border-radius: 4px;
  background: none;
}

.alfa-configurator3d .configurator-pageops button,
.alfa-configurator3d .configurator-customops button,
.alfa-configurator3d .configurator-history button,
.alfa-configurator3d .configurator-preview-btn {
  border: 1px solid #c9cfd6;
  background: #fff;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.alfa-configurator3d .configurator-history button:disabled { opacity: 0.4; cursor: default; }
.alfa-configurator3d .configurator-preview-btn.is-active { background: #2f6db3; border-color: #2f6db3; color: #fff; }

/* Preview (the clean look): slot panels and hints step aside. */
.alfa-configurator3d .configurator-overlay.is-preview .configurator-slots,
.alfa-configurator3d .configurator-overlay.is-preview .configurator-slot-hint,
.alfa-configurator3d .configurator-overlay.is-preview .configurator-controls-hint { display: none; }

/* v3.2: buyer custom frames (free placement) */
.alfa-configurator3d .configurator-customops button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.alfa-configurator3d .configurator-customops button.is-active {
  background: #2f6db3;
  border-color: #2f6db3;
  color: #fff;
}

.alfa-configurator3d .configurator-stage.is-placing canvas { cursor: crosshair; }

.alfa-configurator3d .configurator-slot-custom { position: relative; }

.alfa-configurator3d .configurator-custom-remove {
  border: 0;
  background: none;
  color: #c0392b;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

/* v3.2: studio asset library + copy/paste */
.cfg3d-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 0.4rem;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid #c9cfd6;
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  background: #fafbfc;
}

.cfg3d-library .cfg3d-lib-item {
  border: 2px solid transparent;
  border-radius: 4px;
  background: #fff;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
}

.cfg3d-library .cfg3d-lib-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cfg3d-library .cfg3d-lib-item.is-current,
.cfg3d-library .cfg3d-lib-item:hover { border-color: #2f6db3; }

.cfg3d-library .cfg3d-lib-model {
  font-size: 0.68rem;
  word-break: break-all;
  padding: 0.3rem;
  color: #4a5158;
}

/* Prefilled-content row of the float toolbar (default text / default image). */
.cfg3d-editor .cfg3d-float { flex-wrap: wrap; }

.cfg3d-editor .cfg3d-float-row2 {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
}

.cfg3d-editor .cfg3d-float-row2:empty { display: none; }

.cfg3d-editor .cfg3d-float-default {
  flex: 1 1 8rem;
  font-size: 0.72rem;
  padding: 0.1rem 0.3rem;
  border: 1px solid #d8dce1;
  border-radius: 4px;
}

.cfg3d-editor .cfg3d-float-row2 select,
.cfg3d-editor .cfg3d-float-row2 input[type="color"] {
  font-size: 0.68rem;
  border: 1px solid #d8dce1;
  border-radius: 4px;
  background: #fff;
}

.cfg3d-editor .cfg3d-float-row2 input[type="color"] {
  width: 1.6rem;
  height: 1.45rem;
  padding: 0;
}

/* v3.2 phase 2: left rail + panel layout */
.alfa-configurator3d .configurator-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
  align-items: stretch;
}

.alfa-configurator3d .configurator-body .configurator-stage {
  flex: 1 1 auto;
  height: auto !important;
  min-height: 320px;
}

.alfa-configurator3d .configurator-rail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 0.4rem;
  border-right: 1px solid #e3e7eb;
  background: #fafbfc;
}

.alfa-configurator3d .configurator-rail button {
  width: 3.2rem;
  min-height: 3.1rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  padding: 0.3rem 0.1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: #4a5158;
  cursor: pointer;
}
.alfa-configurator3d .configurator-rail-label { font-size: 0.62rem; line-height: 1; letter-spacing: 0.01em; }

.alfa-configurator3d .configurator-rail button:hover { background: #eef1f4; }
.alfa-configurator3d .configurator-rail button.is-active { background: #2f6db3; border-color: #2f6db3; color: #fff; }

.alfa-configurator3d .configurator-panel {
  width: 300px;
  flex: 0 0 300px;
  overflow-y: auto;
  border-right: 1px solid #e3e7eb;
  padding: 0.75rem;
  background: #fff;
}

.alfa-configurator3d .configurator-panel h5 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6a7178;
  margin: 0 0 0.6rem;
}

.alfa-configurator3d .configurator-panel-hint { font-size: 0.78rem; color: #8a9199; margin: 0.4rem 0; }

.alfa-configurator3d .configurator-upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 92px;
  padding: 1rem 0.6rem;
  border: 2px dashed #b9c2cb;
  border-radius: 10px;
  background: #f7f9fb;
  color: #2f6db3;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.alfa-configurator3d .configurator-upload-btn svg { width: 22px; height: 22px; }

.alfa-configurator3d .configurator-upload-btn:hover { background: #eef4fa; border-color: #2f6db3; }
.alfa-configurator3d .configurator-upload-sub { font-size: 0.72rem; font-weight: 400; color: #8a929b; }

/* Empty My-Images state: a guiding line, never a blank box. */
.alfa-configurator3d .configurator-gallery-empty {
  grid-column: 1 / -1;
  padding: 0.9rem 0.4rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #8a929b;
  text-align: center;
}
.alfa-configurator3d .configurator-gallery.is-picking .configurator-gallery-empty { color: #2f6db3; }

/* Active drag-over: solid accent, tinted, gently lifted. */
.alfa-configurator3d .configurator-upload-btn.is-dropping {
  background: #e3eefb;
  border-color: #2f6db3;
  border-style: solid;
  transform: scale(1.01);
}

.alfa-configurator3d .configurator-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 0.4rem;
  margin-top: 0.5rem;
}

/* Timeline headers span the full width of the thumbnail grid. */
.alfa-configurator3d .configurator-gallery-month {
  grid-column: 1 / -1;
  font-size: 0.74rem;
  font-weight: 700;
  color: #2b3138;
  letter-spacing: 0.02em;
  margin: 0.5rem 0 0.1rem;
  padding-top: 0.4rem;
  border-top: 1px solid #eef1f4;
}
.alfa-configurator3d .configurator-gallery-month:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.alfa-configurator3d .configurator-gallery-day {
  grid-column: 1 / -1;
  font-size: 0.68rem;
  font-weight: 500;
  color: #8a929b;
  text-transform: capitalize;
  margin: 0.15rem 0 0.05rem;
}
/* Segmented radio toggle above the thumbnails: both options always visible,
   the active one filled. */
.alfa-configurator3d .configurator-gallery-sort {
  display: inline-flex;
  gap: 0;
  margin: 0.5rem 0 0.15rem;
  padding: 2px;
  background: #f1f4f7;
  border: 1px solid #d8dee4;
  border-radius: 999px;
}
.alfa-configurator3d .configurator-gallery-seg {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  border-radius: 999px;
  padding: 0.24rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.alfa-configurator3d .configurator-gallery-seg:hover { color: #2f6db3; }
.alfa-configurator3d .configurator-gallery-seg.is-active {
  color: #fff;
  background: #2f6db3;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.alfa-configurator3d .configurator-gallery-item {
  position: relative;
  border: 1px solid #e3e7eb;
  border-radius: 6px;
  padding: 0;
  background: #fff;
  cursor: grab;
  overflow: hidden;
  aspect-ratio: 1;
}

.alfa-configurator3d .configurator-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.alfa-configurator3d .configurator-gallery-item:hover { border-color: #2f6db3; }

.alfa-configurator3d .configurator-gallery-badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: #2f6db3;
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.15rem;
  text-align: center;
  padding: 0 0.2rem;
}

.configurator-drag-ghost {
  position: fixed;
  z-index: 2000;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  pointer-events: none;
  opacity: 0.9;
}

.alfa-configurator3d .configurator-stickers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 0.4rem;
}

.alfa-configurator3d .configurator-sticker {
  border: 1px solid #e3e7eb;
  border-radius: 6px;
  background: #fff;
  padding: 0.3rem;
  cursor: grab;
  aspect-ratio: 1;
}

.alfa-configurator3d .configurator-sticker img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.alfa-configurator3d .configurator-sticker:hover { border-color: #2f6db3; }

.alfa-configurator3d .configurator-opt-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.45rem 0;
  font-size: 0.8rem;
  color: #4a5158;
}

.alfa-configurator3d .configurator-opt-row input[type="range"] { flex: 1; }

/* Text style controls stay dimmed + inert until the frame has text. */
.alfa-configurator3d .configurator-opt-row.configurator-opt-gated {
  opacity: 0.4;
  pointer-events: none;
}

.alfa-configurator3d .configurator-opt-group { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }

.alfa-configurator3d .configurator-opt-btn {
  border: 1px solid #c9cfd6;
  background: #fff;
  border-radius: 5px;
  padding: 0.22rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: #4a5158;
}

.alfa-configurator3d .configurator-opt-btn.is-active { background: #2f6db3; border-color: #2f6db3; color: #fff; }
.alfa-configurator3d .configurator-opt-danger { color: #c0392b; border-color: #e4b6b0; margin-top: 0.6rem; }

/* Slot cards inside the Elements panel become full-width stacked rows. */
.alfa-configurator3d .configurator-panel .configurator-slots { display: block; }
.alfa-configurator3d .configurator-panel .configurator-slot { margin-bottom: 0.6rem; }

/* Preview also hides the rail/panel for the clean look. */
.alfa-configurator3d .configurator-overlay.is-preview .configurator-rail,
.alfa-configurator3d .configurator-overlay.is-preview .configurator-panel { display: none; }

/* Mobile: the panel drops under the stage; the rail turns horizontal. */
@media (max-width: 860px) {
  .alfa-configurator3d .configurator-body { flex-direction: column; }
  .alfa-configurator3d .configurator-body .configurator-stage { order: 1; min-height: 44vh; }
  .alfa-configurator3d .configurator-rail { order: 2; flex-direction: row; border-right: 0; border-top: 1px solid #e3e7eb; }
  .alfa-configurator3d .configurator-panel { order: 3; width: auto; flex: 0 0 auto; max-height: 34vh; border-right: 0; }
}

/* Studio: sticker chips in the settings row. */
.cfg3d-editor .cfg3d-sticker-chip { position: relative; display: inline-flex; }
.cfg3d-editor .cfg3d-sticker-chip img { width: 34px; height: 34px; object-fit: contain; border: 1px solid #d8dce1; border-radius: 5px; background: #fff; }
.cfg3d-editor .cfg3d-sticker-chip button { position: absolute; top: -7px; right: -7px; border: 0; background: #d9534f; color: #fff; border-radius: 50%; width: 15px; height: 15px; font-size: 10px; line-height: 1; cursor: pointer; padding: 0; }

/* v3.2 phase 2b: font dropdown with live previews + text mini editor */
.alfa-configurator3d .configurator-opt-text {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid #c9cfd6;
  border-radius: 6px;
  font-size: 0.85rem;
  margin: 0.3rem 0;
}

.alfa-configurator3d .configurator-font-dd { position: relative; flex: 1; }

.alfa-configurator3d .configurator-font-current {
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
}

.alfa-configurator3d .configurator-font-list {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #c9cfd6;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.16);
}

.alfa-configurator3d .configurator-font-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 0.45rem 0.6rem;
  font-size: 1.05rem;
  cursor: pointer;
}

.alfa-configurator3d .configurator-font-list button:hover { background: #eef4fa; }

/* v3.2 phase 2c: the studio mirrors the storefront layout */
.cfg3d-editor .cfg3d-body { display: flex; gap: 0; align-items: stretch; border: 1px solid #d8dce1; border-radius: 8px; overflow: hidden; }
.cfg3d-editor .cfg3d-body .cfg3d-stage { flex: 1 1 auto; border: 0; border-radius: 0; height: 480px; }
.cfg3d-editor .cfg3d-rail { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.5rem 0.4rem; border-right: 1px solid #e3e7eb; background: #fafbfc; }
.cfg3d-editor .cfg3d-rail button { width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; background: none; color: #4a5158; cursor: pointer; }
.cfg3d-editor .cfg3d-rail button:hover { background: #eef1f4; }
.cfg3d-editor .cfg3d-rail button.is-active { background: #2f6db3; border-color: #2f6db3; color: #fff; }
.cfg3d-editor .cfg3d-panel { width: 290px; flex: 0 0 290px; overflow-y: auto; border-right: 1px solid #e3e7eb; padding: 0.75rem; background: #fff; }
.cfg3d-editor .cfg3d-panel h5 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: #6a7178; margin: 0 0 0.6rem; }
.cfg3d-editor .cfg3d-panel-hint { font-size: 0.76rem; color: #8a9199; }
.cfg3d-editor [data-cfg3d-options] { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.cfg3d-editor [data-cfg3d-options] .cfg3d-float-label { width: 100%; }
.cfg3d-editor [data-cfg3d-options] .cfg3d-float-row2 { width: 100%; flex-wrap: wrap; }
.cfg3d-editor .cfg3d-lib-folder { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; font-weight: 600; color: #6a7178; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0.3rem; }

/* v3.2 phase 2d: sticker pack headings */
.alfa-configurator3d .configurator-sticker-group {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6a7178;
  margin: 0.6rem 0 0.25rem;
}

/* Buyer chooser: layout / photo / text inside an allowed container */
.alfa-configurator3d .configurator-chooser {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  min-width: 170px;
  background: #fff;
  border: 1px solid #c9cfd6;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  overflow: hidden;
}

.alfa-configurator3d .configurator-chooser button {
  border: 0;
  background: none;
  text-align: left;
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
  color: #2b3138;
  cursor: pointer;
}

.alfa-configurator3d .configurator-chooser button:hover { background: #eef4fa; color: #2f6db3; }

.alfa-configurator3d .configurator-gallery.is-picking { outline: 2px dashed #2f6db3; outline-offset: 3px; border-radius: 6px; }

/* Layouts panel: auto-rendered thumbnails */
.alfa-configurator3d .configurator-layouts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.alfa-configurator3d .configurator-layout-thumb {
  border: 1px solid #e3e7eb;
  border-radius: 6px;
  background: #fff;
  padding: 0.35rem;
  cursor: pointer;
  aspect-ratio: 10 / 7;
}

.alfa-configurator3d .configurator-layout-thumb:hover { border-color: #2f6db3; background: #f4f8fc; }
.alfa-configurator3d .configurator-layout-thumb svg { width: 100%; height: 100%; }
.alfa-configurator3d .configurator-layout-thumb rect.is-image { fill: #dbe4ee; stroke: #9db4cc; stroke-width: 2; }
.alfa-configurator3d .configurator-layout-thumb rect.is-text { fill: #efe3f5; stroke: #b58cc9; stroke-width: 2; }
.alfa-configurator3d .configurator-layout-thumb text { font-size: 9px; fill: #8e44ad; font-weight: 700; }
.alfa-configurator3d .configurator-apply-all { width: 100%; }

/* Elements tree (layers) */
.alfa-configurator3d .configurator-tree { margin-bottom: 0.7rem; }

.alfa-configurator3d .configurator-tree-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.2rem;
  border-radius: 5px;
}

.alfa-configurator3d .configurator-tree-row.is-selected { background: #e8f1fa; }

/* Re-parent drag & drop: grip in front of every row, page-level drop strip. */
.alfa-configurator3d .configurator-tree-grip {
  cursor: grab; user-select: none; opacity: 0.6; color: #7a8794;
  font-size: 0.85rem; line-height: 1; padding: 0 0.35rem 0 0.1rem;
}
.alfa-configurator3d .configurator-tree-row:hover .configurator-tree-grip { opacity: 1; color: #0e9488; }
.alfa-configurator3d .configurator-tree-empty {
  margin: 0.4rem 0; padding: 0.5rem 0.6rem; border: 1px dashed #d8d4cd;
  border-radius: 6px; font-size: 0.74rem; color: #7a8794;
}
.alfa-configurator3d .configurator-tree-grip:active { cursor: grabbing; }
.alfa-configurator3d .configurator-tree-outer {
  display: none; margin: 0.3rem 0; padding: 0.4rem 0.5rem;
  border: 1px dashed #94a3b8; border-radius: 6px;
  font-size: 0.72rem; color: #64748b; text-align: center;
}
.alfa-configurator3d .configurator-tree.is-treedrag .configurator-tree-outer { display: block; }
.alfa-configurator3d .configurator-tree-outer.is-over {
  border-color: #0e9488; color: #0e9488; background: rgba(14, 148, 136, 0.08);
}
.alfa-configurator3d .configurator-tree-row.is-dragging { opacity: 0.45; }
.alfa-configurator3d .configurator-tree-row.is-droptarget {
  outline: 2px solid #0e9488; outline-offset: -2px;
  border-radius: 6px; background: rgba(14, 148, 136, 0.08);
}
.alfa-configurator3d .configurator-tree-row.is-insert-before { box-shadow: 0 -2px 0 0 #0e9488; }
.alfa-configurator3d .configurator-tree-row.is-insert-after { box-shadow: 0 2px 0 0 #0e9488; }
.configurator-tree-ghost {
  position: fixed; z-index: 99999; pointer-events: none;
  padding: 0.2rem 0.55rem; font-size: 0.74rem; border-radius: 4px;
  background: #0e9488; color: #fff; opacity: 0.92; white-space: nowrap;
}

.alfa-configurator3d .configurator-tree-label {
  flex: 1;
  border: 0;
  background: none;
  text-align: left;
  font-size: 0.8rem;
  color: #2b3138;
  cursor: pointer;
  padding: 0.12rem 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alfa-configurator3d .configurator-tree-label:hover { color: #2f6db3; }
.alfa-configurator3d .configurator-tree-badge { font-size: 0.7rem; color: #8a9199; }
.alfa-configurator3d .configurator-tree-del { border: 0; background: none; color: #c0392b; cursor: pointer; font-size: 0.95rem; line-height: 1; }

/* Views: page strip + grid/list previews */
.alfa-configurator3d .configurator-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.alfa-configurator3d .configurator-main .configurator-stage { flex: 1 1 auto; }

.alfa-configurator3d .configurator-views-nav { display: inline-flex; gap: 0.25rem; }

.alfa-configurator3d .configurator-views-nav button {
  border: 1px solid #c9cfd6;
  background: #fff;
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
  color: #4a5158;
  display: inline-flex;
  align-items: center;
}

.alfa-configurator3d .configurator-views-nav button.is-active { background: #2f6db3; border-color: #2f6db3; color: #fff; }

/* The view/preview buttons name themselves, like every other button. */
.alfa-configurator3d .configurator-view-label { font-size: 0.72rem; line-height: 1; margin-left: 0.3rem; }
.alfa-configurator3d .configurator-views-nav button,
.alfa-configurator3d .configurator-preview-btn { display: inline-flex; align-items: center; }

.alfa-configurator3d .configurator-strip {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-top: 1px solid #e3e7eb;
  background: #fafbfc;
  overflow-x: auto;
}

.alfa-configurator3d .configurator-strip-thumb {
  border: 2px solid transparent;
  border-radius: 6px;
  background: #fff;
  padding: 0.2rem;
  cursor: pointer;
  text-align: center;
  flex: 0 0 auto;
}

.alfa-configurator3d .configurator-strip-thumb.is-active { border-color: #2f6db3; }
.alfa-configurator3d .configurator-strip-thumb canvas { display: block; border: 1px solid #e8ebee; border-radius: 3px; }
.alfa-configurator3d .configurator-strip-thumb span { font-size: 0.66rem; color: #6a7178; display: block; margin-top: 0.15rem; max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.alfa-configurator3d .configurator-views {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  background: #eef1f4;
  display: grid;
  gap: 1rem;
  align-content: start;
}

.alfa-configurator3d .configurator-views.is-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.alfa-configurator3d .configurator-views.is-list { grid-template-columns: minmax(0, 680px); justify-content: center; }

.alfa-configurator3d .configurator-view-card {
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  padding: 0.6rem;
}

.alfa-configurator3d .configurator-view-card canvas { width: 100%; height: auto; display: block; border: 1px solid #eceff2; border-radius: 4px; }

.alfa-configurator3d .configurator-view-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: #4a5158;
}

/* Preview mode hides the strip too. */
.alfa-configurator3d .configurator-overlay.is-preview .configurator-strip { display: none; }

/* Autofill modal + strip inserts */
.alfa-configurator3d .configurator-autofill-btn { width: 100%; margin-top: 0.4rem; }

.alfa-configurator3d .configurator-autofill-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(20, 24, 28, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.alfa-configurator3d .configurator-autofill-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.1rem;
  width: min(30rem, 92vw);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.alfa-configurator3d .configurator-autofill-opt {
  display: block;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.alfa-configurator3d .configurator-autofill-opt:has(input:checked) { border-color: #2f6db3; background: #f4f8fc; }
.alfa-configurator3d .configurator-autofill-opt strong { display: inline-block; margin-left: 0.3rem; }
.alfa-configurator3d .configurator-autofill-opt span { display: block; font-size: 0.78rem; color: #6a7178; margin-top: 0.2rem; }
.alfa-configurator3d .configurator-autofill-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.6rem; }
.alfa-configurator3d .configurator-opt-btn.is-primary { background: #2f6db3; border-color: #2f6db3; color: #fff; }

.alfa-configurator3d .configurator-strip-add {
  align-self: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px dashed #b9c2cb;
  border-radius: 50%;
  background: #fff;
  color: #2f6db3;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.alfa-configurator3d .configurator-strip-add:hover { border-color: #2f6db3; background: #eef4fa; }

/* Elements tree: compact rows, direct-edit affordances */
.configurator-tree-row { display: flex; align-items: center; gap: 0.3rem; padding: 0.12rem 0.25rem; border-radius: 5px; font-size: 0.78rem; line-height: 1.25; }
.configurator-tree-row:hover { background: rgba(47, 109, 179, 0.07); }
.configurator-tree-row.is-selected { background: rgba(47, 109, 179, 0.14); }
.configurator-tree-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; background: none; border: 0; padding: 0.1rem 0; cursor: pointer; font-size: inherit; color: inherit; }
.configurator-tree-add { background: none; border: 1px solid rgba(47, 109, 179, 0.35); border-radius: 4px; color: #2f6db3; font-size: 0.66rem; line-height: 1; padding: 0.14rem 0.28rem; cursor: pointer; }
.configurator-tree-add:hover { background: rgba(47, 109, 179, 0.12); }
.configurator-tree-add svg { display: block; width: 13px; height: 13px; }
.configurator-tree-rearrange svg { flex: none; vertical-align: -2px; margin-right: .3rem; }
.configurator-tree-del { background: none; border: 0; color: #b3372f; font-size: 0.85rem; line-height: 1; padding: 0 0.2rem; cursor: pointer; }
.configurator-tree-badge { font-size: 0.66rem; opacity: 0.8; display: inline-flex; align-items: center; }
.configurator-tree-badge svg { display: block; }
.configurator-tree-glyph { display: inline-flex; align-items: center; margin-right: 0.4rem; vertical-align: -2px; }
.configurator-tree-glyph svg { display: block; }
/* Studio lock toggle (locks module). Muted when open, amber when locked. */
.configurator-tree-lock { background: none; border: 0; padding: 0 0.2rem; cursor: pointer; color: #9aa2ab; display: inline-flex; align-items: center; }
.configurator-tree-lock:hover { color: #6b7280; }
.configurator-tree-lock.is-locked { color: #c8912a; }
.configurator-tree-lock svg { display: block; }
.configurator-bg-locked svg { flex: none; }
.configurator-tree-bgrow { border-bottom: 1px solid rgba(47, 109, 179, 0.12); margin-bottom: 0.15rem; padding-bottom: 0.18rem; }
.configurator-tree-bgrow .configurator-tree-label { display: flex; align-items: center; gap: 0.4rem; }
.configurator-tree-bgswatch { flex: none; width: 0.95rem; height: 0.95rem; border-radius: 3px; border: 1px solid rgba(20, 26, 34, 0.25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }
.configurator-tree-areabg { flex: none; width: 0.9rem; height: 0.9rem; border-radius: 3px; border: 1px solid rgba(20, 26, 34, 0.3); padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4); }
.configurator-pagebg-btn { width: 100%; margin-bottom: .5rem; }
.configurator-bg-back { background: none; border: 0; color: #2f6db3; font-size: .8rem; cursor: pointer; padding: 0 0 .4rem; }
.configurator-bg-back:hover { text-decoration: underline; }

/* The "+" fab on the selected frame: add a photo/text inside it */
.configurator-add-fab { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; border: 0; background: #2f6db3; color: #fff; font-size: 15px; line-height: 1; cursor: pointer; z-index: 6; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.configurator-add-fab:hover { background: #245689; }

/* Per-page action bar (labelled) */
.configurator-pagebar { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; padding: 0.45rem 0.5rem 0.1rem; }
.configurator-pagebar button { border: 1px solid #d5d9de; background: #f5f6f8; border-radius: 7px; padding: 0.32rem 0.65rem; font-size: 0.78rem; color: #2b3138; cursor: pointer; }
.configurator-pagebar button:hover { background: #e9edf2; border-color: #b9c2cc; }
.configurator-pagebar-sep { width: 1px; background: #d5d9de; margin: 0.15rem 0.2rem; }

/* Options drill-down categories */
.configurator-opt-cat { display: block; width: 100%; text-align: left; margin-bottom: 0.3rem; }
.configurator-opt-backrow { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }

/* Shape & mask grid */
.configurator-mask-grid { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.configurator-mask-thumb { width: 44px; height: 44px; padding: 2px; border: 1px solid #d5d9de; border-radius: 6px; background: #223; cursor: pointer; }
.configurator-mask-thumb img { width: 100%; height: 100%; object-fit: contain; }
.configurator-mask-thumb.is-active { border-color: #2f6db3; box-shadow: 0 0 0 2px rgba(47, 109, 179, 0.35); }
.configurator-opt-cat.is-open { background: rgba(47, 109, 179, 0.08); border-color: #2f6db3; }
.configurator-mask-thumb canvas { display: block; width: 100%; height: 100%; }
.configurator-opt-num { width: 4.2rem; padding: 0.2rem 0.3rem; border: 1px solid #d5d9de; border-radius: 5px; font-size: 0.78rem; }
.configurator-opt-colorbtn { width: 2rem; height: 1.9rem; border: 1px solid #d5d9de; border-radius: 5px; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5); }
.configurator-fabs { position: absolute; display: flex; flex-direction: row; gap: 4px; transform: translate(0, -100%); z-index: 6; }
.configurator-fab { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 0; border-radius: 7px; background: #2f6db3; color: #fff; cursor: pointer; padding: 3px 6px 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.configurator-fab:hover { background: #245689; }
.configurator-fab-glyph { font-size: 13px; line-height: 1; display: inline-flex; align-items: center; }
.configurator-fab-glyph svg { display: block; width: 15px; height: 15px; }
.configurator-opt-sizerow { display: inline-flex; align-items: center; gap: 0.3rem; }
.configurator-opt-dimlbl { font-size: 0.72rem; color: #6a7178; font-weight: 600; }
.configurator-opt-x { color: #98a0a8; font-size: 0.8rem; }
.configurator-fab-word { font-size: 8.5px; line-height: 1; letter-spacing: 0.02em; }
.configurator-opt-btn.is-disabled, .configurator-opt-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Backgrounds panel */
.configurator-bg-applyrow { display: flex; flex-direction: row; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: .78rem; color: #5f6a75; }
.configurator-bg-applyrow > span { flex: none; }
.configurator-bg-applyrow select { flex: 1; min-width: 0; border: 1px solid #d7dce2; border-radius: .5rem; padding: .35rem .5rem; font-size: .8rem; background: #fff; }
.configurator-bg-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; margin-bottom: .75rem; }
.configurator-bg-swatch { aspect-ratio: 1; border: 1px solid #d7dce2; border-radius: .5rem; cursor: pointer; padding: 0; transition: transform .12s ease; }
.configurator-bg-swatch:hover { transform: scale(1.12); }
.configurator-bg-gradrow { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.configurator-bg-gradrow input[type="color"] { width: 2.1rem; height: 2.1rem; border: 1px solid #d7dce2; border-radius: .5rem; padding: .1rem; background: #fff; cursor: pointer; }
.configurator-bg-gradrow select { border: 1px solid #d7dce2; border-radius: .5rem; padding: .3rem .4rem; font-size: .78rem; background: #fff; }
.configurator-bg-clear { width: 100%; }
.configurator-sticker-upload { display: flex; align-items: center; justify-content: center; gap: .35rem; margin-bottom: .6rem; font-size: .78rem; }

/* Final check modal */
.configurator-check { position: absolute; inset: 0; background: rgba(20, 26, 34, .45); display: flex; align-items: center; justify-content: center; z-index: 60; }
.configurator-check-card { background: #fff; border-radius: .9rem; padding: 1.25rem 1.4rem; width: min(30rem, 92%); max-height: 80%; overflow: auto; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.configurator-check-card h5 { margin: 0 0 .3rem; }
.configurator-check-list { display: flex; flex-direction: column; gap: .35rem; margin: .6rem 0 1rem; }
.configurator-check-row { text-align: left; border: 1px solid #e4d9c3; background: #fdf8ee; border-radius: .5rem; padding: .5rem .65rem; font-size: .82rem; cursor: pointer; }
.configurator-check-row:hover { border-color: #caa94f; }
.configurator-check-btns { display: flex; gap: .5rem; justify-content: flex-end; }
.configurator-upsell { border: 1px solid #cdd8ea; background: linear-gradient(180deg, #f6faff, #eef4fc); border-radius: .6rem; padding: .8rem .9rem; margin: .2rem 0 1rem; }
.configurator-upsell-title { display: block; font-size: .92rem; color: #24466f; margin-bottom: .25rem; }
.configurator-upsell-blurb { margin: 0 0 .6rem; font-size: .8rem; line-height: 1.4; color: #55606c; }
.configurator-upsell-add.is-added { background: #2e7d46; border-color: #2e7d46; cursor: default; }
.configurator-btn-primary { background: #2f66d0; border-color: #2f66d0; color: #fff; }
.configurator-btn-primary:hover { background: #2857b2; }
.configurator-autofill-pages { display: flex; align-items: center; gap: .4rem; margin-top: .35rem; font-size: .78rem; color: #5f6a75; }
.configurator-autofill-pages select { border: 1px solid #d7dce2; border-radius: .4rem; padding: .2rem .35rem; font-size: .78rem; background: #fff; }
.configurator-autofill-startrow { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .55rem; font-size: .82rem; color: #33404d; }
.configurator-autofill-startrow select { border: 1px solid #d7dce2; border-radius: .4rem; padding: .25rem .4rem; font-size: .8rem; background: #fff; }
.configurator-opt-duo { display: flex; align-items: center; gap: .4rem; flex: 1; }
.configurator-opt-duo input[type="range"] { flex: 1; min-width: 0; }
.configurator-opt-duo .configurator-opt-num { width: 3.6rem; flex: none; }
.configurator-rot-badge { position: absolute; z-index: 40; background: #1d2733; color: #fff; font-size: .72rem; font-weight: 600; padding: .15rem .45rem; border-radius: .4rem; pointer-events: none; }
.configurator-fabs { transform: translate(0, calc(-100% - 30px)); }

/* One selection menu: fabs + fit chips share the bar */
.configurator-fabs { align-items: flex-start; background: rgba(255, 255, 255, .92); border: 1px solid #d7dce2; border-radius: .6rem; padding: .25rem .35rem; box-shadow: 0 6px 18px rgba(20, 26, 34, .12); }
.configurator-fabs .configurator-fit-toolbar { position: static !important; transform: none !important; display: flex; align-items: center; gap: .25rem; margin-left: .45rem; padding-left: .45rem; border-left: 1px solid #e2e6ea; box-shadow: none; background: none; border-top: 0; border-right: 0; border-bottom: 0; border-radius: 0; }

/* Options panel polish: dropdown-cards, quiet buttons, one loud Remove */
.configurator-opt-card { border: 1px solid #dde3e9; border-radius: .55rem; margin-bottom: .45rem; background: #fff; overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.configurator-opt-card.is-open { border-color: #b9cbe0; box-shadow: 0 1px 4px rgba(20, 26, 34, .05); }
.configurator-opt-card .configurator-opt-cat { margin: 0; border: 0; border-radius: 0; background: #f7f9fb; padding: .5rem .65rem; font-weight: 600; font-size: .82rem; color: #33404d; cursor: pointer; }
.configurator-opt-card .configurator-opt-cat:hover { background: #eef3f8; }
.configurator-opt-card .configurator-opt-cat.is-open { background: #eef3f8; border-bottom: 1px solid #e3e9f0; color: #2f6db3; }
.configurator-opt-card-body { padding: .55rem .65rem .65rem; display: flex; flex-direction: column; gap: .45rem; }
.configurator-opt-card-body .configurator-opt-row { margin: 0; }

/* The two TOP-LEVEL cards (Options / Background) read a step louder than the
   nested category cards inside them. */
.configurator-opt-topcard { border-color: #cfd8e2; }
.configurator-opt-topcard > .configurator-opt-cat { font-size: .86rem; letter-spacing: .01em; }
.configurator-opt-topcard.is-open { border-color: #2f6db3; }
.configurator-opt-topcard.is-open > .configurator-opt-cat { background: #e9f1fa; color: #2f6db3; }
/* The adopted background editor drops its old panel chrome inside the card. */
.configurator-opt-topcard .configurator-panel-section { padding: 0; margin: 0; border: 0; }

/* quiet, consistent buttons */
.configurator-opt-btn { border: 1px solid #d7dce2; background: #fff; border-radius: .45rem; padding: .3rem .6rem; font-size: .78rem; color: #33404d; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.configurator-opt-btn:hover { border-color: #2f6db3; background: #f4f8fc; }
.configurator-opt-btn.is-active { border-color: #2f6db3; background: #eaf2fa; color: #2f6db3; }

/* ONE destructive action: full-width, clearly last */
.configurator-opt-danger { display: block; width: 100%; margin-top: .8rem; padding: .5rem .6rem; border-color: #e5c2c2; color: #b23a3a; background: #fff; }
.configurator-opt-danger:hover { border-color: #b23a3a; background: #fbf3f3; }

/* tree rearrange mode */
.configurator-tree-rearrange { display: block; width: 100%; margin-bottom: .45rem; border: 1px solid #d7dce2; background: #fff; border-radius: .45rem; padding: .3rem .6rem; font-size: .78rem; color: #33404d; cursor: pointer; }
.configurator-tree-rearrange.is-active { border-color: #2f6db3; background: #eaf2fa; color: #2f6db3; }
.configurator-tree-move { border: 1px solid #d7dce2; background: #fff; border-radius: .35rem; width: 1.5rem; height: 1.4rem; font-size: .7rem; line-height: 1; cursor: pointer; margin-left: .2rem; color: #33404d; }
.configurator-tree-move:hover:not(:disabled) { border-color: #2f6db3; color: #2f6db3; }
.configurator-tree-move:disabled { opacity: .35; cursor: default; }

/* The buyer works on the 3D canvas + tree + options; the flat per-area input
   list is redundant. Kept in the DOM (hidden): its file inputs still carry
   the uploads for the form submit. */
.configurator-slots { display: none !important; }

/* Tree + selected element's options share one tab */
.configurator-options-inline { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid #e6eaef; }

/* Backgrounds v2: gradient stops + angle */
.configurator-bg-grad { display: flex; flex-direction: column; gap: .45rem; margin-bottom: .6rem; }
.configurator-bg-stops { display: flex; flex-wrap: wrap; gap: .35rem; }
.configurator-bg-stop { position: relative; display: inline-flex; }
.configurator-bg-stop input[type="color"] { width: 2.1rem; height: 2.1rem; border: 1px solid #d7dce2; border-radius: .5rem; padding: .1rem; background: #fff; cursor: pointer; }
.configurator-bg-stop-del { position: absolute; top: -.4rem; right: -.4rem; width: 1.1rem; height: 1.1rem; border: 0; border-radius: 50%; background: #b23a3a; color: #fff; font-size: .7rem; line-height: 1; cursor: pointer; }
.configurator-bg-addstop { align-self: flex-start; }
.configurator-bg-anglerow { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: #5f6a75; }
.configurator-bg-anglerow input[type="range"] { flex: 1; min-width: 0; }
.configurator-bg-anglerow .configurator-opt-num { width: 3.4rem; }
.configurator-bg-gtyperow select { width: 100%; border: 1px solid #d7dce2; border-radius: .45rem; padding: .3rem .4rem; font-size: .78rem; background: #fff; }

/* Gradient stop bar (cssgradient.io-style position handles) */
.configurator-bg-bar { position: relative; height: 1.6rem; border: 1px solid #d7dce2; border-radius: .45rem; margin-bottom: .5rem; background-image: linear-gradient(90deg, #ffe9d2, #f7b6c8); }
.configurator-bg-handle { position: absolute; top: 50%; width: .9rem; height: .9rem; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(20,26,34,.35); cursor: ew-resize; }
.configurator-bg-allpages { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: #33404d; margin-bottom: .6rem; cursor: pointer; }
.configurator-bg-gradtoggle { margin-top: .4rem; }
/* In-panel live preview of the composed background (checkerboard shows through
   when opacity < 1). */
.configurator-bg-preview { height: 3rem; border-radius: .55rem; border: 1px solid #d7dce2; margin-bottom: .6rem; background-color: #fff; background-image: linear-gradient(45deg, #eceff3 25%, transparent 25%), linear-gradient(-45deg, #eceff3 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eceff3 75%), linear-gradient(-45deg, transparent 75%, #eceff3 75%); background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0; }
.configurator-bg-preview.is-empty { opacity: .5; }
/* "+" chip that adds a colour (solid swatches and gradient stops alike). */
.configurator-bg-addchip { display: inline-flex; align-items: center; justify-content: center; position: relative; color: #2f6db3; font-size: 1.1rem; font-weight: 700; background: #fff !important; border: 1px dashed #9db4d0; }
.configurator-bg-addchip:hover { border-color: #2f6db3; background: #f4f8fc !important; }
.configurator-bg-swatch.is-selected { outline: 3px solid #2f6db3; outline-offset: 1px; box-shadow: 0 0 0 1px #fff inset; }
.configurator-bg-swatch-tick { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #16324f; font-size: .85rem; font-weight: 700; text-shadow: 0 0 2px rgba(255,255,255,.9); }
.configurator-bg-stop-chip { width: 2.1rem; height: 2.1rem; border: 1px solid #d7dce2; border-radius: .5rem; padding: 0; cursor: pointer; }
/* Custom HSV colour picker popover */
.configurator-cp { position: fixed; z-index: 3000; width: 208px; background: #fff; border: 1px solid #d0d6de; border-radius: .7rem; box-shadow: 0 16px 44px rgba(16,26,38,.28); padding: .7rem; display: flex; flex-direction: column; gap: .55rem; }
.configurator-cp-sv { position: relative; height: 118px; border-radius: .45rem; cursor: crosshair; }
.configurator-cp-cursor { position: absolute; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px rgba(0,0,0,.4); pointer-events: none; }
.configurator-cp-hue { position: relative; height: 14px; border-radius: 7px; cursor: ew-resize; background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); }
.configurator-cp-huecursor { position: absolute; top: 50%; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px rgba(0,0,0,.4); pointer-events: none; }
.configurator-cp-row { display: flex; align-items: center; gap: .45rem; }
.configurator-cp-prev { flex: none; width: 1.8rem; height: 1.8rem; border-radius: .4rem; border: 1px solid #d7dce2; }
.configurator-cp-hex { flex: 1; min-width: 0; border: 1px solid #d7dce2; border-radius: .4rem; padding: .3rem .45rem; font-size: .8rem; font-family: ui-monospace, monospace; }
.configurator-cp-btns { display: flex; justify-content: flex-end; gap: .4rem; }
.configurator-bg-opacityrow input[type="range"] { flex: 1; min-width: 0; }
.configurator-bg-target { font-size: .78rem; color: #2f6db3; background: #eef4fc; border: 1px solid #cdd8ea; border-radius: .45rem; padding: .35rem .55rem; margin: 0 0 .55rem; }

/* Store-locked background: the buyer sees the note and every editing control
   is greyed out and inert. */
.configurator-bg-locked { display: flex; gap: .4rem; align-items: flex-start; font-size: .8rem; line-height: 1.35; color: #7a5a12; background: #fdf3d6; border: 1px solid #ecd28a; border-radius: .5rem; padding: .55rem .65rem; margin: 0 0 .7rem; }
/* Locked backgrounds need no CSS: the JS hides [data-configurator-bg-editor]
   as one unit and shows the message instead. */

/* Studio: options merged under the tree + captioned controls */
.cfg3d-options-inline { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid #e2e6ea; }
.cfg3d-float-capped { display: inline-flex; flex-direction: column; gap: .1rem; font-size: .68rem; color: #5f6a75; }
.cfg3d-float-capped > span { white-space: nowrap; }
.cfg3d-float-capped input, .cfg3d-float-capped select { font-size: .8rem; }

/* studio/properties: element name + per-frame buyer freedom (admin) */
.configurator-prop-card { display: flex; flex-direction: column; gap: .45rem; padding: .55rem .6rem; margin-bottom: .55rem; border: 1px solid #e3e0da; border-radius: .5rem; background: #faf9f7; }
.configurator-prop-row { display: flex; align-items: center; gap: .5rem; }
.configurator-prop-label { font-size: .72rem; color: #7a8794; min-width: 2.6rem; }
.configurator-prop-name { flex: 1; font-size: .8rem; padding: .3rem .45rem; border: 1px solid #d8d4cd; border-radius: .35rem; background: #fff; }
.configurator-prop-toggle { font-size: .74rem; text-align: left; padding: .35rem .5rem; border: 1px solid #d8d4cd; border-radius: .35rem; background: #fff; color: #7a8794; cursor: pointer; }
.configurator-prop-toggle.is-on { border-color: #2f6db3; color: #2f6db3; background: #eef4fb; }

/* studio/dimensions: bindings editor in the settings anchor (admin) */
.configurator-studio-settings { padding: .55rem .75rem; border-bottom: 1px solid #e3e0da; background: #faf9f7; }
.configurator-dims-desc { font-size: .72rem; color: #7a8794; margin: 0 0 .5rem; }
.configurator-dims-binding { border: 1px solid #e3e0da; border-radius: .5rem; background: #fff; padding: .5rem .6rem; margin-bottom: .5rem; max-width: 30rem; }
.configurator-dims-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.configurator-dims-field { flex: 1; font-size: .78rem; padding: .25rem .4rem; }
.configurator-dims-remove { border: none; background: none; color: #c0392b; font-size: 1rem; cursor: pointer; }
.configurator-dims-row { display: flex; gap: .45rem; align-items: center; margin-bottom: .3rem; }
.configurator-dims-row > span { flex: 1; font-size: .74rem; color: #4c5560; }
.configurator-dims-num { width: 4.2rem; font-size: .76rem; padding: .2rem .3rem; }
.configurator-upsell-blurb { width: 100%; max-width: 30rem; font-size: .78rem; padding: .3rem .45rem; border: 1px solid #d8d4cd; border-radius: .35rem; background: #fff; margin-top: .35rem; resize: vertical; }

/* studio/pages: admin page CRUD; buyer flex controls hide in the studio */
.alfa-configurator3d--admin [data-configurator-page-add],
.alfa-configurator3d--admin [data-configurator-page-del],
.alfa-configurator3d--admin [data-configurator-bar-addpage],
.alfa-configurator3d--admin [data-configurator-bar-duplicate],
.alfa-configurator3d--admin [data-configurator-bar-delpage],
.alfa-configurator3d--admin .configurator-strip-add { display: none; }
.configurator-studio-pagesctl { display: inline-flex; gap: .3rem; margin-left: .5rem; }

/* studio/libraries: shared sticker library grid (admin) */
.configurator-lib-grid { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; max-width: 34rem; }
.configurator-lib-cell { width: 3.2rem; height: 3.2rem; padding: .25rem; border: 2px solid #d8d4cd; border-radius: .45rem; background: #fff; cursor: pointer; opacity: .55; }
.configurator-lib-cell img { max-width: 100%; max-height: 100%; object-fit: contain; }
.configurator-lib-cell.is-on { border-color: #2f6db3; opacity: 1; }
.configurator-lib-note { font-size: .72rem; color: #2e7d32; margin-left: .4rem; }

/* studio/assets: the "Page asset" rail panel (admin) */
.configurator-pageasset-hint { font-size: .72rem; color: #7a8794; margin: 0 0 .6rem; }
.configurator-pageasset-current-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #9aa3ac; margin: .6rem 0 .3rem; }
.configurator-pageasset-current { display: flex; align-items: center; gap: .5rem; }
.configurator-pageasset-grid { display: flex; flex-wrap: wrap; gap: .45rem; }
.configurator-pageasset-cell { width: 4.6rem; height: 3.6rem; padding: .2rem; border: 2px solid #d8d4cd; border-radius: .45rem; background: #fff; cursor: pointer; overflow: hidden; }
.configurator-pageasset-cell img { max-width: 100%; max-height: 100%; object-fit: contain; }
.configurator-pageasset-cell.is-on, .configurator-pageasset-cell.is-current { border-color: #2f6db3; }
.configurator-pageasset-model { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .58rem; color: #4c5560; word-break: break-all; }
.configurator-pageasset-cube { font-size: 1.1rem; color: #b58a2b; }
.configurator-pageasset-badge { font-size: .68rem; color: #2f6db3; background: #eef4fb; border-radius: .3rem; padding: .12rem .4rem; }
.configurator-pageasset-none { font-size: .74rem; color: #9aa3ac; }
.configurator-pageasset-note { font-size: .72rem; color: #c0392b; margin-left: .4rem; }

/* custom area (layouts panel, admin) + layout visibility + view row */
.configurator-customarea { display: flex; align-items: center; gap: .4rem; padding: .45rem .5rem; margin-bottom: .6rem; border: 1px dashed #c9c4bb; border-radius: .5rem; background: #faf9f7; }
.configurator-customarea-label { font-size: .72rem; color: #7a8794; margin-right: .2rem; }
.configurator-customarea-lock { border: 1px solid #d8d4cd; border-radius: .35rem; background: #fff; cursor: pointer; font-size: .85rem; padding: .2rem .4rem; margin-left: auto; }
.configurator-customarea-lock.is-locked { border-color: #b58a2b; background: #fdf6e7; }
.configurator-layout-thumb { position: relative; }
.configurator-layout-eye { position: absolute; top: .2rem; right: .2rem; width: 1.15rem; height: 1.15rem; line-height: 1.1rem; text-align: center; font-size: .7rem; border-radius: 50%; background: #e7e4de; color: #9aa3ac; cursor: pointer; }
.configurator-layout-eye.is-on { background: #2f6db3; color: #fff; }
.configurator-pageasset-view { display: flex; align-items: center; gap: .45rem; font-size: .76rem; color: #4c5560; margin: .5rem 0; cursor: pointer; }
.configurator-prop-check { cursor: pointer; font-size: .76rem; color: #4c5560; }
.configurator-prop-subhead { margin-top: .2rem; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #7a8794; }
.configurator-prop-parent { flex: 1; min-width: 0; font-size: .76rem; padding: .25rem .3rem; border: 1px solid #d8d4cd; border-radius: .35rem; background: #fff; color: #333; }
