:root{--ink:#111;--muted:#767676;--line:#e4e4e4;--paper:#fff;--editor-width:440px;font-family:Arial,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}
*{box-sizing:border-box}body{margin:0;overflow:hidden}button,input,textarea{font:inherit;color:inherit}button{cursor:pointer;background:none;border:0;padding:0}button:disabled{opacity:.4;cursor:wait}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #111;outline-offset:4px}button,svg{touch-action:manipulation}button{ -webkit-tap-highlight-color:transparent}button:hover{opacity:.63}button:active{transform:translateY(1px)}[hidden]{display:none!important}svg{display:block}::selection{background:#111;color:white}.header{height:92px;padding:0 44px;display:flex;align-items:center;gap:30px;position:relative;z-index:5;background:white;border-bottom:1px solid #eee}.brand{display:flex;align-items:center;gap:11px;font-size:20px;letter-spacing:5px;font-weight:600}.brand-mark{width:26px;height:26px;border:1.5px solid #111;border-radius:50%;display:grid;place-items:center}.brand-mark i{width:5px;height:5px;border-radius:50%;background:#111}.header-note{font-size:12px;color:#858585;letter-spacing:2px}.header-actions{display:flex;align-items:center;gap:32px;margin-left:auto;font-size:13px}.small-arrow{margin-left:10px}.create-button{display:flex;align-items:center;gap:7px}.create-button>span:first-child{font-size:24px;font-weight:200}.identity-button{display:flex;align-items:center;gap:9px;border-left:1px solid var(--line);padding-left:25px;font-family:monospace;font-size:11px}.identity-dot{width:7px;height:7px;border-radius:50%;background:#111}main{height:calc(100dvh - 92px);display:flex;position:relative}.world-view{position:relative;flex:1;min-width:0;overflow:hidden}.world-mount{position:absolute;inset:0}.world-mount iframe{width:100%;height:100%;border:0;display:block}.world-heading{position:absolute;left:44px;top:37px;pointer-events:none}.eyebrow{font-family:Arial,"PingFang SC",sans-serif;font-size:10px;letter-spacing:2px;color:#777;text-transform:uppercase;display:flex;align-items:center;gap:10px}.live-line{height:1px;width:19px;background:#aaa}h1,h2,p{margin:0}h1{font-family:"Songti SC","Noto Serif CJK SC",Georgia,serif;font-weight:400;font-size:52px;letter-spacing:6px;margin:15px 0 10px}.world-heading p{font-size:12px;color:#777;letter-spacing:1px}.side-worlds{position:absolute;right:34px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:22px}.portal-button{font-size:11px;display:flex;align-items:center;justify-content:flex-end;gap:15px;color:#888;min-height:26px;padding:5px}.portal-button .portal-circle{width:7px;height:7px;border:1px solid #aaa;border-radius:50%;transition:all .2s}.portal-button.active{color:#111}.portal-button.active .portal-circle{background:#111;border-color:#111;box-shadow:0 0 0 5px white,0 0 0 6px #aaa}.portal-number{font-family:monospace;opacity:.55;font-size:9px;margin-right:8px}.world-bottom{position:absolute;bottom:68px;left:50%;transform:translateX(-50%);text-align:center;pointer-events:none}.equation{font-family:Georgia,"Times New Roman",serif;font-size:25px;white-space:nowrap;color:#333;letter-spacing:1px}.equation span{font-style:italic}.equation sub,.about-equation sub{font-size:10px;letter-spacing:0}.world-toolbar{display:flex;justify-content:center;align-items:center;gap:16px;margin-top:22px;pointer-events:auto}.icon-button{width:32px;height:34px;display:grid;place-items:center}.icon-button svg{width:19px;height:19px;fill:none;stroke:#222;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}.toolbar-divider{height:18px;width:1px;background:#ddd;margin:0 2px}.rule-button{font-size:12px;white-space:nowrap;background:#111;color:#fff;padding:14px 18px;display:flex;align-items:center;gap:10px}.code-icon{font:14px Georgia,serif;color:#aaa}.rule-button .small-arrow{margin-left:13px}.world-footer{position:absolute;bottom:25px;left:44px;right:44px;display:flex;justify-content:space-between;align-items:center;font-size:10px;letter-spacing:.6px;color:#888;gap:15px;pointer-events:none}.world-footer button{pointer-events:auto;font-size:10px;white-space:nowrap}.tiny-cross{font-size:16px;margin-right:6px;color:#555}.world-footer button span{margin-left:6px}.editor{width:var(--editor-width);flex-shrink:0;background:white;border-left:1px solid var(--line);display:flex;flex-direction:column;padding:28px 26px 22px;z-index:8}.editor-top{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:27px}.editor h2{font-family:"Songti SC",Georgia,serif;font-size:25px;font-weight:400;letter-spacing:2px;margin-top:8px}.close-button{font-size:27px;font-weight:200;line-height:24px;width:30px;height:30px;display:grid;place-items:center;color:#666}.field-label{display:block;font-size:10px;letter-spacing:1px;color:#888;margin-bottom:9px}.name-input{width:100%;border:0;border-bottom:1px solid #ddd;padding:6px 0 11px;background:transparent;font-size:15px;border-radius:0}.code-toolbar{display:flex;justify-content:space-between;align-items:center;margin:24px 0 13px;font-size:10px;color:#888}.code-toolbar button{font-size:11px;color:#333}.code-wrap{display:flex;min-height:130px;flex:1;border:1px solid #e8e8e8;background:#fcfcfc;overflow:hidden}.code-wrap pre{padding:14px 8px 14px 10px;margin:0;text-align:right;color:#b6b6b6;background:#f7f7f7;overflow:hidden;user-select:none;border-right:1px solid #ececec;min-width:37px;font:11px/21px "SFMono-Regular",Consolas,monospace}.code-wrap textarea{flex:1;min-width:0;width:100%;resize:none;padding:14px 12px;border:0;background:transparent;outline:none;font:11px/21px "SFMono-Regular",Consolas,monospace;tab-size:2;border-radius:0}.code-wrap textarea:focus-visible{outline:none}.editor-status{font-size:10px;color:#777;line-height:1.6;min-height:45px;padding:10px 0;overflow-wrap:anywhere}.editor-status.error{color:#111;border-bottom:1px dashed #111}.editor-actions{display:flex;gap:10px}.primary-button{background:#111;color:white;padding:14px 20px;font-size:12px;display:flex;align-items:center;justify-content:center;gap:20px;min-height:44px;white-space:nowrap}.primary-button>span{font-size:10px;color:#bbb;margin-left:auto}.editor-actions .primary-button{flex:1}.secondary-button{border:1px solid #bbb;padding:12px 22px;font-size:12px;min-height:44px;white-space:nowrap}.editor-bottom{display:flex;align-items:center;justify-content:space-between;font-size:9px;color:#999;margin-top:19px}.editor-bottom button{font-size:10px;color:#555}.editor-open .world-heading{left:32px}.editor-open .side-worlds{right:20px}.editor-open .world-footer{left:32px;right:26px}.editor-open .world-footer #worldHint{max-width:220px;line-height:1.6}.editor-open h1{font-size:43px}.editor-open .world-bottom{bottom:70px}.map-overlay{position:fixed;inset:92px 0 0;background:#fff;z-index:15;padding:38px 44px 28px;display:flex;flex-direction:column}.map-top{display:flex;justify-content:space-between}.map-top h2{font-family:"Songti SC",Georgia,serif;font-size:34px;letter-spacing:4px;font-weight:400;margin:14px 0 12px}.map-top p{font-size:12px;color:#888;letter-spacing:.5px}.map-cosmos{position:relative;flex:1;min-height:200px;margin:8px 30px}.map-cosmos>svg{position:absolute;width:100%;height:100%;overflow:visible}.map-cosmos #mapNodes{position:absolute;inset:0}.map-node{position:absolute;transform:translate(-50%,-50%);text-align:center;display:flex;flex-direction:column;align-items:center;gap:14px;min-width:90px}.map-node:active{transform:translate(-50%,-50%) scale(.98)}.map-orb{width:82px;height:82px;border:1px solid #777;border-radius:50%;display:grid;place-items:center;background:#fff;position:relative;transition:transform .3s}.map-orb:before{content:"";position:absolute;inset:10px;border:1px solid #ddd;border-radius:50%}.map-orb i{width:5px;height:5px;background:#111;border-radius:50%}.map-node.selected .map-orb{width:118px;height:118px;border-color:#111}.map-node.selected .map-orb:after{content:"";position:absolute;left:-15px;right:-15px;top:43px;height:27px;border:1px solid #999;border-radius:50%;transform:rotate(-26deg)}.map-node:hover{opacity:1}.map-node:hover .map-orb{transform:scale(1.07)}.map-node strong{font-size:12px;font-weight:400;letter-spacing:2px}.map-node small{font:9px monospace;color:#aaa;letter-spacing:1px}.map-node.add .map-orb{border-style:dashed;border-color:#aaa;font-size:25px;font-weight:200}.map-node.add .map-orb:before{display:none}.map-bottom{display:flex;justify-content:space-between;align-items:center;gap:25px;padding-top:20px;border-top:1px solid #eee;color:#888;font-size:11px}.map-bottom>div{display:flex;gap:28px;align-items:center}.map-bottom .text-button{font-size:12px;color:#444}.dialog{border:1px solid #ddd;padding:40px;width:min(470px,calc(100vw - 36px));max-height:calc(100dvh - 40px);overflow:auto;box-shadow:0 20px 80px #0000000d;color:#111;background:white}.dialog::backdrop{background:#ffffffc9;backdrop-filter:blur(7px)}.dialog-close{position:absolute;right:16px;top:16px}.dialog h2{font-family:"Songti SC",Georgia,serif;font-weight:400;font-size:30px;line-height:1.6;letter-spacing:2px;margin:19px 0 15px}.dialog p{font-size:12px;color:#777;line-height:1.9;margin:14px 0}.dialog .field-label{margin-top:29px}.dialog-input{padding:12px 0;border:0;border-bottom:1px solid #bbb;width:100%;outline:none;background:white;font-size:16px;border-radius:0}.full-width{width:100%;margin-top:25px;justify-content:space-between}.quiet-note{display:block;font-size:10px;color:#999;line-height:1.8;margin-top:15px}.about-equation{font-family:Georgia,serif;font-size:26px;margin:20px 0 25px}.large-identity{display:grid;place-items:center;width:100px;height:100px;border:1px solid #111;border-radius:50%;margin:30px auto}.large-identity i{width:12px;height:12px;border-radius:50%;background:#111}.identity-code{display:block;border-top:1px solid #eee;border-bottom:1px solid #eee;padding:14px 0;overflow-wrap:anywhere;font-size:10px}.ai-dialog{width:min(600px,calc(100vw - 36px))}.ai-dialog textarea{width:100%;height:220px;resize:vertical;min-height:120px;max-height:40dvh;background:#fafafa;border:1px solid #ddd;padding:16px;font:11px/1.8 monospace}.confirm-actions{display:flex;gap:12px;margin-top:28px}.confirm-actions button{flex:1}.cancel-confirm{display:block;font-size:11px;color:#888;margin:20px auto 0}.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:100;background:#111;color:white;font-size:12px;line-height:1.7;padding:12px 20px;max-width:calc(100vw - 32px);box-shadow:0 5px 20px #0001;pointer-events:none;text-align:center}.dialog[open]{animation:reveal .18s ease-out}@keyframes reveal{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.play-guide-button{pointer-events:auto;display:inline-flex;align-items:center;gap:8px;min-height:26px;margin-top:12px;font-size:10px;letter-spacing:.3px;color:#777}.instructions-label{margin-top:18px}.instructions-input{width:100%;height:58px;min-height:58px;max-height:110px;resize:vertical;flex-shrink:0;border:1px solid #e8e8e8;border-radius:0;background:#fcfcfc;padding:10px 11px;font:11px/1.6 Arial,sans-serif}.editor{overflow-y:auto}.play-guide-dialog #guideInstructions{white-space:pre-line;overflow-wrap:anywhere}
@media(min-width:1600px){.header{padding:0 62px}.world-heading{left:62px;top:47px}.world-footer{left:62px;right:62px}.world-bottom{bottom:85px}.side-worlds{right:55px}}
@media(max-width:1000px){:root{--editor-width:380px}.header{padding:0 28px;height:76px}.header-note{display:none}main{height:calc(100dvh - 76px)}.world-heading{left:28px;top:30px}.world-footer{left:28px;right:28px}.side-worlds{right:22px}.editor{padding:24px 20px 19px}.editor-open .world-heading{left:22px}.editor-open h1{font-size:36px}.editor-open .side-worlds{right:10px}.editor-open .portal-button>span:first-child{display:none}.editor-open .world-footer #worldHint{max-width:180px}.map-overlay{top:76px;padding:30px 28px 25px}.map-top h2{font-size:29px}.map-cosmos{margin:8px 0}}
@media(max-width:700px){.header{padding:0 21px;height:70px;gap:15px}.brand{font-size:17px;letter-spacing:4px;gap:8px}.brand-mark{width:23px;height:23px}.header-actions{gap:21px;font-size:12px}.identity-button{padding-left:16px}.identity-button>span:last-child{display:none}.create-button{gap:3px}.header-actions .small-arrow{margin-left:5px}main{height:calc(100dvh - 70px)}.world-heading{left:24px;top:28px}h1{font-size:40px;margin-top:13px}.world-heading p{font-size:11px}.eyebrow{font-size:9px}.side-worlds{right:16px;top:42%;gap:16px}.portal-button{font-size:10px;gap:11px}.portal-number{display:none}.world-bottom{bottom:75px}.equation{font-size:22px}.world-toolbar{gap:12px;margin-top:17px}.world-footer{bottom:22px;left:24px;right:24px;font-size:9px;align-items:flex-end}.world-footer #worldHint{max-width:220px;line-height:1.7}.world-footer button{font-size:9px}.rule-button{font-size:11px;padding:13px 15px}.editor{position:absolute;inset:0;width:100%;padding:24px;z-index:12}.editor-top{margin-bottom:17px}.editor h2{font-size:24px}.code-toolbar{margin-top:20px}.editor .code-wrap textarea,.code-wrap pre{font-size:12px;line-height:22px}.map-overlay{top:70px;padding:27px 24px 22px}.map-top h2{font-size:25px;letter-spacing:2px}.map-top p{font-size:11px}.map-node.selected .map-orb{width:83px;height:83px}.map-node.selected .map-orb:after{top:29px;height:23px}.map-orb{width:61px;height:61px}.map-node{min-width:60px;gap:11px}.map-node strong{font-size:10px}.map-node small{font-size:8px}.map-bottom{align-items:flex-start;gap:15px;flex-direction:column;padding-top:14px;font-size:9px}.map-bottom>div{width:100%;justify-content:space-between}.map-bottom .primary-button{padding:12px 15px;font-size:11px}.map-bottom .text-button{font-size:11px}.dialog{padding:33px 28px}.dialog h2{font-size:27px}.confirm-actions{gap:8px}.confirm-actions button{padding:12px 15px}.toast{bottom:20px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

.commons-canvas{position:absolute;inset:0;width:100%;height:100%;display:block;cursor:crosshair;touch-action:manipulation}
.commons-connection{position:absolute;left:50%;top:51%;transform:translate(-50%,-50%);text-align:center;max-width:320px;pointer-events:none}
.commons-connection p{font-size:12px;line-height:1.8;color:#999;background:#fff;padding:10px}
.commons-connection button{pointer-events:auto;margin-top:12px;font-size:12px;color:#444}
.commons-portals{position:absolute;right:35px;top:46%;display:flex;flex-direction:column;gap:25px;align-items:flex-end}
.commons-portals button{font-size:11px;color:#777;letter-spacing:.5px;padding:6px}
.community-button{white-space:nowrap}.community-button>span{font:10px ui-monospace,monospace;color:#888;margin-left:5px}
.social-panel{width:320px;flex-shrink:0;border-left:1px solid var(--line);background:#fff;padding:27px 24px 20px;z-index:9;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.social-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.social-top h2{font:400 22px/1.4 Georgia,serif;letter-spacing:1px;margin-top:9px}
.connection-row{display:flex;align-items:center;justify-content:space-between;margin:20px 0 15px;font:10px ui-monospace,monospace;color:#999;gap:10px}
.connection-row .is-online{color:#555}.connection-row .is-online:before{content:' ';display:inline-block;width:4px;height:4px;border-radius:50%;background:#111;margin-right:7px}
.social-section-title{font-size:10px;letter-spacing:.3px;color:#999;margin-bottom:10px}.people-section{max-height:24dvh;min-height:65px;overflow:auto;flex-shrink:0}
.person-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:41px}.person-enter{display:grid;grid-template-columns:6px 1fr;gap:4px 9px;align-items:center;text-align:left;min-width:0;padding:6px 0}
.person-enter strong{font:10px ui-monospace,monospace;font-weight:400;overflow-wrap:anywhere}.person-enter small{grid-column:2;font-size:9px;color:#999;line-height:1.3}.person-dot{display:inline-block;width:5px;height:5px;border-radius:50%;background:#111}
.quiet-action{font-size:9px;color:#999;white-space:nowrap;padding:5px 0}.social-empty{font-size:11px;color:#aaa;line-height:1.8;padding:8px 0}
.published-worlds{border-top:1px solid #eee;border-bottom:1px solid #eee;margin-top:15px;padding:12px 0;font-size:10px;max-height:170px;overflow:auto;flex-shrink:0}.published-worlds summary{cursor:pointer;list-style:none;color:#777}.published-worlds summary::-webkit-details-marker{display:none}.published-worlds summary span{float:right}.published-worlds[open] summary{margin-bottom:9px}
.shared-world-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.shared-world-enter{display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:9px 0;min-width:0;text-align:left}.shared-world-enter span{font-size:11px;overflow-wrap:anywhere}.shared-world-enter small{font:9px ui-monospace,monospace;color:#aaa}
.chat-section{display:flex;flex-direction:column;min-height:190px;flex:1;margin-top:17px}.chat-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:10px;color:#999;margin-bottom:12px}.chat-heading select{max-width:155px;border:0;background:white;color:#555;font-size:10px;padding:4px 0;border-radius:0}
.chat-messages{flex:1;overflow:auto;min-height:60px;overscroll-behavior:contain;padding-right:5px}.chat-message{margin-bottom:18px}.message-meta{display:flex;align-items:center;justify-content:space-between;gap:7px;font:9px ui-monospace,monospace;color:#aaa}.message-meta strong{font-weight:400;color:#777}.message-meta time{font-size:8px;white-space:nowrap}.chat-message p{font-size:12px;line-height:1.7;margin:6px 0 1px;white-space:pre-wrap;overflow-wrap:anywhere}.message-actions{display:flex;gap:13px}.message-actions .quiet-action{font-size:8px;padding:2px 0;color:#aaa}
#messageForm{border-top:1px solid #e8e8e8;margin-top:10px;padding-top:11px;display:flex;gap:9px;align-items:flex-end}#messageInput{flex:1;min-width:0;resize:none;border:0;background:#fff;font:12px/1.6 Arial,sans-serif;height:43px;padding:0;outline:none}#messageInput:focus-visible{outline:1px solid #bbb;outline-offset:4px}#sendMessageButton{font-size:10px;white-space:nowrap;margin-bottom:2px;min-height:30px}.chat-status{font-size:9px;line-height:1.6;color:#aaa;margin-top:9px;min-height:15px;overflow-wrap:anywhere}
.room-people{position:absolute;left:44px;top:225px;display:flex;flex-direction:column;gap:8px;max-width:150px;font:9px/1.5 ui-monospace,monospace;color:#999;pointer-events:none}.room-person{display:flex;align-items:center;gap:7px;color:#777}.room-person i{display:inline-block;width:4px;height:4px;border-radius:50%;background:#777}
.editor-sharing{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:17px;border-top:1px solid #eee;padding-top:14px;font-size:9px;color:#aaa}.editor-sharing button{font-size:10px;color:#555;white-space:nowrap}
.report-reason{width:100%;resize:vertical;min-height:90px;border:1px solid #ddd;padding:12px;font:12px/1.7 Arial,sans-serif;border-radius:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.social-open .world-heading{left:32px}.social-open .world-heading h1{font-size:43px}.social-open .world-footer{left:32px;right:26px}.social-open .world-footer>span:first-child{max-width:210px;line-height:1.6}.social-open .side-worlds,.social-open .commons-portals{right:20px}.editor-open .social-panel{position:absolute;right:0;top:0;bottom:0;z-index:18;box-shadow:-10px 0 30px #00000005}.social-open .room-people,.editor-open .room-people{left:32px}#roomStateLabel{font-size:9px;color:#aaa;line-height:1.5;max-width:145px}
@media(max-width:1000px){.header-actions{gap:20px}.social-panel{width:300px;padding:24px 20px 18px}.room-people{left:28px}.social-open .world-heading{left:23px}.social-open .world-heading h1{font-size:36px}.social-open .world-footer{left:23px;right:23px}#roomStateLabel{display:none}}
@media(max-width:700px){.header-actions{gap:15px}.header .identity-button{padding-left:12px}.community-button>span{margin-left:2px}.social-panel{position:absolute;inset:0;width:100%;z-index:18;padding:24px}.social-top h2{font-size:25px}.people-section{max-height:21dvh}.commons-portals{right:18px;gap:20px;top:44%}.commons-portals button{font-size:10px}.commons-connection{max-width:220px;width:70%}.commons-connection p{font-size:11px}.room-people{left:24px;top:210px;gap:6px;max-width:110px}.social-open .world-heading h1{font-size:40px}.world-footer{flex-wrap:wrap;gap:8px 13px}.world-footer>span:first-child{flex:1;min-width:140px}.published-worlds{max-height:135px}.editor-sharing{margin-top:12px;padding-top:11px}}

/* Conversation stays quiet and readable beside the canvas. */
.social-panel{min-width:0}
.person-enter{min-height:44px;flex:1}
.person-enter strong{font-size:11px;letter-spacing:.15px}
.person-enter small{font-size:11px;line-height:1.4;color:#808080}
.quiet-action{font-size:11px;min-height:30px;color:#777}
.social-empty{font-size:12px;color:#888}
.chat-section{min-height:0}
.chat-tabs{display:flex;align-items:center;gap:24px;flex-shrink:0;border-bottom:1px solid #e8e8e8;margin-bottom:12px}
.chat-tabs>button{position:relative;display:flex;align-items:center;gap:7px;min-height:44px;padding:10px 0;font-size:12px;color:#888;border-bottom:1px solid transparent;margin-bottom:-1px}
.chat-tabs>button[aria-selected="true"]{color:#111;border-bottom-color:#111}
.unread-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;background:#111;color:white;border-radius:20px;font:10px/1 ui-monospace,monospace;letter-spacing:0}
.community-button>.unread-dot{display:inline-block;width:5px;height:5px;margin:0 0 5px 4px;border-radius:50%;background:#111;vertical-align:middle}
.dm-inbox{flex:1;min-height:70px;overflow:auto;overscroll-behavior:contain}
.dm-thread{display:flex;flex-direction:column;gap:7px;text-align:left;width:100%;min-height:75px;padding:15px 0;border-bottom:1px solid #eee}
.dm-thread-head{display:flex;justify-content:space-between;align-items:center;gap:10px;font:11px/1.5 ui-monospace,monospace;min-width:0}
.dm-thread-head strong{font-weight:400;overflow-wrap:anywhere}
.dm-thread-preview{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;line-height:1.6;color:#888;overflow-wrap:anywhere}
.direct-thread-header{display:flex;align-items:center;gap:10px;flex-shrink:0;min-height:48px;padding-bottom:8px;border-bottom:1px solid #eee;margin-bottom:12px}
#dmBackButton{display:flex;align-items:center;justify-content:center;min-width:52px;min-height:36px;font-size:11px;white-space:nowrap}
#dmRecipientCode{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:11px/1.5 ui-monospace,monospace}
#dmBlockButton{margin-left:auto;flex-shrink:0}
.message-destination{font:10px/1.6 ui-monospace,monospace;color:#777;padding:10px 0 1px;flex-shrink:0;overflow-wrap:anywhere}
.chat-heading{font-size:11px;min-height:30px;flex-shrink:0}
.chat-heading select{font-size:12px;max-width:65%;min-height:32px}
.chat-message{margin-bottom:17px}
.message-meta{font-size:10px;line-height:1.5}
.message-meta time{font-size:9px}
.chat-message p{font-size:13px;line-height:1.75;margin:6px 0 2px}
.message-actions .quiet-action{font-size:10px;min-height:26px;color:#888}
#messageForm{flex-shrink:0;gap:12px}
#messageInput{font-size:14px;line-height:1.6;height:48px;padding:4px 0}
#sendMessageButton{font-size:12px;min-height:40px;min-width:46px}
.chat-status{font-size:10px;flex-shrink:0;color:#888}
.my-submissions{border-top:1px solid #eee;margin-top:14px;padding-top:10px}
.submission-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;min-width:0;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.submission-status{display:block;font:9px/1.6 ui-monospace,monospace;letter-spacing:.3px;color:#999;margin-top:4px}
.person-dialog .person-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:26px}
.person-actions button{min-height:46px;padding:12px 8px;font-size:12px;white-space:normal}
#personCode{font-family:ui-monospace,monospace;font-size:21px;letter-spacing:.5px;overflow-wrap:anywhere}
#personLocation{color:#888}
#personBlockButton{display:block;min-height:44px;margin:16px auto 0}
.map-directory{display:flex;gap:20px;max-width:100%;overflow:auto;flex-shrink:0;border-top:1px solid #eee;padding:12px 0;scrollbar-width:thin;overscroll-behavior:contain}
.map-directory-entry{display:flex;flex-direction:column;gap:5px;min-width:105px;max-width:165px;min-height:44px;text-align:left;padding:5px 0}
.map-directory-entry strong{font-size:11px;line-height:1.5;font-weight:400;letter-spacing:.3px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.map-directory-entry small{font:9px/1.5 ui-monospace,monospace;color:#999;letter-spacing:.1px}
#dmRetryButton{align-self:flex-start;flex-shrink:0}

/* On a phone, the world keeps the page. Navigation lives at the edge. */
@media(max-width:700px){
  :root{--mobile-top:calc(76px + env(safe-area-inset-top,0px));--mobile-dock:calc(68px + env(safe-area-inset-bottom,0px))}
  html,body{width:100%;max-width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
  body{height:100dvh}
  button:hover{opacity:1}
  .header{height:var(--mobile-top);padding:env(safe-area-inset-top,0px) 24px 0;gap:0;border-bottom:1px solid #f0f0f0;z-index:25}
  .brand{min-height:48px;min-width:116px;gap:11px;font-size:18px;letter-spacing:4px}
  .brand-mark{width:25px;height:25px;border-width:1px}
  .brand-mark i{width:4px;height:4px}
  .header-actions{position:fixed;inset:auto 0 0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;gap:0;width:100%;height:var(--mobile-dock);padding:5px 12px calc(5px + env(safe-area-inset-bottom,0px));margin:0;border-top:1px solid #e9e9e9;background:#fff;z-index:35}
  .header-actions>#mapButton,.header-actions>#createButton,.header-actions>#communityButton{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:48px;padding:0 4px;font-size:12px;letter-spacing:.25px;white-space:nowrap}
  .header-actions>#createButton{border-left:1px solid #eee;border-right:1px solid #eee}
  .create-button>span:first-child{font-size:19px}
  .header-actions .small-arrow{font-size:12px;margin:0 0 0 2px}
  .community-button>span{font-size:10px;margin-left:0;color:#888}
  .community-button>.unread-dot{margin-left:0}
  .header-actions>#communityButton[aria-expanded="true"]{color:#111;font-weight:600}
  .header .identity-button{position:fixed;top:calc(14px + env(safe-area-inset-top,0px));right:17px;width:48px;height:48px;min-height:48px;min-width:48px;border:0;padding:0;display:grid;place-items:center}
  .identity-dot{width:7px;height:7px;box-shadow:0 0 0 10px white,0 0 0 11px #d7d7d7}
  .identity-button>span:last-child{display:none}
  main{width:100%;height:calc(100dvh - var(--mobile-top) - var(--mobile-dock));min-height:0;overflow:hidden}
  .world-view{width:100%;min-height:0}
  .world-heading,.social-open .world-heading,.editor-open .world-heading{left:24px;right:24px;top:34px;max-width:calc(100% - 48px)}
  .world-heading h1,.social-open .world-heading h1,.editor-open .world-heading h1{font-size:clamp(36px,10.8vw,46px);line-height:1.08;letter-spacing:1px;margin:18px 0 12px;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .world-heading p{font-size:12px;line-height:1.6;letter-spacing:.25px;max-width:290px}
  .eyebrow{font-size:9px;letter-spacing:1.8px;line-height:1.4;gap:9px}
  .live-line{width:16px}
  .commons-portals,.social-open .commons-portals{left:24px;right:24px;top:auto;bottom:53px;display:flex;flex-direction:row;justify-content:space-between;align-items:center;gap:6px;border-top:1px solid #eee;padding-top:5px}
  .commons-portals button{flex:1;min-height:44px;min-width:0;font-size:11px;letter-spacing:.35px;padding:10px 3px;white-space:nowrap;color:#6c6c6c}
  .commons-portals button:first-child{text-align:left}.commons-portals button:last-child{text-align:right}
  .commons-view .world-bottom{bottom:124px}
  .commons-view .world-toolbar{display:none}
  .equation{font-size:23px;letter-spacing:.4px;line-height:1.3}
  .equation sub{font-size:9px}
  .world-bottom,.editor-open .world-bottom{bottom:70px;width:calc(100% - 40px);max-width:340px}
  .world-toolbar{gap:12px;margin-top:18px}
  .icon-button{width:44px;height:46px}
  .icon-button svg{width:20px;height:20px}
  .rule-button{font-size:12px;min-height:46px;padding:14px 18px;gap:10px}
  .rule-button .small-arrow{margin-left:7px}
  .toolbar-divider{margin:0;height:20px}
  .world-footer,.social-open .world-footer,.editor-open .world-footer{left:24px;right:24px;bottom:5px;min-height:44px;gap:12px;align-items:center;flex-wrap:nowrap;font-size:10px;line-height:1.6;letter-spacing:0;color:#888}
  .world-footer>span:first-child,.social-open .world-footer>span:first-child,.editor-open .world-footer #worldHint{min-width:0;max-width:none;flex:1}
  .world-footer button{font-size:11px;min-height:44px;flex-shrink:0}
  .world-footer #reportWorldButton{font-size:10px}
  .side-worlds{display:none}
  .room-people,.social-open .room-people,.editor-open .room-people{left:24px;right:24px;top:210px;max-width:none;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:7px 12px;font-size:10px}
  .room-person:nth-child(n+4){display:none}
  .room-person{font-size:9px}
  .play-guide-button{min-height:44px;margin-top:3px;font-size:11px;letter-spacing:.1px}
  .commons-connection{width:calc(100% - 72px);max-width:280px;top:49%}
  .commons-connection p{font-size:12px;line-height:1.8;background:rgba(255,255,255,.96);padding:12px}
  .commons-connection button{min-height:44px;margin-top:4px}

  .map-overlay{top:var(--mobile-top);bottom:var(--mobile-dock);padding:26px 24px 16px;overflow:hidden}
  .map-top{gap:8px;flex-shrink:0}
  .map-top>div{min-width:0}
  .map-top h2{font-size:28px;line-height:1.25;letter-spacing:.3px;margin:15px 0 11px;max-width:250px}
  .map-top p{font-size:12px;line-height:1.65;letter-spacing:0}
  .close-button{width:44px;height:44px;min-width:44px;min-height:44px;font-size:29px;line-height:1}
  .map-top .close-button{margin-top:-9px;margin-right:-11px}
  .map-cosmos{min-height:0;margin:23px -8px 16px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;flex:1}
  .map-cosmos>svg{display:none}
  .map-cosmos #mapNodes{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 8px;padding:12px 4px 15px}
  .map-node{position:relative;left:auto!important;top:auto!important;transform:none;min-width:0;width:100%;min-height:144px;justify-content:flex-start;gap:12px;padding:8px 6px}
  .map-node:active{transform:scale(.98)}
  .map-orb{width:68px;height:68px;flex-shrink:0;border-color:#aaa}
  .map-node.selected .map-orb{width:82px;height:82px;margin-top:-7px;margin-bottom:-7px}
  .map-node.selected .map-orb:after{left:-12px;right:-12px;top:30px;height:22px}
  .map-node strong{font-size:12px;line-height:1.4;letter-spacing:.3px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .map-node small{font-size:9px;line-height:1;margin-top:-7px}
  .map-directory{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 16px;max-height:118px;padding:9px 0 12px}
  .map-directory-entry{min-width:0;max-width:none;width:100%;min-height:44px;gap:3px;padding:5px 0}
  .map-directory-entry strong{font-size:12px}
  .map-directory-entry small{font-size:9px}
  .map-bottom{flex-shrink:0;gap:10px;font-size:10px;padding-top:13px;line-height:1.5}
  .map-bottom>div{gap:12px;align-items:center}
  .map-bottom .text-button{font-size:11px;min-height:44px}
  .map-bottom .primary-button{font-size:11px;min-height:46px;padding:12px 15px}

  .editor{position:fixed;inset:var(--mobile-top) 0 var(--mobile-dock);width:100%;height:auto;padding:24px 20px 16px;z-index:20;min-height:0;border:0;overflow:auto;overscroll-behavior:contain}
  .editor-top{margin-bottom:18px;flex-shrink:0}
  .editor-top .close-button{margin:-10px -8px 0 0}
  .editor h2{font-size:27px;line-height:1.3;letter-spacing:.3px;margin-top:10px}
  .field-label{font-size:11px;letter-spacing:.4px;line-height:1.5;flex-shrink:0}
  .name-input{font-size:16px;min-height:44px;padding:5px 0 12px;flex-shrink:0}
  .instructions-label{margin-top:17px}
  .instructions-input{font-size:16px;line-height:1.5;height:76px;min-height:76px;padding:12px;resize:vertical}
  .code-toolbar{margin:14px 0 8px;font-size:10px;min-height:44px;flex-shrink:0;gap:10px}
  .code-toolbar button{font-size:11px;min-height:44px}
  .code-wrap{flex:1 0 200px;min-height:200px}
  .editor .code-wrap textarea{font-size:16px;line-height:25px;padding:13px 10px;-webkit-text-size-adjust:100%}
  .editor .code-wrap pre{font-size:11px;line-height:25px;padding:13px 7px;min-width:30px}
  .editor-status{font-size:11px;min-height:42px;flex-shrink:0;padding:10px 0}
  .editor-actions{position:sticky;bottom:0;padding:10px 0;background:#fff;z-index:2;flex-shrink:0;gap:10px}
  .editor-actions>button{min-height:48px;font-size:12px}
  .editor-actions .primary-button>span{display:none}
  .editor-bottom{margin-top:3px;min-height:44px;flex-shrink:0;font-size:10px;gap:12px}
  .editor-bottom button{font-size:11px;min-height:44px}
  .editor-sharing{margin-top:6px;padding-top:9px;min-height:54px;flex-shrink:0;font-size:10px}
  .editor-sharing button{font-size:11px;min-height:44px}

  .social-panel,.editor-open .social-panel{position:fixed;inset:auto 0 var(--mobile-dock);width:100%;height:calc(100dvh - var(--mobile-top) - var(--mobile-dock) - 12px);max-height:calc(100dvh - var(--mobile-top) - var(--mobile-dock) - 12px);padding:25px 22px 12px;border:1px solid #e5e5e5;border-bottom:0;border-radius:24px 24px 0 0;box-shadow:0 -18px 50px #0000000b;z-index:30;overflow:hidden;min-height:0}
  .social-panel:before{content:"";position:absolute;left:calc(50% - 15px);top:9px;width:30px;height:3px;background:#d7d7d7;border-radius:3px}
  .social-top{gap:12px;flex-shrink:0}
  .social-top h2{font-size:27px;line-height:1.2;letter-spacing:.2px;margin-top:8px}
  .social-top .close-button{margin:-7px -10px 0 0}
  .connection-row{font-size:10px;min-height:25px;margin:9px 0 8px;flex-shrink:0}
  .connection-row button{min-height:34px}
  .social-section-title{font-size:10px;margin-bottom:3px;line-height:1.6}
  .people-section{min-height:50px;max-height:118px;overscroll-behavior:contain;scrollbar-width:thin}
  .person-row{min-height:53px;gap:8px;border-bottom:1px solid #f4f4f4}
  .person-row:last-child{border-bottom:0}
  .person-enter{min-height:52px;padding:7px 0;gap:3px 10px}
  .person-enter strong{font-size:11px;line-height:1.5}
  .person-enter small{font-size:11px}
  .quiet-action{font-size:11px;min-height:44px;padding:8px 4px}
  .person-row>.quiet-action{min-width:44px}
  .social-empty{font-size:12px;padding:8px 0;line-height:1.6}
  .published-worlds{margin-top:7px;padding:0;min-height:44px;max-height:160px;flex-shrink:0}
  .published-worlds summary{font-size:11px;min-height:44px;line-height:44px}
  .published-worlds[open] summary{margin-bottom:0}
  .shared-world-enter{min-height:48px;gap:5px;padding:9px 0}
  .shared-world-enter span{font-size:12px}.shared-world-enter small{font-size:10px}
  .chat-section{margin-top:5px;min-height:0;flex:1}
  .chat-tabs{gap:25px;margin-bottom:5px}
  .chat-tabs>button{font-size:12px;min-height:44px;gap:7px}
  .chat-heading{min-height:36px;margin-bottom:4px;font-size:11px}
  .chat-heading select{font-size:16px;line-height:1.4;min-height:36px;max-width:62%;padding:6px 0}
  .chat-messages{min-height:35px;padding-right:3px;scrollbar-width:thin;overscroll-behavior:contain}
  .chat-message{margin-bottom:14px}
  .message-meta{font-size:10px;line-height:1.5;gap:9px}
  .message-meta time{font-size:9px}
  .chat-message p{font-size:14px;line-height:1.65;margin:7px 0 0}
  .message-actions{gap:12px;min-height:35px}
  .message-actions .quiet-action{font-size:10px;min-height:44px;padding:8px 2px}
  .message-destination{font-size:10px;line-height:1.6;padding:7px 0 0;min-height:22px}
  #messageForm{margin-top:6px;padding-top:10px;gap:12px;align-items:flex-end;flex-shrink:0}
  #messageInput{font-size:16px;line-height:1.5;height:48px;min-height:48px;max-height:100px;padding:5px 0;border-radius:0}
  #sendMessageButton{font-size:12px;min-height:44px;min-width:50px;margin-bottom:1px}
  .chat-status{font-size:10px;line-height:1.45;margin-top:5px;min-height:15px;max-height:30px;overflow:auto}
  .dm-inbox{min-height:35px;scrollbar-width:thin}
  .dm-inbox>.quiet-note{font-size:11px;line-height:1.7;margin:5px 0 10px}
  .dm-thread{padding:14px 0;min-height:82px;gap:8px}
  .dm-thread-head{font-size:12px}
  .dm-thread-preview{font-size:13px;line-height:1.6}
  .direct-thread-header{min-height:48px;gap:9px;padding-bottom:3px;margin-bottom:8px}
  #dmBackButton{min-width:58px;min-height:44px;font-size:11px;margin-left:-8px}
  #dmRecipientCode{font-size:11px;letter-spacing:.2px}
  #dmBlockButton{font-size:11px;min-height:44px;margin-right:-4px}
  .submission-row{font-size:12px;min-height:52px;padding:9px 0}
  .submission-status{font-size:10px}
  .social-panel:has(#messageInput:focus) .people-section,.social-panel:has(#messageInput:focus) .published-worlds{display:none}

  .dialog{width:calc(100vw - 32px);max-width:470px;max-height:calc(100dvh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));margin:auto;padding:32px 24px 26px;border-color:#e4e4e4;border-radius:1px;overscroll-behavior:contain}
  .dialog-close{right:7px;top:7px}
  .dialog h2{font-size:28px;line-height:1.35;letter-spacing:.2px;margin:22px 0 16px;overflow-wrap:anywhere}
  .dialog p{font-size:13px;line-height:1.8;margin:14px 0}
  .dialog .quiet-note{font-size:11px;line-height:1.8}
  .dialog input,.dialog textarea,.report-reason,.ai-dialog textarea{font-size:16px;line-height:1.6}
  .dialog .field-label{font-size:11px;margin-top:22px}
  .dialog .primary-button,.dialog .secondary-button{min-height:48px;font-size:12px;white-space:normal;line-height:1.5}
  .dialog .full-width{margin-top:24px}
  .confirm-actions{flex-direction:column;gap:10px;margin-top:24px}
  .cancel-confirm{min-height:44px;margin-top:9px;font-size:12px}
  .identity-code{font-size:13px;line-height:1.5;padding:16px 0}
  .large-identity{width:84px;height:84px;margin:26px auto}
  .person-dialog .person-actions{gap:10px;margin-top:24px}
  #personCode{font-size:19px;letter-spacing:.2px}
  .person-actions button{font-size:12px;min-height:48px;padding:12px 8px}
  #personBlockButton{font-size:11px;min-height:44px;margin-top:14px}
  .toast{bottom:calc(var(--mobile-dock) + 14px);max-width:calc(100vw - 36px);width:max-content;font-size:12px;padding:11px 16px;line-height:1.65}
}

@media(max-width:360px){
  .header{padding-left:20px;padding-right:20px}
  .world-heading,.social-open .world-heading,.editor-open .world-heading{left:20px;right:20px;max-width:calc(100% - 40px)}
  .world-heading h1,.social-open .world-heading h1,.editor-open .world-heading h1{font-size:36px}
  .world-footer,.social-open .world-footer,.editor-open .world-footer{left:20px;right:20px;font-size:9px}
  .commons-portals,.social-open .commons-portals{left:20px;right:20px}
  .equation{font-size:21px}
  .social-panel,.editor-open .social-panel{padding-left:18px;padding-right:18px}
  .social-top h2{font-size:25px}
  .map-overlay{padding-left:20px;padding-right:20px}
  .map-top h2{font-size:25px}
  .map-bottom .primary-button{padding-left:11px;padding-right:11px}
}

/* Short viewports include phones with their software keyboard open. */
@media(max-width:700px) and (max-height:620px){
  :root{--mobile-top:calc(64px + env(safe-area-inset-top,0px));--mobile-dock:calc(58px + env(safe-area-inset-bottom,0px))}
  .header .identity-button{top:calc(8px + env(safe-area-inset-top,0px))}
  .header-actions{padding-top:2px;padding-bottom:calc(2px + env(safe-area-inset-bottom,0px))}
  .header-actions>#mapButton,.header-actions>#createButton,.header-actions>#communityButton{min-height:48px}
  .world-heading,.social-open .world-heading,.editor-open .world-heading{top:20px}
  .world-heading h1,.social-open .world-heading h1,.editor-open .world-heading h1{font-size:34px;margin:12px 0 8px}
  .world-heading p{font-size:11px}
  .commons-view .world-bottom{bottom:104px}
  .commons-portals,.social-open .commons-portals{bottom:42px}
  .world-footer>span:first-child{font-size:9px;line-height:1.4}
  .world-bottom,.editor-open .world-bottom{bottom:52px}
  .world-toolbar{margin-top:10px}
  .room-people,.social-open .room-people,.editor-open .room-people{top:173px}
  .social-panel,.editor-open .social-panel{padding-top:20px;padding-bottom:8px;height:calc(100dvh - var(--mobile-top) - var(--mobile-dock) - 6px);max-height:calc(100dvh - var(--mobile-top) - var(--mobile-dock) - 6px)}
  .social-top h2{font-size:22px;margin-top:4px}
  .social-top .eyebrow,.social-panel .connection-row,.social-panel .people-section,.social-panel .published-worlds{display:none}
  .chat-tabs{margin-bottom:2px}
  .chat-heading{margin-bottom:2px;min-height:32px}
  .chat-heading select{min-height:32px}
  .direct-thread-header{margin-bottom:3px;min-height:44px}
  .message-destination{padding-top:3px;min-height:18px}
  #messageForm{padding-top:5px;margin-top:4px}
  #messageInput{height:44px;min-height:44px}
  .chat-status{margin-top:3px;font-size:9px}
  .map-top h2{font-size:23px;margin:10px 0 7px}
  .map-top p{font-size:11px}
  .map-cosmos{margin-top:12px}
}
