
:root{font:14px system-ui,Segoe UI,sans-serif;color:#dceef7;background:#06111c;--surface:#102234;--border:#29445d;--sub:#90abc0;--accent:#65e5c6}*{box-sizing:border-box}body{margin:0}header{background:#0b1b2a;padding:20px 28px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}h1{margin:0;font-size:24px;letter-spacing:3px}h2{margin:0 0 14px;font-size:17px}h3{margin:0 0 8px;font-size:15px}p{line-height:1.55}small,.muted{color:var(--sub)}main{max-width:1280px;margin:auto;padding:26px;display:grid;grid-template-columns:265px 1fr;gap:22px}.panel{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:18px;margin-bottom:16px}.tag{display:inline-block;padding:4px 9px;margin:3px 3px 3px 0;border-radius:30px;background:#1e3f4d;color:#96e7d4;font-size:11px}.item{border:1px solid #36546b;border-radius:10px;margin:11px 0;padding:16px;background:#0c1b2a}.item p{margin:6px 0 0;color:#b9cddd}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}.region{background:#122e41;border:1px solid #40637b;padding:20px;border-radius:12px;min-height:125px}.region b{display:block;margin-bottom:8px}.notice{background:#14342e;border:1px solid #23725a;padding:12px;border-radius:9px;line-height:1.5}button,input,textarea,select{font:inherit}button{background:#1c3c4a;color:#e6faf5;border:1px solid #42717c;border-radius:7px;padding:9px 13px;cursor:pointer}button:hover{border-color:var(--accent)}input,textarea,select{width:100%;background:#071a29;border:1px solid #3e657d;border-radius:6px;color:#eaf4ff;padding:10px;margin:6px 0 13px}textarea{min-height:80px}label{display:block;font-size:12px;color:#a9c2d4;margin-top:12px}.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center}nav{display:flex;gap:7px;flex-wrap:wrap}nav button.selected{background:#286c68;border-color:var(--accent)}.hide{display:none}.dim{color:#f3c994}.mono{font-family:ui-monospace,monospace;word-break:break-all}.split{display:grid;grid-template-columns:1fr 1fr;gap:12px}.result{white-space:pre-wrap;overflow-wrap:anywhere;max-height:220px;overflow:auto;font-size:12px;color:#d5faed}.privacy{color:#e2c7a5}@media(max-width:850px){main{display:block}.split{display:block}header{padding:18px}}

.world-hud{display:flex;align-items:center;gap:20px;border:1px solid #376071;border-radius:12px;padding:12px 16px;background:#092735;margin-bottom:16px;flex-wrap:wrap}
.world-hud strong,.world-hud small{display:block}.world-hud small{font-size:11px;color:#9abec9;margin-top:3px}
.world-hud button{margin-left:auto}.world-stage{position:relative;min-height:620px;background:#03070c;border:1px solid #406078;border-radius:12px;overflow:hidden}
.world-stage iframe{position:absolute;inset:0;width:100%;height:100%;border:0;display:none;background:#03070c}
.world-stage iframe.active{display:block}
.region.active{outline:2px solid #65e5c6}

/* FizzBook compact visual layout */
header{padding:9px 18px}header h1{font-size:19px}header small{font-size:10px}
main{max-width:1600px;grid-template-columns:190px minmax(0,1fr);gap:10px;padding:10px}
.panel{padding:11px;margin-bottom:9px;border-radius:9px}
aside .panel{padding:10px}aside h2{font-size:13px}.grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.region{min-height:65px;padding:9px}.region b{font-size:12px;margin-bottom:2px}.region p{margin:6px 0 0}
.region button{padding:5px 8px;font-size:11px}
#worldStage{min-height:650px}#worldHud{padding:8px 11px;margin-bottom:8px}
#world .panel>h2{margin-bottom:5px}#world .panel>p.muted{font-size:11px;margin:4px 0 7px}
@media(max-width:800px){main{grid-template-columns:1fr}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

#observatoryFrame{display:block;width:100%;height:720px;border:0}#observatory .world-stage{height:720px;min-height:720px}

.section-gap{margin-top:25px}

.region-activity{display:flex;flex-wrap:wrap;gap:12px;align-items:center;padding:10px;color:#d9f3ff}.region-activity>span{font-size:11px;color:#94b2c4}.region-worker-list{display:flex;flex-wrap:wrap;gap:7px;width:100%}.region-worker{border:1px solid #376078;border-radius:8px;background:#10283b;padding:8px 10px;min-width:200px;display:grid;gap:4px}.region-worker span{font-size:12px}.region-worker small{font-size:10px;color:#a8d4c9}

.topology{padding:10px;background:#071827;border:1px solid #2c5064;border-radius:8px;margin:9px 0;color:#d8ecff}.topology-nodes{display:flex;flex-wrap:wrap;gap:8px;margin:9px 0}.topology-node{display:grid;gap:5px;min-width:145px;flex:1;border:1px solid #39717a;border-radius:7px;padding:10px;background:#123047}.topology-node span,.topology small{font-size:11px;color:#b3cede}


/* Interactive evidence graph - separate from simulation physics */
.topology-header,.graph-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.topology-node{cursor:pointer;text-align:left;color:#d8effa;font:inherit}
.topology-node:hover,.topology-node.selected{border-color:#7df7d7;box-shadow:0 0 0 2px rgba(83,242,204,.22);background:#184a57}
.graph-mode{font-size:11px;padding:6px 10px}
.graph-panel{margin:9px 0 14px;padding:10px 14px;border:1px solid #315a73;background:#041421;border-radius:9px;color:#d3eaf5}
.graph-head small{color:#90bbd0;font-size:11px}
.topology-canvas{width:100%;height:230px;display:block;background:radial-gradient(ellipse at center,#11364a 0%,#05121e 66%);border:1px solid #294e63;border-radius:8px}
.topology-edge{fill:none;stroke:#477995;stroke-width:2;stroke-dasharray:8 6}
.topology-edge.active{stroke:#80f8cd;stroke-width:5;filter:drop-shadow(0 0 6px #76f1d1)}
.topology-tracer{fill:#63dded;filter:drop-shadow(0 0 4px #74e2ec)}
.topology-tracer.active{fill:#d5ff69}
.topology-vertex{cursor:pointer;outline:none}
.topology-vertex circle{fill:#153548;stroke:#61afc2;stroke-width:2;transition:fill .22s,stroke-width .22s}
.topology-vertex text{fill:#dff6ff;font-size:17px;font-family:ui-monospace,monospace;pointer-events:none}
.topology-vertex .graph-num{fill:#9ee0d9;font-size:13px}
.topology-vertex.selected circle,.topology-vertex:focus circle{fill:#266b75;stroke:#b9ffb6;stroke-width:5;filter:drop-shadow(0 0 10px #51f9c9)}
.topology-vertex.in-region circle{stroke:#95dec8}
.graph-selection{font-size:12px;color:#c3dfeb;margin-top:6px}
.graph-panel.graph-flash{animation:graphFlash 1.6s ease}
@keyframes graphFlash{0%,100%{box-shadow:0 0 0 transparent}35%{box-shadow:0 0 20px #50ffbe}}
#worldprojects .item[data-graph-id],#publictasks .item[data-graph-id]{cursor:pointer}
#worldprojects .item[data-graph-id]:hover,#publictasks .item[data-graph-id]:hover{border-color:#82f1c3;background:#16374c}
@media(prefers-reduced-motion:reduce){.graph-panel.graph-flash{animation:none}.topology-tracer animateMotion{display:none}}

/* Read-only public topology drawn over the central part of each preserved renderer. */
.region-network{position:absolute;left:26%;right:25%;top:19%;bottom:13%;z-index:10;pointer-events:none;border:1px solid rgba(100,190,218,.38);border-radius:13px;background:rgba(2,15,26,.86);color:#cdeaf5;display:flex;flex-direction:column;padding:11px;box-shadow:0 0 28px #05162588}
.region-network-title{display:flex;justify-content:space-between;gap:7px;font-size:11px}.region-network-title span{color:#91d1df}
.region-network-svg{width:100%;flex:1;min-height:100px;overflow:visible}
.region-net-edge{fill:none;stroke:#58d4e1;stroke-width:2.8;stroke-dasharray:8 5;opacity:.85}
.region-net-node{pointer-events:auto;cursor:pointer}
.region-net-node circle{fill:#174559;stroke:#7dd9df;stroke-width:3}
.region-net-node:hover circle,.region-net-node:focus circle{stroke:#a6ffcd;fill:#256c73;stroke-width:5}
.region-net-node text{fill:#eefcff;font-size:14px;font-family:ui-monospace,monospace;pointer-events:none}
.region-net-node .region-net-id{font-size:12px;fill:#9cddca}
.region-net-node .region-net-label{font-size:13px;fill:#b9ebff}
.region-net-agent{fill:#8df5ba;filter:drop-shadow(0 0 6px #77ecbc)}
.region-net-empty{fill:#a8c0cf;font-size:21px}
.region-network>small{font-size:10px;color:#8eabbc}
@media(max-width:1000px){.region-network{left:20%;right:20%;top:25%;bottom:12%}}

/* Keep topology in clear central canvas, outside native left/right HUD panels. */
.region-network{left:27%;right:29%;top:17%;bottom:13%}
.region-net-node text{font-size:24px}
.region-net-node .region-net-id{font-size:19px}
.region-net-node .region-net-label{font-size:21px}
.region-network-title{font-size:12px}

.region-net-node .region-net-label{font-size:18px}


/* FizzBook: keep the canvas first; compact authentication panel on the right. */
@media(min-width:801px){
 main{grid-template-columns:minmax(0,1fr) 190px}
 main>section{grid-column:1;grid-row:1;min-width:0}
 main>aside{grid-column:2;grid-row:1;min-width:0;align-self:start}
}

/* Region selector restored to original 2x2 atlas layout. */
#regions{
 position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
 gap:40px 30px;width:min(100%,330px);padding:15px;
 background:#102a3e;border:1px solid #3e627d;border-radius:13px;
 margin:8px 0 12px;isolation:isolate
}
#regions:before,#regions:after{
 content:"";position:absolute;left:23%;top:50%;width:55%;height:0;
 border-top:2px dashed #4c8ba4;opacity:.75;z-index:-1;pointer-events:none
}
#regions:before{transform:rotate(38deg)}
#regions:after{transform:rotate(-38deg)}
#regions .region{
 min-height:98px;padding:9px 5px;display:flex;flex-direction:column;
 justify-content:center;align-items:center;text-align:center;
 background:#15364b;border:2px solid #52839c;border-radius:12px;
 position:relative
}
#regions .region:nth-child(1):before{content:"01"}
#regions .region:nth-child(2):before{content:"02"}
#regions .region:nth-child(3):before{content:"03"}
#regions .region:nth-child(4):before{content:"04"}
#regions .region:before{font-weight:800;font-size:13px;letter-spacing:1px}
#regions .region b{font-size:12px;line-height:1.15;margin:3px 0}
#regions .region p{font-size:10px;line-height:1.2;margin:0;color:#abedff;text-transform:uppercase}
#regions .region button{font-size:10px;padding:3px 6px;margin-top:5px}
#regions .region.active{outline:none;border-color:#81ffc0;box-shadow:0 0 15px #45efa480}
@media(max-width:420px){#regions{gap:27px 20px;padding:10px}}

/* Match original atlas: compact selector at the left, world begins alongside it. */
@media(min-width:801px){#world>.panel:first-child{display:grid;grid-template-columns:315px minmax(0,1fr);column-gap:16px;align-items:start}#world>.panel:first-child>h2,#world>.panel:first-child>.world-hud{grid-column:1/-1}#world>.panel:first-child>#regions{grid-column:1;grid-row:3;width:100%;margin:0}#world>.panel:first-child>#regionNote{grid-column:1;grid-row:4}#world>.panel:first-child>#worldStage{grid-column:2;grid-row:3 / span 2;min-width:0}#world>.panel:first-child>#regionTopology,#world>.panel:first-child>#regionGraph,#world>.panel:first-child>#regionActivity{grid-column:1/-1}}


/* V2 spatial fit: full-width workbench, narrow left atlas, slim right login. */
@media(min-width:1001px){
 main{max-width:none;width:100%;margin:0;padding:6px;gap:7px;grid-template-columns:minmax(0,1fr) 172px}
 main>aside{width:172px;justify-self:end}
 main>section{width:100%}
 #world>.panel:first-child{padding:7px;grid-template-columns:198px minmax(0,1fr);column-gap:7px;row-gap:5px}
 #world>.panel:first-child>h2{font-size:13px;margin:0 0 2px}
 #world>.panel:first-child>#worldHud{margin-bottom:2px;padding:5px 8px}
 #world>.panel:first-child>#regions{width:198px;padding:8px;gap:12px 10px;margin:0;align-self:start}
 #world>.panel:first-child>#worldStage{min-height:680px}
 #regions .region{min-height:79px;padding:5px 2px;border-radius:9px}
 #regions .region:before{font-size:11px}
 #regions .region b{font-size:10px;margin:1px 0;line-height:1.1}
 #regions .region p{font-size:9px;line-height:1.12}
 #regions .region button{font-size:9px;padding:2px 4px;margin-top:3px}
 #regionNote{font-size:10px;margin:0;padding:0}
 main>aside .panel{padding:8px}
 main>aside input{font-size:11px;padding:7px 5px}
 main>aside button{padding:6px 8px}
}
@media(min-width:801px) and (max-width:1000px){
 main{max-width:none;width:100%;padding:6px;gap:7px;grid-template-columns:minmax(0,1fr) 160px}
 #world>.panel:first-child{grid-template-columns:165px minmax(0,1fr);gap:6px}
 #world>.panel:first-child>#regions{width:165px;padding:5px;gap:9px 5px}
 #regions .region{min-height:75px;padding:4px 2px}
 #regions .region b{font-size:10px}
 #regions .region p{font-size:9px}
 #regions .region button{font-size:8px;padding:2px}
}

#regions .region{min-height:70px}#regions .region b{font-size:10px;line-height:1.1}#regions .region p{margin:2px 0 0}#regions .region button{font-size:9px;padding:3px 5px}
