/* Load after Pane's app.css. All artwork is local PNG; existing note behavior is retained. */
.bookshelf.wizard-shelf {
  display: block;
  position: relative;
  isolation: isolate;
  max-width: 100%;
  margin: 4px 0 28px;
  padding: 0 0 9px;
  border: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-color: #8b7553 transparent;
  scrollbar-width: thin;
}
.wizard-shelf .shelf-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: max-content;
  min-width: 100%;
  padding: 26px 10px 35px;
  min-height: 305px;
}
.wizard-shelf .shelf-track::after {
  content: '';
  position: absolute;
  z-index: -1;
  bottom: 0;
  left: 0;
  right: 0;
  height: 42px;
  background: url('assets/wizard-shelf-walnut.png') no-repeat center center / cover;
}
.wizard-shelf .spines {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  flex: 0 0 auto;
  gap: 4px;
  min-width: 0;
  padding: 0 3px;
}
.wizard-shelf .bookend {
  flex: 0 0 auto;
  display: block;
  width: 148px;
  height: 224px;
  border: 0;
  border-radius: 0;
  background: none;
  pointer-events: none;
}
.wizard-shelf .bookend-right { width: 150px; height: 210px; margin-left: 3px; transform: translateY(13px); }
.wizard-shelf .bookend img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.wizard-shelf .spine {
  position: relative;
  flex: 0 0 var(--wizard-w, 46px);
  width: var(--wizard-w, 46px);
  height: var(--wizard-h, 216px);
  min-width: 32px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent !important;
  color: var(--wizard-ink, #f4dfb3) !important;
  box-shadow: none;
  transform: rotate(var(--wizard-tilt, 0deg));
  transform-origin: center bottom;
  transition: transform 180ms ease, filter 180ms ease;
  outline-offset: 3px;
}
.wizard-shelf .spine-art {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
}
.wizard-shelf .spine-title {
  position: absolute;
  z-index: 1;
  top: 32%;
  bottom: 25%;
  left: 50%;
  right: auto;
  width: 1.1em;
  height: auto;
  max-height: none;
  margin: 0;
  display: block;
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font: 400 var(--wizard-title-size, 13.5px)/1.05 Georgia, 'Times New Roman', serif;
  letter-spacing: .015em;
  text-shadow: 0 1px 2px #100b05a6;
}
.wizard-shelf .spine[data-cover='parchment'] .spine-title,
.wizard-shelf .spine[data-cover='ochre'] .spine-title { text-shadow: 0 1px 1px #f1dbb347; }
.wizard-shelf .spine[data-title-direction='horizontal'] .spine-title {
  left: 9%;
  right: 9%;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: horizontal-tb;
  transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: min(var(--wizard-title-size, 13.5px), 13px);
  line-height: 1.2;
}
.wizard-shelf .spine .spine-progress {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 21%;
  color: inherit;
  font: 10px/1 var(--font-ui, sans-serif);
  text-align: center;
  opacity: .95;
}
.wizard-shelf .spine:hover {
  transform: translateY(-7px) rotate(var(--wizard-tilt, 0deg));
  filter: brightness(1.12);
}
.wizard-shelf .spine.is-open {
  transform: translateY(-11px);
  outline: 1.5px solid #d9bd78;
  outline-offset: 2px;
  filter: brightness(1.12) drop-shadow(0 0 7px #d6b769b3);
  box-shadow: none;
}
.wizard-shelf .spine:focus-visible { outline: 2px solid var(--accent, #b5cbd5); }
:root[data-theme='light'] .wizard-shelf .spine.is-open { outline-color: #8a5f28; filter: brightness(1.03) drop-shadow(0 0 4px #7c592e99); }
@media (max-width: 640px) {
  .wizard-shelf .shelf-track { padding-left: 5px; padding-right: 5px; min-height: 276px; gap: 3px; }
  .wizard-shelf .bookend { width: 101px; height: 175px; }
  .wizard-shelf .bookend-right { width: 105px; height: 163px; transform: translateY(10px); }
}
@media (prefers-reduced-motion: reduce) {
  .wizard-shelf .spine { transition: none; }
  .bookshelf.wizard-shelf { scroll-behavior: auto; }
}
