.room-experience{position:relative}
.shelving-cart{position:absolute;z-index:35;left:43%;bottom:5%;width:clamp(92px,13.5%,156px);padding:0;border:0;background:none;cursor:pointer;filter:drop-shadow(0 5px 5px #241b2933);transition:transform .2s}
.shelving-tray.is-drop-target{border:2px dashed var(--brand-blue,#0069fb)}
.shelving-tray.is-drop-target #shelvingHint{display:block!important;color:var(--brand-blue,#0069fb);font-weight:600}
.shelving-selected{flex-wrap:wrap}.shelving-selected button{min-height:36px}
@media(max-width:760px){.shelving-selected>strong{flex-basis:100%}}
.trial-room-view:not(.trial-room-spatial) .shelving-cart{left:calc(50% + 110px);bottom:14%;width:112px}.trial-room-view:not(.trial-room-spatial)>.shelving-tray{bottom:85px;z-index:45}
.trial-room-view .library-grid-book{-webkit-touch-callout:none;user-select:none}
.room[data-space="immersive"] .shelving-cart{left:47%;bottom:7%;width:clamp(180px,18%,224px)}
.room[data-space="grand"] .shelving-cart{left:47%;bottom:7%;width:clamp(246px,24.5%,312px)}
.room[data-space="immersive"][data-size="large"] .shelving-cart{width:clamp(212px,20%,264px)}
.room[data-space="immersive"][data-size="grand"] .shelving-cart{width:clamp(246px,22.5%,296px)}
.shelving-cart:hover{transform:translateY(-3px)}
.shelving-cart svg{display:block;width:100%;height:auto;filter:drop-shadow(0 0 4px #fff4cf) drop-shadow(0 0 12px #efc46dcc);transition:filter .2s}
.shelving-cart:hover svg,.shelving-cart:focus-visible svg{filter:drop-shadow(0 0 6px #fff8e5) drop-shadow(0 0 18px #efc46d)}
.shelving-cart-label{display:block;width:max-content;max-width:180px;position:relative;left:50%;transform:translateX(-50%);padding:7px 12px;border:1px solid #cbbd99;border-radius:12px;background:#fff6e6;color:#4d493c;font-size:11px;font-weight:600;line-height:1.5;box-shadow:0 3px 12px #34261a22}
.shelving-cart:focus-visible,.shelving-book:focus-visible{outline:3px solid #af793c;outline-offset:4px}
.shelf-detail-viewport .shelving-cart{display:none}
.shelving-tray{position:absolute;z-index:40;bottom:12px;left:12px;right:12px;margin:0;padding:8px 12px;border:1px solid var(--accent-border,#c4e7fc);border-top:3px solid var(--brand-blue,#0069fb);border-radius:12px;background:#fff;color:var(--brand-navy,#001c60);box-shadow:0 -3px 22px #001c6026}
.shelving-tray-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
.shelving-tray-heading>div{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.shelving-tray-heading strong{font-size:14px;color:var(--brand-blue,#0069fb);white-space:nowrap}
.shelving-tray p{margin:0;font-size:11px;line-height:1.3;color:var(--muted,#7a8799)}
.shelving-tray-heading>.icon-button{width:28px;height:28px;min-width:28px;padding:0;color:var(--brand-blue,#0069fb);background:var(--accent-soft,#edf8ff);border-radius:7px}
.shelving-books{display:flex;flex-wrap:nowrap;gap:14px;min-width:0;max-width:100%;overflow-x:auto;padding:6px 2px 2px;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:var(--brand-blue,#0069fb) #edf8ff;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.shelving-book{flex:0 0 56px;width:56px;min-width:56px;max-width:56px;border:0;background:transparent;padding:0;color:var(--brand-navy,#001c60);text-align:left;cursor:grab;scroll-snap-align:start}
.shelving-book .cover-art{position:relative;width:56px;height:72px;overflow:hidden;border-radius:2px 5px 5px 2px;box-shadow:2px 2px 5px #001c6026}
.shelving-book .cover-art img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.shelving-book .cover-kicker{font-size:4px}
.shelving-book .cover-title{font-size:8px}
.shelving-book .cover-author{font-size:4px}
.shelving-book .cover-symbol{font-size:18px}
.shelving-book>strong{display:block;margin-top:4px;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shelving-book>small{display:none}
.shelving-book.dragging{opacity:.45}
.shelving-books{touch-action:pan-y pinch-zoom;user-select:none;-webkit-user-select:none}
.shelving-book img{-webkit-user-drag:none}
.shelving-book{touch-action:none;-webkit-touch-callout:none}
.shelving-drag-ghost{position:fixed!important;z-index:10000;transform:translate(-50%,-50%);pointer-events:none!important;opacity:.95;filter:drop-shadow(0 5px 8px #001c6044)}
.shelving-books.is-scrolling{scroll-snap-type:none;cursor:grabbing}
.shelving-books.is-scrolling .shelving-book{cursor:grabbing}
:is(.phone-preview,.app-preview) .shelving-tray{bottom:80px;left:8px;right:8px;padding:6px 8px}
:is(.phone-preview,.app-preview) .shelving-tray-heading{gap:6px}
:is(.phone-preview,.app-preview) .shelving-tray-heading strong{font-size:12px}
:is(.phone-preview,.app-preview) .shelving-tray p{display:none}
:is(.phone-preview,.app-preview) .shelving-books{gap:12px;scrollbar-width:none}
:is(.phone-preview,.app-preview) .shelving-books::-webkit-scrollbar{display:none;width:0;height:0}
:is(.phone-preview,.app-preview) .shelving-book{flex:0 0 48px;width:48px;min-width:48px;max-width:48px}
:is(.phone-preview,.app-preview) .shelving-book .cover-art{width:48px;height:68px}
.shelving-badge,.shelving-mobile-badge{position:static;flex-shrink:0;min-width:18px;height:18px;padding:0 5px;border-radius:20px;background:var(--brand-blue,#0069fb)!important;color:#fff!important;font-size:10px;line-height:18px;text-align:center}
.shelving-badge{margin-left:auto}
.library-nav-icon{display:flex;align-items:center;justify-content:center;gap:5px;min-height:20px}
[data-tab="library"] .icon{color:var(--brand-blue,#0069fb)}
.shelving-celebration{position:absolute;z-index:45;left:50%;top:65%;transform:translate(-50%,-50%);width:max-content;max-width:90%;padding:22px 28px;text-align:center;border:2px solid #84b8ff;border-radius:20px;color:#1646a3;background:linear-gradient(135deg,#e4f3ff 0%,#f0e4ff 48%,#ffe8d9 100%);box-shadow:0 10px 40px #0069fb33;pointer-events:none;animation:shelving-yay .6s ease-out;overflow:hidden}
.shelving-celebration:before,.shelving-celebration:after{content:'';position:absolute;inset:8px;pointer-events:none;background:radial-gradient(circle at 6% 18%,#0085fb 0 3px,transparent 4px),radial-gradient(circle at 94% 75%,#ef7294 0 4px,transparent 5px),radial-gradient(circle at 12% 84%,#a77ce8 0 3px,transparent 4px),radial-gradient(circle at 88% 15%,#efb539 0 3px,transparent 4px)}
.shelving-celebration:after{inset:16px;transform:rotate(9deg);opacity:.65}
.shelving-celebration span,.shelving-celebration strong,.shelving-celebration small{display:block}
.shelving-celebration span{color:#a05bd4;text-shadow:-2px 2px #ffd36e;font-size:30px;letter-spacing:12px;animation:shelving-sparkle 1s ease-in-out infinite alternate}
.shelving-celebration strong{font:22px Georgia,serif;margin:8px 0}.shelving-celebration small{font-size:12px}
@keyframes shelving-yay{from{opacity:0;transform:translate(-50%,-40%) scale(.8)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}
@keyframes shelving-sparkle{to{opacity:.6;transform:scale(1.12)}}
@media(max-width:700px){.shelving-tray{bottom:8px;left:8px;right:8px;padding:6px 8px}.shelving-tray-heading{gap:6px}.shelving-tray-heading strong{font-size:12px}.shelving-tray p{display:none}.shelving-books{gap:12px}.shelving-book{flex-basis:48px}.shelving-book .cover-art{width:48px;height:68px}.shelving-cart-label{font-size:10px;max-width:165px}.shelving-celebration strong{font-size:18px}}
@media(prefers-reduced-motion:reduce){.shelving-celebration,.shelving-celebration span{animation:none}.shelving-cart,.shelving-cart svg{transition:none}}
@media(max-width:700px){.shelving-books{scrollbar-width:none}.shelving-books::-webkit-scrollbar{display:none;width:0;height:0}.shelving-book{flex:0 0 48px;width:48px;min-width:48px;max-width:48px}}
.shelving-cart[hidden],.shelving-tray[hidden],.shelving-celebration[hidden],.shelving-badge[hidden],.shelving-mobile-badge[hidden]{display:none!important}
.room#room .arranged-shelf{justify-content:flex-start;gap:.8%;padding-left:3%;padding-right:3%;overflow:visible;--book-width:calc(var(--slot-width)*3)}
.room#room .arranged-shelf>.shelf-book{width:var(--book-width);flex:0 0 var(--book-width);height:auto!important;max-height:86%;aspect-ratio:2/3;border-right:2px solid #e6dcc6;border-radius:2px 3px 2px 1px}
.room#room .arranged-shelf>.shelf-book.angled{width:var(--slot-width);flex-basis:var(--slot-width);aspect-ratio:2/9;border:0;background:transparent;box-shadow:none;isolation:auto;perspective:350px}
.room#room .arranged-shelf>.shelf-book.angled:before{inset:2% 0 0 4%;width:10%;background:linear-gradient(90deg,#0008,var(--cover),#fff3);box-shadow:1px 0 1px #0007;border-radius:2px;z-index:5}
.room#room .arranged-shelf>.shelf-book.angled .cover-art{width:300%;transform:rotateY(70deg);transform-origin:3% center;box-shadow:2px 2px 3px #0007;border-right:3px solid #e6dcc6;border-radius:2px;outline:none}
.room#room .arranged-shelf .cover-art img{object-fit:cover;image-rendering:auto;background:var(--cover)}
.room#room .arranged-shelf .book-pile{width:calc(var(--slot-width)*2.8);flex:0 0 calc(var(--slot-width)*2.8);height:82%;gap:2%;justify-content:flex-start;overflow:visible;margin-inline:1.5%}
.room#room .arranged-shelf .book-pile>.shelf-book.stacked{height:calc(5%*var(--thickness,1))!important;flex:0 0 calc(5%*var(--thickness,1));width:100%;border-radius:2px;overflow:visible;box-shadow:1px 2px 2px #0007;border:0;border-bottom:1px solid #0007;transform:none}
.room#room .arranged-shelf .book-pile>.shelf-book.stacked:nth-child(even){width:96%;align-self:center}
.room#room .arranged-shelf .stacked:before{inset:15% 2% 15% 3%;background:repeating-linear-gradient(0deg,#d9cbb0 0 1px,#f3ead7 1px 2px);box-shadow:0 -2px 0 var(--cover),0 2px 0 var(--cover);z-index:0}
.room#room .arranged-shelf .stacked .spine-art{background:linear-gradient(90deg,#0004,transparent 9%,#fff1),var(--cover);width:94%;height:50%;top:30%;padding:0 4%;z-index:1;box-shadow:none}
.room#room .arranged-shelf .stacked .spine-art strong{font-size:clamp(4px,.5cqw,8px)!important;text-overflow:ellipsis;overflow:hidden;max-width:100%}
.room#room .arranged-shelf .stacked .spine-art span{display:none}
.room#room .arranged-shelf .flat-cover{position:absolute;left:0;right:0;top:-25%;height:40%;transform:skewX(-18deg);transform-origin:bottom left;overflow:hidden;border:1px solid var(--cover);z-index:2;pointer-events:none}
.room#room .arranged-shelf .flat-cover .cover-art{border:0;outline:0;padding:0}
.room#room .arranged-shelf .flat-cover .cover-art img{display:block;object-fit:cover}
.room#room .arranged-shelf .flat-cover .cover-art>span,.room#room .arranged-shelf .flat-cover .cover-art>strong{display:none}
.room#room .arranged-shelf .shelf-decoration{width:13%;max-width:13%;flex:0 0 13%}
@media(prefers-reduced-motion:reduce){.room#room .shelf-book{transition:none}}
.nook-tooltip.has-book-cover{display:flex;align-items:center;gap:12px;padding:12px;min-height:138px}
.nook-tooltip.has-book-cover[hidden]{display:none}
.tooltip-cover{width:76px;height:114px;flex:0 0 76px;overflow:hidden;border-radius:2px 4px 4px 2px;box-shadow:2px 3px 8px #0005}
.tooltip-cover .cover-art{outline:none;padding:8px 5px}
.tooltip-cover .cover-art img{object-fit:contain;background:var(--cover)}
.tooltip-cover .cover-title{font-size:10px;line-height:1.2;letter-spacing:0}
.tooltip-cover .cover-symbol{font-size:24px}
.tooltip-cover .cover-kicker{display:none}
.tooltip-cover .cover-author{font-size:5px;letter-spacing:.3px}
.tooltip-copy{min-width:0}

/* Rounded cover cards with shared sizing across all bookshelf rows. */
.room#room .arranged-shelf.cover-showcase{display:block;padding:0 12px 1px!important;overflow:visible;container-type:size;--showcase-gap:clamp(3px,3.4cqw,13px);--showcase-unit:calc((100cqw - var(--showcase-gap-count,0)*var(--showcase-gap))/var(--showcase-total-weight,1));--showcase-regular-width:min(73cqh,var(--showcase-unit))}
.room#room .cover-showcase:has(>.showcase-arrangement>.showcase-angled-run:only-child){--showcase-regular-width:min(66cqh,calc(var(--showcase-unit)*.9))}
.room#room .cover-showcase .showcase-arrangement{display:grid;grid-template-columns:var(--showcase-columns,1fr);align-items:end;gap:var(--showcase-gap);width:100%;height:100%}
.room#room .cover-showcase .shelf-book:not(.stacked){width:100%;min-width:0;max-width:none;height:auto!important;max-height:none;aspect-ratio:3/4;padding:0;border:0;border-radius:min(7px,calc(var(--showcase-regular-width)*.09));background:var(--cover);box-shadow:2px 2px 5px #0006;perspective:none;isolation:isolate;transform:none;overflow:hidden}
.room#room .cover-showcase .showcase-arrangement>.shelf-book:not(.stacked){width:var(--showcase-regular-width);justify-self:center;z-index:var(--showcase-order,1)}
.room#room .cover-showcase .showcase-angled-run{display:flex;align-items:flex-end;justify-content:space-between;min-width:0;z-index:var(--showcase-order,1)}
.room#room .cover-showcase .showcase-angled-run>.shelf-book{width:var(--showcase-regular-width);flex:0 0 var(--showcase-regular-width);z-index:var(--showcase-order,1)}
.room#room .cover-showcase .showcase-angled-run>.shelf-book+.shelf-book{margin-left:calc((var(--run-weight)*var(--showcase-unit) - var(--run-count)*var(--showcase-regular-width))/max(1,var(--run-count) - 1))}
.room#room .cover-showcase .showcase-angled-run:has(.shelf-book:hover),.room#room .cover-showcase .showcase-angled-run:focus-within{z-index:20}
.room#room .cover-showcase .shelf-book:not(.stacked):before{display:none}
.room#room .cover-showcase .shelf-book:not(.stacked) .cover-art{width:100%;height:100%;transform:none;outline:0;border:0;border-radius:inherit;box-shadow:none;background:var(--cover)}
.room#room .cover-showcase .shelf-book:not(.stacked) .cover-art img{object-fit:cover;border-radius:inherit}
.room#room .cover-showcase>.shelf-book.angled .cover-art{transform:none;box-shadow:none}
.room#room .cover-showcase .shelf-book.angled{transform:perspective(600px) rotateY(-14deg) skewY(-2deg);transform-origin:left bottom}
.room#room .cover-showcase .showcase-stack-column{height:100%;width:100%;max-width:calc(var(--showcase-regular-width)*1.37);min-width:0;justify-self:center;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:3px;position:relative;z-index:var(--showcase-order,1)}
.room#room .cover-showcase .showcase-stack-column>.shelf-book:not(.stacked){width:min(100%,calc((100cqh - var(--pile-count)*6cqh - 3px)*.75),calc(var(--showcase-regular-width)*.84));flex:0 0 auto;min-height:0;max-height:none;aspect-ratio:3/4;align-self:flex-end}
.room#room .cover-showcase .book-pile{width:100%;max-width:calc(var(--showcase-regular-width)*1.37);height:calc(var(--pile-count)*6%);flex:0 0 calc(var(--pile-count)*6%);gap:1px;min-width:0;align-self:auto;justify-self:center;margin-inline:0}
.room#room .cover-showcase .book-pile>.shelf-book.stacked{height:auto!important;flex:1 1 0;min-height:0;width:100%;border-radius:3px;box-shadow:1px 2px 2px #0007}
.room#room .cover-showcase .stacked .spine-art{width:97%;height:100%;top:0;border-radius:2px;padding:0;display:flex;align-items:center;justify-content:center;container-type:size}
.room#room .cover-showcase .stacked .spine-art img{width:100cqh;height:100cqw;aspect-ratio:auto;max-height:none;top:50%;left:50%;object-fit:fill;transform:translate(-50%,-50%) rotate(-90deg)}
.room#room .cover-showcase .stacked .spine-art strong{font:600 clamp(5px,.33cqw,7px)/1 var(--serif)!important;letter-spacing:.1px;max-width:94%;text-align:center}
.room#room .cover-showcase .flat-cover{height:20%;top:-10%;transform:skewX(-12deg)}
.room#room .cover-showcase .shelf-book:hover,.room#room .cover-showcase .shelf-book:focus-visible{transform:translateY(-3px);filter:brightness(1.07);z-index:20}
.room#room .cover-showcase .showcase-stack-column:has(.shelf-book:hover),.room#room .cover-showcase .showcase-stack-column:focus-within{z-index:20}
.room#room .cover-showcase .shelf-book.forward-facing{box-shadow:0 4px 9px #0008,0 0 0 1px #f6dfaeaa;transform:translateY(-2px);z-index:10}
.room#room .cover-showcase .showcase-stack-column:has(.forward-facing){z-index:10}
.room#room .cover-showcase .shelf-book.forward-facing:hover,.room#room .cover-showcase .shelf-book.forward-facing:focus-visible{transform:translateY(-4px);z-index:20}
.room#room .cover-showcase .shelf-book.angled:hover,.room#room .cover-showcase .shelf-book.angled:focus-visible{transform:translateY(-3px) perspective(600px) rotateY(-14deg) skewY(-2deg);z-index:20}

/* Give placeholder typography the space normally occupied by cover artwork. */
.room#room .shelf-book:not(.stacked) .cover-art:not(:has(img)){container-type:inline-size;padding:8% 6%;justify-content:center;gap:3%}
.room#room .shelf-book:not(.stacked) .cover-art:not(:has(img)) .cover-title{font:700 clamp(6px,12.5cqw,16px)/1.1 var(--serif)!important;letter-spacing:.1px;margin:0;max-width:100%;overflow-wrap:anywhere}
.room#room .shelf-book:not(.stacked) .cover-art:not(:has(img)) .cover-author{font:500 clamp(4px,8cqw,11px)/1.2 var(--sans)!important;letter-spacing:.2px;margin-top:auto;max-width:100%;overflow-wrap:anywhere}
.room#room .shelf-book:not(.stacked) .cover-art:not(:has(img)) .cover-kicker,
.room#room .shelf-book:not(.stacked) .cover-art:not(:has(img)) .cover-symbol{display:none}
.room#room .shelf-book:not(.stacked) .cover-art:not(:has(img)):before,
.room#room .shelf-book:not(.stacked) .cover-art:not(:has(img)):after{font-size:24cqw;opacity:.16}
.room#room .arranged-shelf:not(.cover-showcase) .stacked .spine-art strong{font-size:clamp(5px,.55cqw,9px)!important}

/* Shared reference proportions for Small- and Medium-room bookshelves. */
.room#room .reference-shelf.reference-composition{padding:0 2% 1px!important}
.room#room .reference-composition .showcase-arrangement{grid-template-columns:31% minmax(0,1fr);gap:1.5%}
.room#room .reference-composition .showcase-stack-column{max-width:none;gap:0;align-items:center}
.room#room .reference-composition .showcase-stack-column>.shelf-book:not(.stacked){width:min(86%,calc(74cqh*var(--jacket-ratio,.7)));height:auto!important;aspect-ratio:var(--jacket-ratio,.7);align-self:center;border-radius:1px 3px 2px 1px;transform:none;box-shadow:2px 1px 2px #0007,inset -1px 0 #f5e9d199}
.room#room .reference-composition .book-pile{width:100%;max-width:none;height:calc(var(--pile-count)*7.5cqh);flex:0 0 calc(var(--pile-count)*7.5cqh);gap:1px}
.room#room .reference-composition .book-pile>.shelf-book.stacked{border-radius:2px;box-shadow:1px 1px 2px #0006}
.room#room .reference-composition .book-pile>.shelf-book.stacked:nth-child(2){width:98%;align-self:center}
.room#room .reference-composition .book-pile>.shelf-book.stacked:nth-child(3){width:95%;align-self:center}
.room#room .reference-composition .stacked .spine-art{width:96%;border-radius:2px;background:linear-gradient(0deg,#0003,transparent 30%,#fff2 90%,#0002),var(--cover);color:var(--spine-ink);box-shadow:inset 2px 0 2px #0003}
.room#room .reference-composition .stacked .spine-art strong{font:500 clamp(3px,3.5cqh,10px)/1.1 var(--serif)!important;letter-spacing:.04em}
.room#room .reference-composition .flat-cover{height:12%;top:-6%;transform:skewX(-10deg)}
.room#room .reference-composition .showcase-angled-run{display:grid;grid-template-columns:repeat(4,24.5%);height:80cqh;gap:0;align-items:end;justify-content:start}
.room#room .reference-composition .showcase-angled-run>.shelf-book{width:min(114%,calc(78cqh*var(--jacket-ratio,.67)));flex:none;height:auto!important;aspect-ratio:var(--jacket-ratio,.67);margin-left:0;border-radius:1px 3px 3px 1px;transform:perspective(1200px) rotateY(-22deg) skewY(-2deg);transform-origin:left bottom;overflow:visible;isolation:auto;box-shadow:1px 0 0 #fff4,2px 0 0 #e9e1cb,3px 0 0 #443c32,2px 2px 3px #0005}
.room#room .reference-composition .showcase-angled-run>.shelf-book+.shelf-book{margin-left:0}
.room#room .reference-composition .shelf-book:not(.stacked) .cover-art{overflow:hidden;box-shadow:inset 1px 0 1px #fff5,inset -2px 0 2px #0005}
.room#room .reference-composition .shelf-book:not(.stacked) .cover-art img{object-fit:contain}
.room#room .reference-composition .shelf-book.forward-facing .cover-art img{object-fit:contain}
.room#room .reference-composition .showcase-stack-column:has(.forward-facing){z-index:1}
.room#room .reference-composition .showcase-angled-run>.shelf-book:hover,
.room#room .reference-composition .showcase-angled-run>.shelf-book:focus-visible{transform:translateY(-2px) perspective(1200px) rotateY(-22deg) skewY(-2deg);z-index:20}
.room#room .reference-composition .showcase-arrangement>.forward-facing{width:min(27%,calc(74cqh*var(--jacket-ratio,.7)));height:auto!important;aspect-ratio:var(--jacket-ratio,.7);justify-self:start;align-self:end;transform:none}
.room#room .reference-composition .showcase-arrangement:has(>.forward-facing:only-child){grid-template-columns:1fr}
.room#room .reference-shelf .shelf-book{touch-action:none;-webkit-touch-callout:none;user-select:none}
.room#room .reference-shelf .shelf-book img{-webkit-user-drag:none}
.room#room .reference-shelf .shelf-book.dragging{opacity:.35}
.room#room .reference-shelf.drag-over{outline:2px solid #e8ce91;outline-offset:-2px;background:linear-gradient(0deg,#e8ce9126,transparent 70%);border-radius:2px}

/* Flexible arrangements and larger flat-book titles on every custom row. */
.room#room[data-space="classic"][data-style="illustrated"] #roomPlant{left:.5%;bottom:1%;width:8%;height:18%}
.room#room[data-space="classic"][data-style="illustrated"] #roomPlant,
.room#room[data-space="classic"][data-style="illustrated"] #roomPlant *{pointer-events:none}
.room#room .custom-row .showcase-arrangement{grid-template-columns:var(--custom-columns);gap:1.5%}
.room#room .custom-row .showcase-angled-run{grid-template-columns:repeat(var(--run-count),minmax(0,1fr))}
.room#room .custom-row .showcase-angled-run>.shelf-book{width:min(calc(100%*var(--face-scale)),calc(78cqh*var(--jacket-ratio,.67)));transform:perspective(1200px) rotateY(calc(-1*var(--row-angle))) skewY(-2deg)}
.room#room .custom-row .showcase-angled-run>.shelf-book:hover,.room#room .custom-row .showcase-angled-run>.shelf-book:focus-visible{transform:translateY(-2px) perspective(1200px) rotateY(calc(-1*var(--row-angle))) skewY(-2deg)}
.room#room .custom-row .showcase-arrangement>.forward-facing{width:min(100%,calc(78cqh*var(--jacket-ratio,.7)));height:auto!important;justify-self:center;aspect-ratio:var(--jacket-ratio,.7)}
.room#room .custom-row .book-pile{height:calc(var(--pile-count)*11cqh);flex-basis:calc(var(--pile-count)*11cqh)}
.room#room .custom-row .stacked .spine-art strong{font:500 clamp(5px,8cqw,13px)/1.1 var(--serif)!important;letter-spacing:0;max-width:96%;text-overflow:ellipsis}

/* Medium shelves share a book height; projected footprints control overlap. */
.room#room[data-space="immersive"] .custom-row{--medium-cover-height:120px;--medium-angle:68deg;--medium-footprint:calc(var(--medium-cover-height)*.8*cos(var(--medium-angle)) + 5px);padding:5px 4% 2px!important;overflow:clip}
.room#room[data-space="immersive"] .custom-row .showcase-angled-run{height:100%;padding-right:var(--medium-footprint);grid-template-columns:repeat(var(--run-intervals),minmax(0,1fr)) 0;box-sizing:border-box}
.room#room[data-space="immersive"] .custom-row .showcase-angled-run>.shelf-book{height:var(--medium-cover-height)!important;width:calc(var(--medium-cover-height)*var(--jacket-ratio,.67));max-height:none;transform:perspective(1200px) rotateY(calc(-1*var(--medium-angle))) skewY(-1deg)}
.room#room[data-space="immersive"] .custom-row .showcase-angled-run>.shelf-book:hover,.room#room[data-space="immersive"] .custom-row .showcase-angled-run>.shelf-book:focus-visible{transform:translateY(-2px) perspective(1200px) rotateY(calc(-1*var(--medium-angle))) skewY(-1deg)}
.room#room[data-space="immersive"] .custom-row .showcase-arrangement>.forward-facing{height:var(--medium-cover-height)!important;width:calc(var(--medium-cover-height)*var(--jacket-ratio,.67))}
.room#room[data-space="immersive"] .custom-row .showcase-stack-column>.shelf-book:not(.stacked){height:calc(var(--medium-cover-height)*.8)!important;width:calc(var(--medium-cover-height)*.8*var(--jacket-ratio,.67))}
.room#room[data-space="immersive"] .custom-row .book-pile{height:calc(var(--pile-count)*7cqh);flex-basis:calc(var(--pile-count)*7cqh)}

/* Engraved, editable bookcase labels stay visible in every room style. */
#room.room .bookcase .shelf-heading{
  display:flex!important;align-items:center;justify-content:center;
  position:absolute!important;top:3%!important;left:12%!important;width:76%!important;height:7%!important;
  padding:2px 6px!important;z-index:8;box-sizing:border-box;opacity:1!important;pointer-events:auto!important;
  border:1px solid #b49a60;border-radius:3px;
  background:linear-gradient(115deg,#483d2c,#292b23 48%,#433c2b);
  color:#f4dfad!important;font:500 clamp(7px,.75cqw,12px)/1.2 Georgia,serif!important;
  letter-spacing:.35px!important;text-align:center;text-shadow:0 1px 1px #000;
  box-shadow:0 2px 5px #0006,inset 0 0 0 2px #d9bd7222;
  overflow:hidden;white-space:normal;overflow-wrap:anywhere;cursor:pointer;
}
#room.room .bookcase .shelf-heading:hover,
#room.room .bookcase .shelf-heading:focus-visible{border-color:#ffe3a1;box-shadow:0 0 10px #f5d88b66,inset 0 0 0 2px #d9bd7244;outline:2px solid #f2d699;outline-offset:2px}
.immersive-space #room.room .bookcase .shelf-heading{top:-48px!important;left:4%!important;width:92%!important;height:37px!important;font-size:13px!important}
.immersive-space.shelf-focus-view #room.room .bookcase .shelf-heading{top:-43px!important;height:34px!important;font-size:14px!important}
#room.room[data-space="grand"] .bookcase .shelf-heading{top:3%!important;height:8%!important;font-size:clamp(7px,5cqw,12px)!important}
#shelfNameDialog{width:min(420px,calc(100vw - 32px))}
#shelfNameDialog label{display:block;margin:20px 0 8px;font-size:13px}
#shelfNameInput{box-sizing:border-box;width:100%;padding:12px;border:1px solid #c5c8b5;border-radius:6px;background:var(--paper,#fffdf6);color:var(--ink,#33392d);font:inherit}
#shelfNameDialog .shelf-name-hint{font-size:12px;color:#737965;line-height:1.5}

/* Only the room camera rectifies covers on the four side cabinets. */
.room#room[data-space="immersive"] .side-shelf-overview .shelf-book:not(.stacked),
.room#room[data-space="immersive"] .shelf-room-overview .shelf-book:not(.stacked){transform:var(--room-facing-transform,none)!important;transform-origin:0 0!important}
.room#room[data-space="immersive"] .bookcase .shelf-book:not(.stacked){transform:var(--room-facing-transform,none)!important;transform-origin:0 0!important}
.room#room[data-space="immersive"] .shelf-room-overview .book-pile{width:calc(var(--medium-cover-height)*.68);max-width:100%;align-self:center}

/* Keep the button on the shelf plane for the Medium room camera and drag/drop.
   Only the jacket turns; the last cover has room to extend past its grid cell. */
.room#room .cover-showcase .showcase-angled-run{
  display:grid;grid-template-columns:repeat(var(--run-count),minmax(0,1fr));
  align-items:end;justify-content:start;gap:0;height:100%;box-sizing:border-box;
  width:min(100%,calc(52cqh * (var(--run-count) + .3) / 1.55));
  padding-right:calc(100% / (var(--run-count) + .3) * .3);
}
.room#room .cover-showcase .showcase-angled-run>.shelf-book.angled{
  width:min(155%,52cqh);height:auto!important;aspect-ratio:2/3;
  max-height:none;min-width:0;flex:none;margin:0;padding:0;border:0;
  transform:none;transform-origin:left bottom;isolation:auto;overflow:visible;
  background:none;box-shadow:none;filter:none;border-radius:0;
}
.room#room[data-space="immersive"] .custom-row{--medium-angle:40deg;--medium-footprint:calc(var(--medium-cover-height)*.52);overflow:visible}
.room#room[data-space="immersive"] .custom-row .showcase-angled-run{
  width:100%;
  grid-template-columns:repeat(var(--run-intervals),minmax(0,1fr)) 0;
  padding-right:var(--medium-footprint);
}
.room#room[data-space="immersive"] .custom-row .showcase-angled-run>.shelf-book.angled{
  width:calc(var(--medium-cover-height)*.666667);height:auto!important;
}
.room#room[data-space="immersive"] .bookcase:not(.shelf-room-overview) .custom-row .showcase-angled-run{
  width:min(100%,calc(var(--medium-cover-height) * .666667 * (var(--run-count) + .3) / 1.55));
}
.room#room .cover-showcase .shelf-book.angled .library-grid-jacket{
  display:block;position:relative;width:100%;aspect-ratio:2/3;
}
.room#room .cover-showcase .shelf-book.angled .library-grid-jacket>.cover-art{
  width:100%;height:100%;padding:0;outline:0;border:0;
}
.room#room .cover-showcase .shelf-book.angled .cover-art img{object-fit:cover}
.room#room .cover-showcase .shelf-book.angled .cover-art.has-real-cover::before,
.room#room .cover-showcase .shelf-book.angled .cover-art.has-real-cover::after{display:none}
.room#room .cover-showcase .shelf-book.angled::before,
.room#room .cover-showcase .shelf-book.angled::after{display:none}

/* The same 3D jacket surfaces as Grid, scaled to the room shelf openings. */
.room#room .cover-showcase .library-grid-jacket{--book-depth:clamp(3px,4cqh,12px);transform-style:preserve-3d;transform:perspective(1600px) rotateX(-5deg) rotateY(40deg);transform-origin:left bottom;transition:transform .3s cubic-bezier(.2,.7,.25,1);isolation:auto}
.room#room .cover-showcase .shelf-book.angled .library-grid-jacket>.cover-art{position:relative;transform:translateZ(calc(var(--book-depth)/2));backface-visibility:hidden;border-radius:2px 5px 5px 2px;box-shadow:inset 4px 0 6px #0004,2px 5px 9px #30201644;transition:box-shadow .3s}
.room#room .cover-showcase .library-grid-jacket::before{content:"";position:absolute;inset:0 auto 0 0;width:var(--book-depth);background:linear-gradient(90deg,#0008,transparent 35%,#fff3 60%,#0005),linear-gradient(180deg,transparent 8%,#e6ce8b99 8.5% 9%,transparent 9.5% 90%,#e6ce8b99 90.5% 91%,transparent 91.5%),var(--jacket-color);transform-origin:left center;transform:translateZ(calc(var(--book-depth)/-2)) rotateY(-90deg);backface-visibility:hidden;border-radius:2px}
.room#room .cover-showcase .library-grid-jacket::after{content:"";position:absolute;inset:0;background:var(--jacket-color);border-radius:3px;transform:translateZ(calc(var(--book-depth)/-2));box-shadow:12px 12px 18px #30201655}
.room#room .cover-showcase .library-grid-page-edge{display:block;position:absolute;left:100%;top:1%;height:98%;width:var(--book-depth);background:repeating-linear-gradient(90deg,#d0c0a5 0 1px,#f6edda 1px 3px);transform-origin:left center;transform:translateZ(calc(var(--book-depth)/2)) rotateY(90deg);backface-visibility:hidden}
.room#room .cover-showcase .library-grid-top-edge{display:block;position:absolute;left:0;top:0;width:100%;height:var(--book-depth);background:repeating-linear-gradient(#f6edda 0 2px,#cbbca3 2px 3px);transform-origin:center top;transform:translateZ(calc(var(--book-depth)/-2)) rotateX(90deg);backface-visibility:hidden}

.room#room .cover-showcase .showcase-angled-run>.shelf-book.angled:is(:hover,:focus-visible){transform:none;filter:none;z-index:20}
.room#room .cover-showcase .shelf-book.angled:focus-visible{outline:2px solid #e8ce91;outline-offset:3px}
.room#room .cover-showcase .shelf-book.angled:focus-visible .library-grid-jacket{transform:perspective(1600px) translateY(-5px) translateZ(20px) rotateX(-5deg) rotateY(12deg)}
@media(hover:hover) and (pointer:fine){
 .room#room .cover-showcase .shelf-book.angled:hover .library-grid-jacket{transform:perspective(1600px) translateY(-5px) translateZ(20px) rotateX(-5deg) rotateY(12deg)}
}
@media(prefers-reduced-motion:reduce){.room#room .cover-showcase .library-grid-jacket{transition:none}}

/* Medium always uses matching jackets; cover metadata and row density cannot
   change their size. The room camera places the five fixed shelf positions. */
.room#room[data-space="immersive"] .cover-showcase .shelf-book:not(.stacked){
  width:calc(var(--medium-cover-height)*2/3);height:var(--medium-cover-height)!important;aspect-ratio:2/3;
}
.room#room[data-space="immersive"] .cover-showcase .library-grid-jacket{
  transform:perspective(1600px) rotateX(-5deg) rotateY(var(--medium-jacket-angle,40deg));
}
.room#room[data-space="immersive"] .cover-showcase .shelf-book:not(.stacked) .cover-art img{object-fit:cover}

/* Available destinations for the currently selected cart book. */
.shelving-available{outline:3px solid #67d9a0!important;outline-offset:-3px;background-color:#4ec98b22!important;box-shadow:inset 0 0 18px #67d9a044!important;cursor:pointer}
.shelving-available:hover{outline-color:#b5ffd9!important;background-color:#4ec98b44!important}
.shelving-book[aria-pressed=true]{outline:3px solid var(--accent,#0069fb);outline-offset:3px;border-radius:5px}
