.cb-editor {
  max-width: 1380px;
  margin: 32px auto;
  padding: 24px;
  font:
    16px/1.5 system-ui,
    sans-serif;
  color: #252c27;
  background: #faf9f6;
}
.cb-editor h1 {
  font:
    500 32px/1.2 Georgia,
    serif;
  margin: 0 0 12px;
}
.cb-editor h2 {
  font:
    600 19px/1.3 system-ui,
    sans-serif;
  margin: 12px 0;
}
.cb-editor p {
  margin: 8px 0 18px;
}
.cb-editor__columns {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}
.cb-editor__preview {
  position: sticky;
  top: 16px;
  background: white;
  border: 1px solid #deded5;
  border-radius: 12px;
  overflow: hidden;
}
.cb-editor [ref="previewMain"] {
  width: 100%;
  height: 620px;
  min-height: 420px;
  position: relative;
  display: block;
  container-type: size;
}
.cb-editor .charm-builder__preview-charm-img {
  /* Large or generously padded pictures can exceed the necklace canvas.
     The editor camera fits them; the theme's image cap would shrink the
     picture independently and move its calculated hook point. */
  max-width: none;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.cb-editor .charm-builder__preview-charm-img:focus,
.cb-editor .charm-builder__preview-charm-img[data-selected] {
  outline: 1px dashed #426650;
}
.cb-editor label {
  display: block;
  margin: 12px 0;
  font-weight: 600;
}
.cb-editor select,
.cb-editor input,
.cb-editor textarea {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #aeb8ae;
  background: white;
  color: #252c27;
  border-radius: 6px;
  font: inherit;
  box-sizing: border-box;
}
.cb-editor button {
  padding: 10px 16px;
  border: 1px solid #426650;
  background: white;
  color: #284232;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
  margin: 4px 8px 4px 0;
}
.cb-editor button[data-copy] {
  background: #284232;
  color: white;
}
.cb-editor button:disabled {
  opacity: 0.45;
  cursor: default;
}
.cb-editor__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.cb-editor__status {
  min-height: 24px;
}
.cb-editor__hint {
  padding: 0 20px;
}
.cb-editor textarea {
  font-size: 12px;
}
@media (max-width: 800px) {
  .cb-editor {
    padding: 16px;
    margin: 12px auto;
  }
  .cb-editor__columns {
    grid-template-columns: 1fr;
  }
  .cb-editor__preview {
    position: relative;
    top: 0;
  }
  .cb-editor [ref="previewMain"] {
    height: 440px;
    min-height: 300px;
  }
}

.cb-editor button.cb-editor__resize {
  position: absolute;
  z-index: 20;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  background: #284232;
  color: white;
  cursor: nwse-resize;
  touch-action: none;
  border-radius: 5px;
}

.cb-editor__header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.cb-editor .cb-editor__eyebrow {
  color: #526a59;
  font-size: 11px;
  letter-spacing: 0.14em;
  margin-bottom: 12px;
}
.cb-editor nav {
  display: flex;
  align-items: start;
  gap: 8px;
}
.cb-editor nav a {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #d4dacf;
  border-radius: 6px;
  color: #284232;
  text-decoration: none;
}
.cb-editor nav a[aria-current] {
  color: white;
  background: #284232;
}
.cb-editor__card {
  background: #fff;
  border: 1px solid #deded5;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  min-width: 0;
}
.cb-editor .cb-editor__small {
  font-size: 13px;
  color: #546054;
}
.cb-editor button[data-download] {
  background: #284232;
  color: white;
}
.cb-editor input[type="range"] {
  padding: 10px 0;
  border: 0;
  accent-color: #284232;
  background: transparent;
  cursor: pointer;
}
.cb-editor__field {
  min-width: 0;
}
.cb-editor__field-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cb-editor__field-heading label {
  font-size: 14px;
  flex: 1;
}
.cb-editor__help {
  position: relative;
}
.cb-editor__help summary {
  border: 1px solid #778575;
  border-radius: 50%;
  color: #284232;
  width: 24px;
  height: 24px;
  text-align: center;
  cursor: help;
  list-style: none;
}
.cb-editor__help summary::-webkit-details-marker {
  display: none;
}
.cb-editor__help p {
  position: absolute;
  z-index: 25;
  right: 0;
  top: 26px;
  padding: 14px;
  margin: 0;
  width: min(250px, 70vw);
  font-size: 13px;
  font-weight: normal;
  color: white;
  background: #284232;
  border-radius: 6px;
  box-shadow: 0 4px 12px #0002;
}
.cb-editor__help:not([open]):hover p,
.cb-editor__help:not([open]):focus-within p {
  display: block;
}
.cb-editor details {
  margin: 12px 0;
}
.cb-editor details summary {
  cursor: pointer;
}
.cb-editor__history {
  max-height: 280px;
  overflow: auto;
  padding-left: 22px;
  font-size: 13px;
}
.cb-editor__history li {
  padding: 6px 0;
}
.cb-editor__status {
  font-size: 13px;
  color: #345540;
}
.cb-editor__error {
  font-size: 13px;
  color: #a32121;
  overflow-wrap: anywhere;
}
.cb-editor input[aria-invalid] {
  border-color: #a32121;
}
.cb-editor :focus-visible {
  outline: 2px solid #426650;
  outline-offset: 3px;
}
@media (max-width: 800px) {
  .cb-editor__card {
    padding: 16px;
  }
  .cb-editor [ref="previewMain"] {
    height: 390px;
  }
}

/* Keep the controls beside the picture while the settings column scrolls. */
.cb-editor__preview {
  top: calc(var(--header-height, 0px) + 12px);
}
.cb-editor [ref="previewMain"] {
  height: clamp(280px, calc(100dvh - var(--header-height, 0px) - 355px), 600px);
  min-height: 280px;
  overflow: hidden;
}
.cb-editor__view-tools,
.cb-editor__move-tools,
.cb-editor__undo-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cb-editor__view-tools {
  padding: 10px 14px;
  border-bottom: 1px solid #e5e8df;
}
.cb-editor__view-tools label,
.cb-editor__move-tools label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}
.cb-editor__view-tools select,
.cb-editor__move-tools select {
  width: auto;
  padding: 7px;
}
.cb-editor__view-tools button,
.cb-editor__move-tools button,
.cb-editor__undo-tools button {
  margin: 0;
}
.cb-editor .cb-editor__check input {
  width: 17px;
  height: 17px;
  accent-color: #284232;
}
.cb-editor__position-tools {
  padding: 12px 16px;
  border-top: 1px solid #e5e8df;
  background: #fbfcf8;
}
.cb-editor__piece-buttons {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px;
}
.cb-editor__piece-buttons button {
  flex: 0 0 auto;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  font-size: 12px;
  padding: 7px 10px;
}
.cb-editor__piece-buttons button[aria-pressed="true"] {
  background: #284232;
  color: white;
}
.cb-editor__position-tools .cb-editor__small {
  margin: 6px 0;
  font-size: 12px;
}
.cb-editor__position-tools .cb-editor__hint {
  margin: 8px 0 0;
  padding: 0;
  font-size: 12px;
  color: #546054;
}
.cb-editor__move-tools {
  margin: 10px 0;
  justify-content: space-between;
}
.cb-editor__move-tools [role="group"] {
  display: flex;
  gap: 4px;
}
.cb-editor__move-tools button {
  min-width: 38px;
  min-height: 38px;
  padding: 6px;
  font-size: 20px;
  line-height: 1;
}
.cb-editor__undo-tools button {
  font-size: 13px;
  padding: 7px 12px;
}
.cb-editor__guide {
  position: absolute;
  z-index: 19;
  pointer-events: none;
  opacity: 0.65;
}
.cb-editor__guide--x {
  top: 0;
  bottom: 0;
  border-left: 1px dashed #426650;
}
.cb-editor__guide--y {
  left: 0;
  right: 0;
  border-top: 1px dashed #426650;
}
@media (max-width: 800px) {
  .cb-editor__preview {
    top: 0;
  }
  .cb-editor [ref="previewMain"] {
    height: 360px;
  }
  .cb-editor__move-tools {
    justify-content: flex-start;
    gap: 14px;
  }
}
.cb-editor__empty {
  padding: 40px 24px;
  text-align: center;
}
.cb-editor__position-tools p:empty {
  display: none;
}
@media (pointer: coarse) {
  .cb-editor__move-tools button {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Focused workspace: advanced inputs stay folded until they are needed. */
.cb-editor [hidden] {
  display: none !important;
}
.cb-editor__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cb-editor button.cb-editor__primary {
  background: #284232;
  color: white;
}
.cb-editor button.cb-editor__danger {
  color: #8a3d2e;
  border-color: #dac4bc;
  font-size: 13px;
}
.cb-editor__cycle {
  border-block: 1px solid #e5e8df;
  padding: 12px 0;
  margin: 16px 0;
}
.cb-editor__card > summary {
  font-weight: 600;
}
.cb-editor__card > summary span {
  display: block;
  margin-left: 18px;
  font-weight: normal;
}
.cb-editor__dialog {
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 24px;
  border: 1px solid #deded5;
  border-radius: 16px;
  color: #252c27;
  background: #faf9f6;
  box-shadow: 0 16px 70px #0003;
  box-sizing: border-box;
}
.cb-editor__dialog::backdrop {
  background: #15251e99;
  backdrop-filter: blur(3px);
}
.cb-editor__dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cb-editor__dialog-heading button {
  font-size: 24px;
  padding: 0 12px;
}
.cb-editor__dialog h3 {
  font:
    600 22px/1.3 system-ui,
    sans-serif;
}
.cb-editor__dialog li {
  margin-block: 10px;
}
.cb-editor__review {
  max-height: 42dvh;
  overflow: auto;
  border: 1px solid #deded5;
  background: white;
  padding: 14px;
  border-radius: 8px;
}
.cb-editor__wizard-design {
  padding: 16px;
  margin-block: 16px;
  background: white;
  border: 1px solid #deded5;
  border-radius: 10px;
}
.cb-editor__wizard-picture {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid #e5e8df;
  padding-block: 12px;
}
.cb-editor__wizard-picture img {
  width: 90px;
  height: 110px;
  object-fit: contain;
  background: repeating-conic-gradient(#f1f0eb 0% 25%, white 0% 50%) 50% / 16px
    16px;
  border-radius: 8px;
}
.cb-editor__wizard-picture label {
  flex: 1;
  min-width: 180px;
  font-size: 13px;
}
.cb-editor button.cb-editor__pivot {
  position: absolute;
  z-index: 22;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  transform: translate(-50%, -50%);
  border: 2px solid white;
  border-radius: 9px;
  background: #2254c7;
  color: white;
  display: grid;
  place-items: center;
  box-shadow:
    0 0 0 1px #173782,
    0 2px 6px #0005;
  cursor: crosshair;
  touch-action: none;
}
.cb-editor__pivot svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.cb-editor__pivot-centre {
  fill: currentColor;
  stroke: none;
}
.cb-editor button.cb-editor__pivot:hover {
  background: #163d98;
}
.cb-editor button.cb-editor__pivot:focus-visible {
  outline: 3px solid #2254c7;
  outline-offset: 3px;
}
@media (max-width: 800px) {
  .cb-editor__header {
    gap: 10px;
  }
  .cb-editor__actions {
    width: 100%;
  }
  .cb-editor__actions button {
    flex: 1;
  }
  .cb-editor__dialog {
    padding: 16px;
  }
}

/* Three-pane workspace: piece list · preview · settings for the selection.
   The shop's header and footer are not needed on these two editor pages. */
body:has(.cb-editor) .shopify-section-group-header-group,
body:has(.cb-editor) .shopify-section-group-footer-group {
  display: none;
}
.cb-editor {
  --header-height: 0px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}
.cb-editor__header {
  align-items: center;
  margin-bottom: 16px;
}
.cb-editor h1 {
  font-size: 26px;
  margin: 0;
}
.cb-editor .cb-editor__title .cb-editor__eyebrow {
  margin: 0 0 4px;
}
.cb-editor nav {
  align-items: center;
}
.cb-editor .cb-editor__pill {
  margin: 0 4px 0 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: #eef1ea;
  color: #345540;
}
.cb-editor .cb-editor__pill[data-pending] {
  background: #fff1d6;
  color: #6d4300;
}
.cb-editor__columns {
  grid-template-columns: 290px minmax(0, 1fr) 360px;
  gap: 20px;
}
.cb-editor__library {
  position: sticky;
  top: 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 24px);
  padding: 16px;
  background: white;
  border: 1px solid #deded5;
  border-radius: 12px;
  box-sizing: border-box;
  min-width: 0;
}
.cb-editor__library-head h2 {
  margin: 0 0 10px;
}
.cb-editor input[type="search"] {
  padding: 8px 10px;
}
.cb-editor__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}
.cb-editor .cb-editor__filters button {
  margin: 0;
  padding: 4px 10px;
  border-color: #c9d1c6;
  border-radius: 999px;
  font-size: 12px;
}
.cb-editor .cb-editor__filters button[aria-pressed="true"] {
  background: #284232;
  border-color: #284232;
  color: white;
}
.cb-editor__library-list {
  position: relative;
  flex: 1;
  min-height: 120px;
  overflow: auto;
  margin: 0 -6px;
  padding: 0;
  list-style: none;
}
.cb-editor .cb-editor__library-list button {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 0 0 2px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: #252c27;
  text-align: left;
}
.cb-editor .cb-editor__library-list button:hover {
  background: #f2f4ee;
}
.cb-editor .cb-editor__library-list button[aria-current] {
  background: #e7efe4;
  border-color: #426650;
}
.cb-editor__library-list img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 6px;
  background: #f6f5f0;
}
.cb-editor__entry-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cb-editor__entry-text strong {
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
}
.cb-editor__entry-detail {
  font-size: 12px;
  line-height: 1.3;
  color: #546054;
}
.cb-editor__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cb-editor__badges:empty {
  display: none;
}
.cb-editor__badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.cb-editor__badge--edited {
  background: #e3ecfb;
  color: #1f4f9a;
}
.cb-editor__badge--measure {
  background: #fff1d6;
  color: #6d4300;
}
.cb-editor__badge--differs {
  background: #fbe3de;
  color: #8a3d2e;
}
.cb-editor__badge--new {
  background: #dff1e4;
  color: #22603a;
}
.cb-editor .cb-editor__library-note {
  margin: 10px 0 0;
  font-size: 12px;
}
.cb-editor__preview {
  top: 12px;
}
.cb-editor [ref="previewMain"] {
  height: clamp(320px, calc(100dvh - 290px), 760px);
}
.cb-editor .cb-editor__cycle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto 0 0;
  padding: 0;
  border: 0;
}
.cb-editor .cb-editor__cycle button {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}
.cb-editor .cb-editor__cycle p {
  min-width: 72px;
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.cb-editor__on-necklace {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cb-editor__on-necklace .cb-editor__piece-buttons {
  flex: 1;
}
.cb-editor .cb-editor__on-necklace > button {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
}
.cb-editor__move-tools .cb-editor__undo-tools {
  margin-left: auto;
}
.cb-editor__inspector {
  min-width: 0;
}
.cb-editor [data-inspector] h2 {
  margin: 0;
  font-size: 20px;
}
.cb-editor [data-inspector] .cb-editor__eyebrow {
  margin: 0 0 4px;
}
.cb-editor [data-inspector] [data-selected-info] {
  margin: 4px 0 12px;
}
.cb-editor__field-group {
  grid-column: 1 / -1;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e8df;
}
.cb-editor__field-group:first-child {
  margin-top: 4px;
}
.cb-editor__field-group h3 {
  margin: 0;
  font:
    600 12px/1.4 system-ui,
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3d5545;
}
.cb-editor .cb-editor__field-group p {
  margin: 2px 0 0;
  font-size: 12px;
}
.cb-editor .cb-editor__notice {
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid #ecd29a;
  border-radius: 8px;
  background: #fff8e8;
  font-size: 13px;
}
.cb-editor .cb-editor__notice p {
  margin: 0 0 8px;
}
.cb-editor .cb-editor__notice button {
  margin: 0;
  padding: 6px 12px;
  font-size: 13px;
}
.cb-editor__inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e8df;
}
.cb-editor .cb-editor__inspector-actions button {
  margin: 0;
}
@media (max-width: 1280px) {
  .cb-editor__columns {
    grid-template-columns: 250px minmax(0, 1fr) 320px;
  }
}
/* Narrower screens: the list sits above the preview as a short scrolling grid. */
@media (max-width: 1100px) {
  .cb-editor__columns {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .cb-editor__library {
    grid-column: 1 / -1;
    position: relative;
    top: 0;
    max-height: none;
  }
  .cb-editor__library-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    align-content: start;
    max-height: 250px;
    flex: none;
  }
}
@media (max-width: 800px) {
  .cb-editor {
    padding: 12px 12px 32px;
  }
  .cb-editor__columns {
    grid-template-columns: 1fr;
  }
  .cb-editor__library-list {
    max-height: 210px;
  }
  .cb-editor .cb-editor__pill {
    flex-basis: 100%;
    text-align: center;
  }
  .cb-editor__move-tools .cb-editor__undo-tools {
    margin-left: 0;
  }
}
/* One setting per row: slider beside its exact number. */
.cb-editor__fields {
  grid-template-columns: 1fr;
}
.cb-editor__field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  grid-template-areas:
    "heading heading"
    "slider number";
  align-items: center;
  column-gap: 12px;
  margin-top: 10px;
}
.cb-editor__field .cb-editor__field-heading {
  grid-area: heading;
}
.cb-editor__field input[type="number"] {
  grid-area: number;
  padding: 6px 8px;
}
.cb-editor__field input[type="range"] {
  grid-area: slider;
}
.cb-editor__field:not(:has(input[type="range"])) input[type="number"] {
  grid-column: 1 / -1;
  width: 140px;
}
.cb-editor__field-heading label {
  margin: 0;
}
.cb-editor__help summary {
  width: 20px;
  height: 20px;
  font-size: 12px;
  line-height: 20px;
}
.cb-editor [data-picture-label] {
  font-size: 14px;
}
.cb-editor [data-picture-label] select {
  margin-top: 4px;
  padding: 7px 10px;
}
@media (max-width: 800px) {
  .cb-editor__actions {
    flex-wrap: wrap;
  }
}
/* Leave room for the move controls above Shopify's preview bar. */
.cb-editor [ref="previewMain"] {
  height: clamp(300px, calc(100dvh - 360px), 740px);
}
/* See-through hook marker: outline only, so the thin loop shows through.
   The 34px button keeps the same grab area. */
.cb-editor button.cb-editor__pivot,
.cb-editor button.cb-editor__pivot:hover {
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
.cb-editor__pivot svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke-linecap: round;
}
.cb-editor__pivot-halo {
  stroke: #ffffff;
  stroke-width: 4;
  opacity: 0.85;
}
.cb-editor__pivot-mark {
  stroke: #2254c7;
  stroke-width: 1.75;
}
.cb-editor button.cb-editor__pivot:hover .cb-editor__pivot-mark,
.cb-editor button.cb-editor__pivot:focus-visible .cb-editor__pivot-mark {
  stroke: #163d98;
  stroke-width: 2.25;
}

/* Necklace + charm steppers above the preview. */
.cb-editor .cb-editor__view-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
}
.cb-editor__steppers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-width: 0;
}
.cb-editor__stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.cb-editor__stepper-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3d5545;
  margin-right: 4px;
}
.cb-editor .cb-editor__stepper button {
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  flex: none;
}
.cb-editor .cb-editor__stepper select {
  width: 200px;
  max-width: 34vw;
  padding: 6px 8px;
  font-size: 14px;
  text-overflow: ellipsis;
}
.cb-editor__view-options {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cb-editor .cb-editor__view-options button {
  margin: 0;
  padding: 6px 12px;
}
.cb-editor .cb-editor__position {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: #546054;
  font-variant-numeric: tabular-nums;
}
.cb-editor__add-charm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.cb-editor .cb-editor__add-charm label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  white-space: nowrap;
}
.cb-editor .cb-editor__add-charm select {
  width: 220px;
  padding: 6px 8px;
  font-size: 13px;
}
.cb-editor .cb-editor__add-charm button {
  margin: 0;
  padding: 6px 12px;
  font-size: 13px;
}

/* Remove (×) on each list picture; removed pieces listed below. */
.cb-editor__library-list li {
  position: relative;
}
.cb-editor .cb-editor__library-list button.cb-editor__entry-remove {
  position: absolute;
  top: 2px;
  left: 2px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 1px solid #dac4bc;
  border-radius: 50%;
  background: #fff;
  color: #8a3d2e;
  font-size: 15px;
  line-height: 1;
  opacity: 0.85;
  box-shadow: 0 1px 3px #0002;
}
.cb-editor .cb-editor__library-list button.cb-editor__entry-remove:hover,
.cb-editor .cb-editor__library-list button.cb-editor__entry-remove:focus-visible {
  opacity: 1;
  background: #8a3d2e;
  border-color: #8a3d2e;
  color: #fff;
}
.cb-editor .cb-editor__removed {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px solid #e5e8df;
  font-size: 13px;
}
.cb-editor__removed ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.cb-editor__removed li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  color: #6b6f68;
  text-decoration: line-through;
}
.cb-editor .cb-editor__removed li button {
  margin: 0;
  padding: 3px 10px;
  font-size: 12px;
  text-decoration: none;
}

/* Tidier settings column: messages only when present, quieter extras. */
.cb-editor__messages p:empty {
  display: none;
}
.cb-editor .cb-editor__messages p {
  margin: 0 0 8px;
}
.cb-editor .cb-editor__card--quiet {
  padding: 12px 16px;
  background: #fbfcf8;
}
.cb-editor .cb-editor__card--quiet > summary,
.cb-editor [data-product-tools] > details > summary {
  font-weight: 600;
  font-size: 14px;
}
.cb-editor [data-product-tools] > details {
  margin: 0;
}
.cb-editor [data-product-operations]:empty {
  display: none;
}
.cb-editor [data-draft-panel] [data-count] {
  margin: 8px 0;
}

/* Desktop: a fixed-height workspace. The page itself does not scroll; the
   piece list and the settings column scroll on their own, and the preview
   always fills the middle. */
@media (min-width: 1101px) {
  .cb-editor {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding-bottom: 12px;
    box-sizing: border-box;
    overflow: hidden;
  }
  .cb-editor.cb-editor--preview-bar {
    padding-bottom: 70px;
  }
  .cb-editor__header {
    flex: none;
    flex-wrap: nowrap;
  }
  .cb-editor__columns {
    flex: 1;
    min-height: 0;
    align-items: stretch;
  }
  .cb-editor__library,
  .cb-editor__preview {
    position: relative;
    top: 0;
    max-height: none;
    min-height: 0;
  }
  .cb-editor__preview {
    display: flex;
    flex-direction: column;
  }
  .cb-editor__preview [ref="previewMain"] {
    flex: 1;
    height: auto;
    min-height: 220px;
  }
  .cb-editor__position-tools {
    flex: none;
  }
  .cb-editor__inspector {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-gutter: stable;
  }
  .cb-editor__library-list {
    overscroll-behavior: contain;
  }
}
@media (max-width: 800px) {
  .cb-editor .cb-editor__view-tools {
    grid-template-columns: 1fr;
  }
  .cb-editor .cb-editor__stepper select {
    width: auto;
    flex: 1;
    max-width: none;
  }
  .cb-editor__stepper {
    width: 100%;
  }
  .cb-editor__add-charm {
    flex-wrap: wrap;
  }
  .cb-editor .cb-editor__add-charm select {
    width: auto;
    flex: 1;
  }
  .cb-editor .cb-editor__library-list button.cb-editor__entry-remove {
    width: 28px;
    height: 28px;
  }
}
.cb-editor .cb-editor__library-list button.cb-editor__entry-remove {
  grid-template-columns: none;
  top: 3px;
  left: 40px;
  text-align: center;
}
/* The preview fills the remaining height, so a message appearing under it
   must not change that height (it would rescale the picture mid-drag).
   Keep a one-line slot for preview messages. */
@media (min-width: 1101px) {
  .cb-editor .cb-editor__position-tools p[data-preview-status] {
    display: block;
    min-height: 1.5em;
    margin: 4px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
