/* Shared scene imagery connects the library and the room. */
#sceneGrid{perspective:1400px;gap:28px;padding:12px 4px 32px}
#sceneGrid .scene-card{border-radius:24px;overflow:hidden;transition:transform .35s,box-shadow .35s;box-shadow:0 12px 25px #293d3010;transform:rotateY(-3deg)}
#sceneGrid .scene-card:nth-child(even){transform:rotateY(3deg)}
#sceneGrid .scene-card:hover,#sceneGrid .scene-card:focus-visible{transform:translateY(-5px) rotateY(0);box-shadow:0 22px 36px #293d3024}
#sceneGrid .card-photo{height:245px}#sceneGrid .card-body{padding:20px}
.scene-space{--space-ink:#fff9ee;position:relative;height:calc(100dvh - 165px);min-height:480px;isolation:isolate;overflow:hidden;border-radius:24px;background:#252c29;color:var(--space-ink);box-shadow:0 15px 32px #25392c25}
.space-header{position:absolute;inset:0 0 auto;z-index:4;display:flex;align-items:center;gap:18px;padding:20px 24px;background:linear-gradient(#15201be8,transparent)}
.space-header>div{flex:1;min-width:0}.space-header h1{font-size:24px;color:inherit;margin:4px 0;line-height:1.3}.space-header small{color:#eee9dd}.scene-space button{cursor:pointer;min-height:44px}.space-back,.space-edit{border:1px solid #ffffff65;border-radius:30px;padding:0 16px;color:white;background:#17241dc9;backdrop-filter:blur(12px)}
.space-viewport{position:absolute;inset:0;display:flex;align-items:center;overflow:hidden}.space-plane{position:relative;width:100%;flex-shrink:0;transition:transform .7s cubic-bezier(.22,.7,.18,1);will-change:transform}.space-plane>img{display:block;width:100%;height:auto}.space-vignette{position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 100px #09140e65;background:linear-gradient(0deg,#101e17bf,transparent 40%,transparent 75%,#101e1760)}
.space-hotspot{position:absolute;z-index:2;transform:translate(-50%,-50%);display:flex;align-items:center;gap:8px;background:#203e33dd;color:white;border:1px solid #fff9;border-radius:28px;padding:4px 12px 4px 4px;box-shadow:0 3px 14px #0003;white-space:nowrap}.space-hotspot span{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#f7f0de;color:#284d3f}.space-hotspot b{font-size:13px;font-weight:500}.space-hotspot.active{background:#a84f34}.space-caption{position:absolute;left:28px;bottom:94px;max-width:55%;pointer-events:none}.space-caption span{font-size:11px;letter-spacing:2px;color:#f1e3c8}.space-caption p{font-size:22px;line-height:1.6;margin:12px 0;text-shadow:0 2px 10px #0009}
.space-dock{position:absolute;z-index:4;bottom:24px;left:24px;display:flex;gap:7px;padding:7px;border:1px solid #fff4;border-radius:40px;background:#18291fe6;backdrop-filter:blur(16px)}.space-dock button{border:0;background:transparent;color:#fff8e8;border-radius:26px;padding:0 16px}.space-dock button[aria-pressed=true]{background:#ffffff26}.space-dock .space-talk{background:#f1e7d2;color:#234535;display:flex;align-items:center;gap:10px}.role-dot{display:grid;place-items:center;background:#ad5639;color:white;border-radius:50%;width:28px;height:28px;font-size:13px}
.space-panel{position:absolute;z-index:5;right:18px;top:100px;bottom:20px;width:min(390px,44%);border:1px solid #e7e0d2;border-radius:20px;background:#fffdf6;color:#273c32;box-shadow:0 14px 36px #0004;overflow:auto;overscroll-behavior:contain}.space-panel[hidden],.scene-space [hidden]{display:none!important}.space-panel-head{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;border-bottom:1px solid #e8e3d6;position:sticky;top:0;background:#fffdf6;z-index:2}.space-panel-head button{border:0;background:none;font-size:24px;color:#405449;width:44px}.space-objects,.space-expression{padding:20px}.space-objects>button:not(.btn){display:flex;width:100%;gap:16px;align-items:center;background:#f1f1e6;border:0;border-radius:14px;margin:10px 0;padding:14px;text-align:left;color:#294b3d}.space-objects button div{flex:1}.space-objects small{display:block;margin-top:5px}.space-expression h2{font-size:30px;margin:14px 0}.space-expression p{line-height:1.8}.space-expression>.btn{margin-top:24px}.space-chat .chat-box{border:0;box-shadow:none;border-radius:0}.space-chat .messages{height:210px;min-height:100px}.space-chat .chat-head{padding:12px;flex-wrap:wrap}.space-chat .sample-note{font-size:11px}.space-chat .composer{padding:12px}.space-chat .compose-tools{flex-wrap:wrap}.space-transition{position:fixed;z-index:1000;pointer-events:none;object-fit:cover;transform-origin:top left;box-shadow:0 0 0 1px #ffffff30}
@media(max-width:800px){#sceneGrid{gap:18px}#sceneGrid .scene-card{transform:none!important}#sceneGrid .card-photo{height:220px}.scene-space{height:calc(100dvh - 164px);min-height:440px;border-radius:20px}.space-header{padding:14px 12px;gap:10px}.space-header h1{font-size:18px}.space-header small{font-size:10px}.space-back,.space-edit{padding:0 10px;font-size:12px}.space-plane{width:150%;margin-left:-25%}.space-hotspot b{display:none}.space-caption{left:20px;bottom:100px;max-width:85%}.space-caption p{font-size:19px}.space-dock{left:10px;right:10px;bottom:15px;justify-content:center;padding:5px;gap:2px}.space-dock button{padding:0 11px;font-size:13px}.space-panel{left:8px;right:8px;top:auto;bottom:78px;width:auto;max-height:65%;border-radius:18px}.space-chat .messages{height:150px}.space-expression h2{font-size:26px}}
@media(prefers-reduced-motion:reduce){.space-plane,#sceneGrid .scene-card{transition:none!important}.space-transition{display:none}}

.space-plane{position:absolute;top:0;left:0;margin:0}.space-caption{pointer-events:none}


/* Scene covers are doors; utility information stays quiet. */
#sceneGrid{grid-template-columns:repeat(auto-fit,minmax(250px,1fr));align-items:start;gap:22px;padding-top:8px}
#sceneGrid .scene-card{position:relative;min-height:370px;max-width:440px;border:1px solid #ffffff70;text-align:left;transform:none;border-radius:24px;background:#233a30;box-shadow:0 12px 26px #283d3016}
#sceneGrid .scene-card:nth-child(even){transform:none}
#sceneGrid .card-photo{position:absolute;inset:0;height:100%;border-radius:inherit}
#sceneGrid .card-photo img{width:100%;height:100%;object-fit:cover;transition:transform .6s cubic-bezier(.2,.7,.2,1)}
#sceneGrid .card-photo:after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,#12251e30 0%,transparent 25%,#12251ee8 100%)}
#sceneGrid .badge{z-index:1;top:16px;left:16px;background:#fffaf0ed;color:#2b483a;border-radius:20px;padding:6px 12px;font-size:11px}
#sceneGrid .card-body{position:relative;display:flex;flex-direction:column;justify-content:end;min-height:370px;padding:26px;color:#fffaf0;background:none}
#sceneGrid .card-body h3{color:inherit;font-size:24px;line-height:1.35;margin:0 0 10px;max-width:90%;text-shadow:0 2px 12px #0004}
#sceneGrid .saved-intent{color:#f2eee3;font-size:13px;line-height:1.8;margin:0 0 18px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#sceneGrid .scene-tags{display:none}#sceneGrid .meta{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#dfdfd2;border-top:1px solid #ffffff40;padding-top:16px;font-size:11px}
#sceneGrid .meta>span:last-child{color:#fffaf0;font-size:13px}#sceneGrid .scene-card:hover .card-photo img{transform:scale(1.045)}
.scene-space[data-tool="expression"] .space-panel{top:auto;bottom:24px;width:min(330px,40%);max-height:calc(100% - 120px);height:auto}
.scene-space[data-tool="objects"] .space-panel{top:100px;bottom:auto;max-height:calc(100% - 124px)}
.space-panel{transition:width .22s ease,box-shadow .22s ease}.space-panel.is-open{animation:space-tool-in .24s ease-out}
.space-expression{padding:18px 22px 22px}.space-expression h2{font-size:29px;line-height:1.25;margin:8px 0 16px;overflow-wrap:anywhere;outline:none}.space-expression p{font-family:Georgia,serif;font-size:19px;line-height:1.6;margin-bottom:18px}.space-expression .muted{font-family:inherit;font-size:13px}.space-expression>.btn{margin-top:18px}.space-panel-head{padding:4px 14px;background:#fffdf6}.space-panel-head strong{font-size:12px;font-weight:500;color:#647162}.space-panel-head button{font-size:21px}.space-expression .row{gap:8px}
.space-caption{transition:opacity .2s}.scene-space:not([data-tool=""]) .space-caption{opacity:0}.space-caption p{font-size:18px;max-width:420px}.space-hotspot{min-width:44px;min-height:44px;padding:5px;background:#1c392ed9;transition:background .2s}.space-hotspot b{max-width:0;opacity:0;overflow:hidden;transition:max-width .2s,opacity .2s}.space-hotspot:hover b,.space-hotspot:focus-visible b,.space-hotspot.active b{max-width:160px;opacity:1;padding-right:8px}.space-hotspot span{width:28px;height:28px;font-size:12px}.space-hotspot.active{background:#a65337}
@keyframes space-tool-in{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}
@media(max-width:800px){#sceneGrid{grid-template-columns:1fr;gap:20px}#sceneGrid .scene-card{max-width:none;min-height:340px}#sceneGrid .card-photo{height:100%}#sceneGrid .card-body{min-height:340px;padding:24px}#sceneGrid .card-body h3{font-size:23px}.scene-space[data-tool="expression"] .space-panel,.scene-space[data-tool="objects"] .space-panel{top:auto;bottom:80px;left:10px;right:10px;width:auto;max-height:62%}.space-expression{padding:14px 18px 18px}.space-expression h2{font-size:26px}.space-expression p{font-size:17px}.space-hotspot b{display:none}.space-header h1{font-size:17px}.space-caption p{font-size:17px}}
@media(prefers-reduced-motion:reduce){.space-panel.is-open{animation:none}#sceneGrid .card-photo img{transition:none}#sceneGrid .scene-card:hover .card-photo img{transform:none}}

.scene-space[data-tool="chat"] .space-panel{display:flex;flex-direction:column;overflow:hidden}.space-chat:not([hidden]){display:flex;flex:1;min-height:0;flex-direction:column}.space-chat .chat-box{display:flex;flex:1;min-height:0;flex-direction:column;margin:0}.space-chat .messages{flex:1;height:auto;min-height:75px;overflow:auto;padding:14px}.space-chat .composer{flex-shrink:0;padding:10px 12px}.space-chat .chat-head{flex-shrink:0;padding:8px 12px}.space-chat .compose-tools{gap:10px;font-size:11px}.space-chat .sample-note{display:none}.space-topic-index{flex-shrink:0;border-bottom:1px solid #e8e3d6}.space-topic-index>summary{padding:10px 16px;font-size:12px;cursor:pointer}.space-topic-index .topic-rail{margin:0;padding:8px;border:0;border-radius:0}.space-topic-index .topic-cards{max-height:150px;overflow:auto}.space-topic-index .note{margin:8px}.space-chat .composer textarea{min-height:48px;max-height:100px}@media(max-width:800px){.scene-space[data-tool="chat"] .space-panel{top:90px;bottom:78px;max-height:none}.space-chat .chat-head .avatar{display:none}.space-chat .chat-head{font-size:12px}.space-chat .compose-tools{gap:8px}.space-chat .compose-tools button{min-height:32px;padding:2px}.space-chat .conversation-empty{padding:6px}}
