.fb3d-panel {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  background: #faf8f3;
}

.fb3d-panel h3 {
  margin-bottom: 0.35rem;
  font-size: 1.45rem;
}

.fb3d-panel__intro {
  margin-bottom: 0.55rem;
  font-size: 0.96rem;
  line-height: 1.35;
}

.fb3d-existing-note {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #d8c79b;
  border-radius: 10px;
  background: #fff4d6;
  color: #5f4c12;
}

.fb3d-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 0.85rem;
}

.fb3d-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fb3d-field span {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
}

.fb3d-field--wide {
  grid-column: 1 / -1;
}

.fb3d-field input,
.fb3d-field select,
.fb3d-field textarea {
  padding: 0.55rem 0.65rem;
  border: 1px solid #cfc7bb;
  border-radius: 8px;
  background: #fff;
  font-size: 0.94rem;
}

.fb3d-field__hint {
  color: #746f66;
  line-height: 1.25;
  font-size: 0.78rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  transform: translateY(-2px);
  transition: opacity 0.18s ease, max-height 0.18s ease, margin-top 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.fb3d-field:hover .fb3d-field__hint,
.fb3d-field:focus-within .fb3d-field__hint {
  opacity: 1;
  max-height: 3.5rem;
  margin-top: 0.1rem;
  transform: translateY(0);
}

.fb3d-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.15rem;
  font-size: 0.92rem;
}

.fb3d-face-slots {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  margin-top: 1rem;
}

.fb3d-face-slot {
  padding: 0.85rem;
  border: 1px solid #ddd5c9;
  border-radius: 12px;
  background: #fffdf8;
}

.fb3d-face-slot--inactive {
  display: none;
}

.fb3d-face-slot__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.fb3d-face-slot__header > strong {
  display: inline-block;
  padding-top: 0.2rem;
  font-size: 1rem;
}

.fb3d-face-slot__header .fb3d-field {
  flex: 1 1 170px;
}

.fb3d-face-slot__previews {
  display: grid;
  gap: 0.7rem;
}

.fb3d-preview {
  margin-top: 0.85rem;
}

.fb3d-preview__help {
  margin: 0.5rem 0 0;
  color: #5f5b53;
  font-size: 0.9rem;
}

.fb3d-preview--lithophane {
  padding-top: 0.75rem;
  border-top: 1px solid #e4ddd2;
}

.fb3d-preview img {
  display: block;
  max-width: 320px;
  margin-top: 0.75rem;
  border-radius: 10px;
  border: 1px solid #d9d9d9;
}

.fb3d-preview__visual {
  position: relative;
  display: inline-block;
}

.fb3d-preview__visual img {
  margin-top: 0.75rem;
}

.fb3d-preview--lithophane .fb3d-preview__visual img {
  background: #fff;
  transition: padding 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.fb3d-preview--frame-none .fb3d-preview__visual img {
  padding: 0;
  border-width: 1px;
  border-color: #d9d9d9;
  box-shadow: none;
  background: #fff;
}

.fb3d-preview--frame-slim .fb3d-preview__visual img {
  padding: 0.45rem;
  border-width: 2px;
  border-color: #a89573;
  background: linear-gradient(180deg, #f7f0e2 0%, #ede2cf 100%);
  box-shadow: 0 4px 14px rgba(102, 84, 53, 0.12);
}

.fb3d-preview--frame-classic .fb3d-preview__visual img {
  padding: 0.8rem;
  border-width: 3px;
  border-color: #826744;
  background: linear-gradient(180deg, #f4ead6 0%, #e5d2b6 100%);
  box-shadow: 0 8px 18px rgba(92, 68, 36, 0.18);
}

.fb3d-preview--stand-none .fb3d-preview__visual {
  margin-bottom: 0;
}

.fb3d-preview--stand-narrow_tab .fb3d-preview__visual,
.fb3d-preview--stand-wide_tab .fb3d-preview__visual {
  margin-bottom: 0.7rem;
}

.fb3d-preview--stand-narrow_tab .fb3d-preview__visual::after,
.fb3d-preview--stand-wide_tab .fb3d-preview__visual::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: -0.15rem;
  height: 0.7rem;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #c6b08e 0%, #a89069 100%);
  box-shadow: 0 3px 8px rgba(75, 56, 31, 0.15);
}

.fb3d-preview--stand-narrow_tab .fb3d-preview__visual::after {
  width: 22%;
}

.fb3d-preview--stand-wide_tab .fb3d-preview__visual::after {
  width: 38%;
}

@media (max-width: 767px) {
  .fb3d-face-slot__header {
    flex-direction: column;
  }

  .fb3d-preview img {
    max-width: 100%;
  }
}
