.jewelry-stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}
.jewelry-library {
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #d8ccba;
  border-radius: 7px;
  background: #fffaf2;
  font-size: .86rem;
}
.jewelry-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  flex-wrap: wrap;
}
.jewelry-library-head label { display: inline-flex; align-items: center; gap: 7px; }
.jewelry-library-head select {
  max-width: 100%;
  padding: 4px 6px;
  border: 1px solid #cfc5b4;
  border-radius: 5px;
  background: #fffdf7;
}
.jewelry-library p { color: var(--muted); margin: 5px 0; }
.jewelry-library p[role=status]:empty { display: none; }
.jewelry-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(108px,100%),1fr));
  gap: 6px;
}
.jewelry-cards button {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  padding: 5px;
  border: 1px solid #d7cbbb;
  border-radius: 6px;
  background: #f5eee1;
  cursor: grab;
}
.jewelry-cards button:hover { border-color: var(--moss); background: #e7ebdf; }
.jewelry-cards button:active { cursor: grabbing; }
.jewelry-cards svg { width: 48px; height: 31px; pointer-events: none; }
.jewelry-cards strong { line-height: 1.25; }
.jewelry-cards small { color: var(--muted); font-variant-numeric: tabular-nums; }
.jewelry-placed { margin-top: 6px; }
.jewelry-placed summary { cursor: pointer; }
.jewelry-placed ul { list-style: none; margin: 5px 0; padding: 0; }
.jewelry-placed li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  flex-wrap: wrap;
  padding: 4px 0;
  border-bottom: 1px solid #e9e0d2;
}
.jewelry-placed li div { display: flex; gap: 4px; }
.box-scene [data-jewelry-item] { cursor: grab; }
.box-scene[data-jewelry-dragging] { cursor: grabbing; }
.jewelry-stage .box-scene { min-height: 0; height: clamp(340px, 55svh, 680px); }
.box-viewer:has(.jewelry-library:not([hidden])) .jewelry-stage { flex: 0 0 auto; }
.box-viewer:has(.jewelry-library:not([hidden])) .jewelry-stage .box-scene {
  flex: 0 0 auto;
  height: clamp(290px, 46svh, 540px);
}
.box-viewer:has(.jewelry-stage) #jewelry-library-toggle[aria-expanded=true] {
  color: var(--white);
  background: var(--moss);
}
@media (max-width: 750px) {
  .jewelry-stage .box-scene { height: max(270px, 42svh); }
}
.box-settings:has(+ .box-viewer .jewelry-stage) .wood-sample {
  grid-template-columns: minmax(0,1fr);
  gap: 4px;
  align-content: start;
}
.box-settings:has(+ .box-viewer .jewelry-stage) .wood-sample img { width: 100%; height: 36px; }
.box-settings:has(+ .box-viewer .jewelry-stage) .wood-sample span { padding-left: 0; }
.box-settings:has(+ .box-viewer .jewelry-stage) .wood-sample small { line-height: 1.3; }
