/* UI-only shelf store, independent of backend implementation. */
#shelf-board{position:fixed;top:86px;left:50%;transform:translateX(-50%);z-index:20;display:flex;gap:10px;max-width:90vw;overflow:auto;padding:8px 5px 12px;scrollbar-width:none}
.shelf-sign{display:flex;background:linear-gradient(#fff6de,#efd5a1);border:1px solid #bd8c48;border-radius:12px;box-shadow:0 3px 0 #86582c55;flex-shrink:0;overflow:hidden}
.shelf-sign.selected{background:linear-gradient(#dbad62,#c38b3e)}
.shelf-sign button{border:0;background:none;color:#513719;padding:9px 15px;cursor:pointer}.shelf-sign strong{font-size:14px}.shelf-sign small{display:block;font-size:10px;margin-top:3px;opacity:.8}.shelf-sign .shelf-unlock{padding:8px;border-left:1px solid #9c713544}.shelf-unlock img{width:22px;height:22px}
#catalog-open{display:none!important}.scene-reading #shelf-board{display:none}
#shelf-purchase,#store-login{width:min(520px,calc(100vw - 24px));max-height:88dvh;padding:36px!important;background-size:48px 48px,0 0,48px 48px,48px 48px,100% 100%,180px 180px!important}
:is(#shelf-purchase,#store-login) h2{font-size:28px!important;margin:12px 0!important;letter-spacing:-.02em}
:is(#shelf-purchase,#store-login) p{font-size:14px;line-height:1.6}.close img{width:22px;height:22px}
.purchase-intro{color:#80684d}.purchase-picked{padding:12px;background:#efd5a24d;border-radius:10px;border-left:3px solid #c08b37}.purchase-picked strong{display:block}
.purchase-books{display:grid;gap:8px;margin:18px 0}.purchase-book{display:flex;align-items:center;text-align:left;gap:12px;padding:10px;border:1px solid #d5c4a3;border-radius:12px;background:#fffaf0;color:#513f2c;font:inherit;width:100%}.purchase-book:disabled{opacity:1;cursor:default}.purchase-book>img:first-child{width:40px;height:54px;object-fit:cover;border-radius:3px}.purchase-book>img:last-child{width:20px;height:20px;margin-left:auto}.purchase-book span{flex:1;font-size:14px;font-weight:600}.purchase-book small{display:block;font-weight:400;font-size:11px;color:#897451;margin-top:5px}
.purchase-total{display:flex;justify-content:space-between;align-items:center;border-top:1px solid #d4bc90;padding:18px 0;gap:10px;font-size:13px}.purchase-total strong{font-size:29px;white-space:nowrap}.purchase-total small{display:block;font-size:11px;font-weight:400;margin-top:4px;color:#897451}
:is(#shelf-purchase,#store-login) form label{display:grid;gap:8px;font-size:13px!important;padding:8px 0!important}:is(#shelf-purchase,#store-login) input{box-sizing:border-box;width:100%;padding:13px;border-radius:10px}:is(#shelf-purchase,#store-login) .primary{width:100%;margin-top:14px;border-radius:12px!important;padding:13px;font-size:15px;font-weight:600}.store-status{font-size:12px!important;color:#8a7051;min-height:20px}.login-emblem img{width:48px;height:48px}
@media(max-width:600px){#shelf-board{top:76px;gap:7px;max-width:96vw}.shelf-sign button{padding:7px 10px}.shelf-sign strong{font-size:12px}#shelf-purchase,#store-login{padding:28px 22px!important}}

/* Keep form hierarchy clean while retaining the room's illustrated frame. */
:is(#shelf-purchase,#store-login) form label{display:flex!important;flex-direction:column;align-items:stretch;border:0!important}
:is(#shelf-purchase,#store-login) input{max-width:none!important;flex:none!important;width:100%!important}
:is(#shelf-purchase,#store-login) .eyebrow{padding-right:36px}
:is(#shelf-purchase,#store-login) h2::after{display:none}
:is(#shelf-purchase,#store-login) .close{position:sticky;float:right;top:0;margin:-15px -15px 0 8px;z-index:2}
.shelf-sign button:focus-visible,.purchase-book:focus-visible{outline:3px solid #936021;outline-offset:-4px}
@media(hover:hover){.shelf-sign:not(.selected):hover{background:linear-gradient(#fff9e9,#e7c17d)}.purchase-book:not(:disabled):hover{border-color:#a87530;background:#fff2d4}}
@media(prefers-reduced-motion:reduce){.shelf-sign,.purchase-book{transition:none}}

/* v121: shelf choice stays behind a header control. */
#shelf-picker{width:min(480px,calc(100vw - 30px));padding:38px;box-sizing:border-box}
#shelf-picker h2{font-size:26px;padding-right:25px}
#shelf-picker #shelf-board{position:static;transform:none;display:grid;max-width:none;padding:12px 0 0;overflow:visible}
#shelf-picker .shelf-sign{width:100%;border-radius:16px;background:linear-gradient(155deg,#3f436f,#202447);border:2px solid #a99456;box-shadow:inset 0 2px 2px #ffffff25,0 3px 6px #251d2420}
#shelf-picker .shelf-sign.selected{border-color:#f1c773;background:linear-gradient(155deg,#515682,#292e54)}
#shelf-picker .shelf-sign button{color:#fff4d6;padding:18px;text-align:left;flex:1}
#shelf-picker .shelf-sign strong{font-size:17px}#shelf-picker .shelf-unlock{flex:0 0 56px;border-color:#bda76966;text-align:center;padding:12px}
.site-header nav #shelf-picker-open{display:flex!important;gap:7px;align-items:center;justify-content:center;width:auto!important;min-width:100px;height:46px!important;padding:8px 14px!important;border-radius:26px!important;border:2px solid #a99456!important;background:linear-gradient(155deg,#414774,#202447)!important;box-shadow:inset 0 2px 2px #ffffff26,0 3px 5px #24203935!important;color:#fff3d4!important;align-self:center}
#shelf-picker-open::before,#shelf-picker-open::after{display:none!important}#shelf-picker-open img{width:25px;height:25px}#shelf-picker-open span{display:block!important;font-size:13px!important;color:inherit!important}
@media(max-width:600px){.site-header nav #shelf-picker-open{min-width:42px;width:42px!important;height:42px!important;padding:6px!important}#shelf-picker-open span{display:none!important}#shelf-picker{padding:30px 22px}}
#shelf-picker .shelf-sign .shelf-unlock{flex:0 0 56px;padding:12px;text-align:center}
#shelf-picker .shelf-sign small{color:#e4dfcc!important;opacity:1}
/* v124 — match the header medallions and use a rounded, bold label. */
.site-header nav #shelf-picker-open{height:54px!important;min-height:54px!important;gap:9px;padding:0 17px!important;border-radius:29px!important;box-sizing:border-box;line-height:1;align-items:center;justify-content:center;text-shadow:none!important}
#shelf-picker-open img{display:block;width:30px;height:30px;object-fit:contain;flex:none}
#shelf-picker-open span{font-family:'Avenir Next','Arial Rounded MT Bold','Trebuchet MS',sans-serif!important;font-size:16px!important;font-weight:800!important;line-height:1!important;letter-spacing:.015em;text-shadow:0 1px 1px #10142d60}
@media(max-width:600px){.site-header nav #shelf-picker-open{height:42px!important;min-height:42px!important;padding:0 7px!important}#shelf-picker-open img{width:26px;height:26px}}
.site-header nav #shelf-picker-open{max-width:260px}
#shelf-picker-open span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
@media(max-width:600px){.site-header nav #shelf-picker-open{width:auto!important;max-width:150px;padding:0 9px!important;gap:5px}#shelf-picker-open span{display:block!important;font-size:12px!important}#shelf-picker-open img{width:22px;height:22px}}
/* v131: shelf names cannot resize or shift the header. */
.site-header nav{flex-shrink:0}
.site-header nav #shelf-picker-open{width:244px!important;min-width:244px!important;max-width:244px!important;flex:0 0 244px;justify-content:center!important;gap:10px}
#shelf-picker-open span{font-size:18px!important;font-weight:900!important;text-align:center}
@media(max-width:600px){
.site-header{display:grid!important;grid-template-columns:1fr auto;align-items:center!important;height:auto!important;gap:12px!important}
.site-header nav{display:grid;grid-template-columns:42px 42px;max-width:none;gap:8px!important}
.site-header nav #shelf-picker-open{grid-column:1 / -1;grid-row:2;width:150px!important;min-width:150px!important;max-width:150px!important;justify-self:end;flex-basis:150px}
#shelf-picker-open span{font-size:14px!important}
}
.webgl-ready .site-header{right:clamp(20px,2.5vw,48px)!important}
/* v132: center the shelf selector in the whole header, not in the right nav. */
@media(min-width:601px){
.site-header nav #shelf-picker-open{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)!important;margin:0}
.site-header nav #shelf-picker-open:hover{transform:translate(-50%,calc(-50% - 2px))!important}
.site-header nav #shelf-picker-open:active{transform:translate(-50%,-50%)!important}
}
@media(min-width:601px) and (max-width:1050px){
.site-header .brand-image{width:clamp(175px,23vw,240px)}
.site-header nav #shelf-picker-open{width:220px!important;min-width:220px!important;max-width:220px!important}
}
@media(max-width:600px){
.webgl-ready .site-header{height:112px!important;display:flex!important;align-items:flex-start!important;padding-top:10px!important}
.webgl-ready .site-header nav{display:flex!important;gap:8px!important}
.site-header nav #shelf-picker-open{position:absolute;left:50%;top:62px;transform:translateX(-50%)!important;width:210px!important;min-width:210px!important;max-width:210px!important;margin:0}
#shelf-picker-open span{font-size:16px!important}
}
/* v133: intrinsic width around the name, with an independently anchored center. */
.site-header nav #shelf-picker-open{width:max-content!important;min-width:0!important;max-width:min(360px,42vw)!important;flex:none;padding-inline:20px!important}
@media(max-width:600px){.site-header nav #shelf-picker-open{width:max-content!important;min-width:0!important;max-width:calc(100vw - 40px)!important;padding-inline:16px!important}}

/* Purple selector: compact and centered independently of label length. */
#shelf-picker-open .shelf-chevron{display:block;width:0;height:0;flex:none;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:7px solid #eee1b9;margin-left:3px}
.site-header nav #shelf-picker-open{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}

/* business-layer additions (Claude): legal small print, parent space shelves/receipts, account deletion */
.purchase-legal,.settings-links{font-size:12px;opacity:.78;margin:8px 0 0;text-align:center}
.purchase-legal a,.settings-links a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.account-shelves,.account-receipts{display:grid;gap:8px;margin:12px 0}
.account-shelves .secondary{width:100%;text-align:left}
[data-track].remembered:not(.active){outline:1px dashed currentColor;outline-offset:2px}
