:root{--pine:#142f2a;--deep:#0b2421;--cream:#f6f2e7;--paper:#fffdf8;--sage:#759a82;--warm:#d7b98b;--muted:#8b9289;--line:#d9dfd5;--serif:Georgia,'Playfair Display',serif;--sans:'DM Sans',system-ui,sans-serif}
*{box-sizing:border-box}html,body{padding:0;margin:0;width:100%;height:100%;overflow:hidden;font-family:var(--sans);color:var(--pine);background:#142f2a}button{font:inherit;cursor:pointer}button:focus-visible{outline:3px solid #dda967;outline-offset:2px}h1,h2,h3,p{margin:0}[hidden]{display:none!important}
#app{width:100%;height:100%;display:flex;position:relative}
#world{flex:1;min-width:0;overflow:hidden;position:relative;background:#9dc6b4}
#scene{position:absolute;inset:0}#scene canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}
#labels{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.world-shade{position:absolute;inset:0;pointer-events:none;background:linear-gradient(0deg,rgba(19,40,32,.53),transparent 26%,transparent 80%,rgba(29,52,48,.11))}
.topbar{position:absolute;z-index:4;left:29px;right:24px;top:25px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;pointer-events:none}
.topbar>*{pointer-events:auto}.identity{display:flex;align-items:center;gap:12px;color:var(--paper);text-shadow:0 1px 9px #1f473b40}.brand-icon{height:42px;width:42px;border:1px solid #fff6e990;display:grid;place-items:center;background:#17382f;border-radius:12px;color:#f3e6c6;font-size:24px;font-family:var(--serif);font-weight:800}.brand-icon span{color:#d0aa68;margin-left:-8px}
.identity strong{font-size:17px;letter-spacing:.8px;font-weight:800;display:block}.identity strong span{font-weight:500;letter-spacing:2px}.identity small{display:block;font-size:9px;letter-spacing:1.65px;margin-top:5px;color:#edf1e0;font-weight:800}.identity i{display:inline-block;width:3px;height:3px;background:#dfc091;border-radius:50%;vertical-align:middle;margin:0 3px}
.clock{display:flex;align-items:center;gap:10px;padding:9px 14px;background:#fffff2e8;backdrop-filter:blur(12px);border:1px solid #ffffff;border-radius:11px;box-shadow:0 6px 26px #16392925;white-space:nowrap}.clock span{font-size:9px;font-weight:800;letter-spacing:.9px;color:#778c79}.clock strong{font-size:23px;letter-spacing:-.5px;font-variant-numeric:tabular-nums}.clock span:last-child{padding:5px 6px;background:#e2e9dd;border-radius:4px}
.top-actions{display:flex;gap:7px;align-items:center}.on-air{display:flex;gap:7px;align-items:center;background:#15372ee8;border:1px solid #a3bcaa80;color:#dce9d8;border-radius:9px;padding:10px;font-weight:700;font-size:10px;white-space:nowrap}.pulse,.live-dot{width:7px;height:7px;display:inline-block;flex-shrink:0;border-radius:50%;background:#a1cd9e;box-shadow:0 0 9px #a3d79b}
.square-btn,.reset-btn{border:1px solid #e4ead6;background:#fffff0e9;color:#315744;width:36px;height:36px;border-radius:8px;font-size:19px;font-weight:800}
.map-corner{position:absolute;z-index:2;left:35px;top:143px;color:#fff8ee;text-shadow:0 2px 15px #16342754;pointer-events:none}
.overline,.eyebrow{font-size:10px;letter-spacing:2.2px;font-weight:800}.map-corner h1{font-family:var(--serif);font-size:clamp(36px,4.5vw,64px);line-height:1.02;letter-spacing:-2px;font-weight:600;margin:18px 0}.map-corner h1 em{font-weight:600;color:#ffe0ac}.map-corner p{font-size:12px;line-height:1.7;color:#f4f5e9;font-weight:600}
.map-stats{display:flex;flex-wrap:wrap;gap:7px;margin-top:22px}.map-stats span{background:#15382fbb;border:1px solid #afccae77;border-radius:6px;padding:7px 10px;color:#f7f7e6;font-size:11px;font-weight:650}
.left-bottom{position:absolute;bottom:112px;left:30px;z-index:3;background:#173930e8;color:#ebf1dd;border-radius:8px;max-width:370px;display:flex;align-items:center;gap:10px;padding:12px 15px;font-size:11px;box-shadow:0 3px 20px #15392f66;pointer-events:none}.view-hint{position:absolute;right:20px;bottom:119px;z-index:3;font-size:9px;letter-spacing:1.1px;color:#eff4e7;text-shadow:0 1px 5px #12412f;pointer-events:none}.view-hint span{padding:0 5px}
.bottom-controls{position:absolute;z-index:5;bottom:28px;left:50%;transform:translateX(-50%);display:flex;gap:7px;align-items:center;background:#15392be6;padding:8px;border:1px solid #e3e9d17a;border-radius:13px;box-shadow:0 8px 22px #123b3555;white-space:nowrap}
.start-btn{background:#ebc68c;border:1px solid #f6ddac;border-bottom:3px solid #a17c48;color:#344538;font-size:11px;letter-spacing:.25px;font-weight:800;border-radius:8px;padding:12px 15px}.start-btn:hover{background:#ffe0a8}.start-btn span:first-child{margin-right:6px}
.speed-controls{display:flex;gap:3px;border-left:1px solid #b9c7b06e;padding-left:9px}.speed-controls button{background:transparent;border:none;border-radius:6px;color:#c8d5bd;padding:10px 8px;font-size:11px;font-weight:800}.speed-controls button.active{background:#91b39c;color:#13382a}.reset-btn{height:37px;width:37px}
#sidebar{width:355px;min-width:355px;height:100%;overflow-y:auto;overscroll-behavior:contain;background:#f7f5ec;border-left:1px solid #f0f1e5;display:flex;flex-direction:column;z-index:5;box-shadow:-7px 0 30px #19392e2d;scrollbar-width:thin}
.intro{padding:26px 26px 19px;background:#fdfcf6}.intro-top{display:flex;align-items:center;justify-content:space-between}.eyebrow{color:#868e7d;font-size:9px;letter-spacing:1.6px}.version{border:1px solid #bac6b6;border-radius:5px;font-size:9px;font-weight:800;padding:5px 7px;color:#67806d}.intro h2{font:600 36px/1.05 var(--serif);letter-spacing:-1.2px;margin:17px 0 13px;color:#1e4335}.intro h2 em{color:#769b83}.intro p{font-size:11px;line-height:1.65;color:#859285;max-width:290px}
.people,.happening{padding:18px 21px;border-top:1px solid #dfe5d9}.section-title{display:flex;justify-content:space-between;gap:6px;align-items:center;margin:0 0 13px}.section-title h3{font-size:10px;letter-spacing:1.25px;font-weight:800;color:#364d40}.section-title span,.text-btn{color:#849c84;font-size:9px;letter-spacing:.7px;font-weight:800}.text-btn{border:0;background:none;padding:4px}
.people-list{display:flex;flex-direction:column;gap:7px}.person-card{border:1px solid #dce5d7;background:#fffdf8;border-radius:11px;display:flex;gap:10px;padding:11px 12px;align-items:center;cursor:pointer;text-align:left;width:100%;transition:transform .15s,background .15s}.person-card:hover{transform:translateX(2px);background:#f0f7ec}.person-card.selected{border-color:#83b594;box-shadow:inset 3px 0 0 #6c9b7f}.person-avatar{width:39px;height:39px;flex-shrink:0;border-radius:10px;display:grid;place-items:center;color:#18382b;font-family:var(--serif);font-size:21px;font-weight:700;border:2px solid #ffffff9e}
.person-description{min-width:0;flex:1}.person-description b{display:block;font-size:13px;color:#274436}.person-description small{display:block;font-size:10px;color:#929e90;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:3px}.person-money{font-size:11px;color:#527961;font-weight:800;white-space:nowrap}
.happening{padding-bottom:12px}.event-feed{display:flex;flex-direction:column;gap:9px;max-height:220px;overflow-y:auto;padding-right:3px}.event{display:flex;gap:9px;align-items:flex-start}.event-icon{font-size:14px;border-radius:8px;display:grid;place-items:center;width:30px;height:30px;flex-shrink:0;background:#e8ecdd}.event div{min-width:0}.event b{font-size:10px;color:#294c39}.event p{font-size:10px;color:#7f8d7e;line-height:1.45;overflow-wrap:anywhere;margin-top:3px}.event time{font-size:9px;color:#abb3a5;float:right}.empty-state{font-size:11px;line-height:1.6;color:#98a196;padding:10px 0}
.social-promo{margin:5px 20px 15px;background:#1c493d;color:white;border-radius:13px;padding:17px;border:1px solid #749a8075}.social-promo .eyebrow{color:#a9c6ae}.social-promo h3{font:600 25px var(--serif);margin:9px 0}.social-promo p{color:#cadbcc;font-size:10px;line-height:1.6}.phone-open{width:100%;display:flex;justify-content:space-between;align-items:center;flex-direction:row-reverse;background:#d9c095;color:#1f4533;border:none;border-radius:7px;margin-top:12px;padding:11px 13px;font-size:11px;font-weight:800}.phone-open:hover{background:#ecd2a0}.rail-footer{margin-top:auto;display:flex;justify-content:space-between;padding:14px 23px;border-top:1px solid #dfe5d9;color:#9ba99b;font-size:9px;letter-spacing:.5px}

#shade{position:absolute;inset:0;background:#0f241bb0;backdrop-filter:blur(3px);z-index:8}
#profile-drawer{position:absolute;right:0;top:0;bottom:0;width:min(450px,100%);background:#fbfaf4;z-index:9;transform:translateX(102%);transition:transform .2s;box-shadow:-20px 0 60px #132c2a55;display:flex;flex-direction:column}
#profile-drawer.open{transform:translateX(0)}
.drawer-bar{display:flex;justify-content:space-between;align-items:center;flex-shrink:0;padding:17px 25px;border-bottom:1px solid #dce4d7;letter-spacing:1.5px;color:#829589;font-size:10px;font-weight:800}
.drawer-bar button,#phone-close{width:32px;height:32px;border:0;border-radius:9px;background:#e6eadc;color:#3e6650;font-size:22px;line-height:1}
.drawer-body{overflow-y:auto;padding:22px 25px 45px;scrollbar-width:thin}
.profile-hero{display:flex;gap:13px;align-items:center}.hero-icon{height:65px;width:65px;border-radius:14px;display:grid;place-items:center;font:700 34px var(--serif)}
.profile-hero span{font-size:10px;color:#899c8c}.profile-hero h2{font:600 36px/1.08 var(--serif);color:#234d39;margin:4px 0}.profile-hero p{font-size:11px;color:#718777;line-height:1.45}
.profile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:20px 0}.profile-grid div{border:1px solid #dee7d9;background:#fff;padding:12px 9px;border-radius:9px}
.profile-grid small{font-size:9px;display:block;color:#91a292;font-weight:800}.profile-grid b{display:block;color:#355b43;font-size:18px;margin-top:5px}
.profile-section{margin:25px 0}.profile-section h4{font-size:10px;letter-spacing:1.4px;color:#7e9785;margin:0 0 10px}
.profile-section p{font-size:12px;line-height:1.8;color:#516e58}
.profile-section pre{font:10px/1.7 var(--sans);white-space:pre-wrap;word-break:break-word;background:#edf3e8;border-radius:9px;padding:12px;color:#385744}
.receipts{display:flex;flex-direction:column;gap:8px}.receipt{border:1px solid #e1e5dc;border-radius:10px;padding:10px 12px;background:#fff}
.receipt strong{font-size:12px}.receipt span{float:right;color:#6a9c7b;font-size:11px;font-weight:800}.receipt small{display:block;color:#93a293;font-size:10px;margin-top:4px}
.decision-box{background:#183a30;color:#dce9d6;padding:15px;border-radius:11px}
.decision-box small{font-size:9px;color:#a8cbaa;letter-spacing:1px}
.decision-box b{display:block;font-size:12px;margin:9px 0}.decision-box p{color:#e7e8d9;font-size:12px;line-height:1.65}
.trace-button{margin-top:10px;border:1px solid #a5c0a8;color:#2b593e;background:#e8f1e4;border-radius:7px;padding:9px;font-weight:800;font-size:10px}
.trace-output{font:10px/1.5 monospace;white-space:pre-wrap;overflow-wrap:anywhere;background:#e7eee5;border-radius:8px;padding:10px;max-height:250px;overflow:auto}

.phone-layer{position:absolute;inset:0;z-index:12;display:grid;place-items:center;background:#12231abd;backdrop-filter:blur(5px)}
.phone{width:min(365px,95vw);height:min(710px,94vh);border:9px solid #1c2926;border-radius:42px;background:#f9faf8;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 90px #0007;color:#254b39}
.phone-top{height:38px;display:flex;justify-content:space-between;align-items:center;padding:12px 28px 0;font-size:12px;font-weight:800}
.phone-app-head{display:flex;align-items:center;gap:11px;padding:14px 17px;border-bottom:1px solid #e1e6de}
.app-icon{width:40px;height:40px;border-radius:12px;background:#245f47;color:#f3f5dd;font-size:27px;display:grid;place-items:center}
.phone-app-head div:nth-child(2){flex:1}.phone-app-head strong{display:block;font-size:13px;letter-spacing:2px}.phone-app-head small{display:block;font-size:9px;color:#95a19a;margin-top:4px}
.phone-filter{display:flex;justify-content:space-between;padding:13px 20px;background:#edf3ec;color:#759780;font-size:10px;letter-spacing:1px;font-weight:800}
.phone-feed{overflow-y:auto;flex:1;padding:14px 16px}
.post{border-bottom:1px solid #e5eae4;padding:12px 0 18px}.post-head{display:flex;align-items:center;gap:8px}
.post-avatar{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;font:700 18px var(--serif);color:#25533a}
.post-author{flex:1}.post-author b{display:block;font-size:12px}.post-author small{color:#a2aba3;font-size:10px}
.post-score{font-size:10px;background:#e6efe5;padding:6px 8px;border-radius:7px;font-weight:800;color:#426c4d}
.post p{font-size:12px;line-height:1.65;color:#53655a;margin:11px 0}.post-place{font-size:10px;color:#71967c;font-weight:800}
.phone-bottom{border-top:1px solid #dfe7df;height:54px;display:flex;justify-content:space-around;align-items:center;font-size:22px;color:#829f91}.phone-bottom b{color:#367756}
.phone-empty{padding:36px 15px;text-align:center;color:#92a396;font-size:13px;line-height:1.65}
.avatar-label{position:absolute;transform:translate(-50%,-100%);background:#fdfbefea;border:1px solid #ffffffd9;box-shadow:0 5px 13px #1b403b45;border-radius:8px;color:#244a35;font-size:10px;font-weight:850;padding:6px 10px;min-width:66px;text-align:center;white-space:nowrap;z-index:3}
.avatar-label.selected{background:#284c39;color:#fff7db;border-color:#d9c391}
.avatar-label::after{content:'';position:absolute;bottom:-6px;left:50%;width:9px;height:9px;background:inherit;transform:translateX(-50%) rotate(45deg);border-right:1px solid #ffffffb8;border-bottom:1px solid #ffffffb8}
.avatar-label small{display:block;font-size:9px;font-weight:500;margin-top:2px;max-width:140px;overflow:hidden;text-overflow:ellipsis}
@media(max-width:1080px){#sidebar{width:312px;min-width:312px}.map-corner{top:135px}.map-corner h1{font-size:44px}.top-actions .square-btn{display:none}.identity strong{font-size:14px}.view-hint{display:none}}
@media(max-width:750px){#app{display:block}#world{height:65vh;height:65dvh}#sidebar{height:35vh;height:35dvh;min-width:0;width:100%;overflow:auto}#sidebar .intro{display:none}.people{padding:12px}.people-list{display:flex;flex-direction:row;overflow-x:auto;padding-bottom:4px}.person-card{min-width:151px;max-width:175px;flex-shrink:0;padding:8px}.person-money{display:none}.people .section-title{margin-bottom:8px}.happening,.social-promo,.rail-footer{display:none}.topbar{top:12px;left:12px;right:12px}.top-actions{display:none}.identity small{font-size:7px;letter-spacing:.7px}.brand-icon{width:35px;height:35px}.clock{padding:8px}.clock strong{font-size:18px}.map-corner{left:17px;top:82px}.map-corner h1{font-size:36px;margin:10px 0}.map-corner p{font-size:10px}.map-stats{margin-top:13px;gap:4px}.map-stats span{padding:5px;font-size:9px}.bottom-controls{bottom:12px}.left-bottom{bottom:80px;left:12px;font-size:9px;padding:7px}.view-hint{display:none}.phone-layer{position:fixed}}

#app{overflow:hidden}


/* TownSim: archive and transcript downloads, including touch/mobile access. */
.journal-tools{display:flex;gap:7px;align-items:center;margin-top:14px;flex-wrap:wrap}
.journal-download{flex:1;text-align:center;white-space:nowrap;text-decoration:none;background:#245740;color:#f7f7ec;border-radius:7px;font-size:10px;font-weight:800;padding:11px 9px}
.journal-download:hover{background:#357456}
.journal-archive{font-size:10px;color:#467452;background:#e5efe1;border:1px solid #cfdecf;border-radius:7px;padding:10px 9px;font-weight:800}
.journal-shortcut{height:37px;width:37px;border:1px solid #dcead3;background:#f2eedc;border-radius:8px;color:#345640;font-size:19px;font-weight:800}
.journal-layer{position:absolute;inset:0;z-index:14;display:grid;place-items:center;background:#09241dc4;backdrop-filter:blur(4px);padding:18px}
.journal-modal{width:min(650px,100%);max-height:min(760px,94dvh);display:flex;flex-direction:column;overflow:hidden;background:#fbfaf4;color:#2d4e39;border:1px solid #e7e4d5;border-radius:18px;box-shadow:0 18px 70px #0006}
.journal-modal-head{display:flex;justify-content:space-between;align-items:center;padding:25px 27px 18px;border-bottom:1px solid #e3e7d9}
.journal-modal-head h2{font:600 31px/1.1 var(--serif);margin-top:7px}
#journal-close{border:0;border-radius:9px;background:#e6eadc;color:#355d48;height:35px;width:35px;font-size:23px}
.journal-help{font-size:12px;color:#758777;line-height:1.6;padding:14px 27px 0}
.journal-active{padding:19px 22px;margin:14px 25px 12px;background:#e6efe2;border:1px solid #d5e0d2;border-radius:11px}
.journal-active>b{display:block;font-size:13px;margin:8px 0 15px}
.journal-download-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.journal-download-grid a{display:grid;place-items:center;text-decoration:none;font-size:10px;text-align:center;font-weight:800;background:#2a5943;color:#f6f3dc;border-radius:7px;padding:12px 7px;line-height:1.4}
.journal-download-grid a:hover{background:#3a7a55}
.journal-session-title{display:flex;justify-content:space-between;align-items:center;margin:8px 27px 6px}
.journal-session-title h3{font-size:10px;letter-spacing:1.1px;color:#62846a}
#journal-refresh{border:0;background:transparent;color:#56836a;font-size:11px;font-weight:800}
.journal-sessions{overflow-y:auto;min-height:70px;padding:8px 25px 24px;scrollbar-width:thin}
.journal-session{padding:15px 3px;border-bottom:1px solid #e0e8df}
.journal-session strong{font-size:12px}
.journal-session small{display:block;font-size:10px;color:#879b8a;margin-top:4px}
.journal-session-links{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}
.journal-session-links a{font-size:10px;text-decoration:none;color:#2e6a49;padding:8px 10px;border-radius:7px;background:#e5eee3;font-weight:800}
.journal-session-links a:hover{background:#cde6d0}
@media(max-width:750px){
 .journal-layer{position:fixed;padding:8px}
 .journal-modal{max-height:95dvh}
 .journal-modal-head{padding:16px}
 .journal-help{padding:11px 17px 0}
 .journal-active{margin:12px 15px 9px;padding:13px}
 .journal-download-grid{grid-template-columns:1fr}
 .journal-download-grid a{padding:8px}
 .journal-session-title{margin:8px 16px}
 .journal-sessions{padding:8px 16px}
 .journal-shortcut{flex-shrink:0}
 .bottom-controls{max-width:96%;gap:4px;padding:5px}
 .speed-controls button{padding:8px 5px}
 .start-btn{padding:11px 8px}
}

/* Mixed-use city districts and resident physiology */
.venues{padding:16px 20px;border-top:1px solid #dfe5d9}
#venue-list{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.venue-card{display:flex;gap:8px;text-align:left;align-items:center;border:1px solid #dbe4d7;background:#fffdf8;border-radius:9px;padding:9px 7px;cursor:pointer;min-width:0}
.venue-card:hover{background:#eef5eb;border-color:#9ebc9e}
.venue-icon{font-size:18px;display:grid;place-items:center;flex:0 0 25px;height:30px;color:#3c7554;background:#e5eee4;border-radius:6px}
.venue-copy{min-width:0;flex:1}
.venue-copy b{display:block;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.venue-copy small{display:block;font-size:9px;color:#82998a;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.venue-revenue{font-size:9px;color:#76927b;white-space:nowrap;align-self:flex-start}
.person-needs{display:block;color:#92a291;font-size:9px;font-weight:600;margin-top:7px;text-align:right}
.journal-download-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.zip-download{background:#bb8f54!important;color:#192d27!important}
.venue-layer{position:absolute;inset:0;background:#123225b3;z-index:15;backdrop-filter:blur(3px);display:grid;place-items:center;padding:12px}
.venue-modal{background:#f9f8f2;border-radius:18px;padding:26px;width:min(500px,95vw);max-height:88vh;overflow:auto;box-shadow:0 22px 70px #0005;position:relative}
.venue-modal>button{position:absolute;right:17px;top:17px;border:0;background:#e5eddf;width:33px;height:33px;border-radius:8px;font-size:24px;color:#244d35}
#venue-details h2{font:600 30px Georgia,serif;margin:12px 32px 11px 0}
#venue-details h3{font-size:10px;letter-spacing:1.4px;color:#638771;margin:25px 0 10px}
#venue-details>p{font-size:12px;line-height:1.7;color:#647b69}
#venue-details .venue-hours{padding:9px 12px;background:#e8f0e6;border-radius:8px;margin-top:12px}
.venue-menu-row{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #e1e8dc;font-size:12px}
.venue-menu-row b{color:#43805a}
.venue-review{padding:12px 0;border-bottom:1px solid #e0e8df}
.venue-review b{font-size:11px}
.venue-review p{font-size:11px;color:#718777;line-height:1.6;margin-top:5px}
@media(max-width:750px){
 .venues{display:block;padding:10px 12px}
 #venue-list{display:flex;overflow-x:auto;gap:8px}
 .venue-card{min-width:169px}
 .person-money{display:block;font-size:10px}
 .person-needs{font-size:9px}
}

@media(max-width:750px){.speed-controls button[data-speed="1"],.speed-controls button[data-speed="6"],.speed-controls button[data-speed="30"]{display:none}.bottom-controls{left:50%;width:auto;max-width:98%}.journal-shortcut,.reset-btn{height:33px;width:33px}.start-btn{font-size:10px}.clock #phase-label{display:none}}

.research-runs{max-height:235px;overflow:auto;margin:5px 25px 17px;border:1px solid #e1e5d9;border-radius:10px}
.research-intro{font-size:11px;color:#607d6c;margin:10px 12px}
.research-run{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 12px;border-top:1px solid #e9ecdf;font-size:11px}
.research-run b{font-size:11px}.research-run small{display:block;font-size:9px;color:#798d7c;margin-top:3px}
.research-run a{font-size:10px;color:#2c6d46;text-decoration:none;font-weight:800}
@media(max-width:750px){.research-runs{margin:5px 15px 15px}}

/* TownSim v4: meaningful marketing strategy rather than A/B research dashboard. */
.brand-story{padding:19px 22px;border-top:1px solid #dfe5d9;background:linear-gradient(145deg,#eaf0e5,#faf8ee)}
.brand-story p{font-size:11px;line-height:1.8;color:#647c68;margin:9px 0 12px}
.brand-open{width:100%;background:#214e3a;color:#f2e5bb;border:1px solid #628971;border-radius:10px;padding:13px;text-align:left;font-weight:800;font-size:11px}
.brand-open:hover{background:#30664a}
.brand-shortcut{background:#dcebd9;border-color:#7ca78b;color:#1c543c}
.brand-modal{width:min(900px,100%);max-height:min(850px,95dvh)}
#brands-close{border:0;border-radius:9px;background:#e6eadc;color:#355d48;height:35px;width:35px;font-size:23px}
.brands-grid{overflow:auto;padding:14px 22px 24px;display:grid;gap:14px}
.pair-heading{font-size:11px;text-transform:uppercase;font-weight:900;letter-spacing:1.4px;color:#4d775e;margin-bottom:9px}
.brand-pair{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.brand-brief{background:#fff;border:1px solid #d6e5d6;border-radius:12px;padding:15px;min-width:0}
.brand-brief h3{font:600 21px Georgia,serif;color:#274b38;margin:8px 0}
.brand-brief .promise{font:italic 16px/1.5 Georgia,serif;color:#496c51;margin-bottom:11px}
.brand-brief p{font-size:11px;line-height:1.65;color:#637869;margin:9px 0}
.brand-metrics{display:flex;gap:7px;flex-wrap:wrap;margin:9px 0}
.brand-metrics span{font-size:10px;font-weight:800;color:#2e6246;background:#eaf2e7;border-radius:7px;padding:7px}
.brand-chips{font-size:10px;color:#8b997b;margin-top:10px}
.brand-brief .brand-cta{display:block;width:100%;border:1px solid #afceba;border-radius:7px;background:#eaf1e7;color:#24533a;padding:9px;margin-top:12px;font-size:10px;font-weight:800;text-align:left}
.venue-positioning{font-size:11px;color:#73927a;font-weight:800;letter-spacing:.5px}
.brand-description{border-left:3px solid #a6c5a8;padding:10px 12px;background:#f0f5ed;border-radius:0 8px 8px 0;color:#42604b;line-height:1.7;font-size:12px;margin:12px 0}
.brand-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:14px 0}
.brand-facts div{padding:10px;border-radius:8px;background:#e9f2e6}
.brand-facts small{display:block;color:#7d957e;font-size:9px;text-transform:uppercase;margin-bottom:5px}
.brand-facts b{font-size:13px;color:#28553b}
@media(max-width:750px){.brands-grid{padding:12px}.brand-brief{padding:11px}.brand-brief h3{font-size:17px}.brand-brief .promise{font-size:12px}.brand-brief p{font-size:10px}.brand-pair{gap:7px}.brand-shortcut{display:block}.brand-story{padding:14px 15px}.brand-modal .journal-modal-head{padding:14px}}
@media(max-width:380px){.brand-pair{grid-template-columns:1fr}.brand-open{font-size:10px}}

/* v4 living city — restrained full-map mobile controls and image cards */
.mobile-directory,.directory-close{display:none}
.avatar-label{pointer-events:auto;touch-action:manipulation}
.avatar-label small{font-size:14px;line-height:1.1;font-weight:750;margin:3px 0 0;color:#1c6947}
.avatar-label.selected small{color:#ffe7a5}
.person-avatar,.hero-icon{position:relative;overflow:hidden}
.person-avatar img,.hero-icon img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.hero-icon img{border-radius:inherit}
.venue-pictures{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:-4px 0 15px}
.venue-pictures img{width:100%;height:160px;display:block;object-fit:cover;border-radius:10px;background:#dde6d8}
.venue-pictures img:only-child{grid-column:1/-1}
.venue-revenue{display:none}
@media(max-width:750px){
 html,body,#app{width:100%;height:100%;height:100dvh;overflow:hidden}
 #world{height:100%;height:100dvh}
 .map-corner,.left-bottom,.view-hint{display:none}
 .topbar{top:calc(10px + env(safe-area-inset-top,0px));left:12px;right:12px}
 .identity small{display:none}
 .brand-icon{width:31px;height:31px;font-size:17px}
 .clock{padding:7px 9px;gap:6px}
 .clock strong{font-size:17px}
 .clock span{font-size:8px}
 .bottom-controls{bottom:calc(12px + env(safe-area-inset-bottom,0px));left:50%;
  width:max-content;max-width:calc(100vw - 16px);padding:5px 7px;gap:5px}
 .speed-controls{padding-left:5px;gap:1px}
 .speed-controls button{font-size:10px;padding:7px 6px}
 .speed-controls button[data-speed="6"],.speed-controls button[data-speed="12"],.speed-controls button[data-speed="30"],.speed-controls button[data-speed="60"]{display:none}
 .start-btn{font-size:10px;padding:10px 9px}
 .reset-btn{display:none}
 .mobile-directory{display:block;position:absolute;z-index:5;left:12px;bottom:calc(90px + env(safe-area-inset-bottom,0px));
  border:1px solid #eff1db;background:#fffbeaed;color:#264b37;border-radius:999px;
  padding:11px 16px;font-size:12px;font-weight:800;box-shadow:0 6px 25px #1f432e44}
 #sidebar{display:none;position:fixed;left:0;right:0;bottom:0;width:100%;min-width:0;max-height:78dvh;
  height:auto;overflow:auto;z-index:11;background:#fbfaf4;
  border-radius:23px 23px 0 0;box-shadow:0 -12px 50px #0006;padding-top:12px;
  padding-bottom:env(safe-area-inset-bottom,0px)}
 body.browse-open #sidebar{display:flex}
 .directory-close{display:block;position:sticky;top:0;align-self:flex-end;margin:0 16px 6px;
  width:38px;height:38px;background:#e6ece0;color:#244b35;border:0;border-radius:10px;
  font-size:23px;z-index:1}
 #sidebar .intro{display:none}
 .people{padding:10px 14px}
 .people-list{display:grid;grid-template-columns:1fr 1fr;overflow:visible;gap:8px}
 .person-card{min-width:0;max-width:none;width:100%;padding:8px}
 .person-avatar{width:43px;height:43px}
 .happening,.social-promo{display:block}
 .social-promo{margin:10px 14px}
 .brand-story{display:none}
 .venues{display:block;padding:12px 14px}
 #venue-list{display:grid;grid-template-columns:1fr 1fr;overflow:visible}
 .venue-card{min-width:0}
 #shade{position:fixed;z-index:12}
 #profile-drawer{position:fixed;top:auto;bottom:0;left:0;right:0;width:100%;height:auto;max-height:82dvh;
  min-height:35dvh;border-radius:22px 22px 0 0;overflow:hidden;
  transform:translateY(105%);z-index:13}
 #profile-drawer.open{transform:translateY(0)}
 .drawer-bar{padding:12px 17px}
 .drawer-body{padding:15px 18px 45px}
 .profile-hero h2{font-size:27px}
 .profile-section{margin:17px 0}
 .venue-layer{position:fixed;z-index:16;display:flex;align-items:flex-end;justify-content:center;padding:0}
 .venue-modal{width:100%;max-width:100%;max-height:86dvh;border-radius:20px 20px 0 0;
  padding:19px 18px calc(25px + env(safe-area-inset-bottom,0px))}
 .venue-pictures img{height:118px}
 .avatar-label{font-size:9px;padding:5px 8px;min-width:54px}
 .avatar-label small{font-size:13px}
 .map-stats{display:none}
}

.venue-sensory{background:#f0f4ec;border-radius:10px;padding:13px;margin-top:12px}
.venue-sensory b{font-size:10px;letter-spacing:1.2px;color:#4a785a}
.venue-sensory p{font-size:12px;line-height:1.6;color:#52705c;margin:5px 0 13px}
.venue-sensory p:last-child{margin-bottom:0}


/* TownSim HUD V5 — map-first interface (2026-10-12). Scene geometry untouched. */
#app{display:block!important;width:100%!important;height:100dvh!important;overflow:hidden!important}
#world{width:100%!important;height:100dvh!important;min-width:0!important;flex:none!important}
.map-corner,.left-bottom,.view-hint,.mobile-directory{display:none!important}
.world-shade{background:linear-gradient(0deg,rgba(15,41,32,.2),transparent 20%,transparent 84%,rgba(16,40,33,.06))!important}
.topbar{top:calc(14px + env(safe-area-inset-top,0px))!important;left:clamp(12px,2vw,26px)!important;right:clamp(12px,2vw,26px)!important;align-items:center!important}
.identity{gap:9px!important;min-width:0!important}
.brand-icon{width:38px!important;height:38px!important;border-radius:12px!important;box-shadow:0 5px 14px #183b2a33!important;font-size:23px!important}
.identity strong{font-size:clamp(14px,2.5vw,17px)!important;letter-spacing:2px!important;white-space:nowrap!important}
.identity small,.top-actions{display:none!important}
.clock{padding:10px 13px!important;gap:9px!important;box-shadow:0 8px 25px #173b3033!important;background:rgba(255,253,242,.86)!important;border:1px solid rgba(255,255,255,.88)!important;border-radius:18px!important;backdrop-filter:blur(18px)!important;-webkit-backdrop-filter:blur(18px)!important}
.clock strong{font-size:21px!important;letter-spacing:-.6px!important;color:#153e32!important}
.clock span{font-size:10px!important;letter-spacing:.55px!important}
.clock #phase-label{display:none!important}
.clock #speed-label{background:rgba(213,229,216,.58)!important;padding:4px 6px!important;border-radius:8px!important;color:#3b6951!important}
.bottom-controls{bottom:calc(24px + env(safe-area-inset-bottom,0px))!important;left:50%!important;transform:translateX(-50%)!important;gap:7px!important;padding:7px!important;max-width:calc(100vw - 20px)!important;border:1px solid rgba(244,252,238,.72)!important;border-radius:19px!important;background:rgba(27,67,53,.74)!important;backdrop-filter:blur(16px)!important;-webkit-backdrop-filter:blur(16px)!important;box-shadow:0 10px 28px rgba(12,48,34,.25)!important}
.bottom-controls .speed-controls,.bottom-controls #restart{display:none!important}
.bottom-controls #start{padding:12px 17px!important;min-height:44px!important;background:#f4d6a1!important;border:1px solid #ffe4ac!important;border-bottom:2px solid #c69f65!important;border-radius:12px!important;font-size:12px!important;color:#1c4534!important;white-space:nowrap!important}
.bottom-controls #start span:first-child{font-size:16px!important}
.bottom-controls #brands-shortcut,.bottom-controls #journal-shortcut,.hud-speed{height:44px!important;width:44px!important;flex:0 0 44px!important;display:grid!important;place-items:center!important;padding:0!important;background:rgba(244,249,238,.22)!important;border:1px solid rgba(239,249,237,.30)!important;color:#f6faeb!important;border-radius:12px!important;font-size:22px!important;font-weight:700!important}
.bottom-controls #brands-shortcut:hover,.bottom-controls #journal-shortcut:hover,.hud-speed:hover{background:rgba(244,249,238,.36)!important}
.hud-speed{font-size:14px!important;letter-spacing:.3px!important}
#sidebar{display:none!important;position:fixed!important;top:0!important;right:0!important;bottom:0!important;left:auto!important;width:min(410px,100vw)!important;min-width:0!important;height:100dvh!important;max-height:100dvh!important;z-index:20!important;overflow-y:auto!important;border-radius:22px 0 0 22px!important;background:#f8f8f0!important;box-shadow:-15px 0 65px #08291b66!important;padding:12px 0 28px!important}
body.browse-open #sidebar{display:flex!important}
#sidebar .intro,#sidebar .social-promo,#sidebar .brand-story,#sidebar .rail-footer{display:none!important}
#sidebar .directory-close{display:grid!important;place-items:center!important;position:sticky!important;top:0!important;right:15px!important;align-self:flex-end!important;z-index:3!important;margin:0 15px -20px 0!important;width:38px!important;height:38px!important;border:1px solid #dce9dc!important;border-radius:12px!important;background:#e6eee4!important;color:#214b3c!important;font-size:25px!important}
#hud-pane-title{display:block!important;flex:0 0 auto;margin:15px 20px 16px;font:600 27px/1.1 Georgia,serif;color:#204536}
#sidebar .people,#sidebar .happening,#sidebar .venues{padding:12px 20px!important;border:0!important}
#sidebar .people-list{display:grid!important;grid-template-columns:1fr!important;overflow:visible!important;gap:8px!important}
#sidebar .person-card{min-width:0!important;max-width:none!important;width:100%!important;padding:10px!important}
#sidebar #venue-list{display:grid!important;grid-template-columns:1fr 1fr!important;overflow:visible!important}
#sidebar .venue-card{min-width:0!important}
#sidebar .happening{display:block!important}
#sidebar .event-feed{max-height:none!important;overflow:visible!important}
body[data-town-pane="people"] #sidebar .venues,body[data-town-pane="people"] #sidebar .happening{display:none!important}
body[data-town-pane="venues"] #sidebar .people,body[data-town-pane="venues"] #sidebar .happening{display:none!important}
body[data-town-pane="events"] #sidebar .people,body[data-town-pane="events"] #sidebar .venues{display:none!important}
#hub-layer[hidden]{display:none!important}
#hub-layer{position:fixed;inset:0;z-index:26;display:flex;align-items:flex-end;justify-content:center;padding:16px;overflow:auto;background:rgba(7,27,21,.42);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
#hud-hub{width:min(420px,100%);max-height:88dvh;overflow-y:auto;border-radius:25px;background:#faf9f0;border:1px solid #fff;box-shadow:0 24px 70px #0e302a66;padding:20px;color:#1b4838}
.hud-hub-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:17px}
.hud-hub-head h2{font:600 27px Georgia,serif;margin:0}
#hud-menu-close{border:1px solid #dbe8d9;background:#eaf0e7;border-radius:11px;height:38px;width:38px;color:#244b37;font-size:26px;line-height:1}
.hud-hub-subtitle{font-size:11px;color:#789182;margin:-8px 0 17px}
.hud-hub-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.hud-hub-tile{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px;min-width:0;min-height:92px;padding:12px 7px;border:1px solid #d9e6d8;background:#fffefa;color:#295540;border-radius:15px;font-size:11px;font-weight:800;cursor:pointer}
.hud-hub-tile:hover{background:#e8f2e9;border-color:#9ec5a7}
.hud-hub-tile svg{height:25px;width:25px;stroke:#39795b;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round}
.hud-hub-tools{display:flex;gap:8px;margin-top:15px;padding-top:14px;border-top:1px solid #e4e9df}
.hud-hub-tools button{flex:1;border:1px solid #dce7da;border-radius:11px;background:#eef3e9;padding:12px 7px;color:#406f54;font-size:11px;font-weight:750}
.hud-hub-status{font-size:10px;color:#87a08e;margin-top:15px;text-align:center}
#hub-layer :is(button):focus-visible,#sidebar .directory-close:focus-visible{outline:3px solid #d8ab63;outline-offset:2px}
@media(max-width:750px){
 html,body{height:100dvh!important;overflow:hidden!important}
 .topbar{top:calc(12px + env(safe-area-inset-top,0px))!important;left:12px!important;right:12px!important;gap:6px!important}
 .brand-icon{height:33px!important;width:33px!important;border-radius:10px!important;font-size:20px!important}
 .identity strong{font-size:clamp(12px,3.75vw,15px)!important;letter-spacing:1.5px!important}
 .clock{gap:6px!important;padding:9px 10px!important;border-radius:16px!important}
 .clock span{font-size:9px!important}
 .clock strong{font-size:18px!important}
 .clock #speed-label{font-size:10px!important;padding:3px!important}
 .bottom-controls{bottom:calc(20px + env(safe-area-inset-bottom,0px))!important;gap:6px!important;padding:6px!important;border-radius:17px!important}
 .bottom-controls #start{padding:10px 11px!important;min-height:42px!important;font-size:11px!important}
 .bottom-controls #brands-shortcut,.bottom-controls #journal-shortcut,.hud-speed{height:42px!important;width:42px!important;flex-basis:42px!important}
 #sidebar{top:auto!important;left:0!important;right:0!important;bottom:0!important;width:100%!important;height:auto!important;max-height:87dvh!important;padding:9px 0 calc(16px + env(safe-area-inset-bottom,0px))!important;border-radius:24px 24px 0 0!important;box-shadow:0 -12px 60px #0a2e2566!important}
 #sidebar .people,#sidebar .happening,#sidebar .venues{padding:9px 15px!important}
 #hud-pane-title{margin:12px 16px 14px;font-size:25px}
 #hub-layer{padding:10px 10px calc(10px + env(safe-area-inset-bottom,0px))}
 #hud-hub{border-radius:23px;padding:20px 14px 16px}
}
@media(max-width:370px){
 .identity strong{font-size:12px!important}
 .clock{padding:8px!important;gap:5px!important}
 .clock strong{font-size:16px!important}
 .bottom-controls #start{padding:9px!important}
 .bottom-controls #brands-shortcut,.bottom-controls #journal-shortcut,.hud-speed{width:40px!important;flex-basis:40px!important}
}

/* HUD V5B: zero-lag resident drawer and sparse mobile name tags. */
@media(max-width:750px){
 #profile-drawer{transition:none!important;transform:translateY(105%)!important}
 #profile-drawer.open{transform:translateY(0)!important}
 #labels .avatar-label{display:none!important}
 #labels .avatar-label[data-agent-id="adam"],#labels .avatar-label[data-agent-id="zosia"],#labels .avatar-label.selected{display:block!important}
}

/* V4 profile sheet: thoughts → identity → vital signs → expandable history. */
#profile-drawer{width:min(505px,100%);background:#f5f6ef;border-left:1px solid #dce5d8}
#profile-drawer .drawer-bar{padding:17px 24px;color:#4f715b;background:#fcfcf7;letter-spacing:1.25px;font-size:10px}
#profile-drawer .drawer-bar button{width:38px;height:38px;border-radius:12px;display:grid;place-items:center}
#profile-drawer .drawer-body{padding:19px 24px calc(36px + env(safe-area-inset-bottom,0px));overscroll-behavior:contain}
.v4-thought{background:linear-gradient(130deg,#173d32,#235444 76%,#275e48);color:#f9faee;border:1px solid #52846b;border-radius:18px;padding:20px 21px 19px;box-shadow:0 10px 22px #163a3023;position:relative;overflow:hidden;margin-bottom:17px}
.v4-thought::after{content:'✧';position:absolute;right:-7px;top:13px;font:110px/1 Georgia,serif;color:#d7dfc31c;pointer-events:none}
.v4-thought-top{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;position:relative;z-index:1}
.v4-thought-top>span:first-child{font-size:10px;letter-spacing:1.15px;font-weight:850;color:#dce9c8}
.v4-live-mark{font-size:9px;font-weight:750;color:#c6e9c7;background:#ffffff18;border:1px solid #ffffff2a;border-radius:30px;padding:6px 9px}
.v4-thought h3{font:600 24px/1.15 var(--serif);letter-spacing:-.5px;margin:15px 0 9px;color:#fff5d9;position:relative;z-index:1}
.v4-thought-quote{font-size:14px;line-height:1.65;color:#f2f5e7;max-width:43ch;overflow-wrap:anywhere;position:relative;z-index:1}
.v4-thought-meta{font-size:10px;line-height:1.6;color:#bacfbe;border-top:1px solid #ffffff24;padding-top:11px;margin-top:17px;position:relative;z-index:1}
.v4-person-hero{display:flex;align-items:center;gap:15px;background:#fffefa;border:1px solid #e3e9dc;border-radius:16px;padding:15px;margin-bottom:12px}
.v4-portrait{width:91px;height:100px;flex:0 0 91px;position:relative;display:grid;place-items:center;overflow:hidden;border-radius:13px;font:600 42px Georgia,serif;color:#21483c}
.v4-portrait img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.v4-person-header{min-width:0;flex:1}
.v4-person-kicker{font-size:9px;font-weight:850;color:#83a08b;letter-spacing:1px}
.v4-person-header h2{color:#1f4735;font:600 34px/1.07 var(--serif);letter-spacing:-.65px;margin:6px 0}
.v4-person-role{font-size:12px;color:#5e7768;line-height:1.5}
.v4-person-badge{display:inline-block;background:#e9f2e5;color:#326149;border:1px solid #d9e9d4;padding:6px 10px;font-size:10px;line-height:1.3;font-weight:750;border-radius:22px;margin-top:9px;overflow-wrap:anywhere}
.v4-basics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:16px}
.v4-basics>div{background:#fffefa;border:1px solid #e3e9dc;border-radius:12px;padding:12px;min-height:68px;min-width:0}
.v4-basics>div:nth-child(2){grid-row:span 2}
.v4-basics span{display:block;color:#86a18c;font-size:9px;letter-spacing:.8px;font-weight:850;margin-bottom:7px}
.v4-basics b{font-size:12px;line-height:1.45;font-weight:650;color:#355842;display:block;overflow-wrap:anywhere}
.v4-panel{border:1px solid #dfe8da;border-radius:15px;background:#fffefa;padding:18px;margin-bottom:13px}
.v4-panel-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:17px}
.v4-panel-heading h3{font-size:15px;font-weight:800;color:#254937;letter-spacing:-.25px}
.v4-panel-heading>span{font-size:9px;font-weight:800;color:#5d916f;letter-spacing:1px}
.v4-meters{display:flex;flex-direction:column;gap:16px}
.v4-meter-label{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;font-size:12px;font-weight:650;color:#536d5a}
.v4-meter-label b{font-size:14px;line-height:1;color:#264d37;font-variant-numeric:tabular-nums}
.v4-meter-label small{font-size:10px;font-weight:550;color:#96a799}
.v4-meter-track{height:8px;border-radius:10px;background:#e8eee3;overflow:hidden}
.v4-meter-track>span{display:block;height:100%;border-radius:inherit;background:#649877;transition:width .45s}
.v4-meter.caution .v4-meter-track>span{background:#d1a760}
.v4-meter.bad .v4-meter-track>span{background:#ca7b65}
.v4-state-now{border-top:1px solid #e9eee5;margin-top:17px;padding-top:14px;display:flex;align-items:flex-start;justify-content:space-between;gap:15px}
.v4-state-now span{font-size:11px;color:#90a292;white-space:nowrap}
.v4-state-now strong{font-size:12px;color:#355942;line-height:1.5;text-align:right;font-weight:700}
.v4-finances{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:13px}
.v4-finances>div{border:1px solid #dfe7d9;border-radius:12px;background:#fffefa;padding:13px 10px;min-width:0}
.v4-finances small{display:block;color:#819a83;letter-spacing:.65px;font-size:9px;font-weight:850;white-space:nowrap}
.v4-finances strong{display:block;font-size:23px;line-height:1.3;color:#27563c;font-variant-numeric:tabular-nums;margin-top:6px}
.v4-finances i{font-size:12px;color:#759c80;font-style:normal}
.v4-life-row{display:grid;grid-template-columns:105px minmax(0,1fr);gap:10px;padding:12px 0;border-top:1px solid #edf0e9}
.v4-life-row span:first-child{font-size:11px;font-weight:650;color:#8aa08f}
.v4-life-row b{font-size:12px;line-height:1.55;font-weight:600;color:#385744;overflow-wrap:anywhere}
.v4-task-list{display:flex;flex-direction:column;gap:8px;min-width:0}
.v4-task-list span{font-size:11px;line-height:1.35;color:#57735d}
.v4-task-list span.complete{color:#7b9d79;text-decoration:line-through}
.v4-details{background:#fffefa;border:1px solid #e0e7da;border-radius:12px;margin:8px 0;overflow:hidden}
.v4-details summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;list-style:none;padding:16px;color:#2f543d;font-weight:750;font-size:12px}
.v4-details summary::-webkit-details-marker{display:none}
.v4-details-right{color:#88a28e;font-size:10px;white-space:nowrap;font-weight:650}
.v4-details-right span{font-size:16px;display:inline-block;transition:transform .15s}
.v4-details[open] .v4-details-right span{transform:rotate(180deg)}
.v4-details[open] summary{border-bottom:1px solid #e9eee5}
.v4-details-body{padding:15px 16px;font-size:12px;line-height:1.65;color:#486b53;overflow-wrap:anywhere}
.v4-details-body>p{margin:0 0 10px}
.v4-details-body .receipt{margin-bottom:8px}
.v4-history{display:flex;flex-direction:column;gap:10px}
.v4-history p{font-size:12px;color:#486b53;line-height:1.55;margin:0;border-bottom:1px solid #e9eee6;padding-bottom:10px}
.v4-history p:last-child{border:0;padding-bottom:0}
.v4-minor-row{display:flex;justify-content:space-between;gap:8px;border-bottom:1px solid #e9eee5;padding:8px 0}
.v4-minor-row b{font-size:11px}
.v4-last-ai{border-radius:9px;background:#eaf2e8;padding:12px;margin-bottom:12px}
.v4-last-ai b{font-size:12px;color:#2c543b;display:block}
.v4-last-ai small{font-size:10px;color:#789180;display:block;margin-top:5px}
#profile-drawer .trace-button{width:100%;font-size:11px;padding:12px;line-height:1.35;text-align:center}
#profile-drawer .trace-output{max-height:350px}
@media(max-width:750px){
 #profile-drawer{width:100%!important;max-height:91dvh!important;border-radius:24px 24px 0 0!important;background:#f5f6ef!important}
 #profile-drawer .drawer-bar{padding:12px 18px!important}
 #profile-drawer .drawer-body{padding:12px 15px calc(33px + env(safe-area-inset-bottom,0px))!important}
 .v4-thought{padding:16px 17px;border-radius:15px;margin-bottom:11px}
 .v4-thought h3{font-size:22px;margin:11px 0 8px}
 .v4-thought-quote{font-size:13px}
 .v4-person-hero{padding:11px;margin-bottom:9px;gap:12px}
 .v4-portrait{height:84px;width:78px;flex-basis:78px;border-radius:11px}
 .v4-person-header h2{font-size:30px}
 .v4-basics{gap:7px;margin-bottom:10px}
 .v4-basics>div{padding:11px}
 .v4-panel{padding:15px;margin-bottom:10px}
 .v4-finances{gap:7px;margin-bottom:10px}
 .v4-finances>div{padding:11px 9px}
 .v4-finances strong{font-size:21px}
 .v4-life-row{grid-template-columns:89px minmax(0,1fr)}
}
@media(max-width:355px){
 .v4-person-header h2{font-size:26px}
 .v4-thought-top>span:first-child{font-size:9px}
 .v4-live-mark{font-size:8px}
 .v4-finances strong{font-size:18px}
}

/* TownSim v4 — readable resident dossier; verified AI thought first. */
#profile-drawer{width:min(482px,100%);background:#f7f8f2}
#profile-drawer .drawer-bar{background:#fbfcf8;color:#537462;border-bottom:1px solid #d9e6d8;padding:15px 22px;font-size:10px}
#profile-drawer .drawer-bar button{border-radius:12px;width:36px;height:36px;background:#e6efe6;color:#244d3c}
#profile-drawer .drawer-body{padding:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#a1baa7 transparent}
.citizen-card{padding:19px 19px 34px;display:flex;flex-direction:column;gap:14px;color:#213e32}
.citizen-thought{position:relative;overflow:hidden;border-radius:19px;padding:20px 20px 17px;background:linear-gradient(125deg,#183d32 0%,#234f41 75%,#2d5849 100%);box-shadow:0 10px 22px #264a3b22;color:#fffdf4}
.citizen-thought:after{content:"“";position:absolute;right:5px;top:3px;color:#ffffff0d;font:140px/.9 Georgia,serif;pointer-events:none}
.citizen-thought-eyebrow{position:relative;display:flex;align-items:center;gap:8px;color:#c5d8bf;font-size:10px;letter-spacing:1.5px;font-weight:800}
.citizen-thought-dot{width:7px;height:7px;background:#edce8f;border-radius:50%;box-shadow:0 0 0 4px #edce8f28}
.citizen-thought h3{position:relative;font:600 22px/1.2 var(--serif);color:#fff8e9;margin:12px 0 10px}
.citizen-thought p{position:relative;font-size:14px;line-height:1.65;font-weight:500;color:#f3f5e9;white-space:normal;overflow-wrap:anywhere}
.citizen-thought-meta{position:relative;margin-top:13px;padding-top:12px;border-top:1px solid #ffffff2e;color:#bdd2c3;font-size:10px;letter-spacing:.15px;line-height:1.5}
.citizen-identity{display:flex;gap:15px;align-items:center;padding:5px 4px 3px}
.citizen-portrait{position:relative;flex:none;display:grid;place-items:center;width:89px;height:98px;border:3px solid white;border-radius:17px;overflow:hidden;font:700 34px var(--serif);color:#1c3d2d;box-shadow:0 4px 17px #264f3d1e}
.citizen-portrait img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.citizen-identity-copy{flex:1;min-width:0}
.citizen-kicker{display:block;color:#718875;font-size:10px;font-weight:850;letter-spacing:1.4px}
.citizen-identity h2{font:600 34px/1.06 var(--serif);color:#234736;letter-spacing:-1px;margin:5px 0 5px}
.citizen-identity p{color:#55705e;font-size:12px;line-height:1.55}
.citizen-location{display:inline-block;margin-top:7px;font-size:11px;color:#74917b;line-height:1.5}
.citizen-now,.citizen-section{background:#fffefb;border:1px solid #dfe9dc;border-radius:15px;padding:15px 16px}
.citizen-now{background:#edf3ec;border-color:#cbdccc}
.citizen-section-top{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:0 0 12px;color:#66826d;font-size:10px;letter-spacing:1px;font-weight:850}
.citizen-section-top>span:last-child:not(:first-child){letter-spacing:.25px;font-weight:750}
.citizen-flag{border-radius:999px;padding:5px 9px;background:#e0e9dc;color:#426b50;white-space:nowrap;font-size:10px;letter-spacing:0;font-weight:800}
.citizen-flag-thinking{background:#e7e2f5;color:#5f588d}
.citizen-flag-inside{background:#dce5da;color:#355a43}
.citizen-flag-moving{background:#e1e8f7;color:#3e6595}
.citizen-now .citizen-section-top{margin-bottom:8px}
.citizen-current-status{font-size:15px;line-height:1.4;font-weight:780;color:#254e39}
.citizen-now-note{font-size:11px;line-height:1.5;color:#678373;margin-top:5px}
.citizen-meters{display:grid;gap:13px}
.citizen-meter-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;font-size:12px;color:#536d5c;font-weight:650}
.citizen-meter-top strong{color:#254b3a;font-variant-numeric:tabular-nums;font-size:12px}
.citizen-meter-track{height:8px;border-radius:99px;background:#e7ece5;overflow:hidden}
.citizen-meter-track>span{display:block;height:100%;border-radius:99px;background:#629a76;transition:width .4s ease}
.citizen-meter-hunger .citizen-meter-track>span{background:#d6a268}
.citizen-meter-mood .citizen-meter-track>span{background:#7798ab}
.citizen-finances{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.citizen-fact{border-radius:11px;background:#f1f5ef;padding:12px 10px;min-width:0}
.citizen-fact small{display:block;color:#849989;font-size:9px;letter-spacing:.75px;font-weight:800}
.citizen-fact strong{display:block;color:#2b5742;font-size:18px;margin-top:6px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.citizen-tasks{display:flex;flex-direction:column;gap:9px}
.citizen-task{display:flex;align-items:flex-start;gap:9px;font-size:12px;line-height:1.5;color:#54695c}
.citizen-task>span:first-child{flex:none;display:grid;place-items:center;width:20px;height:20px;color:#a0b3a6;font-size:18px}
.citizen-task.is-done{color:#608b68}
.citizen-task.is-done>span:first-child{font-weight:900;color:#3e8758;font-size:15px;background:#e8f5e9;border-radius:6px}
.citizen-personal-grid{display:grid;gap:13px}
.citizen-personal-grid small{display:block;color:#7e9384;font-size:9px;font-weight:850;letter-spacing:1px;margin-bottom:4px}
.citizen-personal-grid b{display:block;font-size:12px;line-height:1.55;color:#365a43;font-weight:680;overflow-wrap:anywhere}
.citizen-goal p{font-size:12px;line-height:1.65;color:#45624e}
.citizen-goal p.citizen-muted{font-size:11px;color:#789080;margin-top:9px}
.citizen-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:11px}
.citizen-tags span{padding:6px 8px;font-size:10px;color:#41624d;background:#ecf3e9;border-radius:8px}
.citizen-more{padding-bottom:8px}
.citizen-details{border-top:1px solid #e5eae2}
.citizen-details summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 1px;color:#355842;font-size:12px;font-weight:760;cursor:pointer}
.citizen-details summary::-webkit-details-marker{display:none}
.citizen-details summary>span{font-size:19px;color:#8eaa93;transition:transform .2s}
.citizen-details[open] summary>span{transform:rotate(180deg)}
.citizen-details-inner{padding:0 0 14px;color:#516c5a;overflow-wrap:anywhere;font-size:12px;line-height:1.7}
.citizen-details-inner p+p{margin-top:8px}
.citizen-history-row{padding:10px 0;border-bottom:1px solid #e9eee7;line-height:1.6}
.citizen-history-row:last-child{border-bottom:0}
.citizen-history-row strong{display:block;font-size:12px}
.citizen-history-row small{display:block;color:#78917b;font-size:10px;margin-top:3px}
.citizen-purchase-price{float:right;color:#417654;font-weight:800;font-size:12px}
.citizen-empty{color:#97a599;font-size:12px}
.citizen-decision-detail{border-radius:11px;background:#eff5eb;padding:12px;margin-bottom:8px}
.citizen-decision-detail small{display:block;color:#648676;font-size:10px}
.citizen-decision-detail b{display:block;color:#31543e;font-size:12px;margin:6px 0}
.citizen-decision-detail p{font-size:12px;line-height:1.65;color:#496951}
.citizen-more .trace-button{width:100%;text-align:left;padding:11px 12px;border-radius:10px}
.citizen-more .trace-output{font-size:10px;max-height:320px}
@media(max-width:750px){
 #profile-drawer{width:100%!important;max-height:90dvh;min-height:38dvh;border-radius:22px 22px 0 0}
 #profile-drawer .drawer-bar{padding:12px 18px}
 #profile-drawer .drawer-body{padding:0 0 max(12px,env(safe-area-inset-bottom,0px));}
 .citizen-card{padding:14px 16px 28px;gap:11px}
 .citizen-thought{padding:18px 17px 15px;border-radius:16px}
 .citizen-thought h3{font-size:21px;margin:9px 0}
 .citizen-thought p{font-size:13px;line-height:1.55}
 .citizen-portrait{height:88px;width:80px}
 .citizen-identity h2{font-size:30px}
 .citizen-now,.citizen-section{padding:13px 14px;border-radius:13px}
 .citizen-fact strong{font-size:17px}
}
@media(prefers-reduced-motion:reduce){
 .citizen-meter-track>span,.citizen-details summary>span{transition:none}
}
.gesture-hint{display:none}\n@media(max-width:750px){.gesture-hint{display:flex;gap:7px;align-items:center;position:absolute;left:50%;transform:translateX(-50%);bottom:calc(86px + env(safe-area-inset-bottom,0px));z-index:3;pointer-events:none;white-space:nowrap;background:rgba(23,64,52,.72);border:1px solid rgba(255,255,240,.25);border-radius:30px;padding:8px 12px;color:#f5f7ed;font-size:10px;font-weight:650;letter-spacing:.1px;backdrop-filter:blur(8px)}.gesture-hint span{color:#d9c691}.gesture-hint.used{display:none}}\n
/* Visual pass 13 — quieter world labels + cinematic edge treatment. */
.avatar-label{
  min-width:48px;
  padding:4px 7px;
  border-radius:7px;
  background:rgba(249,249,239,.78);
  border:1px solid rgba(255,255,255,.68);
  color:#244a35;
  box-shadow:0 3px 10px rgba(22,54,44,.22);
  backdrop-filter:blur(7px) saturate(1.08);
  -webkit-backdrop-filter:blur(7px) saturate(1.08);
  font-size:9px;
  opacity:.86;
  transition:opacity .15s,transform .15s,background .15s;
}
.avatar-label::after{width:7px;height:7px;bottom:-5px;border-color:rgba(255,255,255,.55)}
.avatar-label small{font-size:10px!important;line-height:1;margin-top:2px!important;color:#397052!important}
.avatar-label.selected{
  opacity:1;
  transform:translate(-50%,-100%) scale(1.06);
  background:rgba(35,75,56,.94);
  color:#fff8df;
  box-shadow:0 5px 16px rgba(19,54,39,.32);
}
.avatar-label.selected small{color:#f6dca0!important}
.world-shade{
  background:
    radial-gradient(ellipse at 50% 46%,transparent 36%,rgba(17,42,34,.08) 78%,rgba(15,34,29,.17) 100%),
    linear-gradient(0deg,rgba(18,39,31,.25),transparent 18%,transparent 84%,rgba(255,234,194,.035));
}
@media(max-width:750px){
  .avatar-label{padding:4px 6px;min-width:44px;font-size:8px;opacity:.9}
  .avatar-label small{font-size:9px!important}
}

/* Visual pass 13b — scale labels down over the closer camera. */
.avatar-label{transform:translate(-50%,-100%) scale(.88)}
.avatar-label.selected{transform:translate(-50%,-100%) scale(1)}

/* Level-art 24: compact in-world nameplates instead of speech-card bubbles. */
.avatar-label{
  min-width:0!important;
  padding:4px 7px!important;
  border:1px solid rgba(255,255,255,.22)!important;
  border-radius:6px!important;
  background:rgba(28,55,43,.76)!important;
  color:#fffdf1!important;
  box-shadow:0 3px 10px rgba(15,38,29,.2)!important;
  backdrop-filter:blur(5px)!important;
  -webkit-backdrop-filter:blur(5px)!important;
  font-size:9px!important;
  line-height:1.05!important;
  opacity:.82!important;
  transform:translate(-50%,-115%) scale(.88)!important;
}
.avatar-label::after{display:none!important}
.avatar-label small{
  display:inline-block!important;
  font-size:9px!important;
  color:#d5e7d3!important;
  margin:0 0 0 4px!important;
  vertical-align:baseline!important;
}
.avatar-label.selected{
  background:rgba(42,78,57,.96)!important;
  border-color:#f0cd8e!important;
  color:#fff4ce!important;
  opacity:1!important;
  transform:translate(-50%,-115%) scale(1)!important;
  box-shadow:0 4px 14px rgba(15,38,29,.3)!important;
}


/* TownSim TS-UI-02: five genuinely different layouts built around the CITY, not an individual. */
body[data-tsui-theme]{--ch-bg:rgba(18,42,43,.94);--ch-border:rgba(194,225,212,.34);--ch-fg:#fafbf4;--ch-soft:#bad2cb;--ch-accent:#dff3a6;--ch-slot:rgba(255,255,255,.085);--ch-shadow:0 12px 38px rgba(7,25,27,.28)}
body[data-tsui-theme] .bottom-controls{display:none!important}
body[data-tsui-theme] .identity small{display:none!important}
body[data-tsui-theme] .topbar{align-items:center!important}
body[data-tsui-theme] #world{height:100dvh!important}
#tsui-switch{position:absolute;z-index:8;top:76px;right:clamp(12px,2vw,26px);display:flex;align-items:center;gap:11px;padding:7px;background:rgba(16,33,37,.87);border:1px solid rgba(255,255,255,.25);box-shadow:0 9px 34px #0004;border-radius:13px;backdrop-filter:blur(18px);color:#fbfdfa;pointer-events:auto}
.tsui-switch-title{margin:0 6px;font-size:10px;letter-spacing:1.3px;font-weight:900;white-space:nowrap;color:#d2e9e0}
.tsui-switch-items{display:flex;align-items:center;gap:4px}
#tsui-switch button{white-space:nowrap;border:1px solid transparent;background:#ffffff15;border-radius:8px;color:#e9f2f0;font-size:11px;font-weight:800;min-height:34px;padding:7px 9px}
#tsui-switch button span{font-weight:600}
#tsui-switch button:hover{background:#ffffff32}
#tsui-switch button[aria-pressed="true"]{background:#e3f5bd;color:#203c37;border-color:#f3ffd0}
#city-hud{position:absolute;inset:0;z-index:5;pointer-events:none;color:var(--ch-fg);font-family:system-ui,-apple-system,Arial,sans-serif}
#city-hud>*{position:absolute;pointer-events:auto;min-width:0}
#city-hud .city-widget{background:var(--ch-bg);color:var(--ch-fg);border:1px solid var(--ch-border);box-shadow:var(--ch-shadow);border-radius:17px;padding:14px;backdrop-filter:blur(19px);-webkit-backdrop-filter:blur(19px);min-width:0}
#city-hud .city-widget>header{display:flex;justify-content:space-between;gap:6px;align-items:center;margin-bottom:12px}
#city-hud .city-widget h2{font:750 18px/1.1 system-ui,sans-serif;margin:4px 0 0;letter-spacing:-.55px;color:var(--ch-fg)}
#city-hud .city-eyebrow{font-size:9px;letter-spacing:1.3px;font-weight:850;color:var(--ch-accent)}
#city-hud .city-indicator{display:inline-flex;align-items:center;gap:5px;padding:6px 8px;border-radius:999px;background:var(--ch-slot);font-size:10px;font-weight:700;color:var(--ch-fg);white-space:nowrap}
#city-hud .city-indicator::before,.city-live-dot{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:#98dbaa;box-shadow:0 0 9px #8fcfa9;flex-shrink:0}
#city-hud .city-indicator[data-health="off"]::before{background:#e4a9a9;box-shadow:0 0 9px #d68c8c}
#city-hud .city-indicator[data-health="pause"]::before{background:#f3d58e;box-shadow:0 0 9px #e7cb8c}
.city-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.city-stat{min-width:0;padding:10px 9px;background:var(--ch-slot);border:1px solid rgba(255,255,255,.075);border-radius:10px}
.city-stat span{display:block;color:var(--ch-soft);font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.city-stat strong{display:block;margin-top:5px;font-size:22px;font-weight:850;color:var(--ch-fg);line-height:1.15;font-variant-numeric:tabular-nums}
.city-overview-footer{display:flex;align-items:center;justify-content:space-between;gap:9px;font-size:10px;font-weight:650;color:var(--ch-soft);margin-top:11px}
.city-overview-footer>*{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#city-hud .city-small-link{border:1px solid var(--ch-border);border-radius:8px;background:var(--ch-slot);color:var(--ch-accent);font-size:10px;padding:8px;white-space:nowrap;font-weight:700}
.city-event-list{display:flex;flex-direction:column;gap:5px;max-height:205px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--ch-border) transparent}
.city-event{display:grid;grid-template-columns:26px 1fr;gap:8px;align-items:start;padding:7px 5px;border-bottom:1px solid var(--ch-border)}
.city-event:last-child{border-bottom:0}
.city-event-icon{display:grid;place-items:center;height:25px;width:25px;background:var(--ch-slot);border-radius:8px;font-size:14px}
.city-event-text{min-width:0}
.city-event-text div{display:flex;justify-content:space-between;gap:5px;align-items:baseline;margin-bottom:3px}
.city-event-text strong{font-size:11px;color:var(--ch-fg)}
.city-event-text time{font-size:10px;color:var(--ch-accent);white-space:nowrap}
.city-event-text p{color:var(--ch-soft);font-size:10px;line-height:1.45;overflow-wrap:anywhere;margin:0}
#city-hud .city-empty{color:var(--ch-soft);font-size:11px;line-height:1.5}
.city-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.city-actions button{border:1px solid var(--ch-border);background:var(--ch-slot);border-radius:10px;color:var(--ch-fg);font-size:10px;font-weight:700;min-height:58px;padding:7px 2px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:5px;line-height:1.15}
.city-actions button span{color:var(--ch-accent);font-size:20px;line-height:1}
.city-actions button:hover,.city-time button:hover,.city-primary:hover{filter:brightness(1.2);background:#ffffff28}
#city-hud button:focus-visible,#tsui-switch button:focus-visible{outline:3px solid #fce098;outline-offset:2px}
#city-hud #city-play{display:flex;align-items:center;gap:11px;justify-content:space-between}
.city-play-status{display:flex;gap:7px;align-items:center;color:var(--ch-soft);font-size:10px;white-space:nowrap}
.city-play-controls{display:flex;align-items:center;gap:8px}
#city-hud .city-primary{padding:11px 14px;border-radius:10px;border:1px solid #ffffff55;background:var(--ch-accent);color:#203b38;font-size:12px;font-weight:850;white-space:nowrap;min-height:40px}
.city-time{display:flex;gap:2px;padding:3px;border-radius:9px;border:1px solid var(--ch-border);background:var(--ch-slot)}
.city-time button{border:0;background:transparent;color:var(--ch-fg);padding:8px 9px;font-weight:850;font-size:11px;border-radius:7px}
.city-time button[aria-pressed="true"]{background:#f6f8e7;color:#183e3b}
#city-hud #city-pulse{display:flex;flex-direction:column;gap:9px}
.city-pulse-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.city-pulse-grid>div{background:var(--ch-slot);border-radius:10px;padding:9px 8px;min-width:0}
.city-pulse-grid strong{display:block;font-size:18px;line-height:1.1;color:var(--ch-fg);font-variant-numeric:tabular-nums}
.city-pulse-grid span{display:block;font-size:9px;color:var(--ch-soft);line-height:1.25;margin-top:5px}
body[data-tsui-theme="panorama"]{--ch-bg:rgba(24,52,52,.93);--ch-accent:#c7f4db}
body[data-tsui-theme="command"]{--ch-bg:linear-gradient(145deg,rgba(34,49,69,.96),rgba(21,36,61,.96));--ch-accent:#9fddfb;--ch-border:#9fc4ef5c;--ch-soft:#c2cee1}
body[data-tsui-theme="chronicle"]{--ch-bg:linear-gradient(155deg,rgba(47,40,52,.96),rgba(31,37,47,.96));--ch-accent:#ffd3ab;--ch-border:#f4cda65a;--ch-soft:#e5cfc9}
body[data-tsui-theme="console"]{--ch-bg:linear-gradient(160deg,rgba(24,54,49,.97),rgba(18,44,42,.97));--ch-accent:#e7cf8f;--ch-border:#f0dcad58;--ch-soft:#cad7cb}
body[data-tsui-theme="map"]{--ch-bg:rgba(19,45,37,.91);--ch-accent:#d9efb3;--ch-soft:#cfdbce}
/* 01 panorama: command dock below, strategic overview left, news right. */
body[data-tsui-theme="panorama"] #city-overview{top:151px;left:23px;width:355px}
body[data-tsui-theme="panorama"] #city-activity{top:151px;right:23px;width:320px}
body[data-tsui-theme="panorama"] #city-quick{right:23px;bottom:22px;width:350px}
body[data-tsui-theme="panorama"] #city-play{left:23px;bottom:22px;width:355px}
body[data-tsui-theme="panorama"] #city-pulse{left:23px;bottom:103px;width:355px}
/* 02 command: real left control column, vertical navigation on the right. */
body[data-tsui-theme="command"] #city-overview{top:145px;left:18px;width:294px}
body[data-tsui-theme="command"] #city-activity{left:18px;top:440px;width:294px}
body[data-tsui-theme="command"] #city-quick{top:145px;right:18px;width:198px}
body[data-tsui-theme="command"] #city-quick .city-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
body[data-tsui-theme="command"] #city-play{right:18px;bottom:22px;width:380px}
body[data-tsui-theme="command"] #city-pulse{left:325px;bottom:22px;width:310px}
/* 03 chronicle: latest events take priority on the left, stats stack across right. */
body[data-tsui-theme="chronicle"] #city-overview{top:145px;right:20px;width:385px}
body[data-tsui-theme="chronicle"] #city-activity{top:145px;left:20px;width:380px}
body[data-tsui-theme="chronicle"] #city-activity .city-event-list{max-height:380px}
body[data-tsui-theme="chronicle"] #city-pulse{right:20px;top:446px;width:385px}
body[data-tsui-theme="chronicle"] #city-quick{left:20px;bottom:20px;width:480px}
body[data-tsui-theme="chronicle"] #city-play{right:20px;bottom:20px;width:385px}
/* 04 console: wide integrated bottom console, unobstructed world above. */
body[data-tsui-theme="console"] #city-overview{left:18px;bottom:113px;width:312px}
body[data-tsui-theme="console"] #city-activity{left:342px;bottom:113px;width:calc(100vw - 690px)}
body[data-tsui-theme="console"] #city-quick{right:18px;bottom:113px;width:316px}
body[data-tsui-theme="console"] #city-play{bottom:21px;left:50%;transform:translateX(-50%);width:470px}
body[data-tsui-theme="console"] #city-pulse{top:145px;left:18px;width:307px}
body[data-tsui-theme="console"] #city-activity .city-event-list{max-height:150px}
body[data-tsui-theme="console"] #city-overview,body[data-tsui-theme="console"] #city-activity,body[data-tsui-theme="console"] #city-quick{height:231px}
body[data-tsui-theme="console"] #city-overview{overflow:hidden}
body[data-tsui-theme="console"] #city-quick .city-actions button{min-height:57px}
/* 05 map: condensed at-a-glance cards and vertical hotkey rail; scene prioritized. */
body[data-tsui-theme="map"] #city-overview{top:145px;left:18px;width:260px;padding:11px}
body[data-tsui-theme="map"] #city-overview .city-stat{padding:7px}
body[data-tsui-theme="map"] #city-overview .city-stat strong{font-size:18px}
body[data-tsui-theme="map"] #city-quick{top:145px;right:18px;width:164px;padding:10px}
body[data-tsui-theme="map"] #city-quick header{display:none}
body[data-tsui-theme="map"] #city-quick .city-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
body[data-tsui-theme="map"] #city-quick .city-actions button{font-size:9px;min-height:58px}
body[data-tsui-theme="map"] #city-activity{bottom:20px;left:18px;width:340px}
body[data-tsui-theme="map"] #city-activity .city-event-list{max-height:92px;overflow:hidden}
body[data-tsui-theme="map"] #city-activity .city-event:nth-child(n+2){display:none}
body[data-tsui-theme="map"] #city-pulse{right:18px;top:490px;width:235px}
body[data-tsui-theme="map"] #city-play{bottom:20px;right:18px;width:385px}
@media(min-width:1151px) and (max-height:790px){
 body[data-tsui-theme="command"] #city-activity{top:435px}
 body[data-tsui-theme="command"] #city-activity .city-event-list{max-height:110px}
 body[data-tsui-theme="chronicle"] #city-pulse{top:420px}
 body[data-tsui-theme="map"] #city-pulse{top:430px}
}
@media(min-width:781px) and (max-width:1150px){
 #tsui-switch{top:76px}
 #tsui-switch button{padding:7px 5px;font-size:10px}
 body[data-tsui-theme="panorama"] #city-overview,body[data-tsui-theme="panorama"] #city-play,body[data-tsui-theme="panorama"] #city-pulse{width:290px;left:12px}
 body[data-tsui-theme="panorama"] #city-activity,body[data-tsui-theme="panorama"] #city-quick{width:290px;right:12px}
 body[data-tsui-theme="command"] #city-quick{width:172px}
 body[data-tsui-theme="command"] #city-pulse{left:325px;width:270px}
 body[data-tsui-theme="command"] #city-play{width:290px}
 body[data-tsui-theme="chronicle"] #city-overview,body[data-tsui-theme="chronicle"] #city-pulse{width:300px}
 body[data-tsui-theme="chronicle"] #city-activity{width:305px}
 body[data-tsui-theme="chronicle"] #city-quick{width:430px}
 body[data-tsui-theme="chronicle"] #city-play{width:310px}
 body[data-tsui-theme="console"] #city-overview{width:285px}
 body[data-tsui-theme="console"] #city-activity{left:314px;width:calc(100vw - 602px)}
 body[data-tsui-theme="console"] #city-quick{width:260px}
 body[data-tsui-theme="console"] #city-quick .city-actions button{font-size:9px}
 body[data-tsui-theme="console"] #city-overview,body[data-tsui-theme="console"] #city-activity,body[data-tsui-theme="console"] #city-quick{bottom:101px;height:230px}
 body[data-tsui-theme="map"] #city-pulse{top:450px}
}
@media(max-width:780px){
 body[data-tsui-theme] .topbar{top:calc(8px + env(safe-area-inset-top,0px))!important}
 body[data-tsui-theme] .identity .brand-icon{width:30px!important;height:30px!important}
 body[data-tsui-theme] .identity strong{font-size:12px!important}
 body[data-tsui-theme] .clock{padding:8px!important}
 body[data-tsui-theme] .clock strong{font-size:16px!important}
 #tsui-switch{top:calc(57px + env(safe-area-inset-top,0px));left:7px;right:7px;padding:4px;gap:0;width:auto;justify-content:space-between;border-radius:12px}
 .tsui-switch-title{display:none}
 .tsui-switch-items{width:100%;justify-content:space-between;gap:2px}
 #tsui-switch button{padding:7px 3px;min-height:33px;flex:1;font-size:10px}
 #tsui-switch button span{display:none}
 #city-hud .city-widget{border-radius:12px;padding:9px}
 #city-hud .city-widget h2{font-size:14px}
 #city-hud .city-widget>header{margin-bottom:7px}
 .city-stats{gap:4px}
 .city-stat{padding:6px 5px;border-radius:7px}
 .city-stat span{font-size:8px}
 .city-stat strong{font-size:16px;margin-top:2px}
 .city-overview-footer{margin-top:6px;font-size:9px}
 #city-hud #city-overview{top:calc(100px + env(safe-area-inset-top,0px));left:8px;right:8px;width:auto;height:auto;padding:9px}
 #city-hud #city-overview .city-stat{padding:6px 5px}
 #city-hud #city-activity{left:8px;right:8px;top:auto;bottom:calc(153px + env(safe-area-inset-bottom,0px));width:auto;height:auto;padding:8px}
 #city-hud #city-activity .city-event-list{max-height:45px;overflow:hidden}
 #city-hud #city-activity .city-event:nth-child(n+2){display:none}
 #city-hud #city-activity header{margin-bottom:2px}
 #city-hud #city-activity .city-event{padding:2px 0;grid-template-columns:23px 1fr}
 #city-hud #city-quick{top:auto;left:8px;right:8px;bottom:calc(78px + env(safe-area-inset-bottom,0px));width:auto;height:auto;padding:6px}
 #city-hud #city-quick header{display:none}
 #city-hud #city-quick .city-actions{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:3px}
 #city-hud #city-quick .city-actions button{min-height:50px;min-width:0;font-size:0;gap:2px;border-radius:7px}
 #city-hud #city-quick .city-actions button span{font-size:22px}
 #city-hud #city-play{left:8px;right:8px;bottom:calc(10px + env(safe-area-inset-bottom,0px));width:auto;min-height:59px;display:flex;padding:7px;gap:4px}
 #city-hud .city-play-status{font-size:9px}
 #city-hud .city-primary{min-height:39px;padding:8px 11px;font-size:11px}
 #city-hud .city-time button{padding:8px 8px;font-size:10px}
 #city-hud #city-pulse{display:none}
 /* Mobile 02: column of city actions sits alongside a compact city state. */
 body[data-tsui-theme="command"] #city-overview{right:67px!important}
 body[data-tsui-theme="command"] #city-quick{left:auto!important;top:calc(100px + env(safe-area-inset-top,0px))!important;right:8px!important;bottom:auto!important;width:52px!important;padding:5px!important}
 body[data-tsui-theme="command"] #city-quick .city-actions{grid-template-columns:1fr!important;gap:2px}
 body[data-tsui-theme="command"] #city-quick .city-actions button{min-height:36px}
 body[data-tsui-theme="command"] #city-quick .city-actions button span{font-size:18px}
 body[data-tsui-theme="command"] #city-activity{bottom:calc(78px + env(safe-area-inset-bottom,0px))!important;right:67px!important}
 body[data-tsui-theme="command"] #city-play{bottom:calc(10px + env(safe-area-inset-bottom,0px))!important}
 /* Mobile 03: event chronology top, live city footer above controls. */
 body[data-tsui-theme="chronicle"] #city-activity{top:calc(100px + env(safe-area-inset-top,0px))!important;bottom:auto!important;height:155px!important}
 body[data-tsui-theme="chronicle"] #city-activity .city-event-list{max-height:106px;overflow:auto!important}
 body[data-tsui-theme="chronicle"] #city-activity .city-event:nth-child(n+2){display:grid}
 body[data-tsui-theme="chronicle"] #city-overview{top:auto!important;bottom:calc(149px + env(safe-area-inset-bottom,0px))!important}
 /* Mobile 04: lower console with compact status immediately above dock. */
 body[data-tsui-theme="console"] #city-overview{top:auto!important;bottom:calc(157px + env(safe-area-inset-bottom,0px))!important}
 body[data-tsui-theme="console"] #city-activity{display:none!important}
 body[data-tsui-theme="console"] #city-quick{bottom:calc(78px + env(safe-area-inset-bottom,0px))!important}
 /* Mobile 05: minimal map, condensed counters and latest news, with visible hotkeys. */
 body[data-tsui-theme="map"] #city-overview{top:calc(100px + env(safe-area-inset-top,0px))!important;left:8px!important;right:8px!important}
 body[data-tsui-theme="map"] #city-overview .city-overview-footer{display:none}
 body[data-tsui-theme="map"] #city-activity{bottom:calc(153px + env(safe-area-inset-bottom,0px))!important}
}
@media(max-width:370px){
 #city-hud .city-widget{padding:7px}
 #city-hud #city-quick .city-actions button span{font-size:19px}
 #city-hud .city-primary{padding:7px 8px}
 #city-hud .city-time button{padding:7px}
 #city-hud #city-play{gap:3px}
}
@media(prefers-reduced-motion:reduce){#city-hud *{transition:none!important}}

/* Keep the console playback bar fully on-screen after desktop centering is disabled on mobile. */
@media(max-width:780px){body[data-tsui-theme="console"] #city-hud #city-play{transform:none!important}}

/* Mobile layout selector: keep abbreviated names visible, not just anonymous numbers. */
@media(max-width:780px){#tsui-switch button{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:9px!important;padding:7px 2px!important}#tsui-switch button span{display:inline!important;font-size:9px;font-weight:650}}


/* TS-UI-03 — reference PNG: cream panels, pine/terracotta PNG icons. */
.ref-icon{width:40px;height:40px;object-fit:contain;flex:none}
.city-actions .ref-nav-label{font-size:10px!important;font-weight:750;line-height:1.15;color:inherit!important}
#city-pause .ref-icon{width:27px;height:27px}
#ref-overview-close{display:none}
.ref-relations-tip{display:none;font-size:12px;line-height:1.5;margin:0 0 14px;color:#39553a}
body.ref-relations-mode .ref-relations-tip{display:block}
body[data-tsui-theme="reference"]{
 --ch-bg:linear-gradient(110deg,#fff8e8,#f7e8cd);
 --ch-border:#d5b380;--ch-fg:#15331d;--ch-soft:#4b6143;
 --ch-accent:#537b38;--ch-slot:#f0e2c5;
 --ch-shadow:0 5px 15px #27381d35,inset 0 1px 0 #fffef8;
}
body[data-tsui-theme="reference"] .topbar{inset:0!important;display:block!important;height:100%;padding:0!important;z-index:7;pointer-events:none}
body[data-tsui-theme="reference"] .identity,
body[data-tsui-theme="reference"] .clock{
 position:absolute!important;top:max(20px,env(safe-area-inset-top,0px));height:65px;
 background:var(--ch-bg)!important;color:#15331d!important;border:1px solid #d5b380!important;
 border-radius:15px!important;box-shadow:var(--ch-shadow)!important;backdrop-filter:none!important;
}
body[data-tsui-theme="reference"] .identity{left:20px;padding:7px 19px 7px 11px;gap:14px;text-shadow:none!important}
body[data-tsui-theme="reference"] .brand-icon{width:59px;height:48px;border:0;background:none;border-radius:0;border-right:1px solid #d0b581;padding-right:11px}
body[data-tsui-theme="reference"] .brand-icon .ref-icon{width:48px;height:48px}
body[data-tsui-theme="reference"] .identity strong{font:850 28px/1 system-ui,sans-serif;letter-spacing:-.5px}
body[data-tsui-theme="reference"] .identity strong span{font-weight:850;letter-spacing:-.5px}
body[data-tsui-theme="reference"] .clock{right:20px;gap:13px;padding:6px 7px 6px 12px}
body[data-tsui-theme="reference"] .ref-sun{width:45px;height:45px;object-fit:contain}
body[data-tsui-theme="reference"] .clock>span:first-of-type{font-size:13px;letter-spacing:-.3px;color:#193522;border-left:1px solid #d0b581;padding-left:12px}
body[data-tsui-theme="reference"] .clock #clock{font-size:34px;line-height:1;letter-spacing:-1px;border-left:1px solid #d0b581;padding-left:13px}
body[data-tsui-theme="reference"] #speed-label{background:#b5cd8b;color:#20391d;font-size:20px;letter-spacing:-.3px;border:1px solid #8fa96b;border-radius:8px;padding:7px 12px}
body[data-tsui-theme="reference"] #phase-label,
body[data-tsui-theme="reference"] .top-actions,
body[data-tsui-theme="reference"] .map-corner,
body[data-tsui-theme="reference"] .left-bottom,
body[data-tsui-theme="reference"] .view-hint,
body[data-tsui-theme="reference"] .gesture-hint,
body[data-tsui-theme="reference"] #mobile-directory{display:none!important}
.ref-settings-button{border:1px solid #be6237;border-radius:10px;background:linear-gradient(#e27643,#c6582e);width:49px;height:49px;padding:9px;display:grid;place-items:center}
.ref-settings-button .ref-icon{filter:brightness(0) invert(1);width:29px;height:29px}
body:not([data-tsui-theme="reference"]) .ref-settings-button{width:34px;height:34px;padding:5px}
body:not([data-tsui-theme="reference"]) .ref-settings-button .ref-icon{width:24px;height:24px}
#tsui-switch{position:absolute!important;top:94px!important;right:20px!important;left:auto!important;bottom:auto!important;width:min(350px,calc(100vw - 32px))!important;display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:15px!important;border-radius:16px;color:#15331d;background:linear-gradient(125deg,#fff9ec,#f5e7cf);border:1px solid #c9ac7c;box-shadow:0 8px 30px #15291a40;backdrop-filter:none;z-index:20;max-height:calc(100dvh - 116px);overflow:auto}
#tsui-switch[hidden]{display:none!important}
.ref-settings-head{display:flex;align-items:center;justify-content:space-between}
#tsui-switch .tsui-switch-title{font-size:15px;font-weight:800;color:#183c24;letter-spacing:-.3px;margin:0}
#ref-settings-close{font-size:25px!important;width:36px;min-height:36px!important;padding:0!important;border:1px solid #d2b783!important;background:#efdfc0!important;color:#203d25!important}
#tsui-switch .tsui-switch-items{display:grid;grid-template-columns:1fr 1fr;gap:7px}
#tsui-switch button{background:#f4e5c9;color:#1d3a22;border:1px solid #d0b581;white-space:normal;min-height:43px;font-size:12px}
#tsui-switch button[aria-pressed="true"]{background:#557b3e;color:#fff9e9;border-color:#365927}
#tsui-switch button:hover{background:#e7d3ad}
#tsui-switch button[aria-pressed="true"]:hover{background:#456931}
.ref-settings-tools{display:grid;grid-template-columns:1fr 1fr;gap:7px;border-top:1px solid #d4b887;padding-top:12px}
.ref-settings-tools a{grid-column:1/-1;text-align:center;color:#294c2b;font-size:12px;padding:12px;border:1px solid #ccb07f;border-radius:8px;background:#fff8e8;text-decoration:none;font-weight:750}
body[data-tsui-theme="reference"] .world-shade{background:linear-gradient(0deg,#334d2720,transparent 23%,transparent 82%,#243b2720)}
body[data-tsui-theme="reference"] #city-hud .city-widget{border-radius:16px;border:1px solid #d5b380;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body[data-tsui-theme="reference"] #city-overview,
body[data-tsui-theme="reference"] #city-activity,
body[data-tsui-theme="reference"] #city-pulse{display:none!important}
body[data-tsui-theme="reference"].ref-overview-open #city-overview{
 display:block!important;top:101px!important;left:20px!important;right:auto!important;bottom:auto!important;
 width:340px!important;height:auto!important;max-height:calc(100dvh - 250px);overflow:auto;z-index:8
}
body[data-tsui-theme="reference"].ref-overview-open #ref-overview-close{display:block;border:0;background:#ead6b0;border-radius:7px;color:#20452a;width:30px;height:30px;font-size:21px;flex:none}
body[data-tsui-theme="reference"] #city-hud #city-quick{
 top:auto!important;left:auto!important;bottom:max(20px,env(safe-area-inset-bottom,0px))!important;right:20px!important;
 width:610px!important;height:84px!important;padding:7px 9px!important
}
body[data-tsui-theme="reference"] #city-quick>header{display:none!important}
body[data-tsui-theme="reference"] #city-quick .city-actions{display:grid!important;grid-template-columns:repeat(8,minmax(0,1fr))!important;gap:0!important;height:100%}
body[data-tsui-theme="reference"] #city-quick .city-actions button{
 min-width:0!important;min-height:0!important;padding:3px!important;border:0!important;background:transparent!important;
 border-radius:6px!important;font-size:11px!important;gap:3px!important;color:#193522!important;position:relative;
 transition:background .13s,transform .13s;
}
body[data-tsui-theme="reference"] #city-quick .city-actions button+button{border-left:1px solid #d0b581!important;border-radius:0!important}
body[data-tsui-theme="reference"] #city-quick .city-actions button:hover{filter:none;background:#e6d3ac!important;transform:translateY(-2px)}
body[data-tsui-theme="reference"] #city-quick .ref-icon{width:37px;height:37px}
body[data-tsui-theme="reference"] #city-quick .ref-nav-label{font-size:10px!important;font-weight:800;letter-spacing:-.2px;color:#193522!important}
body[data-tsui-theme="reference"] #city-hud #city-play{
 top:auto!important;bottom:max(20px,env(safe-area-inset-bottom,0px))!important;left:20px!important;right:auto!important;
 width:408px!important;height:78px!important;min-height:0!important;padding:9px 11px!important;transform:none!important;gap:10px!important
}
body[data-tsui-theme="reference"] .city-play-status{font-size:12px;font-weight:800;color:#193522;gap:9px;max-width:130px;white-space:normal;line-height:1.25}
body[data-tsui-theme="reference"] .city-live-dot{width:14px;height:14px;background:#76c850;border:1px solid #43863a;box-shadow:inset 0 1px 2px #ffffff9c,0 0 4px #26402b40}
body[data-tsui-theme="reference"][data-ref-health="paused"] .city-live-dot{background:#d8b361;border-color:#a88844}
body[data-tsui-theme="reference"][data-ref-health="error"] .city-live-dot{background:#d85d36;border-color:#a03c28}
body[data-tsui-theme="reference"] #city-hud .city-primary{
 width:65px!important;height:66px!important;min-height:0!important;padding:12px!important;border-radius:12px!important;
 border:1px solid #b75831!important;background:linear-gradient(#e27849,#c85a32)!important;box-shadow:0 0 0 3px #fff4dd,0 0 0 4px #d6b783;
 display:grid;place-items:center;color:#fff9ea;flex:none
}
body[data-tsui-theme="reference"] #city-pause .ref-icon{filter:brightness(0) invert(1);width:30px;height:30px}
body[data-tsui-theme="reference"] .city-play-controls{gap:13px}
body[data-tsui-theme="reference"] .city-time{padding:0!important;gap:6px!important;border:0!important;background:none!important}
body[data-tsui-theme="reference"] .city-time button{
 min-width:48px;min-height:47px;font-size:19px!important;font-weight:850;padding:6px!important;
 color:#20391d!important;background:linear-gradient(#f3e2c1,#ebd6ad)!important;border:1px solid #c5a875!important;border-radius:8px!important;
 box-shadow:inset 0 1px 0 #fff8e7
}
body[data-tsui-theme="reference"] .city-time button[aria-pressed="true"]{background:linear-gradient(#71934f,#4e7135)!important;color:#fff9e9!important;border-color:#446630!important}
body[data-tsui-theme="reference"] #city-hud button:focus-visible,
body[data-tsui-theme="reference"] .clock button:focus-visible{outline:3px solid #254d28;outline-offset:3px}
@media(min-width:781px) and (max-width:1110px){
 body[data-tsui-theme="reference"] #city-hud #city-play{left:50%!important;bottom:119px!important;transform:translateX(-50%)!important}
 body[data-tsui-theme="reference"] #city-hud #city-quick{right:auto!important;left:50%!important;transform:translateX(-50%)!important;width:660px!important}
}
@media(max-width:780px){
 body[data-tsui-theme="reference"] .identity,body[data-tsui-theme="reference"] .clock{top:max(10px,env(safe-area-inset-top,0px));height:49px!important;border-radius:11px!important}
 body[data-tsui-theme="reference"] .identity{left:8px;padding:6px 9px;gap:7px}
 body[data-tsui-theme="reference"] .brand-icon{width:34px;height:32px;padding-right:5px}
 body[data-tsui-theme="reference"] .brand-icon .ref-icon{width:29px;height:29px}
 body[data-tsui-theme="reference"] .identity strong{font-size:20px;letter-spacing:-.5px}
 body[data-tsui-theme="reference"] .identity strong span{letter-spacing:-.5px}
 body[data-tsui-theme="reference"] .clock{right:8px;gap:7px;padding:5px!important}
 body[data-tsui-theme="reference"] .clock .ref-sun{display:none}
 body[data-tsui-theme="reference"] .clock>span:first-of-type{font-size:10px;border:0;padding-left:3px;letter-spacing:-.4px}
 body[data-tsui-theme="reference"] .clock #clock{font-size:24px;padding-left:7px;letter-spacing:-.9px}
 body[data-tsui-theme="reference"] #speed-label{font-size:14px;padding:5px 6px;border-radius:6px}
 body[data-tsui-theme="reference"] .ref-settings-button{width:32px;height:33px;padding:5px;border-radius:7px}
 body[data-tsui-theme="reference"] .ref-settings-button .ref-icon{width:22px;height:22px}
 #tsui-switch{top:70px!important;right:8px!important;width:min(350px,calc(100vw - 16px))!important;max-height:calc(100dvh - 88px)}
 body[data-tsui-theme="reference"] #city-hud #city-quick{
 left:8px!important;right:8px!important;top:auto!important;bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
 width:auto!important;height:122px!important;padding:5px!important;transform:none!important
 }
 body[data-tsui-theme="reference"] #city-quick .city-actions{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:0!important}
 body[data-tsui-theme="reference"] #city-quick .city-actions button{padding:3px 1px!important;gap:0!important;border-radius:5px!important}
 body[data-tsui-theme="reference"] #city-quick .city-actions button:nth-child(5){border-left:0!important}
 body[data-tsui-theme="reference"] #city-quick .city-actions button:nth-child(n+5){border-top:1px solid #dac29a!important}
 body[data-tsui-theme="reference"] #city-quick .ref-icon{width:32px;height:32px}
 body[data-tsui-theme="reference"] #city-quick .ref-nav-label{font-size:10px!important}
 body[data-tsui-theme="reference"] #city-hud #city-play{
 left:8px!important;right:8px!important;top:auto!important;bottom:calc(140px + env(safe-area-inset-bottom,0px))!important;
 width:auto!important;height:61px!important;padding:7px 9px!important;transform:none!important;gap:8px!important
 }
 body[data-tsui-theme="reference"] .city-play-status{font-size:11px;gap:6px;max-width:116px}
 body[data-tsui-theme="reference"] .city-live-dot{width:11px;height:11px}
 body[data-tsui-theme="reference"] #city-hud .city-primary{width:46px!important;height:47px!important;padding:8px!important;border-radius:9px!important}
 body[data-tsui-theme="reference"] #city-pause .ref-icon{width:25px;height:25px}
 body[data-tsui-theme="reference"] .city-play-controls{gap:9px}
 body[data-tsui-theme="reference"] .city-time{gap:4px!important}
 body[data-tsui-theme="reference"] .city-time button{min-width:42px;min-height:41px;font-size:17px!important}
 body[data-tsui-theme="reference"].ref-overview-open #city-overview{
  top:71px!important;left:8px!important;right:8px!important;bottom:auto!important;width:auto!important;max-height:calc(100dvh - 300px);padding:12px!important
 }
}
@media(max-width:359px){
 body[data-tsui-theme="reference"] .identity{padding:5px 6px;gap:4px}
 body[data-tsui-theme="reference"] .identity strong{font-size:17px}
 body[data-tsui-theme="reference"] .brand-icon{width:29px;padding-right:4px}
 body[data-tsui-theme="reference"] .brand-icon .ref-icon{width:25px;height:25px}
 body[data-tsui-theme="reference"] .clock{gap:4px}
 body[data-tsui-theme="reference"] .clock #clock{font-size:22px;padding-left:5px}
 body[data-tsui-theme="reference"] .clock>span:first-of-type{font-size:9px}
 body[data-tsui-theme="reference"] .city-play-status{font-size:10px;max-width:85px}
 body[data-tsui-theme="reference"] .city-time button{min-width:38px;font-size:16px!important}
}
@media(max-height:520px) and (min-width:600px){
 body[data-tsui-theme="reference"] #city-hud #city-quick{height:65px!important;bottom:8px!important}
 body[data-tsui-theme="reference"] #city-quick .city-actions{grid-template-columns:repeat(8,minmax(0,1fr))!important}
 body[data-tsui-theme="reference"] #city-quick .city-actions button{border-top:0!important}
 body[data-tsui-theme="reference"] #city-hud #city-play{bottom:85px!important;height:61px!important}
}
@media(prefers-reduced-motion:reduce){.city-actions button{transition:none!important}}

body:not([data-tsui-theme="reference"]) .ref-sun{display:none}

body:not([data-tsui-theme="reference"]) .city-actions .ref-icon{width:24px;height:24px}

/* Override the legacy compact header typography for the supplied reference. */
body[data-tsui-theme="reference"] .identity strong{font:850 28px/1 system-ui,sans-serif!important;letter-spacing:-.5px!important}
body[data-tsui-theme="reference"] .identity .brand-icon{width:59px!important;height:48px!important;border-radius:0!important;box-shadow:none!important}
body[data-tsui-theme="reference"] .clock strong{font-size:34px!important;letter-spacing:-1px!important}
body[data-tsui-theme="reference"] .clock>span:first-of-type{font-size:13px!important;letter-spacing:-.3px!important}
body[data-tsui-theme="reference"] #speed-label{font-size:20px!important;letter-spacing:-.3px!important}
@media(max-width:780px){
 body[data-tsui-theme="reference"] .identity{width:calc(40vw - 12px);padding:6px 8px;gap:6px}
 body[data-tsui-theme="reference"] .identity strong{font-size:17px!important;letter-spacing:-.5px!important}
 body[data-tsui-theme="reference"] .identity .brand-icon{width:32px!important;height:32px!important}
 body[data-tsui-theme="reference"] .clock{width:calc(60vw - 12px);justify-content:space-between;gap:5px}
 body[data-tsui-theme="reference"] .clock strong{font-size:24px!important}
 body[data-tsui-theme="reference"] .clock>span:first-of-type{font-size:10px!important;letter-spacing:-.3px!important}
 body[data-tsui-theme="reference"] #speed-label{font-size:14px!important}
}
@media(max-width:359px){
 body[data-tsui-theme="reference"] .identity{padding:5px 5px;gap:4px}
 body[data-tsui-theme="reference"] .identity strong{font-size:15px!important}
 body[data-tsui-theme="reference"] .identity .brand-icon{width:28px!important;height:28px!important}
 body[data-tsui-theme="reference"] .clock strong{font-size:22px!important}
 body[data-tsui-theme="reference"] .clock>span:first-of-type{font-size:9px!important}
}

@media(max-width:359px){
 body[data-tsui-theme="reference"] .clock{gap:3px!important}
 body[data-tsui-theme="reference"] .clock strong{font-size:21px!important;padding-left:4px!important}
 body[data-tsui-theme="reference"] #speed-label{font-size:13px!important;padding:4px!important}
 body[data-tsui-theme="reference"] .ref-settings-button{flex:0 0 30px;width:30px;height:32px;padding:4px}
}

@media(max-width:780px){body[data-tsui-theme="reference"] .clock{gap:5px!important}}
@media(max-width:359px){
 body[data-tsui-theme="reference"] .clock{display:grid!important;grid-template-columns:38px minmax(0,1fr) 26px 28px;gap:3px!important}
 body[data-tsui-theme="reference"] .clock>span:first-of-type{min-width:0;width:38px;padding-left:0;font-size:9px!important;letter-spacing:-.5px!important}
 body[data-tsui-theme="reference"] .clock strong{min-width:0;width:100%;font-size:20px!important;padding-left:4px!important}
 body[data-tsui-theme="reference"] #speed-label{min-width:0;width:26px;padding:2px!important;letter-spacing:-.5px!important;text-align:center}
 body[data-tsui-theme="reference"] .ref-settings-button{min-width:0;width:28px;height:30px;padding:3px}
 body[data-tsui-theme="reference"] .ref-settings-button .ref-icon{width:20px!important;height:20px!important}
}

@media(max-width:359px){body[data-tsui-theme="reference"] .clock #day{font-size:9px!important;letter-spacing:-.5px!important}}

/* TownSim brand launch — sourced from the supplied TownSim crest illustration. */
body.ts-is-loading { overflow:hidden; }
#ts-loading[hidden] { display:none!important; }
#ts-loading {
  --ts-forest:#174c35; --ts-ink:#173f30; --ts-gold:#e9b779;
  position:fixed; inset:0; z-index:99999;
  isolation:isolate; overflow:hidden;
  display:flex; justify-content:center; align-items:center;
  background:radial-gradient(ellipse 62% 56% at 49% 39%,#fffcf3 2%,#faf6e9 67%,#eddfc4 100%);
  color:var(--ts-ink); font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  text-align:center; opacity:1;
  transition:opacity .52s ease,visibility .52s ease;
}
#ts-loading.is-leaving { opacity:0; visibility:hidden; pointer-events:none; }
#ts-loading::before {
  content:"";position:absolute;inset:0;pointer-events:none;
  background:
    radial-gradient(ellipse 29% 30% at 13% 88%,rgba(105,149,100,.13),transparent 90%),
    radial-gradient(ellipse 31% 25% at 90% 15%,rgba(245,173,91,.13),transparent 90%);
}
#ts-loading::after {
  content:"";position:absolute;inset:auto -8% -36% -8%;height:42%;
  border-radius:50% 50% 0 0;background:rgba(76,119,76,.10);
  filter:blur(30px);pointer-events:none;
}
.ts-loading-panel {
  position:relative;z-index:1;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  width:min(92vw,940px); min-height:420px;
  padding:clamp(12px,4vh,40px) 20px;
}
.ts-loading-art {
  display:block; width:min(760px,86vw);max-height:min(62vh,620px);
  object-fit:contain; margin:0 auto;
  filter:drop-shadow(0 18px 22px rgba(53,90,59,.08));
  animation:ts-art-rise 4.6s ease-in-out infinite;
}
.ts-loading-foot {width:min(430px,83vw);margin:-2.5vh auto 0;position:relative;z-index:2;}
.ts-loading-eyebrow {
  font-size:11px; letter-spacing:.27em;text-transform:uppercase;
  font-weight:800;color:#8a7659;margin:0 0 12px;
}
.ts-loading-caption {font-size:clamp(16px,2vw,20px);font-weight:800;margin:0 0 7px;color:#1a4a36;}
.ts-loading-status {
  color:#826f56;font-size:13px;line-height:1.5;
  min-height:20px;margin:0 0 20px;
}
.ts-loading-track {
  width:100%;height:11px;border-radius:50px;
  padding:2px;background:#eee0bf;
  box-shadow:inset 0 2px 5px rgba(57,76,42,.12),0 1px 0 #fff;
  overflow:hidden;border:1px solid #e3d4b7;
}
.ts-loading-fill {
  display:block; width:7%; height:100%; border-radius:50px;
  background:linear-gradient(90deg,#3a7c54,#1f5b3b 68%,#52956d);
  box-shadow:0 0 10px rgba(75,130,86,.33);
  transition:width .65s cubic-bezier(.2,.8,.2,1);
  position:relative;overflow:hidden;
}
.ts-loading-fill::after {
  content:"";position:absolute;inset:0;width:60%;
  background:linear-gradient(90deg,transparent,rgba(255,247,208,.38),transparent);
  transform:translateX(-115%);animation:ts-loading-shine 1.9s ease-in-out infinite;
}
.ts-loading-complete::after {display:none;}
.ts-loading-subtitle{font-size:12px;color:#8c806c;margin:14px 0 0;line-height:1.45;}
.ts-loading-enter {
  border:1px solid #c9aa75; border-radius:12px; background:#f4dcaa;
  color:#194b37; padding:9px 16px;font:700 13px system-ui;
  cursor:pointer;margin-top:12px;box-shadow:0 4px 0 #dec28d;
}
.ts-loading-enter[hidden]{display:none}
.ts-loading-enter:focus-visible{outline:3px solid #3c8756;outline-offset:3px}
.ts-branded-header {
  min-width:0!important;min-height:0!important;gap:7px!important;
  padding:5px 11px 7px 6px!important;
  display:flex!important;align-items:center!important;
  background:rgba(253,248,234,.95)!important;
  border:1px solid rgba(231,211,174,.75)!important;
  box-shadow:0 8px 25px rgba(25,55,40,.14)!important;
  border-radius:17px!important;
  backdrop-filter:blur(11px);
}
.ts-brand-wordmark {
  width:clamp(125px,16vw,194px);
  max-height:69px;height:auto;
  object-fit:contain;display:block;
}
.ts-brand-tagline {
  font:800 8.5px/1.35 system-ui,-apple-system,sans-serif;
  color:#51785c;letter-spacing:.11em;text-align:left;
  max-width:94px;
}
@keyframes ts-art-rise {0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
@keyframes ts-loading-shine {to{transform:translateX(285%)}}
@media(max-width:720px){
  #ts-loading {padding-bottom:env(safe-area-inset-bottom);}
  .ts-loading-panel{padding:18px 8px;min-height:0;}
  .ts-loading-art {width:min(97vw,520px);max-height:48vh;}
  .ts-loading-foot{margin:0 auto;width:min(330px,82vw);}
  .ts-loading-eyebrow{font-size:10px;margin-bottom:9px;}
  .ts-loading-status{font-size:12px;margin-bottom:13px;}
  .ts-loading-subtitle{font-size:11px;}
  .ts-branded-header{padding:3px 7px!important;border-radius:12px!important;}
  .ts-brand-wordmark{width:clamp(104px,34vw,145px);max-height:52px;}
  .ts-brand-tagline{display:none;}
}
@media(max-height:640px){
  .ts-loading-panel{padding:4px 10px;}
  .ts-loading-art{max-height:49vh;}
  .ts-loading-foot{margin-top:-6px;}
  .ts-loading-subtitle{margin-top:7px}
}
@media(prefers-reduced-motion:reduce){
  .ts-loading-art,.ts-loading-fill::after{animation:none!important;}
  #ts-loading{transition:none!important;}
}

/* Final responsive polish: dissolve the warm photo background into the scene. */
.ts-loading-art{mix-blend-mode:darken;}
@media(max-width:720px){
  .ts-loading-panel{box-sizing:border-box;width:100%;max-width:100%;padding-inline:8px;}
  .ts-loading-art{width:min(91vw,520px);max-width:91vw;}
  .ts-loading-foot{width:min(330px,82vw);}
}


/* TS-UI-04: fully visible wordmark, tear-off day calendar and LCD clock. */
@font-face{
  font-family:"TS-DSEG7";
  src:url("assets/fonts/DSEG7ClassicMini-Regular.woff2") format("woff2");
  font-weight:400;font-style:normal;font-display:swap;
}
.ts-branded-header{overflow:hidden;justify-content:center;}
.ts-brand-wordmark{
  width:min(100%,194px)!important;max-height:52px!important;
  object-fit:contain;object-position:center!important;
}
.clock #speed-label{display:none!important;}
.clock .ts-calendar{
  position:relative;isolation:isolate;
  flex:none;width:68px;height:52px;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  line-height:1;
}
.clock .ts-calendar-next,
.clock .ts-calendar-front{
  position:absolute;display:flex;flex-direction:column;
  align-items:center;justify-content:center;box-sizing:border-box;
  border-radius:6px;border:1px solid #b8a272;
  padding:5px 0 2px!important;
}
.clock .ts-calendar-next{
  top:4px;right:1px;width:51px;height:45px;z-index:0;
  transform:rotate(7deg);transform-origin:bottom center;
  background:linear-gradient(165deg,#dcd2a9,#f1dfb8)!important;
  box-shadow:1px 2px 2px #6b553b30;
  color:#738367!important;
}
.clock .ts-calendar-next b{margin-left:15px;margin-top:9px;font:800 16px/1 system-ui,sans-serif;}
.clock .ts-calendar-front{
  top:1px;left:0;z-index:1;width:54px;height:50px;
  background:linear-gradient(175deg,#fffaf0,#f5e6c8)!important;
  box-shadow:0 2px 3px #49371b25,inset 0 1px 0 #fff;
  color:#20472f!important;
}
.clock .ts-calendar-front::before,
.clock .ts-calendar-front::after{
  content:"";position:absolute;top:-4px;width:5px;height:10px;
  background:#7e936d;border:1px solid #526e4d;border-radius:4px;
}
.clock .ts-calendar-front::before{left:10px}
.clock .ts-calendar-front::after{right:10px}
.clock .ts-calendar-front small{font:850 8px/1 system-ui,sans-serif;letter-spacing:.045em;opacity:.7;margin-bottom:2px;}
.clock .ts-calendar-front #day{font:850 25px/.95 system-ui,sans-serif;letter-spacing:-1px;}
.clock #clock{
  font-family:"TS-DSEG7","DejaVu Sans Mono",monospace!important;
  font-weight:400!important;white-space:nowrap;
  font-variant-numeric:tabular-nums;
  color:#214b3c!important;
  text-shadow:0 1px 0 #fff8df,0 0 3px #6f9f7b30;
}
body[data-tsui-theme="reference"] .clock{
  display:flex!important;align-items:center!important;justify-content:flex-end!important;
  gap:9px!important;padding:6px 8px!important;
}
body[data-tsui-theme="reference"] .clock #clock{
  font-size:31px!important;letter-spacing:-.04em!important;line-height:1.18!important;
  padding-left:11px!important;border-left:1px solid #ccb78d!important;
}
@media(max-width:780px){
  body[data-tsui-theme="reference"] .ts-branded-header{
    box-sizing:border-box!important;justify-content:center!important;
    padding:5px 6px!important;
  }
  body[data-tsui-theme="reference"] .ts-brand-wordmark{
    width:100%!important;max-height:38px!important;
  }
  body[data-tsui-theme="reference"] .clock{
    display:flex!important;grid-template-columns:none!important;
    justify-content:space-between!important;gap:5px!important;
    padding:4px 6px!important;
  }
  body[data-tsui-theme="reference"] .clock .ts-calendar{width:52px;height:41px;flex:0 0 52px;}
  body[data-tsui-theme="reference"] .clock .ts-calendar-next{width:39px;height:35px;right:1px;top:4px;}
  body[data-tsui-theme="reference"] .clock .ts-calendar-next b{font-size:12px;margin:5px 0 0 12px;}
  body[data-tsui-theme="reference"] .clock .ts-calendar-front{width:43px;height:39px;padding:2px 0 0!important;}
  body[data-tsui-theme="reference"] .clock .ts-calendar-front::before,
  body[data-tsui-theme="reference"] .clock .ts-calendar-front::after{top:-3px;width:4px;height:7px;}
  body[data-tsui-theme="reference"] .clock .ts-calendar-front small{font-size:6px!important;margin-bottom:2px;}
  body[data-tsui-theme="reference"] .clock .ts-calendar-front #day{font-size:21px!important;}
  body[data-tsui-theme="reference"] .clock #clock{
    flex:1 1 auto;min-width:0;width:auto!important;font-size:23px!important;
    letter-spacing:-.055em!important;padding-left:5px!important;
  }
  body[data-tsui-theme="reference"] .clock .ref-settings-button{
    flex:0 0 33px!important;min-width:33px!important;width:33px!important;
  }
}
@media(max-width:359px){
  body[data-tsui-theme="reference"] .clock{display:flex!important;gap:3px!important;padding:4px!important;}
  body[data-tsui-theme="reference"] .clock .ts-calendar{width:44px;flex-basis:44px;}
  body[data-tsui-theme="reference"] .clock .ts-calendar-front{width:38px;}
  body[data-tsui-theme="reference"] .clock .ts-calendar-next{width:35px;right:0;}
  body[data-tsui-theme="reference"] .clock #clock{
    flex:1 1 auto!important;font-size:20px!important;padding-left:3px!important;
  }
  body[data-tsui-theme="reference"] .clock .ref-settings-button{
    flex:0 0 28px!important;min-width:28px!important;width:28px!important;
  }
}


/* TS-UI-05: modern watch-style time display for TownSim V5. */
/* Keep the tear-off calendar and all simulation controls unchanged. */
body[data-tsui-theme="reference"] .clock #clock{
  box-sizing:border-box!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  align-self:center!important;
  padding:4px 8px!important;
  margin:0!important;
  min-height:40px!important;
  border:1px solid #386d50!important;
  border-radius:11px!important;
  background:linear-gradient(160deg,#2e6249 0%,#1a4537 70%,#183d33 100%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,234,.18),inset 0 -2px 5px rgba(9,31,23,.16),0 2px 3px rgba(38,51,28,.18)!important;
  color:#fff6d7!important;
  font-family:ui-rounded,"Trebuchet MS","Segoe UI",system-ui,sans-serif!important;
  font-size:clamp(22px,2.5vw,31px)!important;
  font-weight:850!important;
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1;
  line-height:1!important;
  letter-spacing:-1.5px!important;
  text-shadow:0 1px 1px rgba(4,25,20,.45)!important;
  white-space:nowrap!important;
}
@media(max-width:780px){
 body[data-tsui-theme="reference"] .clock #clock{
   font-size:clamp(20px,5.9vw,25px)!important;
   letter-spacing:-1.1px!important;
   min-height:36px!important;
   padding:3px 4px!important;
   border-radius:9px!important;
 }
}
@media(max-width:359px){
 body[data-tsui-theme="reference"] .clock #clock{
   min-height:33px!important;
   font-size:19px!important;
   letter-spacing:-.9px!important;
   padding:3px 2px!important;
   border-radius:8px!important;
 }
}
/* TownSim V5.2 compact mobile map layer — PNG place & activity icons. */
.mobile-venue-pin,.mobile-person-marker{display:none}
@media(max-width:750px){
 #labels{z-index:3}
 #labels .mobile-venue-pin{
   position:absolute;display:block;pointer-events:auto;
   background:transparent;border:0;min-width:40px;min-height:49px;
   padding:2px;margin:0;transform:translate(-50%,-94%);
   z-index:4;cursor:pointer;touch-action:manipulation;
   filter:drop-shadow(0 2px 3px rgba(11,35,27,.36));
 }
 #labels .mobile-venue-pin img{display:block;width:34px;height:46px;object-fit:contain;margin:auto}
 #labels .mobile-venue-pin.is-hidden{display:none!important}
 #labels .mobile-venue-pin:focus-visible{outline:2px solid #fff5bf;border-radius:9px}
 #labels .avatar-label{
   display:block!important;pointer-events:auto;
   border:0!important;border-radius:0!important;background:transparent!important;
   box-shadow:none!important;backdrop-filter:none!important;
   -webkit-backdrop-filter:none!important;
   color:transparent!important;min-width:34px!important;min-height:39px!important;
   padding:0!important;line-height:1!important;
   margin:0!important;transform:translate(-50%,-85%)!important;
   opacity:1!important;z-index:5!important;
   filter:drop-shadow(0 2px 3px rgba(0,0,0,.35));
 }
 #labels .avatar-label.marker-invisible,
 #labels .avatar-label[data-world-hidden="true"]{display:none!important}
 #labels .avatar-label .label-name,#labels .avatar-label small{display:none!important}
 #labels .avatar-label .mobile-person-marker{
   display:block;width:34px;height:39px;position:relative;
 }
 #labels .avatar-label .mobile-person-triangle{
   position:absolute;left:3px;top:2px;width:27px;height:31px;
   background:linear-gradient(160deg,#8ef78b 0%,#30bb5e 45%,#07834c 100%);
   clip-path:polygon(50% 100%,0 0,100% 0);
   filter:drop-shadow(0 1px 1px #0c3f25);
 }
 #labels .avatar-label .mobile-person-activity{
   display:block;position:absolute;top:1px;left:8px;width:18px;height:18px;
   object-fit:contain;border:1px solid #fffdebd9;background:#f7fbec;
   border-radius:50%;padding:1px;
 }
 #labels .avatar-label.selected .mobile-person-triangle{
   background:linear-gradient(160deg,#a7ff95,#1ca05b);
   outline:0;filter:drop-shadow(0 0 3px #f5d980);
 }
 #labels .avatar-label.selected .mobile-person-activity{
   outline:2px solid #ffdc6b;outline-offset:1px;
 }
}
