*{box-sizing:border-box}
/* Keep unavailable construction actions hidden even when button display rules override [hidden]. */
#citySideInfo .building-action-row button[hidden]{display:none!important}
/* V260: stable desktop layout, all panels in a single 3-column grid. */
@media(min-width:1001px){
 body>main{display:grid!important;grid-template-columns:minmax(0,1fr) 242px 190px!important;grid-template-rows:auto auto auto auto auto!important;column-gap:8px!important;row-gap:7px!important;align-items:start!important;width:min(100%,1480px)!important;max-width:1480px!important;min-width:1180px!important;padding:0 12px 20px!important;box-sizing:border-box!important;overflow:visible!important}
 body>.nav{padding:0 450px 0 12px!important}
 body>main>.toolbar{grid-column:1/3!important;grid-row:1!important;margin:0!important}
 body>main>.territory-bar{grid-column:1/3!important;grid-row:2!important;margin:0!important}
 body>main>#worldMapPage{grid-column:1/3!important;grid-row:3!important}
 body>main>#cityLayout{grid-column:1/3!important;grid-row:3!important;grid-template-columns:minmax(0,1fr) 242px!important;gap:8px!important;margin:0!important}
 body>main>#cityLower{grid-column:1/3!important;grid-row:4!important;grid-template-columns:minmax(0,1fr) 242px!important;gap:8px!important;margin:0!important}
 body>main>#accountCityRail{grid-column:3!important;grid-row:1 / span 4!important;position:relative!important;top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;width:190px!important;max-width:190px!important;height:auto!important;min-height:0!important;max-height:none!important;margin:calc(-1 * var(--nav-offset,40px)) 0 0!important;overflow:visible!important;z-index:3!important}
 body>main>#accountCityRail .rail-cities{height:600px;max-height:calc(100vh - 160px);overflow:hidden!important}
 body>main>#accountCityRail #railCityList{overflow-y:auto!important;min-height:0!important}
 #cityLayout>.city,#cityLayout>.outer-city{aspect-ratio:1670/942!important;height:auto!important;max-height:none!important;min-width:0!important}
 #cityLayout>aside:not(.outer-status-panel){height:100%!important;max-height:none!important;min-width:0!important;align-self:stretch!important;overflow-y:auto!important}
 #cityLower>.panel:last-child{height:340px!important;min-height:280px!important;max-height:none!important;overflow:hidden!important}
 #cityLower>.panel:last-child .chat-log{height:225px!important;min-height:130px!important;max-height:none!important;overflow-y:auto!important}
 body.panel-layout-editing #cityLayout>aside:not(.outer-status-panel),body.panel-layout-editing #cityLower>.panel:last-child{height:auto!important;min-height:200px!important}
 body.panel-layout-editing [data-layout-panel]{transform:none!important}
}
/* V259: true shared grid; account/cities no longer an absolute overlay. */
@media(min-width:1001px){
 body>main{display:grid!important;grid-template-columns:minmax(0,1fr) 208px!important;column-gap:8px!important;align-items:start!important;padding-right:12px!important;overflow:visible!important}
 body>main>.toolbar,body>main>.territory-bar,body>main>#worldMapPage,body>main>#cityLayout,body>main>#cityLower{grid-column:1!important;min-width:0!important}
 body>main>.toolbar{grid-row:1!important}body>main>.territory-bar{grid-row:2!important}body>main>#worldMapPage{grid-row:3!important}body>main>#cityLayout{grid-row:4!important}body>main>#cityLower{grid-row:5!important}
 body>main>#accountCityRail{position:relative!important;grid-column:2!important;grid-row:1 / span 5!important;top:auto!important;left:auto!important;right:auto!important;bottom:auto!important;width:208px!important;max-width:none!important;min-height:0!important;height:auto!important;margin-top:calc(-1 * var(--nav-offset,40px))!important;overflow:visible!important;align-self:start!important;z-index:4!important}
 body>main>#accountCityRail .rail-account,body>main>#accountCityRail .rail-cities{position:relative;min-width:0}
}
/* V258 explicit resize grip for all editable panels */
.panel-resize-grip{display:none;position:absolute;right:0;bottom:0;width:25px;height:25px;background:#ad7927;color:#160e04;border:1px solid #f7d48a;border-radius:4px 0 5px 0;text-align:center;line-height:23px;font-size:18px;cursor:nwse-resize;touch-action:none;user-select:none;z-index:1002}
.panel-layout-editing [data-layout-panel]{position:relative!important;overflow:auto!important;min-width:140px!important}
.panel-layout-editing [data-layout-panel]>.panel-resize-grip{display:block!important;position:sticky;float:right;margin-top:-25px;bottom:0;right:0}
/* V257: rail shares the main layout coordinate space; no clipped fixed-height wrapper. */
@media(min-width:1001px){
 body>main>.account-city-rail{top:-46px!important;height:auto!important;min-height:0!important;overflow:visible!important;align-self:start!important}
 body>main>.account-city-rail .rail-account,body>main>.account-city-rail .rail-cities{flex:0 0 auto;overflow:visible!important}
 body.panel-layout-editing>main>.account-city-rail{z-index:120!important}
}
/* V256: inner-city panel layout must not stretch the lower row, especially Wu. */
@media(min-width:1001px){
 #cityLayout{align-items:start!important;grid-auto-rows:auto!important;height:auto!important;min-height:0!important;max-height:none!important}
 #cityLayout>aside:not(#outerStatusPanel){align-self:start!important;max-height:var(--inner-art-height,560px)!important;min-height:0!important;overflow-y:auto!important}
 #cityLower{margin-top:7px!important;clear:both!important}
 .panel-layout-editing #cityLayout>aside:not(#outerStatusPanel){max-height:none!important;overflow:auto!important}
}
.panel-layout-editing [data-layout-panel]{resize:both!important;overflow:auto!important}
#panelLayoutControls{position:fixed;bottom:12px;left:12px;z-index:100000;display:flex;align-items:center;gap:6px;padding:6px 9px;background:#1c150fe8;border:1px solid #b88a38;border-radius:8px;color:#f0cc84;font-size:12px;box-shadow:0 4px 18px #0008}
#panelLayoutControls button{padding:5px 9px;border:1px solid #b88a38;border-radius:5px;background:#342514;color:#ffe0a0;cursor:pointer}
#panelLayoutControls [hidden]{display:none!important}
.panel-drag-handle{display:none;background:#70501d;color:#fff4c6;font-size:12px;line-height:22px;padding:3px 8px;cursor:grab;touch-action:none;user-select:none;border-radius:4px}
.panel-layout-editing [data-layout-panel]{outline:2px dashed #ffcb4a!important;outline-offset:1px;position:relative!important;min-height:90px!important;box-sizing:border-box!important;overflow:auto!important}
.panel-layout-editing .panel-drag-handle{display:block!important;position:sticky;top:0;z-index:1000}
.panel-layout-editing [data-layout-panel="detail"]{min-width:150px!important}
.panel-layout-editing [data-layout-panel="chat"]{min-width:170px!important}body{margin:0;background:#080909;color:#f5d995;font-family:"Microsoft JhengHei",sans-serif}button,select,input{font:inherit}button{cursor:pointer}header{height:62px;background:linear-gradient(#29262a,#090909);border-bottom:2px solid #aa7b2a;display:flex;align-items:center;justify-content:space-between;padding:5px 20px;gap:12px}header strong{font-size:28px;color:#f9c34b;text-shadow:2px 2px #4b180c}header small{font-size:14px;color:#ff5143}header span{color:#f2c36d}.top-res{display:flex;gap:10px;flex-wrap:wrap}.resource{background:#141414;border:1px solid #8b642b;border-radius:20px;padding:7px 12px;color:#f4e7cc}.resource b{color:#ffcd4e}.nav{display:flex;gap:4px;margin:7px 14px}.nav button{background:linear-gradient(#302b25,#0a0a0a);color:#f5d995;border:1px solid #98702e;padding:10px 22px;border-radius:8px;font-weight:bold}.nav button.active{background:linear-gradient(#795318,#25180b)}main{max-width:1700px;margin:auto;padding:0 12px 15px}.toolbar{display:flex;align-items:center;gap:18px;background:linear-gradient(90deg,#58120e,#101921);border:2px solid #ae7924;border-radius:15px 15px 0 0;padding:7px 18px}.toolbar h1{font-size:30px;margin:0;color:#ffe09c}.toolbar p{margin:0;color:#eee}.toolbar #start{margin-left:auto}.toolbar button{background:#231b13;color:#e9ca8c;border:1px solid #aa802d;border-radius:5px;padding:5px 12px}.toolbar button.active{background:#8a6329}.layout{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:6px}.city{aspect-ratio:1670/942;position:relative;background:#314536 center/100% 100% no-repeat;border:3px solid #b68a32;overflow:hidden}.plots{position:absolute;inset:0}.plot{position:absolute;width:9.4%;height:12.5%;transform:translate(-50%,-50%);border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;color:white;text-shadow:0 2px 3px black;display:flex;align-items:center;justify-content:end;flex-direction:column;padding:0 0 3px;font-size:12px}.plot:hover,.plot:focus,.plot.selected{background:transparent!important;outline:0!important;border:0!important}.plot .emoji{font-size:25px}.plot.occupied span:last-child{background:#000b;padding:2px 4px;border-radius:3px}.plot.selected:after{content:'◆';position:absolute;bottom:-8px;color:#ffe47b}aside,.panel{border:2px solid #b58b36;border-radius:14px;background:linear-gradient(145deg,#1d1b16,#080909);padding:14px;color:#e6d4aa}aside h2,.panel h2{margin:0 0 12px;color:#ffce58;border-bottom:1px solid #8a662e;padding-bottom:8px}aside button,aside select{display:block;width:100%;padding:10px;margin:9px 0;border:1px solid #b88d34;background:linear-gradient(#55401b,#1b1a13);color:#ffdf93;border-radius:7px}.wall-panel,.summary{border-top:1px solid #715b36;margin-top:16px;padding-top:10px}.wall-panel h3{margin:0}.lower{display:grid;grid-template-columns:minmax(0,1fr) 350px;gap:6px;margin-top:7px}.catalog-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}.catalog-tabs button{border:1px solid #a67a31;border-radius:5px;background:#281d10;color:#f9d892;padding:8px 13px}.catalog-tabs button.active{background:#8b5e1e}.catalog-grid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:5px;max-height:225px;overflow:auto}.catalog-item{border:1px solid #b38936;background:#211d17;color:#fff0c8;border-radius:5px;padding:8px 3px;display:flex;flex-direction:column;align-items:center;gap:5px}.catalog-item span{font-size:25px}.chat-tabs{display:flex;gap:5px;margin-bottom:8px}.chat-tabs button{background:#322414;border:1px solid #9d752d;color:#efcc7a;padding:6px 14px;border-radius:5px}.chat-tabs button.active{background:#c29836;color:#15110a}.chat-log{height:150px;overflow:auto;color:#ddd;border-bottom:1px solid #80602b;font-size:13px}.chat-log p{margin:7px 0}.chat-input{display:flex;gap:6px;margin-top:9px}.chat-input input{flex:1;min-width:0;background:#222;color:white;border:1px solid #8b713c;border-radius:5px;padding:8px}.chat-input button{background:#d6a229;border:1px solid #ffe085;border-radius:5px;padding:7px 13px;font-weight:bold}.small-note{color:#ac9c7e;font-size:12px}@media(max-width:1000px){.layout,.lower{grid-template-columns:1fr}.catalog-grid{grid-template-columns:repeat(7,1fr)}header{height:auto;flex-wrap:wrap}.nav{overflow-x:auto}.nav button{white-space:nowrap}.plot{font-size:9px}.plot .emoji{font-size:14px}}
/* V5 desktop composition: fill viewport like the supplied reference */
@media(min-width:1100px){header{height:64px;padding:6px 1.2%}header strong{font-size:clamp(24px,2.15vw,37px)}.top-res{gap:clamp(6px,1vw,18px)}.resource{font-size:clamp(12px,1.08vw,18px);padding:8px 15px}.nav{margin:6px 1%;gap:5px}.nav button{flex:1;font-size:clamp(14px,1.2vw,20px);padding:11px 8px}main{max-width:none;width:100%;padding:0 0.7% 12px}.toolbar{height:58px;padding:6px 1.4%}.toolbar h1{font-size:clamp(27px,2.2vw,40px)}.layout,.lower{grid-template-columns:minmax(0,1fr) minmax(330px,25.5%);gap:8px}.city{width:100%}.layout aside{font-size:clamp(13px,1vw,17px);padding:18px}.layout aside h2{font-size:clamp(21px,1.6vw,30px)}.layout aside button,.layout aside select{padding:12px}.lower{margin-top:7px}.lower .panel{min-height:255px}.catalog-grid{grid-template-columns:repeat(10,minmax(0,1fr));max-height:230px}.catalog-item{font-size:clamp(11px,.9vw,15px)}.catalog-item span{font-size:clamp(22px,2.2vw,36px)}.chat-log{height:150px}}
@media(min-width:1550px){.catalog-grid{grid-template-columns:repeat(11,minmax(0,1fr))}.lower .panel{min-height:290px}.chat-log{height:185px}}
.top-res .resource.food-deficit b{color:#ff6f6f!important}.top-res [data-resource="文明度"],.top-res [data-resource="耗糧"]{white-space:nowrap}.building-preview .outer-detail-art{display:block;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;object-position:center}.building-preview:has(.outer-detail-art){overflow:hidden;padding:0;box-sizing:border-box}
.building-preview{height:125px;display:flex;align-items:center;justify-content:center;font-size:85px;background:radial-gradient(ellipse at center,#57411d,#15110c 70%);border:1px solid #795923;border-radius:7px;margin:7px 0}.cost-panel{margin-top:12px;border-top:1px solid #775b28;padding-top:12px;color:#e4c77c}.cost-panel strong{color:#ffcc4b}.cost-panel p{margin:8px 0}.layout aside h3{color:#ffe3a1;margin:8px 0}
/* V6: compact desktop game canvas; avoid full-screen stretching */
@media(min-width:1100px){main{width:min(100% - 28px,1510px);max-width:1510px;margin:0 auto;padding:0 0 12px}.layout,.lower{grid-template-columns:minmax(0,1fr) 340px;gap:7px}.toolbar{height:49px}.toolbar h1{font-size:29px}.nav{max-width:1510px;margin:6px auto}.nav button{font-size:15px;padding:8px 6px}.resource{font-size:13px;padding:6px 10px}header{height:54px}header strong{font-size:27px}.layout aside{padding:12px;font-size:13px}.layout aside h2{font-size:23px}.layout aside button,.layout aside select{padding:8px;margin:7px 0}.building-preview{height:90px;font-size:60px}.lower .panel{min-height:220px}.catalog-grid{grid-template-columns:repeat(10,minmax(0,1fr));max-height:175px}.catalog-item span{font-size:25px}.chat-log{height:120px}}
/* V7 ornamental black-gold shell */
:root{--gold:#f3c85b;--darkgold:#7d4b0a}body{background:radial-gradient(ellipse at top,#292017 0,#090a0b 60%)}header{border-bottom:3px double #c6932d;box-shadow:0 3px 13px #000,0 1px 0 #f7c76e}header strong{font-family:serif;color:#ffdb7a;text-shadow:1px 2px 0 #5e1e09,0 0 8px #bc7b20}.nav button,.catalog-tabs button,.chat-tabs button{border:2px ridge #9c6a1e;box-shadow:inset 0 1px 1px #ffe7a050,0 2px 4px #000;background:linear-gradient(180deg,#4c3317,#14100b 55%,#050505);text-shadow:0 1px 2px #000}.nav button.active,.catalog-tabs button.active,.chat-tabs button.active{background:linear-gradient(180deg,#aa792a,#483011 55%,#120c06);color:#fff2bf}.toolbar,.panel,aside,.city{position:relative;border:3px ridge #bf892d;box-shadow:inset 0 0 0 1px #f5cc6a60,0 0 0 1px #281500,0 4px 12px #0008}.toolbar:before,.toolbar:after,.panel:before,.panel:after,aside:before,aside:after{content:'❧';position:absolute;color:#f3b63e;text-shadow:1px 1px #5b2800,0 0 6px #a76a19;font-size:24px;z-index:2;pointer-events:none}.toolbar:before,.panel:before,aside:before{top:-12px;left:-8px}.toolbar:after,.panel:after,aside:after{bottom:-13px;right:-7px;transform:rotate(180deg)}.toolbar h1,aside h2,.panel h2{font-family:serif;color:#ffe19a;text-shadow:1px 2px #6c220a,0 0 9px #ac6d1e}.panel{border-radius:12px;background:linear-gradient(130deg,#21170b,#0b0b0c 40%,#12100d)}aside{background:linear-gradient(130deg,#23170b,#0b0b0c 45%,#15110b)}.header-actions{display:flex;align-items:center;gap:7px}.round-action{position:relative;display:grid;place-items:center;width:39px;height:39px;border-radius:50%;border:2px ridge #c58a2b;background:radial-gradient(circle at 35% 25%,#5b411d,#080808 70%);color:#ffda75;font-size:21px;box-shadow:inset 0 0 0 2px #19140c,0 1px 5px #000}.round-action:hover{filter:brightness(1.35)}.round-action i{position:absolute;top:-5px;right:-5px;background:#ae1616;color:#fff;border-radius:50%;font:10px sans-serif;padding:2px 5px}.settings-shade{position:fixed;inset:0;z-index:999;background:#000b;display:grid;place-items:center}.settings-shade[hidden]{display:none}.settings-dialog{width:min(420px,90vw);background:linear-gradient(#3d2b13,#0e0d0b);border:4px ridge #d8a63e;border-radius:14px;box-shadow:0 10px 60px #000;padding:20px;color:#f6dfa4}.settings-dialog label{display:block;margin:20px 0}.settings-dialog select{background:#201a10;color:#f9dc8d;padding:6px;border:1px solid #bd8d35}.settings-head{display:flex;justify-content:space-between;align-items:center}.settings-head button{border:1px solid #c18c2c;background:#231709;color:#f7dc99;padding:7px 12px}.settings-dialog p{color:#c2ac7f;font-size:13px}body.compact main{max-width:1300px}body.no-anim *,body.no-anim *:before,body.no-anim *:after{animation:none!important;transition:none!important}@media(max-width:800px){.header-actions{flex-wrap:wrap}.round-action{width:32px;height:32px;font-size:17px}}
/* V8: aligned compact header and top navigation */
header{padding:0 12px}.header-inner{width:min(100%,1510px);margin:0 auto;display:grid;grid-template-columns:max-content minmax(0,1fr) max-content;align-items:center;gap:16px}.header-inner strong{white-space:nowrap}.top-res{justify-content:center;align-items:center;gap:7px;flex-wrap:nowrap}.resource{white-space:nowrap}.header-actions{white-space:nowrap}.nav{width:min(calc(100% - 24px),1510px);max-width:1510px;margin:4px auto 6px;justify-content:stretch;gap:4px}.nav button{min-width:0}.nav button:first-child{border-radius:12px 3px 3px 12px}.nav button:last-child{border-radius:3px 12px 12px 3px}@media(min-width:1100px){header{height:61px}.header-inner strong{font-size:clamp(22px,1.75vw,29px)}.resource{font-size:clamp(11px,.85vw,14px);padding:7px 10px}.nav button{font-size:clamp(13px,.95vw,16px);padding:9px 4px}.round-action{width:38px;height:38px}.header-actions{gap:5px}main{width:min(calc(100% - 24px),1510px)}}@media(max-width:1099px){.header-inner{display:flex;flex-wrap:wrap;justify-content:center;padding:8px 0}.top-res{flex-wrap:wrap}.header-actions{margin-left:auto}}
/* Distinct resource capsules and temporary faction preview */
.top-res{gap:clamp(7px,1vw,15px)}.top-res .resource{display:inline-flex;align-items:center;gap:8px;border:2px ridge #a97827;border-radius:25px;background:linear-gradient(#30251a,#090909);color:#f5d995;box-shadow:inset 0 1px #e5ba6655;cursor:pointer}.top-res .resource b{color:#fff;min-width:12px}.top-res .resource em{font-style:normal;font-size:19px;line-height:1;border-radius:50%;color:#ffcf5c;border:1px solid #996a20;padding:0 4px;background:#18110a}.top-res .resource:hover{filter:brightness(1.2)}.test-faction{position:fixed;right:12px;bottom:12px;z-index:30;border:1px solid #a87a2a;background:#15120dec;color:#d7b66c;border-radius:8px;padding:6px 10px;font-size:12px}.test-faction select{background:#292011;color:#f4d389;border:1px solid #916d2d;margin-left:6px;padding:4px;border-radius:4px}@media(max-width:700px){.top-res .resource{gap:3px;padding:5px 6px}.top-res .resource em{font-size:14px}}
/* V10: resource plus symbols without circles */
.top-res .resource em{border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;padding:0 1px!important;font-size:21px;font-weight:900;line-height:1;color:#ffd05b}
/* V12 align header action icons to the same centerline */
.header-actions{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-end;gap:7px;line-height:1}
.header-actions .round-action{box-sizing:border-box;flex:0 0 38px;width:38px!important;height:38px!important;min-width:38px;min-height:38px;padding:0;margin:0;display:flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;font-size:20px;transform:none}
.header-actions .round-action i{line-height:1}
@media(max-width:600px){.header-actions .round-action{flex-basis:34px;width:34px!important;height:34px!important;min-width:34px;min-height:34px}}
.territory-bar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:7px 0 12px;padding:10px 15px;border:1px solid #a87a2b;border-radius:9px;background:linear-gradient(110deg,#21190d,#342513,#1c170f);color:#f2d48a}
.territory-bar[hidden]{display:none}
.territory-bar select,.territory-bar button{padding:7px 12px;background:#17120d;color:#f2d48a;border:1px solid #ac8239;border-radius:6px;cursor:pointer}
.territory-bar .territory-note{font-size:12px;opacity:.8}

/* Outer city is a separate interactive scene; the six illustrated backgrounds will be wired later. */
.outer-city{position:relative;min-width:0;width:100%;aspect-ratio:1670/942;border:2px solid #b58b42;border-radius:8px;overflow:hidden;background:#243c29}
.outer-city[hidden],.city[hidden],.lower[hidden],.wall-panel[hidden]{display:none!important}
.outer-scene{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,#587e44 0%,#456a3d 47%,#234732 85%,#1b3c33 100%);display:grid;grid-template-columns:repeat(6,1fr);grid-template-rows:repeat(3,1fr);gap:1.2%;padding:6% 3% 4%;align-items:center;justify-items:center}
.outer-scene:before{content:'';position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(115deg,transparent 0 60px,#e5c58412 61px 63px,transparent 64px 130px)}
.outer-land-title{position:absolute;top:2%;left:3%;font-weight:bold;color:#f8e1a5;background:#1a1b14c9;border:1px solid #bd9445;border-radius:6px;padding:5px 12px;z-index:2}
.outer-center{position:absolute;left:43%;top:40%;font-size:clamp(30px,5vw,85px);filter:drop-shadow(0 4px 5px #15150b);pointer-events:none}
.outer-point{z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;background:#20301c88;border:1px solid #c4a76e88;border-radius:48%;width:85%;height:73%;cursor:pointer;color:#ffdf87;transition:transform .15s,border-color .15s}
.outer-point:hover,.outer-point.chosen{border-color:#ffe08d;background:#293f22bf;transform:scale(1.04)}
.outer-symbol{font-size:clamp(23px,3vw,50px)}.outer-level{background:#17130ddc;border:1px solid #c69a44;border-radius:5px;padding:1px 7px;font-size:clamp(10px,1.1vw,16px);font-weight:700}
.outer-help{position:absolute;bottom:1%;left:2%;color:#f0e1c0;background:#141b15cc;padding:4px 8px;font-size:11px;border-radius:4px}
@media(max-width:750px){.outer-scene{padding-top:12%}.outer-point{height:80%;width:98%}.outer-center{font-size:35px}}

/* V15: real terrain image with transparent clickable overlays, not placeholder grid */
.outer-scene{display:block!important;padding:0!important;background-size:100% 100%!important;background-position:center!important;background-repeat:no-repeat!important}
.outer-scene:before,.outer-center,.outer-land-title,.outer-symbol{display:none!important}
.outer-scene .outer-point{position:absolute!important;transform:translate(-50%,-50%);width:8%;height:13%;min-width:0;background:transparent!important;border:1px solid transparent!important;border-radius:12px;display:flex;align-items:flex-end;justify-content:center;padding:0 0 3px;opacity:.85}
.outer-scene .outer-point:hover,.outer-scene .outer-point.chosen{background:#f3d58022!important;border:1px solid #e7bd62!important;transform:translate(-50%,-50%)}
.outer-scene .outer-level{font-size:clamp(10px,.8vw,13px);background:#16130cdb;border:1px solid #c8a04f;border-radius:4px;color:#ffe09a;padding:1px 5px}
.outer-help{font-size:11px}
/* Consistent native dropdown contrast across the entire game */
select,select:focus,select:hover{color:#ffe7a6!important;background-color:#23180c!important;border:1px solid #c39339!important;color-scheme:dark}
select option,select optgroup{background:#20170e!important;color:#ffe7a6!important;font-size:15px}
select option:checked{background:#76511e!important;color:#fff1c9!important}
.settings-footer{display:flex;justify-content:flex-end;padding-top:18px}
.settings-footer button{border:1px solid #b77f32;border-radius:7px;background:linear-gradient(#49301a,#21140c);color:#ffe2aa;padding:10px 22px;cursor:pointer;font-size:14px}
.settings-footer button:hover{filter:brightness(1.2)}
/* V21 compact music selector and adjacent pause control */
.settings-dialog label.music-setting{display:flex;align-items:center;gap:10px;justify-content:space-between}
.settings-dialog .music-inline{display:flex;align-items:center;gap:7px;min-width:0}
.settings-dialog .music-inline #musicMode{width:116px;max-width:none;height:36px;margin:0}
.settings-dialog .music-inline #musicPlay{display:inline-flex;align-items:center;justify-content:center;width:88px;max-width:none;min-height:36px;height:36px;margin:0;padding:5px 7px;white-space:nowrap;font-size:12px;letter-spacing:0}
@media(max-width:440px){.settings-dialog .music-inline #musicMode{width:95px}.settings-dialog .music-inline #musicPlay{width:76px;font-size:11px}}
/* V18 polished music settings controls */
.settings-dialog #musicPlay{display:block;width:100%;padding:11px 16px;margin:12px 0 18px;border:1px solid #d8a844;border-radius:8px;background:linear-gradient(180deg,#765321 0%,#36230f 48%,#171008 100%);color:#ffe5a3;font-size:15px;font-weight:700;letter-spacing:1px;text-shadow:0 1px 2px #000;box-shadow:inset 0 1px 0 #ffdf8b88,0 3px 8px #0007;cursor:pointer;transition:filter .15s}
.settings-dialog #musicPlay:hover{filter:brightness(1.2)}
.settings-dialog #musicPlay:focus-visible{outline:2px solid #ffe09a;outline-offset:2px}
.settings-dialog #musicVolume{width:min(220px,100%);accent-color:#d9a43a;vertical-align:middle;cursor:pointer}
.settings-dialog #musicMode,.settings-dialog #scaleSelect{border-radius:5px;background:linear-gradient(#3d2b13,#16100a);border:1px solid #bc8d37;color:#ffe1a0;padding:7px 9px}
.settings-dialog input[type="checkbox"]{accent-color:#d5a23b}
.settings-dialog{box-sizing:border-box;width:min(470px,calc(100vw - 28px));padding:22px 24px;border-width:2px}
.settings-dialog label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:15px 0;border-bottom:1px solid #ad843333;font-size:14px}
.settings-dialog label:first-of-type{justify-content:flex-start}
.settings-dialog label select{width:145px;max-width:45%;height:38px;box-sizing:border-box}
.settings-dialog #musicPlay{width:170px;max-width:100%;margin:13px 0 13px auto;min-height:38px;padding:8px 10px;font-size:13px}
.settings-dialog #musicVolume{width:170px;max-width:52%}
.settings-head{padding-bottom:13px;border-bottom:1px solid #ad843355}
.settings-head h2{font-size:21px;margin:0}
.settings-dialog p{margin:16px 0 0;font-size:11px}
/* V22 final compact settings overrides */
.settings-dialog{width:min(440px,calc(100vw - 24px));padding:16px 20px}
.settings-head{padding-bottom:9px}
.settings-head h2{font-size:19px}
.settings-dialog label,.settings-dialog label:first-of-type{min-height:46px;padding:8px 0;margin:0;gap:10px}
.settings-dialog label.music-setting{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px}
.settings-dialog .music-inline{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;gap:6px;flex-shrink:0}
.settings-dialog .music-inline #musicMode{width:108px;max-width:none;height:34px;padding:5px 6px}
.settings-dialog .music-inline #musicPlay{display:inline-flex;width:88px;max-width:none;height:34px;min-height:34px;margin:0;padding:5px 6px;font-size:12px;letter-spacing:0}
.settings-dialog #musicVolume{width:155px;max-width:50%}
.settings-dialog label select{height:34px}
.settings-footer{padding-top:10px}
.settings-footer button{padding:8px 16px}
.settings-dialog p{margin:9px 0 0;font-size:11px}
@media(max-width:390px){.settings-dialog{padding:14px 13px}.settings-dialog .music-inline #musicMode{width:88px}.settings-dialog .music-inline #musicPlay{width:73px;font-size:11px}}
/* V23 narrower settings dialog */
.settings-dialog{width:min(390px,calc(100vw - 20px));padding:15px 17px}
.settings-dialog .music-inline #musicMode{width:104px}
.settings-dialog .music-inline #musicPlay{width:74px;font-size:11px}
.settings-dialog #musicVolume{width:135px}
@media(max-width:410px){.settings-dialog{width:calc(100vw - 18px);padding:13px 12px}.settings-dialog .music-inline #musicMode{width:94px}.settings-dialog .music-inline #musicPlay{width:69px}}
/* V26 center city link and six terrain calibration selector */
.outer-center-link{position:absolute;z-index:4;left:50%;top:47%;transform:translate(-50%,-50%);width:22%;height:33%;border:0;background:transparent;color:transparent;font-size:0;cursor:pointer}
.outer-center-link:hover{outline:2px solid #e2b65b88;outline-offset:-8px;border-radius:35%}
.outer-scene.calibrating .outer-center-link{outline:2px dashed #ffe4a0;border-radius:30%;background:#18100855;color:#fff2c4;font-size:13px;font-weight:700}
#outerCalibrationTerrain{padding:7px 10px;background:#30210d;color:#ffe0a0;border:1px solid #c99b42;border-radius:6px}
/* V25: labels below resource buildings */
.outer-scene:not(.calibrating) .outer-point{background:transparent!important;border-color:transparent!important;overflow:visible!important}
.outer-scene:not(.calibrating) .outer-point:hover,.outer-scene:not(.calibrating) .outer-point.chosen{background:transparent!important;border-color:transparent!important;transform:translate(-50%,-50%)!important}
.outer-scene:not(.calibrating) .outer-level{position:absolute!important;left:50%!important;bottom:-9px!important;transform:translateX(-50%)!important;white-space:nowrap!important;text-align:center!important;pointer-events:none!important}
/* V37 multiplayer chat */
.chat-toolbar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:9px 0}
.chat-toolbar span{flex:1;min-width:100px;font-size:12px;color:#ebd5a5}
.chat-toolbar button,.chat-target button{border:1px solid #b58b48;background:#3c2a17;color:#ffe6b2;border-radius:6px;padding:7px;cursor:pointer}
.chat-target{display:flex;gap:6px;margin:7px 0}.chat-target[hidden]{display:none}.chat-target input{flex:1;min-width:0;padding:8px;border-radius:6px}
.chat-message{padding:7px 5px;border-bottom:1px solid #b08a4a44;overflow-wrap:anywhere}.chat-message b{color:#f6d48d}.chat-message time{margin-left:8px;font-size:11px;opacity:.65}.chat-message p{margin:4px 0;white-space:pre-wrap}.chat-status{color:#f5b6a7;font-size:12px;min-height:1em}
/* V42: keep chat typing and IME anchored inside the input */
#chattext,#chatTo{position:relative!important;display:block!important;text-align:left!important;direction:ltr!important;writing-mode:horizontal-tb!important;transform:none!important;letter-spacing:normal!important;line-height:1.5!important;min-height:38px;caret-color:#ffe1a1;z-index:2}
.chat-input{position:relative;align-items:center;isolation:isolate}
/* V46 restore original two-column chat layout */
.lower>.panel:last-child{position:relative!important;right:auto!important;bottom:auto!important;width:auto!important;z-index:auto!important;box-shadow:none!important}
.lower .chat-log{height:150px!important;min-height:0!important;max-height:none!important}
.lower{align-items:stretch!important}
.lower>.panel:first-child{align-self:stretch!important;min-height:220px!important}
.layout aside{padding:8px!important;font-size:12px!important}
.layout aside h2{font-size:19px!important;margin:5px 0!important}
.layout aside button,.layout aside select{padding:6px!important;margin:4px 0!important}
/* V45 floating compact chat */
.lower>.panel:last-child{position:fixed!important;right:12px;bottom:12px;width:340px;z-index:80;box-shadow:0 8px 30px #000a}
.lower .chat-log{height:180px!important;min-height:100px!important;max-height:65vh!important}
.chat-resize-handle{cursor:ns-resize;touch-action:none;text-align:center;color:#d7aa56;font-size:12px;padding:5px}
@media(max-width:700px){.lower>.panel:last-child{right:5px;bottom:5px;width:min(340px,96vw)}}
/* V44: do not stretch building catalog to match tall chat panel */
.lower{align-items:start!important}
.lower>.panel:first-child{align-self:start!important;min-height:0!important;height:auto!important}
.lower>.panel:first-child .catalog-grid{max-height:none!important;overflow:visible!important}
.lower>.panel:last-child{align-self:start!important}
/* V43: taller readable chat history on all screen sizes */
.lower .chat-log{height:clamp(300px,38vh,520px)!important;min-height:300px!important;font-size:14px;line-height:1.55;padding:8px 10px}
@media(max-width:700px){.lower .chat-log{height:42vh!important;min-height:260px!important}}
/* V47 slightly smaller building details and larger chat without changing layout */
.layout{grid-template-columns:minmax(0,1fr) minmax(270px,22%)!important}
.layout aside{padding:6px 9px!important;font-size:11px!important;line-height:1.3!important}
.layout aside h2{font-size:17px!important;margin:3px 0!important}
.layout aside h3{font-size:12px!important;margin:4px 0!important}
.layout aside button,.layout aside select{padding:5px 7px!important;margin:3px 0!important;font-size:11px!important}
/* V46 final original layout override */
.lower>.panel:last-child{position:relative!important;right:auto!important;bottom:auto!important;width:auto!important;z-index:auto!important}
.lower .chat-log{height:150px!important;min-height:0!important;max-height:none!important}
.lower{align-items:stretch!important}
.lower>.panel:first-child{align-self:stretch!important;min-height:220px!important}
/* V54 lift chat into empty space below shorter building details */
@media(min-width:1001px){.lower>.panel:last-child{transform:translateY(-75px)!important;margin-bottom:-75px!important}}
/* V53 wall name and level on one line */
.wall-title-row{display:flex;align-items:center;gap:10px;margin:0 0 6px}
.wall-title-row h3,.wall-title-row p{margin:0!important;line-height:1.5}
/* V52 proportional two-column layout */
.layout,.lower{grid-template-columns:minmax(0,1fr) 290px!important;column-gap:8px!important}
.layout aside{padding:9px 11px!important;font-size:13px!important;line-height:1.45!important}
.layout aside h2{font-size:21px!important;margin-bottom:5px!important;padding-bottom:5px!important}
.layout aside .building-preview{height:64px!important;font-size:46px!important;margin:4px 0!important}
.layout aside .building-action-row{display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important}
.layout aside .building-action-row button{display:block!important;width:100%!important;min-width:0!important;margin:4px 0!important;padding:7px 2px!important}
.layout aside .cost-panel{margin-top:6px!important;padding-top:6px!important}
.layout aside .cost-panel p{margin:3px 0!important}
.layout aside .wall-panel{margin-top:8px!important;padding-top:6px!important}
.lower .chat-log{height:195px!important}
.lower>.panel:first-child{height:max-content!important;min-height:0!important}
@media(max-width:1000px){.layout,.lower{grid-template-columns:1fr!important}}
/* V51: side-by-side building actions */
.layout aside .building-action-row{display:flex;gap:8px;align-items:stretch}
.layout aside .building-action-row button{flex:1;min-width:0;width:auto!important}
/* V50: prevent chat overlapping building details; align lower panels */
.lower>.panel:last-child{transform:none!important;margin-bottom:0!important}
.lower{align-items:start!important;grid-template-columns:minmax(0,1fr) 340px!important}
.lower>.panel:first-child,.lower>.panel:last-child{align-self:start!important;margin-top:0!important}
.layout{grid-template-columns:minmax(0,1fr) 340px!important}
/* V49: restore readable building detail fonts, shorten detail box and lift chat only */
.layout{grid-template-columns:minmax(0,1fr) 340px!important;align-items:start!important}
.layout aside{height:auto!important;min-height:0!important;align-self:start!important;padding:12px!important;font-size:13px!important;line-height:1.5!important}
.layout aside h2{font-size:23px!important;margin:0 0 10px!important}
.layout aside h3{font-size:inherit!important;margin:8px 0!important}
.layout aside button,.layout aside select{font-size:inherit!important;padding:8px!important;margin:7px 0!important}
.lower>.panel:last-child{transform:none!important;margin-bottom:0!important}
@media(max-width:1000px){.lower>.panel:last-child{transform:none!important;margin-bottom:0!important}}
/* V48: keep building catalog independent from chat height */
.lower{align-items:start!important}
.lower>.panel:first-child{align-self:start!important;height:max-content!important;min-height:0!important}
.lower>.panel:last-child{align-self:start!important}
/* V47 chat size tuned */
.lower .chat-log{height:230px!important;min-height:0!important;max-height:none!important}
/* V40: dark-gold slim scrollbars matching the game UI */
html{scrollbar-color:#84632e #15120e;scrollbar-width:thin}
.catalog-grid,.chat-log,aside,.panel,.settings-dialog{scrollbar-color:#86632c #17130f;scrollbar-width:thin}
::-webkit-scrollbar{width:7px;height:7px}
::-webkit-scrollbar-track{background:#17130f;border-radius:10px}
::-webkit-scrollbar-thumb{background:linear-gradient(180deg,#b48a42,#71501e);border-radius:10px;border:1px solid #282015}
::-webkit-scrollbar-thumb:hover{background:#d5a34d}
::-webkit-scrollbar-button{display:none;width:0;height:0}
/* V36: inner city coordinates permanently fixed for all players */
#innerCalibrateButton,#innerExportButton{display:none!important}
/* V33: three distinct special hitboxes; smaller staircase */
.inner-special-stairs{width:8%!important;height:5%!important}
.inner-special-gate{width:11%!important;height:10%!important}
.inner-special-wall{width:12%!important;height:10%!important}
/* V32 inner gate and stairs */
.inner-special{position:absolute;transform:translate(-50%,-50%);width:14%;height:11%;z-index:8;background:transparent;border:0;color:transparent;font-size:0;cursor:pointer}
.city.calibrating-inner .inner-special{background:#173a4a77;border:2px dashed #b0e8ff;color:white;font-size:12px;touch-action:none}
/* V31: inner-city 21 plot calibration */
.city.calibrating-inner .plot{border:1px dashed #ffe29c!important;background:#24170755!important;touch-action:none;cursor:grab;z-index:8}
.city.calibrating-inner .plot:before{content:attr(data-plot);position:absolute;top:0;left:50%;transform:translateX(-50%);background:#241707;color:#fff0bd;padding:2px 6px;border-radius:5px;font-weight:bold}
#innerCalibrateButton,#innerExportButton{padding:7px 10px;background:#342410;color:#ffe3a2;border:1px solid #bd9045;border-radius:6px;cursor:pointer}
/* V30: fixed coordinates for all players; calibration tools retired */
#calibrateOuter,#outerCalibrationTerrain,#exportOuterPositions{display:none!important}
/* V28: resource type visible during calibration only */
.outer-resource-name{display:none}
.outer-scene.calibrating .outer-resource-name{display:block;position:absolute;left:50%;top:-25px;transform:translateX(-50%);white-space:nowrap;font-size:12px;font-weight:700;color:#ffe8b1;background:#211509ed;border:1px solid #e1b45b;border-radius:5px;padding:2px 5px;pointer-events:none;z-index:8;text-shadow:0 1px 2px #000}
/* V27: calibration and normal mode share the same centered label anchor */
.outer-scene .outer-point,.outer-scene.calibrating .outer-point{box-sizing:border-box!important;transform:translate(-50%,-50%)!important;display:block!important;padding:0!important;overflow:visible!important}
.outer-scene .outer-level,.outer-scene.calibrating .outer-level{position:absolute!important;left:50%!important;top:auto!important;bottom:-9px!important;transform:translateX(-50%)!important;margin:0!important;text-align:center!important;white-space:nowrap!important;pointer-events:none!important}
.outer-scene.calibrating .outer-point{width:8%!important;height:13%!important;border:1px dashed #ffe28b88!important;background:transparent!important}
.outer-scene.calibrating .outer-point:hover{background:#251a0c33!important}
/* V24 calibration of terrain-specific resource hitboxes */
#calibrateOuter{padding:8px 12px;border:1px solid #c49a4d;border-radius:6px;background:linear-gradient(#503b1c,#211608);color:#ffe4a0;cursor:pointer}
.outer-scene.calibrating .outer-point{width:10%!important;height:13%!important;border:2px dashed #ffe28b!important;background:#251a0c99!important;touch-action:none;cursor:grab;z-index:5}
.outer-scene.calibrating .outer-point:active{cursor:grabbing}
.outer-scene.calibrating .outer-level{white-space:nowrap;font-size:clamp(10px,.9vw,14px);pointer-events:none}
/* V58: align logo with the left navigation and blend black JPEG into header */
.header-inner .header-logo-group{display:flex;align-items:center;gap:0;min-width:0}.header-logo-group .game-logo-top-left{width:175px;transform:none!important}.header-logo-group .faction-emblem{margin-left:-30px}.faction-emblem{width:48px;height:48px;object-fit:contain;flex:none}.faction-emblem[hidden]{display:none!important}@media(max-width:750px){.faction-emblem{width:36px;height:36px}.header-logo-group{gap:2px}}.game-logo-top-left{width:220px;height:50px;object-fit:contain;mix-blend-mode:screen;transform:translateX(-24px);background:transparent}
@media(max-width:1099px){.header-inner .game-logo-top-left{transform:none}}
/* V66 definitive consistent level label, regardless of calibration */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level,.outer-scene:not(.calibrating) .outer-point .outer-level{font-size:16px!important;font-weight:700!important;line-height:20px!important;font-family:Arial,sans-serif!important;letter-spacing:0!important;text-align:center!important;position:absolute!important;left:auto!important;right:22px!important;top:auto!important;bottom:0!important;transform:none!important;margin:0!important;padding:1px 5px!important;border:0!important;outline:0!important;box-shadow:none!important;border-radius:3px!important;background:#16130cdb!important;color:#ffe09a!important;opacity:1!important;white-space:nowrap!important}
/* V68: move centered level badge right 24px; identical in both modes */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level,.outer-scene:not(.calibrating) .outer-point .outer-level{width:62px!important;min-width:62px!important;max-width:62px!important;box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;padding:1px 0!important;left:auto!important;right:-12px!important;transform:none!important}
/* V67 last override: fixed 62px badge centered for Lv.1 through Lv.20 */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level,.outer-scene:not(.calibrating) .outer-point .outer-level{box-sizing:border-box!important;width:62px!important;min-width:62px!important;max-width:62px!important;padding:1px 0!important;text-align:center!important;display:flex!important;align-items:center!important;justify-content:center!important;right:12px!important}
.outer-scene.calibrating .outer-point{border:2px dashed #ffe28b!important;background:#251a0c25!important;outline:1px solid #271707!important;outline-offset:0!important}
/* V65: identical resource level text before/during/after position calibration */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level,.outer-scene:not(.calibrating) .outer-point .outer-level{font-size:16px!important;font-weight:700!important;line-height:1.25!important;font-family:inherit!important;letter-spacing:0!important;padding:1px 5px!important;min-width:0!important;width:auto!important;max-width:none!important;border:0!important;box-shadow:none!important;outline:0!important;transform:none!important;right:22px!important;bottom:0!important}
/* V64 final: same geometry before, during and after calibration; no bright level border */
.outer-scene .outer-point,.outer-scene.calibrating .outer-point{width:8%!important;height:13%!important;border:1px solid transparent!important;background:transparent!important;opacity:1!important;transform:translate(-50%,-50%)!important;outline:0!important;box-shadow:none!important}
.outer-scene .outer-point:hover,.outer-scene .outer-point.chosen,.outer-scene.calibrating .outer-point:hover,.outer-scene.calibrating .outer-point.chosen{border-color:transparent!important;background:transparent!important;transform:translate(-50%,-50%)!important;outline:0!important;box-shadow:none!important}
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level{right:22px!important;bottom:0!important;border:0!important;outline:0!important;box-shadow:none!important;background:#16130cdb!important}
/* V64: calibration and normal view share identical hitbox geometry and label styling */
.outer-scene .outer-point,.outer-scene.calibrating .outer-point{width:8%!important;height:13%!important;box-sizing:border-box!important;border:1px solid transparent!important;background:transparent!important;opacity:1!important;transform:translate(-50%,-50%)!important;outline:none!important;box-shadow:none!important}
.outer-scene .outer-point:hover,.outer-scene .outer-point.chosen,.outer-scene.calibrating .outer-point:hover,.outer-scene.calibrating .outer-point.chosen{border-color:transparent!important;background:transparent!important;transform:translate(-50%,-50%)!important;outline:none!important;box-shadow:none!important}
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level{position:absolute!important;left:auto!important;right:22px!important;top:auto!important;bottom:0!important;transform:none!important;border:0!important;outline:0!important;box-shadow:none!important;background:#16130cdb!important;border-radius:3px!important;padding:1px 4px!important;white-space:nowrap!important}
.outer-scene.calibrating .outer-resource-name{display:block!important}
/* V61: place resource-level label at bottom-right of its resource hitbox */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level{position:absolute!important;left:auto!important;right:0!important;top:auto!important;bottom:0!important;transform:none!important;margin:0!important;text-align:right!important;white-space:nowrap!important;pointer-events:none!important}
/* V62 final override */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level{right:8px!important}
/* V60: expose terrain calibration only to allow precise alignment on new art */
#calibrateOuter{display:inline-block!important}
#outerCalibrationTerrain:not([hidden]){display:inline-block!important}
/* V62: nudge resource level labels slightly left */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level{right:8px!important}
/* V61 final precedence: bottom-right alignment in both regular and calibration mode */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level{left:auto!important;right:22px!important;top:auto!important;bottom:0!important;transform:none!important;text-align:right!important}
#exportOuterPositions{display:inline-block!important}
.outer-scene.calibrating .outer-resource-name{display:block!important}
.outer-scene.calibrating .outer-point{touch-action:none!important;cursor:grab!important;z-index:12!important}
/* V58: lift the chat into the unused space below building details, desktop only */
@media(min-width:1001px){.lower>.panel:last-child{transform:translateY(-95px)!important;margin-bottom:-95px!important}}
/* Left-hand game logo */
.header-inner .game-logo-top-left{display:block;width:220px;height:54px;object-fit:contain;flex:0 0 auto}
@media(max-width:600px){.header-inner .game-logo-top-left{width:150px;height:40px}}
.header-actions .game-logo-top-right{display:block;width:clamp(100px,10vw,155px);height:52px;object-fit:contain;flex:0 0 auto;border:0;background:#000}
@media(max-width:1099px){.header-actions .game-logo-top-right{width:125px;height:44px}}
@media(max-width:600px){.header-actions .game-logo-top-right{width:100px;height:36px}}
/* V58 final overrides */
.header-inner .game-logo-top-left{width:220px;height:50px;mix-blend-mode:screen;transform:translateX(-24px);background:transparent}
@media(min-width:1001px){.lower>.panel:last-child{transform:translateY(-95px)!important;margin-bottom:-95px!important}}
@media(max-width:1099px){.header-inner .game-logo-top-left{transform:none}}
/* V67: fixed-width centered level text, and visible calibration hitboxes */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level,.outer-scene:not(.calibrating) .outer-point .outer-level{box-sizing:border-box!important;width:62px!important;min-width:62px!important;max-width:62px!important;padding:1px 0!important;text-align:center!important;display:flex!important;align-items:center!important;justify-content:center!important;right:12px!important}
.outer-scene.calibrating .outer-point{border:2px dashed #ffe28b!important;background:#251a0c25!important;outline:1px solid #271707!important;outline-offset:0!important}
.outer-scene.calibrating .outer-point:hover{border-color:#fff2b1!important;background:#ffe28b18!important}
/* V66 FINAL visual consistency */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level,.outer-scene:not(.calibrating) .outer-point .outer-level{font-size:16px!important;font-weight:700!important;line-height:20px!important;font-family:Arial,sans-serif!important;letter-spacing:0!important;position:absolute!important;left:auto!important;right:22px!important;top:auto!important;bottom:0!important;transform:none!important;margin:0!important;padding:1px 5px!important;border:0!important;outline:0!important;box-shadow:none!important;background:#16130cdb!important;color:#ffe09a!important;opacity:1!important;white-space:nowrap!important}
/* V72 resource label 30px rightward offset */
.outer-scene .outer-point .outer-level{translate:30px 0!important}
/* V76 compact classic chat */
.lower>.panel:last-child{height:auto!important;min-height:0!important;align-self:start!important;padding-bottom:8px!important}
.lower .chat-log{height:205px!important;min-height:0!important;padding:4px 6px!important;font-size:12px!important;line-height:1.3!important}
.lower .chat-message{padding:2px 2px!important;line-height:1.3!important;border-bottom:1px solid #b08a4a22!important}
.lower .chat-message b{font-size:12px!important}
.lower .chat-message time{font-size:10px!important;margin-left:4px!important}
.lower .chat-message p{display:inline!important;margin:0 0 0 5px!important;padding:0!important;line-height:1.3!important;white-space:pre-wrap!important}
.lower .chat-input{margin-top:4px!important;gap:4px!important}
.lower .chat-input input{min-height:30px!important;height:30px!important;padding:4px 7px!important;font-size:12px!important}
.lower .chat-input button{min-height:30px!important;height:30px!important;padding:3px 10px!important;font-size:12px!important}
.lower .chat-tabs{margin-bottom:3px!important}
/* V75 draggable chat, compact messages and lower input */
.lower>.panel:last-child .small-note{display:none!important}
.lower .chat-message{padding:3px 5px!important}
.lower .chat-message p{margin:1px 0 2px!important;line-height:1.3!important}
.lower .chat-message time{margin-left:6px!important}
.lower .chat-input{margin-top:17px!important}
.chat-drag-handle{display:none}
@media(min-width:1001px){.chat-drag-handle{display:block;cursor:ns-resize;touch-action:none;user-select:none;text-align:center;font-size:11px;color:#c7a45a;padding:3px 0 5px}.lower>.panel:last-child{transform:translateY(calc(-75px + var(--chat-user-offset,0px)))!important;margin-bottom:-75px!important}}
/* V73 chat panel alignment */
@media(min-width:1001px){.lower>.panel:last-child{transform:translate(5px,-120px)!important;margin-bottom:-120px!important;box-sizing:border-box!important}}
/* V74: keep level text inside the right edge of the resource hitbox */
.outer-scene .outer-point .outer-level{translate:none!important}
/* V75 final chat position rule */
@media(min-width:1001px){.lower>.panel:last-child{transform:translateY(calc(-75px + var(--chat-user-offset,0px)))!important;margin-bottom:-75px!important}}
/* V76 final chat input spacing override */
.lower .chat-input{margin-top:4px!important}
.lower>.panel:last-child{height:auto!important;min-height:0!important;align-self:start!important}
/* V77: level text only, no background badge or border */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level,.outer-scene:not(.calibrating) .outer-point .outer-level{background:transparent!important;border:0!important;outline:0!important;box-shadow:none!important;text-shadow:0 1px 3px #000,0 0 2px #000!important}
/* V78 chat resizing and transparent level labels */
.chat-history-grip{height:14px;line-height:14px;cursor:ns-resize;touch-action:none;user-select:none;text-align:center;font-size:10px;color:#b78b45;margin:2px 0}
.lower .chat-input{margin-top:13px!important}
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level{background:transparent!important;background-color:transparent!important;border:none!important;outline:none!important;box-shadow:none!important}
/* V79: align chat bottom with building catalog; extend chat upward */
.toolbar h1:empty,.toolbar #intro:empty{display:none!important}
.chat-history-grip{display:none!important}
@media(min-width:1001px){
.lower{position:relative!important;align-items:stretch!important}
.lower>.panel:first-child{align-self:stretch!important}
.lower>.panel:last-child{position:absolute!important;display:flex!important;flex-direction:column!important;box-sizing:border-box!important;top:calc(-70px + var(--chat-user-offset,0px))!important;bottom:calc(0px - var(--chat-user-offset,0px))!important;right:0!important;left:auto!important;width:350px!important;height:auto!important;min-height:0!important;transform:none!important;margin:0!important}
.lower .chat-log{flex:1 1 auto!important;height:auto!important;min-height:120px!important;max-height:none!important;overflow-y:auto!important}
.lower .chat-input{flex:0 0 auto!important;margin-top:8px!important;margin-bottom:0!important}
}
/* V81 desktop chat calibration */
.chat-calibration-controls{display:flex;gap:5px;justify-content:center;flex-wrap:wrap;margin-bottom:3px}
.chat-calibration-controls button{font-size:11px!important;padding:4px 6px!important}
.chat-drag-handle{display:none!important}
.chat-calibration-resize{display:none}
@media(min-width:1001px){
.lower>.panel:last-child.chat-positioned{top:var(--chat-cal-top)!important;right:var(--chat-cal-right)!important;bottom:auto!important;width:var(--chat-cal-width)!important;height:var(--chat-cal-height)!important;min-height:0!important;transform:none!important;margin:0!important}
.lower>.panel:last-child.chat-calibrating{outline:2px dashed #ffcf60!important;outline-offset:2px!important}
.chat-calibrating .chat-drag-handle{display:block!important;cursor:move!important;touch-action:none!important;user-select:none!important;font-size:12px!important;text-align:center!important;padding:5px!important;color:#ffdf86!important}
.chat-calibrating .chat-calibration-resize{display:flex!important;position:absolute;left:0;bottom:0;width:24px;height:24px;align-items:center;justify-content:center;cursor:nesw-resize;touch-action:none;user-select:none;background:#4b310e;color:#ffe39a;border:1px solid #d1a044;border-radius:3px;z-index:3}
}
@media(max-width:1000px){.chat-calibration-controls{display:none!important}}
/* V83 fixed chat geometry, desktop, same in inner and outer views */
.chat-calibration-controls,.chat-drag-handle,.chat-calibration-resize{display:none!important}
@media(min-width:1001px){
.lower{position:relative!important}
.lower>.panel:last-child,.lower>.panel:last-child.chat-positioned,.lower>.panel:last-child.chat-calibrating{position:absolute!important;top:-110px!important;right:-3px!important;bottom:auto!important;left:auto!important;width:340px!important;height:429px!important;min-height:0!important;transform:none!important;margin:0!important;display:flex!important;flex-direction:column!important;box-sizing:border-box!important}
.lower>.panel:last-child .chat-log{flex:1 1 auto!important;min-height:80px!important;height:auto!important;max-height:none!important;overflow-y:auto!important}
.lower>.panel:last-child .chat-input{flex:0 0 auto!important;margin-top:8px!important}
}
/* V84 inner-city rounded image corners and full-size outer resource details */
.city{border-radius:8px!important;overflow:hidden!important}
.layout:has(#outerCity:not([hidden]))>aside{min-height:440px!important;padding:14px!important;font-size:14px!important;line-height:1.55!important;box-sizing:border-box!important}
.layout:has(#outerCity:not([hidden]))>aside h2{font-size:23px!important;margin:0 0 10px!important;padding-bottom:9px!important}
.layout:has(#outerCity:not([hidden]))>aside h3{font-size:15px!important;margin:10px 0!important}
.layout:has(#outerCity:not([hidden]))>aside .building-preview{height:85px!important;font-size:56px!important;margin:9px 0!important}
.layout:has(#outerCity:not([hidden]))>aside button,.layout:has(#outerCity:not([hidden]))>aside select{padding:9px 10px!important;margin:7px 0!important;font-size:13px!important}
/* V85 adjustable outer building details, inner city unchanged */
.detail-cal-controls{display:none}
.layout:has(#outerCity:not([hidden]))>aside{min-height:var(--detail-cal-height,440px)!important;font-size:var(--detail-cal-font,14px)!important}
.layout:has(#outerCity:not([hidden]))>aside .detail-cal-controls{display:block;margin-bottom:10px;border-bottom:1px solid #7c5d2a;padding-bottom:8px}
.detail-cal-controls button{width:auto!important;display:inline-block!important;font-size:12px!important;padding:5px 8px!important;margin:3px!important}
.detail-cal-controls #detailCalTools[hidden]{display:none!important}
.detail-cal-controls #detailCalTools label{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0}
.detail-cal-controls #detailCalTools input{width:58%;accent-color:#d8a638}
.detail-cal-controls #detailCalValues{font-size:12px;color:#f6ce75;margin-right:8px}
.layout:has(#outerCity:not([hidden]))>aside #plotDesc,.layout:has(#outerCity:not([hidden]))>aside #plotTitle,.layout:has(#outerCity:not([hidden]))>aside .cost-panel,.layout:has(#outerCity:not([hidden]))>aside .summary{font-size:var(--detail-cal-font,14px)!important}
/* V86 dynamic right-side status panel: building details / city list */
#statusCityList[hidden],#statusBuildingDetail[hidden]{display:none!important}
#openCityList.active{border-color:#e7b650!important;background:linear-gradient(#63441b,#30210d)!important}
#statusCityList h2{font-size:21px;margin:0 0 12px;border-bottom:1px solid #8b6a32;padding-bottom:10px}
.status-city-note{font-size:12px;color:#c5a975}
#statusCityItems{display:flex;flex-direction:column;gap:6px;max-height:500px;overflow-y:auto}
#statusCityItems .status-city-item{display:block;width:100%;text-align:left;padding:10px 12px;margin:0;font-size:14px;border:1px solid #82632b;border-radius:5px;background:#211a12;color:#f5d792;cursor:pointer}
#statusCityItems .status-city-item.selected{background:#463016;border-color:#e4af45}
/* V87 resizable status panel and fixed building catalog height */
.layout>aside{position:relative!important;height:var(--status-fixed-height,440px)!important;min-height:0!important;max-height:none!important;box-sizing:border-box!important;overflow:hidden!important;padding-bottom:49px!important}
.layout:has(#outerCity:not([hidden]))>aside{height:var(--status-fixed-height,440px)!important;min-height:0!important}
#statusBuildingDetail:not([hidden]),#statusCityList:not([hidden]){height:100%!important;min-height:0!important;overflow-y:auto!important;scrollbar-width:thin}
.status-height-grip{position:absolute;bottom:25px;left:12px;right:12px;height:18px;line-height:18px;text-align:center;cursor:ns-resize;touch-action:none;user-select:none;color:#d8ae5a;font-size:11px;border-top:1px solid #7b5928}
.status-height-controls{position:absolute;bottom:3px;left:12px;right:12px;text-align:center;height:22px}
.status-height-controls button{padding:2px 8px!important;margin:0!important;font-size:10px!important}
.detail-cal-controls{display:none!important}
.lower>.panel:first-child{height:265px!important;min-height:265px!important;max-height:265px!important;box-sizing:border-box!important;overflow:hidden!important}
.lower>.panel:first-child .catalog-grid{max-height:185px!important;overflow-y:auto!important}
@media(max-width:1000px){.layout>aside{height:auto!important;min-height:300px!important;overflow:visible!important}.status-height-grip,.status-height-controls{display:none!important}.lower>.panel:first-child{height:auto!important;max-height:none!important}}
/* V91 targeted corrections: identical inner/outer status frames, stable catalog */
.layout>aside,.layout:has(#outerCity:not([hidden]))>aside{
 width:100%!important;
 height:var(--status-fixed-height,440px)!important;
 min-height:0!important;
 max-height:none!important;
 padding:9px 9px 49px!important;
 font-size:12px!important;
 line-height:1.4!important;
 box-sizing:border-box!important;
 overflow:hidden!important;
}
.layout>aside h2,.layout:has(#outerCity:not([hidden]))>aside h2{font-size:19px!important;margin:5px 0 9px!important;padding-bottom:6px!important}
.layout>aside h3,.layout:has(#outerCity:not([hidden]))>aside h3{font-size:13px!important;margin:6px 0!important}
.layout>aside button,.layout>aside select,.layout:has(#outerCity:not([hidden]))>aside button,.layout:has(#outerCity:not([hidden]))>aside select{font-size:12px!important;padding:6px 8px!important;margin:4px 0!important}
.layout>aside .building-preview,.layout:has(#outerCity:not([hidden]))>aside .building-preview{height:65px!important;font-size:43px!important;margin:7px 0!important}
.layout>aside .detail-cal-controls,.layout:has(#outerCity:not([hidden]))>aside .detail-cal-controls{display:none!important}
#statusCityList:not([hidden]),#statusBuildingDetail:not([hidden]){height:100%!important;overflow-y:auto!important;min-height:0!important}
#statusCityItems .status-city-item,.layout:has(#outerCity:not([hidden])) #statusCityItems .status-city-item{font-size:13px!important;padding:9px 10px!important;margin:0!important}
.lower>.panel:first-child{height:265px!important;min-height:265px!important;max-height:265px!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;box-sizing:border-box!important}
.lower>.panel:first-child .catalog-tabs{flex:0 0 auto!important}
.lower>.panel:first-child .catalog-grid{flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;align-content:start!important;padding-bottom:8px!important}
@media(max-width:1000px){.layout>aside,.layout:has(#outerCity:not([hidden]))>aside{height:auto!important;min-height:300px!important;overflow:visible!important}.lower>.panel:first-child{height:auto!important;max-height:none!important}.lower>.panel:first-child .catalog-grid{max-height:none!important}}
/* V92: finalized status height; borderless city-list rows */
.status-height-grip,.status-height-controls{display:none!important}
.layout>aside,.layout:has(#outerCity:not([hidden]))>aside{padding-bottom:10px!important}
#statusCityItems{gap:0!important;max-height:none!important}
#statusCityItems .status-city-item,.layout:has(#outerCity:not([hidden])) #statusCityItems .status-city-item{
 border:0!important;border-bottom:1px solid rgba(190,143,65,.28)!important;
 border-radius:0!important;background:transparent!important;box-shadow:none!important;
 margin:0!important;padding:10px 7px!important;text-align:left!important;
 width:100%!important;color:#eacb87!important
}
#statusCityItems .status-city-item.selected,.layout:has(#outerCity:not([hidden])) #statusCityItems .status-city-item.selected{
 background:rgba(176,120,32,.12)!important;color:#ffdf93!important;font-weight:700!important
}
#statusCityItems .status-city-item:hover{background:rgba(200,150,50,.12)!important}
/* V93: catalog bottom aligned to fixed chat bottom: chat top -110 + height 429 = 319 */
@media(min-width:1001px){
.lower>.panel:first-child{height:319px!important;min-height:319px!important;max-height:319px!important}
.lower>.panel:first-child .catalog-grid{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important}
}
/* V95 mobile-first repair: isolate mobile from desktop calibration */
@media(max-width:700px){
html,body{width:100%!important;max-width:100%!important;overflow-x:hidden!important}
header{height:auto!important;min-height:0!important;padding:8px!important}
.header-inner{width:100%!important;max-width:100%!important;display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:8px!important}
.header-inner .game-logo-top-left{width:150px!important;height:42px!important;transform:none!important;object-fit:contain!important;flex:0 0 auto!important}
.top-res{order:2!important;width:100%!important;display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:5px!important}
.top-res .resource{font-size:12px!important;padding:5px 8px!important;gap:4px!important}
.header-actions{order:3!important;width:100%!important;justify-content:center!important;margin:0!important;gap:6px!important}
.nav{width:100%!important;max-width:100%!important;display:flex!important;overflow-x:auto!important;gap:5px!important;margin:5px 0!important;padding:0 8px 5px!important;scrollbar-width:thin}
.nav button{flex:0 0 auto!important;min-width:75px!important;font-size:13px!important;padding:9px 12px!important}
main{width:100%!important;max-width:100%!important;padding:0 8px 18px!important;margin:0!important}
.toolbar{height:auto!important;min-height:0!important;display:flex!important;flex-wrap:wrap!important;gap:8px!important;padding:9px!important}
.toolbar h1{font-size:22px!important;white-space:nowrap!important}
.toolbar p{font-size:12px!important;flex:1 1 140px!important}
.toolbar #start{display:flex!important;flex-wrap:wrap!important;gap:5px!important;margin:0!important}
.toolbar button{font-size:13px!important;padding:7px!important}
.territory-bar{width:100%!important;min-height:0!important;display:flex!important;flex-wrap:wrap!important;gap:6px!important;padding:8px!important;margin:6px 0!important}
.territory-bar button{font-size:12px!important}
.territory-note{display:none!important}
.layout,.lower{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;width:100%!important;align-items:start!important}
.layout>.city,.layout>.outer-city{width:100%!important;min-width:0!important;max-width:100%!important;grid-column:1!important;grid-row:1!important}
.layout>aside,.layout:has(#outerCity:not([hidden]))>aside{
 grid-column:1!important;grid-row:2!important;width:100%!important;
 position:relative!important;top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;
 height:auto!important;min-height:0!important;max-height:none!important;
 padding:12px!important;margin:0!important;font-size:13px!important;overflow:visible!important
}
#statusBuildingDetail:not([hidden]),#statusCityList:not([hidden]){height:auto!important;max-height:520px!important;overflow-y:auto!important}
.layout>aside h2{font-size:19px!important}
.layout>aside button,.layout>aside select{font-size:14px!important;min-height:36px!important}
.lower{margin-top:8px!important}
.lower>.panel:first-child{grid-column:1!important;grid-row:1!important;height:auto!important;min-height:190px!important;max-height:none!important;overflow:visible!important;padding:10px!important}
.lower>.panel:first-child .catalog-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;max-height:none!important;overflow:visible!important;gap:5px!important}
.catalog-item{min-width:0!important;font-size:12px!important;padding:8px 2px!important}
.catalog-item span{font-size:23px!important}
.catalog-tabs{gap:4px!important}
.catalog-tabs button{font-size:12px!important;padding:7px!important}
.lower>.panel:last-child,.lower>.panel:last-child.chat-positioned,.lower>.panel:last-child.chat-calibrating{
 grid-column:1!important;grid-row:2!important;position:relative!important;inset:auto!important;
 top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;
 transform:none!important;margin:0!important;width:100%!important;height:350px!important;min-height:0!important;max-height:none!important;
 display:flex!important;flex-direction:column!important;padding:10px!important
}
.lower>.panel:last-child .chat-log{height:auto!important;min-height:0!important;max-height:none!important;flex:1 1 auto!important;overflow-y:auto!important}
.lower>.panel:last-child .chat-input{flex:0 0 auto!important;margin-top:8px!important}
.test-faction{display:none!important}
.settings-dialog{width:min(95vw,500px)!important;max-height:85dvh!important;overflow-y:auto!important}
}
/* V96 responsive resource labels: size relative to scene, not browser viewport */
.outer-scene{container-type:inline-size!important}
.outer-scene .outer-point .outer-level,
.outer-scene.calibrating .outer-point .outer-level,
.outer-scene:not(.calibrating) .outer-point .outer-level{
 box-sizing:border-box!important;
 width:7.2cqw!important;min-width:0!important;max-width:none!important;
 font-size:clamp(8px,1.55cqw,16px)!important;
 line-height:1.15!important;font-weight:700!important;
 height:auto!important;min-height:0!important;
 padding:0!important;letter-spacing:0!important;
 display:flex!important;align-items:center!important;justify-content:center!important;
 position:absolute!important;left:auto!important;right:0!important;top:auto!important;bottom:0!important;
 transform:none!important;text-align:center!important;white-space:nowrap!important;
 border:0!important;outline:0!important;box-shadow:none!important;
 background:rgba(22,19,12,.78)!important;border-radius:2px!important;
 color:#ffe09a!important;text-shadow:0 1px 2px #000!important;
}
@media(max-width:700px){
 .outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level,.outer-scene:not(.calibrating) .outer-point .outer-level{
 font-size:clamp(8px,1.45cqw,12px)!important;
 }
}
/* V97: Original inner-city building artwork, scoped to existing building slots. */
.plot .emoji{display:flex;align-items:center;justify-content:center;width:100%;height:80%;font-size:0;overflow:visible;pointer-events:none}
.building-art{display:block;object-fit:contain;max-width:100%;max-height:100%;width:auto;height:auto;filter:drop-shadow(0 2px 2px #0009)}
.plot .building-art{width:100%;height:100%;max-width:none;max-height:none;object-fit:contain}
.catalog-item .building-art{width:48px;height:43px;max-width:100%;object-fit:contain}
.catalog-item>span{display:flex;align-items:center;justify-content:center;min-height:45px}
#buildingPreview .building-art{width:100%;height:100%;max-height:130px;object-fit:contain;margin:auto}
/* V99: clean image overlays and responsive map hitboxes. Position percentages remain untouched. */
.outer-scene:not(.calibrating) .outer-point .outer-level,
.outer-scene:not(.calibrating) .outer-point .outer-resource-name{display:none!important}
.outer-scene:not(.calibrating) .outer-point,
.outer-scene:not(.calibrating) .outer-point:hover,
.outer-scene:not(.calibrating) .outer-point.chosen{background:transparent!important;border:0!important;box-shadow:none!important;outline:0!important;opacity:1!important;transform:translate(-50%,-50%)!important}
.outer-scene:not(.calibrating) .outer-point:before,
.outer-scene:not(.calibrating) .outer-point:after{display:none!important;content:none!important}
.city{container-type:inline-size!important}
.city .plot{box-sizing:border-box!important;width:9.4%!important;height:12.5%!important;transform:translate(-50%,-50%)!important;padding:0!important;display:flex!important;justify-content:center!important;align-items:center!important;overflow:visible!important}
.city .plot .emoji{width:100%!important;height:100%!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:visible!important}
.city .plot .plot-art{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important}
.city .plot.occupied>span:nth-child(2){display:none!important}
.city .plot.selected:after{display:none!important}
@media(max-width:700px){.city .plot{width:9.4%!important;height:12.5%!important}.outer-scene .outer-point{touch-action:manipulation}}
.catalog-item.chosen-building{outline:2px solid #ffdc72!important;outline-offset:-2px;background:#49331a!important}
.building-pick-hint{font-size:13px;color:#d8bf86;line-height:1.5}
/* V101: Buildings sit inside the original 21 plots with clear margins. */
.city:not(.calibrating-inner) .plot.occupied .emoji{width:82%!important;height:78%!important;flex:0 0 auto!important;align-self:center!important;overflow:visible!important}
.city:not(.calibrating-inner) .plot.occupied .plot-art{width:100%!important;height:100%!important;object-fit:contain!important;object-position:center center!important;filter:drop-shadow(0 1px 1px #0007)!important}
@media(max-width:700px){.city:not(.calibrating-inner) .plot.occupied .emoji{width:78%!important;height:75%!important}}
/* V102 backing layer removed in V103. */
/* V103 building artwork sizing */
.city .plot.occupied::before{display:none!important;content:none!important}
.city .plot.occupied .emoji{width:120%!important;height:125%!important}
@media(max-width:700px){.city .plot.occupied .emoji{width:115%!important;height:120%!important}}
.art-calibration-panel{margin:12px 0;padding:10px;border:1px solid #a77b29;border-radius:8px;background:#19140e;color:#f3dc9b}.art-calibration-panel button{cursor:pointer;padding:7px 12px}.art-calibration-panel p{font-size:12px;line-height:1.5}.art-calibration-panel label{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0}.art-calibration-panel input[type=range]{flex:1;min-width:90px}.art-cal-buttons{display:flex;gap:8px}.city.art-calibrating .plot{touch-action:none!important;cursor:grab!important}.city.art-calibrating .plot.art-cal-active{outline:2px dashed #ffda6e!important;outline-offset:2px!important}.city.art-calibrating .plot .emoji{pointer-events:none!important}
/* V105: castle gate roof foreground cut from the identical background image. */
.city{--inner-city-image:url('/images/wei.png')}
.city:has(~*){}
#gateRoofOverlay{position:absolute;inset:0;z-index:20;pointer-events:none;background-image:var(--inner-city-image);background-size:100% 100%;background-position:center;background-repeat:no-repeat;clip-path:polygon(32% 76%,68% 76%,68% 96%,32% 96%)}
.city .plot .building-level{display:block!important;position:absolute!important;top:-17%!important;left:50%!important;transform:translateX(-50%)!important;z-index:3!important;white-space:nowrap!important;background:#20170bbd!important;color:#ffe2a0!important;border:1px solid #d6a44a!important;border-radius:5px!important;padding:1px 5px!important;font:bold clamp(9px,1.1cqw,15px)/1.3 sans-serif!important;pointer-events:none!important}
.city .plot .building-progress{display:block;position:absolute!important;top:-32%!important;left:0!important;width:100%!important;height:6px!important;border-radius:6px!important;background:#30220c!important;border:1px solid #e2bc60!important;z-index:4!important;overflow:hidden!important;pointer-events:none!important}
.city .plot .building-progress[hidden]{display:none!important}
.city .plot .building-progress>span{display:block;height:100%;width:0;background:linear-gradient(90deg,#4acb63,#f9df5c)}
.layout:has(#city[hidden]) #upgradeBuilding{display:none!important}
@media(max-width:700px){.city .plot .building-level{top:-22%!important;font-size:9px!important}.city .plot .building-progress{top:-38%!important;height:4px!important}}
.city .plot.occupied .building-level{top:auto!important;bottom:-8%!important;left:auto!important;right:-6%!important;transform:none!important;font-size:11px!important}
.city .plot.occupied .building-progress{display:block!important;top:auto!important;bottom:-22%!important;left:5%!important;width:90%!important;height:7px!important}
.city .plot.occupied .building-progress[hidden]{display:none!important}
/* V112: Blue upgrade bar anchored above the building without covering the sign. */
.city .plot.occupied .building-progress{top:-32%!important;bottom:auto!important;left:5%!important;width:90%!important;height:7px!important;background:#10263d!important;border:1px solid #65b8ff!important;box-shadow:0 0 4px #158bff88!important;z-index:9!important}
.city .plot.occupied .building-progress>span{background:linear-gradient(90deg,#1678e8,#42c8ff)!important}
@media(max-width:700px){.city .plot.occupied .building-progress{top:-34%!important;bottom:auto!important;height:5px!important}}
/* V113: bring the blue upgrade progress bar closer to each building roof. */
.city .plot.occupied .building-progress{top:-12%!important;bottom:auto!important}
@media(max-width:700px){.city .plot.occupied .building-progress{top:-14%!important;bottom:auto!important}}
.building-action-notice{margin:10px 0;padding:9px 12px;border-radius:7px;border:1px solid #8d723e;background:#251d12;color:#f5dca5;font-size:13px;line-height:1.5}.building-action-notice.success{border-color:#5d956d;color:#bce6bd}.building-action-notice.warning{border-color:#b48b4a;color:#ffe1a1}
/* V118: compact building actions; no oversized buttons. */
.layout aside .building-action-row{display:flex!important;flex-wrap:wrap!important;gap:6px!important;align-items:center!important}
.layout aside .building-action-row button{flex:0 0 auto!important;width:auto!important;min-width:0!important;max-width:100%!important;margin:2px 0!important;padding:6px 10px!important;line-height:1.3!important;min-height:30px!important;font-size:12px!important}
#wallDetailPanel[hidden]{display:none!important}
/* V120: gate-only wall level and upgrade progress; resource field progress. */
.inner-special-wall .gate-level,.inner-special-wall .gate-progress{display:none!important}
#wallDetailPanel .wall-title-row{display:none!important}
#wallDetailPanel #wallLevel{display:none!important}
.inner-special-gate .gate-level{display:block;position:absolute;right:-9px;bottom:-13px;white-space:nowrap;padding:1px 4px;border-radius:4px;background:#1b160ecf;color:#ffe6a3;font-size:11px;pointer-events:none}
.inner-special-gate .gate-progress{position:absolute!important;left:8%!important;top:auto!important;bottom:8%!important;width:84%!important;height:6px!important;border-radius:5px;border:1px solid #65b8ff;background:#10263d;overflow:hidden;pointer-events:none;z-index:12}.outer-point .outer-progress{position:absolute;left:8%;width:84%;height:6px;top:-11px;border-radius:5px;border:1px solid #65b8ff;background:#10263d;overflow:hidden;pointer-events:none;z-index:12}
.inner-special-gate .gate-progress>span,.outer-point .outer-progress>span{display:block;width:0;height:100%;background:linear-gradient(90deg,#1678e8,#42c8ff)}
.inner-special-gate .gate-progress[hidden],.outer-point .outer-progress[hidden]{display:none!important}
#wallDragProgress{position:absolute;z-index:50;transform:translate(-50%,-50%);width:150px;max-width:22%;padding:3px 5px;background:#111b22e8;border:1px solid #e8b451;border-radius:7px;pointer-events:none;box-shadow:0 2px 8px #0009}
#wallDragProgress:active{cursor:grabbing}
.resource-svg{display:inline-block;vertical-align:middle;flex:none;margin-right:3px}.top-res .resource{white-space:nowrap}.outer-resource-name .resource-svg{width:17px;height:17px}
#saveWallPosition{display:block;margin:5px auto;padding:7px 14px;background:#342410;color:#ffe3a2;border:1px solid #bd9045;border-radius:6px;cursor:pointer}
#wallDragProgress[hidden]{display:none!important}
#wallDragProgress .wall-drag-caption{display:block;font-size:10px;line-height:15px;color:#ffdb86;text-align:center;white-space:nowrap}
#wallDragProgress .wall-drag-track{display:block;height:7px;border-radius:5px;background:#263b50;overflow:hidden;margin-top:3px}
#wallDragProgress .wall-drag-track>span{display:block;height:100%;width:0;background:linear-gradient(90deg,#1678e8,#42c8ff)}
/* V90: reverted V89 global layout and status overrides to restore calibrated layout. */
/* V69 actual final override: move level badge right from right:22px to right:-12px */
.outer-scene .outer-point .outer-level,.outer-scene.calibrating .outer-point .outer-level,.outer-scene:not(.calibrating) .outer-point .outer-level{right:0!important;left:auto!important;width:min(62px,100%)!important;min-width:0!important;max-width:62px!important;box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:center!important;text-align:center!important;padding:1px 0!important}
/* World map screen */
.world-map-page{max-width:980px;margin:8px auto 20px;padding:14px;color:#f5d69a;background:radial-gradient(circle at 40% 35%,#5c1720,#2b0911 72%);border:1px solid #a66c29;border-radius:8px}
.world-map-page[hidden],#cityLayout[hidden],#cityLower[hidden],.toolbar[hidden],#territoryBar[hidden]{display:none!important}
.world-map-page h2{margin:0 0 8px;font-size:22px}
.world-map-stage{position:relative;max-width:700px;margin:auto}
#worldMapSvg{display:block;width:100%;height:auto;min-height:320px}
.world-tile{cursor:pointer;outline:none}.world-tile:hover polygon,.world-tile:focus polygon{stroke:#fff5b1;stroke-width:2}
.world-arrow{position:absolute;border:0;background:transparent;color:#4de132;font-size:35px;font-weight:bold;line-height:1;filter:drop-shadow(1px 2px 1px #111)}
.world-arrow.nw{top:15%;left:3%}.world-arrow.ne{top:15%;right:3%}.world-arrow.sw{bottom:17%;left:3%}.world-arrow.se{bottom:17%;right:3%}
.world-map-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0}.world-map-controls input{width:74px}.world-map-controls input,.world-map-controls select,.world-map-controls button{background:#1d0b0c;color:#ffe3a2;border:1px solid #bb8a37;padding:5px}
.world-map-detail{padding:12px 2px;min-height:80px}.world-map-detail p{margin:7px 0}
/* Independent world-map screen, not nested in the inner/outer city frame */
body.world-map-active main{display:none!important}
body.world-map-active #worldMapPage{display:block!important;box-sizing:border-box;width:100%;max-width:none;min-height:calc(100vh - 125px);margin:0;padding:14px clamp(14px,3vw,50px);border:0;border-radius:0;background-color:#320b13;background-image:repeating-radial-gradient(ellipse at 50% 100%,transparent 0 7px,#692b30 8px,#320b13 10px);background-size:35px 22px}
body.world-map-active .world-map-stage{width:min(100%,850px);max-width:850px;margin:0 auto}
body.world-map-active #worldMapSvg{width:100%;min-height:390px}
body.world-map-active .world-map-controls,body.world-map-active .world-map-detail{max-width:850px;margin-left:auto;margin-right:auto}
body.world-map-active #worldMapTitle{max-width:850px;margin:0 auto 10px}
/* Restore original inner/outer page frame, without the decorative map wallpaper. */
.world-map-page{background:#11100e!important;background-image:none!important;max-width:1180px;margin:8px auto 20px;border:1px solid #8a6529;border-radius:8px}
.world-map-page[hidden]{display:none!important}
/* World map follows the same gold-trimmed header, territory strip and content panel as city views. */
.world-map-page{max-width:none!important;width:100%;margin:0 auto 16px!important;padding:0!important;background:transparent!important;border:0!important;border-radius:0!important}
.world-map-heading{margin:0 0 6px;border:2px solid #b9862d;border-radius:12px 12px 0 0;padding:9px 20px;background:linear-gradient(90deg,#571111,#280809);box-shadow:inset 0 0 0 1px #4e2710;color:#f6cf8b;font-size:23px;font-weight:700}
.world-map-territory{display:flex;align-items:center;gap:18px;min-height:50px;padding:8px 16px;margin:0 0 10px;background:#281c0f;border:1px solid #b98b39;border-radius:9px;color:#e6c182}
.world-map-frame{border:2px solid #ad7d2c;border-radius:10px;background:#0e0e0e;padding:12px 16px 18px;box-shadow:inset 0 0 0 1px #30220f}
.world-map-stage{max-width:850px}
.world-map-detail{border-top:1px solid #6f4b1b;margin-top:10px;padding-top:14px}
.world-map-controls{margin-top:0}
/* Map is the left city-scene panel, sharing the original header, territory strip, right sidebar and lower panels. */
#cityLayout #worldMapPage{display:block;box-sizing:border-box;min-width:0;width:100%;margin:0!important;border:2px solid #b68a32!important;border-radius:7px!important;background:#0e0e0e!important;padding:9px!important}
#cityLayout #worldMapPage[hidden]{display:none!important}
#cityLayout .world-map-heading,#cityLayout .world-map-territory{display:none!important}
#cityLayout .world-map-frame{border:0!important;box-shadow:none!important;padding:0!important;background:transparent!important}
#cityLayout .world-map-stage{max-width:none!important;width:100%;min-height:420px}
#cityLayout #worldMapSvg{width:100%;height:auto;max-height:440px}
#cityLayout .world-map-controls{margin-top:5px}
#cityLayout .world-map-detail{margin-top:8px}
/* Scale the diamond to fill the same left visual panel as the city artwork. */
#cityLayout #worldMapPage .world-map-stage{width:100%;min-height:0!important;max-width:none!important}
#cityLayout #worldMapSvg{display:block;width:100%;height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:1.72/1}
#cityLayout #worldMapPage .world-arrow{font-size:32px}
/* Match world map left panel exactly to the city artwork's 1670:942 dimensions. */
#cityLayout #worldMapPage{aspect-ratio:1670/942!important;position:relative!important;overflow:hidden!important;padding:8px!important;align-self:start!important}
#cityLayout #worldMapPage .world-map-frame{height:100%!important;display:flex;flex-direction:column;min-height:0}
#cityLayout #worldMapPage .world-map-stage{flex:1 1 auto!important;height:0!important;min-height:0!important;width:100%!important;position:relative}
#cityLayout #worldMapSvg{height:100%!important;width:100%!important;max-height:100%!important;aspect-ratio:auto!important;object-fit:contain}
#cityLayout #worldMapPage .world-map-controls{flex:0 0 auto;margin:2px 0!important}
#cityLayout #worldMapPage .world-map-detail{flex:0 0 auto;max-height:52px;overflow:auto;margin:2px 0 0!important;padding:4px 0 0!important;font-size:12px}
#cityLayout #worldMapPage .world-arrow{font-size:26px}
#mapLowerInfo .map-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0 14px}#mapLowerInfo .map-stat-grid>div{border:1px solid #886323;background:#261a0e;border-radius:6px;padding:9px;color:#dfbd7a;text-align:center}#mapLowerInfo .map-stat-grid strong{display:block;font-size:21px;color:#f8d28b}#mapLowerInfo .map-intel-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}#mapLowerInfo .map-intel-tabs button.active{background:linear-gradient(#78521b,#34210c);color:#ffe0a1}#mapLowerDetail button{margin:4px}#mapSideInfo p{line-height:1.5}
#mapLowerInfo .map-intel-tabs button{border:1px solid #a67a31;border-radius:5px;background:#281d10;color:#f9d892;padding:8px 13px;font:inherit;cursor:pointer}#mapLowerInfo .map-intel-tabs button.active{background:#8b5e1e;color:#ffe0a1}#mapLowerInfo .map-intel-tabs button:hover{border-color:#e4b758;background:#4a3215}
/* Land details live exclusively in the right-hand sidebar; retain hidden DOM as data source. */
#cityLayout #worldMapPage #worldMapDetail{display:none!important}
#mapLowerInfo .map-intel-heading{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-bottom:12px}#mapLowerInfo .map-intel-heading h2{margin:0;white-space:nowrap}#mapLowerInfo .map-intel-heading .map-stat-grid{display:flex;align-items:center;flex-wrap:wrap;gap:18px;margin:0}#mapLowerInfo .map-intel-heading .map-stat-grid>div{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;padding:0;border-radius:0;color:#f5cf86;font-size:inherit;white-space:nowrap}#mapLowerInfo .map-intel-heading .map-stat-grid strong{display:inline;font-size:inherit;color:#f5cf86;font-weight:700}
.screen-reader-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.game-ticker{height:42px;display:flex;align-items:center;overflow:hidden;min-width:0;color:#ffe0a1}.game-ticker .ticker-label{position:relative;z-index:2;flex:0 0 auto;padding:0 14px 0 2px;font-size:17px;font-weight:700;white-space:nowrap;color:#ffdc91}.ticker-viewport{overflow:hidden;flex:1;min-width:0;mask-image:linear-gradient(90deg,transparent,#000 2%,#000 98%,transparent)}.ticker-track{display:flex;width:max-content;align-items:center;gap:85px;white-space:nowrap;animation:game-ticker-scroll 80s linear infinite;will-change:transform;font-size:18px;font-weight:700}.ticker-track span{display:inline-block}.game-ticker:hover .ticker-track{animation-play-state:paused}@keyframes game-ticker-scroll{from{transform:translate3d(100vw,0,0)}to{transform:translate3d(-100%,0,0)}}@media(prefers-reduced-motion:reduce){.ticker-track{animation:none;white-space:normal;width:auto}.ticker-viewport{overflow:auto}}
#outerStatusPanel{color:#efd19a;border:1px solid #a67a31;border-radius:8px;background:#120f0c;padding:12px;min-width:0}#outerStatusPanel[hidden]{display:none!important}#outerStatusPanel h2{font-size:19px;margin:0 0 12px}#outerStatusPanel section{border-top:1px solid #694b22;padding:10px 0}#outerStatusPanel h3{font-size:15px;margin:0 0 8px;color:#f4d08b}#outerStatusPanel small{font-size:12px;color:#a99576}#outerStatusPanel .outer-status-row{display:flex;justify-content:space-between;gap:8px;margin:5px 0;font-size:13px}#outerStatusPanel .outer-status-muted{color:#b6a48a;font-size:12px}#outerIndicators{display:flex;flex-wrap:wrap;gap:7px}#outerIndicators .outer-indicator{border:1px solid #665638;border-radius:5px;padding:5px 8px;font-size:12px}#outerIndicators .outer-indicator::before{content:"●";color:#666;margin-right:5px}#outerIndicators .outer-indicator.busy::before{color:#45dc7e;text-shadow:0 0 8px #45dc7e}#outerConstruction .outer-job{padding:6px 0;border-bottom:1px solid #46351c;font-size:12px}#outerConstruction progress{width:100%;height:8px;accent-color:#e2b354}#outerStatusPanel.outer-status-in-catalog{grid-column:auto;grid-row:auto;display:block;width:100%;box-sizing:border-box;border:0;background:transparent;padding:3px 5px}#cityCatalogInfo[hidden]{display:none!important}#outerStatusPanel.outer-status-in-catalog section{padding:9px 0}#outerStatusPanel.outer-status-in-catalog #outerIndicators{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}#outerStatusPanel.outer-status-in-catalog .outer-indicator{min-width:0}/* Right panel remains available in outer city. */@media(max-width:900px){#outerStatusPanel{grid-column:auto;grid-row:auto}}
#territoryBar.territory-collapsed{display:none!important}#productionInfoText[hidden]{display:none!important}
#cityListModal[hidden]{display:none!important}#cityListModal{position:fixed;inset:0;z-index:100000;background:#0009;display:flex;align-items:center;justify-content:center;padding:20px}#cityListModal .city-list-dialog{width:min(540px,94vw);max-height:75vh;overflow:auto;background:#15100b;color:#f5d49a;border:2px solid #bc8c32;border-radius:10px;padding:16px;box-shadow:0 12px 45px #000}#cityListModal header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}#cityListModal button{color:#f3d18c;background:#2c1c0b;border:1px solid #a77929;border-radius:5px;padding:9px;cursor:pointer}#cityListEntries{display:grid;gap:7px}#cityListEntries .city-list-entry{text-align:left;width:100%}#territoryBar.production-mode #territorySelect,#territoryBar.production-mode #terrainLabel,#territoryBar.production-mode #occupyTerrain,#territoryBar.production-mode .territory-note{display:none!important}
#cityLayout{grid-template-columns:minmax(0,1fr) 300px!important;align-items:start}#cityLayout>.outer-status-panel{display:none!important}#cityLayout>aside:not(.outer-status-panel){grid-column:2!important;grid-row:1!important;min-width:0}#cityLayout #outerCity,#cityLayout #city{grid-column:1!important;grid-row:1!important}#cityLayout #statusCityList[hidden],#cityLayout #statusBuildingDetail[hidden]{display:none!important}#cityLayout #statusCityList{min-height:320px}#cityLayout #statusCityItems{display:grid;gap:7px}#cityLayout .status-city-item{display:block;width:100%;text-align:left;padding:10px;background:#2b1d0e;color:#f5d79b;border:1px solid #a77c2b;border-radius:5px}.nav #openCityList{flex:1;min-width:0}.nav #openCityList.active{background:linear-gradient(#795318,#25180b)}
#territoryBar{min-height:52px;display:flex;align-items:center;padding:8px 16px}#territoryBar>:not(#productionPlainText){display:none!important}#productionPlainText{display:block;color:#f4d49b;font-size:16px;font-weight:600;white-space:normal}#cityLayout #outerCity[hidden],#cityLayout #city[hidden]{display:none!important}#cityLayout #outerCity:not([hidden]){display:block!important;position:relative;z-index:2;pointer-events:auto!important}#cityLayout #outerScene{pointer-events:auto!important}#cityLayout #outerScene [data-resource-point]{pointer-events:auto!important;z-index:8!important;cursor:pointer!important}#cityLayout #outerScene .outer-center-link{pointer-events:auto!important;z-index:9!important}
/* Match the original two-column city/catalog layout on all three views. */
#cityLayout,.lower{grid-template-columns:minmax(0,1fr) 300px!important;column-gap:8px!important;width:100%;box-sizing:border-box;align-items:start}
#cityLayout>aside:not(.outer-status-panel){grid-column:2!important;grid-row:1!important;align-self:stretch;min-height:0;box-sizing:border-box}
#cityLayout #outerCity:not([hidden]),#cityLayout #city:not([hidden]){grid-column:1!important;grid-row:1!important;width:100%;min-width:0;box-sizing:border-box}
.lower>.panel:first-child{grid-column:1;min-width:0;box-sizing:border-box}.lower>.panel:last-child{grid-column:2;min-width:0;box-sizing:border-box}
@media(max-width:700px){#cityLayout,.lower{grid-template-columns:minmax(0,1fr)!important}#cityLayout>aside:not(.outer-status-panel),.lower>.panel:last-child{grid-column:1!important;grid-row:auto!important}}
/* V159: chat belongs in the lower right grid cell, never floats over catalog. */
@media(min-width:701px){.lower{position:relative!important;display:grid!important;grid-template-columns:minmax(0,1fr) 300px!important;align-items:start!important}.lower>.panel:last-child,.lower>.panel:last-child.chat-positioned,.lower>.panel:last-child.chat-calibrating{position:relative!important;grid-column:2!important;grid-row:1!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;inset:auto!important;transform:none!important;margin:0!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;box-sizing:border-box!important;z-index:1!important;align-self:start!important}.lower>.panel:first-child{grid-column:1!important;grid-row:1!important;width:100%!important;min-width:0!important}}
/* V160: compact chat, one-row tabs and bounded history. */
@media(min-width:701px){.lower>.panel:last-child,.lower>.panel:last-child.chat-positioned,.lower>.panel:last-child.chat-calibrating{height:330px!important;max-height:330px!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding:10px!important}.lower>.panel:last-child .chat-tabs{display:flex!important;flex-wrap:nowrap!important;gap:4px!important;flex:0 0 auto!important;min-width:0!important}.lower>.panel:last-child .chat-tabs button{flex:1 1 0!important;min-width:0!important;white-space:nowrap!important;word-break:keep-all!important;padding:7px 2px!important;font-size:12px!important;line-height:1.3!important}.lower>.panel:last-child .chat-log{height:auto!important;min-height:0!important;max-height:none!important;flex:1 1 auto!important;overflow-y:auto!important}.lower>.panel:last-child .chat-input{flex:0 0 auto!important;margin-top:6px!important}}
/* V163: chat geometry calibration overrides old fixed sizes */
@media(min-width:701px){
.lower>.panel:last-child.chat-manual-position{position:fixed!important;right:auto!important;bottom:auto!important;max-width:none!important;max-height:none!important;min-width:260px!important;min-height:220px!important;z-index:90!important;box-sizing:border-box!important;}
.lower>.panel:last-child .chat-move-bar{display:block;flex:0 0 auto;cursor:move;touch-action:none;user-select:none;text-align:center;color:#f1c76f;background:#241709;border:1px solid #a5792b;border-radius:4px;padding:5px;margin-bottom:5px;font-size:12px}
.lower>.panel:last-child .chat-size-handle{position:absolute;right:0;bottom:0;width:24px;height:24px;cursor:nwse-resize;touch-action:none;z-index:5;background:linear-gradient(135deg,transparent 55%,#d8a642 56%,#d8a642 61%,transparent 62%,transparent 72%,#d8a642 73%,#d8a642 79%,transparent 80%)}
.lower>.panel:last-child.chat-manual-position .chat-log{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important}
}
/* V161 user-adjustable chat calibration */
@media(min-width:701px){.lower>.panel:last-child.chat-manual-position{position:relative!important;inset:auto!important;transform:none!important;z-index:20!important}.chat-tabs{min-height:32px}.chat-position-save{display:block;margin:4px 0 6px auto;background:#35240f;color:#f5d28b;border:1px solid #b78a35;border-radius:4px;padding:4px 8px;cursor:pointer}}
/* V165 locked desktop chat: calibrated position, no interactive geometry. */
@media(min-width:701px){
.lower>.panel:last-child.chat-fixed-layout{
position:fixed!important;left:1734px!important;top:784px!important;right:auto!important;bottom:auto!important;inset:auto!important;
transform:none!important;width:302px!important;min-width:302px!important;max-width:302px!important;
height:456px!important;min-height:456px!important;max-height:456px!important;
display:flex!important;flex-direction:column!important;overflow:hidden!important;box-sizing:border-box!important;z-index:80!important;
}
.lower>.panel:last-child.chat-fixed-layout .chat-log{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important}
.lower>.panel:last-child.chat-fixed-layout .chat-move-bar,
.lower>.panel:last-child.chat-fixed-layout .chat-size-handle,
.lower>.panel:last-child.chat-fixed-layout .chat-position-save{display:none!important}
}
/* V166: lock chat to the lower-right grid cell, never viewport pixels. */
@media(min-width:701px){
#cityLower{display:grid!important;grid-template-columns:minmax(0,1fr) 300px!important;gap:8px!important;align-items:start!important}
#cityLower>.panel:last-child.chat-fixed-layout{
position:relative!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;inset:auto!important;
grid-column:2!important;grid-row:1!important;transform:none!important;margin:0!important;
width:100%!important;min-width:0!important;max-width:100%!important;height:456px!important;min-height:456px!important;max-height:456px!important;
z-index:1!important;box-sizing:border-box!important;align-self:start!important}
#cityLower>.panel:first-child{grid-column:1!important;grid-row:1!important;min-width:0!important}
}
/* Chat uses the shared responsive grid. */
/* V229: align chat column with the building detail sidebar and keep it below the city artwork */
@media(min-width:1101px){#cityLower{grid-template-columns:minmax(0,1fr) 300px!important}#cityLower>.panel:last-child.chat-fixed-layout{grid-column:2!important;position:relative!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;inset:auto!important;width:100%!important;max-width:100%!important;transform:none!important}#cityLayout{grid-template-columns:minmax(0,1fr) 300px!important}}
/* V228: responsive panels must stay inside their grid cells */
@media(min-width:701px){#cityLower{display:grid!important;grid-template-columns:minmax(0,1fr) 300px!important;align-items:start!important;gap:8px!important;position:relative!important}#cityLower>.panel:last-child.chat-fixed-layout{position:relative!important;inset:auto!important;top:auto!important;right:auto!important;left:auto!important;bottom:auto!important;grid-column:2!important;grid-row:1!important;width:100%!important;min-width:0!important;max-width:100%!important;transform:none!important}#cityLower>.panel:first-child{grid-column:1!important;min-width:0!important}}
@media(min-width:701px) and (max-width:1100px){#cityLayout{grid-template-columns:minmax(0,1fr) 300px!important}#cityLower{grid-template-columns:minmax(0,1fr) 300px!important}#cityLayout>aside{min-width:0!important}#citySideInfo{min-width:0!important}}
@media(max-width:700px){#cityLayout,#cityLower{grid-template-columns:minmax(0,1fr)!important}#cityLower>.panel{min-width:0!important;max-width:100%!important}}
/* V230: common columns for all city views */
@media(min-width:701px){#cityLayout,#cityLower{display:grid!important;grid-template-columns:minmax(0,1fr) 300px!important;gap:8px!important;align-items:start!important}#cityLower>.panel:last-child{grid-column:2!important;grid-row:1!important;position:relative!important;inset:auto!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;transform:none!important;width:100%!important;min-width:0!important;max-width:100%!important}#cityLower>.panel:first-child{grid-column:1!important;grid-row:1!important;min-width:0!important}#cityLayout>aside{min-width:0!important}}
/* V168 outer-city lower dashboard only; no layout changes. */
#outerLowerInfo{padding:4px 8px 12px;color:#e7c98b}
#outerLowerInfo[hidden],#cityCatalogInfo[hidden]{display:none!important}
.outer-lower-heading{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #9e722c;padding:10px 8px 8px;margin:4px 0 8px;font-size:17px;font-weight:bold;color:#f3cf79}
.outer-lower-heading span{font-size:12px;font-weight:normal;color:#c9ac73}
.outer-info-body{padding:4px 8px 15px}
.outer-info-empty{border:1px solid #735323;background:#1d1710;padding:14px;border-radius:6px;color:#e2c58a}
.outer-info-empty span{display:block;margin-top:6px;font-size:12px;color:#a99471}
.outer-build-item{padding:9px 12px;border:1px solid #7c5b28;border-radius:5px;background:#211a10;margin:6px 0}
.outer-build-item>div:first-child{display:flex;justify-content:space-between;gap:12px;font-size:13px}
.outer-build-item span{color:#d5b773}
.outer-build-track{height:7px;background:#4c3921;border-radius:5px;margin-top:8px;overflow:hidden}
.outer-build-track i{display:block;height:100%;background:#d5a347}
/* V169: outer city info clean text, no inner boxes or dividers. */
#outerLowerInfo .outer-lower-heading{border:0!important;border-bottom:0!important;background:none!important;box-shadow:none!important;padding:8px 4px!important}
#outerLowerInfo .outer-info-empty,
#outerLowerInfo .outer-build-item{border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;padding:6px 4px!important}
#outerLowerInfo .outer-build-track{border:0!important}
/* V171: one authoritative view state for the lower content. */
#cityLower[data-active-city-view="outer"] #cityCatalogInfo:not([hidden]){display:flex!important;flex:1 1 auto!important;flex-direction:column!important;min-height:0!important;overflow:hidden!important}#cityLower[data-active-city-view="outer"] #innerInfoTabs{display:flex!important;flex:0 0 auto!important;flex-wrap:nowrap!important;overflow-x:auto!important}#cityLower[data-active-city-view="outer"] #innerInfoDetails:not([hidden]){display:block!important;flex:1 1 0%!important;height:0!important;min-height:0!important;max-height:none!important;overflow-y:scroll!important;overflow-x:hidden!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important}
#cityLower[data-active-city-view="outer"] #outerLowerInfo:not([hidden]){display:block!important}
#cityLower[data-active-city-view="inner"] #outerLowerInfo{display:none!important}
/* V175: outer info has two tabs, no extra boxes or separator lines. */
#outerLowerInfo .outer-info-tabs{display:flex;gap:10px;padding:8px 4px 6px}
#outerLowerInfo .outer-info-tabs button{border:0!important;border-radius:0!important;border-bottom:2px solid transparent!important;background:transparent!important;box-shadow:none!important;color:#bea16b;padding:8px 14px;cursor:pointer;font-size:15px}
#outerLowerInfo .outer-info-tabs button.active{color:#f5d17f;border-bottom-color:#d9a43c!important;font-weight:bold}
#outerLowerInfo section[hidden]{display:none!important}
/* V176: inner city catalog scrolls inside its fixed panel; tabs stay visible. */
@media(min-width:701px){
#cityLower[data-active-city-view="inner"]>.panel:first-child{height:315px!important;min-height:315px!important;max-height:315px!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
#cityLower[data-active-city-view="inner"] #cityCatalogInfo{display:flex!important;flex:1 1 auto!important;flex-direction:column!important;min-height:0!important;overflow:hidden!important}
#cityLower[data-active-city-view="inner"] #cityCatalogInfo .catalog-tabs{flex:0 0 auto!important}
#cityLower[data-active-city-view="inner"] #catalog{display:grid!important;flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:scroll!important;overflow-x:hidden!important;align-content:start!important;scrollbar-width:auto!important;scrollbar-color:#c69a45 #241a0c!important;padding-right:5px!important;padding-bottom:12px!important}
#cityLower[data-active-city-view="inner"] #catalog::-webkit-scrollbar{width:11px}
#cityLower[data-active-city-view="inner"] #catalog::-webkit-scrollbar-track{background:#241a0c}
#cityLower[data-active-city-view="inner"] #catalog::-webkit-scrollbar-thumb{background:#b68b38;border:2px solid #241a0c;border-radius:8px}
}
/* V177: outer-city tab buttons and independently scrollable information. */
@media(min-width:701px){
#cityLower[data-active-city-view="outer"]>.panel:first-child{height:315px!important;min-height:315px!important;max-height:315px!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;box-sizing:border-box!important}
#cityLower[data-active-city-view="outer"] #outerLowerInfo{display:flex!important;flex:1 1 auto!important;flex-direction:column!important;min-height:0!important;overflow:hidden!important}
#outerLowerInfo .outer-info-tabs{display:flex!important;flex:0 0 auto!important;gap:6px!important;padding:4px 6px 9px!important}
#outerLowerInfo .outer-info-tabs button{background:#281d10!important;border:1px solid #a67a31!important;border-radius:5px!important;border-bottom:1px solid #a67a31!important;color:#f9d892!important;padding:8px 15px!important;box-shadow:none!important;font-size:14px!important}
#outerLowerInfo .outer-info-tabs button.active{background:#8b5e1e!important;color:#fff2c6!important;border-color:#e0b45a!important}
#outerLowerInfo #outerInfoUpgrades:not([hidden]),#outerLowerInfo #outerInfoArmy:not([hidden]){display:block!important;flex:1 1 auto!important;min-height:0!important;overflow-y:scroll!important;overflow-x:hidden!important;scrollbar-width:auto!important;scrollbar-color:#c69a45 #241a0c!important;padding-right:8px!important}
#outerLowerInfo #outerInfoUpgrades::-webkit-scrollbar,#outerLowerInfo #outerInfoArmy::-webkit-scrollbar{width:11px}
#outerLowerInfo #outerInfoUpgrades::-webkit-scrollbar-track,#outerLowerInfo #outerInfoArmy::-webkit-scrollbar-track{background:#241a0c}
#outerLowerInfo #outerInfoUpgrades::-webkit-scrollbar-thumb,#outerLowerInfo #outerInfoArmy::-webkit-scrollbar-thumb{background:#b68b38;border:2px solid #241a0c;border-radius:8px}
}
/* V178: visibly distinct scrollbar for outer city info on Chromium. */
@media(min-width:701px){
#cityLower[data-active-city-view="outer"] #outerInfoUpgrades:not([hidden]),
#cityLower[data-active-city-view="outer"] #outerInfoArmy:not([hidden]){
overflow-y:scroll!important;scrollbar-gutter:stable!important;scrollbar-width:auto!important;scrollbar-color:#f5c65c #3a2a12!important;padding-right:12px!important}
#cityLower[data-active-city-view="outer"] #outerInfoUpgrades::-webkit-scrollbar,
#cityLower[data-active-city-view="outer"] #outerInfoArmy::-webkit-scrollbar{width:16px!important;display:block!important}
#cityLower[data-active-city-view="outer"] #outerInfoUpgrades::-webkit-scrollbar-track,
#cityLower[data-active-city-view="outer"] #outerInfoArmy::-webkit-scrollbar-track{background:#3a2a12!important;border:1px solid #b18a3b!important;border-radius:8px!important}
#cityLower[data-active-city-view="outer"] #outerInfoUpgrades::-webkit-scrollbar-thumb,
#cityLower[data-active-city-view="outer"] #outerInfoArmy::-webkit-scrollbar-thumb{background:#f5c65c!important;border:2px solid #3a2a12!important;border-radius:8px!important;min-height:42px!important}
}
/* V179: explicit scroll viewport, independent of flexbox height inheritance. */
@media(min-width:701px){
#cityLower[data-active-city-view="outer"] #outerLowerInfo{height:100%!important;max-height:100%!important;min-height:0!important;box-sizing:border-box!important}
#cityLower[data-active-city-view="outer"] #outerInfoUpgrades:not([hidden]),
#cityLower[data-active-city-view="outer"] #outerInfoArmy:not([hidden]){
height:0!important;flex:1 1 0%!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overscroll-behavior:contain!important;touch-action:pan-y!important}
}
/* V180: consistent lower-panel padding, visible first row and stable scroll viewport. */
@media(min-width:701px){
#cityLower[data-active-city-view="inner"] #catalog{scroll-padding-top:0!important;overscroll-behavior:contain!important}
#cityLower[data-active-city-view="inner"] #cityCatalogInfo{padding-top:0!important}
#cityLower[data-active-city-view="outer"] #outerLowerInfo{height:auto!important;max-height:none!important;flex:1 1 auto!important}
#cityLower[data-active-city-view="outer"] #outerInfoUpgrades:not([hidden]),
#cityLower[data-active-city-view="outer"] #outerInfoArmy:not([hidden]){height:0!important;flex:1 1 0%!important;min-height:0!important;overflow-y:auto!important}
#cityLower[data-active-city-view="outer"] .outer-info-tabs{padding-top:4px!important}
}
/* V194: restore the inner catalog scroll viewport after adding the tab wrapper. */
@media(min-width:701px){
#cityLower[data-active-city-view="inner"] #cityCatalogInfo{display:flex!important;flex-direction:column!important;min-height:0!important;overflow:hidden!important}
#cityLower[data-active-city-view="inner"] #innerBuildingCatalog:not([hidden]){display:flex!important;flex-direction:column!important;flex:1 1 0%!important;min-height:0!important;overflow:hidden!important}
#cityLower[data-active-city-view="inner"] #innerBuildingCatalog #catalog{flex:1 1 0%!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important}
#cityLower[data-active-city-view="inner"] #innerInfoDetails:not([hidden]){flex:1 1 0%!important;min-height:0!important;overflow-y:auto!important}
}
#innerBuildingCatalog[hidden],#innerInfoDetails[hidden]{display:none!important}
/* V181: FIX blank outer tabs: give scroll pane a real height, never height:0. */
@media(min-width:701px){
#cityLower[data-active-city-view="outer"]>.panel:first-child{height:315px!important;min-height:315px!important;max-height:315px!important;overflow:hidden!important;display:block!important}
#cityLower[data-active-city-view="outer"] #outerLowerInfo:not([hidden]){
display:block!important;height:100%!important;max-height:100%!important;min-height:0!important;overflow:hidden!important;box-sizing:border-box!important;padding:4px 8px 8px!important}
#cityLower[data-active-city-view="outer"] #outerLowerInfo .outer-info-tabs{height:48px!important;box-sizing:border-box!important;display:flex!important}
#cityLower[data-active-city-view="outer"] #outerInfoUpgrades:not([hidden]),
#cityLower[data-active-city-view="outer"] #outerInfoArmy:not([hidden]){
display:block!important;position:relative!important;height:calc(100% - 48px)!important;max-height:calc(100% - 48px)!important;min-height:180px!important;
flex:none!important;overflow-y:auto!important;overflow-x:hidden!important;box-sizing:border-box!important;
scrollbar-gutter:stable!important;scrollbar-color:#e0ad46 #30200d!important}
}
/* V182 third tab uses the same scrollable layout as other outer-city pages. */
@media(min-width:701px){
#cityLower[data-active-city-view="outer"] #outerInfoTraining:not([hidden]){
display:block!important;position:relative!important;height:calc(100% - 48px)!important;
max-height:calc(100% - 48px)!important;min-height:180px!important;flex:none!important;
overflow-y:auto!important;overflow-x:hidden!important;box-sizing:border-box!important;
scrollbar-gutter:stable!important;scrollbar-color:#e0ad46 #30200d!important}
#outerInfoTraining[hidden]{display:none!important}
}
/* V183 facility controls in existing building detail panel. */
#militaryFacilityPanel{margin-top:14px;color:#e8cb91;font-size:13px}
#militaryFacilityPanel[hidden]{display:none!important}
#militaryFacilityPanel h3{color:#f0c76a;margin:0 0 8px}
#militaryFacilityPanel p{line-height:1.5;margin:8px 0}
#militaryFacilityPanel .facility-list{display:grid;gap:6px}
#militaryFacilityPanel .facility-line{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:5px 0}
#militaryFacilityPanel .facility-line span{flex:1}
#militaryFacilityPanel input{width:65px;min-width:0;background:#241a10;border:1px solid #9c752f;color:#f4d58d;padding:5px}
#militaryFacilityPanel button{background:#3a2711;border:1px solid #ae8136;color:#f4d58d;border-radius:4px;padding:5px 8px;cursor:pointer}
#militaryFacilityPanel button:disabled{opacity:.45;cursor:default}
/* V184: readable unit statistics in existing training panel. */
#militaryFacilityPanel .facility-line span small{display:block;color:#c7ae7d;font-size:11px;line-height:1.6;font-weight:normal}
#militaryFacilityPanel .facility-line span strong{display:block;color:#f0d18e}
#militaryFacilityPanel .facility-line{align-items:center;border-bottom:0!important}
#militaryFacilityPanel .facility-line input{flex:0 0 62px}
/* V185 compact academy and barracks actions; prevent letter-by-letter wrapping. */
#militaryFacilityPanel{min-width:0!important}
#militaryFacilityPanel .facility-list{gap:3px!important}
#militaryFacilityPanel .facility-line{display:grid!important;grid-template-columns:minmax(0,1fr) 72px!important;gap:7px!important;padding:4px 0!important;align-items:center!important}
#militaryFacilityPanel .facility-line:has(input){grid-template-columns:minmax(0,1fr) 54px 52px!important}
#militaryFacilityPanel .facility-line span{min-width:0!important;overflow-wrap:normal!important;word-break:normal!important;white-space:normal!important}
#militaryFacilityPanel .facility-line span strong{white-space:nowrap!important}
#militaryFacilityPanel .facility-line button{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:72px!important;min-width:0!important;max-width:72px!important;height:27px!important;min-height:27px!important;padding:3px 5px!important;white-space:nowrap!important;font-size:12px!important}
#militaryFacilityPanel .facility-line:has(input) button{width:52px!important;max-width:52px!important}
#militaryFacilityPanel .facility-line input{width:54px!important;box-sizing:border-box!important}
/* V186: barracks stats use full-width rows; controls below, never squeeze Chinese text. */
#citySideInfo #militaryFacilityPanel{display:block!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;overflow-wrap:normal!important}
#citySideInfo #militaryFacilityPanel[hidden]{display:none!important}
#citySideInfo #militaryFacilityPanel .facility-list{display:block!important;width:100%!important}
#citySideInfo #militaryFacilityPanel .facility-line,
#citySideInfo #militaryFacilityPanel .facility-line:has(input){
display:flex!important;flex-wrap:wrap!important;align-items:center!important;
justify-content:flex-start!important;width:100%!important;min-width:0!important;
box-sizing:border-box!important;gap:6px!important;padding:8px 0!important}
#citySideInfo #militaryFacilityPanel .facility-line>span{
display:block!important;flex:0 0 100%!important;width:100%!important;max-width:100%!important;
min-width:0!important;white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important}
#citySideInfo #militaryFacilityPanel .facility-line>span strong{display:block!important;white-space:normal!important;word-break:keep-all!important}
#citySideInfo #militaryFacilityPanel .facility-line>span small{display:block!important;white-space:normal!important;word-break:keep-all!important;line-height:1.65!important}
#citySideInfo #militaryFacilityPanel .facility-line input{flex:0 0 72px!important;width:72px!important;height:28px!important}
#citySideInfo #militaryFacilityPanel .facility-line button,
#citySideInfo #militaryFacilityPanel .facility-line:has(input) button{
display:inline-flex!important;flex:0 0 auto!important;width:auto!important;min-width:64px!important;
max-width:none!important;height:28px!important;min-height:28px!important;padding:3px 12px!important;
margin:0!important;white-space:nowrap!important}
/* V187 maximum affordable troop count action. */
#citySideInfo #militaryFacilityPanel .facility-line button[data-max]{min-width:52px!important;padding:3px 8px!important}
#citySideInfo #militaryFacilityPanel .facility-line:has(input){column-gap:6px!important}
/* V192: keep upgrade requirements readable on separate lines. */
#summary,#citySideInfo #summary{white-space:pre-line!important;line-height:1.75!important;font-size:16px!important;letter-spacing:0!important}
/* V205: queue cancel controls: leading, transparent, borderless. */
#outerLowerInfo .queue-cancel,#mapLowerInfo .queue-cancel,#innerInfoDetails .queue-cancel{appearance:none!important;background:transparent!important;border:0!important;box-shadow:none!important;color:#df6658!important;font-size:18px!important;font-weight:700!important;line-height:1!important;padding:2px 5px!important;margin:0 7px 0 0!important;min-width:0!important;min-height:0!important;width:auto!important;vertical-align:middle!important;cursor:pointer!important}
#outerLowerInfo .queue-cancel:hover,#mapLowerInfo .queue-cancel:hover,#innerInfoDetails .queue-cancel:hover{color:#ff9b85!important;background:transparent!important}
/* V201: compact land details, normal line spacing and no oversized gaps. */
#cityLayout>aside #mapSideInfo{font-size:15px!important;line-height:1.45!important}
#cityLayout>aside #mapSideInfo h2{font-size:21px!important;line-height:1.3!important;margin:2px 0 10px!important}
#cityLayout>aside #mapSideDetail,#cityLayout>aside #mapSideDetail p,#cityLayout>aside #mapLandAction,#cityLayout>aside #mapSideInfo .cost-panel,#cityLayout>aside #mapSideInfo .cost-panel p,#cityLayout>aside #mapSideInfo .cost-panel strong{font-size:15px!important;line-height:1.5!important;letter-spacing:0!important}
#cityLayout>aside #mapSideDetail p,#cityLayout>aside #mapSideInfo .cost-panel p{margin:5px 0!important}
#cityLayout>aside #mapSideInfo .cost-panel{margin-top:10px!important;padding-top:8px!important}
#cityLayout>aside #mapSideInfo button{font-size:14px!important;min-height:32px!important;padding:5px 9px!important}
/* V200: bookmark coordinate buttons match the game's dark-gold theme. */
#mapLowerDetail button{background:linear-gradient(180deg,#443019,#20160d)!important;color:#f5d995!important;border:1px solid #b68a39!important;border-radius:5px!important;padding:7px 12px!important;font:inherit!important;cursor:pointer!important;box-shadow:inset 0 1px 0 #8e6a2b!important}
#mapLowerDetail button:hover{background:linear-gradient(180deg,#6b4a1f,#34210f)!important;border-color:#e5b75b!important}
#mapLowerDetail button:focus-visible{outline:2px solid #f1c66b!important;outline-offset:2px!important}
/* V199: larger readable text throughout land and building detail sidebars. */
#cityLayout>aside #mapSideInfo,#cityLayout>aside #citySideInfo{font-size:18px!important;line-height:1.85!important}
#cityLayout>aside #mapSideInfo h2,#cityLayout>aside #citySideInfo h2{font-size:24px!important;line-height:1.4!important}
#cityLayout>aside #mapSideInfo h3,#cityLayout>aside #citySideInfo h3,#cityLayout>aside #plotTitle{font-size:20px!important;line-height:1.55!important}
#cityLayout>aside #mapSideInfo p,#cityLayout>aside #mapSideDetail,#cityLayout>aside #mapLandAction,#cityLayout>aside #citySideInfo p,#cityLayout>aside #plotDesc,#cityLayout>aside #summary,#cityLayout>aside .cost-panel,#cityLayout>aside .cost-panel strong,#cityLayout>aside .cost-panel p,#cityLayout>aside .building-pick-hint{font-size:18px!important;line-height:1.85!important}
#cityLayout>aside #mapSideInfo button,#cityLayout>aside #citySideInfo button{font-size:16px!important;line-height:1.5!important;min-height:38px!important}
/* V198: hidden state must outrank the inner-city flex layout on map transitions. */
#cityLower #cityCatalogInfo[hidden],#cityLower[data-active-city-view="inner"] #cityCatalogInfo[hidden],#cityLower #mapLowerInfo[hidden],#cityLower #outerLowerInfo[hidden]{display:none!important;height:0!important;min-height:0!important;max-height:0!important;overflow:hidden!important}
#cityLower:has(#mapLowerInfo:not([hidden])) #cityCatalogInfo{display:none!important}
#cityLower:has(#mapLowerInfo:not([hidden])) #outerLowerInfo{display:none!important}
/* V197: improve readability of the right-hand building detail panel. */
#citySideInfo #plotTitle,#citySideInfo #plotDesc,#citySideInfo #summary,#citySideInfo .cost-panel,#citySideInfo .summary,#citySideInfo #buildingActionNotice,#citySideInfo #wallDetailPanel{font-size:16px!important;line-height:1.75!important}
#citySideInfo #plotTitle{font-size:19px!important;font-weight:700!important}
#citySideInfo .building-action-row button{font-size:15px!important;min-height:36px!important;padding:7px 12px!important}
#citySideInfo #militaryFacilityPanel,#citySideInfo #militaryFacilityPanel p,#citySideInfo #militaryFacilityPanel .facility-line span small{font-size:14px!important;line-height:1.65!important}
/* V196: prevent hidden outer-city panel from leaking into the map, and give map tabs a scroll viewport. */
#outerLowerInfo[hidden],#mapLowerInfo[hidden],#cityCatalogInfo[hidden]{display:none!important}
#cityLower:has(#mapLowerInfo:not([hidden]))>.panel:first-child{height:315px!important;min-height:315px!important;max-height:315px!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
#cityLower #mapLowerInfo:not([hidden]){display:flex!important;flex-direction:column!important;flex:1 1 0%!important;height:100%!important;min-height:0!important;overflow:hidden!important}
#cityLower #mapLowerInfo .map-intel-heading,#cityLower #mapLowerInfo .map-intel-tabs{flex:0 0 auto!important}
#cityLower #mapLowerInfo .map-intel-tabs{flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important}
#cityLower #mapLowerInfo .map-intel-tabs button{flex:0 0 auto!important;white-space:nowrap!important}
#cityLower #mapLowerDetail{display:block!important;flex:1 1 0%!important;height:0!important;min-height:0!important;overflow-y:scroll!important;overflow-x:hidden!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important}
/* V195: make all four inner tabs use a real, independently scrollable viewport. */
#cityLower[data-active-city-view="inner"] #cityCatalogInfo{height:100%!important;max-height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
#cityLower[data-active-city-view="inner"] #innerInfoTabs{display:flex!important;flex:0 0 auto!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;max-width:100%!important;scrollbar-width:thin!important}
#cityLower[data-active-city-view="inner"] #innerInfoTabs button{flex:0 0 auto!important;white-space:nowrap!important}
#cityLower[data-active-city-view="inner"] #innerBuildingCatalog:not([hidden]){display:flex!important;flex-direction:column!important;flex:1 1 0%!important;height:0!important;min-height:0!important;overflow:hidden!important}
#cityLower[data-active-city-view="inner"] #innerBuildingCatalog>.catalog-tabs{flex:0 0 auto!important}
#cityLower[data-active-city-view="inner"] #innerBuildingCatalog #catalog{display:grid!important;grid-auto-rows:max-content!important;align-content:start!important;flex:1 1 0%!important;height:0!important;min-height:0!important;max-height:none!important;overflow-y:scroll!important;overflow-x:hidden!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important}
#cityLower[data-active-city-view="inner"] #innerInfoDetails:not([hidden]){display:block!important;flex:1 1 0%!important;height:0!important;min-height:0!important;max-height:none!important;overflow-y:scroll!important;overflow-x:hidden!important;overscroll-behavior:contain!important;scrollbar-gutter:stable!important}
@media(max-width:700px){#cityLower[data-active-city-view="inner"] #cityCatalogInfo{height:315px!important;max-height:315px!important}}
/* V215: same flat queue rows in inner city and map as outer city. */
#innerInfoDetails .outer-build-item,#mapLowerInfo .outer-build-item,
#innerInfoDetails .outer-info-empty,#mapLowerInfo .outer-info-empty{
 border:0!important;border-radius:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;margin:0!important;padding:11px 5px!important;
}
#innerInfoDetails .outer-build-item+.outer-build-item,#mapLowerInfo .outer-build-item+.outer-build-item,
#innerInfoDetails .outer-info-empty+.outer-build-item,#mapLowerInfo .outer-info-empty+.outer-build-item{border-top:1px solid #66502c!important}
#innerInfoDetails .outer-lower-heading,#mapLowerInfo .outer-lower-heading{border:0!important;border-bottom:1px solid #805e2a!important;background:transparent!important;box-shadow:none!important}
#innerInfoDetails .outer-info-body,#mapLowerInfo .outer-info-body{padding:0 8px 10px!important}
/* V214: construction, training, research and garrison use dividers, not cards. */
#outerLowerInfo .outer-lower-heading{display:flex!important;justify-content:flex-start!important;gap:10px!important;flex-wrap:wrap!important;border:0!important;border-bottom:1px solid #805e2a!important;padding:10px 4px!important;margin:0 0 5px!important}
#outerLowerInfo #outerBuildCount{margin-left:auto!important}
#outerLowerInfo .outer-build-item,#outerLowerInfo .outer-info-empty{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;outline:0!important;margin:0!important;padding:11px 5px!important}
#outerLowerInfo .outer-build-item+.outer-build-item,#outerLowerInfo .outer-info-empty+.outer-build-item{border-top:1px solid #66502c!important}
#outerLowerInfo #outerBuildQueue,#outerLowerInfo #outerTrainingQueue,#outerLowerInfo #outerResearchQueue,#outerLowerInfo #outerTroopSummary{padding:0 8px 10px!important}
#outerLowerInfo #instantAllBuildings[hidden],#outerLowerInfo #instantCurrency[hidden]{display:none!important}
#outerLowerInfo #instantAllBuildings{background:#8a5a17!important;color:#fff0c4!important;border:1px solid #d4a74a!important;white-space:nowrap!important}
#outerLowerInfo #instantCurrency{max-width:260px!important}
/* V227: explicit vertical spacing */
#citySideInfo #plotDesc{margin-top:14px!important;margin-bottom:22px!important}
#citySideInfo #summary{margin-top:20px!important}
#citySideInfo #summary .upgrade-cost-title{margin:0 0 16px!important;font-size:14px!important;font-weight:700}
#citySideInfo #summary .upgrade-cost-label{margin:0 0 14px!important;font-size:14px!important}
#citySideInfo #summary .upgrade-cost-grid{margin:0 0 14px!important}
/* Resource layout */
#summary .upgrade-cost-grid>div{display:flex;justify-content:space-between;gap:4px;padding:5px;border:1px solid #66502c;border-radius:5px;font-size:13px}
#summary .upgrade-cost-grid strong{font-size:13px}
#summary .upgrade-cost-title,#summary .upgrade-cost-time{font-size:13px}
#summary .upgrade-cost-time{border-top:1px solid #66502c;padding-top:7px;display:flex;justify-content:space-between}
#summary .upgrade-cost-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:8px 0}
/* V232 unified side detail typography across inner, outer and map */
#cityLayout>aside #citySideInfo,#cityLayout>aside #mapSideInfo{font-size:14px!important;line-height:1.55!important}
#cityLayout>aside #citySideInfo h2,#cityLayout>aside #mapSideInfo h2{font-size:21px!important;line-height:1.35!important}
#cityLayout>aside #citySideInfo h3,#cityLayout>aside #mapSideInfo h3,#cityLayout>aside #plotTitle{font-size:16px!important;line-height:1.45!important}
#cityLayout>aside #citySideInfo p,#cityLayout>aside #plotDesc,#cityLayout>aside #mapSideInfo p,#cityLayout>aside #mapSideDetail,#cityLayout>aside #mapLandAction,#cityLayout>aside .building-pick-hint{font-size:14px!important;line-height:1.65!important}
#cityLayout>aside #citySideInfo button,#cityLayout>aside #mapSideInfo button{font-size:14px!important;line-height:1.4!important;min-height:34px!important;padding:6px 10px!important}
#cityLayout>aside #citySideInfo #summary,#cityLayout>aside #mapSideInfo #summary{font-size:14px!important;line-height:1.55!important}
#cityLayout>aside #summary .upgrade-cost-grid>div,#cityLayout>aside #summary .upgrade-cost-grid strong,#cityLayout>aside #summary .upgrade-cost-time,#cityLayout>aside #summary .upgrade-cost-time strong{font-size:13px!important;line-height:1.4!important}
#cityLayout #costPanel{display:none!important}
.resource-img{width:18px;height:18px;object-fit:contain;vertical-align:middle;display:inline-block;flex-shrink:0}.production-resource{display:inline-flex;align-items:center;gap:3px;white-space:nowrap}#summary .upgrade-cost-grid .resource-img{width:17px;height:17px} .outer-resource-name .resource-img{width:18px;height:18px}
#currencyShop .shop-currency-row{display:flex;align-items:center;gap:12px;padding:10px 4px;border-bottom:1px solid #604b26;font-size:16px}#currencyShop .shop-currency-row img{width:32px;height:32px;object-fit:contain;flex:0 0 32px}#currencyShop .shop-currency-row span{flex:1}#currencyShop .shop-currency-row strong{font-variant-numeric:tabular-nums;color:#ffe0a0}#currencyShop{max-width:min(92vw,430px);box-sizing:border-box}
/* V242 mobile touch scrolling: page, panels and floating chat */
@media(max-width:700px){
 html{height:auto!important;overflow-y:auto!important;overscroll-behavior-y:auto!important}
 body{height:auto!important;min-height:100dvh!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-y pinch-zoom!important}
 main,#cityLayout,#cityLower,.layout,.lower{height:auto!important;max-height:none!important;overflow:visible!important;min-height:0!important}
 #cityLayout,#cityLower{display:grid!important;grid-template-columns:minmax(0,1fr)!important}
 #cityLayout>aside,#cityLower>.panel{min-width:0!important;max-width:100%!important}
 #outerStatusPanel{touch-action:pan-y!important}
 #cityLower #catalog,#cityLower #innerInfoDetails,#cityLower #outerLowerInfo,#cityLower #mapLowerInfo,#cityLower #outerInfoUpgrades,#cityLower #outerInfoTraining,#cityLower #outerInfoArmy{overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-y!important;overscroll-behavior-y:auto!important}
 .lower>.panel:last-child{position:static!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;inset:auto!important;transform:none!important;width:100%!important;min-width:0!important;max-width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;z-index:auto!important}
 .lower>.panel:last-child .chat-log{height:220px!important;min-height:120px!important;max-height:45dvh!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-y!important}
 .top-res{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-x!important}
 .nav{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-x!important}
}

/* V254: V242 base restored. One coordinated three-column desktop layout. */
#territoryBarTitle,#territoryBar #territorySelect,#territoryBar #terrainLabel,#territoryBar #occupyTerrain,#territoryBar .territory-note{display:none!important}
.account-city-rail{color:#e7d3a7;font-size:12px;display:flex;flex-direction:column;gap:6px;min-height:0;box-sizing:border-box}
.account-city-rail section{background:#17110f;border:1px solid #a87934;border-radius:7px;min-height:0;overflow:hidden}
.account-city-rail h3{margin:0;padding:8px;border-bottom:1px solid #6f512d;color:#f7d18a;font-size:13px;background:linear-gradient(#302019,#17100d)}
#railAccountStatus{padding:8px;line-height:1.8;font-size:11px}#railAccountStatus strong{color:#f4cf83}.rail-online{color:#9dd783!important}
.rail-cities{flex:1;display:flex;flex-direction:column;min-height:0}#railCityCount{font-size:11px;color:#cba96c}
#railCityList{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
#railCityList .rail-city{width:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;text-align:left;gap:0;padding:3px 8px;height:34px;min-height:0;max-height:34px;line-height:14px;box-sizing:border-box;flex-shrink:0;background:transparent;border:0;border-bottom:1px solid #4e3823;border-radius:0;color:#eed2a0;cursor:pointer;font-size:12px}
#railCityList .rail-city small{color:#ae9976;font-size:10px}#railCityList .rail-city.selected{background:#49311b;color:#ffda85;border-left:3px solid #e4a842}
@media(min-width:1001px){
 html{overflow-x:auto!important}body{min-width:1180px!important;width:100%!important;max-width:none!important;padding:0!important;margin:0!important;overflow-x:auto!important}
 body>header{width:100%!important;box-sizing:border-box!important}
 body>header .header-inner{width:min(100%,1480px)!important;max-width:1480px!important;margin:0 auto!important}
 body>.nav{width:min(100%,1480px)!important;max-width:1480px!important;margin:5px auto!important;padding:0 228px 0 12px!important;box-sizing:border-box!important}
 body>main{position:relative!important;width:min(100%,1480px)!important;max-width:1480px!important;min-width:1180px!important;margin:0 auto!important;padding:0 228px 15px 12px!important;box-sizing:border-box!important}
 #cityLayout,#cityLower{display:grid!important;grid-template-columns:minmax(0,1fr) 242px!important;gap:7px!important;width:100%!important;max-width:100%!important;min-width:0!important;align-items:start!important;height:auto!important;max-height:none!important;overflow:visible!important}
 #cityLayout>.city,#cityLayout>.outer-city{width:100%!important;max-width:100%!important;height:auto!important;aspect-ratio:1670/942!important;min-width:0!important}
 #cityLayout>aside:not(.outer-status-panel){grid-column:2!important;grid-row:1!important;min-width:0!important;height:auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;align-self:stretch!important}
 #cityLower{margin-top:7px!important}
 #cityLower>.panel:last-child{grid-column:2!important;grid-row:1!important;position:static!important;inset:auto!important;transform:none!important;width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;align-self:start!important;box-sizing:border-box!important}
 body>main>.account-city-rail{position:absolute!important;top:0!important;right:12px!important;bottom:auto!important;left:auto!important;width:208px!important;max-width:208px!important;height:calc(100% - 15px)!important;max-height:none!important;min-height:650px!important;padding:0!important;margin:0!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:hidden!important;z-index:2!important}
 #cityLower>.panel:last-child .chat-log{height:260px!important;min-height:220px!important;max-height:350px!important;overflow-y:auto!important}
}
@media(max-width:1000px){body>main>.account-city-rail{position:static!important;display:flex!important;width:auto!important;max-width:none!important;height:auto!important;min-height:0!important;max-height:none!important;margin:10px 0!important;padding:0!important;overflow:visible!important}#railCityList{max-height:260px!important;overflow-y:auto!important}}
/* V262: editing controls overlay panels instead of changing their geometry. Saved dimensions and offsets stay active after positioning. */
.panel-layout-editing [data-layout-panel]{position:relative!important;box-sizing:border-box!important}
.panel-layout-editing [data-layout-panel]>.panel-drag-handle{position:absolute!important;top:0!important;left:0!important;right:0!important;height:26px!important;line-height:20px!important;margin:0!important;z-index:1001!important;opacity:.94}
.panel-layout-editing [data-layout-panel]>.panel-resize-grip{position:absolute!important;right:0!important;bottom:0!important;float:none!important;margin:0!important;z-index:1002!important}
/* V264: one vertical scrollbar per panel, no horizontal scrolling. */
#cityLayout>aside:not(.outer-status-panel){overflow-x:hidden!important;overflow-y:auto!important;scrollbar-gutter:stable;min-width:0!important;box-sizing:border-box!important}
/* Removed legacy detail overflow:visible rule (V878) */
#cityLower>.panel:last-child{overflow-x:hidden!important;overflow-y:hidden!important;min-width:0!important;box-sizing:border-box!important}
#cityLower>.panel:last-child .chat-log{overflow-x:hidden!important;overflow-y:auto!important;min-width:0!important;overflow-wrap:anywhere!important;box-sizing:border-box!important}
#cityLower>.panel:last-child .chat-message,#cityLower>.panel:last-child .chat-message p{overflow-wrap:anywhere!important;word-break:break-word!important;max-width:100%!important}
#cityLower>.panel:last-child .chat-tabs,#cityLower>.panel:last-child .chat-input{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
.panel-layout-editing [data-layout-panel="chat"],.panel-layout-editing [data-layout-panel="account"],.panel-layout-editing [data-layout-panel="cities"]{overflow-x:hidden!important;overflow-y:hidden!important}
.panel-layout-editing [data-layout-panel="detail"]{overflow-x:hidden!important;overflow-y:auto!important}
/* V266: remove nested status-pane scrollbars; parent building details panel owns vertical scrolling. */
#cityLayout #statusBuildingDetail:not([hidden]),#cityLayout #statusCityList:not([hidden]){height:auto!important;min-height:0!important;max-height:none!important;overflow-x:visible!important;overflow-y:visible!important;scrollbar-width:none!important}
#cityLayout #statusBuildingDetail:not([hidden]) *,#cityLayout #statusCityList:not([hidden]) *{max-width:100%;box-sizing:border-box}
/* V267: remove dark level badges and keep announcements moving on hover/click. */
.city .plot .building-level,.inner-special-gate .gate-level,.outer-scene .outer-point .outer-level{background:transparent!important;background-color:transparent!important;border:0!important;outline:0!important;box-shadow:none!important;border-radius:0!important;text-shadow:0 1px 3px #000!important}
.game-ticker:hover .ticker-track,.game-ticker:active .ticker-track,.game-ticker:focus-within .ticker-track{animation-play-state:running!important}
/* V268: all generated level overlays must be transparent, including nested badges and pseudo elements. */
#city .plot .building-level,#city .plot .building-level::before,#city .plot .building-level::after,#outerScene .outer-point .outer-level,#outerScene .outer-point .outer-level::before,#outerScene .outer-point .outer-level::after,.inner-special-gate .gate-level,.inner-special-gate .gate-level::before,.inner-special-gate .gate-level::after{background:none!important;background-color:transparent!important;background-image:none!important;border:none!important;box-shadow:none!important;outline:none!important;filter:none!important;backdrop-filter:none!important}
/* V271: keep chat in its grid cell, never use legacy viewport-fixed coordinates. Remove orphan corner ornament. */
@media(min-width:1001px){body>main>#cityLower>.panel:last-child,body>main>#cityLower>.panel:last-child.chat-fixed-layout,body>main>#cityLower>.panel:last-child.chat-manual-position{position:relative!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;inset:auto!important;margin:0!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;display:flex!important;flex-direction:column!important}}
#accountCityRail::before,#accountCityRail::after,#accountCityRail .rail-cities::before,#accountCityRail .rail-cities::after,#accountCityRail .rail-account::before,#accountCityRail .rail-account::after{content:none!important;display:none!important}
/* V275: header anchors match navigation left edge and account rail right edge. */
@media(min-width:1100px){
 body>header{padding:0 12px!important}
 body>header .header-inner{width:min(100%,1480px)!important;max-width:1480px!important;height:100%!important;display:flex!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;padding:0 12px!important;box-sizing:border-box!important}
 body>header .header-logo-group{order:0!important;display:flex!important;align-items:center!important;gap:2px!important;flex:0 0 auto!important;margin:0!important}
 body>header .header-logo-group .game-logo-top-left{width:150px!important;height:42px!important;flex:0 0 150px!important;margin:0!important;transform:none!important}
 body>header .header-logo-group .faction-emblem{width:42px!important;height:42px!important;flex:0 0 42px!important;margin:0!important;transform:none!important}
 body>header .top-res{order:1!important;flex:1 1 auto!important;min-width:0!important;display:flex!important;justify-content:space-between!important;gap:5px!important;margin:0!important}
 body>header .top-res .resource{min-width:0!important;padding:6px 8px!important}
 body>header .header-actions{order:2!important;width:auto!important;flex:0 0 auto!important;display:flex!important;justify-content:flex-end!important;gap:5px!important;margin:0!important}
}
/* V276: remove unwanted gold ornamental glyphs from all game panel corners. */
.toolbar::before,.toolbar::after,.panel::before,.panel::after,aside::before,aside::after{content:none!important;display:none!important}
/* V277: move faction emblem closer to logo and remove top resource button frames. */
@media(min-width:1100px){body>header .header-logo-group{gap:0!important}body>header .header-logo-group .faction-emblem{margin-left:-18px!important;margin-right:0!important;position:relative!important;z-index:2!important}}
body>header .top-res .resource{border:0!important;border-radius:0!important;background:transparent!important;background-image:none!important;box-shadow:none!important;outline:0!important;padding:6px 4px!important}
body>header .top-res .resource:hover,body>header .top-res .resource:focus-visible{background:transparent!important;box-shadow:none!important}
/* V278: compact top resource values instead of distributing across full width. */
@media(min-width:1100px){body>header .top-res{justify-content:flex-start!important;gap:14px!important}body>header .top-res .resource{flex:0 0 auto!important;margin:0!important;white-space:nowrap!important}}
/* V261 restore original game area size: navigation through shop and all content below */
@media(min-width:1001px){
 body>.nav{width:min(100%,1480px)!important;max-width:1480px!important;padding:0 228px 0 12px!important;box-sizing:border-box!important;margin:5px auto!important}
 body>main{display:grid!important;grid-template-columns:minmax(0,1fr) 242px 208px!important;grid-template-rows:auto auto auto auto!important;column-gap:8px!important;row-gap:7px!important;width:min(100%,1480px)!important;max-width:1480px!important;min-width:1180px!important;padding:0 12px 20px!important;margin:0 auto!important;box-sizing:border-box!important}
 body>main>.toolbar{grid-column:1/3!important;grid-row:1!important;margin:0!important}
 body>main>.territory-bar{grid-column:1/3!important;grid-row:2!important;margin:0!important}
 body>main>#cityLayout{grid-column:1/3!important;grid-row:3!important;display:grid!important;grid-template-columns:minmax(0,1fr) 242px!important;width:100%!important;gap:8px!important;margin:0!important}
 body>main>#cityLower{grid-column:1/3!important;grid-row:4!important;display:grid!important;grid-template-columns:minmax(0,1fr) 242px!important;width:100%!important;gap:8px!important;margin:0!important}
 body>main>#worldMapPage{grid-column:1/3!important;grid-row:3!important}
 body>main>#accountCityRail{grid-column:3!important;grid-row:1 / 5!important;position:relative!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;width:208px!important;max-width:208px!important;height:100%!important;min-height:0!important;max-height:none!important;margin:0!important;overflow:visible!important}
 #cityLayout>.city,#cityLayout>.outer-city{width:100%!important;max-width:100%!important;min-width:0!important;height:auto!important;aspect-ratio:1670/942!important}
 /* Removed legacy panel stretch and outer scroll (V878) */
 #cityLower>.panel:last-child{width:100%!important;max-width:100%!important;min-width:0!important;height:350px!important;min-height:300px!important;max-height:none!important;align-self:start!important}
 #cityLower>.panel:last-child .chat-log{height:245px!important;max-height:none!important;overflow-y:auto!important}
}
/* V554: hide the outer document scrollbar while preserving normal page scrolling and all lower content. Internal panel scrollbars remain visible. */
@media (min-width:1001px){html{scrollbar-width:none!important;-ms-overflow-style:none!important}html::-webkit-scrollbar{display:none!important;width:0!important}body{overflow-x:clip!important}}
/* V566: instant completion sits immediately after construction heading */
#outerLowerInfo #outerBuildCount{display:none!important;margin:0!important}
#outerLowerInfo #instantAllBuildings{margin-left:8px!important;margin-right:0!important;flex:0 0 auto!important;align-self:center!important}
/* UI asset integration: non-interactive artwork only; preserve gameplay controls. */
body>main>.territory-bar{background-image:url('/images/ui/production.png')!important;background-repeat:no-repeat!important;background-position:center!important;background-size:100% 100%!important;border-color:transparent!important;box-shadow:none!important}
#cityLayout>.city,#cityLayout>.outer-city{position:relative!important;border-color:transparent!important;box-shadow:none!important}
/* City scene borders are rendered by the current frame layer. */
#cityLayout>aside:not(.outer-status-panel){background-image:none!important;background-position:center top!important;background-repeat:no-repeat!important;background-size:100% 100%!important;border-color:transparent!important;box-shadow:none!important;padding:16px!important}
/* The two supplied 130x44 buttons remain available as assets; do not assign hover/selected states without verified identification. */
/* Announcement frame belongs to outer toolbar, not just inner ticker. */
body>main>.toolbar{background:url('/images/ui/announcement-banner.png') center/100% 100% no-repeat!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:0 18px!important;min-height:40px!important}
body>main>.toolbar .game-ticker{width:100%!important;flex:1 1 auto!important;height:100%!important;min-height:40px!important;background:none!important;border:0!important;box-shadow:none!important}
/* V842 announcement: single supplied artwork, no old icon or mask. */
body>main>.toolbar,body>main>.toolbar:before,body>main>.toolbar:after{box-shadow:none!important}
body>main>.toolbar{position:relative!important;isolation:isolate!important;background:none!important;border:0!important;border-radius:0!important;overflow:hidden!important;padding:0 20px!important;min-height:40px!important;height:clamp(40px,3.58vw,50px)!important;display:flex!important;align-items:center!important}
body>main>.toolbar::before{content:''!important;display:block!important;position:absolute!important;inset:0!important;z-index:-1!important;pointer-events:none!important;background:url('/images/ui/announcement-banner.png?v=842') center/100% 100% no-repeat!important}
body>main>.toolbar::after{content:none!important;display:none!important}
body>main>.toolbar .game-ticker{background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;min-height:0!important;height:100%!important;width:100%!important;display:flex!important;align-items:center!important;overflow:hidden!important}
body>main>.toolbar .ticker-label{display:none!important}
body>main>.toolbar .ticker-viewport{mask-image:none!important;-webkit-mask-image:none!important;min-width:0!important;flex:1!important;overflow:hidden!important}
body>main>.toolbar .ticker-track{background:none!important}
@media(max-width:1000px){body>main>.toolbar{background:none!important;border:0!important;border-radius:0!important;padding:0 16px!important;min-height:40px!important;height:40px!important}body>main>.toolbar .game-ticker{background:none!important;height:100%!important;min-height:0!important}}
/* V841 mobile safety: prevent ornate frame art from overlapping live labels and city graphics. */
@media(max-width:1000px){
 body>main>.toolbar{background:#171019!important;border:1px solid #a77b35!important;border-radius:8px!important;box-shadow:none!important;padding:4px 10px!important;min-height:42px!important}
 body>main>.toolbar .game-ticker,.game-ticker{background:none!important;min-height:36px!important;height:auto!important}
 body>main>.territory-bar{background:#171019!important;background-image:none!important;border:1px solid #a77b35!important;border-radius:8px!important;padding:10px!important}
 #cityLayout>.city::after,#cityLayout>.outer-city::after{content:none!important;display:none!important}
 #cityLayout>aside:not(.outer-status-panel){background:#171019!important;background-image:none!important;border:1px solid #a77b35!important;border-radius:8px!important;padding:12px!important}
}
/* V843: original supplied PNG has baked-in white stripes at y=4 and y=34. Mask only the horizontal center, preserve ornamental ends. */
body>main>.toolbar::after{content:''!important;display:block!important;position:absolute!important;left:8.3%!important;right:2.2%!important;top:0!important;bottom:0!important;z-index:0!important;pointer-events:none!important;transform:none!important;background:linear-gradient(to bottom,#100d0d 0%,#100d0d 7%,#bb7a10 7%,#f2cb4d 11%,#a25a06 18%,#100d0d 19%,#100d0d 80%,#a25a06 81%,#f2cb4d 87%,#bb7a10 93%,#100d0d 94%)!important}
body>main>.toolbar .game-ticker{position:relative!important;z-index:1!important}
/* V842 final mobile override: supplied artwork is the only announcement frame. */
@media(max-width:1000px){body>main>.toolbar{background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:0 16px!important;height:40px!important;min-height:40px!important}body>main>.toolbar .game-ticker{background:none!important;min-height:0!important;height:100%!important}}
/* Announcement banner art, with live scrolling text preserved. */
.game-ticker{background:url('/images/ui/announcement-banner.png') center/100% 100% no-repeat!important;border:0!important;border-radius:0!important;box-shadow:none!important;min-height:40px!important}
.game-ticker .ticker-label,.game-ticker .ticker-viewport{position:relative!important;z-index:1!important}