@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Fraunces:opsz,wght@9..144,600;9..144,800&display=swap");

:root{color-scheme:dark;--ink:#f4ead3;--muted:#b7c4b7;--green:#182e2b;--green-2:#24443b;--paper:#f4ead3;--wood:#6e3e26;--wood-light:#a7683c;--gold:#e4b75e;--red:#a84132}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;overflow-x:hidden;color:var(--ink);font-family:"Fraunces",Georgia,serif;background:radial-gradient(circle at 15% 0,#315448 0,transparent 34%),linear-gradient(135deg,#0c1918,#182e2b 55%,#111c21)}
body::before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.14;background:repeating-linear-gradient(90deg,transparent 0 47px,#d7bd7b22 48px),repeating-linear-gradient(0deg,transparent 0 47px,#d7bd7b18 48px)}
button,input{font:inherit}
button{cursor:pointer}
.library-app{position:relative;width:min(1120px,100%);min-width:0;margin:0 auto;padding:28px clamp(14px,4vw,38px) 70px;display:grid;gap:22px}
.library-header{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:18px;padding:8px 0 12px}
.library-header>div,.location-heading>*,.bookshelf-heading>*{min-width:0}
.library-header .home-link{display:grid;place-items:center;width:52px;height:52px;border:2px solid #d9c287;border-radius:16px;background:#101f1d;color:#fff;text-decoration:none;font:800 18px/1 "DM Mono",monospace;box-shadow:0 5px 0 #07100f}
.eyebrow,.location-heading span,.bookshelf-heading span,.reader-heading span{margin:0 0 5px;color:var(--gold);font:500 11px/1.2 "DM Mono",monospace;letter-spacing:.13em;text-transform:uppercase}
h1,h2,p{margin-top:0}
h1{margin-bottom:7px;font-size:clamp(2rem,6vw,4.3rem);line-height:.98;letter-spacing:-.035em}
.library-header p:last-child{max-width:670px;margin:0;color:var(--muted);font-size:clamp(.95rem,2vw,1.1rem);line-height:1.45}
.location-panel,.bookshelf-section,.reader,.about-panel{width:100%;min-width:0;max-width:100%;border:1px solid #a7885666;border-radius:22px;background:#122320e8;box-shadow:0 18px 50px #02080766,0 5px 0 #08110f;overflow:hidden}
.location-panel{padding:clamp(16px,3vw,26px);display:grid;gap:18px}
.location-heading,.bookshelf-heading,.reader-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}
.location-heading h2,.bookshelf-heading h2,.reader-heading h2{margin:0;font-size:clamp(1.35rem,3vw,2rem)}
.location-heading p{max-width:470px;margin:0;color:var(--muted);font:400 12px/1.5 "DM Mono",monospace}
code{color:#f2cf84}
.coordinate-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.coordinate-grid label{display:grid;gap:7px;min-width:0;color:#d5c7aa;font-size:14px;font-weight:800}
.coordinate-grid small{color:#92aa9a;font:400 10px/1 "DM Mono",monospace}
.coordinate-grid input{width:100%;min-width:0;border:1px solid #587064;border-radius:11px;padding:12px;background:#091411;color:#f6e9cc;font:500 15px/1 "DM Mono",monospace;outline:none}
.coordinate-grid input:focus{border-color:var(--gold);box-shadow:0 0 0 3px #e4b75e24}
.location-actions{display:flex;flex-wrap:wrap;gap:10px}
.primary-action,.secondary-action,.page-controls button,.page-meta button,.icon-button{min-height:43px;border:1px solid #d0a758;border-radius:11px;padding:10px 16px;background:var(--gold);color:#16231e;font-weight:800}
.secondary-action,.page-controls button,.page-meta button,.icon-button{border-color:#62796c;background:#203b34;color:#f4ead3}
button:disabled{cursor:not-allowed;opacity:.4}
.error-message{margin:0;padding:11px 13px;border-radius:10px;background:#5a221d;color:#ffd7c9;font:500 13px/1.4 "DM Mono",monospace}
.bookshelf-heading,.reader-heading{padding:18px 20px;border-bottom:1px solid #80674455}
.bookshelf-heading p{max-width:650px;margin:0;color:var(--muted);font:400 11px/1.45 "DM Mono",monospace;text-align:right;overflow-wrap:anywhere}
.bookshelf{width:100%;min-width:0;padding:18px;background:linear-gradient(90deg,#402216,#6f4027 5%,#4d2b1c 50%,#704329 95%,#3c2015)}
.shelf{position:relative;width:100%;min-width:0;max-width:100%;padding:22px 14px 17px;border-inline:7px solid #2a160f;background:linear-gradient(#172622,#0d1816)}
.shelf::after{content:"";position:absolute;left:-7px;right:-7px;bottom:0;height:15px;border-block:2px solid #d49a54;background:linear-gradient(#9c6036,#59311f);box-shadow:0 6px 0 #25130d}
.shelf-label{position:absolute;z-index:2;top:4px;left:12px;color:#d8ba79;font:500 9px/1 "DM Mono",monospace;text-transform:uppercase;letter-spacing:.12em}
.shelf-books{display:grid;grid-template-columns:repeat(19,minmax(28px,1fr));align-items:end;gap:3px;min-width:680px}
.shelf{overflow-x:auto;scrollbar-color:#b47a43 #25150f;scrollbar-width:thin}
.book{position:relative;height:87px;border:1px solid #e2c98e;border-radius:3px 5px 2px 2px;padding:0;background:#8f352d;color:#fbeac5;box-shadow:inset 3px 0 #ffffff20,inset -3px 0 #0004,0 2px 0 #160b08;transition:transform .12s,filter .12s}
.book:nth-child(3n){height:76px}.book:nth-child(4n){height:93px}.book:nth-child(5n){height:82px}
.book span{position:absolute;inset:auto 0 9px;writing-mode:vertical-rl;transform:rotate(180deg);font:500 10px/1 "DM Mono",monospace}
.book:hover,.book:focus-visible{z-index:2;transform:translateY(-7px);filter:brightness(1.18)}
.book.is-open{outline:3px solid #ffd46f;outline-offset:2px;transform:translateY(-6px)}
.book-color-0{background:#9b3f34}.book-color-1{background:#366b62}.book-color-2{background:#a16c2e}.book-color-3{background:#4e527e}.book-color-4{background:#723e63}.book-color-5{background:#596b35}.book-color-6{background:#854e2d}
.reader{scroll-margin-top:12px}
.icon-button{display:grid;place-items:center;width:44px;height:44px;padding:0;color:#f8dfb4;font:500 28px/1 "DM Mono",monospace}
.page-controls{display:grid;grid-template-columns:auto minmax(130px,1fr) auto auto;align-items:end;gap:10px;padding:16px 20px;background:#0d1c19}
.page-controls label{display:grid;grid-template-columns:auto minmax(70px,130px) auto;justify-content:center;align-items:center;gap:8px;color:#d5c7aa}
.page-controls input{width:100%;border:1px solid #6b7e72;border-radius:9px;padding:9px;background:#08120f;color:#fff3d5;font:500 15px/1 "DM Mono",monospace;text-align:center}
.page-controls small{color:#92aa9a}
.page-card{padding:clamp(12px,3vw,24px);background:#d9c8a4;color:#211c16}
.page-meta{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;color:#5e4c36;font:500 11px/1.3 "DM Mono",monospace}
.page-meta button{min-height:34px;padding:7px 11px;background:#e8dcc2;color:#392f23;border-color:#8e7757}
.page-status{margin:0 0 10px;color:#67553c;font:500 10px/1.3 "DM Mono",monospace}
.page-card pre{width:100%;min-height:350px;margin:0;padding:18px;border:1px solid #b4a17b;background:var(--paper);color:#171410;font:500 clamp(7px,1.45vw,13px)/1.45 "DM Mono",monospace;white-space:pre;overflow:auto;tab-size:2;box-shadow:inset 0 0 35px #8e6b2a17}
.about-panel{padding:19px 21px;color:var(--muted)}
.about-panel h2{margin-bottom:7px;color:#f4ead3;font-size:1.25rem}.about-panel p{margin:0;line-height:1.55}
[hidden]{display:none!important}
@media(max-width:720px){.library-app{padding-inline:10px}.coordinate-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.location-heading,.bookshelf-heading{display:grid}.bookshelf-heading p{text-align:left}.page-controls{grid-template-columns:1fr 1fr}.page-controls label{grid-column:1/-1;grid-row:1}.page-controls .primary-action{grid-column:1/-1}.page-card pre{font-size:8px}.library-header{gap:11px}.library-header .home-link{width:46px;height:46px}.bookshelf{padding:10px}.shelf{padding-inline:9px}}
@media(max-width:420px){.coordinate-grid{grid-template-columns:1fr}.page-card{padding:9px}.page-card pre{min-height:300px;padding:12px;font-size:7px}.page-controls{padding:12px}.location-panel{border-radius:16px}}

/* Single-screen library layout. */
html,body{width:100%;height:100%;overflow:hidden}
body{min-height:100dvh}
.library-app{height:100dvh;max-height:100dvh;padding:8px 10px 10px;grid-template-rows:auto minmax(0,1fr);gap:8px;overflow:hidden}
.library-header{min-height:50px;padding:0;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px}
.library-header .home-link{width:46px;height:46px;border-radius:13px;font-size:15px;box-shadow:0 3px 0 #07100f}
.library-title{min-width:0}
.library-title .eyebrow,.library-title>p:last-child{display:none}
.library-title h1{margin:0;font-size:clamp(15px,3.2vw,28px);line-height:1.08;letter-spacing:-.015em;overflow-wrap:normal}
.header-actions{display:flex;align-items:stretch;gap:6px}
.teleport-button,.help-button{height:46px;border:1px solid #d0a758;border-radius:12px;background:#203b34;color:#f7e8c6;font-weight:800}
.teleport-button{width:clamp(108px,24vw,190px);padding:4px 10px;font-size:clamp(10px,2vw,14px);line-height:1.12}
.help-button{width:46px;padding:0;font:800 22px/1 "DM Mono",monospace}
.bookshelf-section{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);border-radius:16px}
.bookshelf-heading{min-height:42px;padding:6px 10px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px}
.bookshelf-heading>div{display:flex;align-items:baseline;gap:8px}
.bookshelf-heading span{margin:0;font-size:8px}
.bookshelf-heading h2{font-size:clamp(15px,2.5vw,21px)}
.bookshelf-heading p{max-width:none;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:right;font-size:9px}
.bookshelf{height:100%;min-height:0;padding:4px 5px 7px;display:grid;grid-template-rows:repeat(5,minmax(0,1fr));background:linear-gradient(90deg,#402216,#6f4027 5%,#4d2b1c 50%,#704329 95%,#3c2015)}
.shelf{height:100%;min-height:0;padding:13px 4px 7px;border-inline-width:4px;overflow:hidden;scrollbar-width:none}
.shelf::after{left:-4px;right:-4px;height:7px;border-block-width:1px;box-shadow:0 3px 0 #25130d}
.shelf-label{top:3px;left:6px;font-size:7px}
.shelf-books{width:100%;height:100%;min-width:0;grid-template-columns:repeat(19,minmax(0,1fr));align-items:stretch;gap:2px;background:#100906}
.book,.book:nth-child(3n),.book:nth-child(4n),.book:nth-child(5n){width:100%;min-width:0;height:100%;border-color:#c58b51;border-radius:2px 2px 1px 1px;background:#704128;color:#e8c89c;box-shadow:inset 1px 0 #ffffff17,inset -1px 0 #0005,0 1px 0 #160b08}
.book span{position:absolute;inset:14% 0 auto;display:grid;place-items:center;min-height:clamp(13px,2.6vh,20px);padding:1px;background:#100d0b;color:#f2dfba;border-block:1px solid #bd8952;writing-mode:horizontal-tb;transform:none;font:800 clamp(8px,1.55vw,14px)/1 "DM Mono",monospace;text-shadow:0 1px #000}
.book:hover,.book:focus-visible,.book.is-open{transform:none;filter:brightness(1.2)}
.book.is-open{outline:2px solid #ffd46f;outline-offset:-2px}
.book-color-0,.book-color-1,.book-color-2,.book-color-3,.book-color-4,.book-color-5,.book-color-6{background:#704128}

dialog::backdrop{background:#06100ddb;backdrop-filter:blur(3px)}
.popup-dialog,.reader{margin:auto;border:1px solid #a78856;border-radius:17px;background:#122320;color:var(--ink);box-shadow:0 22px 70px #000b}
.popup-dialog{width:min(680px,calc(100vw - 16px));max-width:none;max-height:calc(100dvh - 16px);padding:0;overflow:hidden}
.popup-dialog[open]{display:block}
.popup-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid #80674455}
.popup-heading>div{min-width:0}
.popup-heading span{display:block;margin-bottom:3px;color:var(--gold);font:500 9px/1.2 "DM Mono",monospace;letter-spacing:.13em;text-transform:uppercase}
.popup-heading h2{margin:0;font-size:clamp(18px,4vw,26px)}
.popup-heading .icon-button,.reader-heading .icon-button{flex:0 0 auto;width:39px;height:39px;min-height:39px;padding:0;font-size:17px}
.popup-dialog .location-panel{width:100%;padding:0 14px 14px;display:grid;gap:10px;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:hidden}
.popup-dialog .location-panel .popup-heading{margin-inline:-14px}
.coordinate-help{margin:0;color:var(--muted);font:400 10px/1.35 "DM Mono",monospace}
.coordinate-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.coordinate-grid label{gap:4px;font-size:12px}
.coordinate-grid input{height:39px;padding:7px 9px;font-size:13px}
.location-actions{gap:7px}.location-actions button{min-height:39px;padding:7px 13px}
.error-message{padding:7px 9px;font-size:10px}
.about-dialog{width:min(560px,calc(100vw - 16px))}
.about-dialog[open]{display:grid;grid-template-rows:auto minmax(0,1fr)}
.about-copy{display:grid;gap:10px;max-height:calc(100dvh - 90px);padding:15px;overflow-y:auto;overscroll-behavior:contain;color:var(--muted);font-size:14px;line-height:1.5;scrollbar-color:#ad8249 #0c1916}
.about-copy p{margin:0}
.library-rules{margin-top:5px;padding-top:15px;border-top:1px solid #80674488}
.library-rules h3{margin:0 0 11px;color:var(--gold);font-size:18px}
.library-rules ol{display:grid;gap:10px;margin:0;padding-left:24px}
.library-rules li{padding-left:3px;color:#e0d2b8}
.library-rules li::marker{color:var(--gold);font-family:"DM Mono",monospace;font-weight:800}

.reader{width:fit-content;height:max-content;min-height:0;max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);padding:0;overflow:hidden}
.reader[open]{display:grid;grid-template-rows:max-content max-content max-content;align-content:start}
.reader-heading{min-height:46px;padding:5px 10px;align-items:center}
.reader-heading span{font-size:8px;margin-bottom:2px}.reader-heading h2{font-size:17px}
.page-controls{min-height:48px;padding:5px 8px;grid-template-columns:auto minmax(110px,1fr) auto auto;align-items:center;gap:5px}
.page-controls button{min-height:37px;padding:6px 10px;font-size:12px}
.page-controls label{grid-template-columns:auto minmax(48px,80px) auto;gap:5px;font-size:11px}
.page-controls input{height:35px;padding:5px;font-size:12px}
.page-card{width:fit-content;min-width:100%;min-height:0;padding:6px 8px 8px;display:grid;place-items:center;background:#172723;color:#ead9b7;touch-action:pan-x pan-y pinch-zoom}
.page-meta{width:100%;min-height:30px;margin:0;gap:6px;color:#cbb990;font-size:9px}.page-meta button{min-height:29px;padding:4px 8px;font-size:10px}
.page-status{width:100%;min-height:14px;margin:0;color:#ad9e7d;font-size:8px}
.page-card pre{align-self:center;width:max-content;height:max-content;min-height:0;max-width:none;max-height:none;margin:0;padding:5px;border-radius:3px;background:var(--paper);font-size:8px;line-height:1.16;white-space:pre;overflow:hidden;touch-action:pan-x pan-y pinch-zoom;box-shadow:0 10px 35px #0007,inset 0 0 35px #8e6b2a17}

@media(max-width:720px){
  .library-app{padding:6px 6px 7px}
  .library-header{gap:6px}.library-header .home-link{width:42px;height:42px}.teleport-button,.help-button{height:42px}.help-button{width:42px}
  .bookshelf{padding:3px}.shelf{padding-inline:2px;border-inline-width:2px}.shelf::after{left:-2px;right:-2px}
  .coordinate-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .page-controls{grid-template-columns:auto minmax(105px,1fr) auto auto}.page-controls label{grid-column:auto;grid-row:auto}
  .page-controls .primary-action{grid-column:auto}
  .page-card{padding:4px}.page-card pre{padding:3px}
}
@media(max-width:420px){
  .library-title h1{font-size:14px}.teleport-button{width:106px;font-size:9px}.help-button{width:38px}.library-header .home-link{width:38px;font-size:13px}
  .bookshelf-heading{grid-template-columns:1fr}.bookshelf-heading p{display:none}.bookshelf-heading>div{justify-content:space-between}
  .coordinate-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .popup-dialog .location-panel{padding-inline:10px}.popup-dialog .location-panel .popup-heading{margin-inline:-10px}
  .page-controls{grid-template-columns:auto minmax(96px,1fr) auto auto}.reader[open]{grid-template-rows:max-content max-content max-content;align-content:start}
  .reader-heading{min-height:42px}.page-card pre{line-height:1.12}
}
@media(max-height:620px){
  .library-header{min-height:40px}.library-header .home-link,.teleport-button,.help-button{height:38px}.library-header .home-link,.help-button{width:38px}
  .bookshelf-heading{min-height:34px;padding-block:3px}.bookshelf-heading span{display:none}
  .popup-heading{padding-block:8px}.coordinate-help{display:none}.coordinate-grid input{height:34px}.coordinate-grid label{font-size:10px}
  .reader-heading{min-height:38px}.page-controls{min-height:42px}.page-controls button{min-height:32px}.page-controls input{height:31px}
}

/* Overhead stacks and popup bookcase. */
.library-scene-section{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;border:1px solid #a7885666;border-radius:16px;background:#122320e8;box-shadow:0 18px 50px #02080766,0 5px 0 #08110f}
.scene-heading{min-height:42px;padding:6px 10px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;border-bottom:1px solid #80674455}
.scene-heading>div{display:flex;align-items:baseline;gap:8px;min-width:0}
.scene-heading span{color:var(--gold);font:500 8px/1.2 "DM Mono",monospace;letter-spacing:.13em;text-transform:uppercase}
.scene-heading h2{margin:0;font-size:clamp(15px,2.5vw,21px)}
.scene-heading p{min-width:0;margin:0;overflow:hidden;color:var(--muted);font:400 9px/1.3 "DM Mono",monospace;text-align:right;text-overflow:ellipsis;white-space:nowrap}
.library-scene{position:relative;min-height:0;overflow:hidden;touch-action:none;outline:none;background:#000}
.library-scene::before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#020807bb,transparent 18% 82%,#020807bb),linear-gradient(#020807aa,transparent 16% 84%,#020807aa);z-index:3}
.scene-grid{position:absolute;inset:0;will-change:transform}
.scene-floor{position:absolute;z-index:0;inset:-176px;background-color:#696e6d;background-image:linear-gradient(90deg,transparent 0 43px,#383d3c 43px 45px,transparent 45px),linear-gradient(0deg,transparent 0 41px,#383d3c 41px 43px,transparent 43px),linear-gradient(135deg,#ffffff0d,#00000016);background-position:center;background-size:88px 84px,88px 84px,100% 100%;box-shadow:inset 0 0 90px #0008}
.scene-shelf{position:absolute;z-index:1;left:calc(50% + var(--shelf-x));top:calc(50% + var(--shelf-y));width:64px;height:38px;min-width:0;min-height:0;padding:0;border:2px solid #32180f;border-radius:0;background:#704128;box-shadow:inset 0 0 0 2px #9a603966,0 4px 0 #241109,0 7px 10px #0007;transform:translate(-50%,-50%);transition:filter .12s,transform .12s}
.scene-shelf:hover,.scene-shelf:focus-visible{z-index:4;filter:brightness(1.22);transform:translate(-50%,-50%) scale(1.06)}
.scene-boundary{position:absolute;z-index:3;pointer-events:none;background:#000}
.boundary-left{left:calc(50% + var(--boundary-offset));top:-100vh;width:200vw;height:300vh;transform:translateX(-100%)}
.boundary-right{left:calc(50% + var(--boundary-offset));top:-100vh;width:200vw;height:300vh}
.boundary-bottom{left:-100vw;top:calc(50% + var(--boundary-offset));width:300vw;height:200vh}
.boundary-top{left:-100vw;top:calc(50% + var(--boundary-offset));width:300vw;height:200vh;transform:translateY(-100%)}
.scene-wall{position:absolute;z-index:4;pointer-events:none;background:linear-gradient(90deg,#2b1a10,#765036 45% 55%,#2b1a10);box-shadow:0 0 0 2px #150c08,0 0 15px #000c}
.wall-vertical{left:calc(50% + var(--wall-position));top:calc(50% + var(--wall-start));width:12px;height:var(--wall-length);transform:translateX(-50%)}
.wall-horizontal{left:calc(50% + var(--wall-start));top:calc(50% + var(--wall-position));width:var(--wall-length);height:12px;transform:translateY(-50%);background:linear-gradient(#2b1a10,#765036 45% 55%,#2b1a10)}
.scene-player{position:absolute;z-index:5;left:50%;top:50%;width:22px;height:22px;display:grid;place-items:center;transform:translate(-50%,-50%);border:3px solid #f3dfb5;border-radius:50%;background:#030504;box-shadow:0 3px 12px #000,0 0 0 5px #08100dcc;pointer-events:none}
.scene-player span{display:none}
.scene-instructions{position:absolute;z-index:5;left:50%;bottom:10px;max-width:calc(100% - 24px);margin:0;padding:6px 10px;transform:translateX(-50%);border:1px solid #c59d5577;border-radius:999px;background:#081310dd;color:#f0dbb1;font:500 clamp(8px,2vw,11px)/1.2 "DM Mono",monospace;text-align:center;white-space:nowrap;pointer-events:none}

.bookshelf-overlay{position:fixed;z-index:1000;inset:0;display:grid;place-items:center;padding:12px;background:#06100ddb;backdrop-filter:blur(3px)}
.bookshelf-overlay[hidden]{display:none}
.bookshelf-dialog{width:min(900px,calc(100vw - 16px));height:min(720px,calc(100dvh - 24px));max-width:none;max-height:none;padding:0;display:grid;grid-template-rows:max-content minmax(0,1fr);overflow:hidden}
.bookshelf-popup-heading{min-height:48px}
.bookshelf-dialog .bookshelf{height:100%;min-height:0}
.bookshelf-overlay.guard-release-click .book{pointer-events:none}
.reader{max-width:calc(100vw - 32px)}

@media(max-width:520px){
  .scene-heading{grid-template-columns:1fr}.scene-heading p{display:none}.scene-heading>div{justify-content:space-between}
  .scene-grid{inset:0;width:auto;height:auto}
  .scene-shelf{width:58px;height:34px;border-width:1px;box-shadow:inset 0 0 0 2px #9a603966,0 3px 0 #241109,0 6px 9px #0007}
  .scene-player{width:21px;height:21px}
  .bookshelf-overlay{padding:6px}
  .bookshelf-dialog{width:100%;height:min(680px,calc(100dvh - 12px))}
}

.library-debug{position:fixed;z-index:5000;right:6px;bottom:6px;width:min(390px,calc(100vw - 12px));max-height:min(46dvh,430px);padding:7px;display:grid;grid-template-rows:auto minmax(70px,1fr) auto;gap:6px;border:2px solid #e9d49e;border-radius:10px;background:#07110ff2;color:#f7ecd2;box-shadow:0 8px 30px #000c;font:500 11px/1.35 "DM Mono",monospace}
.library-debug[hidden]{display:none}
.library-debug-heading,.library-debug-actions{display:flex;align-items:center;gap:5px}.library-debug-heading{justify-content:space-between}.library-debug-heading strong{font-size:13px}
.library-debug button{min-height:30px;padding:4px 7px;border:1px solid #b89658;border-radius:6px;background:#1d3932;color:#fff;font:inherit}
.library-debug-output{min-height:70px;margin:0;padding:6px;overflow:auto;border:1px solid #52665e;background:#000;color:#d8f0e8;white-space:pre-wrap;overflow-wrap:anywhere;user-select:text}
.library-debug-actions{flex-wrap:wrap}.library-debug.is-minimized{grid-template-rows:auto}.library-debug.is-minimized .library-debug-output,.library-debug.is-minimized .library-debug-actions{display:none}
