.shelf-showcase { min-width: 0; width: 100%; margin: 0; position: relative; }
.shelf-showcase[hidden], .shelf-editor [hidden] { display: none; }
.shelf-showcase .shelf-preview { display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: hidden; color: #43382e; }
.profile-showcase .shelf-edit { position: absolute; inset: auto 12px 4px auto; padding: 6px 8px; border: 1px solid #bca98d; border-radius: 5px; background: #fff9ed; font-size: 11px; box-shadow: none; transform: scale(calc(1 / var(--showcase-scale, 1))); transform-origin: bottom right; white-space: nowrap; }
.is-arranging .shelf-edit { visibility: hidden; }
.shelf-stage { position: relative; display: block; height: 180px; padding: 0 14px; margin-bottom: 74px; box-sizing: border-box; }
.shelf-spines { position: relative; display: block; height: 180px; transform-origin: top left; }
.shelf-stage::after { content: ''; position: absolute; top: 100%; left: -2.5%; right: -2.5%; height: 74px; background: url('/static/shelf.png') center -94px / 100% 240px no-repeat; pointer-events: none; }
.shelf-preview .shelf-stage { overflow: clip visible; }
.shelf-showcase .shelf-book, .shelf-editor .shelf-book, .shelf-magnifier .shelf-book { position: absolute; display: block; padding: 0; margin: 0; border: 0; background: transparent; border-radius: 0; color: inherit; box-shadow: none; line-height: 0; pointer-events: none; }
.shelf-book img { display: block; height: 100%; width: 100%; max-width: none; pointer-events: none; user-select: none; }
.shelf-book:focus-visible { outline: 3px solid #8853c9; outline-offset: 2px; }
.shelf-missing { display: flex; writing-mode: vertical-rl; justify-content: center; gap: 10px; height: 180px; width: 100%; padding: 6px; box-sizing: border-box; background: #544367; color: white; border: 2px solid #30223b; font-size: 12px; line-height: 1.4; }
.shelf-missing small { font-size: 9px; opacity: .75; }
.shelf-editor { box-sizing: border-box; margin: auto; width: min(850px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 24px; overflow-y: auto; border: 2px solid #302832; border-radius: 16px; background: #fcf8f1; color: #302832; }
.shelf-editor::backdrop { background: #20182799; backdrop-filter: blur(5px); }
.shelf-editor header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.shelf-editor header small { font-size: 9px; letter-spacing: .13em; color: #8b735d; }
.shelf-editor h3 { font-size: 28px; margin: 6px 0 0; }
.shelf-scroll { overflow-x: auto; padding-bottom: 16px; }
.shelf-scroll .shelf-stage { width: max-content; min-width: 100%; touch-action: pan-y; }
.shelf-editor .shelf-book { cursor: grab; touch-action: none; }
.shelf-book[aria-pressed="true"] { outline: 3px solid #8853c9; outline-offset: 2px; }
.shelf-editor button:not(.shelf-book), .shelf-editor select { min-height: 40px; padding: 8px 12px; border: 1px solid #c5b5a4; border-radius: 7px; background: white; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.shelf-editor button:disabled { opacity: .4; cursor: default; }
.shelf-editor button:focus-visible, .shelf-preview:focus-visible { outline: 3px solid #8853c9; outline-offset: 3px; }
.shelf-selection { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 14px; }
.shelf-selection a { color: #7441ad; font-size: 12px; }
.shelf-hint { font-size: 12px; line-height: 1.6; color: #807164; }
.shelf-arrange { display: flex; gap: 6px; }
.shelf-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 22px; }
.shelf-add label { grid-column: 1 / -1; font-size: 12px; font-weight: 700; }
.shelf-add select { min-width: 0; }
.shelf-editor footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.shelf-editor [data-save] { background: #ead8ff !important; border-color: #a07cbd !important; font-weight: 750 !important; }
.shelf-editor [data-status] { font-size: 12px; color: #8d3a31; }
.shelf-editor [data-status]:empty { display: none; }
.shelf-magnifier { --magnifier-background: #fcf8f1; }
@media (max-width: 600px) { .shelf-editor { padding: 16px; } }
